1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="9438de6b-0df9-501d-b68b-b14d0bab8197")}catch(e){}}(); 3(globalThis.rspackChunkowl_frontend||=[]).push([["node_modules_amplitude_analytics-browser_lib_esm_index_js"],{33271(e,t,n){"use strict";let r;n.r(t),n.d(t,{AmplitudeBrowser:()=>iP,Identify:()=>ef,Revenue:()=>ey,Types:()=>T,_setDiagnosticsSampleRate:()=>i9,add:()=>iF,createInstance:()=>iI,extendSession:()=>iY,flush:()=>iq,getDeviceId:()=>iz,getIdentity:()=>iB,getOptOut:()=>iJ,getSessionId:()=>iV,getUserId:()=>iW,groupIdentify:()=>iX,identify:()=>iK,init:()=>i$,logEvent:()=>iG,remove:()=>iQ,reset:()=>iZ,revenue:()=>i0,runQueuedFunctions:()=>ej,setDeviceId:()=>i1,setGroup:()=>i2,setIdentity:()=>i3,setOptOut:()=>i4,setSessionId:()=>i5,setTransport:()=>i6,setUserId:()=>i7,track:()=>i8,trackVideo:()=>ij});var i,o,s,a,u,l,c,d,f,p,h,v,g,m,y,b,w,E,S,k,T={};n.r(T),n.d(T,{DEFAULT_ACTION_CLICK_ALLOWLIST:()=>t0,DEFAULT_CSS_SELECTOR_ALLOWLIST:()=>tQ,DEFAULT_DATA_ATTRIBUTE_PREFIX:()=>tZ,EXCLUDE_INTERNAL_REFERRERS_CONDITIONS:()=>tv,IdentifyOperation:()=>eh.e,LogLevel:()=>P.$,OfflineDisabled:()=>Z,RevenueProperty:()=>p,ServerZone:()=>iU.e,SpecialEventType:()=>eh.S});var C=n(43964),_=n(31635),A=n(2511),x=n(40225),P=n(48003),I=function(){function e(e,t){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=t}return e.prototype.fetchConfig=function(){var e=null,t={remoteConfig:null,lastFetch:new Date};try{e=localStorage.getItem(this.key)}catch(e){return this.logger.debug("Remote config localstorage failed to access: ",e),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(JSON.stringify(n))),Promise.resolve({remoteConfig:n.remoteConfig,lastFetch:new Date(n.lastFetch)})}catch(e){return this.logger.debug("Remote config localstorage failed to parse: ",e),localStorage.removeItem(this.key),Promise.resolve(t)}},e.prototype.setConfig=function(e){try{return localStorage.setItem(this.key,JSON.stringify(e)),this.logger.debug("Remote config localstorage set successfully."),Promise.resolve(!0)}catch(e){this.logger.debug("Remote config localstorage failed to set: ",e)}return Promise.resolve(!1)},e}(),O=n(65107),R=(0,_.fX)([],(0,_.zs)(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),H=function(e){var t,n=(0,O.m)();if(!(null==(t=null==n?void 0:n.crypto)?void 0:t.getRandomValues))return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,H);var r=n.crypto.getRandomValues(new Uint8Array(16));return r[6]=15&r[6]|64,r[8]=63&r[8]|128,(0,_.fX)([],(0,_.zs)(r.entries()),!1).map(function(e){var t=(0,_.zs)(e,2),n=t[0],r=t[1];return[4,6,8,10].includes(n)?"-".concat(R[r]):R[r]}).join("")},D=function(){function e(e,t,n,r,i){void 0===n&&(n="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.isLastFetchInvalidApiKey=!1,this.apiKey=e,this.serverUrl=r||("US"===n?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=t,this.storage=new I(e,t),this.customFetch=i}return e.prototype.subscribe=function(e,t,n){var r=H(),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,_.sH)(this,void 0,void 0,function(){var e,t=this;return(0,_.YH)(this,function(n){switch(n.label){case 0:if(this.lastSuccessfulFetch&&Date.now()-this.lastSuccessfulFetch<3e5)return this.logger.debug("Remote config client skipping updateConfigs: Too recent"),[2];return[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;
3return 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.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,_.sH)(this,void 0,void 0,function(){var t,n,r,i=this;return(0,_.YH)(this,function(o){switch(o.label){case 0:return t=this.getOrCreateFetchPromise().then(function(t){i.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))),i.sendCallback(e,t,"remote"),i.storage.setConfig(t)}),n=this.storage.fetchConfig().then(function(e){return e}),[4,Promise.race([t,n])];case 1:return void 0!==(r=o.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
3allback because cache is empty (first time user).")),[4,t];case 2:return o.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return(0,_.sH)(this,void 0,void 0,function(){var n,r;return(0,_.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,_.sH)(this,void 0,void 0,function(){var n,r,i,o,s,a,u=this;return(0,_.YH)(this,function(l){switch(l.label){case 0:n=t/e,r={remoteConfig:null,lastFetch:new Date},i=function(r){var i,s,a,l,c,d,f,p,h;return(0,_.YH)(this,function(v){switch(v.label){case 0:i=!0,s=new AbortController,a=setTimeout(function(){return s.abort()},t),v.label=1;case 1:var g,m;if(v.trys.push([1,10,11,12]),l=o.getUrlParams(),c={Accept:"*/*"},!o.customFetch)return[3,3];return[4,(g=o.customFetch({url:l,method:"GET",headers:c,signal:s.signal}),m=s.signal,new Promise(function(e,t){var n=function(){var e=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)})}))];case 2:return f=v.sent(),[3,5];case 3:return[4,fetch(l,{method:"GET",headers:c,signal:s.signal})];case 4:f=v.sent(),v.label=5;case 5:if((d=f).ok||d.status>=200&&d.status<300)return[3,7];return[4,d.text()];case 6:return p=v.sent(),o.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(d.status,": ").concat(p)),401===d.status||403===d.status?(o.logger.error("Remote config client fetch failed with ".concat(d.status,". Invalid API key; future fetches will be skipped.")),o.isLastFetchInvalidApiKey=!0,i=!1):d.status>=400&&d.status<500&&429!==d.status&&(i=!1),[3,9];case 7:return[4,d.json()];case 8:return[2,{value:{remoteConfig:v.sent(),lastFetch:new Date}}];case 9:return[3,12];case 10:return(h=v.sent())instanceof Error&&"AbortError"===h.name?o.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(t,"ms")):o.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),h),[3,12];case 11:return clearTimeout(a),[7];case 12:if(!i)return[2,"break"];if(!(r<e-1))return[3,14];return[4,new Promise(function(e){return setTimeout(e,u.getJitterDelay(n))})];case 13:v.sent(),v.label=14;case 14:return[2]}})},o=this,s=0,l.label=1;case 1:if(!(s<e))return[3,4];return[5,i(s)];case 2:if("object"==typeof(a=l.sent()))return[2,a.value];if("break"===a)return[3,4];l.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 t=encodeURIComponent(this.apiKey),n=new URLSearchParams;return n.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(n.toString())},e.CONFIG_GROUP="browser",e}(),L="tags",N="counters",M="histograms",j="events",U="internal",F="last_flush_timestamp",Y=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(null==(e=(0,O.m)())?void 0:e.indexedDB)!==void 0},e.prototype.getDB=function(){return(0,_.sH)(this,void 0,void 0,function(){return(0,_.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(Error("Failed to open IndexedDB"))},r.onsuccess=function(){var n=r.result;
3n.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(L)||e.createObjectStore(L,{keyPath:"key"}),e.objectStoreNames.contains(N)||e.createObjectStore(N,{keyPath:"key"}),e.objectStoreNames.contains(M)||e.createObjectStore(M,{keyPath:"key"}),e.objectStoreNames.contains(j)||e.createObjectStore(j,{keyPath:"id",autoIncrement:!0}).createIndex("time_idx","time",{unique:!1}),e.objectStoreNames.contains(U)||e.createObjectStore(U,{keyPath:"key"})},e.prototype.setTags=function(e){return(0,_.sH)(this,void 0,void 0,function(){var t,n,r,i=this;return(0,_.YH)(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),0===Object.entries(e).length)return[2];return[4,this.getDB()];case 1:return n=(t=o.sent().transaction([L],"readwrite")).objectStore(L),[2,new Promise(function(r){var o=Object.entries(e);t.oncomplete=function(){r()},t.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to set tags",e),r()},o.forEach(function(e){var t=(0,_.zs)(e,2),r=t[0],o=t[1];n.put({key:r,value:o}).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to set tag",r,o,e)}})})];case 2:return r=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",r),[3,3];case 3:return[2]}})})},e.prototype.incrementCounters=function(e){return(0,_.sH)(this,void 0,void 0,function(){var t,n,r,i=this;return(0,_.YH)(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),0===Object.entries(e).length)return[2];return[4,this.getDB()];case 1:return n=(t=o.sent().transaction([N],"readwrite")).objectStore(N),[2,new Promise(function(r){var o=Object.entries(e);t.oncomplete=function(){r()},t.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to increment counters",e),r()},o.forEach(function(e){var t=(0,_.zs)(e,2),r=t[0],o=t[1],s=n.get(r);s.onsuccess=function(){var e=s.result,t=e?e.value:0;n.put({key:r,value:t+o}).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to update counter",r,e)}},s.onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to read existing counter",r,e)}})})];case 2:return r=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",r),[3,3];case 3:return[2]}})})},e.prototype.setHistogramStats=function(e){return(0,_.sH)(this,void 0,void 0,function(){var t,n,r,i=this;return(0,_.YH)(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),0===Object.entries(e).length)return[2];return[4,this.getDB()];case 1:return n=(t=o.sent().transaction([M],"readwrite")).objectStore(M),[2,new Promise(function(r){var o=Object.entries(e);t.oncomplete=function(){r()},t.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to set histogram stats",e),r()},o.forEach(function(e){var t=(0,_.zs)(e,2),r=t[0],o=t[1],s=n.get(r);s.onsuccess=function(){var e,t=s.result;e=t?{key:r,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:r,count:o.count,min:o.min,max:o.max,sum:o.sum},n.put(e).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to set histogram stats",r,e)}},s.onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",r,e)}})})];case 2:return r=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set histogram stats",r),[3,3];case 3:return[2]}})})},e.prototype.addEventRecords=function(e){return(0,_.sH)(this,void 0,void 0,function(){var t,n,r,i=this;return(0,_.YH)(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),0===e.length)return[2];return[4,this.getDB()];case 1:return n=(t=o.sent().transaction([j],"readwrite")).objectStore(j),[2,new Promise(function(r){t.oncomplete=function(){r()},t.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to add event records",e),r()};var o=n.count();o.onsuccess=function(){var t=Math.max(0,10-o.result);t<e.length&&i.logger.debug("DiagnosticsStorage: Only added ".concat(t," of ").concat(e.length," events due to storage limit")),e.slice(0,t).forEach(function(e){n.add(e).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to add event record",e)}})},o.onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to count existing events",e)}})];case 2:return r=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to add event records",r),[3,3];case 3:return[2]}})})},e.prototype.setInternal=function(e,t){return(0,_.sH)(this,void 0,void 0,function(){var n,r,i;return(0,_.YH)(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.getDB()];case 1:return r=(n=o.sent().transaction([U],"readwrite")).objectStore(U),[2,new Promise(function(i,o){n.onabort=function(){return o(Error("Failed to set internal value"))};var s=r.put({key:e,value:t});s.onsuccess=function(){return i()},s.onerror=function(){return o(Error("Failed to set internal value"))}})];case 2:return i=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set internal value",i),[3,3];case 3:return[2]}})})},e.prototype.getInternal=function(e){return(0,_.sH)(this,void 0,void 0,function(){var t,n,r;return(0,_.YH)(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.getDB()];case 1:return n=(t=i.sent().transaction([U],"readonly")).objectStore(U),[2,new Promise(function(r,i){t.onabort=function(){return i(Error("Failed to get internal value"))};var o=n.get(e);o.onsuccess=function(){return r(o.result)},o.onerror=function(){return i(Error("Failed to get internal value"))}})];case 2:return r=i.sent(),this.logger.debug("DiagnosticsStorage: Failed to get internal value",r),[2,void 0];case 3:return[2]}})})},e.prototype.getLastFlushTimestamp=function(){return(0,_.sH)(this,void 0,void 0,function(){var e,t;return(0,_.YH)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getInternal(F)];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,_.sH)(this,void 0,void 0,function(){var t;return(0,_.YH)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.setInternal(F,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(Error("Failed to clear table ".concat(t)))}})},e.prototype.getAllAndClear=function(){return(0,_.sH)(this,void 0,void 0,function(){var e,t,n,r,i,o,s;return(0,_.YH)(this,function(a){switch(a.label){case 0:return a.trys.push([0,4,,5]),[4,this.getDB()];case 1:return e=a.sent().transaction([L,N,M,j],"readwrite"),[4,Promise.all([this.getAllFromStore(e,L),this.getAllFromStore(e,N),this.getAllFromStore(e,M),this.getAllFromStore(e,j)])];case 2:return n=(t=_.zs.apply(void 0,[a.sent(),4]))[0],r=t[1],i=t[2],o=t[3],[4,Promise.all([this.clearTable(e,N),this.clearTable(e,M),this.clearTable(e,j)])];case 3:return a.sent(),[2,{tags:n,counters:r,histogramStats:i,events:o}];case 4:return s=a.sent(),this.logger.debug("DiagnosticsStorage: Failed to get all and clear data",s),[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(Error("Failed to get all from ".concat(t)))}})},e}(),q=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)|0;return t}
3,z=function(e,t){return 31*Math.abs(q(e.toString()))%1e5/1e5<t},B=function(){var e=(0,O.m)();if(!e)return[];var t=e.__AMPLITUDE_SCRIPT_URL__;return Array.isArray(t)?t:"string"==typeof t?[t]:[]},J=function(e){var t=(0,O.m)();if(t&&"function"==typeof t.addEventListener){var n=function(t){e.recordEvent("sdk.error.uncaught",(0,_.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=V({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=W(i),s=V({filename:o,stack:i});s&&n({type:"unhandledrejection",message:null!=(t=null==r?void 0:r.message)?t:X(e.reason),stack:i,filename:o,errorName:null==r?void 0:r.name,metadata:{isTrusted:e.isTrusted,matchReason:s}})},!0)}},V=function(e){var t,n,r=B();if(0!==r.length)try{for(var i=(0,_.Ju)(r),o=i.next();!o.done;o=i.next()){var s=o.value;if(e.filename&&e.filename.includes(s))return"filename";if(e.stack&&e.stack.includes(s))return"stack"}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},W=function(e){if(e){var t=e.match(/(https?:\/\/\S+?)(?=[)\s]|$)/);return t?t[1]:void 0}},X=function(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(e){return"[object Object]"}},K=function(){function e(e,t,n,r){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,_.Cl)({enabled:!0,sampleRate:0},r),this.startTimestamp=Date.now(),this.shouldTrack=z(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,Y.isSupported()?this.storage=new Y(e,t):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&(this.increment("sdk.diagnostics.sampled.in.and.enabled"),J(this))}return e.prototype.isStorageAndTrackEnabled=function(){return!!this.storage&&!!this.shouldTrack},e.prototype.setTag=function(e,t){if(this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryTags).length>=1e4)return void this.logger.debug("DiagnosticsClient: Early return setTags as reaching memory limit");this.inMemoryTags[e]=t,this.startTimersIfNeeded()}},e.prototype.increment=function(e,t){if(void 0===t&&(t=1),this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryCounters).length>=1e4)return void 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>=1e4)return void this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");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){if(this.isStorageAndTrackEnabled()){if(this.inMemoryEvents.length>=10)return void 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})},3e5))},e.prototype.saveAllDataToStorage=function(){return(0,_.sH)(this,void 0,void 0,function(){var e,t,n,r;return(0,_.YH)(this,function(i){switch(i.label){case 0:if(!this.storage)return[2];return e=(0,_.Cl)({},this.inMemoryTags),t=(0,_.Cl)({},this.inMemoryCounters),n=(0,_.Cl)({},this.inMemoryHistograms),r=(0,_.fX)([],(0,_.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)])];case 1:return i.sent(),[2]}})})},e.prototype._flush=function(){return(0,_.sH)(this,void 0,void 0,function(){var e,t,n,r,i,o,s,a,u,l;return(0,_.YH)(this,function(c){switch(c.label){case 0:if(!this.storage)return[2];return[4,this.saveAllDataToStorage()];case 1:return c.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:if(t=(e=c.sent()).tags,n=e.counters,r=e.histogramStats,i=e.events,this.storage.setLastFlushTimestamp(Date.now()),o={},t.forEach(function(e){o[e.key]=e.value}),s={}
3,n.forEach(function(e){s[e.key]=e.value}),a={},r.forEach(function(e){a[e.key]={count:e.count,min:e.min,max:e.max,avg:Math.round(e.sum/e.count*100)/100}}),u=i.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(a).length&&0===u.length)return[2];return l={tags:o,histogram:a,counters:s,events:u},this.fetch(l),[2]}})})},e.prototype.fetch=function(e){return(0,_.sH)(this,void 0,void 0,function(){var t;return(0,_.YH)(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),!(0,O.m)())throw 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:if(!n.sent().ok)return this.logger.debug("DiagnosticsClient: Failed to send diagnostics data."),[2];return this.logger.debug("DiagnosticsClient: Successfully sent diagnostics data"),[3,3];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,_.sH)(this,void 0,void 0,function(){var e,t,n;return(0,_.YH)(this,function(r){switch(r.label){case 0:if(!this.storage)return[2];return e=Date.now(),[4,this.storage.getLastFlushTimestamp()];case 1:if(-1===(t=r.sent()||-1))return this.storage.setLastFlushTimestamp(e),this._setFlushTimer(3e5),[2];return(n=e-t)>=3e5?this._flush():this._setFlushTimer(3e5-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=z(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e}(),$=function(){var e,t=(0,O.m)();return(null==(e=null==t?void 0:t.location)?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce(function(e,t){var n=t.split("=",2),r=G(n[0]),i=G(n[1]);return i&&(e[r]=i),e},{}):{}},G=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},Q=n(66295),Z=null,ee=n(68553),et=n(41962),en=function(e,t){var n=Math.max(t,1);return e.reduce(function(e,t,r){var i=Math.floor(r/n);return e[i]||(e[i]=[]),e[i].push(t),e},[])},er=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=ee.n.Unknown),{event:e,code:t,message:n}},ei=n(1555),eo=n(93795),es=new Set([et.mJ,et.bu,et.pL,et.OP]);function ea(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var eu=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,_.sH)(this,void 0,void 0,function(){var n,r=this;return(0,_.YH)(this,function(i){switch(i.label){case 0:return this.config=e,this.storageKey="".concat(et.fS,"_").concat(this.config.apiKey.substring(0,10)),[4,null==(t=this.config.storageProvider)?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=H()),new Promise(function(n){t.queue.push({event:e,attempts:0,callback:function(e){return n(e)},timeout:0}),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&&(null===this.scheduleId||this.scheduleId&&e>this.scheduledTimeout)){this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=e,this.scheduleId=setTimeout(function(){t.queue=t.queue.map(function(e){return e.timeout=0,e}),t.flush(!0)},e);return}},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(e){return void 0===e&&(e=!1),(0,_.sH)(this,void 0,void 0,function(){var t,n,r=this;return(0,_.YH)(this,function(i){switch(i.label){case 0:if(this.config.offline)return this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2];if(this.flushId)return this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2];return this.flushId=this.scheduleId,this.resetSchedule(),t=[],n=[],this.queue.forEach(function(e){return 0===e.timeout?t.push(e):n.push(e)}),[4,en(t,this.config.flushQueueSize).reduce(function(t,n){return(0,_.sH)(r,void 0,void 0,function(){return(0,_.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 i.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}})})},e.prototype.send=function(e,t){var n;return void 0===t&&(t=!0),(0,_.sH)(this,void 0,void 0,function(){var r,i,o,s,a;return(0,_.YH)(this,function(u){var l,c,d;switch(u.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;return t.extra,(0,_.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 ei.vG,u.label=1;case 1:return u.trys.push([1,3,,4]),l=i=(0,ei.Ql)(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,void 0===(c=this.config.enableRequestBodyCompression)&&(c=!1),o=!!es.has(l)||c,[4,this.config.transportProvider.send(i,r,o)];case 2:if(null===(s=u.sent()))return this.fulfillRequest(e,0,"Unexpected error occurred"),[2];if(!t)return"body"in s?this.fulfillRequest(e,s.statusCode,"".concat(s.status,": ").concat(ea(s))
3):this.fulfillRequest(e,s.statusCode,s.status),[2];return this.handleResponse(s,e),[3,4];case 3:return a=(d=u.sent())instanceof Error?d.message:String(d),this.config.loggerProvider.error(a),null==(n=this.diagnosticsClient)||n.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:e.map(function(e){return e.event.event_type}),message:a,stack_trace:(0,C.cI)()}),this.handleResponse({status:ee.n.Failed,statusCode:0},e),[3,4];case 4:return[2]}})})},e.prototype.handleResponse=function(e,t){(0,eo.R)(e.statusCode)||null==(n=this.diagnosticsClient)||n.recordEvent("analytics.events.unsuccessful",{events:t.map(function(e){return e.event.event_type}),code:e.statusCode,status:e.status,body:ea(e),stack_trace:(0,C.cI)()});var n,r=e.status;switch(r){case ee.n.Success:this.handleSuccessResponse(e,t);break;case ee.n.Invalid:this.handleInvalidResponse(e,t);break;case ee.n.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case ee.n.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"))return void this.fulfillRequest(t,e.statusCode,e.body.error);var r=new Set((0,_.fX)((0,_.fX)((0,_.fX)((0,_.fX)([],(0,_.zs)(Object.values(e.body.eventsWithInvalidFields)),!1),(0,_.zs)(Object.values(e.body.eventsWithMissingFields)),!1),(0,_.zs)(Object.values(e.body.eventsWithInvalidIdLengths)),!1),(0,_.zs)(e.body.silencedEvents),!1).flat()),i=t.filter(function(t,i){return!r.has(i)||void n.fulfillRequest([t],e.statusCode,e.body.error)});i.length>0&&this.config.loggerProvider.warn(ea(e));var o=this.removeEventsExceedFlushMaxRetries(i);this.scheduleEvents(o)},e.prototype.handlePayloadTooLargeResponse=function(e,t){if(1===t.length)return void this.fulfillRequest(t,e.statusCode,e.body.error);this.config.loggerProvider.warn(ea(e)),this.config.flushQueueSize/=2;var n=this.removeEventsExceedFlushMaxRetries(t);this.scheduleEvents(n)},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,s=new Set(r),a=new Set(i),u=new Set(o),l=t.filter(function(t,r){return t.event.user_id&&s.has(t.event.user_id)||t.event.device_id&&a.has(t.event.device_id)?void n.fulfillRequest([t],e.statusCode,e.body.error):(u.has(r)&&(t.timeout=n.throttleTimeout),!0)});l.length>0&&this.config.loggerProvider.warn(ea(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,o;(0,eo.R)(t)?null==(o=this.diagnosticsClient)||o.increment("analytics.events.sent",e.length):(null==(r=this.diagnosticsClient)||r.increment("analytics.events.dropped",e.length),null==(i=this.diagnosticsClient)||i.recordEvent("analytics.events.dropped",{events:e.map(function(e){return e.event.event_type}),code:t,message:n,stack_trace:(0,C.cI)()})),this.removeEvents(e),e.forEach(function(e){return e.callback(er(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}(),el=function(){function e(){this.name="identity",this.type="before",this.identityStore=(0,Q.w$)().identityStore}return e.prototype.execute=function(e){return(0,_.sH)(this,void 0,void 0,function(){var t;return(0,_.YH)(this,function(n){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]})})},e.prototype.setup=function(e){return(0,_.sH)(this,void 0,void 0,function(){return(0,_.YH)(this,function(t){return e.instanceName&&(this.identityStore=(0,Q.w$)(e.instanceName).identityStore),[2]})})},e}(),ec=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var n=e[t];if(!ed(t,n))return!1}return!0},ed=function(e,t){var n,r;if("string"!=typeof e)return!1;if(Array.isArray(t)){var i=!0;try{for(var o=(0,_.Ju)(t),s=o.next();!s.done;s=o.next()){var a=s.value;if(Array.isArray(a))return!1;if("object"==typeof a)i=i&&ec(a);else if(!["number","string"].includes(typeof a))return!1;if(!i)return!1}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}else if(null==t)return!1;else if("object"==typeof t)return ec(t);else if(!["number","string","boolean"].includes(typeof t))return!1;return!0},ef=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return(0,_.Cl)({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(f.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(f.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(f.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(f.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(f.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(f.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(f.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(f.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(f.UNSET,e,et.mG),this},e.prototype.clearAll=function(){return this._properties={},this._properties[f.CLEAR_ALL]=et.mG,this}
3,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[f.CLEAR_ALL]||this._propertySet.has(t))&&(e===f.ADD?"number"==typeof n:e===f.UNSET||e===f.REMOVE||ed(t,n))},e}();(i=f||(f={})).SET="$set",i.SET_ONCE="$setOnce",i.ADD="$add",i.APPEND="$append",i.PREPEND="$prepend",i.REMOVE="$remove",i.PREINSERT="$preInsert",i.POSTINSERT="$postInsert",i.UNSET="$unset",i.CLEAR_ALL="$clearAll";var ep=[f.CLEAR_ALL,f.UNSET,f.SET,f.SET_ONCE,f.ADD,f.APPEND,f.PREPEND,f.PREINSERT,f.POSTINSERT,f.REMOVE],eh=n(97184),ev=function(e,t){return(0,_.Cl)((0,_.Cl)({},t),{event_type:eh.S.IDENTIFY,user_properties:e.getUserProperties()})},eg=function(e,t,n,r){var i;return(0,_.Cl)((0,_.Cl)({},r),{event_type:eh.S.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:((i={})[e]=t,i)})},em=function(e,t,n){var r,i=new ef;return i.set(e,t),(0,_.Cl)((0,_.Cl)({},n),{event_type:eh.S.IDENTIFY,user_properties:i.getUserProperties(),groups:((r={})[e]=t,r)})},ey=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));ec(t)&&(this.properties=t)}catch(e){}return this},e.prototype.getEventProperties=function(){var e=this.properties?(0,_.Cl)({},this.properties):{};return e[p.REVENUE_PRODUCT_ID]=this.productId,e[p.REVENUE_QUANTITY]=this.quantity,e[p.REVENUE_PRICE]=this.price,e[p.REVENUE_TYPE]=this.revenueType,e[p.REVENUE_CURRENCY]=this.currency,e[p.REVENUE]=this.revenue,e[p.RECEIPT]=this.receipt,e[p.RECEIPT_SIG]=this.receiptSig,e},e}();(o=p||(p={})).REVENUE_PRODUCT_ID="$productId",o.REVENUE_QUANTITY="$quantity",o.REVENUE_PRICE="$price",o.REVENUE_TYPE="$revenueType",o.REVENUE_CURRENCY="$currency",o.REVENUE="$revenue",o.RECEIPT="$receipt",o.RECEIPT_SIG="$receiptSig";var eb=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e},ew=n(81401),eE=n.n(ew)()||ew,eS=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,_.sH)(this,void 0,void 0,function(){var i;return(0,_.YH)(this,function(o){switch(o.label){case 0:if(void 0===e.name&&(e.name=H(),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."))),i=e.name,this.pluginStatus.has(i))return this.loggerProvider.warn("Plugin with name ".concat(i," already exists, skipping registration")),[2];return e.type=null!=(n=e.type)?n:"enrichment",this.pluginStatus.set(i,"locked"),[4,null==(r=e.setup)?void 0:r.call(e,t,this.client)];case 1:if(o.sent(),"locked"!==this.pluginStatus.get(i))return[2];return this.plugins.push(e),this.pluginStatus.set(i,"installed"),[2]}})})},e.prototype.deregister=function(e,t){var n;return(0,_.sH)(this,void 0,void 0,function(){var r,i;return(0,_.YH)(this,function(o){switch(o.label){case 0:if(this.pluginStatus.delete(e),-1===(r=this.plugins.findIndex(function(t){return t.name===e})))return t.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2];return i=this.plugins[r],this.plugins.splice(r,1),[4,null==(n=i.teardown)?void 0:n.call(i)];case 1:return o.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.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,_.sH)(this,void 0,void 0,function(){var t,n,r,i,o,s,a,u,l,c,d,f,p,h,v;return(0,_.YH)(this,function(g){switch(g.label){case 0:if(!e)return[2];t=(0,_.zs)(e,1)[0],n=(0,_.zs)(e,2)[1],this.loggerProvider.log("Timeline.apply: Initial event",t),r=this.plugins.filter(function(e){return"before"===e.type}),g.label=1;case 1:g.trys.push([1,6,7,8]),o=(i=(0,_.Ju)(r)).next(),g.label=2;case 2:if(o.done)return[3,5];if(!(s=o.value).execute)return[3,4];return[4,s.execute((0,_.Cl)({},t))];case 3:if(null===(a=g.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(s.name),"', event: ").concat(JSON.stringify(t))),n({event:t,code:0,message:""}),[2];t=a,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(s.name),"', event: ").concat(JSON.stringify(t))),g.label=4;case 4:return o=i.next(),[3,2];case 5:return[3,8];case 6:return f={error:g.sent()},[3,8];
3case 7:try{o&&!o.done&&(p=i.return)&&p.call(i)}finally{if(f)throw f.error}return[7];case 8:u=this.plugins.filter(function(e){return"enrichment"===e.type||void 0===e.type}),g.label=9;case 9:g.trys.push([9,14,15,16]),c=(l=(0,_.Ju)(u)).next(),g.label=10;case 10:if(c.done)return[3,13];if(!(s=c.value).execute)return[3,12];return[4,s.execute((0,_.Cl)({},t))];case 11:if(null===(a=g.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(s.name),"', event: ").concat(JSON.stringify(t))),n({event:t,code:0,message:""}),[2];t=a,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(s.name),"', event: ").concat(JSON.stringify(t))),g.label=12;case 12:return c=l.next(),[3,10];case 13:return[3,16];case 14:return h={error:g.sent()},[3,16];case 15:try{c&&!c.done&&(v=l.return)&&v.call(l)}finally{if(h)throw h.error}return[7];case 16:return d=this.plugins.filter(function(e){return"destination"===e.type}),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(JSON.stringify(t))),Promise.all(d.map(function(e){var n=(0,_.Cl)({},t);return e.execute(n).catch(function(e){return er(n,0,String(e))})})).then(function(e){var r=(0,_.zs)(e,1)[0]||er(t,100,"Event not tracked, no destination plugins on the instance");n(r)}),[2]}})})},e.prototype.flush=function(){return(0,_.sH)(this,void 0,void 0,function(){var e,t=this;return(0,_.YH)(this,function(n){switch(n.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map(function(e){return t.apply(e)}))];case 1:return n.sent(),[4,Promise.all(this.plugins.filter(function(e){return"destination"===e.type}).map(function(e){return e.flush&&e.flush()}))];case 2:return n.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)||n.call(t,e)})},e.prototype.onSessionIdChanged=function(e){this.plugins.forEach(function(t){var n;null==(n=t.onSessionIdChanged)||n.call(t,e)})},e.prototype.onOptOutChanged=function(e){this.plugins.forEach(function(t){var n;null==(n=t.onOptOutChanged)||n.call(t,e)}),this._callOptOutListeners(e)},e.prototype._callOptOutListeners=function(e){return(0,_.sH)(this,void 0,void 0,function(){var t,n,r,i,o,s;return(0,_.YH)(this,function(a){switch(a.label){case 0:a.trys.push([0,7,8,9]),n=(t=(0,_.Ju)(this._optOutListeners)).next(),a.label=1;case 1:if(n.done)return[3,6];r=n.value,a.label=2;case 2:return a.trys.push([2,4,,5]),[4,r(e)];case 3:return a.sent(),[3,5];case 4:return i=a.sent(),this.loggerProvider.error("Error calling optOut listener",i),[3,5];case 5:return n=t.next(),[3,1];case 6:return[3,9];case 7:return o={error:a.sent()},[3,9];case 8:try{n&&!n.done&&(s=t.return)&&s.call(t)}finally{if(o)throw o.error}return[7];case 9:return[2]}})})},e.prototype.onReset=function(){this.plugins.forEach(function(e){var t;null==(t=e.onReset)||t.call(e)})},e}(),ek=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 eS(this),this.name=e}return e.prototype._init=function(e){return(0,_.sH)(this,void 0,void 0,function(){var t=this;return(0,_.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,_.sH)(this,void 0,void 0,function(){var n,r,i,o,s,a;return(0,_.YH)(this,function(u){switch(u.label){case 0:n=this[e],this[e]=[],u.label=1;case 1:u.trys.push([1,8,9,10]),i=(r=(0,_.Ju)(n)).next(),u.label=2;case 2:if(i.done)return[3,7];if(!((o=(0,i.value)())&&"promise"in o))return[3,4];return[4,o.promise];case 3:return u.sent(),[3,6];case 4:return[4,o];case 5:u.sent(),u.label=6;case 6:return i=r.next(),[3,2];case 7:return[3,10];case 8:return s={error:u.sent()},[3,10];case 9:try{i&&!i.done&&(a=r.return)&&a.call(r)}finally{if(s)throw s.error}
3return[7];case 10:if(!this[e].length)return[3,12];return[4,this.runQueuedFunctions(e,t)];case 11:return u.sent(),[3,13];case 12:null==t||t(),u.label=13;case 13:return[2]}})})},e.prototype.track=function(e,t,n){var r=(0,_.Cl)((0,_.Cl)((0,_.Cl)({},"string"==typeof e?{event_type:e}:e),n),t&&{event_properties:t});return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),(0,A.m)(this.dispatch(r))},e.prototype.identify=function(e,t){var n=ev(e,t);return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),(0,A.m)(this.dispatch(n))},e.prototype.groupIdentify=function(e,t,n,r){var i=eg(e,t,n,r);return(0,A.m)(this.dispatch(i))},e.prototype.setGroup=function(e,t,n){var r=em(e,t,n);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),(0,A.m)(this.dispatch(r))},e.prototype.revenue=function(e,t){var n=(0,_.Cl)((0,_.Cl)({},t),{event_type:eh.S.REVENUE,event_properties:e.getEventProperties()});return(0,A.m)(this.dispatch(n))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),(0,A.m)())},e.prototype._addPlugin=function(e){return(0,A.m)(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)),(0,A.m)())},e.prototype._removePlugin=function(e){return(0,A.m)(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(er(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return(0,_.sH)(this,void 0,void 0,function(){var t=this;return(0,_.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)?t:{},r=(0,_.Cl)({},n);if(void 0===e)return r;var i={};return Object.keys(e).forEach(function(t){Object.values(eh.e).includes(t)||(i[t]=e[t])}),ep.forEach(function(t){if(Object.keys(e).includes(t)){var n=e[t];switch(t){case eh.e.CLEAR_ALL:Object.keys(r).forEach(function(e){delete r[e]});break;case eh.e.UNSET:Object.keys(n).forEach(function(e){delete r[e]});break;case eh.e.SET:Object.assign(r,n)}}}),Object.assign(r,i),r},e.prototype.process=function(e){return(0,_.sH)(this,void 0,void 0,function(){var t,n;return(0,_.YH)(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),this.config.optOut)return[2,er(e,0,"Event skipped due to optOut config")];return e.event_type===eh.S.IDENTIFY&&this.timeline.onIdentityChanged({userProperties:this.userProperties}),[4,this.timeline.push(e)];case 1:return 200===(t=r.sent()).code?this.config.loggerProvider.log(t.message):100===t.code?this.config.loggerProvider.warn(t.message):this.config.loggerProvider.error(t.message),[2,t];case 2:return n=String(r.sent()),this.config.loggerProvider.error(n),[2,t=er(e,0,n)];case 3:return[2]}})})},e.prototype.setOptOut=function(e){this.isReady?this._setOptOut(e):this.q.push(this._setOptOut.bind(this,!!e))},e.prototype._setOptOut=function(e){this.config.optOut!==e&&(this.config.optOut=!!e,this.timeline.onOptOutChanged(e))},e.prototype.flush=function(){return(0,A.m)(this.timeline.flush())},e.prototype.plugin=function(e){var t=this.timeline.plugins.find(function(t){return t.name===e});return void 0===t?void this.config.loggerProvider.debug("Cannot find plugin with name ".concat(e)):t},e.prototype.plugins=function(e){return this.timeline.plugins.filter(function(t){return t instanceof e})},e}(),eT=function(e,t){var n,r,i;return"boolean"==typeof e?e:(null==e?void 0:e[t])!==!1&&("string"!=typeof(null==(r=null==(n=null==(i=(0,O.m)())?void 0:i.chrome)?void 0:n.runtime)?void 0:r.id)||!!(null==e?void 0:e[t]))},eC=function(e){return eT(e,"attribution")},e_=function(e){return eT(e,"formInteractions")},eA=function(e){return eT(e,"pageViews")},ex=function(e){return eT(e,"sessions")},eP=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.networkTracking||"object"==typeof e.networkTracking)},eI=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},eO=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.frustrationInteractions||"object"==typeof e.frustrationInteractions)},eR=function(e){if("object"==typeof e.autocapture){var t=e.autocapture.performanceTracking;if(!0===t)return{mainThreadBlock:!0};if("object"==typeof t&&null!==t)return t}},eH=function(e){if(eI(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},eD=function(e){if(eO(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.frustrationInteractions)return e.autocapture.frustrationInteractions},eL=function(e){if(eP(e.autocapture)){var t,n,r=void 0;return"object"==typeof e.autocapture&&"object"==typeof e.autocapture.
3networkTracking?r=e.autocapture.networkTracking:e.networkTrackingOptions&&(r=e.networkTrackingOptions),(0,_.Cl)((0,_.Cl)({},r),{captureRules:(t=null==r?void 0:r.captureRules,n=e.loggerProvider,null==t?void 0:t.map(function(e){var t,r;if((null==(t=e.urls)?void 0:t.length)&&(null==(r=e.hosts)?void 0:r.length)){var i=JSON.stringify(e.hosts),o=JSON.stringify(e.urls);return null==n||n.warn("Found network capture rule with both urls='".concat(o,"' and hosts='").concat(i,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),(0,_.Cl)((0,_.Cl)({},e),{hosts:void 0})}return e}))})}},eN=function(e){var t,n=function(){return!1},r=void 0,i=e.pageCounter;return eA(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}},eM=function(e){if(e_(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&"object"==typeof e.defaultTracking.formInteractions)return e.defaultTracking.formInteractions},ej=function(e,t){eU(e,t)},eU=function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.name,o=r.args,s=r.resolve,a=e&&e[i];if("function"==typeof a){var u=a.apply(e,o);"function"==typeof s&&s(null==u?void 0:u.promise)}}return e},eF=function(e){return e&&void 0!==e._q},eY=function(){if("u"<typeof navigator)return"";var e,t,n,r,i=navigator.userLanguage;return null!=(r=null!=(n=null!=(t=null==(e=navigator.languages)?void 0:e[0])?t:navigator.language)?n:i)?r:""},eq="2.45.5",ez="amplitude-ts",eB=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(ez,"/").concat(eq),"u">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,_.sH)(this,void 0,void 0,function(){var r,i,o;return(0,_.YH)(this,function(s){return r=new Date().getTime(),i=null!=(t=this.config.lastEventId)?t:-1,o=null!=(n=e.event_id)?n:i+1,this.config.lastEventId=o,e.time||(this.config.lastEventTime=r),[2,(0,_.Cl)((0,_.Cl)((0,_.Cl)((0,_.Cl)((0,_.Cl)((0,_.Cl)((0,_.Cl)((0,_.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:eY()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:H(),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:o,library:this.library,user_agent:this.userAgent})]})})},e}(),eJ=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return(0,_.sH)(this,void 0,void 0,function(){return(0,_.YH)(this,function(e){return[2,!0]})})},e.prototype.get=function(e){return(0,_.sH)(this,void 0,void 0,function(){return(0,_.YH)(this,function(t){return[2,this.memoryStorage.get(e)]})})},e.prototype.getRaw=function(e){return(0,_.sH)(this,void 0,void 0,function(){var t;return(0,_.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,_.sH)(this,void 0,void 0,function(){return(0,_.YH)(this,function(n){return this.memoryStorage.set(e,t),[2]})})},e.prototype.remove=function(e){return(0,_.sH)(this,void 0,void 0,function(){return(0,_.YH)(this,function(t){return this.memoryStorage.delete(e),[2]})})},e.prototype.reset=function(){return(0,_.sH)(this,void 0,void 0,function(){return(0,_.YH)(this,function(e){return this.memoryStorage.clear(),[2]})})},e}(),eV=function(){var e,t=(0,O.m)();return null==(e=null==t?void 0:t.navigator)?void 0:e.locks},eW=function(){function e(e,t){void 0===t&&(t={}),this.options=(0,_.Cl)({},e),this.config=t}return e.prototype.isEnabled=function(){return(0,_.sH)(this,void 0,void 0,function(){var t,n,r,i=this;return(0,_.YH)(this,function(o){switch(o.label){case 0:return t="AMP_TEST",n=new e((0,_.Cl)({},this.options)),r=String(Date.now()),[4,n.transaction(t,function(e){var n,o;try{e.set(r);var s=e.get()===r;return!s&&i.config.diagnosticsClient&&(null==(n=i.config.diagnosticsClient)||n.recordEvent("cookies.isEnabled.failure",{reason:"Test Value mismatch",testKey:t,testValue:r,sync:!0})),s}catch(e){if(i.config.diagnosticsClient){var a=e instanceof Error?e.message:String(e);null==(o=i.config.diagnosticsClient)||o.recordEvent("cookies.isEnabled.failure",{reason:"Cookie getter/setter failed",testKey:t,testValue:r,error:a,sync:!0})}return!1}
3finally{e.set(null)}})];case 1:return[2,o.sent()]}})})},e.prototype.get=function(e){return(0,_.sH)(this,void 0,void 0,function(){var t;return(0,_.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=e$(t);if(void 0===n)return void console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(t));return JSON.parse(n)}catch(n){console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(t));return}},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,_.sH)(this,void 0,void 0,function(){var r,i,o,s,a,u,l,c;return(0,_.YH)(this,function(d){switch(d.label){case 0:r=(0,O.m)(),d.label=1;case 1:if(d.trys.push([1,4,,5]),!(i=null==r?void 0:r.cookieStore))return[3,3];return[4,i.getAll(e)];case 2:if(o=d.sent()){o.length>1&&(null==(t=this.config.diagnosticsClient)||t.recordEvent("cookies.duplicate",{cookies:o.map(function(e){return e.domain})}),null==(n=this.config.diagnosticsClient)||n.increment("cookies.duplicate.occurrence.cookieStore"));try{for(a=(s=(0,_.Ju)(o)).next();!a.done;a=s.next())if(u=a.value,eG(u.domain,this.options.domain))return[2,u.value]}catch(e){l={error:e}}finally{try{a&&!a.done&&(c=s.return)&&c.call(s)}finally{if(l)throw l.error}}}d.label=3;case 3:return[3,5];case 4:return d.sent(),[3,5];case 5:return[2,this.getRawSync(e)]}})})},e.prototype.getRawSync=function(e){var t,n,r=this,i=(0,O.m)(),o=(null!=(n=null==(t=null==i?void 0:i.document)?void 0:t.cookie.split("; "))?n:[]).filter(function(t){return 0===t.indexOf(e+"=")}),s=void 0,a=this.config.duplicateResolverFn;if("function"==typeof a&&o.length>1&&(s=o.find(function(t){var n;try{var i=a(t.substring(e.length+1));return i||null==(n=r.config.diagnosticsClient)||n.increment("cookies.duplicate.occurrence.document.cookie"),i}catch(e){return!1}})),s||(s=o[0]),s)return s.substring(e.length+1)},e.prototype.set=function(e,t){return(0,_.sH)(this,void 0,void 0,function(){return(0,_.YH)(this,function(n){return this.setSync(e,t),[2]})})},e.prototype.setSync=function(e,t){var n;try{var r=(0,O.m)();if(!r||!r.document||"function"!=typeof r.btoa||"function"!=typeof r.encodeURIComponent)return;var i=null!=(n=this.options.expirationDays)?n:0,o=null!==t?i:-1,s=void 0;if(o){var a=new Date;a.setTime(a.getTime()+24*o*36e5),s=a}var u="".concat(e,"=").concat(r.btoa(r.encodeURIComponent(JSON.stringify(t))));s&&(u+="; expires=".concat(s.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(t){var l=t instanceof Error?t.message:String(t);console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(l))}},e.prototype.remove=function(e){return(0,_.sH)(this,void 0,void 0,function(){return(0,_.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,_.sH)(this,void 0,void 0,function(){return(0,_.YH)(this,function(e){return[2]})})},e.isDomainWritable=function(t){return(0,_.sH)(this,void 0,void 0,function(){var n,r;return(0,_.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,_.sH)(this,void 0,void 0,function(){var n,r,i=this;return(0,_.YH)(this,function(o){switch(o.label){case 0:if(n=eV(),r=function(){return t({get:function(){return i.getSync(e)},set:function(t){return i.setSync(e,t)}})},!n)return[2,r()];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,n.request("com.amplitude:cookie-lock:".concat(e),r)];case 2:return[2,o.sent()];case 3:return o.sent(),[2,r()];case 4:return[2]}})})},e.cachedTlds={},e}(),eX=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},eK=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},e$=function(e){var t;return null!=(t=eX(e))?t:eK(e)},eG=function(e,t){if(""===e&&""===t)return!0;
3if(!e||!t)return!1;var n=e.startsWith(".")?e.substring(1):e,r=t.startsWith(".")?t.substring(1):t;return n.toLowerCase()===r.toLowerCase()},eQ=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),[et.r,t,e.substring(0,n)].filter(Boolean).join("_")},eZ=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return(0,_.sH)(this,void 0,void 0,function(){var t,n,r;return(0,_.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,_.sH)(this,void 0,void 0,function(){var t;return(0,_.YH)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:if(!(t=n.sent()))return[2,void 0];return[2,JSON.parse(t)];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,_.sH)(this,void 0,void 0,function(){return(0,_.YH)(this,function(n){return[2,(null==(t=this.storage)?void 0:t.getItem(e))||void 0]})})},e.prototype.set=function(e,t){var n;return(0,_.sH)(this,void 0,void 0,function(){return(0,_.YH)(this,function(r){try{null==(n=this.storage)||n.setItem(e,JSON.stringify(t))}catch(e){}return[2]})})},e.prototype.remove=function(e){var t;return(0,_.sH)(this,void 0,void 0,function(){return(0,_.YH)(this,function(n){try{null==(t=this.storage)||t.removeItem(e)}catch(e){}return[2]})})},e.prototype.reset=function(){var e;return(0,_.sH)(this,void 0,void 0,function(){return(0,_.YH)(this,function(t){try{null==(e=this.storage)||e.clear()}catch(e){}return[2]})})},e}(),e0=function(e){function t(t){var n,r,i,o=this;try{i=null==(n=(0,O.m)())?void 0:n.localStorage}catch(e){null==(r=null==t?void 0:t.loggerProvider)||r.debug("Failed to access localStorage. error=".concat(JSON.stringify(e))),i=void 0}return(o=e.call(this,i)||this).loggerProvider=null==t?void 0:t.loggerProvider,o}return(0,_.C6)(t,e),t.prototype.set=function(t,n){var r;return(0,_.sH)(this,void 0,void 0,function(){var i;return(0,_.YH)(this,function(o){switch(o.label){case 0:if(!(Array.isArray(n)&&n.length>1e3))return[3,2];return i=n.length-1e3,[4,e.prototype.set.call(this,t,n.slice(0,1e3))];case 1:return o.sent(),null==(r=this.loggerProvider)||r.error("Failed to save ".concat(i," events because the queue length exceeded ").concat(1e3,".")),[3,4];case 2:return[4,e.prototype.set.call(this,t,n)];case 3:o.sent(),o.label=4;case 4:return[2]}})})},t}(eZ),e1=function(e){function t(){var t;return e.call(this,null==(t=(0,O.m)())?void 0:t.sessionStorage)||this}return(0,_.C6)(t,e),t}(eZ);function e2(){return"u">typeof CompressionStream}function e3(e){return(0,_.sH)(this,void 0,void 0,function(){var t;return(0,_.YH)(this,function(n){switch(n.label){case 0:if(void 0===(t=CompressionStream))return[2,void 0];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,new Response(new Blob([e]).stream().pipeThrough(new t("gzip"))).arrayBuffer()];case 2:return[2,n.sent()];case 3:return n.sent(),[2,void 0];case 4:return[2]}})})}var e4=n(67395),e5=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,_.C6)(t,e),t.prototype.send=function(e,t,n){return void 0===n&&(n=!1),(0,_.sH)(this,void 0,void 0,function(){var r=this;return(0,_.YH)(this,function(i){return[2,new Promise(function(i,o){"u"<typeof XMLHttpRequest&&o(Error("XHRTransport is not supported."));var s=new XMLHttpRequest;s.open("POST",e,!0),s.onreadystatechange=function(){if(s.readyState===r.state.done){var e=s.responseText;try{i(r.buildResponse(JSON.parse(e)))}catch(e){i(r.buildResponse({code:s.status}))}}};var a={"Content-Type":"application/json",Accept:"*/*"},u=JSON.stringify(t),l=n&&u.length>=2048&&e2(),c=function(e){var t,n;a=(0,_.Cl)((0,_.Cl)({},r.customHeaders),a);try{for(var i=(0,_.Ju)(Object.entries(a)),o=i.next();!o.done;o=i.next()){var u=(0,_.zs)(o.value,2),l=u[0],c=u[1];s.setRequestHeader(l,c)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}s.send(e)};(0,_.sH)(r,void 0,void 0,function(){var e;return(0,_.YH)(this,function(t){switch(t.label){case 0:if(!l)return[3,2];return[4,e3(u)];case 1:return(e=t.sent())?(a["Content-Encoding"]="gzip",c(e)):c(u),[3,3];case 2:c(u),t.label=3;case 3:return[2]}})}).catch(o)})]})})},t}(e4.j),e6=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,_.C6)(t,e),t.prototype.send=function(e,t,n){return void 0===n&&(n=!1),(0,_.sH)(this,void 0,void 0,function(){var r,i,o,s,a,u,l,c,d;return(0,_.YH)(this,function(f){switch(f.label){case 0:if("u"<typeof fetch)throw Error("FetchTransport is not supported");if(r=JSON.stringify(t),i=n&&r.length>=2048&&e2(),o=r,s={"Content-Type":"application/json",Accept:"*/*"},!i)return[3,2];return[4,e3(r)];case 1:(a=f.sent())&&(s["Content-Encoding"]="gzip",o=a),f.label=2;case 2:return s=(0,_.Cl)((0,_.Cl)({},this.customHeaders),s),u="string"==typeof o?o.length:o.byteLength,l={headers:s,body:o,method:"POST",keepalive:this.enableKeepalive&&u<=16384},this.referrerPolicy&&(l.referrerPolicy=this.referrerPolicy),[4,fetch(e,l)];case 3:return[4,(c=f.sent()).text()];case 4:d=f.sent();try{return[2,this.buildResponse(JSON.parse(d))]}catch(e){return[2,this.buildResponse({code:c.status})]}}})})},t}(e4.j),e7=function(e){function t(){return e.call(this)||this}return(0,_.C6)(t,e),t.prototype.send=function(e,t,n){return void 0===n&&(n=!1),(0,_.sH)(this,void 0,void 0,function(){var n=this;return(0,_.YH)(this,function(r){return[2,new Promise(function(r,i){var o=(0,O.m)();if(!(null==o?void 0:o.navigator.sendBeacon))throw Error("SendBeaconTransport is not supported");try{var s=JSON.stringify(t);if(o.navigator.sendBeacon(e,s))return r(n.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:s.length,server_upload_time:Date.now()}));return r(n.buildResponse({code:500}))}catch(e){i(e)}})]})})},t}(e4.j),e8=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},e9=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},te="[Amplitude]",tt="".concat(te," Form Started"),tn="".concat(te," Form Submitted"),tr="".concat(te," File Downloaded"),ti="session_start",to="session_end",ts="".concat(te," File Extension"),ta="".concat(te," File Name"),tu="".concat(te," Link ID"),tl="".concat(te," Link Text"),tc="".concat(te," Link URL"),td="".concat(te," Form ID"),tf="".concat(te," Form Name"),tp="".concat(te," Form Destination"),th="cookie",tv={always:"always",ifEmptyCampaign:"ifEmptyCampaign"},tg=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},tm=function(e,t,n,r,i,o){void 0===i&&(i=!0),e.referrer;var s=e.referring_domain,a=(0,_.Tt)(e,["referrer","referring_domain"]),u=t||{},l=(u.referrer,u.referring_domain),c=(0,_.Tt)(u,["referrer","referring_domain"]),d=n.excludeInternalReferrers;if(d){var f=tE(d,r);if(!(f instanceof TypeError)&&e.referring_domain&&tC(e.referring_domain,o)){if
3("always"===f)return tS(f,e.referring_domain,r),!1;else if("ifEmptyCampaign"===f&&Object.values((0,_.Cl)((0,_.Cl)({},e),{referring_domain:void 0,referrer:void 0})).every(function(e){return!e}))return tS(f,e.referring_domain,r),!1}}if(ty(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(!i&&Object.values(e).every(function(e){return!e})&&t)return r.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var p=JSON.stringify(a)!==JSON.stringify(c),h=tg(s||"")!==tg(l||""),v=!t||p||h;return v?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."),v},ty=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})},tb=function(e,t){var n=t.startsWith(".")?t:".".concat(t);return!!(e.startsWith(".")?e:".".concat(e)).endsWith(n)},tw=function(e){var t=e;return t?(t.startsWith(".")&&(t=t.substring(1)),[new RegExp("".concat(t.replace(".","\\."),"$"))]):[]},tE=function(e,t){if(!0===e)return tv.always;if("object"==typeof e){var n=e.condition;if("string"==typeof n&&Object.keys(tv).includes(n))return n;if(void 0===n)return tv.always}var r="Invalid configuration provided for attribution.excludeInternalReferrers: ".concat(JSON.stringify(e));return t.error(r),TypeError(r)};function tS(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 tk=["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"],tT=function(e){var t,n,r=e||(null==(n=null==(t=(0,O.m)())?void 0:t.location)?void 0:n.hostname);if(!r)return"";var i=r.split("."),o=i[i.length-1],s=i[i.length-2];return(tk.find(function(e){return r.endsWith(".".concat(e))})&&(o=i[i.length-2]+"."+i[i.length-1],s=i[i.length-3]),s)?"".concat(s,".").concat(o):o},tC=function(e,t){var n=(0,O.m)();return!!n&&tb(e,(t||"").trim()||tT(n.location.hostname))},t_=function(e){function t(t,n,r,i,o,s,a,u,l,c,d,f,p,h,v,g,m,y,b,w,E,S,k,T,C,_,A,I,O,R,H,D,L,N,M,j,U,F,Y,q,z,B,J,V){void 0===r&&(r=new eJ),void 0===i&&(i={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),void 0===u&&(u=1e3),void 0===l&&(l=5),void 0===c&&(c=30),void 0===d&&(d=th),void 0===g&&(g=new x.V),void 0===m&&(m=P.$.Warn),void 0===b&&(b=!1),void 0===w&&(w=!1),void 0===k&&(k=""),void 0===T&&(T="US"),void 0===A&&(A=18e5),void 0===I&&(I=new e0({loggerProvider:g})),void 0===O&&(O={ipAddress:!0,language:!0,platform:!0}),void 0===R&&(R="fetch"),void 0===H&&(H=!1),void 0===D&&(D=!0),void 0===F&&(F=!0),void 0===Y&&(Y=0),void 0===J&&(J=!1);var W,X=this;(X=e.call(this,{apiKey:t,storageProvider:I,transportProvider:tP(R)})||this).apiKey=t,X.appVersion=n,X.cookieOptions=i,X.defaultTracking=o,X.autocapture=s,X.flushIntervalMillis=u,X.flushMaxRetries=l,X.flushQueueSize=c,X.identityStorage=d,X.ingestionMetadata=f,X.instanceName=p,X.loggerProvider=g,X.logLevel=m,X.minIdLength=y,X.offline=b,X.partnerId=E,X.plan=S,X.serverUrl=k,X.serverZone=T,X.sessionTimeout=A,X.storageProvider=I,X.trackingOptions=O,X.transport=R,X.useBatch=H,X.fetchRemoteConfig=D,X.networkTrackingOptions=j,X.identify=U,X.enableDiagnostics=F,X.diagnosticsSampleRate=Y,X.diagnosticsClient=q,X.remoteConfig=z,X.topLevelDomain=B,X.enableRequestBodyCompression=J,X.customEnrichment=V,X.version=eq,X._optOut=!1,X._cookieStorage=r,X.deviceId=a,X.lastEventId=h,X.lastEventTime=v,X.optOut=w,X.deferredSessionId=_,X.sessionId=C,X.pageCounter=N,X.userId=L,X.debugLogsEnabled=M,X.loggerProvider.enable(M?P.$.Debug:X.logLevel),X.networkTrackingOptions=j,X.identify=U,X.enableDiagnostics=F,X.diagnosticsSampleRate=Y,X.diagnosticsClient=q;var K=null!=(W=null==z?void 0:z.fetchRemoteConfig)?W:D;return X.remoteConfig=X.remoteConfig||{},X.remoteConfig.fetchRemoteConfig=K,X.fetchRemoteConfig=K,X.topLevelDomain=B||tT(),X}return(0,_.C6)(t,e),Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(e){this._cookieStorage!==e&&(this._cookieStorage=e,this.updateStorage())}
3,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())},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 eW&&(e.cookieDomain=this.cookieStorage.options.domain),this.cookieStorage.set(eQ(this.apiKey),e)},t}(ei.TS),tA=function(e,t,n){switch(void 0===e&&(e=th),void 0===t&&(t={}),e){case"localStorage":return new e0;case"sessionStorage":return new e1;case"none":return new eJ;default:return new eW((0,_.Cl)((0,_.Cl)({},t),{expirationDays:t.expiration}),n)}},tx=function(e){var t,n;return void 0===e&&(e={}),(null==(t=e.remoteConfig)?void 0:t.fetchRemoteConfig)===!0||(null==(n=e.remoteConfig)?void 0:n.fetchRemoteConfig)!==!1&&!1!==e.fetchRemoteConfig},tP=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 e5(n):"beacon"===t?new e7:new e6(n,r,i)},tI="data-amp-mask",tO="*****",tR=/\b(?:\d[ -]*?){13,16}\b/,tH=/(\d{3}-?\d{2}-?\d{4})/g,tD=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,tL=function(e,t){if(void 0===t&&(t=[]),"string"!=typeof e)return"";var n,r,i=e;i=(i=(i=i.replace(tR,tO)).replace(tH,tO)).replace(tD,tO);try{for(var o=(0,_.Ju)(t),s=o.next();!s.done;s=o.next()){var a=s.value;try{i=i.replace(a,tO)}catch(e){}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},tN=function(e){if("u"<typeof document||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(tI)?tO:e?e(document.title):document.title},tM=function(e){var t={};for(var n in e){var r=e[n];r&&(t[n]=r)}return t},tj=function(){function e(){}return e.prototype.parse=function(){return(0,_.sH)(this,void 0,void 0,function(){return(0,_.YH)(this,function(e){return[2,(0,_.Cl)((0,_.Cl)((0,_.Cl)((0,_.Cl)({},et.F3),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})}
3,e.prototype.getUtmParam=function(){var e=$();return{utm_campaign:e[et._9],utm_content:e[et.fL],utm_id:e[et.Cs],utm_medium:e[et.Jn],utm_source:e[et.VU],utm_term:e[et.Wx]}},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.split("/")[2])?t:void 0}catch(e){}return n},e.prototype.getClickIds=function(){var e,t=$();return(e={})[et.h2]=t[et.h2],e[et.lT]=t[et.lT],e[et.wX]=t[et.wX],e[et.q2]=t[et.q2],e[et.KY]=t[et.KY],e[et.Ct]=t[et.Ct],e[et.qr]=t[et.qr],e[et.wu]=t[et.wu],e[et.tt]=t[et.tt],e[et.Gp]=t[et.Gp],e[et.SO]=t[et.SO],e},e}(),tU="AMP_PAGE_VIEW",tF=function(e){void 0===e&&(e={});var t,n,r,i=(0,O.m)(),o=void 0,s=!1,a=e.trackOn,u=e.trackHistoryChanges,l=e.eventType,c=void 0===l?"[Amplitude] Page Viewed":l,d=function(e){var t=e;try{t=decodeURI(e)}catch(e){null==o||o.error("Malformed URI sequence: ",e)}return t},f=function(e){return(0,_.sH)(void 0,void 0,void 0,function(){var t,n,r;return(0,_.YH)(this,function(i){switch(i.label){case 0:return t=d("u">typeof location&&location.href||""),r={event_type:c},n=[{}],[4,tY()];case 1:return[2,(r.event_properties=_.Cl.apply(void 0,[_.Cl.apply(void 0,n.concat([i.sent()])),{"[Amplitude] Page Domain":"u">typeof location&&location.hostname||"","[Amplitude] Page Location":t,"[Amplitude] Page Path":"u">typeof location&&d(location.pathname)||"","[Amplitude] Page Title":tN(tL),"[Amplitude] Page URL":t.split("?")[0],"[Amplitude] Page View ID":e}]),r)]}})})},p=function(){return void 0===a||"function"==typeof a&&a()},h="u">typeof location?location.href:null,v=function(){(0,_.sH)(void 0,void 0,void 0,function(){var e,n,i,s,a;return(0,_.YH)(this,function(l){switch(l.label){case 0:if(n=tz(u,e=location.href,h||"")&&p(),h=e,!n)return[3,4];if(i=void 0,r&&(i=H(),r.set(tU,{pageViewId:i})),null==o||o.log("Tracking page view event"),null!=t)return[3,1];return[3,3];case 1:return a=(s=t).track,[4,f(i)];case 2:a.apply(s,[l.sent()]),l.label=3;case 3:l.label=4;case 4:return[2]}})})};return{name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,a){return(0,_.sH)(void 0,void 0,void 0,function(){var u,l,c;return(0,_.YH)(this,function(d){switch(d.label){case 0:if(t=a,n=e,(o=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),s=!0,i){try{r=new eZ(i.sessionStorage)}catch(e){null==o||o.debug("sessionStorage is not available in this environment.")}i.addEventListener("popstate",v),i.history.pushState=new Proxy(i.history.pushState,{apply:function(e,t,n){var r=(0,_.zs)(n,3),i=r[0],o=r[1],a=r[2];e.apply(t,[i,o,a]),s&&v()}})}if(!p())return[3,2];return o.log("Tracking page view event"),u=void 0,r&&(u=H(),r.set(tU,{pageViewId:u})),c=(l=t).track,[4,f(u)];case 1:c.apply(l,[d.sent()]),d.label=2;case 2:return[2]}})})},execute:function(e){return(0,_.sH)(void 0,void 0,void 0,function(){var t,i,s;return(0,_.YH)(this,function(u){switch(u.label){case 0:if(!("attribution"===a&&tq(e)))return[3,4];if(null==o||o.log("Enriching campaign event to page view event with campaign parameters"),t=void 0,!r)return[3,2];return[4,r.get(tU)];case 1:t=null==(i=u.sent())?void 0:i.pageViewId,u.label=2;case 2:return[4,f(t)];case 3:e.event_type=(s=u.sent()).event_type,e.event_properties=(0,_.Cl)((0,_.Cl)({},e.event_properties),s.event_properties),u.label=4;case 4:return n&&e.event_type===c&&(n.pageCounter=n.pageCounter?n.pageCounter+1:1,e.event_properties=(0,_.Cl)((0,_.Cl)({},e.event_properties),{"[Amplitude] Page Counter":n.pageCounter})),[2,e]}})})},teardown:function(){return(0,_.sH)(void 0,void 0,void 0,function(){return(0,_.YH)(this,function(e){return i&&(i.removeEventListener("popstate",v),s=!1),[2]})})}}},tY=function(){return(0,_.sH)(void 0,void 0,void 0,function(){var e;return(0,_.YH)(this,function(t){switch(t.label){case 0:return e=tM,[4,new tj().parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}})})},tq=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,n=t[eh.e.SET]||{},r=t[eh.e.UNSET]||{},i=(0,_.fX)((0,_.fX)([],(0,_.zs)(Object.keys(n)),!1),(0,_.zs)(Object.keys(r)),!1);return Object.keys(et.F3).every(function(e){return i.includes(e)})}return!1},tz=function(e,t,n){if("pathOnly"!==e)return t!==n;if(""==n)return!0;
3var r=new URL(t),i=new URL(n);return r.origin+r.pathname!==i.origin+i.pathname},tB=function(){var e,t,n=[],r=function(e,t,r){e.addEventListener(t,r),n.push({element:e,type:t,handler:r})},i=function(){n.forEach(function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)}),n=[]};return{name:"@amplitude/plugin-form-interaction-tracking-browser",type:"enrichment",setup:function(n,i){return(0,_.sH)(void 0,void 0,void 0,function(){var o,s;return(0,_.YH)(this,function(a){return t=eM(n),o=function(){if(!i)return void n.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.");if("u">typeof document){var o=new WeakSet,s=function(e){if(!o.has(e)){o.add(e);var s=!1;r(e,"change",function(){var t,n=tV(e);s||i.track(tt,((t={})[td]=tJ(e.id),t[tf]=tJ(e.name),t[tp]=n,t)),s=!0}),r(e,"submit",function(r){var o,a,u=tV(e);if(s||i.track(tt,((o={})[td]=tJ(e.id),o[tf]=tJ(e.name),o[tp]=u,o)),s=!0,(null==t?void 0:t.shouldTrackSubmit)!==void 0)if("function"==typeof t.shouldTrackSubmit&&"u">typeof SubmitEvent&&r instanceof SubmitEvent)try{if(!t.shouldTrackSubmit(r))return}catch(e){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.");i.track(tn,((a={})[td]=tJ(e.id),a[tf]=tJ(e.name),a[tp]=u,a)),s=!1})}};Array.from(document.getElementsByTagName("form")).forEach(s),"u">typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){"FORM"===e.nodeName&&s(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("form")).map(s)})})})).observe(document.body,{subtree:!0,childList:!0})}},"complete"===document.readyState?o():(s=(0,O.m)())?s.addEventListener("load",o):n.loggerProvider.debug("Form interaction tracking is not installed because global is undefined."),[2]})})},execute:function(e){return(0,_.sH)(void 0,void 0,void 0,function(){return(0,_.YH)(this,function(t){return[2,e]})})},teardown:function(){return(0,_.sH)(void 0,void 0,void 0,function(){return(0,_.YH)(this,function(t){return null==e||e.disconnect(),i(),[2]})})}}},tJ=function(e){if("string"==typeof e)return e},tV=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(null!=t?t:""),window.location.href).href}catch(e){}return t},tW=function(){var e,t=[],n=function(e,n,r){e.addEventListener(n,r),t.push({element:e,type:n,handler:r})},r=function(){t.forEach(function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)}),t=[]};return{name:"@amplitude/plugin-file-download-tracking-browser",type:"enrichment",setup:function(t,r){return(0,_.sH)(void 0,void 0,void 0,function(){var i,o;return(0,_.YH)(this,function(s){return i=function(){if(!r)return void t.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.");if("u">typeof document){var i=function(e){try{t=new URL(e.href,window.location.href)}catch(e){return}var t,i=o.exec(t.href),s=null==i?void 0:i[1];s&&n(e,"click",function(){var n;s&&r.track(tr,((n={})[ts]=s,n[ta]=t.pathname,n[tu]=e.id,n[tl]=e.text,n[tc]=e.href,n))})},o=/\.(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)(\?.+)?$/;Array.from(document.getElementsByTagName("a")).forEach(i),"u">typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){"A"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("a")).map(i)})})})).observe(document.body,{subtree:!0,childList:!0})}},"complete"===document.readyState?i():(o=(0,O.m)())?o.addEventListener("load",i):t.loggerProvider.debug("File download tracking is not installed because global is undefined."),[2]})})},execute:function(e){return(0,_.sH)(void 0,void 0,void 0,function(){return(0,_.YH)(this,function(t){return[2,e]})})},teardown:function(){return(0,_.sH)(void 0,void 0,void 0,function(){return(0,_.YH)(this,function(t){return null==e||e.disconnect(),r(),[2]})})}}},tX=!1,tK=function(e){tX||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."),tX=!0)},t$=function(){var e=(0,O.m)(),t=[],n=function(n,r){(null==e?void 0:e.addEventListener)&&(null==e||e.addEventListener(n,r),t.push({type:n,handler:r}))},r=function(){t.forEach(function(t){var n=t.type,r=t.handler;null==e||e.removeEventListener(n,r)}),t=[]};return{name:"@amplitude/plugin-network-checker-browser",type:"before",setup:function(e,t){return(0,_.sH)(void 0,void 0,void 0,function(){return(0,_.YH)(this,function(r){return"u"<typeof navigator?(e.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),e.offline=!1):(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,_.sH)(void 0,void 0,void 0,function(){return(0,_.YH)(this,function(e){return r(),[2]})})}}};function tG(e,t,n){var r,i,o=[];try{for(var s=(0,_.Ju)(null!=t?t:[]),a=s.next();!a.done;a=s.next()){var u=a.value;try{o.push(new RegExp(u))}catch(e){n.warn("Invalid regex pattern: ".concat(u),e)}}}catch(e){r={error:e}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return e.concat(o)}var tQ=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],tZ="data-amp-track-",t0=["div","span","h1","h2","h3","h4","h5","h6"],t1=n(16064),t2=n.n(t1);
3function t3(e,t){return new(t2())(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 t4(e,t){return new(t2())(function(n){var r=!1,i=new Set,o=function(){var e,t;r=!0;try{for(var n=(0,_.Ju)(i),o=n.next();!o.done;o=n.next()){var s=o.value;try{s.unsubscribe()}catch(e){}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}i.clear()},s=function(e){var t=e.subscribe({next:function(e){r||n.next(e)},error:function(e){r||(r=!0,n.error(e),o())},complete:function(){i.delete(t),r||0!==i.size||(n.complete(),o(),r=!0)}});i.add(t)};return s(e),s(t),o})}function t5(e){var t=new Set,n=null;function r(){null==n||n.unsubscribe(),n=null,t.clear()}return new(t2())(function(i){return t.add(i),null===n&&(n=e.subscribe({next:function(e){try{for(var n,r,i,o=(0,_.Ju)(t),s=o.next();!s.done;s=o.next()){var a=s.value;null==(i=a.next)||i.call(a,e)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},error:function(e){try{for(var n,i,o,s=(0,_.Ju)(t),a=s.next();!a.done;a=s.next()){var u=a.value;null==(o=u.error)||o.call(u,e)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}r()},complete:function(){try{for(var e,n,i,o=(0,_.Ju)(t),s=o.next();!s.done;s=o.next()){var a=s.value;null==(i=a.complete)||i.call(a)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}r()}})),function(){t.delete(i),0===t.size&&n&&(n.unsubscribe(),n=null)}})}var t6="https://app.amplitude.com",t7={US:t6,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"},t8="__AMPLITUDE_MESSENGER_INSTANCE__",t9="__AMPLITUDE_MESSENGER__",ne=function(){function e(e){var t=(void 0===e?{}:e).origin;this[h]=!0,this.isSetup=!1,this.messageHandler=null,this.requestCallbacks={},this.actionHandlers=new Map,this.pendingMessages=new Map,this.scriptLoadPromises=new Map,this.endpoint=void 0===t?t6:t}return e.prototype.notify=function(e){var t,n,r,i;null==(n=null==(t=this.logger)?void 0:t.debug)||n.call(t,"Message sent: ",JSON.stringify(e)),null==(i=null==(r=window.opener)?void 0:r.postMessage)||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,s){r.requestCallbacks[i]={resolve:t,reject:s},r.notify(o),n.timeout>0&&setTimeout(function(){s(Error("".concat(e," timed out (id: ").concat(i,")"))),delete r.requestCallbacks[i]},n.timeout)})},e.prototype.handleResponse=function(e){var t;if(!this.requestCallbacks[e.id]){null==(t=this.logger)||t.warn("No callback found for request id: ".concat(e.id));return}this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]},e.prototype.registerActionHandler=function(e,t){this.actionHandlers.has(e)&&(null==(o=null==(i=this.logger)?void 0:i.warn)||o.call(i,"Overwriting existing action handler for: ".concat(e))),this.actionHandlers.set(e,t);var n,r,i,o,s=this.pendingMessages.get(e);if(s){this.pendingMessages.delete(e);try{for(var a=(0,_.Ju)(s),u=a.next();!u.done;u=a.next()){var l=u.value;t(l)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}}},e.prototype.loadScriptOnce=function(e){return(0,_.sH)(this,void 0,void 0,function(){var t,n,r;return(0,_.YH)(this,function(i){switch(i.label){case 0:if(t=this.scriptLoadPromises.get(e))return[2,t];n=(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)||r.appendChild(i)}catch(e){n(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,s=i.endpoint;o&&(this.logger=o),s&&this.endpoint===t6&&(this.endpoint=s),this.isSetup||(this.isSetup=!0,null==(n=null==(t=this.logger)?void 0:t.debug)||n.call(t,"Setting up messenger"),this.messageHandler=function(e){if(null==(n=null==(t=r.logger)?void 0:t.debug)||n.call(t,"Message received: ",JSON.stringify(e)),r.endpoint===e.origin){var t,n,i,o,s,a=e.data,u=null==a?void 0:a.action;if(u)if("id"in a&&a.id)null==(o=null==(i=r.logger)?void 0:i.debug)||o.call(i,"Received Response to previous request: ",JSON.stringify(e)),r.handleResponse(a
3);else{if("ping"===u)return void r.notify({action:"pong"});var l=r.actionHandlers.get(u);if(l)l(a.data);else{var c=null!=(s=r.pendingMessages.get(u))?s:[];c.push(a.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=(0,O.m)();(null==e?void 0:e[t9])===this&&delete e[t9]},e}();h=t8;var nt="__AMPLITUDE_BACKGROUND_CAPTURE__",nn="1.28.10",nr="[Amplitude] Element Clicked",ni="[Amplitude] Element Tag",no="[Amplitude] Element Text",ns="[Amplitude] Page URL",na="[Amplitude] Viewport Height",nu="[Amplitude] Viewport Width",nl="[Amplitude] Page View ID",nc="data-amp-mask-attributes",nd=function(e,t){return!t||!t.length||t.some(function(t){return"string"==typeof t?e===t:e.match(t)})},nf=function(e,t){var n=e;try{n=decodeURI(e)}catch(e){null==t||t.error("Malformed URI sequence: ",e)}return n},np=["input","select","textarea"],nh=function(e,t){var n,r=null==(n=null==window?void 0:window.getComputedStyle)?void 0:n.call(window,e);return(null==r?void 0:r.getPropertyValue("cursor"))==="pointer"&&"click"===t},nv=function(e){var t=e.pageUrlAllowlist,n=e.pageUrlExcludelist;return!(n&&n.length>0&&nd(window.location.href,n))&&!!nd(window.location.href,t)},ng=function(e,t){return function(n,r){var i,o,s=e.shouldTrackEventResolver,a=null==(o=null==(i=null==r?void 0:r.tagName)?void 0:i.toLowerCase)?void 0:o.call(i);if(!a)return!1;if(s)return s(n,r);if(!nv(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&&!t.some(function(e){var t;return!!(null==(t=null==r?void 0:r.matches)?void 0:t.call(r,e))}))return!1;switch(a){case"input":case"select":case"textarea":return"change"===n||"click"===n;default:return"click"===n}}},nm=function(e){var t,n,r,i=null==(n=null==(t=null==e?void 0:e.tagName)?void 0:t.toLowerCase)?void 0:n.call(t),o=e instanceof HTMLElement&&(null==(r=e.getAttribute("contenteditable"))?void 0:r.toLowerCase())==="true";return!np.includes(i)&&!o},ny=function(e){return Object.keys(e).reduce(function(t,n){var r=e[n];return null!=r&&("object"!=typeof r||0!==Object.keys(r).length)&&("string"!=typeof r||0!==r.trim().length)&&(t[n]=r),t},{})},nb=function(){var e;try{var t=(0,O.m)(),n=null==(e=null==t?void 0:t.sessionStorage)?void 0:e.getItem("AMP_PAGE_VIEW");if(!n)return;var r=JSON.parse(n);if("string"==typeof r.pageViewId)return r.pageViewId}catch(e){}},nw=function(e,t){return e?t.some(function(t){var n;return null==(n=null==e?void 0:e.matches)?void 0:n.call(e,t)})?e:nw(null==e?void 0:e.parentElement,t):null},nE=function(e){return null!==e.event.target&&!!e.closestTrackedAncestor};(s=v||(v={}))[s.LEFT_OR_TOUCH_CONTACT=0]="LEFT_OR_TOUCH_CONTACT",s[s.MIDDLE=1]="MIDDLE",s[s.RIGHT=2]="RIGHT";var nS="__AMPLITUDE_VISUAL_TAGGING__",nk=(0,O.m)(),nT=null==nk?void 0:nk.console,nC={},n_={},nA=!1,nx=function(e,t){if(!nT||"function"!=typeof nT[e]||!n_[e]&&(n_[e]=nT[e],nT[e]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{if(nC[e]&&!nA){nA=!0;var r=nC[e];r&&r.forEach(function(n){try{n(e,t)}catch(e){}})}}catch(e){}return nA=!1,n_[e].apply(nT,t)},0))return Error("Console override failed");nC[e]?nC[e].push(t):nC[e]=[t]},nP=function(e){var t,n;try{for(var r=(0,_.Ju)(Object.values(nC)),i=r.next();!i.done;i=r.next())for(var o=i.value,s=o.length-1;s>=0;s--)if(o[s]===e){o.splice(s,1);break}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},nI=(0,O.m)(),nO=function(){return new(t2())(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()}})},nR=function(e){return void 0===e&&(e="click"),new(t2())(function(t){var n,r=function(e){t.next(e)};return null==(n=(0,O.m)())||n.document.addEventListener(e,r,{capture:!0}),function(){var t;null==(t=(0,O.m)())||t.document.removeEventListener(e,r,{capture:!0})}})},nH=function(){var e=t4(new(t2())(function(e){var t=function(t){if(t instanceof ErrorEvent){var n={kind:"error"};t.error instanceof Error||t.error instanceof DOMException?n=(0,_.Cl)((0,_.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 nI.addEventListener("error",t),function(){nI.removeEventListener("error",t)}}),new(t2())(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 nI.addEventListener("unhandledrejection",t),function(){nI.removeEventListener("unhandledrejection",t)}}));return t4(e,new(t2())(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 nx("error",t),function(){nP(t)}}))},nD=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(e){console.error("Error matching event to filter",e)}return!1},nL=function(e,t){try{if("DOM_ELEMENT"===e.sourceType){var n=document.documentElement;if(e.scope&&t&&(n=t.closest(e.scope)),n&&e.selector)return n.querySelector(e.selector);return n}}catch(e){}},nN=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}})},nM={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},nj=function(e){var t,n,r,i,o=Object.values(nM).reduce(function(e,t){return e[t]=new Set,e},{});if(!e)return o;try{for(var s=(0,_.Ju)(e),a=s.next();!a.done;a=s.next()){var u=a.value;try{try{for(var l=(r=void 0,(0,_.Ju)(u.definition)),c=l.next();!c.done;c=l.next()){var d=nM[c.value.event_type];d&&o[d].add(u.id)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}}catch(e){console.warn("Skipping Labeled Event due to malformed definition",null==u?void 0:u.id,e)}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return o},nU=function(e){var t,n,r,i,o=new Map;try{for(var s=(0,_.Ju)(e),a=s.next();!a.done;a=s.next()){var u=a.value;try{for(var l=(r=void 0,(0,_.Ju)(u.conditions)),c=l.next();!c.done;c=l.next()){var d=c.value;if("LABELED_EVENT"===d.type){var f=d.match.eventId,p=o.get(f);p||(p=[],o.set(f,p)),p.push(u)}}}catch(e){r={error:e}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return o},nF=function(e,t){var n,r,i,o,s=new Set;try{for(var a=(0,_.Ju)(e),u=a.next();!u.done;u=a.next()){var l=u.value,c=t.get(l.id);if(c)try{for(var d=(i=void 0,(0,_.Ju)(c)),f=d.next();!f.done;f=d.next()){var p=f.value;s.add(p)}}catch(e){i={error:e}}
3finally{try{f&&!f.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return Array.from(s)},nY=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 i=nF(Array.from(this.groupedLabeledEvents[e.type]).map(function(e){return r.labeledEvents[e]}).filter(function(t){return t.definition.some(function(t){return nM[t.event_type]===e.type&&t.filters.every(function(t){return nD(e,t)})})}),this.labeledEventToTriggerMap);try{for(var o=(0,_.Ju)(i),s=o.next();!s.done;s=o.next()){var a=s.value;nN(a.actions,e,this.dataExtractor)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}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}(),nq=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",nc,tI]),nz=["type"],nB=["svg","path","g"],nJ=["password","hidden"];function nV(e,t){var n=e.getAttribute(t.explicitTrackingAttribute);if(null!==n&&""===n)return null;var r=e.getAttribute("id");return null===r||""===r||!function(e,t){var n,r;if(null==e||""===e)return!1;try{for(var i=(0,_.Ju)(t),o=i.next();!o.done;o=i.next())if(o.value.test(e))return!1}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!0}(r,t.autogeneratedIdPatterns)?null:r}function nW(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 s=n.charCodeAt(o);if(0===s){i+="�";continue}if(s>=1&&s<=31||127===s||0===o&&s>=48&&s<=57||1===o&&s>=48&&s<=57&&45===n.charCodeAt(0)){i+="\\".concat(s.toString(16)," ");continue}if(0===o&&1===r&&45===s){i+="\\-";continue}if(s>=128||45===s||95===s||s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122){i+=n.charAt(o);continue}i+="\\".concat(n.charAt(o))}return i}function nX(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 nK=[{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=nV(e,t.config);return null===n?null:"".concat(e.tagName.toLowerCase(),"#").concat(nW(n))}}];function n$(e,t,n,r,i){var o;try{o=e.querySelectorAll(t)}catch(e){var s=e instanceof Error?e.message:String(e);return null==i||i.debug('@amplitude/element-selector: strategy "'.concat(r,'" emitted a malformed selector "').concat(t,'" (').concat(s,")")),!1}return 1===o.length&&o[0]===n}var nG=function(){function e(e,t){this.value=e,this.optimized=t}return e.prototype.toString=function(){return this.value},e}(),nQ=function(e,t){if(e.nodeType!==Node.ELEMENT_NODE)return"";for(var n=[],r=e;r;){var i=nZ(r,!!t,r===e);if(!i||(n.push(i),i.optimized))break;r=r.parentElement}return n.reverse(),n.join(" > ")},nZ=function(e,t,n){if(e.nodeType!==Node.ELEMENT_NODE)return null;var r,i,o=e.getAttribute("id");if(t){if(o)return new nG(n1(o),!0);var s=e.tagName.toLowerCase();if("body"===s||"head"===s||"html"===s)return new nG(s,!0)}var a=e.tagName.toLowerCase();if(o)return new nG(a+n1(o),!0);var u=e.parentNode;if(!u||u.nodeType===Node.DOCUMENT_NODE)return new nG(a,!0);for(var l=n0(e),c=!1,d=!1,f=-1,p=-1,h=u.children,v=0;h&&(-1===f||!d)&&v<h.length;++v){var g=h[v];if(g.nodeType===Node.ELEMENT_NODE){if(p+=1,g===e){f=p;continue}if(!d&&g.tagName.toLowerCase()===a){c=!0;var m=new Set(l);if(!m.size){d=!0;continue}for(var y=n0(g),b=0;b<y.length;++b){var w=y[b];if(m.has(w)&&(m.delete(w),!m.size)){d=!0;break}}}}}var E=a;if(n&&"input"===a.toLowerCase()&&e.getAttribute("type")&&!e.getAttribute("id")&&!e.getAttribute("class")&&(E+="[type="+nW(e.getAttribute("type")||"")+"]"),d)E+=":nth-child("+String(f+1)+")";else if(c)try{for(var S=(0,_.Ju)(l),k=S.next();!k.done;k=S.next()){var T=k.value;E+="."+nW(T.slice(1))}}catch(e){r={error:e}}finally{try{k&&!k.done&&(i=S.return)&&i.call(S)}finally{if(r)throw r.error}}return new nG(E,!1)},n0=function(e){var t=e.getAttribute("class");
3return t?t.split(/\s+/g).filter(Boolean).map(function(e){return"$"+e}):[]},n1=function(e){return"#"+nW(e)};function n2(e,t){try{return nQ(e)}catch(e){var n=e instanceof Error?e.message:String(e);return null==t||t.warn("@amplitude/element-selector: legacyCssPath threw — emitting empty selector: ".concat(n)),""}}var n3=Object.freeze({enabled:!1,explicitTrackingAttribute:"data-amp-track-id",autogeneratedIdPatterns:(0,_.fX)([],(0,_.zs)([/^:r[0-9a-z]+:$/,/^radix-/,/^headlessui-/,/^mui-/,/^[a-f0-9]{16,}$/i,/-\d{8,}$/,/\d{4,}/]),!1),unstableClassPatterns:(0,_.fX)([],(0,_.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});function n4(e,t){if(!e)return n5();var n=n5();return"boolean"==typeof e.enabled&&(n.enabled=e.enabled),"string"==typeof e.explicitTrackingAttribute&&""!==e.explicitTrackingAttribute&&(n.explicitTrackingAttribute=e.explicitTrackingAttribute),Array.isArray(e.autogeneratedIdPatterns)&&(n.autogeneratedIdPatterns=function(e,t){var n,r,i=[];try{for(var o=(0,_.Ju)(e),s=o.next();!s.done;s=o.next()){var a=s.value;try{i.push(new RegExp(a))}catch(e){var u=e instanceof Error?e.message:String(e);null==t||t.warn('@amplitude/element-selector: ignoring invalid autogenerated-id pattern "'.concat(a,'" (').concat(u,")"))}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}(e.autogeneratedIdPatterns,t)),Array.isArray(e.unstableClassPatterns)&&(n.unstableClassPatterns=function(e,t){var n,r,i=[];try{for(var o=(0,_.Ju)(e),s=o.next();!s.done;s=o.next()){var a=s.value;try{i.push(new RegExp(a))}catch(e){var u=e instanceof Error?e.message:String(e);null==t||t.warn('@amplitude/element-selector: ignoring invalid unstable-class pattern "'.concat(a,'" (').concat(u,")"))}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}(e.unstableClassPatterns,t)),n.maxAncestorWalkDepth=function(e){if("number"==typeof e&&Number.isFinite(e)&&!(e<=0))return Math.floor(e)}(e.maxAncestorWalkDepth),n}function n5(){return{enabled:n3.enabled,explicitTrackingAttribute:n3.explicitTrackingAttribute,autogeneratedIdPatterns:(0,_.fX)([],(0,_.zs)(n3.autogeneratedIdPatterns),!1),unstableClassPatterns:(0,_.fX)([],(0,_.zs)(n3.unstableClassPatterns),!1),maxAncestorWalkDepth:n3.maxAncestorWalkDepth}}var n6=function(e,t){var n,r,i,o,s,a,u,l,c,d=this;this.replaceSensitiveString=function(e){return tL(e,d.additionalMaskTextPatterns)},this.getHierarchy=function(e){var t,n,r,i,o=performance.now(),s=[];if(!e)return[];for(var a=function(e){var t=[];if(!e)return t;
3t.push(e);for(var n=e.parentElement;n&&"HTML"!==n.tagName;)t.push(n),n=n.parentElement;return t}(e),u=new Map,l=a.length-1;l>=0;l--){var c=a[l];if(c){var f,p=(f=c.getAttribute(nc))?f.split(",").map(function(e){return e.trim()}).filter(function(e){return e.length>0&&"id"!==e&&"class"!==e}):[],h=l===a.length-1?[]:null!=(r=u.get(a[l+1]))?r:new Set,v=new Set((0,_.fX)((0,_.fX)([],(0,_.zs)(h),!1),(0,_.zs)(p),!1));u.set(c,v)}}s=a.map(function(e){var t;return function(e,t){if(null===e)return null;var n,r,i,o,s,a,u=String(e.tagName).toLowerCase(),l={tag:u},c=Array.from(null!=(o=null==(i=e.parentElement)?void 0:i.children)?o:[]);c.length&&(l.index=c.indexOf(e),l.indexOfType=c.filter(function(t){return t.tagName===e.tagName}).indexOf(e));var d=null==(a=null==(s=e.previousElementSibling)?void 0:s.tagName)?void 0:a.toLowerCase();d&&(l.prevSib=String(d));var f=e.getAttribute("id");f&&(l.id=String(f));var p=Array.from(e.classList);p.length&&(l.classes=p);var h={},v=Array.from(e.attributes).filter(function(e){return!nq.has(e.name)}),g=!nm(e);if(!nJ.includes(String(e.getAttribute("type")))&&!nB.includes(u))try{for(var m=(0,_.Ju)(v),y=m.next();!y.done;y=m.next()){var b=y.value;if(!g||nz.includes(b.name)){if(t.has(b.name)){h[b.name]=tO;continue}h[b.name]=String(b.value).substring(0,128)}}}catch(e){n={error:e}}finally{try{y&&!y.done&&(r=m.return)&&r.call(m)}finally{if(n)throw n.error}}return Object.keys(h).length&&(l.attrs=h),l}(e,null!=(t=u.get(e))?t:new Set)});var g=function(e){(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach(function(t){var n=(0,_.zs)(t,2),r=n[0],i=n[1];e.attrs&&(e.attrs[r]=d.replaceSensitiveString(i))})};try{for(var m=(0,_.Ju)(s),y=m.next();!y.done;y=m.next()){var b=y.value;g(b)}}catch(e){t={error:e}}finally{try{y&&!y.done&&(n=m.return)&&n.call(m)}finally{if(t)throw t.error}}var w=performance.now();return null==(i=d.diagnosticsClient)||i.recordHistogram("autocapturePlugin.getHierarchy",w-o),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(e){t=null}return t?d.getText(t):d.getNearestLabel(n)},this.getElementPath=function(e){if(!e)return"";var t,n=performance.now(),r=d.selectorEngine.generate(e),i=performance.now();return null==(t=d.diagnosticsClient)||t.recordHistogram("autocapturePlugin.getElementPath",i-n),r},this.updateSelectorConfig=function(e,t){if(null==e||"boolean"!=typeof e.enabled){null==t||t.debug("@amplitude/element-selector: ignoring remote-config delivery without an explicit `enabled` flag — keeping current engine state.");return}var n=d.selectorEngine.getConfig().enabled,r=n4(e,t);d.selectorEngine.updateConfig(r),!n&&r.enabled?null==t||t.debug("@amplitude/element-selector: engine enabled — now emitting new element-selector element paths for autocapture events."):n&&!r.enabled&&(null==t||t.debug("@amplitude/element-selector: engine disabled — reverting to legacy cssPath for element paths."))},this.getEventProperties=function(e,t,n){var r,i,o,s,a=null==(o=null==(i=null==t?void 0:t.tagName)?void 0:i.toLowerCase)?void 0:o.call(i),u="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},l=d.getHierarchy(t),c=null==(s=l[0])?void 0:s.attrs,f=d.getNearestLabel(t),p=Object.entries(null!=c?c:{}).reduce(function(e,t){var r=(0,_.zs)(t,2),i=r[0],o=r[1];if(i.startsWith(n)){var s=i.replace(n,"");s&&(e[s]=o||"")}return e},{}),h=((r={})["[Amplitude] Element Hierarchy"]=l,r[ni]=a,r[no]=d.getText(t),r["[Amplitude] Element Position Left"]=null==u.left?null:Math.round(u.left),r["[Amplitude] Element Position Top"]=null==u.top?null:Math.round(u.top),r["[Amplitude] Element Attributes"]=p,r["[Amplitude] Element Path"]=d.getElementPath(t),r["[Amplitude] Element Parent Label"]=f,r[ns]=nf(window.location.href.split("?")[0]),r["[Amplitude] Page Title"]=tN(d.replaceSensitiveString),r[na]=window.innerHeight,r[nu]=window.innerWidth,r),v=nb();if(v&&(h[nl]=v),h["[Amplitude] Element ID"]=t.getAttribute("id")||"",h["[Amplitude] Element Class"]=t.getAttribute("class"),h["[Amplitude] Element Aria Label"]=null==c?void 0:c["aria-label"],"a"===a&&"click"===e&&t instanceof HTMLAnchorElement){var g=t.href.substring(0,128);
3h["[Amplitude] Element Href"]=d.replaceSensitiveString(g)}return ny(h)},this.addTypeAndTimestamp=function(e,t){return{event:e,timestamp:Date.now(),type:t}},this.addAdditionalEventProperties=function(e,t,n,r,i){void 0===i&&(i=!1);var o=d.addTypeAndTimestamp(e,t);if(("click"===o.type||"change"===o.type)&&null!==o.event.target){if(i&&nh(o.event.target,o.type))return o.closestTrackedAncestor=o.event.target,o.targetElementProperties=d.getEventProperties(o.type,o.closestTrackedAncestor,r),o;var s=nw(o.event.target,n);s&&(o.closestTrackedAncestor=s,o.targetElementProperties=d.getEventProperties(o.type,s,r))}return o},this.extractDataFromDataSource=function(e,t){if("DOM_ELEMENT"===e.sourceType){var n=nL(e,t);if(n){if("TEXT"===e.elementExtractType)return d.getText(n);if("ATTRIBUTE"===e.elementExtractType&&e.attribute)return n.getAttribute(e.attribute)}}},this.getTextWithMaskedDescendants=function(e){var t,n,r="[".concat(tI,"], [contenteditable]");if(!e.querySelector(r))return e.innerText;var i="",o=Array.from(e.childNodes);try{for(var s=(0,_.Ju)(o),a=s.next();!a.done;a=s.next()){var u=a.value;if(u.nodeType===Node.TEXT_NODE){i+=u.textContent||"";continue}if(u instanceof Element){if(u.hasAttribute(tI)||u.hasAttribute("contenteditable")){i+=tO;continue}i+=d.getTextWithMaskedDescendants(u)}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return i},this.getText=function(e){if(null!==e.closest("[".concat(tI,"]")))return tO;var t="";return t=e.querySelector("[".concat(tI,"], [contenteditable]"))?d.getTextWithMaskedDescendants(e):e.innerText||"",d.replaceSensitiveString(t.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=function(e){if(!e)return{};var t,n,r,i=null==(r=null==(n=null==e?void 0:e.tagName)?void 0:n.toLowerCase)?void 0:r.call(n);return ny(((t={})[ni]=i,t[no]=d.getText(e),t[ns]=window.location.href.split("?")[0],t))},this.diagnosticsClient=null==t?void 0:t.diagnosticsClient,this.selectorEngine=(g||(n=n4(),void 0===r&&(r={}),i=n,o=new Set,s=r.logger,a={strategies:r.strategies,scope:r.scope,logger:s},g={generate:function(e){var t,n;if(!i.enabled)return n2(e,s);try{var o=function(e,t,n){void 0===n&&(n={});var r,i,o,s,a,u=null!=(o=n.strategies)?o:nK,l=null!=(a=null!=(s=n.scope)?s:e.ownerDocument)?a:document,c={scope:l,config:t},d=function(e,t){for(var n=[],r=e;null!==r&&(n.push(r),void 0===t||!(n.length>t));)r=r.parentElement;return n}(e,t.maxAncestorWalkDepth);try{for(var f=(0,_.Ju)(u),p=f.next();!p.done;p=f.next())for(var h=p.value,v=0;v<d.length;v++){var g=d[v],m=h.try(g,c);if(null!==m){if(0===v){if(n$(l,m,e,h.name,n.logger))return m;continue}var y=d.slice(0,v).reverse().map(nX).join(" > "),b="".concat(m," > ").concat(y);if(n$(l,b,e,h.name,n.logger))return b}}}catch(e){r={error:e}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}return null}(e,i,a);if(null!==o)return o;return function(e,t,n){void 0===n&&(n={});for(var r,i,o=null!=(i=null!=(r=n.scope)?r:e.ownerDocument)?i:document,s=[],a=e,u=0;null!==a&&(void 0===t.maxAncestorWalkDepth||!(u>t.maxAncestorWalkDepth));){var l=nV(a,t);if(null!==l){var c="".concat(a.tagName.toLowerCase(),"#").concat(nW(l)),d=(0,_.fX)([c],(0,_.zs)(s),!1).join(" > ");if(function(e,t,n){var r;try{r=e.querySelectorAll(t)}catch(e){return!1}return 1===r.length&&r[0]===n}(o,d,e))return d}s.unshift(function(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,")")}(a)),a=a.parentElement,u+=1}return s.join(" > ")}(e,i,{scope:null!=(n=null!=(t=r.scope)?t:e.ownerDocument)?n:document})}catch(t){var u=t instanceof Error?t.message:String(t);return null==s||s.warn("@amplitude/element-selector: strategy chain threw — falling back to legacy cssPath: ".concat(u)),n2(e,s)}},getConfig:function(){return i},updateConfig:function(e){var t,n;i=e;try{for(var r=(0,_.Ju)(o),a=r.next();!a.done;a=r.next()){var u=a.value;try{u(e)}catch(e){var l=e instanceof Error?e.message:String(e);null==s||s.warn("@amplitude/element-selector: onConfigChange subscriber threw — ".concat(l))}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},onConfigChange:function(e){return o.add(e),function(){o.delete(e)}}}),g);var f=null!=(c=e.maskTextRegex)?c:[],p=[];try{for(var h=(0,_.Ju)(f),v=h.next();!v.done;v=h.next()){var m=v.value;if(p.length>=25)break;if(m instanceof RegExp)p.push(m);else if("pattern"in m&&"string"==typeof m.pattern)try{p.push(RegExp(m.pattern,"i"))}catch(e){}}}catch(e){u={error:e}}finally{try{v&&!v.done&&(l=h.return)&&l.call(h)}finally{if(u)throw u.error}}this.additionalMaskTextPatterns=p};function n7(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)}}}(a=m||(m={})).ClickObservable="clickObservable",a.ChangeObservable="changeObservable",a.NavigateObservable="navigateObservable",a.MutationObservable="mutationObservable",a.ScrollObservable="scrollObservable",a.ExposureObservable="exposureObservable",a.BrowserErrorObservable="browserErrorObservable",a.SelectionObservable="selectionObservable",a.MouseMoveObservable="mouseMoveObservable";var n8=function(e,t){void 0===e&&(e={}),null==t||t.diagnosticsClient.setTag("plugin.autocapture.version",nn);var n,r,i,o,s,a,u,l,c,d,f,p,h,v=e.dataAttributePrefix,g=void 0===v?tZ:v,y=e.visualTaggingOptions,b=void 0===y?{enabled:!0}:y;e.cssSelectorAllowlist=null!=(n=e.cssSelectorAllowlist)?n:tQ,e.actionClickAllowlist=null!=(r=e.actionClickAllowlist)?r:t0,e.debounceTime=null!=(i=e.debounceTime)?i:0;var w=(null==(o=e.viewportContentUpdated)?void 0:o.enabled)!==!1,E=null!=(u=null!=(a=null==(s=e.viewportContentUpdated)?void 0:s.exposureDuration)?a:e.exposureDuration)?u:150;e.viewportContentUpdated=(0,_.Cl)((0,_.Cl)({},e.viewportContentUpdated),{exposureDuration:E}),e.pageUrlExcludelist=null==(l=e.pageUrlExcludelist)?void 0:l.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(e){console.warn("Invalid regex pattern: ".concat(t.pattern),e)}return e},[]);var S="@amplitude/plugin-autocapture-browser",k=[],T=new n6(e,t),C=new Set,A=new Set,x=function(){var t,n,r,i=t5(nR().map(function(t){return T.addAdditionalEventProperties(t,"click",e.cssSelectorAllowlist,g)})),o=t5(new(t2())(function(t){var n,r=function(n){var r=T.addAdditionalEventProperties(n,"change",e.cssSelectorAllowlist,g);t.next(r)};return null==(n=(0,O.m)())||n.document.addEventListener("change",r,{capture:!0}),function(){var e;return null==(e=(0,O.m)())?void 0:e.document.removeEventListener("change",r)}}));window.navigation&&(r=t5(new(t2())(function(t){var n=function(n){var r=T.addAdditionalEventProperties(n,"navigate",e.cssSelectorAllowlist,g);t.next(r)};return window.navigation.addEventListener("navigate",n),function(){window.navigation.removeEventListener("navigate",n)}})));var s=t5(nO().map(function(t){return T.addAdditionalEventProperties(t,"mutation",e.cssSelectorAllowlist,g)})),a=new(t2())(function(e){var t,n=function(t){e.next(t)};return null==(t=(0,O.m)())||t.addEventListener("scroll",n),function(){var e;null==(e=(0,O.m)())||e.removeEventListener("scroll",n)}}),u=(t=e.cssSelectorAllowlist,new(t2())(function(e){var n,r=(0,O.m)();if(!(null==r?void 0:r.IntersectionObserver))return function(){};var i=new IntersectionObserver(function(t){t.forEach(function(t){e.next(t)})},{root:null,rootMargin:"0px",threshold:1}),o=t.join(",");
3(null!=(n=null==r?void 0:r.document.querySelectorAll(o))?n:[]).forEach(function(e){i.observe(e)});var a=s.subscribe(function(e){return e.event.forEach(function(e){return e.addedNodes.forEach(function(e){e instanceof Element&&(e.matches(o)&&i.observe(e),e.querySelectorAll(o).forEach(function(e){i.observe(e)}))})})});return function(){a.unsubscribe(),i.disconnect()}}));return(n={})[m.ChangeObservable]=o,n[m.ClickObservable]=i,n[m.MutationObservable]=s,n[m.NavigateObservable]=r,n[m.ScrollObservable]=a,n[m.ExposureObservable]=u,n},P=nj(Object.values(null!=(d=null==(c=e.pageActions)?void 0:c.labeledEvents)?d:{})),I=nU(null!=(p=null==(f=e.pageActions)?void 0:f.triggers)?p:[]),R=new nY(P,I,T,e),H=function(t){var n,r;t&&(e.pageActions=(0,_.Cl)((0,_.Cl)({},e.pageActions),t),P=nj(Object.values(null!=(n=e.pageActions.labeledEvents)?n:{})),I=nU(null!=(r=e.pageActions.triggers)?r:[]),R.update(P,I,e))};return{name:S,type:"enrichment",setup:function(t,n){return(0,_.sH)(void 0,void 0,void 0,function(){var r,i,o,s,a,u,l,c,d,f,p,v,y,P,I,D,L,N,M,j,U,F;return(0,_.YH)(this,function(Y){if("u"<typeof document)return[2];if(r=!1,i={maxX:void 0,maxY:void 0},t.fetchRemoteConfig&&(t.remoteConfigClient?t.remoteConfigClient.subscribe("configs.analyticsSDK.pageActions","all",function(e){H(e)}):t.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),(o=n7(t,T))&&k.push({unsubscribe:o}),s=ng(e,e.cssSelectorAllowlist),a=ng(e,e.actionClickAllowlist),z=(q={allObservables:u=x(),amplitude:n,shouldTrackEvent:s,evaluateTriggers:R.evaluate.bind(R)}).amplitude,B=q.allObservables,J=q.shouldTrackEvent,V=q.evaluateTriggers,l=B.clickObservable.filter(nE).filter(function(e){return J("click",e.closestTrackedAncestor)}).map(function(e){return V(e)}).subscribe(function(e){null==z||z.track(nr,e.targetElementProperties)}),k.push(l),X=(W={allObservables:u,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return T.getEventProperties.apply(T,(0,_.fX)((0,_.fX)([],(0,_.zs)(e),!1),[g],!1))},amplitude:n,shouldTrackEvent:s,evaluateTriggers:R.evaluate.bind(R)}).amplitude,K=W.allObservables,$=W.getEventProperties,G=W.shouldTrackEvent,Q=W.evaluateTriggers,c=K.changeObservable.filter(nE).filter(function(e){return G("change",e.closestTrackedAncestor)}).map(function(e){return Q(e)}).subscribe(function(e){null==X||X.track("[Amplitude] Element Changed",$("change",e.closestTrackedAncestor))}),k.push(c),ee=(Z={allObservables:u,options:e,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return T.getEventProperties.apply(T,(0,_.fX)((0,_.fX)([],(0,_.zs)(e),!1),[g],!1))},amplitude:n,shouldTrackEvent:s,shouldTrackActionClick:a}).amplitude,et=Z.allObservables,en=Z.options,er=Z.getEventProperties,ei=Z.shouldTrackEvent,eo=Z.shouldTrackActionClick,es=et.clickObservable,ea=et.mutationObservable,eu=et.navigateObservable,el=es.filter(function(e){return!ei("click",e.closestTrackedAncestor)}).map(function(e){var t=nw(e.event.target,en.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=er(e.type,e.closestTrackedAncestor)),e}).filter(nE).filter(function(e){return eo("click",e.closestTrackedAncestor)}),ec=eu?t4(ea,eu):ea,ed=t4(el,ec),ef=null,ep=null,(d=t3(ed,function(e){if(ef&&(clearTimeout(ef),ef=null),"click"===e.type)ep=e,ef=setTimeout(function(){ef=null,ep=null},500);else if(ep){var t=ep;return ep=null,Promise.resolve(t)}return Promise.resolve(null)}).subscribe(function(e){e&&(null==ee||ee.track(nr,er("click",e.closestTrackedAncestor)))}))&&k.push(d),(eh={allObservables:u,amplitude:n}).amplitude,ev=eh.allObservables.scrollObservable,eg={maxX:0,maxY:0},em=ev.subscribe(function(){var e,t,n,r,i=(0,O.m)(),o=Math.floor(null!=(t=null!=(e=null==i?void 0:i.scrollX)?e:null==i?void 0:i.pageXOffset)?t:0),s=Math.floor(null!=(r=null!=(n=null==i?void 0:i.scrollY)?n:null==i?void 0:i.pageYOffset)?r:0);eg.maxX=Math.max(eg.maxX,o),eg.maxY=Math.max(eg.maxY,s)}),f={unsubscribe:function(){em.unsubscribe()},getState:function(){return eg},reset:function(){eg.maxX=0,eg.maxY=0}},k.push(f),p={},v=(0,O.m)(),y=function(e){e&&r||(setTimeout(function(){r=!1},100),r=!0,function(e){var t,n,r,i,o,s,a=e.amplitude,u=e.scrollTracker,l=e.currentElementExposed,c=e.elementExposedForPage,d=e.exposureTracker,f=e.isPageEnd,p=e.lastScroll,h=u.getState(),v=(0,O.m)(),g=null!=(n=null==v?void 0:v.innerWidth)?n:0,m=null!=(r=null==v?void 0:v.innerHe
3ight)?r:0,y=((t={})[ns]=nf(null!=(s=null==(o=null==(i=null==v?void 0:v.location)?void 0:i.href)?void 0:o.split("?")[0])?s:""),t["[Amplitude] Max Page X"]=h.maxX+g,t["[Amplitude] Max Page Y"]=h.maxY+m,t[na]=m,t[nu]=g,t["[Amplitude] Element Exposed"]=Array.from(l),t),b=nb();if(b&&(y[nl]=b),0===l.size&&h.maxX===p.maxX&&h.maxY===p.maxY){f&&(u.reset(),c.clear(),null==d||d.reset());return}null==a||a.track("[Amplitude] Viewport Content Updated",y),p.maxX=h.maxX,p.maxY=h.maxY,l.clear(),f&&(u.reset(),c.clear(),null==d||d.reset())}({amplitude:n,scrollTracker:f,currentElementExposed:A,elementExposedForPage:C,exposureTracker:p.exposure,isPageEnd:e,lastScroll:i}))},P=function(e){!C.has(e)&&(C.add(e),A.add(e),JSON.stringify(Array.from(A)).length>=18e3&&y(!1))},w&&(eb=(ey={allObservables:u,onExposure:P,dataExtractor:T,exposureDuration:E}).allObservables,ew=ey.onExposure,eE=ey.dataExtractor,ek=void 0===(eS=ey.exposureDuration)?150:eS,eT=new Map,eC=new Map,e_=eb.exposureObservable.subscribe(function(e){var t=e.target;if(e.isIntersecting){if(!eT.get(t)){var n=setTimeout(function(){eT.set(t,!0),ew(eE.getElementPath(t)),eC.set(t,null)},ek);eC.set(t,n)}}else if(!e.isIntersecting&&e.intersectionRatio<1){var n=eC.get(t);n&&(clearTimeout(n),eC.set(t,null))}}),p.exposure={unsubscribe:function(){e_.unsubscribe()},reset:function(){eC.forEach(function(e){e&&clearTimeout(e)}),eC.clear(),eT.clear()}},p.exposure&&k.push(p.exposure),I=function(){y(!0)},null==v||v.addEventListener("beforeunload",I),h=function(){null==v||v.removeEventListener("beforeunload",I)},k.push({unsubscribe:function(){return h()}}),(D=u[m.NavigateObservable])?k.push(D.subscribe(function(){y(!0)})):v&&(L=function(){y(!0)},v.addEventListener("popstate",L),N=v.history.pushState,v.history&&N&&(v.history.pushState=new Proxy(N,{apply:function(e,t,n){var r=(0,_.zs)(n,3),i=r[0],o=r[1],s=r[2];e.apply(t,[i,o,s]),y(!0)}})),k.push({unsubscribe:function(){v.removeEventListener("popstate",L),v.history&&N&&(v.history.pushState=N)}}))),null==(F=null==t?void 0:t.loggerProvider)||F.log("".concat(S," has been successfully added.")),window.opener&&b.enabled){var q,z,B,J,V,W,X,K,$,G,Q,Z,ee,et,en,er,ei,eo,es,ea,eu,el,ec,ed,ef,ep,eh,ev,eg,em,ey,eb,ew,eE,eS,ek,eT,eC,e_;if(M=e.cssSelectorAllowlist,j=e.actionClickAllowlist,function(e,t){if(!0!==e[nS]){e[nS]=!0;var n=t.dataExtractor,r=t.isElementSelectable,i=t.cssSelectorAllowlist,o=t.actionClickAllowlist,s=null,a=function(t){e.notify({action:"element-selected",data:t})},u=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 l;s=null==(l=null==window?void 0:window.amplitudeVisualTaggingSelector)?void 0:l.call(window,{getEventTagProps:n.getEventTagProps,isElementSelectable:function(e){return!r||r((null==t?void 0:t.actionType)||"click",e)},onTrack:u,onSelect:a,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:e,cssSelectorAllowlist:i,actionClickAllowlist:o,extractDataFromDataSource:n.extractDataFromDataSource,dataExtractor:n,diagnostics:{autocapture:{version:nn}}}),e.notify({action:"selector-loaded"})}).catch(function(){var t;null==(t=e.logger)||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)||e.call(s)})}}(U=function(){var e=(0,O.m)(),t=null==e?void 0:e[t9];if("object"==typeof t&&null!==t&&t8 in t&&!0===t[t8])return t;var n=new ne(void 0);return e&&(e[t9]=n),n}(),{dataExtractor:T,isElementSelectable:ng(e,(0,_.fX)((0,_.fX)([],(0,_.zs)(M),!1),(0,_.zs)(j),!1)),cssSelectorAllowlist:M,actionClickAllowlist:j}),!0!==U[nt]){U[nt]=!0;var eA="https://cdn.amplitude.com/libs/background-capture-1.0.3.js.gz",ex=null,eP=function(e,t){var n,r;"background-capture-complete"===e&&(null==(r=null==(n=U.logger)?void 0:n.debug)||r.call(n,"Backgroun
3d capture complete"),U.notify({action:"background-capture-complete",data:t}))};U.registerActionHandler("initialize-background-capture",function(){null==(t=null==(e=U.logger)?void 0:e.debug)||t.call(e,"Initializing background capture (external script)");var e,t,n=new URL(eA,U.endpoint).toString();U.loadScriptOnce(n).then(function(){var e,t,n;null==(t=null==(e=U.logger)?void 0:e.debug)||t.call(e,"Background capture script loaded (external)"),ex=null==(n=null==window?void 0:window.amplitudeBackgroundCapture)?void 0:n.call(window,{messenger:U,onBackgroundCapture:eP}),U.notify({action:"background-capture-loaded"})}).catch(function(){var e;null==(e=U.logger)||e.warn("Failed to initialize background capture")})}),U.registerActionHandler("close-background-capture",function(){var e;null==(e=null==ex?void 0:ex.close)||e.call(ex),ex=null})}U.setup((0,_.Cl)({logger:null==t?void 0:t.loggerProvider},(null==t?void 0:t.serverZone)&&{endpoint:t7[t.serverZone]}))}return[2]})})},execute:function(e){return(0,_.sH)(void 0,void 0,void 0,function(){return(0,_.YH)(this,function(t){return[2,e]})})},teardown:function(){return(0,_.sH)(void 0,void 0,void 0,function(){var e,t,n,r;return(0,_.YH)(this,function(i){try{for(t=(e=(0,_.Ju)(k)).next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(r=e.return)&&r.call(e)}finally{if(n)throw n.error}}return[2]})})}}},n9=(0,_.fX)(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],(0,_.zs)(["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]']),!1),re=["*"],rt=["mutation","navigate"];function rn(e,t){var n,r,i,o,s=t.event,a=s.pageX,u=s.pageY;e.yMin=Math.min(null!=(n=e.yMin)?n:u,u),e.yMax=Math.max(null!=(r=e.yMax)?r:u,u),e.xMin=Math.min(null!=(i=e.xMin)?i:a,a),e.xMax=Math.max(null!=(o=e.xMax)?o:a,a),e.isOutOfBounds=e.yMax-e.yMin>50||e.xMax-e.xMin>50}function rr(e){if(0===e.length)return null;var t=e[0],n=e[e.length-1];return{rageClickEvent:(0,_.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}}(u=y||(y={})).INCREASING="increasing",u.DECREASING="decreasing",(l=b||(b={})).X="x",l.Y="y";var ri=function(e){var t=e.allWindowObservables.mouseMoveObservable;return new(t2())(function(e){var n=null,r=null,i=null;return t.subscribe(function(t){var o={x:t.clientX,y:t.clientY};if(null===n){n=o;return}o.x>n.x?(r===y.DECREASING&&e.next(b.X),r=y.INCREASING):o.x<n.x&&(r===y.INCREASING&&e.next(b.X),r=y.DECREASING),o.y>n.y?(i===y.DECREASING&&e.next(b.Y),i=y.INCREASING):o.y<n.y&&(i===y.INCREASING&&e.next(b.Y),i=y.DECREASING),n=o})})};function ro(e){var t=e.changes,n=e.changesThreshold,r=e.thresholdMs;return!(t.length<n)&&t[t.length-1]-t[0]<r}function rs(e){e.changes=[],e.startTime=void 0}function ra(e){for(var t=e.changes,n=e.thresholdMs,r=0,i=t[t.length-1];r<t.length&&!(i-t[r]<n);r++);0!==r&&(e.startTime=t[r],e.changes.splice(0,r))}var ru=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(t2())(function(e){var n={changes:[],changesThreshold:r,thresholdMs:o},i={changes:[],changesThreshold:r,thresholdMs:o},s=void 0,a=null;function u(){void 0!==s&&(e.next(s),s=void 0,null!==a&&clearTimeout(a),rs(n),rs(i))}return t.subscribe(function(e){null!==a&&clearTimeout(a),t=e===b.X?n:i,r=+Date.now(),t.startTime=t.startTime||r,l=t.changes,c=t.changesThreshold,l.push(r),l.length>c&&l.shift();var t,r,l,c,d=function(e,t){var n=void 0;if(ro(e)&&(n=e.startTime),ro(t)){var r=t.startTime;r&&(!n||r<n)&&(n=r)}return n}(n,i);return d?(s=s||d,a=setTimeout(function(){u(),a=null},o)):u(),ra(n),ra(i),function(){null!==a&&(clearTimeout(a),a=null)}})})},rl=function(e){var t=e.amplitude,n=e.options,r=e.allObservables,i=e.directionChanges,o=e.thresholdMs;return ru({mouseDirectionChangeObservable:ri({allWindowObservables:r}),directionChanges:void 0===i?20:i,thresholdMs:void 0===o?2e3:o}).subscribe(function(e){nv(n)&&t.track("[Amplitude] Thrashed Cursor",void 0,{time:e})})};function rc(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 rd=function(e){void 0===e&&(e={});var t,n="@amplitude/plugin-frustration-browser",r=[],i=!1!==e.errorClicks;e.errorClicks||(i=!1);var o=!1!==e.deadClicks&&null!==e.deadClicks,s=!1!==e.rageClicks&&null!==e.rageClicks,a=!1!==e.thrashedCursor&&null!==e.thrashedCursor;e.thrashedCursor||(a=!1);var u=rc(e,"rageClicks",re,s),l=rc(e,"deadClicks",n9,o),c=rc(e,"errorClicks",n9,i),d=null!=(t=e.dataAttributePrefix)?t:tZ,f=new n6(e),p=(0,_.fX)([],(0,_.zs)(new Set((0,_.fX)((0,_.fX)((0,_.fX)([],(0,_.zs)(u),!1),(0,_.zs)(l),!1),(0,_.zs)(c),!1))),!1),h=function(){var e,t,n=t5(nR("pointerdown").map(function(e){return f.addAdditionalEventProperties(e,"click",p,d,!0)})),r=t5(nH().map(function(e){return f.addTypeAndTimestamp(e,"error")})),i=t5(nO().map(function(e){return f.addAdditionalEventProperties(e,"mutation",p,d)}));window.navigation&&(t=t5(new(t2())(function(e){var t=function(t){e.next((0,_.Cl)((0,_.Cl)({},t),{type:"navigate"}))};return window.navigation.addEventListener("navigate",t),function(){window.navigation.removeEventListener("navigate",t)}}).map(function(e){return f.addAdditionalEventProperties(e,"navigate",p,d)})));var o=t5(new(t2())(function(e){var t=function(){var t=document.activeElement;if(t&&("TEXTAREA"===t.tagName||"INPUT"===t.tagName)){var n=void 0,r=void 0;try{if(n=t.selectionStart,r=t.selectionEnd,n===r)return}catch(e){return}return e.next()}var i=window.getSelection();if(i&&!i.isCollapsed)return e.next()};return window.document.addEventListener("selectionchange",t),function(){window.document.removeEventListener("selectionchange",t)}})),s=t5(new(t2())(function(e){var t=function(t){e.next(t)},n={capture:!0};return nI.document.addEventListener("mousemove",t,n),function(){nI.document.removeEventListener("mousemove",t,n)}}));return(e={})[m.ClickObservable]=n,e[m.MutationObservable]=i,e[m.NavigateObservable]=t,e[m.BrowserErrorObservable]=r,e[m.SelectionObservable]=o,e[m.MouseMoveObservable]=s,e};return{name:n,type:"enrichment",setup:function(t,p){return(0,_.sH)(void 0,void 0,void 0,function(){var g,m,y,b,w,E,S,k,T;return(0,_.YH)(this,function(C){var A,x,P,I,O,R,H,D,L,N,M,j,U,F,Y,q,z,B,J,V,W,X;return"u"<typeof document?[2]:(g=h(),(m=n7(t,f))&&r.push({unsubscribe:m}),s&&(y=function(e){var t=this,n=e.amplitude,r=e.allObservables,i=e.shouldTrackRageClick,o=r.clickObservable,s=r.selectionObservable,a=[],u={},l=null;function c(e){a=[],u={},e&&(rn(u,e),a.push(e))}var d=t3(o.filter(function(e){return i("click",e.closestTrackedAncestor)}),function(e){return(0,_.sH)(t,void 0,void 0,function(){var t;return(0,_.YH)(this,function(n){var r,i,o,s;return(rn(u,e),t=null,0===a.length||(r=a).length>0&&r[r.length-1].closestTrackedAncestor!==e.closestTrackedAncestor||(o=Math.max(0,(i=a).length-4+1),s=i[o],e.timestamp-s.timestamp>=1e3)||u.isOutOfBounds)?(l&&(t=rr(a)),c(e)):a.push(e),(l&&(clearTimeout(l.timerId),l.resolve(t),l=null),a.length>=4)?[2,new Promise(function(e){l={resolve:e,timerId:setTimeout(function(){e(rr(a))},1e3)}})]:[2,null]})})}),f=null==s?void 0:s.subscribe(function(){c()}),p=d.subscribe(function(e){null!==e&&n.track("[Amplitude] Rage Click",e.rageClickEvent,{time:e.time})});return{unsubscribe:function(){p.unsubscribe(),null==f||f.unsubscribe()}}}({allObservables:g,amplitude:p,shouldTrackRageClick:ng(e,u)}),r.push(y)),o&&(x=(A={amplitude:p,allObservables:g,getEventProperties:function(e,t){return f.getEventProperties(e,t,d)},shouldTrackDeadClick:ng(e,l)}).amplitude,P=A.allObservables,I=A.getEventProperties,O=A.shouldTrackDeadClick,R=P.clickObservable,H=P.mutationObservable,D=P.navigateObservable,L=R.filter(function(e){return nE(e)&&O("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===v.LEFT_OR_TOUCH_CONTACT}),N=D?t4(H,D):H,M=t4(L,N),j=null,b=t3(M,function(e){if(j&&rt.includes(e.type))clearTimeout(j),j=null;else if("click"===e.type)return j?Promise.resolve(null):new Promise(function(t){j=setTimeout(function(){t(e),j=null},3e3)});return Promise.resolve(null)}).subscribe(function(e){if(e){var t={"[Amplitude] X":e.event.clientX,"[Amplitude] Y":e.event.clientY};x.track("[Amplitude] Dead Click",(0,_.Cl)((0,_.Cl)({},I("click",e.closestTrackedAncestor)),t),{time:e.timestamp})}}),r.push(b)),i&&(F=(U={amplitude:p,allObservables:g,shouldTrackErrorClick:ng(e,c)}).amplitude,Y=U.allObservables,q=U.shouldTrackErrorClick,z=Y.clickObservable,B=Y.browserErrorObservable,J=z.filter(function(e){return nE(e)&&q("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===v.LEFT_OR_TOUCH_CONTACT}),V=null,W=null,X=function(){null!==V&&(clearTimeout(V),V=null),W=null},w=t4(J,B).subscribe(function(e){var t;if("click"===e.type){X(),W=e,V=setTimeout(X,2e3);return}"error"===e.type&&W&&(F.track("[Amplitude] Error Click",(0,_.Cl)(((t={})["[Amplitude] Kind"]=e.event.kind,t["[Amplitude] Message"]=e.event.message,t["[Amplitude] Stack"]=e.event.stack,t["[Amplitude] Filename"]=e.event.filename,t["[Amplitude] Line Number"]=e.event.lineNumber,t["[Amplitude] Column Number"]=e.event.columnNumber,t),W.targetElementProperties)),X())}),r.push(w)),a&&(E=void 0,S=void 0,"object"==typeof e.thrashedCursor&&(E=e.thrashedCursor.directionChanges,S=e.thrashedCursor.threshold,E&&E<5&&(t.loggerProvider.warn("'thrashedCursor.directionChanges' of ".concat(E," is below the minimum of ").concat(5,", setting to ").concat(5)),E=5),S&&S>4e3&&(t.loggerProvider.warn("'thrashedCursor.threshold' of ".concat(S," is above the maximum of ").concat(4e3,", setting to ").concat(4e3)),S=4e3)),k=rl({amplitude:p,options:e,allObservables:g,directionChanges:E,thresholdMs:S}),r.push(k)),null==(T=null==t?void 0:t.loggerProvider)||T.log("".concat(n," has been successfully added.")),[2])})})},execute:function(e){return(0,_.sH)(void 0,void 0,void 0,function(){return(0,_.YH)(this,function(t){return[2,e]})})},teardown:function(){return(0,_.sH)(void 0,void 0,void 0,function(){var e,t,n,i;return(0,_.YH)(this,function(o){try{for(t=(e=(0,_.Ju)(r)).next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(i=e.return)&&i.call(e)}finally{if(n)throw n.error}}return[2]})})}}};function rf(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})}var rp=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(i,o){return(0,_.sH)(void 0,void 0,void 0,function(){var s,a,u;return(0,_.YH)(this,function(l){return"u"<typeof document||(r&&(s=100,"object"==typeof e.mainThreadBlock&&void 0!==e.mainThreadBlock.durationThreshold&&(s=e.mainThreadBlock.durationThreshold),a=function(e){var t=e.amplitude,n=e.options,r=e.durationThreshold,i=void 0===r?100:r,o=function(){if("u"<typeof PerformanceObserver)return null;try{var e=PerformanceObserver.supportedEntryTypes;if(e.includes("long-animation-frame"))return"long-animation-frame";if(e.includes("longtask"))return"longtask"}catch(e){}return null}();if(!o)return{unsubscribe:function(){}};var s=[],a=new PerformanceObserver(function(e){var t,n,r=performance.now();try{for(var i=(0,_.Ju)(e.getEntries()),o=i.next();!o.done;o=i.next()){var a=o.value;s.push(a)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}for(var u=r-1e4;s.length>0&&s[0].startTime<u;)s.shift()});try{a.observe({entryTypes:["measure"]})}catch(e){}var u=new PerformanceObserver(function(e){var r,a;try{for(var u=(0,_.Ju)(e.getEntries()),l=u.next();!l.done;l=u.next()){var c=l.value;if(!nv(n))return;if(!(c.duration<i)){var d="long-animation-frame"===o?function(e,t){var n,r=rf(e,t),i=null!=(n=e.scripts)?n:[],o=i.map(function(e){return e.sourceURL}
3).filter(Boolean),s=i.map(function(e){return e.sourceFunctionName}).filter(Boolean),a=i.map(function(e){return e.sourceCharPosition}).filter(function(e){return"number"==typeof e&&e>=0}),u=i.map(function(e){return e.invokerType}).filter(Boolean),l=i.map(function(e){return e.invoker}).filter(Boolean);return(0,_.Cl)((0,_.Cl)((0,_.Cl)((0,_.Cl)((0,_.Cl)((0,_.Cl)((0,_.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":i.length}),o.length>0&&{"[Amplitude] Main Thread Block Script URLs":o}),s.length>0&&{"[Amplitude] Main Thread Block Script Functions":s}),a.length>0&&{"[Amplitude] Main Thread Block Script Positions":a}),u.length>0&&{"[Amplitude] Main Thread Block Invoker Types":u}),l.length>0&&{"[Amplitude] Main Thread Block Invokers":l})}(c,s):function(e,t){var n,r=rf(e,t),i=null!=(n=e.attribution)?n:[];return(0,_.Cl)((0,_.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}),i.length>0&&{"[Amplitude] Main Thread Block Attribution":i.map(function(e){return e.name})})}(c,s);t.track("[Amplitude] Main Thread Block",d)}}}catch(e){r={error:e}}finally{try{l&&!l.done&&(a=u.return)&&a.call(u)}finally{if(r)throw r.error}}});try{u.observe({entryTypes:[o]})}catch(e){return a.disconnect(),{unsubscribe:function(){}}}return{unsubscribe:function(){u.disconnect(),a.disconnect()}}}({amplitude:o,options:e,durationThreshold:s}),n.push(a)),null==(u=null==i?void 0:i.loggerProvider)||u.log("".concat(t," performance tracking has been successfully added."))),[2]})})},execute:function(e){return(0,_.sH)(void 0,void 0,void 0,function(){return(0,_.YH)(this,function(t){return[2,e]})})},teardown:function(){return(0,_.sH)(void 0,void 0,void 0,function(){var e,t,r,i;return(0,_.YH)(this,function(o){try{for(t=(e=(0,_.Ju)(n)).next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){r={error:e}}finally{try{t&&!t.done&&(i=e.return)&&i.call(e)}finally{if(r)throw r.error}}return[2]})})}}};function rh(e,t,n){e&&function e(t){var n,r,i=t.json,o=t.targetObject,s=t.allowlist,a=t.excludelist,u=t.ancestors,l=t.parentObject,c=t.targetKey;o||(o=i);var d=Object.keys(o);try{for(var f=(0,_.Ju)(d),p=f.next();!p.done;p=f.next()){var h,v=p.value,g=(0,_.fX)((0,_.fX)([],(0,_.zs)(u),!1),[v],!1);(h=o[v],"string"==typeof h||"number"==typeof h||"boolean"==typeof h||null==h)?(!rg(g,s)||rg(g,a))&&delete o[v]:e({json:i,targetObject:o[v],allowlist:s,excludelist:a,ancestors:g,parentObject:o,targetKey:v})}}catch(e){n={error:e}}finally{try{p&&!p.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}0===Object.keys(o).length&&l&&c&&delete l[c]}({json:e,allowlist:t.map(rv),excludelist:n.map(rv),ancestors:[]})}function rv(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map(function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")})}function rg(e,t){return t.some(function(t){return function e(t,n,r,i){if(void 0===r&&(r=0),void 0===i&&(i=0),i===n.length)return r===t.length;if(r===t.length){for(;i<n.length&&"**"===n[i];)i++;return i===n.length}var o=n[i];if("**"===o){if(i+1===n.length)return!0;for(var s=r;s<=t.length;s++)if(e(t,n,s,i+1))return!0;return!1}return("*"===o||o===t[r])&&e(t,n,r+1,i+1)}(e,t)})}var rm=function(){function e(e){this.request=e}return e.prototype.headers=function(e){void 0===e&&(e=[]);var t,n,r=this.request.headers,i={};if(Array.isArray(r))r.forEach(function(e){var t=(0,_.zs)(e,2),n=t[0],r=t[1];i[n]=r});else if(r instanceof Headers)r.forEach(function(e,t){i[t]=e});else if("object"==typeof r&&null!==r)try{for(var o=(0,_.Ju)(Object.entries(r)),s=o.next();!s.done;s=o.next()){var a=(0,_.zs)(s.value,2),u=a[0],l=a[1];i[u]=l}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return rT(i,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if("number"==typeof this._bodySize)return this._bodySize;var e=(0,O.m)();if(null==e?void 0:e.TextEncoder){var t=this.request.body;return this._bodySize=rb(t,100),this._bodySize}}
3,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,_.sH)(this,void 0,void 0,function(){return(0,_.YH)(this,function(n){return 0===e.length?[2,null]:[2,rS(this.body,e,t)]})})},e}(),ry=function(){function e(e,t){this.bodyRaw=e,this.requestHeaders=t}return e.prototype.headers=function(e){return void 0===e&&(e=[]),rT(this.requestHeaders,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return rb(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,_.sH)(this,void 0,void 0,function(){return(0,_.YH)(this,function(n){return 0===e.length?[2,null]:[2,rS(this.body,e,t)]})})},e}();function rb(e,t){var n,r,i,o,s=(0,O.m)(),a=null==s?void 0:s.TextEncoder;if(a&&null!=e){if("string"==typeof e)o=e,i=new a().encode(o).length;else if("u">typeof Blob&&e instanceof Blob)i=(o=e).size;else if("u">typeof URLSearchParams&&e instanceof URLSearchParams)o=e,i=new a().encode(o.toString()).length;else if(ArrayBuffer.isView(e))i=(o=e).byteLength;else if(e instanceof ArrayBuffer)i=(o=e).byteLength;else if("u">typeof FormData&&e instanceof FormData){var u=0,l=0;try{for(var c=(0,_.Ju)(e.entries()),d=c.next();!d.done;d=c.next()){var f=(0,_.zs)(d.value,2),p=f[0],h=f[1];if(u+=p.length,"string"==typeof h)u+=new a().encode(h).length;else{if(!("u">typeof Blob&&h instanceof Blob))return;u+=h.size}if(++l>=t)return}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}i=u}else if("u">typeof ReadableStream&&e instanceof ReadableStream){o=e;return}return i}}var rw=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)||t.call(n,function(e,t){r[t]=e}),rT(r,{allow:e})}},Object.defineProperty(e.prototype,"bodySize",{get:function(){if(void 0!==this._bodySize)return this._bodySize;var e,t,n=null==(t=null==(e=this.response.headers)?void 0:e.get)?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,_.sH)(this,void 0,void 0,function(){return(0,_.YH)(this,function(e){switch(e.label){case 0:this.clonedResponse||(this.clonedResponse=this.response.clone()),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,Promise.race([this.clonedResponse.text(),new Promise(function(e){return setTimeout(function(){return e(null)},500)})])];case 2:return[2,e.sent()];case 3:return e.sent(),[2,null];case 4:return[2]}})})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,_.sH)(this,void 0,void 0,function(){return(0,_.YH)(this,function(n){switch(n.label){case 0:if(0===e.length)return[2,null];return[4,this.text()];case 1:return[2,rS(n.sent(),e,t)]}})})},e}(),rE=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){if(void 0===e&&(e=[]),!this.headersString)return{};var t,n,r={},i=this.headersString.split("\r\n");try{for(var o=(0,_.Ju)(i),s=o.next();!s.done;s=o.next()){var a=s.value,u=(0,_.zs)(a.split(": "),2),l=u[0],c=u[1];l&&c&&(r[l]=c)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return rT(r,{allow:e})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,_.sH)(this,void 0,void 0,function(){var n;return(0,_.YH)(this,function(r){return 0===e.length?[2,null]:(n=this.getJson())?(rh(n,e,t),[2,n]):[2,null]})})},e}();function rS(e,t,n){if(!e)return null;try{var r=JSON.parse(e);return rh(r,t,n),r}catch(e){return null}}(c=w||(w={})).REDACT="redact",c.REMOVE="remove";var rk="[REDACTED]",rT=function(e,t){var n,r,i=t.allow,o=void 0===i?[]:i,s=t.strategy,a=void 0===s?w.REMOVE:s,u=(0,_.fX)([],(0,_.zs)(et.L),!1),l={};try{for(var c=(0,_.Ju)(Object.keys(e)),d=c.next();!d.done;d=c.next()){var f=d.value;!function(t){var n=t.toLowerCase();u.find(function(e){return e.toLowerCase()===n})?a===w.REDACT&&(l[t]=rk):o.find(function(e){return e.toLowerCase()===n})?l[t]=e[t]:a===w.REDACT&&(l[t]=rk)}(f)}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return l},rC=function(){function e(e,t,n,r,i,o,s,a,u,l,c){void 0===s&&(s=0),this.type=e,this.method=t,this.timestamp=n,this.startTime=r,this.url=i,this.requestWrapper=o,this.status=s,this.duration=a,this.responseWrapper=u,this.error=l,this.endTime=c}return e.prototype.toSerializable=function(){var e,t,n,r;
3return Object.fromEntries(Object.entries({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.headers((0,_.fX)([],(0,_.zs)(et.j7),!1)),requestBodySize:null==(t=this.requestWrapper)?void 0:t.bodySize,responseHeaders:null==(n=this.responseWrapper)?void 0:n.headers((0,_.fX)([],(0,_.zs)(et.j7),!1)),responseBodySize:null==(r=this.responseWrapper)?void 0:r.bodySize}).filter(function(e){var t=(0,_.zs)(e,2);return void 0!==(t[0],t[1])}))},e}(),r_=function(e,t){void 0===t&&(t=H()),this.callback=e,this.id=t};function rA(e){try{e()}catch(e){}}var rx=new(function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var n=(0,O.m)();e.isSupported()&&(this.globalScope=n)}return e.isSupported=function(){var e=(0,O.m)();return!!e&&!!e.fetch},e.prototype.subscribe=function(e,t){var n,r,i,o,s,a,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.XMLHttpRequest)?void 0:r.prototype)?void 0:i.open,p=null==(a=null==(s=null==(o=this.globalScope)?void 0:o.XMLHttpRequest)?void 0:s.prototype)?void 0:a.send,h=null==(c=null==(l=null==(u=this.globalScope)?void 0:u.XMLHttpRequest)?void 0:l.prototype)?void 0:c.setRequestHeader;f&&p&&h&&this.observeXhr(f,p,h);var v=null==(d=this.globalScope)?void 0:d.fetch;v&&this.observeFetch(v),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(e){rA(function(){var n;null==(n=t.logger)||n.debug("an unexpected error occurred while triggering event callbacks",e)})}})},e.prototype.handleNetworkRequestEvent=function(e,t,n,r,i,o,s){if(void 0!==o&&void 0!==s){var a,u,l,c,d="GET";if("object"==typeof t&&null!==t&&"url"in t&&"method"in t?(u=t.url,d=t.method):u=null==(a=null==t?void 0:t.toString)?void 0:a.call(t),u)try{var f=new URL(u);u="".concat(f.protocol,"//").concat(f.host).concat(f.pathname).concat(f.search).concat(f.hash)}catch(e){}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 p=Math.floor(performance.now()-s),h=Math.floor(o+p),v=new rC(e,d,o,o,u,n,l,p,r,c,h);this.triggerEventCallbacks(v)}},e.prototype.getTimestamps=function(){var e,t;return{startTime:null==(e=Date.now)?void 0:e.call(Date),durationStart:null==(t=null==performance?void 0:performance.now)?void 0:t.call(performance)}},e.prototype.observeFetch=function(e){var t=this;this.globalScope&&e&&(this.globalScope.fetch=function(n,r){return(0,_.sH)(t,void 0,void 0,function(){var t,i,o,s=this;return(0,_.YH)(this,function(a){switch(a.label){case 0:try{t=this.getTimestamps()}catch(e){rA(function(){var t;return null==(t=s.logger)?void 0:t.debug("an unexpected error occurred while retrieving timestamps",e)})}a.label=1;case 1:return a.trys.push([1,3,,4]),[4,e(n,r)];case 2:return i=a.sent(),[3,4];case 3:return o=a.sent(),[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",n,r?new rm(r):void 0,i?new rw(i):void 0,o,null==t?void 0:t.startTime,null==t?void 0:t.durationStart)}catch(e){rA(function(){var t;return null==(t=s.logger)?void 0:t.debug("an unexpected error occurred while handling fetch",e)})}if(i)return[2,i];throw o}})})})},e.createXhrJsonParser=function(e,t){return function(){var n;try{if("json"===e.responseType){if(null==(n=t.globalScope)?void 0:n.structuredClone)return t.globalScope.structuredClone(e.response)}else if(["text",""].includes(e.responseType))return JSON.parse(e.responseText)}catch(n){n instanceof Error&&"InvalidStateError"===n.name&&rA(function(){var n;return null==(n=t.logger)?void 0:n.debug("unexpected error when retrieving responseText. responseType='".concat(e.responseType,"'"))})}return null}},e.prototype.observeXhr=function(t,n,r){if(this.globalScope&&t&&n){var i=this.globalScope.XMLHttpRequest.prototype,o=this;i.open=function(){for(var e,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=(0,_.zs)(n,2),s=i[0],a=i[1];try{this.$$AmplitudeAnalyticsEvent=(0,_.Cl)({method:s,url:null==(e=null==a?void 0:a.toString)?void 0:e.call(a),headers:{}},o.getTimestamps())}catch(e){rA(function(){var t;return null==(t=o.logger)?void 0:t.debug("an unexpected error occurred while calling xhr open",e)})}return t.apply(this,n)},i.send=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=this,s=e.createXhrJsonParser(this,o),a=t[0],u=i.$$AmplitudeAnalyticsEvent;return i.$$AmplitudeAnalyticsEvent&&i.addEventListener("loadend",function(){try{var e=i.getAllResponseHeaders(),t=i.getResponseHeader("content-length"),n=new rE(i.status,e,t?parseInt(t,10):void 0,s),r=i.$$AmplitudeAnalyticsEvent.headers,l=new ry(a,r);u.status=i.status,o.handleNetworkRequestEvent("xhr",{url:u.url,method:u.method},l,n,void 0,u.startTime,u.durationStart)}catch(e){rA(function(){var t;return null==(t=o.logger)?void 0:t.debug("an unexpected error occurred while handling xhr send",e)})}}),n.apply(i,t)},i.setRequestHeader=function(e,t){try{var n=this.$$AmplitudeAnalyticsEvent;n&&(n.headers[e]=t)}catch(e){rA(function(){var t;return null==(t=o.logger)?void 0:t.debug("an unexpected error occurred while calling xhr setRequestHeader",e)})}r.apply(this,[e,t])}}},e}()),rP="[Amplitude] Network Request",rI="500-599";function rO(e,t){return RegExp("^"+t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$").test(e)}function rR(e,t){var n,r,i=t.split(",");try{for(var o=(0,_.Ju)(i),s=o.next();!s.done;s=o.next()){var a=s.value,u=(0,_.zs)(a.split("-").map(Number),2),l=u[0],c=u[1];if(e===l&&void 0===c||e>=l&&e<=c)return!0}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!1}function rH(e){if(e)try{var t,n,r,i,o,s,a,u,l,c=null==(t=(0,O.m)())?void 0:t.location.href,d=new URL(e,c),f=d.searchParams.toString(),p=d.hash.replace("#",""),h=d.href,v=d.host;d.hash="",d.search="";var g=d.href;return{query:f,fragment:p,href:h,hrefWithoutQueryOrHash:g,host:v}}catch(t){try{return i=(r=e.indexOf("#"))>=0?e.slice(r+1):"",a=(s=(o=r>=0?e.slice(0,r):e).indexOf("?"))>=0?o.slice(s+1):"",l=(u=s>=0?o.slice(0,s):o).match(/^[a-z][a-z0-9+.-]*:\/\/([^/?#]+)/i),{query:a,fragment:i,href:e,hrefW
3ithoutQueryOrHash:u,host:null!=(n=null==l?void 0:l[1])?n:""}}catch(e){return}}}function rD(e){return"object"!=typeof e||null===e?e?(0,_.fX)([],(0,_.zs)(et.j7),!1):void 0:0!==e.length?e:void 0}function rL(e){var t,n,r;return!(null==(t=null==e?void 0:e.allowlist)?void 0:t.length)&&!(null==(n=null==e?void 0:e.blocklist)?void 0:n.length)&&!(null==(r=null==e?void 0:e.excludelist)?void 0:r.length)}(E||(E={})).NetworkObservable="networkObservable";var rN=function(e){void 0===e&&(e={});var t,n="@amplitude/plugin-network-capture-browser",r=function(){var e,n=new(t2())(function(e){var n=new r_(function(t){var n={event:t,timestamp:Date.now(),type:"network"};e.next(n)});return rx.subscribe(n,t),function(){rx.unsubscribe(n)}});return(e={})[E.NetworkObservable]=n,e};return{name:n,type:"enrichment",setup:function(i,o){return(0,_.sH)(void 0,void 0,void 0,function(){var s;return(0,_.YH)(this,function(a){var u,l,c,d,f,p,h;return"u"<typeof document&&(null==(u=null==(l=(0,O.m)())?void 0:l.navigator)?void 0:u.product)!=="ReactNative"?[2]:(s=r(),t=null==i?void 0:i.loggerProvider,d=(c={allObservables:s,networkTrackingOptions:e,amplitude:o,loggerProvider:t}).allObservables,f=c.networkTrackingOptions,p=c.amplitude,h=c.loggerProvider,S=d.networkObservable.filter(function(e){return function(e,t){void 0===t&&(t={});var n,r,i=rH(e.url);if(!i)return!1;var o=i.host;return!(!1!==t.ignoreAmplitudeRequests&&(rO(o,"*.amplitude.com")||rO(o,"amplitude.com"))||(null==(n=t.ignoreHosts)?void 0:n.find(function(e){return rO(o,e)})))&&(!!t.captureRules||void 0===e.status||!!rR(e.status,rI))&&(!t.captureRules||((0,_.fX)([],(0,_.zs)(t.captureRules),!1).reverse().find(function(t){if(r=function(e,t,n,r,i){if((!e.hosts||e.hosts.find(function(e){return rO(t,e)}))&&(!r||!e.urls||nd(r,e.urls))&&(!i||!e.methods||e.methods.find(function(e){return i.toLowerCase()===e.toLowerCase()||"*"===e})))return(!n&&0!==n||!!rR(n,e.statusCodeRange||rI))&&!0}(t,o,e.status,e.url,e.method)){var n=rD(t.responseHeaders);if(e.responseWrapper&&n){var i=e.responseWrapper.headers(n);i&&(e.responseHeaders=i)}var s=rD(t.requestHeaders);if(e.requestWrapper&&s){var a=e.requestWrapper.headers(s);a&&(e.requestHeaders=a)}if(e.responseWrapper&&t.responseBody&&!rL(t.responseBody)){var u=t.responseBody.excludelist||t.responseBody.blocklist;e.responseBodyJson=e.responseWrapper.json(t.responseBody.allowlist,u)}if(e.requestWrapper&&t.requestBody&&!rL(t.requestBody)){var u=t.requestBody.excludelist||t.requestBody.blocklist;e.requestBodyJson=e.requestWrapper.json(t.requestBody.allowlist,u)}}return void 0!==r}),!!r))&&!(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===rP}))return!0}catch(e){}return!1}(o,e.requestWrapper))}(e.event,f)}).subscribe(function(e){var t,n,r,i=e.event,o=rH(i.url);if(o){var s=null==(n=i.responseWrapper)?void 0:n.bodySize,a=null==(r=i.requestWrapper)?void 0:r.bodySize;!function(e,t,n,r){(0,_.sH)(this,void 0,void 0,function(){var i,o,s;return(0,_.YH)(this,function(a){switch(a.label){case 0:if(!(t.requestBodyJson||t.responseBodyJson))return[3,2];return[4,Promise.all([t.requestBodyJson,t.responseBodyJson])];case 1:if(o=(i=_.zs.apply(void 0,[a.sent(),2]))[0],s=i[1],o)try{e["[Amplitude] Request Body"]=JSON.stringify(o)}catch(e){null==r||r.debug("Failed to stringify request body",e)}if(s)try{e["[Amplitude] Response Body"]=JSON.stringify(s)}catch(e){null==r||r.debug("Failed to stringify response body")}a.label=2;case 2:return null==n||n.track(rP,e),[2]}})})}(((t={})["[Amplitude] URL"]=o.hrefWithoutQueryOrHash,t["[Amplitude] URL Query"]=o.query,t["[Amplitude] URL Fragment"]=o.fragment,t["[Amplitude] Request Method"]=i.method,t["[Amplitude] Status Code"]=i.status,t["[Amplitude] Start Time"]=i.startTime,t["[Amplitude] Completion Time"]=i.endTime,t["[Amplitude] Duration"]=i.duration,t["[Amplitude] Request Body Size"]=a,t["[Amplitude] Response Body Size"]=s,t["[Amplitude] Request Type"]=i.type,t["[Amplitude] Request Headers"]=i.requestHeaders,t["[Amplitude] Response Headers"]=i.responseHeaders,t),i,p,h)}}),null==t||t.log("".concat(n," has been successfully added.")),[2])})})},execute:function(e){return(0,_.sH)(void 0,void 0,void 0,function(){return(0,_.YH)(this,function(t){return[2,e]})})},teardown:function(){return(0,_.sH)(void 0,void 0,void 0,function(){return(0,_.YH)(this,function(e){return S.unsubscribe(),[2]})})}}};let rM=-1,rj=e=>{addEventListener("pageshow",t=>{t.persisted&&(rM=t.timeStamp,e(t))},!0)},rU=(e,t,n,r)=>{let i,o;return s=>{let a;t.value>=0&&(s||r)&&((o=t.value-(i??0))||void 0===i)&&(i=t.value,t.delta=o,a=t.value,t.rating=a>n[1]?"poor":a>n[0]?"needs-improvement":"good",e(t))}},rF=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},rY=()=>{let e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},rq=()=>{let e=rY();return e?.activationStart??0},rz=(e,t=-1)=>{let n=rY(),r="navigate";return rM>=0?r="back-forward-cache":n&&(document.prerendering||rq()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(0x82f79cd8fff*Math.random())+1e12}`,navigationType:r}},rB=new WeakMap;function rJ(e,t){return rB.get(e)||rB.set(e,new t),rB.get(e)}class rV{t;i=0;o=[];h(e){if(e.hadRecentInput)return;let 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)}}let rW=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},rX=e=>{let t=!1;return()=>{t||(e(),t=!0)}},rK=-1,r$=new Set,rG=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,rQ=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(let e of r$)e();isFinite(rK)||(rK="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",rQ,!0))}},rZ=()=>
3{if(rK<0){let e=rq();rK=(document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>"hidden"===t.name&&t.startTime>e)[0]?.startTime)??rG(),addEventListener("visibilitychange",rQ,!0),addEventListener("prerenderingchange",rQ,!0),rj(()=>{setTimeout(()=>{rK=rG()})})}return{get firstHiddenTime(){return rK},onHidden(e){r$.add(e)}}},r0=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},r1=[1800,3e3],r2=(e,t={})=>{r0(()=>{let n=rZ(),r,i=rz("FCP"),o=rW("paint",e=>{for(let t of e)"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-rq(),0),i.entries.push(t),r(!0)))});o&&(r=rU(e,i,r1,t.reportAllChanges),rj(n=>{r=rU(e,i=rz("FCP"),r1,t.reportAllChanges),rF(()=>{i.value=performance.now()-n.timeStamp,r(!0)})}))})},r3=[.1,.25],r4=0,r5=1/0,r6=0,r7=e=>{for(let t of e)t.interactionId&&(r5=Math.min(r5,t.interactionId),r4=(r6=Math.max(r6,t.interactionId))?(r6-r5)/7+1:0)},r8=()=>r?r4:performance.interactionCount??0,r9=0;class ie{u=[];l=new Map;m;p;v(){r9=r8(),this.u.length=0,this.l.clear()}L(){let e=Math.min(this.u.length-1,Math.floor((r8()-r9)/50));return this.u[e]}h(e){if(this.m?.(e),!e.interactionId&&"first-input"!==e.entryType)return;let t=this.u.at(-1),n=this.l.get(e.interactionId);if(n||this.u.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.l.set(n.id,n),this.u.push(n)),this.u.sort((e,t)=>t.P-e.P),this.u.length>10)for(let e of this.u.splice(10))this.l.delete(e.id);this.p?.(n)}}}let it=e=>{let t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(addEventListener("visibilitychange",e=rX(e),{once:!0,capture:!0}),t(()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})}))},ir=[200,500];class ii{m;h(e){this.m?.(e)}}let io=[2500,4e3],is=[800,1800],ia=e=>{document.prerendering?r0(()=>ia(e)):"complete"!==document.readyState?addEventListener("load",()=>ia(e),!0):setTimeout(e)};function iu(e){var t,n;return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor((n=(null==(t=e.entries[0])?void 0:t.startTime)||0,performance.timeOrigin+n)),navigationStart:Math.floor(performance.timeOrigin)}}var il=function(){var e=null,t=(0,O.m)(),n=null==t?void 0:t.document,i=null==t?void 0:t.location;return{name:"web-vitals-browser",type:"enrichment",setup:function(t,o){return(0,_.sH)(void 0,void 0,void 0,function(){var s,a;return(0,_.YH)(this,function(u){return void 0===n||(s=nf((null==i?void 0:i.href)||"",t.loggerProvider),a={"[Amplitude] Page Domain":(null==i?void 0:i.hostname)||"","[Amplitude] Page Location":s,"[Amplitude] Page Path":nf((null==i?void 0:i.pathname)||"",t.loggerProvider),"[Amplitude] Page Title":"u">typeof document&&document.title||"","[Amplitude] Page URL":nf(s.split("?")[0],t.loggerProvider)},((e,t={})=>{r0(()=>{let n=rZ(),r,i=rz("LCP"),o=rJ(t,ii),s=e=>{for(let s of(t.reportAllChanges||(e=e.slice(-1)),e))o.h(s),s.startTime<n.firstHiddenTime&&(i.value=Math.max(s.startTime-rq(),0),i.entries=[s],r())},a=rW("largest-contentful-paint",s);if(a){r=rU(e,i,io,t.reportAllChanges);let n=rX(()=>{s(a.takeRecords()),a.disconnect(),r(!0)}),o=e=>{e.isTrusted&&(it(n),removeEventListener(e.type,o,{capture:!0}))};for(let e of["keydown","click","visibilitychange"])addEventListener(e,o,{capture:!0});rj(n=>{r=rU(e,i=rz("LCP"),io,t.reportAllChanges),rF(()=>{i.value=performance.now()-n.timeStamp,r(!0)})})}})})(function(e){a["[Amplitude] LCP"]=iu(e)}),r2(function(e){a["[Amplitude] FCP"]=iu(e)}),((e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;let n=rZ();r0(()=>{"interactionCount"in performance||r||(r=rW("event",r7,{type:"event",buffered:!0,durationThreshold:0}));let i,o=rz("INP"),s=rJ(t,ie),a=e=>{it(()=>{for(let t of e)s.h(t);let t=s.L();t&&t.P!==o.value&&(o.value=t.P,o.entries=t.entries,i())})},u=rW("event",a,{durationThreshold:t.durationThreshold??40});i=rU(e,o,ir,t.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{a(u.takeRecords()),i(!0)}),rj(()=>{s.v(),i=rU(e,o=rz("INP"),ir,t.reportAllChanges)}))})})(function(e){a["[Amplitude] INP"]=iu(e)}),((e,t={})=>{let n=rZ();r2(rX(()=>{let r,i=rz("CLS",0),o=rJ(t,rV),s=e=>{for(let t of e)o.h(t);o.i>i.value&&(i.value=o.i,i.entries=o.o,r())},a=rW("layout-shift",s);a&&(r=rU(e,i,r3,t.reportAllChanges),n.onHidden(()=>{s(a.takeRecords()),r(!0)}),rj(()=>{o.i=0,r=rU(e,i=rz("CLS",0),r3,t.reportAllChanges),rF(()=>r())}),setTimeout(r))}))})(function(e){a["[Amplitude] CLS"]=iu(e)}),((e,t={})=>{let n=rz("TTFB"),r=rU(e,n,is,t.reportAllChanges);ia(()=>{let i=rY();i&&(n.value=Math.max(i.responseStart-rq(),0),n.entries=[i],r(!0),rj(()=>{(r=rU(e,n=rz("TTFB",0),is,t.reportAllChanges))(!0)}))})})(function(e){a["[Amplitude] TTFB"]=iu(e)}),e=function(){"hidden"===n.visibilityState&&e&&(o.track("[Amplitude] Web Vitals",a),n.removeEventListener("visibilitychange",e),e=null)},n.addEventListener("visibilitychange",e)),[2]})})},execute:function(e){return(0,_.sH)(void 0,void 0,void 0,function(){return(0,_.YH)(this,function(t){return[2,e]})})},teardown:function(){return(0,_.sH)(void 0,void 0,void 0,function(){return(0,_.YH)(this,function(t){return e&&(null==n||n.removeEventListener("visibilitychange",e)),[2]})})}}},ic=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),[et.r,t,e.substring(0,n)].filter(
3Boolean).join("_")},id=function(){function e(e,t){var n;this.shouldTrackNewCampaign=!1,this.options=(0,_.Cl)({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:tw((null==(n=t.cookieOptions)?void 0:n.domain)||t.topLevelDomain),optOut:t.optOut},e),this.storage=t.cookieStorage,this.storageKey=ic(t.apiKey,"MKTG"),this.webExpStorageKey=ic(t.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=et.F3,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,_.sH)(this,void 0,void 0,function(){var e,t;return(0,_.YH)(this,function(n){switch(n.label){case 0:if(this.options.optOut)return[2];return[4,this.fetchCampaign()];case 1:if(t=_.zs.apply(void 0,[n.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||eb(this.sessionTimeout,this.lastEventTime),!tm(this.currentCampaign,this.previousCampaign,this.options,this.logger,e,this.topLevelDomain))return[3,3];return this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)];case 2:n.sent(),n.label=3;case 3:return[2]}})})},e.prototype.fetchCampaign=function(){return(0,_.sH)(this,void 0,void 0,function(){var e;return(0,_.YH)(this,function(t){switch(t.label){case 0:return[4,this.storage.get(this.webExpStorageKey)];case 1:if(!(e=t.sent()))return[3,3];return[4,this.storage.remove(this.webExpStorageKey)];case 2:t.sent(),t.label=3;case 3:return[4,Promise.all([e||new tj().parse(),this.storage.get(this.storageKey)])];case 4:return[2,t.sent()]}})})},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var t,n,r=(t=this.currentCampaign,n=this.options,ev(Object.entries((0,_.Cl)((0,_.Cl)({},et.F3),t)).reduce(function(e,t){var r,i=(0,_.zs)(t,2),o=i[0],s=i[1];return(e.setOnce("initial_".concat(o),null!=(r=null!=s?s:n.initialEmptyValue)?r:"EMPTY"),s)?e.set(o,s):e.unset(o)},new ef)));return e&&(r.event_id=e),r},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),ip=new Set([eh.S.IDENTIFY,eh.S.GROUP_IDENTIFY]),ih=function(e){void 0===e&&(e={});var t,n,r,i,o,s,a,u=null!=(t=e.fallbackAttributionEvent)&&t,l=(0,O.m)(),c={},d=!1,f=!1,p=function(){return(0,_.sH)(void 0,void 0,void 0,function(){return(0,_.YH)(this,function(e){switch(e.label){case 0:return[4,new tj().parse()];case 1:return c=tM(e.sent()),u&&(null==r||r.log("Tracking attribution fallback event."),null==n||n.track("[Amplitude] Attribution",c)),[2]}})})},h=function(){p()},v=function(e){return new Proxy(e,{apply:function(e,t,n){Reflect.apply(e,t,n),d&&h()}})};return{name:"@amplitude/plugin-event-property-attribution-browser",type:"enrichment",setup:function(e,t){return(0,_.sH)(void 0,void 0,void 0,function(){return(0,_.YH)(this,function(u){switch(u.label){case 0:return n=t,r=e.loggerProvider,d=!0,r.log("Installing event property attribution tracking."),[4,p()];case 1:if(u.sent(),!l)return[2];if(l.addEventListener("popstate",h),!f){if(i=Reflect.get(l.history,"pushState"),o=Reflect.get(l.history,"replaceState"),!i||!o)return[2];s=v(i),l.history.pushState=s,a=v(o),l.history.replaceState=a,f=!0}return[2]}})})},execute:function(e){return(0,_.sH)(void 0,void 0,void 0,function(){return(0,_.YH)(this,function(t){return ip.has(e.event_type)||(e.event_properties=(0,_.Cl)((0,_.Cl)({},c),e.event_properties)),[2,e]})})},teardown:function(){return(0,_.sH)(void 0,void 0,void 0,function(){var e,t;return(0,_.YH)(this,function(n){return l&&(l.removeEventListener("popstate",h),e=Reflect.get(l.history,"pushState"),t=Reflect.get(l.history,"replaceState"),f&&e===s&&i&&(l.history.pushState=i),f&&t===a&&o&&(l.history.replaceState=o)),d=!1,f=!1,i=void 0,o=void 0,s=void 0,a=void 0,c={},[2]})})}}},iv="AMP_CURRENT_PAGE",ig="AMP_PREVIOUS_PAGE",im="AMP_URL_INFO";(d=k||(k={})).Direct="direct",d.Internal="internal",d.External="external";var iy=new Set([eh.S.IDENTIFY,eh.S.GROUP_IDENTIFY,eh.S.REVENUE]),ib=function(e){var t=(void 0===e?{}:e).internalDomains,n=void 0===t?[]:t,r=(0,O.m)(),i=void 0,o=!1,s=void 0,a=!1,u=!1,l=function(e){var t;try{var n=nf(e,s);
3t=new URL(n).hostname}catch(e){null==s||s.error("Could not parse URL: ",e)}return t},c=function(e){var t="u">typeof location&&location.hostname||"",r=e?l(e):void 0;if(!r)return k.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?k.Internal:k.External},d=function(){return(0,_.sH)(void 0,void 0,void 0,function(){var e,t,n,r,s;return(0,_.YH)(this,function(a){switch(a.label){case 0:if(!(i&&o))return[3,3];return[4,i.get(im)];case 1:return e=a.sent(),t=nf("u">typeof location&&location.href||""),n=(null==e?void 0:e[iv])||"",r=void 0,r=t===n?(null==e?void 0:e[ig])||"":n||document.referrer||"",[4,i.set(im,((s={})[iv]=t,s[ig]=r,s))];case 2:a.sent(),a.label=3;case 3:return[2]}})})},f=function(){d()};return{name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(e,t){return(0,_.sH)(void 0,void 0,void 0,function(){var t,n,c,p,h,v,g,m;return(0,_.YH)(this,function(y){switch(y.label){case 0:if((s=e.loggerProvider).log("Installing @amplitude/plugin-page-url-enrichment-browser"),u=!0,!r)return[3,7];try{i=new eZ(r.sessionStorage)}catch(e){null==s||s.debug("sessionStorage is not available in this environment.")}return[4,null==i?void 0:i.isEnabled()];case 1:if(o=null!=(m=y.sent())&&m,!(i&&o))return[3,6];return n=(t="u">typeof document&&document.referrer||"")?l(t):void 0,c="u">typeof location&&location.hostname||"",p=nf("u">typeof location&&location.href||""),[4,i.get(im)];case 2:if(v=(null==(h=y.sent())?void 0:h[iv])||"",!(n&&n!==c&&v!==p))return[3,4];return[4,i.set(im,((g={})[iv]=p,g[ig]=t,g))];case 3:return y.sent(),[3,6];case 4:return[4,d()];case 5:y.sent(),y.label=6;case 6:r.addEventListener("popstate",f),a||(r.history.pushState=new Proxy(r.history.pushState,{apply:function(e,t,n){var r=(0,_.zs)(n,3),i=r[0],o=r[1],s=r[2];e.apply(t,[i,o,s]),u&&f()}}),r.history.replaceState=new Proxy(r.history.replaceState,{apply:function(e,t,n){var r=(0,_.zs)(n,3),i=r[0],o=r[1],s=r[2];e.apply(t,[i,o,s]),u&&f()}}),a=!0),y.label=7;case 7:return[2]}})})},execute:function(e){return(0,_.sH)(void 0,void 0,void 0,function(){var t,n,r;return(0,_.YH)(this,function(s){switch(s.label){case 0:if(t=nf("u">typeof location&&location.href||""),!(i&&o))return[3,2];return[4,i.get(im)];case 1:if(r=(null==(n=s.sent())?void 0:n[ig])||"",iy.has(e.event_type))return[2,e];e.event_properties=(0,_.Cl)((0,_.Cl)({},e.event_properties||{}),{"[Amplitude] Page Domain":iw(e,"[Amplitude] Page Domain","u">typeof location&&location.hostname||""),"[Amplitude] Page Location":iw(e,"[Amplitude] Page Location",t),"[Amplitude] Page Path":iw(e,"[Amplitude] Page Path","u">typeof location&&nf(location.pathname)||""),"[Amplitude] Page Title":iw(e,"[Amplitude] Page Title",tN(tL)),"[Amplitude] Page URL":iw(e,"[Amplitude] Page URL",t.split("?")[0]),"[Amplitude] Previous Page Location":r,"[Amplitude] Previous Page Type":c(r)}),s.label=2;case 2:return[2,e]}})})},teardown:function(){return(0,_.sH)(void 0,void 0,void 0,function(){return(0,_.YH)(this,function(e){switch(e.label){case 0:if(r&&(r.removeEventListener("popstate",f),u=!1),!(i&&o))return[3,2];return[4,i.set(im,{})];case 1:e.sent(),e.label=2;case 2:return[2]}})})}}};function iw(e,t,n){return(e.event_properties||(e.event_properties={}),void 0===e.event_properties[t])?n:e.event_properties[t]}var iE=function(){var e,t,n;function r(t){if(t)try{var n=Function("return "+t)();if("function"==typeof n)return n;null==e||e.error("Custom enrichment body did not evaluate to a function")}catch(t){null==e||e.error("Could not create custom enrichment function",t)}return function(e){return e}}return{name:"@amplitude/plugin-custom-enrichment-browser",type:"enrichment",setup:function(i,o){return(0,_.sH)(void 0,void 0,void 0,function(){var o,s;return(0,_.YH)(this,function(a){return null==(e=i.loggerProvider)||e.log("Installing @amplitude/plugin-custom-enrichment-browser"),(null==(s=i.remoteConfig)?void 0:s.fetchRemoteConfig)&&(i.remoteConfigClient?(o=i.remoteConfigClient.subscribe("configs.analyticsSDK.browserSDK.customEnrichment","all",function(e){n=e&&"object"==typeof e&&null!==e&&"body"in e&&"string"==typeof e.body?r(e.body||""):r("")}),t=function(){var e;return null==(e=i.remoteConfigClient)?void 0:e.unsubscribe(o)}):null==e||e.debug("Remote config client is not provided, skipping remote config fetch")),[2]})})},execute:function(t){return(0,_.sH)(void 0,void 0,void 0,function(){var r;return(0,_.YH)(this,function(i){if(n)try{return[2,null!=(r=n(t))?r:null]}catch(t){null==e||e.error("Could not execute custom enrichment function",t)}return[2,t]})})},teardown:function(){return(0,_.sH)(void 0,void 0,void 0,function(){return(0,_.YH)(this,function(e){return t&&t(),[2]})})}}},iS="userProperty",ik="eventProperty",iT=function(e){return e===iS||e===ik},iC=[iS,ik],i_=function(e){var t=(0,_.fX)([],(0,_.zs)(new Set((Array.isArray(e)?e:[e]).filter(iT))),!1);return t.length>0?t:(0,_.fX)([],(0,_.zs)(iC),!1)},iA=function(e,t){return i_(e.trackingMethod).includes(t)},ix=function(e){return iA(e,iS)},iP=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._diagnosticsSampleRate=0,t}return(0,_.C6)(t,e),t.prototype.init=function(e,t,n){var r,i;return void 0===e&&(e=""),arguments.length>
32?(r=t,i=n):"string"==typeof t?(r=t,i=void 0):(r=null==t?void 0:t.userId,i=t),(0,A.m)(this._init((0,_.Cl)((0,_.Cl)({},i),{userId:r,apiKey:e})))},t.prototype._init=function(t){var n,r,i,o,s,a,u,l;return(0,_.sH)(this,void 0,void 0,function(){var c,d,f,p,h,v,g,m,y,b,w,E,S,k,T=this;return(0,_.YH)(this,function(C){var A,I,O,R,L,N,M,j,U;switch(C.label){case 0:if(this.initializing)return[2];if(this.initializing=!0,c=tx(t),d=null!=(n=t.loggerProvider)?n:new x.V,t.loggerProvider||d.enable(null!=(r=t.logLevel)?r:P.$.Warn),f=null!=(i=t.serverZone)?i:"US",h=this._diagnosticsSampleRate,v=null==(o=t.enableDiagnostics)||o,!c)return[3,2];return p=new D(t.apiKey,d,f,null==(s=t.remoteConfig)?void 0:s.serverUrl),[4,new Promise(function(e){null==p||p.subscribe("configs.diagnostics.browserSDK","all",function(t,n,r){if(d.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)||(h=i);var o=t.enabled;"boolean"==typeof o&&(v=o)}e()})})];
3case 1:C.sent(),C.label=2;case 2:return(g=new K(t.apiKey,d,f,{enabled:v,sampleRate:h})).setTag("library","".concat(ez,"/").concat(eq)),"u">typeof navigator&&g.setTag("user_agent",navigator.userAgent),[4,(A=t.apiKey,I=t,O=this,R=g,L={loggerProvider:d,serverZone:f,enableDiagnostics:v,diagnosticsSampleRate:h},void 0===I&&(I={}),(0,_.sH)(void 0,void 0,void 0,function(){var e,t,n,r,i,o,s,a,u,l,c,d,f,p,h,v,g,m,y,b,w,E,S,k,T,C,x,P,D,N,M,j,U,F,Y,q,z,B,J,V,W,X,K,G,Q,Z,ee,en,er,ei,eo;return(0,_.YH)(this,function(es){var ea,eu,el,ec;switch(es.label){case 0:if(e=I.identityStorage||th,t="",!(e===th&&!(null==(E=I.cookieOptions)?void 0:E.domain)&&(null==(S=I.cookieOptions)?void 0:S.domain)!==""))return[3,2];return[4,(ea=void 0,eu=R,(0,_.sH)(void 0,void 0,void 0,function(){var e,t,n,r,i,o,s;return(0,_.YH)(this,function(a){switch(a.label){case 0:return[4,new eW(void 0,{diagnosticsClient:eu}).isEnabled()];case 1:if(!a.sent()||!ea&&("u"<typeof location||!location.hostname)||1===(t=(e=null!=ea?ea:location.hostname).split(".")).length)return[2,""];for(n=[],r=1,tk.find(function(t){return e.endsWith(".".concat(t))})&&(r=2),i=t.length-r-1;i>=0;--i)n.push(t.slice(i).join("."));i=0,a.label=2;case 2:if(!(i<n.length))return[3,7];o=n[i],a.label=3;case 3:return a.trys.push([3,5,,6]),[4,eW.isDomainWritable(o)];case 4:if(a.sent())return[2,"."+o];return[3,6];case 5:return s=a.sent(),eu&&eu.recordEvent("cookies.tld.failure",{reason:"Unexpected exception checking domain is writable: ".concat(o),error:s instanceof Error?s.message:String(s)}),[3,6];case 6:return i++,[3,2];case 7:return eu&&eu.recordEvent("cookies.tld.failure",{reason:"Could not determine TLD for host ".concat(e)}),[2,""]}})}))];case 1:t=es.sent(),es.label=2;case 2:return n=(0,_.Cl)({domain:null!=(T=null==(k=I.cookieOptions)?void 0:k.domain)?T:t,expiration:365,sameSite:"Lax",secure:!1,upgrade:!0},I.cookieOptions),r={duplicateResolverFn:function(e){var t=e$(e);return!!t&&eG(JSON.parse(t).cookieDomain,n.domain)},diagnosticsClient:R},[4,(el=i=tA(I.identityStorage,n,r),void 0===(ec=null==(x=null==(C=I.cookieOptions)?void 0:C.upgrade)||x)&&(ec=!0),(0,_.sH)(void 0,void 0,void 0,function(){var e,t,n,r,i,o,s,a,u;return(0,_.YH)(this,function(l){switch(l.label){case 0:return e="".concat(et.r.toLowerCase(),"_").concat(A.substring(0,6)),[4,el.getRaw(e)];case 1:if(!(t=l.sent()))return[2,{optOut:!1}];if(!ec)return[3,3];
3return[4,el.remove(e)];case 2:l.sent(),l.label=3;case 3:return r=(n=(0,_.zs)(t.split("."),6))[0],i=n[1],o=n[2],s=n[3],a=n[4],u=n[5],[2,{deviceId:r,userId:e9(i),sessionId:e8(s),lastEventId:e8(u),lastEventTime:e8(a),optOut:!!o}]}})}))];case 3:return o=es.sent(),[4,i.get(eQ(A))];case 4:return s=es.sent(),l=!(u=(a=$()).ampTimestamp?Number(a.ampTimestamp):void 0)||Date.now()<u,c=null!=(j=null!=(M=null!=(N=null!=(P=I.deviceId)?P:l?null!=(D=a.ampDeviceId)?D:a.deviceId:void 0)?N:null==s?void 0:s.deviceId)?M:o.deviceId)?j:H(),d=null!=(U=null==s?void 0:s.lastEventId)?U:o.lastEventId,f=null!=(F=null==s?void 0:s.lastEventTime)?F:o.lastEventTime,p=null!=(q=null!=(Y=I.optOut)?Y:null==s?void 0:s.optOut)?q:o.optOut,h=null!=(z=null==s?void 0:s.sessionId)?z:o.sessionId,v=null==s?void 0:s.deferredSessionId,g=null!=(J=null!=(B=I.userId)?B:null==s?void 0:s.userId)?J:o.userId,O.previousSessionDeviceId=null!=(V=null==s?void 0:s.deviceId)?V:o.deviceId,O.previousSessionUserId=null!=(W=null==s?void 0:s.userId)?W:o.userId,m={ipAddress:null==(K=null==(X=I.trackingOptions)?void 0:X.ipAddress)||K,language:null==(Q=null==(G=I.trackingOptions)?void 0:G.language)||Q,platform:null==(ee=null==(Z=I.trackingOptions)?void 0:Z.platform)||ee},y=null==s?void 0:s.pageCounter,b=null==s?void 0:s.debugLogsEnabled,void 0!==I.autocapture&&(I.defaultTracking=I.autocapture),[4,(w=new t_(A,I.appVersion,i,n,I.defaultTracking,I.autocapture,c,I.flushIntervalMillis,I.flushMaxRetries,I.flushQueueSize,e,I.ingestionMetadata,I.instanceName,d,f,null!=(en=null==L?void 0:L.loggerProvider)?en:I.loggerProvider,I.logLevel,I.minIdLength,I.offline,p,I.partnerId,I.plan,I.serverUrl,null!=(er=null==L?void 0:L.serverZone)?er:I.serverZone,h,v,I.sessionTimeout,I.storageProvider,m,I.transport,I.useBatch,I.fetchRemoteConfig,g,y,b,I.networkTrackingOptions,I.identify,null!=(ei=null==L?void 0:L.enableDiagnostics)?ei:I.enableDiagnostics,null!=(eo=null==L?void 0:L.diagnosticsSampleRate)?eo:O._diagnosticsSampleRate,R,I.remoteConfig,t,I.enableRequestBodyCompression,I.customEnrichment)).storageProvider.isEnabled()];case 5:return es.sent()||(w.loggerProvider.warn("Storage provider ".concat(w.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),w.storageProvider=new eJ),[2,w]}})}))];case 3:if(m=C.sent(),!(c&&p))return[3,5];return[4,new Promise(function(e){null==p||p.subscribe("configs.analyticsSDK.browserSDK","all",function(t,n,r){m.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:t,source:n,lastFetch:r},null,2)),t&&function(e,t){var n,r;if(e){!function e(t){if("object"==typeof t&&null!==t&&!Array.isArray(t)){var n,r,i,o,s,a,u,l,c,d,f,p,h=Object.keys(t);try{for(var v=(0,_.Ju)(h),g=v.next();!g.done;g=v.next()){var m=g.value;try{var y=t[m];"boolean"==typeof(null==y?void 0:y.enabled)&&(y.enabled?(delete y.enabled,0===Object.keys(y).length&&(t[m]=!0)):t[m]=!1),e(y)}catch(e){}}}catch(e){n={error:e}}finally{try{g&&!g.done&&(r=v.return)&&r.call(v)}finally{if(n)throw n.error}}try{if(null==(c=null==(l=null==(u=t.autocapture)?void 0:u.networkTracking)?void 0:l.captureRules)?void 0:c.length)try{for(var b=(0,_.Ju)(t.autocapture.networkTracking.captureRules),w=b.next();!w.done;w=b.next()){var E=w.value;try{for(var S=(s=void 0,(0,_.Ju)(["responseHeaders","requestHeaders"])),k=S.next();!k.done;k=S.next()){var T=k.value,C=null!=(d=E[T])?d:{},A=C.captureSafeHeaders,x=C.allowlist;if(A||x){if(void 0!==x&&!Array.isArray(x)){delete E[T];continue}E[T]=(0,_.fX)((0,_.fX)([],(0,_.zs)(A?et.j7:[]),!1),(0,_.zs)(null!=x?x:[]),!1)}}}catch(e){s={error:e}}finally{try{k&&!k.done&&(a=S.return)&&a.call(S)}finally{if(s)throw s.error}}}}catch(e){i={error:e}}
3finally{try{w&&!w.done&&(o=b.return)&&o.call(b)}finally{if(i)throw i.error}}}catch(e){}var P=null==(f=t.autocapture)?void 0:f.frustrationInteractions;P&&(P.rageClick&&(P.rageClicks=P.rageClick,delete P.rageClick),P.deadClick&&(P.deadClicks=P.deadClick,delete P.deadClick));try{var I=null==(p=t.autocapture)?void 0:p.elementInteractions;if(I&&"object"==typeof I&&(!0===I.viewportContentUpdated&&(I.viewportContentUpdated={}),!1===I.viewportContentUpdated&&(I.viewportContentUpdated={enabled:!1}),void 0!==I.exposureDuration)){var O=I.viewportContentUpdated;void 0===O?I.viewportContentUpdated={exposureDuration:I.exposureDuration}:"object"==typeof O&&void 0===O.exposureDuration&&!1!==O.enabled&&(O.exposureDuration=I.exposureDuration),delete I.exposureDuration}}catch(e){}}}(e);try{if(t.loggerProvider.debug("Update browser config with remote configuration:",eE(e)),e&&"autocapture"in e){if("boolean"==typeof e.autocapture&&(t.autocapture=e.autocapture),"object"==typeof e.autocapture&&null!==e.autocapture){var i=(0,_.Cl)({},e.autocapture);if(void 0===t.autocapture&&(t.autocapture=e.autocapture),"object"==typeof e.autocapture.elementInteractions&&null!==e.autocapture.elementInteractions&&(null==(n=e.autocapture.elementInteractions.pageUrlAllowlistRegex)?void 0:n.length)){i.elementInteractions=(0,_.Cl)({},e.autocapture.elementInteractions);var o=i.elementInteractions,s=null!=(r=o.pageUrlAllowlist)?r:[],a=e.autocapture.elementInteractions.pageUrlAllowlistRegex;o.pageUrlAllowlist=tG(s,a,t.loggerProvider),delete o.pageUrlAllowlistRegex}var u=function(e,t){if("object"==typeof e&&null!==e&&(null==(i=e.captureRules)?void 0:i.length)){var n,r,i,o,s,a=(0,_.Cl)({},e),u=null!=(o=a.captureRules)?o:[];try{for(var l=(0,_.Ju)(u),c=l.next();!c.done;c=l.next()){var d=c.value;d.urls=tG(null!=(s=d.urls)?s:[],d.urlsRegex,t),delete d.urlsRegex}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return a}}(e.autocapture.networkTracking,t.loggerProvider);u&&(i.networkTracking=u),"boolean"==typeof t.autocapture&&(t.autocapture=(0,_.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},i)),"object"==typeof t.autocapture&&(t.autocapture=(0,_.Cl)((0,_.Cl)({},t.autocapture),i))}t.defaultTracking=t.autocapture}"customEnrichment"in e&&null!==e.customEnrichment&&!1!==t.customEnrichment&&(t.customEnrichment=e.customEnrichment),t.loggerProvider.debug("Browser config after remote config update:",eE(t))}catch(e){t.loggerProvider.error("Failed to apply remote configuration because of error: ",e)}}}(t,m),e()})})];case 4:C.sent(),C.label=5;case 5:return[4,e.prototype._init.call(this,m)];case 6:if(C.sent(),this.logBrowserOptions(m),this.config.remoteConfigClient=p,y=eC((N=this.config).defaultTracking)&&N.defaultTracking&&"object"==typeof N.defaultTracking&&N.defaultTracking.attribution&&"object"==typeof N.defaultTracking.attribution?(0,_.Cl)({},N.defaultTracking.attribution):{},!(eC(this.config.defaultTracking)&&ix(y)))return[3,8];return this.config.optOut&&this.timeline.addOptOutListener(function(e){return(0,_.sH)(T,void 0,void 0,function(){return(0,_.YH)(this,function(t){switch(t.label){case 0:if(e)return[3,2];return this.webAttribution=new id(y,this.config),[4,this.webAttribution.init()];case 1:t.sent(),t.label=2;case 2:return[2]}})})}),this.webAttribution=new id(y,this.config),[4,this.webAttribution.init()];case 7:C.sent(),C.label=8;case 8:if(E=!(!(w=(b=$()).ampTimestamp?Number(b.ampTimestamp):void 0)||Date.now()<w)||Number.isNaN(Number(b.ampSessionId))?void 0:Number(b.ampSessionId),-1!==(S=this.config.deferredSessionId)||this.config.optOut||(S=Date.now()),this.setSessionId(null!=(l=null!=(u=null!=(a=t.sessionId)?a:E)?u:S)?l:this.config.sessionId),this.config.optOut&&this.timeline.addOptOutListener(function(e){return(0,_.sH)(T,void 0,void 0,function(){return(0,_.YH)(this,function(t){return!e&&this.config.deferredSessionId&&(-1===this.config.deferredSessionId?this.setSessionId(void 0):this.setSessionId(this.config.deferredSessionId)),[2]})})}),(k=(0,Q.w$)(t.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),this.config.offline===Z)return[3,10];return[4,this.add(t$()).promise];
3case 9:C.sent(),C.label=10;case 10:return[4,this.add(new eu({diagnosticsClient:g})).promise];case 11:return C.sent(),[4,this.add(new eB).promise];case 12:return C.sent(),[4,this.add(new el).promise];case 13:if(C.sent(),tK(this.config),!eT(this.config.defaultTracking,"fileDownloads"))return[3,15];return this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(tW()).promise];case 14:C.sent(),C.label=15;case 15:if(!e_(this.config.defaultTracking))return[3,17];return this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(tB()).promise];case 16:C.sent(),C.label=17;case 17:if(!eA(this.config.defaultTracking))return[3,20];if(this.config.optOut)return[3,19];return this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(tF(eN(this.config))).promise];case 18:return C.sent(),[3,20];case 19:this.timeline.addOptOutListener(function(e){return(0,_.sH)(T,void 0,void 0,function(){return(0,_.YH)(this,function(t){switch(t.label){case 0:if(e)return[2];return this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(tF(eN(this.config))).promise];case 1:return t.sent(),[2]}})})}),C.label=20;case 20:if(!(eC(this.config.defaultTracking)&&iA(y,ik)))return[3,22];return this.config.loggerProvider.debug("Adding event property attribution plugin"),[4,this.add(ih(y)).promise];case 21:C.sent(),C.label=22;case 22:if(!eI(this.config.autocapture))return[3,24];return this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(n8(eH(this.config),{diagnosticsClient:g})).promise];case 23:C.sent(),C.label=24;case 24:if(!eO(this.config.autocapture))return[3,26];return this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(rd(eD(this.config))).promise];case 25:C.sent(),C.label=26;case 26:if(!eP(this.config.autocapture))return[3,28];return this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(rN(eL(this.config))).promise];case 27:C.sent(),C.label=28;case 28:if(!("boolean"==typeof(M=this.config.autocapture)?M:"object"==typeof M&&!0===M.webVitals))return[3,30];return this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(il()).promise];case 29:C.sent(),C.label=30;case 30:if("object"!=typeof(j=this.config.autocapture)||!0!==j.performanceTracking&&"object"!=typeof j.performanceTracking)return[3,32];return this.config.loggerProvider.debug("Adding performance tracking plugin"),[4,this.add(rp(eR(this.config))).promise];
3case 31:C.sent(),C.label=32;case 32:if(!eT(this.config.autocapture,"pageUrlEnrichment"))return[3,34];return this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(ib()).promise];case 33:C.sent(),C.label=34;case 34:if(!("boolean"==typeof(U=this.config.customEnrichment)?U:"object"==typeof U&&null!==U&&!1!==U.enabled))return[3,36];return this.config.loggerProvider.debug("Adding custom enrichment plugin"),[4,this.add(iE()).promise];case 35:C.sent(),C.label=36;case 36:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 37:return C.sent(),k.eventBridge.setEventReceiver(function(e){var t=e.eventProperties||{},n=t.time,r=(0,_.Tt)(t,["time"]);T.track(e.eventType,r,"number"==typeof n?{time:n}:void 0)}),[2]}})})},t.prototype.getUserId=function(){var e;return null==(e=this.config)?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}),(0,Q.yo)(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.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}),(0,Q.rb)(e,this.config.instanceName))):this.q.push(this.setDeviceId.bind(this,e))},t.prototype.reset=function(){this.setDeviceId(H()),this.setUserId(void 0),this.timeline.onReset()},t.prototype.getIdentity=function(){var e,t;return{deviceId:null==(e=this.config)?void 0:e.deviceId,userId:null==(t=this.config)?void 0:t.userId,userProperties:this.userProperties}},t.prototype.setIdentity=function(e){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 t,n,r,i=new ef,o=null!=(r=e.userProperties)?r:{};try{for(var s=(0,_.Ju)(Object.entries(o)),a=s.next();!a.done;a=s.next()){var u=(0,_.zs)(a.value,2),l=u[0],c=u[1];i.set(l,c)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}this.identify(i)}},t.prototype.getOptOut=function(){var e;return null==(e=this.config)?void 0:e.optOut},t.prototype.getSessionId=function(){var e;return null==(e=this.config)?void 0:e.sessionId},t.prototype.setSessionId=function(e){var t,n=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,e)),(0,A.m)(Promise.resolve());if(this.config.optOut)return this.config.deferredSessionId=null!=e?e:-1,(0,A.m)(Promise.resolve());if(void 0===e&&(e=Date.now()),e===this.config.sessionId)return(0,A.m)(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)?t:-1;this.config.sessionId=e,this.config.lastEventTime=void 0,this.config.pageCounter=0,ex(this.config.defaultTracking)&&(r&&i&&n.push(this.track(to,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 s=this.trackCampaignEventIfNeeded(++o,n);return this.config.identify&&n.push(this.track(ev(this.config.identify)).promise),ex(this.config.defaultTracking)&&n.push(this.track(ti,void 0,{event_id:s?++o:o,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,(0,A.m)(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=tP(e):this.q.push(this.setTransport.bind(this,e))},t.prototype.identify=function(t,n){if(eF(t)){var r=t._q;t._q=[],t=eU(new ef,r)}
3return(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(eF(r)){var o=r._q;r._q=[],r=eU(new ef,o)}return e.prototype.groupIdentify.call(this,t,n,r,i)},t.prototype.revenue=function(t,n){if(eF(t)){var r=t._q;t._q=[],t=eU(new ey,r)}return e.prototype.revenue.call(this,t,n)},t.prototype.trackCampaignEventIfNeeded=function(e,t){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign||!ix(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,_.sH)(this,void 0,void 0,function(){var n,r,i;return(0,_.YH)(this,function(o){return n=Date.now(),r=eb(this.config.sessionTimeout,this.config.lastEventTime),i=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),t.event_type!==ti&&t.event_type!==to&&(!t.session_id||t.session_id===this.getSessionId())&&(r||i?(this.setSessionId(n),i&&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,_.Cl)((0,_.Cl)({},e),{apiKey:e.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",eE(t))}catch(e){this.config.loggerProvider.error("Error logging browser config",e)}},t.prototype._setDiagnosticsSampleRate=function(e){if(!(e>1)&&!(e<0)&&!this.config){this._diagnosticsSampleRate=e;return}},t}(ek),iI=function(){var e=new iP;return{init:(0,C.nA)(e.init.bind(e),"init",(0,C.WI)(e),(0,C.av)(e,["config"])),add:(0,C.nA)(e.add.bind(e),"add",(0,C.WI)(e),(0,C.av)(e,["config.apiKey","timeline.plugins"])),remove:(0,C.nA)(e.remove.bind(e),"remove",(0,C.WI)(e),(0,C.av)(e,["config.apiKey","timeline.plugins"])),track:(0,C.nA)(e.track.bind(e),"track",(0,C.WI)(e),(0,C.av)(e,["config.apiKey","timeline.queue.length"])),logEvent:(0,C.nA)(e.logEvent.bind(e),"logEvent",(0,C.WI)(e),(0,C.av)(e,["config.apiKey","timeline.queue.length"])),identify:(0,C.nA)(e.identify.bind(e),"identify",(0,C.WI)(e),(0,C.av)(e,["config.apiKey","timeline.queue.length"])),groupIdentify:(0,C.nA)(e.groupIdentify.bind(e),"groupIdentify",(0,C.WI)(e),(0,C.av)(e,["config.apiKey","timeline.queue.length"])),setGroup:(0,C.nA)(e.setGroup.bind(e),"setGroup",(0,C.WI)(e),(0,C.av)(e,["config.apiKey","timeline.queue.length"])),revenue:(0,C.nA)(e.revenue.bind(e),"revenue",(0,C.WI)(e),(0,C.av)(e,["config.apiKey","timeline.queue.length"])),flush:(0,C.nA)(e.flush.bind(e),"flush",(0,C.WI)(e),(0,C.av)(e,["config.apiKey","timeline.queue.length"])),getUserId:(0,C.nA)(e.getUserId.bind(e),"getUserId",(0,C.WI)(e),(0,C.av)(e,["config","config.userId"])),setUserId:(0,C.nA)(e.setUserId.bind(e),"setUserId",(0,C.WI)(e),(0,C.av)(e,["config","config.userId"])),getDeviceId:(0,C.nA)(e.getDeviceId.bind(e),"getDeviceId",(0,C.WI)(e),(0,C.av)(e,["config","config.deviceId"])),setDeviceId:(0,C.nA)(e.setDeviceId.bind(e),"setDeviceId",(0,C.WI)(e),(0,C.av)(e,["config","config.deviceId"])),reset:(0,C.nA)(e.reset.bind(e),"reset",(0,C.WI)(e),(0,C.av)(e,["config","config.userId","config.deviceId"])),getSessionId:(0,C.nA)(e.getSessionId.bind(e),"getSessionId",(0,C.WI)(e),(0,C.av)(e,["config"])),setSessionId:(0,C.nA)(e.setSessionId.bind(e),"setSessionId",(0,C.WI)(e),(0,C.av)(e,["config"])),extendSession:(0,C.nA)(e.extendSession.bind(e),"extendSession",(0,C.WI)(e),(0,C.av)(e,["config"])),setOptOut:(0,C.nA)(e.setOptOut.bind(e),"setOptOut",(0,C.WI)(e),(0,C.av)(e,["config"])),setTransport:(0,C.nA)(e.setTransport.bind(e),"setTransport",(0,C.WI)(e),(0,C.av)(e,["config"])),getIdentity:(0,C.nA)(e.getIdentity.bind(e),"getIdentity",(0,C.WI)(e),(0,C.av)(e,["config"])),setIdentity:(0,C.nA)(e.setIdentity.bind(e),"setIdentity",(0,C.WI)(e),(0,C.av)(e,["config","config.userId","config.deviceId"])),getOptOut:(0,C.nA)(e.getOptOut.bind(e),"getOptOut",(0,C.WI)(e),(0,C.av)(e,["config"])),_setDiagnosticsSampleRate:(0,C.nA)(e._setDiagnosticsSampleRate.bind(e),"_setDiagnosticsSampleRate",(0,C.WI)(e),(0,C.av)(e,["config"]))}};let iO=iI();function iR(e,t){var n=0;return Number.isFinite(e)&&Number.isFinite(t)&&t>0&&(n=Math.min(100,Math.max(0,e/t*100))),n}function iH(e,t){var n=e.currentTime,r=e.duration;return(0,_.Cl)({duration:r,start_time:n,last_position:n,percent_completed:iR(n,r)},void 0!==t?{stop_reason:t}:{})}function iD(e){return{mux_playback_id:e.getAttribute("playback-id"),mux_video_id:e.getAttribute("metadata-video-id"),mux_video_title:e.getAttribute("metadata-video-title")}}function iL(e,t,n,r){return(0,_.sH)(this,void 0,void 0,function(){var i,o,s,a,u;return(0,_.YH)(this,function(l){switch(l.label){case 0:return[4,Promise.all([new Promise(function(t){return e.getDuration(t)}),new Promise(function(t){return e.getCurrentTime(t)})])];case 1:if(o=(i=_.zs.apply(void 0,[l.sent(),2]))[0],s=i[1],a={},"mux"===n){u=void 0;try{a.mux_video_title=(u=new URL(t.getAttribute("src"))).searchParams.get("metadata-video-title"),a.mux_video_id=u.searchParams.get("metadata-video-id"),a.mux_playback_id=u.pathname.split("/").pop()}catch(e){}}return[2,(0,_.Cl)((0,_.Cl)({duration:o,start_time:s,last_position:s,percent_completed:iR(s,o)},void 0!==r?{stop_reason:r}:{}),a)]}})})}var iN=function(){function e(e){var t,n,r,i,o,s,a,u,l,c,d,f=e.videoEl,p=e.onStateChange,h=e.vendor,v=e.isEmbedded,g=this;(this.state={playbackState:"paused"},this.handler={onPlay:function(e){g.updatePlaybackState("playing",e)},onPause:function(e){g.updatePlaybackState("paused",e)},onEnded:function(e){g.updatePlaybackState("ended",e)},onSeeking:function(){var e=(0,_.Cl)((0,_.Cl)({},g.state),{isSeeking:!0});g.updateState(e)},onSeeked:function(e){var t=(0,_.Cl)((0,_.Cl)({},g.state),{isSeeking:!1,position:e.last_position});g.updateState(t)},onError:function(e){g.updateStateWithError(e)},onTimeUpdate:function(e){g.updateTime(e)}},this.onStateChange=p,v)?this.untrack=(t=this.handler,void 0===(n=h)&&(n=null),r=[],i=function(){var e=f.elem,i=!1,o=function(){iL(f,e,n).then(function(e){t.onPlay(e)}).catch(function(e){t.onError("Error getting iframe metadata from 'play' handler: ".concat(e))})};f.on("play",o),r.push(function(){return f.off("play",o)});var s=function(){iL(f,e,n,"paused").then(function(e){t.onPause(e)}).catch(function(e){t.onError("Error getting iframe metadata from 'pause' handler: ".concat(e))})};f.on("pause",s),r.push(function(){return f.off("pause",s)});var a=function(){iL(f,e,n,"ended").then(function(e){t.onEnded(e)}).catch(function(e){t.onError("Error getting iframe metadata from 'ended' handler: ".concat(e))})};f.on("ended",a),r.push(function(){return f.off("ended",a)});var u=function(){i=!0,iL(f,e,n,"seeking").then(function(e){t.onSeeking(e)}
3).catch(function(e){t.onError("Error getting iframe metadata from 'seeking' handler: ".concat(e))})};f.on("seeking",u),r.push(function(){return f.off("seeking",u)});var l=function(){i=!1,iL(f,e,n).then(function(e){t.onSeeked(e)}).catch(function(e){t.onError("Error getting iframe metadata from 'seeked' handler: ".concat(e))})};f.on("seeked",l),r.push(function(){return f.off("seeked",l)});var c=function(){(function(e){return(0,_.sH)(this,void 0,void 0,function(){return(0,_.YH)(this,function(t){switch(t.label){case 0:return[4,new Promise(function(t){return e.getCurrentTime(t)})];case 1:return[2,{currentTime:t.sent()}]}})})})(f).then(function(e){var n={position:e.currentTime,isSeeking:i};t.onTimeUpdate(n)}).catch(function(e){t.onError("Error getting iframe metadata from 'timeupdate' handler: ".concat(e))})};f.on("timeupdate",c),r.push(function(){return f.off("timeupdate",c)})},f.on("ready",i),function(){f.off("ready",i),r.forEach(function(e){return e()})}):this.untrack=(o=this.handler,s=function(){var e=(0,_.Cl)((0,_.Cl)({},iH(f)),"mux"===h?iD(f):{});o.onPlay(e)},f.addEventListener("play",s),a=function(){var e=(0,_.Cl)((0,_.Cl)({},iH(f,"paused")),"mux"===h?iD(f):{});o.onPause(e)},f.addEventListener("pause",a),u=function(){var e=(0,_.Cl)((0,_.Cl)({},iH(f,"ended")),"mux"===h?iD(f):{});o.onEnded(e)},f.addEventListener("ended",u),l=function(){var e=(0,_.Cl)((0,_.Cl)({},iH(f,"seeking")),"mux"===h?iD(f):{});o.onSeeking(e)},f.addEventListener("seeking",l),c=function(){var e=(0,_.Cl)((0,_.Cl)({},iH(f)),"mux"===h?iD(f):{});o.onSeeked(e)},f.addEventListener("seeked",c),d=function(){var e={position:f.currentTime,isSeeking:!!f.seeking};o.onTimeUpdate(e)},f.addEventListener("timeupdate",d),function(){f.removeEventListener("play",s),f.removeEventListener("pause",a),f.removeEventListener("ended",u),f.removeEventListener("seeking",l),f.removeEventListener("seeked",c),f.removeEventListener("timeupdate",d)})}return e.prototype.stateChangeHandler=function(e,t){try{this.onStateChange(e,t)}catch(e){}},e.prototype.updateStateWithError=function(e){var t=this.state,n=(0,_.Cl)((0,_.Cl)({},t),{playbackState:"error",errorMessage:e});this.updateState(n)},e.prototype.updatePlaybackState=function(e,t){var n=(0,_.Cl)((0,_.Cl)({},this.state),{playbackState:e,lastEvent:t,position:t.last_position});this.updateState(n)},e.prototype.updateTime=function(e){var t,n;if(this.state.lastEvent&&"playing"===this.state.playbackState){var r=e.isSeeking||this.state.isSeeking,i=null!=(t=this.state.position)?t:0,o=e.position;if(r){this.state=(0,_.Cl)((0,_.Cl)({},this.state),{position:o});return}var s=o-i,a=(0,_.Cl)((0,_.Cl)({},this.state),{position:o,watchTime:(null!=(n=this.state.watchTime)?n:0)+s});this.updateState(a)}},e.prototype.updateState=function(e){var t=this.state;this.state=e,this.stateChangeHandler(t,e)},e.prototype.destroy=function(){this.untrack()},e}(),iM=function(){function e(e){this.amplitude=e,this.videoEl=null,this.embeddedVideoPlayer=null,this.extraEventProperties={},this.listeners=[],this.onRemoveListeners=[]}return e.prototype.withVideoElement=function(e){return this.videoEl=e,this},e.prototype.withEmbeddedPlayer=function(e){return this.embeddedVideoPlayer=e,this},e.prototype.withVendor=function(e){return this.vendor=e,this},e.prototype.withExtraEventProperties=function(e){return this.extraEventProperties=e,this},e.prototype.captureVideoStarted=function(){var e=this;return this.listeners.push(function(t,n){"playing"!==t.playbackState&&"playing"===n.playbackState&&e.amplitude.track("Video Content Started",(0,_.Cl)((0,_.Cl)({},n.lastEvent),e.extraEventProperties))}),this},e.prototype.captureVideoStopped=function(){var e=this;return this.listeners.push(function(t,n){"playing"===t.playbackState&&"playing"!==n.playbackState&&e.amplitude.track("Video Content Stopped",(0,_.Cl)((0,_.Cl)((0,_.Cl)({},n.lastEvent),{watch_duration:n.watchTime}),e.extraEventProperties))}),this},e.prototype.start=function(){var e,t=this,n=null!=(e=this.videoEl)?e:this.embeddedVideoPlayer;if(!n)throw Error("Video element not specified. Use withVideoElement() or withEmbeddedPlayer() to specify the video element.");if(this.videoEl&&this.embeddedVideoPlayer)throw Error("Both video element and embedded video player specified. Use only one of withVideoElement() or withEmbeddedPlayer() to specify the video element.");var r=new iN({videoEl:n,onStateChange:function(e,n){t.listeners.forEac
3h(function(t){return t(e,n)})},vendor:this.vendor,isEmbedded:!!this.embeddedVideoPlayer});return this.onRemoveListeners.push(function(){r.destroy()}),this},e.prototype.stop=function(){this.onRemoveListeners.forEach(function(e){return e()}),this.onRemoveListeners=[]},e}();function ij(e,t,n){void 0===n&&(n={});var r,i=new iM(e);t instanceof HTMLVideoElement?i.withVideoElement(t):i.withEmbeddedPlayer(t),n.vendor&&i.withVendor(n.vendor);var o=null!=(r=n.extraEventProperties)?r:{};try{i.withExtraEventProperties((0,_.Cl)({view_session_id:H()},o)).captureVideoStarted().captureVideoStopped().start()}catch(e){return e}return function(){return i.stop()}}var iU=n(39207),iF=iO.add,iY=iO.extendSession,iq=iO.flush,iz=iO.getDeviceId,iB=iO.getIdentity,iJ=iO.getOptOut,iV=iO.getSessionId,iW=iO.getUserId,iX=iO.groupIdentify,iK=iO.identify,i$=iO.init,iG=iO.logEvent,iQ=iO.remove,iZ=iO.reset,i0=iO.revenue,i1=iO.setDeviceId,i2=iO.setGroup,i3=iO.setIdentity,i4=iO.setOptOut,i5=iO.setSessionId,i6=iO.setTransport,i7=iO.setUserId,i8=iO.track,i9=iO._setDiagnosticsSampleRate},81401(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(e){return n(e)}if(Array.isArray(i)){var s=i.map(e);return r.pop(),s}var a=Object.keys(i).reduce(function(r,o){return r[o]=e(function(e,r){if(t.call(e,r))try{return e[r]}catch(e){return n(e)}return e[r]}(i,o)),r},{});return r.pop(),a}(e)}e.exports=function(e,t,n){return JSON.stringify(r(e),t,n)},e.exports.ensureProperties=r},16064(e,t,n){e.exports=n(43619).Observable},43619(e,t){"use strict";t.Observable=void 0;let n=e=>!!Symbol[e],r=e=>n(e)?Symbol[e]:"@@"+e,i=r("iterator"),o=r("observable"),s=r("species");function a(e,t){let n=e[t];if(null!=n){if("function"!=typeof n)throw TypeError(n+" is not a function");return n}}function u(e){let t=e.constructor;return void 0!==t&&null===(t=t[s])&&(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(e){l(e)}})}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=a(t,"unsubscribe");e&&e.call(t)}}catch(e){l(e)}}function f(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function p(e,t,n){e._state="running";let r=e._observer;try{let i=a(r,t);switch(t){case"next":i&&i.call(r,n);break;case"error":if(f(e),i)i.call(r,n);else throw n;break;case"complete":f(e),i&&i.call(r)}}catch(e){l(e)}"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 void e._queue.push({type:t,value:n});if("ready"!==e._state){e._state="buffering",e._queue=[{type:t,value:n}],c(()=>(function(e){let t=e._queue;if(t){e._queue=void 0,e._state="ready";for(let n=0;n<t.length&&(p(e,t[n].type,t[n].value),"closed"!==e._state);++n);}})(e));return}p(e,t,n)}}class v{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(e){r.error(e)}"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 TypeError("Observable cannot be called as a function");if("function"!=typeof e)throw 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 v(e,this._subscriber)}forEach(e){return new Promise((t,n)=>{if("function"!=typeof e)return void n(TypeError(e+" is not a function"));function r(){i.unsubscribe(),t()}let i=this.subscribe({next(t){try{e(t,r)}catch(e){n(e),i.unsubscribe()}},error:n,complete:t})})}map(e){if("function"!=typeof e)throw TypeError(e+" is not a function");return new(u(this))(t=>this.subscribe({next(n){try{n=e(n)}catch(e){return t.error(e)}t.next(n)},error(e){t.error(e)},complete(){t.complete()}}))}filter(e){if("function"!=typeof e)throw TypeError(e+" is not a function");return new(u(this))(t=>this.subscribe({next(n){try{if(!e(n))return}catch(e){return t.error(e)}t.next(n)},error(e){t.error(e)},complete(){t.complete()}}))}reduce(e){if("function"!=typeof e)throw TypeError(e+" is not a function");let t=u(this),n=arguments.length>1,r=!1,i=arguments[1],o=i;return new t(t=>this.subscribe({next(i){let s=!r;if(r=!0,!s||n)try{o=e(o,i)}catch(e){return t.error(e)}else o=i},error(e){t.error(e)},complete(){if(!r&&!n)return t.error(TypeError("Cannot reduce an empty sequence"));t.next(o),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(s){r=s.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 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(e){return n.error(e)}let s=t.from(i).subscribe({next(e){n.next(e)},error(e){n.error(e)},complete(){let e=r.indexOf(s);e>=0&&r.splice(e,1),o()}});r.push(s)},error(e){n.error(e)},complete(){o()}});function o(){i.closed&&0===r.length&&n.complete()}return()=>
3{r.forEach(e=>e.unsubscribe()),i.unsubscribe()}})}[o](){return this}static from(e){let t="function"==typeof this?this:g;if(null==e)throw TypeError(e+" is not an object");let r=a(e,o);if(r){let n=r.call(e);if(Object(n)!==n)throw TypeError(n+" is not an object");return n instanceof g&&n.constructor===t?n:new t(e=>n.subscribe(e))}if(n("iterator")&&(r=a(e,i)))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 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[s](){return this}}t.Observable=g,Object.defineProperty(g,Symbol("extensions"),{value:{symbol:o,hostReportError:l},configurable:!0})}}]); 4//# sourceMappingURL=node_modules_amplitude_analytics-browser_lib_esm_index_js.9df7045d8f9dfa88.js.map 5//# debugId=9438de6b-0df9-501d-b68b-b14d0bab8197
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.