PageSourceSearch

https://www.davidlloyd.be/1163-10a7425ea914f50b50c5.js

js davidlloyd.be collected 2026-10-07 07:43:43 UTC 205,641 bytes, 2 lines download raw bytes

vendor: 29,148 bytes, line 1
1(self.webpackChunkgatsby_starter_website_future=self.webpackChunkgatsby_starter_website_future||[]).push([[1163],{16064:function(e,t,n){e.exports=n(43619).Observable},43619:function(e,t){"use strict";t.Observable=void 0;const n=e=>Boolean(Symbol[e]),r=e=>n(e)?Symbol[e]:"@@"+e,i=r("iterator"),o=r("observable"),s=r("species");function a(e,t){let n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function u(e){let t=e.constructor;return void 0!==t&&(t=t[s],null===t&&(t=void 0)),void 0!==t?t:g}function c(e){c.log?c.log(e):setTimeout(()=>{throw e})}function l(e){Promise.resolve().then(()=>{try{e()}catch(t){c(t)}})}function d(e){let t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{let e=a(t,"unsubscribe");e&&e.call(t)}}catch(n){c(n)}}function f(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function v(e,t,n){e._state="running";let r=e._observer;try{let i=a(r,t);switch(t){case"next":i&&i.call(r,n);break;case"error":if(f(e),!i)throw n;i.call(r,n);break;case"complete":f(e),i&&i.call(r)}}catch(i){c(i)}"closed"===e._state?d(e):"running"===e._state&&(e._state="ready")}function p(e,t,n){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:n}],void l(()=>function(e){let t=e._queue;if(t){e._queue=void 0,e._state="ready";for(let n=0;n<t.length&&(v(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e))):void v(e,t,n);e._queue.push({type:t,value:n})}}class h{constructor(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";let n=this,r={get closed(){return"closed"===n._state},next(e){p(n,"next",e)},error(e){p(n,"error",e)},complete(){p(n,"complete")}};try{this._cleanup=t.call(void 0,r)}catch(i){r.error(i)}"initializing"===this._state&&(this._state="ready")}get closed(){return"closed"===this._state}unsubscribe(){"closed"!==this._state&&(f(this),d(this))}}class g{constructor(e){if(!(this instanceof g))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof e)throw new TypeError("Observable initializer must be a function");this._subscriber=e}subscribe(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new h(e,this._subscriber)}forEach(e){return new Promise((t,n)=>{if("function"!=typeof e)return void n(new TypeError(e+" is not a function"));function r(){i.unsubscribe(),t()}let i=this.subscribe({next(t){try{e(t,r)}catch(o){n(o),i.unsubscribe()}},error:n,complete:t})})}map(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(u(this))(t=>this.subscribe({next(n){try{n=e(n)}catch(r){return t.error(r)}t.next(n)},error(e){t.error(e)},complete(){t.complete()}}))}filter(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(u(this))(t=>this.subscribe({next(n){try{if(!e(n))return}catch(r){return t.error(r)}t.next(n)},error(e){t.error(e)},complete(){t.complete()}}))}reduce(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");let t=u(this),n=arguments.length>1,r=!1,i=arguments[1];return new t(t=>this.subscribe({next(o){let s=!r;if(r=!0,!s||n)try{i=e(i,o)}catch(a){return t.error(a)}else i=o},error(e){t.error(e)},complete(){if(!r&&!n)return t.error(new TypeError("Cannot reduce an empty sequence"));t.next(i),t.complete()}}))}async all(){let e=[];return await this.forEach(t=>e.push(t)),e}concat(...e){let t=u(this);return new t(n=>{let r,i=0;return function o(s){r=s.subscribe({next(e){n.next(e)},error(e){n.error(e)},complete(){i===e.length?(r=void 0,n.complete()):o(t.from(e[i++]))}})}(this),()=>{r&&(r.unsubscribe(),r=void 0)}})}flatMap(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");let t=u(this);return new t(n=>{let r=[],i=this.subscribe({next(i){if(e)try{i=e(i)}catch(a){return n.error(a)}let s=t.from(i).subscribe({next(e){n.next(e)},error(e){n.error(e)},complete(){let e=r.indexOf(s);e>=0&&r.splice(e,1),o()}});r.push(s)},error(e){n.error(e)},complete(){o()}});function o(){i.closed&&0===r.length&&n.complete()}return()=>{r.forEach(e=>e.unsubscribe()),i.unsubscribe()}})}[o](){return this}static from(e){let t="function"==typeof this?this:g;if(null==e)throw new TypeError(e+" is not an object");let r=a(e,o);if(r){let n=r.call(e);if(Object(n)!==n)throw new TypeError(n+" is not an object");return function(e){return e instanceof g}(n)&&n.constructor===t?n:new t(e=>n.subscribe(e))}if(n("iterator")&&(r=a(e,i),r))return new t(t=>{l(()=>{if(!t.closed){for(let n of r.call(e))if(t.next(n),t.closed)return;t.complete()}})});if(Array.isArray(e))return new t(t=>{l(()=>{if(!t.closed){for(let n=0;n<e.length;++n)if(t.next(e[n]),t.closed)return;t.complete()}})});throw new TypeError(e+" is not observable")}static of(...e){return new("function"==typeof this?this:g)(t=>{l(()=>{if(!t.closed){for(let n=0;n<e.length;++n)if(t.next(e[n]),t.closed)return;t.complete()}})})}static get[s](){return this}}t.Observable=g,Object.defineProperty(g,Symbol("extensions"),{value:{symbol:o,hostReportError:c},configurable:!0})},61163:function(e,t,n){"use strict";n.r(t),n.d(t,{AmplitudeBrowser:function(){return ao},Identify:function(){return B},Revenue:function(){return $},Types:function(){return r},_setDiagnosticsSampleRate:function(){return zo},add:function(){return wo},createInstance:function(){return uo},extendSession:function(){return Eo},flush:function(){return So},getDeviceId:function(){return ko},getIdentity:function(){return To},getOptOut:function(){return Co},getSessionId:function(){return Ao},getUserId:function(){return xo},groupIdentify:function(){return Io},identify:function(){return Po},init:function(){return Oo},logEvent:function(){return _o},remove:function(){return Ro},reset:function(){return Ho},revenue:function(){return Do},runQueuedFunctions:function(){return he},setDeviceId:function(){return Lo},setGroup:function(){return No},setIdentity:function(){return Mo},setOptOut:function(){return jo},setSessionId:function(){return Uo},setTransport:function(){return Yo},setUserId:function(){return qo},track:function(){return Fo},trackVideo:function(){return yo}});var r={};n.r(r),n.d(r,{DEFAULT_ACTION_CLICK_ALLOWLIST:function(){return Yt},DEFAULT_CSS_SELECTOR_ALLOWLIST:function(){return jt},DEFAULT_DATA_ATTRIBUTE_PREFIX:function(){return Ut},EXCLUDE_INTERNAL_REFERRERS_CONDITIONS:function(){return tt},IdentifyOperation:function(){return W.e},LogLevel:function(){return u.$},OfflineDisabled:function(){return O},RevenueProperty:function(){return J},ServerZone:function(){return bo.e},SpecialEventType:function(){return W.S}});var i=n(43964),o=n(31635),s=n(2511),a=n(40225),u=n(48003),c=n(95626),l=n(65107),d="tags",f="counters",v="histograms",p="events",h="internal",g="last_flush_timestamp",m=function(){function e(e,t){this.dbPromise=null,this.logger=t,this.dbName="AMP_diagnostics_".concat(e.substring(0,10))}return e.isSupported=function(){var e;return void 0!==(null===(e=(0,l.m)())||void 0===e?void 0:e.indexedDB)},e.prototype.getDB=function(){return(0,o.sH)(this,void 0,void 0,function(){return(0,o.YH)(this,function(e){return this.dbPromise||(this.dbPromise=this.openDB()),[2,this.dbPromise]})})},e.prototype.openDB=function(){var e=this;return new Promise(function(t,n){var r=indexedDB.open(e.dbName,1);r.onerror=function(){e.dbPromise=null,n(new Error("Failed to open IndexedDB"))},r.onsuccess=function(){var n=r.result;n.onclose=function(){e.dbPromise=null,e.logger.debug("DiagnosticsStorage: DB connection closed.")},n.onerror=function(t){e.logger.debug("DiagnosticsStorage: A global database error occurred.",t),n.close()},t(n)},r.onupgradeneeded=function(){var t=r.result;t?e.createTables(t):e.logger.debug("DiagnosticsStorage: Missing DB during upgrade.")}})},e.prototype.createTables=function(e){(e.objectStoreNames.contains(d)||e.createObjectStore(d,{keyPath:"key"}),e.objectStoreNames.contains(f)||e.createObjectStore(f,{keyPath:"key"}),e.objectStoreNames.contains(v)||e.createObjectStore(v,{keyPath:"key"}),e.objectStoreNames.contains(p))||e.createObjectStore(p,{keyPath:"id",autoIncrement:!0}).createIndex("time_idx","time",{unique:!1});e.objectStoreNames.contains(h)||e.createObjectStore(h,{keyPath:"key"})},e.prototype.setTags=function(e){return(0,o.sH)(this,void 0,void 0,function(){var t,n,r,i,s=this;return(0,o.YH)(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=a.sent(),n=t.transaction([d],"readwrite"),r=n.objectStore(d),[2,new Promise(function(t){var i=Object.entries(e);n.oncomplete=function(){t()},n.onabort=function(e){s.logger.debug("DiagnosticsStorage: Failed to set tags",e),t()},i.forEach(function(e){var t=(0,o.zs)(e,2),n=t[0],i=t[1];r.put({key:n,value:i}).onerror=function(e){s.logger.debug("DiagnosticsStorage: Failed to set tag",n,i,e)}})})];case 2:return i=a.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",i),[3,3];case 3:return[2]}})})},e.prototype.incrementCounters=function(e){return(0,o.sH)(this,void 0,void 0,function(){var t,n,r,i,s=this;return(0,o.YH)(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=a.sent(),n=t.transaction([f],"readwrite"),r=n.objectStore(f),[2,new Promise(function(t){var i=Object.entries(e);n.oncomplete=function(){t()},n.onabort=function(e){s.logger.debug("DiagnosticsStorage: Failed to increment counters",e),t()},i.forEach(function(e){var t=(0,o.zs)(e,2),n=t[0],i=t[1],a=r.get(n);a.onsuccess=function(){var e=a.result,t=e?e.value:0;r.put({key:n,value:t+i}).onerror=function(e){s.logger.debug("DiagnosticsStorage: Failed to update counter",n,e)}},a.onerror=function(e){s.logger.debug("DiagnosticsStorage: Failed to read existing counter",n,e)}})})];case 2:return i=a.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",i),[3,3];case 3:return[2]}})})},e.prototype.setHistogramStats=function(e){return(0,o.sH)(this,void 0,void 0,function(){var t,n,r,i,s=this;return(0,o.YH)(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=a.sent(),n=t.transaction([v],"readwrite"),r=n.objectStore(v),[2,new Promise(function(t){var i=Object.entries(e);n.oncomplete=function(){t()},n.onabort=function(e){s.logger.debug("DiagnosticsStorage: Failed to set histogram stats",e),t()},i.forEach(function(e){var t=(0,o.zs)(e,2),n=t[0],i=t[1],a=r.get(n);a.onsuccess=function(){var e,t=a.result;e=t?{key:n,count:t.count+i.count,min:Math.min(t.min,i.min),max:Math.max(t.max,i.max),sum:t.sum+i.sum}:{key:n,count:i.count,min:i.min,max:i.max,sum:i.sum},r.put(e).onerror=function(e){s.logger.debug("DiagnosticsStorage: Failed to set histogram stats",n,e)}},a.onerror=function(e){s.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",n,e)}})})];case 2:return i=a.sent(),this.logger.debug("DiagnosticsStorage: Failed to set histogram stats",i),[3,3];case 3:return[2]}})})},e.prototype.addEventRecords=function(e){return(0,o.sH)(this,void 0,void 0,function(){var t,n,r,i,s=this;return(0,o.YH)(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),0===e.length?[2]:[4,this.getDB()];case 1:return t=o.sent(),n=t.transaction([p],"readwrite"),r=n.objectStore(p),[2,new Promise(function(t){n.oncomplete=function(){t()},n.onabort=function(e){s.logger.debug("DiagnosticsStorage: Failed to add event records",e),t()};var i=r.count();i.onsuccess=function(){var t=i.result,n=Math.max(0,10-t);n<e.length&&s.logger.debug("DiagnosticsStorage: Only added ".concat(n," of ").concat(e.length," events due to storage limit")),e.slice(0,n).forEach(function(e){r.add(e).onerror=function(e){s.logger.debug("DiagnosticsStorage: Failed to add event record",e)}})},i.onerror=function(e){s.logger.debug("DiagnosticsStorage: Failed to count existing events",e)}})];case 2:return i=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to add event records",i),[3,3];case 3:return[2]}})})},e.prototype.setInternal=function(e,t){return(0,o.sH)(this,void 0,void 0,function(){var n,r,i,s;return(0,o.YH)(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.getDB()];case 1:return n=o.sent(),r=n.transaction([h],"readwrite"),i=r.objectStore(h),[2,new Promise(function(n,o){r.onabort=function(){return o(new Error("Failed to set internal value"))};var s=i.put({key:e,value:t});s.onsuccess=function(){return n()},s.onerror=function(){return o(new Error("Failed to set internal value"))}})];case 2:return s=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set internal value",s),[3,3];case 3:return[2]}})})},e.prototype.getInternal=function(e){return(0,o.sH)(this,void 0,void 0,function(){var t,n,r,i;return(0,o.YH)(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.getDB()];case 1:return t=o.sent(),n=t.transaction([h],"readonly"),r=n.objectStore(h),[2,new Promise(function(t,i){n.onabort=function(){return i(new Error("Failed to get internal value"))};var o=r.get(e);o.onsuccess=function(){return t(o.result)},o.onerror=function(){return i(new Error("Failed to get internal value"))}})];case 2:return i=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to get internal value",i),[2,void 0];case 3:return[2]}})})},e.prototype.getLastFlushTimestamp=function(){return(0,o.sH)(this,void 0,void 0,function(){var e,t;return(0,o.YH)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getInternal(g)];case 1:return[2,(e=n.sent())?parseInt(e.value,10):void 0];case 2:return t=n.sent(),this.logger.debug("DiagnosticsStorage: Failed to get last flush timestamp",t),[2,void 0];case 3:return[2]}})})},e.prototype.setLastFlushTimestamp=function(e){return(0,o.sH)(this,void 0,void 0,function(){var t;return(0,o.YH)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.setInternal(g,e.toString())];case 1:return n.sent(),[3,3];case 2:return t=n.sent(),this.logger.debug("DiagnosticsStorage: Failed to set last flush timestamp",t),[3,3];case 3:return[2]}})})},e.prototype.clearTable=function(e,t){return new Promise(function(n,r){var i=e.objectStore(t).clear();i.onsuccess=function(){return n()},i.onerror=function(){return r(new Error("Failed to clear table ".concat(t)))}})},e.prototype.getAllAndClear=function(){return(0,o.sH)(this,void 0,void 0,function(){var e,t,n,r,i,s,a,u;return(0,o.YH)(this,function(c){switch(c.label){case 0:return c.trys.push([0,4,,5]),[4,this.getDB()];case 1:return e=c.sent(),t=e.transaction([d,f,v,p],"readwrite"),[4,Promise.all([this.getAllFromStore(t,d),this.getAllFromStore(t,f),this.getAllFromStore(t,v),this.getAllFromStore(t,p)])];case 2:return n=o.zs.apply(void 0,[c.sent(),4]),r=n[0],i=n[1],s=n[2],a=n[3],[4,Promise.all([this.clearTable(t,f),this.clearTable(t,v),this.clearTable(t,p)])];case 3:return c.sent(),[2,{tags:r,counters:i,histogramStats:s,events:a}];case 4:return u=c.sent(),this.logger.debug("DiagnosticsStorage: Failed to get all and clear data",u),[2,{tags:[],counters:[],histogramStats:[],events:[]}];case 5:return[2]}})})},e.prototype.getAllFromStore=function(e,t){return new Promise(function(n,r){var i=e.objectStore(t).getAll();i.onsuccess=function(){return n(i.result)},i.onerror=function(){return r(new Error("Failed to get all from ".concat(t)))}})},e}(),y=n(94342),b="__AMPLITUDE_SCRIPT_URL__",w=function(){var e=(0,l.m)();if(!e)return[];var t=e[b];return Array.isArray(t)?t:"string"==typeof t?[t]:[]},E=function(e){var t,n,r=w();if(0!==r.length)try{for(var i=(0,o.Ju)(r),s=i.next();!s.done;s=i.next()){var a=s.value;if(e.filename&&e.filename.includes(a))return"filename";if(e.stack&&e.stack.includes(a))return"stack"}}catch(u){t={error:u}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},S=function(e){if(e){var t=e.match(/(https?:\/\/\S+?)(?=[)\s]|$)/);return t?t[1]:void 0}},k=function(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(t){return"[object Object]"}},T=3e5,C=1e4,A=function(){function e(e,t,n,r){void 0===n&&(n="US"),this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},this.inMemoryEvents=[],this.saveTimer=null,this.flushTimer=null,this.apiKey=e,this.logger=t,this.serverUrl="US"===n?"https://diagnostics.prod.us-west-2.amplitude.com/v1/capture":"https://diagnostics.prod.eu-central-1.amplitude.com/v1/capture",this.logger.debug("DiagnosticsClient: Initializing with options",JSON.stringify(r,null,2)),this.config=(0,o.Cl)({enabled:!0,sampleRate:0},r),this.startTimestamp=Date.now(),this.shouldTrack=(0,y.Ss)(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,m.isSupported()?this.storage=new m(e,t):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&(this.increment("sdk.diagnostics.sampled.in.and.enabled"),function(e){var t=(0,l.m)();if(t&&"function"==typeof t.addEventListener){var n=function(t){e.recordEvent("sdk.error.uncaught",(0,o.Cl)({type:t.type,message:t.message,filename:t.filename,error_name:t.errorName,stack:t.stack},t.metadata))};t.addEventListener("error",function(e){var t=e.error instanceof Error?e.error:void 0,r=null==t?void 0:t.stack,i=E({filename:e.filename,stack:r});i&&n({type:"error",message:e.message,stack:r,filename:e.filename,errorName:null==t?void 0:t.name,metadata:{colno:e.colno,lineno:e.lineno,isTrusted:e.isTrusted,matchReason:i}})},!0),t.addEventListener("unhandledrejection",function(e){var t,r=e.reason instanceof Error?e.reason:void 0,i=null==r?void 0:r.stack,o=S(i),s=E({filename:o,stack:i});s&&n({type:"unhandledrejection",message:null!==(t=null==r?void 0:r.message)&&void 0!==t?t:k(e.reason),stack:i,filename:o,errorName:null==r?void 0:r.name,metadata:{isTrusted:e.isTrusted,matchReason:s}})},!0)}}(this))}return e.prototype.isStorageAndTrackEnabled=function(){return Boolean(this.storage)&&Boolean(this.shouldTrack)},e.prototype.setTag=function(e,t){this.isStorageAndTrackEnabled()&&(Object.keys(this.inMemoryTags).length>=C?this.logger.debug("DiagnosticsClient: Early return setTags as reaching memory limit"):(this.inMemoryTags[e]=t,this.startTimersIfNeeded()))},e.prototype.increment=function(e,t){void 0===t&&(t=1),this.isStorageAndTrackEnabled()&&(Object.keys(this.inMemoryCounters).length>=C?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>=C)this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");else{var n=this.inMemoryHistograms[e];n?(n.count+=1,n.min=Math.min(n.min,t),n.max=Math.max(n.max,t),n.sum+=t):this.inMemoryHistograms[e]={count:1,min:t,max:t,sum:t},this.startTimersIfNeeded()}},e.prototype.recordEvent=function(e,t){this.isStorageAndTrackEnabled()&&(this.inMemoryEvents.length>=10?this.logger.debug("DiagnosticsClient: Early return recordEvent as reaching memory limit"):(this.inMemoryEvents.push({event_name:e,time:Date.now(),event_properties:t}),this.startTimersIfNeeded()))},e.prototype.startTimersIfNeeded=function(){var e=this;this.saveTimer||(this.saveTimer=setTimeout(function(){e.saveAllDataToStorage().catch(function(t){e.logger.debug("DiagnosticsClient: Failed to save all data to storage",t)}).finally(function(){e.saveTimer=null})},1e3)),this.flushTimer||(this.flushTimer=setTimeout(function(){e._flush().catch(function(t){e.logger.debug("DiagnosticsClient: Failed to flush",t)}).finally(function(){e.flushTimer=null})},T))},e.prototype.saveAllDataToStorage=function(){return(0,o.sH)(this,void 0,void 0,function(){var e,t,n,r;return(0,o.YH)(this,function(i){switch(i.label){case 0:return this.storage?(e=(0,o.Cl)({},this.inMemoryTags),t=(0,o.Cl)({},this.inMemoryCounters),n=(0,o.Cl)({},this.inMemoryHistograms),r=(0,o.fX)([],(0,o.zs)(this.inMemoryEvents),!1),this.inMemoryEvents=[],this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},[4,Promise.all([this.storage.setTags(e),this.storage.incrementCounters(t),this.storage.setHistogramStats(n),this.storage.addEventRecords(r)])]):[2];case 1:return i.sent(),[2]}})})},e.prototype._flush=function(){return(0,o.sH)(this,void 0,void 0,function(){var e,t,n,r,i,s,a,u,c,l;return(0,o.YH)(this,function(o){switch(o.label){case 0:return this.storage?[4,this.saveAllDataToStorage()]:[2];case 1:return o.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:return e=o.sent(),t=e.tags,n=e.counters,r=e.histogramStats,i=e.events,this.storage.setLastFlushTimestamp(Date.now()),s={},t.forEach(function(e){s[e.key]=e.value}),a={},n.forEach(function(e){a[e.key]=e.value}),u={},r.forEach(function(e){u[e.key]={count:e.count,min:e.min,max:e.max,avg:Math.round(e.sum/e.count*100)/100}}),c=i.map(function(e){return{event_name:e.event_name,time:e.time,event_properties:e.event_properties}}),0===Object.keys(a).length&&0===Object.keys(u).length&&0===c.length?[2]:(l={tags:s,histogram:u,counters:a,events:c},this.fetch(l),[2])}})})},e.prototype.fetch=function(e){return(0,o.sH)(this,void 0,void 0,function(){var t;return(0,o.YH)(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),!(0,l.m)())throw new Error("DiagnosticsClient: Fetch is not supported");return[4,fetch(this.serverUrl,{method:"POST",headers:{"X-ApiKey":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify(e)})];case 1:return n.sent().ok?(this.logger.debug("DiagnosticsClient: Successfully sent diagnostics data"),[3,3]):(this.logger.debug("DiagnosticsClient: Failed to send diagnostics data."),[2]);case 2:return t=n.sent(),this.logger.debug("DiagnosticsClient: Failed to send diagnostics data. ",t),[3,3];case 3:return[2]}})})},e.prototype.initializeFlushInterval=function(){return(0,o.sH)(this,void 0,void 0,function(){var e,t,n;return(0,o.YH)(this,function(r){switch(r.label){case 0:return this.storage?(e=Date.now(),[4,this.storage.getLastFlushTimestamp()]):[2];case 1:return-1===(t=r.sent()||-1)?(this.storage.setLastFlushTimestamp(e),this._setFlushTimer(T),[2]):(n=e-t)>=T?(this._flush(),[2]):(this._setFlushTimer(T-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=(0,y.Ss)(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e}(),x=function(){var e,t=(0,l.m)();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce(function(e,t){var n=t.split("=",2),r=I(n[0]),i=I(n[1]);return i?(e[r]=i,e):e},{}):{}},I=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(t){return""}},P=n(66295),O=null,_=n(68553),R=n(41962),H=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=_.n.Unknown),{event:e,code:t,message:n}},D=n(1555),L=n(85168),N=n(93795),M=new Set([R.mJ,R.bu,R.pL,R.OP]);function j(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(n){}return t}var U,Y=function(){function e(e){this.name="amplitude",this.type="destination",this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduleId=null,this.scheduledTimeout=0,this.flushId=null,this.queue=[],this.diagnosticsClient=null==e?void 0:e.diagnosticsClient}return e.prototype.setup=function(e){var t;return(0,o.sH)(this,void 0,void 0,function(){var n,r=this;return(0,o.YH)(this,function(i){switch(i.label){case 0:return this.config=e,this.storageKey="".concat(R.fS,"_").concat(this.config.apiKey.substring(0,10)),[4,null===(t=this.config.storageProvider)||void 0===t?void 0:t.get(this.storageKey)];case 1:return(n=i.sent())&&n.length>0&&Promise.all(n.map(function(e){return r.execute(e)})).catch(),[2,Promise.resolve(void 0)]}})})},e.prototype.execute=function(e){var t=this;return e.insert_id||(e.insert_id=(0,L.k)()),new Promise(function(n){var r={event:e,attempts:0,callback:function(e){return n(e)},timeout:0};t.queue.push(r),t.schedule(t.config.flushIntervalMillis),t.saveEvents()})},e.prototype.removeEventsExceedFlushMaxRetries=function(e){var t=this;return e.filter(function(e){return e.attempts+=1,e.attempts<t.config.flushMaxRetries||(t.fulfillRequest([e],500,"Event rejected due to exceeded retry count"),!1)})},e.prototype.scheduleEvents=function(e){var t=this;e.forEach(function(e){t.schedule(0===e.timeout?t.config.flushIntervalMillis:e.timeout)})},e.prototype.schedule=function(e){var t=this;if(!this.config.offline)return null===this.scheduleId||this.scheduleId&&e>this.scheduledTimeout?(this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=e,void(this.scheduleId=setTimeout(function(){t.queue=t.queue.map(function(e){return e.timeout=0,e}),t.flush(!0)},e))):void 0},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(e){return void 0===e&&(e=!1),(0,o.sH)(this,void 0,void 0,function(){var t,n,r=this;return(0,o.YH)(this,function(i){switch(i.label){case 0:return this.config.offline?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2]):this.flushId?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2]):(this.flushId=this.scheduleId,this.resetSchedule(),t=[],n=[],this.queue.forEach(function(e){return 0===e.timeout?t.push(e):n.push(e)}),s=t,a=this.config.flushQueueSize,u=Math.max(a,1),[4,s.reduce(function(e,t,n){var r=Math.floor(n/u);return e[r]||(e[r]=[]),e[r].push(t),e},[]).reduce(function(t,n){return(0,o.sH)(r,void 0,void 0,function(){return(0,o.YH)(this,function(r){switch(r.label){case 0:return[4,t];case 1:return r.sent(),[4,this.send(n,e)];case 2:return[2,r.sent()]}})})},Promise.resolve())]);case 1:return i.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}var s,a,u})})},e.prototype.send=function(e,t){var n;return void 0===t&&(t=!0),(0,o.sH)(this,void 0,void 0,function(){var r,s,a,u,c,l;return(0,o.YH)(this,function(d){switch(d.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];r={api_key:this.config.apiKey,events:e.map(function(e){var t=e.event;t.extra;return(0,o.Tt)(t,["extra"])}),options:{min_id_length:this.config.minIdLength},client_upload_time:(new Date).toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new D.vG,d.label=1;case 1:return d.trys.push([1,3,,4]),s=(0,D.Ql)(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,a=function(e,t){return void 0===t&&(t=!1),!!M.has(e)||t}(s,this.config.enableRequestBodyCompression),[4,this.config.transportProvider.send(s,r,a)];case 2:return null===(u=d.sent())?(this.fulfillRequest(e,0,"Unexpected error occurred"),[2]):t?(this.handleResponse(u,e),[3,4]):("body"in u?this.fulfillRequest(e,u.statusCode,"".concat(u.status,": ").concat(j(u))):this.fulfillRequest(e,u.statusCode,u.status),[2]);case 3:return c=d.sent(),l=(f=c)instanceof Error?f.message:String(f),this.config.loggerProvider.error(l),null===(n=this.diagnosticsClient)||void 0===n||n.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:e.map(function(e){return e.event.event_type}),message:l,stack_trace:(0,i.cI)()}),this.handleResponse({status:_.n.Failed,statusCode:0},e),[3,4];case 4:return[2]}var f})})},e.prototype.handleResponse=function(e,t){var n;(0,N.R)(e.statusCode)||null===(n=this.diagnosticsClient)||void 0===n||n.recordEvent("analytics.events.unsuccessful",{events:t.map(function(e){return e.event.event_type}),code:e.statusCode,status:e.status,body:j(e),stack_trace:(0,i.cI)()});var r=e.status;switch(r){case _.n.Success:this.handleSuccessResponse(e,t);break;case _.n.Invalid:this.handleInvalidResponse(e,t);break;case _.n.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case _.n.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.config.loggerProvider.warn("{code: 0, error: \"Status '".concat(r,"' provided for ").concat(t.length,' events"}')),this.handleOtherResponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,"Event tracked successfully")},e.prototype.handleInvalidResponse=function(e,t){var n=this;if(e.body.missingField||e.body.error.startsWith("Invalid API key"))this.fulfillRequest(t,e.statusCode,e.body.error);else{var r=(0,o.fX)((0,o.fX)((0,o.fX)((0,o.fX)([],(0,o.zs)(Object.values(e.body.eventsWithInvalidFields)),!1),(0,o.zs)(Object.values(e.body.eventsWithMissingFields)),!1),(0,o.zs)(Object.values(e.body.eventsWithInvalidIdLengths)),!1),(0,o.zs)(e.body.silencedEvents),!1).flat(),i=new Set(r),s=t.filter(function(t,r){if(!i.has(r))return!0;n.fulfillRequest([t],e.statusCode,e.body.error)});s.length>0&&this.config.loggerProvider.warn(j(e));
1var a=this.removeEventsExceedFlushMaxRetries(s);this.scheduleEvents(a)}},e.prototype.handlePayloadTooLargeResponse=function(e,t){if(1!==t.length){this.config.loggerProvider.warn(j(e)),this.config.flushQueueSize/=2;var n=this.removeEventsExceedFlushMaxRetries(t);this.scheduleEvents(n)}else this.fulfillRequest(t,e.statusCode,e.body.error)},e.prototype.handleRateLimitResponse=function(e,t){var n=this,r=Object.keys(e.body.exceededDailyQuotaUsers),i=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,s=new Set(r),a=new Set(i),u=new Set(o),c=t.filter(function(t,r){if(!(t.event.user_id&&s.has(t.event.user_id)||t.event.device_id&&a.has(t.event.device_id)))return u.has(r)&&(t.timeout=n.throttleTimeout),!0;n.fulfillRequest([t],e.statusCode,e.body.error)});c.length>0&&this.config.loggerProvider.warn(j(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){var r,o,s;(0,N.R)(t)?null===(s=this.diagnosticsClient)||void 0===s||s.increment("analytics.events.sent",e.length):(null===(r=this.diagnosticsClient)||void 0===r||r.increment("analytics.events.dropped",e.length),null===(o=this.diagnosticsClient)||void 0===o||o.recordEvent("analytics.events.dropped",{events:e.map(function(e){return e.event.event_type}),code:t,message:n,stack_trace:(0,i.cI)()})),this.removeEvents(e),e.forEach(function(e){return e.callback(H(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}(),q=function(){function e(){this.name="identity",this.type="before",this.identityStore=(0,P.w$)().identityStore}return e.prototype.execute=function(e){return(0,o.sH)(this,void 0,void 0,function(){var t;return(0,o.YH)(this,function(n){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]})})},e.prototype.setup=function(e){return(0,o.sH)(this,void 0,void 0,function(){return(0,o.YH)(this,function(t){return e.instanceName&&(this.identityStore=(0,P.w$)(e.instanceName).identityStore),[2]})})},e}(),F=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var n=e[t];if(!z(t,n))return!1}return!0},z=function(e,t){var n,r;if("string"!=typeof e)return!1;if(Array.isArray(t)){var i=!0;try{for(var s=(0,o.Ju)(t),a=s.next();!a.done;a=s.next()){var u=a.value;if(Array.isArray(u))return!1;if("object"==typeof u)i=i&&F(u);else if(!["number","string"].includes(typeof u))return!1;if(!i)return!1}}catch(c){n={error:c}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}}else{if(null==t)return!1;if("object"==typeof t)return F(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},B=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return(0,o.Cl)({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(U.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(U.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(U.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(U.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(U.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(U.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(U.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(U.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(U.UNSET,e,R.mG),this},e.prototype.clearAll=function(){return this._properties={},this._properties[U.CLEAR_ALL]=R.mG,this}
1,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[U.CLEAR_ALL]&&(!this._propertySet.has(t)&&(e===U.ADD?"number"==typeof n:e===U.UNSET||e===U.REMOVE||z(t,n)))},e}();!function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(U||(U={}));var J,V=[U.CLEAR_ALL,U.UNSET,U.SET,U.SET_ONCE,U.ADD,U.APPEND,U.PREPEND,U.PREINSERT,U.POSTINSERT,U.REMOVE],W=n(97184),X=function(e,t){return(0,o.Cl)((0,o.Cl)({},t),{event_type:W.S.IDENTIFY,user_properties:e.getUserProperties()})},$=function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(e){return this.productId=e,this},e.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},e.prototype.setPrice=function(e){return this.price=e,this},e.prototype.setRevenueType=function(e){return this.revenueType=e,this},e.prototype.setCurrency=function(e){return this.currency=e,this},e.prototype.setRevenue=function(e){return this.revenue=e,this},e.prototype.setReceipt=function(e){return this.receipt=e,this},e.prototype.setReceiptSig=function(e){return this.receiptSig=e,this},e.prototype.setEventProperties=function(e){try{var t=JSON.parse(JSON.stringify(e));F(t)&&(this.properties=t)}catch(n){}return this},e.prototype.getEventProperties=function(){var e=this.properties?(0,o.Cl)({},this.properties):{};return e[J.REVENUE_PRODUCT_ID]=this.productId,e[J.REVENUE_QUANTITY]=this.quantity,e[J.REVENUE_PRICE]=this.price,e[J.REVENUE_TYPE]=this.revenueType,e[J.REVENUE_CURRENCY]=this.currency,e[J.REVENUE]=this.revenue,e[J.RECEIPT]=this.receipt,e[J.RECEIPT_SIG]=this.receiptSig,e},e}();!function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue",e.RECEIPT="$receipt",e.RECEIPT_SIG="$receiptSig"}(J||(J={}));var K=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e},G=n(81401),Q=n.n(G)()||G,Z=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[],this.pluginStatus=new Map,this._optOutListeners=[]}return e.prototype.register=function(e,t){var n,r;return(0,o.sH)(this,void 0,void 0,function(){var i;return(0,o.YH)(this,function(o){switch(o.label){case 0:return void 0===e.name&&(e.name=(0,L.k)(),this.loggerProvider.warn("Plugin name is undefined.\n      Generating a random UUID for plugin name: ".concat(e.name,".\n      Set a name for the plugin to prevent it from being added multiple times."))),i=e.name,this.pluginStatus.has(i)?(this.loggerProvider.warn("Plugin with name ".concat(i," already exists, skipping registration")),[2]):(e.type=null!==(n=e.type)&&void 0!==n?n:"enrichment",this.pluginStatus.set(i,"locked"),[4,null===(r=e.setup)||void 0===r?void 0:r.call(e,t,this.client)]);case 1:return o.sent(),"locked"!==this.pluginStatus.get(i)?[2]:(this.plugins.push(e),this.pluginStatus.set(i,"installed"),[2])}})})},e.prototype.deregister=function(e,t){var n;return(0,o.sH)(this,void 0,void 0,function(){var r,i;return(0,o.YH)(this,function(o){switch(o.label){case 0:return this.pluginStatus.delete(e),r=this.plugins.findIndex(function(t){return t.name===e}),-1===r?(t.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2]):(i=this.plugins[r],this.plugins.splice(r,1),[4,null===(n=i.teardown)||void 0===n?void 0:n.call(i)]);case 1:return o.sent(),[2]}})})},e.prototype.reset=function(e){this._clearOptOutListeners(),this.applying=!1,this.plugins.map(function(e){var t;return null===(t=e.teardown)||void 0===t?void 0:t.call(e)}),this.plugins=[],this.pluginStatus.clear(),this.client=e},e.prototype.push=function(e){var t=this;return new Promise(function(n){t.queue.push([e,n]),t.scheduleApply(0)})},e.prototype.scheduleApply=function(e){var t=this;this.applying||(this.applying=!0,setTimeout(function(){t.apply(t.queue.shift()).then(function(){t.applying=!1,t.queue.length>0&&t.scheduleApply(0)})},e))},e.prototype.apply=function(e){return(0,o.sH)(this,void 0,void 0,function(){var t,n,r,i,s,a,u,c,l,d,f,v,p,h,g,m,y,b,w,E;return(0,o.YH)(this,function(S){switch(S.label){case 0:if(!e)return[2];t=(0,o.zs)(e,1),n=t[0],r=(0,o.zs)(e,2),i=r[1],this.loggerProvider.log("Timeline.apply: Initial event",n),s=this.plugins.filter(function(e){return"before"===e.type}),S.label=1;case 1:S.trys.push([1,6,7,8]),a=(0,o.Ju)(s),u=a.next(),S.label=2;case 2:return u.done?[3,5]:(v=u.value).execute?[4,v.execute((0,o.Cl)({},n))]:[3,4];case 3:if(null===(p=S.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(v.name),"', event: ").concat(JSON.stringify(n))),i({event:n,code:0,message:""}),[2];n=p,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(v.name),"', event: ").concat(JSON.stringify(n))),S.label=4;case 4:return u=a.next(),[3,2];case 5:return[3,8];case 6:return c=S.sent(),y={error:c},[3,8];case 7:try{u&&!u.done&&(b=a.return)&&b.call(a)}finally{if(y)throw y.error}
vendor: 4,180 bytes, line 1
1return[7];case 8:l=this.plugins.filter(function(e){return"enrichment"===e.type||void 0===e.type}),S.label=9;case 9:S.trys.push([9,14,15,16]),d=(0,o.Ju)(l),f=d.next(),S.label=10;case 10:return f.done?[3,13]:(v=f.value).execute?[4,v.execute((0,o.Cl)({},n))]:[3,12];case 11:if(null===(p=S.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(v.name),"', event: ").concat(JSON.stringify(n))),i({event:n,code:0,message:""}),[2];n=p,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(v.name),"', event: ").concat(JSON.stringify(n))),S.label=12;case 12:return f=d.next(),[3,10];case 13:return[3,16];case 14:return h=S.sent(),w={error:h},[3,16];case 15:try{f&&!f.done&&(E=d.return)&&E.call(d)}finally{if(w)throw w.error}return[7];case 16:return g=this.plugins.filter(function(e){return"destination"===e.type}),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(JSON.stringify(n))),m=g.map(function(e){var t=(0,o.Cl)({},n);return e.execute(t).catch(function(e){return H(t,0,String(e))})}),Promise.all(m).then(function(e){var t=(0,o.zs)(e,1)[0]||H(n,100,"Event not tracked, no destination plugins on the instance");i(t)}),[2]}})})},e.prototype.flush=function(){return(0,o.sH)(this,void 0,void 0,function(){var e,t,n,r=this;return(0,o.YH)(this,function(i){switch(i.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map(function(e){return r.apply(e)}))];case 1:return i.sent(),t=this.plugins.filter(function(e){return"destination"===e.type}),n=t.map(function(e){return e.flush&&e.flush()}),[4,Promise.all(n)];case 2:return i.sent(),[2]}})})},e.prototype.addOptOutListener=function(e){this._optOutListeners.push(e)},e.prototype._clearOptOutListeners=function(){this._optOutListeners=[]},e.prototype.onIdentityChanged=function(e){this.plugins.forEach(function(t){var n;null===(n=t.onIdentityChanged)||void 0===n||n.call(t,e)})},e.prototype.onSessionIdChanged=function(e){this.plugins.forEach(function(t){var n;null===(n=t.onSessionIdChanged)||void 0===n||n.call(t,e)})},e.prototype.onOptOutChanged=function(e){this.plugins.forEach(function(t){var n;null===(n=t.onOptOutChanged)||void 0===n||n.call(t,e)}),this._callOptOutListeners(e)},e.prototype._callOptOutListeners=function(e){return(0,o.sH)(this,void 0,void 0,function(){var t,n,r,i,s,a,u;return(0,o.YH)(this,function(c){switch(c.label){case 0:c.trys.push([0,7,8,9]),t=(0,o.Ju)(this._optOutListeners),n=t.next(),c.label=1;case 1:if(n.done)return[3,6];r=n.value,c.label=2;case 2:return c.trys.push([2,4,,5]),[4,r(e)];case 3:return c.sent(),[3,5];case 4:return i=c.sent(),this.loggerProvider.error("Error calling optOut listener",i),[3,5];case 5:return n=t.next(),[3,1];case 6:return[3,9];case 7:return s=c.sent(),a={error:s},[3,9];case 8:try{n&&!n.done&&(u=t.return)&&u.call(t)}finally{if(a)throw a.error}return[7];case 9:return[2]}})})},e.prototype.onReset=function(){this.plugins.forEach(function(e){var t;null===(t=e.onReset)||void 0===t||t.call(e)})},e}(),ee=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 Z(this),this.name=e}return e.prototype._init=function(e){return(0,o.sH)(this,void 0,void 0,function(){var t=this;return(0,o.YH)(this,function(n){switch(n.label){case 0:return this.config=e,this.timeline.reset(this),this.timeline.loggerProvider=this.config.loggerProvider,[4,this.runQueuedFunctions("q",function(){return t.isReady=!0})];case 1:return n.sent(),[2]}})})},e.prototype.runQueuedFunctions=function(e,t){return(0,o.sH)(this,void 0,void 0,function(){var n,r,i,s,a,u,c,l;return(0,o.YH)(this,function(d){switch(d.label){case 0:n=this[e],this[e]=[],d.label=1;case 1:d.trys.push([1,8,9,10]),r=(0,o.Ju)(n),i=r.next(),d.label=2;case 2:return i.done?[3,7]:(s=i.value,(a=s())&&"promise"in a?[4,a.promise]:[3,4]);case 3:return d.sent(),[3,6];case 4:return[4,a];case 5:d.sent(),d.label=6;case 6:return i=r.next(),[3,2];case 7:return[3,10];case 8:return u=d.sent(),c={error:u},[3,10];case 9:try{i&&!i.done&&(l=r.return)&&l.call(r)}finally{if(c)throw c.error}
1return[7];case 10:return this[e].length?[4,this.runQueuedFunctions(e,t)]:[3,12];case 11:return d.sent(),[3,13];case 12:null==t||t(),d.label=13;case 13:return[2]}})})},e.prototype.track=function(e,t,n){var r=function(e,t,n){var r="string"==typeof e?{event_type:e}:e;return(0,o.Cl)((0,o.Cl)((0,o.Cl)({},r),n),t&&{event_properties:t})}(e,t,n);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),(0,s.m)(this.dispatch(r))},e.prototype.identify=function(e,t){var n=X(e,t);return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),(0,s.m)(this.dispatch(n))},e.prototype.groupIdentify=function(e,t,n,r){var i=function(e,t,n,r){var i;return(0,o.Cl)((0,o.Cl)({},r),{event_type:W.S.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(i={},i[e]=t,i)})}(e,t,n,r);return(0,s.m)(this.dispatch(i))},e.prototype.setGroup=function(e,t,n){var r=function(e,t,n){var r,i=new B;return i.set(e,t),(0,o.Cl)((0,o.Cl)({},n),{event_type:W.S.IDENTIFY,user_properties:i.getUserProperties(),groups:(r={},r[e]=t,r)})}(e,t,n);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),(0,s.m)(this.dispatch(r))},e.prototype.revenue=function(e,t){var n=function(e,t){return(0,o.Cl)((0,o.Cl)({},t),{event_type:W.S.REVENUE,event_properties:e.getEventProperties()})}(e,t);return(0,s.m)(this.dispatch(n))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),(0,s.m)())},e.prototype._addPlugin=function(e){return(0,s.m)(this.timeline.register(e,this.config))},e.prototype.remove=function(e){return this.isReady?this._removePlugin(e):(this.q.push(this._removePlugin.bind(this,e)),(0,s.m)())},e.prototype._removePlugin=function(e){return(0,s.m)(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(H(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return(0,o.sH)(this,void 0,void 0,function(){var t=this;return(0,o.YH)(this,function(n){return this.isReady?[2,this.process(e)]:[2,new Promise(function(n){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,n))})]})})},e.prototype.getOperationAppliedUserProperties=function(e){var t,n=null!==(t=this.userProperties)&&void 0!==t?t:{},r=(0,o.Cl)({},n);if(void 0===e)return r;var i={};return Object.keys(e).forEach(function(t){Object.values(W.e).includes(t)||(i[t]=e[t])}),V.forEach(function(t){if(Object.keys(e).includes(t)){var n=e[t];switch(t){case W.e.CLEAR_ALL:Object.keys(r).forEach(function(e){delete r[e]});break;case W.e.UNSET:Object.keys(n).forEach(function(e){delete r[e]});break;case W.e.SET:Object.assign(r,n)}}}),Object.assign(r,i),r},e.prototype.process=function(e){return(0,o.sH)(this,void 0,void 0,function(){var t,n,r;return(0,o.YH)(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this.config.optOut?[2,H(e,0,"Event skipped due to optOut config")]:(e.event_type===W.S.IDENTIFY&&this.timeline.onIdentityChanged({userProperties:this.userProperties}),[4,this.timeline.push(e)]);case 1:return 200===(r=i.sent()).code?this.config.loggerProvider.log(r.message):100===r.code?this.config.loggerProvider.warn(r.message):this.config.loggerProvider.error(r.message),[2,r];case 2:return t=i.sent(),n=String(t),this.config.loggerProvider.error(n),[2,r=H(e,0,n)];case 3:return[2]}})})},e.prototype.setOptOut=function(e){this.isReady?this._setOptOut(e):this.q.push(this._setOptOut.bind(this,Boolean(e)))},e.prototype._setOptOut=function(e){this.config.optOut!==e&&(this.config.optOut=Boolean(e),this.timeline.onOptOutChanged(e))},e.prototype.flush=function(){return(0,s.m)(this.timeline.flush())},e.prototype.plugin=function(e){var t=this.timeline.plugins.find(function(t){return t.name===e});if(void 0!==t)return t;this.config.loggerProvider.debug("Cannot find plugin with name ".concat(e))},e.prototype.plugins=function(e){return this.timeline.plugins.filter(function(t){return t instanceof e})},e}();var te=function(e,t){return null==e?void 0:e.map(function(e){var n,r;if((null===(n=e.urls)||void 0===n?void 0:n.length)&&(null===(r=e.hosts)||void 0===r?void 0:r.length)){var i=JSON.stringify(e.hosts),s=JSON.stringify(e.urls);return null==t||t.warn("Found network capture rule with both urls='".concat(s,"' and hosts='").concat(i,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),(0,o.Cl)((0,o.Cl)({},e),{hosts:void 0})}return e})},ne=function(e,t){return"boolean"==typeof e?e:!1!==(null==e?void 0:e[t])&&(!function(){var e,t,n=(0,l.m)();return"string"==typeof(null===(t=null===(e=null==n?void 0:n.chrome)||void 0===e?void 0:e.runtime)||void 0===t?void 0:t.id)}()||!!(null==e?void 0:e[t]))},re=function(e){return ne(e,"attribution")},ie=function(e){return ne(e,"formInteractions")},oe=function(e){return ne(e,"pageViews")},se=function(e){return ne(e,"sessions")},ae=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.networkTracking||"object"==typeof e.networkTracking)},ue=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},ce=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.frustrationInteractions||"object"==typeof e.frustrationInteractions)},le=function(e){if("object"==typeof e.autocapture){var t=e.autocapture.performanceTracking;return!0===t?{mainThreadBlock:!0}:"object"==typeof t&&null!==t?t:void 0}},de=function(e){if(ue(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},fe=function(e){if(ce(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.frustrationInteractions)return e.autocapture.frustrationInteractions},ve=function(e){if(ae(e.autocapture)){var t=void 0;return"object"==typeof e.autocapture&&"object"==typeof e.autocapture.
vendor: 37,433 bytes, line 1
1networkTracking?t=e.autocapture.networkTracking:e.networkTrackingOptions&&(t=e.networkTrackingOptions),(0,o.Cl)((0,o.Cl)({},t),{captureRules:te(null==t?void 0:t.captureRules,e.loggerProvider)})}},pe=function(e){var t,n=function(){return!1},r=void 0,i=e.pageCounter;return oe(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}},he=function(e,t){ge(e,t)},ge=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},me=function(e){return e&&void 0!==e._q},ye=function(){var e,t,n,r;if("undefined"==typeof navigator)return"";var i=navigator.userLanguage;return null!==(r=null!==(n=null!==(t=null===(e=navigator.languages)||void 0===e?void 0:e[0])&&void 0!==t?t:navigator.language)&&void 0!==n?n:i)&&void 0!==r?r:""},be="2.45.5",we="amplitude-ts",Ee=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(we,"/").concat(be),"undefined"!=typeof navigator&&(this.userAgent=navigator.userAgent)}return e.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},e.prototype.execute=function(e){var t,n;return(0,o.sH)(this,void 0,void 0,function(){var r,i,s;return(0,o.YH)(this,function(a){return r=(new Date).getTime(),i=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1,s=null!==(n=e.event_id)&&void 0!==n?n:i+1,this.config.lastEventId=s,e.time||(this.config.lastEventTime=r),[2,(0,o.Cl)((0,o.Cl)((0,o.Cl)((0,o.Cl)((0,o.Cl)((0,o.Cl)((0,o.Cl)((0,o.Cl)({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:r},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:"Web"}),this.config.trackingOptions.language&&{language:ye()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:(0,L.k)(),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:s,library:this.library,user_agent:this.userAgent})]})})},e}(),Se=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return(0,o.sH)(this,void 0,void 0,function(){return(0,o.YH)(this,function(e){return[2,!0]})})},e.prototype.get=function(e){return(0,o.sH)(this,void 0,void 0,function(){return(0,o.YH)(this,function(t){return[2,this.memoryStorage.get(e)]})})},e.prototype.getRaw=function(e){return(0,o.sH)(this,void 0,void 0,function(){var t;return(0,o.YH)(this,function(n){switch(n.label){case 0:return[4,this.get(e)];case 1:return[2,(t=n.sent())?JSON.stringify(t):void 0]}})})},e.prototype.set=function(e,t){return(0,o.sH)(this,void 0,void 0,function(){return(0,o.YH)(this,function(n){return this.memoryStorage.set(e,t),[2]})})},e.prototype.remove=function(e){return(0,o.sH)(this,void 0,void 0,function(){return(0,o.YH)(this,function(t){return this.memoryStorage.delete(e),[2]})})},e.prototype.reset=function(){return(0,o.sH)(this,void 0,void 0,function(){return(0,o.YH)(this,function(e){return this.memoryStorage.clear(),[2]})})},e}(),ke=function(){function e(e,t){void 0===t&&(t={}),this.options=(0,o.Cl)({},e),this.config=t}return e.prototype.isEnabled=function(){return(0,o.sH)(this,void 0,void 0,function(){var t,n,r,i,s=this;return(0,o.YH)(this,function(a){switch(a.label){case 0:return t="AMP_TEST",n=(0,o.Cl)({},this.options),r=new e(n),i=String(Date.now()),[4,r.transaction(t,function(e){var n,r;try{e.set(i);var o=e.get()===i;return!o&&s.config.diagnosticsClient&&(null===(n=s.config.diagnosticsClient)||void 0===n||n.recordEvent("cookies.isEnabled.failure",{reason:"Test Value mismatch",testKey:t,testValue:i,sync:!0})),o}catch(ii){if(s.config.diagnosticsClient){var a=ii instanceof Error?ii.message:String(ii);null===(r=s.config.diagnosticsClient)||void 0===r||r.recordEvent("cookies.isEnabled.failure",{reason:"Cookie getter/setter failed",testKey:t,testValue:i,error:a,sync:!0})}return!1}finally{e.set(null)}})];case 1:return[2,a.sent()]}})})},e.prototype.get=function(e){return(0,o.sH)(this,void 0,void 0,function(){var t;return(0,o.YH)(this,function(n){switch(n.label){case 0:return[4,this.getRaw(e)];case 1:return t=n.sent(),[2,this.decodeCookieValue(e,t)]}})})},e.prototype.decodeCookieValue=function(e,t){if(t)try{var n=Te(t);return void 0===n?void console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(t)):JSON.parse(n)}catch(r){return void console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(t))}},e.prototype.getSync=function(e){var t=this.getRawSync(e);return this.decodeCookieValue(e,t)},e.prototype.getRaw=function(e){var t,n;return(0,o.sH)(this,void 0,void 0,function(){var r,i,s,a,u,c,d,f,v;return(0,o.YH)(this,function(p){switch(p.label){case 0:r=(0,l.m)(),i=r,p.label=1;case 1:return p.trys.push([1,4,,5]),(s=null==i?void 0:i.cookieStore)?[4,s.getAll(e)]:[3,3];case 2:if(a=p.sent()){a.length>1&&(null===(t=this.config.diagnosticsClient)||void 0===t||t.recordEvent("cookies.duplicate",{cookies:a.map(function(e){return e.domain})}),null===(n=this.config.diagnosticsClient)||void 0===n||n.increment("cookies.duplicate.occurrence.cookieStore"));try{for(u=(0,o.Ju)(a),c=u.next();!c.done;c=u.next())if(d=c.value,Ce(d.domain,this.options.domain))return[2,d.value]}catch(h){f={error:h}}finally{try{c&&!c.done&&(v=u.return)&&v.call(u)}finally{if(f)throw f.error}}}p.label=3;case 3:return[3,5];case 4:return p.sent(),[3,5];case 5:return[2,this.getRawSync(e)]}})})},e.prototype.getRawSync=function(e){var t,n,r=this,i=(0,l.m)(),o=(null!==(n=null===(t=null==i?void 0:i.document)||void 0===t?void 0:t.cookie.split("; "))&&void 0!==n?n:[]).filter(function(t){return 0===t.indexOf(e+"=")}),s=void 0,a=this.config.duplicateResolverFn;if("function"==typeof a&&o.length>1&&(s=o.find(function(t){var n;try{var i=a(t.substring(e.length+1));return i||null===(n=r.config.diagnosticsClient)||void 0===n||n.increment("cookies.duplicate.occurrence.document.cookie"),i}catch(o){return!1}})),s||(s=o[0]),s)return s.substring(e.length+1)},e.prototype.set=function(e,t){return(0,o.sH)(this,void 0,void 0,function(){return(0,o.YH)(this,function(n){return this.setSync(e,t),[2]})})},e.prototype.setSync=function(e,t){var n;try{var r=(0,l.m)();if(!r||!r.document||"function"!=typeof r.btoa||"function"!=typeof r.encodeURIComponent)return;var i=null!==(n=this.options.expirationDays)&&void 0!==n?n:0,o=null!==t?i:-1,s=void 0;if(o){var a=new Date;a.setTime(a.getTime()+24*o*60*60*1e3),s=a}var u="".concat(e,"=").concat(r.btoa(r.encodeURIComponent(JSON.stringify(t))));s&&(u+="; expires=".concat(s.toUTCString())),u+="; path=/",this.options.domain&&(u+="; domain=".concat(this.options.domain)),this.options.secure&&(u+="; Secure"),this.options.sameSite&&(u+="; SameSite=".concat(this.options.sameSite)),r.document.cookie=u}catch(d){var c=d instanceof Error?d.message:String(d);console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(c))}},e.prototype.remove=function(e){return(0,o.sH)(this,void 0,void 0,function(){return(0,o.YH)(this,function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}})})},e.prototype.reset=function(){return(0,o.sH)(this,void 0,void 0,function(){return(0,o.YH)(this,function(e){return[2]})})},e.isDomainWritable=function(t){return(0,o.sH)(this,void 0,void 0,function(){var n,r;return(0,o.YH)(this,function(i){switch(i.label){case 0:if(e.cachedTlds[t])return[2,!0];n="AMP_TLDTEST",r=new e({domain:"."+t}),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,r.transaction(n,function(n){if(e.cachedTlds[t])return!0;try{n.set(1);var r=!!n.get();return r&&(e.cachedTlds[t]=!0),r}finally{n.set(null)}})];case 2:return[2,!!i.sent()];case 3:return i.sent(),[2,!1];case 4:return[2]}})})},e.prototype.transaction=function(e,t){return(0,o.sH)(this,void 0,void 0,function(){var n,r,i=this;return(0,o.YH)(this,function(o){switch(o.label){case 0:if(n=function(){var e,t=(0,l.m)();return null===(e=null==t?void 0:t.navigator)||void 0===e?void 0:e.locks}(),r=function(){return t({get:function(){return i.getSync(e)},set:function(t){return i.setSync(e,t)}})},!n)return[2,r()];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,n.request("com.amplitude:cookie-lock:".concat(e),r)];case 2:return[2,o.sent()];case 3:return o.sent(),[2,r()];case 4:return[2]}})})},e.cachedTlds={},e}(),Te=function(e){var t;return null!==(t=function(e){try{return decodeURIComponent(atob(e))}catch(t){return}}(e))&&void 0!==t?t:function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(t){return}}(e)},Ce=function(e,t){if(""===e&&""===t)return!0;if(!e||!t)return!1;var n=e.startsWith(".")?e.substring(1):e,r=t.startsWith(".")?t.substring(1):t;return n.toLowerCase()===r.toLowerCase()},Ae=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),[R.r,t,e.substring(0,n)].filter(Boolean).join("_")},xe=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return(0,o.sH)(this,void 0,void 0,function(){var t,n,r;return(0,o.YH)(this,function(i){switch(i.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),n=new e(this.storage),r="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,n.set(r,t)];case 2:return i.sent(),[4,n.get(r)];case 3:return[2,i.sent()===t];case 4:return i.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return i.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(e){return(0,o.sH)(this,void 0,void 0,function(){var t;return(0,o.YH)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return(t=n.sent())?[2,JSON.parse(t)]:[2,void 0];case 2:return n.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}})})},e.prototype.getRaw=function(e){var t;return(0,o.sH)(this,void 0,void 0,function(){return(0,o.YH)(this,function(n){return[2,(null===(t=this.storage)||void 0===t?void 0:t.getItem(e))||void 0]})})},e.prototype.set=function(e,t){var n;return(0,o.sH)(this,void 0,void 0,function(){return(0,o.YH)(this,function(r){try{null===(n=this.storage)||void 0===n||n.setItem(e,JSON.stringify(t))}catch(i){}return[2]})})},e.prototype.remove=function(e){var t;return(0,o.sH)(this,void 0,void 0,function(){return(0,o.YH)(this,function(n){try{null===(t=this.storage)||void 0===t||t.removeItem(e)}catch(r){}return[2]})})},e.prototype.reset=function(){var e;return(0,o.sH)(this,void 0,void 0,function(){return(0,o.YH)(this,function(t){try{null===(e=this.storage)||void 0===e||e.clear()}catch(n){}return[2]})})},e}(),Ie=1e3,Pe=function(e){function t(t){var n,r,i,o=this;try{i=null===(n=(0,l.m)())||void 0===n?void 0:n.localStorage}catch(ii){null===(r=null==t?void 0:t.loggerProvider)||void 0===r||r.debug("Failed to access localStorage. error=".concat(JSON.stringify(ii))),i=void 0}return(o=e.call(this,i)||this).loggerProvider=null==t?void 0:t.loggerProvider,o}return(0,o.C6)(t,e),t.prototype.set=function(t,n){var r;return(0,o.sH)(this,void 0,void 0,function(){var i;return(0,o.YH)(this,function(o){switch(o.label){case 0:return Array.isArray(n)&&n.length>Ie?(i=n.length-Ie,[4,e.prototype.set.call(this,t,n.slice(0,Ie))]):[3,2];case 1:return o.sent(),null===(r=this.loggerProvider)||void 0===r||r.error("Failed to save ".concat(i," events because the queue length exceeded ").concat(Ie,".")),[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}(xe),Oe=function(e){function t(){var t;return e.call(this,null===(t=(0,l.m)())||void 0===t?void 0:t.sessionStorage)||this}return(0,o.C6)(t,e),t}(xe);function _e(){return"undefined"!=typeof CompressionStream}function Re(e){return(0,o.sH)(this,void 0,void 0,function(){var t,n;return(0,o.YH)(this,function(r){switch(r.label){case 0:if(void 0===(t=CompressionStream))return[2,void 0];r.label=1;case 1:return r.trys.push([1,3,,4]),n=new Blob([e]).stream().pipeThrough(new t("gzip")),[4,new Response(n).arrayBuffer()];case 2:return[2,r.sent()];case 3:return r.sent(),[2,void 0];case 4:return[2]}})})}var He=n(67395),De=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.state={done:4},n.customHeaders=t,n}return(0,o.C6)(t,e),t.prototype.send=function(e,t,n){return void 0===n&&(n=!1),(0,o.sH)(this,void 0,void 0,function(){var r=this;return(0,o.YH)(this,function(i){return[2,new Promise(function(s,a){"undefined"==typeof XMLHttpRequest&&a(new Error("XHRTransport is not supported."));var u=new XMLHttpRequest;u.open("POST",e,!0),u.onreadystatechange=function(){if(u.readyState===r.state.done){var e=u.responseText;try{s(r.buildResponse(JSON.parse(e)))}catch(i){s(r.buildResponse({code:u.status}))}}};var c={"Content-Type":"application/json",Accept:"*/*"},l=JSON.stringify(t),d=n&&l.length>=2048&&_e(),f=function(e){var t,n;c=(0,o.Cl)((0,o.Cl)({},r.customHeaders),c);try{for(var i=(0,o.Ju)(Object.entries(c)),s=i.next();!s.done;s=i.next()){var a=(0,o.zs)(s.value,2),l=a[0],d=a[1];u.setRequestHeader(l,d)}}catch(f){t={error:f}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}u.send(e)};(0,o.sH)(r,void 0,void 0,function(){var e;return(0,o.YH)(this,function(t){switch(t.label){case 0:return d?[4,Re(l)]:[3,2];case 1:return(e=t.sent())?(c["Content-Encoding"]="gzip",f(e)):f(l),[3,3];case 2:f(l),t.label=3;case 3:return[2]}})}).catch(a)})]})})},t}(He.j),Le=function(e){function t(t,n,r){void 0===t&&(t={});var i=e.call(this)||this;return i.customHeaders=t,i.enableKeepalive=!1!==n,i.referrerPolicy=r,i}return(0,o.C6)(t,e),t.prototype.send=function(e,t,n){return void 0===n&&(n=!1),(0,o.sH)(this,void 0,void 0,function(){var r,i,s,a,u,c,l,d,f;return(0,o.YH)(this,function(v){switch(v.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return r=JSON.stringify(t),i=n&&r.length>=2048&&_e(),s=r,a={"Content-Type":"application/json",Accept:"*/*"},i?[4,Re(r)]:[3,2];case 1:(u=v.sent())&&(a["Content-Encoding"]="gzip",s=u),v.label=2;case 2:return a=(0,o.Cl)((0,o.Cl)({},this.customHeaders),a),c="string"==typeof s?s.length:s.byteLength,l={headers:a,body:s,method:"POST",keepalive:this.enableKeepalive&&c<=16384},this.referrerPolicy&&(l.referrerPolicy=this.referrerPolicy),[4,fetch(e,l)];case 3:return[4,(d=v.sent()).text()];case 4:f=v.sent();try{return[2,this.buildResponse(JSON.parse(f))]}catch(p){return[2,this.buildResponse({code:d.status})]}return[2]}})})},t}(He.j),Ne=function(e){function t(){return e.call(this)||this}return(0,o.C6)(t,e),t.prototype.send=function(e,t,n){return void 0===n&&(n=!1),(0,o.sH)(this,void 0,void 0,function(){var n=this;return(0,o.YH)(this,function(r){return[2,new Promise(function(r,i){var o=(0,l.m)();if(!(null==o?void 0:o.navigator.sendBeacon))throw new Error("SendBeaconTransport is not supported");try{var s=JSON.stringify(t);return r(o.navigator.sendBeacon(e,s)?n.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:s.length,server_upload_time:Date.now()}):n.buildResponse({code:500}))}catch(ii){i(ii)}})]})})},t}(He.j),Me=function(e,t,n){return void 0===n&&(n=!0),(0,o.sH)(void 0,void 0,void 0,function(){var r,i,s,a,u,c,l,d,f;return(0,o.YH)(this,function(v){switch(v.label){case 0:return r=function(e){return"".concat(R.r.toLowerCase(),"_").concat(e.substring(0,6))}(e),[4,t.getRaw(r)];case 1:return(i=v.sent())?n?[4,t.remove(r)]:[3,3]:[2,{optOut:!1}];case 2:v.sent(),v.label=3;case 3:return s=(0,o.zs)(i.split("."),6),a=s[0],u=s[1],c=s[2],l=s[3],d=s[4],f=s[5],[2,{deviceId:a,userId:Ue(u),sessionId:je(l),lastEventId:je(f),lastEventTime:je(d),optOut:Boolean(c)}]}})})},je=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},Ue=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(t){return}},Ye="[Amplitude]",qe=("".concat(Ye," Page Viewed"),"".concat(Ye," Form Started")),Fe="".concat(Ye," Form Submitted"),ze="".concat(Ye," File Downloaded"),Be="session_start",Je="session_end",Ve="".concat(Ye," File Extension"),We="".concat(Ye," File Name"),Xe="".concat(Ye," Link ID"),$e="".concat(Ye," Link Text"),Ke="".concat(Ye," Link URL"),Ge="".concat(Ye," Form ID"),Qe="".concat(Ye," Form Name"),Ze="".concat(Ye," Form Destination"),et="cookie",tt={always:"always",ifEmptyCampaign:"ifEmptyCampaign"},nt=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},rt=function(e,t,n,r,i,s){void 0===i&&(i=!0);e.referrer;var a,u,c=e.referring_domain,l=(0,o.Tt)(e,["referrer","referring_domain"]),d=t||{},f=(d.referrer,d.referring_domain),v=(0,o.Tt)(d,["referrer","referring_domain"]),p=n.excludeInternalReferrers;if(p){var h=ot(p,r);if(!(h instanceof TypeError)&&e.referring_domain&&ct(e.referring_domain,s)){if("always"===h)return st(h,e.referring_domain,r),!1;if("ifEmptyCampaign"===h&&(a=e,u=(0,o.Cl)((0,o.Cl)({},a),{referring_domain:void 0,referrer:void 0}),Object.values(u).every(function(e){return!e})))return st(h,e.referring_domain,r),!1}}if(it(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&&function(e){return Object.values(e).every(function(e){return!e})}(e)&&t)return r.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var g=JSON.stringify(l)!==JSON.stringify(v),m=nt(c||"")!==nt(f||""),y=!t||g||m;return y?r.debug("This is a new campaign. An $identify event will be sent."):r.debug("This is not a new campaign because it's the same as the previous one."),y},it=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})},ot=function(e,t){if(!0===e)return tt.always;if("object"==typeof e){var n=e.condition;if("string"==typeof n&&Object.keys(tt).includes(n))return n;if(void 0===n)return tt.always}var r="Invalid configuration provided for attribution.excludeInternalReferrers: ".concat(JSON.stringify(e));return t.error(r),new TypeError(r)};function st(e,t,n){var r="This is not a new campaign because referring_domain=".concat(t," is on the same domain as the current page and it is configured to exclude internal referrers");"always"===e?n.debug(r):"ifEmptyCampaign"===e&&n.debug("".concat(r," with empty campaign parameters"))}var at=["ac.in","ac.jp","ac.kr","ac.th","ac.uk","ac.za","appspot.com","asn.au","azurewebsites.net","cloudfront.net","myshopify.com","blogspot.com","co.ca","co.in","co.jp","co.kr","co.nz","co.th","co.uk","co.za","com.ar","com.au","com.br","com.cn","com.hk","com.in","com.jp","com.kr","com.mx","com.pl","com.sg","com.tr","com.tw","ed.jp","edu.au","edu.br","edu.cn","edu.hk","edu.sg","edu.th","edu.tr","edu.tw","firebaseapp.com","fly.dev","gc.ca","geek.nz","github.io","gitlab.io","go.jp","go.kr","go.th","gob.ar","gob.mx","gov.au","gov.br","gov.cn","gov.hk","gov.in","gov.pl","gov.sg","gov.tr","gov.tw","gov.uk","gov.za","govt.nz","gr.jp","herokuapp.com","id.au","idv.hk","iwi.nz","lg.jp","ltd.uk","maori.nz","me.uk","mil.kr","ne.jp","ne.kr","net.au","net.br","net.cn","net.hk","net.in","net.nz","net.pl","net.sg","net.tr","net.tw","net.za","onrender.com","or.jp","or.kr","or.th","org.ar","org.au","org.br","org.cn","org.hk","org.in","org.mx","org.nz","org.pl","org.sg","org.tw","org.uk","org.za","pages.dev","pe.kr","plc.uk","re.kr","res.in","sch.uk","vercel.app","netlify.app","workers.dev"],ut=function(e){var t,n,r=e||(null===(n=null===(t=(0,l.m)())||void 0===t?void 0:t.location)||void 0===n?void 0:n.hostname);if(!r)return"";var i=r.split("."),o=i[i.length-1],s=i[i.length-2];return at.find(function(e){return r.endsWith(".".concat(e))})&&(o=i[i.length-2]+"."+i[i.length-1],s=i[i.length-3]),s?"".concat(s,".").concat(o):o},ct=function(e,t){var n=(0,l.m)();if(!n)return!1;var r,i,o,s=(t||"").trim()||ut(n.location.hostname);return r=e,o=(i=s).startsWith(".")?i:".".concat(i),!!(r.startsWith(".")?r:".".concat(r)).endsWith(o)},lt=function(e){function t(t,n,r,i,o,s,c,l,d,f,v,p,h,g,m,y,b,w,E,S,k,T,C,A,x,I,P,O,_,R,H,D,L,N,M,j,U,Y,q,F,z,B,J,V){void 0===r&&(r=new Se),void 0===i&&(i={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),void 0===l&&(l=1e3),void 0===d&&(d=5),void 0===f&&(f=30),void 0===v&&(v=et),void 0===y&&(y=new a.V),void 0===b&&(b=u.$.Warn),void 0===E&&(E=!1),void 0===S&&(S=!1),void 0===C&&(C=""),void 0===A&&(A="US"),void 0===P&&(P=18e5),void 0===O&&(O=new Pe({loggerProvider:y})),void 0===_&&(_={ipAddress:!0,language:!0,platform:!0}),void 0===R&&(R="fetch"),void 0===H&&(H=!1),void 0===D&&(D=!0),void 0===Y&&(Y=!0),void 0===q&&(q=0),void 0===J&&(J=!1);var W,X=this;(X=e.call(this,{apiKey:t,storageProvider:O,transportProvider:vt(R)})||this).apiKey=t,X.appVersion=n,X.cookieOptions=i,X.defaultTracking=o,X.autocapture=s,X.flushIntervalMillis=l,X.flushMaxRetries=d,X.flushQueueSize=f,X.identityStorage=v,X.ingestionMetadata=p,X.instanceName=h,X.loggerProvider=y,X.logLevel=b,X.minIdLength=w,X.offline=E,X.partnerId=k,X.plan=T,X.serverUrl=C,X.serverZone=A,X.sessionTimeout=P,X.storageProvider=O,X.trackingOptions=_,X.transport=R,X.useBatch=H,X.fetchRemoteConfig=D,X.networkTrackingOptions=j,X.identify=U,X.enableDiagnostics=Y,X.diagnosticsSampleRate=q,X.diagnosticsClient=F,X.remoteConfig=z,X.topLevelDomain=B,X.enableRequestBodyCompression=J,X.customEnrichment=V,X.version=be,X._optOut=!1,X._cookieStorage=r,X.deviceId=c,X.lastEventId=g,X.lastEventTime=m,X.optOut=S,X.deferredSessionId=I,X.sessionId=x,X.pageCounter=N,X.userId=L,X.debugLogsEnabled=M,X.loggerProvider.enable(M?u.$.Debug:X.logLevel),X.networkTrackingOptions=j,X.identify=U,X.enableDiagnostics=Y,X.diagnosticsSampleRate=q,X.diagnosticsClient=F;var $=null!==(W=null==z?void 0:z.fetchRemoteConfig)&&void 0!==W?W:D;return X.remoteConfig=X.remoteConfig||{},X.remoteConfig.fetchRemoteConfig=$,X.fetchRemoteConfig=$,X.topLevelDomain=B||ut(),X}return(0,o.C6)(t,e),Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(e){this._cookieStorage!==e&&(this._cookieStorage=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(e){this._deviceId!==e&&(this._deviceId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(e){this._userId!==e&&(this._userId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(e){this._sessionId!==e&&(this._sessionId=e,void 0!==e&&void 0!==this._deferredSessionId&&(this._deferredSessionId=void 0),this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deferredSessionId",{get:function(){return this._deferredSessionId},set:function(e){this._deferredSessionId!==e&&e!==this.sessionId&&(this._deferredSessionId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut!==e&&(this._optOut=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(e){this._lastEventTime!==e&&(this._lastEventTime=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(e){this._lastEventId!==e&&(this._lastEventId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageCounter",{get:function(){return this._pageCounter},set:function(e){this._pageCounter!==e&&(this._pageCounter=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugLogsEnabled",{set:function(e){this._debugLogsEnabled!==e&&(this._debugLogsEnabled=e,this.updateStorage())},enumerable:!1,configurable:!0}),t.prototype.updateStorage=function(){var e={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,deferredSessionId:this._deferredSessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled,cookieDomain:void 0};this.cookieStorage instanceof ke&&(e.cookieDomain=this.cookieStorage.options.domain),this.cookieStorage.set(Ae(this.apiKey),e)},t}(D.TS),dt=function(e,t,n,r,i){return void 0===t&&(t={}),(0,o.sH)(void 0,void 0,void 0,function(){var s,a,u,c,l,d,f,v,p,h,g,m,y,b,w,E,S,k,T,C,A,I,P,O,_,R,H,D,N,M,j,U,Y,q,F,z,B,J,V,W,X,$,K,G,Q,Z,ee,te,ne,re,ie;return(0,o.YH)(this,function(oe){switch(oe.label){case 0:return s=t.identityStorage||et,a="",s!==et||(null===(I=t.cookieOptions)||void 0===I?void 0:I.domain)||""===(null===(P=t.cookieOptions)||void 0===P?void 0:P.domain)?[3,2]:[4,pt(void 0,r)];case 1:a=oe.sent(),oe.label=2;case 2:return u=(0,o.Cl)({domain:null!==(_=null===(O=t.cookieOptions)||void 0===O?void 0:O.domain)&&void 0!==_?_:a,expiration:365,sameSite:"Lax",secure:!1,upgrade:!0},t.cookieOptions),c={duplicateResolverFn:function(e){var t=Te(e);if(!t)return!1;var n=JSON.parse(t);return Ce(n.cookieDomain,u.domain)},diagnosticsClient:r},l=ft(t.identityStorage,u,c),[4,Me(e,l,null===(H=null===(R=t.cookieOptions)||void 0===R?void 0:R.upgrade)||void 0===H||H)];case 3:return d=oe.sent(),[4,l.get(Ae(e))];case 4:return f=oe.sent(),v=x(),p=v.ampTimestamp?Number(v.ampTimestamp):void 0,h=!p||Date.now()<p,g=null!==(U=null!==(j=null!==(M=null!==(D=t.deviceId)&&void 0!==D?D:h?null!==(N=v.ampDeviceId)&&void 0!==N?N:v.deviceId:void 0)&&void 0!==M?M:null==f?void 0:f.deviceId)&&void 0!==j?j:d.deviceId)&&void 0!==U?U:(0,L.k)(),m=null!==(Y=null==f?void 0:f.lastEventId)&&void 0!==Y?Y:d.lastEventId,y=null!==(q=null==f?void 0:f.lastEventTime)&&void 0!==q?q:d.lastEventTime,b=null!==(z=null!==(F=t.optOut)&&void 0!==F?F:null==f?void 0:f.optOut)&&void 0!==z?z:d.optOut,w=null!==(B=null==f?void 0:f.sessionId)&&void 0!==B?B:d.sessionId,E=null==f?void 0:f.deferredSessionId,S=null!==(V=null!==(J=t.userId)&&void 0!==J?J:null==f?void 0:f.userId)&&void 0!==V?V:d.userId,n.previousSessionDeviceId=null!==(W=null==f?void 0:f.deviceId)&&void 0!==W?W:d.deviceId,n.previousSessionUserId=null!==(X=null==f?void 0:f.userId)&&void 0!==X?X:d.userId,k={ipAddress:null===(K=null===($=t.trackingOptions)||void 0===$?void 0:$.ipAddress)||void 0===K||K,language:null===(Q=null===(G=t.trackingOptions)||void 0===G?void 0:G.language)||void 0===Q||Q,platform:null===(ee=null===(Z=t.trackingOptions)||void 0===Z?void 0:Z.platform)||void 0===ee||ee},T=null==f?void 0:f.pageCounter,C=null==f?void 0:f.debugLogsEnabled,void 0!==t.autocapture&&(t.defaultTracking=t.autocapture),[4,(A=new lt(e,t.appVersion,l,u,t.defaultTracking,t.autocapture,g,t.flushIntervalMillis,t.flushMaxRetries,t.flushQueueSize,s,t.ingestionMetadata,t.instanceName,m,y,null!==(te=null==i?void 0:i.loggerProvider)&&void 0!==te?te:t.loggerProvider,t.logLevel,t.minIdLength,t.offline,b,t.partnerId,t.plan,t.serverUrl,null!==(ne=null==i?void 0:i.serverZone)&&void 0!==ne?ne:t.serverZone,w,E,t.sessionTimeout,t.storageProvider,k,t.transport,t.useBatch,t.fetchRemoteConfig,S,T,C,t.networkTrackingOptions,t.identify,null!==(re=null==i?void 0:i.enableDiagnostics)&&void 0!==re?re:t.enableDiagnostics,null!==(ie=null==i?void 0:i.diagnosticsSampleRate)&&void 0!==ie?ie:n._diagnosticsSampleRate,r,t.remoteConfig,a,t.enableRequestBodyCompression,t.customEnrichment)).storageProvider.isEnabled()];case 5:return oe.sent()||(A.loggerProvider.warn("Storage provider ".concat(A.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),A.storageProvider=new Se),[2,A]}})})},ft=function(e,t,n){switch(void 0===e&&(e=et),void 0===t&&(t={}),e){case"localStorage":return new Pe;case"sessionStorage":return new Oe;case"none":return new Se;default:return new ke((0,o.Cl)((0,o.Cl)({},t),{expirationDays:t.expiration}),n)}},vt=function(e){var t="object"==typeof e?e.type:e,n="object"==typeof e?e.headers:void 0,r="object"==typeof e?e.enableKeepalive:void 0,i="object"==typeof e?e.referrerPolicy:void 0;return"xhr"===t?new De(n):"beacon"===t?new Ne:new Le(n,r,i)},pt=function(e,t){return(0,o.sH)(void 0,void 0,void 0,function(){var n,r,i,s,a,u,c;return(0,o.YH)(this,function(o){switch(o.label){case 0:return[4,new ke(void 0,{diagnosticsClient:t}).isEnabled()];case 1:if(!o.sent()||!e&&("undefined"==typeof location||!location.hostname))return[2,""];if(n=null!=e?e:location.hostname,1===(r=n.split(".")).length)return[2,""];for(i=[],s=1,at.find(function(e){return n.endsWith(".".concat(e))})&&(s=2),a=r.length-s-1;a>=0;--a)i.push(r.slice(a).join("."));a=0,o.label=2;case 2:if(!(a<i.length))return[3,7];u=i[a],o.label=3;case 3:return o.trys.push([3,5,,6]),[4,ke.isDomainWritable(u)];case 4:return o.sent()?[2,"."+u]:[3,6];case 5:return c=o.sent(),t&&t.recordEvent("cookies.tld.failure",{reason:"Unexpected exception checking domain is writable: ".concat(u),error:c instanceof Error?c.message:String(c)}),[3,6];case 6:return a++,[3,2];case 7:return t&&t.recordEvent("cookies.tld.failure",{reason:"Could not determine TLD for host ".concat(n)}),[2,""]}})})},ht="data-amp-mask",gt="*****",mt=/\b(?:\d[ -]*?){13,16}\b/,yt=/(\d{3}-?\d{2}-?\d{4})/g,bt=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,wt=function(e,t){var n,r;if(void 0===t&&(t=[]),"string"!=typeof e)return"";var i=e;i=(i=(i=i.replace(mt,gt)).replace(yt,gt)).replace(bt,gt);try{for(var s=(0,o.Ju)(t),a=s.next();!a.done;a=s.next()){var u=a.value;try{i=i.replace(u,gt)}catch(c){}}}catch(l){n={error:l}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return i},Et=function(e){if("undefined"==typeof document||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(ht)?gt:e?e(document.title):document.title},St=function(e){var t={};for(var n in e){var r=e[n];r&&(t[n]=r)}return t},kt=function(){function e(){}return e.prototype.parse=function(){return(0,o.sH)(this,void 0,void 0,function(){return(0,o.YH)(this,function(e){return[2,(0,o.Cl)((0,o.Cl)((0,o.Cl)((0,o.Cl)({},R.F3),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var e=x();return{utm_campaign:e[R._9],utm_content:e[R.fL],utm_id:e[R.Cs],utm_medium:e[R.Jn],utm_source:e[R.VU],utm_term:e[R.Wx]}},e.prototype.getReferrer=function(){var e,t,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=null!==(t=null===(e=n.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(r){}return n},e.prototype.getClickIds=function(){var e,t=x();return(e={})[R.h2]=t[R.h2],e[R.lT]=t[R.lT],e[R.wX]=t[R.wX],e[R.q2]=t[R.q2],e[R.KY]=t[R.KY],e[R.Ct]=t[R.Ct],e[R.qr]=t[R.qr],e[R.wu]=t[R.wu],e[R.tt]=t[R.tt],e[R.Gp]=t[R.Gp],e[R.SO]=t[R.SO],e},e}(),Tt="AMP_PAGE_VIEW",Ct=function(e){var t;void 0===e&&(e={});var n,r,i=(0,l.m)(),s=void 0,a=!1,u=e.trackOn,c=e.trackHistoryChanges,d=e.eventType,f=void 0===d?"[Amplitude] Page Viewed":d,v=function(e){var t=e;try{t=decodeURI(e)}catch(ii){null==s||s.error("Malformed URI sequence: ",ii)}return t},p=function(e){return(0,o.sH)(void 0,void 0,void 0,function(){var t,n,r;return(0,o.YH)(this,function(i){switch(i.label){case 0:return t=v("undefined"!=typeof location&&location.href||""),r={event_type:f},n=[{}],[4,At()];case 1:return[2,(r.event_properties=o.Cl.apply(void 0,[o.Cl.apply(void 0,n.concat([i.sent()])),{"[Amplitude] Page Domain":"undefined"!=typeof location&&location.hostname||"","[Amplitude] Page Location":t,"[Amplitude] Page Path":"undefined"!=typeof location&&v(location.pathname)||"","[Amplitude] Page Title":Et(wt),"[Amplitude] Page URL":t.split("?")[0],"[Amplitude] Page View ID":e}]),r)]}})})},h=function(){return void 0===u||"function"==typeof u&&u()},g="undefined"!=typeof location?location.href:null,m=function(){(0,o.sH)(void 0,void 0,void 0,function(){var e,n,i,a,u;return(0,o.YH)(this,function(o){switch(o.label){case 0:return e=location.href,n=It(c,e,g||"")&&h(),g=e,n?(i=void 0,r&&(i=(0,L.k)(),r.set(Tt,{pageViewId:i})),null==s||s.log("Tracking page view event"),null!=t?[3,1]:[3,3]):[3,4];case 1:return u=(a=t).track,[4,p(i)];case 2:u.apply(a,[o.sent()]),o.label=3;case 3:o.label=4;case 4:return[2]}})})},y={name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,u){return(0,o.sH)(void 0,void 0,void 0,function(){var c,l,d;return(0,o.YH)(this,function(f){switch(f.label){case 0:if(t=u,n=e,(s=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),a=!0,i){try{r=new xe(i.sessionStorage)}catch(v){null==s||s.debug("sessionStorage is not available in this environment.")}i.addEventListener("popstate",m),i.history.pushState=new Proxy(i.history.pushState,{apply:function(e,t,n){var r=(0,o.zs)(n,3),i=r[0],s=r[1],u=r[2];e.apply(t,[i,s,u]),a&&m()}})}return h()?(s.log("Tracking page view event"),c=void 0,r&&(c=(0,L.k)(),r.set(Tt,{pageViewId:c})),d=(l=t).track,[4,p(c)]):[3,2];case 1:d.apply(l,[f.sent()]),f.label=2;case 2:return[2]}})})},execute:function(e){return(0,o.sH)(void 0,void 0,void 0,function(){var t,i,a;return(0,o.YH)(this,function(c){switch(c.label){case 0:return"attribution"===u&&xt(e)?(null==s||s.log("Enriching campaign event to page view event with campaign parameters"),t=void 0,r?[4,r.get(Tt)]:[3,2]):[3,4];case 1:i=c.sent(),t=null==i?void 0:i.pageViewId,c.label=2;case 2:return[4,p(t)];case 3:a=c.sent(),e.event_type=a.event_type,e.event_properties=(0,o.Cl)((0,o.Cl)({},e.event_properties),a.event_properties),c.label=4;case 4:return n&&e.event_type===f&&(n.pageCounter=n.pageCounter?n.pageCounter+1:1,e.event_properties=(0,o.Cl)((0,o.Cl)({},e.event_properties),{"[Amplitude] Page Counter":n.pageCounter})),[2,e]}})})},teardown:function(){return(0,o.sH)(void 0,void 0,void 0,function(){return(0,o.YH)(this,function(e){return i&&(i.removeEventListener("popstate",m),a=!1),[2]})})}};return y},At=function(){return(0,o.sH)(void 0,void 0,void 0,function(){var e;return(0,o.YH)(this,function(t){switch(t.label){case 0:return e=St,[4,(new kt).parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}})})},xt=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,n=t[W.e.SET]||{},r=t[W.e.UNSET]||{},i=(0,o.fX)((0,o.fX)([],(0,o.zs)(Object.keys(n)),!1),(0,o.zs)(Object.keys(r)),!1);return Object.keys(R.F3).every(function(e){return i.includes(e)})}return!1},It=function(e,t,n){if("pathOnly"===e){if(""==n)return!0;var r=new URL(t),i=new URL(n);return r.origin+r.pathname!==i.origin+i.pathname}return t!==n},Pt=function(){var e,t,n=[],r=function(e,t,r){e.addEventListener(t,r),n.push({element:e,type:t,handler:r})};return{name:"@amplitude/plugin-form-interaction-tracking-browser",type:"enrichment",setup:function(n,i){return(0,o.sH)(void 0,void 0,void 0,function(){var s,a;return(0,o.YH)(this,function(o){return t=function(e){if(ie(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&"object"==typeof e.defaultTracking.formInteractions)return e.defaultTracking.formInteractions}(n),s=function(){if(i){if("undefined"!=typeof document){var o=new WeakSet,s=function(e){if(!o.has(e)){o.add(e);var s=!1;r(e,"change",function(){var t,n=_t(e);s||i.track(qe,((t={})[Ge]=Ot(e.id),t[Qe]=Ot(e.name),t[Ze]=n,t)),s=!0}),r(e,"submit",function(r){var o,a,u=_t(e);if(s||i.track(qe,((o={})[Ge]=Ot(e.id),o[Qe]=Ot(e.name),o[Ze]=u,o)),s=!0,void 0!==(null==t?void 0:t.shouldTrackSubmit))if("function"==typeof t.shouldTrackSubmit&&"undefined"!=typeof SubmitEvent&&r instanceof SubmitEvent)try{if(!t.shouldTrackSubmit(r))return}catch(ii){n.loggerProvider.warn("shouldTrackSubmit callback threw an error, proceeding with tracking.")}else n.loggerProvider.warn("shouldTrackSubmit is ignored because it is not a function or event is not a SubmitEvent.");i.track(Fe,((a={})[Ge]=Ot(e.id),a[Qe]=Ot(e.name),a[Ze]=u,a)),s=!1})}};Array.from(document.getElementsByTagName("form")).forEach(s),"undefined"!=typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){"FORM"===e.nodeName&&s(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("form")).map(s)})})})).observe(document.body,{subtree:!0,childList:!0})}}else n.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.")},"complete"===document.readyState?s():(a=(0,l.m)())?a.addEventListener("load",s):n.loggerProvider.debug("Form interaction tracking is not installed because global is undefined."),[2]})})},execute:function(e){return(0,o.sH)(void 0,void 0,void 0,function(){return(0,o.YH)(this,function(t){return[2,e]})})},teardown:function(){return(0,o.sH)(void 0,void 0,void 0,function(){return(0,o.YH)(this,function(t){return null==e||e.disconnect(),n.forEac
1h(function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)}),n=[],[2]})})}}},Ot=function(e){if("string"==typeof e)return e},_t=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(null!=t?t:""),window.location.href).href}catch(n){}return t},Rt=function(){var e,t=[];return{name:"@amplitude/plugin-file-download-tracking-browser",type:"enrichment",setup:function(n,r){return(0,o.sH)(void 0,void 0,void 0,function(){var i,s;return(0,o.YH)(this,function(o){return i=function(){if(r){if("undefined"!=typeof document){var i=function(e){var n;try{n=new URL(e.href,window.location.href)}catch(o){return}var i=s.exec(n.href),a=null==i?void 0:i[1];a&&function(e,n,r){e.addEventListener(n,r),t.push({element:e,type:n,handler:r})}(e,"click",function(){var t;a&&r.track(ze,((t={})[Ve]=a,t[We]=n.pathname,t[Xe]=e.id,t[$e]=e.text,t[Ke]=e.href,t))})},s=/\.(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),"undefined"!=typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){"A"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("a")).map(i)})})})).observe(document.body,{subtree:!0,childList:!0})}}else n.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.")},"complete"===document.readyState?i():(s=(0,l.m)())?s.addEventListener("load",i):n.loggerProvider.debug("File download tracking is not installed because global is undefined."),[2]})})},execute:function(e){return(0,o.sH)(void 0,void 0,void 0,function(){return(0,o.YH)(this,function(t){return[2,e]})})},teardown:function(){return(0,o.sH)(void 0,void 0,void 0,function(){return(0,o.YH)(this,function(n){return null==e||e.disconnect(),t.forEach(function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)}),t=[],[2]})})}}},Ht=!1,Dt=function(){var e=(0,l.m)(),t=[],n=function(n,r){(null==e?void 0:e.addEventListener)&&(null==e||e.addEventListener(n,r),t.push({type:n,handler:r}))};return{name:"@amplitude/plugin-network-checker-browser",type:"before",setup:function(e,t){return(0,o.sH)(void 0,void 0,void 0,function(){return(0,o.YH)(this,function(r){return"undefined"==typeof navigator?(e.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),e.offline=!1,[2]):(e.offline=!navigator.onLine,n("online",function(){!1!==e.offline&&(e.loggerProvider.debug("Network connectivity changed to online."),e.offline=!1,setTimeout(function(){t.flush()},e.flushIntervalMillis))}),n("offline",function(){e.loggerProvider.debug("Network connectivity changed to offline."),e.offline=!0}),[2])})})},teardown:function(){return(0,o.sH)(void 0,void 0,void 0,function(){return(0,o.YH)(this,function(n){return t.forEach(function(t){var n=t.type,r=t.handler;null==e||e.removeEventListener(n,r)}),t=[],[2]})})}}};function Lt(e,t,n){var r,i,s=[];try{for(var a=(0,o.Ju)(null!=t?t:[]),u=a.next();!u.done;u=a.next()){var c=u.value;try{s.push(new RegExp(c))}catch(l){n.warn("Invalid regex pattern: ".concat(c),l)}}}catch(d){r={error:d}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return e.concat(s)}function Nt(e){var t,n,r,i,s,a,u,c,l,d,f,v;if("object"==typeof e&&null!==e&&!Array.isArray(e)){var p=Object.keys(e);try{for(var h=(0,o.Ju)(p),g=h.next();!g.done;g=h.next()){var m=g.value;try{var y=e[m];"boolean"==typeof(null==y?void 0:y.enabled)&&(y.enabled?(delete y.enabled,0===Object.keys(y).length&&(e[m]=!0)):e[m]=!1),Nt(y)}catch(ii){}}}catch(_){t={error:_}}finally{try{g&&!g.done&&(n=h.return)&&n.call(h)}finally{if(t)throw t.error}}try{if(null===(l=null===(c=null===(u=e.autocapture)||void 0===u?void 0:u.networkTracking)||void 0===c?void 0:c.captureRules)||void 0===l?void 0:l.length)try{for(var b=(0,o.Ju)(e.autocapture.networkTracking.captureRules),w=b.next();!w.done;w=b.next()){var E=w.value;try{for(var S=(s=void 0,(0,o.Ju)(["responseHeaders","requestHeaders"])),k=S.next();!k.done;k=S.next()){var T=k.value,C=null!==(d=E[T])&&void 0!==d?d:{},A=C.captureSafeHeaders,x=C.allowlist;(A||x)&&(void 0===x||Array.isArray(x)?E[T]=(0,o.fX)((0,o.fX)([],(0,o.zs)(A?R.j7:[]),!1),(0,o.zs)(null!=x?x:[]),!1):delete E[T])}}catch(H){s={error:H}}finally{try{k&&!k.done&&(a=S.return)&&a.call(S)}finally{if(s)throw s.error}}}}catch(D){r={error:D}}finally{try{w&&!w.done&&(i=b.return)&&i.call(b)}finally{if(r)throw r.error}}}catch(ii){}var I=null===(f=e.autocapture)||void 0===f?void 0:f.frustrationInteractions;I&&(I.rageClick&&(I.rageClicks=I.rageClick,delete I.rageClick),I.deadClick&&(I.deadClicks=I.deadClick,delete I.deadClick));try{var P=null===(v=e.autocapture)||void 0===v?void 0:v.elementInteractions;if(P&&"object"==typeof P&&(!0===P.viewportContentUpdated&&(P.viewportContentUpdated={}),!1===P.viewportContentUpdated&&(P.viewportContentUpdated={enabled:!1}),void 0!==P.exposureDuration)){var O=P.viewportContentUpdated;void 0===O?P.viewportContentUpdated={exposureDuration:P.exposureDuration}:"object"==typeof O&&void 0===O.exposureDuration&&!1!==O.enabled&&(O.exposureDuration=P.exposureDuration),delete P.exposureDuration}}catch(ii){}}}function Mt(e,t){var n,r;if(e){Nt(e);try{t.loggerProvider.debug("Update browser config with remote configuration:",Q(e));var i=e;if(i&&"autocapture"in i){if("boolean"==typeof i.autocapture&&(t.autocapture=i.autocapture),"object"==typeof i.autocapture&&null!==i.autocapture){var s=(0,o.Cl)({},i.autocapture);if(void 0===t.autocapture&&(t.autocapture=i.autocapture),"object"==typeof i.autocapture.elementInteractions&&null!==i.autocapture.elementInteractions&&(null===(n=i.autocapture.elementInteractions.pageUrlAllowlistRegex)||void 0===n?void 0:n.length)){s.elementInteractions=(0,o.Cl)({},i.autocapture.elementInteractions);var a=s.elementInteractions,u=null!==(r=a.pageUrlAllowlist)&&void 0!==r?r:[],c=i.autocapture.elementInteractions.pageUrlAllowlistRegex;a.pageUrlAllowlist=Lt(u,c,t.loggerProvider),delete a.pageUrlAllowlistRegex}var l=function(e,t){var n,r,i,s,a;
1if("object"==typeof e&&null!==e&&(null===(i=e.captureRules)||void 0===i?void 0:i.length)){var u=(0,o.Cl)({},e),c=null!==(s=u.captureRules)&&void 0!==s?s:[];try{for(var l=(0,o.Ju)(c),d=l.next();!d.done;d=l.next()){var f=d.value;f.urls=Lt(null!==(a=f.urls)&&void 0!==a?a:[],f.urlsRegex,t),delete f.urlsRegex}}catch(v){n={error:v}}finally{try{d&&!d.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return u}}(i.autocapture.networkTracking,t.loggerProvider);l&&(s.networkTracking=l),"boolean"==typeof t.autocapture&&(t.autocapture=(0,o.Cl)({attribution:t.autocapture,fileDownloads:t.autocapture,formInteractions:t.autocapture,pageViews:t.autocapture,sessions:t.autocapture,elementInteractions:t.autocapture,webVitals:t.autocapture,frustrationInteractions:t.autocapture},s)),"object"==typeof t.autocapture&&(t.autocapture=(0,o.Cl)((0,o.Cl)({},t.autocapture),s))}t.defaultTracking=t.autocapture}"customEnrichment"in i&&null!==i.customEnrichment&&!1!==t.customEnrichment&&(t.customEnrichment=i.customEnrichment),t.loggerProvider.debug("Browser config after remote config update:",Q(t))}catch(ii){t.loggerProvider.error("Failed to apply remote configuration because of error: ",ii)}}}var jt=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],Ut="data-amp-track-",Yt=["div","span","h1","h2","h3","h4","h5","h6"],qt=n(16064),Ft=n.n(qt);function zt(e,t){return new(Ft())(function(n){e.subscribe({next:function(e){t(e).then(function(e){return n.next(e)}).catch(function(e){return n.error(e)})},error:function(e){n.error(e)},complete:function(){n.complete()}})})}function Bt(e,t){return new(Ft())(function(n){var r=!1,i=new Set,s=function(){var e,t;r=!0;try{for(var n=(0,o.Ju)(i),s=n.next();!s.done;s=n.next()){var a=s.value;try{a.unsubscribe()}catch(u){}}}catch(c){e={error:c}}finally{try{s&&!s.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}i.clear()},a=function(e){var t=e.subscribe({next:function(e){r||n.next(e)},error:function(e){r||(r=!0,n.error(e),s())},complete:function(){i.delete(t),r||0!==i.size||(n.complete(),s(),r=!0)}});i.add(t)};return a(e),a(t),s})}function Jt(e){var t=new Set,n=null;function r(){null==n||n.unsubscribe(),n=null,t.clear()}return new(Ft())(function(i){return t.add(i),null===n&&(n=e.subscribe({next:function(e){var n,r,i;try{for(var s=(0,o.Ju)(t),a=s.next();!a.done;a=s.next()){var u=a.value;null===(i=u.next)||void 0===i||i.call(u,e)}}catch(c){n={error:c}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}},error:function(e){var n,i,s;try{for(var a=(0,o.Ju)(t),u=a.next();!u.done;u=a.next()){var c=u.value;null===(s=c.error)||void 0===s||s.call(c,e)}}catch(l){n={error:l}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}r()},complete:function(){var e,n,i;try{for(var s=(0,o.Ju)(t),a=s.next();!a.done;a=s.next()){var u=a.value;null===(i=u.complete)||void 0===i||i.call(u)}}catch(c){e={error:c}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}r()}})),function(){t.delete(i),0===t.size&&n&&(n.unsubscribe(),n=null)}})}var Vt=n(92056),Wt=n(39258),Xt="1.28.10",$t="[Amplitude] Element Clicked",Kt="[Amplitude] Element Tag",Gt="[Amplitude] Element Text",Qt="[Amplitude] Page URL",Zt="[Amplitude] Viewport Height",en="[Amplitude] Viewport Width",tn="[Amplitude] Page View ID",nn="data-amp-mask-attributes",rn=n(92872),on=function(e,t){return!t||!t.length||t.some(function(t){return"string"==typeof t?e===t:e.match(t)})},sn=function(e,t){var n=e;try{n=decodeURI(e)}catch(ii){null==t||t.error("Malformed URI sequence: ",ii)}return n},an=["input","select","textarea"],un=function(e){var t=e.pageUrlAllowlist,n=e.pageUrlExcludelist;return!(n&&n.length>0&&on(window.location.href,n))&&!!on(window.location.href,t)},cn=function(e,t){return function(n,r){var i,o,s=e.shouldTrackEventResolver,a=null===(o=null===(i=null==r?void 0:r.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===o?void 0:o.call(i);if(!a)return!1;if(s)return s(n,r);if(!un(e))return!1;var u=String(null==r?void 0:r.getAttribute("type"))||"";if("string"==typeof u)switch(u.toLowerCase()){case"hidden":case"password":return!1}if(t){var c=t.some(function(e){var t;return!!(null===(t=null==r?void 0:r.matches)||void 0===t?void 0:t.call(r,e))});if(!c)return!1}switch(a){case"input":case"select":case"textarea":return"change"===n||"click"===n;default:return"click"===n}}},ln=function(e){return e?e.split(",").map(function(e){return e.trim()}).filter(function(e){return e.length>0&&"id"!==e&&"class"!==e}):[]},dn=function(e){return Object.keys(e).reduce(function(t,n){var r=e[n];return function(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length}(r)||(t[n]=r),t},{})},fn=function(){var e;try{var t=(0,l.m)(),n=null===(e=null==t?void 0:t.sessionStorage)||void 0===e?void 0:e.getItem("AMP_PAGE_VIEW");if(!n)return;var r=JSON.parse(n);if("string"==typeof r.pageViewId)return r.pageViewId}catch(i){}},vn=function(e,t){return e?t.some(function(t){var n;return null===(n=null==e?void 0:e.matches)||void 0===n?void 0:n.call(e,t)})?e:vn(null==e?void 0:e.parentElement,t):null};var pn,hn=function(e){return!(null===e.event.target||!e.closestTrackedAncestor)};!function(e){e[e.LEFT_OR_TOUCH_CONTACT=0]="LEFT_OR_TOUCH_CONTACT",e[e.MIDDLE=1]="MIDDLE",e[e.RIGHT=2]="RIGHT"}(pn||(pn={}));var gn="__AMPLITUDE_VISUAL_TAGGING__";var mn=(0,l.m)(),yn=null==mn?void 0:mn.console,bn={},wn={},En=!1;var Sn={addListener:function(e,t){var n,r=(n=e,!!yn&&"function"==typeof yn[n]&&(wn[n]||(wn[n]=yn[n],yn[n]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{if(bn[n]&&!En){En=!0;var r=bn[n];r&&r.forEach(function(t){try{t(n,e)}catch(r){}})}}catch(i){}return En=!1,wn[n].apply(yn,e)}),!0));if(!r)return new Error("Console override failed");bn[e]?bn[e].push(t):bn[e]=[t]},removeListener:function(e){var t,n;
1try{for(var r=(0,o.Ju)(Object.values(bn)),i=r.next();!i.done;i=r.next())for(var s=i.value,a=s.length-1;a>=0;a--)if(s[a]===e){s.splice(a,1);break}}catch(u){t={error:u}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},_restoreConsole:function(){var e,t;try{for(var n=(0,o.Ju)(Object.entries(wn)),r=n.next();!r.done;r=n.next()){var i=(0,o.zs)(r.value,2),s=i[0],a=i[1];a&&(yn[s]=a)}}catch(u){e={error:u}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}wn={},bn={}}},kn=(0,l.m)(),Tn=function(){return new(Ft())(function(e){var t=new MutationObserver(function(t){e.next(t)});return document.body&&t.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return t.disconnect()}})},Cn=function(e){return void 0===e&&(e="click"),new(Ft())(function(t){var n,r=function(e){t.next(e)};return null===(n=(0,l.m)())||void 0===n||n.document.addEventListener(e,r,{capture:!0}),function(){var t;null===(t=(0,l.m)())||void 0===t||t.document.removeEventListener(e,r,{capture:!0})}})},An=function(){var e=Bt(new(Ft())(function(e){var t=function(t){if(t instanceof ErrorEvent){var n={kind:"error"};t.error instanceof Error||t.error instanceof DOMException?n=(0,o.Cl)((0,o.Cl)({},n),{message:t.error.message,stack:t.error.stack,filename:t.filename,lineNumber:t.lineno,columnNumber:t.colno}):"string"==typeof t.error&&(n.message=t.error),e.next(n)}};return kn.addEventListener("error",t),function(){kn.removeEventListener("error",t)}}),new(Ft())(function(e){var t=function(t){var n={kind:"unhandledrejection"};t.reason instanceof Error||t.reason instanceof DOMException?(n.message=t.reason.message,n.stack=t.reason.stack):"string"==typeof t.reason&&(n.message=t.reason),e.next(n)};return kn.addEventListener("unhandledrejection",t),function(){kn.removeEventListener("unhandledrejection",t)}}));return Bt(e,new(Ft())(function(e){var t=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=void 0;Array.isArray(n[0])&&"string"==typeof n[0][0]&&(i=n[0][0]),e.next({kind:"console",message:i})};return Sn.addListener("error",t),function(){Sn.removeListener(t)}}))},xn=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}})},In={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},Pn=function(e){var t,n,r,i,s=Object.values(In).reduce(function(e,t){return e[t]=new Set,e},{});if(!e)return s;try{for(var a=(0,o.Ju)(e),u=a.next();!u.done;u=a.next()){var c=u.value;try{try{for(var l=(r=void 0,(0,o.Ju)(c.definition)),d=l.next();!d.done;d=l.next()){var f=d.value,v=In[f.event_type];v&&s[v].add(c.id)}}catch(p){r={error:p}}finally{try{d&&!d.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}}catch(ii){console.warn("Skipping Labeled Event due to malformed definition",null==c?void 0:c.id,ii)}}}catch(h){t={error:h}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return s},On=function(e){var t,n,r,i,s=new Map;try{for(var a=(0,o.Ju)(e),u=a.next();!u.done;u=a.next()){var c=u.value;try{for(var l=(r=void 0,(0,o.Ju)(c.conditions)),d=l.next();!d.done;d=l.next()){var f=d.value;if("LABELED_EVENT"===f.type){var v=f.match.eventId,p=s.get(v);p||(p=[],s.set(v,p)),p.push(c)}}}catch(h){r={error:h}}finally{try{d&&!d.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}}}catch(g){t={error:g}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return s},_n=function(e,t){return t.filter(function(t){return t.definition.some(function(t){return In[t.event_type]===e.type&&t.filters.every(function(t){return function(e,t){try{if("[Amplitude] Element Text"===t.subprop_key)return"is"===t.subprop_op&&t.subprop_value.includes(e.targetElementProperties["[Amplitude] Element Text"]);if("[Amplitude] Element Hierarchy"===t.subprop_key)return"autotrack css match"===t.subprop_op&&!!e.closestTrackedAncestor.closest(t.subprop_value.toString())}catch(n){return console.error("Error matching event to filter",n),!1}return!1}(e,t)})})})},Rn=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=function(e,t){var n,r,i,s,a=new Set;try{for(var u=(0,o.Ju)(e),c=u.next();!c.done;c=u.next()){var l=c.value,d=t.get(l.id);if(d)try{for(var f=(i=void 0,(0,o.Ju)(d)),v=f.next();!v.done;v=f.next()){var p=v.value;a.add(p)}}catch(h){i={error:h}}finally{try{v&&!v.done&&(s=f.return)&&s.call(f)}finally{if(i)throw i.error}}}}catch(g){n={error:g}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}return Array.from(a)}(_n(e,Array.from(this.groupedLabeledEvents[e.type]).map(function(e){return r.labeledEvents[e]})),this.labeledEventToTriggerMap);try{for(var s=(0,o.Ju)(i),a=s.next();!a.done;a=s.next()){var u=a.value;xn(u.actions,e,this.dataExtractor)}}catch(c){t={error:c}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}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}(),Hn=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",nn,ht]),Dn=["type"],Ln=["svg","path","g"],Nn=["password","hidden"];function Mn(e,t){var n,r,i,s,a,u;if(null===e)return null;var c=String(e.tagName).toLowerCase(),l={tag:c},d=Array.from(null!==(s=null===(i=e.parentElement)||void 0===i?void 0:i.children)&&void 0!==s?s:[]);d.length&&(l.index=d.indexOf(e),l.indexOfType=d.filter(function(t){return t.tagName===e.tagName}).indexOf(e));var f=null===(u=null===(a=e.previousElementSibling)||void 0===a?void 0:a.tagName)||void 0===u?void 0:u.toLowerCase();f&&(l.prevSib=String(f));var v=e.getAttribute("id");v&&(l.id=String(v));var p=Array.from(e.classList);p.length&&(l.classes=p);var h={},g=Array.from(e.attributes).filter(function(e){return!Hn.has(e.name)}),m=!function(e){var t,n,r,i=null===(n=null===(t=null==e?void 0:e.tagName)||void 0===t?void 0:t.toLowerCase)||void 0===n?void 0:n.call(t),o=e instanceof HTMLElement&&"true"===(null===(r=e.getAttribute("contenteditable"))||void 0===r?void 0:r.toLowerCase());return!an.includes(i)&&!o}(e);if(!Nn.includes(String(e.getAttribute("type")))&&!Ln.includes(c))try{for(var y=(0,o.Ju)(g),b=y.next();!b.done;b=y.next()){var w=b.value;m&&!Dn.includes(w.name)||(t.has(w.name)?h[w.name]=gt:h[w.name]=String(w.value).substring(0,128))}}catch(E){n={error:E}}finally{try{b&&!b.done&&(r=y.return)&&r.call(y)}finally{if(n)throw n.error}}return Object.keys(h).length&&(l.attrs=h),l}function jn(e,t){var n=e.getAttribute(t.explicitTrackingAttribute);if(null!==n&&""===n)return null;var r=e.getAttribute("id");return null===r||""===r?null:function(e,t){var n,r;if(null==e||""===e)return!1;try{for(var i=(0,o.Ju)(t),s=i.next();!s.done;s=i.next())if(s.value.test(e))return!1}catch(a){n={error:a}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!0}(r,t.autogeneratedIdPatterns)?r:null}function Un(e){var t=globalThis.CSS;if(t&&"function"==typeof t.escape)return t.escape(e);for(var n=String(e),r=n.length,i="",o=0;o<r;o++){var s=n.charCodeAt(o);0!==s?s>
1=1&&s<=31||127===s||0===o&&s>=48&&s<=57||1===o&&s>=48&&s<=57&&45===n.charCodeAt(0)?i+="\\".concat(s.toString(16)," "):i+=0!==o||1!==r||45!==s?s>=128||45===s||95===s||s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122?n.charAt(o):"\\".concat(n.charAt(o)):"\\-":i+="�"}return i}function Yn(e){return Un(e)}function qn(e,t){return t.map(Fn).join(" > ")}function Fn(e){var t=e.tagName.toLowerCase(),n=e.parentElement;if(null===n)return t;var r=function(e,t){for(var n=0,r=0;r<t.children.length;r++){var i=t.children[r];if(i.tagName===e.tagName&&(n+=1,i===e))return n}return 1}(e,n);return"".concat(t,":nth-of-type(").concat(r,")")}var zn=[{name:"explicitTrackingAttribute",try:function(e,t){var n=t.config.explicitTrackingAttribute,r=e.getAttribute(n);return null===r||""===r?null:"[".concat(n,"=").concat(JSON.stringify(r),"]")}},{name:"stableId",try:function(e,t){var n=jn(e,t.config);return null===n?null:"".concat(e.tagName.toLowerCase(),"#").concat(Yn(n))}}];function Bn(e,t,n){var r,i,s,a,u;void 0===n&&(n={});var c=null!==(s=n.strategies)&&void 0!==s?s:zn,l=null!==(u=null!==(a=n.scope)&&void 0!==a?a:e.ownerDocument)&&void 0!==u?u:document,d={scope:l,config:t},f=function(e,t){var n=[],r=e;for(;null!==r&&(n.push(r),!(void 0!==t&&n.length>t));)r=r.parentElement;return n}(e,t.maxAncestorWalkDepth);try{for(var v=(0,o.Ju)(c),p=v.next();!p.done;p=v.next())for(var h=p.value,g=0;g<f.length;g++){var m=f[g],y=h.try(m,d);if(null!==y)if(0!==g){var b=qn(0,f.slice(0,g).reverse()),w="".concat(y," > ").concat(b);if(Jn(l,w,e,h.name,n.logger))return w}else if(Jn(l,y,e,h.name,n.logger))return y}}catch(E){r={error:E}}finally{try{p&&!p.done&&(i=v.return)&&i.call(v)}finally{if(r)throw r.error}}return null}function Jn(e,t,n,r,i){var o;try{o=e.querySelectorAll(t)}catch(ii){var s=ii instanceof Error?ii.message:String(ii);return null==i||i.debug('@amplitude/element-selector: strategy "'.concat(r,'" emitted a malformed selector "').concat(t,'" (').concat(s,")")),!1}return 1===o.length&&o[0]===n}function Vn(e){var t=e.tagName.toLowerCase(),n=e.parentElement;if(null===n)return t;var r=function(e,t){for(var n=0,r=0;r<t.children.length;r++){var i=t.children[r];if(i.tagName===e.tagName&&(n+=1,i===e))return n}return 1}(e,n);return"".concat(t,":nth-of-type(").concat(r,")")}function Wn(e,t,n){var r;try{r=e.querySelectorAll(t)}catch(i){return!1}return 1===r.length&&r[0]===n}var Xn=function(){function e(e,t){this.value=e,this.optimized=t}return e.prototype.toString=function(){return this.value},e}(),$n=function(e,t,n){var r,i;if(e.nodeType!==Node.ELEMENT_NODE)return null;var s=e.getAttribute("id");if(t){if(s)return new Xn(Gn(s),!0);var a=e.tagName.toLowerCase();if("body"===a||"head"===a||"html"===a)return new Xn(a,!0)}var u=e.tagName.toLowerCase();if(s)return new Xn(u+Gn(s),!0);var c=e.parentNode;if(!c||c.nodeType===Node.DOCUMENT_NODE)return new Xn(u,!0);for(var l=Kn(e),d=!1,f=!1,v=-1,p=-1,h=c.children,g=0;h&&(-1===v||!f)&&g<h.length;++g){var m=h[g];if(m.nodeType===Node.ELEMENT_NODE)if(p+=1,m!==e){if(!f&&m.tagName.toLowerCase()===u){d=!0;var y=new Set(l);if(y.size)for(var b=Kn(m),w=0;w<b.length;++w){var E=b[w];if(y.has(E)&&(y.delete(E),!y.size)){f=!0;break}}else f=!0}}else v=p}var S=u;if(n&&"input"===u.toLowerCase()&&e.getAttribute("type")&&!e.getAttribute("id")&&!e.getAttribute("class")&&(S+="[type="+Un(e.getAttribute("type")||"")+"]"),f)S+=":nth-child("+String(v+1)+")";else if(d)try{for(var k=(0,o.Ju)(l),T=k.next();!T.done;T=k.next()){S+="."+Un(T.value.slice(1))}}catch(C){r={error:C}}finally{try{T&&!T.done&&(i=k.return)&&i.call(k)}finally{if(r)throw r.error}}return new Xn(S,!1)},Kn=function(e){var t=e.getAttribute("class");return t?t.split(/\s+/g).filter(Boolean).map(function(e){return"$"+e}):[]},Gn=function(e){return"#"+Un(e)};function Qn(e,t){try{return function(e,t){if(e.nodeType!==Node.ELEMENT_NODE)return"";for(var n=[],r=e;r;){var i=$n(r,Boolean(t),r===e);if(!i)break;if(n.push(i),i.optimized)break;r=r.parentElement}return n.reverse(),n.join(" > ")}(e)}catch(ii){var n=ii instanceof Error?ii.message:String(ii);return null==t||t.warn("@amplitude/element-selector: legacyCssPath threw — emitting empty selector: ".concat(n)),""}}function Zn(e,t){void 0===t&&(t={});var n=e,r=new Set,i=t.logger,s={strategies:t.strategies,scope:t.scope,logger:i};return{generate:function(e){var r,a;if(!n.enabled)return Qn(e,i);try{var u=Bn(e,n,s);return null!==u?u:function(e,t,n){var r,i;void 0===n&&(n={});for(var s=null!==(i=null!==(r=n.scope)&&void 0!==r?r:e.ownerDocument)&&void 0!==i?i:document,a=[],u=e,c=0;null!==u&&!(void 0!==t.maxAncestorWalkDepth&&c>t.maxAncestorWalkDepth);){var l=jn(u,t);if(null!==l){var d="".concat(u.tagName.toLowerCase(),"#").concat(Yn(l)),f=(0,o.fX)([d],(0,o.zs)(a),!1).join(" > ");if(Wn(s,f,e))return f}a.unshift(Vn(u)),u=u.parentElement,c+=1}return a.join(" > ")}(e,n,{scope:null!==(a=null!==(r=t.scope)&&void 0!==r?r:e.ownerDocument)&&void 0!==a?a:document})}catch(ii){var c=ii instanceof Error?ii.message:String(ii);return null==i||i.warn("@amplitude/element-selector: strategy chain threw — falling back to legacy cssPath: ".concat(c)),Qn(e,i)}},getConfig:function(){return n},updateConfig:function(e){var t,s;n=e;try{for(var a=(0,o.Ju)(r),u=a.next();!u.done;u=a.next()){var c=u.value;try{c(e)}catch(ii){var l=ii instanceof Error?ii.message:String(ii);null==i||i.warn("@amplitude/element-selector: onConfigChange subscriber threw — ".concat(l))}}}catch(d){t={error:d}}finally{try{u&&!u.done&&(s=a.return)&&s.call(a)}finally{if(t)throw t.error}}},onConfigChange:function(e){return r.add(e),function(){r.delete(e)}}}}var er,tr=Object.freeze({enabled:!1,explicitTrackingAttribute:"data-amp-track-id",autogeneratedIdPatterns:(0,o.fX)([],(0,o.zs)([/^:r[0-9a-z]+:$/,/^radix-/,/^headlessui-/,/^mui-/,/^[a-f0-9]{16,}$/i,/-\d{8,}$/,/\d{4,}/]),!1),unstableClassPatterns:(0,o.fX)([],(0,o.zs)([/^(p|m|px|py|mx|my|pt|pb|pl|pr|mt|mb|ml|mr)-\d+$/,/^(w|h|min-w|max-w|min-h|max-h)-/,/^(text|bg|border|ring|fill|stroke)-/,/^(hover|focus|active|disabled|group-hover):/,/^(sm|md|lg|xl|2xl):/,/^z-\d+$/,/^data-\[/,/^\[/,/^css-[a-z0-9]{6,}$/,/^[a-zA-Z]+_[a-zA-Z0-9]{3,}__[a-zA-Z0-9]{5,}$/,/^sc-[a-zA-Z0-9]{6,}$/,/^jsx-\d+$/,/^swiper-slide-(visible|fully-visible|active|prev|next|duplicate)$/,/^is-(active|open|selected|hovered|focused|expanded)$/,/^Mui[A-Z][a-zA-Z]+-(focused|selected|disabled|expanded|focusVisible|active|checked)$/,/^Mui-(selected|focused|disabled|expanded|focusVisible|active|checked)$/,/^data-state-/]),!1),maxAncestorWalkDepth:void 0});function nr(e,t){if(!e)return rr();var n,r=rr();return"boolean"==typeof e.enabled&&(r.enabled=e.enabled),"string"==typeof e.explicitTrackingAttribute&&""!==e.explicitTrackingAttribute&&(r.explicitTrackingAttribute=e.explicitTrackingAttribute),Array.isArray(e.autogeneratedIdPatterns)&&(r.autogeneratedIdPatterns=function(e,t){var n,r,i=[];try{for(var s=(0,o.Ju)(e),a=s.next();!a.done;a=s.next()){var u=a.value;try{i.push(new RegExp(u))}catch(ii){var c=ii instanceof Error?ii.message:String(ii);null==t||t.warn('@amplitude/element-selector: ignoring invalid autogenerated-id pattern "'.concat(u,'" (').concat(c,")"))}}}catch(l){n={error:l}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return i}(e.autogeneratedIdPatterns,t)),Array.isArray(e.unstableClassPatterns)&&(r.unstableClassPatterns=function(e,t){var n,r,i=[];try{for(var s=(0,o.Ju)(e),a=s.next();!a.done;a=s.next()){var u=a.value;try{i.push(new RegExp(u))}catch(ii){var c=ii instanceof Error?ii.message:String(ii);null==t||t.warn('@amplitude/element-selector: ignoring invalid unstable-class pattern "'.concat(u,'" (').concat(c,")"))}}}catch(l){n={error:l}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return i}(e.unstableClassPatterns,t)),r.maxAncestorWalkDepth="number"!=typeof(n=e.maxAncestorWalkDepth)?void 0:Number.isFinite(n)?n<=0?void 0:Math.floor(n):void 0,r}function rr(){return{enabled:tr.enabled,explicitTrackingAttribute:tr.explicitTrackingAttribute,autogeneratedIdPatterns:(0,o.fX)([],(0,o.zs)(tr.autogeneratedIdPatterns),!1),unstableClassPatterns:(0,o.fX)([],(0,o.zs)(tr.unstableClassPatterns),!1),maxAncestorWalkDepth:tr.maxAncestorWalkDepth}}var ir,or=function(e,t){var n,r,i,s=this;
vendor: 5,450 bytes, line 1
1this.replaceSensitiveString=function(e){return wt(e,s.additionalMaskTextPatterns)},this.getHierarchy=function(e){var t,n,r,i,a,u=performance.now();if(!e)return[];for(var c=function(e){var t=[];if(!e)return t;t.push(e);for(var n=e.parentElement;n&&"HTML"!==n.tagName;)t.push(n),n=n.parentElement;return t}(e),l=new Map,d=c.length-1;d>=0;d--){var f=c[d];if(f){var v=ln(f.getAttribute(nn)),p=d===c.length-1?[]:null!==(r=l.get(c[d+1]))&&void 0!==r?r:new Set,h=new Set((0,o.fX)((0,o.fX)([],(0,o.zs)(p),!1),(0,o.zs)(v),!1));l.set(f,h)}}a=c.map(function(e){var t;return Mn(e,null!==(t=l.get(e))&&void 0!==t?t:new Set)});var g=function(e){(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach(function(t){var n=(0,o.zs)(t,2),r=n[0],i=n[1];e.attrs&&(e.attrs[r]=s.replaceSensitiveString(i))})};try{for(var m=(0,o.Ju)(a),y=m.next();!y.done;y=m.next())g(y.value)}catch(w){t={error:w}}finally{try{y&&!y.done&&(n=m.return)&&n.call(m)}finally{if(t)throw t.error}}var b=performance.now();return null===(i=s.diagnosticsClient)||void 0===i||i.recordHistogram("autocapturePlugin.getHierarchy",b-u),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(r){t=null}return t?s.getText(t):s.getNearestLabel(n)},this.getElementPath=function(e){var t;if(!e)return"";var n=performance.now(),r=s.selectorEngine.generate(e),i=performance.now();return null===(t=s.diagnosticsClient)||void 0===t||t.recordHistogram("autocapturePlugin.getElementPath",i-n),r},this.updateSelectorConfig=function(e,t){if(null!=e&&"boolean"==typeof e.enabled){var n=s.selectorEngine.getConfig().enabled,r=nr(e,t);s.selectorEngine.updateConfig(r),!n&&r.enabled?null==t||t.debug("@amplitude/element-selector: engine enabled — now emitting new element-selector element paths for autocapture events."):n&&!r.enabled&&(null==t||t.debug("@amplitude/element-selector: engine disabled — reverting to legacy cssPath for element paths."))}else null==t||t.debug("@amplitude/element-selector: ignoring remote-config delivery without an explicit `enabled` flag — keeping current engine state.")},this.getEventProperties=function(e,t,n){var r,i,a,u,c,l,d=null===(a=null===(i=null==t?void 0:t.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===a?void 0:a.call(i),f="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},v=s.getHierarchy(t),p=null===(u=v[0])||void 0===u?void 0:u.attrs,h=s.getNearestLabel(t),g=(c=null!=p?p:{},l=n,Object.entries(c).reduce(function(e,t){var n=(0,o.zs)(t,2),r=n[0],i=n[1];if(r.startsWith(l)){var s=r.replace(l,"");s&&(e[s]=i||"")}return e},{})),m=((r={})["[Amplitude] Element Hierarchy"]=v,r[Kt]=d,r[Gt]=s.getText(t),r["[Amplitude] Element Position Left"]=null==f.left?null:Math.round(f.left),r["[Amplitude] Element Position Top"]=null==f.top?null:Math.round(f.top),r["[Amplitude] Element Attributes"]=g,r["[Amplitude] Element Path"]=s.getElementPath(t),r["[Amplitude] Element Parent Label"]=h,r[Qt]=sn(window.location.href.split("?")[0]),r["[Amplitude] Page Title"]=Et(s.replaceSensitiveString),r[Zt]=window.innerHeight,r[en]=window.innerWidth,r),y=fn();if(y&&(m[tn]=y),m["[Amplitude] Element ID"]=t.getAttribute("id")||"",m["[Amplitude] Element Class"]=t.getAttribute("class"),m["[Amplitude] Element Aria Label"]=null==p?void 0:p["aria-label"],"a"===d&&"click"===e&&t instanceof HTMLAnchorElement){var b=t.href.substring(0,128);m["[Amplitude] Element Href"]=s.replaceSensitiveString(b)}return dn(m)},this.addTypeAndTimestamp=function(e,t){return{event:e,timestamp:Date.now(),type:t}},this.addAdditionalEventProperties=function(e,t,n,r,i){void 0===i&&(i=!1);var o=s.addTypeAndTimestamp(e,t);if(function(e){return"click"===e.type||"change"===e.type}(o)&&null!==o.event.target){if(i){var a=function(e,t){var n,r=null===(n=null===window||void 0===window?void 0:window.getComputedStyle)||void 0===n?void 0:n.call(window,e);return"pointer"===(null==r?void 0:r.getPropertyValue("cursor"))&&"click"===t}(o.event.target,o.type);if(a)return o.closestTrackedAncestor=o.event.target,o.targetElementProperties=s.getEventProperties(o.type,o.closestTrackedAncestor,r),o}var u=vn(o.event.target,n);return u&&(o.closestTrackedAncestor=u,o.targetElementProperties=s.getEventProperties(o.type,u,r)),o}return o},this.extractDataFromDataSource=function(e,t){if("DOM_ELEMENT"===e.sourceType){var n=function(e,t){try{if("DOM_ELEMENT"===e.sourceType){var n=document.documentElement;return e.scope&&t&&(n=t.closest(e.scope)),n&&e.selector?n.querySelector(e.selector):n}}catch(r){return}}(e,t);if(!n)return;return"TEXT"===e.elementExtractType?s.getText(n):"ATTRIBUTE"===e.elementExtractType&&e.attribute?n.getAttribute(e.attribute):void 0}},this.getTextWithMaskedDescendants=function(e){var t,n,r="[".concat(ht,"], [contenteditable]");if(!e.querySelector(r))return e.innerText;var i="",a=Array.from(e.childNodes);try{for(var u=(0,o.Ju)(a),c=u.next();!c.done;c=u.next()){var l=c.value;l.nodeType!==Node.TEXT_NODE?l instanceof Element&&(l.hasAttribute(ht)||l.hasAttribute("contenteditable")?i+=gt:i+=s.getTextWithMaskedDescendants(l)):i+=l.textContent||""}}catch(d){t={error:d}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}return i},this.getText=function(e){if(null!==e.closest("[".concat(ht,"]")))return gt;var t="";return t=e.querySelector("[".concat(ht,"], [contenteditable]"))?s.getTextWithMaskedDescendants(e):e.innerText||"",s.replaceSensitiveStr
1ing(t.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=function(e){var t,n,r;if(!e)return{};var i=null===(r=null===(n=null==e?void 0:e.tagName)||void 0===n?void 0:n.toLowerCase)||void 0===r?void 0:r.call(n),o=((t={})[Kt]=i,t[Gt]=s.getText(e),t[Qt]=window.location.href.split("?")[0],t);return dn(o)},this.diagnosticsClient=null==t?void 0:t.diagnosticsClient,this.selectorEngine=(er||(er=Zn(nr())),er);var a=null!==(i=e.maskTextRegex)&&void 0!==i?i:[],u=[];try{for(var c=(0,o.Ju)(a),l=c.next();!l.done;l=c.next()){var d=l.value;if(u.length>=25)break;if(d instanceof RegExp)u.push(d);else if("pattern"in d&&"string"==typeof d.pattern)try{u.push(new RegExp(d.pattern,"i"))}catch(f){}}}catch(v){n={error:v}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}this.additionalMaskTextPatterns=u};function sr(e,t){var n=e.remoteConfigClient;if(e.fetchRemoteConfig&&n){var r=n.subscribe("configs.analyticsSDK.browserSDK.autocapture.elementSelector","all",function(n,r){e.loggerProvider.debug("@amplitude/element-selector: remote-config delivery (source=".concat(String(r),") ").concat(JSON.stringify(n))),t.updateSelectorConfig(n,e.loggerProvider)});return function(){n.unsubscribe(r)}}}!function(e){e.ClickObservable="clickObservable",e.ChangeObservable="changeObservable",e.NavigateObservable="navigateObservable",e.MutationObservable="mutationObservable",e.ScrollObservable="scrollObservable",e.ExposureObservable="exposureObservable",e.BrowserErrorObservable="browserErrorObservable",e.SelectionObservable="selectionObservable",e.MouseMoveObservable="mouseMoveObservable"}(ir||(ir={}));var ar=function(e,t){var n,r,i,s,a,u,c,d,f,v,p,h;void 0===e&&(e={}),null==t||t.diagnosticsClient.setTag("plugin.autocapture.version",Xt);var g=e.dataAttributePrefix,m=void 0===g?Ut:g,y=e.visualTaggingOptions,b=void 0===y?{enabled:!0}:y;e.cssSelectorAllowlist=null!==(n=e.cssSelectorAllowlist)&&void 0!==n?n:jt,e.actionClickAllowlist=null!==(r=e.actionClickAllowlist)&&void 0!==r?r:Yt,e.debounceTime=null!==(i=e.debounceTime)&&void 0!==i?i:0;var w=!1!==(null===(s=e.viewportContentUpdated)||void 0===s?void 0:s.enabled),E=null!==(c=null!==(u=null===(a=e.viewportContentUpdated)||void 0===a?void 0:a.exposureDuration)&&void 0!==u?u:e.exp
vendor: 20,861 bytes, line 1
1osureDuration)&&void 0!==c?c:150;e.viewportContentUpdated=(0,o.Cl)((0,o.Cl)({},e.viewportContentUpdated),{exposureDuration:E}),e.pageUrlExcludelist=null===(d=e.pageUrlExcludelist)||void 0===d?void 0:d.reduce(function(e,t){if("string"==typeof t&&e.push(t),t instanceof RegExp&&e.push(t),"object"==typeof t&&null!==t&&"pattern"in t)try{e.push(new RegExp(t.pattern))}catch(n){return console.warn("Invalid regex pattern: ".concat(t.pattern),n),e}return e},[]);var S,k="@amplitude/plugin-autocapture-browser",T=[],C=new or(e,t),A=new Set,x=new Set,I=function(){var t,n,r=Jt(Cn().map(function(t){return C.addAdditionalEventProperties(t,"click",e.cssSelectorAllowlist,m)})),i=Jt(new(Ft())(function(t){var n,r=function(n){var r=C.addAdditionalEventProperties(n,"change",e.cssSelectorAllowlist,m);t.next(r)};return null===(n=(0,l.m)())||void 0===n||n.document.addEventListener("change",r,{capture:!0}),function(){var e;return null===(e=(0,l.m)())||void 0===e?void 0:e.document.removeEventListener("change",r)}}));window.navigation&&(n=Jt(new(Ft())(function(t){var n=function(n){var r=C.addAdditionalEventProperties(n,"navigate",e.cssSelectorAllowlist,m);t.next(r)};return window.navigation.addEventListener("navigate",n),function(){window.navigation.removeEventListener("navigate",n)}})));var o=Jt(Tn().map(function(t){return C.addAdditionalEventProperties(t,"mutation",e.cssSelectorAllowlist,m)})),s=new(Ft())(function(e){var t,n=function(t){e.next(t)};return null===(t=(0,l.m)())||void 0===t||t.addEventListener("scroll",n),function(){var e;null===(e=(0,l.m)())||void 0===e||e.removeEventListener("scroll",n)}}),a=function(e,t){return new(Ft())(function(n){var r,i=(0,l.m)();if(!(null==i?void 0:i.IntersectionObserver))return function(){};var o=new IntersectionObserver(function(e){e.forEach(function(e){n.next(e)})},{root:null,rootMargin:"0px",threshold:1}),s=t.join(",");(null!==(r=null==i?void 0:i.document.querySelectorAll(s))&&void 0!==r?r:[]).forEach(function(e){o.observe(e)});var a=e.subscribe(function(e){return e.event.forEach(function(e){return e.addedNodes.forEach(function(e){e instanceof Element&&(e.matches(s)&&o.observe(e),e.querySelectorAll(s).forEach(function(e){o.observe(e)}))})})});return function(){a.unsubscribe(),o.disconnect()}})}(o,e.cssSelectorAllowlist);return(t={})[ir.ChangeObservable]=i,t[ir.ClickObservable]=r,t[ir.MutationObservable]=o,t[ir.NavigateObservable]=n,t[ir.ScrollObservable]=s,t[ir.ExposureObservable]=a,t},P=Pn(Object.values(null!==(v=null===(f=e.pageActions)||void 0===f?void 0:f.labeledEvents)&&void 0!==v?v:{})),O=On(null!==(h=null===(p=e.pageActions)||void 0===p?void 0:p.triggers)&&void 0!==h?h:[]),_=function(e,t,n,r){return new Rn(e,t,n,r)}(P,O,C,e);return{name:k,type:"enrichment",setup:function(t,n){return(0,o.sH)(void 0,void 0,void 0,function(){var r,i,s,a,u,c,d,f,v,p,h,g,y,R,H,D,L,N,M,j,U,Y;return(0,o.YH)(this,function(q){return"undefined"==typeof document||(r=!1,i={maxX:void 0,maxY:void 0},t.fetchRemoteConfig&&(t.remoteConfigClient?t.remoteConfigClient.subscribe("configs.analyticsSDK.pageActions","all",function(t){!function(t){var n,r;t&&(e.pageActions=(0,o.Cl)((0,o.Cl)({},e.pageActions),t),P=Pn(Object.values(null!==(n=e.pageActions.labeledEvents)&&void 0!==n?n:{})),O=On(null!==(r=e.pageActions.triggers)&&void 0!==r?r:[]),_.update(P,O,e))}(t)}):t.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),(s=sr(t,C))&&T.push({unsubscribe:s}),a=cn(e,e.cssSelectorAllowlist),u=cn(e,e.actionClickAllowlist),c=I(),d=function(e){var t=e.amplitude,n=e.allObservables,r=e.shouldTrackEvent,i=e.evaluateTriggers;return n.clickObservable.filter(hn).filter(function(e){return r("click",e.closestTrackedAncestor)}).map(function(e){return i(e)}).subscribe(function(e){null==t||t.track($t,e.targetElementProperties)})}({allObservables:c,amplitude:n,shouldTrackEvent:a,evaluateTriggers:_.evaluate.bind(_)}),T.push(d),f=function(e){var t=e.amplitude,n=e.allObservables,r=e.getEventProperties,i=e.shouldTrackEvent,o=e.evaluateTriggers;return n.changeObservable.filter(hn).filter(function(e){return i("change",e.closestTrackedAncestor)}).map(function(e){return o(e)}).subscribe(function(e){null==t||t.track("[Amplitude] Element Changed",r("change",e.closestTrackedAncestor))})}({allObservables:c,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return C.getEventProperties.apply(C,(0,o.fX)((0,o.fX)([],(0,o.zs)(e),!1),[m],!1))},amplitude:n,shouldTrackEvent:a,evaluateTriggers:_.evaluate.bind(_)}),T.push(f),v=function(e){var t=e.amplitude,n=e.allObservables,r=e.options,i=e.getEventProperties,o=e.shouldTrackEvent,s=e.shouldTrackActionClick,a=n.clickObservable,u=n.mutationObservable,c=n.navigateObservable,l=a.filter(function(e){return!o("click",e.closestTrackedAncestor)}).map(function(e){var t=vn(e.event.target,r.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=i(e.type,e.closestTrackedAncestor)),e}).filter(hn).filter(function(e){return s("click",e.closestTrackedAncestor)}),d=c?Bt(u,c):u,f=Bt(l,d),v=null,p=null;return zt(f,function(e){if(v&&(clearTimeout(v),v=null),"click"===e.type)return p=e,v=setTimeout(function(){v=null,p=null},500),Promise.resolve(null);if(p){var t=p;return p=null,Promise.resolve(t)}return Promise.resolve(null)}).subscribe(function(e){e&&(null==t||t.track($t,i("click",e.closestTrackedAncestor)))})}({allObservables:c,options:e,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return C.getEventProperties.apply(C,(0,o.fX)((0,o.fX)([],(0,o.zs)(e),!1),[m],!1))},amplitude:n,shouldTrackEvent:a,shouldTrackActionClick:u}),v&&T.push(v),p=function(e){e.amplitude;var t=e.allObservables.scrollObservable,n={maxX:0,maxY:0},r=t.subscribe(function(){var e,t,r,i,o=(0,l.m)(),s=Math.floor(null!==(t=null!==(e=null==o?void 0:o.scrollX)&&void 0!==e?e:null==o?void 0:o.pageXOffset)&&void 0!==t?t:0),a=Math.floor(null!==(i=null!==(r=null==o?void 0:o.scrollY)&&void 0!==r?r:null==o?void 0:o.pageYOffset)&&void 0!==i?i:0);n.maxX=Math.max(n.maxX,s),n.maxY=Math.max(n.maxY,a)});return{unsubscribe:function(){r.unsubscribe()},getState:function(){return n},reset:function(){n.maxX=0,n.maxY=0}}}({allObservables:c,amplitude:n}),T.push(p),h={},g=(0,l.m)(),y=function(e){e&&r||(setTimeout(function(){r=!1},100),r=!0,function(e){var t,n,r,i,o,s,a=e.amplitude,u=e.scrollTracker,c=e.currentElementExposed,d=e.elementExposedForPage,f=e.exposureTracker,v=e.isPageEnd,p=e.lastScroll,h=u.getState(),g=(0,l.m)(),m=null!==(n=null==g?void 0:g.innerWidth)&&void 0!==n?n:0,y=null!==(r=null==g?void 0:g.innerHeight)&&void 0!==r?r:0,b=((t={})[Qt]=sn(null!==(s=null===(o=null===(i=null==g?void 0:g.location)||void 0===i?void 0:i.href)||void 0===o?void 0:o.split("?")[0])&&void 0!==s?s:""),t["[Amplitude] Max Page X"]=h.maxX+m,t["[Amplitude] Max Page Y"]=h.maxY+y,t[Zt]=y,t[en]=m,t["[Amplitude] Element Exposed"]=Array.from(c),t),w=fn();w&&(b[tn]=w),0!==c.size||h.maxX!==p.maxX||h.maxY!==p.maxY?(null==a||a.track("[Amplitude] Viewport Content Updated",b),p.maxX=h.maxX,p.maxY=h.maxY,c.clear(),v&&(u.reset(),d.clear(),null==f||f.reset())):v&&(u.reset(),d.clear(),null==f||f.reset())}({amplitude:n,scrollTracker:p,currentElementExposed:x,elementExposedForPage:A,exposureTracker:h.exposure,isPageEnd:e,lastScroll:i}))},R=function(e){!function(e,t,n,r){if(!t.has(e)){t.add(e),n.add(e);var i=Array.from(n);JSON.stringify(i).length>=18e3&&r(!1)}}(e,A,x,y)},w&&(h.exposure=function(e){var t=e.allObservables,n=e.onExposure,r=e.dataExtractor,i=e.exposureDuration,o=void 0===i?150:i,s=new Map,a=new Map,u=t.exposureObservable.subscribe(function(e){var t=e,i=t.target;if(t.isIntersecting){if(!s.get(i)){var u=setTimeout(function(){s.set(i,!0);var e=r.getElementPath(i);n(e),a.set(i,null)},o);a.set(i,u)}}else!t.isIntersecting&&t.intersectionRatio<1&&(u=a.get(i))&&(clearTimeout(u),a.set(i,null))});return{unsubscribe:function(){u.unsubscribe()},reset:function(){a.forEach(function(e){e&&clearTimeout(e)}),a.clear(),s.clear()}}}({allObservables:c,onExposure:R,dataExtractor:C,exposureDuration:E}),h.exposure&&T.push(h.exposure),H=function(){y(!0)},null==g||g.addEventListener("beforeunload",H),S=function(){null==g||g.removeEventListener("beforeunload",H)},T.push({unsubscribe:function(){return S()}}),(D=c[ir.NavigateObservable])?T.push(D.subscribe(function(){y(!0)})):g&&(L=function(){y(!0)},g.addEventListener("popstate",L),N=g.history.pushState,g.history&&N&&(g.history.pushState=new Proxy(N,{apply:function(e,t,n){var r=(0,o.zs)(n,3),i=r[0],s=r[1],a=r[2];e.apply(t,[i,s,a]),y(!0)}})),T.push({unsubscribe:function(){g.removeEventListener("popstate",L),g.history&&N&&(g.history.pushState=N)}}))),null===(Y=null==t?void 0:t.loggerProvider)||void 0===Y||Y.log("".concat(k," has been successfully added.")),window.opener&&b.enabled&&(M=e.cssSelectorAllowlist,j=e.actionClickAllowlist,function(e,t){var n=e;if(!0!==n[gn]){n[gn]=!0;var r=t.dataExtractor,i=t.isElementSelectable,o=t.cssSelectorAllowlist,s=t.actionClickAllowlist,a=null,u=function(t){e.notify({action:"element-selected",data:t})},c=function(t,n){"selector-mode-changed"===t?e.notify({action:"track-selector-mode-changed",data:n}):"selector-moved"===t&&e.notify({action:"track-selector-moved",data:n})};e.registerActionHandler("initialize-visual-tagging-selector",function(t){e.loadScriptOnce("https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz").then(function(){var n;a=null===(n=null===window||void 0===window?void 0:window.amplitudeVisualTaggingSelector)||void 0===n?void 0:n.call(window,{getEventTagProps:r.getEventTagProps,isElementSelectable:function(e){return!i||i((null==t?void 0:t.actionType)||"click",e)},onTrack:c,onSelect:u,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:e,cssSelectorAllowlist:o,actionClickAllowlist:s,extractDataFromDataSource:r.extractDataFromDataSource,dataExtractor:r,diagnostics:{autocapture:{version:Xt}}}),e.notify({action:"selector-loaded"})}).catch(function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize visual tagging selector")})}),e.registerActionHandler("close-visual-tagging-selector",function(){var e;null===(e=null==a?void 0:a.close)||void 0===e||e.call(a)})}}(U=(0,Vt.Z)(),{dataExtractor:C,isElementSelectable:cn(e,(0,o.fX)((0,o.fX)([],(0,o.zs)(M),!1),(0,o.zs)(j),!1)),cssSelectorAllowlist:M,actionClickAllowlist:j}),(0,Wt.E)(U),U.setup((0,o.Cl)({logger:null==t?void 0:t.loggerProvider},(null==t?void 0:t.serverZone)&&{endpoint:rn.ht[t.serverZone]})))),[2]})})},execute:function(e){return(0,o.sH)(void 0,void 0,void 0,function(){return(0,o.YH)(this,function(t){return[2,e]})})},teardown:function(){return(0,o.sH)(void 0,void 0,void 0,function(){var e,t,n,r;return(0,o.YH)(this,function(i){try{for(e=(0,o.Ju)(T),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(s){n={error:s}}finally{try{t&&!t.done&&(r=e.return)&&r.call(e)}finally{if(n)throw n.error}}return[2]})})}}},ur=(0,o.fX)(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],(0,o.zs)(["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]']),!1),cr=ur,lr=ur,dr=["*"],fr=["mutation","navigate"];function vr(e,t){var n,r,i,o,s=t.event,a=s.pageX,u=s.pageY;e.yMin=Math.min(null!==(n=e.yMin)&&void 0!==n?n:u,u),e.yMax=Math.max(null!==(r=e.yMax)&&void 0!==r?r:u,u),e.xMin=Math.min(null!==(i=e.xMin)&&void 0!==i?i:a,a),e.xMax=Math.max(null!==(o=e.xMax)&&void 0!==o?o:a,a),e.isOutOfBounds=e.yMax-e.yMin>50||e.xMax-e.xMin>50}function pr(e){if(0===e.length)return null;var t=e[0],n=e[e.length-1];return{rageClickEvent:(0,o.Cl)({"[Amplitude] Begin Time":new Date(t.timestamp).toISOString(),"[Amplitude] End Time":new Date(n.timestamp).toISOString(),"[Amplitude] Duration":n.timestamp-t.timestamp,"[Amplitude] Clicks":e.map(function(e){return{X:e.event.pageX,Y:e.event.pageY,Time:e.timestamp}}),"[Amplitude] Click Count":e.length},t.targetElementProperties),time:t.timestamp}}function hr(e){var t=this,n=e.amplitude,r=e.allObservables,i=e.shouldTrackRageClick,s=r.clickObservable,a=r.selectionObservable,u=[],c={},l=null;function d(e){u=[],c={},e&&(vr(c,e),u.push(e))}var f=zt(s.filter(function(e){return i("click",e.closestTrackedAncestor)}),function(e){return(0,o.sH)(t,void 0,void 0,function(){var t;return(0,o.YH)(this,function(n){return vr(c,e),t=null,0===u.length||function(e,t){return e.length>0&&e[e.length-1].closestTrackedAncestor!==t.closestTrackedAncestor}(u,e)||function(e,t){var n=e[Math.max(0,e.length-4+1)];return t.timestamp-n.timestamp>=1e3}(u,e)||c.isOutOfBounds?(l&&(t=pr(u)),d(e)):u.push(e),l&&(clearTimeout(l.timerId),l.resolve(t),l=null),u.length>=4?[2,new Promise(function(e){l={resolve:e,timerId:setTimeout(function(){e(pr(u))},1e3)}})]:[2,null]})})}),v=null==a?void 0:a.subscribe(function(){d()}),p=f.subscribe(function(e){null!==e&&n.track("[Amplitude] Rage Click",e.rageClickEvent,{time:e.time})});return{unsubscribe:function(){p.unsubscribe(),null==v||v.unsubscribe()}}}var gr,mr;!function(e){e.INCREASING="increasing",e.DECREASING="decreasing"}(gr||(gr={})),function(e){e.X="x",e.Y="y"}(mr||(mr={}));function yr(e){var t=e.changes,n=e.changesThreshold,r=e.thresholdMs;return!(t.length<n)&&t[t.length-1]-t[0]<r}function br(e){e.changes=[],e.startTime=void 0}function wr(e){for(var t=e.changes,n=e.thresholdMs,r=0,i=t[t.length-1];r<t.length;r++){if(i-t[r]<n)break}0!==r&&(e.startTime=t[r],e.changes.splice(0,r))}var Er=function(e){var t=e.mouseDirectionChangeObservable,n=e.directionChanges,r=void 0===n?20:n,i=e.thresholdMs,o=void 0===i?2e3:i;return new(Ft())(function(e){var n={changes:[],changesThreshold:r,thresholdMs:o},i={changes:[],changesThreshold:r,thresholdMs:o},s=void 0,a=null;function u(){void 0!==s&&(e.next(s),s=void 0,null!==a&&clearTimeout(a),br(n),br(i))}return t.subscribe(function(e){null!==a&&clearTimeout(a),function(e){var t=+Date.now();e.startTime=e.startTime||t;var n=e.changes,r=e.changesThreshold;n.push(t),n.length>r&&n.shift()}(e===mr.X?n:i);var t=function(e,t){var n=void 0;if(yr(e)&&(n=e.startTime),yr(t)){var r=t.startTime;r&&(!n||r<n)&&(n=r)}return n}(n,i);return t?(s=s||t,a=setTimeout(function(){u(),a=null},o)):u(),wr(n),wr(i),function(){null!==a&&(clearTimeout(a),a=null)}})})},Sr=function(e){var t=e.amplitude,n=e.options,r=e.allObservables,i=e.directionChanges,o=void 0===i?20:i,s=e.thresholdMs,a=void 0===s?2e3:s,u=function(e){var t=e.allWindowObservables.mouseMoveObservable;return new(Ft())(function(e){var n=null,r=null,i=null;return t.subscribe(function(t){var o={x:t.clientX,y:t.clientY};null!==n?(o.x>n.x?(r===gr.DECREASING&&e.next(mr.X),r=gr.INCREASING):o.x<n.x&&(r===gr.INCREASING&&e.next(mr.X),r=gr.DECREASING),o.y>n.y?(i===gr.DECREASING&&e.next(mr.Y),i=gr.INCREASING):o.y<n.y&&(i===gr.INCREASING&&e.next(mr.Y),i=gr.DECREASING),n=o):n=o})})}({allWindowObservables:r});return Er({mouseDirectionChangeObservable:u,directionChanges:o,thresholdMs:a}).subscribe(function(e){un(n)&&t.track("[Amplitude] Thrashed Cursor",void 0,{time:e})})};function kr(e,t,n,r){if(!r)return[];var i=e[t];return"object"==typeof i&&null!==i&&"cssSelectorAllowlist"in i&&Array.isArray(i.cssSelectorAllowlist)?i.cssSelectorAllowlist:n}var Tr=4e3,Cr=function(e){var t;void 0===e&&(e={});var n="@amplitude/plugin-frustration-browser",r=[],i=!1!==e.errorClicks;e.errorClicks||(i=!1);var s=!1!==e.deadClicks&&null!==e.deadClicks,a=!1!==e.rageClicks&&null!==e.rageClicks,u=!1!==e.thrashedCursor&&null!==e.thrashedCursor;e.thrashedCursor||(u=!1);var c=kr(e,"rageClicks",dr,a),l=kr(e,"deadClicks",cr,s),d=kr(e,"errorClicks",lr,i),f=null!==(t=e.dataAttributePrefix)&&void 0!==t?t:Ut,v=new or(e),p=(0,o.fX)([],(0,o.zs)(new Set((0,o.fX)((0,o.fX)((0,o.fX)([],(0,o.zs)(c),!1),(0,o.zs)(l),!1),(0,o.zs)(d),!1))),!1),h=function(){var e,t,n=Jt(Cn("pointerdown").map(function(e){return v.addAdditionalEventProperties(e,"click",p,f,!0)})),r=Jt(An().map(function(e){return v.addTypeAndTimestamp(e,"error")})),i=Jt(Tn().map(function(e){return v.addAdditionalEventProperties(e,"mutation",p,f)}));window.navigation&&(t=Jt(new(Ft())(function(e){var t=function(t){e.next((0,o.Cl)((0,o.Cl)({},t),{type:"navigate"}))};return window.navigation.addEventListener("navigate",t),function(){window.navigation.removeEventListener("navigate",t)}}).map(function(e){return v.addAdditionalEventProperties(e,"navigate",p,f)})));var s=Jt(new(Ft())(function(e){var t=function(){var t=document.activeElement;if(t&&("TEXTAREA"===t.tagName||"INPUT"===t.tagName)){try{if(t.selectionStart===t.selectionEnd)return}catch(r){return}return e.next()}var n=window.getSelection();if(n&&!n.isCollapsed)return e.next()};return window.document.addEventListener("selectionchange",t),function(){window.document.removeEventListener("selectionchange",t)}})),a=Jt(new(Ft())(function(e){var t=function(t){e.next(t)},n={capture:!0};return kn.document.addEventListener("mousemove",t,n),function(){kn.document.removeEventListener("mousemove",t,n)}}));return(e={})[ir.ClickObservable]=n,e[ir.MutationObservable]=i,e[ir.NavigateObservable]=t,e[ir.BrowserErrorObservable]=r,e[ir.SelectionObservable]=s,e[ir.MouseMoveObservable]=a,e};return{name:n,type:"enrichment",setup:function(t,p){return(0,o.sH)(void 0,void 0,void 0,function(){var g,m,y,b,w,E,S,k,T,C,A,x;return(0,o.YH)(this,function(I){return"undefined"==typeof document||(g=h(),(m=sr(t,v))&&r.push({unsubscribe:m}),a&&(y=cn(e,c),b=hr({allObservables:g,amplitude:p,shouldTrackRageClick:y}),r.push(b)),s&&(w=cn(e,l),E=function(e){var t=e.amplitude,n=e.allObservables,r=e.getEventProperties,i=e.shouldTrackDeadClick,s=n.clickObservable,a=n.mutationObservable,u=n.navigateObservable,c=s.filter(function(e){return hn(e)&&i("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===pn.LEFT_OR_TOUCH_CONTACT}),l=u?Bt(a,u):a,d=Bt(c,l),f=null;return zt(d,function(e){return f&&fr.includes(e.type)?(clearTimeout(f),f=null,Promise.resolve(null)):"click"===e.type?f?Promise.resolve(null):new Promise(function(t){f=setTimeout(function(){t(e),f=null},3e3)}):Promise.resolve(null)}).subscribe(function(e){if(e){var n={"[Amplitude] X":e.event.clientX,"[Amplitude] Y":e.event.clientY};t.track("[Amplitude] Dead Click",(0,o.Cl)((0,o.Cl)({},r("click",e.closestTrackedAncestor)),n),{time:e.timestamp})}})}({amplitude:p,allObservables:g,getEventProperties:function(e,t){return v.getEventProperties(e,t,f)},shouldTrackDeadClick:w}),r.push(E)),i&&(S=cn(e,d),k=function(e){var t=e.amplitude,n=e.allObservables,r=e.shouldTrackErrorClick,i=n.clickObservable,s=n.browserErrorObservable,a=i.filter(function(e){return hn(e)&&r("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===pn.LEFT_OR_TOUCH_CONTACT}),u=null,c=null,l=function(){null!==u&&(clearTimeout(u),u=null),c=null};return Bt(a,s).subscribe(function(e){var n;if("click"===e.type)return l(),c=e,void(u=setTimeout(l,2e3));"error"===e.type&&c&&(t.track("[Amplitude] Error Click",(0,o.Cl)(((n={})["[Amplitude] Kind"]=e.event.kind,n["[Amplitude] Message"]=e.event.message,n["[Amplitude] Stack"]=e.event.stack,n["[Amplitude] Filename"]=e.event.filename,n["[Amplitude] Line Number"]=e.event.lineNumber,n["[Amplitude] Column Number"]=e.event.columnNumber,n),c.targetElementProperties)),l())})}({amplitude:p,allObservables:g,shouldTrackErrorClick:S}),r.push(k)),u&&(T=void 0,C=void 0,"object"==typeof e.thrashedCursor&&(T=e.thrashedCursor.directionChanges,C=e.thrashedCursor.threshold,T&&T<5&&(t.loggerProvider.warn("'thrashedCursor.directionChanges' of ".concat(T," is below the minimum of ").concat(5,", setting to ").concat(5)),T=5),C&&C>Tr&&(t.loggerProvider.warn("'thrashedCursor.threshold' of ".concat(C," is above the maximum of ").concat(Tr,", setting to ").concat(Tr)),C=Tr)),A=Sr({amplitude:p,options:e,allObservables:g,directionChanges:T,thresholdMs:C}),r.push(A)),null===(x=null==t?void 0:t.loggerProvider)||void 0===x||x.log("".concat(n," has been successfully added."))),[2]})})},execute:function(e){return(0,o.sH)(void 0,void 0,void 0,function(){return(0,o.YH)(this,function(t){return[2,e]})})},teardown:function(){return(0,o.sH)(void 0,void 0,void 0,function(){var e,t,n,i;return(0,o.YH)(this,function(s){try{for(e=(0,o.Ju)(r),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(a){n={error:a}}finally{try{t&&!t.done&&(i=e.return)&&i.call(e)}finally{if(n)throw n.error}}return[2]})})}}};function Ar(e,t){var n=e.startTime+e.duration;return t.filter(function(t){return t.startTime<n&&t.startTime+t.duration>e.startTime}).map(function(e){return e.name})}function xr(e,t){var n,r=Ar(e,t),i=null!==(n=e.scripts)&&void 0!==n?n:[],s=i.map(function(e){return e.sourceURL}
1).filter(Boolean),a=i.map(function(e){return e.sourceFunctionName}).filter(Boolean),u=i.map(function(e){return e.sourceCharPosition}).filter(function(e){return"number"==typeof e&&e>=0}),c=i.map(function(e){return e.invokerType}).filter(Boolean),l=i.map(function(e){return e.invoker}).filter(Boolean);return(0,o.Cl)((0,o.Cl)((0,o.Cl)((0,o.Cl)((0,o.Cl)((0,o.Cl)((0,o.Cl)({"[Amplitude] Main Thread Block Source":"long-animation-frame","[Amplitude] Main Thread Block Duration":e.duration,"[Amplitude] Main Thread Block Blocking Duration":e.blockingDuration,"[Amplitude] Main Thread Block Start Time":e.startTime},r.length>0&&{"[Amplitude] Main Thread Block Measures":r}),{"[Amplitude] Main Thread Block Render Start":e.renderStart,"[Amplitude] Main Thread Block Style And Layout Start":e.styleAndLayoutStart,"[Amplitude] Main Thread Block Script Count":i.length}),s.length>0&&{"[Amplitude] Main Thread Block Script URLs":s}),a.length>0&&{"[Amplitude] Main Thread Block Script Functions":a}),u.length>0&&{"[Amplitude] Main Thread Block Script Positions":u}),c.length>0&&{"[Amplitude] Main Thread Block Invoker Types":c}),l.length>0&&{"[Amplitude] Main Thread Block Invokers":l})}function Ir(e,t){var n,r=Ar(e,t),i=null!==(n=e.attribution)&&void 0!==n?n:[];return(0,o.Cl)((0,o.Cl)({"[Amplitude] Main Thread Block Source":"long-task","[Amplitude] Main Thread Block Duration":e.duration,"[Amplitude] Main Thread Block Blocking Duration":e.duration,"[Amplitude] Main Thread Block Start Time":e.startTime},r.length>0&&{"[Amplitude] Main Thread Block Measures":r}),i.length>0&&{"[Amplitude] Main Thread Block Attribution":i.map(function(e){return e.name})})}function Pr(e){var t=e.amplitude,n=e.options,r=e.durationThreshold,i=void 0===r?100:r,s=function(){if("undefined"==typeof PerformanceObserver)return null;try{var t=PerformanceObserver.supportedEntryTypes;if(t.includes("long-animation-frame"))return"long-animation-frame";if(t.includes("longtask"))return"longtask"}catch(e){}return null}();if(!s)return{unsubscribe:function(){}};var a=[],u=new PerformanceObserver(function(e){var t,n,r=performance.now();try{for(var i=(0,o.Ju)(e.getEntries()),s=i.next();!s.done;s=i.next()){var u=s.value;a.push(u)}}
1catch(l){t={error:l}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}for(var c=r-1e4;a.length>0&&a[0].startTime<c;)a.shift()});try{u.observe({entryTypes:["measure"]})}catch(l){}var c=new PerformanceObserver(function(e){var r,u;try{for(var c=(0,o.Ju)(e.getEntries()),l=c.next();!l.done;l=c.next()){var d=l.value;if(!un(n))return;if(!(d.duration<i)){var f="long-animation-frame"===s?xr(d,a):Ir(d,a);t.track("[Amplitude] Main Thread Block",f)}}}catch(v){r={error:v}}finally{try{l&&!l.done&&(u=c.return)&&u.call(c)}finally{if(r)throw r.error}}});try{c.observe({entryTypes:[s]})}catch(d){return u.disconnect(),{unsubscribe:function(){}}}return{unsubscribe:function(){c.disconnect(),u.disconnect()}}}var Or=function(e){void 0===e&&(e={});var t="@amplitude/plugin-performance-browser",n=[],r=!0===e.mainThreadBlock||"object"==typeof e.mainThreadBlock&&null!==e.mainThreadBlock;return{name:t,type:"enrichment",setup:function(i,s){return(0,o.sH)(void 0,void 0,void 0,function(){var a,u,c;return(0,o.YH)(this,function(o){return"undefined"==typeof document||(r&&(a=100,"object"==typeof e.mainThreadBlock&&void 0!==e.mainThreadBlock.durationThreshold&&(a=e.mainThreadBlock.durationThreshold),u=Pr({amplitude:s,options:e,durationThreshold:a}),n.push(u)),null===(c=null==i?void 0:i.loggerProvider)||void 0===c||c.log("".concat(t," performance tracking has been successfully added."))),[2]})})},execute:function(e){return(0,o.sH)(void 0,void 0,void 0,function(){return(0,o.YH)(this,function(t){return[2,e]})})},teardown:function(){return(0,o.sH)(void 0,void 0,void 0,function(){var e,t,r,i;return(0,o.YH)(this,function(s){try{for(e=(0,o.Ju)(n),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(a){r={error:a}}finally{try{t&&!t.done&&(i=e.return)&&i.call(e)}finally{if(r)throw r.error}}return[2]})})}}},_r=n(31192),Rr=function(){function e(e){this.request=e}return e.prototype.headers=function(e){var t,n;void 0===e&&(e=[]);var r=this.request.headers,i={};if(Array.isArray(r))r.forEach(function(e){var t=(0,o.zs)(e,2),n=t[0],r=t[1];i[n]=r});else if(r instanceof Headers)r.forEach(function(e,t){i[t]=e});else if("object"==typeof r&&null!==r)try{for(var s=(0,o.Ju)(Object.entries(r)),a=s.next();!a.done;a=s.next()){var u=(0,o.zs)(a.value,2),c=u[0],l=u[1];i[c]=l}}catch(d){t={error:d}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return Yr(i,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if("number"==typeof this._bodySize)return this._bodySize;var e=(0,l.m)();if(null==e?void 0:e.TextEncoder){var t=this.request.body;return this._bodySize=Dr(t,100),this._bodySize}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"method",{get:function(){return this.request.method},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.request.body?this.request.body:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,o.sH)(this,void 0,void 0,function(){return(0,o.YH)(this,function(n){return 0===e.length?[2,null]:[2,jr(this.body,e,t)]})})},e}(),Hr=function(){function e(e,t){this.bodyRaw=e,this.requestHeaders=t}return e.prototype.headers=function(e){return void 0===e&&(e=[]),Yr(this.requestHeaders,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return Dr(this.bodyRaw,100)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.bodyRaw?this.bodyRaw:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,o.sH)(this,void 0,void 0,function(){return(0,o.YH)(this,function(n){return 0===e.length?[2,null]:[2,jr(this.body,e,t)]})})},e}();function Dr(e,t){var n,r,i,s=(0,l.m)(),a=null==s?void 0:s.TextEncoder;if(a&&null!=e){var u;if("string"==typeof e)u=e,i=(new a).encode(u).length;else if("undefined"!=typeof Blob&&e instanceof Blob)i=(u=e).size;else if("undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams)u=e,i=(new a).encode(u.toString()).length;else if(ArrayBuffer.isView(e))i=(u=e).byteLength;else if(e instanceof ArrayBuffer)i=(u=e).byteLength;else if("undefined"!=typeof FormData&&e instanceof FormData){var c=e,d=0,f=0;try{for(var v=(0,o.Ju)(c.entries()),p=v.next();!p.done;p=v.next()){var h=(0,o.zs)(p.value,2),g=h[0],m=h[1];if(d+=g.length,"string"==typeof m)d+=(new a).encode(m).length;else{if(!("undefined"!=typeof Blob&&m instanceof Blob))return;d+=m.size}if(++f>=t)return}}catch(y){n={error:y}}finally{try{p&&!p.done&&(r=v.return)&&r.call(v)}finally{if(n)throw n.error}}i=d}else if("undefined"!=typeof ReadableStream&&e instanceof ReadableStream)return void(u=e);return i}}var Lr,Nr=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
vendor: 6,804 bytes, line 1
1={};return null===(t=null==n?void 0:n.forEach)||void 0===t||t.call(n,function(e,t){r[t]=e}),Yr(r,{allow:e})}},Object.defineProperty(e.prototype,"bodySize",{get:function(){var e,t;if(void 0!==this._bodySize)return this._bodySize;var n=null===(t=null===(e=this.response.headers)||void 0===e?void 0:e.get)||void 0===t?void 0:t.call(e,"content-length"),r=n?parseInt(n,10):void 0;return this._bodySize=r,r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.response.status},enumerable:!1,configurable:!0}),e.prototype.text=function(){return(0,o.sH)(this,void 0,void 0,function(){var e,t;return(0,o.YH)(this,function(n){switch(n.label){case 0:this.clonedResponse||(this.clonedResponse=this.response.clone()),n.label=1;case 1:return n.trys.push([1,3,,4]),e=this.clonedResponse.text(),t=new Promise(function(e){return setTimeout(function(){return e(null)},500)}),[4,Promise.race([e,t])];case 2:return[2,n.sent()];case 3:return n.sent(),[2,null];case 4:return[2]}})})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,o.sH)(this,void 0,void 0,function(){return(0,o.YH)(this,function(n){switch(n.label){case 0:return 0===e.length?[2,null]:[4,this.text()];case 1:return[2,jr(n.sent(),e,t)]}})})},e}(),Mr=function(){function e(e,t,n,r){this.statusCode=e,this.headersString=t,this.size=n,this.getJson=r}return Object.defineProperty(e.prototype,"bodySize",{get:function(){return this.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.statusCode},enumerable:!1,configurable:!0}),e.prototype.headers=function(e){var t,n;if(void 0===e&&(e=[]),!this.headersString)return{};var r={},i=this.headersString.split("\r\n");try{for(var s=(0,o.Ju)(i),a=s.next();!a.done;a=s.next()){var u=a.value,c=(0,o.zs)(u.split(": "),2),l=c[0],d=c[1];l&&d&&(r[l]=d)}}catch(f){t={error:f}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return Yr(r,{allow:e})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,o.sH)(this,void 0,void 0,function(){var n;return(0,o.YH)(this,function(r){return 0===e.length?[2,null]:(n=this.getJson())?((0,_r.D7)(n,e,t),[2,n]):[2,null]})})},e}();function jr(e,t,n){if(!e)return null;try{var r=JSON.parse(e);return(0,_r.D7)(r,t,n),r}catch(i){return null}}!function(e){e.REDACT="redact",e.REMOVE="remove"}(Lr||(Lr={}));var Ur="[REDACTED]",Yr=function(e,t){var n,r,i=t.allow,s=void 0===i?[]:i,a=t.strategy,u=void 0===a?Lr.REMOVE:a,c=(0,o.fX)([],(0,o.zs)(R.L),!1),l={},d=function(t){var n=t.toLowerCase();c.find(function(e){return e.toLowerCase()===n})?u===Lr.REDACT&&(l[t]=Ur):s.find(function(e){return e.toLowerCase()===n})?l[t]=e[t]:u===Lr.REDACT&&(l[t]=Ur)};try{for(var f=(0,o.Ju)(Object.keys(e)),v=f.next();!v.done;v=f.next()){d(v.value)}}catch(p){n={error:p}}finally{try{v&&!v.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}return l},qr=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,i={type:this.type,method:this.method,url:this.url,timestamp:this.timestamp,status:this.status,duration:this.duration,error:this.error,startTime:this.startTime,endTime:this.endTime,requestHeaders:null===(e=this.requestWrapper)||void 0===e?void 0:e.headers((0,o.fX)([],(0,o.zs)(R.j7),!1)),requestBodySize:null===(t=this.requestWrapper)||void 0===t?void 0:t.bodySize,responseHeaders:null===(n=this.responseWrapper)||void 0===n?void 0:n.headers((0,o.fX)([],(0,o.zs)(R.j7),!1)),responseBodySize:null===(r=this.responseWrapper)||void 0===r?void 0:r.bodySize};return Object.fromEntries(Object.entries(i).filter(function(e){var t=(0,o.zs)(e,2);t[0];return void 0!==t[1]}))},e}();var Fr=function(e,t){void 0===t&&(t=(0,L.k)()),this.callback=e,this.id=t};function zr(e){try{e()}catch(t){}}var Br,Jr,Vr=function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var n=(0,l.m)();e.isSupported()&&(this.globalScope=n)}return e.isSupported=function(){var e=(0,l.m)();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?void 0:n.XMLHttpRequest)||void 0===r?void 0:r.prototype)||void 0===i?void 0:i.open,v=null===(a=null===(s=null===(o=this.globalScope)||void 0===o?void 0:o.XMLHttpRequest)||void 0===s?void 0:s.prototype)||void 0===a?void 0:a.send,p=null===(l=null===(c=null===(u=this.globalScope)||void 0===u?void 0:u.XMLHttpRequest)||void 0===c?void 0:c.prototype)||void 0===l?void 0:l.setRequestHeader;f&&v&&p&&this.observeXhr(f,v,p);var h=null===(d=this.globalScope)||void 0===d?void 0:d.fetch;h&&this.observeFetch(h),this.isObserving=!0}},e.prototype.unsubscribe=function(e){this.eventCallbacks.delete(e.id)},e.prototype.triggerEventCallbacks=function(e){var t=this;this.eventCallbacks.forEach(function(n){try{n.callback(e)}catch(r){zr(function(){var e;null===(e=t.logger)||void 0===e||e.debug("an unexpected error occurred while triggering event callbacks",r)})}})},e.prototype.handleNetworkRequestEvent=function(e,t,n,r,i,o,s){var a;if(void 0!==o&&void 0!==s){var u,c,l,d="GET";if(!function(e){return"object"==typeof e&&null!==e&&"url"in e&&"method"in e}(t)?u=null===(a=null==t?void 0:t.toString)||void 0===a?void 0:a.call(t):(u=t.url,d=t.method),u)try{var f=new URL(u);u="".concat(f.protocol,"//").concat(f.host).concat(f.pathname).concat(f.search).concat(f.hash)}catch(g){}d=(null==n?void 0:n.method)||d,r&&(c=r.status),i&&(l={name:i.name||"UnknownError",message:i.message||"An unknown error occurred"},c=0);var v=Math.floor(performance.now()-s),p=Math.floor(o+v),h=new qr(e,d,o,o,u,n,c,v,r,l,p);this.triggerEventCallbacks(h)}},e.prototype.getTimestamps=function(){var e,t;return{startTime:null===(e=Date.now)||void 0===e?void 0:e.call(Date),durationStart:null===(t=null===performance||void 0===performance?void 0:performance.now)||void 0===t?void 0:t.call(performance)}},e.prototype.observeFetch=function(e){var t=this;this.globalScope&&e&&(this.globalScope.fetch=function(n,r){return(0,o.sH)(t,void 0,void 0,function(){var t,i,s,a,u=this;return(0,o.YH)(this,function(o){switch(o.label){case 0:try{t=this.getTimestamps()}catch(c){zr(function(){var e;return null===(e=u.logger)||void 0===e?void 0:e.debug("an unexpected error occurred while retrieving timestamps",c)})}o.label=1;case 1:return o.trys.push([1,3,,4]),[4,e(n,r)];case 2:return i=o.sent(),[3,4];case 3:return a=o.sent(),s=a,[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",n,r?new Rr(r):void 0,i?new 
1Nr(i):void 0,s,null==t?void 0:t.startTime,null==t?void 0:t.durationStart)}catch(l){zr(function(){var e;return null===(e=u.logger)||void 0===e?void 0:e.debug("an unexpected error occurred while handling fetch",l)})}if(i)return[2,i];throw s}})})})},e.createXhrJsonParser=function(e,t){return function(){var n;try{if("json"===e.responseType){if(null===(n=t.globalScope)||void 0===n?void 0:n.structuredClone)return t.globalScope.structuredClone(e.response)}else if(["text",""].includes(e.responseType))return JSON.parse(e.responseText)}catch(r){return r instanceof Error&&"InvalidStateError"===r.name&&zr(function(){var n;return null===(n=t.logger)||void 0===n?void 0:n.debug("unexpected error when retrieving responseText. responseType='".concat(e.responseType,"'"))}),null}return null}},e.prototype.observeXhr=function(t,n,r){if(this.globalScope&&t&&n){var i=this.globalScope.XMLHttpRequest.prototype,s=this;i.open=function(){for(var e,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=(0,o.zs)(n,2),a=i[0],u=i[1];try{this.$$AmplitudeAnalyticsEvent=(0,o.Cl)({method:a,url:null===(e=null==u?void 0:u.toString)||void 0===e?void 0:e.call(u),headers:{}},s.getTimestamps())}catch(c){zr(function(){var e;return null===(e=s.logger)||void 0===e?void 0:e.debug("an unexpected error occurred while calling xhr open",c)})}return t.apply(this,n)},i.send=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=this,o=e.createXhrJsonParser(this,s),a=t[0],u=i.$$AmplitudeAnalyticsEvent;return i.$$AmplitudeAnalyticsEvent&&i.addEventListener("loadend",function(){try{var e=i.getAllResponseHeaders(),t=i.getResponseHeader("content-length"),n=new Mr(i.status,e,t?parseInt(t,10):void 0,o),r=i.$$AmplitudeAnalyticsEvent.headers,c=new Hr(a,r);u.status=i.status,s.handleNetworkRequestEvent("xhr",{url:u.url,method:u.method},c,n,void 0,u.startTime,u.durationStart)}catch(l){zr(function(){var e;return null===(e=s.logger)||void 0===e?void 0:e.debug("an unexpected error occurred while handling xhr send",l)})}}),n.apply(i,t)},i.setRequestHeader=function(e,t){try{var n=this.$$AmplitudeAnalyticsEvent;n&&(n.headers[e]=t)}catch(i){zr(function(){var e;return null===(e=s.logger)||void 0===e?void 0:e.debug("an unexpected error occurred while calling xhr setRequestHeader",i)})}r.apply(this,[e,t])}}},e}(),Wr=new Vr,Xr="[Amplitude] Network Request",$r="500-599";function Kr(e,t){var n="^"+t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$";return new RegExp(n).test(e)}function Gr(e,t){var n,r,i=t.split(",");try{for(var s=(0,o.Ju)(i),a=s.next();!a.done;a=s.next()){var u=a.value,c=(0,o.zs)(u.split("-").map(Number),2),l=c[0],d=c[1];if(e===l&&void 0===d)return!0;if(e>=l&&e<=d)return!0}}catch(f){n={error:f}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return!1}function Qr(e){var t;if(e)try{var n=null===(t=(0,l.m)())||void 0===t?void 0:t.location.href,r=new URL(e,n),i=r.searchParams.toString(),o=r.hash.replace("#",""),s=r.href,a=r.host;return r.hash="",r.search="",{query:i,fragment:o,href:s,hrefWithoutQueryOrHash:r.href,host:a}}catch(u){try{return function(e){var t,n=e.indexOf("#"),r=n>=0?e.slice(n+1):"",i=n>=0?e.slice(0,n):e,o=i.indexOf("?"),s=o>=0?i.slice(o+1):"",a=o>=0?i.slice(0,o):i,u=a.match(/^[a-z][a-z0-9+.-]*:\/\/([^/?#]+)/i);return{query:s,fragment:r,href:e,hrefWithoutQueryOrHash:a,host:null!==(t=null==u?void 0:u[1])&&void 0!==t?t:""}}(e)}catch(c){return}}}function Zr(e){if("object"==typeof e&&null!==e){if(0!==e.length)return e}else{if(e)return(0,o.fX)([],(0,o.zs)(R.j7),!1);if(void 0===e){return}}}function ei(e){var t,n,r;return!(null===(t=null==e?void 0:e.allowlist)||void 0===t?void 0:t.length)&&!(null===(n=null==e?void 0:e.blocklist)||void 0===n?void 0:n.length)&&!(null===(r=null==e?void 0:e.excludelist)||void 0===r?void 0:r.length)}function ti(e,t){var n;void 0===t&&(t={});var r=Qr(e.url);if(!r)return!1;var i,s=r.host;if(!1!==t.ignoreAmplitudeRequests&&(Kr(s,"*.amplitude.com")||Kr(s,"amplitude.com")))return!1;if(null===(n=t.ignoreHosts)||void 0===n?void 0:n.find(function(e){return Kr(s,e)}))return!1;if(!t.captureRules&&void 0!==e.status&&!Gr(e.status,$r))return!1;if(t.captureRules&&((0,o.fX)([],(0,o.zs)(t.captureRules),!1).reverse().find(function(t){if(i=function(e,t,n,r,i){if((!e.hosts||e.hosts.find(function(e){return Kr(t,e)}))&&(!r||!e.urls||on(r,e.urls))&&(!i||!e.methods||e.methods.find(function(e){return i.toLowerCase()===e.toLowerCase()||"*"===e})))return!((n||0===n)&&!Gr(n,e.statusCodeRange||$r))}(t,s,e.status,e.url,e.method),i){var n=Zr(t.responseHeaders);if(e.responseWrapper&&n){var r=e.responseWrapper.headers(n);r&&(e.responseHeaders=r)}var o=Zr(t.requestHeaders);if(e.requestWrapper&&o){var a=e.requestWrapper.headers(o);a&&(e.requestHeaders=a)}if(e.responseWrapper&&t.responseBody&&!ei(t.responseBody)){var u=t.responseBody.excludelist||t.responseBody.blocklist;e.responseBodyJson=e.responseWrapper.json(t.responseBody.allowlist,u)}if(e.requestWrapper&&t.requestBody&&!ei(t.requestBody)){u=t.requestBody.excludelist||t.requestBody.blocklist;e.requestBodyJson=e.requestWrapper.json(t.requestBody.allowlist,u)}}return void 0!==i}),!i))return!1;return!e.requestWrapper||!function(e,t){if(e.includes("amplitude.com"))try{var n=t.body;if("string"!=typeof n)return!1;if(JSON.parse(n).events.find(function(e){return e.event_type===Xr}))return!0}catch(ii){}return!1}(s,e.requestWrapper)}function ni(e){var t=e.allObservables,n=e.networkTrackingOptions,r=e.amplitude,i=e.loggerProvider;return t.networkObservable.filter(function(e){return ti(e.event,n)}).subscribe(function(e){var t,n,s,a=e.event,u=Qr(a.url);if(u){var c=null===(n=a.responseWrapper)||void 0===n?void 0:n.bodySize,l=null===(s=a.requestWrapper)||void 0===s?void 0:s.bodySize;!function(e,t,n,r){(0,o.sH)(this,void 0,void 0,function(){var i,s,a;return(0,o.YH)(this,function(u){switch(u.label){case 0:return t.requestBodyJson||t.responseBodyJson?[4,Promise.all([t.requestBodyJson,t.responseBodyJson])]:[3,2];case 1:if(i=o.zs.apply(void 0,[u.sent(),2]),s=i[0],a=i[1],s)try{e["[Amplitude] Request Body"]=JSON.stringify(s)}catch(ii){null==r||r.debug("Failed to stringify request body",ii)}if(a)try{e["[Amplitude] Response Body"]=JSON.stringify(a)}catch(ii){null==r||r.debug("Failed to stringify response body")}u.label=2;case 2:return null==n||n.track(Xr,e),[2]}})})}(((t={}
vendor: 11,809 bytes, line 1
1)["[Amplitude] URL"]=u.hrefWithoutQueryOrHash,t["[Amplitude] URL Query"]=u.query,t["[Amplitude] URL Fragment"]=u.fragment,t["[Amplitude] Request Method"]=a.method,t["[Amplitude] Status Code"]=a.status,t["[Amplitude] Start Time"]=a.startTime,t["[Amplitude] Completion Time"]=a.endTime,t["[Amplitude] Duration"]=a.duration,t["[Amplitude] Request Body Size"]=l,t["[Amplitude] Response Body Size"]=c,t["[Amplitude] Request Type"]=a.type,t["[Amplitude] Request Headers"]=a.requestHeaders,t["[Amplitude] Response Headers"]=a.responseHeaders,t),a,r,i)}})}!function(e){e.NetworkObservable="networkObservable"}(Br||(Br={}));var ri=function(e){void 0===e&&(e={});var t,n="@amplitude/plugin-network-capture-browser",r=function(){var e,n=new(Ft())(function(e){var n=new Fr(function(t){var n=function(e,t){return{event:e,timestamp:Date.now(),type:t}}(t,"network");e.next(n)});return Wr.subscribe(n,t),function(){Wr.unsubscribe(n)}});return(e={})[Br.NetworkObservable]=n,e};return{name:n,type:"enrichment",setup:function(i,s){return(0,o.sH)(void 0,void 0,void 0,function(){var a;return(0,o.YH)(this,function(o){return"undefined"!=typeof document||function(){var e,t=(0,l.m)();return"ReactNative"===(null===(e=null==t?void 0:t.navigator)||void 0===e?void 0:e.product)}()?(a=r(),t=null==i?void 0:i.loggerProvider,Jr=ni({allObservables:a,networkTrackingOptions:e,amplitude:s,loggerProvider:t}),null==t||t.log("".concat(n," has been successfully added.")),[2]):[2]})})},execute:function(e){return(0,o.sH)(void 0,void 0,void 0,function(){return(0,o.YH)(this,function(t){return[2,e]})})},teardown:function(){return(0,o.sH)(void 0,void 0,void 0,function(){return(0,o.YH)(this,function(e){return Jr.unsubscribe(),[2]})})}}};let ii=-1;const oi=e=>{addEventListener("pageshow",t=>{t.persisted&&(ii=t.timeStamp,e(t))},!0)},si=(e,t,n,r)=>{let i,o;return s=>{t.value>=0&&(s||r)&&(o=t.value-(i??0),(o||void 0===i)&&(i=t.value,t.delta=o,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,n),e(t)))}},ai=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},ui=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},ci=()=>{const e=ui();return e?.activationStart??0},li=(e,t=-1)=>{const n=ui();let r="navigate";return ii>=0?r="back-forward-cache":n&&(document.prerendering||ci()>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(8999999999999*Math.random())+1e12}`,navigationType:r}},di=new WeakMap;function fi(e,t){return di.get(e)||di.set(e,new t),di.get(e)}class vi{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}}const pi=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},hi=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let gi=-1;const mi=new Set,yi=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,bi=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of mi)e();isFinite(gi)||(gi="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",bi,!0))}},wi=()=>{if(gi<0){const e=ci(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>"hidden"===t.name&&t.startTime>e)[0]?.startTime;gi=t??yi(),addEventListener("visibilitychange",bi,!0),addEventListener("prerenderingchange",bi,!0),oi(()=>{setTimeout(()=>{gi=yi()})})}return{get firstHiddenTime(){return gi},onHidden(e){mi.add(e)}}},Ei=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},Si=[1800,3e3],ki=(e,t={})=>{Ei(()=>{const n=wi();let r,i=li("FCP");const o=pi("paint",e=>{for(const t of e)"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-ci(),0),i.entries.push(t),r(!0)))});o&&(r=si(e,i,Si,t.reportAllChanges),oi(n=>{i=li("FCP"),r=si(e,i,Si,t.reportAllChanges),ai(()=>{i.value=performance.now()-n.timeStamp,r(!0)})}))})},Ti=[.1,.25];let Ci=0,Ai=1/0,xi=0;const Ii=e=>{for(const t of e)t.interactionId&&(Ai=Math.min(Ai,t.interactionId),xi=Math.max(xi,t.interactionId),Ci=xi?(xi-Ai)/7+1:0)};let Pi;const Oi=()=>Pi?Ci:performance.interactionCount??0;let _i=0;class Ri{u=[];l=new Map;m;p;v(){_i=Oi(),this.u.length=0,this.l.clear()}L(){const e=Math.min(this.u.length-1,Math.floor((Oi()-_i)/50));return this.u[e]}h(e){if(this.m?.(e),!e.interactionId&&"first-input"!==e.entryType)return;const t=this.u.at(-1);let n=this.l.get(e.interactionId);if(n||this.u.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.l.set(n.id,n),this.u.push(n)),this.u.sort((e,t)=>t.P-e.P),this.u.length>10){const e=this.u.splice(10);for(const t of e)this.l.delete(t.id)}this.p?.(n)}}}const Hi=e=>{const t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=hi(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t(()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})}))},Di=[200,500],Li=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=wi();Ei(()=>{"interactionCount"in performance||Pi||(Pi=pi("event",Ii,{type:"event",buffered:!0,durationThreshold:0}));let r,i=li("INP");const o=fi(t,Ri),s=e=>{Hi(()=>{for(const n of e)o.h(n);const t=o.L();t&&t.P!==i.value&&(i.value=t.P,i.entries=t.entries,r())})},a=pi("event",s,{durationThreshold:t.durationThreshold??40});r=si(e,i,Di,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{s(a.takeRecords()),r(!0)}),oi(()=>{o.v(),i=li("INP"),r=si(e,i,Di,t.reportAllChanges)}))})};class Ni{m;h(e){this.m?.(e)}}const Mi=[2500,4e3],ji=[800,1800],Ui=e=>{document.prerendering?Ei(()=>Ui(e)):"complete"!==document.readyState?addEventListener("load",()=>Ui(e),!0):setTimeout(e)};function Yi(e){var t,n=(null===(t=e.entries[0])||void 0===t?void 0:t.startTime)||0;return performance.timeOrigin+n}function qi(e){return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor(Yi(e)),navigationStart:Math.floor(performance.timeOrigin)}}var Fi,zi=function(){var e=null,t=(0,l.m)(),n=null==t?void 0:t.document,r=null==t?void 0:t.location;return{name:"web-vitals-browser",type:"enrichment",setup:function(t,i){return(0,o.sH)(void 0,void 0,void 0,function(){var s,a;return(0,o.YH)(this,function(o){return void 0===n||(s=sn((null==r?void 0:r.href)||"",t.loggerProvider),a={"[Amplitude] Page Domain":(null==r?void 0:r.hostname)||"","[Amplitude] Page Location":s,"[Amplitude] Page Path":sn((null==r?void 0:r.pathname)||"",t.loggerProvider),"[Amplitude] Page Title":"undefined"!=typeof document&&document.title||"","[Amplitude] Page URL":sn(s.split("?")[0],t.loggerProvider)},((e,t={})=>{Ei(()=>{const n=wi();let r,i=li("LCP");const o=fi(t,Ni),s=e=>{t.reportAllChanges||(e=e.slice(-1));for(const t of e)o.h(t),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-ci(),0),i.entries=[t],r())},a=pi("largest-contentful-paint",s);if(a){r=si(e,i,Mi,t.reportAllChanges);const n=hi(()=>{s(a.takeRecords()),a.disconnect(),r(!0)}),o=e=>{e.isTrusted&&(Hi(n),removeEventListener(e.type,o,{capture:!0}))};for(const e of["keydown","click","visibilitychange"])addEventListener(e,o,{capture:!0});oi(n=>{i=li("LCP"),r=si(e,i,Mi,t.reportAllChanges),ai(()=>{i.value=performance.now()-n.timeStamp,r(!0)})})}})})(function(e){a["[Amplitude] LCP"]=qi(e)}),ki(function(e){a["[Amplitude] FCP"]=qi(e)}),Li(function(e){a["[Amplitude] INP"]=qi(e)}),((e,t={})=>{const n=wi();ki(hi(()=>{let r,i=li("CLS",0);const o=fi(t,vi),s=e=>{for(const t of e)o.h(t);o.i>i.value&&(i.value=o.i,i.entries=o.o,r())},a=pi("layout-shift",s);a&&(r=si(e,i,Ti,t.reportAllChanges),n.onHidden(()=>{s(a.takeRecords()),r(!0)}),oi(()=>{o.i=0,i=li("CLS",0),r=si(e,i,Ti,t.reportAllChanges),ai(()=>r())}),setTimeout(r))}))})(function(e){a["[Amplitude] CLS"]=qi(e)}),((e,t={})=>{let n=li("TTFB"),r=si(e,n,ji,t.reportAllChanges);Ui(()=>{const i=ui();i&&(n.value=Math.max(i.responseStart-ci(),0),n.entries=[i],r(!0),oi(()=>{n=li("TTFB",0),r=si(e,n,ji,t.reportAllChanges),r(!0)}))})})(function(e){a["[Amplitude] TTFB"]=qi(e)}),e=function(){"hidden"===n.visibilityState&&e&&(i.track("[Amplitude] Web Vitals",a),n.removeEventListener("visibilitychange",e),e=null)},n.addEventListener("visibilitychange",e)),[2]})})},execute:function(e){return(0,o.sH)(void 0,void 0,void 0,function(){return(0,o.YH)(this,function(t){return[2,e]})})},teardown:function(){return(0,o.sH)(void 0,void 0,void 0,function(){return(0,o.YH)(this,function(t){return e&&(null==n||n.removeEventListener("visibilitychange",e)),[2]})})}}},Bi=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),[R.r,t,e.substring(0,n)].filter(Boolean).join("_")},Ji=function(){function e(e,t){var n,r,i;this.shouldTrackNewCampaign=!1,this.options=(0,o.Cl)({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:(r=(null===(n=t.cookieOptions)||void 0===n?void 0:n.domain)||t.topLevelDomain,i=r,i?(i.startsWith(".")&&(i=i.substring(1)),[new RegExp("".concat(i.replace(".","\\."),"$"))]):[]),optOut:t.optOut},e),this.storage=t.cookieStorage,this.storageKey=Bi(t.apiKey,"MKTG"),this.webExpStorageKey=Bi(t.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=R.F3,this.sessionTimeout=t.sessionTimeout,this.lastEventTime=t.lastEventTime,this.logger=t.loggerProvider,this.topLevelDomain=t.topLevelDomain,t.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return(0,o.sH)(this,void 0,void 0,function(){var e,t;return(0,o.YH)(this,function(n){switch(n.label){case 0:return this.options.optOut?[2]:[4,this.fetchCampaign()];case 1:return t=o.zs.apply(void 0,[n.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||K(this.sessionTimeout,this.lastEventTime),rt(this.currentCampaign,this.previousCampaign,this.options,this.logger,e,this.topLevelDomain)?(this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)]):[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}})})},e.prototype.fetchCampaign=function(){return(0,o.sH)(this,void 0,void 0,function(){var e;return(0,o.YH)(this,function(t){switch(t.label){case 0:return[4,this.storage.get(this.webExpStorageKey)];case 1:return(e=t.sent())?[4,this.storage.remove(this.webExpStorageKey)]:[3,3];case 2:t.sent(),t.label=3;case 3:return[4,Promise.all([e||(new kt).parse(),this.storage.get(this.storageKey)])];case 4:return[2,t.sent()]}})})},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var t,n,r,i,s=(t=this.currentCampaign,n=this.options,r=(0,o.Cl)((0,o.Cl)({},R.F3),t),i=Object.entries(r).reduce(function(e,t){var r,i=(0,o.zs)(t,2),s=i[0],a=i[1];return e.setOnce("initial_".concat(s),null!==(r=null!=a?a:n.initialEmptyValue)&&void 0!==r?r:"EMPTY"),a?e.set(s,a):e.unset(s)},new B),X(i));return e&&(s.event_id=e),s},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),Vi=new Set([W.S.IDENTIFY,W.S.GROUP_IDENTIFY]),Wi=function(e){var t;void 0===e&&(e={});var n,r,i,s,a,u,c=null!==(t=e.fallbackAttributionEvent)&&void 0!==t&&t,d=(0,l.m)(),f={},v=!1,p=!1,h=function(){return(0,o.sH)(void 0,void 0,void 0,function(){var e;return(0,o.YH)(this,function(t){switch(t.label){case 0:return[4,(ne
1w kt).parse()];case 1:return e=t.sent(),f=St(e),c&&(null==r||r.log("Tracking attribution fallback event."),null==n||n.track("[Amplitude] Attribution",f)),[2]}})})},g=function(){h()},m=function(e){return new Proxy(e,{apply:function(e,t,n){Reflect.apply(e,t,n),v&&g()}})};return{name:"@amplitude/plugin-event-property-attribution-browser",type:"enrichment",setup:function(e,t){return(0,o.sH)(void 0,void 0,void 0,function(){return(0,o.YH)(this,function(o){switch(o.label){case 0:return n=t,r=e.loggerProvider,v=!0,r.log("Installing event property attribution tracking."),[4,h()];case 1:if(o.sent(),!d)return[2];if(d.addEventListener("popstate",g),!p){if(i=Reflect.get(d.history,"pushState"),s=Reflect.get(d.history,"replaceState"),!i||!s)return[2];a=m(i),d.history.pushState=a,u=m(s),d.history.replaceState=u,p=!0}return[2]}})})},execute:function(e){return(0,o.sH)(void 0,void 0,void 0,function(){return(0,o.YH)(this,function(t){return Vi.has(e.event_type)||(e.event_properties=(0,o.Cl)((0,o.Cl)({},f),e.event_properties)),[2,e]})})},teardown:function(){return(0,o.sH)(void 0,void 0,void 0,function(){var e,t;return(0,o.YH)(this,function(n){return d&&(d.removeEventListener("popstate",g),e=Reflect.get(d.history,"pushState"),t=Reflect.get(d.history,"replaceState"),p&&e===a&&i&&(d.history.pushState=i),p&&t===u&&s&&(d.history.replaceState=s)),v=!1,p=!1,i=void 0,s=void 0,a=void 0,u=void 0,f={},[2]})})}}},Xi="AMP_CURRENT_PAGE",$i="AMP_PREVIOUS_PAGE",Ki="AMP_URL_INFO";!function(e){e.Direct="direct",e.Internal="internal",e.External="external"}(Fi||(Fi={}));var Gi=new Set([W.S.IDENTIFY,W.S.GROUP_IDENTIFY,W.S.REVENUE]),Qi=function(e){var t=(void 0===e?{}:e).internalDomains,n=void 0===t?[]:t,r=(0,l.m)(),i=void 0,s=!1,a=void 0,u=!1,c=!1,d=function(e){var t;try{var n=sn(e,a);t=new URL(n).hostname}catch(ii){null==a||a.error("Could not parse URL: ",ii)}return t},f=function(e){var t="undefined"!=typeof location&&location.hostname||"",r=e?d(e):void 0;if(!r)return Fi.Direct;var i=n.some(function(e){return-1!==t.indexOf(e)}),o=n.some(function(e){return-1!==r.indexOf(e)});return t===r||o&&i?Fi.Internal:Fi.External},v=function(){return(0,o.sH)(void 0,void 0,void 0,function(){var e,t,n,r,a;return(0,o.YH)(this,function(o){switch(o.label){case 0:return i&&s?[4,i.get(Ki)]:[3,3];case 1:return e=o.sent(),t=sn("undefined"!=typeof location&&location.href||""),n=(null==e?void 0:e[Xi])||"",r=void 0,r=t===n?(null==e?void 0:e[$i])||"":n||(document.referrer||""),[4,i.set(Ki,(a={},a[Xi]=t,a[$i]=r,a))];case 2:o.sent(),o.label=3;case 3:return[2]}})})},p=function(){v()},h={name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(e,t){return(0,o.sH)(void 0,void 0,void 0,function(){var t,n,l,f,h,g,m,y;return(0,o.YH)(this,function(b){switch(b.label){case 0:if((a=e.loggerProvider).log("Installing @amplitude/plugin-page-url-enrichment-browser"),c=!0,!r)return[3,7];try{i=new xe(r.sessionStorage)}catch(w){null==a||a.debug("sessionStorage is not available in this environment.")}return[4,null==i?void 0:i.isEnabled()];case 1:return s=null!==(y=b.sent())&&void 0!==y&&y,i&&s?(t="undefined"!=typeof document&&document.referrer||"",n=t?d(t):void 0,l="undefined"!=typeof location&&location.hostname||"",f=sn("undefined"!=typeof location&&location.href||""),[4,i.get(Ki)]):[3,6];case 2:return h=b.sent(),g=(null==h?void 0:h[Xi])||"",!!n&&n!==l&&g!==f?[4,i.set(Ki,(m={},m[Xi]=f,m[$i]=t,m))]:[3,4];case 3:return b.sent(),[3,6];case 4:return[4,v()];case 5:b.sent(),b.label=6;case 6:r.addEventListener("popstate",p),u||(r.history.pushState=new Proxy(r.history.pushState,{apply:function(e,t,n){var r=(0,o.zs)(n,3),i=r[0],s=r[1],a=r[2];e.apply(t,[i,s,a]),c&&p()}}),r.history.replaceState=new Proxy(r.history.replaceState,{apply:function(e,t,n){var r=(0,o.zs)(n,3),i=r[0],s=r[1],a=r[2];e.apply(t,[i,s,a]),c&&p()}}),u=!0),b.label=7;case 7:return[2]}})})},execute:function(e){return(0,o.sH)(void 0,void 0,void 0,function(){var t,n,r;return(0,o.YH)(this,function(a){switch(a.label){case 0:return t=sn("undefined"!=typeof location&&location.href||""),i&&s?[4,i.get(Ki)]:[3,2];case 1:if(n=a.sent(),r=(null==n?void 0:n[$i])||"",Gi.has(e.event_type))return[2,e];e.event_properties=(0,o.Cl)((0,o.Cl)({},e.event_properties||{}),{"[Amplitude] Page Domain":Zi(e,"[Amplitude] Page Domain","undefined"!=typeof location&&location.hostname||""),"[Amplitude] Page Location":Zi(e,"[Amplitude] Page Location",t),"[Amplitude] Page Path":Zi(e,"[Amplitude] Page Path","undefined"!=typeof location&&sn(location.pathname)||""),"[Amplitude] Page Title":Zi(e,"[Amplitude] Page Title",Et(wt)),"[Amplitude] Page URL":Zi(e,"[Amplitude] Page URL",t.split("?")[0]),"[Amplitude] Previous Page Location":r,"[Amplitude] Previous Page Type":f(r)}),a.label=2;case 2:return[2,e]}})})},teardown:function(){return(0,o.sH)(void 0,void 0,void 0,function(){return(0,o.YH)(this,function(e){switch(e.label){case 0:return r&&(r.removeEventListener("popstate",p),c=!1),i&&s?[4,i.set(Ki,{})]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})}};return h};function Zi(e,t,n){return e.event_properties||(e.event_properties={}),void 0===e.event_properties[t]?n:e.event_properties[t]}var eo=function(){var e,t,n;function r(t){if(t)try{var n=new Function("return "+t)();if("function"==typeof n)return n;null==e||e.error("Custom enrichment body did not evaluate to a function")}catch(r){null==e||e.error("Could not create custom enrichment function",r)}return function(e){return e}}var i={name:"@amplitude/plugin-custom-enrichment-browser",type:"enrichment",setup:function(i,s){return(0,o.sH)(void 0,void 0,void 0,function(){var s,a;return(0,o.YH)(this,function(o){return null==(e=i.loggerProvider)||e.log("Installing @amplitude/plugin-custom-enrichment-browser"),(null===(a=i.remoteConfig)||void 0===a?void 0:a.fetchRemoteConfig)&&(i.remoteConfigClient?(s=i.remoteConfigClient.subscribe("configs.analyticsSDK.browserSDK.customEnrichment","all",function(e){n=e&&function(e){return"object"==typeof e&&null!==e&&"body"in e&&"string"==typeof e.body}(e)?r(e.body||""):r("")}),t=function(){var e;return null===(e=i.remoteConfigClient)||void 0===e?void 0:e.unsubscribe(s)}):null==e||e.debug("Remote config client is not provided, skipping remote config fetch")),[2]})})},execute:function(t){return(0,o.sH)(void 0,void 0,void 0,function(){var r;return(0,o.YH)(this,function(i){if(n)try{return[2,null!==(r=n(t))&&void 0!==r?r:null]}catch(o){return null==e||e.error("Could not execute custom enrichment function",o),[2,t]}return[2,t]})})},teardown:function(){return(0,o.sH)(void 0,void 0,void 0,function(){return(0,o.YH)(this,function(e){return t&&t(),[2]})})}};return i},to="userProperty",no="eventProperty",ro=function(e){return e===to||e===no},io=[to,no],oo=function(e,t){return function(e){var t=(0,o.fX)([],(0,o.zs)(new Set((Array.isArray(e)?e:[e]).filter(ro))),!1);return t.length>0?t:(0,o.fX)([],(0,o.zs)(io),!1)}(e.trackingMethod).includes(t)},so=function(e){return oo(e,to)},ao=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._diagnosticsSampleRate=0,t}return(0,o.C6)(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),(0,s.m)(this._init((0,o.Cl)((0,o.Cl)({},i),{userId:r,apiKey:e})))},t.prototype._init=function(t){var n,r,i,s,l,d,f,v;return(0,o.sH)(this,void 0,void 0,function(){var p,h,g,m,y,b,w,E,S,k,T,C,I,_,R,H=this;return(0,o.YH)(this,function(D){switch(D.label){case 0:return this.initializing?[2]:(this.initializing=!0,p=function(e){var t,n;return void 0===e&&(e={}),!0===(null===(t=e.remoteConfig)||void 0===t?void 0:t.fetchRemoteConfig)||!1!==(null===(n=e.remoteConfig)||void 0===n?void 0:n.fetchRemoteConfig)&&!1!==e.fetchRemoteConfig}(t),h=null!==(n=t.loggerProvider)&&void 0!==n?n:new a.V,t.loggerProvider||h.enable(null!==(r=t.logLevel)&&void 0!==r?r:u.$.Warn),g=null!==(i=t.serverZone)&&void 0!==i?i:"US",y=this._diagnosticsSampleRate,b=null===(s=t.enableDiagnostics)||void 0===s||s,p?(m=new c.IQ(t.apiKey,h,g,null===(l=t.remoteConfig)||void 0===l?void 0:l.serverUrl),[4,new Promise(function(e){null==m||m.subscribe("configs.diagnostics.browserSDK","all",function(t,n,r){if(h.debug("Diagnostics remote configuration received:",JSON.stringify({remoteConfig:t,source:n,lastFetch:r},null,2)),t){var i=t.sampleRate;"number"!=typeof i||isNaN(i)||(y=i);var o=t.enabled;"boolean"==typeof o&&(b=o)}e()})})]):[3,2]);case 1:D.sent(),D.label=2;case 2:return(w=new A(t.apiKey,h,g,{enabled:b,sampleRate:y})).setTag("library","".concat(we,"/").concat(be)),"undefined"!=typeof navigator&&w.setTag("user_agent",navigator.userAgent),[4,dt(t.apiKey,t,this,w,{loggerProvider:h,serverZone:g,enableDiagnostics:b,diagnosticsSampleRate:y})];case 3:return E=D.sent(),p&&m?[4,new Promise(function(e){null==m||m.subscribe("configs.analyticsSDK.browserSDK","all",function(t,n,r){E.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:t,source:n,lastFetch:r},null,2)),t&&Mt(t,E),e()})})]:[3,5];case 4:D.sent(),D.label=5;case 5:return[4,e.prototype._init.call(this,E)];case 6:return D.sent(),this.logBrowserOptions(E),this.config.remoteConfigClient=m,S=function(e){return re(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.attribution&&"object"==typeof e.defaultTracking.attribution?(0,o.Cl)({},e.defaultTracking.attribution):{}}(this.config),re(this.config.defaultTracking)&&so(S)?(this.config.optOut&&this.timeline.addOptOutListener(function(e){return(0,o.sH)(H,void 0,void 0,function(){return(0,o.YH)(this,function(t){switch(t.label){case 0:return e?[3,2]:(this.webAttribution=new Ji(S,this.config),[4,this.webAttribution.init()]);case 1:t.sent(),t.label=2;case 2:return[2]}})})}),this.webAttribution=new Ji(S,this.config),[4,this.webAttribution.init()]):[3,8];case 7:D.sent(),D.label=8;case 8:return k=x(),T=k.ampTimestamp?Number(k.ampTimestamp):void 0,C=!T||Date.now()<T,I=C&&!Number.isNaN(Number(k.ampSessionId))?Number(k.ampSessionId):void 0,-1!==(_=this.config.deferredSessionId)||this.config.optOut||(_=Date.now()),this.setSessionId(null!==(v=null!==(f=null!==(d=t.sessionId)&&void 0!==d?d:I)&&void 0!==f?f:_)&&void 0!==v?v:this.config.sessionId),this.config.optOut&&this.timeline.addOptOutListener(function(e){return(0,o.sH)(H,void 0,void 0,function(){return(0,o.YH)(this,function(t){return!e&&this.config.deferredSessionId&&(-1===this.config.deferredSessionId?this.setSessionId(void 0):this.setSessionId(this.config.deferredSessionId)),[2]})})}),(R=(0,P.w$)(t.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),this.config.offline===O?[3,10]:[4,this.add(Dt()).promise];case 9:D.sent(),D.label=10;case 10:return[4,this.add(new Y({diagnosticsClient:w})).promise];case 11:return D.sent(),[4,this.add(new Ee).promise];case 12:return D.sent(),[4,this.add(new q).promise];case 13:return D.sent(),function(e){Ht||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."),Ht=!0)}(this.config),N=this.config.defaultTracking,ne(N,"fileDownloads")?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(Rt()).promise]):[3,15];case 14:D.sent(),D.label=15;case 15:return ie(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(Pt()).promise]):[3,17];case 16:D.sent(),D.label=17;case 17:return oe(this.config.defaultTracking)?this.config.optOut?[3,19]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(Ct(pe(this.config))).promise]):[3,20];case 18:return D.sent(),[3,20];case 19:this.timeline.addOptOutListener(function(e){return(0,o.sH)(H,void 0,void 0,function(){return(0,o.YH)(this,function(t){switch(t.label){case 0:return e?[2]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(Ct(pe(this.config))).promise]);case 1:return t.sent(),[2]}})})}),D.label=20;case 20:return re(this.config.defaultTracking)&&function(e){return oo(e,no)}(S)?(this.config.loggerProvider.debug("Adding event property attribution plugin"),[4,this.add(Wi(S)).promise]):[3,22];case 21:D.sent(),D.label=22;case 22:return ue(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(ar(de(this.config),{diagnosticsClient:w})).promise]):[3,24];case 23:D.sent(),D.label=24;case 24:return ce(this.config.autocapture)?(this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(Cr(fe(this.config))).promise]):[3,26];
1case 25:D.sent(),D.label=26;case 26:return ae(this.config.autocapture)?(this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(ri(ve(this.config))).promise]):[3,28];case 27:D.sent(),D.label=28;case 28:return function(e){return"boolean"==typeof e?e:"object"==typeof e&&!0===e.webVitals}(this.config.autocapture)?(this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(zi()).promise]):[3,30];case 29:D.sent(),D.label=30;case 30:return function(e){return"object"==typeof e&&(!0===e.performanceTracking||"object"==typeof e.performanceTracking)}(this.config.autocapture)?(this.config.loggerProvider.debug("Adding performance tracking plugin"),[4,this.add(Or(le(this.config))).promise]):[3,32];case 31:D.sent(),D.label=32;case 32:return function(e){return ne(e,"pageUrlEnrichment")}(this.config.autocapture)?(this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(Qi()).promise]):[3,34];case 33:D.sent(),D.label=34;case 34:return("boolean"==typeof(L=this.config.customEnrichment)?L:"object"==typeof L&&null!==L&&!1!==L.enabled)?(this.config.loggerProvider.debug("Adding custom enrichment plugin"),[4,this.add(eo()).promise]):[3,36];case 35:D.sent(),D.label=36;case 36:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 37:return D.sent(),R.eventBridge.setEventReceiver(function(e){var t=e.eventProperties||{},n=t.time,r=(0,o.Tt)(t,["time"]),i="number"==typeof n?{time:n}:void 0;H.track(e.eventType,r,i)}),[2]}var L,N})})},t.prototype.getUserId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.userId},t.prototype.setUserId=function(e){this.config?(this.config.loggerProvider.debug("function setUserId: ",e),e===this.config.userId&&void 0!==e||(this.config.userId=e,this.timeline.onIdentityChanged({userId:e}),(0,P.yo)(e,this.config.instanceName))):this.q.push(this.setUserId.bind(this,e))},t.prototype.getDeviceId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.deviceId},t.prototype.setDeviceId=function(e){this.config?(this.config.loggerProvider.debug("function setDeviceId: ",e),e!==this.config.deviceId&&(this.config.deviceId=e,this.timeline.onIdentityChanged({deviceId:e}),(0,P.rb)(e,this.config.instanceName))):this.q.push(this.setDeviceId.bind(this,e))},t.prototype.reset=function(){this.setDeviceId((0,L.k)()),this.setUserId(void 0),this.timeline.onReset()},t.prototype.getIdentity=function(){var e,t;return{deviceId:null===(e=this.config)||void 0===e?void 0:e.deviceId,userId:null===(t=this.config)||void 0===t?void 0:t.userId,userProperties:this.userProperties}},t.prototype.setIdentity=function(e){var t,n,r;if("userId"in e&&this.setUserId(e.userId),"deviceId"in e&&e.deviceId&&this.setDeviceId(e.deviceId),"userProperties"in e){this.userProperties=e.userProperties;var i=new B,s=null!==(r=e.userProperties)&&void 0!==r?r:{};try{for(var a=(0,o.Ju)(Object.entries(s)),u=a.next();!u.done;u=a.next()){var c=(0,o.zs)(u.value,2),l=c[0],d=c[1];i.set(l,d)}}catch(f){t={error:f}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}this.identify(i)}},t.prototype.getOptOut=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.optOut},t.prototype.getSessionId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.sessionId},t.prototype.setSessionId=function(e){var t,n=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,e)),(0,s.m)(Promise.resolve());if(this.config.optOut)return this.config.deferredSessionId=null!=e?e:-1,(0,s.m)(Promise.resolve());if(void 0===e&&(e=Date.now()),e===this.config.sessionId)return(0,s.m)(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",e);var r=this.getSessionId();r!==e&&this.timeline.onSessionIdChanged(e);var i=this.config.lastEventTime,o=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1;this.config.sessionId=e,this.config.lastEventTime=void 0,this.config.pageCounter=0,se(this.config.defaultTracking)&&(r&&i&&n.push(this.track(Je,void 0,{device_id:this.previousSessionDeviceId,event_id:++o,session_id:r,time:i+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var a=this.trackCampaignEventIfNeeded(++o,n);return this.config.identify&&n.push(this.track(X(this.config.identify)).promise),se(this.config.defaultTracking)&&n.push(this.track(Be,void 0,{event_id:a?++o:o,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,(0,s.m)(Promise.all(n))},t.prototype.extendSession=function(){this.config?this.config.lastEventTime=
1Date.now():this.q.push(this.extendSession.bind(this))},t.prototype.setTransport=function(e){this.config?this.config.transportProvider=vt(e):this.q.push(this.setTransport.bind(this,e))},t.prototype.identify=function(t,n){if(me(t)){var r=t._q;t._q=[],t=ge(new B,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(me(r)){var o=r._q;r._q=[],r=ge(new B,o)}return e.prototype.groupIdentify.call(this,t,n,r,i)},t.prototype.revenue=function(t,n){if(me(t)){var r=t._q;t._q=[],t=ge(new $,r)}return e.prototype.revenue.call(this,t,n)},t.prototype.trackCampaignEventIfNeeded=function(e,t){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign||!so(this.webAttribution.options))return!1;var n=this.webAttribution.generateCampaignEvent(e);return t?t.push(this.track(n).promise):this.track(n),this.config.loggerProvider.log("Tracking attribution."),!0},t.prototype.process=function(t){return(0,o.sH)(this,void 0,void 0,function(){var n,r,i;return(0,o.YH)(this,function(o){return n=Date.now(),r=K(this.config.sessionTimeout,this.config.lastEventTime),i=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),t.event_type===Be||t.event_type===Je||t.session_id&&t.session_id!==this.getSessionId()||(r||i?(this.setSessionId(n),i&&this.config.loggerProvider.log("Created a new session for new campaign.")):r||this.trackCampaignEventIfNeeded()),[2,e.prototype.process.call(this,t)]})})},t.prototype.logBrowserOptions=function(e){try{var t=(0,o.Cl)((0,o.Cl)({},e),{apiKey:e.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",Q(t))}catch(ii){this.config.loggerProvider.error("Error logging browser config",ii)}},t.prototype._setDiagnosticsSampleRate=function(e){e>1||e<0||this.config||(this._diagnosticsSampleRate=e)},t}(ee),uo=function(){var e=new ao;return{init:(0,i.nA)(e.init.bind(e),"init",(0,i.WI)(e),(0,i.av)(e,["config"])),add:(0,i.nA)(e.add.bind(e),"add",(0,i.WI)(e),(0,i.av)(e,["config.apiKey","timeline.plugins"])),remove:(0,i.nA)(e.remove.bind(e),"remove",(0,i.WI)(e),(0,i.av)(e,["config.apiKey","timeline.plugins"])),track:(0,i.nA)(e.track.bind(e),"track",(0,i.WI)(e),(0,i.av)(e,["config.apiKey","timeline.queue.length"])),logEvent:(0,i.nA)(e.logEvent.bind(e),"logEvent",(0,i.WI)(e),(0,i.av)(e,["config.apiKey","timeline.queue.length"])),identify:(0,i.nA)(e.identify.bind(e),"identify",(0,i.WI)(e),(0,i.av)(e,["config.apiKey","timeline.queue.length"])),groupIdentify:(0,i.nA)(e.groupIdentify.bind(e),"groupIdentify",(0,i.WI)(e),(0,i.av)(e,["config.apiKey","timeline.queue.length"])),setGroup:(0,i.nA)(e.setGroup.bind(e),"setGroup",(0,i.WI)(e),(0,i.av)(e,["config.apiKey","timeline.queue.length"])),revenue:(0,i.nA)(e.revenue.bind(e),"revenue",(0,i.WI)(e),(0,i.av)(e,["config.apiKey","timeline.queue.length"])),flush:(0,i.nA)(e.flush.bind(e),"flush",(0,i.WI)(e),(0,i.av)(e,["config.apiKey","timeline.queue.length"])),getUserId:(0,i.nA)(e.getUserId.bind(e),"getUserId",(0,i.WI)(e),(0,i.av)(e,["config","config.userId"])),setUserId:(0,i.nA)(e.setUserId.bind(e),"setUserId",(0,i.WI)(e),(0,i.av)(e,["config","config.userId"])),getDeviceId:(0,i.nA)(e.getDeviceId.bind(e),"getDeviceId",(0,i.WI)(e),(0,i.av)(e,["config","config.deviceId"])),setDeviceId:(0,i.nA)(e.setDeviceId.bind(e),"setDeviceId",(0,i.WI)(e),(0,i.av)(e,["config","config.deviceId"])),reset:(0,i.nA)(e.reset.bind(e),"reset",(0,i.WI)(e),(0,i.av)(e,["config","config.userId","config.deviceId"])),getSessionId:(0,i.nA)(e.getSessionId.bind(e),"getSessionId",(0,i.WI)(e),(0,i.av)(e,["config"])),setSessionId:(0,i.nA)(e.setSessionId.bind(e),"setSessionId",(0,i.WI)(e),(0,i.av)(e,["config"])),extendSession:(0,i.nA)(e.extendSession.bind(e),"extendSession",(0,i.WI)(e),(0,i.av)(e,["config"])),setOptOut:(0,i.nA)(e.setOptOut.bind(e),"setOptOut",(0,i.WI)(e),(0,i.av)(e,["config"])),setTransport:(0,i.nA)(e.setTransport.bind(e),"setTransport",(0,i.WI)(e),(0,i.av)(e,["config"])),getIdentity:(0,i.nA)(e.getIdentity.bind(e),"getIdentity",(0,i.WI)(e),(0,i.av)(e,["config"])),setIdentity:(0,i.nA)(e.setIdentity.bind(e),"setIdentity",(0,i.WI)(e),(0,i.av)(e,["config","config.userId","config.deviceId"])),getOptOut:(0,i.nA)(e.getOptOut.bind(e),"getOptOut",(0,i.WI)(e),(0,i.av)(e,["config"])),_setDiagnosticsSampleRate:(0,i.nA)(e._setDiagnosticsSampleRate.bind(e),"_setDiagnosticsSampleRate",(0,i.WI)(e),(0,i.av)(e,["config"]))}},co=uo();function lo(e,t){var n=0;if(Number.isFinite(e)&&Number.isFinite(t)&&t>0){var r=e/t*100;n=Math.min(100,Math.max(0,r))}return n}function fo(e,t){var n=e.currentTime,r=e.duration;return(0,o.Cl)({duration:r,start_time:n,last_position:n,percent_completed:lo(n,r)},void 0!==t?{stop_reason:t}:{})}function vo(e){return{mux_playback_id:e.getAttribute("playback-id"),mux_video_id:e.getAttribute("metadata-video-id"),mux_video_title:e.getAttribute("metadata-video-title")}}function po(e,t,n,r){return(0,o.sH)(this,void 0,void 0,function(){var i,s,a,u,c;return(0,o.YH)(this,function(l){switch(l.label){case 0:return[4,Promise.all([new Promise(function(t){return e.getDuration(t)}),new Promise(function(t){return e.getCurrentTime(t)})])];case 1:if(i=o.zs.apply(void 0,[l.sent(),2]),s=i[0],a=i[1],u={},"mux"===n){c=void 0;try{c=new URL(t.getAttribute("src")),u.mux_video_title=c.searchParams.get("metadata-video-title"),u.mux_video_id=c.searchParams.get("metadata-video-id"),u.mux_playback_id=c.pathname.split("/").pop()}catch(d){}}return[2,(0,o.Cl)((0,o.Cl)({duration:s,start_time:a,last_position:a,percent_completed:lo(a,s)},void 0!==r?{stop_reason:r}:{}),u)]}})})}
1function ho(e,t,n){void 0===n&&(n=null);var r=[],i=function(){var i=e.elem,s=!1,a=function(){po(e,i,n).then(function(e){t.onPlay(e)}).catch(function(e){t.onError("Error getting iframe metadata from 'play' handler: ".concat(e))})};e.on("play",a),r.push(function(){return e.off("play",a)});var u=function(){po(e,i,n,"paused").then(function(e){t.onPause(e)}).catch(function(e){t.onError("Error getting iframe metadata from 'pause' handler: ".concat(e))})};e.on("pause",u),r.push(function(){return e.off("pause",u)});var c=function(){po(e,i,n,"ended").then(function(e){t.onEnded(e)}).catch(function(e){t.onError("Error getting iframe metadata from 'ended' handler: ".concat(e))})};e.on("ended",c),r.push(function(){return e.off("ended",c)});var l=function(){s=!0,po(e,i,n,"seeking").then(function(e){t.onSeeking(e)}).catch(function(e){t.onError("Error getting iframe metadata from 'seeking' handler: ".concat(e))})};e.on("seeking",l),r.push(function(){return e.off("seeking",l)});var d=function(){s=!1,po(e,i,n).then(function(e){t.onSeeked(e)}).catch(function(e){t.onError("Error getting iframe metadata from 'seeked' handler: ".concat(e))})};e.on("seeked",d),r.push(function(){return e.off("seeked",d)});var f=function(){(function(e){return(0,o.sH)(this,void 0,void 0,function(){return(0,o.YH)(this,function(t){switch(t.label){case 0:return[4,new Promise(function(t){return e.getCurrentTime(t)})];case 1:return[2,{currentTime:t.sent()}]}})})})(e).then(function(e){var n={position:e.currentTime,isSeeking:s};t.onTimeUpdate(n)}).catch(function(e){t.onError("Error getting iframe metadata from 'timeupdate' handler: ".concat(e))})};e.on("timeupdate",f),r.push(function(){return e.off("timeupdate",f)})};return e.on("ready",i),function(){e.off("ready",i),r.forEach(function(e){return e()})}}var go=function(){function e(e){var t=e.videoEl,n=e.onStateChange,r=e.vendor,i=e.isEmbedded,s=this;this.state={playbackState:"paused"},this.handler={onPlay:function(e){s.updatePlaybackState("playing",e)},onPause:function(e){s.updatePlaybackState("paused",e)},onEnded:function(e){s.updatePlaybackState("ended",e)},onSeeking:function(){var e=(0,o.Cl)((0,o.Cl)({},s.state),{isSeeking:!0});s.updateState(e)},onSeeked:function(e){var t=(0,o.Cl)((0,o.Cl)({},s.state),{isSeeking:!1,position:e.last_position});s.updateState(t)},onError:function(e){s.updateStateWithError(e)},onTimeUpdate:function(e){s.updateTime(e)}},this.onStateChange=n,this.untrack=i?ho(t,this.handler,r):function(e,t,n){var r=function(){var r=(0,o.Cl)((0,o.Cl)({},fo(e)),"mux"===n?vo(e):{});t.onPlay(r)};e.addEventListener("play",r);var i=function(){var r=(0,o.Cl)((0,o.Cl)({},fo(e,"paused")),"mux"===n?vo(e):{});t.onPause(r)};e.addEventListener("pause",i);var s=function(){var r=(0,o.Cl)((0,o.Cl)({},fo(e,"ended")),"mux"===n?vo(e):{});t.onEnded(r)};e.addEventListener("ended",s);var a=function(){var r=(0,o.Cl)((0,o.Cl)({},fo(e,"seeking")),"mux"===n?vo(e):{});t.onSeeking(r)};e.addEventListener("seeking",a);var u=function(){var r=(0,o.Cl)((0,o.Cl)({},fo(e)),"mux"===n?vo(e):{});t.onSeeked(r)};e.addEventListener("seeked",u);var c=function(){var n=e,r={position:e.currentTime,isSeeking:!!n.seeking};t.onTimeUpdate(r)};return e.addEventListener("timeupdate",c),function(){e.removeEventListener("play",r),e.removeEventListener("pause",i),e.removeEventListener("ended",s),e.removeEventListener("seeking",a),e.removeEventListener("seeked",u),e.removeEventListener("timeupdate",c)}}(t,this.handler,r)}return e.prototype.stateChangeHandler=function(e,t){try{this.onStateChange(e,t)}catch(n){}},e.prototype.updateStateWithError=function(e){var t=this.state,n=(0,o.Cl)((0,o.Cl)({},t),{playbackState:"error",errorMessage:e});this.updateState(n)},e.prototype.updatePlaybackState=function(e,t){var n=(0,o.Cl)((0,o.Cl)({},this.state),{playbackState:e,lastEvent:t,position:t.last_position});this.updateState(n)},e.prototype.updateTime=function(e){var t,n;if(this.state.lastEvent&&"playing"===this.state.playbackState){var r=e.isSeeking||this.state.isSeeking,i=null!==(t=this.state.position)&&void 0!==t?t:0,s=e.position;if(r)this.state=(0,o.Cl)((0,o.Cl)({},this.state),{position:s});else{var a=s-i,u=(0,o.Cl)((0,o.Cl)({},this.state),{position:s,watchTime:(null!==(n=this.state.watchTime)&&void 0!==n?n:0)+a});this.updateState(u)}}},e.prototype.updateState=function(e){var t=this.state;this.state=e,this.stateChangeHandler(t,e)},e.prototype.destroy=function(){this.untrack()},e}(),mo=function(){function e(e){this.amplitude=e,this.videoEl=null,this.embeddedVideoPlayer=null,this.extraEventProperties={},this.listeners=[],this.onRemoveListeners=[]}return e.prototype.withVideoElement=function(e){return this.videoEl=e,this},e.prototype.withEmbeddedPlayer=function(e){return this.embeddedVideoPlayer=e,this},e.prototype.withVendor=function(e){return this.vendor=e,this},e.prototype.withExtraEventProperties=function(e){return this.extraEventProperties=e,this},e.prototype.captureVideoStarted=function(){var e=this;return this.listeners.push(function(t,n){"playing"!==t.playbackState&&"playing"===n.playbackState&&e.amplitude.track("Video Content Started",(0,o.Cl)((0,o.Cl)({},n.lastEvent),e.extraEventProperties))}),this},e.prototype.captureVideoStopped=function(){var e=this;return this.listeners.push(function(t,n){"playing"===t.playbackState&&"playing"!==n.playbackState&&e.amplitude.track("Video Content Stopped",(0,o.Cl)((0,o.Cl)((0,o.Cl)({},n.lastEvent),{watch_duration:n.watchTime}),e.extraEventProperties))}),this},e.prototype.start=function(){var e,t=this,n=null!==(e=this.videoEl)&&void 0!==e?e:this.embeddedVideoPlayer;if(!n)throw new Error("Video element not specified. Use withVideoElement() or withEmbeddedPlayer() to specify the video element.");if(this.videoEl&&this.embeddedVideoPlayer)throw new Error("Both video element and embedded video player specified. Use only one of withVideoElement() or withEmbeddedPlayer() to specify the video element.");var r=new go({videoEl:n,onStateChange:function(e,n){t.listeners.forEac
1h(function(t){return t(e,n)})},vendor:this.vendor,isEmbedded:!!this.embeddedVideoPlayer});return this.onRemoveListeners.push(function(){r.destroy()}),this},e.prototype.stop=function(){this.onRemoveListeners.forEach(function(e){return e()}),this.onRemoveListeners=[]},e}();function yo(e,t,n){var r;void 0===n&&(n={});var i=new mo(e);t instanceof HTMLVideoElement?i.withVideoElement(t):i.withEmbeddedPlayer(t),n.vendor&&i.withVendor(n.vendor);var s=null!==(r=n.extraEventProperties)&&void 0!==r?r:{};try{i.withExtraEventProperties((0,o.Cl)({view_session_id:(0,L.k)()},s)).captureVideoStarted().captureVideoStopped().start()}catch(a){return a}return function(){return i.stop()}}var bo=n(39207),wo=co.add,Eo=co.extendSession,So=co.flush,ko=co.getDeviceId,To=co.getIdentity,Co=co.getOptOut,Ao=co.getSessionId,xo=co.getUserId,Io=co.groupIdentify,Po=co.identify,Oo=co.init,_o=co.logEvent,Ro=co.remove,Ho=co.reset,Do=co.revenue,Lo=co.setDeviceId,No=co.setGroup,Mo=co.setIdentity,jo=co.setOptOut,Uo=co.setSessionId,Yo=co.setTransport,qo=co.setUserId,Fo=co.track,zo=co._setDiagnosticsSampleRate},81401:function(e){var t=Object.prototype.hasOwnProperty;function n(e){return"[Throws: "+(e?e.message:"?")+"]"}function r(e){var r=[];return function e(i){if(null===i||"object"!=typeof i)return i;if(-1!==r.indexOf(i))return"[Circular]";if(r.push(i),"function"==typeof i.toJSON)try{var o=e(i.toJSON());return r.pop(),o}catch(u){return n(u)}if(Array.isArray(i)){var s=i.map(e);return r.pop(),s}var a=Object.keys(i).reduce(function(r,o){return r[o]=e(function(e,r){if(t.call(e,r))try{return e[r]}catch(u){return n(u)}return e[r]}(i,o)),r},{});return r.pop(),a}(e)}e.exports=function(e,t,n){return JSON.stringify(r(e),t,n)},e.exports.ensureProperties=r}}]);
2//# sourceMappingURL=1163-10a7425ea914f50b50c5.js.map

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.