PageSourceSearch

https://8percent.kr/assets/amplitude-XFpKxuOU.js

js 8percent.kr collected 2026-10-02 06:49:40 UTC 188,916 bytes, 13 lines download raw bytes

1import{n as xi,t as Ee}from"./defineProperty-CFNHu9_4.js";import{n as Ni}from"./storage-DkjrkYuN.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"fc1789549d66d1cdf4cedbb8c6acb8d93cfb0dc9"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="21b53ec8-e81a-4bbe-8a89-5a08519ff2a2",e._sentryDebugIdIdentifier="sentry-dbid-21b53ec8-e81a-4bbe-8a89-5a08519ff2a2")}catch{}})();var jt=function(e,t){return jt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},jt(e,t)};function re(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");jt(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var w=function(){return w=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},w.apply(this,arguments)};function ct(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function E(e,t,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(l){try{u(n.next(l))}catch(f){a(f)}}function c(l){try{u(n.throw(l))}catch(f){a(f)}}function u(l){l.done?o(l.value):i(l.value).then(s,c)}u((n=n.apply(e,t||[])).next())})}function b(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(r=0)),r;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){r.label=u[1];break}if(u[0]===6&&r.label<o[1]){r.label=o[1],o=u;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(u);break}o[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(l){u=[6,l],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function x(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function I(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o}function L(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}function Ce(e){return this instanceof Ce?(this.v=e,this):new Ce(e)}function Ui(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(v){return function(h){return Promise.resolve(h).then(v,f)}}function s(v,h){n[v]&&(i[v]=function(g){return new Promise(function(y,m){o.push([v,g,y,m])>1||c(v,g)})},h&&(i[v]=h(i[v])))}function c(v,h){try{u(n[v](h))}catch(g){d(o[0][3],g)}}function u(v){v.value instanceof Ce?Promise.resolve(v.value.v).then(l,f):d(o[0][2],v)}function l(v){c("next",v)}function f(v){c("throw",v)}function d(v,h){v(h),o.shift(),o.length&&c(o[0][0],o[0][1])}}function Mi(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof x=="function"?x(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=e[o]&&function(a){return new Promise(function(s,c){a=e[o](a),i(s,c,a.done,a.value)})}}
1function i(o,a,s,c){Promise.resolve(c).then(function(u){o({value:u,done:s})},a)}}var Te;(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"})(Te||(Te={}));var le;(function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"})(le||(le={}));var Fi="".concat("AMP","_unsent"),wn="$default_instance",_n="https://api2.amplitude.com/2/httpapi",qi="https://api.eu.amplitude.com/2/httpapi",Vi="https://api2.amplitude.com/batch",ji="https://api.eu.amplitude.com/batch",Hi="utm_campaign",Bi="utm_content",Gi="utm_id",Wi="utm_medium",Ki="utm_source",$i="utm_term",br="dclid",Er="fbclid",Tr="gbraid",Sr="gclid",wr="ko_click_id",_r="li_fat_id",Ir="msclkid",Ar="rdt_cid",Pr="ttclid",Rr="twclid",kr="wbraid",mt={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},lt=["access-control-allow-origin","access-control-allow-credentials","access-control-expose-headers","access-control-max-age","access-control-allow-methods","access-control-allow-headers","accept-patch","accept-ranges","age","allow","alt-svc","cache-control","connection","content-disposition","content-encoding","content-language","content-length","content-location","content-md5","content-range","content-type","date","delta-base","etag","expires","im","last-modified","link","location","permanent","p3p","pragma","proxy-authenticate","public-key-pins","retry-after","server","status","strict-transport-security","trailer","transfer-encoding","tk","upgrade","vary","via","warning","www-authenticate","x-b3-traceid","x-frame-options"],zi=["authorization","cookie","set-cookie"],Yi=1e3,Ht=function(e){if(Object.keys(e).length>Yi)return!1;for(var t in e){var r=e[t];if(!In(t,r))return!1}return!0},In=function(e,t){var r,n;if(typeof e!="string")return!1;if(Array.isArray(t)){var i=!0;try{for(var o=x(t),a=o.next();!a.done;a=o.next()){var s=a.value;if(Array.isArray(s))return!1;if(typeof s=="object")i=i&&Ht(s);else if(!["number","string"].includes(typeof s))return!1;if(!i)return!1}}catch(c){r={error:c}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}else{if(t==null)return!1;if(typeof t=="object")return Ht(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},Ge=(function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return w({},this._properties)},e.prototype.set=function(t,r){return this._safeSet(F.SET,t,r),this},e.prototype.setOnce=function(t,r){return this._safeSet(F.SET_ONCE,t,r),this},e.prototype.append=function(t,r){return this._safeSet(F.APPEND,t,r),this},e.prototype.prepend=function(t,r){return this._safeSet(F.PREPEND,t,r),this},e.prototype.postInsert=function(t,r){return this._safeSet(F.POSTINSERT,t,r),this},e.prototype.preInsert=function(t,r){return this._safeSet(F.PREINSERT,t,r),this},e.prototype.remove=function(t,r){return this._safeSet(F.REMOVE,t,r),this},e.prototype.add=function(t,r){return this._safeSet(F.ADD,t,r),this},e.prototype.unset=function(t){return this._safeSet(F.UNSET,t,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[F.CLEAR_ALL]="-",this},e.prototype._safeSet=function(t,r,n){if(this._validate(t,r,n)){var i=this._properties[t];return i===void 0&&(i={},this._properties[t]=i),i[r]=n,this._propertySet.add(r),!0}return!1},e.prototype._validate=function(t,r,n){return this._properties[F.CLEAR_ALL]!==void 0||this._propertySet.has(r)?!1:t===F.ADD?typeof n=="number":t!==F.UNSET&&t!==F.REMOVE?In(r,n):!0},e})(),F;(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"})(F||(F={}));var Xi=[F.CLEAR_ALL,F.UNSET,F.SET,F.SET_ONCE,F.ADD,F.APPEND,F.PREPEND,F.PREINSERT,F.POSTINSERT,F.REMOVE],Ji="Event tracked successfully",Qi="Unexpected error occurred",Zi="Event rejected due to exceeded retry count",eo="Event skipped due to optOut config",to="Event rejected due to missing API key";var ro="Client not initialized",K;(function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"})(K||(K={}));var Le=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=K.Unknown),{event:e,code:t,message:r}},$=function(){var e="ampIntegrationContext";if(typeof globalThis<"u"&&typeof globalThis[e]<"u")return globalThis[e];if(typeof globalThis<"u")return globalThis;if(typeof window<"u")return window;if(typeof self<"u")return self;if(typeof global<"u")return global},no=function(e){return e?(e^Math.random()*16>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,we)},Or=L([],I(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),we=function(e){var t,r=$();if(!(!((t=r?.crypto)===null||t===void 0)&&t.getRandomValues))return no(e);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=n[6]&15|64,n[8]=n[8]&63|128,L([],I(n.entries()),!1).map(function(i){var o=I(i,2),a=o[0],s=o[1];return[4,6,8,10].includes(a)?"-".concat(Or[s]):Or[s]}).join("")},io=(function(){function e(t){this.client=t,this.queue=[],this.applying=!1,this.plugins=[]}return e.prototype.register=function(t,r){var n,i;return E(this,void 0,void 0,function(){return b(this,function(o){switch(o.label){case 0:return this.plugins.some(function(a){return a.name===t.name})?(this.loggerProvider.warn("Plugin with name ".concat(t.name," already exists, skipping registration")),[2]):(t.name===void 0&&(t.name=we(),this.loggerProvider.warn(`Plugin name is undefined. 
2      Generating a random UUID for plugin name: `.concat(t.name,`. 
3      Set a name for the plugin to prevent it from being added multiple times.`))),t.type=(n=t.type)!==null&&n!==void 0?n:"enrichment",[4,(i=t.setup)===null||i===void 0?void 0:i.call(t,r,this.client)]);case 1:return o.sent(),this.plugins.push(t),[2]}})})},e.prototype.deregister=function(t,r){var n;return E(this,void 0,void 0,function(){var i,o;return b(this,function(a){switch(a.label){case 0:return i=this.plugins.findIndex(function(s){return s.name===t}),i===-1?(r.loggerProvider.warn("Plugin with name ".concat(t," does not exist, skipping deregistration")),[2]):(o=this.plugins[i],this.plugins.splice(i,1),[4,(n=o.teardown)===null||n===void 0?void 0:n.call(o)]);case 1:return a.sent(),[2]}})})},e.prototype.reset=function(t){this.applying=!1,this.plugins.map(function(r){var n;return(n=r.teardown)===null||n===void 0?void 0:n.call(r)}),this.plugins=[],this.client=t},e.prototype.push=function(t){var r=this;return new Promise(function(n){r.queue.push([t,n]),r.scheduleApply(0)})},e.prototype.scheduleApply=function(t){var r=this;this.applying||(this.applying=!0,setTimeout(function(){r.apply(r.queue.shift()).then(function(){r.applying=!1,r.queue.length>0&&r.scheduleApply(0)})},t))},e.prototype.apply=function(t){return E(this,void 0,void 0,function(){var r,n,i,o,a,s,c,v,h,u,l,f,d,v,h,g,y,m,p,T,S,A;return b(this,function(_){switch(_.label){case 0:if(!t)return[2];r=I(t,1),n=r[0],i=I(t,2),o=i[1],this.loggerProvider.log("Timeline.apply: Initial event",n),a=this.plugins.filter(function(O){return O.type==="before"}),_.label=1;case 1:_.trys.push([1,6,7,8]),s=x(a),c=s.next(),_.label=2;case 2:return c.done?[3,5]:(v=c.value,v.execute?[4,v.execute(w({},n))]:[3,4]);case 3:if(h=_.sent(),h===null)return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(v.name),"', event: ").concat(JSON.stringify(n))),o({event:n,code:0,message:""}),[2];n=h,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(v.name),"', event: ").concat(JSON.stringify(n))),_.label=4;case 4:return c=s.next(),[3,2];case 5:return[3,8];case 6:return u=_.sent(),p={error:u},[3,8];case 7:try{c&&!c.done&&(T=s.return)&&T.call(s)}finally{if(p)throw p.error}
3return[7];case 8:l=this.plugins.filter(function(O){return O.type==="enrichment"||O.type===void 0}),_.label=9;case 9:_.trys.push([9,14,15,16]),f=x(l),d=f.next(),_.label=10;case 10:return d.done?[3,13]:(v=d.value,v.execute?[4,v.execute(w({},n))]:[3,12]);case 11:if(h=_.sent(),h===null)return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(v.name),"', event: ").concat(JSON.stringify(n))),o({event:n,code:0,message:""}),[2];n=h,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(v.name),"', event: ").concat(JSON.stringify(n))),_.label=12;case 12:return d=f.next(),[3,10];case 13:return[3,16];case 14:return g=_.sent(),S={error:g},[3,16];case 15:try{d&&!d.done&&(A=f.return)&&A.call(f)}finally{if(S)throw S.error}return[7];case 16:return y=this.plugins.filter(function(O){return O.type==="destination"}),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(JSON.stringify(n))),m=y.map(function(O){var C=w({},n);return O.execute(C).catch(function(D){return Le(C,0,String(D))})}),Promise.all(m).then(function(O){var C=I(O,1)[0]||Le(n,100,"Event not tracked, no destination plugins on the instance");o(C)}),[2]}})})},e.prototype.flush=function(){return E(this,void 0,void 0,function(){var t,r,n,i=this;return b(this,function(o){switch(o.label){case 0:return t=this.queue,this.queue=[],[4,Promise.all(t.map(function(a){return i.apply(a)}))];case 1:return o.sent(),r=this.plugins.filter(function(a){return a.type==="destination"}),n=r.map(function(a){return a.flush&&a.flush()}),[4,Promise.all(n)];case 2:return o.sent(),[2]}})})},e.prototype.onIdentityChanged=function(t){this.plugins.forEach(function(r){var n;(n=r.onIdentityChanged)===null||n===void 0||n.call(r,t)})},e.prototype.onSessionIdChanged=function(t){this.plugins.forEach(function(r){var n;(n=r.onSessionIdChanged)===null||n===void 0||n.call(r,t)})},e.prototype.onOptOutChanged=function(t){this.plugins.forEach(function(r){var n;(n=r.onOptOutChanged)===null||n===void 0||n.call(r,t)})},e})(),oo=function(e,t,r){return w(w(w({},typeof e=="string"?{event_type:e}:e),r),t&&{event_properties:t})},An=function(e,t){return w(w({},t),{event_type:le.IDENTIFY,user_properties:e.getUserProperties()})},ao=function(e,t,r,n){var i;return w(w({},n),{event_type:le.GROUP_IDENTIFY,group_properties:r.getUserProperties(),groups:(i={},i[e]=t,i)})},so=function(e,t,r){var n,i=new Ge;return i.set(e,t),w(w({},r),{event_type:le.IDENTIFY,user_properties:i.getUserProperties(),groups:(n={},n[e]=t,n)})},uo=function(e,t){return w(w({},t),{event_type:le.REVENUE,event_properties:e.getEventProperties()})},ne=function(e){return{promise:e||Promise.resolve()}},co=(function(){function e(t){t===void 0&&(t="$default"),this.initializing=!1,this.isReady=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new io(this),this.name=t}return e.prototype._init=function(t){return E(this,void 0,void 0,function(){return b(this,function(r){switch(r.label){case 0:return this.config=t,this.timeline.reset(this),this.timeline.loggerProvider=this.config.loggerProvider,[4,this.runQueuedFunctions("q")];case 1:return r.sent(),this.isReady=!0,[2]}})})},e.prototype.runQueuedFunctions=function(t){return E(this,void 0,void 0,function(){var r,n,i,o,a,s,c,u;return b(this,function(l){switch(l.label){case 0:r=this[t],this[t]=[],l.label=1;case 1:l.trys.push([1,8,9,10]),n=x(r),i=n.next(),l.label=2;case 2:return i.done?[3,7]:(o=i.value,a=o(),a&&"promise"in a?[4,a.promise]:[3,4]);case 3:return l.sent(),[3,6];case 4:return[4,a];case 5:l.sent(),l.label=6;case 6:return i=n.next(),[3,2];case 7:return[3,10];case 8:return s=l.sent(),c={error:s},[3,10];case 9:try{i&&!i.done&&(u=n.return)&&u.call(n)}finally{if(c)throw c.error}return[7];case 10:return this[t].length?[4,this.runQueuedFunctions(t)]:[3,12];case 11:l.sent(),l.label=12;case 12:return[2]}})})},e.prototype.track=function(t,r,n){var i=oo(t,r,n);return ne(this.dispatch(i))},e.prototype.identify=function(t,r){var n=An(t,r);return ne(this.dispatch(n))},e.prototype.groupIdentify=function(t,r,n,i){var o=ao(t,r,n,i);return ne(this.dispatch(o))},e.prototype.setGroup=function(t,r,n){var i=so(t,r,n);return ne(this.dispatch(i))},e.prototype.revenue=function(t,r){var n=uo(t,r);return ne(this.dispatch(n))},e.prototype.add=function(t){return this.isReady?this._addPlugin(t):(this.q.push(this._addPlugin.bind(this,t)),ne())},e.prototype._addPlugin=function(t){return ne(this.timeline.register(t,this.config))},e.prototype.remove=function(t){return this.isReady?this._removePlugin(t):(this.q.push(this._removePlugin.bind(this,t)),ne())},e.prototype._removePlugin=function(t){return ne(this.timeline.deregister(t,this.config))},e.prototype.dispatchWithCallback=function(t,r){if(!this.isReady)return r(Le(t,0,ro));this.process(t).then(r)},e.prototype.dispatch=function(t){return E(this,void 0,void 0,function(){var r=this;return b(this,function(n){return this.isReady?[2,this.process(t)]:[2,new Promise(function(i){r.dispatchQ.push(r.dispatchWithCallback.bind(r,t,i))})]})})},e.prototype.getOperationAppliedUserProperties=function(t){var r={};if(t===void 0)return r;var n={};return Object.keys(t).forEach(function(i){Object.values(Te).includes(i)||(n[i]=t[i])}),Xi.forEach(function(i){if(Object.keys(t).includes(i)){var o=t[i];switch(i){case Te.CLEAR_ALL:Object.keys(r).forEach(function(a){delete r[a]});break;
3case Te.UNSET:Object.keys(o).forEach(function(a){delete r[a]});break;case Te.SET:Object.assign(r,o);break}}}),Object.assign(r,n),r},e.prototype.process=function(t){return E(this,void 0,void 0,function(){var r,o,n,i,o;return b(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),this.config.optOut?[2,Le(t,0,eo)]:(t.event_type===le.IDENTIFY&&(r=this.getOperationAppliedUserProperties(t.user_properties),this.timeline.onIdentityChanged({userProperties:r})),[4,this.timeline.push(t)]);case 1:return o=a.sent(),o.code===200?this.config.loggerProvider.log(o.message):o.code===100?this.config.loggerProvider.warn(o.message):this.config.loggerProvider.error(o.message),[2,o];case 2:return n=a.sent(),i=String(n),this.config.loggerProvider.error(i),o=Le(t,0,i),[2,o];case 3:return[2]}})})},e.prototype.setOptOut=function(t){if(!this.isReady){this.q.push(this._setOptOut.bind(this,!!t));return}this._setOptOut(t)},e.prototype._setOptOut=function(t){this.config.optOut!==t&&(this.timeline.onOptOutChanged(t),this.config.optOut=!!t)},e.prototype.flush=function(){return ne(this.timeline.flush())},e.prototype.plugin=function(t){var r=this.timeline.plugins.find(function(n){return n.name===t});if(r===void 0){this.config.loggerProvider.debug("Cannot find plugin with name ".concat(t));return}return r},e.prototype.plugins=function(t){return this.timeline.plugins.filter(function(r){return r instanceof t})},e})(),lo=(function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(t){return this.productId=t,this},e.prototype.setQuantity=function(t){return t>0&&(this.quantity=t),this},e.prototype.setPrice=function(t){return this.price=t,this},e.prototype.setRevenueType=function(t){return this.revenueType=t,this},e.prototype.setCurrency=function(t){return this.currency=t,this},e.prototype.setRevenue=function(t){return this.revenue=t,this},e.prototype.setReceipt=function(t){return this.receipt=t,this},e.prototype.setReceiptSig=function(t){return this.receiptSig=t,this},e.prototype.setEventProperties=function(t){return Ht(t)&&(this.properties=t),this},e.prototype.getEventProperties=function(){var t=this.properties?w({},this.properties):{};return t[ve.REVENUE_PRODUCT_ID]=this.productId,t[ve.REVENUE_QUANTITY]=this.quantity,t[ve.REVENUE_PRICE]=this.price,t[ve.REVENUE_TYPE]=this.revenueType,t[ve.REVENUE_CURRENCY]=this.currency,t[ve.REVENUE]=this.revenue,t[ve.RECEIPT]=this.receipt,t[ve.RECEIPT_SIG]=this.receiptSig,t},e})(),ve;(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"})(ve||(ve={}));var fo=function(e,t){var r=Math.max(t,1);return e.reduce(function(n,i,o){var a=Math.floor(o/r);return n[a]||(n[a]=[]),n[a].push(i),n},[])},oe;(function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Verbose=3]="Verbose",e[e.Debug=4]="Debug"})(oe||(oe={}));var Ze="Amplitude Logger ",Pn=(function(){function e(){this.logLevel=oe.None}return e.prototype.disable=function(){this.logLevel=oe.None},e.prototype.enable=function(t){t===void 0&&(t=oe.Warn),this.logLevel=t},e.prototype.log=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this.logLevel<oe.Verbose||console.log("".concat(Ze,"[Log]: ").concat(t.join(" ")))},e.prototype.warn=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this.logLevel<oe.Warn||console.warn("".concat(Ze,"[Warn]: ").concat(t.join(" ")))},e.prototype.error=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this.logLevel<oe.Error||console.error("".concat(Ze,"[Error]: ").concat(t.join(" ")))},e.prototype.debug=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this.logLevel<oe.Debug||console.log("".concat(Ze,"[Debug]: ").concat(t.join(" ")))},e})(),it=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:wn,logLevel:oe.Warn,loggerProvider:new Pn,offline:!1,optOut:!1,serverUrl:_n,serverZone:"US",useBatch:!1}},vo=(function(){function e(t){var r,n,i,o;this._optOut=!1;var a=it();this.apiKey=t.apiKey,this.flushIntervalMillis=(r=t.flushIntervalMillis)!==null&&r!==void 0?r:a.flushIntervalMillis,this.flushMaxRetries=t.flushMaxRetries||a.flushMaxRetries,this.flushQueueSize=t.flushQueueSize||a.flushQueueSize,this.instanceName=t.instanceName||a.instanceName,this.loggerProvider=t.loggerProvider||a.loggerProvider,this.logLevel=(n=t.logLevel)!==null&&n!==void 0?n:a.logLevel,this.minIdLength=t.minIdLength,this.plan=t.plan,this.ingestionMetadata=t.ingestionMetadata,this.offline=t.offline!==void 0?t.offline:a.offline,this.optOut=(i=t.optOut)!==null&&i!==void 0?i:a.optOut,this.serverUrl=t.serverUrl,this.serverZone=t.serverZone||a.serverZone,this.storageProvider=t.storageProvider,this.transportProvider=t.transportProvider,this.useBatch=(o=t.useBatch)!==null&&o!==void 0?o:a.useBatch,this.loggerProvider.enable(this.logLevel);var s=Rn(t.serverUrl,t.serverZone,t.useBatch);this.serverZone=s.serverZone,this.serverUrl=s.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(t){this._optOut=t}
3,enumerable:!1,configurable:!0}),e})(),ho=function(e,t){return e==="EU"?t?ji:qi:t?Vi:_n},Rn=function(e,t,r){if(e===void 0&&(e=""),t===void 0&&(t=it().serverZone),r===void 0&&(r=it().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:it().serverZone;return{serverZone:n,serverUrl:ho(n,r)}},po=(function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(t,r){this.sdk.metrics.histogram[t]=r},e})();function kn(e){return e>=200&&e<300}var On=function(e){return e===void 0&&(e=0),(new Error().stack||"").split(`
4`).slice(2+e).map(function(t){return t.trim()})},V=function(e){return function(){var t=w({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},go=function(e,t){var r,n;t=t.replace(/\[(\w+)\]/g,".$1"),t=t.replace(/^\./,"");try{for(var i=x(t.split(".")),o=i.next();!o.done;o=i.next()){var a=o.value;if(a in e)e=e[a];else return}}catch(s){r={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return e},j=function(e,t){return function(){var r,n,i={};try{for(var o=x(t),a=o.next();!a.done;a=o.next()){var s=a.value;i[s]=go(e,s)}}catch(c){r={error:c}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i}},H=function(e,t,r,n,i){return i===void 0&&(i=null),function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var s=r(),c=s.logger,u=s.logLevel;if(u&&u<oe.Debug||!u||!c)return e.apply(i,o);var l={type:"invoke public method",name:t,args:o,stacktrace:On(1),time:{start:new Date().toISOString()},states:{}};n&&l.states&&(l.states.before=n());var f=e.apply(i,o);return f&&f.promise?f.promise.then(function(){n&&l.states&&(l.states.after=n()),l.time&&(l.time.end=new Date().toISOString()),c.debug(JSON.stringify(l,null,2))}):(n&&l.states&&(l.states.after=n()),l.time&&(l.time.end=new Date().toISOString()),c.debug(JSON.stringify(l,null,2))),f}};function mo(e){return e instanceof Error?e.message:String(e)}function et(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch{}return t}var yo=(function(){function e(t){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=t?.diagnosticsClient}return e.prototype.setup=function(t){var r;return E(this,void 0,void 0,function(){var n,i=this;return b(this,function(o){switch(o.label){case 0:return this.config=t,this.storageKey="".concat(Fi,"_").concat(this.config.apiKey.substring(0,10)),[4,(r=this.config.storageProvider)===null||r===void 0?void 0:r.get(this.storageKey)];case 1:return n=o.sent(),n&&n.length>0&&Promise.all(n.map(function(a){return i.execute(a)})).catch(),[2,Promise.resolve(void 0)]}})})},e.prototype.execute=function(t){var r=this;return t.insert_id||(t.insert_id=we()),new Promise(function(n){var i={event:t,attempts:0,callback:function(o){return n(o)},timeout:0};r.queue.push(i),r.schedule(r.config.flushIntervalMillis),r.saveEvents()})},e.prototype.removeEventsExceedFlushMaxRetries=function(t){var r=this;return t.filter(function(n){return n.attempts+=1,n.attempts<r.config.flushMaxRetries?!0:(r.fulfillRequest([n],500,Zi),!1)})},e.prototype.scheduleEvents=function(t){var r=this;t.forEach(function(n){r.schedule(n.timeout===0?r.config.flushIntervalMillis:n.timeout)})},e.prototype.schedule=function(t){var r=this;if(!this.config.offline&&(this.scheduleId===null||this.scheduleId&&t>this.scheduledTimeout)){this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=t,this.scheduleId=setTimeout(function(){r.queue=r.queue.map(function(n){return n.timeout=0,n}),r.flush(!0)},t);return}},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(t){return t===void 0&&(t=!1),E(this,void 0,void 0,function(){var r,n,i,o=this;return b(this,function(a){switch(a.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(),r=[],n=[],this.queue.forEach(function(s){return s.timeout===0?r.push(s):n.push(s)}),i=fo(r,this.config.flushQueueSize),[4,i.reduce(function(s,c){return E(o,void 0,void 0,function(){return b(this,function(u){switch(u.label){case 0:return[4,s];case 1:return u.sent(),[4,this.send(c,t)];case 2:return[2,u.sent()]}})})},Promise.resolve())]);case 1:return a.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}})})},e.prototype.send=function(t,r){return r===void 0&&(r=!0),E(this,void 0,void 0,function(){var n,i,o,a,s;return b(this,function(c){switch(c.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(t,400,to)];n={api_key:this.config.apiKey,events:t.map(function(u){var l=u.event;return l.extra,ct(l,["extra"])}),options:{min_id_length:this.config.minIdLength},client_upload_time:new Date().toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new po,c.label=1;case 1:return c.trys.push([1,3,,4]),i=Rn(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(i,n)];case 2:return o=c.sent(),o===null?(this.fulfillRequest(t,0,Qi),[2]):r?(this.handleResponse(o,t),[3,4]):("body"in o?this.fulfillRequest(t,o.statusCode,"".concat(o.status,": ").concat(et(o))):this.fulfillRequest(t,o.statusCode,o.status),[2]);case 3:return a=c.sent(),s=mo(a),this.config.loggerProvider.error(s),this.handleResponse({status:K.Failed,statusCode:0},t),[3,4];case 4:return[2]}})})},e.prototype.handleResponse=function(t,r){var n=t.status;switch(n){case K.Success:this.handleSuccessResponse(t,r);break;case K.Invalid:this.handleInvalidResponse(t,r);break;case K.PayloadTooLarge:this.handlePayloadTooLargeResponse(t,r);break;case K.RateLimit:this.handleRateLimitResponse(t,r);break;default:this.config.loggerProvider.warn(`{code: 0, error: "Status '`.concat(n,"' provided for ").concat(r.length,' events"}')),this.handleOtherResponse(r);break}},e.prototype.handleSuccessResponse=function(t,r){this.fulfillRequest(r,t.statusCode,Ji)},e.prototype.handleInvalidResponse=function(t,r){var n=this;if(t.body.missingField||t.body.error.startsWith("Invalid API key")){this.fulfillRequest(r,t.statusCode,t.body.error);return}var i=L(L(L(L([],I(Object.values(t.body.eventsWithInvalidFields)),!1),I(Object.values(t.body.eventsWithMissingFields)),!1),I(Object.values(t.body.eventsWithInvalidIdLengths)),!1),I(t.body.silencedEvents),!1).flat(),o=new Set(i),a=r.filter(function(c,u){if(o.has(u)){n.fulfillRequest([c],t.statusCode,t.body.error);return}return!0});a.length>0&&this.config.loggerProvider.warn(et(t));
4var s=this.removeEventsExceedFlushMaxRetries(a);this.scheduleEvents(s)},e.prototype.handlePayloadTooLargeResponse=function(t,r){if(r.length===1){this.fulfillRequest(r,t.statusCode,t.body.error);return}this.config.loggerProvider.warn(et(t)),this.config.flushQueueSize/=2;var n=this.removeEventsExceedFlushMaxRetries(r);this.scheduleEvents(n)},e.prototype.handleRateLimitResponse=function(t,r){var n=this,i=Object.keys(t.body.exceededDailyQuotaUsers),o=Object.keys(t.body.exceededDailyQuotaDevices),a=t.body.throttledEvents,s=new Set(i),c=new Set(o),u=new Set(a),l=r.filter(function(d,v){if(d.event.user_id&&s.has(d.event.user_id)||d.event.device_id&&c.has(d.event.device_id)){n.fulfillRequest([d],t.statusCode,t.body.error);return}return u.has(v)&&(d.timeout=n.throttleTimeout),!0});l.length>0&&this.config.loggerProvider.warn(et(t));var f=this.removeEventsExceedFlushMaxRetries(l);this.scheduleEvents(f)},e.prototype.handleOtherResponse=function(t){var r=this,n=t.map(function(o){return o.timeout=o.attempts*r.retryTimeout,o}),i=this.removeEventsExceedFlushMaxRetries(n);this.scheduleEvents(i)},e.prototype.fulfillRequest=function(t,r,n){var i,o,a;kn(r)?(a=this.diagnosticsClient)===null||a===void 0||a.increment("analytics.events.sent",t.length):((i=this.diagnosticsClient)===null||i===void 0||i.increment("analytics.events.dropped",t.length),(o=this.diagnosticsClient)===null||o===void 0||o.recordEvent("analytics.events.dropped",{events:t.map(function(s){return s.event.event_type}),code:r,message:n,stack_trace:On()})),this.removeEvents(t),t.forEach(function(s){return s.callback(Le(s.event,r,n))})},e.prototype.saveEvents=function(){if(this.config.storageProvider){var t=this.queue.map(function(r){return r.event});this.config.storageProvider.set(this.storageKey,t)}},e.prototype.removeEvents=function(t){this.queue=this.queue.filter(function(r){return!t.some(function(n){return n.event.insert_id===r.event.insert_id})}),this.saveEvents()},e})(),bo=(function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:Eo(),platform:"Web",os:void 0,deviceModel:void 0}},e})(),Eo=function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},To=(function(){function e(){this.queue=[]}return e.prototype.logEvent=function(t){this.receiver?this.receiver(t):this.queue.length<512&&this.queue.push(t)},e.prototype.setEventReceiver=function(t){this.receiver=t,this.queue.length>0&&(this.queue.forEach(function(r){t(r)}),this.queue=[])},e})(),be=function(){return be=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},be.apply(this,arguments)};function ot(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Cr(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o}var at=function(e,t){var r,n,i=["string","number","boolean","undefined"],o=typeof e;if(o!==typeof t)return!1;try{for(var a=ot(i),s=a.next();!s.done;s=a.next())if(s.value===o)return e===t}catch(d){r={error:d}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}if(e==null&&t==null)return!0;if(e==null||t==null||e.length!==t.length)return!1;var c=Array.isArray(e),u=Array.isArray(t);if(c!==u)return!1;if(c&&u){for(var l=0;l<e.length;l++)if(!at(e[l],t[l]))return!1}else{if(!at(Object.keys(e).sort(),Object.keys(t).sort()))return!1;var f=!0;return Object.keys(e).forEach(function(d){at(e[d],t[d])||(f=!1)}),f}return!0},So="$set",wo="$unset",_o="$clearAll";Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n});var Io=(function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var t=this,r=be({},this.identity.userProperties),n=be(be({},this.identity),{userProperties:r});return{setUserId:function(i){return n.userId=i,this},setDeviceId:function(i){return n.deviceId=i,this},setUserProperties:function(i){return n.userProperties=i,this},setOptOut:function(i){return n.optOut=i,this},updateUserProperties:function(i){var o,a,s,c,u,l,f=n.userProperties||{};try{for(var d=ot(Object.entries(i)),v=d.next();!v.done;v=d.next()){var h=Cr(v.value,2),g=h[0],y=h[1];switch(g){case So:try{for(var m=(s=void 0,ot(Object.entries(y))),p=m.next();!p.done;p=m.next()){var T=Cr(p.value,2),S=T[0],A=T[1];f[S]=A}}catch(C){s={error:C}}finally{try{p&&!p.done&&(c=m.return)&&c.call(m)}finally{if(s)throw s.error}}break;case wo:try{for(var _=(u=void 0,ot(Object.keys(y))),O=_.next();!O.done;O=_.next()){var S=O.value;delete f[S]}}catch(C){u={error:C}}finally{try{O&&!O.done&&(l=_.return)&&l.call(_)}finally{if(u)throw u.error}}break;case _o:f={};break}}}catch(C){o={error:C}}
4finally{try{v&&!v.done&&(a=d.return)&&a.call(d)}finally{if(o)throw o.error}}return n.userProperties=f,this},commit:function(){return t.setIdentity(n),this}}},e.prototype.getIdentity=function(){return be({},this.identity)},e.prototype.setIdentity=function(t){var r=be({},this.identity);this.identity=be({},t),at(r,this.identity)||this.listeners.forEach(function(n){n(t)})},e.prototype.addIdentityListener=function(t){this.listeners.add(t)},e.prototype.removeIdentityListener=function(t){this.listeners.delete(t)},e})(),Me=typeof globalThis<"u"?globalThis:typeof global<"u"?global:self,Ao=(function(){function e(){this.identityStore=new Io,this.eventBridge=new To,this.applicationContextProvider=new bo}return e.getInstance=function(t){return Me.analyticsConnectorInstances||(Me.analyticsConnectorInstances={}),Me.analyticsConnectorInstances[t]||(Me.analyticsConnectorInstances[t]=new e),Me.analyticsConnectorInstances[t]},e})(),We=function(e){return e===void 0&&(e=wn),Ao.getInstance(e)},Po=function(e,t){We(t).identityStore.editIdentity().setUserId(e).commit()},Ro=function(e,t){We(t).identityStore.editIdentity().setDeviceId(e).commit()},ko=(function(){function e(){this.name="identity",this.type="before",this.identityStore=We().identityStore}return e.prototype.execute=function(t){return E(this,void 0,void 0,function(){var r;return b(this,function(n){return r=t.user_properties,r&&this.identityStore.editIdentity().updateUserProperties(r).commit(),[2,t]})})},e.prototype.setup=function(t){return E(this,void 0,void 0,function(){return b(this,function(r){return t.instanceName&&(this.identityStore=We(t.instanceName).identityStore),[2]})})},e})(),Cn=function(e,t){return t===void 0&&(t=Date.now()),Date.now()-t>e},Ln=function(e,t,r){return t===void 0&&(t=""),r===void 0&&(r=10),["AMP",t,e.substring(0,r)].filter(Boolean).join("_")},Oo=function(e){return"".concat("AMP".toLowerCase(),"_").concat(e.substring(0,6))},Co=function(){var e,t,r,n;if(typeof navigator>"u")return"";var i=navigator.userLanguage;return(n=(r=(t=(e=navigator.languages)===null||e===void 0?void 0:e[0])!==null&&t!==void 0?t:navigator.language)!==null&&r!==void 0?r:i)!==null&&n!==void 0?n:""},dt=function(){var e,t=$();return!((e=t?.location)===null||e===void 0)&&e.search?t.location.search.substring(1).split("&").filter(Boolean).reduce(function(r,n){var i=n.split("=",2),o=Lr(i[0]),a=Lr(i[1]);return a&&(r[o]=a),r},{}):{}},Lr=function(e){e===void 0&&(e="");try{return decodeURIComponent(e)}catch{return""}},Bt=function(e,t){return!t||!t.length?!0:t.some(function(r){return typeof r=="string"?e===r:e.match(r)})},Ve=function(e,t){var r=e;try{r=decodeURI(e)}catch(n){t?.error("Malformed URI sequence: ",n)}return r},Lo=function(e){var t=0;if(e.length===0)return t;for(var r=0;r<e.length;r++){var n=e.charCodeAt(r);t=(t<<5)-t+n,t|=0}return t},Dr=function(e,t){var r=Lo(e.toString());return Math.abs(r)*31%1e5/1e5<t},Zt=(function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return E(this,void 0,void 0,function(){return b(this,function(t){return[2,!0]})})},e.prototype.get=function(t){return E(this,void 0,void 0,function(){return b(this,function(r){return[2,this.memoryStorage.get(t)]})})},e.prototype.getRaw=function(t){return E(this,void 0,void 0,function(){var r;return b(this,function(n){switch(n.label){case 0:return[4,this.get(t)];case 1:return r=n.sent(),[2,r?JSON.stringify(r):void 0]}})})},e.prototype.set=function(t,r){return E(this,void 0,void 0,function(){return b(this,function(n){return this.memoryStorage.set(t,r),[2]})})},e.prototype.remove=function(t){return E(this,void 0,void 0,function(){return b(this,function(r){return this.memoryStorage.delete(t),[2]})})},e.prototype.reset=function(){return E(this,void 0,void 0,function(){return b(this,function(t){return this.memoryStorage.clear(),[2]})})},e})(),Gt=(function(){function e(t){this.options=w({},t)}return e.prototype.isEnabled=function(){return E(this,void 0,void 0,function(){var t,r,n;return b(this,function(i){switch(i.label){case 0:if(!$())return[2,!1];e.testValue=String(Date.now()),t=new e(this.options),r="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,t.set(r,e.testValue)];case 2:return i.sent(),[4,t.get(r)];case 3:return n=i.sent(),[2,n===e.testValue];case 4:return i.sent(),[2,!1];case 5:return[4,t.remove(r)];case 6:return i.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(t){var r;return E(this,void 0,void 0,function(){var n,i;return b(this,function(o){switch(o.label){case 0:return[4,this.getRaw(t)];case 1:if(n=o.sent(),!n)return[2,void 0];
4try{return i=(r=Do(n))!==null&&r!==void 0?r:xo(n),i===void 0?(console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(t,", value: ").concat(n)),[2,void 0]):[2,JSON.parse(i)]}catch{return console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(t,", value: ").concat(n)),[2,void 0]}return[2]}})})},e.prototype.getRaw=function(t){var r,n;return E(this,void 0,void 0,function(){var i,o,a;return b(this,function(s){return i=$(),o=(n=(r=i?.document)===null||r===void 0?void 0:r.cookie.split("; "))!==null&&n!==void 0?n:[],a=o.find(function(c){return c.indexOf(t+"=")===0}),a?[2,a.substring(t.length+1)]:[2,void 0]})})},e.prototype.set=function(t,r){var n;return E(this,void 0,void 0,function(){var i,o,a,s,c,u,l;return b(this,function(f){try{i=(n=this.options.expirationDays)!==null&&n!==void 0?n:0,o=r!==null?i:-1,a=void 0,o&&(s=new Date,s.setTime(s.getTime()+o*24*60*60*1e3),a=s),c="".concat(t,"=").concat(btoa(encodeURIComponent(JSON.stringify(r)))),a&&(c+="; expires=".concat(a.toUTCString())),c+="; path=/",this.options.domain&&(c+="; domain=".concat(this.options.domain)),this.options.secure&&(c+="; Secure"),this.options.sameSite&&(c+="; SameSite=".concat(this.options.sameSite)),u=$(),u&&(u.document.cookie=c)}catch(d){l=d instanceof Error?d.message:String(d),console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(t,". Error: ").concat(l))}return[2]})})},e.prototype.remove=function(t){return E(this,void 0,void 0,function(){return b(this,function(r){switch(r.label){case 0:return[4,this.set(t,null)];case 1:return r.sent(),[2]}})})},e.prototype.reset=function(){return E(this,void 0,void 0,function(){return b(this,function(t){return[2]})})},e})(),Do=function(e){try{return decodeURIComponent(atob(e))}catch{return}},xo=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch{return}},xr=function(e,t,r){return t===void 0&&(t=""),r===void 0&&(r=10),["AMP",t,e.substring(0,r)].filter(Boolean).join("_")},er=(function(){function e(t){this.storage=t}return e.prototype.isEnabled=function(){return E(this,void 0,void 0,function(){var t,r,n,i;return b(this,function(o){switch(o.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),r=new e(this.storage),n="AMP_TEST",o.label=1;case 1:return o.trys.push([1,4,5,7]),[4,r.set(n,t)];case 2:return o.sent(),[4,r.get(n)];case 3:return i=o.sent(),[2,i===t];case 4:return o.sent(),[2,!1];case 5:return[4,r.remove(n)];case 6:return o.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(t){return E(this,void 0,void 0,function(){var r;return b(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getRaw(t)];case 1:return r=n.sent(),r?[2,JSON.parse(r)]:[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(t){var r;return E(this,void 0,void 0,function(){return b(this,function(n){return[2,((r=this.storage)===null||r===void 0?void 0:r.getItem(t))||void 0]})})},e.prototype.set=function(t,r){var n;return E(this,void 0,void 0,function(){return b(this,function(i){try{(n=this.storage)===null||n===void 0||n.setItem(t,JSON.stringify(r))}catch{}return[2]})})},e.prototype.remove=function(t){var r;return E(this,void 0,void 0,function(){return b(this,function(n){try{(r=this.storage)===null||r===void 0||r.removeItem(t)}catch{}return[2]})})},e.prototype.reset=function(){var t;return E(this,void 0,void 0,function(){return b(this,function(r){try{(t=this.storage)===null||t===void 0||t.clear()}catch{}return[2]})})},e})(),No=10,Uo=1,N={TAGS:"tags",COUNTERS:"counters",HISTOGRAMS:"histograms",EVENTS:"events",INTERNAL:"internal"},Nr={LAST_FLUSH_TIMESTAMP:"last_flush_timestamp"},Ur=(function(){function e(t,r){this.dbPromise=null,this.logger=r,this.dbName="AMP_diagnostics_".concat(t.substring(0,10))}return e.isSupported=function(){var t;return((t=$())===null||t===void 0?void 0:t.indexedDB)!==void 0},e.prototype.getDB=function(){return E(this,void 0,void 0,function(){return b(this,function(t){return this.dbPromise||(this.dbPromise=this.openDB()),[2,this.dbPromise]})})},e.prototype.openDB=function(){var t=this;return new Promise(function(r,n){var i=indexedDB.open(t.dbName,Uo);i.onerror=function(){t.dbPromise=null,n(new Error("Failed to open IndexedDB"))},i.onsuccess=function(){var o=i.result;
4o.onclose=function(){t.dbPromise=null,t.logger.debug("DiagnosticsStorage: DB connection closed.")},o.onerror=function(a){t.logger.debug("DiagnosticsStorage: A global database error occurred.",a),o.close()},r(o)},i.onupgradeneeded=function(o){var a=o.target.result;t.createTables(a)}})},e.prototype.createTables=function(t){t.objectStoreNames.contains(N.TAGS)||t.createObjectStore(N.TAGS,{keyPath:"key"}),t.objectStoreNames.contains(N.COUNTERS)||t.createObjectStore(N.COUNTERS,{keyPath:"key"}),t.objectStoreNames.contains(N.HISTOGRAMS)||t.createObjectStore(N.HISTOGRAMS,{keyPath:"key"}),t.objectStoreNames.contains(N.EVENTS)||t.createObjectStore(N.EVENTS,{keyPath:"id",autoIncrement:!0}).createIndex("time_idx","time",{unique:!1}),t.objectStoreNames.contains(N.INTERNAL)||t.createObjectStore(N.INTERNAL,{keyPath:"key"})},e.prototype.setTags=function(t){return E(this,void 0,void 0,function(){var r,n,i,o,a=this;return b(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),Object.entries(t).length===0?[2]:[4,this.getDB()];case 1:return r=s.sent(),n=r.transaction([N.TAGS],"readwrite"),i=n.objectStore(N.TAGS),[2,new Promise(function(c){var u=Object.entries(t);n.oncomplete=function(){c()},n.onabort=function(l){a.logger.debug("DiagnosticsStorage: Failed to set tags",l),c()},u.forEach(function(l){var f=I(l,2),d=f[0],v=f[1],h=i.put({key:d,value:v});h.onerror=function(g){a.logger.debug("DiagnosticsStorage: Failed to set tag",d,v,g)}})})];case 2:return o=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",o),[3,3];case 3:return[2]}})})},e.prototype.incrementCounters=function(t){return E(this,void 0,void 0,function(){var r,n,i,o,a=this;return b(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),Object.entries(t).length===0?[2]:[4,this.getDB()];case 1:return r=s.sent(),n=r.transaction([N.COUNTERS],"readwrite"),i=n.objectStore(N.COUNTERS),[2,new Promise(function(c){var u=Object.entries(t);n.oncomplete=function(){c()},n.onabort=function(l){a.logger.debug("DiagnosticsStorage: Failed to increment counters",l),c()},u.forEach(function(l){var f=I(l,2),d=f[0],v=f[1],h=i.get(d);h.onsuccess=function(){var g=h.result,y=g?g.value:0,m=i.put({key:d,value:y+v});m.onerror=function(p){a.logger.debug("DiagnosticsStorage: Failed to update counter",d,p)}},h.onerror=function(g){a.logger.debug("DiagnosticsStorage: Failed to read existing counter",d,g)}})})];case 2:return o=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",o),[3,3];case 3:return[2]}})})},e.prototype.setHistogramStats=function(t){return E(this,void 0,void 0,function(){var r,n,i,o,a=this;return b(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),Object.entries(t).length===0?[2]:[4,this.getDB()];case 1:return r=s.sent(),n=r.transaction([N.HISTOGRAMS],"readwrite"),i=n.objectStore(N.HISTOGRAMS),[2,new Promise(function(c){var u=Object.entries(t);n.oncomplete=function(){c()},n.onabort=function(l){a.logger.debug("DiagnosticsStorage: Failed to set histogram stats",l),c()},u.forEach(function(l){var f=I(l,2),d=f[0],v=f[1],h=i.get(d);h.onsuccess=function(){var g=h.result,y;g?y={key:d,count:g.count+v.count,min:Math.min(g.min,v.min),max:Math.max(g.max,v.max),sum:g.sum+v.sum}:y={key:d,count:v.count,min:v.min,max:v.max,sum:v.sum};var m=i.put(y);m.onerror=function(p){a.logger.debug("DiagnosticsStorage: Failed to set histogram stats",d,p)}},h.onerror=function(g){a.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",d,g)}})})];case 2:return o=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set histogram stats",o),[3,3];case 3:return[2]}})})},e.prototype.addEventRecords=function(t){return E(this,void 0,void 0,function(){var r,n,i,o,a=this;return b(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),t.length===0?[2]:[4,this.getDB()];case 1:return r=s.sent(),n=r.transaction([N.EVENTS],"readwrite"),i=n.objectStore(N.EVENTS),[2,new Promise(function(c){n.oncomplete=function(){c()},n.onabort=function(l){a.logger.debug("DiagnosticsStorage: Failed to add event records",l),c()};var u=i.count();u.onsuccess=function(){var l=u.result,f=Math.max(0,No-l);f<t.length&&a.logger.debug("DiagnosticsStorage: Only added ".concat(f," of ").concat(t.length," events due to storage limit")),t.slice(0,f).forEach(function(d){var v=i.add(d);v.onerror=function(h){a.logger.debug("DiagnosticsStorage: Failed to add event record",h)}})},u.onerror=function(l){a.logger.debug("DiagnosticsStorage: Failed to count existing events",l)}})];case 2:return o=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to add event records",o),[3,3];case 3:return[2]}})})},e.prototype.setInternal=function(t,r){return E(this,void 0,void 0,function(){var n,i,o,a;return b(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,this.getDB()];case 1:return n=s.sent(),i=n.transaction([N.INTERNAL],"readwrite"),o=i.objectStore(N.INTERNAL),[2,new Promise(function(c,u){i.onabort=function(){return u(new Error("Failed to set internal value"))};var l=o.put({key:t,value:r});l.onsuccess=function(){return c()},l.onerror=function(){return u(new Error("Failed to set internal value"))}})];case 2:return a=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set internal value",a),[3,3];case 3:return[2]}})})},e.prototype.getInternal=function(t){return E(this,void 0,void 0,function(){var r,n,i,o;return b(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.getDB()];case 1:return r=a.sent(),n=r.transaction([N.INTERNAL],"readonly"),i=n.objectStore(N.INTERNAL),[2,new Promise(function(s,c){n.onabort=function(){return c(new Error("Failed to get internal value"))};var u=i.get(t);u.onsuccess=function(){return s(u.result)},u.onerror=function(){return c(new Error("Failed to get internal value"))}})];case 2:return o=a.sent(),this.logger.debug("DiagnosticsStorage: Failed to get internal value",o),[2,void 0];case 3:return[2]}})})},e.prototype.getLastFlushTimestamp=function(){return E(this,void 0,void 0,function(){var t,r;return b(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getInternal(Nr.LAST_FLUSH_TIMESTAMP)];case 1:return t=n.sent(),[2,t?parseInt(t.value,10):void 0];case 2:return r=n.sent(),this.logger.debug("DiagnosticsStorage: Failed to get last flush timestamp",r),[2,void 0];case 3:return[2]}})})},e.prototype.setLastFlushTimestamp=function(t){return E(this,void 0,void 0,function(){var r;return b(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.setInternal(Nr.LAST_FLUSH_TIMESTAMP,t.toString())];case 1:return n.sent(),[3,3];case 2:return r=n.sent(),this.logger.debug("DiagnosticsStorage: Failed to set last flush timestamp",r),[3,3];case 3:return[2]}})})},e.prototype.clearTable=function(t,r){return new Promise(function(n,i){var o=t.objectStore(r).clear();o.onsuccess=function(){return n()},o.onerror=function(){return i(new Error("Failed to clear table ".concat(r)))}})},e.prototype.getAllAndClear=function(){return E(this,void 0,void 0,function(){var t,r,n,i,o,a,s,c;return b(this,function(u){switch(u.label){case 0:return u.trys.push([0,4,,5]),[4,this.getDB()];case 1:return t=u.sent(),r=t.transaction([N.TAGS,N.COUNTERS,N.HISTOGRAMS,N.EVENTS],"readwrite"),[4,Promise.all([this.getAllFromStore(r,N.TAGS),this.getAllFromStore(r,N.COUNTERS),this.getAllFromStore(r,N.HISTOGRAMS),this.getAllFromStore(r,N.EVENTS)])];case 2:return n=I.apply(void 0,[u.sent(),4]),i=n[0],o=n[1],a=n[2],s=n[3],[4,Promise.all([this.clearTable(r,N.COUNTERS),this.clearTable(r,N.HISTOGRAMS),this.clearTable(r,N.EVENTS)])];case 3:return u.sent(),[2,{tags:i,counters:o,histogramStats:a,events:s}];case 4:return c=u.sent(),this.logger.debug("DiagnosticsStorage: Failed to get all and clear data",c),[2,{tags:[],counters:[],histogramStats:[],events:[]}];case 5:return[2]}})})},e.prototype.getAllFromStore=function(t,r){return new Promise(function(n,i){var o=t.objectStore(r).getAll();o.onsuccess=function(){return n(o.result)},o.onerror=function(){return i(new Error("Failed to get all from ".concat(r)))}})},e})(),Mo=1e3,Pt=300*1e3,Fo="https://diagnostics.prod.us-west-2.amplitude.com/v1/capture",qo="https://diagnostics.prod.eu-central-1.amplitude.com/v1/capture";var Vo=(function(){function e(t,r,n,i){n===void 0&&(n="US"),this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},this.inMemoryEvents=[],this.saveTimer=null,this.flushTimer=null,this.apiKey=t,this.logger=r,this.serverUrl=n==="US"?Fo:qo,this.logger.debug("DiagnosticsClient: Initializing with options",JSON.stringify(i,null,2)),this.config=w({enabled:!0,sampleRate:0},i),this.startTimestamp=Date.now(),this.shouldTrack=Dr(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,Ur.isSupported()?this.storage=new Ur(t,r):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&this.increment("sdk.diagnostics.sampled.in.and.enabled")}return e.prototype.isStorageAndTrackEnabled=function(){return!!this.storage&&!!this.shouldTrack},e.prototype.setTag=function(t,r){if(this.isStorageAndTrackEnabled()){if
4(Object.keys(this.inMemoryTags).length>=1e4){this.logger.debug("DiagnosticsClient: Early return setTags as reaching memory limit");return}this.inMemoryTags[t]=r,this.startTimersIfNeeded()}},e.prototype.increment=function(t,r){if(r===void 0&&(r=1),!!this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryCounters).length>=1e4){this.logger.debug("DiagnosticsClient: Early return increment as reaching memory limit");return}this.inMemoryCounters[t]=(this.inMemoryCounters[t]||0)+r,this.startTimersIfNeeded()}},e.prototype.recordHistogram=function(t,r){if(this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryHistograms).length>=1e4){this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");return}var n=this.inMemoryHistograms[t];n?(n.count+=1,n.min=Math.min(n.min,r),n.max=Math.max(n.max,r),n.sum+=r):this.inMemoryHistograms[t]={count:1,min:r,max:r,sum:r},this.startTimersIfNeeded()}},e.prototype.recordEvent=function(t,r){if(this.isStorageAndTrackEnabled()){if(this.inMemoryEvents.length>=10){this.logger.debug("DiagnosticsClient: Early return recordEvent as reaching memory limit");return}this.inMemoryEvents.push({event_name:t,time:Date.now(),event_properties:r}),this.startTimersIfNeeded()}},e.prototype.startTimersIfNeeded=function(){var t=this;this.saveTimer||(this.saveTimer=setTimeout(function(){t.saveAllDataToStorage().catch(function(r){t.logger.debug("DiagnosticsClient: Failed to save all data to storage",r)}).finally(function(){t.saveTimer=null})},Mo)),this.flushTimer||(this.flushTimer=setTimeout(function(){t._flush().catch(function(r){t.logger.debug("DiagnosticsClient: Failed to flush",r)}).finally(function(){t.flushTimer=null})},Pt))},e.prototype.saveAllDataToStorage=function(){return E(this,void 0,void 0,function(){var t,r,n,i;return b(this,function(o){switch(o.label){case 0:return this.storage?(t=w({},this.inMemoryTags),r=w({},this.inMemoryCounters),n=w({},this.inMemoryHistograms),i=L([],I(this.inMemoryEvents),!1),this.inMemoryEvents=[],this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},[4,Promise.all([this.storage.setTags(t),this.storage.incrementCounters(r),this.storage.setHistogramStats(n),this.storage.addEventRecords(i)])]):[2];case 1:return o.sent(),[2]}})})},e.prototype._flush=function(){return E(this,void 0,void 0,function(){var t,r,n,i,o,a,s,c,u,l;return b(this,function(f){switch(f.label){case 0:return this.storage?[4,this.saveAllDataToStorage()]:[2];case 1:return f.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:return t=f.sent(),r=t.tags,n=t.counters,i=t.histogramStats,o=t.events,this.storage.setLastFlushTimestamp(Date.now()),a={},r.forEach(function(d){a[d.key]=d.value}),s={},n.forEach(function(d){s[d.key]=d.value}),c={},i.forEach(function(d){c[d.key]={count:d.count,min:d.min,max:d.max,avg:Math.round(d.sum/d.count*100)/100}}),u=o.map(function(d){return{event_name:d.event_name,time:d.time,event_properties:d.event_properties}}),Object.keys(s).length===0&&Object.keys(c).length===0&&u.length===0?[2]:(l={tags:a,histogram:c,counters:s,events:u},this.fetch(l),[2])}})})},e.prototype.fetch=function(t){return E(this,void 0,void 0,function(){var r,n;return b(this,function(i){switch(i.label){case 0:if(i.trys.push([0,2,,3]),!$())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(t)})];case 1:return r=i.sent(),r.ok?(this.logger.debug("DiagnosticsClient: Successfully sent diagnostics data"),[3,3]):(this.logger.debug("DiagnosticsClient: Failed to send diagnostics data."),[2]);case 2:return n=i.sent(),this.logger.debug("DiagnosticsClient: Failed to send diagnostics data. ",n),[3,3];case 3:return[2]}})})},e.prototype.initializeFlushInterval=function(){return E(this,void 0,void 0,function(){var t,r,n;return b(this,function(i){switch(i.label){case 0:return this.storage?(t=Date.now(),[4,this.storage.getLastFlushTimestamp()]):[2];case 1:return r=i.sent()||-1,r===-1?(this.storage.setLastFlushTimestamp(t),this._setFlushTimer(Pt),[2]):(n=t-r,n>=3e5?(this._flush(),[2]):(this._setFlushTimer(Pt-n),[2]))}})})},e.prototype._setFlushTimer=function(t){var r=this;this.flushTimer=setTimeout(function(){r._flush().catch(function(n){r.logger.debug("DiagnosticsClient: Failed to flush",n)}).finally(function(){r.flushTimer=null})},t)},e.prototype._setSampleRate=function(t){this.logger.debug("DiagnosticsClient: Setting sample rate to",t),this.config.sampleRate=t,this.shouldTrack=Dr(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e})(),tr=(function(){function e(){}return e.prototype.send=function(t,r){return Promise.resolve(null)},e.prototype.buildResponse=function(t){var r,n,i,o,a,s,c,u,l,f,d,v,h,g,y,m,p,T,S,A,_,O;if(typeof t!="object")return null;var C=t.code||0,D=this.buildStatus(C);switch(D){case K.Success:return{status:D,statusCode:C,body:{eventsIngested:(r=t.events_ingested)!==null&&r!==void 0?r:0,payloadSizeBytes:(n=t.payload_size_bytes)!==null&&n!==void 0?n:0,serverUploadTime:(i=t.server_upload_time)!==null&&i!==void 0?i:0}};case K.Invalid:return{status:D,statusCode:C,body:{error:(o=t.error)!==null&&o!==void 0?o:"",missingField:(a=t.missing_field)!==null&&a!==void 0?a:"",eventsWithInvalidFields:(s=t.events_with_invali
vendor: 5,991 bytes, line 4
4d_fields)!==null&&s!==void 0?s:{},eventsWithMissingFields:(c=t.events_with_missing_fields)!==null&&c!==void 0?c:{},eventsWithInvalidIdLengths:(u=t.events_with_invalid_id_lengths)!==null&&u!==void 0?u:{},epsThreshold:(l=t.eps_threshold)!==null&&l!==void 0?l:0,exceededDailyQuotaDevices:(f=t.exceeded_daily_quota_devices)!==null&&f!==void 0?f:{},silencedDevices:(d=t.silenced_devices)!==null&&d!==void 0?d:[],silencedEvents:(v=t.silenced_events)!==null&&v!==void 0?v:[],throttledDevices:(h=t.throttled_devices)!==null&&h!==void 0?h:{},throttledEvents:(g=t.throttled_events)!==null&&g!==void 0?g:[]}};case K.PayloadTooLarge:return{status:D,statusCode:C,body:{error:(y=t.error)!==null&&y!==void 0?y:""}};case K.RateLimit:return{status:D,statusCode:C,body:{error:(m=t.error)!==null&&m!==void 0?m:"",epsThreshold:(p=t.eps_threshold)!==null&&p!==void 0?p:0,throttledDevices:(T=t.throttled_devices)!==null&&T!==void 0?T:{},throttledUsers:(S=t.throttled_users)!==null&&S!==void 0?S:{},exceededDailyQuotaDevices:(A=t.exceeded_daily_quota_devices)!==null&&A!==void 0?A:{},exceededDailyQuotaUsers:(_=t.exceeded_daily_quota_users)!==null&&_!==void 0?_:{},throttledEvents:(O=t.throttled_events)!==null&&O!==void 0?O:[]}};case K.Timeout:default:return{status:D,statusCode:C}}},e.prototype.buildStatus=function(t){return kn(t)?K.Success:t===429?K.RateLimit:t===413?K.PayloadTooLarge:t===408?K.Timeout:t>=400&&t<500?K.Invalid:t>=500?K.Failed:K.Unknown},e})(),jo=(function(e){re(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.send=function(r,n){return E(this,void 0,void 0,function(){var i,o,a;return b(this,function(s){switch(s.label){case 0:if(typeof fetch>"u")throw new Error("FetchTransport is not supported");return i={headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(n),method:"POST"},[4,fetch(r,i)];case 1:return o=s.sent(),[4,o.text()];case 2:a=s.sent();try{return[2,this.buildResponse(JSON.parse(a))]}catch{return[2,this.buildResponse({code:o.status})]}return[2]}})})},t})(tr),Ho=(function(){function e(t,r){this.key="AMP_remote_config_".concat(t.substring(0,10)),this.logger=r}return e.prototype.fetchConfig=function(){var t=null,r={remoteConfig:null,lastFetch:new Date};try{t=localStorage.getItem(this.key)}catch(i){return this.logger.debug("Remote config localstorage failed to access: ",i),Promise.resolve(r)}if(t===null)return this.logger.debug("Remote config localstorage gets null because the key does not exist"),Promise.resolve(r);try{var n=JSON.parse(t);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(n))),Promise.resolve({remoteConfig:n.remoteConfig,lastFetch:new Date(n.lastFetch)})}catch(i){return this.logger.debug("Remote config localstorage failed to parse: ",i),localStorage.removeItem(this.key),Promise.resolve(r)}},e.prototype.setConfig=function(t){try{return localStorage.setItem(this.key,JSON.stringify(t)),this.logger.debug("Remote config localstorage set successfully."),Promise.resolve(!0)}catch(r){this.logger.debug("Remote config localstorage failed to set: ",r)}return Promise.resolve(!1)},e})();var Bo=1e3,Go=(function(){function e(t,r,n,i){n===void 0&&(n="US"),this.callbackInfos=[],this.apiKey=t,this.serverUrl=i||(n==="US"?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=r,this.storage=new Ho(t,r)}return e.prototype.subscribe=function(t,r,n){var i=we(),o={id:i,key:t,deliveryMode:r,callback:n};return this.callbackInfos.push(o),r==="all"?this.subscribeAll(o):this.subscribeWaitForRemote(o,r.timeout),i},e.prototype.unsubscribe=function(t){var r=this.callbackInfos.findIndex(function(n){return n.id===t});return r===-1?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(t," doesn't exist.")),!1):(this.callbackInfos.splice(r,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(t,".")),!0)},e.prototype.updateConfigs=function(){return E(this,void 0,void 0,function(){var t,r=this;return b(this,function(n){switch(n.label){case 0:return[4,this.fetch()];case 1:return t=n.sent(),this.storage.setConfig(t),this.callbackInfos.forEach(function(i){r.sendCallback(i,t,"remote")}),[2]}})})},e.prototype.subscribeAll=function(t){return E(this,void 0,void 0,function(){var r,n,i,o=this;return b(this,function(a){switch(a.label){case 0:return r=this.fetch().then(function(s){o.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(s))),o.sendCallback(t,s,"remote"),o.storage.setConfig(s)}),n=this.storage.fetchConfig().then(function(s){return s}),[4,Promise.race([r,n])];case 1:return i=a.sent(),i!==void 0&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(i))),this.sendCallback(t,i,"cache")),[4,r];case 2:return a.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(t,r){return E(this,void 0,void 0,function(){var n,i,i;return b(this,function(o){switch(o.label){case 0:n=new Promise(function(a,s){setTimeout(function(){s("Timeout exceeded")},r)}),o.label=1;case 1:return o.trys.push([1,3,,5]),[4,Promise.race([this.fetch(),n])];case 2:return i=o.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(t,i,"remote"),this.storage.setConfig(i),[3,5];case 3:return o.sent(),this.logger.debug("Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache."),[4,this.storage.fetchConfig()];case 4:return i=o.sent(),i.remoteConfig!==null?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(t,i,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(t,i,"remote")),[3,5];case 5:return[2]}})})},e.prototype.sendCallback=function(t,r,n){t.lastCallback=new Date;var i;
4t.key?i=t.key.split(".").reduce(function(o,a){return o===null?o:a in o?o[a]:null},r.remoteConfig):i=r.remoteConfig,t.callback(i,n,r.lastFetch)},e.prototype.fetch=function(t,r){return t===void 0&&(t=3),r===void 0&&(r=Bo),E(this,void 0,void 0,function(){var n,i,o,a,s,c,u=this;return b(this,function(l){switch(l.label){case 0:n=r/t,i={remoteConfig:null,lastFetch:new Date},o=function(f){var d,v,h,g,y,m;return b(this,function(p){switch(p.label){case 0:d=new AbortController,v=setTimeout(function(){return d.abort()},r),p.label=1;case 1:return p.trys.push([1,7,8,9]),[4,fetch(a.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:d.signal})];case 2:return h=p.sent(),h.ok?[3,4]:[4,h.text()];case 3:return g=p.sent(),a.logger.debug("Remote config client fetch with retry time ".concat(t," failed with ").concat(h.status,": ").concat(g)),[3,6];case 4:return[4,h.json()];case 5:return y=p.sent(),[2,{value:{remoteConfig:y,lastFetch:new Date}}];case 6:return[3,9];case 7:return m=p.sent(),m instanceof Error&&m.name==="AbortError"?a.logger.debug("Remote config client fetch with retry time ".concat(t," timed out after ").concat(r,"ms")):a.logger.debug("Remote config client fetch with retry time ".concat(t," is rejected because: "),m),[3,9];case 8:return clearTimeout(v),[7];case 9:return f<t-1?[4,new Promise(function(T){return setTimeout(T,u.getJitterDelay(n))})]:[3,11];case 10:p.sent(),p.label=11;case 11:return[2]}})},a=this,s=0,l.label=1;case 1:return s<t?[5,o(s)]:[3,4];case 2:if(c=l.sent(),typeof c=="object")return[2,c.value];l.label=3;case 3:return s++,[3,1];case 4:return[2,i]}})})},e.prototype.getJitterDelay=function(t){return Math.floor(Math.random()*t)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),r=new URLSearchParams;return r.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(r.toString())},e.CONFIG_GROUP="browser",e})(),Wo=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],Dn="data-amp-track-",Ko=["div","span","h1","h2","h3","h4","h5","h6"],$o=["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]'],zo=L(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],I($o),!1),Yo=["*"],Xo=1e3;function Jo(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||e===null||e===void 0}function xn(e,t,r){e&&Nn({json:e,allowlist:t.map(Mr),excludelist:r.map(Mr),ancestors:[]})}function Nn(e){var t,r,n=e.json,i=e.targetObject,o=e.allowlist,a=e.excludelist,s=e.ancestors,c=e.parentObject,u=e.targetKey;i||(i=n);var l=Object.keys(i);try{for(var f=x(l),d=f.next();!d.done;d=f.next()){var v=d.value,h=L(L([],I(s),!1),[v],!1);Jo(i[v])?(!Fr(h,o)||Fr(h,a))&&delete i[v]:Nn({json:n,targetObject:i[v],allowlist:o,excludelist:a,ancestors:h,parentObject:i,targetKey:v})}}catch(g){t={error:g}}finally{try{d&&!d.done&&(r=f.return)&&r.call(f)}finally{if(t)throw t.error}}Object.keys(i).length===0&&c&&u&&delete c[u]}function Mr(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map(function(t){return t.replace(/~0/g,"~").replace(/~1/g,"/")})}function Wt(e,t,r,n){if(r===void 0&&(r=0),n===void 0&&(n=0),n===t.length)return r===e.length;if(r===e.length){for(;n<t.length&&t[n]==="**";)n++;return n===t.length}var i=t[n];if(i==="**"){if(n+1===t.length)return!0;for(var o=r;o<=e.length;o++)if(Wt(e,t,o,n+1))return!0;return!1}else return i==="*"||i===e[r]?Wt(e,t,r+1,n+1):!1}function Fr(e,t){return t.some(function(r){return Wt(e,r)})}var Qo=500;var Zo=(function(){function e(t){this.request=t}return e.prototype.headers=function(t){var r,n;t===void 0&&(t=[]);var i=this.request.headers,o={};if(Array.isArray(i))i.forEach(function(l){var f=I(l,2),d=f[0];o[d]=f[1]});else if(i instanceof Headers)i.forEach(function(l,f){o[f]=l});else if(typeof i=="object"&&i!==null)try{for(var a=x(Object.entries(i)),s=a.next();!s.done;s=a.next()){var c=I(s.value,2),u=c[0];o[u]=c[1]}}catch(l){r={error:l}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return yt(o,{allow:t})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if(typeof this._bodySize=="number")return this._bodySize;var t=$();if(t?.TextEncoder){var r=this.request.body;return this._bodySize=Un(r,100),this._bodySize}}
4,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 typeof this.request.body=="string"?this.request.body:null},enumerable:!1,configurable:!0}),e.prototype.json=function(t,r){return t===void 0&&(t=[]),r===void 0&&(r=[]),E(this,void 0,void 0,function(){var n;return b(this,function(i){return t.length===0?[2,null]:(n=this.body,[2,rr(n,t,r)])})})},e})(),ea=(function(){function e(t,r){this.bodyRaw=t,this.requestHeaders=r}return e.prototype.headers=function(t){return t===void 0&&(t=[]),yt(this.requestHeaders,{allow:t})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return Un(this.bodyRaw,100)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return typeof this.bodyRaw=="string"?this.bodyRaw:null},enumerable:!1,configurable:!0}),e.prototype.json=function(t,r){return t===void 0&&(t=[]),r===void 0&&(r=[]),E(this,void 0,void 0,function(){var n;return b(this,function(i){return t.length===0?[2,null]:(n=this.body,[2,rr(n,t,r)])})})},e})();
4function Un(e,t){var r,n,i,o=$(),a=o?.TextEncoder;if(a){var s;if(typeof e=="string")s=e,i=new a().encode(s).length;else if(e instanceof Blob)s=e,i=s.size;else if(e instanceof URLSearchParams)s=e,i=new a().encode(s.toString()).length;else if(ArrayBuffer.isView(e))s=e,i=s.byteLength;else if(e instanceof ArrayBuffer)s=e,i=s.byteLength;else if(e instanceof FormData){var c=e,u=0,l=0;try{for(var f=x(c.entries()),d=f.next();!d.done;d=f.next()){var v=I(d.value,2),h=v[0],g=v[1];if(u+=h.length,typeof g=="string")u+=new a().encode(g).length;else if(g instanceof Blob)u+=g.size;else return;if(++l>=t)return}}catch(y){r={error:y}}finally{try{d&&!d.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}i=u}else if(e instanceof ReadableStream){s=e;return}return i}}var ta=(function(){function e(t){this.response=t}return e.prototype.headers=function(t){var r;if(t===void 0&&(t=[]),this.response.headers instanceof Headers){var n=this.response.headers,i={};return(r=n?.forEach)===null||r===void 0||r.call(n,function(o,a){i[a]=o}),yt(i,{allow:t})}},Object.defineProperty(e.prototype,"bodySize",{get:function(){var t,r;if(this._bodySize!==void 0)return this._bodySize;var n=(r=(t=this.response.headers)===null||t===void 0?void 0:t.get)===null||r===void 0?void 0:r.call(t,"content-length"),i=n?parseInt(n,10):void 0;return this._bodySize=i,i},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.response.status},enumerable:!1,configurable:!0}),e.prototype.text=function(){return E(this,void 0,void 0,function(){var t,r,n;return b(this,function(i){switch(i.label){case 0:this.clonedResponse||(this.clonedResponse=this.response.clone()),i.label=1;case 1:return i.trys.push([1,3,,4]),t=this.clonedResponse.text(),r=new Promise(function(o){return setTimeout(function(){return o(null)},Qo)}),[4,Promise.race([t,r])];case 2:return n=i.sent(),[2,n];case 3:return i.sent(),[2,null];case 4:return[2]}})})},e.prototype.json=function(t,r){return t===void 0&&(t=[]),r===void 0&&(r=[]),E(this,void 0,void 0,function(){var n;return b(this,function(i){switch(i.label){case 0:return t.length===0?[2,null]:[4,this.text()];case 1:return n=i.sent(),[2,rr(n,t,r)]}})})},e})(),ra=(function(){function e(t,r,n,i){this.statusCode=t,this.headersString=r,this.size=n,this.getJson=i}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(t){var r,n;if(t===void 0&&(t=[]),!this.headersString)return{};var i={},o=this.headersString.split(`\r
5`);try{for(var a=x(o),s=a.next();!s.done;s=a.next()){var c=s.value,u=I(c.split(": "),2),l=u[0],f=u[1];l&&f&&(i[l]=f)}}catch(d){r={error:d}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return yt(i,{allow:t})},e.prototype.json=function(t,r){return t===void 0&&(t=[]),r===void 0&&(r=[]),E(this,void 0,void 0,function(){var n;return b(this,function(i){return t.length===0?[2,null]:(n=this.getJson(),n?(xn(n,t,r),[2,n]):[2,null])})})},e})();function rr(e,t,r){if(!e)return null;try{var n=JSON.parse(e);return xn(n,t,r),n}catch{return null}}var je;(function(e){e.REDACT="redact",e.REMOVE="remove"})(je||(je={}));var qr="[REDACTED]",yt=function(e,t){var r,n,i=t.allow,o=i===void 0?[]:i,a=t.strategy,s=a===void 0?je.REMOVE:a,c=L([],I(zi),!1),u={},l=function(h){var g=h.toLowerCase();c.find(function(y){return y.toLowerCase()===g})?s===je.REDACT&&(u[h]=qr):o.find(function(y){return y.toLowerCase()===g})?u[h]=e[h]:s===je.REDACT&&(u[h]=qr)};try{for(var f=x(Object.keys(e)),d=f.next();!d.done;d=f.next()){var v=d.value;l(v)}}catch(h){r={error:h}}finally{try{d&&!d.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}return u},na=(function(){function e(t,r,n,i,o,a,s,c,u,l,f){s===void 0&&(s=0),this.type=t,this.method=r,this.timestamp=n,this.startTime=i,this.url=o,this.requestWrapper=a,this.status=s,this.duration=c,this.responseWrapper=u,this.error=l,this.endTime=f}return e.prototype.toSerializable=function(){var t,r,n,i,o={type:this.t
5ype,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:(t=this.requestWrapper)===null||t===void 0?void 0:t.headers(L([],I(lt),!1)),requestBodySize:(r=this.requestWrapper)===null||r===void 0?void 0:r.bodySize,responseHeaders:(n=this.responseWrapper)===null||n===void 0?void 0:n.headers(L([],I(lt),!1)),responseBodySize:(i=this.responseWrapper)===null||i===void 0?void 0:i.bodySize};return Object.fromEntries(Object.entries(o).filter(function(a){var s=I(a,2);return s[0],s[1]!==void 0}))},e})();function ia(e){return typeof e=="object"&&e!==null&&"url"in e&&"method"in e}var oa=(function(){function e(t,r){r===void 0&&(r=we()),this.callback=t,this.id=r}return e})(),aa=(function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var r=$();e.isSupported()&&(this.globalScope=r)}return e.isSupported=function(){var t=$();return!!t&&!!t.fetch},e.prototype.subscribe=function(t,r){var n,i,o,a,s,c,u,l,f,d;if(this.logger||(this.logger=r),this.eventCallbacks.set(t.id,t),!this.isObserving){var v=(o=(i=(n=this.globalScope)===null||n===void 0?void 0:n.XMLHttpRequest)===null||i===void 0?void 0:i.prototype)===null||o===void 0?void 0:o.open,h=(c=(s=(a=this.globalScope)===null||a===void 0?void 0:a.XMLHttpRequest)===null||s===void 0?void 0:s.prototype)===null||c===void 0?void 0:c.send,g=(f=(l=(u=this.globalScope)===null||u===void 0?void 0:u.XMLHttpRequest)===null||l===void 0?void 0:l.prototype)===null||f===void 0?void 0:f.setRequestHeader;v&&h&&g&&this.observeXhr(v,h,g);var y=(d=this.globalScope)===null||d===void 0?void 0:d.fetch;y&&this.observeFetch(y),this.isObserving=!0}},e.prototype.unsubscribe=function(t){this.eventCallbacks.delete(t.id)},e.prototype.triggerEventCallbacks=function(t){var r=this;this.eventCallbacks.forEach(function(n){var i;try{n.callback(t)}catch(o){(i=r.logger)===null||i===void 0||i.debug("an unexpected error occurred while triggering event callbacks",o)}})},e.prototype.handleNetworkRequestEvent=function(t,r,n,i,o,a,s){var c;if(!(a===void 0||s===void 0)){var u,l="GET";if(ia(r)?(u=r.url,l=r.method):u=(c=r?.toString)===null||c===void 0?void 0:c.call(r),u)try{var f=new URL(u);u="".concat(f.protocol,"//").concat(f.host).concat(f.pathname).concat(f.search).concat(f.hash)}catch{}l=n?.method||l;var d,v;i&&(d=i.status),o&&(v={name:o.name||"UnknownError",message:o.message||"An unknown error occurred"},d=0);var h=Math.floor(performance.now()-s),g=Math.floor(a+h),y=new na(t,l,a,a,u,n,d,h,i,v,g);this.triggerEventCallbacks(y)}},e.prototype.getTimestamps=function(){var t,r;return{startTime:(t=Date.now)===null||t===void 0?void 0:t.call(Date),durationStart:(r=performance?.now)===null||r===void 0?void 0:r.call(performance)}},e.prototype.observeFetch=function(t){var r=this;!this.globalScope||!t||(this.globalScope.fetch=function(n,i){return E(r,void 0,void 0,function(){var o,a,s,c,u,l;return b(this,function(f){switch(f.label){case 0:try{o=this.getTimestamps()}catch(d){(u=this.logger)===null||u===void 0||u.debug("an unexpected error occurred while retrieving timestamps",d)}f.label=1;case 1:return f.trys.push([1,3,,4]),[4,t(n,i)];case 2:return a=f.sent(),[3,4];case 3:return c=f.sent(),s=c,[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",n,i?new Zo(i):void 0,a?new ta(a):void 0,s,o?.startTime,o?.durationStart)}catch(d){(l=this.logger)===null||l===void 0||l.debug("an unexpected error occurred while handling fetch",d)}if(a)return[2,a];throw s}})})})},e.createXhrJsonParser=function(t,r){return function(){var n,i;try{if(t.responseType==="json"){if(!((n=r.globalScope)===null||n===void 0)&&n.structuredClone)return r.globalScope.structuredClone(t.response)}else if(["text",""].includes(t.responseType))return JSON.parse(t.responseText)}catch(o){return o instanceof Error&&o.name==="InvalidStateError"&&((i=r.logger)===null||i===void 0||i.error("unexpected error when retrieving responseText. responseType='".concat(t.responseType,"'"))),null}return null}},e.prototype.observeXhr=function(t,r,n){if(!(!this.globalScope||!t||!r)){var i=this.globalScope.XMLHttpRequest.prototype,o=this;i.open=function(){for(var a,s,c=[],u=0;u<arguments.length;u++)c[u]=arguments[u];var l=this,f=I(c,2),d=f[0],v=f[1];try{l.$$AmplitudeAnalyticsEvent=w({method:d,url:(a=v?.toString)===null||a===void 0?void 0:a.call(v),headers:{}},o.getTimestamps())}catch(h){(s=o.logger)===null||s===void 0||s.error("an unexpected error occurred while calling xhr open",h)}return t.apply(l,c)},i.send=function(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];var c=this,u=c,l=e.createXhrJsonParser(c,o),f=a[0],d=u.$$AmplitudeAnalyticsEvent;return u.addEventListener("loadend",function(){var v;try{var h=u.getAllResponseHeaders(),g=u.getResponseHeader("content-length"),y=new ra(u.status,h,g?parseInt(g,10):void 0,l),m=u.$$AmplitudeAnalyticsEvent.headers,p=new ea(f,m);d.status=u.status,o.handleNetworkRequestEvent("xhr",{url:d.url,method:d.method},p,y,void 0,d.startTime,d.durationStart)}catch(T){(v=o.logger)===null||v===void 0||v.error("an unexpected error occurred while handling xhr send",T)}}),r.apply(u,a)},i.setRequestHeader=function(a,s){var c,u=this;try{u.$$AmplitudeAnalyticsEvent.headers[a]=s}catch(l){(c=o.logger)===null||c===void 0||c.error("an unexpected error occurred while calling xhr setRequestHeader",l)}n.apply(u,[a,s])}}},e})(),Vr=new aa,Mn=(function(){function e(){}return e.prototype.parse=function(){return E(this,void 0,void 0,function(){return b(this,function(t){return[2,w(w(w(w({},mt),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var t=dt();return{utm_campaign:t[Hi],utm_content:t[Bi],utm_id:t[Gi],utm_medium:t[Wi],utm_source:t[Ki],utm_term:t[$i]}},e.prototype.getReferrer=function(){var t,r,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=(r=(t=n.referrer)===null||t===void 0?void 0:t.split("/")[2])!==null&&r!==void 0?r:void 0}catch{}return n},e.prototype.getClickIds=function(){var t,r=dt();return t={},t[br]=r[br],t[Er]=r[Er],t[Tr]=r[Tr],t[Sr]=r[Sr],t[wr]=r[wr],t[_r]=r[_r],t[Ir]=r[Ir],t[Ar]=r[Ar],t[Pr]=r[Pr],t[Rr]=r[Rr],t[kr]=r[kr],t},e})(),Fn="data-amp-mask",Se="*****",sa=/\b(?:\d[ -]*?){13,16}\b/,ua=/(\d{3}-?\d{2}-?\d{4})/g,ca=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,nr=function(e,t){var r,n;if(t===void 0&&(t=[]),typeof e!="string")return"";var i=e;i=i.replace(sa,Se),i=i.replace(ua,Se),i=i.replace(ca,Se);try{for(var o=x(t),a=o.next();!a.done;a=o.next()){var s=a.value;try{i=i.replace(s,Se)}catch{}}}catch(c){r={error:c}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},ir=function(e){if(typeof document>"u"||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute("data-amp-mask")?Se:e?e(document.title):document.title};xi();var xe=function(e,t){return typeof e=="boolean"?e:e?.[t]!==!1},qn=function(e){return xe(e,"attribution")},la=function(e){return xe(e,"fileDownloads")},da=function(e){return xe(e,"formInteractions")},Vn=function(e){return xe(e,"pageViews")},jr=function(e){return xe(e,"sessions")},fa=function(e){return xe(e,"pageUrlEnrichment")},jn=function(e){return typeof e=="boolean"?e:typeof e=="object"&&(e.networkTracking===!0||typeof e.networkTracking=="object")},Hn=function(e){return typeof e=="boolean"?e:typeof e=="object"&&(e.elementInteractions===!0||typeof e.elementInteractions=="object")},va=function(e){return typeof e=="boolean"?e:typeof e=="object"&&e.webVitals===!0},Bn=function(e){return typeof e=="boolean"?e:typeof e=="object"&&(e.frustrationInteractions===!0||typeof e.frustrationInteractions=="object")},ha=function(e){if(Hn(e.autocapture)&&typeof e.autocapture=="object"&&typeof e.autocapture.elementInteractions=="object")return e.autocapture.elementInteractions},pa=function(e){if(Bn(e.autocapture)&&typeof e.autocapture=="object"&&typeof e.autocapture.frustrationInteractions=="object")return e.autocapture.frustrationInteractions},ga=function(e){var t;if(jn(e.autocapture)){var r=void 0;
5return typeof e.autocapture=="object"&&typeof e.autocapture.networkTracking=="object"?r=e.autocapture.networkTracking:e.networkTrackingOptions&&(r=e.networkTrackingOptions),w(w({},r),{captureRules:(t=r?.captureRules)===null||t===void 0?void 0:t.map(function(n){var i,o,a;if(!((i=n.urls)===null||i===void 0)&&i.length&&(!((o=n.hosts)===null||o===void 0)&&o.length)){var s=JSON.stringify(n.hosts),c=JSON.stringify(n.urls);return(a=e.loggerProvider)===null||a===void 0||a.warn("Found network capture rule with both urls='".concat(c,"' and hosts='").concat(s,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),w(w({},n),{hosts:void 0})}return n})})}},ma=function(e){var t=function(){return!1},r=void 0,n,i=e.pageCounter;return Vn(e.defaultTracking)&&(t=void 0,n=void 0,e.defaultTracking&&typeof e.defaultTracking=="object"&&e.defaultTracking.pageViews&&typeof e.defaultTracking.pageViews=="object"&&("trackOn"in e.defaultTracking.pageViews&&(t=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(r=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(n=e.defaultTracking.pageViews.eventType))),{trackOn:t,trackHistoryChanges:r,eventType:n,pageCounter:i}},ya=function(e){return qn(e.defaultTracking)&&e.defaultTracking&&typeof e.defaultTracking=="object"&&e.defaultTracking.attribution&&typeof e.defaultTracking.attribution=="object"?w({},e.defaultTracking.attribution):{}},Rt=function(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.name,o=n.args,a=n.resolve,s=e&&e[i];if(typeof s=="function"){var c=s.apply(e,o);typeof a=="function"&&a(c?.promise)}}return e},kt=function(e){var t=e;return t&&t._q!==void 0},or="2.30.1",Gn="amplitude-ts",ba="Web",Ea="$remote",Ta=(function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(Gn,"/").concat(or),typeof navigator<"u"&&(this.userAgent=navigator.userAgent)}return e.prototype.setup=function(t){return this.config=t,Promise.resolve(void 0)},e.prototype.execute=function(t){var r,n;return E(this,void 0,void 0,function(){var i,o,a,s;return b(this,function(c){return i=new Date().getTime(),o=(r=this.config.lastEventId)!==null&&r!==void 0?r:-1,a=(n=t.event_id)!==null&&n!==void 0?n:o+1,this.config.lastEventId=a,t.time||(this.config.lastEventTime=i),s=w(w(w(w(w(w(w(w({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:i},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:ba}),this.config.trackingOptions.language&&{language:Co()}),this.config.trackingOptions.ipAddress&&{ip:Ea}),{insert_id:we(),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}}),t),{event_id:a,library:this.library,user_agent:this.userAgent}),[2,s]})})},e})(),tt=1e3,Wn=(function(e){re(t,e);function t(r){var n=this,i,o,a;try{a=(i=$())===null||i===void 0?void 0:i.localStorage}catch(s){(o=r?.loggerProvider)===null||o===void 0||o.debug("Failed to access localStorage. error=".concat(JSON.stringify(s))),a=void 0}return n=e.call(this,a)||this,n.loggerProvider=r?.loggerProvider,n}return t.prototype.set=function(r,n){var i;return E(this,void 0,void 0,function(){var o;return b(this,function(a){switch(a.label){case 0:return Array.isArray(n)&&n.length>tt?(o=n.length-tt,[4,e.prototype.set.call(this,r,n.slice(0,tt))]):[3,2];case 1:return a.sent(),(i=this.loggerProvider)===null||i===void 0||i.error("Failed to save ".concat(o," events because the queue length exceeded ").concat(tt,".")),[3,4];case 2:return[4,e.prototype.set.call(this,r,n)];case 3:a.sent(),a.label=4;case 4:return[2]}})})},t})(er),Sa=(function(e){re(t,e);function t(){var r;return e.call(this,(r=$())===null||r===void 0?void 0:r.sessionStorage)||this}return t})(er),wa=(function(e){re(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.state={done:4},r}return t.prototype.send=function(r,n){return E(this,void 0,void 0,function(){var i=this;return b(this,function(o){return[2,new Promise(function(a,s){typeof XMLHttpRequest>"u"&&s(new Error("XHRTransport is not supported."));var c=new XMLHttpRequest;c.open("POST",r,!0),c.onreadystatechange=function(){if(c.readyState===i.state.done){var u=c.responseText;try{a(i.buildResponse(JSON.parse(u)))}catch{a(i.buildResponse({code:c.status}))}}},c.setRequestHeader("Content-Type","application/json"),c.setRequestHeader("Accept","*/*"),c.send(JSON.stringify(n))})]})})},t})(tr),_a=(function(e){re(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.send=function(r,n){return E(this,void 0,void 0,function(){var i=this;return b(this,function(o){return[2,new Promise(function(a,s){var c=$();if(!c?.navigator.sendBeacon)throw new Error("SendBeaconTransport is not supported");try{var u=JSON.stringify(n);return c.navigator.sendBeacon(r,JSON.stringify(n))?a(i.buildResponse({code:200,events_ingested:n.events.length,payload_size_bytes:u.length,server_upload_time:Date.now()})):a(i.buildResponse({code:500}))}catch(l){s(l)}})]})})},t})(tr),Ia=function(e,t,r){return r===void 0&&(r=!0),E(void 0,void 0,void 0,function(){var n,i,o,a,s,c,u,l,f;return b(this,function(d){switch(d.label){case 0:return n=Oo(e),[4,t.getRaw(n)];case 1:return i=d.sent(),i?r?[4,t.remove(n)]:[3,3]:[2,{optOut:!1}];case 2:d.sent(),d.label=3;
5case 3:return o=I(i.split("."),6),a=o[0],s=o[1],c=o[2],u=o[3],l=o[4],f=o[5],[2,{deviceId:a,userId:Aa(s),sessionId:Ot(u),lastEventId:Ot(f),lastEventTime:Ot(l),optOut:!!c}]}})})},Ot=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},Aa=function(e){if(!(!atob||!escape||!e))try{return decodeURIComponent(escape(atob(e)))}catch{return}},se="[Amplitude]",Hc="".concat(se," Page Viewed"),Hr="".concat(se," Form Started"),Pa="".concat(se," Form Submitted"),Ra="".concat(se," File Downloaded"),ka="session_start",Oa="session_end",Ca="".concat(se," File Extension"),La="".concat(se," File Name"),Da="".concat(se," Link ID"),xa="".concat(se," Link Text"),Na="".concat(se," Link URL"),Ct="".concat(se," Form ID"),Lt="".concat(se," Form Name"),Dt="".concat(se," Form Destination"),Kn="cookie",Ua=(function(e){re(t,e);function t(r,n,i,o,a,s,c,u,l,f,d,v,h,g,y,m,p,T,S,A,_,O,C,D,P,k,U,z,W,M,G,ue,ce,ae,de,fe,me,Q,Z,Ue){i===void 0&&(i=new Zt),o===void 0&&(o={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),u===void 0&&(u=1e3),l===void 0&&(l=5),f===void 0&&(f=30),d===void 0&&(d=Kn),m===void 0&&(m=new Pn),p===void 0&&(p=oe.Warn),S===void 0&&(S=!1),A===void 0&&(A=!1),C===void 0&&(C=""),D===void 0&&(D="US"),k===void 0&&(k=1800*1e3),U===void 0&&(U=new Wn({loggerProvider:m})),z===void 0&&(z={ipAddress:!0,language:!0,platform:!0}),W===void 0&&(W="fetch"),M===void 0&&(M=!1),G===void 0&&(G=!0),me===void 0&&(me=!0),Q===void 0&&(Q=0);var R=e.call(this,{apiKey:r,storageProvider:U,transportProvider:$n(W)})||this;return R.apiKey=r,R.appVersion=n,R.cookieOptions=o,R.defaultTracking=a,R.autocapture=s,R.flushIntervalMillis=u,R.flushMaxRetries=l,R.flushQueueSize=f,R.identityStorage=d,R.ingestionMetadata=v,R.instanceName=h,R.loggerProvider=m,R.logLevel=p,R.minIdLength=T,R.offline=S,R.partnerId=_,R.plan=O,R.serverUrl=C,R.serverZone=D,R.sessionTimeout=k,R.storageProvider=U,R.trackingOptions=z,R.transport=W,R.useBatch=M,R.fetchRemoteConfig=G,R.networkTrackingOptions=de,R.identify=fe,R.enableDiagnostics=me,R.diagnosticsSampleRate=Q,R.diagnosticsClient=Z,R.remoteConfig=Ue,R.version=or,R._optOut=!1,R._cookieStorage=i,R.deviceId=c,R.lastEventId=g,R.lastEventTime=y,R.optOut=A,R.sessionId=P,R.pageCounter=ce,R.userId=ue,R.debugLogsEnabled=ae,R.loggerProvider.enable(ae?oe.Debug:R.logLevel),R.networkTrackingOptions=de,R.identify=fe,R.enableDiagnostics=me,R.diagnosticsSampleRate=Q,R.diagnosticsClient=Z,G&&(R.remoteConfig||(R.remoteConfig={fetchRemoteConfig:G}),R.remoteConfig.fetchRemoteConfig||(R.remoteConfig.fetchRemoteConfig=G)),R}return Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(r){this._cookieStorage!==r&&(this._cookieStorage=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(r){this._deviceId!==r&&(this._deviceId=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(r){this._userId!==r&&(this._userId=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(r){this._sessionId!==r&&(this._sessionId=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(r){this._optOut!==r&&(this._optOut=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(r){this._lastEventTime!==r&&(this._lastEventTime=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(r){this._lastEventId!==r&&(this._lastEventId=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageCounter",{get:function(){return this._pageCounter},set:function(r){this._pageCounter!==r&&(this._pageCounter=r,this.updateStorage())}
5,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugLogsEnabled",{set:function(r){this._debugLogsEnabled!==r&&(this._debugLogsEnabled=r,this.updateStorage())},enumerable:!1,configurable:!0}),t.prototype.updateStorage=function(){var r={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled};this.cookieStorage.set(Ln(this.apiKey),r)},t})(vo),Ma=function(e,t,r){return t===void 0&&(t={}),E(void 0,void 0,void 0,function(){var n,i,o,a,s,c,u,l,f,d,v,h,g,y,m,p,T,S,A,_,O,C,D,P,k,U,z,W,M,G,ue,ce,ae,de,fe,me,Q,Z,Ue,R,St,wt,_t,It,At;return b(this,function(_e){switch(_e.label){case 0:return n=t.identityStorage||"cookie",O={},n==="cookie"?[3,1]:(o="",[3,5]);case 1:return(D=(C=t.cookieOptions)===null||C===void 0?void 0:C.domain)!==null&&D!==void 0?(a=D,[3,4]):[3,2];case 2:return[4,qa()];case 3:a=_e.sent(),_e.label=4;case 4:o=a,_e.label=5;case 5:return i=w.apply(void 0,[(O.domain=o,O.expiration=365,O.sameSite="Lax",O.secure=!1,O.upgrade=!0,O),t.cookieOptions]),s=Fa(t.identityStorage,i),[4,Ia(e,s,(k=(P=t.cookieOptions)===null||P===void 0?void 0:P.upgrade)!==null&&k!==void 0?k:!0)];case 6:return c=_e.sent(),[4,s.get(Ln(e))];case 7:return u=_e.sent(),l=dt(),f=l.ampTimestamp?Number(l.ampTimestamp):void 0,d=f?Date.now()<f:!0,v=(G=(M=(W=(U=t.deviceId)!==null&&U!==void 0?U:d?(z=l.ampDeviceId)!==null&&z!==void 0?z:l.deviceId:void 0)!==null&&W!==void 0?W:u?.deviceId)!==null&&M!==void 0?M:c.deviceId)!==null&&G!==void 0?G:we(),h=(ue=u?.lastEventId)!==null&&ue!==void 0?ue:c.lastEventId,g=(ce=u?.lastEventTime)!==null&&ce!==void 0?ce:c.lastEventTime,y=(de=(ae=t.optOut)!==null&&ae!==void 0?ae:u?.optOut)!==null&&de!==void 0?de:c.optOut,m=(fe=u?.sessionId)!==null&&fe!==void 0?fe:c.sessionId,p=(Q=(me=t.userId)!==null&&me!==void 0?me:u?.userId)!==null&&Q!==void 0?Q:c.userId,r.previousSessionDeviceId=(Z=u?.deviceId)!==null&&Z!==void 0?Z:c.deviceId,r.previousSessionUserId=(Ue=u?.userId)!==null&&Ue!==void 0?Ue:c.userId,T={ipAddress:(St=(R=t.trackingOptions)===null||R===void 0?void 0:R.ipAddress)!==null&&St!==void 0?St:!0,language:(_t=(wt=t.trackingOptions)===null||wt===void 0?void 0:wt.language)!==null&&_t!==void 0?_t:!0,platform:(At=(It=t.trackingOptions)===null||It===void 0?void 0:It.platform)!==null&&At!==void 0?At:!0},S=u?.pageCounter,A=u?.debugLogsEnabled,t.autocapture!==void 0&&(t.defaultTracking=t.autocapture),_=new Ua(e,t.appVersion,s,i,t.defaultTracking,t.autocapture,v,t.flushIntervalMillis,t.flushMaxRetries,t.flushQueueSize,n,t.ingestionMetadata,t.instanceName,h,g,t.loggerProvider,t.logLevel,t.minIdLength,t.offline,y,t.partnerId,t.plan,t.serverUrl,t.serverZone,m,t.sessionTimeout,t.storageProvider,T,t.transport,t.useBatch,t.fetchRemoteConfig,p,S,A,t.networkTrackingOptions,t.identify,t.enableDiagnostics,void 0,void 0,t.remoteConfig),[4,_.storageProvider.isEnabled()];case 8:return _e.sent()||(_.loggerProvider.warn("Storage provider ".concat(_.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),_.storageProvider=new Zt),[2,_]}})})},Fa=function(e,t){switch(e===void 0&&(e=Kn),t===void 0&&(t={}),e){case"localStorage":return new Wn;case"sessionStorage":return new Sa;case"none":return new Zt;default:return new Gt(w(w({},t),{expirationDays:t.expiration}))}},$n=function(e){return e==="xhr"?new wa:e==="beacon"?new _a:new jo},qa=function(e){return E(void 0,void 0,void 0,function(){var t,r,n,i,o,o,a,s,c,u;return b(this,function(l){switch(l.label){case 0:return[4,new Gt().isEnabled()];case 1:if(!l.sent()||!e&&(typeof location>"u"||!location.hostname))return[2,""];for(t=e??location.hostname,r=t.split("."),n=[],i="AMP_TLDTEST",o=r.length-2;o>=0;--o)n.push(r.slice(o).join("."));o=0,l.label=2;case 2:return o<n.length?(a=n[o],s={domain:"."+a},c=new Gt(s),[4,c.set(i,1)]):[3,7];case 3:return l.sent(),[4,c.get(i)];case 4:return u=l.sent(),u?[4,c.remove(i)]:[3,6];case 5:return l.sent(),[2,"."+a];case 6:return o++,[3,2];case 7:return[2,""]}})})},Va=function(e){var t={};for(var r in e){var n=e[r];n&&(t[r]=n)}return t},ja="[Amplitude] Page Viewed",Ha=function(e){e===void 0&&(e={});var t,r=$(),n=void 0,i=!1,o,a=e.trackOn,s=e.trackHistoryChanges,c=e.eventType,u=c===void 0?ja:c,l=function(y){var m=y;try{m=decodeURI(y)}catch(p){n?.error("Malformed URI sequence: ",p)}return m},f=function(){return E(void 0,void 0,void 0,function(){var y,m,p;return b(this,function(T){switch(T.label){case 0:return y=l(typeof location<"u"&&location.href||""),p={event_type:u},m=[{}],[4,Ba()];case 1:return[2,(p.event_properties=w.apply(void 0,[w.apply(void 0,m.concat([T.sent()])),{"[Amplitude] Page Domain":typeof location<"u"&&location.hostname||"","[Amplitude] Page Location":y,"[Amplitude] Page Path":typeof location<"u"&&l(location.pathname)||"","[Amplitude] Page Title":ir(nr),"[Amplitude] Page URL":y.split("?")[0]}]),p)]}})})},d=function(){return typeof a>"u"||typeof a=="function"&&a()},v=typeof location<"u"?location.href:null,h=function(){return E(void 0,void 0,void 0,function(){var y,m,p,T;return b(this,function(S){switch(S.label){case 0:return y=location.href,m=Wa(s,y,v||"")&&d(),v=y,m?(n?.log("Tracking page view event"),t!=null?[3,1]:[3,3]):[3,4];case 1:return T=(p=t).track,[4,f()];case 2:T.apply(p,[S.sent()]),S.label=3;case 3:S.label=4;case 4:return[2]}})})},g=function(){h()};return{name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(y,m){return E(void 0,void 0,void 0,function(){var p,T;return b(this,function(S){switch(S.label){case 0:return t=m,o=y,n=y.loggerProvider,n.log("Installing @amplitude/plugin-page-view-tracking-browser"),i=!0,r&&(r.addEventListener("popstate",g),r.history.pushState=new Proxy(r.history.pushState,{apply:function(A,_,O){var C=I(O,3),D=C[0],P=C[1],k=C[2];A.apply(_,[D,P,k]),i&&h()}})),d()?(n.log("Tracking page view event"),T=(p=t).track,[4,f()]):[3,2];case 1:T.apply(p,[S.sent()]),S.label=2;case 2:return[2]}})})},execute:function(y){return E(void 0,void 0,void 0,function(){var m;return b(this,function(p){switch(p.label){case 0:return a==="attribution"&&Ga(y)?(n?.log("Enriching c
5ampaign event to page view event with campaign parameters"),[4,f()]):[3,2];case 1:m=p.sent(),y.event_type=m.event_type,y.event_properties=w(w({},y.event_properties),m.event_properties),p.label=2;case 2:return o&&y.event_type===u&&(o.pageCounter=o.pageCounter?o.pageCounter+1:1,y.event_properties=w(w({},y.event_properties),{"[Amplitude] Page Counter":o.pageCounter})),[2,y]}})})},teardown:function(){return E(void 0,void 0,void 0,function(){return b(this,function(y){return r&&(r.removeEventListener("popstate",g),i=!1),[2]})})}}},Ba=function(){return E(void 0,void 0,void 0,function(){var e;return b(this,function(t){switch(t.label){case 0:return e=Va,[4,new Mn().parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}})})},Ga=function(e){if(e.event_type==="$identify"&&e.user_properties){var t=e.user_properties,r=t[Te.SET]||{},n=t[Te.UNSET]||{},i=L(L([],I(Object.keys(r)),!1),I(Object.keys(n)),!1);return Object.keys(mt).every(function(o){return i.includes(o)})}return!1},Wa=function(e,t,r){switch(e){case"pathOnly":if(r=="")return!0;var n=new URL(t),i=new URL(r);return n.origin+n.pathname!==i.origin+i.pathname;default:return t!==r}},Ka=function(){var e,t=[],r=function(u,l,f){u.addEventListener(l,f),t.push({element:u,type:l,handler:f})},n=function(){t.forEach(function(u){var l=u.element,f=u.type,d=u.handler;l?.removeEventListener(f,d)}),t=[]},i="@amplitude/plugin-form-interaction-tracking-browser",o="enrichment",a=function(u,l){return E(void 0,void 0,void 0,function(){var f,d;return b(this,function(v){return f=function(){if(!l){u.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.");return}if(!(typeof document>"u")){var h=function(g){var y=!1;r(g,"change",function(){var m,p=Br(g);y||l.track(Hr,(m={},m[Ct]=Re(g.id),m[Lt]=Re(g.name),m[Dt]=p,m)),y=!0}),r(g,"submit",function(){var m,p,T=Br(g);y||l.track(Hr,(m={},m[Ct]=Re(g.id),m[Lt]=Re(g.name),m[Dt]=T,m)),l.track(Pa,(p={},p[Ct]=Re(g.id),p[Lt]=Re(g.name),p[Dt]=T,p)),y=!1})};Array.from(document.getElementsByTagName("form")).forEach(h),typeof MutationObserver<"u"&&(e=new MutationObserver(function(g){g.forEach(function(y){y.addedNodes.forEach(function(m){m.nodeName==="FORM"&&h(m),"querySelectorAll"in m&&typeof m.querySelectorAll=="function"&&Array.from(m.querySelectorAll("form")).map(h)})})}),e.observe(document.body,{subtree:!0,childList:!0}))}},document.readyState==="complete"?f():(d=$(),d?d.addEventListener("load",f):u.loggerProvider.debug("Form interaction tracking is not installed because global is undefined.")),[2]})})},s=function(u){return E(void 0,void 0,void 0,function(){return b(this,function(l){return[2,u]})})},c=function(){return E(void 0,void 0,void 0,function(){return b(this,function(u){return e?.disconnect(),n(),[2]})})};return{name:i,type:o,setup:a,execute:s,teardown:c}},Re=function(e){if(typeof e=="string")return e},Br=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(t??""),window.location.href).href}catch{}return t},$a=function(){var e,t=[],r=function(u,l,f){u.addEventListener(l,f),t.push({element:u,type:l,handler:f})},n=function(){t.forEach(function(u){var l=u.element,f=u.type,d=u.handler;l?.removeEventListener(f,d)}),t=[]},i="@amplitude/plugin-file-download-tracking-browser",o="enrichment",a=function(u,l){return E(void 0,void 0,void 0,function(){var f,d;return b(this,function(v){return f=function(){if(!l){u.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.");return}if(!(typeof document>"u")){var h=function(y){var m;try{m=new URL(y.href,window.location.href)}catch{return}var p=g.exec(m.href),T=p?.[1];T&&r(y,"click",function(){var S;T&&l.track(Ra,(S={},S[Ca]=T,S[La]=m.pathname,S[Da]=y.id,S[xa]=y.text,S[Na]=y.href,S))})},g=/\.(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(h),typeof MutationObserver<"u"&&(e=new MutationObserver(function(y){y.forEach(function(m){m.addedNodes.forEac
5h(function(p){p.nodeName==="A"&&h(p),"querySelectorAll"in p&&typeof p.querySelectorAll=="function"&&Array.from(p.querySelectorAll("a")).map(h)})})}),e.observe(document.body,{subtree:!0,childList:!0}))}},document.readyState==="complete"?f():(d=$(),d?d.addEventListener("load",f):u.loggerProvider.debug("File download tracking is not installed because global is undefined.")),[2]})})},s=function(u){return E(void 0,void 0,void 0,function(){return b(this,function(l){return[2,u]})})},c=function(){return E(void 0,void 0,void 0,function(){return b(this,function(u){return e?.disconnect(),n(),[2]})})};return{name:i,type:o,setup:a,execute:s,teardown:c}},Gr=!1,za=function(e){Gr||e.defaultTracking!==void 0||(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:
6
7amplitude.init(<YOUR_API_KEY>, {
8  defaultTracking: true,
9});
10
11Visit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details.`),Gr=!0)},Ya=function(){var e="@amplitude/plugin-network-checker-browser",t="before",r=$(),n=[],i=function(c,u){r?.addEventListener&&(r?.addEventListener(c,u),n.push({type:c,handler:u}))},o=function(){n.forEach(function(c){var u=c.type,l=c.handler;r?.removeEventListener(u,l)}),n=[]},a=function(c,u){return E(void 0,void 0,void 0,function(){return b(this,function(l){return typeof navigator>"u"?(c.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),c.offline=!1,[2]):(c.offline=!navigator.onLine,i("online",function(){c.loggerProvider.debug("Network connectivity changed to online."),c.offline=!1,setTimeout(function(){u.flush()},c.flushIntervalMillis)}),i("offline",function(){c.loggerProvider.debug("Network connectivity changed to offline."),c.offline=!0}),[2])})})},s=function(){return E(void 0,void 0,void 0,function(){return b(this,function(c){return o(),[2]})})};return{name:e,type:t,setup:a,teardown:s}};function zn(e){var t,r,n,i,o,a,s,c,u,l,f;if(!(typeof e!="object"||e===null)&&!Array.isArray(e)){var d=Object.keys(e);try{for(var v=x(d),h=v.next();!h.done;h=v.next()){var g=h.value;try{var y=e[g];typeof y?.enabled=="boolean"&&(y.enabled?(delete y.enabled,Object.keys(y).length===0&&(e[g]=!0)):e[g]=!1),zn(y)}catch{}}}catch(k){t={error:k}}finally{try{h&&!h.done&&(r=v.return)&&r.call(v)}finally{if(t)throw t.error}}try{if(!((u=(c=(s=e.autocapture)===null||s===void 0?void 0:s.networkTracking)===null||c===void 0?void 0:c.captureRules)===null||u===void 0)&&u.length)try{for(var m=x(e.autocapture.networkTracking.captureRules),p=m.next();!p.done;p=m.next()){var T=p.value;try{for(var S=(o=void 0,x(["responseHeaders","requestHeaders"])),A=S.next();!A.done;A=S.next()){var _=A.value,O=(l=T[_])!==null&&l!==void 0?l:{},C=O.captureSafeHeaders,D=O.allowlist;if(!(!C&&!D)){if(D!==void 0&&!Array.isArray(D)){delete T[_];continue}T[_]=L(L([],I(C?lt:[]),!1),I(D??[]),!1)}}}catch(k){o={error:k}}finally{try{A&&!A.done&&(a=S.return)&&a.call(S)}finally{if(o)throw o.error}}}}catch(k){n={error:k}}finally{try{p&&!p.done&&(i=m.return)&&i.call(m)}finally{if(n)throw n.error}}}catch{}var P=(f=e.autocapture)===null||f===void 0?void 0:f.frustrationInteractions;P&&(P.rageClick&&(P.rageClicks=P.rageClick,delete P.rageClick),P.deadClick&&(P.deadClicks=P.deadClick,delete P.deadClick))}}function Wr(e,t,r){var n,i,o=[];try{for(var a=x(t??[]),s=a.next();!s.done;s=a.next()){var c=s.value;try{o.push(new RegExp(c))}catch(u){r.loggerProvider.warn("Invalid regex pattern: ".concat(c),u)}}}catch(u){n={error:u}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return e.concat(o)}function Xa(e,t){var r,n,i,o,a,s,c;if(e){zn(e);try{t.loggerProvider.debug("Update browser config with remote configuration:",JSON.stringify(e));var u=e;if(u&&"autocapture"in u){if(typeof u.autocapture=="boolean"&&(t.autocapture=u.autocapture),typeof u.autocapture=="object"&&u.autocapture!==null){var l=w({},u.autocapture);if(t.autocapture===void 0&&(t.autocapture=u.autocapture),typeof u.autocapture.elementInteractions=="object"&&u.autocapture.elementInteractions!==null&&(!((i=u.autocapture.elementInteractions.pageUrlAllowlistRegex)===null||i===void 0)&&i.length)){l.elementInteractions=w({},u.autocapture.elementInteractions);var f=l.elementInteractions,d=(o=f.pageUrlAllowlist)!==null&&o!==void 0?o:[],v=u.autocapture.elementInteractions.pageUrlAllowlistRegex;f.pageUrlAllowlist=Wr(d,v,t),delete f.pageUrlAllowlistRegex}
11if(typeof u.autocapture.networkTracking=="object"&&u.autocapture.networkTracking!==null&&(!((a=u.autocapture.networkTracking.captureRules)===null||a===void 0)&&a.length)){l.networkTracking=w({},u.autocapture.networkTracking);var h=(s=l.networkTracking.captureRules)!==null&&s!==void 0?s:[];try{for(var g=x(h),y=g.next();!y.done;y=g.next()){var m=y.value;m.urls=Wr((c=m.urls)!==null&&c!==void 0?c:[],m.urlsRegex,t),delete m.urlsRegex}}catch(p){r={error:p}}finally{try{y&&!y.done&&(n=g.return)&&n.call(g)}finally{if(r)throw r.error}}}typeof t.autocapture=="boolean"&&(t.autocapture=w({attribution:t.autocapture,fileDownloads:t.autocapture,formInteractions:t.autocapture,pageViews:t.autocapture,sessions:t.autocapture,elementInteractions:t.autocapture,webVitals:t.autocapture,frustrationInteractions:t.autocapture},l)),typeof t.autocapture=="object"&&(t.autocapture=w(w({},t.autocapture),l))}t.defaultTracking=t.autocapture}t.loggerProvider.debug("Browser config after remote config update:",JSON.stringify(t))}catch(p){t.loggerProvider.error("Failed to apply remote configuration because of error: ",p)}}}var Ja="@amplitude/plugin-autocapture-browser",Qa="@amplitude/plugin-frustration-browser",Kr="[Amplitude] Element Clicked",Za="[Amplitude] Dead Click",$r="[Amplitude] Rage Click";var es="[Amplitude] Element ID",ts="[Amplitude] Element Class",zr="[Amplitude] Element Tag",Yr="[Amplitude] Element Text",rs="[Amplitude] Element Hierarchy",ns="[Amplitude] Element Href",is="[Amplitude] Element Position Left",os="[Amplitude] Element Position Top",as="[Amplitude] Element Aria Label",ss="[Amplitude] Element Attributes",us="[Amplitude] Element Parent Label",Xr="[Amplitude] Page URL",cs="[Amplitude] Page Title",ls="[Amplitude] Viewport Height",ds="[Amplitude] Viewport Width",Kt="https://app.amplitude.com",fs="https://app.eu.amplitude.com",vs="https://apps.stag2.amplitude.com",hs={US:Kt,EU:fs,STAGING:vs},ps="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",gs="amp-visual-tagging-selector-highlight",Yn="data-amp-mask-attributes";function q(e){return typeof e=="function"}function ar(e){var t=function(n){Error.call(n),n.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var xt=ar(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
12`+r.map(function(n,i){return i+1+") "+n.toString()}).join(`
13  `):"",this.name="UnsubscriptionError",this.errors=r}});function ft(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var $e=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,i,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=x(a),c=s.next();!c.done;c=s.next())c.value.remove(this)}catch(h){t={error:h}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else a.remove(this);var u=this.initialTeardown;if(q(u))try{u()}catch(h){o=h instanceof xt?h.errors:[h]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var f=x(l),d=f.next();!d.done;d=f.next()){var v=d.value;try{Jr(v)}catch(h){o=o??[],h instanceof xt?o=L(L([],I(o)),I(h.errors)):o.push(h)}}}catch(h){n={error:h}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}}if(o)throw new xt(o)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)Jr(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&ft(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&ft(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),Xn=$e.EMPTY;function Jn(e){return e instanceof $e||e&&"closed"in e&&q(e.remove)&&q(e.add)&&q(e.unsubscribe)}function Jr(e){q(e)?e():e.unsubscribe()}var Pe={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNext
vendor: 5,887 bytes, line 13
13Context:!1},vt={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=vt.delegate;return i?.setTimeout?i.setTimeout.apply(i,L([e,t],I(r))):setTimeout.apply(void 0,L([e,t],I(r)))},clearTimeout:function(e){var t=vt.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Qn(e){vt.setTimeout(function(){var t=Pe.onUnhandledError;if(t)t(e);else throw e})}function ht(){}var ms=(function(){return sr("C",void 0,void 0)})();function ys(e){return sr("E",void 0,e)}function bs(e){return sr("N",e,void 0)}function sr(e,t,r){return{kind:e,value:t,error:r}}var Ie=null;function st(e){if(Pe.useDeprecatedSynchronousErrorHandling){var t=!Ie;if(t&&(Ie={errorThrown:!1,error:null}),e(),t){var r=Ie,n=r.errorThrown,i=r.error;if(Ie=null,n)throw i}}else e()}function Es(e){Pe.useDeprecatedSynchronousErrorHandling&&Ie&&(Ie.errorThrown=!0,Ie.error=e)}var ur=(function(e){re(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,Jn(r)&&r.add(n)):n.destination=_s,n}return t.create=function(r,n,i){return new Ke(r,n,i)},t.prototype.next=function(r){this.isStopped?Ut(bs(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?Ut(ys(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?Ut(ms,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})($e),Ts=Function.prototype.bind;function Nt(e,t){return Ts.call(e,t)}var Ss=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){rt(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){rt(n)}else rt(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){rt(r)}},e})(),Ke=(function(e){re(t,e);function t(r,n,i){var o=e.call(this)||this,a;if(q(r)||!r)a={next:r??void 0,error:n??void 0,complete:i??void 0};else{var s;o&&Pe.useDeprecatedNextContext?(s=Object.create(r),s.unsubscribe=function(){return o.unsubscribe()},a={next:r.next&&Nt(r.next,s),error:r.error&&Nt(r.error,s),complete:r.complete&&Nt(r.complete,s)}):a=r}return o.destination=new Ss(a),o}return t})(ur);function rt(e){Pe.useDeprecatedSynchronousErrorHandling?Es(e):Qn(e)}function ws(e){throw e}function Ut(e,t){var r=Pe.onStoppedNotification;r&&vt.setTimeout(function(){return r(e,t)})}var _s={closed:!0,next:ht,error:ws,complete:ht},cr=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function Zn(e){return e}function Is(e){return e.length===0?Zn:e.length===1?e[0]:function(r){return e.reduce(function(n,i){return i(n)},r)}}var Y=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var i=this,o=Ps(t)?t:new Ke(t,r,n);return st(function(){var a=i,s=a.operator,c=a.source;o.add(s?s.call(o,c):c?i._subscribe(o):i._trySubscribe(o))}),o},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=Qr(r),new r(function(i,o){var a=new Ke({next:function(s){try{t(s)}catch(c){o(c),a.unsubscribe()}},error:o,complete:i});n.subscribe(a)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[cr]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return Is(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=Qr(t),new t(function(n,i){var o;r.subscribe(function(a){return o=a},function(a){return i(a)},function(){return n(o)})})},e.create=function(t){return new e(t)},e})();function Qr(e){var t;return(t=e??Pe.Promise)!==null&&t!==void 0?t:Promise}function As(e){return e&&q(e.next)&&q(e.error)&&q(e.complete)}function Ps(e){return e&&e instanceof ur||As(e)&&Jn(e)}function Rs(e){return q(e?.lift)}function ie(e){return function(t){if(Rs(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function J(e,t,r,n,i){return new ks(e,t,r,n,i)}var ks=(function(e){re(t,e);function t(r,n,i,o,a,s){var c=e.call(this,r)||this;return c.onFinalize=a,c.shouldUnsubscribe=s,c._next=n?function(u){try{n(u)}catch(l){r.error(l)}}:e.prototype._next,c._error=o?function(u){try{o(u)}catch(l){r.error(l)}finally{this.unsubscribe()}}:e.prototype._error,c._complete=i?function(){try{i()}catch(u){r.error(u)}finally{this.unsubscribe()}}:e.prototype._complete,c}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t})(ur),Os=ar(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),ei=(function(e){re(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var n=new Zr(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new Os},t.prototype.next=function(r){var n=this;st(function(){var i,o;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var a=x(n.currentObservers),s=a.next();!s.done;s=a.next())s.value.next(r)}catch(c){i={error:c}}
13finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}}})},t.prototype.error=function(r){var n=this;st(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var i=n.observers;i.length;)i.shift().error(r)}})},t.prototype.complete=function(){var r=this;st(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,i=this,o=i.hasError,a=i.isStopped,s=i.observers;return o||a?Xn:(this.currentObservers=null,s.push(r),new $e(function(){n.currentObservers=null,ft(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,i=n.hasError,o=n.thrownError,a=n.isStopped;i?r.error(o):a&&r.complete()},t.prototype.asObservable=function(){var r=new Y;return r.source=this,r},t.create=function(r,n){return new Zr(r,n)},t})(Y),Zr=(function(e){re(t,e);function t(r,n){var i=e.call(this)||this;return i.destination=r,i.source=n,i}return t.prototype.next=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,r)},t.prototype.error=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&i!==void 0?i:Xn},t})(ei),ti={now:function(){return(ti.delegate||Date).now()},delegate:void 0},Cs=(function(e){re(t,e);function t(r,n){return e.call(this)||this}return t.prototype.schedule=function(r,n){return n===void 0&&(n=0),this},t})($e),pt={setInterval:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=pt.delegate;return i?.setInterval?i.setInterval.apply(i,L([e,t],I(r))):setInterval.apply(void 0,L([e,t],I(r)))},clearInterval:function(e){var t=pt.delegate;return(t?.clearInterval||clearInterval)(e)},delegate:void 0},Ls=(function(e){re(t,e);function t(r,n){var i=e.call(this,r,n)||this;
vendor: 4,589 bytes, line 13
13return i.scheduler=r,i.work=n,i.pending=!1,i}return t.prototype.schedule=function(r,n){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=r;var o=this.id,a=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(a,o,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(a,this.id,n),this},t.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),pt.setInterval(r.flush.bind(r,this),i)},t.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;n!=null&&pt.clearInterval(n)},t.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(r,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,n){var i=!1,o;try{this.work(r)}catch(a){i=!0,o=a||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),o},t.prototype.unsubscribe=function(){if(!this.closed){var r=this,n=r.id,i=r.scheduler,o=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,ft(o,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t})(Cs),en=(function(){function e(t,r){r===void 0&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(t,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,t).schedule(n,r)},e.now=ti.now,e})(),Ds=(function(e){re(t,e);function t(r,n){n===void 0&&(n=en.now);var i=e.call(this,r,n)||this;return i.actions=[],i._active=!1,i}return t.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var i;this._active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},t})(en),ze=new Ds(Ls),xs=ze,lr=new Y(function(e){return e.complete()});function ri(e){return e&&q(e.schedule)}function ni(e){return e[e.length-1]}function ii(e){return ri(ni(e))?e.pop():void 0}function Ns(e,t){return typeof ni(e)=="number"?e.pop():t}var dr=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function oi(e){return q(e?.then)}function ai(e){return q(e[cr])}function si(e){return Symbol.asyncIterator&&q(e?.[Symbol.asyncIterator])}function ui(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Us(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var ci=Us();function li(e){return q(e?.[ci])}function di(e){return Ui(this,arguments,function(){var r,n,i,o;return b(this,function(a){switch(a.label){case 0:r=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,Ce(r.read())];case 3:return n=a.sent(),i=n.value,o=n.done,o?[4,Ce(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,Ce(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function fi(e){return q(e?.getReader)}function te(e){if(e instanceof Y)return e;if(e!=null){if(ai(e))return Ms(e);if(dr(e))return Fs(e);if(oi(e))return qs(e);if(si(e))return vi(e);if(li(e))return Vs(e);if(fi(e))return js(e)}throw ui(e)}function Ms(e){return new Y(function(t){var r=e[cr]();if(q(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Fs(e){return new Y(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function qs(e){return new Y(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,Qn)})}function Vs(e){return new Y(function(t){var r,n;try{for(var i=x(e),o=i.next();!o.done;o=i.next()){var a=o.value;if(t.next(a),t.closed)return}}catch(s){r={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}t.complete()})}function vi(e){return new Y(function(t){Hs(e,t).catch(function(r){return t.error(r)})})}function js(e){return vi(di(e))}function Hs(e,t){var r,n,i,o;return E(this,void 0,void 0,function(){var a,s;return b(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),r=Mi(e),c.label=1;case 1:return[4,r.next()];case 2:if(n=c.sent(),!!n.done)return[3,4];if(a=n.value,t.next(a),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),i={error:s},[3,11];
13case 6:return c.trys.push([6,,9,10]),n&&!n.done&&(o=r.return)?[4,o.call(r)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function ye(e,t,r,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var o=t.schedule(function(){r(),i?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(o),!i)return o}function hi(e,t){return t===void 0&&(t=0),ie(function(r,n){r.subscribe(J(n,function(i){return ye(n,e,function(){return n.next(i)},t)},function(){return ye(n,e,function(){return n.complete()},t)},function(i){return ye(n,e,function(){return n.error(i)},t)}))})}function pi(e,t){return t===void 0&&(t=0),ie(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function Bs(e,t){return te(e).pipe(pi(t),hi(t))}function Gs(e,t){return te(e).pipe(pi(t),hi(t))}function Ws(e,t){return new Y(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}function Ks(e,t){return new Y(function(r){var n;return ye(r,t,function(){n=e[ci](),ye(r,t,function(){var i,o,a;try{i=n.next(),o=i.value,a=i.done}catch(s){r.error(s);return}a?r.complete():r.next(o)},0,!0)}),function(){return q(n?.return)&&n.return()}})}function gi(e,t){if(!e)throw new Error("Iterable cannot be null");return new Y(function(r){ye(r,t,function(){var n=e[Symbol.asyncIterator]();ye(r,t,function(){n.next().then(function(i){i.done?r.complete():r.next(i.value)})},0,!0)})})}function $s(e,t){return gi(di(e),t)}function zs(e,t){if(e!=null){if(ai(e))return Bs(e,t);if(dr(e))return Ws(e,t);if(oi(e))return Gs(e,t);if(si(e))return gi(e,t);if(li(e))return Ks(e,t);if(fi(e))return $s(e,t)}throw ui(e)}function mi(e,t){return t?zs(e,t):te(e)}function yi(e){return e instanceof Date&&!isNaN(e)}var Ys=ar(function(e){return function(r){r===void 0&&(r=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=r}});function Xs(e,t){var r=yi(e)?{first:e}:typeof e=="number"?{each:e}:e,n=r.first,i=r.each,o=r.with,a=o===void 0?Js:o,s=r.scheduler,c=s===void 0?t??ze:s,u=r.meta,l=u===void 0?null:u;if(n==null&&i==null)throw new TypeError("No timeout provided.");return ie(function(f,d){var v,h,g=null,y=0,m=function(p){h=ye(d,c,function(){try{v.unsubscribe(),te(a({meta:l,lastValue:g,seen:y})).subscribe(d)}catch(T){d.error(T)}},p)};v=f.subscribe(J(d,function(p){h?.unsubscribe(),y++,d.next(g=p),i>0&&m(i)},void 0,void 0,function(){h?.closed||h?.unsubscribe(),g=null})),!y&&m(n!=null?typeof n=="number"?n:+n-c.now():i)})}function Js(e){throw new Ys(e)}function X(e,t){return ie(function(r,n){var i=0;r.subscribe(J(n,function(o){n.next(e.call(t,o,i++))}))})}var Qs=Array.isArray;function Zs(e,t){return Qs(t)?e.apply(void 0,L([],I(t))):e(t)}function eu(e){return X(function(t){return Zs(e,t)})}function tu(e,t,r,n,i,o,a,s){var c=[],u=0,l=0,f=!1,d=function(){f&&!c.length&&!u&&t.complete()},v=function(g){return u<n?h(g):c.push(g)},h=function(g){o&&t.next(g),u++;var y=!1;te(r(g,l++)).subscribe(J(t,function(m){i?.(m),o?v(m):t.next(m)},function(){y=!0},void 0,function(){if(y)try{u--;for(var m=function(){var p=c.shift();a?ye(t,a,function(){return h(p)}):h(p)};c.length&&u<n;)m();d()}catch(p){t.error(p)}}))};return e.subscribe(J(t,v,function(){f=!0,d()})),function(){s?.()}}function Ye(e,t,r){return r===void 0&&(r=1/0),q(t)?Ye(function(n,i){return X(function(o,a){return t(n,o,i,a)})(te(e(n,i)))},r):(typeof t=="number"&&(r=t),ie(function(n,i){return tu(n,i,e,r)}))}function bi(e){return e===void 0&&(e=1/0),Ye(Zn,e)}function ru(){return bi(1)}function nu(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ru()(mi(e,ii(e)))}var iu=["addListener","removeListener"],ou=["addEventListener","removeEventListener"],au=["on","off"];function De(e,t,r,n){if(q(r)&&(n=r,r=void 0),n)return De(e,t,r).pipe(eu(n));var i=I(cu(e)?ou.map(function(s){return function(c){return e[s](t,c,r)}}):su(e)?iu.map(tn(e,t)):uu(e)?au.map(tn(e,t)):[],2),o=i[0],a=i[1];if(!o&&dr(e))return Ye(function(s){return De(s,t,r)})(te(e));if(!o)throw new TypeError("Invalid event target");return new Y(function(s){var c=function(){for(var u=[],l=0;l<arguments.length;l++)u[l]=arguments[l];return s.next(1<u.length?u:u[0])};return o(c),function(){return a(c)}})}function tn(e,t){return function(r){return function(n){return e[r](t,n)}}}function su(e){return q(e.addListener)&&q(e.removeListener)}function uu(e){return q(e.on)&&q(e.off)}function cu(e){return q(e.addEventListener)&&q(e.removeEventListener)}function Ei(e,t,r){e===void 0&&(e=0),r===void 0&&(r=xs);var n=-1;return t!=null&&(ri(t)?r=t:n=t),new Y(function(i){var o=yi(e)?+e-r.now():e;o<0&&(o=0);var a=0;return r.schedule(function(){i.closed||(i.next(a++),0<=n?this.schedule(void 0,n):i.complete())},o)})}function fr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=ii(e),n=Ns(e,1/0),i=e;return i.length?i.length===1?te(i[0]):bi(n)(mi(i,r)):lr}var lu=Array.isArray;function du(e){return e.length===1&&lu(e[0])?e[0]:e}function ee(e,t){return ie(function(r,n){var i=0;r.subscribe(J(n,function(o){return e.call(t,o,i++)&&n.next(o)}))})}function fu(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e=du(e),e.length===1?te(e[0]):new Y(vu(e))}function vu(e){return function(t){for(var r=[],n=function(o){r.push(te(e[o]).subscribe(J(t,function(a){if
13(r){for(var s=0;s<r.length;s++)s!==o&&r[s].unsubscribe();r=null}t.next(a)})))},i=0;r&&!t.closed&&i<e.length;i++)n(i)}}function hu(e){return ie(function(t,r){var n=[];return t.subscribe(J(r,function(i){return n.push(i)},function(){r.next(n),r.complete()})),te(e).subscribe(J(r,function(){var i=n;n=[],r.next(i)},ht)),function(){n=null}})}function pu(e,t){return t===void 0&&(t=ze),ie(function(r,n){var i=null,o=null,a=null,s=function(){if(i){i.unsubscribe(),i=null;var u=o;o=null,n.next(u)}};function c(){var u=a+e,l=t.now();if(l<u){i=this.schedule(void 0,u-l),n.add(i);return}s()}r.subscribe(J(n,function(u){o=u,a=t.now(),i||(i=t.schedule(c,e),n.add(i))},function(){s(),n.complete()},void 0,function(){o=i=null}))})}function gt(e){return e<=0?function(){return lr}:ie(function(t,r){var n=0;t.subscribe(J(r,function(i){++n<=e&&(r.next(i),e<=n&&r.complete())}))})}function gu(){return ie(function(e,t){e.subscribe(J(t,ht))})}function mu(e){return X(function(){return e})}function Ti(e,t){return t?function(r){return nu(t.pipe(gt(1),gu()),r.pipe(Ti(e)))}:Ye(function(r,n){return te(e(r,n)).pipe(gt(1),mu(r))})}function yu(e,t){t===void 0&&(t=ze);var r=Ei(e,t);return Ti(function(){return r})}function bu(){return ie(function(e,t){var r,n=!1;e.subscribe(J(t,function(i){var o=r;r=i,n&&t.next([o,i]),n=!0}))})}function Ae(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new ei}:t,n=e.resetOnError,i=n===void 0?!0:n,o=e.resetOnComplete,a=o===void 0?!0:o,s=e.resetOnRefCountZero,c=s===void 0?!0:s;return function(u){var l,f,d,v=0,h=!1,g=!1,y=function(){f?.unsubscribe(),f=void 0},m=function(){y(),l=d=void 0,h=g=!1},p=function(){var T=l;m(),T?.unsubscribe()};return ie(function(T,S){v++,!g&&!h&&y();var A=d=d??r();S.add(function(){v--,v===0&&!g&&!h&&(f=Mt(p,c))}),A.subscribe(S),!l&&v>0&&(l=new Ke({next:function(_){return A.next(_)},error:function(_){g=!0,y(),f=Mt(m,i,_),A.error(_)},complete:function(){h=!0,y(),f=Mt(m,a),A.complete()}}),te(T).subscribe(l))})(u)}}function Mt(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];if(t===!0){e();return}if(t!==!1){var i=new Ke({next:function(){i.unsubscribe(),e()}});return te(t.apply(void 0,L([],I(r)))).subscribe(i)}}function Eu(e,t){return ie(function(r,n){var i=null,o=0,a=!1,s=function(){return a&&!i&&n.complete()};r.subscribe(J(n,function(c){i?.unsubscribe();var u=0,l=o++;te(e(c,l)).subscribe(i=J(n,function(f){return n.next(t?t(c,f,l,u++):f)},function(){i=null,s()}))},function(){a=!0,s()}))})}function Tu(e,t){return ie(function(r,n){var i=t??{},o=i.leading,a=o===void 0?!0:o,s=i.trailing,c=s===void 0?!1:s,u=!1,l=null,f=null,d=!1,v=function(){f?.unsubscribe(),f=null,c&&(y(),d&&n.complete())},h=function(){f=null,d&&n.complete()},g=function(m){return f=te(e(m)).subscribe(J(n,v,h))},y=function(){if(u){u=!1;var m=l;l=null,n.next(m),!d&&g(m)}};r.subscribe(J(n,function(m){u=!0,l=m,!(f&&!f.closed)&&(a?y():g(m))},function(){d=!0,!(c&&u&&f&&!f.closed)&&n.complete()}))})}function Su(e,t,r){t===void 0&&(t=ze);var n=Ei(e,t);return Tu(function(){return n},r)}var wu=["input","select","textarea"],Si=function(e,t){var r,n=(r=window?.getComputedStyle)===null||r===void 0?void 0:r.call(window,e);return n?.getPropertyValue("cursor")==="pointer"&&t==="click"},He=function(e,t,r){return r===void 0&&(r=!1),function(n,i){var o,a,s=e.pageUrlAllowlist,c=e.pageUrlExcludelist,u=e.shouldTrackEventResolver,l=(a=(o=i?.tagName)===null||o===void 0?void 0:o.toLowerCase)===null||a===void 0?void 0:a.call(o);if(!l)return!1;if(u)return u(n,i);if(!Bt(window.location.href,s)||c&&c.length>0&&Bt(window.location.href,c))return!1;var f=String(i?.getAttribute("type"))||"";if(typeof f=="string")switch(f.toLowerCase()){case"hidden":return!1;case"password":return!1}var d=Si(i,n);if(r&&d)return!0;if(t&&!t.some(function(v){var h;return!!(!((h=i?.matches)===null||h===void 0)&&h.call(i,v))}))return!1;switch(l){case"input":case"select":case"textarea":return n==="change"||n==="click";default:return d?!0:n==="click"}}},_u=function(e){var t,r,n,i=(r=(t=e?.tagName)===null||t===void 0?void 0:t.toLowerCase)===null||r===void 0?void 0:r.call(t),o=e instanceof HTMLElement?((n=e.getAttribute("contenteditable"))===null||n===void 0?void 0:n.toLowerCase())==="true":!1;return!wu.includes(i)&&!o},Iu=function(e){return e?e.split(",").map(function(t){return t.trim()}).filter(function(t){return t.length>0&&t!=="id"&&t!=="class"}):[]},Au=function(e,t){return Object.entries(e).reduce(function(r,n){var i=I(n,2),o=i[0],a=i[1];if(o.startsWith(t)){var s=o.replace(t,"");
13s&&(r[s]=a||"")}return r},{})},Pu=function(e){return e==null||typeof e=="object"&&Object.keys(e).length===0||typeof e=="string"&&e.trim().length===0},rn=function(e){return Object.keys(e).reduce(function(t,r){var n=e[r];return Pu(n)||(t[r]=n),t},{})},vr=function(e,t){return e?t.some(function(r){var n;return(n=e?.matches)===null||n===void 0?void 0:n.call(e,r)})?e:vr(e?.parentElement,t):null},Ru=function(e){return new Promise(function(t,r){var n;try{var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.addEventListener("load",function(){t({status:!0})},{once:!0}),i.addEventListener("error",function(){r({status:!1,message:"Failed to load the script ".concat(e)})}),(n=document.head)===null||n===void 0||n.appendChild(i)}catch(o){r(o)}})};function ku(){return"".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9))}var Xe=function(e){return!(e.event.target===null||!e.closestTrackedAncestor)};function Ou(e){return e.type==="click"||e.type==="change"}var Cu="1.17.1",Lu=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",Yn,Fn]),Du=["type"],xu=["svg","path","g"],Nu=["password","hidden"],Uu=128;function Mu(e,t){var r,n,i,o,a,s;if(e===null)return null;var c=String(e.tagName).toLowerCase(),u={tag:c},l=Array.from((o=(i=e.parentElement)===null||i===void 0?void 0:i.children)!==null&&o!==void 0?o:[]);l.length&&(u.index=l.indexOf(e),u.indexOfType=l.filter(function(S){return S.tagName===e.tagName}).indexOf(e));var f=(s=(a=e.previousElementSibling)===null||a===void 0?void 0:a.tagName)===null||s===void 0?void 0:s.toLowerCase();f&&(u.prevSib=String(f));var d=e.getAttribute("id");d&&(u.id=String(d));var v=Array.from(e.classList);v.length&&(u.classes=v);var h={},g=Array.from(e.attributes).filter(function(S){return!Lu.has(S.name)}),y=!_u(e);if(!Nu.includes(String(e.getAttribute("type")))&&!xu.includes(c))try{for(var m=x(g),p=m.next();!p.done;p=m.next()){var T=p.value;if(!(y&&!Du.includes(T.name))){if(t.has(T.name)){h[T.name]=Se;continue}h[T.name]=String(T.value).substring(0,Uu)}}}catch(S){r={error:S}}finally{try{p&&!p.done&&(n=m.return)&&n.call(m)}finally{if(r)throw r.error}}return Object.keys(h).length&&(u.attrs=h),u}function Fu(e){var t=[];if(!e)return t;
13t.push(e);for(var r=e.parentElement;r&&r.tagName!=="HTML";)t.push(r),r=r.parentElement;return t}var qu=function(e,t){try{if(e.sourceType==="DOM_ELEMENT"){var r=document.documentElement;return e.scope&&t&&(r=t.closest(e.scope)),r&&e.selector?r.querySelector(e.selector):r}}catch{return}},Vu=function(e,t,r){e.forEach(function(n){if(typeof n!="string"&&n.actionType==="ATTACH_EVENT_PROPERTY"){var i=r.extractDataFromDataSource(n.dataSource,t.closestTrackedAncestor);t.targetElementProperties[n.destinationKey]=i}})},hr=(function(){function e(t,r){var n,i,o=this,a;this.replaceSensitiveString=function(d){return nr(d,o.additionalMaskTextPatterns)},this.getHierarchy=function(d){var v,h,g,y,m=performance.now(),p=[];if(!d)return[];for(var T=Fu(d),S=new Map,A=T.length-1;A>=0;A--){var _=T[A];if(_){var O=Iu(_.getAttribute(Yn)),C=A===T.length-1?[]:(g=S.get(T[A+1]))!==null&&g!==void 0?g:new Set,D=new Set(L(L([],I(C),!1),I(O),!1));S.set(_,D)}}p=T.map(function(M){var G;return Mu(M,(G=S.get(M))!==null&&G!==void 0?G:new Set)});var P=function(M){M?.attrs&&Object.entries(M.attrs).forEach(function(G){var ue=I(G,2),ce=ue[0],ae=ue[1];M.attrs&&(M.attrs[ce]=o.replaceSensitiveString(ae))})};try{for(var k=x(p),U=k.next();!U.done;U=k.next()){var z=U.value;P(z)}}catch(M){v={error:M}}finally{try{U&&!U.done&&(h=k.return)&&h.call(k)}finally{if(v)throw v.error}}var W=performance.now();return(y=o.diagnosticsClient)===null||y===void 0||y.recordHistogram("autocapturePlugin.getHierarchy",W-m),p},this.getNearestLabel=function(d){var v=d.parentElement;if(!v)return"";var h;try{h=v.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch{h=null}return h?o.getText(h):o.getNearestLabel(v)},this.getEventProperties=function(d,v,h){var g,y,m,p,T=(m=(y=v?.tagName)===null||y===void 0?void 0:y.toLowerCase)===null||m===void 0?void 0:m.call(y),S=typeof v.getBoundingClientRect=="function"?v.getBoundingClientRect():{left:null,top:null},A=o.getHierarchy(v),_=(p=A[0])===null||p===void 0?void 0:p.attrs,O=o.getNearestLabel(v),C=Au(_??{},h),D=(g={},g[rs]=A,g[zr]=T,g[Yr]=o.getText(v),g[is]=S.left==null?null:Math.round(S.left),g[os]=S.top==null?null:Math.round(S.top),g[ss]=C,g[us]=O,g[Xr]=Ve(window.location.href.split("?")[0]),g[cs]=ir(o.replaceSensitiveString),g[ls]=window.innerHeight,g[ds]=window.innerWidth,g);return D[es]=v.getAttribute("id")||"",D[ts]=v.getAttribute("class"),D[as]=_?.["aria-label"],T==="a"&&d==="click"&&v instanceof HTMLAnchorElement&&(D[ns]=o.replaceSensitiveString(v.href)),rn(D)},this.addAdditionalEventProperties=function(d,v,h,g,y){y===void 0&&(y=!1);var m={event:d,timestamp:Date.now(),type:v};if(Ou(m)&&m.event.target!==null){if(y&&Si(m.event.target,m.type))return m.closestTrackedAncestor=m.event.target,m.targetElementProperties=o.getEventProperties(m.type,m.closestTrackedAncestor,g),m;var p=vr(m.event.target,h);return p&&(m.closestTrackedAncestor=p,m.targetElementProperties=o.getEventProperties(m.type,p,g)),m}return m},this.extractDataFromDataSource=function(d,v){if(d.sourceType==="DOM_ELEMENT"){var h=qu(d,v);return h?d.elementExtractType==="TEXT"?o.getText(h):d.elementExtractType==="ATTRIBUTE"&&d.attribute?h.getAttribute(d.attribute):void 0:void 0}},this.getText=function(d){if(d.closest("[".concat("data-amp-mask","]"))!==null)return Se;var v="";if(!d.querySelector("[".concat("data-amp-mask","], [contenteditable]")))v=d.innerText||"";else{var h=d.cloneNode(!0);h.querySelectorAll("[".concat(Fn,"], [contenteditable]")).forEach(function(g){g.innerText=Se}),v=h.innerText||""}return o.replaceSensitiveString(v.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=function(d){var v,h,g;if(!d)return{};var y=(g=(h=d?.tagName)===null||h===void 0?void 0:h.toLowerCase)===null||g===void 0?void 0:g.call(h);return rn((v={},v[zr]=y,v[Yr]=o.getText(d),v[Xr]=window.location.href.split("?")[0],v))},this.diagnosticsClient=r?.diagnosticsClient;var s=(a=t.maskTextRegex)!==null&&a!==void 0?a:[],c=[];try{for(var u=x(s),l=u.next();!l.done;l=u.next()){var f=l.value;if(c.length>=25)break;if(f instanceof RegExp)c.push(f);else if("pattern"in f&&typeof f.pattern=="string")try{c.push(new RegExp(f.pattern,"i"))}catch{}}}catch(d){n={error:d}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}this.additionalMaskTextPatterns=c}return e})(),ju=(function(){function e(t){var r=(t===void 0?{}:t).origin,n=r===void 0?Kt:r,i=this;this.endpoint=Kt,this.requestCallbacks={},this.onSelect=function(o){i.notify({action:"element-selected",data:o})},this.onTrack=function(o,a){o==="selector-mode-changed"?i.notify({action:"track-selector-mode-changed",data:a}):o==="selector-moved"&&i.notify({action:"track-selector-moved",data:a})},this.endpoint=n}return e.prototype.notify=function(t){var r,n,i,o;(n=(r=this.logger)===null||r===void 0?void 0:r.debug)===null||n===void 0||n.call(r,"Message sent: ",JSON.stringify(t)),(o=(i=window.opener)===null||i===void 0?void 0:i.postMessage)===null||o===void 0||o.call(i,t,this.endpoint)},e.prototype.sendRequest=function(t,r,n){var i=this;n===void 0&&(n={timeout:15e3});var o=ku(),a={id:o,action:t,args:r};return new Promise(function(s,c){i.requestCallbacks[o]={resolve:s,reject:c},i.notify(a),n?.timeout>0&&setTimeout(function(){c(new Error("".concat(t," timed out (id: ").concat(o,")"))),delete i.requestCallbacks[o]},n.timeout)})},e.prototype.handleResponse=function(t){var r;if(!this.requestCallbacks[t.id]){(r=this.logger)===null||r===void 0||r.warn("No callback found for request id: ".concat(t.id));return}this.requestCallbacks[t.id].resolve(t.responseData),delete this.requestCallbacks[t.id]},e.prototype.setup=function(t){var r=this,n=t===void 0?{dataExtractor:new hr({})}:t,i=n.logger,o=n.endpoint,a=n.isElementSelectable,s=n.cssSelectorAllowlist,c=n.actionClickAllowlist,u=n.dataExtractor;this.logger=i,o&&this.endpoint==="https://app.amplitude.com"&&(this.endpoint=o
13);var l=null;window.addEventListener("message",function(f){var d,v,h,g,y;if((v=(d=r.logger)===null||d===void 0?void 0:d.debug)===null||v===void 0||v.call(d,"Message received: ",JSON.stringify(f)),r.endpoint===f.origin){var m=f?.data,p=m?.action;if(p)if("id"in m)(g=(h=r.logger)===null||h===void 0?void 0:h.debug)===null||g===void 0||g.call(h,"Received Response to previous request: ",JSON.stringify(f)),r.handleResponse(m);else if(p==="ping")r.notify({action:"pong"});else if(p==="initialize-visual-tagging-selector"){var T=m?.data;Ru(ps).then(function(){var S;l=(S=window?.amplitudeVisualTaggingSelector)===null||S===void 0?void 0:S.call(window,{getEventTagProps:u.getEventTagProps,isElementSelectable:function(A){return a?a(T?.actionType||"click",A):!0},onTrack:r.onTrack,onSelect:r.onSelect,visualHighlightClass:gs,messenger:r,cssSelectorAllowlist:s,actionClickAllowlist:c,extractDataFromDataSource:u.extractDataFromDataSource,dataExtractor:u,diagnostics:{autocapture:{version:Cu}}}),r.notify({action:"selector-loaded"})}).catch(function(){var S;(S=r.logger)===null||S===void 0||S.warn("Failed to initialize visual tagging selector")})}else p==="close-visual-tagging-selector"&&((y=l?.close)===null||y===void 0||y.call(l))}}),this.notify({action:"page-loaded"})},e})(),Hu=5;function Bu(e){var t=e.amplitude,r=e.allObservables,n=e.options,i=e.shouldTrackEvent,o=e.evaluateTriggers,a=r.clickObservable,s=fr(a.pipe(bu(),ee(function(c){var u=I(c,2),l=u[0],f=u[1],d=l.event.target!==f.event.target,v=Math.abs(f.event.screenX-l.event.screenX)<=20&&Math.abs(f.event.screenY-l.event.screenY)<=20;return d&&!v})),a.pipe(pu(n.debounceTime),X(function(){return"timeout"})));return a.pipe(yu(0),ee(Xe),ee(function(c){return i("click",c.closestTrackedAncestor)}),X(function(c){return o(c)}),hu(s)).subscribe(function(c){var u,l,f=(c.length>=Hu,Kr);try{for(var d=x(c),v=d.next();!v.done;v=d.next()){var h=v.value;t?.track(f,h.targetElementProperties)}}catch(g){u={error:g}}finally{try{v&&!v.done&&(l=d.return)&&l.call(d)}finally{if(u)throw u.error}}})}function Gu(e){var t=e.amplitude,r=e.allObservables,n=e.getEventProperties,i=e.shouldTrackEvent,o=e.evaluateTriggers;return r.changeObservable.pipe(ee(Xe),ee(function(a){return i("change",a.
13closestTrackedAncestor)}),X(function(a){return o(a)})).subscribe(function(a){t?.track("[Amplitude] Element Changed",n("change",a.closestTrackedAncestor))})}function Wu(e){var t=e.amplitude,r=e.allObservables,n=e.options,i=e.getEventProperties,o=e.shouldTrackEvent,a=e.shouldTrackActionClick,s=r.clickObservable,c=r.mutationObservable,u=r.navigateObservable,l=s.pipe(ee(function(v){return!o("click",v.closestTrackedAncestor)}),X(function(v){return v.closestTrackedAncestor=vr(v.event.target,n.actionClickAllowlist),v.closestTrackedAncestor!==null&&(v.targetElementProperties=i(v.type,v.closestTrackedAncestor)),v}),ee(Xe),ee(function(v){return a("click",v.closestTrackedAncestor)})),f=[c];u&&f.push(u);var d=fr.apply(void 0,L([],I(f),!1));return l.pipe(Eu(function(v){return d.pipe(gt(1),Xs({first:500,with:function(){return lr}}),X(function(){return v}))})).subscribe(function(v){t?.track("[Amplitude] Element Clicked",i("click",v.closestTrackedAncestor))})}var wi=function(){return new Y(function(e){var t=new MutationObserver(function(r){e.next(r)});return t.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return t.disconnect()}})},_i=function(e){return e===void 0&&(e="click"),De(document,e,{capture:!0})},Ku=function(e,t){try{if(t.subprop_key==="[Amplitude] Element Text")return t.subprop_op==="is"&&t.subprop_value.includes(e.targetElementProperties["[Amplitude] Element Text"]);if(t.subprop_key==="[Amplitude] Element Hierarchy")return t.subprop_op==="autotrack css match"&&!!e.closestTrackedAncestor.closest(t.subprop_value.toString())}catch(r){return console.error("Error matching event to filter",r),!1}return!1},$t={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},nn=function(e){var t,r,n,i,o=Object.values($t).reduce(function(d,v){return d[v]=new Set,d},{});if(!e)return o;try{for(var a=x(e),s=a.next();!s.done;s=a.next()){var c=s.value;try{try{for(var u=(n=void 0,x(c.definition)),l=u.next();!l.done;l=u.next()){var f=$t[l.value.event_type];f&&o[f].add(c.id)}}catch(d){n={error:d}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}catch(d){console.warn("Skipping Labeled Event due to malformed definition",c?.id,d)}}}catch(d){t={error:d}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return o},on=function(e){var t,r,n,i,o=new Map;try{for(var a=x(e),s=a.next();!s.done;s=a.next()){var c=s.value;try{for(var u=(n=void 0,x(c.conditions)),l=u.next();!l.done;l=u.next()){var f=l.value;if(f.type==="LABELED_EVENT"){var d=f.match.eventId,v=o.get(d);v||(v=[],o.set(d,v)),v.push(c)}}}catch(h){n={error:h}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}}catch(h){t={error:h}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return o},$u=function(e,t){return t.filter(function(r){return r.definition.some(function(n){return $t[n.event_type]===e.type&&n.filters.every(function(i){return Ku(e,i)})})})},zu=function(e,t){var r,n,i,o,a=new Set;try{for(var s=x(e),c=s.next();!c.done;c=s.next()){var u=c.value,l=t.get(u.id);if(l)try{for(var f=(i=void 0,x(l)),d=f.next();!d.done;d=f.next()){var v=d.value;a.add(v)}}catch(h){i={error:h}}finally{try{d&&!d.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}}}catch(h){r={error:h}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return Array.from(a)},Yu=(function(){function e(t,r,n,i){this.groupedLabeledEvents=t,this.labeledEventToTriggerMap=r,this.dataExtractor=n,this.options=i}return e.prototype.evaluate=function(t){var r,n,i=this.options.pageActions;if(!i)return t;var o=zu($u(t,Array.from(this.groupedLabeledEvents[t.type]).map(function(u){return i.labeledEvents[u]})),this.labeledEventToTriggerMap);try{for(var a=x(o),s=a.next();!s.done;s=a.next()){var c=s.value;Vu(c.actions,t,this.dataExtractor)}}catch(u){r={error:u}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return t},e.prototype.update=function(t,r,n){this.groupedLabeledEvents=t,this.labeledEventToTriggerMap=r,this.options=n},e})(),Xu=function(e,t,r,n){return new Yu(e,t,r,n)},he;(function(e){e.ClickObservable="clickObservable",e.ChangeObservable="changeObservable",e.NavigateObservable="navigateObservable",e.MutationObservable="mutationObservable"})(he||(he={}));var Ju=function(e,t){var r,n,i,o,a,s,c,u;e===void 0&&(e={}),t?.diagnosticsClient.setTag("plugin.autocapture.version","1.17.1");var l=e.dataAttributePrefix,f=l===void 0?Dn:l,d=e.visualTaggingOptions,v=d===void 0?{enabled:!0,messenger:new ju}:d;e.cssSelectorAllowlist=(r=e.cssSelectorAllowlist)!==null&&r!==void 0?r:Wo,e.actionClickAllowlist=(n=e.actionClickAllowlist)!==null&&n!==void 0?n:Ko,e.debounceTime=(i=e.debounceTime)!==null&&i!==void 0?i:0,e.pageUrlExcludelist=(o=e.pageUrlExcludelist)===null||o===void 0?void 0:o.reduce(function(P,k){if(typeof k=="string"&&P.push(k),k instanceof RegExp&&P.push(k),typeof k=="object"&&k!==null&&"pattern"in k)try{P.push(new RegExp(k.pattern))}catch(U){return console.warn("Invalid regex pattern: ".concat(k.pattern),U),P}return P},[]);
13var h=Ja,g="enrichment",y=[],m=new hr(e,t),p=function(){var P,k=_i().pipe(X(function(M){return m.addAdditionalEventProperties(M,"click",e.cssSelectorAllowlist,f)}),Ae()),U=De(document,"change",{capture:!0}).pipe(X(function(M){return m.addAdditionalEventProperties(M,"change",e.cssSelectorAllowlist,f)}),Ae()),z;window.navigation&&(z=De(window.navigation,"navigate").pipe(X(function(M){return m.addAdditionalEventProperties(M,"navigate",e.cssSelectorAllowlist,f)}),Ae()));var W=wi().pipe(X(function(M){return m.addAdditionalEventProperties(M,"mutation",e.cssSelectorAllowlist,f)}),Ae());return P={},P[he.ClickObservable]=k,P[he.ChangeObservable]=U,P[he.NavigateObservable]=z,P[he.MutationObservable]=W,P},T=nn(Object.values((s=(a=e.pageActions)===null||a===void 0?void 0:a.labeledEvents)!==null&&s!==void 0?s:{})),S=on((u=(c=e.pageActions)===null||c===void 0?void 0:c.triggers)!==null&&u!==void 0?u:[]),A=Xu(T,S,m,e),_=function(P){var k,U;P&&(e.pageActions=w(w({},e.pageActions),P),T=nn(Object.values((k=e.pageActions.labeledEvents)!==null&&k!==void 0?k:{})),S=on((U=e.pageActions.triggers)!==null&&U!==void 0?U:[]),A.update(T,S,e))},O=function(P,k){return E(void 0,void 0,void 0,function(){var U,z,W,M,G,ue,ce,ae,de,fe;return b(this,function(me){return typeof document>"u"?[2]:(P.fetchRemoteConfig&&(P.remoteConfigClient?P.remoteConfigClient.subscribe("analyticsSDK.pageActions","all",function(Q){_(Q)}):P.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),U=He(e,e.cssSelectorAllowlist),z=He(e,e.actionClickAllowlist),W=p(),M=Bu({allObservables:W,options:e,amplitude:k,shouldTrackEvent:U,evaluateTriggers:A.evaluate.bind(A)}),y.push(M),G=Gu({allObservables:W,getEventProperties:function(){for(var Q=[],Z=0;Z<arguments.length;Z++)Q[Z]=arguments[Z];return m.getEventProperties.apply(m,L(L([],I(Q),!1),[f],!1))},amplitude:k,shouldTrackEvent:U,evaluateTriggers:A.evaluate.bind(A)}),y.push(G),ue=Wu({allObservables:W,options:e,getEventProperties:function(){for(var Q=[],Z=0;Z<arguments.length;Z++)Q[Z]=arguments[Z];return m.getEventProperties.apply(m,L(L([],I(Q),!1),[f],!1))},amplitude:k,shouldTrackEvent:U,shouldTrackActionClick:z}),y.push(ue),(de=P?.loggerProvider)===null||de===void 0||de.log("".concat(h," has been successfully added.")),window.opener&&v.enabled&&(ce=e.cssSelectorAllowlist,ae=e.actionClickAllowlist,(fe=v.messenger)===null||fe===void 0||fe.setup(w(w({dataExtractor:m,logger:P?.loggerProvider},P?.serverZone&&{endpoint:hs[P.serverZone]}),{isElementSelectable:He(e,L(L([],I(ce),!1),I(ae),!1)),cssSelectorAllowlist:ce,actionClickAllowlist:ae}))),[2])})})},C=function(P){return E(void 0,void 0,void 0,function(){return b(this,function(k){return[2,P]})})},D=function(){return E(void 0,void 0,void 0,function(){var P,k,U,z,W;return b(this,function(M){try{for(P=x(y),k=P.next();!k.done;k=P.next())U=k.value,U.unsubscribe()}catch(G){z={error:G}}finally{try{k&&!k.done&&(W=P.return)&&W.call(P)}finally{if(z)throw z.error}}return[2]})})};return{name:h,type:g,setup:O,execute:C,teardown:D}},an=3e3;function Qu(e){var t=e.amplitude,r=e.allObservables,n=e.getEventProperties,i=e.shouldTrackDeadClick,o=r.clickObservable,a=r.mutationObservable,s=r.navigateObservable,c=o.pipe(ee(Xe),ee(function(f){return i("click",f.closestTrackedAncestor)}),ee(function(f){return f.event.target.closest('a[target="_blank"]')===null})),u=[a];s&&u.push(s);var l=fr.apply(void 0,L([],I(u),!1));return c.pipe(Ye(function(f){var d;return fu(new Y(function(v){return d=setTimeout(function(){return v.next(f)},an),function(){clearTimeout(d)}}),l.pipe(gt(1),X(function(){return null}))).pipe(ee(function(v){return v!==null}))}),Su(an)).subscribe(function(f){var d={"[Amplitude] X":f.event.clientX,"[Amplitude] Y":f.event.clientY};t.track(Za,w(w({},n("click",f.closestTrackedAncestor)),d),{time:f.timestamp})})}var zt=4,Ii=Xo,sn=50;function un(e,t){var r,n,i,o,a=t.event,s=a.clientX,c=a.clientY;e.yMin=Math.min((r=e.yMin)!==null&&r!==void 0?r:c,c),e.yMax=Math.max((n=e.yMax)!==null&&n!==void 0?n:c,c),e.xMin=Math.min((i=e.xMin)!==null&&i!==void 0?i:s,s),e.xMax=Math.max((o=e.xMax)!==null&&o!==void 0?o:s,s),e.isOutOfBounds=e.yMax-e.yMin>sn||e.xMax-e.xMin>sn}function cn(e){var t=e[0],r=e[e.length-1];return{rageClickEvent:w({"[Amplitude] Begin Time":new Date(t.timestamp).toISOString(),"[Amplitude] End Time":new Date(r.timestamp).toISOString(),"[Amplitude] Duration":r.timestamp-t.timestamp,"[Amplitude] Clicks":e.map(function(n){return{X:n.event.clientX,Y:n.event.clientY,Time:n.timestamp}}),"[Amplitude] Click Count":e.length},t.targetElementProperties),time:t.timestamp}}function Zu(e,t){var r=e[Math.max(0,e.length-zt+1)];return t.timestamp-r.timestamp>=Ii}function ec(e,t){return e.length>0&&e[e.length-1].closestTrackedAncestor!==t.closestTrackedAncestor}function tc(e){var t=e.amplitude,r=e.allObservables,n=e.shouldTrackRageClick,i=r.clickObservable,o=[],a={},s;function c(u){o=[],a={},u&&(un(a,u),o.push(u))}return i.pipe(ee(Xe),ee(function(u){return n("click",u.closestTrackedAncestor)}),X(function(u){if(s&&clearTimeout(s),un(a,u),o.length===0)return o.push(u),null;if(ec(o,u)||Zu(o,u)||a.isOutOfBounds){var l=o.length>=zt?cn(o):null;return c(u),l}return o.push(u),o.length>=zt&&(s=setTimeout(function(){var f=cn(o),d=f.rageClickEvent,v=f.time;t.track($r,d,{time:v}),c()},Ii)),null}),ee(function(u){return u!==null})).subscribe(function(u){u!==null&&t.track($r,u.rageClickEvent,{time:u.time})})}var rc=function(e){var t,r,n,i,o;e===void 0&&(e={});var a=Qa,s="enrichment",c=[],u=(r=(t=e.rageClicks)===null||t===void 0?void 0:t.cssSelectorAllowlist)!==null&&r!==void 0?r:Yo,l=(i=(n=e.deadClicks)===null||n===void 0?void 0:n.cssSelectorAllowlist)!==null&&i!==void 0?i:zo,f=(o=e.dataAttributePrefix)!==null&&o!==void 0?o:Dn,d=new hr(e),v=L([],I(new Set(L(L([],I(u),!1),I(l),!1))),!1),h=function(){var p,T=_i("pointerdown").pipe(X(function(_){return d.addAdditionalEventProperties(_,"click",v,f,!0)}),Ae()),S;window.navigation&&(S=De(window.navigation,"navigate").pipe(X(function(_){return d.addAdditionalEventProperties(_,"navigate",v,f)}),Ae()));var A=wi().pipe(X(function(_){return d.addAdditionalEventProperties(_,"mutation",v,f)}),Ae());return p={},p[he.ClickObservable]=T,p[he.ChangeObservable]=new Y,p[he.NavigateObservable]=S,p[he.MutationObservable]=A,p},g=function(p,T){return E(void 0,void 0,void 0,function(){var S,A,_,O,C,D;return b(this,function(P){return typeof document>"u"?[2]:(S=He(e,u),A=He(e,l),_=h(),O=tc({allObservables:_,amplitude:T,shouldTrackRageClick:S}),c.push(O),C=Qu({amplitude:T,allObservables:_,getEventProperties:function(k,U){return d.getEventProperties(k,U,f)},shouldTrackDeadClick:A}),c.push(C),(D=p?.loggerProvider)===null||D===void 0||D.log("".concat(a," has been successfully added.")),[2])})})},y=function(p){return E(void 0,void 0,void 0,function(){return b(this,function(T){return[2,p]})})},m=function(){return E(void 0,void 0,void 0,function(){var p,T,S,A,_;return b(this,function(O){try{for(p=x(c),T=p.next();!T.done;T=p.next())S=T.value,S.unsubscribe()}catch(C){A={error:C}}finally{try{T&&!T.done&&(_=p.return)&&_.call(p)}finally{if(A)throw A.error}}return[2]})})};return{name:a,type:s,setup:g,execute:y,teardown:m}},nc="@amplitude/plugin-network-capture-browser";var Ai="500-599";function ut(e,t){var r="^"+t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$";return new RegExp(r).test(e)}function Pi(e,t){var r,n,i=t.split(",");try{for(var o=x(i),a=o.next();!a.done;a=o.next()){var s=a.value,c=I(s.split("-").map(Number),2),u=c[0],l=c[1];if(e===u&&l===void 0||e>=u&&e<=l)return!0}}catch(f){r={error:f}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return!1}function ic(e,t,r,n,i){if(!(e.hosts&&!e.hosts.find(function(o){return ut(t,o)}))&&!(n&&e.urls&&!Bt(n,e.urls))&&!(i&&e.methods&&!e.methods.find(function(o){return i.toLowerCase()===o.toLowerCase()||o==="*"})))return!((r||r===0)&&!Pi(r,e.statusCodeRange||Ai))}function Ri(e){var t;if(e)try{var r=(t=$())===null||t===void 0?void 0:t.location.href,n=new URL(e,r),i=n.searchParams.toString(),o=n.hash.replace("#",""),a=n.href,s=n.host;return n.hash="",n.search="",{query:i,fragment:o,href:a,hrefWithoutQueryOrHash:n.href,host:s}}catch{return}}function oc(e,t){if(e.includes("amplitude.com"))try{var r=t.body;if(typeof r!="string")return!1;if(JSON.parse(r).events.find(function(n){return n.event_type==="[Amplitude] Network Request"}))return!0}catch{}return!1}function ln(e){if(typeof e!="object"||e===null)return e?L([],I(lt),!1):void 0;if(e.length!==0)return e}function dn(e){var t,r;return!(!((t=e?.allowlist)===null||t===void 0)&&t.length)&&!(!((r=e?.blocklist)===null||r===void 0)&&r.length)}function ac(e,t){var r;t===void 0&&(t={});var n=Ri(e.url);if(!n)return!1;var i=n.host;if(t.ignoreAmplitudeRequests!==!1&&(ut(i,"*.amplitude.com")||ut(i,"amplitude.com"))||!((r=t.ignoreHosts)===null||r===void 0)&&r.find(function(a){return ut(i,a)})||!t.captureRules&&e.status!==void 0&&!Pi(e.status,Ai))return!1;if(t.captureRules){var o;
13if(L([],I(t.captureRules),!1).reverse().find(function(a){if(o=ic(a,i,e.status,e.url,e.method),o){var s=ln(a.responseHeaders);if(e.responseWrapper&&s){var c=e.responseWrapper.headers(s);c&&(e.responseHeaders=c)}var u=ln(a.requestHeaders);if(e.requestWrapper&&u){var l=e.requestWrapper.headers(u);l&&(e.requestHeaders=l)}e.responseWrapper&&a.responseBody&&!dn(a.responseBody)&&(e.responseBodyJson=e.responseWrapper.json(a.responseBody.allowlist,a.responseBody.blocklist)),e.requestWrapper&&a.requestBody&&!dn(a.requestBody)&&(e.requestBodyJson=e.requestWrapper.json(a.requestBody.allowlist,a.requestBody.blocklist))}return o!==void 0}),!o)return!1}return!(e.requestWrapper&&oc(i,e.requestWrapper))}function sc(e,t,r,n){return E(this,void 0,void 0,function(){var i,o,a;return b(this,function(s){switch(s.label){case 0:return t.requestBodyJson||t.responseBodyJson?[4,Promise.all([t.requestBodyJson,t.responseBodyJson])]:[3,2];case 1:if(i=I.apply(void 0,[s.sent(),2]),o=i[0],a=i[1],o)try{e["[Amplitude] Request Body"]=JSON.stringify(o)}catch(c){n?.debug("Failed to stringify request body",c)}if(a)try{e["[Amplitude] Response Body"]=JSON.stringify(a)}catch{n?.debug("Failed to stringify response body")}s.label=2;case 2:return r?.track("[Amplitude] Network Request",e),[2]}})})}function uc(e){var t=e.allObservables,r=e.networkTrackingOptions,n=e.amplitude,i=e.loggerProvider;return t.networkObservable.pipe(ee(function(o){return ac(o.event,r)})).subscribe(function(o){var a,s,c,u=o.event,l=Ri(u.url);if(l){var f=(s=u.responseWrapper)===null||s===void 0?void 0:s.bodySize,d=(c=u.requestWrapper)===null||c===void 0?void 0:c.bodySize;sc((a={},a["[Amplitude] URL"]=l.hrefWithoutQueryOrHash,a["[Amplitude] URL Query"]=l.query,a["[Amplitude] URL Fragment"]=l.fragment,a["[Amplitude] Request Method"]=u.method,a["[Amplitude] Status Code"]=u.status,a["[Amplitude] Start Time"]=u.startTime,a["[Amplitude] Completion Time"]=u.endTime,a["[Amplitude] Duration"]=u.duration,a["[Amplitude] Request Body Size"]=d,a["[Amplitude] Response Body Size"]=f,a["[Amplitude] Request Type"]=u.type,a["[Amplitude] Request Headers"]=u.requestHeaders,a["[Amplitude] Response Headers"]=u.responseHeaders,a),u,n,i)}})}var Yt;(function(e){e.NetworkObservable="networkObservable"})(Yt||(Yt={}));var cc=function(e){e===void 0&&(e={});var t=nc,r="enrichment",n,i=[],o=function(l,f){return{event:l,timestamp:Date.now(),type:f}},a=function(){var l,f=new Y(function(d){var v=new oa(function(h){var g=o(h,"network");d.next(g)});return Vr.subscribe(v,n),function(){Vr.unsubscribe(v)}});return l={},l[Yt.NetworkObservable]=f,l},s=function(l,f){return E(void 0,void 0,void 0,function(){var d,v;return b(this,function(h){return typeof document>"u"?[2]:(d=a(),n=l?.loggerProvider,v=uc({allObservables:d,networkTrackingOptions:e,amplitude:f,loggerProvider:n}),i.push(v),n?.log("".concat(t," has been successfully added.")),[2])})})},c=function(l){return E(void 0,void 0,void 0,function(){return b(this,function(f){return[2,l]})})},u=function(){return E(void 0,void 0,void 0,function(){var l,f,d,v,h;return b(this,function(g){try{for(l=x(i),f=l.next();!f.done;f=l.next())d=f.value,d.unsubscribe()}catch(y){v={error:y}}finally{try{f&&!f.done&&(h=l.return)&&h.call(l)}finally{if(v)throw v.error}}return[2]})})};return{name:t,type:r,setup:s,execute:c,teardown:u}},lc=function(){var e="ampIntegrationContext";if(typeof globalThis<"u"&&typeof globalThis[e]<"u")return globalThis[e];if(typeof globalThis<"u")return globalThis;if(typeof window<"u")return window;if(typeof self<"u")return self;if(typeof global<"u")return global},Ft=function(e,t){var r=e;try{r=decodeURI(e)}catch(n){t?.error("Malformed URI sequence: ",n)}return r},dc="web-vitals-browser",fc="[Amplitude] Web Vitals",ki=-1,Ne=e=>{addEventListener("pageshow",(t=>{t.persisted&&(ki=t.timeStamp,e(t))}),!0)},pe=(e,t,r,n)=>{let i,o;return a=>{t.value>=0&&(a||n)&&(o=t.value-(i??0),(o||i===void 0)&&(i=t.value,t.delta=o,t.rating=((s,c)=>s>c[1]?"poor":s>c[0]?"needs-improvement":"good")(t.value,r),e(t)))}},pr=e=>{requestAnimationFrame((()=>requestAnimationFrame((()=>e()))))},gr=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Je=()=>gr()?.activationStart??0,ge=(e,t=-1)=>{const r=gr();let n="navigate";return ki>=0?n="back-forward-cache":r&&(document.prerendering||Je()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:n}},qt=new WeakMap;function mr(e,t){return qt.get(e)||qt.set(e,new t),qt.get(e)}var vc=class{constructor(){Ee(this,"t",void 0),Ee(this,"i",0),Ee(this,"o",[])}h(e){if(e.hadRecentInput)return;const t=this.o[0],r=this.o.at(-1);this.i&&t&&r&&e.startTime-r.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)}},Qe=(e,t,r={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const n=new PerformanceObserver((i=>{Promise.resolve().then((()=>{t(i.getEntries())}))}));return n.observe({type:e,buffered:!0,...r}),n}}catch{}},yr=e=>{let t=!1;return()=>{t||(e(),t=!0)}},Oe=-1,Oi=new Set,fn=()=>document.visibilityState!=="hidden"||document.prerendering?1/0:0,Xt=e=>{if(document.visibilityState==="hidden"){if(e.type==="visibilitychange")for(const t of Oi)t();isFinite(Oe)||(Oe=e.type==="visibilitychange"?e.timeStamp:0,removeEventListener("prerenderingchange",Xt,!0))}},bt=()=>{if(Oe<0){const e=Je();Oe=(document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter((t=>t.name==="hidden"&&t.startTime>e))[0]?.startTime)??fn(),addEventListener("visibilitychange",Xt,!0),addEventListener("prerenderingchange",Xt,!0),Ne((()=>{setTimeout((()=>{Oe=fn()}))}))}return{get firstHiddenTime(){return Oe},onHidden(e){Oi.add(e)}}},Et=e=>{document.prerendering?addEventListener("prerenderingchange",(()=>e()),!0):e()},vn=[1800,3e3],Ci=(e,t={})=>{Et((()=>{const r=bt();let n,i=ge("FCP");const o=Qe("paint",(a=>{for(const s of a)s.name==="first-contentful-paint"&&(o.disconnect(),s.startTime<r.firstHiddenTime&&(i.value=Math.max(s.startTime-Je(),0),i.entries.push(s),n(!0)))}));o&&(n=pe(e,i,vn,t.reportAllChanges),Ne((a=>{i=ge("FCP"),n=pe(e,i,vn,t.reportAllChanges),pr((()=>{i.value=performance.now()-a.timeStamp,n(!0)}))})))}))},hn=[.1,.25],hc=(e,t={})=>{const r=bt();Ci(yr((()=>{let n,i=ge("CLS",0);const o=mr(t,vc),a=c=>{for(const u of c)o.h(u);o.i>i.value&&(i.value=o.i,i.entries=o.o,n())},s=Qe("layout-shift",a);s&&(n=pe(e,i,hn,t.reportAllChanges),r.onHidden((()=>{a(s.takeRecords()),n(!0)})),Ne((()=>{o.i=0,i=ge("CLS",0),n=pe(e,i,hn,t.reportAllChanges),pr((()=>n()))})),setTimeout(n))})))},Li=0,Vt=1/0,nt=0,pc=e=>{for(const t of e)t.interactionId&&(Vt=Math.min(Vt,t.interactionId),nt=Math.max(nt,t.interactionId),Li=nt?(nt-Vt)/7+1:0)},Jt,pn=()=>Jt?Li:performance.interactionCount??0,gc=()=>{"interactionCount"in performance||Jt||(Jt=Qe("event",pc,{type:"event",buffered:!0,durationThreshold:0}))},gn=0,mc=class{constructor(){Ee(this,"u",[]),Ee(this,"l",new Map),Ee(this,"m",void 0),Ee(this,"p",void 0)}v(){gn=pn(),this.u.length=0,this.l.clear()}L(){const e=Math.min(this.u.length-1,Math.floor((pn()-gn)/50));return this.u[e]}h(e){if(this.m?.(e),!e.interactionId&&e.entryType!=="first-input")return;const t=this.u.at(-1);let r=this.l.get(e.interactionId);if(r||this.u.length<10||e.duration>t.P){if(r?e.duration>r.P?(r.entries=[e],r.P=e.duration):e.duration===r.P&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],P:e.duration},this.l.set(r.id,r),this.u.push(r)),this.u.sort(((n,i)=>i.P-n.P)),this.u.length>10){const n=this.u.splice(10);for(const i of n)this.l.delete(i.id)}this.p?.(r)}}},Di=e=>{const t=globalThis.requestIdleCallback||setTimeout;document.visibilityState==="hidden"?e():(e=yr(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t((()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})}
13)))},mn=[200,500],yc=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const r=bt();Et((()=>{gc();let n,i=ge("INP");const o=mr(t,mc),a=c=>{Di((()=>{for(const l of c)o.h(l);const u=o.L();u&&u.P!==i.value&&(i.value=u.P,i.entries=u.entries,n())}))},s=Qe("event",a,{durationThreshold:t.durationThreshold??40});n=pe(e,i,mn,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(s.takeRecords()),n(!0)})),Ne((()=>{o.v(),i=ge("INP"),n=pe(e,i,mn,t.reportAllChanges)})))}))},bc=class{constructor(){Ee(this,"m",void 0)}h(e){this.m?.(e)}},yn=[2500,4e3],Ec=(e,t={})=>{Et((()=>{const r=bt();let n,i=ge("LCP");const o=mr(t,bc),a=c=>{t.reportAllChanges||(c=c.slice(-1));for(const u of c)o.h(u),u.startTime<r.firstHiddenTime&&(i.value=Math.max(u.startTime-Je(),0),i.entries=[u],n())},s=Qe("largest-contentful-paint",a);if(s){n=pe(e,i,yn,t.reportAllChanges);const c=yr((()=>{a(s.takeRecords()),s.disconnect(),n(!0)})),u=l=>{l.isTrusted&&(Di(c),removeEventListener(l.type,u,{capture:!0}))};for(const l of["keydown","click","visibilitychange"])addEventListener(l,u,{capture:!0});Ne((l=>{i=ge("LCP"),n=pe(e,i,yn,t.reportAllChanges),pr((()=>{i.value=performance.now()-l.timeStamp,n(!0)}))}))}}))},bn=[800,1800],Qt=e=>{document.prerendering?Et((()=>Qt(e))):document.readyState!=="complete"?addEventListener("load",(()=>Qt(e)),!0):setTimeout(e)},Tc=(e,t={})=>{let r=ge("TTFB"),n=pe(e,r,bn,t.reportAllChanges);Qt((()=>{const i=gr();i&&(r.value=Math.max(i.responseStart-Je(),0),r.entries=[i],n(!0),Ne((()=>{r=ge("TTFB",0),n=pe(e,r,bn,t.reportAllChanges),n(!0)})))}))};function Sc(e){var t,r=((t=e.entries[0])===null||t===void 0?void 0:t.startTime)||0;return performance.timeOrigin+r}function Fe(e){return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor(Sc(e)),navigationStart:Math.floor(performance.timeOrigin)}}var wc=function(){var e=null,t=lc(),r=t?.document,n=t?.location,i=function(s,c){return E(void 0,void 0,void 0,function(){var u,l;return b(this,function(f){return r===void 0?[2]:(u=Ft(n?.href||"",s.loggerProvider),l={"[Amplitude] Page Domain":n?.hostname||"","[Amplitude] Page Location":u,"[Amplitude] Page Path":Ft(n?.pathname||"",s.loggerProvider),"[Amplitude] Page Title":typeof document<"u"&&document.title||"","[Amplitude] Page URL":Ft(u.split("?")[0],s.loggerProvider)},Ec(function(d){l["[Amplitude] LCP"]=Fe(d)}),Ci(function(d){l["[Amplitude] FCP"]=Fe(d)}),yc(function(d){l["[Amplitude] INP"]=Fe(d)}),hc(function(d){l["[Amplitude] CLS"]=Fe(d)}),Tc(function(d){l["[Amplitude] TTFB"]=Fe(d)}),e=function(){r.visibilityState==="hidden"&&e&&(c.track(fc,l),r.removeEventListener("visibilitychange",e),e=null)},r.addEventListener("visibilitychange",e),[2])})})},o=function(s){return E(void 0,void 0,void 0,function(){return b(this,function(c){return[2,s]})})},a=function(){return E(void 0,void 0,void 0,function(){return b(this,function(s){return e&&r?.removeEventListener("visibilitychange",e),[2]})})};return{name:dc,type:"enrichment",setup:i,execute:o,teardown:a}},En=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},_c=function(e){return Object.values(e).every(function(t){return!t})},Ic=function(e,t,r,n,i){i===void 0&&(i=!0),e.referrer;var o=e.referring_domain,a=ct(e,["referrer","referring_domain"]),s=t||{};s.referrer;var c=s.referring_domain,u=ct(s,["referrer","referring_domain"]);if(Ac(r.excludeReferrers,e.referring_domain))return n.debug("This is not a new campaign because ".concat(e.referring_domain," is in the exclude referrer list.")),!1;if(!i&&_c(e)&&t)return n.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var l=JSON.stringify(a)!==JSON.stringify(u),f=En(o||"")!==En(c||""),d=!t||l||f;return d?n.debug("This is a new campaign. An $identify event will be sent."):n.debug("This is not a new campaign because it's the same as the previous one."),d},Ac=function(e,t){return e===void 0&&(e=[]),t===void 0&&(t=""),e.some(function(r){return r instanceof RegExp?r.test(t):r===t})},Pc=function(e,t){var r=w(w({},mt),e);return An(Object.entries(r).reduce(function(n,i){var o,a=I(i,2),s=a[0],c=a[1];
13return n.setOnce("initial_".concat(s),(o=c??t.initialEmptyValue)!==null&&o!==void 0?o:"EMPTY"),c?n.set(s,c):n.unset(s)},new Ge))},Rc=function(e){var t=e;return t?(t.startsWith(".")&&(t=t.substring(1)),[new RegExp("".concat(t.replace(".","\\."),"$"))]):[]},kc=(function(){function e(t,r){var n;this.shouldTrackNewCampaign=!1,this.options=w({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:Rc((n=r.cookieOptions)===null||n===void 0?void 0:n.domain)},t),this.storage=r.cookieStorage,this.storageKey=xr(r.apiKey,"MKTG"),this.webExpStorageKey=xr(r.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=mt,this.sessionTimeout=r.sessionTimeout,this.lastEventTime=r.lastEventTime,this.logger=r.loggerProvider,r.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return E(this,void 0,void 0,function(){var t,r;return b(this,function(n){switch(n.label){case 0:return[4,this.fetchCampaign()];case 1:return r=I.apply(void 0,[n.sent(),2]),this.currentCampaign=r[0],this.previousCampaign=r[1],t=this.lastEventTime?Cn(this.sessionTimeout,this.lastEventTime):!0,Ic(this.currentCampaign,this.previousCampaign,this.options,this.logger,t)?(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 E(this,void 0,void 0,function(){var t;return b(this,function(r){switch(r.label){case 0:return[4,this.storage.get(this.webExpStorageKey)];case 1:return t=r.sent(),t?[4,this.storage.remove(this.webExpStorageKey)]:[3,3];case 2:r.sent(),r.label=3;case 3:return[4,Promise.all([t||new Mn().parse(),this.storage.get(this.storageKey)])];case 4:return[2,r.sent()]}})})},e.prototype.generateCampaignEvent=function(t){this.shouldTrackNewCampaign=!1;var r=Pc(this.currentCampaign,this.options);return t&&(r.event_id=t),r},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e})(),Tn="AMP_CURRENT_PAGE",Sn="AMP_PREVIOUS_PAGE",ke="AMP_URL_INFO",Be;(function(e){e.Direct="direct",e.Internal="internal",e.External="external"})(Be||(Be={}));var Oc=new Set([le.IDENTIFY,le.GROUP_IDENTIFY,le.REVENUE]),Cc=function(){var e=$
13(),t=void 0,r=!1,n=void 0,i=!1,o=!1,a=function(l){var f;try{var d=Ve(l,n);f=new URL(d).hostname}catch(v){n?.error("Could not parse URL: ",v)}return f},s=function(l){var f=typeof location<"u"&&location.hostname||"";switch(l?a(l):void 0){case void 0:return Be.Direct;case f:return Be.Internal;default:return Be.External}},c=function(){return E(void 0,void 0,void 0,function(){var l,f,d,v,h;return b(this,function(g){switch(g.label){case 0:return t&&r?[4,t.get(ke)]:[3,3];case 1:return l=g.sent(),f=Ve(typeof location<"u"&&location.href||""),d=l?.AMP_CURRENT_PAGE||"",v=void 0,f===d?v=l?.AMP_PREVIOUS_PAGE||"":d?v=d:v=document.referrer||"",[4,t.set(ke,(h={},h[Tn]=f,h[Sn]=v,h))];case 2:g.sent(),g.label=3;case 3:return[2]}})})},u=function(){c()};return{name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(l,f){return E(void 0,void 0,void 0,function(){return b(this,function(d){switch(d.label){case 0:return n=l.loggerProvider,n.log("Installing @amplitude/plugin-page-url-enrichment-browser"),o=!0,e?(t=new er(e.sessionStorage),[4,t.isEnabled()]):[3,2];case 1:r=d.sent(),e.addEventListener("popstate",u),i||(e.history.pushState=new Proxy(e.history.pushState,{apply:function(v,h,g){var y=I(g,3),m=y[0],p=y[1],T=y[2];v.apply(h,[m,p,T]),o&&u()}}),e.history.replaceState=new Proxy(e.history.replaceState,{apply:function(v,h,g){var y=I(g,3),m=y[0],p=y[1],T=y[2];v.apply(h,[m,p,T]),o&&u()}}),i=!0),d.label=2;case 2:return[2]}})})},execute:function(l){return E(void 0,void 0,void 0,function(){var f,d,v,h,g;return b(this,function(y){switch(y.label){case 0:return f=Ve(typeof location<"u"&&location.href||""),t&&r?[4,t.get(ke)]:[3,5];case 1:return d=y.sent(),d?.AMP_CURRENT_PAGE?[3,3]:[4,t.set(ke,(g={},g[Tn]=f,g[Sn]=document.referrer||"",g))];case 2:y.sent(),y.label=3;case 3:return[4,t.get(ke)];case 4:if(v=y.sent(),h="",v&&(h=v.AMP_PREVIOUS_PAGE||""),Oc.has(l.event_type))return[2,l];l.event_properties=w(w({},l.event_properties||{}),{"[Amplitude] Page Domain":qe(l,"[Amplitude] Page Domain",typeof location<"u"&&location.hostname||""),"[Amplitude] Page Location":qe(l,"[Amplitude] Page Location",f),"[Amplitude] Page Path":qe(l,"[Amplitude] Page Path",typeof location<"u"&&Ve(location.pathname)||""),"[Amplitude] Page Title":qe(l,"[Amplitude] Page Title",ir(nr)),"[Amplitude] Page URL":qe(l,"[Amplitude] Page URL",f.split("?")[0]),"[Amplitude] Previous Page Location":h,"[Amplitude] Previous Page Type":s(h)}),y.label=5;case 5:return[2,l]}})})},teardown:function(){return E(void 0,void 0,void 0,function(){return b(this,function(l){switch(l.label){case 0:return e&&(e.removeEventListener("popstate",u),o=!1),t&&r?[4,t.set(ke,{})]:[3,2];case 1:l.sent(),l.label=2;case 2:return[2]}})})}}};function qe(e,t,r){return e.event_properties||(e.event_properties={}),e.event_properties[t]===void 0?r:e.event_properties[t]}var Lc=(function(e){re(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r._diagnosticsSampleRate=0,r}return t.prototype.init=function(r,n,i){r===void 0&&(r="");var o,a;return arguments.length>2?(o=n,a=i):typeof n=="string"?(o=n,a=void 0):(o=n?.userId,a=n),ne(this._init(w(w({},a),{userId:o,apiKey:r})))},t.prototype._init=function(r){var n,i,o,a,s;return E(this,void 0,void 0,function(){var c,u,l,f,d,v,h,g,y,m=this;return b(this,function(p){switch(p.label){case 0:return this.initializing?[2]:(this.initializing=!0,[4,Ma(r.apiKey,r,this)]);case 1:return c=p.sent(),!((n=c.remoteConfig)===null||n===void 0)&&n.fetchRemoteConfig?(u=new Go(c.apiKey,c.loggerProvider,c.serverZone,(i=c.remoteConfig)===null||i===void 0?void 0:i.serverUrl),[4,new Promise(function(T){u?.subscribe("configs.analyticsSDK.browserSDK","all",function(S,A,_){c.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:S,source:A,lastFetch:_},null,2)),S&&Xa(S,c),T()})})]):[3,3];case 2:p.sent(),p.label=3;case 3:return l=new Vo(c.apiKey,c.loggerProvider,c.serverZone,{enabled:c.enableDiagnostics,sampleRate:c.diagnosticsSampleRate||this._diagnosticsSampleRate}),l.setTag("library","".concat(Gn,"/").concat(or)),[4,e.prototype._init.call(this,c)];case 4:return p.sent(),this.logBrowserOptions(c),this.config.diagnosticsClient=l,this.config.remoteConfigClient=u,qn(this.config.defaultTracking)?(f=ya(this.config),this.webAttribution=new kc(f,this.config),[4,this.webAttribution.init()]):[3,6];case 5:p.sent(),p.label=6;case 6:return d=dt(),v=d.ampTimestamp?Number(d.ampTimestamp):void 0,h=v?Date.now()<v:!0,this.config.identify&&this.identify(this.config.identify),g=h&&
13!Number.isNaN(Number(d.ampSessionId))?Number(d.ampSessionId):void 0,this.setSessionId((s=(a=(o=r.sessionId)!==null&&o!==void 0?o:g)!==null&&a!==void 0?a:this.config.sessionId)!==null&&s!==void 0?s:Date.now()),y=We(r.instanceName),y.identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),this.config.offline===null?[3,8]:[4,this.add(Ya()).promise];case 7:p.sent(),p.label=8;case 8:return[4,this.add(new yo({diagnosticsClient:l})).promise];case 9:return p.sent(),[4,this.add(new Ta).promise];case 10:return p.sent(),[4,this.add(new ko).promise];case 11:return p.sent(),za(this.config),la(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add($a()).promise]):[3,13];case 12:p.sent(),p.label=13;case 13:return da(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(Ka()).promise]):[3,15];case 14:p.sent(),p.label=15;case 15:return Vn(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(Ha(ma(this.config))).promise]):[3,17];case 16:p.sent(),p.label=17;case 17:return Hn(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(Ju(ha(this.config),{diagnosticsClient:l})).promise]):[3,19];case 18:p.sent(),p.label=19;case 19:return Bn(this.config.autocapture)?(this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(rc(pa(this.config))).promise]):[3,21];case 20:p.sent(),p.label=21;case 21:return jn(this.config.autocapture)?(this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(cc(ga(this.config))).promise]):[3,23];case 22:p.sent(),p.label=23;case 23:return va(this.config.autocapture)?(this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(wc()).promise]):[3,25];case 24:p.sent(),p.label=25;case 25:return fa(this.config.autocapture)?(this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(Cc()).promise]):[3,27];case 26:p.sent(),p.label=27;case 27:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 28:return p.sent(),y.eventBridge.setEventReceiver(function(T){var S=T.eventProperties||{},A=S.time,_=ct(S,["time"]),O=typeof A=="number"?{time:A}:void 0;m.track(T.eventType,_,O)}),[2]}})})},t.prototype.getUserId=function(){var r;return(r=this.config)===null||r===void 0?void 0:r.userId},t.prototype.setUserId=function(r){if(!this.config){this.q.push(this.setUserId.bind(this,r));return}this.config.loggerProvider.debug("function setUserId: ",r),(r!==this.config.userId||r===void 0)&&(this.config.userId=r,this.timeline.onIdentityChanged({userId:r}),Po(r,this.config.instanceName))},t.prototype.getDeviceId=function(){var r;return(r=this.config)===null||r===void 0?void 0:r.deviceId},t.prototype.setDeviceId=function(r){if(!this.config){this.q.push(this.setDeviceId.bind(this,r));return}this.config.loggerProvider.debug("function setDeviceId: ",r),r!==this.config.deviceId&&(this.config.deviceId=r,this.timeline.onIdentityChanged({deviceId:r}),Ro(r,this.config.instanceName))},t.prototype.reset=function(){this.setDeviceId(we()),this.setUserId(void 0)},t.prototype.getIdentity=function(){var r,n;return{deviceId:(r=this.config)===null||r===void 0?void 0:r.deviceId,userId:(n=this.config)===null||n===void 0?void 0:n.userId,userProperties:this.userProperties}},t.prototype.getOptOut=function(){var r;return(r=this.config)===null||r===void 0?void 0:r.optOut},t.prototype.getSessionId=function(){var r;return(r=this.config)===null||r===void 0?void 0:r.sessionId},t.prototype.setSessionId=function(r){var n,i=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,r)),ne(Promise.resolve());if(r===this.config.sessionId)return ne(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",r);var o=this.getSessionId();o!==r&&this.timeline.onSessionIdChanged(r);var a=this.config.lastEventTime,s=(n=this.config.lastEventId)!==null&&n!==void 0?n:-1;this.config.sessionId=r,this.config.lastEventTime=void 0,this.config.pageCounter=0,jr(this.config.defaultTracking)&&(o&&a&&i.push(this.track(Oa,void 0,{device_id:this.previousSessionDeviceId,event_id:++s,session_id:o,time:a+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var c=this.trackCampaignEventIfNeeded(++s,i);return jr(this.config.defaultTracking)&&i.push(this.track(ka,void 0,{event_id:c?++s:s,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,ne(Promise.all(i))},t.prototype.extendSession=function(){if(!this.config){this.q.push(this.extendSession.bind(this));return}
13this.config.lastEventTime=Date.now()},t.prototype.setTransport=function(r){if(!this.config){this.q.push(this.setTransport.bind(this,r));return}this.config.transportProvider=$n(r)},t.prototype.identify=function(r,n){if(kt(r)){var i=r._q;r._q=[],r=Rt(new Ge,i)}return n?.user_id&&this.setUserId(n.user_id),n?.device_id&&this.setDeviceId(n.device_id),e.prototype.identify.call(this,r,n)},t.prototype.groupIdentify=function(r,n,i,o){if(kt(i)){var a=i._q;i._q=[],i=Rt(new Ge,a)}return e.prototype.groupIdentify.call(this,r,n,i,o)},t.prototype.revenue=function(r,n){if(kt(r)){var i=r._q;r._q=[],r=Rt(new lo,i)}return e.prototype.revenue.call(this,r,n)},t.prototype.trackCampaignEventIfNeeded=function(r,n){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign)return!1;var i=this.webAttribution.generateCampaignEvent(r);return n?n.push(this.track(i).promise):this.track(i),this.config.loggerProvider.log("Tracking attribution."),!0},t.prototype.process=function(r){return E(this,void 0,void 0,function(){var n,i,o;return b(this,function(a){return n=Date.now(),i=Cn(this.config.sessionTimeout,this.config.lastEventTime),o=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),r.event_type!=="session_start"&&r.event_type!=="session_end"&&(!r.session_id||r.session_id===this.getSessionId())&&(i||o?(this.setSessionId(n),o&&this.config.loggerProvider.log("Created a new session for new campaign.")):i||this.trackCampaignEventIfNeeded()),r.event_type===le.IDENTIFY&&r.user_properties&&(this.userProperties=this.getOperationAppliedUserProperties(r.user_properties)),[2,e.prototype.process.call(this,r)]})})},t.prototype.logBrowserOptions=function(r){try{var n=w(w({},r),{apiKey:r.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",JSON.stringify(n))}catch(i){this.config.loggerProvider.error("Error logging browser config",i)}},t.prototype._setDiagnosticsSampleRate=function(r){if(!(r>1||r<0)&&!this.config){this._diagnosticsSampleRate=r;return}},t})(co),Dc=function(){var e=new Lc;return{init:H(e.init.bind(e),"init",V(e),j(e,["config"])),add:H(e.add.bind(e),"add",V(e),j(e,["config.apiKey","timeline.plugins"])),remove:H(e.remove.bind(e),"remove",V(e),j(e,["config.apiKey","timeline.plugins"])),track:H(e.track.bind(e),"track",V(e),j(e,["config.apiKey","timeline.queue.length"])),logEvent:H(e.logEvent.bind(e),"logEvent",V(e),j(e,["config.apiKey","timeline.queue.length"])),identify:H(e.identify.bind(e),"identify",V(e),j(e,["config.apiKey","timeline.queue.length"])),groupIdentify:H(e.groupIdentify.bind(e),"groupIdentify",V(e),j(e,["config.apiKey","timeline.queue.length"])),setGroup:H(e.setGroup.bind(e),"setGroup",V(e),j(e,["config.apiKey","timeline.queue.length"])),revenue:H(e.revenue.bind(e),"revenue",V(e),j(e,["config.apiKey","timeline.queue.length"])),flush:H(e.flush.bind(e),"flush",V(e),j(e,["config.apiKey","timeline.queue.length"])),getUserId:H(e.getUserId.bind(e),"getUserId",V(e),j(e,["config","config.userId"])),setUserId:H(e.setUserId.bind(e),"setUserId",V(e),j(e,["config","config.userId"])),getDeviceId:H(e.getDeviceId.bind(e),"getDeviceId",V(e),j(e,["config","config.deviceId"])),setDeviceId:H(e.setDeviceId.bind(e),"setDeviceId",V(e),j(e,["config","config.deviceId"])),reset:H(e.reset.bind(e),"reset",V(e),j(e,["config","config.userId","config.deviceId"])),getSessionId:H(e.getSessionId.bind(e),"getSessionId",V(e),j(e,["config"])),setSessionId:H(e.setSessionId.bind(e),"setSessionId",V(e),j(e,["config"])),extendSession:H(e.extendSession.bind(e),"extendSession",V(e),j(e,["config"])),setOptOut:H(e.setOptOut.bind(e),"setOptOut",V(e),j(e,["config"])),setTransport:H(e.setTransport.bind(e),"setTransport",V(e),j(e,["config"])),getIdentity:H(e.getIdentity.bind(e),"getIdentity",V(e),j(e,["config"])),getOptOut:H(e.getOptOut.bind(e),"getOptOut",V(e),j(e,["config"])),_setDiagnosticsSampleRate:H(e._setDiagnosticsSampleRate.bind(e),"_setDiagnosticsSampleRate",V(e),j(e,["config"]))}},B=Dc(),Bc=B.add,Gc=B.extendSession,Wc=B.flush,Kc=B.getDeviceId,$c=B.getIdentity,zc=B.getOptOut,Yc=B.getSessionId,Xc=B.getUserId,Jc=B.groupIdentify,xc=B.identify,Nc=B.init,Qc=B.logEvent,Zc=B.remove,el=B.reset,tl=B.revenue,rl=B.setDeviceId,nl=B.setGroup,il=B.setOptOut,ol=B.setSessionId,al=B.setTransport,Uc=B.setUserId,Mc=B.track,sl=B._setDiagnosticsSampleRate,Fc=()=>!0,qc=()=>window.location.href.includes("/wv")||window.location.href.includes("/in-app"),Tt=()=>Fc()&&!qc(),ul=()=>{if(Tt())try{Nc("880a9d375077cc20c6f320ab7d042fe7",{autocapture:{pageViews:!1,formInteractions:!1,elementInteractions:!1,fileDownloads:!1}})}catch{}},cl=e=>{if(Tt())try{Uc(e)}catch{}},ll=e=>{if(Tt())try{const t=new Ge;for(const r in e)t.set(r,e[r]);xc(t)}catch{}},dl=(e,t)=>{if(Tt())try{Mc(e,{prevPage:Ni.getItem("referrer"),clickPage:window.location.pathname,...t})}catch{}};export{dl as i,cl as n,ll as r,ul as t};

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.