Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@amplitude/amplitude-js-gtm

Package Overview
Dependencies
Maintainers
20
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amplitude/amplitude-js-gtm - npm Package Compare versions

Comparing version 3.4.0 to 3.5.0

2

dist/index.js

@@ -1,1 +0,1 @@

(()=>{"use strict";!function(e,t){var n=e.amplitudeGTM||{_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}},i=function(e,t,n){return function(r){e._q.push({name:t,args:Array.prototype.slice.call(n,0),resolve:r})}},s=function(e,t,n){e[t]=function(){if(n)return{promise:new Promise(i(e,t,Array.prototype.slice.call(arguments)))}}},p=function(e){for(var t=0;t<f.length;t++)s(e,f[t],!1);for(var n=0;n<m.length;n++)s(e,m[n],!0)};n.invoked=!0;var o=t.createElement("script");o.type="text/javascript",o.integrity="sha384-JgGhMqE+JXsvjPMgPoI507H0dZ02IX50VHbmLsoC6hYCH5llQgn5JtEDH6O3vIrv",o.crossOrigin="anonymous",o.async=!0,o.src="https://cdn.amplitude.com/libs/analytics-browser-gtm-2.1.3-min.js.gz",o.onload=function(){e.amplitudeGTM.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var a=t.getElementsByTagName("script")[0];a.parentNode.insertBefore(o,a);for(var u=function(){return this._q=[],this},d=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],c=0;c<d.length;c++)r(u,d[c]);n.Identify=u;for(var l=function(){return this._q=[],this},v=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],g=0;g<v.length;g++)r(l,v[g]);n.Revenue=l;var f=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset","extendSession"],m=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];p(n),n.createInstance=function(e){return n._iq[e]={_q:[]},p(n._iq[e]),n._iq[e]},e.amplitudeGTM=n,e.amplitude||(e.amplitude=e.amplitudeGTM)}}(window,document),function(e,t){const n=e.amplitudeGTM;if(n&&"function"==typeof n.init){var r=["init","track","identify","setGroup","groupIdentify","revenue","flush","getUserId","setUserId","getSessionId","setSessionId","setDeviceId","getDeviceId","reset","setOptOut","setTransport"],i=["add","append","clearAll","prepend","set","setOnce","remove","preInsert","postInsert"],s=function(e,t,r){if(t=t.shift(),Array.isArray(t)&&0!==t.length){var s=new n.Identify;if(t.forEach((function(e){if(Array.isArray(e)){var t=e.shift();-1!==i.indexOf(t)&&s[t].apply(s,e)}})),!0===r)return s;e.identify(s)}},p=function(e,t){if(!(t.length<3)&&"string"==typeof t[0]&&"string"==typeof t[1]&&Array.isArray(t[2])&&0!==t[2].length){var n=s(e,[t[2]],!0);e.groupIdentify(t[0],t[1],n)}},o=function(e,t){if((t=t.shift()).price&&t.productId){var r=(new n.Revenue).setProductId(t.productId).setQuantity(t.quantity||1).setPrice(t.price).setRevenueType(t.revenueType||"").setEventProperties(t.eventProperties||{}).setRevenue(t.revenue||t.price*(t.quantity||1));e.revenue(r)}},a=function(e,t){const n=t[t.length-1],r=n.userAgentEnrichmentOptions,i=n.pageViewLegacy;userAgentEnrichment&&e.add(userAgentEnrichmentPlugin(r)),i&&e.add({name:"page-view-plugin",type:"enrichment",setup:async()=>{},execute:async e=>("[Amplitude] Page Viewed"==e.event_type&&(e.event_type="Page View",e.event_properties.page_domain=e.event_properties["[Amplitude] Page Domain"],e.event_properties.page_location=e.event_properties["[Amplitude] Page Location"],e.event_properties.page_path=e.event_properties["[Amplitude] Page Path"],e.event_properties.page_title=e.event_properties["[Amplitude] Page Title"],e.event_properties.page_url=e.event_properties["[Amplitude] Page URL"],delete e.event_properties["[Amplitude] Page Domain"],delete e.event_properties["[Amplitude] Page Location"],delete e.event_properties["[Amplitude] Page Path"],delete e.event_properties["[Amplitude] Page Title"],delete e.event_properties["[Amplitude] Page URL"]),e)});let s=e.init(...t).promise;return s.then((()=>e.add({name:"gtm-library-enrichment",type:"enrichment",setup:async()=>{},execute:async e=>(e.library="amplitude-ts-gtm/3.4.0",e)}))),s};e[t]=e[t]||function(){var e=[].slice.call(arguments,0),t=e.shift(),i=t?n._iq[t]:n;i||(i=n.createInstance(t));var u=e.shift();if(-1!==r.indexOf(u))return"revenue"===u?o(i,e):"identify"===u?s(i,e):"groupIdentify"===u?p(i,e):"init"===u?a(i,e):i[u].apply(this,e)}}}(window,"_amplitude")})();
(()=>{"use strict";var e={};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),((e,i,t)=>{!function(e,i){var t=e.amplitudeGTM||{_q:[],_iq:{}};if(t.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{var n=function(e,i){e.prototype[i]=function(){return this._q.push({name:i,args:Array.prototype.slice.call(arguments,0)}),this}},r=function(e,i,t){return function(n){e._q.push({name:i,args:Array.prototype.slice.call(t,0),resolve:n})}},o=function(e,i,t){e[i]=function(){if(t)return{promise:new Promise(r(e,i,Array.prototype.slice.call(arguments)))}}},a=function(e){for(var i=0;i<f.length;i++)o(e,f[i],!1);for(var t=0;t<m.length;t++)o(e,m[t],!0)};t.invoked=!0;var s=i.createElement("script");s.type="text/javascript",s.integrity="sha384-JgGhMqE+JXsvjPMgPoI507H0dZ02IX50VHbmLsoC6hYCH5llQgn5JtEDH6O3vIrv",s.crossOrigin="anonymous",s.async=!0,s.src="https://cdn.amplitude.com/libs/analytics-browser-gtm-2.1.3-min.js.gz",s.onload=function(){e.amplitudeGTM.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var u=i.getElementsByTagName("script")[0];u.parentNode.insertBefore(s,u);for(var l=function(){return this._q=[],this},c=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],d=0;d<c.length;d++)n(l,c[d]);t.Identify=l;for(var p=function(){return this._q=[],this},b=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],w=0;w<b.length;w++)n(p,b[w]);t.Revenue=p;var f=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset","extendSession"],m=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];a(t),t.createInstance=function(e){return t._iq[e]={_q:[]},a(t._iq[e]),t._iq[e]},e.amplitudeGTM=t,e.amplitude||(e.amplitude=e.amplitudeGTM)}}(window,document);var n=function(e){var i=function(){return i=Object.assign||function(e){for(var i,t=1,n=arguments.length;t<n;t++)for(var r in i=arguments[t])Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);return e},i.apply(this,arguments)};function t(e,i,t,n){return new(t||(t=Promise))((function(r,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var i;e.done?r(e.value):(i=e.value,i instanceof t?i:new t((function(e){e(i)}))).then(a,s)}u((n=n.apply(e,i||[])).next())}))}function n(e,i){var t,n,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(t)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(t=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=i.call(e,a)}catch(e){s=[6,e],n=0}finally{t=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}var r=function(){var e=this;return{name:"@amplitude/plugin-page-view-v1-enrichment-browser",type:"enrichment",setup:function(e){return t(this,void 0,void 0,(function(){return n(this,(function(i){return e.loggerProvider.log("Installing @amplitude/plugin-page-view-v1-enrichment-browser."),[2]}))}))},execute:function(r){return t(e,void 0,void 0,(function(){var e,t,o,a,s,u;return n(this,(function(n){return"[Amplitude] Page Viewed"==r.event_type&&(e=r.event_properties||{},t=e["[Amplitude] Page Domain"],o=e["[Amplitude] Page Location"],a=e["[Amplitude] Page Path"],s=e["[Amplitude] Page Title"],u=e["[Amplitude] Page URL"],(r=i(i({},r),{event_type:"Page View",event_properties:i(i({},r.event_properties),{page_domain:null!=t?t:"",page_location:null!=o?o:"",page_path:null!=a?a:"",page_title:null!=s?s:"",page_url:null!=u?u:""})})).event_properties&&(delete r.event_properties["[Amplitude] Page Domain"],delete r.event_properties["[Amplitude] Page Location"],delete r.event_properties["[Amplitude] Page Path"],delete r.event_properties["[Amplitude] Page Title"],delete r.event_properties["[Amplitude] Page URL"])),[2,r]}))}))}}};return e.pageViewV1EnrichmentPlugin=r,e.plugin=r,Object.defineProperty(e,"__esModule",{value:!0}),e}({}),r=function(e){var i=function(){return i=Object.assign||function(e){for(var i,t=1,n=arguments.length;t<n;t++)for(var r in i=arguments[t])Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);return e},i.apply(this,arguments)};function n(e,i,t,n){return new(t||(t=Promise))((function(r,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var i;e.done?r(e.value):(i=e.value,i instanceof t?i:new t((function(e){e(i)}))).then(a,s)}u((n=n.apply(e,i||[])).next())}))}function r(e,i){var t,n,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(t)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(t=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=i.call(e,a)}catch(e){s=[6,e],n=0}finally{t=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t.g?t.g:"undefined"!=typeof self?self:{},a={exports:{}};!function(e,i){!function(t,n){var r="function",o="undefined",a="object",s="string",u="model",l="name",c="type",d="vendor",p="version",b="architecture",w="console",f="mobile",m="tablet",v="smarttv",h="wearable",g="embedded",y="Amazon",x="Apple",k="ASUS",_="BlackBerry",P="Browser",A="Chrome",T="Firefox",I="Google",q="Huawei",S="LG",E="Microsoft",O="Motorola",N="Opera",j="Samsung",z="Sharp",M="Sony",R="Xiaomi",U="Zebra",C="Facebook",V=function(e){for(var i={},t=0;t<e.length;t++)i[e[t].toUpperCase()]=e[t];return i},D=function(e,i){return typeof e===s&&-1!==G(i).indexOf(G(e))},G=function(e){return e.toLowerCase()},B=function(e,i){if(typeof e===s)return e=e.replace(/^\s\s*/,""),typeof i===o?e:e.substring(0,350)},L=function(e,i){for(var t,o,s,u,l,c,d=0;d<i.length&&!l;){var p=i[d],b=i[d+1];for(t=o=0;t<p.length&&!l;)if(l=p[t++].exec(e))for(s=0;s<b.length;s++)c=l[++o],typeof(u=b[s])===a&&u.length>0?2===u.length?typeof u[1]==r?this[u[0]]=u[1].call(this,c):this[u[0]]=u[1]:3===u.length?typeof u[1]!==r||u[1].exec&&u[1].test?this[u[0]]=c?c.replace(u[1],u[2]):n:this[u[0]]=c?u[1].call(this,c,u[2]):n:4===u.length&&(this[u[0]]=c?u[3].call(this,c.replace(u[1],u[2])):n):this[u]=c||n;d+=2}},H=function(e,i){for(var t in i)if(typeof i[t]===a&&i[t].length>0){for(var r=0;r<i[t].length;r++)if(D(i[t][r],e))return"?"===t?n:t}else if(D(i[t],e))return"?"===t?n:t;return e},F={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"},W={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[l,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[l,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[l,p],[/opios[\/ ]+([\w\.]+)/i],[p,[l,N+" Mini"]],[/\bopr\/([\w\.]+)/i],[p,[l,N]],[/(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|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[l,p],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[l,"UC"+P]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[p,[l,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[p,[l,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[l,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[l,"IE"]],[/yabrowser\/([\w\.]+)/i],[p,[l,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[l,/(.+)/,"$1 Secure "+P],p],[/\bfocus\/([\w\.]+)/i],[p,[l,T+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[l,N+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[l,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[l,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[l,N+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[l,"MIUI "+P]],[/fxios\/([-\w\.]+)/i],[p,[l,T]],[/\bqihu|(qi?ho?o?|360)browser/i],[[l,"360 "+P]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[l,/(.+)/,"$1 "+P],p],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[l,p],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[l],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[l,C],p],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[l,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[l,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[l,A+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[l,A+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[l,"Android "+P]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[l,p],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[p,[l,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[p,l],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[l,[p,H,{"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],[l,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[l,"Netscape"],p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[l,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],[l,p],[/(cobalt)\/([\w\.]+)/i],[l,[p,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[b,"amd64"]],[/(ia32(?=;))/i],[[b,G]],[/((?:i[346]|x)86)[;\)]/i],[[b,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[b,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[b,"armhf"]],[/windows (ce|mobile); ppc;/i],[[b,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[b,/ower/,"",G]],[/(sun4\w)[;\)]/i],[[b,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[b,G]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[d,j],[c,m]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[d,j],[c,f]],[/((ipod|iphone)\d+,\d+)/i],[u,[d,x],[c,f]],[/(ipad\d+,\d+)/i],[u,[d,x],[c,m]],[/\((ip(?:hone|od)[\w ]*);/i],[u,[d,x],[c,f]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[d,x],[c,m]],[/(macintosh);/i],[u,[d,x]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[d,q],[c,m]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[d,q],[c,f]],[/\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,R],[c,f]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[d,R],[c,m]],[/; (\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"],[c,f]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[d,"Vivo"],[c,f]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[u,[d,"Realme"],[c,f]],[/\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,O],[c,f]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[d,O],[c,m]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[d,S],[c,m]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[d,S],[c,f]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[d,"Lenovo"],[c,m]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[d,"Nokia"],[c,f]],[/(pixel c)\b/i],[u,[d,I],[c,m]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[d,I],[c,f]],[/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,M],[c,f]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[d,M],[c,m]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[d,"OnePlus"],[c,f]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[d,y],[c,m]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[d,y],[c,f]],[/(playbook);[-\w\),; ]+(rim)/i],[u,d,[c,m]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[d,_],[c,f]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[d,k],[c,m]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[d,k],[c,f]],[/(nexus 9)/i],[u,[d,"HTC"],[c,m]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[u,/_/g," "],[c,f]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[d,"Acer"],[c,m]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[d,"Meizu"],[c,f]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[d,z],[c,f]],[/(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,[c,f]],[/(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,[c,m]],[/(surface duo)/i],[u,[d,E],[c,m]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[d,"Fairphone"],[c,f]],[/(u304aa)/i],[u,[d,"AT&T"],[c,f]],[/\bsie-(\w*)/i],[u,[d,"Siemens"],[c,f]],[/\b(rct\w+) b/i],[u,[d,"RCA"],[c,m]],[/\b(venue[\d ]{2,7}) b/i],[u,[d,"Dell"],[c,m]],[/\b(q(?:mv|ta)\w+) b/i],[u,[d,"Verizon"],[c,m]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[d,"Barnes & Noble"],[c,m]],[/\b(tm\d{3}\w+) b/i],[u,[d,"NuVision"],[c,m]],[/\b(k88) b/i],[u,[d,"ZTE"],[c,m]],[/\b(nx\d{3}j) b/i],[u,[d,"ZTE"],[c,f]],[/\b(gen\d{3}) b.+49h/i],[u,[d,"Swiss"],[c,f]],[/\b(zur\d{3}) b/i],[u,[d,"Swiss"],[c,m]],[/\b((zeki)?tb.*\b) b/i],[u,[d,"Zeki"],[c,m]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],u,[c,m]],[/\b(ns-?\w{0,9}) b/i],[u,[d,"Insignia"],[c,m]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[d,"NextBook"],[c,m]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],u,[c,f]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],u,[c,f]],[/\b(ph-1) /i],[u,[d,"Essential"],[c,f]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[d,"Envizen"],[c,m]],[/\b(trio[-\w\. ]+) b/i],[u,[d,"MachSpeed"],[c,m]],[/\btu_(1491) b/i],[u,[d,"Rotor"],[c,m]],[/(shield[\w ]+) b/i],[u,[d,"Nvidia"],[c,m]],[/(sprint) (\w+)/i],[d,u,[c,f]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[d,E],[c,f]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[d,U],[c,m]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[d,U],[c,f]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,u,[c,w]],[/droid.+; (shield) bui/i],[u,[d,"Nvidia"],[c,w]],[/(playstation [345portablevi]+)/i],[u,[d,M],[c,w]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[d,E],[c,w]],[/smart-tv.+(samsung)/i],[d,[c,v]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[d,j],[c,v]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,S],[c,v]],[/(apple) ?tv/i],[d,[u,x+" TV"],[c,v]],[/crkey/i],[[u,A+"cast"],[d,I],[c,v]],[/droid.+aft(\w)( bui|\))/i],[u,[d,y],[c,v]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[d,z],[c,v]],[/(bravia[\w ]+)( bui|\))/i],[u,[d,M],[c,v]],[/(mitv-\w{5}) bui/i],[u,[d,R],[c,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[d,B],[u,B],[c,v]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[c,v]],[/((pebble))app/i],[d,u,[c,h]],[/droid.+; (glass) \d/i],[u,[d,I],[c,h]],[/droid.+; (wt63?0{2,3})\)/i],[u,[d,U],[c,h]],[/(quest( 2)?)/i],[u,[d,C],[c,h]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[c,g]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[u,[c,f]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[c,m]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[c,m]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[c,f]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[l,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[l,"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],[l,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,l]],os:[[/microsoft (windows) (vista|xp)/i],[l,p],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[l,[p,H,F]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[l,"Windows"],[p,H,F]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[l,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[l,"Mac OS"],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[p,l],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[l,p],[/\(bb(10);/i],[p,[l,_]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[l,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[l,T+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[l,"webOS"]],[/crkey\/([\d\.]+)/i],[p,[l,A+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[l,"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],[l,p],[/(sunos) ?([\w\.\d]*)/i],[[l,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[l,p]]},Z=function(e,i){if(typeof e===a&&(i=e,e=n),!(this instanceof Z))return new Z(e,i).getResult();var r=e||(typeof t!==o&&t.navigator&&t.navigator.userAgent?t.navigator.userAgent:""),w=i?function(e,i){var t={};for(var n in e)i[n]&&i[n].length%2==0?t[n]=i[n].concat(e[n]):t[n]=e[n];return t}(W,i):W;return this.getBrowser=function(){var e,i={};return i[l]=n,i[p]=n,L.call(i,r,w.browser),i.major=typeof(e=i.version)===s?e.replace(/[^\d\.]/g,"").split(".")[0]:n,i},this.getCPU=function(){var e={};return e[b]=n,L.call(e,r,w.cpu),e},this.getDevice=function(){var e={};return e[d]=n,e[u]=n,e[c]=n,L.call(e,r,w.device),e},this.getEngine=function(){var e={};return e[l]=n,e[p]=n,L.call(e,r,w.engine),e},this.getOS=function(){var e={};return e[l]=n,e[p]=n,L.call(e,r,w.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===s&&e.length>350?B(e,350):e,this},this.setUA(r),this};Z.VERSION="0.7.33",Z.BROWSER=V([l,p,"major"]),Z.CPU=V([b]),Z.DEVICE=V([u,d,c,w,f,v,m,h,g]),Z.ENGINE=Z.OS=V([l,p]),e.exports&&(i=e.exports=Z),i.UAParser=Z;var Q=typeof t!==o&&(t.jQuery||t.Zepto);if(Q&&!Q.ua){var X=new Z;Q.ua=X.getResult(),Q.ua.get=function(){return X.getUA()},Q.ua.set=function(e){X.setUA(e);var i=X.getResult();for(var t in i)Q.ua[t]=i[t]}}}("object"==typeof window?window:o)}(a,a.exports);var s=a.exports,u=function(e){var t=this;void 0===e&&(e={});var o,a=e.osName,u=void 0===a||a,l=e.osVersion,c=void 0===l||l,d=e.deviceManufacturer,p=void 0===d||d,b=e.deviceModel,w=void 0===b||b;return{name:"@amplitude/plugin-user-agent-enrichment-browser",type:"enrichment",setup:function(e){return n(this,void 0,void 0,(function(){var i;return r(this,(function(t){return"undefined"!=typeof navigator&&(i=navigator.userAgent),o=new s(i).getResult(),e.loggerProvider.log("Installing @amplitude/plugin-user-agent-enrichment-browser."),[2]}))}))},execute:function(e){return n(t,void 0,void 0,(function(){var t,n,a,s;return r(this,(function(r){return t=o.browser.name,n=o.browser.version,a=o.device.model||o.os.name,s=o.device.vendor,[2,i(i(i(i(i({},e),u&&{os_name:t}),c&&{os_version:n}),p&&{device_manufacturer:s}),w&&{device_model:a})]}))}))}}};return e.plugin=u,e.userAgentEnrichmentPlugin=u,Object.defineProperty(e,"__esModule",{value:!0}),e}({});!function(e,i){const t=e.amplitudeGTM;if(t&&"function"==typeof t.init){var o=["init","track","identify","setGroup","groupIdentify","revenue","flush","getUserId","setUserId","getSessionId","setSessionId","setDeviceId","getDeviceId","reset","setOptOut","setTransport"],a=["add","append","clearAll","prepend","set","setOnce","remove","preInsert","postInsert"],s=function(e,i,n){if(i=i.shift(),Array.isArray(i)&&0!==i.length){var r=new t.Identify;if(i.forEach((function(e){if(Array.isArray(e)){var i=e.shift();-1!==a.indexOf(i)&&r[i].apply(r,e)}})),!0===n)return r;e.identify(r)}},u=function(e,i){if(!(i.length<3)&&"string"==typeof i[0]&&"string"==typeof i[1]&&Array.isArray(i[2])&&0!==i[2].length){var t=s(e,[i[2]],!0);e.groupIdentify(i[0],i[1],t)}},l=function(e,i){if((i=i.shift()).price&&i.productId){var n=(new t.Revenue).setProductId(i.productId).setQuantity(i.quantity||1).setPrice(i.price).setRevenueType(i.revenueType||"").setEventProperties(i.eventProperties||{}).setRevenue(i.revenue||i.price*(i.quantity||1));e.revenue(n)}},c=function(e,i){const t=i[i.length-1],o=t.userAgentEnrichmentOptions,a=t.pageViewLegacy;o&&e.add(r.userAgentEnrichmentPlugin(o)),a&&e.add(n.pageViewV1EnrichmentPlugin());let s=e.init(...i).promise;return s.then((()=>e.add({name:"gtm-library-enrichment",type:"enrichment",setup:async()=>{},execute:async e=>(e.library="amplitude-ts-gtm/3.5.0",e)}))),s};e[i]=e[i]||function(){var e=[].slice.call(arguments,0),i=e.shift(),n=i?t._iq[i]:t;n||(n=t.createInstance(i));var r=e.shift();if(-1!==o.indexOf(r))return"revenue"===r?l(n,e):"identify"===r?s(n,e):"groupIdentify"===r?u(n,e):"init"===r?c(n,e):n[r].apply(this,e)}}}(window,"_amplitude")})(0,0,e)})();
{
"name": "@amplitude/amplitude-js-gtm",
"version": "3.4.0",
"version": "3.5.0",
"description": "Amplitude JS SDK Wrapper for use with Google Tag Manager",

@@ -24,5 +24,2 @@ "main": "dist/index.js",

"homepage": "https://github.com/amplitude/amplitude-js-gtm#readme",
"dependencies": {
"@amplitude/plugin-user-agent-enrichment-browser": "^1.0.0"
},
"devDependencies": {

@@ -29,0 +26,0 @@ "@amplitude/eslint-plugin-amplitude": "^1.0.1",

@@ -7,2 +7,10 @@ import { version } from '../package.json';

/* Amplitude Page View V1 Enrichment Plugin begin */
var amplitudePageViewV1EnrichmentPlugin=function(e){"use strict";var t=function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)};function n(e,t,n,r){return new(n||(n=Promise))((function(i,o){function u(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}l((r=r.apply(e,t||[])).next())}))}function r(e,t){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[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(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(u=0)),u;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(i=u.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){u.label=a[1];break}if(6===a[0]&&u.label<i[1]){u.label=i[1],i=a;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(a);break}i[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}var i=function(){var e=this;return{name:"@amplitude/plugin-page-view-v1-enrichment-browser",type:"enrichment",setup:function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){return e.loggerProvider.log("Installing @amplitude/plugin-page-view-v1-enrichment-browser."),[2]}))}))},execute:function(i){return n(e,void 0,void 0,(function(){var e,n,o,u,a,l;return r(this,(function(r){return"[Amplitude] Page Viewed"==i.event_type&&(e=i.event_properties||{},n=e["[Amplitude] Page Domain"],o=e["[Amplitude] Page Location"],u=e["[Amplitude] Page Path"],a=e["[Amplitude] Page Title"],l=e["[Amplitude] Page URL"],(i=t(t({},i),{event_type:"Page View",event_properties:t(t({},i.event_properties),{page_domain:null!=n?n:"",page_location:null!=o?o:"",page_path:null!=u?u:"",page_title:null!=a?a:"",page_url:null!=l?l:""})})).event_properties&&(delete i.event_properties["[Amplitude] Page Domain"],delete i.event_properties["[Amplitude] Page Location"],delete i.event_properties["[Amplitude] Page Path"],delete i.event_properties["[Amplitude] Page Title"],delete i.event_properties["[Amplitude] Page URL"])),[2,i]}))}))}}};return e.pageViewV1EnrichmentPlugin=i,e.plugin=i,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
/* Amplitude Page View V1 Enrichment Plugin end */
/* Amplitude User Agent Enrichment Plugin begin */
var amplitudeUserAgentEnrichmentPlugin=function(i){"use strict";var e=function(){return e=Object.assign||function(i){for(var e,o=1,r=arguments.length;o<r;o++)for(var n in e=arguments[o])Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n]);return i},e.apply(this,arguments)};function o(i,e,o,r){return new(o||(o=Promise))((function(n,a){function t(i){try{b(r.next(i))}catch(i){a(i)}}function s(i){try{b(r.throw(i))}catch(i){a(i)}}function b(i){var e;i.done?n(i.value):(e=i.value,e instanceof o?e:new o((function(i){i(e)}))).then(t,s)}b((r=r.apply(i,e||[])).next())}))}function r(i,e){var o,r,n,a,t={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(b){return function(s){if(o)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(t=0)),t;)try{if(o=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return t.label++,{value:s[1],done:!1};case 5:t.label++,r=s[1],s=[0];continue;case 7:s=t.ops.pop(),t.trys.pop();continue;default:if(!(n=t.trys,(n=n.length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){t=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){t.label=s[1];break}if(6===s[0]&&t.label<n[1]){t.label=n[1],n=s;break}if(n&&t.label<n[2]){t.label=n[2],t.ops.push(s);break}n[2]&&t.ops.pop(),t.trys.pop();continue}s=e.call(i,t)}catch(i){s=[6,i],r=0}finally{o=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,b])}}}var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},a={exports:{}};!function(i,e){!function(o,r){var n="function",a="undefined",t="object",s="string",b="model",l="name",w="type",u="vendor",d="version",c="architecture",p="console",m="mobile",f="tablet",h="smarttv",v="wearable",g="embedded",x="Amazon",k="Apple",y="ASUS",_="BlackBerry",T="Browser",S="Chrome",q="Firefox",N="Google",z="Huawei",A="LG",E="Microsoft",O="Motorola",j="Opera",C="Samsung",P="Sharp",U="Sony",M="Xiaomi",R="Zebra",V="Facebook",B=function(i){for(var e={},o=0;o<i.length;o++)e[i[o].toUpperCase()]=i[o];return e},I=function(i,e){return typeof i===s&&-1!==D(e).indexOf(D(i))},D=function(i){return i.toLowerCase()},G=function(i,e){if(typeof i===s)return i=i.replace(/^\s\s*/,""),typeof e===a?i:i.substring(0,350)},W=function(i,e){for(var o,a,s,b,l,w,u=0;u<e.length&&!l;){var d=e[u],c=e[u+1];for(o=a=0;o<d.length&&!l;)if(l=d[o++].exec(i))for(s=0;s<c.length;s++)w=l[++a],typeof(b=c[s])===t&&b.length>0?2===b.length?typeof b[1]==n?this[b[0]]=b[1].call(this,w):this[b[0]]=b[1]:3===b.length?typeof b[1]!==n||b[1].exec&&b[1].test?this[b[0]]=w?w.replace(b[1],b[2]):r:this[b[0]]=w?b[1].call(this,w,b[2]):r:4===b.length&&(this[b[0]]=w?b[3].call(this,w.replace(b[1],b[2])):r):this[b]=w||r;u+=2}},F=function(i,e){for(var o in e)if(typeof e[o]===t&&e[o].length>0){for(var n=0;n<e[o].length;n++)if(I(e[o][n],i))return"?"===o?r:o}else if(I(e[o],i))return"?"===o?r:o;return i},L={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"},Z={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[d,[l,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[d,[l,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[l,d],[/opios[\/ ]+([\w\.]+)/i],[d,[l,j+" Mini"]],[/\bopr\/([\w\.]+)/i],[d,[l,j]],[/(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|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[l,d],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[d,[l,"UC"+T]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[d,[l,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[d,[l,"WeChat"]],[/konqueror\/([\w\.]+)/i],[d,[l,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[d,[l,"IE"]],[/yabrowser\/([\w\.]+)/i],[d,[l,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[l,/(.+)/,"$1 Secure "+T],d],[/\bfocus\/([\w\.]+)/i],[d,[l,q+" Focus"]],[/\bopt\/([\w\.]+)/i],[d,[l,j+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[d,[l,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[d,[l,"Dolphin"]],[/coast\/([\w\.]+)/i],[d,[l,j+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[d,[l,"MIUI "+T]],[/fxios\/([-\w\.]+)/i],[d,[l,q]],[/\bqihu|(qi?ho?o?|360)browser/i],[[l,"360 "+T]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[l,/(.+)/,"$1 "+T],d],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],d],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[l,d],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[l],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[l,V],d],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[l,d],[/\bgsa\/([\w\.]+) .*safari\//i],[d,[l,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[d,[l,S+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[l,S+" WebView"],d],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[d,[l,"Android "+T]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[l,d],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[d,[l,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[d,l],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[l,[d,F,{"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],[l,d],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[l,"Netscape"],d],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[d,[l,q+" 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],[l,d],[/(cobalt)\/([\w\.]+)/i],[l,[d,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[c,"amd64"]],[/(ia32(?=;))/i],[[c,D]],[/((?:i[346]|x)86)[;\)]/i],[[c,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[c,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[c,"armhf"]],[/windows (ce|mobile); ppc;/i],[[c,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[c,/ower/,"",D]],[/(sun4\w)[;\)]/i],[[c,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[c,D]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[b,[u,C],[w,f]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[b,[u,C],[w,m]],[/((ipod|iphone)\d+,\d+)/i],[b,[u,k],[w,m]],[/(ipad\d+,\d+)/i],[b,[u,k],[w,f]],[/\((ip(?:hone|od)[\w ]*);/i],[b,[u,k],[w,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[b,[u,k],[w,f]],[/(macintosh);/i],[b,[u,k]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[b,[u,z],[w,f]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[b,[u,z],[w,m]],[/\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],[[b,/_/g," "],[u,M],[w,m]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[b,/_/g," "],[u,M],[w,f]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[b,[u,"OPPO"],[w,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[b,[u,"Vivo"],[w,m]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[b,[u,"Realme"],[w,m]],[/\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],[b,[u,O],[w,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[b,[u,O],[w,f]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[b,[u,A],[w,f]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[b,[u,A],[w,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[b,[u,"Lenovo"],[w,f]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[b,/_/g," "],[u,"Nokia"],[w,m]],[/(pixel c)\b/i],[b,[u,N],[w,f]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[b,[u,N],[w,m]],[/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],[b,[u,U],[w,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[b,"Xperia Tablet"],[u,U],[w,f]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[b,[u,"OnePlus"],[w,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[b,[u,x],[w,f]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[b,/(.+)/g,"Fire Phone $1"],[u,x],[w,m]],[/(playbook);[-\w\),; ]+(rim)/i],[b,u,[w,f]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[b,[u,_],[w,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[b,[u,y],[w,f]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[b,[u,y],[w,m]],[/(nexus 9)/i],[b,[u,"HTC"],[w,f]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[u,[b,/_/g," "],[w,m]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[b,[u,"Acer"],[w,f]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[b,[u,"Meizu"],[w,m]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[b,[u,P],[w,m]],[/(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],[u,b,[w,m]],[/(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],[u,b,[w,f]],[/(surface duo)/i],[b,[u,E],[w,f]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[b,[u,"Fairphone"],[w,m]],[/(u304aa)/i],[b,[u,"AT&T"],[w,m]],[/\bsie-(\w*)/i],[b,[u,"Siemens"],[w,m]],[/\b(rct\w+) b/i],[b,[u,"RCA"],[w,f]],[/\b(venue[\d ]{2,7}) b/i],[b,[u,"Dell"],[w,f]],[/\b(q(?:mv|ta)\w+) b/i],[b,[u,"Verizon"],[w,f]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[b,[u,"Barnes & Noble"],[w,f]],[/\b(tm\d{3}\w+) b/i],[b,[u,"NuVision"],[w,f]],[/\b(k88) b/i],[b,[u,"ZTE"],[w,f]],[/\b(nx\d{3}j) b/i],[b,[u,"ZTE"],[w,m]],[/\b(gen\d{3}) b.+49h/i],[b,[u,"Swiss"],[w,m]],[/\b(zur\d{3}) b/i],[b,[u,"Swiss"],[w,f]],[/\b((zeki)?tb.*\b) b/i],[b,[u,"Zeki"],[w,f]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[u,"Dragon Touch"],b,[w,f]],[/\b(ns-?\w{0,9}) b/i],[b,[u,"Insignia"],[w,f]],[/\b((nxa|next)-?\w{0,9}) b/i],[b,[u,"NextBook"],[w,f]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[u,"Voice"],b,[w,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[u,"LvTel"],b,[w,m]],[/\b(ph-1) /i],[b,[u,"Essential"],[w,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[b,[u,"Envizen"],[w,f]],[/\b(trio[-\w\. ]+) b/i],[b,[u,"MachSpeed"],[w,f]],[/\btu_(1491) b/i],[b,[u,"Rotor"],[w,f]],[/(shield[\w ]+) b/i],[b,[u,"Nvidia"],[w,f]],[/(sprint) (\w+)/i],[u,b,[w,m]],[/(kin\.[onetw]{3})/i],[[b,/\./g," "],[u,E],[w,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[b,[u,R],[w,f]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[b,[u,R],[w,m]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[u,b,[w,p]],[/droid.+; (shield) bui/i],[b,[u,"Nvidia"],[w,p]],[/(playstation [345portablevi]+)/i],[b,[u,U],[w,p]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[b,[u,E],[w,p]],[/smart-tv.+(samsung)/i],[u,[w,h]],[/hbbtv.+maple;(\d+)/i],[[b,/^/,"SmartTV"],[u,C],[w,h]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[u,A],[w,h]],[/(apple) ?tv/i],[u,[b,k+" TV"],[w,h]],[/crkey/i],[[b,S+"cast"],[u,N],[w,h]],[/droid.+aft(\w)( bui|\))/i],[b,[u,x],[w,h]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[b,[u,P],[w,h]],[/(bravia[\w ]+)( bui|\))/i],[b,[u,U],[w,h]],[/(mitv-\w{5}) bui/i],[b,[u,M],[w,h]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[u,G],[b,G],[w,h]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[w,h]],[/((pebble))app/i],[u,b,[w,v]],[/droid.+; (glass) \d/i],[b,[u,N],[w,v]],[/droid.+; (wt63?0{2,3})\)/i],[b,[u,R],[w,v]],[/(quest( 2)?)/i],[b,[u,V],[w,v]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[u,[w,g]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[b,[w,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[b,[w,f]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[w,f]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[w,m]],[/(android[-\w\. ]{0,9});.+buil/i],[b,[u,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[d,[l,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[d,[l,"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],[l,d],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[d,l]],os:[[/microsoft (windows) (vista|xp)/i],[l,d],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[l,[d,F,L]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[l,"Windows"],[d,F,L]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[d,/_/g,"."],[l,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[l,"Mac OS"],[d,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[d,l],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[l,d],[/\(bb(10);/i],[d,[l,_]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[d,[l,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[d,[l,q+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[d,[l,"webOS"]],[/crkey\/([\d\.]+)/i],[d,[l,S+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[l,"Chromium OS"],d],[/(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],[l,d],[/(sunos) ?([\w\.\d]*)/i],[[l,"Solaris"],d],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[l,d]]},H=function(i,e){if(typeof i===t&&(e=i,i=r),!(this instanceof H))return new H(i,e).getResult();var n=i||(typeof o!==a&&o.navigator&&o.navigator.userAgent?o.navigator.userAgent:""),p=e?function(i,e){var o={};for(var r in i)e[r]&&e[r].length%2==0?o[r]=e[r].concat(i[r]):o[r]=i[r];return o}(Z,e):Z;return this.getBrowser=function(){var i,e={};return e[l]=r,e[d]=r,W.call(e,n,p.browser),e.major=typeof(i=e.version)===s?i.replace(/[^\d\.]/g,"").split(".")[0]:r,e},this.getCPU=function(){var i={};return i[c]=r,W.call(i,n,p.cpu),i},this.getDevice=function(){var i={};return i[u]=r,i[b]=r,i[w]=r,W.call(i,n,p.device),i},this.getEngine=function(){var i={};return i[l]=r,i[d]=r,W.call(i,n,p.engine),i},this.getOS=function(){var i={};return i[l]=r,i[d]=r,W.call(i,n,p.os),i},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 n},this.setUA=function(i){return n=typeof i===s&&i.length>350?G(i,350):i,this},this.setUA(n),this};H.VERSION="0.7.33",H.BROWSER=B([l,d,"major"]),H.CPU=B([c]),H.DEVICE=B([b,u,w,p,m,h,f,v,g]),H.ENGINE=H.OS=B([l,d]),i.exports&&(e=i.exports=H),e.UAParser=H;var $=typeof o!==a&&(o.jQuery||o.Zepto);if($&&!$.ua){var X=new H;$.ua=X.getResult(),$.ua.get=function(){return X.getUA()},$.ua.set=function(i){X.setUA(i);var e=X.getResult();for(var o in e)$.ua[o]=e[o]}}}("object"==typeof window?window:n)}(a,a.exports);var t=a.exports,s=function(i){var n=this;void 0===i&&(i={});var a,s=i.osName,b=void 0===s||s,l=i.osVersion,w=void 0===l||l,u=i.deviceManufacturer,d=void 0===u||u,c=i.deviceModel,p=void 0===c||c;return{name:"@amplitude/plugin-user-agent-enrichment-browser",type:"enrichment",setup:function(i){return o(this,void 0,void 0,(function(){var e;return r(this,(function(o){return"undefined"!=typeof navigator&&(e=navigator.userAgent),a=new t(e).getResult(),i.loggerProvider.log("Installing @amplitude/plugin-user-agent-enrichment-browser."),[2]}))}))},execute:function(i){return o(n,void 0,void 0,(function(){var o,n,t,s;return r(this,(function(r){return o=a.browser.name,n=a.browser.version,t=a.device.model||a.os.name,s=a.device.vendor,[2,e(e(e(e(e({},i),b&&{os_name:o}),w&&{os_version:n}),d&&{device_manufacturer:s}),p&&{device_model:t})]}))}))}}};return i.plugin=s,i.userAgentEnrichmentPlugin=s,Object.defineProperty(i,"__esModule",{value:!0}),i}({});
/* Amplitude User Agent Enrichment Plugin end */
/* Amplitude Wrapper begin */

@@ -147,39 +155,16 @@ (function(a,p) {

var pageViewPlugin = () => {
return {
name: 'page-view-plugin',
type: 'enrichment',
setup: async () => undefined,
execute: async (event) => {
if (event.event_type == '[Amplitude] Page Viewed') {
event.event_type = 'Page View';
event.event_properties.page_domain = event.event_properties['[Amplitude] Page Domain'];
event.event_properties.page_location = event.event_properties['[Amplitude] Page Location'];
event.event_properties.page_path = event.event_properties['[Amplitude] Page Path'];
event.event_properties.page_title = event.event_properties['[Amplitude] Page Title'];
event.event_properties.page_url = event.event_properties['[Amplitude] Page URL'];
delete event.event_properties['[Amplitude] Page Domain'];
delete event.event_properties['[Amplitude] Page Location'];
delete event.event_properties['[Amplitude] Page Path'];
delete event.event_properties['[Amplitude] Page Title'];
delete event.event_properties['[Amplitude] Page URL'];
}
return event;
},
};
}
var init = function(client, args) {
const argsLength = args.length;
const configuration = args[argsLength - 1];
const configuration = args[argsLength - 1];
const userAgentEnrichmentOptions = configuration['userAgentEnrichmentOptions'];
const pageViewLegacy = configuration['pageViewLegacy'];
if (userAgentEnrichment) {
client.add(userAgentEnrichmentPlugin(userAgentEnrichmentOptions));
if (userAgentEnrichmentOptions) {
client.add(amplitudeUserAgentEnrichmentPlugin.userAgentEnrichmentPlugin(userAgentEnrichmentOptions));
}
if (pageViewLegacy) {
client.add(pageViewPlugin())
client.add(amplitudePageViewV1EnrichmentPlugin.pageViewV1EnrichmentPlugin())
}
// as plugin order cannot be adjusted, init first then add library plugin to overwrite the library value

@@ -186,0 +171,0 @@ let promise = client.init(...args).promise;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc