@amplitude/analytics-browser 1.10.6 → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/cjs/browser-client.d.ts.map +1 -1
- package/lib/cjs/browser-client.js +41 -95
- package/lib/cjs/browser-client.js.map +1 -1
- package/lib/cjs/config.d.ts +32 -41
- package/lib/cjs/config.d.ts.map +1 -1
- package/lib/cjs/config.js +135 -175
- package/lib/cjs/config.js.map +1 -1
- package/lib/cjs/constants.d.ts +3 -0
- package/lib/cjs/constants.d.ts.map +1 -1
- package/lib/cjs/constants.js +3 -1
- package/lib/cjs/constants.js.map +1 -1
- package/lib/cjs/cookie-migration/index.d.ts +2 -2
- package/lib/cjs/cookie-migration/index.d.ts.map +1 -1
- package/lib/cjs/cookie-migration/index.js +31 -32
- package/lib/cjs/cookie-migration/index.js.map +1 -1
- package/lib/cjs/plugins/context.d.ts +0 -2
- package/lib/cjs/plugins/context.d.ts.map +1 -1
- package/lib/cjs/plugins/context.js +2 -8
- package/lib/cjs/plugins/context.js.map +1 -1
- package/lib/cjs/version.d.ts +1 -1
- package/lib/cjs/version.d.ts.map +1 -1
- package/lib/cjs/version.js +1 -1
- package/lib/cjs/version.js.map +1 -1
- package/lib/esm/browser-client.d.ts.map +1 -1
- package/lib/esm/browser-client.js +44 -98
- package/lib/esm/browser-client.js.map +1 -1
- package/lib/esm/config.d.ts +32 -41
- package/lib/esm/config.d.ts.map +1 -1
- package/lib/esm/config.js +137 -175
- package/lib/esm/config.js.map +1 -1
- package/lib/esm/constants.d.ts +3 -0
- package/lib/esm/constants.d.ts.map +1 -1
- package/lib/esm/constants.js +2 -0
- package/lib/esm/constants.js.map +1 -1
- package/lib/esm/cookie-migration/index.d.ts +2 -2
- package/lib/esm/cookie-migration/index.d.ts.map +1 -1
- package/lib/esm/cookie-migration/index.js +31 -32
- package/lib/esm/cookie-migration/index.js.map +1 -1
- package/lib/esm/plugins/context.d.ts +0 -2
- package/lib/esm/plugins/context.d.ts.map +1 -1
- package/lib/esm/plugins/context.js +2 -8
- package/lib/esm/plugins/context.js.map +1 -1
- package/lib/esm/version.d.ts +1 -1
- package/lib/esm/version.d.ts.map +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/esm/version.js.map +1 -1
- package/lib/scripts/amplitude-min.js +1 -1
- package/lib/scripts/amplitude-min.js.gz +0 -0
- package/lib/scripts/amplitude-min.umd.js +1 -1
- package/lib/scripts/amplitude-min.umd.js.gz +0 -0
- package/lib/scripts/amplitude-snippet-instructions.html +1 -1
- package/lib/scripts/amplitude-snippet-min.js +1 -1
- package/lib/scripts/browser-client.d.ts.map +1 -1
- package/lib/scripts/config.d.ts +32 -41
- package/lib/scripts/config.d.ts.map +1 -1
- package/lib/scripts/constants.d.ts +3 -0
- package/lib/scripts/constants.d.ts.map +1 -1
- package/lib/scripts/cookie-migration/index.d.ts +2 -2
- package/lib/scripts/cookie-migration/index.d.ts.map +1 -1
- package/lib/scripts/plugins/context.d.ts +0 -2
- package/lib/scripts/plugins/context.d.ts.map +1 -1
- package/lib/scripts/version.d.ts +1 -1
- package/lib/scripts/version.d.ts.map +1 -1
- package/package.json +7 -9
- package/lib/cjs/plugins/default-page-view-event-enrichment.d.ts +0 -3
- package/lib/cjs/plugins/default-page-view-event-enrichment.d.ts.map +0 -1
- package/lib/cjs/plugins/default-page-view-event-enrichment.js +0 -47
- package/lib/cjs/plugins/default-page-view-event-enrichment.js.map +0 -1
- package/lib/esm/plugins/default-page-view-event-enrichment.d.ts +0 -3
- package/lib/esm/plugins/default-page-view-event-enrichment.d.ts.map +0 -1
- package/lib/esm/plugins/default-page-view-event-enrichment.js +0 -43
- package/lib/esm/plugins/default-page-view-event-enrichment.js.map +0 -1
- package/lib/scripts/plugins/default-page-view-event-enrichment.d.ts +0 -3
- package/lib/scripts/plugins/default-page-view-event-enrichment.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).amplitude={})}(this,(function(e){"use strict";var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},t(e,i)};function i(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}var n,r,o,s,a,u,c,l,d=function(){return d=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},d.apply(this,arguments)};function p(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]])}return i}function f(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))}function v(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,n&&(r=2&a[0]?n.return:a[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;switch(n=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){s.label=a[1];break}if(6===a[0]&&s.label<r[1]){s.label=r[1],r=a;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(a);break}r[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{i=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}function h(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)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 g(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,o=i.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return s}function b(e,t,i){if(i||2===arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))}!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"}(n||(n={})),function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE="$revenue"}(r||(r={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(o||(o={})),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"}(s||(s={})),function(e){e.BEFORE="before",e.ENRICHMENT="enrichment",e.DESTINATION="destination"}(a||(a={})),function(e){e.US="US",e.EU="EU"}(u||(u={})),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"}(c||(c={})),function(e){e.XHR="xhr",e.SendBeacon="beacon",e.Fetch="fetch"}(l||(l={}));var y=Object.freeze({__proto__:null,get SpecialEventType(){return o},get IdentifyOperation(){return n},get RevenueProperty(){return r},get LogLevel(){return s},get PluginType(){return a},get ServerZone(){return u},get Status(){return c},get TransportType(){return l}}),m="AMP",w="".concat(m,"_unsent"),_="https://api2.amplitude.com/2/httpapi",I=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var i=e[t];if(!k(t,i))return!1}return!0},k=function(e,t){var i,n;if("string"!=typeof e)return!1;if(Array.isArray(t)){var r=!0;try{for(var o=h(t),s=o.next();!s.done;s=o.next()){var a=s.value;if(Array.isArray(a))return!1;if("object"==typeof a)r=r&&I(a);else if(!["number","string"].includes(typeof a))return!1;if(!r)return!1}}catch(e){i={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}}else{if(null==t)return!1;if("object"==typeof t)return I(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},E=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return d({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(n.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(n.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(n.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(n.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(n.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(n.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(n.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(n.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(n.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[n.CLEAR_ALL]="-",this},e.prototype._safeSet=function(e,t,i){if(this._validate(e,t,i)){var n=this._properties[e];return void 0===n&&(n={},this._properties[e]=n),n[t]=i,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,i){return void 0===this._properties[n.CLEAR_ALL]&&(!this._propertySet.has(t)&&(e===n.ADD?"number"==typeof i:e===n.UNSET||e===n.REMOVE||k(t,i)))},e}(),S=function(e,t){return d(d({},t),{event_type:o.IDENTIFY,user_properties:e.getUserProperties()})},T=function(e,t,i){return void 0===t&&(t=0),void 0===i&&(i=c.Unknown),{event:e,code:t,message:i}},O=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[]}return e.prototype.register=function(e,t){return f(this,void 0,void 0,(function(){return v(this,(function(i){switch(i.label){case 0:return[4,e.setup(t,this.client)];case 1:return i.sent(),this.plugins.push(e),[2]}}))}))},e.prototype.deregister=function(e){return this.plugins.splice(this.plugins.findIndex((function(t){return t.name===e})),1),Promise.resolve()},e.prototype.reset=function(e){this.applying=!1,this.plugins=[],this.client=e},e.prototype.push=function(e){var t=this;return new Promise((function(i){t.queue.push([e,i]),t.scheduleApply(0)}))},e.prototype.scheduleApply=function(e){var t=this;this.applying||(this.applying=!0,setTimeout((function(){t.apply(t.queue.shift()).then((function(){t.applying=!1,t.queue.length>0&&t.scheduleApply(0)}))}),e))},e.prototype.apply=function(e){return f(this,void 0,void 0,(function(){var t,i,n,r,o,s,u,c,l,p,f,b,y,m,w,_,I,k,E;return v(this,(function(v){switch(v.label){case 0:if(!e)return[2];t=g(e,1),i=t[0],n=g(e,2),r=n[1],o=this.plugins.filter((function(e){return e.type===a.BEFORE})),v.label=1;case 1:v.trys.push([1,6,7,8]),s=h(o),u=s.next(),v.label=2;case 2:return u.done?[3,5]:[4,u.value.execute(d({},i))];case 3:if(null===(b=v.sent()))return r({event:i,code:0,message:""}),[2];i=b,v.label=4;case 4:return u=s.next(),[3,2];case 5:return[3,8];case 6:return c=v.sent(),_={error:c},[3,8];case 7:try{u&&!u.done&&(I=s.return)&&I.call(s)}finally{if(_)throw _.error}return[7];case 8:l=this.plugins.filter((function(e){return e.type===a.ENRICHMENT})),v.label=9;case 9:v.trys.push([9,14,15,16]),p=h(l),f=p.next(),v.label=10;case 10:return f.done?[3,13]:[4,f.value.execute(d({},i))];case 11:if(null===(b=v.sent()))return r({event:i,code:0,message:""}),[2];i=b,v.label=12;case 12:return f=p.next(),[3,10];case 13:return[3,16];case 14:return y=v.sent(),k={error:y},[3,16];case 15:try{f&&!f.done&&(E=p.return)&&E.call(p)}finally{if(k)throw k.error}return[7];case 16:return m=this.plugins.filter((function(e){return e.type===a.DESTINATION})),w=m.map((function(e){var t=d({},i);return e.execute(t).catch((function(e){return T(t,0,String(e))}))})),Promise.all(w).then((function(e){var t=g(e,1)[0];r(t)})),[2]}}))}))},e.prototype.flush=function(){return f(this,void 0,void 0,(function(){var e,t,i,n=this;return v(this,(function(r){switch(r.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map((function(e){return n.apply(e)})))];case 1:return r.sent(),t=this.plugins.filter((function(e){return e.type===a.DESTINATION})),i=t.map((function(e){return e.flush&&e.flush()})),[4,Promise.all(i)];case 2:return r.sent(),[2]}}))}))},e}(),x="Event rejected due to exceeded retry count",P=function(e){return{promise:e||Promise.resolve()}},R=function(){function e(e){void 0===e&&(e="$default"),this.initializing=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new O(this),this.name=e}return e.prototype._init=function(e){return f(this,void 0,void 0,(function(){return v(this,(function(t){switch(t.label){case 0:return this.config=e,this.timeline.reset(this),[4,this.runQueuedFunctions("q")];case 1:return t.sent(),[2]}}))}))},e.prototype.runQueuedFunctions=function(e){return f(this,void 0,void 0,(function(){var t,i,n,r,o,s;return v(this,(function(a){switch(a.label){case 0:t=this[e],this[e]=[],a.label=1;case 1:a.trys.push([1,6,7,8]),i=h(t),n=i.next(),a.label=2;case 2:return n.done?[3,5]:[4,(0,n.value)()];case 3:a.sent(),a.label=4;case 4:return n=i.next(),[3,2];case 5:return[3,8];case 6:return r=a.sent(),o={error:r},[3,8];case 7:try{n&&!n.done&&(s=i.return)&&s.call(i)}finally{if(o)throw o.error}return[7];case 8:return[2]}}))}))},e.prototype.track=function(e,t,i){var n=function(e,t,i){return d(d(d({},"string"==typeof e?{event_type:e}:e),i),t&&{event_properties:t})}(e,t,i);return P(this.dispatch(n))},e.prototype.identify=function(e,t){var i=S(e,t);return P(this.dispatch(i))},e.prototype.groupIdentify=function(e,t,i,n){var r=function(e,t,i,n){var r;return d(d({},n),{event_type:o.GROUP_IDENTIFY,group_properties:i.getUserProperties(),groups:(r={},r[e]=t,r)})}(e,t,i,n);return P(this.dispatch(r))},e.prototype.setGroup=function(e,t,i){var n=function(e,t,i){var n,r=new E;return r.set(e,t),d(d({},i),{event_type:o.IDENTIFY,user_properties:r.getUserProperties(),groups:(n={},n[e]=t,n)})}(e,t,i);return P(this.dispatch(n))},e.prototype.revenue=function(e,t){var i=function(e,t){return d(d({},t),{event_type:o.REVENUE,event_properties:e.getEventProperties()})}(e,t);return P(this.dispatch(i))},e.prototype.add=function(e){return this.config?P(this.timeline.register(e,this.config)):(this.q.push(this.add.bind(this,e)),P())},e.prototype.remove=function(e){return this.config?P(this.timeline.deregister(e)):(this.q.push(this.remove.bind(this,e)),P())},e.prototype.dispatchWithCallback=function(e,t){if(!this.config)return t(T(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return f(this,void 0,void 0,(function(){var t=this;return v(this,(function(i){return this.config?[2,this.process(e)]:[2,new Promise((function(i){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,i))}))]}))}))},e.prototype.process=function(e){return f(this,void 0,void 0,(function(){var t,i,n;return v(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),this.config.optOut?[2,T(e,0,"Event skipped due to optOut config")]:[4,this.timeline.push(e)];case 1:return 200===(n=r.sent()).code?this.config.loggerProvider.log(n.message):this.config.loggerProvider.error(n.message),[2,n];case 2:return t=r.sent(),i=String(t),this.config.loggerProvider.error(i),[2,n=T(e,0,i)];case 3:return[2]}}))}))},e.prototype.setOptOut=function(e){this.config?this.config.optOut=Boolean(e):this.q.push(this.setOptOut.bind(this,Boolean(e)))},e.prototype.flush=function(){return P(this.timeline.flush())},e}(),N=function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(e){return this.productId=e,this},e.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},e.prototype.setPrice=function(e){return this.price=e,this},e.prototype.setRevenueType=function(e){return this.revenueType=e,this},e.prototype.setRevenue=function(e){return this.revenue=e,this},e.prototype.setEventProperties=function(e){return I(e)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?d({},this.properties):{};return e[r.REVENUE_PRODUCT_ID]=this.productId,e[r.REVENUE_QUANTITY]=this.quantity,e[r.REVENUE_PRICE]=this.price,e[r.REVENUE_TYPE]=this.revenueType,e[r.REVENUE]=this.revenue,e},e}(),U="Amplitude Logger ",q=function(){function e(){this.logLevel=s.None}return e.prototype.disable=function(){this.logLevel=s.None},e.prototype.enable=function(e){void 0===e&&(e=s.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<s.Verbose||console.log("".concat(U,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<s.Warn||console.warn("".concat(U,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<s.Error||console.error("".concat(U,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<s.Debug||console.log("".concat(U,"[Debug]: ").concat(e.join(" ")))},e}(),D=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,logLevel:s.Warn,loggerProvider:new q,optOut:!1,serverUrl:_,serverZone:u.US,useBatch:!1}},A=function(){function e(e){var t,i,n,r;this._optOut=!1;var o=D();this.apiKey=e.apiKey,this.flushIntervalMillis=null!==(t=e.flushIntervalMillis)&&void 0!==t?t:o.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||o.flushQueueSize,this.loggerProvider=e.loggerProvider||o.loggerProvider,this.logLevel=null!==(i=e.logLevel)&&void 0!==i?i:o.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.optOut=null!==(n=e.optOut)&&void 0!==n?n:o.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||o.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(r=e.useBatch)&&void 0!==r?r:o.useBatch,this.loggerProvider.enable(this.logLevel);var s=j(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=s.serverZone,this.serverUrl=s.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),C=function(e,t){return e===u.EU?t?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":t?"https://api2.amplitude.com/batch":_},j=function(e,t,i){if(void 0===e&&(e=""),void 0===t&&(t=D().serverZone),void 0===i&&(i=D().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:D().serverZone;return{serverZone:n,serverUrl:C(n,i)}},L=function(){function e(){this.name="amplitude",this.type=a.DESTINATION,this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduled=null,this.queue=[]}return e.prototype.setup=function(e){var t;return f(this,void 0,void 0,(function(){var i,n=this;return v(this,(function(r){switch(r.label){case 0:return this.config=e,this.storageKey="".concat(w,"_").concat(this.config.apiKey.substring(0,10)),[4,null===(t=this.config.storageProvider)||void 0===t?void 0:t.get(this.storageKey)];case 1:return i=r.sent(),this.saveEvents(),i&&i.length>0&&Promise.all(i.map((function(e){return n.execute(e)}))).catch(),[2,Promise.resolve(void 0)]}}))}))},e.prototype.execute=function(e){var t=this;return new Promise((function(i){var n={event:e,attempts:0,callback:function(e){return i(e)},timeout:0};t.addToQueue(n)}))},e.prototype.addToQueue=function(){for(var e=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var n=t.filter((function(t){return t.attempts<e.config.flushMaxRetries?(t.attempts+=1,!0):(e.fulfillRequest([t],500,x),!1)}));n.forEach((function(t){e.queue=e.queue.concat(t),0!==t.timeout?setTimeout((function(){t.timeout=0,e.schedule(0)}),t.timeout):e.schedule(e.config.flushIntervalMillis)})),this.saveEvents()},e.prototype.schedule=function(e){var t=this;this.scheduled||(this.scheduled=setTimeout((function(){t.flush(!0).then((function(){t.queue.length>0&&t.schedule(e)}))}),e))},e.prototype.flush=function(e){return void 0===e&&(e=!1),f(this,void 0,void 0,(function(){var t,i,n,r=this;return v(this,(function(o){switch(o.label){case 0:return t=[],i=[],this.queue.forEach((function(e){return 0===e.timeout?t.push(e):i.push(e)})),this.queue=i,this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),s=t,a=this.config.flushQueueSize,u=Math.max(a,1),n=s.reduce((function(e,t,i){var n=Math.floor(i/u);return e[n]||(e[n]=[]),e[n].push(t),e}),[]),[4,Promise.all(n.map((function(t){return r.send(t,e)})))];case 1:return o.sent(),[2]}var s,a,u}))}))},e.prototype.send=function(e,t){return void 0===t&&(t=!0),f(this,void 0,void 0,(function(){var i,n,r,o,s;return v(this,(function(a){switch(a.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];i={api_key:this.config.apiKey,events:e.map((function(e){var t=e.event;return t.extra,p(t,["extra"])})),options:{min_id_length:this.config.minIdLength}},a.label=1;case 1:return a.trys.push([1,3,,4]),n=j(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(n,i)];case 2:if(null===(r=a.sent()))return this.fulfillRequest(e,0,"Unexpected error occurred"),[2];if(!t){if("body"in r){o="";try{o=JSON.stringify(r.body,null,2)}catch(e){}this.fulfillRequest(e,r.statusCode,"".concat(r.status,": ").concat(o))}else this.fulfillRequest(e,r.statusCode,r.status);return[2]}return this.handleReponse(r,e),[3,4];case 3:return s=a.sent(),this.fulfillRequest(e,0,String(s)),[3,4];case 4:return[2]}}))}))},e.prototype.handleReponse=function(e,t){switch(e.status){case c.Success:this.handleSuccessResponse(e,t);break;case c.Invalid:this.handleInvalidResponse(e,t);break;case c.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case c.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.handleOtherReponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,"Event tracked successfully")},e.prototype.handleInvalidResponse=function(e,t){var i=this;if(e.body.missingField||e.body.error.startsWith("Invalid API key"))this.fulfillRequest(t,e.statusCode,e.body.error);else{var n=b(b(b(b([],g(Object.values(e.body.eventsWithInvalidFields)),!1),g(Object.values(e.body.eventsWithMissingFields)),!1),g(Object.values(e.body.eventsWithInvalidIdLengths)),!1),g(e.body.silencedEvents),!1).flat(),r=new Set(n),o=t.filter((function(t,n){if(!r.has(n))return!0;i.fulfillRequest([t],e.statusCode,e.body.error)}));this.addToQueue.apply(this,b([],g(o),!1))}},e.prototype.handlePayloadTooLargeResponse=function(e,t){1!==t.length?(this.config.flushQueueSize/=2,this.addToQueue.apply(this,b([],g(t),!1))):this.fulfillRequest(t,e.statusCode,e.body.error)},e.prototype.handleRateLimitResponse=function(e,t){var i=this,n=Object.keys(e.body.exceededDailyQuotaUsers),r=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,s=new Set(n),a=new Set(r),u=new Set(o),c=t.filter((function(t,n){if(!(t.event.user_id&&s.has(t.event.user_id)||t.event.device_id&&a.has(t.event.device_id)))return u.has(n)&&(t.timeout=i.throttleTimeout),!0;i.fulfillRequest([t],e.statusCode,e.body.error)}));this.addToQueue.apply(this,b([],g(c),!1))},e.prototype.handleOtherReponse=function(e){var t=this;this.addToQueue.apply(this,b([],g(e.map((function(e){return e.timeout=e.attempts*t.retryTimeout,e}))),!1))},e.prototype.fulfillRequest=function(e,t,i){this.saveEvents(),e.forEach((function(e){return e.callback(T(e.event,t,i))}))},e.prototype.saveEvents=function(){if(this.config.storageProvider){var e=Array.from(this.queue.map((function(e){return e.event})));this.config.storageProvider.set(this.storageKey,e)}},e}(),M=function(e){return void 0===e&&(e=0),((new Error).stack||"").split("\n").slice(2+e).map((function(e){return e.trim()}))},V=function(e){return function(){var t=d({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},F=function(e,t){var i,n;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var r=h(t.split(".")),o=r.next();!o.done;o=r.next()){var s=o.value;if(!(s in e))return;e=e[s]}}catch(e){i={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return e},z=function(e,t){return function(){var i,n,r={};try{for(var o=h(t),s=o.next();!s.done;s=o.next()){var a=s.value;r[a]=F(e,a)}}catch(e){i={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return r}},B=function(e,t,i,n,r){return void 0===r&&(r=null),function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var u=i(),c=u.logger,l=u.logLevel;if(l&&l<s.Debug||!l||!c)return e.apply(r,o);var d={type:"invoke public method",name:t,args:o,stacktrace:M(1),time:{start:(new Date).toISOString()},states:{}};n&&d.states&&(d.states.before=n());var p=e.apply(r,o);return p&&p.promise?p.promise.then((function(){n&&d.states&&(d.states.after=n()),d.time&&(d.time.end=(new Date).toISOString()),c.debug(JSON.stringify(d,null,2))})):(n&&d.states&&(d.states.after=n()),d.time&&(d.time.end=(new Date).toISOString()),c.debug(JSON.stringify(d,null,2))),p}},$=function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,$)},Q=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return f(this,void 0,void 0,(function(){return v(this,(function(e){return[2,!0]}))}))},e.prototype.get=function(e){return f(this,void 0,void 0,(function(){return v(this,(function(t){return[2,this.memoryStorage.get(e)]}))}))},e.prototype.getRaw=function(e){return f(this,void 0,void 0,(function(){var t;return v(this,(function(i){switch(i.label){case 0:return[4,this.get(e)];case 1:return[2,(t=i.sent())?JSON.stringify(t):void 0]}}))}))},e.prototype.set=function(e,t){return f(this,void 0,void 0,(function(){return v(this,(function(i){return this.memoryStorage.set(e,t),[2]}))}))},e.prototype.remove=function(e){return f(this,void 0,void 0,(function(){return v(this,(function(t){return this.memoryStorage.delete(e),[2]}))}))},e.prototype.reset=function(){return f(this,void 0,void 0,(function(){return v(this,(function(e){return this.memoryStorage.clear(),[2]}))}))},e}(),K=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,i,n,r,o,s,a,u,l,d,p,f,v,h,g,b,y,m,w,_,I,k;if("object"!=typeof e)return null;var E=e.code||0,S=this.buildStatus(E);switch(S){case c.Success:return{status:S,statusCode:E,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(i=e.payload_size_bytes)&&void 0!==i?i:0,serverUploadTime:null!==(n=e.server_upload_time)&&void 0!==n?n:0}};case c.Invalid:return{status:S,statusCode:E,body:{error:null!==(r=e.error)&&void 0!==r?r:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(s=e.events_with_invalid_fields)&&void 0!==s?s:{},eventsWithMissingFields:null!==(a=e.events_with_missing_fields)&&void 0!==a?a:{},eventsWithInvalidIdLengths:null!==(u=e.events_with_invalid_id_lengths)&&void 0!==u?u:{},epsThreshold:null!==(l=e.eps_threshold)&&void 0!==l?l:0,exceededDailyQuotaDevices:null!==(d=e.exceeded_daily_quota_devices)&&void 0!==d?d:{},silencedDevices:null!==(p=e.silenced_devices)&&void 0!==p?p:[],silencedEvents:null!==(f=e.silenced_events)&&void 0!==f?f:[],throttledDevices:null!==(v=e.throttled_devices)&&void 0!==v?v:{},throttledEvents:null!==(h=e.throttled_events)&&void 0!==h?h:[]}};case c.PayloadTooLarge:return{status:S,statusCode:E,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case c.RateLimit:return{status:S,statusCode:E,body:{error:null!==(b=e.error)&&void 0!==b?b:"",epsThreshold:null!==(y=e.eps_threshold)&&void 0!==y?y:0,throttledDevices:null!==(m=e.throttled_devices)&&void 0!==m?m:{},throttledUsers:null!==(w=e.throttled_users)&&void 0!==w?w:{},exceededDailyQuotaDevices:null!==(_=e.exceeded_daily_quota_devices)&&void 0!==_?_:{},exceededDailyQuotaUsers:null!==(I=e.exceeded_daily_quota_users)&&void 0!==I?I:{},throttledEvents:null!==(k=e.throttled_events)&&void 0!==k?k:[]}};case c.Timeout:default:return{status:S,statusCode:E}}},e.prototype.buildStatus=function(e){return e>=200&&e<300?c.Success:429===e?c.RateLimit:413===e?c.PayloadTooLarge:408===e?c.Timeout:e>=400&&e<500?c.Invalid:e>=500?c.Failed:c.Unknown},e}(),H=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},W=function(){var e,t=H();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce((function(e,t){var i=t.split("=",2),n=Z(i[0]),r=Z(i[1]);return r?(e[n]=r,e):e}),{}):{}},Z=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},G="dclid",J="fbclid",Y="gbraid",X="gclid",ee="ko_click_id",te="li_fat_id",ie="msclkid",ne="rtd_cid",re="ttclid",oe="twclid",se="wbraid",ae={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,rtd_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},ue=function(){function e(){}return e.prototype.parse=function(){return f(this,void 0,void 0,(function(){return v(this,(function(e){return[2,d(d(d(d({},ae),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=W();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,i={referrer:void 0,referring_domain:void 0};try{i.referrer=document.referrer||void 0,i.referring_domain=null!==(t=null===(e=i.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return i},e.prototype.getClickIds=function(){var e,t=W();return(e={})[G]=t[G],e[J]=t[J],e[Y]=t[Y],e[X]=t[X],e[ee]=t[ee],e[te]=t[te],e[ie]=t[ie],e[ne]=t[ne],e[re]=t[re],e[oe]=t[oe],e[se]=t[se],e},e}(),ce=function(e,t,i){return void 0===t&&(t=""),void 0===i&&(i=10),[m,t,e.substring(0,i)].filter(Boolean).join("_")},le=function(){function e(e){this.options=d({},e)}return e.prototype.isEnabled=function(){return f(this,void 0,void 0,(function(){var t,i,n;return v(this,(function(r){switch(r.label){case 0:if(!H())return[2,!1];t=String(Date.now()),i=new e(this.options),n="AMP_TEST",r.label=1;case 1:return r.trys.push([1,4,5,7]),[4,i.set(n,t)];case 2:return r.sent(),[4,i.get(n)];case 3:return[2,r.sent()===t];case 4:return r.sent(),[2,!1];case 5:return[4,i.remove(n)];case 6:return r.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){return f(this,void 0,void 0,(function(){var t;return v(this,(function(i){switch(i.label){case 0:return[4,this.getRaw(e)];case 1:if(!(t=i.sent()))return[2,void 0];try{try{t=decodeURIComponent(atob(t))}catch(e){}return[2,JSON.parse(t)]}catch(e){return[2,void 0]}return[2]}}))}))},e.prototype.getRaw=function(e){var t;return f(this,void 0,void 0,(function(){var i,n,r;return v(this,(function(o){return i=H(),n=null!==(t=null==i?void 0:i.document.cookie.split("; "))&&void 0!==t?t:[],(r=n.find((function(t){return 0===t.indexOf(e+"=")})))?[2,r.substring(e.length+1)]:[2,void 0]}))}))},e.prototype.set=function(e,t){var i;return f(this,void 0,void 0,(function(){var n,r,o,s,a,u;return v(this,(function(c){try{n=null!==(i=this.options.expirationDays)&&void 0!==i?i:0,o=void 0,(r=null!==t?n:-1)&&((s=new Date).setTime(s.getTime()+24*r*60*60*1e3),o=s),a="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t)))),o&&(a+="; expires=".concat(o.toUTCString())),a+="; path=/",this.options.domain&&(a+="; domain=".concat(this.options.domain)),this.options.secure&&(a+="; Secure"),this.options.sameSite&&(a+="; SameSite=".concat(this.options.sameSite)),(u=H())&&(u.document.cookie=a)}catch(e){}return[2]}))}))},e.prototype.remove=function(e){return f(this,void 0,void 0,(function(){return v(this,(function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}}))}))},e.prototype.reset=function(){return f(this,void 0,void 0,(function(){return v(this,(function(e){return[2]}))}))},e}(),de=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.send=function(e,t){return f(this,void 0,void 0,(function(){var i,n;return v(this,(function(r){switch(r.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return i={headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(t),method:"POST"},[4,fetch(e,i)];case 1:return[4,r.sent().json()];case 2:return n=r.sent(),[2,this.buildResponse(n)]}}))}))},t}(K),pe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},fe={exports:{}};!function(e,t){!function(i,n){var r="function",o="undefined",s="object",a="string",u="model",c="name",l="type",d="vendor",p="version",f="architecture",v="console",h="mobile",g="tablet",b="smarttv",y="wearable",m="embedded",w="Amazon",_="Apple",I="ASUS",k="BlackBerry",E="Browser",S="Chrome",T="Firefox",O="Google",x="Huawei",P="LG",R="Microsoft",N="Motorola",U="Opera",q="Samsung",D="Sony",A="Xiaomi",C="Zebra",j="Facebook",L=function(e){for(var t={},i=0;i<e.length;i++)t[e[i].toUpperCase()]=e[i];return t},M=function(e,t){return typeof e===a&&-1!==V(t).indexOf(V(e))},V=function(e){return e.toLowerCase()},F=function(e,t){if(typeof e===a)return e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,""),typeof t===o?e:e.substring(0,275)},z=function(e,t){for(var i,o,a,u,c,l,d=0;d<t.length&&!c;){var p=t[d],f=t[d+1];for(i=o=0;i<p.length&&!c;)if(c=p[i++].exec(e))for(a=0;a<f.length;a++)l=c[++o],typeof(u=f[a])===s&&u.length>0?2===u.length?typeof u[1]==r?this[u[0]]=u[1].call(this,l):this[u[0]]=u[1]:3===u.length?typeof u[1]!==r||u[1].exec&&u[1].test?this[u[0]]=l?l.replace(u[1],u[2]):n:this[u[0]]=l?u[1].call(this,l,u[2]):n:4===u.length&&(this[u[0]]=l?u[3].call(this,l.replace(u[1],u[2])):n):this[u]=l||n;d+=2}},B=function(e,t){for(var i in t)if(typeof t[i]===s&&t[i].length>0){for(var r=0;r<t[i].length;r++)if(M(t[i][r],e))return"?"===i?n:i}else if(M(t[i],e))return"?"===i?n:i;return e},$={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Q={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,p],[/opios[\/ ]+([\w\.]+)/i],[p,[c,U+" Mini"]],[/\bopr\/([\w\.]+)/i],[p,[c,U]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[c,p],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[c,"UC"+E]],[/\bqbcore\/([\w\.]+)/i],[p,[c,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[p,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[c,"IE"]],[/yabrowser\/([\w\.]+)/i],[p,[c,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure "+E],p],[/\bfocus\/([\w\.]+)/i],[p,[c,T+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[c,U+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[c,U+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[c,"MIUI "+E]],[/fxios\/([-\w\.]+)/i],[p,[c,T]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 "+E]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 "+E],p],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[c,p],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,j],p],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[c,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[c,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[c,S+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,S+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[c,"Android "+E]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,p],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[p,[c,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[p,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[p,B,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[c,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[c,T+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[c,p]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[f,"amd64"]],[/(ia32(?=;))/i],[[f,V]],[/((?:i[346]|x)86)[;\)]/i],[[f,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[f,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[f,"armhf"]],[/windows (ce|mobile); ppc;/i],[[f,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[f,/ower/,"",V]],[/(sun4\w)[;\)]/i],[[f,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[f,V]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[d,q],[l,g]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[d,q],[l,h]],[/((ipod|iphone)\d+,\d+)/i],[u,[d,_],[l,h]],[/(ipad\d+,\d+)/i],[u,[d,_],[l,g]],[/\((ip(?:hone|od)[\w ]*);/i],[u,[d,_],[l,h]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[d,_],[l,g]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[d,x],[l,g]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[d,x],[l,h]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[u,/_/g," "],[d,A],[l,h]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[d,A],[l,g]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[d,"OPPO"],[l,h]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[d,"Vivo"],[l,h]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[u,[d,"Realme"],[l,h]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[d,N],[l,h]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[d,N],[l,g]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[d,P],[l,g]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[d,P],[l,h]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[d,"Lenovo"],[l,g]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[d,"Nokia"],[l,h]],[/(pixel c)\b/i],[u,[d,O],[l,g]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[d,O],[l,h]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[d,D],[l,h]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[d,D],[l,g]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[d,"OnePlus"],[l,h]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[d,w],[l,g]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[d,w],[l,h]],[/(playbook);[-\w\),; ]+(rim)/i],[u,d,[l,g]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[d,k],[l,h]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[d,I],[l,g]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[d,I],[l,h]],[/(nexus 9)/i],[u,[d,"HTC"],[l,g]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[u,/_/g," "],[l,h]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[d,"Acer"],[l,g]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[d,"Meizu"],[l,h]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[d,"Sharp"],[l,h]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,u,[l,h]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,u,[l,g]],[/(surface duo)/i],[u,[d,R],[l,g]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[d,"Fairphone"],[l,h]],[/(u304aa)/i],[u,[d,"AT&T"],[l,h]],[/\bsie-(\w*)/i],[u,[d,"Siemens"],[l,h]],[/\b(rct\w+) b/i],[u,[d,"RCA"],[l,g]],[/\b(venue[\d ]{2,7}) b/i],[u,[d,"Dell"],[l,g]],[/\b(q(?:mv|ta)\w+) b/i],[u,[d,"Verizon"],[l,g]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[d,"Barnes & Noble"],[l,g]],[/\b(tm\d{3}\w+) b/i],[u,[d,"NuVision"],[l,g]],[/\b(k88) b/i],[u,[d,"ZTE"],[l,g]],[/\b(nx\d{3}j) b/i],[u,[d,"ZTE"],[l,h]],[/\b(gen\d{3}) b.+49h/i],[u,[d,"Swiss"],[l,h]],[/\b(zur\d{3}) b/i],[u,[d,"Swiss"],[l,g]],[/\b((zeki)?tb.*\b) b/i],[u,[d,"Zeki"],[l,g]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],u,[l,g]],[/\b(ns-?\w{0,9}) b/i],[u,[d,"Insignia"],[l,g]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[d,"NextBook"],[l,g]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],u,[l,h]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],u,[l,h]],[/\b(ph-1) /i],[u,[d,"Essential"],[l,h]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[d,"Envizen"],[l,g]],[/\b(trio[-\w\. ]+) b/i],[u,[d,"MachSpeed"],[l,g]],[/\btu_(1491) b/i],[u,[d,"Rotor"],[l,g]],[/(shield[\w ]+) b/i],[u,[d,"Nvidia"],[l,g]],[/(sprint) (\w+)/i],[d,u,[l,h]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[d,R],[l,h]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[d,C],[l,g]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[d,C],[l,h]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,u,[l,v]],[/droid.+; (shield) bui/i],[u,[d,"Nvidia"],[l,v]],[/(playstation [345portablevi]+)/i],[u,[d,D],[l,v]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[d,R],[l,v]],[/smart-tv.+(samsung)/i],[d,[l,b]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[d,q],[l,b]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,P],[l,b]],[/(apple) ?tv/i],[d,[u,_+" TV"],[l,b]],[/crkey/i],[[u,S+"cast"],[d,O],[l,b]],[/droid.+aft(\w)( bui|\))/i],[u,[d,w],[l,b]],[/\(dtv[\);].+(aquos)/i],[u,[d,"Sharp"],[l,b]],[/(bravia[\w- ]+) bui/i],[u,[d,D],[l,b]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[d,F],[u,F],[l,b]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,b]],[/((pebble))app/i],[d,u,[l,y]],[/droid.+; (glass) \d/i],[u,[d,O],[l,y]],[/droid.+; (wt63?0{2,3})\)/i],[u,[d,C],[l,y]],[/(quest( 2)?)/i],[u,[d,j],[l,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[l,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[u,[l,h]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[l,g]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,g]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[l,h]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[c,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,p],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[c,[p,B,$]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,"Windows"],[p,B,$]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,"Mac OS"],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[p,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,p],[/\(bb(10);/i],[p,[c,k]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[c,T+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[c,"webOS"]],[/crkey\/([\d\.]+)/i],[p,[c,S+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[c,"Chromium OS"],p],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[c,p],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[c,p]]},K=function(e,t){if(typeof e===s&&(t=e,e=n),!(this instanceof K))return new K(e,t).getResult();var r=e||(typeof i!==o&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),v=t?function(e,t){var i={};for(var n in e)t[n]&&t[n].length%2==0?i[n]=t[n].concat(e[n]):i[n]=e[n];return i}(Q,t):Q;return this.getBrowser=function(){var e,t={};return t[c]=n,t[p]=n,z.call(t,r,v.browser),t.major=typeof(e=t.version)===a?e.replace(/[^\d\.]/g,"").split(".")[0]:n,t},this.getCPU=function(){var e={};return e[f]=n,z.call(e,r,v.cpu),e},this.getDevice=function(){var e={};return e[d]=n,e[u]=n,e[l]=n,z.call(e,r,v.device),e},this.getEngine=function(){var e={};return e[c]=n,e[p]=n,z.call(e,r,v.engine),e},this.getOS=function(){var e={};return e[c]=n,e[p]=n,z.call(e,r,v.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(e){return r=typeof e===a&&e.length>275?F(e,275):e,this},this.setUA(r),this};K.VERSION="0.7.31",K.BROWSER=L([c,p,"major"]),K.CPU=L([f]),K.DEVICE=L([u,d,l,v,h,b,g,y,m]),K.ENGINE=K.OS=L([c,p]),e.exports&&(t=e.exports=K),t.UAParser=K;var H=typeof i!==o&&(i.jQuery||i.Zepto);if(H&&!H.ua){var W=new K;H.ua=W.getResult(),H.ua.get=function(){return W.getUA()},H.ua.set=function(e){W.setUA(e);var t=W.getResult();for(var i in t)H.ua[i]=t[i]}}}("object"==typeof window?window:pe)}(fe,fe.exports);var ve=fe.exports,he=function(){function e(){this.ua=new fe.exports.UAParser("undefined"!=typeof navigator?navigator.userAgent:null).getResult()}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:ye(),platform:"Web",os:ge(this.ua),deviceModel:be(this.ua)}},e}(),ge=function(e){var t,i;return[null===(t=e.browser)||void 0===t?void 0:t.name,null===(i=e.browser)||void 0===i?void 0:i.major].filter((function(e){return null!=e})).join(" ")},be=function(e){var t;return null===(t=e.os)||void 0===t?void 0:t.name},ye=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},me=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach((function(t){e(t)})),this.queue=[])},e}(),we=function(){return we=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},we.apply(this,arguments)},_e=function(e,t){var i=typeof e;if(i!==typeof t)return!1;for(var n=0,r=["string","number","boolean","undefined"];n<r.length;n++){if(r[n]===i)return e===t}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var o=Array.isArray(e),s=Array.isArray(t);if(o!==s)return!1;if(!o||!s){var a=Object.keys(e).sort(),u=Object.keys(t).sort();if(!_e(a,u))return!1;var c=!0;return Object.keys(e).forEach((function(i){_e(e[i],t[i])||(c=!1)})),c}for(var l=0;l<e.length;l++)if(!_e(e[l],t[l]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),i=t.length,n=new Array(i);i--;)n[i]=[t[i],e[t[i]]];return n});var Ie=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=we({},this.identity.userProperties),i=we(we({},this.identity),{userProperties:t});return{setUserId:function(e){return i.userId=e,this},setDeviceId:function(e){return i.deviceId=e,this},setUserProperties:function(e){return i.userProperties=e,this},updateUserProperties:function(e){for(var t=i.userProperties||{},n=0,r=Object.entries(e);n<r.length;n++){var o=r[n],s=o[0],a=o[1];switch(s){case"$set":for(var u=0,c=Object.entries(a);u<c.length;u++){var l=c[u],d=l[0],p=l[1];t[d]=p}break;case"$unset":for(var f=0,v=Object.keys(a);f<v.length;f++){delete t[d=v[f]]}break;case"$clearAll":t={}}}return i.userProperties=t,this},commit:function(){return e.setIdentity(i),this}}},e.prototype.getIdentity=function(){return we({},this.identity)},e.prototype.setIdentity=function(e){var t=we({},this.identity);this.identity=we({},e),_e(t,this.identity)||this.listeners.forEach((function(t){t(e)}))},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),ke="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,Ee=function(){function e(){this.identityStore=new Ie,this.eventBridge=new me,this.applicationContextProvider=new he}return e.getInstance=function(t){return ke.analyticsConnectorInstances||(ke.analyticsConnectorInstances={}),ke.analyticsConnectorInstances[t]||(ke.analyticsConnectorInstances[t]=new e),ke.analyticsConnectorInstances[t]},e}(),Se=function(){return Ee.getInstance("$default_instance")},Te=function(){function e(){this.name="identity",this.type=a.BEFORE,this.identityStore=Se().identityStore}return e.prototype.execute=function(e){return f(this,void 0,void 0,(function(){var t;return v(this,(function(i){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]}))}))},e.prototype.setup=function(e){return Promise.resolve(void 0)},e}(),Oe=function(){var e,t,i,n;if("undefined"==typeof navigator)return"";var r=navigator.userLanguage;return null!==(n=null!==(i=null!==(t=null===(e=navigator.languages)||void 0===e?void 0:e[0])&&void 0!==t?t:navigator.language)&&void 0!==i?i:r)&&void 0!==n?n:""},xe=function(e,t){for(var i=0;i<t.length;i++){var n=t[i],r=n.name,o=n.args,s=n.resolve,a=e&&e[r];if("function"==typeof a){var u=a.apply(e,o);"function"==typeof s&&s(null==u?void 0:u.promise)}}return e},Pe=function(e){return e&&void 0!==e._q},Re=function(){function e(){this.name="context",this.type=a.BEFORE,this.eventId=0,this.library="amplitude-ts/".concat("1.10.6"),"undefined"!=typeof navigator&&(this.userAgent=navigator.userAgent),this.uaResult=new ve(this.userAgent).getResult()}return e.prototype.setup=function(e){return this.config=e,this.eventId=this.config.lastEventId?this.config.lastEventId+1:0,Promise.resolve(void 0)},e.prototype.execute=function(e){return f(this,void 0,void 0,(function(){var t,i,n,r,o;return v(this,(function(s){return t=(new Date).getTime(),i=this.uaResult.browser.name,n=this.uaResult.browser.version,r=this.uaResult.device.model||this.uaResult.os.name,o=this.uaResult.device.vendor,this.config.lastEventId=this.eventId,[2,d(d(d(d(d(d(d(d(d(d(d(d({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:t},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:"Web"}),this.config.trackingOptions.osName&&{os_name:i}),this.config.trackingOptions.osVersion&&{os_version:n}),this.config.trackingOptions.deviceManufacturer&&{device_manufacturer:o}),this.config.trackingOptions.deviceModel&&{device_model:r}),this.config.trackingOptions.language&&{language:Oe()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:$(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),e),{event_id:this.eventId++,library:this.library,user_agent:this.userAgent})]}))}))},e}(),Ne=function(){function e(){}return e.prototype.isEnabled=function(){return f(this,void 0,void 0,(function(){var t,i,n;return v(this,(function(r){switch(r.label){case 0:if(!H())return[2,!1];t=String(Date.now()),i=new e,n="AMP_TEST",r.label=1;case 1:return r.trys.push([1,4,5,7]),[4,i.set(n,t)];case 2:return r.sent(),[4,i.get(n)];case 3:return[2,r.sent()===t];case 4:return r.sent(),[2,!1];case 5:return[4,i.remove(n)];case 6:return r.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){return f(this,void 0,void 0,(function(){var t;return v(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return(t=i.sent())?[2,JSON.parse(t)]:[2,void 0];case 2:return i.sent(),[2,void 0];case 3:return[2]}}))}))},e.prototype.getRaw=function(e){var t;return f(this,void 0,void 0,(function(){return v(this,(function(i){return[2,(null===(t=H())||void 0===t?void 0:t.localStorage.getItem(e))||void 0]}))}))},e.prototype.set=function(e,t){var i;return f(this,void 0,void 0,(function(){return v(this,(function(n){try{null===(i=H())||void 0===i||i.localStorage.setItem(e,JSON.stringify(t))}catch(e){}return[2]}))}))},e.prototype.remove=function(e){var t;return f(this,void 0,void 0,(function(){return v(this,(function(i){try{null===(t=H())||void 0===t||t.localStorage.removeItem(e)}catch(e){}return[2]}))}))},e.prototype.reset=function(){var e;return f(this,void 0,void 0,(function(){return v(this,(function(t){try{null===(e=H())||void 0===e||e.localStorage.clear()}catch(e){}return[2]}))}))},e}(),Ue=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={done:4},t}return i(t,e),t.prototype.send=function(e,t){return f(this,void 0,void 0,(function(){var i=this;return v(this,(function(n){return[2,new Promise((function(n,r){"undefined"==typeof XMLHttpRequest&&r(new Error("XHRTransport is not supported."));var o=new XMLHttpRequest;o.open("POST",e,!0),o.onreadystatechange=function(){if(o.readyState===i.state.done)try{var e=o.responseText,t=JSON.parse(e),s=i.buildResponse(t);n(s)}catch(e){r(e)}},o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Accept","*/*"),o.send(JSON.stringify(t))}))]}))}))},t}(K),qe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.send=function(e,t){return f(this,void 0,void 0,(function(){var i=this;return v(this,(function(n){return[2,new Promise((function(n,r){var o=H();if(!(null==o?void 0:o.navigator.sendBeacon))throw new Error("SendBeaconTransport is not supported");try{var s=JSON.stringify(t);return n(o.navigator.sendBeacon(e,JSON.stringify(t))?i.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:s.length,server_upload_time:Date.now()}):i.buildResponse({code:500}))}catch(e){r(e)}}))]}))}))},t}(K),De=function(){return{cookieExpiration:365,cookieSameSite:"Lax",cookieSecure:!1,cookieStorage:new Q,cookieUpgrade:!0,disableCookies:!1,domain:"",sessionTimeout:18e5,trackingOptions:{deviceManufacturer:!0,deviceModel:!0,ipAddress:!0,language:!0,osName:!0,osVersion:!0,platform:!0},transportProvider:new de}},Ae=function(e){function t(t,i){var n,r,o,s,a,u,c,l,p,f=this,v=De();return(f=e.call(this,d(d({flushIntervalMillis:1e3,flushMaxRetries:5,flushQueueSize:30,transportProvider:v.transportProvider},i),{apiKey:t}))||this)._optOut=!1,f.cookieStorage=null!==(n=null==i?void 0:i.cookieStorage)&&void 0!==n?n:v.cookieStorage,f.deviceId=null==i?void 0:i.deviceId,f.lastEventId=null==i?void 0:i.lastEventId,f.lastEventTime=null==i?void 0:i.lastEventTime,f.optOut=Boolean(null==i?void 0:i.optOut),f.sessionId=null==i?void 0:i.sessionId,f.userId=null==i?void 0:i.userId,f.appVersion=null==i?void 0:i.appVersion,f.attribution=null==i?void 0:i.attribution,f.cookieExpiration=null!==(r=null==i?void 0:i.cookieExpiration)&&void 0!==r?r:v.cookieExpiration,f.cookieSameSite=null!==(o=null==i?void 0:i.cookieSameSite)&&void 0!==o?o:v.cookieSameSite,f.cookieSecure=null!==(s=null==i?void 0:i.cookieSecure)&&void 0!==s?s:v.cookieSecure,f.cookieUpgrade=null!==(a=null==i?void 0:i.cookieUpgrade)&&void 0!==a?a:v.cookieUpgrade,f.defaultTracking=null==i?void 0:i.defaultTracking,f.disableCookies=null!==(u=null==i?void 0:i.disableCookies)&&void 0!==u?u:v.disableCookies,f.defaultTracking=null==i?void 0:i.defaultTracking,f.domain=null!==(c=null==i?void 0:i.domain)&&void 0!==c?c:v.domain,f.partnerId=null==i?void 0:i.partnerId,f.sessionTimeout=null!==(l=null==i?void 0:i.sessionTimeout)&&void 0!==l?l:v.sessionTimeout,f.trackingOptions=null!==(p=null==i?void 0:i.trackingOptions)&&void 0!==p?p:v.trackingOptions,f}return i(t,e),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(e){this._deviceId!==e&&(this._deviceId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(e){this._userId!==e&&(this._userId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(e){this._sessionId!==e&&(this._sessionId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut!==e&&(this._optOut=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(e){this._lastEventTime!==e&&(this._lastEventTime=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(e){this._lastEventId!==e&&(this._lastEventId=e,this.updateStorage())},enumerable:!1,configurable:!0}),t.prototype.updateStorage=function(){var e,t={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId};null===(e=this.cookieStorage)||void 0===e||e.set(ce(this.apiKey),t)},t}(A),Ce=function(e,t){return f(void 0,void 0,void 0,(function(){var i,n,r,o,s,a,u,c,l,p,f,h,g,b,y;return v(this,(function(v){switch(v.label){case 0:return i=De(),n=null!==(b=null==t?void 0:t.deviceId)&&void 0!==b?b:$(),r=null==t?void 0:t.lastEventId,o=null==t?void 0:t.lastEventTime,s=null==t?void 0:t.optOut,a=null==t?void 0:t.sessionId,u=null==t?void 0:t.userId,c=null==t?void 0:t.cookieStorage,l=null==t?void 0:t.domain,p=Ae.bind,f=[void 0,e],h=[d({},t)],g={cookieStorage:c,deviceId:n,domain:l,lastEventId:r,lastEventTime:o,optOut:s,sessionId:a},[4,Me(t)];case 1:return[2,new(p.apply(Ae,f.concat([d.apply(void 0,h.concat([(g.storageProvider=v.sent(),g.trackingOptions=d(d({},i.trackingOptions),null==t?void 0:t.trackingOptions),g.transportProvider=null!==(y=null==t?void 0:t.transportProvider)&&void 0!==y?y:Ve(null==t?void 0:t.transport),g.userId=u,g)]))])))]}}))}))},je=function(e,t){return void 0===t&&(t=De()),f(void 0,void 0,void 0,(function(){var i,n,r;return v(this,(function(o){switch(o.label){case 0:return i=d(d({},t),e),n=null==e?void 0:e.cookieStorage,(r=!n)?[3,2]:[4,n.isEnabled()];case 1:r=!o.sent(),o.label=2;case 2:return r?[2,Le(i)]:[2,n]}}))}))},Le=function(e){return f(void 0,void 0,void 0,(function(){var t,i;return v(this,(function(n){switch(n.label){case 0:return t=new le({domain:e.domain,expirationDays:e.cookieExpiration,sameSite:e.cookieSameSite,secure:e.cookieSecure}),(i=e.disableCookies)?[3,2]:[4,t.isEnabled()];case 1:i=!n.sent(),n.label=2;case 2:return i?[4,(t=new Ne).isEnabled()]:[3,4];case 3:n.sent()||(t=new Q),n.label=4;case 4:return[2,t]}}))}))},Me=function(e){return f(void 0,void 0,void 0,(function(){var t,i,n,r,o,s,a;return v(this,(function(u){switch(u.label){case 0:if(e&&Object.prototype.hasOwnProperty.call(e,"storageProvider")&&!e.storageProvider)return[3,9];u.label=1;case 1:u.trys.push([1,7,8,9]),t=h([null==e?void 0:e.storageProvider,new Ne]),i=t.next(),u.label=2;case 2:return i.done?[3,6]:(n=i.value,(r=n)?[4,n.isEnabled()]:[3,4]);case 3:r=u.sent(),u.label=4;case 4:if(r)return[2,n];u.label=5;case 5:return i=t.next(),[3,2];case 6:return[3,9];case 7:return o=u.sent(),s={error:o},[3,9];case 8:try{i&&!i.done&&(a=t.return)&&a.call(t)}finally{if(s)throw s.error}return[7];case 9:return[2,void 0]}}))}))},Ve=function(e){return e===l.XHR?new Ue:e===l.SendBeacon?new qe:De().transportProvider},Fe=function(e,t){return f(void 0,void 0,void 0,(function(){var i,n,r,o,s,a,u,c,l,d;return v(this,(function(p){switch(p.label){case 0:return[4,je(t)];case 1:return i=p.sent(),n=function(e){return"".concat(m.toLowerCase(),"_").concat(e.substring(0,6))}(e),[4,i.getRaw(n)];case 2:return(r=p.sent())?(null!==(d=null==t?void 0:t.cookieUpgrade)&&void 0!==d?d:De().cookieUpgrade)?[4,i.remove(n)]:[3,4]:[2,{optOut:!1}];case 3:p.sent(),p.label=4;case 4:return o=g(r.split("."),5),s=o[0],a=o[1],u=o[2],c=o[3],l=o[4],[2,{deviceId:s,userId:Be(a),sessionId:ze(c),lastEventTime:ze(l),optOut:Boolean(u)}]}}))}))},ze=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},Be=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},$e=function(e,t,i){return void 0===t&&(t=""),void 0===i&&(i=10),[m,t,e.substring(0,i)].filter(Boolean).join("_")},Qe=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},Ke=function(e,t,i){var n;e.referrer;var r=e.referring_domain,o=p(e,["referrer","referring_domain"]),s=t||{};s.referrer;var a=s.referring_domain,u=p(s,["referrer","referring_domain"]);if(e.referring_domain&&(null===(n=i.excludeReferrers)||void 0===n?void 0:n.includes(e.referring_domain)))return!1;var c=JSON.stringify(o)!==JSON.stringify(u),l=Qe(r||"")!==Qe(a||"");return!t||c||l},He=function(e,t){var i=d(d({},ae),e),n=Object.entries(i).reduce((function(e,i){var n,r=g(i,2),o=r[0],s=r[1];return e.setOnce("initial_".concat(o),null!==(n=null!=s?s:t.initialEmptyValue)&&void 0!==n?n:"EMPTY"),s?e.set(o,s):e.unset(o)}),new E);return S(n)},We=function(e){var t={};for(var i in e){var n=e[i];n&&(t[i]=n)}return t},Ze=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var n={},r=H(),o=void 0,s=g(t,2),u=s[0],c=s[1];u&&"init"in u?(e=u,c&&(n=c)):u&&(n=u);var l=function(){return f(void 0,void 0,void 0,(function(){var e,t,i;return v(this,(function(r){switch(r.label){case 0:return t={event_type:null!==(i=n.eventType)&&void 0!==i?i:"Page View"},e=[{}],[4,Ge()];case 1:return[2,(t.event_properties=d.apply(void 0,[d.apply(void 0,e.concat([r.sent()])),{page_domain:"undefined"!=typeof location&&location.hostname||"",page_location:"undefined"!=typeof location&&location.href||"",page_path:"undefined"!=typeof location&&location.pathname||"",page_title:"undefined"!=typeof document&&document.title||"",page_url:"undefined"!=typeof location&&location.href.split("?")[0]||""}]),t)]}}))}))},p=function(){return void 0===n.trackOn||"function"==typeof n.trackOn&&n.trackOn()},h="undefined"!=typeof location?location.href:null,b=function(){return f(void 0,void 0,void 0,(function(){var t,i,r;return v(this,(function(s){switch(s.label){case 0:return t=location.href,Ye(n.trackHistoryChanges,t,h||"")&&p()?(null==o||o.log("Tracking page view event"),null!=e?[3,1]:[3,3]):[3,4];case 1:return r=(i=e).track,[4,l()];case 2:r.apply(i,[s.sent()]),s.label=3;case 3:s.label=4;case 4:return h=t,[2]}}))}))},y={name:"page-view-tracking",type:a.ENRICHMENT,setup:function(t,i){return f(void 0,void 0,void 0,(function(){var s,a,c,d,f;return v(this,(function(v){switch(v.label){case 0:return(e=null!=e?e:i)?((o=t.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),n.trackOn=(null===(d=t.attribution)||void 0===d?void 0:d.trackPageViews)?"attribution":n.trackOn,!i&&(null===(f=t.attribution)||void 0===f?void 0:f.trackPageViews)&&(o.warn("@amplitude/plugin-page-view-tracking-browser overrides page view tracking behavior defined in @amplitude/analytics-browser. Resolve by disabling page view tracking in @amplitude/analytics-browser."),t.attribution.trackPageViews=!1),n.trackHistoryChanges&&r&&(r.addEventListener("popstate",(function(){b()})),r.history.pushState=new Proxy(r.history.pushState,{apply:function(e,t,i){var n=g(i,3),r=n[0],o=n[1],s=n[2];e.apply(t,[r,o,s]),b()}})),p()?(o.log("Tracking page view event"),c=(a=e).track,[4,l()]):[3,2]):(s=u?"Options":"undefined",t.loggerProvider.error("Argument of type '".concat(s,"' is not assignable to parameter of type 'BrowserClient'.")),[2]);case 1:c.apply(a,[v.sent()]),v.label=2;case 2:return[2]}}))}))},execute:function(e){return f(void 0,void 0,void 0,(function(){var t;return v(this,(function(i){switch(i.label){case 0:return"attribution"===n.trackOn&&Je(e)?(null==o||o.log("Enriching campaign event to page view event with campaign parameters"),[4,l()]):[3,2];case 1:t=i.sent(),e.event_type=t.event_type,e.event_properties=d(d({},e.event_properties),t.event_properties),i.label=2;case 2:return[2,e]}}))}))}};return y.__trackHistoryPageView=b,y},Ge=function(){return f(void 0,void 0,void 0,(function(){var e;return v(this,(function(t){switch(t.label){case 0:return e=We,[4,(new ue).parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}}))}))},Je=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,i=t[n.SET]||{},r=t[n.UNSET]||{},o=b(b([],g(Object.keys(i)),!1),g(Object.keys(r)),!1);return Object.keys(ae).every((function(e){return o.includes(e)}))}return!1},Ye=function(e,t,i){return"pathOnly"===e?t.split("?")[0]!==i.split("?")[0]:t!==i},Xe="[Amplitude]",et="".concat(Xe," Page Viewed"),tt="".concat(Xe," Form Started"),it="".concat(Xe," Form Submitted"),nt="".concat(Xe," File Downloaded"),rt="session_start",ot="session_end",st="".concat(Xe," File Extension"),at="".concat(Xe," File Name"),ut="".concat(Xe," Link ID"),ct="".concat(Xe," Link Text"),lt="".concat(Xe," Link URL"),dt="".concat(Xe," Form ID"),pt="".concat(Xe," Form Name"),ft="".concat(Xe," Form Destination"),vt={page_domain:"".concat(Xe," Page Domain"),page_location:"".concat(Xe," Page Location"),page_path:"".concat(Xe," Page Path"),page_title:"".concat(Xe," Page Title"),page_url:"".concat(Xe," Page URL")},ht=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.init=function(e,t,i){return void 0===e&&(e=""),P(this._init(d(d({},i),{userId:t,apiKey:e})))},t.prototype._init=function(t){var i,n,r,o,s,u,c,l,p,h,b,y,m,w,_,I,k,E;return f(this,void 0,void 0,(function(){var S,T,O,x,P,R,N,U,q,D,A,C,j,M,V,F,z,B,$=this;return v(this,(function(Q){switch(Q.label){case 0:return this.initializing?[2]:(this.initializing=!0,S=t,t.disableCookies?(T="",[3,5]):[3,1]);case 1:return null===(i=t.domain)||void 0===i?[3,2]:(O=i,[3,4]);case 2:return[4,f(void 0,void 0,void 0,(function(){var e,t,i,n,r,o,s;return v(this,(function(a){switch(a.label){case 0:return[4,(new le).isEnabled()];case 1:if(!a.sent()||!G&&"undefined"==typeof location)return[2,""];for(e=null!=G?G:location.hostname,t=e.split("."),i=[],n="AMP_TLDTEST",r=t.length-2;r>=0;--r)i.push(t.slice(r).join("."));r=0,a.label=2;case 2:return r<i.length?(o=i[r],[4,(s=new le({domain:"."+o})).set(n,1)]):[3,7];case 3:return a.sent(),[4,s.get(n)];case 4:return a.sent()?[4,s.remove(n)]:[3,6];case 5:return a.sent(),[2,"."+o];case 6:return r++,[3,2];case 7:return[2,""]}}))}))];case 3:O=Q.sent(),Q.label=4;case 4:T=O,Q.label=5;case 5:return S.domain=T,[4,Fe(t.apiKey,t)];case 6:return x=Q.sent(),[4,je(t)];case 7:return[4,(P=Q.sent()).get(ce(t.apiKey))];case 8:return R=Q.sent(),N=W(),U=null!==(o=null!==(r=null!==(n=t.deviceId)&&void 0!==n?n:N.deviceId)&&void 0!==r?r:null==R?void 0:R.deviceId)&&void 0!==o?o:x.deviceId,q=null!==(u=null!==(s=t.sessionId)&&void 0!==s?s:null==R?void 0:R.sessionId)&&void 0!==u?u:x.sessionId,D=null!==(l=null!==(c=t.optOut)&&void 0!==c?c:null==R?void 0:R.optOut)&&void 0!==l?l:x.optOut,A=null==R?void 0:R.lastEventId,C=null!==(p=null==R?void 0:R.lastEventTime)&&void 0!==p?p:x.lastEventTime,j=null!==(b=null!==(h=t.userId)&&void 0!==h?h:null==R?void 0:R.userId)&&void 0!==b?b:x.userId,this.previousSessionDeviceId=null!==(y=null==R?void 0:R.deviceId)&&void 0!==y?y:x.deviceId,this.previousSessionUserId=null!==(m=null==R?void 0:R.userId)&&void 0!==m?m:x.userId,[4,Ce(t.apiKey,d(d({},t),{deviceId:U,sessionId:q,optOut:D,lastEventId:A,lastEventTime:C,userId:j,cookieStorage:P}))];case 9:return M=Q.sent(),[4,e.prototype._init.call(this,M)];case 10:return Q.sent(),V=!this.config.lastEventTime,(!this.config.sessionId||this.config.lastEventTime&&Date.now()-this.config.lastEventTime>this.config.sessionTimeout)&&(this.setSessionId(Date.now()),V=!0),(F=Se()).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),[4,this.add(new L).promise];case 11:return Q.sent(),[4,this.add(new Re).promise];case 12:return Q.sent(),[4,this.add({name:"@amplitude/plugin-session-handler",type:a.BEFORE,setup:function(e,t){return f(void 0,void 0,void 0,(function(){return v(this,(function(i){return H=e,Z=t,[2]}))}))},execute:function(e){return f(void 0,void 0,void 0,(function(){var t,i;return v(this,(function(n){return t=Date.now(),e.event_type===rt||e.event_type===ot?(H.lastEventTime=t,[2,e]):(i=H.lastEventTime||t,t-i>H.sessionTimeout&&(Z.setSessionId(t),e.session_id=Z.getSessionId(),e.time=t),H.lastEventTime=t,[2,e])}))}))}}).promise];case 13:return Q.sent(),[4,this.add(new Te).promise];case 14:return Q.sent(),("boolean"==typeof(K=this.config.defaultTracking)?K:null==K?void 0:K.fileDownloads)?[4,this.add({name:"@amplitude/plugin-file-download-tracking-browser",type:a.ENRICHMENT,setup:function(e,t){return f(void 0,void 0,void 0,(function(){var i,n;return v(this,(function(r){return t?(i=function(e){var i;try{i=new URL(e.href,window.location.href)}catch(e){return}var r=n.exec(i.href),o=null==r?void 0:r[1];o&&e.addEventListener("click",(function(){var n;o&&t.track(nt,((n={})[st]=o,n[at]=i.pathname,n[ut]=e.id,n[ct]=e.text,n[lt]=e.href,n))}))},n=/\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)$/,Array.from(document.getElementsByTagName("a")).forEach(i),"undefined"!=typeof MutationObserver&&new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){"A"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("a")).map(i)}))}))})).observe(document.body,{subtree:!0,childList:!0}),[2]):(e.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked."),[2])}))}))},execute:function(e){return f(void 0,void 0,void 0,(function(){return v(this,(function(t){return[2,e]}))}))}}).promise]:[3,16];case 15:Q.sent(),Q.label=16;case 16:return function(e){return"boolean"==typeof e?e:!!(null==e?void 0:e.formInteractions)}(this.config.defaultTracking)?[4,this.add({name:"@amplitude/plugin-form-interaction-tracking-browser",type:a.ENRICHMENT,setup:function(e,t){return f(void 0,void 0,void 0,(function(){var i;return v(this,(function(n){return t?(i=function(e){var i=!1;e.addEventListener("change",(function(){var n;i||t.track(tt,((n={})[dt]=e.id,n[pt]=e.name,n[ft]=e.action,n)),i=!0}),{}),e.addEventListener("submit",(function(){var n,r;i||t.track(tt,((n={})[dt]=e.id,n[pt]=e.name,n[ft]=e.action,n)),t.track(it,((r={})[dt]=e.id,r[pt]=e.name,r[ft]=e.action,r)),i=!1}))},Array.from(document.getElementsByTagName("form")).forEach(i),"undefined"!=typeof MutationObserver&&new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){"FORM"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("form")).map(i)}))}))})).observe(document.body,{subtree:!0,childList:!0}),[2]):(e.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked."),[2])}))}))},execute:function(e){return f(void 0,void 0,void 0,(function(){return v(this,(function(t){return[2,e]}))}))}}).promise]:[3,18];case 17:Q.sent(),Q.label=18;case 18:return(null===(w=this.config.attribution)||void 0===w?void 0:w.disabled)?[3,20]:(z=function(){for(var e,t,i=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o={},s=g(n,2),u=s[0],c=s[1];u&&"init"in u?(t=u,c&&(o=c)):u&&(o=u);var l=null!==(e=o.excludeReferrers)&&void 0!==e?e:[];"undefined"!=typeof location&&l.unshift(location.hostname),o=d(d({disabled:!1,initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1},o),{excludeReferrers:l});var p={name:"web-attribution",type:a.BEFORE,setup:function(e,i){var n;return f(this,void 0,void 0,(function(){var r,s,a,c,l,d,p,f;return v(this,(function(v){switch(v.label){case 0:return(t=null!=t?t:i)?o.disabled?(e.loggerProvider.log("@amplitude/plugin-web-attribution-browser is disabled. Attribution is not tracked."),[2]):(e.loggerProvider.log("Installing @amplitude/plugin-web-attribution-browser."),i||(null===(n=e.attribution)||void 0===n?void 0:n.disabled)||(e.loggerProvider.warn("@amplitude/plugin-web-attribution-browser overrides web attribution behavior defined in @amplitude/analytics-browser. Resolve by disabling web attribution tracking in @amplitude/analytics-browser."),e.attribution={disabled:!0}),s=e.cookieStorage,a=$e(e.apiKey,"MKTG"),[4,Promise.all([(new ue).parse(),s.get(a)])]):(r=u?"Options":"undefined",e.loggerProvider.error("Argument of type '".concat(r,"' is not assignable to parameter of type 'BrowserClient'.")),[2]);case 1:return c=g.apply(void 0,[v.sent(),2]),l=c[0],d=c[1],(null!=(p=this.__pluginEnabledOverride)?p:Ke(l,d,o))&&(o.resetSessionOnNewCampaign&&(t.setSessionId(Date.now()),e.loggerProvider.log("Created a new session for new campaign.")),e.loggerProvider.log("Tracking attribution."),f=He(l,o),t.track(f),s.set(a,l)),[2]}}))}))},execute:function(e){return f(i,void 0,void 0,(function(){return v(this,(function(t){return[2,e]}))}))},__pluginEnabledOverride:void 0};return p}({excludeReferrers:null===(_=this.config.attribution)||void 0===_?void 0:_.excludeReferrers,initialEmptyValue:null===(I=this.config.attribution)||void 0===I?void 0:I.initialEmptyValue,resetSessionOnNewCampaign:null===(k=this.config.attribution)||void 0===k?void 0:k.resetSessionOnNewCampaign}),z.__pluginEnabledOverride=!(!V&&!(null===(E=this.config.attribution)||void 0===E?void 0:E.trackNewCampaigns))&&void 0,[4,this.add(z).promise]);case 19:Q.sent(),Q.label=20;case 20:return B=function(e){var t,i,n=(null===(t=e.attribution)||void 0===t?void 0:t.trackPageViews)?"attribution":function(){return!1},r=void 0,o="Page View";return("boolean"==typeof(i=e.defaultTracking)?i:!!(!0===(null==i?void 0:i.pageViews)||(null==i?void 0:i.pageViews)&&"object"==typeof i.pageViews))&&(n=void 0,o=void 0,e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.pageViews&&"object"==typeof e.defaultTracking.pageViews&&("trackOn"in e.defaultTracking.pageViews&&(n=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(r=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(o=e.defaultTracking.pageViews.eventType))),{trackOn:n,trackHistoryChanges:r,eventType:o}}(this.config),B.eventType=B.eventType||et,[4,this.add(Ze(B)).promise];case 21:return Q.sent(),[4,this.add({name:"@amplitude/plugin-default-page-view-event-enrichment-browser",type:a.ENRICHMENT,setup:function(){return f(void 0,void 0,void 0,(function(){return v(this,(function(e){return[2,void 0]}))}))},execute:function(e){return f(void 0,void 0,void 0,(function(){return v(this,(function(t){return e.event_type===et&&e.event_properties&&(e.event_properties=Object.entries(e.event_properties).reduce((function(e,t){var i=g(t,2),n=i[0],r=i[1],o=vt[n];return o?e[o]=r:e[n]=r,e}),{})),[2,e]}))}))}}).promise];case 22:return Q.sent(),this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 23:return Q.sent(),F.eventBridge.setEventReceiver((function(e){$.track(e.eventType,e.eventProperties)})),[2]}var K,H,Z,G}))}))},t.prototype.getUserId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.userId},t.prototype.setUserId=function(e){this.config?e===this.config.userId&&void 0!==e||(this.config.userId=e,this.setSessionId(Date.now()),function(e){Se().identityStore.editIdentity().setUserId(e).commit()}(e)):this.q.push(this.setUserId.bind(this,e))},t.prototype.getDeviceId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.deviceId},t.prototype.setDeviceId=function(e){this.config?(this.config.deviceId=e,function(e){Se().identityStore.editIdentity().setDeviceId(e).commit()}(e)):this.q.push(this.setDeviceId.bind(this,e))},t.prototype.reset=function(){this.setDeviceId($()),this.setUserId(void 0)},t.prototype.getSessionId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.sessionId},t.prototype.setSessionId=function(e){if(this.config){var t,i=this.getSessionId(),n=this.config.lastEventTime;if(this.config.sessionId=e,this.config.lastEventTime=void 0,"boolean"==typeof(t=this.config.defaultTracking)?t:null==t?void 0:t.sessions){if(i&&n){var r={session_id:i,time:n+1};r.device_id=this.previousSessionDeviceId,r.user_id=this.previousSessionUserId,this.track(ot,void 0,r)}this.track(rt,void 0,{session_id:e,time:e-1}),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId}}else this.q.push(this.setSessionId.bind(this,e))},t.prototype.setTransport=function(e){this.config?this.config.transportProvider=Ve(e):this.q.push(this.setTransport.bind(this,e))},t.prototype.identify=function(t,i){if(Pe(t)){var n=t._q;t._q=[],t=xe(new E,n)}return(null==i?void 0:i.user_id)&&this.setUserId(i.user_id),(null==i?void 0:i.device_id)&&this.setDeviceId(i.device_id),e.prototype.identify.call(this,t,i)},t.prototype.groupIdentify=function(t,i,n,r){if(Pe(n)){var o=n._q;n._q=[],n=xe(new E,o)}return e.prototype.groupIdentify.call(this,t,i,n,r)},t.prototype.revenue=function(t,i){if(Pe(t)){var n=t._q;t._q=[],t=xe(new N,n)}return e.prototype.revenue.call(this,t,i)},t}(R),gt=function(){var e=new ht;return{init:B(e.init.bind(e),"init",V(e),z(e,["config"])),add:B(e.add.bind(e),"add",V(e),z(e,["config.apiKey","timeline.plugins"])),remove:B(e.remove.bind(e),"remove",V(e),z(e,["config.apiKey","timeline.plugins"])),track:B(e.track.bind(e),"track",V(e),z(e,["config.apiKey","timeline.queue.length"])),logEvent:B(e.logEvent.bind(e),"logEvent",V(e),z(e,["config.apiKey","timeline.queue.length"])),identify:B(e.identify.bind(e),"identify",V(e),z(e,["config.apiKey","timeline.queue.length"])),groupIdentify:B(e.groupIdentify.bind(e),"groupIdentify",V(e),z(e,["config.apiKey","timeline.queue.length"])),setGroup:B(e.setGroup.bind(e),"setGroup",V(e),z(e,["config.apiKey","timeline.queue.length"])),revenue:B(e.revenue.bind(e),"revenue",V(e),z(e,["config.apiKey","timeline.queue.length"])),flush:B(e.flush.bind(e),"flush",V(e),z(e,["config.apiKey","timeline.queue.length"])),getUserId:B(e.getUserId.bind(e),"getUserId",V(e),z(e,["config","config.userId"])),setUserId:B(e.setUserId.bind(e),"setUserId",V(e),z(e,["config","config.userId"])),getDeviceId:B(e.getDeviceId.bind(e),"getDeviceId",V(e),z(e,["config","config.deviceId"])),setDeviceId:B(e.setDeviceId.bind(e),"setDeviceId",V(e),z(e,["config","config.deviceId"])),reset:B(e.reset.bind(e),"reset",V(e),z(e,["config","config.userId","config.deviceId"])),getSessionId:B(e.getSessionId.bind(e),"getSessionId",V(e),z(e,["config"])),setSessionId:B(e.setSessionId.bind(e),"setSessionId",V(e),z(e,["config"])),setOptOut:B(e.setOptOut.bind(e),"setOptOut",V(e),z(e,["config"])),setTransport:B(e.setTransport.bind(e),"setTransport",V(e),z(e,["config"]))}},bt=gt(),yt=bt.add,mt=bt.flush,wt=bt.getDeviceId,_t=bt.getSessionId,It=bt.getUserId,kt=bt.groupIdentify,Et=bt.identify,St=bt.init,Tt=bt.logEvent,Ot=bt.remove,xt=bt.reset,Pt=bt.revenue,Rt=bt.setDeviceId,Nt=bt.setGroup,Ut=bt.setOptOut,qt=bt.setSessionId,Dt=bt.setTransport,At=bt.setUserId,Ct=bt.track;e.Identify=E,e.Revenue=N,e.Types=y,e.add=yt,e.createInstance=gt,e.flush=mt,e.getDeviceId=wt,e.getSessionId=_t,e.getUserId=It,e.groupIdentify=kt,e.identify=Et,e.init=St,e.logEvent=Tt,e.remove=Ot,e.reset=xt,e.revenue=Pt,e.runQueuedFunctions=function(e,t){xe(e,t)},e.setDeviceId=Rt,e.setGroup=Nt,e.setOptOut=Ut,e.setSessionId=qt,e.setTransport=Dt,e.setUserId=At,e.track=Ct,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).amplitude={})}(this,(function(e){"use strict";var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},t(e,n)};function n(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}var i,r,o,s,u,a,c,d,l=function(){return l=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},l.apply(this,arguments)};function f(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}function p(e,t,n,i){return new(n||(n=Promise))((function(r,o){function s(e){try{a(i.next(e))}catch(e){o(e)}}function u(e){try{a(i.throw(e))}catch(e){o(e)}}function a(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}a((i=i.apply(e,t||[])).next())}))}function v(e,t){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(a){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(n=1,i&&(r=2&u[0]?i.return:u[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,u[1])).done)return r;switch(i=0,r&&(u=[2&u[0],r.value]),u[0]){case 0:case 1:r=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,i=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!r||u[1]>r[0]&&u[1]<r[3])){s.label=u[1];break}if(6===u[0]&&s.label<r[1]){s.label=r[1],r=u;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(u);break}r[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(e,s)}catch(e){u=[6,e],i=0}finally{n=r=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}}function h(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s}function y(e,t,n){if(n||2===arguments.length)for(var i,r=0,o=t.length;r<o;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}!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"}(i||(i={})),function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE="$revenue"}(r||(r={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(o||(o={})),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"}(s||(s={})),function(e){e.BEFORE="before",e.ENRICHMENT="enrichment",e.DESTINATION="destination"}(u||(u={})),function(e){e.US="US",e.EU="EU"}(a||(a={})),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"}(c||(c={})),function(e){e.XHR="xhr",e.SendBeacon="beacon",e.Fetch="fetch"}(d||(d={}));var m=Object.freeze({__proto__:null,get SpecialEventType(){return o},get IdentifyOperation(){return i},get RevenueProperty(){return r},get LogLevel(){return s},get PluginType(){return u},get ServerZone(){return a},get Status(){return c},get TransportType(){return d}}),b="AMP",I="".concat(b,"_unsent"),_="https://api2.amplitude.com/2/httpapi",E=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var n=e[t];if(!S(t,n))return!1}return!0},S=function(e,t){var n,i;if("string"!=typeof e)return!1;if(Array.isArray(t)){var r=!0;try{for(var o=h(t),s=o.next();!s.done;s=o.next()){var u=s.value;if(Array.isArray(u))return!1;if("object"==typeof u)r=r&&E(u);else if(!["number","string"].includes(typeof u))return!1;if(!r)return!1}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}}else{if(null==t)return!1;if("object"==typeof t)return E(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},w=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return l({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(i.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(i.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(i.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(i.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(i.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(i.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(i.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(i.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(i.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[i.CLEAR_ALL]="-",this},e.prototype._safeSet=function(e,t,n){if(this._validate(e,t,n)){var i=this._properties[e];return void 0===i&&(i={},this._properties[e]=i),i[t]=n,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,n){return void 0===this._properties[i.CLEAR_ALL]&&(!this._propertySet.has(t)&&(e===i.ADD?"number"==typeof n:e===i.UNSET||e===i.REMOVE||S(t,n)))},e}(),T=function(e,t){return l(l({},t),{event_type:o.IDENTIFY,user_properties:e.getUserProperties()})},O=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=c.Unknown),{event:e,code:t,message:n}},k=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[]}return e.prototype.register=function(e,t){return p(this,void 0,void 0,(function(){return v(this,(function(n){switch(n.label){case 0:return[4,e.setup(t,this.client)];case 1:return n.sent(),this.plugins.push(e),[2]}}))}))},e.prototype.deregister=function(e){return this.plugins.splice(this.plugins.findIndex((function(t){return t.name===e})),1),Promise.resolve()},e.prototype.reset=function(e){this.applying=!1,this.plugins=[],this.client=e},e.prototype.push=function(e){var t=this;return new Promise((function(n){t.queue.push([e,n]),t.scheduleApply(0)}))},e.prototype.scheduleApply=function(e){var t=this;this.applying||(this.applying=!0,setTimeout((function(){t.apply(t.queue.shift()).then((function(){t.applying=!1,t.queue.length>0&&t.scheduleApply(0)}))}),e))},e.prototype.apply=function(e){return p(this,void 0,void 0,(function(){var t,n,i,r,o,s,a,c,d,f,p,y,m,b,I,_,E,S,w;return v(this,(function(v){switch(v.label){case 0:if(!e)return[2];t=g(e,1),n=t[0],i=g(e,2),r=i[1],o=this.plugins.filter((function(e){return e.type===u.BEFORE})),v.label=1;case 1:v.trys.push([1,6,7,8]),s=h(o),a=s.next(),v.label=2;case 2:return a.done?[3,5]:[4,a.value.execute(l({},n))];case 3:if(null===(y=v.sent()))return r({event:n,code:0,message:""}),[2];n=y,v.label=4;case 4:return a=s.next(),[3,2];case 5:return[3,8];case 6:return c=v.sent(),_={error:c},[3,8];case 7:try{a&&!a.done&&(E=s.return)&&E.call(s)}finally{if(_)throw _.error}return[7];case 8:d=this.plugins.filter((function(e){return e.type===u.ENRICHMENT})),v.label=9;case 9:v.trys.push([9,14,15,16]),f=h(d),p=f.next(),v.label=10;case 10:return p.done?[3,13]:[4,p.value.execute(l({},n))];case 11:if(null===(y=v.sent()))return r({event:n,code:0,message:""}),[2];n=y,v.label=12;case 12:return p=f.next(),[3,10];case 13:return[3,16];case 14:return m=v.sent(),S={error:m},[3,16];case 15:try{p&&!p.done&&(w=f.return)&&w.call(f)}finally{if(S)throw S.error}return[7];case 16:return b=this.plugins.filter((function(e){return e.type===u.DESTINATION})),I=b.map((function(e){var t=l({},n);return e.execute(t).catch((function(e){return O(t,0,String(e))}))})),Promise.all(I).then((function(e){var t=g(e,1)[0];r(t)})),[2]}}))}))},e.prototype.flush=function(){return p(this,void 0,void 0,(function(){var e,t,n,i=this;return v(this,(function(r){switch(r.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map((function(e){return i.apply(e)})))];case 1:return r.sent(),t=this.plugins.filter((function(e){return e.type===u.DESTINATION})),n=t.map((function(e){return e.flush&&e.flush()})),[4,Promise.all(n)];case 2:return r.sent(),[2]}}))}))},e}(),P="Event rejected due to exceeded retry count",R=function(e){return{promise:e||Promise.resolve()}},U=function(){function e(e){void 0===e&&(e="$default"),this.initializing=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new k(this),this.name=e}return e.prototype._init=function(e){return p(this,void 0,void 0,(function(){return v(this,(function(t){switch(t.label){case 0:return this.config=e,this.timeline.reset(this),[4,this.runQueuedFunctions("q")];case 1:return t.sent(),[2]}}))}))},e.prototype.runQueuedFunctions=function(e){return p(this,void 0,void 0,(function(){var t,n,i,r,o,s;return v(this,(function(u){switch(u.label){case 0:t=this[e],this[e]=[],u.label=1;case 1:u.trys.push([1,6,7,8]),n=h(t),i=n.next(),u.label=2;case 2:return i.done?[3,5]:[4,(0,i.value)()];case 3:u.sent(),u.label=4;case 4:return i=n.next(),[3,2];case 5:return[3,8];case 6:return r=u.sent(),o={error:r},[3,8];case 7:try{i&&!i.done&&(s=n.return)&&s.call(n)}finally{if(o)throw o.error}return[7];case 8:return[2]}}))}))},e.prototype.track=function(e,t,n){var i=function(e,t,n){return l(l(l({},"string"==typeof e?{event_type:e}:e),n),t&&{event_properties:t})}(e,t,n);return R(this.dispatch(i))},e.prototype.identify=function(e,t){var n=T(e,t);return R(this.dispatch(n))},e.prototype.groupIdentify=function(e,t,n,i){var r=function(e,t,n,i){var r;return l(l({},i),{event_type:o.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(r={},r[e]=t,r)})}(e,t,n,i);return R(this.dispatch(r))},e.prototype.setGroup=function(e,t,n){var i=function(e,t,n){var i,r=new w;return r.set(e,t),l(l({},n),{event_type:o.IDENTIFY,user_properties:r.getUserProperties(),groups:(i={},i[e]=t,i)})}(e,t,n);return R(this.dispatch(i))},e.prototype.revenue=function(e,t){var n=function(e,t){return l(l({},t),{event_type:o.REVENUE,event_properties:e.getEventProperties()})}(e,t);return R(this.dispatch(n))},e.prototype.add=function(e){return this.config?R(this.timeline.register(e,this.config)):(this.q.push(this.add.bind(this,e)),R())},e.prototype.remove=function(e){return this.config?R(this.timeline.deregister(e)):(this.q.push(this.remove.bind(this,e)),R())},e.prototype.dispatchWithCallback=function(e,t){if(!this.config)return t(O(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return p(this,void 0,void 0,(function(){var t=this;return v(this,(function(n){return this.config?[2,this.process(e)]:[2,new Promise((function(n){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,n))}))]}))}))},e.prototype.process=function(e){return p(this,void 0,void 0,(function(){var t,n,i;return v(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),this.config.optOut?[2,O(e,0,"Event skipped due to optOut config")]:[4,this.timeline.push(e)];case 1:return 200===(i=r.sent()).code?this.config.loggerProvider.log(i.message):this.config.loggerProvider.error(i.message),[2,i];case 2:return t=r.sent(),n=String(t),this.config.loggerProvider.error(n),[2,i=O(e,0,n)];case 3:return[2]}}))}))},e.prototype.setOptOut=function(e){this.config?this.config.optOut=Boolean(e):this.q.push(this.setOptOut.bind(this,Boolean(e)))},e.prototype.flush=function(){return R(this.timeline.flush())},e}(),x=function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(e){return this.productId=e,this},e.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},e.prototype.setPrice=function(e){return this.price=e,this},e.prototype.setRevenueType=function(e){return this.revenueType=e,this},e.prototype.setRevenue=function(e){return this.revenue=e,this},e.prototype.setEventProperties=function(e){return E(e)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?l({},this.properties):{};return e[r.REVENUE_PRODUCT_ID]=this.productId,e[r.REVENUE_QUANTITY]=this.quantity,e[r.REVENUE_PRICE]=this.price,e[r.REVENUE_TYPE]=this.revenueType,e[r.REVENUE]=this.revenue,e},e}(),N="Amplitude Logger ",D=function(){function e(){this.logLevel=s.None}return e.prototype.disable=function(){this.logLevel=s.None},e.prototype.enable=function(e){void 0===e&&(e=s.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<s.Verbose||console.log("".concat(N,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<s.Warn||console.warn("".concat(N,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<s.Error||console.error("".concat(N,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<s.Debug||console.log("".concat(N,"[Debug]: ").concat(e.join(" ")))},e}(),q=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,logLevel:s.Warn,loggerProvider:new D,optOut:!1,serverUrl:_,serverZone:a.US,useBatch:!1}},L=function(){function e(e){var t,n,i,r;this._optOut=!1;var o=q();this.apiKey=e.apiKey,this.flushIntervalMillis=null!==(t=e.flushIntervalMillis)&&void 0!==t?t:o.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||o.flushQueueSize,this.loggerProvider=e.loggerProvider||o.loggerProvider,this.logLevel=null!==(n=e.logLevel)&&void 0!==n?n:o.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.optOut=null!==(i=e.optOut)&&void 0!==i?i:o.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||o.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(r=e.useBatch)&&void 0!==r?r:o.useBatch,this.loggerProvider.enable(this.logLevel);var s=j(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=s.serverZone,this.serverUrl=s.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),A=function(e,t){return e===a.EU?t?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":t?"https://api2.amplitude.com/batch":_},j=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=q().serverZone),void 0===n&&(n=q().useBatch),e)return{serverUrl:e,serverZone:void 0};var i=["US","EU"].includes(t)?t:q().serverZone;return{serverZone:i,serverUrl:A(i,n)}},C=function(){function e(){this.name="amplitude",this.type=u.DESTINATION,this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduled=null,this.queue=[]}return e.prototype.setup=function(e){var t;return p(this,void 0,void 0,(function(){var n,i=this;return v(this,(function(r){switch(r.label){case 0:return this.config=e,this.storageKey="".concat(I,"_").concat(this.config.apiKey.substring(0,10)),[4,null===(t=this.config.storageProvider)||void 0===t?void 0:t.get(this.storageKey)];case 1:return n=r.sent(),this.saveEvents(),n&&n.length>0&&Promise.all(n.map((function(e){return i.execute(e)}))).catch(),[2,Promise.resolve(void 0)]}}))}))},e.prototype.execute=function(e){var t=this;return new Promise((function(n){var i={event:e,attempts:0,callback:function(e){return n(e)},timeout:0};t.addToQueue(i)}))},e.prototype.addToQueue=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=t.filter((function(t){return t.attempts<e.config.flushMaxRetries?(t.attempts+=1,!0):(e.fulfillRequest([t],500,P),!1)}));i.forEach((function(t){e.queue=e.queue.concat(t),0!==t.timeout?setTimeout((function(){t.timeout=0,e.schedule(0)}),t.timeout):e.schedule(e.config.flushIntervalMillis)})),this.saveEvents()},e.prototype.schedule=function(e){var t=this;this.scheduled||(this.scheduled=setTimeout((function(){t.flush(!0).then((function(){t.queue.length>0&&t.schedule(e)}))}),e))},e.prototype.flush=function(e){return void 0===e&&(e=!1),p(this,void 0,void 0,(function(){var t,n,i,r=this;return v(this,(function(o){switch(o.label){case 0:return t=[],n=[],this.queue.forEach((function(e){return 0===e.timeout?t.push(e):n.push(e)})),this.queue=n,this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),s=t,u=this.config.flushQueueSize,a=Math.max(u,1),i=s.reduce((function(e,t,n){var i=Math.floor(n/a);return e[i]||(e[i]=[]),e[i].push(t),e}),[]),[4,Promise.all(i.map((function(t){return r.send(t,e)})))];case 1:return o.sent(),[2]}var s,u,a}))}))},e.prototype.send=function(e,t){return void 0===t&&(t=!0),p(this,void 0,void 0,(function(){var n,i,r,o,s;return v(this,(function(u){switch(u.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];n={api_key:this.config.apiKey,events:e.map((function(e){var t=e.event;return t.extra,f(t,["extra"])})),options:{min_id_length:this.config.minIdLength}},u.label=1;case 1:return u.trys.push([1,3,,4]),i=j(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(i,n)];case 2:if(null===(r=u.sent()))return this.fulfillRequest(e,0,"Unexpected error occurred"),[2];if(!t){if("body"in r){o="";try{o=JSON.stringify(r.body,null,2)}catch(e){}this.fulfillRequest(e,r.statusCode,"".concat(r.status,": ").concat(o))}else this.fulfillRequest(e,r.statusCode,r.status);return[2]}return this.handleReponse(r,e),[3,4];case 3:return s=u.sent(),this.fulfillRequest(e,0,String(s)),[3,4];case 4:return[2]}}))}))},e.prototype.handleReponse=function(e,t){switch(e.status){case c.Success:this.handleSuccessResponse(e,t);break;case c.Invalid:this.handleInvalidResponse(e,t);break;case c.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case c.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.handleOtherReponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,"Event tracked successfully")},e.prototype.handleInvalidResponse=function(e,t){var n=this;if(e.body.missingField||e.body.error.startsWith("Invalid API key"))this.fulfillRequest(t,e.statusCode,e.body.error);else{var i=y(y(y(y([],g(Object.values(e.body.eventsWithInvalidFields)),!1),g(Object.values(e.body.eventsWithMissingFields)),!1),g(Object.values(e.body.eventsWithInvalidIdLengths)),!1),g(e.body.silencedEvents),!1).flat(),r=new Set(i),o=t.filter((function(t,i){if(!r.has(i))return!0;n.fulfillRequest([t],e.statusCode,e.body.error)}));this.addToQueue.apply(this,y([],g(o),!1))}},e.prototype.handlePayloadTooLargeResponse=function(e,t){1!==t.length?(this.config.flushQueueSize/=2,this.addToQueue.apply(this,y([],g(t),!1))):this.fulfillRequest(t,e.statusCode,e.body.error)},e.prototype.handleRateLimitResponse=function(e,t){var n=this,i=Object.keys(e.body.exceededDailyQuotaUsers),r=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,s=new Set(i),u=new Set(r),a=new Set(o),c=t.filter((function(t,i){if(!(t.event.user_id&&s.has(t.event.user_id)||t.event.device_id&&u.has(t.event.device_id)))return a.has(i)&&(t.timeout=n.throttleTimeout),!0;n.fulfillRequest([t],e.statusCode,e.body.error)}));this.addToQueue.apply(this,y([],g(c),!1))},e.prototype.handleOtherReponse=function(e){var t=this;this.addToQueue.apply(this,y([],g(e.map((function(e){return e.timeout=e.attempts*t.retryTimeout,e}))),!1))},e.prototype.fulfillRequest=function(e,t,n){this.saveEvents(),e.forEach((function(e){return e.callback(O(e.event,t,n))}))},e.prototype.saveEvents=function(){if(this.config.storageProvider){var e=Array.from(this.queue.map((function(e){return e.event})));this.config.storageProvider.set(this.storageKey,e)}},e}(),M=function(e){return void 0===e&&(e=0),((new Error).stack||"").split("\n").slice(2+e).map((function(e){return e.trim()}))},F=function(e){return function(){var t=l({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},V=function(e,t){var n,i;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var r=h(t.split(".")),o=r.next();!o.done;o=r.next()){var s=o.value;if(!(s in e))return;e=e[s]}}catch(e){n={error:e}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}return e},B=function(e,t){return function(){var n,i,r={};try{for(var o=h(t),s=o.next();!s.done;s=o.next()){var u=s.value;r[u]=V(e,u)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return r}},Q=function(e,t,n,i,r){return void 0===r&&(r=null),function(){for(var o=[],u=0;u<arguments.length;u++)o[u]=arguments[u];var a=n(),c=a.logger,d=a.logLevel;if(d&&d<s.Debug||!d||!c)return e.apply(r,o);var l={type:"invoke public method",name:t,args:o,stacktrace:M(1),time:{start:(new Date).toISOString()},states:{}};i&&l.states&&(l.states.before=i());var f=e.apply(r,o);return f&&f.promise?f.promise.then((function(){i&&l.states&&(l.states.after=i()),l.time&&(l.time.end=(new Date).toISOString()),c.debug(JSON.stringify(l,null,2))})):(i&&l.states&&(l.states.after=i()),l.time&&(l.time.end=(new Date).toISOString()),c.debug(JSON.stringify(l,null,2))),f}},$=function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,$)},K=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return p(this,void 0,void 0,(function(){return v(this,(function(e){return[2,!0]}))}))},e.prototype.get=function(e){return p(this,void 0,void 0,(function(){return v(this,(function(t){return[2,this.memoryStorage.get(e)]}))}))},e.prototype.getRaw=function(e){return p(this,void 0,void 0,(function(){var t;return v(this,(function(n){switch(n.label){case 0:return[4,this.get(e)];case 1:return[2,(t=n.sent())?JSON.stringify(t):void 0]}}))}))},e.prototype.set=function(e,t){return p(this,void 0,void 0,(function(){return v(this,(function(n){return this.memoryStorage.set(e,t),[2]}))}))},e.prototype.remove=function(e){return p(this,void 0,void 0,(function(){return v(this,(function(t){return this.memoryStorage.delete(e),[2]}))}))},e.prototype.reset=function(){return p(this,void 0,void 0,(function(){return v(this,(function(e){return this.memoryStorage.clear(),[2]}))}))},e}(),z=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,n,i,r,o,s,u,a,d,l,f,p,v,h,g,y,m,b,I,_,E,S;if("object"!=typeof e)return null;var w=e.code||0,T=this.buildStatus(w);switch(T){case c.Success:return{status:T,statusCode:w,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(n=e.payload_size_bytes)&&void 0!==n?n:0,serverUploadTime:null!==(i=e.server_upload_time)&&void 0!==i?i:0}};case c.Invalid:return{status:T,statusCode:w,body:{error:null!==(r=e.error)&&void 0!==r?r:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(s=e.events_with_invalid_fields)&&void 0!==s?s:{},eventsWithMissingFields:null!==(u=e.events_with_missing_fields)&&void 0!==u?u:{},eventsWithInvalidIdLengths:null!==(a=e.events_with_invalid_id_lengths)&&void 0!==a?a:{},epsThreshold:null!==(d=e.eps_threshold)&&void 0!==d?d:0,exceededDailyQuotaDevices:null!==(l=e.exceeded_daily_quota_devices)&&void 0!==l?l:{},silencedDevices:null!==(f=e.silenced_devices)&&void 0!==f?f:[],silencedEvents:null!==(p=e.silenced_events)&&void 0!==p?p:[],throttledDevices:null!==(v=e.throttled_devices)&&void 0!==v?v:{},throttledEvents:null!==(h=e.throttled_events)&&void 0!==h?h:[]}};case c.PayloadTooLarge:return{status:T,statusCode:w,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case c.RateLimit:return{status:T,statusCode:w,body:{error:null!==(y=e.error)&&void 0!==y?y:"",epsThreshold:null!==(m=e.eps_threshold)&&void 0!==m?m:0,throttledDevices:null!==(b=e.throttled_devices)&&void 0!==b?b:{},throttledUsers:null!==(I=e.throttled_users)&&void 0!==I?I:{},exceededDailyQuotaDevices:null!==(_=e.exceeded_daily_quota_devices)&&void 0!==_?_:{},exceededDailyQuotaUsers:null!==(E=e.exceeded_daily_quota_users)&&void 0!==E?E:{},throttledEvents:null!==(S=e.throttled_events)&&void 0!==S?S:[]}};case c.Timeout:default:return{status:T,statusCode:w}}},e.prototype.buildStatus=function(e){return e>=200&&e<300?c.Success:429===e?c.RateLimit:413===e?c.PayloadTooLarge:408===e?c.Timeout:e>=400&&e<500?c.Invalid:e>=500?c.Failed:c.Unknown},e}(),W=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},H=function(){var e,t=W();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce((function(e,t){var n=t.split("=",2),i=J(n[0]),r=J(n[1]);return r?(e[i]=r,e):e}),{}):{}},J=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},Z="dclid",Y="fbclid",G="gbraid",X="gclid",ee="ko_click_id",te="li_fat_id",ne="msclkid",ie="rtd_cid",re="ttclid",oe="twclid",se="wbraid",ue={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,rtd_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},ae=function(){function e(){}return e.prototype.parse=function(){return p(this,void 0,void 0,(function(){return v(this,(function(e){return[2,l(l(l(l({},ue),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=H();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=null!==(t=null===(e=n.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return n},e.prototype.getClickIds=function(){var e,t=H();return(e={})[Z]=t[Z],e[Y]=t[Y],e[G]=t[G],e[X]=t[X],e[ee]=t[ee],e[te]=t[te],e[ne]=t[ne],e[ie]=t[ie],e[re]=t[re],e[oe]=t[oe],e[se]=t[se],e},e}(),ce=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),[b,t,e.substring(0,n)].filter(Boolean).join("_")},de=function(){function e(e){this.options=l({},e)}return e.prototype.isEnabled=function(){return p(this,void 0,void 0,(function(){var t,n,i;return v(this,(function(r){switch(r.label){case 0:if(!W())return[2,!1];t=String(Date.now()),n=new e(this.options),i="AMP_TEST",r.label=1;case 1:return r.trys.push([1,4,5,7]),[4,n.set(i,t)];case 2:return r.sent(),[4,n.get(i)];case 3:return[2,r.sent()===t];case 4:return r.sent(),[2,!1];case 5:return[4,n.remove(i)];case 6:return r.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){return p(this,void 0,void 0,(function(){var t;return v(this,(function(n){switch(n.label){case 0:return[4,this.getRaw(e)];case 1:if(!(t=n.sent()))return[2,void 0];try{try{t=decodeURIComponent(atob(t))}catch(e){}return[2,JSON.parse(t)]}catch(e){return[2,void 0]}return[2]}}))}))},e.prototype.getRaw=function(e){var t;return p(this,void 0,void 0,(function(){var n,i,r;return v(this,(function(o){return n=W(),i=null!==(t=null==n?void 0:n.document.cookie.split("; "))&&void 0!==t?t:[],(r=i.find((function(t){return 0===t.indexOf(e+"=")})))?[2,r.substring(e.length+1)]:[2,void 0]}))}))},e.prototype.set=function(e,t){var n;return p(this,void 0,void 0,(function(){var i,r,o,s,u,a;return v(this,(function(c){try{i=null!==(n=this.options.expirationDays)&&void 0!==n?n:0,o=void 0,(r=null!==t?i:-1)&&((s=new Date).setTime(s.getTime()+24*r*60*60*1e3),o=s),u="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t)))),o&&(u+="; expires=".concat(o.toUTCString())),u+="; path=/",this.options.domain&&(u+="; domain=".concat(this.options.domain)),this.options.secure&&(u+="; Secure"),this.options.sameSite&&(u+="; SameSite=".concat(this.options.sameSite)),(a=W())&&(a.document.cookie=u)}catch(e){}return[2]}))}))},e.prototype.remove=function(e){return p(this,void 0,void 0,(function(){return v(this,(function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}}))}))},e.prototype.reset=function(){return p(this,void 0,void 0,(function(){return v(this,(function(e){return[2]}))}))},e}(),le=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.send=function(e,t){return p(this,void 0,void 0,(function(){var n,i;return v(this,(function(r){switch(r.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return n={headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(t),method:"POST"},[4,fetch(e,n)];case 1:return[4,r.sent().json()];case 2:return i=r.sent(),[2,this.buildResponse(i)]}}))}))},t}(z),fe=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:pe(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),pe=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},ve=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach((function(t){e(t)})),this.queue=[])},e}(),he=function(){return he=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},he.apply(this,arguments)},ge=function(e,t){var n=typeof e;if(n!==typeof t)return!1;for(var i=0,r=["string","number","boolean","undefined"];i<r.length;i++){if(r[i]===n)return e===t}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var o=Array.isArray(e),s=Array.isArray(t);if(o!==s)return!1;if(!o||!s){var u=Object.keys(e).sort(),a=Object.keys(t).sort();if(!ge(u,a))return!1;var c=!0;return Object.keys(e).forEach((function(n){ge(e[n],t[n])||(c=!1)})),c}for(var d=0;d<e.length;d++)if(!ge(e[d],t[d]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),n=t.length,i=new Array(n);n--;)i[n]=[t[n],e[t[n]]];return i});var ye=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=he({},this.identity.userProperties),n=he(he({},this.identity),{userProperties:t});return{setUserId:function(e){return n.userId=e,this},setDeviceId:function(e){return n.deviceId=e,this},setUserProperties:function(e){return n.userProperties=e,this},updateUserProperties:function(e){for(var t=n.userProperties||{},i=0,r=Object.entries(e);i<r.length;i++){var o=r[i],s=o[0],u=o[1];switch(s){case"$set":for(var a=0,c=Object.entries(u);a<c.length;a++){var d=c[a],l=d[0],f=d[1];t[l]=f}break;case"$unset":for(var p=0,v=Object.keys(u);p<v.length;p++){delete t[l=v[p]]}break;case"$clearAll":t={}}}return n.userProperties=t,this},commit:function(){return e.setIdentity(n),this}}},e.prototype.getIdentity=function(){return he({},this.identity)},e.prototype.setIdentity=function(e){var t=he({},this.identity);this.identity=he({},e),ge(t,this.identity)||this.listeners.forEach((function(t){t(e)}))},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),me="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,be=function(){function e(){this.identityStore=new ye,this.eventBridge=new ve,this.applicationContextProvider=new fe}return e.getInstance=function(t){return me.analyticsConnectorInstances||(me.analyticsConnectorInstances={}),me.analyticsConnectorInstances[t]||(me.analyticsConnectorInstances[t]=new e),me.analyticsConnectorInstances[t]},e}(),Ie=function(){return be.getInstance("$default_instance")},_e=function(){function e(){this.name="identity",this.type=u.BEFORE,this.identityStore=Ie().identityStore}return e.prototype.execute=function(e){return p(this,void 0,void 0,(function(){var t;return v(this,(function(n){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]}))}))},e.prototype.setup=function(e){return Promise.resolve(void 0)},e}(),Ee=function(){var e,t,n,i;if("undefined"==typeof navigator)return"";var r=navigator.userLanguage;return null!==(i=null!==(n=null!==(t=null===(e=navigator.languages)||void 0===e?void 0:e[0])&&void 0!==t?t:navigator.language)&&void 0!==n?n:r)&&void 0!==i?i:""},Se=function(e,t){return"boolean"==typeof e?e:!1!==(null==e?void 0:e[t])},we=function(e){return Se(e,"attribution")},Te=function(e){var t,n,i=function(){return!1},r=void 0;return(n=e.defaultTracking,Se(n,"pageViews"))&&(i=void 0,t=void 0,e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.pageViews&&"object"==typeof e.defaultTracking.pageViews&&("trackOn"in e.defaultTracking.pageViews&&(i=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(r=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(t=e.defaultTracking.pageViews.eventType))),{trackOn:i,trackHistoryChanges:r,eventType:t}},Oe=function(e,t){for(var n=0;n<t.length;n++){var i=t[n],r=i.name,o=i.args,s=i.resolve,u=e&&e[r];if("function"==typeof u){var a=u.apply(e,o);"function"==typeof s&&s(null==a?void 0:a.promise)}}return e},ke=function(e){return e&&void 0!==e._q},Pe=function(){function e(){this.name="context",this.type=u.BEFORE,this.eventId=0,this.library="amplitude-ts/".concat("2.0.0-beta.1"),"undefined"!=typeof navigator&&(this.userAgent=navigator.userAgent)}return e.prototype.setup=function(e){return this.config=e,this.eventId=this.config.lastEventId?this.config.lastEventId+1:0,Promise.resolve(void 0)},e.prototype.execute=function(e){return p(this,void 0,void 0,(function(){var t;return v(this,(function(n){return t=(new Date).getTime(),this.config.lastEventId=this.eventId,[2,l(l(l(l(l(l(l(l({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:t},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:"Web"}),this.config.trackingOptions.language&&{language:Ee()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:$(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),e),{event_id:this.eventId++,library:this.library,user_agent:this.userAgent})]}))}))},e}(),Re=function(){function e(){}return e.prototype.isEnabled=function(){return p(this,void 0,void 0,(function(){var t,n,i;return v(this,(function(r){switch(r.label){case 0:if(!W())return[2,!1];t=String(Date.now()),n=new e,i="AMP_TEST",r.label=1;case 1:return r.trys.push([1,4,5,7]),[4,n.set(i,t)];case 2:return r.sent(),[4,n.get(i)];case 3:return[2,r.sent()===t];case 4:return r.sent(),[2,!1];case 5:return[4,n.remove(i)];case 6:return r.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){return p(this,void 0,void 0,(function(){var t;return v(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return(t=n.sent())?[2,JSON.parse(t)]:[2,void 0];case 2:return n.sent(),[2,void 0];case 3:return[2]}}))}))},e.prototype.getRaw=function(e){var t;return p(this,void 0,void 0,(function(){return v(this,(function(n){return[2,(null===(t=W())||void 0===t?void 0:t.localStorage.getItem(e))||void 0]}))}))},e.prototype.set=function(e,t){var n;return p(this,void 0,void 0,(function(){return v(this,(function(i){try{null===(n=W())||void 0===n||n.localStorage.setItem(e,JSON.stringify(t))}catch(e){}return[2]}))}))},e.prototype.remove=function(e){var t;return p(this,void 0,void 0,(function(){return v(this,(function(n){try{null===(t=W())||void 0===t||t.localStorage.removeItem(e)}catch(e){}return[2]}))}))},e.prototype.reset=function(){var e;return p(this,void 0,void 0,(function(){return v(this,(function(t){try{null===(e=W())||void 0===e||e.localStorage.clear()}catch(e){}return[2]}))}))},e}(),Ue=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={done:4},t}return n(t,e),t.prototype.send=function(e,t){return p(this,void 0,void 0,(function(){var n=this;return v(this,(function(i){return[2,new Promise((function(i,r){"undefined"==typeof XMLHttpRequest&&r(new Error("XHRTransport is not supported."));var o=new XMLHttpRequest;o.open("POST",e,!0),o.onreadystatechange=function(){if(o.readyState===n.state.done)try{var e=o.responseText,t=JSON.parse(e),s=n.buildResponse(t);i(s)}catch(e){r(e)}},o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Accept","*/*"),o.send(JSON.stringify(t))}))]}))}))},t}(z),xe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.send=function(e,t){return p(this,void 0,void 0,(function(){var n=this;return v(this,(function(i){return[2,new Promise((function(i,r){var o=W();if(!(null==o?void 0:o.navigator.sendBeacon))throw new Error("SendBeaconTransport is not supported");try{var s=JSON.stringify(t);return i(o.navigator.sendBeacon(e,JSON.stringify(t))?n.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:s.length,server_upload_time:Date.now()}):n.buildResponse({code:500}))}catch(e){r(e)}}))]}))}))},t}(z),Ne=function(e,t,n){return void 0===n&&(n=!0),p(void 0,void 0,void 0,(function(){var i,r,o,s,u,a,c,d;return v(this,(function(l){switch(l.label){case 0:return i=function(e){return"".concat(b.toLowerCase(),"_").concat(e.substring(0,6))}(e),[4,t.getRaw(i)];case 1:return(r=l.sent())?n?[4,t.remove(i)]:[3,3]:[2,{optOut:!1}];case 2:l.sent(),l.label=3;case 3:return o=g(r.split("."),5),s=o[0],u=o[1],a=o[2],c=o[3],d=o[4],[2,{deviceId:s,userId:qe(u),sessionId:De(c),lastEventTime:De(d),optOut:Boolean(a)}]}}))}))},De=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},qe=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},Le="[Amplitude]",Ae="".concat(Le," Form Started"),je="".concat(Le," Form Submitted"),Ce="".concat(Le," File Downloaded"),Me="session_start",Fe="session_end",Ve="".concat(Le," File Extension"),Be="".concat(Le," File Name"),Qe="".concat(Le," Link ID"),$e="".concat(Le," Link Text"),Ke="".concat(Le," Link URL"),ze="".concat(Le," Form ID"),We="".concat(Le," Form Name"),He="".concat(Le," Form Destination"),Je="cookie",Ze=function(e){function t(t,n,i,r,o,u,a,c,d,l,f,p,v,h,g,y,m,b,I,_,E,S,w,T,O,k,P,R,U){void 0===i&&(i=new K),void 0===r&&(r={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),void 0===o&&(o=!0),void 0===a&&(a=1e3),void 0===c&&(c=5),void 0===d&&(d=30),void 0===l&&(l=Je),void 0===h&&(h=new D),void 0===g&&(g=s.Warn),void 0===m&&(m=!1),void 0===_&&(_=""),void 0===E&&(E="US"),void 0===w&&(w=18e5),void 0===T&&(T=new Re),void 0===O&&(O={ipAddress:!0,language:!0,platform:!0}),void 0===k&&(k="fetch"),void 0===P&&(P=new le),void 0===R&&(R=!1);var x=e.call(this,{apiKey:t,storageProvider:T,transportProvider:P})||this;return x.apiKey=t,x.appVersion=n,x.cookieOptions=r,x.defaultTracking=o,x.flushIntervalMillis=a,x.flushMaxRetries=c,x.flushQueueSize=d,x.identityStorage=l,x.ingestionMetadata=f,x.loggerProvider=h,x.logLevel=g,x.minIdLength=y,x.partnerId=b,x.plan=I,x.serverUrl=_,x.serverZone=E,x.sessionTimeout=w,x.storageProvider=T,x.trackingOptions=O,x.transport=k,x.transportProvider=P,x.useBatch=R,x._optOut=!1,x._cookieStorage=i,x.deviceId=u,x.lastEventId=p,x.lastEventTime=v,x.optOut=m,x.sessionId=S,x.userId=U,x.loggerProvider.enable(x.logLevel),x}return n(t,e),Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(e){this._cookieStorage!==e&&(this._cookieStorage=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(e){this._deviceId!==e&&(this._deviceId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(e){this._userId!==e&&(this._userId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(e){this._sessionId!==e&&(this._sessionId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut!==e&&(this._optOut=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(e){this._lastEventTime!==e&&(this._lastEventTime=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(e){this._lastEventId!==e&&(this._lastEventId=e,this.updateStorage())},enumerable:!1,configurable:!0}),t.prototype.updateStorage=function(){var e={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId};this.cookieStorage.set(ce(this.apiKey),e)},t}(L),Ye=function(e,t,n){return void 0===t&&(t={}),p(void 0,void 0,void 0,(function(){var i,r,o,s,u,a,c,d,f,p,h,g,y,m,b,I,_,E,S,w,T,O,k,P,R,U,x,N,D,q,L,A,j,C;return v(this,(function(v){switch(v.label){case 0:return i=t.identityStorage||Je,o=[l({},t.cookieOptions)],_={},i===Je?[3,1]:(s="",[3,5]);case 1:return null===(S=null===(E=t.cookieOptions)||void 0===E?void 0:E.domain)||void 0===S?[3,2]:(u=S,[3,4]);case 2:return[4,Xe()];case 3:u=v.sent(),v.label=4;case 4:s=u,v.label=5;case 5:return r=l.apply(void 0,o.concat([(_.domain=s,_.expiration=365,_.sameSite="Lax",_.secure=!1,_.upgrade=!0,_)])),a=Ge(t.identityStorage,r),[4,Ne(e,a,null===(T=null===(w=t.cookieOptions)||void 0===w?void 0:w.upgrade)||void 0===T||T)];case 6:return c=v.sent(),[4,a.get(ce(e))];case 7:return d=v.sent(),f=H(),p=null!==(R=null!==(P=null!==(k=null!==(O=t.deviceId)&&void 0!==O?O:f.deviceId)&&void 0!==k?k:null==d?void 0:d.deviceId)&&void 0!==P?P:c.deviceId)&&void 0!==R?R:$(),h=null==d?void 0:d.lastEventId,g=null!==(U=null==d?void 0:d.lastEventTime)&&void 0!==U?U:c.lastEventTime,y=null!==(N=null!==(x=t.optOut)&&void 0!==x?x:null==d?void 0:d.optOut)&&void 0!==N?N:c.optOut,m=null!==(q=null!==(D=t.sessionId)&&void 0!==D?D:null==d?void 0:d.sessionId)&&void 0!==q?q:c.sessionId,b=null!==(A=null!==(L=t.userId)&&void 0!==L?L:null==d?void 0:d.userId)&&void 0!==A?A:c.userId,n.previousSessionDeviceId=null!==(j=null==d?void 0:d.deviceId)&&void 0!==j?j:c.deviceId,n.previousSessionUserId=null!==(C=null==d?void 0:d.userId)&&void 0!==C?C:c.userId,I=l(l({},t.trackingOptions),{ipAddress:!0,language:!0,platform:!0}),[2,new Ze(e,t.appVersion,a,r,t.defaultTracking,p,t.flushIntervalMillis,t.flushMaxRetries,t.flushQueueSize,i,t.ingestionMetadata,h,g,t.loggerProvider,t.logLevel,t.minIdLength,y,t.partnerId,t.plan,t.serverUrl,t.serverZone,m,t.sessionTimeout,t.storageProvider,I,t.transport,t.transportProvider,t.useBatch,b)]}}))}))},Ge=function(e,t){switch(void 0===e&&(e=Je),void 0===t&&(t={}),e){case"localStorage":return new Re;case"none":return new K;default:return new de(t)}},Xe=function(e){return p(void 0,void 0,void 0,(function(){var t,n,i,r,o,s,u;return v(this,(function(a){switch(a.label){case 0:return[4,(new de).isEnabled()];case 1:if(!a.sent()||!e&&"undefined"==typeof location)return[2,""];for(t=null!=e?e:location.hostname,n=t.split("."),i=[],r="AMP_TLDTEST",o=n.length-2;o>=0;--o)i.push(n.slice(o).join("."));o=0,a.label=2;case 2:return o<i.length?(s=i[o],[4,(u=new de({domain:"."+s})).set(r,1)]):[3,7];case 3:return a.sent(),[4,u.get(r)];case 4:return a.sent()?[4,u.remove(r)]:[3,6];case 5:return a.sent(),[2,"."+s];case 6:return o++,[3,2];case 7:return[2,""]}}))}))},et=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},tt=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=""),e.some((function(e){return e instanceof RegExp?e.test(t):e===t}))},nt=function(e){var t=this;void 0===e&&(e={});var n={name:"@amplitude/plugin-web-attribution-browser",type:u.BEFORE,setup:function(t,n){var i;return p(this,void 0,void 0,(function(){var r,o,s,u,a,c,d;return v(this,(function(p){switch(p.label){case 0:return r=l({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:(m=null===(i=t.cookieOptions)||void 0===i?void 0:i.domain,I=m,I?(I.startsWith(".")&&(I=I.substring(1)),[new RegExp("".concat(I.replace(".","\\."),"$"))]):[])},e),t.loggerProvider.log("Installing @amplitude/plugin-web-attribution-browser."),o=t.cookieStorage,v=t.apiKey,void 0===(h="MKTG")&&(h=""),void 0===y&&(y=10),s=[b,h,v.substring(0,y)].filter(Boolean).join("_"),[4,Promise.all([(new ae).parse(),o.get(s)])];case 1:return u=g.apply(void 0,[p.sent(),2]),a=u[0],c=u[1],function(e,t,n){e.referrer;var i=e.referring_domain,r=f(e,["referrer","referring_domain"]),o=t||{};o.referrer;var s=o.referring_domain,u=f(o,["referrer","referring_domain"]);if(tt(n.excludeReferrers,e.referring_domain))return!1;var a=JSON.stringify(r)!==JSON.stringify(u),c=et(i||"")!==et(s||"");return!t||a||c}(a,c,r)&&(r.resetSessionOnNewCampaign&&(n.setSessionId(Date.now()),t.loggerProvider.log("Created a new session for new campaign.")),t.loggerProvider.log("Tracking attribution."),d=function(e,t){var n=l(l({},ue),e),i=Object.entries(n).reduce((function(e,n){var i,r=g(n,2),o=r[0],s=r[1];return e.setOnce("initial_".concat(o),null!==(i=null!=s?s:t.initialEmptyValue)&&void 0!==i?i:"EMPTY"),s?e.set(o,s):e.unset(o)}),new w);return T(i)}(a,r),n.track(d),o.set(s,a)),[2]}var v,h,y,m,I}))}))},execute:function(e){return p(t,void 0,void 0,(function(){return v(this,(function(t){return[2,e]}))}))}};return n},it=function(e){var t={};for(var n in e){var i=e[n];i&&(t[n]=i)}return t},rt=function(e){var t;void 0===e&&(e={});var n=W(),i=void 0,r=function(){return p(void 0,void 0,void 0,(function(){var t,n,i;return v(this,(function(r){switch(r.label){case 0:return n={event_type:null!==(i=e.eventType)&&void 0!==i?i:"[Amplitude] Page Viewed"},t=[{}],[4,ot()];case 1:return[2,(n.event_properties=l.apply(void 0,[l.apply(void 0,t.concat([r.sent()])),{"[Amplitude] Page Domain":"undefined"!=typeof location&&location.hostname||"","[Amplitude] Page Location":"undefined"!=typeof location&&location.href||"","[Amplitude] Page Path":"undefined"!=typeof location&&location.pathname||"","[Amplitude] Page Title":"undefined"!=typeof document&&document.title||"","[Amplitude] Page URL":"undefined"!=typeof location&&location.href.split("?")[0]||""}]),n)]}}))}))},o=function(){return void 0===e.trackOn||"function"==typeof e.trackOn&&e.trackOn()},s="undefined"!=typeof location?location.href:null,a=function(){return p(void 0,void 0,void 0,(function(){var n,u,a;return v(this,(function(c){switch(c.label){case 0:return n=location.href,ut(e.trackHistoryChanges,n,s||"")&&o()?(null==i||i.log("Tracking page view event"),null!=t?[3,1]:[3,3]):[3,4];case 1:return a=(u=t).track,[4,r()];case 2:a.apply(u,[c.sent()]),c.label=3;case 3:c.label=4;case 4:return s=n,[2]}}))}))},c={name:"@amplitude/plugin-page-view-tracking-browser",type:u.ENRICHMENT,setup:function(e,s){return p(void 0,void 0,void 0,(function(){var u,c;return v(this,(function(d){switch(d.label){case 0:return t=s,(i=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),n&&(n.addEventListener("popstate",(function(){a()})),n.history.pushState=new Proxy(n.history.pushState,{apply:function(e,t,n){var i=g(n,3),r=i[0],o=i[1],s=i[2];e.apply(t,[r,o,s]),a()}})),o()?(i.log("Tracking page view event"),c=(u=t).track,[4,r()]):[3,2];case 1:c.apply(u,[d.sent()]),d.label=2;case 2:return[2]}}))}))},execute:function(t){return p(void 0,void 0,void 0,(function(){var n;return v(this,(function(o){switch(o.label){case 0:return"attribution"===e.trackOn&&st(t)?(null==i||i.log("Enriching campaign event to page view event with campaign parameters"),[4,r()]):[3,2];case 1:n=o.sent(),t.event_type=n.event_type,t.event_properties=l(l({},t.event_properties),n.event_properties),o.label=2;case 2:return[2,t]}}))}))}};return c},ot=function(){return p(void 0,void 0,void 0,(function(){var e;return v(this,(function(t){switch(t.label){case 0:return e=it,[4,(new ae).parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}}))}))},st=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,n=t[i.SET]||{},r=t[i.UNSET]||{},o=y(y([],g(Object.keys(n)),!1),g(Object.keys(r)),!1);return Object.keys(ue).every((function(e){return o.includes(e)}))}return!1},ut=function(e,t,n){return"pathOnly"===e?t.split("?")[0]!==n.split("?")[0]:t!==n},at=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.init=function(e,t,n){return void 0===e&&(e=""),R(this._init(l(l({},n),{userId:t,apiKey:e})))},t.prototype._init=function(t){return p(this,void 0,void 0,(function(){var n,i,r,o,s=this;return v(this,(function(a){switch(a.label){case 0:return this.initializing?[2]:(this.initializing=!0,[4,Ye(t.apiKey,t,this)]);case 1:return n=a.sent(),[4,e.prototype._init.call(this,n)];case 2:return a.sent(),(!this.config.sessionId||this.config.lastEventTime&&Date.now()-this.config.lastEventTime>this.config.sessionTimeout)&&this.setSessionId(Date.now()),(i=Ie()).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),[4,this.add(new C).promise];case 3:return a.sent(),[4,this.add(new Pe).promise];case 4:return a.sent(),[4,this.add({name:"@amplitude/plugin-session-handler",type:u.BEFORE,setup:function(e,t){return p(void 0,void 0,void 0,(function(){return v(this,(function(n){return f=e,h=t,[2]}))}))},execute:function(e){return p(void 0,void 0,void 0,(function(){var t,n;return v(this,(function(i){return t=Date.now(),e.event_type===Me||e.event_type===Fe?(f.lastEventTime=t,[2,e]):(n=f.lastEventTime||t,t-n>f.sessionTimeout&&(h.setSessionId(t),e.session_id=h.getSessionId(),e.time=t),f.lastEventTime=t,[2,e])}))}))}}).promise];case 5:return a.sent(),[4,this.add(new _e).promise];case 6:return a.sent(),d=this.config.defaultTracking,Se(d,"fileDownloads")?[4,this.add({name:"@amplitude/plugin-file-download-tracking-browser",type:u.ENRICHMENT,setup:function(e,t){return p(void 0,void 0,void 0,(function(){var n,i;return v(this,(function(r){return t?(n=function(e){var n;try{n=new URL(e.href,window.location.href)}catch(e){return}var r=i.exec(n.href),o=null==r?void 0:r[1];o&&e.addEventListener("click",(function(){var i;o&&t.track(Ce,((i={})[Ve]=o,i[Be]=n.pathname,i[Qe]=e.id,i[$e]=e.text,i[Ke]=e.href,i))}))},i=/\.(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(n),"undefined"!=typeof MutationObserver&&new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){"A"===e.nodeName&&n(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("a")).map(n)}))}))})).observe(document.body,{subtree:!0,childList:!0}),[2]):(e.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked."),[2])}))}))},execute:function(e){return p(void 0,void 0,void 0,(function(){return v(this,(function(t){return[2,e]}))}))}}).promise]:[3,8];case 7:a.sent(),a.label=8;case 8:return function(e){return Se(e,"formInteractions")}(this.config.defaultTracking)?[4,this.add({name:"@amplitude/plugin-form-interaction-tracking-browser",type:u.ENRICHMENT,setup:function(e,t){return p(void 0,void 0,void 0,(function(){var n;return v(this,(function(i){return t?(n=function(e){var n=!1;e.addEventListener("change",(function(){var i;n||t.track(Ae,((i={})[ze]=e.id,i[We]=e.name,i[He]=e.action,i)),n=!0}),{}),e.addEventListener("submit",(function(){var i,r;n||t.track(Ae,((i={})[ze]=e.id,i[We]=e.name,i[He]=e.action,i)),t.track(je,((r={})[ze]=e.id,r[We]=e.name,r[He]=e.action,r)),n=!1}))},Array.from(document.getElementsByTagName("form")).forEach(n),"undefined"!=typeof MutationObserver&&new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){"FORM"===e.nodeName&&n(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("form")).map(n)}))}))})).observe(document.body,{subtree:!0,childList:!0}),[2]):(e.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked."),[2])}))}))},execute:function(e){return p(void 0,void 0,void 0,(function(){return v(this,(function(t){return[2,e]}))}))}}).promise]:[3,10];case 9:a.sent(),a.label=10;case 10:return we(this.config.defaultTracking)?(c=this.config,r=we(c.defaultTracking)&&c.defaultTracking&&"object"==typeof c.defaultTracking&&c.defaultTracking.attribution&&"object"==typeof c.defaultTracking.attribution?l({},c.defaultTracking.attribution):{},o=nt(r),[4,this.add(o).promise]):[3,12];case 11:a.sent(),a.label=12;case 12:return[4,this.add(rt(Te(this.config))).promise];case 13:return a.sent(),this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 14:return a.sent(),i.eventBridge.setEventReceiver((function(e){s.track(e.eventType,e.eventProperties)})),[2]}var c,d,f,h}))}))},t.prototype.getUserId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.userId},t.prototype.setUserId=function(e){this.config?e===this.config.userId&&void 0!==e||(this.config.userId=e,this.setSessionId(Date.now()),function(e){Ie().identityStore.editIdentity().setUserId(e).commit()}(e)):this.q.push(this.setUserId.bind(this,e))},t.prototype.getDeviceId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.deviceId},t.prototype.setDeviceId=function(e){this.config?(this.config.deviceId=e,function(e){Ie().identityStore.editIdentity().setDeviceId(e).commit()}(e)):this.q.push(this.setDeviceId.bind(this,e))},t.prototype.reset=function(){this.setDeviceId($()),this.setUserId(void 0)},t.prototype.getSessionId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.sessionId},t.prototype.setSessionId=function(e){if(this.config){var t,n=this.getSessionId(),i=this.config.lastEventTime;if(this.config.sessionId=e,this.config.lastEventTime=void 0,t=this.config.defaultTracking,Se(t,"sessions")){if(n&&i){var r={session_id:n,time:i+1};r.device_id=this.previousSessionDeviceId,r.user_id=this.previousSessionUserId,this.track(Fe,void 0,r)}this.track(Me,void 0,{session_id:e,time:e-1}),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId}}else this.q.push(this.setSessionId.bind(this,e))},t.prototype.setTransport=function(e){this.config?this.config.transportProvider=function(e){return e===d.XHR?new Ue:e===d.SendBeacon?new xe:new le}(e):this.q.push(this.setTransport.bind(this,e))},t.prototype.identify=function(t,n){if(ke(t)){var i=t._q;t._q=[],t=Oe(new w,i)}return(null==n?void 0:n.user_id)&&this.setUserId(n.user_id),(null==n?void 0:n.device_id)&&this.setDeviceId(n.device_id),e.prototype.identify.call(this,t,n)},t.prototype.groupIdentify=function(t,n,i,r){if(ke(i)){var o=i._q;i._q=[],i=Oe(new w,o)}return e.prototype.groupIdentify.call(this,t,n,i,r)},t.prototype.revenue=function(t,n){if(ke(t)){var i=t._q;t._q=[],t=Oe(new x,i)}return e.prototype.revenue.call(this,t,n)},t}(U),ct=function(){var e=new at;return{init:Q(e.init.bind(e),"init",F(e),B(e,["config"])),add:Q(e.add.bind(e),"add",F(e),B(e,["config.apiKey","timeline.plugins"])),remove:Q(e.remove.bind(e),"remove",F(e),B(e,["config.apiKey","timeline.plugins"])),track:Q(e.track.bind(e),"track",F(e),B(e,["config.apiKey","timeline.queue.length"])),logEvent:Q(e.logEvent.bind(e),"logEvent",F(e),B(e,["config.apiKey","timeline.queue.length"])),identify:Q(e.identify.bind(e),"identify",F(e),B(e,["config.apiKey","timeline.queue.length"])),groupIdentify:Q(e.groupIdentify.bind(e),"groupIdentify",F(e),B(e,["config.apiKey","timeline.queue.length"])),setGroup:Q(e.setGroup.bind(e),"setGroup",F(e),B(e,["config.apiKey","timeline.queue.length"])),revenue:Q(e.revenue.bind(e),"revenue",F(e),B(e,["config.apiKey","timeline.queue.length"])),flush:Q(e.flush.bind(e),"flush",F(e),B(e,["config.apiKey","timeline.queue.length"])),getUserId:Q(e.getUserId.bind(e),"getUserId",F(e),B(e,["config","config.userId"])),setUserId:Q(e.setUserId.bind(e),"setUserId",F(e),B(e,["config","config.userId"])),getDeviceId:Q(e.getDeviceId.bind(e),"getDeviceId",F(e),B(e,["config","config.deviceId"])),setDeviceId:Q(e.setDeviceId.bind(e),"setDeviceId",F(e),B(e,["config","config.deviceId"])),reset:Q(e.reset.bind(e),"reset",F(e),B(e,["config","config.userId","config.deviceId"])),getSessionId:Q(e.getSessionId.bind(e),"getSessionId",F(e),B(e,["config"])),setSessionId:Q(e.setSessionId.bind(e),"setSessionId",F(e),B(e,["config"])),setOptOut:Q(e.setOptOut.bind(e),"setOptOut",F(e),B(e,["config"])),setTransport:Q(e.setTransport.bind(e),"setTransport",F(e),B(e,["config"]))}},dt=ct(),lt=dt.add,ft=dt.flush,pt=dt.getDeviceId,vt=dt.getSessionId,ht=dt.getUserId,gt=dt.groupIdentify,yt=dt.identify,mt=dt.init,bt=dt.logEvent,It=dt.remove,_t=dt.reset,Et=dt.revenue,St=dt.setDeviceId,wt=dt.setGroup,Tt=dt.setOptOut,Ot=dt.setSessionId,kt=dt.setTransport,Pt=dt.setUserId,Rt=dt.track;e.Identify=w,e.Revenue=x,e.Types=m,e.add=lt,e.createInstance=ct,e.flush=ft,e.getDeviceId=pt,e.getSessionId=vt,e.getUserId=ht,e.groupIdentify=gt,e.identify=yt,e.init=mt,e.logEvent=bt,e.remove=It,e.reset=_t,e.revenue=Et,e.runQueuedFunctions=function(e,t){Oe(e,t)},e.setDeviceId=St,e.setGroup=wt,e.setOptOut=Tt,e.setSessionId=Ot,e.setTransport=kt,e.setUserId=Pt,e.track=Rt,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script type="text/javascript">
|
|
2
|
-
!function(){"use strict";!function(e,t){var
|
|
2
|
+
!function(){"use strict";!function(e,t){var n=e.amplitude||{_q:[],_iq:{}};if(n.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{var r=function(e,t){e.prototype[t]=function(){return this._q.push({name:t,args:Array.prototype.slice.call(arguments,0)}),this}},s=function(e,t,n){return function(r){e._q.push({name:t,args:Array.prototype.slice.call(n,0),resolve:r})}},o=function(e,t,n){e[t]=function(){if(n)return{promise:new Promise(s(e,t,Array.prototype.slice.call(arguments)))}}},i=function(e){for(var t=0;t<m.length;t++)o(e,m[t],!1);for(var n=0;n<g.length;n++)o(e,g[n],!0)};n.invoked=!0;var a=t.createElement("script");a.type="text/javascript",a.integrity="sha384-wZAYoU/Dyp5YYHRl09XkA/xsjCGm1JgxV6S6nBBmjPIU9BEGyQvTKUEXbjCUoZPJ",a.crossOrigin="anonymous",a.async=!0,a.src="https://cdn.amplitude.com/libs/analytics-browser-1.10.5-min.js.gz",a.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var c=t.getElementsByTagName("script")[0];c.parentNode.insertBefore(a,c);for(var u=function(){return this._q=[],this},l=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],p=0;p<l.length;p++)r(u,l[p]);n.Identify=u;for(var d=function(){return this._q=[],this},v=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],f=0;f<v.length;f++)r(d,v[f]);n.Revenue=d;var m=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset"],g=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];i(n),n.createInstance=function(e){return n._iq[e]={_q:[]},i(n._iq[e]),n._iq[e]},e.amplitude=n}}(window,document)}();
|
|
3
3
|
|
|
4
4
|
amplitude.init("YOUR_API_KEY_HERE");
|
|
5
5
|
</script>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";!function(e,t){var
|
|
1
|
+
!function(){"use strict";!function(e,t){var n=e.amplitude||{_q:[],_iq:{}};if(n.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{var r=function(e,t){e.prototype[t]=function(){return this._q.push({name:t,args:Array.prototype.slice.call(arguments,0)}),this}},s=function(e,t,n){return function(r){e._q.push({name:t,args:Array.prototype.slice.call(n,0),resolve:r})}},o=function(e,t,n){e[t]=function(){if(n)return{promise:new Promise(s(e,t,Array.prototype.slice.call(arguments)))}}},i=function(e){for(var t=0;t<m.length;t++)o(e,m[t],!1);for(var n=0;n<g.length;n++)o(e,g[n],!0)};n.invoked=!0;var a=t.createElement("script");a.type="text/javascript",a.integrity="sha384-wZAYoU/Dyp5YYHRl09XkA/xsjCGm1JgxV6S6nBBmjPIU9BEGyQvTKUEXbjCUoZPJ",a.crossOrigin="anonymous",a.async=!0,a.src="https://cdn.amplitude.com/libs/analytics-browser-1.10.5-min.js.gz",a.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var c=t.getElementsByTagName("script")[0];c.parentNode.insertBefore(a,c);for(var u=function(){return this._q=[],this},l=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],p=0;p<l.length;p++)r(u,l[p]);n.Identify=u;for(var d=function(){return this._q=[],this},v=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],f=0;f<v.length;f++)r(d,v[f]);n.Revenue=d;var m=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset"],g=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];i(n),n.createInstance=function(e){return n._iq[e]={_q:[]},i(n._iq[e]),n._iq[e]},e.amplitude=n}}(window,document)}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-client.d.ts","sourceRoot":"","sources":["../../src/browser-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAuD,MAAM,2BAA2B,CAAC;AAa/G,OAAO,EACL,aAAa,EACb,aAAa,EACb,cAAc,EACd,YAAY,EACZ,QAAQ,IAAI,SAAS,EACrB,OAAO,IAAI,QAAQ,EACnB,aAAa,
|
|
1
|
+
{"version":3,"file":"browser-client.d.ts","sourceRoot":"","sources":["../../src/browser-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAuD,MAAM,2BAA2B,CAAC;AAa/G,OAAO,EACL,aAAa,EACb,aAAa,EACb,cAAc,EACd,YAAY,EACZ,QAAQ,IAAI,SAAS,EACrB,OAAO,IAAI,QAAQ,EACnB,aAAa,EACd,MAAM,4BAA4B,CAAC;AAWpC,qBAAa,gBAAiB,SAAQ,aAAc,YAAW,aAAa;IAG1E,MAAM,EAAE,aAAa,CAAC;IACtB,uBAAuB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5C,qBAAqB,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1C,IAAI,CAAC,MAAM,SAAK,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc;cAG3C,KAAK,CAAC,OAAO,EAAE,cAAc,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE;IAmElE,SAAS;IAIT,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS;IAYpC,WAAW;IAIX,WAAW,CAAC,QAAQ,EAAE,MAAM;IAS5B,KAAK;IAKL,YAAY;IAIZ,YAAY,CAAC,SAAS,EAAE,MAAM;IA+B9B,YAAY,CAAC,SAAS,EAAE,aAAa;IAQrC,QAAQ,CAAC,QAAQ,EAAE,SAAS,EAAE,YAAY,CAAC,EAAE,YAAY;IAezD,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,CAAC,EAAE,YAAY;IAS/G,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,YAAY,CAAC,EAAE,YAAY;CAQvD"}
|
package/lib/scripts/config.d.ts
CHANGED
|
@@ -1,41 +1,44 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Event, BrowserOptions, BrowserConfig as IBrowserConfig, DefaultTrackingOptions, Storage, TrackingOptions, TransportType, UserSession, Transport, Logger as ILogger, LogLevel, Plan, IngestionMetadata, IdentityStorageType, ServerZoneType } from '@amplitude/analytics-types';
|
|
2
2
|
import { Config, MemoryStorage } from '@amplitude/analytics-core';
|
|
3
|
-
import { FetchTransport } from '@amplitude/analytics-client-common';
|
|
3
|
+
import { CookieStorage, FetchTransport } from '@amplitude/analytics-client-common';
|
|
4
|
+
import { LocalStorage } from './storage/local-storage';
|
|
4
5
|
import { XHRTransport } from './transports/xhr';
|
|
5
6
|
import { SendBeaconTransport } from './transports/send-beacon';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
cookieSameSite: string;
|
|
9
|
-
cookieSecure: boolean;
|
|
10
|
-
cookieStorage: MemoryStorage<UserSession>;
|
|
11
|
-
cookieUpgrade: boolean;
|
|
12
|
-
disableCookies: boolean;
|
|
13
|
-
domain: string;
|
|
14
|
-
sessionTimeout: number;
|
|
15
|
-
trackingOptions: Required<TrackingOptions>;
|
|
16
|
-
transportProvider: FetchTransport;
|
|
17
|
-
};
|
|
7
|
+
import { CookieOptions } from '@amplitude/analytics-types/lib/esm/config/browser';
|
|
8
|
+
import { AmplitudeBrowser } from './browser-client';
|
|
18
9
|
export declare class BrowserConfig extends Config implements IBrowserConfig {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
10
|
+
apiKey: string;
|
|
11
|
+
appVersion?: string | undefined;
|
|
12
|
+
cookieOptions: CookieOptions;
|
|
13
|
+
defaultTracking: boolean | DefaultTrackingOptions;
|
|
14
|
+
flushIntervalMillis: number;
|
|
15
|
+
flushMaxRetries: number;
|
|
16
|
+
flushQueueSize: number;
|
|
17
|
+
identityStorage: IdentityStorageType;
|
|
18
|
+
ingestionMetadata?: IngestionMetadata | undefined;
|
|
19
|
+
loggerProvider: ILogger;
|
|
20
|
+
logLevel: LogLevel;
|
|
21
|
+
minIdLength?: number | undefined;
|
|
22
|
+
partnerId?: string | undefined;
|
|
23
|
+
plan?: Plan | undefined;
|
|
24
|
+
serverUrl: string;
|
|
25
|
+
serverZone: ServerZoneType;
|
|
30
26
|
sessionTimeout: number;
|
|
31
|
-
|
|
27
|
+
storageProvider: Storage<Event[]>;
|
|
28
|
+
trackingOptions: Required<TrackingOptions>;
|
|
29
|
+
transport: 'fetch' | 'xhr' | 'beacon';
|
|
30
|
+
transportProvider: Transport;
|
|
31
|
+
useBatch: boolean;
|
|
32
|
+
protected _cookieStorage: Storage<UserSession>;
|
|
32
33
|
protected _deviceId?: string;
|
|
33
34
|
protected _lastEventId?: number;
|
|
34
35
|
protected _lastEventTime?: number;
|
|
35
36
|
protected _optOut: boolean;
|
|
36
37
|
protected _sessionId?: number;
|
|
37
38
|
protected _userId?: string;
|
|
38
|
-
constructor(apiKey: string,
|
|
39
|
+
constructor(apiKey: string, appVersion?: string | undefined, cookieStorage?: Storage<UserSession>, cookieOptions?: CookieOptions, defaultTracking?: boolean | DefaultTrackingOptions, deviceId?: string, flushIntervalMillis?: number, flushMaxRetries?: number, flushQueueSize?: number, identityStorage?: IdentityStorageType, ingestionMetadata?: IngestionMetadata | undefined, lastEventId?: number, lastEventTime?: number, loggerProvider?: ILogger, logLevel?: LogLevel, minIdLength?: number | undefined, optOut?: boolean, partnerId?: string | undefined, plan?: Plan | undefined, serverUrl?: string, serverZone?: ServerZoneType, sessionId?: number, sessionTimeout?: number, storageProvider?: Storage<Event[]>, trackingOptions?: Required<TrackingOptions>, transport?: 'fetch' | 'xhr' | 'beacon', transportProvider?: Transport, useBatch?: boolean, userId?: string);
|
|
40
|
+
get cookieStorage(): Storage<UserSession>;
|
|
41
|
+
set cookieStorage(cookieStorage: Storage<UserSession>);
|
|
39
42
|
get deviceId(): string | undefined;
|
|
40
43
|
set deviceId(deviceId: string | undefined);
|
|
41
44
|
get userId(): string | undefined;
|
|
@@ -50,20 +53,8 @@ export declare class BrowserConfig extends Config implements IBrowserConfig {
|
|
|
50
53
|
set lastEventId(lastEventId: number | undefined);
|
|
51
54
|
private updateStorage;
|
|
52
55
|
}
|
|
53
|
-
export declare const useBrowserConfig: (apiKey: string, options
|
|
54
|
-
export declare const createCookieStorage: <T>(
|
|
55
|
-
cookieExpiration: number;
|
|
56
|
-
cookieSameSite: string;
|
|
57
|
-
cookieSecure: boolean;
|
|
58
|
-
cookieStorage: MemoryStorage<UserSession>;
|
|
59
|
-
cookieUpgrade: boolean;
|
|
60
|
-
disableCookies: boolean;
|
|
61
|
-
domain: string;
|
|
62
|
-
sessionTimeout: number;
|
|
63
|
-
trackingOptions: Required<TrackingOptions>;
|
|
64
|
-
transportProvider: FetchTransport;
|
|
65
|
-
}) => Promise<Storage<T>>;
|
|
66
|
-
export declare const createEventsStorage: (overrides?: BrowserOptions) => Promise<Storage<Event[]> | undefined>;
|
|
56
|
+
export declare const useBrowserConfig: (apiKey: string, options: BrowserOptions | undefined, amplitudeInstance: AmplitudeBrowser) => Promise<IBrowserConfig>;
|
|
57
|
+
export declare const createCookieStorage: <T>(identityStorage?: IdentityStorageType, cookieOptions?: CookieOptions) => LocalStorage<T> | MemoryStorage<T> | CookieStorage<T>;
|
|
67
58
|
export declare const createTransport: (transport?: TransportType | keyof typeof TransportType) => XHRTransport | SendBeaconTransport | FetchTransport;
|
|
68
59
|
export declare const getTopLevelDomain: (url?: string) => Promise<string>;
|
|
69
60
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,cAAc,EACd,aAAa,IAAI,cAAc,EAC/B,sBAAsB,EACtB,OAAO,EACP,eAAe,EACf,aAAa,EACb,WAAW,EACX,SAAS,EACT,MAAM,IAAI,OAAO,EACjB,QAAQ,EACR,IAAI,EACJ,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,MAAM,EAAU,aAAa,EAAQ,MAAM,2BAA2B,CAAC;AAChF,OAAO,EAAE,aAAa,EAAiB,cAAc,EAAkB,MAAM,oCAAoC,CAAC;AAElH,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,MAAM,mDAAmD,CAAC;AAElF,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,qBAAa,aAAc,SAAQ,MAAO,YAAW,cAAc;IAUxD,MAAM,EAAE,MAAM;IACd,UAAU,CAAC;IAEX,aAAa,EAAE,aAAa;IAO5B,eAAe,EAAE,OAAO,GAAG,sBAAsB;IAEjD,mBAAmB,EAAE,MAAM;IAC3B,eAAe,EAAE,MAAM;IACvB,cAAc,EAAE,MAAM;IACtB,eAAe,EAAE,mBAAmB;IACpC,iBAAiB,CAAC;IAGlB,cAAc,EAAE,OAAO;IACvB,QAAQ,EAAE,QAAQ;IAClB,WAAW,CAAC;IAEZ,SAAS,CAAC;IACV,IAAI,CAAC;IACL,SAAS,EAAE,MAAM;IACjB,UAAU,EAAE,cAAc;IAE1B,cAAc,EAAE,MAAM;IACtB,eAAe,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC;IACjC,eAAe,EAAE,QAAQ,CAAC,eAAe,CAAC;IAK1C,SAAS,EAAE,OAAO,GAAG,KAAK,GAAG,QAAQ;IACrC,iBAAiB,EAAE,SAAS;IAC5B,QAAQ,EAAE,OAAO;IA9C1B,SAAS,CAAC,cAAc,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAC/C,SAAS,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC7B,SAAS,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAChC,SAAS,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAClC,SAAS,CAAC,OAAO,UAAS;IAC1B,SAAS,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC9B,SAAS,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;gBAGlB,MAAM,EAAE,MAAM,EACd,UAAU,CAAC,oBAAQ,EAC1B,aAAa,GAAE,OAAO,CAAC,WAAW,CAAuB,EAClD,aAAa,GAAE,aAMrB,EACM,eAAe,GAAE,OAAO,GAAG,sBAA6B,EAC/D,QAAQ,CAAC,EAAE,MAAM,EACV,mBAAmB,GAAE,MAAa,EAClC,eAAe,GAAE,MAAU,EAC3B,cAAc,GAAE,MAAW,EAC3B,eAAe,GAAE,mBAA8C,EAC/D,iBAAiB,CAAC,+BAAmB,EAC5C,WAAW,CAAC,EAAE,MAAM,EACpB,aAAa,CAAC,EAAE,MAAM,EACf,cAAc,GAAE,OAAsB,EACtC,QAAQ,GAAE,QAAwB,EAClC,WAAW,CAAC,oBAAQ,EAC3B,MAAM,UAAQ,EACP,SAAS,CAAC,oBAAQ,EAClB,IAAI,CAAC,kBAAM,EACX,SAAS,GAAE,MAAW,EACtB,UAAU,GAAE,cAAoC,EACvD,SAAS,CAAC,EAAE,MAAM,EACX,cAAc,GAAE,MAAuB,EACvC,eAAe,GAAE,OAAO,CAAC,KAAK,EAAE,CAAsB,EACtD,eAAe,GAAE,QAAQ,CAAC,eAAe,CAI/C,EACM,SAAS,GAAE,OAAO,GAAG,KAAK,GAAG,QAAkB,EAC/C,iBAAiB,GAAE,SAAgC,EACnD,QAAQ,GAAE,OAAe,EAChC,MAAM,CAAC,EAAE,MAAM;IAajB,IAAI,aAAa,IAIgB,OAAO,CAAC,WAAW,CAAC,CAFpD;IAED,IAAI,aAAa,CAAC,aAAa,EAAE,OAAO,CAAC,WAAW,CAAC,EAKpD;IAED,IAAI,QAAQ,IAIW,MAAM,GAAG,SAAS,CAFxC;IAED,IAAI,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAKxC;IAED,IAAI,MAAM,IAIS,MAAM,GAAG,SAAS,CAFpC;IAED,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAKpC;IAED,IAAI,SAAS,IAIY,MAAM,GAAG,SAAS,CAF1C;IAED,IAAI,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,EAK1C;IAED,IAAI,MAAM,IAIS,OAAO,CAFzB;IAED,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,EAKzB;IAED,IAAI,aAAa,IAIgB,MAAM,GAAG,SAAS,CAFlD;IAED,IAAI,aAAa,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,EAKlD;IAED,IAAI,WAAW,IAIc,MAAM,GAAG,SAAS,CAF9C;IAED,IAAI,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,EAK9C;IAED,OAAO,CAAC,aAAa;CAWtB;AAED,eAAO,MAAM,gBAAgB,WACnB,MAAM,0DAEK,gBAAgB,KAClC,QAAQ,cAAc,CAoExB,CAAC;AAEF,eAAO,MAAM,mBAAmB,wBACb,mBAAmB,kBACrB,aAAa,0DAW7B,CAAC;AAEF,eAAO,MAAM,eAAe,eAAgB,aAAa,GAAG,MAAM,oBAAoB,wDAQrF,CAAC;AAEF,eAAO,MAAM,iBAAiB,SAAgB,MAAM,oBA0BnD,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IdentityStorageType, ServerZoneType } from '@amplitude/analytics-types';
|
|
1
2
|
export declare const DEFAULT_EVENT_PREFIX = "[Amplitude]";
|
|
2
3
|
export declare const DEFAULT_PAGE_VIEW_EVENT: string;
|
|
3
4
|
export declare const DEFAULT_FORM_START_EVENT: string;
|
|
@@ -13,4 +14,6 @@ export declare const LINK_URL: string;
|
|
|
13
14
|
export declare const FORM_ID: string;
|
|
14
15
|
export declare const FORM_NAME: string;
|
|
15
16
|
export declare const FORM_DESTINATION: string;
|
|
17
|
+
export declare const DEFAULT_IDENTITY_STORAGE: IdentityStorageType;
|
|
18
|
+
export declare const DEFAULT_SERVER_ZONE: ServerZoneType;
|
|
16
19
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,gBAAgB,CAAC;AAElD,eAAO,MAAM,uBAAuB,QAAwC,CAAC;AAC7E,eAAO,MAAM,wBAAwB,QAAyC,CAAC;AAC/E,eAAO,MAAM,yBAAyB,QAA2C,CAAC;AAClF,eAAO,MAAM,2BAA2B,QAA4C,CAAC;AACrF,eAAO,MAAM,2BAA2B,kBAAkB,CAAC;AAC3D,eAAO,MAAM,yBAAyB,gBAAgB,CAAC;AAEvD,eAAO,MAAM,cAAc,QAA2C,CAAC;AACvE,eAAO,MAAM,SAAS,QAAsC,CAAC;AAC7D,eAAO,MAAM,OAAO,QAAoC,CAAC;AACzD,eAAO,MAAM,SAAS,QAAsC,CAAC;AAC7D,eAAO,MAAM,QAAQ,QAAqC,CAAC;AAE3D,eAAO,MAAM,OAAO,QAAoC,CAAC;AACzD,eAAO,MAAM,SAAS,QAAsC,CAAC;AAC7D,eAAO,MAAM,gBAAgB,QAA6C,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjF,eAAO,MAAM,oBAAoB,gBAAgB,CAAC;AAElD,eAAO,MAAM,uBAAuB,QAAwC,CAAC;AAC7E,eAAO,MAAM,wBAAwB,QAAyC,CAAC;AAC/E,eAAO,MAAM,yBAAyB,QAA2C,CAAC;AAClF,eAAO,MAAM,2BAA2B,QAA4C,CAAC;AACrF,eAAO,MAAM,2BAA2B,kBAAkB,CAAC;AAC3D,eAAO,MAAM,yBAAyB,gBAAgB,CAAC;AAEvD,eAAO,MAAM,cAAc,QAA2C,CAAC;AACvE,eAAO,MAAM,SAAS,QAAsC,CAAC;AAC7D,eAAO,MAAM,OAAO,QAAoC,CAAC;AACzD,eAAO,MAAM,SAAS,QAAsC,CAAC;AAC7D,eAAO,MAAM,QAAQ,QAAqC,CAAC;AAE3D,eAAO,MAAM,OAAO,QAAoC,CAAC;AACzD,eAAO,MAAM,SAAS,QAAsC,CAAC;AAC7D,eAAO,MAAM,gBAAgB,QAA6C,CAAC;AAE3E,eAAO,MAAM,wBAAwB,EAAE,mBAA8B,CAAC;AACtE,eAAO,MAAM,mBAAmB,EAAE,cAAqB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const parseLegacyCookies: (apiKey: string,
|
|
1
|
+
import { Storage, UserSession } from '@amplitude/analytics-types';
|
|
2
|
+
export declare const parseLegacyCookies: (apiKey: string, cookieStorage: Storage<UserSession>, deleteLegacyCookies?: boolean) => Promise<UserSession>;
|
|
3
3
|
export declare const parseTime: (num: string) => number | undefined;
|
|
4
4
|
export declare const decode: (value?: string) => string | undefined;
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cookie-migration/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cookie-migration/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAGlE,eAAO,MAAM,kBAAkB,WACrB,MAAM,iBACC,QAAQ,WAAW,CAAC,oCAElC,QAAQ,WAAW,CAmBrB,CAAC;AAEF,eAAO,MAAM,SAAS,QAAS,MAAM,uBAMpC,CAAC;AAEF,eAAO,MAAM,MAAM,WAAY,MAAM,KAAG,MAAM,GAAG,SAShD,CAAC"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { BeforePlugin, BrowserConfig, Event, PluginType } from '@amplitude/analytics-types';
|
|
2
|
-
import UAParser from '@amplitude/ua-parser-js';
|
|
3
2
|
export declare class Context implements BeforePlugin {
|
|
4
3
|
name: string;
|
|
5
4
|
type: PluginType.BEFORE;
|
|
6
5
|
config: BrowserConfig;
|
|
7
6
|
eventId: number;
|
|
8
7
|
userAgent: string | undefined;
|
|
9
|
-
uaResult: UAParser.IResult;
|
|
10
8
|
library: string;
|
|
11
9
|
constructor();
|
|
12
10
|
setup(config: BrowserConfig): Promise<undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/plugins/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/plugins/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAO5F,qBAAa,OAAQ,YAAW,YAAY;IAC1C,IAAI,SAAa;IACjB,IAAI,oBAA8B;IAKlC,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,SAAK;IACZ,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,OAAO,SAA6B;;IASpC,KAAK,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,SAAS,CAAC;IAO1C,OAAO,CAAC,OAAO,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;CA6B9C"}
|
package/lib/scripts/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "
|
|
1
|
+
export declare const VERSION = "2.0.0-beta.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,iBAAiB,CAAC"}
|