PageSourceSearch

https://studdyai.com/_next/static/chunks/5046-a721862b1fad88fd.js?dpl=dpl_FpFKQKcENC9ess2UsVdtHSwpyDvU

js studdyai.com collected 2026-10-08 14:53:54 UTC 180,241 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5046],{15046:(e,t,n)=>{let r;n.r(t),n.d(t,{AmplitudeBrowser:()=>of,Identify:()=>eX,Revenue:()=>e0,Types:()=>x,_setDiagnosticsSampleRate:()=>oU,add:()=>ov,createInstance:()=>op,extendSession:()=>og,flush:()=>oy,getDeviceId:()=>om,getIdentity:()=>ob,getOptOut:()=>ow,getSessionId:()=>oE,getUserId:()=>oS,groupIdentify:()=>o_,identify:()=>oT,init:()=>ok,logEvent:()=>oI,remove:()=>oP,reset:()=>oO,revenue:()=>ox,runQueuedFunctions:()=>tu,setDeviceId:()=>oA,setGroup:()=>oC,setOptOut:()=>oR,setSessionId:()=>oD,setTransport:()=>oN,setUserId:()=>oL,track:()=>oj});var i,o,s,a,u,c,l,d,f,p,h,v,g,y,m,b,w,E,S,_,T,k,I,P,O,x={};n.r(x),n.d(x,{DEFAULT_ACTION_CLICK_ALLOWLIST:()=>nh,DEFAULT_CSS_SELECTOR_ALLOWLIST:()=>nf,DEFAULT_DATA_ATTRIBUTE_PREFIX:()=>np,IdentifyOperation:()=>w,LogLevel:()=>g,OfflineDisabled:()=>eM,RevenueProperty:()=>b,ServerZone:()=>O,SpecialEventType:()=>E});var A=function(e,t){return(A=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function C(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}A(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var R=function(){return(R=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function D(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function N(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(s,a)}u((r=r.apply(e,t||[])).next())})}function L(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(u){var c=[a,u];if(n)throw TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&c[0]?r.return:c[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;switch(r=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,r=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){o.label=c[1];break}if(6===c[0]&&o.label<i[1]){o.label=i[1],i=c;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(c);break}i[2]&&o.ops.pop(),o.trys.pop();continue}c=t.call(e,o)}catch(e){c=[6,e],r=0}finally{n=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function j(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function U(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function M(e,t,n){if(n||2==arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function q(e){return this instanceof q?(this.v=e,this):new q(e)}"function"==typeof SuppressedError&&SuppressedError,(i=g||(g={}))[i.None=0]="None",i[i.Error=1]="Error",i[i.Warn=2]="Warn",i[i.Verbose
1=3]="Verbose",i[i.Debug=4]="Debug";var F=function(e){return function(){var t=R({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},B=function(e,t){var n,r;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var i=j(t.split(".")),o=i.next();!o.done;o=i.next()){var s=o.value;if(!(s in e))return;e=e[s]}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e},$=function(e,t){return function(){var n,r,i={};try{for(var o=j(t),s=o.next();!s.done;s=o.next()){var a=s.value;i[a]=B(e,a)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}},H=function(e,t,n,r,i){return void 0===i&&(i=null),function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=n(),u=a.logger,c=a.logLevel;if(c&&c<g.Debug||!c||!u)return e.apply(i,o);var l={type:"invoke public method",name:t,args:o,stacktrace:(Error().stack||"").split("\n").slice(3).map(function(e){return e.trim()}),time:{start:new Date().toISOString()},states:{}};r&&l.states&&(l.states.before=r());var d=e.apply(i,o);return d&&d.promise?d.promise.then(function(){r&&l.states&&(l.states.after=r()),l.time&&(l.time.end=new Date().toISOString()),u.debug(JSON.stringify(l,null,2))}):(r&&l.states&&(l.states.after=r()),l.time&&(l.time.end=new Date().toISOString()),u.debug(JSON.stringify(l,null,2))),d}},V=function(e){return{promise:e||Promise.resolve()}},z=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}(),J=function(){var e="ampIntegrationContext";return"u">typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof self?self:void 0!==n.g?n.g:void 0},K=M([],U(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),W=function(e){var t,n=J();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,W);var r=n.crypto.getRandomValues(new Uint8Array(16));return r[6]=15&r[6]|64,r[8]=63&r[8]|128,M([],U(r.entries()),!1).map(function(e){var t=U(e,2),n=t[0],r=t[1];return[4,6,8,10].includes(n)?"-".concat(K[r]):K[r]}).join("")},Y=function(){function e(e,t,n){void 0===n&&(n="US"),this.callbackInfos=[],this.apiKey=e,this.serverUrl="US"===n?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config",this.logger=t,this.storage=new z(e,t)}return e.prototype.subscribe=function(e,t,n){var r=W(),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 N(this,void 0,void 0,function(){var e,t=this;return L(this,function(n){switch(n.label){case 0:return[4,this.fetch()];case 1:return e=n.sent(),this.storage.setConfig(e),this.callbackInfos.forEach(function(n){t.sendCallback(n,e,"remote")}),[2]}})})},e.prototype.subscribeAll=function(e){return N(this,void 0,void 0,function(){var t,n,r,i=this;return L(this,function(o){switch(o.label){case 0:return t=this.fetch().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))),this.sendCallback(e,r,"cache")),[4,t];case 2:return o.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return N(this,void 0,void 0,function(){var n,r;return L(this,function(i){switch(i.label){case 0:n=new Promise(function(e,n){setTimeout(function(){n("Timeout exceeded")},t)}
1),i.label=1;case 1:return i.trys.push([1,3,,5]),[4,Promise.race([this.fetch(),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),N(this,void 0,void 0,function(){var n,r,i,o,s,a,u=this;return L(this,function(c){switch(c.label){case 0:n=t/e,r={remoteConfig:null,lastFetch:new Date},i=function(r){var i,s,a,c,l;return L(this,function(d){switch(d.label){case 0:i=new AbortController,s=setTimeout(function(){return i.abort()},t),d.label=1;case 1:return d.trys.push([1,7,8,9]),[4,fetch(o.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:i.signal})];case 2:if((a=d.sent()).ok)return[3,4];return[4,a.text()];case 3:return c=d.sent(),o.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(a.status,": ").concat(c)),[3,6];case 4:return[4,a.json()];case 5:return[2,{value:{remoteConfig:d.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(l=d.sent())instanceof Error&&"AbortError"===l.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: "),l),[3,9];case 8:return clearTimeout(s),[7];case 9:if(!(r<e-1))return[3,11];return[4,new Promise(function(e){return setTimeout(e,u.getJitterDelay(n))})];case 10:d.sent(),d.label=11;case 11:return[2]}})},o=this,s=0,c.label=1;case 1:if(!(s<e))return[3,4];return[5,i(s)];case 2:if("object"==typeof(a=c.sent()))return[2,a.value];c.label=3;case 3:return s++,[3,1];case 4:return[2,r]}})})},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var 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}(),G="tags",Q="counters",X="histograms",Z="events",ee="internal",et="last_flush_timestamp",en=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=J())?void 0:e.indexedDB)!==void 0},e.prototype.getDB=function(){return N(this,void 0,void 0,function(){return L(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;
1n.onclose=function(){e.dbPromise=null,e.logger.debug("DiagnosticsStorage: DB connection closed.")},n.onerror=function(t){e.logger.debug("DiagnosticsStorage: A global database error occurred.",t),n.close()},t(n)},r.onupgradeneeded=function(t){var n=t.target.result;e.createTables(n)}})},e.prototype.createTables=function(e){e.objectStoreNames.contains(G)||e.createObjectStore(G,{keyPath:"key"}),e.objectStoreNames.contains(Q)||e.createObjectStore(Q,{keyPath:"key"}),e.objectStoreNames.contains(X)||e.createObjectStore(X,{keyPath:"key"}),e.objectStoreNames.contains(Z)||e.createObjectStore(Z,{keyPath:"id",autoIncrement:!0}).createIndex("time_idx","time",{unique:!1}),e.objectStoreNames.contains(ee)||e.createObjectStore(ee,{keyPath:"key"})},e.prototype.setTags=function(e){return N(this,void 0,void 0,function(){var t,n,r,i=this;return L(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([G],"readwrite")).objectStore(G),[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=U(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 N(this,void 0,void 0,function(){var t,n,r,i=this;return L(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([Q],"readwrite")).objectStore(Q),[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=U(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 N(this,void 0,void 0,function(){var t,n,r,i=this;return L(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([X],"readwrite")).objectStore(X),[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=U(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 N(this,void 0,void 0,function(){var t,n,r,i=this;return L(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([Z],"readwrite")).objectStore(Z),[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 N(this,void 0,void 0,function(){var n,r,i;return L(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([ee],"readwrite")).objectStore(ee),[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 N(this,void 0,void 0,function(){var t,n,r;return L(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([ee],"readonly")).objectStore(ee),[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 N(this,void 0,void 0,function(){var e,t;return L(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getInternal(et)];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 N(this,void 0,void 0,function(){var t;return L(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.setInternal(et,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 N(this,void 0,void 0,function(){var e,t,n,r,i,o,s;return L(this,function(a){switch(a.label){case 0:return a.trys.push([0,4,,5]),[4,this.getDB()];
1case 1:return e=a.sent().transaction([G,Q,X,Z],"readwrite"),[4,Promise.all([this.getAllFromStore(e,G),this.getAllFromStore(e,Q),this.getAllFromStore(e,X),this.getAllFromStore(e,Z)])];case 2:return n=(t=U.apply(void 0,[a.sent(),4]))[0],r=t[1],i=t[2],o=t[3],[4,Promise.all([this.clearTable(e,Q),this.clearTable(e,X),this.clearTable(e,Z)])];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}(),er=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},ei=function(e,t){return 31*Math.abs(er(e.toString()))%1e6/1e6<t},eo=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=R({enabled:!0,sampleRate:0},r),this.startTimestamp=Date.now(),this.shouldTrack=ei(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,en.isSupported()?this.storage=new en(e,t):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval()}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 N(this,void 0,void 0,function(){var e,t,n,r;return L(this,function(i){switch(i.label){case 0:if(!this.storage)return[2];return e=R({},this.inMemoryTags),t=R({},this.inMemoryCounters),n=R({},this.inMemoryHistograms),r=M([],U(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 N(this,void 0,void 0,function(){var e,t,n,r,i,o,s,a,u,c;return L(this,function(l){switch(l.label){case 0:if(!this.storage)return[2];return[4,this.saveAllDataToStorage()];case 1:return l.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:if(t=(e=l.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={}
1,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 c={tags:o,histogram:a,counters:s,events:u},this.fetch(c),[2]}})})},e.prototype.fetch=function(e){return N(this,void 0,void 0,function(){var t;return L(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),!J())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 N(this,void 0,void 0,function(){var e,t,n;return L(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=ei(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e}(),es=function(){var e,t=J();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=ea(n[0]),i=ea(n[1]);return i&&(e[r]=i),e},{}):{}},ea=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},eu=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:ec(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),ec=function(){return"u">typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},el=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(function(t){e(t)}),this.queue=[])},e}(),ed=function(){return(ed=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function ef(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ep(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}"function"==typeof SuppressedError&&SuppressedError;var eh=function(e,t){var n,r,i=typeof e;if(i!==typeof t)return!1;try{for(var o=ef(["string","number","boolean","undefined"]),s=o.next();!s.done;s=o.next())if(s.value===i)return e===t}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}if(null==e&&null==t)return!0;if(null==e||null==t||e.length!==t.length)return!1;var a=Array.isArray(e),u=Array.isArray(t);if(a!==u)return!1;if(a&&u){for(var c=0;c<e.length;c++)if(!eh(e[c],t[c]))return!1}else{if(!eh(Object.keys(e).sort(),Object.keys(t).sort()))return!1;var l=!0;return Object.keys(e).forEach(function(n){eh(e[n],t[n])||(l=!1)}),l}return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),n=t.length,r=Array(n);n--;)r[n]=[t[n],e[t[n]]];return r});var ev=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=ed({},this.identity.userProperties),n=ed(ed({},this.identity),{userProperties:t});return{setUserId:function(e){return n.userId=e,this},setDeviceId:function(e){return n.deviceId=e,this},setUserProperties:function(e){return n.userProperties=e,this},setOptOut:function(e){return n.optOut=e,this},updateUserProperties:function(e){var t,r,i,o,s,a,u=n.userProperties||{};try{for(var c=ef(Object.entries(e)),l=c.next();!l.done;l=c.next()){var d=ep(l.value,2),f=d[0],p=d[1];switch(f){case"$set":try{for(var h=(i=void 0,ef(Object.entries(p))),v=h.next();!v.done;v=h.next()){var g=ep(v.value,2),y=g[0],m=g[1];u[y]=m}}catch(e){i={error:e}}finally{try{v&&!v.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}break;case"$unset":try{for(var b=(s=void 0,ef(Object.keys(p))),w=b.next();!w.done;w=b.next()){var y=w.value;delete u[y]}}catch(e){s={error:e}}finally{try{w&&!w.done&&(a=b.return)&&a.call(b)}finally{if(s)throw s.error}}break;case"$clearAll":u={}}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}return n.userProperties=u,this},commit:function(){return e.setIdentity(n),this}}},e.prototype.getIdentity=function(){return ed({},this.identity)},e.prototype.setIdentity=function(e){var t=ed({},this.identity);this.identity=ed({}
1,e),eh(t,this.identity)||this.listeners.forEach(function(t){t(e)})},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),eg="u">typeof globalThis?globalThis:void 0!==n.g?n.g:self,ey=function(){function e(){this.identityStore=new ev,this.eventBridge=new el,this.applicationContextProvider=new eu}return e.getInstance=function(t){return eg.analyticsConnectorInstances||(eg.analyticsConnectorInstances={}),eg.analyticsConnectorInstances[t]||(eg.analyticsConnectorInstances[t]=new e),eg.analyticsConnectorInstances[t]},e}(),em="".concat("AMP","_unsent"),eb="$default_instance",ew="https://api2.amplitude.com/2/httpapi",eE="dclid",eS="fbclid",e_="gbraid",eT="gclid",ek="ko_click_id",eI="li_fat_id",eP="msclkid",eO="rdt_cid",ex="ttclid",eA="twclid",eC="wbraid",eR={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},eD=["access-control-allow-origin","access-control-allow-credentials","access-control-expose-headers","access-control-max-age","access-control-allow-methods","access-control-allow-headers","accept-patch","accept-ranges","age","allow","alt-svc","cache-control","connection","content-disposition","content-encoding","content-language","content-length","content-location","content-md5","content-range","content-type","date","delta-base","etag","expires","im","last-modified","link","location","permanent","p3p","pragma","proxy-authenticate","public-key-pins","retry-after","server","status","strict-transport-security","trailer","transfer-encoding","tk","upgrade","vary","via","warning","www-authenticate","x-b3-traceid","x-frame-options"],eN=["authorization","cookie","set-cookie"],eL=function(e){return void 0===e&&(e=eb),ey.getInstance(e)},ej=function(e,t){eL(t).identityStore.editIdentity().setUserId(e).commit()},eU=function(e,t){eL(t).identityStore.editIdentity().setDeviceId(e).commit()},eM=null;(o=y||(y={})).Unknown="unknown",o.Skipped="skipped",o.Success="success",o.RateLimit="rate_limit",o.PayloadTooLarge="payload_too_large",o.Invalid="invalid",o.Failed="failed",o.Timeout="Timeout",o.SystemError="SystemError";var eq=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},[])},eF=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=y.Unknown),{event:e,code:t,message:n}},eB="Amplitude Logger ",e$=function(){function e(){this.logLevel=g.None}return e.prototype.disable=function(){this.logLevel=g.None},e.prototype.enable=function(e){void 0===e&&(e=g.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<g.Verbose||console.log("".concat(eB,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<g.Warn||console.warn("".concat(eB,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<g.Error||console.error("".concat(eB,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<g.Debug||console.log("".concat(eB,"[Debug]: ").concat(e.join(" ")))},e}(),eH=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:eb,logLevel:g.Warn,loggerProvider:new e$,offline:!1,optOut:!1,serverUrl:ew,serverZone:"US",useBatch:!1}},eV=function(){function e(e){this._optOut=!1;var t,n,r,i,o=eH();this.apiKey=e.apiKey,this.flushIntervalMillis=null!=(t=e.flushIntervalMillis)?t:o.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||o.flushQueueSize,this.instanceName=e.instanceName||o.instanceName,this.loggerProvider=e.loggerProvider||o.loggerProvider,this.logLevel=null!=(n=e.logLevel)?n:o.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:o.offline,this.optOut=null!=(r=e.optOut)?r:o.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||o.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!=(i=e.useBatch)?i:o.useBatch,this.loggerProvider.enable(this.logLevel);var s=ez(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=s.serverZone,this.serverUrl=s.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e}
1,enumerable:!1,configurable:!0}),e}(),ez=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=eH().serverZone),void 0===n&&(n=eH().useBatch),e)return{serverUrl:e,serverZone:void 0};var r,i=["US","EU"].includes(t)?t:eH().serverZone;return{serverZone:i,serverUrl:(r=n,"EU"===i?r?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":r?"https://api2.amplitude.com/batch":ew)}},eJ=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}();function eK(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var eW=function(){function 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=[]}return e.prototype.setup=function(e){var t;return N(this,void 0,void 0,function(){var n,r=this;return L(this,function(i){switch(i.label){case 0:return this.config=e,this.storageKey="".concat(em,"_").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=W()),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),N(this,void 0,void 0,function(){var t,n,r=this;return L(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,eq(t,this.config.flushQueueSize).reduce(function(t,n){return N(r,void 0,void 0,function(){return L(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){return void 0===t&&(t=!0),N(this,void 0,void 0,function(){var n,r,i,o;return L(this,function(s){switch(s.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];n={api_key:this.config.apiKey,events:e.map(function(e){var t=e.event;return t.extra,D(t,["extra"])}),options:{min_id_length:this.config.minIdLength},client_upload_time:new Date().toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new eJ,s.label=1;case 1:return s.trys.push([1,3,,4]),r=ez(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(r,n)];case 2:if(null===(i=s.sent()))return this.fulfillRequest(e,0,"Unexpected error occurred"),[2];if(!t)return"body"in i?this.fulfillRequest(e,i.statusCode,"".concat(i.status,": ").concat(eK(i))):this.fulfillRequest(e,i.statusCode,i.status),[2];return this.handleResponse(i,e),[3,4];case 3:var a;return o=(a=s.sent())instanceof Error?a.message:String(a),this.config.loggerProvider.error(o),this.handleResponse({status:y.Failed,statusCode:0},e),[3,4];case 4:return[2]}})})},e.prototype.handleResponse=function(e,t){var n=e.status;switch(n){case y.Success:this.handleSuccessResponse(e,t);break;case y.Invalid:this.handleInvalidResponse(e,t);break;case y.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case y.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.config.loggerProvider.warn("{code: 0, error: \"Status '".concat(n,"' 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(M(M(M(M([],U(Object.values(e.body.eventsWithInvalidFields)),!1),U(Object.values(e.body.eventsWithMissingFields)),!1),U(Object.values(e.body.eventsWithInvalidIdLengths)),!1),U(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(eK(e));
1var 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(eK(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),c=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)});c.length>0&&this.config.loggerProvider.warn(eK(e));var l=this.removeEventsExceedFlushMaxRetries(c);this.scheduleEvents(l)},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){this.removeEvents(e),e.forEach(function(e){return e.callback(eF(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}(),eY=function(){function e(){this.name="identity",this.type="before",this.identityStore=eL().identityStore}return e.prototype.execute=function(e){return N(this,void 0,void 0,function(){var t;return L(this,function(n){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]})})},e.prototype.setup=function(e){return N(this,void 0,void 0,function(){return L(this,function(t){return e.instanceName&&(this.identityStore=eL(e.instanceName).identityStore),[2]})})},e}(),eG=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var n=e[t];if(!eQ(t,n))return!1}return!0},eQ=function(e,t){var n,r;if("string"!=typeof e)return!1;if(Array.isArray(t)){var i=!0;try{for(var o=j(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&&eG(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 eG(t);else if(!["number","string","boolean"].includes(typeof t))return!1;return!0},eX=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return R({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(m.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(m.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(m.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(m.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(m.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(m.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(m.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(m.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(m.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[m.CLEAR_ALL]="-",this},e.prototype._safeSet=function(e,t,n){if(this._validate(e,t,n)){var r=this._properties[e];return void 0===r&&(r={},this._properties[e]=r),r[t]=n,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,n){return!(void 0!==this._properties[m.CLEAR_ALL]||this._propertySet.has(t))&&(e===m.ADD?"number"==typeof n:e===m.UNSET||e===m.REMOVE||eQ(t,n))},e}();(s=m||(m={})).SET="$set",s.SET_ONCE="$setOnce",s.ADD="$add",s.APPEND="$append",s.PREPEND="$prepend",s.REMOVE="$remove",s.PREINSERT="$preInsert",s.POSTINSERT="$postInsert",s.UNSET="$unset",s.CLEAR_ALL="$clearAll";var eZ=[m.CLEAR_ALL,m.UNSET,m.SET,m.SET_ONCE,m.ADD,m.APPEND,m.PREPEND,m.PREINSERT,m.POSTINSERT,m.REMOVE],e0=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){return eG(e)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?R({},this.properties):{};return e[b.REVENUE_PRODUCT_ID]=this.productId,e[b.REVENUE_QUANTITY]=this.quantity,e[b.REVENUE_PRICE]=this.price,e[b.REVENUE_TYPE]=this.revenueType,e[b.REVENUE_CURRENCY]=this.currency,e[b.REVENUE]=this.revenue,e[b.RECEIPT]=this.receipt,e[b.RECEIPT_SIG]=this.receiptSig,e},e}();(a=b||(b={})).REVENUE_PRODUCT_ID="$productId",a.REVENUE_QUANTITY="$quantity",a.REVENUE_PRICE="$price",a.REVENUE_TYPE="$revenueType",a.REVENUE_CURRENCY="$currency",a.REVENUE="$revenue",a.RECEIPT="$receipt",a.RECEIPT_SIG="$receiptSig";var e1=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e};(u=w||(w={})).SET="$set",u.SET_ONCE="$setOnce",u.ADD="$add",u.APPEND="$append",u.PREPEND="$prepend",u.REMOVE="$remove",u.PREINSERT="$preInsert",u.POSTINSERT="$postInsert",u.UNSET="$unset",u.CLEAR_ALL="$clearAll",(c=E||(E={})).IDENTIFY="$identify",c.GROUP_IDENTIFY="$groupidentify",c.REVENUE="revenue_amount";var e2=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[]}return e.prototype.register=function(e,t){var n,r;return N(this,void 0,void 0,function(){return L(this,function(i){switch(i.label){case 0:if(this.plugins.some(function(t){return t.name===e.name}))return this.loggerProvider.warn("Plugin with name ".concat(e.name," already exists, skipping registration")),[2];return void 0===e.name&&(e.name=W(),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."))),e.type=null!=(n=e.type)?n:"enrichment",[4,null==(r=e.setup)?void 0:r.call(e,t,this.client)];case 1:return i.sent(),this.plugins.push(e),[2]}})})},e.prototype.deregister=function(e,t){var n;return N(this,void 0,void 0,function(){var r,i;return L(this,function(o){switch(o.label){case 0:if(-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.applying=!1,this.plugins.map(function(e){var t;return null==(t=e.teardown)?void 0:t.call(e)}),this.plugins=[],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 N(this,void 0,void 0,function(){var t,n,r,i,o,s,a,u,c,l,d,f,p,h,v;return L(this,function(g){switch(g.label){case 0:if(!e)return[2];t=U(e,1)[0],n=U(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=j(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(R({},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];
1case 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]),l=(c=j(u)).next(),g.label=10;case 10:if(l.done)return[3,13];if(!(s=l.value).execute)return[3,12];return[4,s.execute(R({},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 l=c.next(),[3,10];case 13:return[3,16];case 14:return h={error:g.sent()},[3,16];case 15:try{l&&!l.done&&(v=c.return)&&v.call(c)}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=R({},t);return e.execute(n).catch(function(e){return eF(n,0,String(e))})})).then(function(e){var r=U(e,1)[0]||eF(t,100,"Event not tracked, no destination plugins on the instance");n(r)}),[2]}})})},e.prototype.flush=function(){return N(this,void 0,void 0,function(){var e,t=this;return L(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.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)})},e}(),e3=function(e,t){return R(R({},t),{event_type:E.IDENTIFY,user_properties:e.getUserProperties()})},e4=function(e,t,n,r){var i;return R(R({},r),{event_type:E.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:((i={})[e]=t,i)})},e5=function(e,t,n){var r,i=new eX;return i.set(e,t),R(R({},n),{event_type:E.IDENTIFY,user_properties:i.getUserProperties(),groups:((r={})[e]=t,r)})},e6=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 e2(this),this.name=e}return e.prototype._init=function(e){return N(this,void 0,void 0,function(){return L(this,function(t){switch(t.label){case 0:return this.config=e,this.timeline.reset(this),this.timeline.loggerProvider=this.config.loggerProvider,[4,this.runQueuedFunctions("q")];case 1:return t.sent(),this.isReady=!0,[2]}})})},e.prototype.runQueuedFunctions=function(e){return N(this,void 0,void 0,function(){var t,n,r,i,o,s;return L(this,function(a){switch(a.label){case 0:t=this[e],this[e]=[],a.label=1;case 1:a.trys.push([1,8,9,10]),r=(n=j(t)).next(),a.label=2;case 2:if(r.done)return[3,7];if(!((i=(0,r.value)())&&"promise"in i))return[3,4];return[4,i.promise];case 3:return a.sent(),[3,6];case 4:return[4,i];case 5:a.sent(),a.label=6;case 6:return r=n.next(),[3,2];case 7:return[3,10];case 8:return o={error:a.sent()},[3,10];case 9:try{r&&!r.done&&(s=n.return)&&s.call(n)}finally{if(o)throw o.error}return[7];case 10:if(!this[e].length)return[3,12];return[4,this.runQueuedFunctions(e)];case 11:a.sent(),a.label=12;case 12:return[2]}})})},e.prototype.track=function(e,t,n){var r=R(R(R({},"string"==typeof e?{event_type:e}:e),n),t&&{event_properties:t});return V(this.dispatch(r))},e.prototype.identify=function(e,t){var n=e3(e,t);return V(this.dispatch(n))},e.prototype.groupIdentify=function(e,t,n,r){var i=e4(e,t,n,r);return V(this.dispatch(i))},e.prototype.setGroup=function(e,t,n){var r=e5(e,t,n);return V(this.dispatch(r))},e.prototype.revenue=function(e,t){var n=R(R({},t),{event_type:E.REVENUE,event_properties:e.getEventProperties()});return V(this.dispatch(n))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),V())},e.prototype._addPlugin=function(e){return V(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)),V())},e.prototype._removePlugin=function(e){return V(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(eF(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return N(this,void 0,void 0,function(){var t=this;return L(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={};if(void 0===e)return t;var n={};return Object.keys(e).forEach(function(t){Object.values(w).includes(t)||(n[t]=e[t])}),eZ.forEach(function(n){if(Object.keys(e).includes(n)){var r=e[n];switch(n){case w.CLEAR_ALL:Object.keys(t).forEach(function(e){delete t[e]});break;case w.UNSET:Object.keys(r).forEach(function(e){delete t[e]});break;case w.SET:Object.assign(t,r)}}}),Object.assign(t,n),t},e.prototype.process=function(e){return N(this,void 0,void 0,function(){var t,n,r;return L(this,function(i){switch(i.label){case 0:if(i.trys.push([0,2,,3]),this.config.optOut)return[2,eF(e,0,"Event skipped due to optOut config")];return e.event_type===E.IDENTIFY&&(t=this.getOperationAppliedUserProperties(e.user_properties),this.timeline.onIdentityChanged({userProperties:t})),[4,this.timeline.push(e)];case 1:return 200===(n=i.sent()).code?this.config.loggerProvider.log(n.message):100===n.code?this.config.loggerProvider.warn(n.message):this.config.loggerProvider.error(n.message),[2,n];case 2:return r=String(i.sent()),this.config.loggerProvider.error(r),[2,n=eF(e,0,r)];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.timeline.onOptOutChanged(e),this.config.optOut=!!e)},e.prototype.flush=function(){return V(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}(),e7=function(e,t){return"boolean"==typeof e?e:(null==e?void 0:e[t])!==!1},e8=function(e){return e7(e,"attribution")},e9=function(e){return e7(e,"pageViews")},te=function(e){return e7(e,"sessions")},tt=function(e){return"object"==typeof e&&(!0===e.networkTracking||"object"==typeof e.networkTracking)},tn=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},tr=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.frustrationInteractions||"object"==typeof e.frustrationInteractions)},ti=function(e){if(tn(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},to=function(e){if(tr(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.frustrationInteractions)return e.autocapture.frustrationInteractions},ts=function(e){var t;if(tt(e.autocapture)){var n=void 0;return"object"==typeof e.autocapture&&"object"==typeof e.autocapture.
1networkTracking?n=e.autocapture.networkTracking:e.networkTrackingOptions&&(n=e.networkTrackingOptions),R(R({},n),{captureRules:null==(t=null==n?void 0:n.captureRules)?void 0:t.map(function(t){var n,r,i;if((null==(n=t.urls)?void 0:n.length)&&(null==(r=t.hosts)?void 0:r.length)){var o=JSON.stringify(t.hosts),s=JSON.stringify(t.urls);return null==(i=e.loggerProvider)||i.warn("Found network capture rule with both urls='".concat(s,"' and hosts='").concat(o,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),R(R({},t),{hosts:void 0})}return t})})}},ta=function(e){var t,n=function(){return!1},r=void 0,i=e.pageCounter;return e9(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}},tu=function(e,t){tc(e,t)},tc=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},tl=function(e){return e&&void 0!==e._q},td=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:""},tf="2.25.4",tp="amplitude-ts",th=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(tp,"/").concat(tf),"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 N(this,void 0,void 0,function(){var r,i,o;return L(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,R(R(R(R(R(R(R(R({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:td()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:W(),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}(),tv=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return N(this,void 0,void 0,function(){return L(this,function(e){return[2,!0]})})},e.prototype.get=function(e){return N(this,void 0,void 0,function(){return L(this,function(t){return[2,this.memoryStorage.get(e)]})})},e.prototype.getRaw=function(e){return N(this,void 0,void 0,function(){var t;return L(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 N(this,void 0,void 0,function(){return L(this,function(n){return this.memoryStorage.set(e,t),[2]})})},e.prototype.remove=function(e){return N(this,void 0,void 0,function(){return L(this,function(t){return this.memoryStorage.delete(e),[2]})})},e.prototype.reset=function(){return N(this,void 0,void 0,function(){return L(this,function(e){return this.memoryStorage.clear(),[2]})})},e}(),tg=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),["AMP",t,e.substring(0,n)].filter(Boolean).join("_")},ty=function(){function e(e){this.options=R({},e)}return e.prototype.isEnabled=function(){return N(this,void 0,void 0,function(){var t,n;return L(this,function(r){switch(r.label){case 0:if(!J())return[2,!1];e.testValue=String(Date.now()),t=new e(this.options),n="AMP_TEST",r.label=1;case 1:return r.trys.push([1,4,5,7]),[4,t.set(n,e.testValue)];case 2:return r.sent(),[4,t.get(n)];case 3:return[2,r.sent()===e.testValue];case 4:return r.sent(),[2,!1];case 5:return[4,t.remove(n)];case 6:return r.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(e){var t;return N(this,void 0,void 0,function(){var n,r;return L(this,function(i){switch(i.label){case 0:return[4,this.getRaw(e)];case 1:if(!(n=i.sent()))return[2,void 0];try{if(r=null!=(t=tm(n))?t:tb(n),void 0===r)return console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(n)),[2,void 0];return[2,JSON.parse(r)]}catch(t){return console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(n)),[2,void 0]}}})})},e.prototype.getRaw=function(e){var t,n;return N(this,void 0,void 0,function(){var r,i;return L(this,function(o){return(i=(null!=(n=null==(t=null==(r=J())?void 0:r.document)?void 0:t.cookie.split("; "))?n:[]).find(function(t){return 0===t.indexOf(e+"=")}))?[2,i.substring(e.length+1)]:[2,void 0]})})},e.prototype.set=function(e,t){var n;return N(this,void 0,void 0,function(){var r,i,o,s,a,u,c;return L(this,function(l){try{r=null!=(n=this.options.expirationDays)?n:0,i=null!==t?r:-1,o=void 0,i&&((s=new Date).setTime(s.getTime()+24*i*36e5),o=s),a="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t)))),o&&(a+="; expires=".concat(o.toUTCString())),a+="; path=/",this.options.domain&&(a+="; domain=".concat(this.options.domain)),this.options.secure&&(a+="; Secure"),this.options.sameSite&&(a+="; SameSite=".concat(this.options.sameSite)),(u=J())&&(u.document.cookie=a)}catch(t){c=t instanceof Error?t.message:String(t),console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(c))}return[2]})})},e.prototype.remove=function(e){return N(this,void 0,void 0,function(){return L(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 N(this,void 0,void 0,function(){return L(this,function(e){return[2]})})},e}(),tm=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},tb=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},tw=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){if("object"!=typeof e)return null;var t,n,r,i,o,s,a,u,c,l,d,f,p,h,v,g,m,b,w,E,S,_,T=e.code||0,k=this.buildStatus(T);switch(k){case y.Success:return{status:k,statusCode:T,body:{eventsIngested:null!=(t=e.events_ingested)?t:0,payloadSizeBytes:null!=(n=e.payload_size_bytes)?n:0,serverUploadTime:null!=(r=e.server_upload_time)?r:0}};case y.Invalid:return{status:k,statusCode:T,body:{error:null!=(i=e.error)?i:"",missingField:null!=(o=e.missing_field)?o:"",eventsWithInvalidFields:null!=(s=e.events_with_invali
1d_fields)?s:{},eventsWithMissingFields:null!=(a=e.events_with_missing_fields)?a:{},eventsWithInvalidIdLengths:null!=(u=e.events_with_invalid_id_lengths)?u:{},epsThreshold:null!=(c=e.eps_threshold)?c:0,exceededDailyQuotaDevices:null!=(l=e.exceeded_daily_quota_devices)?l:{},silencedDevices:null!=(d=e.silenced_devices)?d:[],silencedEvents:null!=(f=e.silenced_events)?f:[],throttledDevices:null!=(p=e.throttled_devices)?p:{},throttledEvents:null!=(h=e.throttled_events)?h:[]}};case y.PayloadTooLarge:return{status:k,statusCode:T,body:{error:null!=(v=e.error)?v:""}};case y.RateLimit:return{status:k,statusCode:T,body:{error:null!=(g=e.error)?g:"",epsThreshold:null!=(m=e.eps_threshold)?m:0,throttledDevices:null!=(b=e.throttled_devices)?b:{},throttledUsers:null!=(w=e.throttled_users)?w:{},exceededDailyQuotaDevices:null!=(E=e.exceeded_daily_quota_devices)?E:{},exceededDailyQuotaUsers:null!=(S=e.exceeded_daily_quota_users)?S:{},throttledEvents:null!=(_=e.throttled_events)?_:[]}};case y.Timeout:default:return{status:k,statusCode:T}}},e.prototype.buildStatus=function(e){return e>=200&&e<300?y.Success:429===e?y.RateLimit:413===e?y.PayloadTooLarge:408===e?y.Timeout:e>=400&&e<500?y.Invalid:e>=500?y.Failed:y.Unknown},e}(),tE=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return C(t,e),t.prototype.send=function(e,t){return N(this,void 0,void 0,function(){var n,r;return L(this,function(i){switch(i.label){case 0:if("u"<typeof fetch)throw Error("FetchTransport is not supported");return[4,fetch(e,{headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(t),method:"POST"})];case 1:return[4,(n=i.sent()).text()];case 2:r=i.sent();try{return[2,this.buildResponse(JSON.parse(r))]}catch(e){return[2,this.buildResponse({code:n.status})]}}})})},t}(tw),tS=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return N(this,void 0,void 0,function(){var t,n,r;return L(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 N(this,void 0,void 0,function(){var t;return L(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 N(this,void 0,void 0,function(){return L(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 N(this,void 0,void 0,function(){return L(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 N(this,void 0,void 0,function(){return L(this,function(n){try{null==(t=this.storage)||t.removeItem(e)}catch(e){}return[2]})})},e.prototype.reset=function(){var e;return N(this,void 0,void 0,function(){return L(this,function(t){try{null==(e=this.storage)||e.clear()}catch(e){}return[2]})})},e}(),t_=function(e){function t(t){var n,r,i,o=this;try{i=null==(n=J())?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 C(t,e),t.prototype.set=function(t,n){var r;return N(this,void 0,void 0,function(){var i;return L(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}(tS),tT=function(e){function t(){var t;return e.call(this,null==(t=J())?void 0:t.sessionStorage)||this}return C(t,e),t}(tS),tk=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={done:4},t}return C(t,e),t.prototype.send=function(e,t){return N(this,void 0,void 0,function(){var n=this;return L(this,function(r){return[2,new Promise(function(r,i){"u"<typeof XMLHttpRequest&&i(Error("XHRTransport is not supported."));var o=new XMLHttpRequest;o.open("POST",e,!0),o.onreadystatechange=function(){if(o.readyState===n.state.done){var e=o.responseText;try{r(n.buildResponse(JSON.parse(e)))}catch(e){r(n.buildResponse({code:o.status}))}}},o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Accept","*/*"),o.send(JSON.stringify(t))})]})})},t}(tw),tI=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return C(t,e),t.prototype.send=function(e,t){return N(this,void 0,void 0,function(){var n=this;return L(this,function(r){return[2,new Promise(function(r,i){var o=J();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,JSON.stringify(t)))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}(tw),tP=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},tO=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},tx="[Amplitude]",tA="".concat(tx," Form Started"),tC="".concat(tx," Form Submitted"),tR="".concat(tx," File Downloaded"),tD="session_start",tN="session_end",tL="".concat(tx," File Extension"),tj="".concat(tx," File Name"),tU="".concat(tx," Link ID"),tM="".concat(tx," Link Text"),tq="".concat(tx," Link URL"),tF="".concat(tx," Form ID"),tB="".concat(tx," Form Name"),t$="".concat(tx," Form Destination"),tH="cookie",tV=function(e){function t(t,n,r,i,o,s,a,u,c,l,d,f,p,h,v,y,m,b,w,E,S,_,T,k,I,P,O,x,A,C,R,D,N,L,j,U,M,q,F){void 0===r&&(r=new tv),void 0===i&&(i={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),void 0===u&&(u=1e3),void 0===c&&(c=5),void 0===l&&(l=30),void 0===d&&(d=tH),void 0===y&&(y=new e$),void 0===m&&(m=g.Warn),void 0===w&&(w=!1),void 0===E&&(E=!1),void 0===T&&(T=""),void 0===k&&(k="US"),void 0===P&&(P=18e5),void 0===O&&(O=new t_({loggerProvider:y})),void 0===x&&(x={ipAddress:!0,language:!0,platform:!0}),void 0===A&&(A="fetch"),void 0===C&&(C=!1),void 0===R&&(R=!0),void 0===M&&(M=!0),void 0===q&&(q=0);var B=e.call(this,{apiKey:t,storageProvider:O,transportProvider:tJ(A)})||this;return B.apiKey=t,B.appVersion=n,B.cookieOptions=i,B.defaultTracking=o,B.autocapture=s,B.flushIntervalMillis=u,B.flushMaxRetries=c,B.flushQueueSize=l,B.identityStorage=d,B.ingestionMetadata=f,B.instanceName=p,B.loggerProvider=y,B.logLevel=m,B.minIdLength=b,B.offline=w,B.partnerId=S,B.plan=_,B.serverUrl=T,B.serverZone=k,B.sessionTimeout=P,B.storageProvider=O,B.trackingOptions=x,B.transport=A,B.useBatch=C,B.fetchRemoteConfig=R,B.networkTrackingOptions=j,B.identify=U,B.enableDiagnostics=M,B.diagnosticsSampleRate=q,B.diagnosticsClient=F,B.version=tf,B._optOut=!1,B._cookieStorage=r,B.deviceId=a,B.lastEventId=h,B.lastEventTime=v,B.optOut=E,B.sessionId=I,B.pageCounter=N,B.userId=D,B.debugLogsEnabled=L,B.loggerProvider.enable(L?g.Debug:B.logLevel),B.networkTrackingOptions=j,B.identify=U,B.enableDiagnostics=M,B.diagnosticsSampleRate=q,B.diagnosticsClient=F,B}
1return C(t,e),Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(e){this._cookieStorage!==e&&(this._cookieStorage=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(e){this._deviceId!==e&&(this._deviceId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(e){this._userId!==e&&(this._userId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(e){this._sessionId!==e&&(this._sessionId=e,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,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled};this.cookieStorage.set(tg(this.apiKey),e)},t}(eV),tz=function(e,t){switch(void 0===e&&(e=tH),void 0===t&&(t={}),e){case"localStorage":return new t_;case"sessionStorage":return new tT;case"none":return new tv;default:return new ty(R(R({},t),{expirationDays:t.expiration}))}},tJ=function(e){return"xhr"===e?new tk:"beacon"===e?new tI:new tE},tK=function(){var e="ampIntegrationContext";return"u">typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof self?self:void 0!==n.g?n.g:void 0},tW=function(){var e,t=tK();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=tY(n[0]),i=tY(n[1]);return i&&(e[r]=i),e},{}):{}},tY=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},tG="dclid",tQ="fbclid",tX="gbraid",tZ="gclid",t0="ko_click_id",t1="li_fat_id",t2="msclkid",t3="rdt_cid",t4="ttclid",t5="twclid",t6="wbraid",t7={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},t8=function(){function e(){}return e.prototype.parse=function(){return N(this,void 0,void 0,function(){return L(this,function(e){return[2,R(R(R(R({},t7),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var e=tW();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=null!=(t=null==(e=n.referrer)?void 0:e.split("/")[2])?t:void 0}catch(e){}return n},e.prototype.getClickIds=function(){var e,t=tW();return(e={})[tG]=t[tG],e[tQ]=t[tQ],e[tX]=t[tX],e[tZ]=t[tZ],e[t0]=t[t0],e[t1]=t[t1],e[t2]=t[t2],e[t3]=t[t3],e[t4]=t[t4],e[t5]=t[t5],e[t6]=t[t6],e},e}();(l=S||(S={})).SET="$set",l.SET_ONCE="$setOnce",l.ADD="$add",l.APPEND="$append",l.PREPEND="$prepend",l.REMOVE="$remove",l.PREINSERT="$preInsert",l.POSTINSERT="$postInsert",l.UNSET="$unset",l.CLEAR_ALL="$clearAll",(d=_||(_={})).REVENUE_PRODUCT_ID="$productId",d.REVENUE_QUANTITY="$quantity",d.REVENUE_PRICE="$price",d.REVENUE_TYPE="$revenueType",d.REVENUE_CURRENCY="$currency",d.REVENUE="$revenue",(f=T||(T={})).IDENTIFY="$identify",f.GROUP_IDENTIFY="$groupidentify",f.REVENUE="revenue_amount";var t9=function(e){var t={};for(var n in e){var r=e[n];r&&(t[n]=r)}return t},ne=function(e){void 0===e&&(e={});var t,n,r=tK(),i=void 0,o=!1,s=e.trackOn,a=e.trackHistoryChanges,u=e.eventType,c=void 0===u?"[Amplitude] Page Viewed":u,l=function(e){var t=e;try{t=decodeURI(e)}catch(e){null==i||i.error("Malformed URI sequence: ",e)}return t},d=function(){return N(void 0,void 0,void 0,function(){var e,t,n;return L(this,function(r){switch(r.label){case 0:return e=l("u">typeof location&&location.href||""),n={event_type:c},t=[{}],[4,nt()];case 1:return[2,(n.event_properties=R.apply(void 0,[R.apply(void 0,t.concat([r.sent()])),{"[Amplitude] Page Domain":"u">typeof location&&location.hostname||"","[Amplitude] Page Location":e,"[Amplitude] Page Path":"u">typeof location&&l(location.pathname)||"","[Amplitude] Page Title":"u">typeof document&&document.title||"","[Amplitude] Page URL":e.split("?")[0]}]),n)]}})})},f=function(){return void 0===s||"function"==typeof s&&s()},p="u">typeof location?location.href:null,h=function(){return N(void 0,void 0,void 0,function(){var e,n,r,o;return L(this,function(s){switch(s.label){case 0:if(n=nr(a,e=location.href,p||"")&&f(),p=e,!n)return[3,4];if(null==i||i.log("Tracking page view event"),null!=t)return[3,1];return[3,3];case 1:return o=(r=t).track,[4,d()];case 2:o.apply(r,[s.sent()]),s.label=3;case 3:s.label=4;case 4:return[2]}})})},v=function(){h()};return{name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,s){return N(void 0,void 0,void 0,function(){var a,u;return L(this,function(c){switch(c.label){case 0:if(t=s,n=e,(i=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),o=!0,r&&(r.addEventListener("popstate",v),r.history.pushState=new Proxy(r.history.pushState,{apply:function(e,t,n){var r=U(n,3),i=r[0],s=r[1],a=r[2];e.apply(t,[i,s,a]),o&&h()}})),!f())return[3,2];return i.log("Tracking page view event"),u=(a=t).track,[4,d()];case 1:u.apply(a,[c.sent()]),c.label=2;case 2:return[2]}})})},execute:function(e){return N(void 0,void 0,void 0,function(){var t;return L(this,function(r){switch(r.label){case 0:if(!("attribution"===s&&nn(e)))return[3,2];
1return null==i||i.log("Enriching campaign event to page view event with campaign parameters"),[4,d()];case 1:e.event_type=(t=r.sent()).event_type,e.event_properties=R(R({},e.event_properties),t.event_properties),r.label=2;case 2:return n&&e.event_type===c&&(n.pageCounter=n.pageCounter?n.pageCounter+1:1,e.event_properties=R(R({},e.event_properties),{"[Amplitude] Page Counter":n.pageCounter})),[2,e]}})})},teardown:function(){return N(void 0,void 0,void 0,function(){return L(this,function(e){return r&&(r.removeEventListener("popstate",v),o=!1),[2]})})}}},nt=function(){return N(void 0,void 0,void 0,function(){var e;return L(this,function(t){switch(t.label){case 0:return e=t9,[4,new t8().parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}})})},nn=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,n=t[S.SET]||{},r=t[S.UNSET]||{},i=M(M([],U(Object.keys(n)),!1),U(Object.keys(r)),!1);return Object.keys(t7).every(function(e){return i.includes(e)})}return!1},nr=function(e,t,n){if("pathOnly"!==e)return t!==n;if(""==n)return!0;var r=new URL(t),i=new URL(n);return r.origin+r.pathname!==i.origin+i.pathname},ni=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-form-interaction-tracking-browser",type:"enrichment",setup:function(t,r){return N(void 0,void 0,void 0,function(){var i,o;return L(this,function(s){return i=function(){if(!r)return void t.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.");if("u">typeof document){var i=function(e){var t=!1;n(e,"change",function(){var n,i=ns(e);t||r.track(tA,((n={})[tF]=no(e.id),n[tB]=no(e.name),n[t$]=i,n)),t=!0}),n(e,"submit",function(){var n,i,o=ns(e);t||r.track(tA,((n={})[tF]=no(e.id),n[tB]=no(e.name),n[t$]=o,n)),r.track(tC,((i={})[tF]=no(e.id),i[tB]=no(e.name),i[t$]=o,i)),t=!1})};Array.from(document.getElementsByTagName("form")).forEach(i),"u">typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){"FORM"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("form")).map(i)})})})).observe(document.body,{subtree:!0,childList:!0})}},"complete"===document.readyState?i():(o=J())?o.addEventListener("load",i):t.loggerProvider.debug("Form interaction tracking is not installed because global is undefined."),[2]})})},execute:function(e){return N(void 0,void 0,void 0,function(){return L(this,function(t){return[2,e]})})},teardown:function(){return N(void 0,void 0,void 0,function(){return L(this,function(t){return null==e||e.disconnect(),r(),[2]})})}}},no=function(e){if("string"==typeof e)return e},ns=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(null!=t?t:""),window.location.href).href}catch(e){}return t},na=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 N(void 0,void 0,void 0,function(){var i,o;return L(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={})[tL]=s,n[tj]=t.pathname,n[tU]=e.id,n[tM]=e.text,n[tq]=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.forEac
1h(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=J())?o.addEventListener("load",i):t.loggerProvider.debug("File download tracking is not installed because global is undefined."),[2]})})},execute:function(e){return N(void 0,void 0,void 0,function(){return L(this,function(t){return[2,e]})})},teardown:function(){return N(void 0,void 0,void 0,function(){return L(this,function(t){return null==e||e.disconnect(),r(),[2]})})}}},nu=!1,nc=function(e){nu||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."),nu=!0)},nl=function(){var e=J(),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 N(void 0,void 0,void 0,function(){return L(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(){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 N(void 0,void 0,void 0,function(){return L(this,function(e){return r(),[2]})})}}};function nd(e,t,n){var r,i,o=[];try{for(var s=j(null!=t?t:[]),a=s.next();!a.done;a=s.next()){var u=a.value;try{o.push(new RegExp(u))}catch(e){n.loggerProvider.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 nf=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],np="data-amp-track-",nh=["div","span","h1","h2","h3","h4","h5","h6"],nv="[Amplitude] Element Clicked",ng="[Amplitude] Rage Click",ny="[Amplitude] Element Tag",nm="[Amplitude] Element Text",nb="[Amplitude] Page URL",nw="https://app.amplitude.com",nE={US:nw,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"},nS="data-amp-mask-attributes",n_="data-amp-mask",nT="*****";function nk(e){return"function"==typeof e}function nI(e){return function(t){if(nk(null==t?void 0:t.lift))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError("Unable to lift unknown Observable type")}}function nP(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var nO=nP(function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map(function(e,t){return t+1+") "+e.toString()}).join("\n  "):"",this.name="UnsubscriptionError",this.errors=t}});function nx(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var nA=function(){var e;function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e,t,n,r,i,o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=j(o),a=s.next();!a.done;a=s.next())a.value.remove(this)}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}else o.remove(this);var u=this.initialTeardown;
1if(nk(u))try{u()}catch(e){i=e instanceof nO?e.errors:[e]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var l=j(c),d=l.next();!d.done;d=l.next()){var f=d.value;try{nD(f)}catch(e){i=null!=i?i:[],e instanceof nO?i=M(M([],U(i)),U(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}}if(i)throw new nO(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)nD(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!=(n=this._finalizers)?n:[]).push(e)}},t.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},t.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},t.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&nx(t,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&nx(n,e),e instanceof t&&e._removeParent(this)},(e=new t).closed=!0,t.EMPTY=e,t}(),nC=nA.EMPTY;function nR(e){return e instanceof nA||e&&"closed"in e&&nk(e.remove)&&nk(e.add)&&nk(e.unsubscribe)}function nD(e){nk(e)?e():e.unsubscribe()}var nN=void 0,nL={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=nL.delegate;return(null==i?void 0:i.setTimeout)?i.setTimeout.apply(i,M([e,t],U(n))):setTimeout.apply(void 0,M([e,t],U(n)))},clearTimeout:function(e){var t=nL.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function nj(e){nL.setTimeout(function(){!1;throw e})}function nU(){}var nM=nq("C",void 0,void 0);function nq(e,t,n){return{kind:e,value:t,error:n}}var nF=null;function nB(e){var t,n,r,i;1;e()}var n$=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,nR(t)&&t.add(n)):n.destination=nY,n}return C(t,e),t.create=function(e,t,n){return new nJ(e,t,n)},t.prototype.next=function(e){this.isStopped?nW(nq("N",e,void 0),this):this._next(e)},t.prototype.error=function(e){this.isStopped?nW(nq("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?nW(nM,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(nA),nH=Function.prototype.bind;function nV(e,t){return nH.call(e,t)}var nz=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){nK(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){nK(e)}else nK(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){nK(e)}},e}(),nJ=function(e){function t(t,n,r){var i,o,s=e.call(this)||this;return nk(t)||!t?i={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:i=t,s.destination=new nz(i),s}return C(t,e),t}(n$);function nK(e){1;nj(e)}function nW(e,t){}var nY={closed:!0,next:nU,error:function(e){throw e},complete:nU};function nG(e,t,n,r,i){return new nQ(e,t,n,r,i)}var nQ=function(e){function t(t,n,r,i,o,s){var a=e.call(this,t)||this;return a.onFinalize=o,a.shouldUnsubscribe=s,a._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return C(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),n||null==(t=this.onFinalize)||t.call(this)}},t}(n$);function nX(e,t){return nI(function(n,r){var i=0;n.subscribe(nG(r,function(n){r.next(e.call(t,n,i++))}))})}var nZ=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function n0(e){return nk(null==e?void 0:e.then)}var n1="function"==typeof Symbol&&Symbol.observable||"@@observable";function n2(e){return e}var n3=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this,i=!function(e){return e&&e instanceof n$||e&&nk(e.next)&&nk(e.error)&&nk(e.complete)&&nR(e)}(e)?new nJ(e,t,n):e;return nB(function(){var e=r.operator,t=r.source;i.add(e?e.call(i,t):t?r._subscribe(i):r._trySubscribe(i))}),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=n4(t))(function(t,r){var i=new nJ({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){var t;return null==(t=this.source)?void 0:t.subscribe(e)},e.prototype[n1]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0===e.length?n2:1===e.length?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)})(this)},e.prototype.toPromise=function(e){var t=this;return new(e=n4(e))(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}();function n4(e){var t;return null!=(t=null!=e?e:nN)?t:Promise}function n5(e){return Symbol.asyncIterator&&nk(null==e?void 0:e[Symbol.asyncIterator])}function n6(e){return TypeError("You provided "+(null!==e&&"object"==typeof e?"an invali
1d object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var n7="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function n8(e){return nk(null==e?void 0:e[n7])}function n9(e){return function(e,t,n){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",function(e){return function(t){return Promise.resolve(t).then(e,c)}}),r[Symbol.asyncIterator]=function(){return this},r;function s(e,t){i[e]&&(r[e]=function(t){return new Promise(function(n,r){o.push([e,t,n,r])>1||a(e,t)})},t&&(r[e]=t(r[e])))}function a(e,t){try{var n;(n=i[e](t)).value instanceof q?Promise.resolve(n.value.v).then(u,c):l(o[0][2],n)}catch(e){l(o[0][3],e)}}function u(e){a("next",e)}function c(e){a("throw",e)}function l(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}(this,arguments,function(){var t,n,r;return L(this,function(i){switch(i.label){case 0:t=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,q(t.read())];case 3:if(r=(n=i.sent()).value,!n.done)return[3,5];return[4,q(void 0)];case 4:return[2,i.sent()];case 5:return[4,q(r)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function re(e){return nk(null==e?void 0:e.getReader)}function rt(e){if(e instanceof n3)return e;if(null!=e){var t,n,r,i;if(nk(e[n1])){return t=e,new n3(function(e){var n=t[n1]();if(nk(n.subscribe))return n.subscribe(e);throw TypeError("Provided object does not correctly implement Symbol.observable")})}if(nZ(e)){return n=e,new n3(function(e){for(var t=0;t<n.length&&!e.closed;t++)e.next(n[t]);e.complete()})}if(n0(e)){return r=e,new n3(function(e){r.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,nj)})}if(n5(e))return rn(e);if(n8(e)){return i=e,new n3(function(e){var t,n;try{for(var r=j(i),o=r.next();!o.done;o=r.next()){var s=o.value;if(e.next(s),e.closed)return}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}e.complete()})}if(re(e))return rn(n9(e))}throw n6(e)}function rn(e){return new n3(function(t){(function(e,t){var n,r,i,o;return N(this,void 0,void 0,function(){var s;return L(this,function(a){switch(a.label){case 0:a.trys.push([0,5,6,11]),n=function(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=j(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,i){var o,s,a;o=r,s=i,a=(t=e[n](t)).done,Promise.resolve(t.value).then(function(e){o({value:e,done:a})},s)})}}}(e),a.label=1;case 1:return[4,n.next()];case 2:if((r=a.sent()).done)return[3,4];if(s=r.value,t.next(s),t.closed)return[2];a.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return i={error:a.sent()},[3,11];case 6:if(a.trys.push([6,,9,10]),!(r&&!r.done&&(o=n.return)))return[3,8];return[4,o.call(n)];case 7:a.sent(),a.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})})(e,t).catch(function(e){return t.error(e)})})}var rr=nP(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),ri=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return C(t,e),t.prototype.lift=function(e){var t=new ro(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new rr},t.prototype.next=function(e){var t=this;nB(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=j(t.currentObservers),o=i.next();!o.done;o=i.next())o.value.next(e)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var t=this;nB(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;nB(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null==(e=this.observers)?void 0:e.length)>0}
1,enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this.hasError,r=this.isStopped,i=this.observers;return n||r?nC:(this.currentObservers=null,i.push(e),new nA(function(){t.currentObservers=null,nx(i,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this.hasError,n=this.thrownError,r=this.isStopped;t?e.error(n):r&&e.complete()},t.prototype.asObservable=function(){var e=new n3;return e.source=this,e},t.create=function(e,t){return new ro(e,t)},t}(n3),ro=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return C(t,e),t.prototype.next=function(e){var t,n;null==(n=null==(t=this.destination)?void 0:t.next)||n.call(t,e)},t.prototype.error=function(e){var t,n;null==(n=null==(t=this.destination)?void 0:t.error)||n.call(t,e)},t.prototype.complete=function(){var e,t;null==(t=null==(e=this.destination)?void 0:e.complete)||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!=(n=null==(t=this.source)?void 0:t.subscribe(e))?n:nC},t}(ri);function rs(e){void 0===e&&(e={});var t=e.connector,n=void 0===t?function(){return new ri}:t,r=e.resetOnError,i=void 0===r||r,o=e.resetOnComplete,s=void 0===o||o,a=e.resetOnRefCountZero,u=void 0===a||a;return function(e){var t,r,o,a=0,c=!1,l=!1,d=function(){null==r||r.unsubscribe(),r=void 0},f=function(){d(),t=o=void 0,c=l=!1},p=function(){var e=t;f(),null==e||e.unsubscribe()};return nI(function(e,h){a++,l||c||d();var v=o=null!=o?o:n();h.add(function(){0!=--a||l||c||(r=ra(p,u))}),v.subscribe(h),!t&&a>0&&(t=new nJ({next:function(e){return v.next(e)},error:function(e){l=!0,d(),r=ra(f,i,e),v.error(e)},complete:function(){c=!0,d(),r=ra(f,s),v.complete()}}),rt(e).subscribe(t))})(e)}}function ra(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(!0===t)return void e();if(!1!==t){var i=new nJ({next:function(){i.unsubscribe(),e()}});return rt(t.apply(void 0,M([],U(n)))).subscribe(i)}}function ru(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var o=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(o),!i)return o}function rc(e,t,n){return(void 0===n&&(n=1/0),nk(t))?rc(function(n,r){return nX(function(e,i){return t(n,e,r,i)})(rt(e(n,r)))},n):("number"==typeof t&&(n=t),nI(function(t,r){var i,o,s,a,u,c,l,d;return i=n,o=[],s=0,a=0,u=!1,c=function(){!u||o.length||s||r.complete()},l=function(e){return s<i?d(e):o.push(e)},d=function(t){s++;var n=!1;rt(e(t,a++)).subscribe(nG(r,function(e){r.next(e)},function(){n=!0},void 0,function(){if(n)try{for(s--;o.length&&s<i;)!function(){var e=o.shift();d(e)}();c()}catch(e){r.error(e)}}))},t.subscribe(nG(r,l,function(){u=!0,c()})),function(){}}))}var rl=Array.isArray,rd=["addListener","removeListener"],rf=["addEventListener","removeEventListener"],rp=["on","off"];function rh(e,t,n,r){if(nk(n)&&(r=n,n=void 0),r){return rh(e,t,n).pipe((i=r,nX(function(e){return rl(e)?i.apply(void 0,M([],U(e))):i(e)})))}var i,o,s,a,u=U(nk((o=e).addEventListener)&&nk(o.removeEventListener)?rf.map(function(r){return function(i){return e[r](t,i,n)}}):nk((s=e).addListener)&&nk(s.removeListener)?rd.map(rv(e,t)):nk((a=e).on)&&nk(a.off)?rp.map(rv(e,t)):[],2),c=u[0],l=u[1];if(!c&&nZ(e))return rc(function(e){return rh(e,t,n)})(rt(e));if(!c)throw TypeError("Invalid event target");return new n3(function(e){var t=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.next(1<t.length?t:t[0])};return c(t),function(){return l(t)}})}function rv(e,t){return function(n){return function(r){return e[n](t,r)}}}var rg=function(e,t){return!t||!t.length||t.some(function(t){return"string"==typeof t?e===t:e.match(t)})},ry=function(e,t){var n=e;try{n=decodeURI(e)}catch(e){null==t||t.error("Malformed URI sequence: ",e)}return n},rm=["input","select","textarea"],rb=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},rw=function(e,t,n){return void 0===n&&(n=!1),function(r,i){var o,s,a=e.pageUrlAllowlist,u=e.pageUrlExcludelist,c=e.shouldTrackEventResolver,l=null==(s=null==(o=null==i?void 0:i.tagName)?void 0:o.toLowerCase)?void 0:s.call(o);if(!l)return!1;if(c)return c(r,i);if(!rg(window.location.href,a)||u&&u.length>0&&rg(window.location.href,u))return!1;var d=String(null==i?void 0:i.getAttribute("type"))||"";if("string"==typeof d)switch(d.toLowerCase()){case"hidden":case"password":return!1}var f=rb(i,r);if(n&&f)return!0;
1if(t&&!t.some(function(e){var t;return!!(null==(t=null==i?void 0:i.matches)?void 0:t.call(i,e))}))return!1;switch(l){case"input":case"select":case"textarea":return"change"===r||"click"===r;default:if(f)return!0;return"click"===r}}},rE=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!rm.includes(i)&&!o},rS=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},{})},r_=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:r_(null==e?void 0:e.parentElement,t):null},rT=function(e){return null!==e.event.target&&!!e.closestTrackedAncestor},rk=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",nS,n_]),rI=["type"],rP=["svg","path","g"],rO=["password","hidden"],rx=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){}},rA=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}})},rC=/\b(?:\d[ -]*?){13,16}\b/,rR=/(\d{3}-?\d{2}-?\d{4})/g,rD=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,rN=function(e,t){var n,r,i,o=this;this.replaceSensitiveString=function(e){if("string"!=typeof e)return"";var t,n,r=e;r=(r=(r=r.replace(rC,nT)).replace(rR,nT)).replace(rD,nT);try{for(var i=j(o.additionalMaskTextPatterns),s=i.next();!s.done;s=i.next()){var a=s.value;try{r=r.replace(a,nT)}catch(e){}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},this.getHierarchy=function(e){var t,n,r,i,s=performance.now(),a=[];if(!e)return[];for(var u=function(e){var t=[];if(!e)return t;
1t.push(e);for(var n=e.parentElement;n&&"HTML"!==n.tagName;)t.push(n),n=n.parentElement;return t}(e),c=new Map,l=u.length-1;l>=0;l--){var d=u[l];if(d){var f,p=(f=d.getAttribute(nS))?f.split(",").map(function(e){return e.trim()}).filter(function(e){return e.length>0&&"id"!==e&&"class"!==e}):[],h=new Set(M(M([],U(l===u.length-1?[]:null!=(r=c.get(u[l+1]))?r:new Set),!1),U(p),!1));c.set(d,h)}}a=u.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(),c={tag:u},l=Array.from(null!=(o=null==(i=e.parentElement)?void 0:i.children)?o:[]);l.length&&(c.index=l.indexOf(e),c.indexOfType=l.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&&(c.prevSib=String(d));var f=e.getAttribute("id");f&&(c.id=String(f));var p=Array.from(e.classList);p.length&&(c.classes=p);var h={},v=Array.from(e.attributes).filter(function(e){return!rk.has(e.name)}),g=!rE(e);if(!rO.includes(String(e.getAttribute("type")))&&!rP.includes(u))try{for(var y=j(v),m=y.next();!m.done;m=y.next()){var b=m.value;if(!g||rI.includes(b.name)){if(t.has(b.name)){h[b.name]=nT;continue}h[b.name]=String(b.value).substring(0,128)}}}catch(e){n={error:e}}finally{try{m&&!m.done&&(r=y.return)&&r.call(y)}finally{if(n)throw n.error}}return Object.keys(h).length&&(c.attrs=h),c}(e,null!=(t=c.get(e))?t:new Set)});var v=function(e){(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach(function(t){var n=U(t,2),r=n[0],i=n[1];e.attrs&&(e.attrs[r]=o.replaceSensitiveString(i))})};try{for(var g=j(a),y=g.next();!y.done;y=g.next()){var m=y.value;v(m)}}catch(e){t={error:e}}finally{try{y&&!y.done&&(n=g.return)&&n.call(g)}finally{if(t)throw t.error}}var b=performance.now();return null==(i=o.diagnosticsClient)||i.recordHistogram("autocapturePlugin.getHierarchy",b-s),a},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?o.getText(t):o.getNearestLabel(n)},this.getEventProperties=function(e,t,n){var r,i,s,a,u=null==(s=null==(i=null==t?void 0:t.tagName)?void 0:i.toLowerCase)?void 0:s.call(i),c="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},l=o.getHierarchy(t),d=null==(a=l[0])?void 0:a.attrs,f=o.getNearestLabel(t),p=Object.entries(null!=d?d:{}).reduce(function(e,t){var r=U(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[ny]=u,r[nm]=o.getText(t),r["[Amplitude] Element Position Left"]=null==c.left?null:Math.round(c.left),r["[Amplitude] Element Position Top"]=null==c.top?null:Math.round(c.top),r["[Amplitude] Element Attributes"]=p,r["[Amplitude] Element Parent Label"]=f,r[nb]=ry(window.location.href.split("?")[0]),r["[Amplitude] Page Title"]=o.getPageTitle(),r["[Amplitude] Viewport Height"]=window.innerHeight,r["[Amplitude] Viewport Width"]=window.innerWidth,r);return h["[Amplitude] Element ID"]=t.getAttribute("id")||"",h["[Amplitude] Element Class"]=t.getAttribute("class"),h["[Amplitude] Element Aria Label"]=null==d?void 0:d["aria-label"],"a"===u&&"click"===e&&t instanceof HTMLAnchorElement&&(h["[Amplitude] Element Href"]=o.replaceSensitiveString(t.href)),rS(h)},this.addAdditionalEventProperties=function(e,t,n,r,i){void 0===i&&(i=!1);var s={event:e,timestamp:Date.now(),type:t};if(("click"===s.type||"change"===s.type)&&null!==s.event.target){if(i&&rb(s.event.target,s.type))return s.closestTrackedAncestor=s.event.target,s.targetElementProperties=o.getEventProperties(s.type,s.closestTrackedAncestor,r),s;var a=r_(s.event.target,n);a&&(s.closestTrackedAncestor=a,s.targetElementProperties=o.getEventProperties(s.type,a,r))}return s},this.extractDataFromDataSource=function(e,t){if("DOM_ELEMENT"===e.sourceType){var n=rx(e,t);if(n){if("TEXT"===e.elementExtractType)return o.getText(n);if("ATTRIBUTE"===e.elementExtractType&&e.attribute)return n.getAttribute(e.attribute)}}},this.getText=function(e){if(null!==e.closest("[".concat(n_,"]")))return nT;var t="";if(e.querySelector("[".concat(n_,"], [contenteditable]"))){var n=e.cloneNode(!0);n.querySelectorAll("[".concat(n_,"], [contenteditable]")).forEac
1h(function(e){e.innerText=nT}),t=n.innerText||""}else t=e.innerText||"";return o.replaceSensitiveString(t.substring(0,255)).replace(/\s+/g," ").trim()},this.getPageTitle=function(){if("u"<typeof document)return"";var e=document.querySelector("title");return e&&e.hasAttribute(n_)?nT:o.replaceSensitiveString(document.title)},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 rS(((t={})[ny]=i,t[nm]=o.getText(e),t[nb]=window.location.href.split("?")[0],t))},this.diagnosticsClient=null==t?void 0:t.diagnosticsClient;var s=null!=(i=e.maskTextRegex)?i:[],a=[];try{for(var u=j(s),c=u.next();!c.done;c=u.next()){var l=c.value;if(a.length>=25)break;if(l instanceof RegExp)a.push(l);else if("pattern"in l&&"string"==typeof l.pattern)try{a.push(RegExp(l.pattern,"i"))}catch(e){}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}this.additionalMaskTextPatterns=a},rL=function(){function e(e){var t=(void 0===e?{}:e).origin,n=this;this.endpoint=nw,this.requestCallbacks={},this.onSelect=function(e){n.notify({action:"element-selected",data:e})},this.onTrack=function(e,t){"selector-mode-changed"===e?n.notify({action:"track-selector-mode-changed",data:t}):"selector-moved"===e&&n.notify({action:"track-selector-moved",data:t})},this.endpoint=void 0===t?nw: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),(null==n?void 0: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.setup=function(e){var t=this,n=void 0===e?{dataExtractor:new rN({})}:e,r=n.logger,i=n.endpoint,o=n.isElementSelectable,s=n.cssSelectorAllowlist,a=n.actionClickAllowlist,u=n.dataExtractor;this.logger=r,i&&this.endpoint===nw&&(this.endpoint=i);var c=null;window.addEventListener("message",function(e){if(null==(r=null==(n=t.logger)?void 0:n.debug)||r.call(n,"Message received: ",JSON.stringify(e)),t.endpoint===e.origin){var n,r,i,l,d,f=null==e?void 0:e.data,p=null==f?void 0:f.action;if(p)if("id"in f)null==(l=null==(i=t.logger)?void 0:i.debug)||l.call(i,"Received Response to previous request: ",JSON.stringify(e)),t.handleResponse(f);else if("ping"===p)t.notify({action:"pong"});else if("initialize-visual-tagging-selector"===p){var h,v=null==f?void 0:f.data;(h="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",new Promise(function(e,t){var n;try{var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src=h,r.addEventListener("load",function(){e({status:!0})},{once:!0}),r.addEventListener("error",function(){t({status:!1,message:"Failed to load the script ".concat(h)})}),null==(n=document.head)||n.appendChild(r)}catch(e){t(e)}})).then(function(){var e;c=null==(e=null==window?void 0:window.amplitudeVisualTaggingSelector)?void 0:e.call(window,{getEventTagProps:u.getEventTagProps,isElementSelectable:function(e){return!o||o((null==v?void 0:v.actionType)||"click",e)},onTrack:t.onTrack,onSelect:t.onSelect,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:t,cssSelectorAllowlist:s,actionClickAllowlist:a,extractDataFromDataSource:u.extractDataFromDataSource,dataExtractor:u,diagnostics:{autocapture:{version:"1.14.4"}}}),t.notify({action:"selector-loaded"})}).catch(function(){var e;null==(e=t.logger)||e.warn("Failed to initialize visual tagging selector")})}else"close-visual-tagging-selector"===p&&(null==(d=null==c?void 0:c.close)||d.call(c))}}),this.notify({action:"page-loaded"})},e}();function rj(e,t){return nI(function(n,r){var i=0;n.subscribe(nG(r,function(n){return e.call(t,n,i++)&&r.next(n)}))})}var rU=function(e){function t(t,n){return e.call(this)||this}return C(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(nA),rM={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=rM.delegate;return(null==i?void 0:i.setInterval)?i.setInterval.apply(i,M([e,t],U(n))):setInterval.apply(void 0,M([e,t],U(n)))},clearInterval:function(e){var t=rM.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},rq=function(e){function t(t,n){var r=e.call(this,t,n)||this;
1return r.scheduler=t,r.work=n,r.pending=!1,r}return C(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n,r=this.id,i=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(i,r,t)),this.pending=!0,this.delay=t,this.id=null!=(n=this.id)?n:this.requestAsyncId(i,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),rM.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;null!=t&&rM.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,r=!1;try{this.work(e)}catch(e){r=!0,n=e||Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,nx(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(rU),rF={now:function(){return(rF.delegate||Date).now()},delegate:void 0},rB=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=rF.now,e}(),r$=new(function(e){function t(t,n){void 0===n&&(n=rB.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return C(t,e),t.prototype.flush=function(e){var t,n=this.actions;if(this._active)return void n.push(e);this._active=!0;do if(t=e.execute(e.state,e.delay))break;while(e=n.shift());if(this._active=!1,t){for(;e=n.shift();)e.unsubscribe();throw t}},t}(rB))(rq);function rH(e){return void 0===e&&(e=1/0),rc(n2,e)}var rV=new n3(function(e){return e.complete()});function rz(e){return e&&nk(e.schedule)}function rJ(e){return e[e.length-1]}function rK(e){return rz(rJ(e))?e.pop():void 0}function rW(e,t){return void 0===t&&(t=0),nI(function(n,r){n.subscribe(nG(r,function(n){return ru(r,e,function(){return r.next(n)},t)},function(){return ru(r,e,function(){return r.complete()},t)},function(n){return ru(r,e,function(){return r.error(n)},t)}))})}function rY(e,t){return void 0===t&&(t=0),nI(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function rG(e,t){if(!e)throw Error("Iterable cannot be null");return new n3(function(n){ru(n,t,function(){var r=e[Symbol.asyncIterator]();ru(n,t,function(){r.next().then(function(e){e.done?n.complete():n.next(e.value)})},0,!0)})})}function rQ(e,t){return t?function(e,t){if(null!=e){if(nk(e[n1]))return rt(e).pipe(rY(t),rW(t));if(nZ(e))return new n3(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})});if(n0(e))return rt(e).pipe(rY(t),rW(t));if(n5(e))return rG(e,t);if(n8(e))return new n3(function(n){var r;return ru(n,t,function(){r=e[n7](),ru(n,t,function(){var e,t,i;try{t=(e=r.next()).value,i=e.done}catch(e){n.error(e);return}i?n.complete():n.next(t)},0,!0)}),function(){return nk(null==r?void 0:r.return)&&r.return()}});if(re(e))return rG(n9(e),t)}throw n6(e)}(e,t):rt(e)}function rX(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=rK(t),i=(e=1/0,"number"==typeof rJ(t)?t.pop():e);return t.length?1===t.length?rt(t[0]):rH(i)(rQ(t,r)):rV}function rZ(e){return e<=0?function(){return rV}:nI(function(t,n){var r=0;t.subscribe(nG(n,function(t){++r<=e&&(n.next(t),e<=r&&n.complete())}))})}function r0(e){return e instanceof Date&&!isNaN(e)}function r1(e,t,n){void 0===e&&(e=0),void 0===n&&(n=r$);var r=-1;return null!=t&&(rz(t)?n=t:r=t),new n3(function(t){var i=r0(e)?e-n.now():e;i<0&&(i=0);var o=0;return n.schedule(function(){t.closed||(t.next(o++),0<=r?this.schedule(void 0,r):t.complete())},i)})}var r2=nP(function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}});function r3(e){throw new r2(e)}var r4=function(){return new n3(function(e){var t=new MutationObserver(function(t){e.next(t)});return t.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return t.disconnect()}})},r5=function(e){return void 0===e&&(e="click"),rh(document,e,{capture:!0})},r6=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},r7={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},r8=function(e){var t,n,r,i,o=Object.values(r7).reduce(function(e,t){return e[t]=new Set,e},{});if(!e)return o;try{for(var s=j(e),a=s.next();!a.done;a=s.next()){var u=a.value;try{try{for(var c=(r=void 0,j(u.definition)),l=c.next();!l.done;l=c.next()){var d=r7[l.value.event_type];d&&o[d].add(u.id)}}catch(e){r={error:e}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}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},r9=function(e){var t,n,r,i,o=new Map;try{for(var s=j(e),a=s.next();!a.done;a=s.next()){var u=a.value;try{for(var c=(r=void 0,j(u.conditions)),l=c.next();!l.done;l=c.next()){var d=l.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{l&&!l.done&&(i=c.return)&&i.call(c)}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},ie=function(e,t){var n,r,i,o,s=new Set;try{for(var a=j(e),u=a.next();!u.done;u=a.next()){var c=u.value,l=t.get(c.id);if(l)try{for(var d=(i=void 0,j(l)),f=d.next();!f.done;f=d.next()){var p=f.value;s.add(p)}}catch(e){i={error:e}}
1finally{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)},it=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=ie(Array.from(this.groupedLabeledEvents[e.type]).map(function(e){return r.labeledEvents[e]}).filter(function(t){return t.definition.some(function(t){return r7[t.event_type]===e.type&&t.filters.every(function(t){return r6(e,t)})})}),this.labeledEventToTriggerMap);try{for(var o=j(i),s=o.next();!s.done;s=o.next()){var a=s.value;rA(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}();(p=k||(k={})).ClickObservable="clickObservable",p.ChangeObservable="changeObservable",p.NavigateObservable="navigateObservable",p.MutationObservable="mutationObservable";var ir=function(e,t){void 0===e&&(e={});var n,r,i,o,s,a,u,c,l=e.dataAttributePrefix,d=void 0===l?np:l,f=e.visualTaggingOptions,p=void 0===f?{enabled:!0,messenger:new rL}:f;e.cssSelectorAllowlist=null!=(n=e.cssSelectorAllowlist)?n:nf,e.actionClickAllowlist=null!=(r=e.actionClickAllowlist)?r:nh,e.debounceTime=null!=(i=e.debounceTime)?i:0,e.pageUrlExcludelist=null==(o=e.pageUrlExcludelist)?void 0:o.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 h="@amplitude/plugin-autocapture-browser",v=[],g=new rN(e,t),y=function(){var t,n,r=r5().pipe(nX(function(t){return g.addAdditionalEventProperties(t,"click",e.cssSelectorAllowlist,d)}),rs()),i=rh(document,"change",{capture:!0}).pipe(nX(function(t){return g.addAdditionalEventProperties(t,"change",e.cssSelectorAllowlist,d)}),rs());window.navigation&&(n=rh(window.navigation,"navigate").pipe(nX(function(t){return g.addAdditionalEventProperties(t,"navigate",e.cssSelectorAllowlist,d)}),rs()));var o=r4().pipe(nX(function(t){return g.addAdditionalEventProperties(t,"mutation",e.cssSelectorAllowlist,d)}),rs());return(t={})[k.ClickObservable]=r,t[k.ChangeObservable]=i,t[k.NavigateObservable]=n,t[k.MutationObservable]=o,t},m=r8(Object.values(null!=(a=null==(s=e.pageActions)?void 0:s.labeledEvents)?a:{})),b=r9(null!=(c=null==(u=e.pageActions)?void 0:u.triggers)?c:[]),w=new it(m,b,g,e),E=function(t){var n,r;t&&(e.pageActions=R(R({},e.pageActions),t),m=r8(Object.values(null!=(n=e.pageActions.labeledEvents)?n:{})),b=r9(null!=(r=e.pageActions.triggers)?r:[]),w.update(m,b,e))};return{name:h,type:"enrichment",setup:function(t,n){return N(void 0,void 0,void 0,function(){var r,i,o,s,a,u,c,l,f,m;return L(this,function(b){var S,_,T,k,I,P,O,x,A,C,D,N,L,q,F,B,$,H,V,z,J,K,W,Y,G,Q,X,Z,ee,et,en,er;return"u"<typeof document?[2]:(t.fetchRemoteConfig&&(t.remoteConfigClient?t.remoteConfigClient.subscribe("analyticsSDK.pageActions","all",function(e){E(e)}):t.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),r=rw(e,e.cssSelectorAllowlist),i=rw(e,e.actionClickAllowlist),_=(S={allObservables:o=y(),options:e,amplitude:n,shouldTrackEvent:r,evaluateTriggers:w.evaluate.bind(w)}).amplitude,T=S.allObservables,k=S.options,I=S.shouldTrackEvent,P=S.evaluateTriggers,C=rX((O=T.clickObservable).pipe(nI(function(e,t){var n,r=!1;e.subscribe(nG(t,function(e){var i=n;n=e,r&&t.next([i,e]),r=!0}))}),rj(function(e){var t=U(e,2),n=t[0],r=t[1],i=n.event.target!==r.event.target,o=20>=Math.abs(r.event.screenX-n.event.screenX)&&20>=Math.abs(r.event.screenY-n.event.screenY);return i&&!o})),O.pipe((x=k.debounceTime,void 0===A&&(A=r$),nI(function(e,t){var n=null,r=null,i=null,o=function(){if(n){n.unsubscribe(),n=null;var e=r;r=null,t.next(e)}};function s(){var e=i+x,r=A.now();if(r<e){n=this.schedule(void 0,e-r),t.add(n);return}o()}e.subscribe(nG(t,function(e){r=e,i=A.now(),n||(n=A.schedule(s,x),t.add(n))},function(){o(),t.complete()},void 0,function(){r=n=null}))})),nX(function(){return"timeout"}))),s=O.pipe((void 0===D&&(D=r$),N=r1(0,D),function e(t,n){return n?function(r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return rH(1)(rQ(e,rK(e)))}(n.pipe(rZ(1),nI(function(e,t){e.subscribe(nG(t,nU))})),r.pipe(e(t)))}:rc(function(e,n){return rt(t(e,n)).pipe(rZ(1),nX(function(){return e}))})}(function(){return N})),rj(rT),rj(function(e){return I("click",e.closestTrackedAncestor)}),nX(function(e){return P(e)}),nI(function(e,t){var n=[];return e.subscribe(nG(t,function(e){return n.push(e)},function(){t.next(n),t.complete()}
1)),rt(C).subscribe(nG(t,function(){var e=n;n=[],t.next(e)},nU)),function(){n=null}})).subscribe(function(e){var t,n,r=(e.length,nv);try{for(var i=j(e),o=i.next();!o.done;o=i.next()){var s=o.value;null==_||_.track(r,s.targetElementProperties)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}}),v.push(s),q=(L={allObservables:o,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return g.getEventProperties.apply(g,M(M([],U(e),!1),[d],!1))},amplitude:n,shouldTrackEvent:r,evaluateTriggers:w.evaluate.bind(w)}).amplitude,F=L.allObservables,B=L.getEventProperties,$=L.shouldTrackEvent,H=L.evaluateTriggers,a=F.changeObservable.pipe(rj(rT),rj(function(e){return $("change",e.closestTrackedAncestor)}),nX(function(e){return H(e)})).subscribe(function(e){null==q||q.track("[Amplitude] Element Changed",B("change",e.closestTrackedAncestor))}),v.push(a),z=(V={allObservables:o,options:e,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return g.getEventProperties.apply(g,M(M([],U(e),!1),[d],!1))},amplitude:n,shouldTrackEvent:r,shouldTrackActionClick:i}).amplitude,J=V.allObservables,K=V.options,W=V.getEventProperties,Y=V.shouldTrackEvent,G=V.shouldTrackActionClick,Q=J.clickObservable,X=J.mutationObservable,Z=J.navigateObservable,ee=Q.pipe(rj(function(e){return!Y("click",e.closestTrackedAncestor)}),nX(function(e){var t=r_(e.event.target,K.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=W(e.type,e.closestTrackedAncestor)),e}),rj(rT),rj(function(e){return G("click",e.closestTrackedAncestor)})),et=[X],Z&&et.push(Z),en=rX.apply(void 0,M([],U(et),!1)),u=ee.pipe((er=function(e){return en.pipe(rZ(1),function(e){var t=r0(e)?{first:e}:"number"==typeof e?{each:e}:e,n=t.first,r=t.each,i=t.with,o=void 0===i?r3:i,s=t.scheduler,a=void 0===s?r$:s,u=t.meta,c=void 0===u?null:u;if(null==n&&null==r)throw TypeError("No timeout provided.");return nI(function(e,t){var i,s,u=null,l=0,d=function(e){s=ru(t,a,function(){try{i.unsubscribe(),rt(o({meta:c,lastValue:u,seen:l})).subscribe(t)}catch(e){t.error(e)}},e)};i=e.subscribe(nG(t,function(e){null==s||s.unsubscribe(),l++,t.next(u=e),r>0&&d(r)},void 0,void 0,function(){(null==s?void 0:s.closed)||null==s||s.unsubscribe(),u=null})),l||d(null!=n?"number"==typeof n?n:n-a.now():r)})}({first:500,with:function(){return rV}}),nX(function(){return e}))},nI(function(e,t){var n=null,r=0,i=!1,o=function(){return i&&!n&&t.complete()};e.subscribe(nG(t,function(e){null==n||n.unsubscribe(),rt(er(e,r++)).subscribe(n=nG(t,function(e){return t.next(e)},function(){n=null,o()}))},function(){i=!0,o()}))}))).subscribe(function(e){null==z||z.track(nv,W("click",e.closestTrackedAncestor))}),v.push(u),null==(f=null==t?void 0:t.loggerProvider)||f.log("".concat(h," has been successfully added.")),window.opener&&p.enabled&&(c=e.cssSelectorAllowlist,l=e.actionClickAllowlist,null==(m=p.messenger)||m.setup(R(R({dataExtractor:g,logger:null==t?void 0:t.loggerProvider},(null==t?void 0:t.serverZone)&&{endpoint:nE[t.serverZone]}),{isElementSelectable:rw(e,M(M([],U(c),!1),U(l),!1)),cssSelectorAllowlist:c,actionClickAllowlist:l}))),[2])})})},execute:function(e){return N(void 0,void 0,void 0,function(){return L(this,function(t){return[2,e]})})},teardown:function(){return N(void 0,void 0,void 0,function(){var e,t,n,r;return L(this,function(i){try{for(t=(e=j(v)).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]})})}}},ii=M(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],U(["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]']),!1),io=["*"],is=Array.isArray;function ia(e,t){var n,r,i,o,s=t.event,a=s.clientX,u=s.clientY;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 iu(e){var t=e[0],n=e[e.length-1];return{rageClickEvent:R({"[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.clientX,Y:e.event.clientY,Time:e.timestamp}}),"[Amplitude] Click Count":e.length},t.targetElementProperties),time:t.timestamp}}var ic=function(e){void 0===e&&(e={});var t,n,r,i,o,s="@amplitude/plugin-frustration-browser",a=[],u=null!=(n=null==(t=e.rageClicks)?void 0:t.cssSelectorAllowlist)?n:io,c=null!=(i=null==(r=e.deadClicks)?void 0:r.cssSelectorAllowlist)?i:ii,l=null!=(o=e.dataAttributePrefix)?o:np,d=new rN(e),f=M([],U(new Set(M(M([],U(u),!1),U(c),!1))),!1),p=function(){var e,t,n=r5("pointerdown").pipe(nX(function(e){return d.addAdditionalEventProperties(e,"click",f,l,!0)}
1),rs());window.navigation&&(t=rh(window.navigation,"navigate").pipe(nX(function(e){return d.addAdditionalEventProperties(e,"navigate",f,l)}),rs()));var r=r4().pipe(nX(function(e){return d.addAdditionalEventProperties(e,"mutation",f,l)}),rs());return(e={})[k.ClickObservable]=n,e[k.ChangeObservable]=new n3,e[k.NavigateObservable]=t,e[k.MutationObservable]=r,e};return{name:s,type:"enrichment",setup:function(t,n){return N(void 0,void 0,void 0,function(){var r,i,o,f,h,v;return L(this,function(g){var y,m,b,w,E,S,_,T,k,I,P,O,x,A,C;return"u"<typeof document?[2]:(r=rw(e,u),i=rw(e,c),f=function(e){var t,n=e.amplitude,r=e.allObservables,i=e.shouldTrackRageClick,o=r.clickObservable,s=[],a={};function u(e){s=[],a={},e&&(ia(a,e),s.push(e))}return o.pipe(rj(rT),rj(function(e){return i("click",e.closestTrackedAncestor)}),nX(function(e){if(t&&clearTimeout(t),ia(a,e),0===s.length)return s.push(e),null;if((r=s).length>0&&r[r.length-1].closestTrackedAncestor!==e.closestTrackedAncestor||(o=Math.max(0,(i=s).length-4+1),c=i[o],e.timestamp-c.timestamp>=1e3)||a.isOutOfBounds){var r,i,o,c,l=s.length>=4?iu(s):null;return u(e),l}return s.push(e),s.length>=4&&(t=setTimeout(function(){var e=iu(s),t=e.rageClickEvent,r=e.time;n.track(ng,t,{time:r}),u()},1e3)),null}),rj(function(e){return null!==e})).subscribe(function(e){null!==e&&n.track(ng,e.rageClickEvent,{time:e.time})})}({allObservables:o=p(),amplitude:n,shouldTrackRageClick:r}),a.push(f),m=(y={amplitude:n,allObservables:o,getEventProperties:function(e,t){return d.getEventProperties(e,t,l)},shouldTrackDeadClick:i}).amplitude,b=y.allObservables,w=y.getEventProperties,E=y.shouldTrackDeadClick,S=b.clickObservable,_=b.mutationObservable,T=b.navigateObservable,k=S.pipe(rj(rT),rj(function(e){return E("click",e.closestTrackedAncestor)}),rj(function(e){return null===e.event.target.closest('a[target="_blank"]')})),I=[_],T&&I.push(T),P=rX.apply(void 0,M([],U(I),!1)),h=k.pipe(rc(function(e){var t;return(function(){for(var e,t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return 1===(n=1===(t=n).length&&is(t[0])?t[0]:t).length?rt(n[0]):new n3((e=n,function(t){for(var n=[],r=function(r){n.push(rt(e[r]).subscribe(nG(t,function(e){if(n){for(var i=0;i<n.length;i++)i!==r&&n[i].unsubscribe();n=null}t.next(e)})))},i=0;n&&!t.closed&&i<e.length;i++)r(i)}))})(new n3(function(n){return t=setTimeout(function(){return n.next(e)},3e3),function(){clearTimeout(t)}}),P.pipe(rZ(1),nX(function(){return null}))).pipe(rj(function(e){return null!==e}))}),(void 0===O&&(O=r$),x=r1(3e3,O),A=function(){return x},C=void 0,nI(function(e,t){var n=null!=C?C:{},r=n.leading,i=void 0===r||r,o=n.trailing,s=void 0!==o&&o,a=!1,u=null,c=null,l=!1,d=function(){null==c||c.unsubscribe(),c=null,s&&(h(),l&&t.complete())},f=function(){c=null,l&&t.complete()},p=function(e){return c=rt(A(e)).subscribe(nG(t,d,f))},h=function(){if(a){a=!1;var e=u;u=null,t.next(e),l||p(e)}};e.subscribe(nG(t,function(e){a=!0,u=e,c&&!c.closed||(i?h():p(e))},function(){l=!0,s&&a&&c&&!c.closed||t.complete()}))}))).subscribe(function(e){var t={"[Amplitude] X":e.event.clientX,"[Amplitude] Y":e.event.clientY};m.track("[Amplitude] Dead Click",R(R({},w("click",e.closestTrackedAncestor)),t),{time:e.timestamp})}),a.push(h),null==(v=null==t?void 0:t.loggerProvider)||v.log("".concat(s," has been successfully added.")),[2])})})},execute:function(e){return N(void 0,void 0,void 0,function(){return L(this,function(t){return[2,e]})})},teardown:function(){return N(void 0,void 0,void 0,function(){var e,t,n,r;return L(this,function(i){try{for(t=(e=j(a)).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]})})}}};function il(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,c=t.parentObject,l=t.targetKey;o||(o=i);var d=Object.keys(o);try{for(var f=j(d),p=f.next();!p.done;p=f.next()){var h,v=p.value,g=M(M([],U(u),!1),[v],!1);(h=o[v],"string"==typeof h||"number"==typeof h||"boolean"==typeof h||null==h)?(!ip(g,s)||ip(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&&c&&l&&delete c[l]}({json:e,allowlist:t.map(id),excludelist:n.map(id),ancestors:[]})}function id(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map(function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")})}function ip(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 ih=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=U(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=j(Object.entries(r)),s=o.next();!s.done;s=o.next()){var a=U(s.value,2),u=a[0],c=a[1];i[u]=c}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return iE(i,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if("number"==typeof this._bodySize)return this._bodySize;var e=J();if(null==e?void 0:e.TextEncoder){var t=this.request.body;return this._bodySize=ig(t,100),this._bodySize}}
1,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=[]),N(this,void 0,void 0,function(){return L(this,function(n){return 0===e.length?[2,null]:[2,ib(this.body,e,t)]})})},e}(),iv=function(){function e(e,t){this.bodyRaw=e,this.requestHeaders=t}return e.prototype.headers=function(e){return void 0===e&&(e=[]),iE(this.requestHeaders,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return ig(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=[]),N(this,void 0,void 0,function(){return L(this,function(n){return 0===e.length?[2,null]:[2,ib(this.body,e,t)]})})},e}();function ig(e,t){var n,r,i,o,s=J(),a=null==s?void 0:s.TextEncoder;if(a){if("string"==typeof e)o=e,i=new a().encode(o).length;else if(e instanceof Blob)i=(o=e).size;else if(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(e instanceof FormData){var u=0,c=0;try{for(var l=j(e.entries()),d=l.next();!d.done;d=l.next()){var f=U(d.value,2),p=f[0],h=f[1];if(u+=p.length,"string"==typeof h)u+=new a().encode(h).length;else{if(!(h instanceof Blob))return;u+=h.size}if(++c>=t)return}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}i=u}else if(e instanceof ReadableStream){o=e;return}return i}}var iy=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}),iE(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 N(this,void 0,void 0,function(){return L(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=[]),N(this,void 0,void 0,function(){return L(this,function(n){switch(n.label){case 0:if(0===e.length)return[2,null];return[4,this.text()];case 1:return[2,ib(n.sent(),e,t)]}})})},e}(),im=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=j(i),s=o.next();!s.done;s=o.next()){var a=s.value,u=U(a.split(": "),2),c=u[0],l=u[1];c&&l&&(r[c]=l)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return iE(r,{allow:e})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),N(this,void 0,void 0,function(){var n;return L(this,function(r){return 0===e.length?[2,null]:(n=this.getJson())?(il(n,e,t),[2,n]):[2,null]})})},e}();function ib(e,t,n){if(!e)return null;try{var r=JSON.parse(e);return il(r,t,n),r}catch(e){return null}}(h=I||(I={})).REDACT="redact",h.REMOVE="remove";var iw="[REDACTED]",iE=function(e,t){var n,r,i=t.allow,o=void 0===i?[]:i,s=t.strategy,a=void 0===s?I.REMOVE:s,u=M([],U(eN),!1),c={};try{for(var l=j(Object.keys(e)),d=l.next();!d.done;d=l.next()){var f=d.value;!function(t){var n=t.toLowerCase();u.find(function(e){return e.toLowerCase()===n})?a===I.REDACT&&(c[t]=iw):o.find(function(e){return e.toLowerCase()===n})?c[t]=e[t]:a===I.REDACT&&(c[t]=iw)}(f)}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return c},iS=function(){function e(e,t,n,r,i,o,s,a,u,c,l){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=c,this.endTime=l}return e.prototype.toSerializable=function(){var e,t,n,r;
1return 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(M([],U(eD),!1)),requestBodySize:null==(t=this.requestWrapper)?void 0:t.bodySize,responseHeaders:null==(n=this.responseWrapper)?void 0:n.headers(M([],U(eD),!1)),responseBodySize:null==(r=this.responseWrapper)?void 0:r.bodySize}).filter(function(e){var t=U(e,2);return void 0!==(t[0],t[1])}))},e}(),i_=function(e,t){void 0===t&&(t=W()),this.callback=e,this.id=t},iT=new(function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var n=J();e.isSupported()&&(this.globalScope=n)}return e.isSupported=function(){var e=J();return!!e&&!!e.fetch},e.prototype.subscribe=function(e,t){var n,r,i,o,s,a,u,c,l,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==(l=null==(c=null==(u=this.globalScope)?void 0:u.XMLHttpRequest)?void 0:c.prototype)?void 0:l.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){var r;try{n.callback(e)}catch(e){null==(r=t.logger)||r.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,c,l,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&&(c=r.status),i&&(l={name:i.name||"UnknownError",message:i.message||"An unknown error occurred"},c=0);var p=Math.floor(performance.now()-s),h=Math.floor(o+p),v=new iS(e,d,o,o,u,n,c,p,r,l,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 N(t,void 0,void 0,function(){var t,i,o,s,a;return L(this,function(u){switch(u.label){case 0:try{t=this.getTimestamps()}catch(e){null==(s=this.logger)||s.debug("an unexpected error occurred while retrieving timestamps",e)}u.label=1;case 1:return u.trys.push([1,3,,4]),[4,e(n,r)];case 2:return i=u.sent(),[3,4];case 3:return o=u.sent(),[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",n,r?new ih(r):void 0,i?new iy(i):void 0,o,null==t?void 0:t.startTime,null==t?void 0:t.durationStart)}catch(e){null==(a=this.logger)||a.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,r;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&&(null==(r=t.logger)||r.error("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=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var s=U(r,2),a=s[0],u=s[1];try{this.$$AmplitudeAnalyticsEvent=R({method:a,url:null==(e=null==u?void 0:u.toString)?void 0:e.call(u),headers:{}},o.getTimestamps())}catch(e){null==(n=o.logger)||n.error("an unexpected error occurred while calling xhr open",e)}return t.apply(this,r)},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.addEventListener("loadend",function(){var e;try{var t=i.getAllResponseHeaders(),n=i.getResponseHeader("content-length"),r=new im(i.status,t,n?parseInt(n,10):void 0,s),c=i.$$AmplitudeAnalyticsEvent.headers,l=new iv(a,c);u.status=i.status,o.handleNetworkRequestEvent("xhr",{url:u.url,method:u.method},l,r,void 0,u.startTime,u.durationStart)}catch(t){null==(e=o.logger)||e.error("an unexpected error occurred while handling xhr send",t)}}),n.apply(i,t)},i.setRequestHeader=function(e,t){var n;try{this.$$AmplitudeAnalyticsEvent.headers[e]=t}catch(e){null==(n=o.logger)||n.error("an unexpected error occurred while calling xhr setRequestHeader",e)}r.apply(this,[e,t])}}},e}()),ik="[Amplitude] Network Request",iI="500-599";function iP(e,t){return RegExp("^"+t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$").test(e)}function iO(e,t){var n,r,i=t.split(",");try{for(var o=j(i),s=o.next();!s.done;s=o.next()){var a=s.value,u=U(a.split("-").map(Number),2),c=u[0],l=u[1];if(e===c&&void 0===l||e>=c&&e<=l)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 ix(e){var t;if(e)try{var n=null==(t=J())?void 0:t.location.href,r=new URL(e,n),i=r.searchParams.toString(),o=r.hash.replace("#",""),s=r.href,a=r.host;r.hash="",r.search="";var u=r.href;return{query:i,fragment:o,href:s,hrefWithoutQueryOrHash:u,host:a}}catch(e){return}}function iA(e){return"object"!=typeof e||null===e?e?M([],U(eD),!1):void 0:0!==e.length?e:void 0}function iC(e){var t,n;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)}(P||(P={})).NetworkObservable="networkObservable";var iR=function(e){void 0===e&&(e={});var t,n="@amplitude/plugin-network-capture-browser",r=[],i=function(){var e,n=new n3(function(e){var n=new i_(function(t){var n={event:t,timestamp:Date.now(),type:"network"};e.next(n)});return iT.subscribe(n,t),function(){iT.unsubscribe(n)}});return(e={})[P.NetworkObservable]=n,e};return{name:n,type:"enrichment",setup:function(o,s){return N(void 0,void 0,void 0,function(){var a,u;return L(this,function(c){var l,d,f,p,h;return"u"<typeof document?[2]:(a=i(),t=null==o?void 0:o.loggerProvider,d=(l={allObservables:a,networkTrackingOptions:e,amplitude:s,loggerProvider:t}).allObservables,f=l.networkTrackingOptions,p=l.amplitude,h=l.loggerProvider,u=d.networkObservable.pipe(rj(function(e){return function(e,t){void 0===t&&(t={});var n,r,i=ix(e.url);if(!i)return!1;var o=i.host;return!(!1!==t.ignoreAmplitudeRequests&&(iP(o,"*.amplitude.com")||iP(o,"amplitude.com"))||(null==(n=t.ignoreHosts)?void 0:n.find(function(e){return iP(o,e)})))&&(!!t.captureRules||void 0===e.status||!!iO(e.status,iI))&&(!t.captureRules||(M([],U(t.captureRules),!1).reverse().find(function(t){if(r=function(e,t,n,r,i){if((!e.hosts||e.hosts.find(function(e){return iP(t,e)}))&&(!r||!e.urls||rg(r,e.urls))&&(!i||!e.methods||e.methods.find(function(e){return i.toLowerCase()===e.toLowerCase()||"*"===e})))return(!n&&0!==n||!!iO(n,e.statusCodeRange||iI))&&!0}(t,o,e.status,e.url,e.method)){var n=iA(t.responseHeaders);if(e.responseWrapper&&n){var i=e.responseWrapper.headers(n);i&&(e.responseHeaders=i)}var s=iA(t.requestHeaders);if(e.requestWrapper&&s){var a=e.requestWrapper.headers(s);a&&(e.requestHeaders=a)}e.responseWrapper&&t.responseBody&&!iC(t.responseBody)&&(e.responseBodyJson=e.responseWrapper.json(t.responseBody.allowlist,t.responseBody.blocklist)),e.requestWrapper&&t.requestBody&&!iC(t.requestBody)&&(e.requestBodyJson=e.requestWrapper.json(t.requestBody.allowlist,t.requestBody.blocklist))}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===ik}))return!0}catch(e){}return!1}(o,e.requestWrapper))}(e.event,f)})).subscribe(function(e){var t,n,r,i=e.event,o=ix(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){N(this,void 0,void 0,function(){var i,o,s;return L(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=U.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(ik,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)}}),r.push(u),null==t||t.log("".concat(n," has been successfully added.")),[2])})})},execute:function(e){return N(void 0,void 0,void 0,function(){return L(this,function(t){return[2,e]})})},teardown:function(){return N(void 0,void 0,void 0,function(){var e,t,n,i;return L(this,function(o){try{for(t=(e=j(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]})})}}};let iD=-1,iN=e=>{addEventListener("pageshow",t=>{t.persisted&&(iD=t.timeStamp,e(t))},!0)},iL=(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))}},ij=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},iU=()=>{let e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},iM=()=>{let e=iU();return e?.activationStart??0},iq=(e,t=-1)=>{let n=iU(),r="navigate";return iD>=0?r="back-forward-cache":n&&(document.prerendering||iM()>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}},iF=new WeakMap;function iB(e,t){return iF.get(e)||iF.set(e,new t),iF.get(e)}class i${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 iH=(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{}},iV=e=>{let t=!1;return()=>{t||(e(),t=!0)}},iz=-1,iJ=new Set,iK=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,iW=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(let e of iJ)e();isFinite(iz)||(iz="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",iW,!0))}},iY=()=>{if(iz<0){let e=iM();iz=(document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>"hidden"===t.name&&t.startTime>e)[0]?.startTime)??iK(),addEventListener("visibilitychange",iW,!0),addEventListener("prerenderingchange",iW,!0),iN(()=>{setTimeout(()=>{iz=iK()})})}return{get firstHiddenTime(){return iz},onHidden(e){iJ.add(e)}}},iG=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},iQ=[1800,3e3],iX=(e,t={})=>{iG(()=>{let n=iY(),r,i=iq("FCP"),o=iH("paint",e=>{for(let t of e)"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-iM(),0),i.entries.push(t),r(!0)))});o&&(r=iL(e,i,iQ,t.reportAllChanges),iN(n=>{r=iL(e,i=iq("FCP"),iQ,t.reportAllChanges),ij(()=>{i.value=performance.now()-n.timeStamp,r(!0)})}))})},iZ=[.1,.25],i0=0,i1=1/0,i2=0,i3=e=>{for(let t of e)t.interactionId&&(i1=Math.min(i1,t.interactionId),i0=(i2=Math.max(i2,t.interactionId))?(i2-i1)/7+1:0)},i4=()=>r?i0:performance.interactionCount??0,i5=0;class i6{u=[];l=new Map;m;p;v(){i5=i4(),this.u.length=0,this.l.clear()}L(){let e=Math.min(this.u.length-1,Math.floor((i4()-i5)/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)=>
1t.P-e.P),this.u.length>10)for(let e of this.u.splice(10))this.l.delete(e.id);this.p?.(n)}}}let i7=e=>{let t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(addEventListener("visibilitychange",e=iV(e),{once:!0,capture:!0}),t(()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})}))},i8=[200,500];class i9{m;h(e){this.m?.(e)}}let oe=[2500,4e3],ot=[800,1800],on=e=>{document.prerendering?iG(()=>on(e)):"complete"!==document.readyState?addEventListener("load",()=>on(e),!0):setTimeout(e)};function or(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 oi=function(){var e=null,t=J(),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 N(void 0,void 0,void 0,function(){var s,a,u;return L(this,function(c){return s=function(e){if(!e)return"";var n,r=e;try{r=decodeURI(e)}catch(e){null==(n=t.loggerProvider)||n.error("Malformed URI sequence: ",e)}return r},void 0===n||(a=s(null==i?void 0:i.href),u={"[Amplitude] Page Domain":(null==i?void 0:i.hostname)||"","[Amplitude] Page Location":a,"[Amplitude] Page Path":s(null==i?void 0:i.pathname),"[Amplitude] Page Title":"u">typeof document&&document.title||"","[Amplitude] Page URL":a.split("?")[0]},((e,t={})=>{iG(()=>{let n=iY(),r,i=iq("LCP"),o=iB(t,i9),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-iM(),0),i.entries=[s],r())},a=iH("largest-contentful-paint",s);if(a){r=iL(e,i,oe,t.reportAllChanges);let n=iV(()=>{s(a.takeRecords()),a.disconnect(),r(!0)}),o=e=>{e.isTrusted&&(i7(n),removeEventListener(e.type,o,{capture:!0}))};for(let e of["keydown","click","visibilitychange"])addEventListener(e,o,{capture:!0});iN(n=>{r=iL(e,i=iq("LCP"),oe,t.reportAllChanges),ij(()=>{i.value=performance.now()-n.timeStamp,r(!0)})})}})})(function(e){u["[Amplitude] LCP"]=or(e)}),iX(function(e){u["[Amplitude] FCP"]=or(e)}
1),((e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;let n=iY();iG(()=>{"interactionCount"in performance||r||(r=iH("event",i3,{type:"event",buffered:!0,durationThreshold:0}));let i,o=iq("INP"),s=iB(t,i6),a=e=>{i7(()=>{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=iH("event",a,{durationThreshold:t.durationThreshold??40});i=iL(e,o,i8,t.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{a(u.takeRecords()),i(!0)}),iN(()=>{s.v(),i=iL(e,o=iq("INP"),i8,t.reportAllChanges)}))})})(function(e){u["[Amplitude] INP"]=or(e)}),((e,t={})=>{let n=iY();iX(iV(()=>{let r,i=iq("CLS",0),o=iB(t,i$),s=e=>{for(let t of e)o.h(t);o.i>i.value&&(i.value=o.i,i.entries=o.o,r())},a=iH("layout-shift",s);a&&(r=iL(e,i,iZ,t.reportAllChanges),n.onHidden(()=>{s(a.takeRecords()),r(!0)}),iN(()=>{o.i=0,r=iL(e,i=iq("CLS",0),iZ,t.reportAllChanges),ij(()=>r())}),setTimeout(r))}))})(function(e){u["[Amplitude] CLS"]=or(e)}),((e,t={})=>{let n=iq("TTFB"),r=iL(e,n,ot,t.reportAllChanges);on(()=>{let i=iU();i&&(n.value=Math.max(i.responseStart-iM(),0),n.entries=[i],r(!0),iN(()=>{(r=iL(e,n=iq("TTFB",0),ot,t.reportAllChanges))(!0)}))})})(function(e){u["[Amplitude] TTFB"]=or(e)}),e=function(){"hidden"===n.visibilityState&&e&&(o.track("[Amplitude] Web Vitals",u),n.removeEventListener("visibilitychange",e),e=null)},n.addEventListener("visibilitychange",e)),[2]})})},execute:function(e){return N(void 0,void 0,void 0,function(){return L(this,function(t){return[2,e]})})},teardown:function(){return N(void 0,void 0,void 0,function(){return L(this,function(t){return e&&(null==n||n.removeEventListener("visibilitychange",e)),[2]})})}}},oo=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),["AMP",t,e.substring(0,n)].filter(Boolean).join("_")},os=function(){function e(){}return e.prototype.parse=function(){return N(this,void 0,void 0,function(){return L(this,function(e){return[2,R(R(R(R({},eR),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var e=es();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=null!=(t=null==(e=n.referrer)?void 0:e.split("/")[2])?t:void 0}catch(e){}return n},e.prototype.getClickIds=function(){var e,t=es();return(e={})[eE]=t[eE],e[eS]=t[eS],e[e_]=t[e_],e[eT]=t[eT],e[ek]=t[ek],e[eI]=t[eI],e[eP]=t[eP],e[eO]=t[eO],e[ex]=t[ex],e[eA]=t[eA],e[eC]=t[eC],e},e}(),oa=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},ou=function(e,t,n,r,i){void 0===i&&(i=!0),e.referrer;var o=e.referring_domain,s=D(e,["referrer","referring_domain"]),a=t||{},u=(a.referrer,a.referring_domain),c=D(a,["referrer","referring_domain"]);if(oc(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 l=JSON.stringify(s)!==JSON.stringify(c),d=oa(o||"")!==oa(u||""),f=!t||l||d;return f?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."),f},oc=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})},ol=function(e){var t=e;return t?(t.startsWith(".")&&(t=t.substring(1)),[new RegExp("".concat(t.replace(".","\\."),"$"))]):[]},od=function(){function e(e,t){var n;this.shouldTrackNewCampaign=!1,this.options=R({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:ol(null==(n=t.cookieOptions)?void 0:n.domain)},e),this.storage=t.cookieStorage,this.storageKey=oo(t.apiKey,"MKTG"),this.webExpStorageKey=oo(t.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=eR,this.sessionTimeout=t.sessionTimeout,this.lastEventTime=t.lastEventTime,this.logger=t.loggerProvider,t.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return N(this,void 0,void 0,function(){var e,t;return L(this,function(n){switch(n.label){case 0:return[4,this.fetchCampaign()];case 1:if(t=U.apply(void 0,[n.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||e1(this.sessionTimeout,this.lastEventTime),!ou(this.currentCampaign,this.previousCampaign,this.options,this.logger,e))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 N(this,void 0,void 0,function(){var e;return L(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 os().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,e3(Object.entries(R(R({},eR),t)).reduce(function(e,t){var r,i=U(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 eX)));return e&&(r.event_id=e),r},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),of=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._diagnosticsSampleRate=0,t}return C(t,e),t.prototype.init=function(e,t,n){var r,i;return void 0===e&&(e=""),arguments.length>
12?(r=t,i=n):"string"==typeof t?(r=t,i=void 0):(r=null==t?void 0:t.userId,i=t),V(this._init(R(R({},i),{userId:r,apiKey:e})))},t.prototype._init=function(t){var n,r,i;return N(this,void 0,void 0,function(){var o,s,a,u,c,l,d,f,p,h=this;return L(this,function(v){var g,y,m,b,w;switch(v.label){case 0:if(this.initializing)return[2];return this.initializing=!0,[4,(g=t.apiKey,y=t,m=this,void 0===y&&(y={}),N(void 0,void 0,void 0,function(){var e,t,n,r,i,o,s,a,u,c,l,d,f,p,h,v,b,w,E,S,_,T,k,I,P,O,x,A,C,D,j,M,q,F,B,$,H,V,z,J,K,Y,G,Q,X;return L(this,function(Z){switch(Z.label){case 0:if(e=y.identityStorage||tH,_={},e===tH)return[3,1];return n="",[3,5];case 1:if(null==(k=null==(T=y.cookieOptions)?void 0:T.domain))return[3,2];return r=k,[3,4];case 2:return[4,N(void 0,void 0,void 0,function(){var e,t,n,r,i,o;return L(this,function(s){switch(s.label){case 0:return[4,new ty().isEnabled()];case 1:if(!s.sent()||"u"<typeof location||!location.hostname)return[2,""];for(e=(0,location.hostname).split("."),t=[],n="AMP_TLDTEST",r=e.length-2;r>=0;--r)t.push(e.slice(r).join("."));r=0,s.label=2;case 2:if(!(r<t.length))return[3,7];return[4,(o=new ty({domain:"."+(i=t[r])})).set(n,1)];case 3:return s.sent(),[4,o.get(n)];case 4:if(!s.sent())return[3,6];return[4,o.remove(n)];case 5:return s.sent(),[2,"."+i];case 6:return r++,[3,2];case 7:return[2,""]}})})];case 3:r=Z.sent(),Z.label=4;case 4:n=r,Z.label=5;case 5:var ee,et;return t=R.apply(void 0,[(_.domain=n,_.expiration=365,_.sameSite="Lax",_.secure=!1,_.upgrade=!0,_),y.cookieOptions]),[4,(ee=i=tz(y.identityStorage,t),void 0===(et=null==(P=null==(I=y.cookieOptions)?void 0:I.upgrade)||P)&&(et=!0),N(void 0,void 0,void 0,function(){var e,t,n,r,i,o,s,a,u;return L(this,function(c){switch(c.label){case 0:return e="".concat("amp","_").concat(g.substring(0,6)),[4,ee.getRaw(e)];case 1:if(!(t=c.sent()))return[2,{optOut:!1}];if(!et)return[3,3];
1return[4,ee.remove(e)];case 2:c.sent(),c.label=3;case 3:return r=(n=U(t.split("."),6))[0],i=n[1],o=n[2],s=n[3],a=n[4],u=n[5],[2,{deviceId:r,userId:tO(i),sessionId:tP(s),lastEventId:tP(u),lastEventTime:tP(a),optOut:!!o}]}})}))];case 6:return o=Z.sent(),[4,i.get(tg(g))];case 7:return s=Z.sent(),c=!(u=(a=es()).ampTimestamp?Number(a.ampTimestamp):void 0)||Date.now()<u,l=null!=(D=null!=(C=null!=(A=null!=(O=y.deviceId)?O:c?null!=(x=a.ampDeviceId)?x:a.deviceId:void 0)?A:null==s?void 0:s.deviceId)?C:o.deviceId)?D:W(),d=null!=(j=null==s?void 0:s.lastEventId)?j:o.lastEventId,f=null!=(M=null==s?void 0:s.lastEventTime)?M:o.lastEventTime,p=null!=(F=null!=(q=y.optOut)?q:null==s?void 0:s.optOut)?F:o.optOut,h=null!=(B=null==s?void 0:s.sessionId)?B:o.sessionId,v=null!=(H=null!=($=y.userId)?$:null==s?void 0:s.userId)?H:o.userId,m.previousSessionDeviceId=null!=(V=null==s?void 0:s.deviceId)?V:o.deviceId,m.previousSessionUserId=null!=(z=null==s?void 0:s.userId)?z:o.userId,b={ipAddress:null==(K=null==(J=y.trackingOptions)?void 0:J.ipAddress)||K,language:null==(G=null==(Y=y.trackingOptions)?void 0:Y.language)||G,platform:null==(X=null==(Q=y.trackingOptions)?void 0:Q.platform)||X},w=null==s?void 0:s.pageCounter,E=null==s?void 0:s.debugLogsEnabled,void 0!==y.autocapture&&(y.defaultTracking=y.autocapture),[4,(S=new tV(g,y.appVersion,i,t,y.defaultTracking,y.autocapture,l,y.flushIntervalMillis,y.flushMaxRetries,y.flushQueueSize,e,y.ingestionMetadata,y.instanceName,d,f,y.loggerProvider,y.logLevel,y.minIdLength,y.offline,p,y.partnerId,y.plan,y.serverUrl,y.serverZone,h,y.sessionTimeout,y.storageProvider,b,y.transport,y.useBatch,y.fetchRemoteConfig,v,w,E,y.networkTrackingOptions,y.identify,y.enableDiagnostics)).storageProvider.isEnabled()];case 8:return Z.sent()||(S.loggerProvider.warn("Storage provider ".concat(S.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),S.storageProvider=new tv),[2,S]}})}))];case 1:if(!(o=v.sent()).fetchRemoteConfig)return[3,3];return s=new Y(o.apiKey,o.loggerProvider,o.serverZone),[4,new Promise(function(e){null==s||s.subscribe("configs.analyticsSDK.browserSDK","all",function(t,n,r){o.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:t,source:n,lastFetch:r},null,2)),t&&function(e,t){if(e){!function e(t){if("object"==typeof t&&null!==t&&!Array.isArray(t)){var n,r,i,o,s,a,u,c,l,d,f,p=Object.keys(t);try{for(var h=j(p),v=h.next();!v.done;v=h.next()){var g=v.value;try{var y=t[g];"boolean"==typeof(null==y?void 0:y.enabled)&&(y.enabled?(delete y.enabled,0===Object.keys(y).length&&(t[g]=!0)):t[g]=!1),e(y)}catch(e){}}}catch(e){n={error:e}}finally{try{v&&!v.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}try{if(null==(l=null==(c=null==(u=t.autocapture)?void 0:u.networkTracking)?void 0:c.captureRules)?void 0:l.length)try{for(var m=j(t.autocapture.networkTracking.captureRules),b=m.next();!b.done;b=m.next()){var w=b.value;try{for(var E=(s=void 0,j(["responseHeaders","requestHeaders"])),S=E.next();!S.done;S=E.next()){var _=S.value,T=null!=(d=w[_])?d:{},k=T.captureSafeHeaders,I=T.allowlist;if(k||I){if(void 0!==I&&!Array.isArray(I)){delete w[_];continue}w[_]=M(M([],U(k?eD:[]),!1),U(null!=I?I:[]),!1)}}}catch(e){s={error:e}}finally{try{S&&!S.done&&(a=E.return)&&a.call(E)}finally{if(s)throw s.error}}}}catch(e){i={error:e}}finally{try{b&&!b.done&&(o=m.return)&&o.call(m)}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))}}(e);try{var n,r,i,o,s,a,u;if(t.loggerProvider.debug("Update browser config with remote configuration:",JSON.stringify(e)),e&&"autocapture"in e){if("boolean"==typeof e.autocapture&&(t.autocapture=e.autocapture),"object"==typeof e.autocapture&&null!==e.autocapture){var c=R({},e.autocapture);if(void 0===t.autocapture&&(t.autocapture=e.autocapture),"object"==typeof e.autocapture.elementInteractions&&null!==e.autocapture.elementInteractions&&(null==(i=e.autocapture.elementInteractions.pageUrlAllowlistRegex)?void 0:i.length)){c.elementInteractions=R({},e.autocapture.elementInteractions);var l=c.elementInteractions,d=null!=(o=l.pageUrlAllowlist)?o:[],f=e.autocapture.elementInteractions.pageUrlAllowlistRegex;l.pageUrlAllowlist=nd(d,f,t),delete l.pageUrlAllowlistRegex}
1if("object"==typeof e.autocapture.networkTracking&&null!==e.autocapture.networkTracking&&(null==(s=e.autocapture.networkTracking.captureRules)?void 0:s.length)){c.networkTracking=R({},e.autocapture.networkTracking);var p=null!=(a=c.networkTracking.captureRules)?a:[];try{for(var h=j(p),v=h.next();!v.done;v=h.next()){var g=v.value;g.urls=nd(null!=(u=g.urls)?u:[],g.urlsRegex,t),delete g.urlsRegex}}catch(e){n={error:e}}finally{try{v&&!v.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}}"boolean"==typeof t.autocapture&&(t.autocapture=R({attribution:t.autocapture,fileDownloads:t.autocapture,formInteractions:t.autocapture,pageViews:t.autocapture,sessions:t.autocapture,elementInteractions:t.autocapture,webVitals:t.autocapture,frustrationInteractions:t.autocapture},c)),"object"==typeof t.autocapture&&(t.autocapture=R(R({},t.autocapture),c))}t.defaultTracking=t.autocapture}t.loggerProvider.debug("Browser config after remote config update:",JSON.stringify(t))}catch(e){t.loggerProvider.error("Failed to apply remote configuration because of error: ",e)}}}(t,o),e()})})];case 2:v.sent(),v.label=3;case 3:return(a=new eo(o.apiKey,o.loggerProvider,o.serverZone,{enabled:o.enableDiagnostics,sampleRate:o.diagnosticsSampleRate||this._diagnosticsSampleRate})).setTag("library","".concat(tp,"/").concat(tf)),[4,e.prototype._init.call(this,o)];case 4:if(v.sent(),this.logBrowserOptions(o),this.config.diagnosticsClient=a,this.config.remoteConfigClient=s,!e8(this.config.defaultTracking))return[3,6];return u=e8((b=this.config).defaultTracking)&&b.defaultTracking&&"object"==typeof b.defaultTracking&&b.defaultTracking.attribution&&"object"==typeof b.defaultTracking.attribution?R({},b.defaultTracking.attribution):{},this.webAttribution=new od(u,this.config),[4,this.webAttribution.init()];case 5:v.sent(),v.label=6;case 6:if(d=!(l=(c=es()).ampTimestamp?Number(c.ampTimestamp):void 0)||Date.now()<l,this.config.identify&&this.identify(this.config.identify),f=d&&!Number.isNaN(Number(c.ampSessionId))?Number(c.ampSessionId):void 0,this.setSessionId(null!=(i=null!=(r=null!=(n=t.sessionId)?n:f)?r:this.config.sessionId)?i:Date.now()),(p=eL(t.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),this.config.offline===eM)return[3,8];return[4,this.add(nl()).promise];case 7:v.sent(),v.label=8;case 8:return[4,this.add(new eW).promise];case 9:return v.sent(),[4,this.add(new th).promise];case 10:return v.sent(),[4,this.add(new eY).promise];case 11:if(v.sent(),nc(this.config),!e7(this.config.defaultTracking,"fileDownloads"))return[3,13];return this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(na()).promise];case 12:v.sent(),v.label=13;case 13:if(!e7(this.config.defaultTracking,"formInteractions"))return[3,15];return this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(ni()).promise];case 14:v.sent(),v.label=15;case 15:if(!e9(this.config.defaultTracking))return[3,17];return this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(ne(ta(this.config))).promise];case 16:v.sent(),v.label=17;case 17:if(!tn(this.config.autocapture))return[3,19];return this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(ir(ti(this.config),{diagnosticsClient:a})).promise];case 18:v.sent(),v.label=19;case 19:if(!tr(this.config.autocapture))return[3,21];return this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(ic(to(this.config))).promise];case 20:v.sent(),v.label=21;case 21:if(!tt(this.config.autocapture))return[3,23];return this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(iR(ts(this.config))).promise];case 22:v.sent(),v.label=23;case 23:if("object"!=typeof(w=this.config.autocapture)||!0!==w.webVitals)return[3,25];return this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(oi()).promise];case 24:v.sent(),v.label=25;case 25:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 26:return v.sent(),p.eventBridge.setEventReceiver(function(e){var t=e.eventProperties||{}
1,n=t.time,r=D(t,["time"]);h.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}),ej(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}),eU(e,this.config.instanceName))):this.q.push(this.setDeviceId.bind(this,e))},t.prototype.reset=function(){this.setDeviceId(W()),this.setUserId(void 0)},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.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)),V(Promise.resolve());if(e===this.config.sessionId)return V(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,te(this.config.defaultTracking)&&(r&&i&&n.push(this.track(tN,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 te(this.config.defaultTracking)&&n.push(this.track(tD,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,V(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=tJ(e):this.q.push(this.setTransport.bind(this,e))},t.prototype.identify=function(t,n){if(tl(t)){var r=t._q;t._q=[],t=tc(new eX,r)}return(null==n?void 0:n.user_id)&&this.setUserId(n.user_id),(null==n?void 0:n.device_id)&&this.setDeviceId(n.device_id),e.prototype.identify.call(this,t,n)},t.prototype.groupIdentify=function(t,n,r,i){if(tl(r)){var o=r._q;r._q=[],r=tc(new eX,o)}return e.prototype.groupIdentify.call(this,t,n,r,i)},t.prototype.revenue=function(t,n){if(tl(t)){var r=t._q;t._q=[],t=tc(new e0,r)}return e.prototype.revenue.call(this,t,n)},t.prototype.trackCampaignEventIfNeeded=function(e,t){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign)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 N(this,void 0,void 0,function(){var n,r,i;return L(this,function(o){return n=Date.now(),r=e1(this.config.sessionTimeout,this.config.lastEventTime),i=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),t.event_type!==tD&&t.event_type!==tN&&(!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()),t.event_type===E.IDENTIFY&&t.user_properties&&(this.userProperties=this.getOperationAppliedUserProperties(t.user_properties)),[2,e.prototype.process.call(this,t)]})})},t.prototype.logBrowserOptions=function(e){try{var t=R(R({},e),{apiKey:e.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",JSON.stringify(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}(e6),op=function(){var e=new of;return{init:H(e.init.bind(e),"init",F(e),$(e,["config"])),add:H(e.add.bind(e),"add",F(e),$(e,["config.apiKey","timeline.plugins"])),remove:H(e.remove.bind(e),"remove",F(e),$(e,["config.apiKey","timeline.plugins"])),track:H(e.track.bind(e),"track",F(e),$(e,["config.apiKey","timeline.queue.length"])),logEvent:H(e.logEvent.bind(e),"logEvent",F(e),$(e,["config.apiKey","timeline.queue.length"])),identify:H(e.identify.bind(e),"identify",F(e),$(e,["config.apiKey","timeline.queue.length"])),groupIdentify:H(e.groupIdentify.bind(e),"groupIdentify",F(e),$(e,["config.apiKey","timeline.queue.length"])),setGroup:H(e.setGroup.bind(e),"setGroup",F(e),$(e,["config.apiKey","timeline.queue.length"])),revenue:H(e.revenue.bind(e),"revenue",F(e),$(e,["config.apiKey","timeline.queue.length"])),flush:H(e.flush.bind(e),"flush",F(e),$(e,["config.apiKey","timeline.queue.length"])),getUserId:H(e.getUserId.bind(e),"getUserId",F(e),$(e,["config","config.userId"])),setUserId:H(e.setUserId.bind(e),"setUserId",F(e),$(e,["config","config.userId"])),getDeviceId:H(e.getDeviceId.bind(e),"getDeviceId",F(e),$(e,["config","config.deviceId"])),setDeviceId:H(e.setDeviceId.bind(e),"setDeviceId",F(e),$(e,["config","config.deviceId"])),reset:H(e.reset.bind(e),"reset",F(e),$(e,["config","config.userId","config.deviceId"])),getSessionId:H(e.getSessionId.bind(e),"getSessionId",F(e),$(e,["config"])),setSessionId:H(e.setSessionId.bind(e),"setSessionId",F(e),$(e,["config"])),extendSession:H(e.extendSession.bind(e),"extendSession",F(e),$(e,["config"])),setOptOut:H(e.setOptOut.bind(e),"setOptOut",F(e),$(e,["config"])),setTransport:H(e.setTransport.bind(e),"setTransport",F(e),$(e,["config"])),getIdentity:H(e.getIdentity.bind(e),"getIdentity",F(e),$(e,["config"])),getOptOut:H(e.getOptOut.bind(e),"getOptOut",F(e),$(e,["config"])),_setDiagnosticsSampleRate:H(e._setDiagnosticsSampleRate.bind(e),"_setDiagnosticsSampleRate",F(e),$(e,["config"]))}};let oh=op();(v=O||(O={})).US="US",v.EU="EU",v.STAGING="STAGING";var ov=oh.add,og=oh.extendSession,oy=oh.flush,om=oh.getDeviceId,ob=oh.getIdentity,ow=oh.getOptOut,oE=oh.getSessionId,oS=oh.getUserId,o_=oh.groupIdentify,oT=oh.identify,ok=oh.init,oI=oh.logEvent,oP=oh.remove,oO=oh.reset,ox=oh.revenue,oA=oh.setDeviceId,oC=oh.setGroup,oR=oh.setOptOut,oD=oh.setSessionId,oN=oh.setTransport,oL=oh.setUserId,oj=oh.track,oU=oh._setDiagnosticsSampleRate}}]);

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.