UNPKG

autochart-tracker

Version:

JavaScript API for tracking visitor activities on automotive websites with Autochart.io

1 lines 33.7 kB
!function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=19)}([function(t,e,n){function r(t){return null==t?void 0===t?s:a:u&&u in Object(t)?i(t):c(t)}var o=n(8),i=n(28),c=n(29),a="[object Null]",s="[object Undefined]",u=o?o.toStringTag:void 0;t.exports=r},function(t,e){function n(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}t.exports=n},function(t,e){function n(t){return null!=t&&"object"==typeof t}t.exports=n},function(t,e,n){function r(t){return null!=t&&i(t.length)&&!o(t)}var o=n(7),i=n(12);t.exports=r},function(t,e,n){var r=n(9),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},function(t,e,n){function r(t,e,n){"__proto__"==e&&o?o(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var o=n(6);t.exports=r},function(t,e,n){var r=n(25),o=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},function(t,e,n){function r(t){if(!i(t))return!1;var e=o(t);return e==a||e==s||e==c||e==u}var o=n(0),i=n(1),c="[object AsyncFunction]",a="[object Function]",s="[object GeneratorFunction]",u="[object Proxy]";t.exports=r},function(t,e,n){var r=n(4),o=r.Symbol;t.exports=o},function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(e,n(27))},function(t,e){function n(t,e){return t===e||t!==t&&e!==e}t.exports=n},function(t,e){function n(t){return t}t.exports=n},function(t,e){function n(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=r}var r=9007199254740991;t.exports=n},function(t,e){function n(t,e){return!!(e=null==e?r:e)&&("number"==typeof t||o.test(t))&&t>-1&&t%1==0&&t<e}var r=9007199254740991,o=/^(?:0|[1-9]\d*)$/;t.exports=n},function(t,e,n){function r(t,e){var n=c(t),r=!n&&i(t),f=!n&&!r&&a(t),p=!n&&!r&&!f&&u(t),d=n||r||f||p,h=d?o(t.length,String):[],g=h.length;for(var m in t)!e&&!l.call(t,m)||d&&("length"==m||f&&("offset"==m||"parent"==m)||p&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||s(m,g))||h.push(m);return h}var o=n(44),i=n(45),c=n(15),a=n(47),s=n(13),u=n(49),f=Object.prototype,l=f.hasOwnProperty;t.exports=r},function(t,e){var n=Array.isArray;t.exports=n},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){function n(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||r)}var r=Object.prototype;t.exports=n},function(t,e,n){"use strict";function r(t,e){i&&(console.log("[autochart] "+t),e&&console.dir&&console.dir(e))}function o(t){var e=t||window.event;return e.preventDefault?e.preventDefault():(e.returnValue=!1,e.returnValue)}Object.defineProperty(e,"__esModule",{value:!0});var i=console&&localStorage&&localStorage.getItem&&localStorage.getItem("autochartLogging");e.default={log:r,error:function(t){i&&console.error("[autochart] "+t)},prevent:o,isFunction:function(t){return"function"==typeof t},callAsync:function(t,e){"function"==typeof t&&(r("Calling func in "+(e||0)+"ms..."),e?setTimeout(t,e):setTimeout(t,0))},getQueryParameters:function(){return document.location.search?document.location.search.replace(/(^\?)/,"").split("&").map(function(t){return t=t.split("="),this[t[0]]=t[1],this}.bind({}))[0]:{}},aspnet:{beforePostbackAsync:function(t,e){if(!e)return void r("No handler defined for beforePostbackAsync");var n=void 0;if("function"==typeof window.WebForm_DoPostBackWithOptions){var i=t?document.getElementById(t.replace(/\\\$/,"_")):null;i&&i.getAttribute("onclick")&&(r("Appending to onclick attribute for "+t),i.setAttribute("onclick",i.getAttribute("onclick").replace(/\)$/,",event)"))),n=window.WebForm_DoPostBackWithOptions,window.WebForm_DoPostBackWithOptions=function(i,c){return i=i||{},r("Calling wrapped WebForm_DoPostBackWithOptions..."),!i.eventTarget||t&&!new RegExp(t+"$").test(i.eventTarget)?(r("Postback triggered by unwatched control. Just doing standard postback..."),n(i)):(r("Intercepting postback, first checking if validation needs performed..."),i.validation&&"function"==typeof window.Page_ClientValidate&&window.Page_ClientValidate(i.validationGroup),i.validation&&!window.Page_IsValid||(r("Preventing standard postback..."),o(c),r("Invoking custom postback handler..."),e(function(){r("Invoking window.__doPostBack..."),window.__doPostBack&&window.__doPostBack(i.eventTarget,i.eventArgument)}))),!1}}else r("window.WebForm_DoPostBackWithOptions not found.")}}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(20),i=r(o),c=n(18),a=r(c),s=new i.default;if(window){var u=window.autochart||[];for(window.autochart=s,window.autochart.util=a.default;u.length>0;){var f=u.shift(),l=f.shift();s[l]&&s[l].apply(s,function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}(f))}window.AutoChartTracker=i.default}e.default=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(){}Object.defineProperty(e,"__esModule",{value:!0});var i=n(21),c=r(i),a=n(55),s=r(a),u=n(72),f=r(u),l=n(73),p=r(l),d=n(80),h=r(d),g=n(18),m=r(g),v=n(83),b=f.default.disabledAccounts;o.prototype.init=function(t,e,n){if(!t)throw new Error("accountKey must be specified");if("string"!=typeof t||24!==t.length)throw new Error("Invalid account key. It must be a 24 character long string.");e?(this.options=e,m.default.log("Initilised with options: "+JSON.stringify(e))):this.options={},this.timeout=1e3,this.trackingDisabled=!0===window.AUTOCHART_DISABLED||(0,s.default)(b,t),this.trackingDisabled&&m.default.log("Tracking disabled. No events will be sent");var r=n||new h.default(window);this.dispatcher=new p.default(t),this.globalProperties={session:r.session,urlRaw:r.page.url,pageTitle:r.page.title,dayOfWeek:r.page.timestamp&&r.page.timestamp.getDay?r.page.timestamp.getDay():(new Date).getDay(),timestamp:r.page.timestamp||void 0,ac:{clientTrackerLibraryVersion:v.version}},this.globalProperties.session.customerAccountId=t,this.globalProperties.session.userAgentRaw=r.session.userAgentRaw,this.globalProperties.session.ipAddress=r.session.ipAddress,this.page()},o.prototype.page=function(t){return this.trackVisitorAction("PageView",null,null,t)},o.prototype.trackVehicleView=function(t,e,n){return this.trackVisitorAction("VehicleView",{vehicles:[t]},e,n)},o.prototype.trackVehicleAction=function(t,e,n,r){return this.trackVisitorAction("VehicleAction",{vehicles:[t],actionCategory:e},n,r)},o.prototype.trackSearch=function(t,e,n){return this.trackVisitorAction("Search",{searchCriteria:t},e,n)},o.prototype.trackVisitIntent=function(t,e,n){return this.trackVisitorAction("VisitIntent",{intentAction:t},e,n)},o.prototype.tag=function(t,e){if(this.trackingDisabled)return!1;if(this.ensureInit(),!t)throw new Error("tags parameter must be specified");for(var n=t instanceof Array?t:[t.toString()],r=0;r<n.length;r+=1)n[r]=n[r].toString().replace(/[^\w\s-]/gi,"");var o=this.mergeGlobalProps({tags:n});return m.default.log("Tag tracked",t),this.dispatcher.addEvent("VisitorTags",o,e)},o.prototype.trackLead=function(t,e,n){if(this.trackingDisabled)return!1;if(this.ensureInit(),!t)throw new Error("Lead must be specified");var r=this.mergeGlobalProps({channel:t.channel,subject:t.subject,contact:t.contact,message:t.message,vehicle:t.vehicle,recipient:t.recipient},e);return m.default.log("Lead tracked",t),this.dispatcher.addEvent("Leads",r,n)},o.prototype.trackLeadForm=function(t,e,n,r,o){if(this.trackingDisabled)return!1;var i=this;if(i.ensureInit(),!e||!m.default.isFunction(e))throw new Error("A function must be specified to return the lead data when the form is submitted.");if(t){m.default.log("Wiring up submit handler");var c=function(c){if(n&&n(t))return void m.default.log("Validation errors detected. Lead not tracked");m.default.log("Handler fired. Preventing default submit..."),m.default.prevent(c);var a=e();i.trackLead(a,r,o),i.options.preventFormSubmits?m.default.log("Preventing submit of form."):i.callback(function(){t.submit()})},a=window.jQuery||window.Zepto;a?a(t).submit(c):t.addEventListener?t.addEventListener("submit",c,!1):t.attachEvent&&t.attachEvent("onsubmit",c)}return!0},o.prototype.trackLeadFormAspNet=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1],n=arguments[2],r=arguments[3];if(this.trackingDisabled)return!1;var o=this;if(o.ensureInit(),!e||!m.default.isFunction(e))throw new Error("A function must be specified to return the lead data when the form is submitted.");return m.default.aspnet.beforePostbackAsync(t.submitButtonId,function(t){var i=e();o.trackLead(i,n,r),o.callback(function(){t()})}),!0},o.prototype.trackFinance=function(t,e,n,r){if(!t)throw new Error("financeData object must be specified");return this.trackVisitorAction("Finance",{finance:t,vehicles:[e]},n,r)},o.prototype.ready=function(t){t&&m.default.isFunction(t)&&t()},o.prototype.ensureInit=function(){if(!this.globalProperties.session.customerAccountId)throw new Error("init() must be called before calling this method.")},o.prototype.trackVisitorAction=function(t,e,n,r){if(this.trackingDisabled)return!1;this.ensureInit();var o=this.mergeGlobalProps(e||{},n);return o.actionType=t,m.default.log("VisitorAction tracked: "+t,e),this.dispatcher.addEvent("VisitorActions",o,r)},o.prototype.mergeGlobalProps=function(t,e){var n=(0,c.default)({},this.globalProperties,t);return e&&(n.timestamp=t.timestamp),n},o.prototype.callback=function(t){return m.default.callAsync(t,this.timeout||1e3),this},e.default=o},function(t,e,n){t.exports=n(22)},function(t,e,n){var r=n(23),o=n(34),i=n(43),c=o(function(t,e){r(e,i(e),t)});t.exports=c},function(t,e,n){function r(t,e,n,r){var c=!n;n||(n={});for(var a=-1,s=e.length;++a<s;){var u=e[a],f=r?r(n[u],t[u],u,n,t):void 0;void 0===f&&(f=t[u]),c?i(n,u,f):o(n,u,f)}return n}var o=n(24),i=n(5);t.exports=r},function(t,e,n){function r(t,e,n){var r=t[e];a.call(t,e)&&i(r,n)&&(void 0!==n||e in t)||o(t,e,n)}var o=n(5),i=n(10),c=Object.prototype,a=c.hasOwnProperty;t.exports=r},function(t,e,n){function r(t,e){var n=i(t,e);return o(n)?n:void 0}var o=n(26),i=n(33);t.exports=r},function(t,e,n){function r(t){return!(!c(t)||i(t))&&(o(t)?h:u).test(a(t))}var o=n(7),i=n(30),c=n(1),a=n(32),s=/[\\^$.*+?()[\]{}|]/g,u=/^\[object .+?Constructor\]$/,f=Function.prototype,l=Object.prototype,p=f.toString,d=l.hasOwnProperty,h=RegExp("^"+p.call(d).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=r},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){function r(t){var e=c.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(t){}var o=a.call(t);return r&&(e?t[s]=n:delete t[s]),o}var o=n(8),i=Object.prototype,c=i.hasOwnProperty,a=i.toString,s=o?o.toStringTag:void 0;t.exports=r},function(t,e){function n(t){return o.call(t)}var r=Object.prototype,o=r.toString;t.exports=n},function(t,e,n){function r(t){return!!i&&i in t}var o=n(31),i=function(){var t=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();t.exports=r},function(t,e,n){var r=n(4),o=r["__core-js_shared__"];t.exports=o},function(t,e){function n(t){if(null!=t){try{return o.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var r=Function.prototype,o=r.toString;t.exports=n},function(t,e){function n(t,e){return null==t?void 0:t[e]}t.exports=n},function(t,e,n){function r(t){return o(function(e,n){var r=-1,o=n.length,c=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(c=t.length>3&&"function"==typeof c?(o--,c):void 0,a&&i(n[0],n[1],a)&&(c=o<3?void 0:c,o=1),e=Object(e);++r<o;){var s=n[r];s&&t(e,s,r,c)}return e})}var o=n(35),i=n(42);t.exports=r},function(t,e,n){function r(t,e){return c(i(t,e,o),t+"")}var o=n(11),i=n(36),c=n(38);t.exports=r},function(t,e,n){function r(t,e,n){return e=i(void 0===e?t.length-1:e,0),function(){for(var r=arguments,c=-1,a=i(r.length-e,0),s=Array(a);++c<a;)s[c]=r[e+c];c=-1;for(var u=Array(e+1);++c<e;)u[c]=r[c];return u[e]=n(s),o(t,this,u)}}var o=n(37),i=Math.max;t.exports=r},function(t,e){function n(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}t.exports=n},function(t,e,n){var r=n(39),o=n(41),i=o(r);t.exports=i},function(t,e,n){var r=n(40),o=n(6),i=n(11),c=o?function(t,e){return o(t,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:i;t.exports=c},function(t,e){function n(t){return function(){return t}}t.exports=n},function(t,e){function n(t){var e=0,n=0;return function(){var c=i(),a=o-(c-n);if(n=c,a>0){if(++e>=r)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var r=800,o=16,i=Date.now;t.exports=n},function(t,e,n){function r(t,e,n){if(!a(n))return!1;var r=typeof e;return!!("number"==r?i(n)&&c(e,n.length):"string"==r&&e in n)&&o(n[e],t)}var o=n(10),i=n(3),c=n(13),a=n(1);t.exports=r},function(t,e,n){function r(t){return c(t)?o(t,!0):i(t)}var o=n(14),i=n(53),c=n(3);t.exports=r},function(t,e){function n(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}t.exports=n},function(t,e,n){var r=n(46),o=n(2),i=Object.prototype,c=i.hasOwnProperty,a=i.propertyIsEnumerable,s=r(function(){return arguments}())?r:function(t){return o(t)&&c.call(t,"callee")&&!a.call(t,"callee")};t.exports=s},function(t,e,n){function r(t){return i(t)&&o(t)==c}var o=n(0),i=n(2),c="[object Arguments]";t.exports=r},function(t,e,n){(function(t){var r=n(4),o=n(48),i="object"==typeof e&&e&&!e.nodeType&&e,c=i&&"object"==typeof t&&t&&!t.nodeType&&t,a=c&&c.exports===i,s=a?r.Buffer:void 0,u=s?s.isBuffer:void 0,f=u||o;t.exports=f}).call(e,n(16)(t))},function(t,e){function n(){return!1}t.exports=n},function(t,e,n){var r=n(50),o=n(51),i=n(52),c=i&&i.isTypedArray,a=c?o(c):r;t.exports=a},function(t,e,n){function r(t){return c(t)&&i(t.length)&&!!a[o(t)]}var o=n(0),i=n(12),c=n(2),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=r},function(t,e){function n(t){return function(e){return t(e)}}t.exports=n},function(t,e,n){(function(t){var r=n(9),o="object"==typeof e&&e&&!e.nodeType&&e,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,c=i&&i.exports===o,a=c&&r.process,s=function(){try{return a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=s}).call(e,n(16)(t))},function(t,e,n){function r(t){if(!o(t))return c(t);var e=i(t),n=[];for(var r in t)("constructor"!=r||!e&&s.call(t,r))&&n.push(r);return n}var o=n(1),i=n(17),c=n(54),a=Object.prototype,s=a.hasOwnProperty;t.exports=r},function(t,e){function n(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}t.exports=n},function(t,e,n){function r(t,e,n,r){t=i(t)?t:s(t),n=n&&!r?a(n):0;var f=t.length;return n<0&&(n=u(f+n,0)),c(t)?n<=f&&t.indexOf(e,n)>-1:!!f&&o(t,e,n)>-1}var o=n(56),i=n(3),c=n(60),a=n(61),s=n(65),u=Math.max;t.exports=r},function(t,e,n){function r(t,e,n){return e===e?c(t,e,n):o(t,i,n)}var o=n(57),i=n(58),c=n(59);t.exports=r},function(t,e){function n(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1}t.exports=n},function(t,e){function n(t){return t!==t}t.exports=n},function(t,e){function n(t,e,n){for(var r=n-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}t.exports=n},function(t,e,n){function r(t){return"string"==typeof t||!i(t)&&c(t)&&o(t)==a}var o=n(0),i=n(15),c=n(2),a="[object String]";t.exports=r},function(t,e,n){function r(t){var e=o(t),n=e%1;return e===e?n?e-n:e:0}var o=n(62);t.exports=r},function(t,e,n){function r(t){if(!t)return 0===t?t:0;if((t=o(t))===i||t===-i){return(t<0?-1:1)*c}return t===t?t:0}var o=n(63),i=1/0,c=1.7976931348623157e308;t.exports=r},function(t,e,n){function r(t){if("number"==typeof t)return t;if(i(t))return c;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(a,"");var n=u.test(t);return n||f.test(t)?l(t.slice(2),n?2:8):s.test(t)?c:+t}var o=n(1),i=n(64),c=NaN,a=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,f=/^0o[0-7]+$/i,l=parseInt;t.exports=r},function(t,e,n){function r(t){return"symbol"==typeof t||i(t)&&o(t)==c}var o=n(0),i=n(2),c="[object Symbol]";t.exports=r},function(t,e,n){function r(t){return null==t?[]:o(t,i(t))}var o=n(66),i=n(68);t.exports=r},function(t,e,n){function r(t,e){return o(e,function(e){return t[e]})}var o=n(67);t.exports=r},function(t,e){function n(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}t.exports=n},function(t,e,n){function r(t){return c(t)?o(t):i(t)}var o=n(14),i=n(69),c=n(3);t.exports=r},function(t,e,n){function r(t){if(!o(t))return i(t);var e=[];for(var n in Object(t))a.call(t,n)&&"constructor"!=n&&e.push(n);return e}var o=n(17),i=n(70),c=Object.prototype,a=c.hasOwnProperty;t.exports=r},function(t,e,n){var r=n(71),o=r(Object.keys,Object);t.exports=o},function(t,e){function n(t,e){return function(n){return t(e(n))}}t.exports=n},function(t,e,n){"use strict";t.exports={disabledAccounts:["5777e9f16d38af15178611f1","5432a16219e9c0003a3aad36","5513e35c237d77ac23d546f6","5677e9f16d38ef18178633fe"]}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){this.customerAccountId=t,this.options=e||{}}function i(){}function c(t,e,n){return"https://api.autochart.io/tracked-events/"+t+"/"+encodeURIComponent(e)+"?data="+f.default.encode(JSON.stringify(n||{}))}Object.defineProperty(e,"__esModule",{value:!0});var a=n(74),s=r(a),u=n(79),f=r(u);o.prototype.addEvent=function(t,e,n){var r=n||i,o=c(this.customerAccountId,t,e);(0,s.default)(o,{param:"callback",timeout:6e4,prefix:"__jp"},function(t,e){r(t,{created:!0,response:e})})},e.default=o},function(t,e,n){function r(){}function o(t,e,n){function o(){s.parentNode&&s.parentNode.removeChild(s),window[l]=r,u&&clearTimeout(u)}function a(){window[l]&&o()}"function"==typeof e&&(n=e,e={}),e||(e={});var s,u,f=e.prefix||"__jp",l=e.name||f+c++,p=e.param||"callback",d=null!=e.timeout?e.timeout:6e4,h=encodeURIComponent,g=document.getElementsByTagName("script")[0]||document.head;return d&&(u=setTimeout(function(){o(),n&&n(new Error("Timeout"))},d)),window[l]=function(t){i("jsonp got",t),o(),n&&n(null,t)},t+=(~t.indexOf("?")?"&":"?")+p+"="+h(l),t=t.replace("?&","?"),i('jsonp req "%s"',t),s=document.createElement("script"),s.src=t,g.parentNode.insertBefore(s,g),a}var i=n(75)("jsonp");t.exports=o;var c=0},function(t,e,n){(function(r){function o(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function i(t){var n=this.useColors;if(t[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+t[0]+(n?"%c ":" ")+"+"+e.humanize(this.diff),n){var r="color: "+this.color;t.splice(1,0,r,"color: inherit");var o=0,i=0;t[0].replace(/%[a-zA-Z%]/g,function(t){"%%"!==t&&(o++,"%c"===t&&(i=o))}),t.splice(i,0,r)}}function c(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(t){}}function s(){var t;try{t=e.storage.debug}catch(t){}return!t&&void 0!==r&&"env"in r&&(t=r.env.DEBUG),t}e=t.exports=n(77),e.log=c,e.formatArgs=i,e.save=a,e.load=s,e.useColors=o,e.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),e.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],e.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},e.enable(s())}).call(e,n(76))},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(t){if(f===setTimeout)return setTimeout(t,0);if((f===n||!f)&&setTimeout)return f=setTimeout,setTimeout(t,0);try{return f(t,0)}catch(e){try{return f.call(null,t,0)}catch(e){return f.call(this,t,0)}}}function i(t){if(l===clearTimeout)return clearTimeout(t);if((l===r||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(t);try{return l(t)}catch(e){try{return l.call(null,t)}catch(e){return l.call(this,t)}}}function c(){g&&d&&(g=!1,d.length?h=d.concat(h):m=-1,h.length&&a())}function a(){if(!g){var t=o(c);g=!0;for(var e=h.length;e;){for(d=h,h=[];++m<e;)d&&d[m].run();m=-1,e=h.length}d=null,g=!1,i(t)}}function s(t,e){this.fun=t,this.array=e}function u(){}var f,l,p=t.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:n}catch(t){f=n}try{l="function"==typeof clearTimeout?clearTimeout:r}catch(t){l=r}}();var d,h=[],g=!1,m=-1;p.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];h.push(new s(t,e)),1!==h.length||g||o(a)},s.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=u,p.addListener=u,p.once=u,p.off=u,p.removeListener=u,p.removeAllListeners=u,p.emit=u,p.prependListener=u,p.prependOnceListener=u,p.listeners=function(t){return[]},p.binding=function(t){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(t){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},function(t,e,n){function r(t){var n,r=0;for(n in t)r=(r<<5)-r+t.charCodeAt(n),r|=0;return e.colors[Math.abs(r)%e.colors.length]}function o(t){function n(){if(n.enabled){var t=n,r=+new Date,o=r-(u||r);t.diff=o,t.prev=u,t.curr=r,u=r;for(var i=new Array(arguments.length),c=0;c<i.length;c++)i[c]=arguments[c];i[0]=e.coerce(i[0]),"string"!=typeof i[0]&&i.unshift("%O");var a=0;i[0]=i[0].replace(/%([a-zA-Z%])/g,function(n,r){if("%%"===n)return n;a++;var o=e.formatters[r];if("function"==typeof o){var c=i[a];n=o.call(t,c),i.splice(a,1),a--}return n}),e.formatArgs.call(t,i);(n.log||e.log||console.log.bind(console)).apply(t,i)}}return n.namespace=t,n.enabled=e.enabled(t),n.useColors=e.useColors(),n.color=r(t),"function"==typeof e.init&&e.init(n),n}function i(t){e.save(t),e.names=[],e.skips=[];for(var n=("string"==typeof t?t:"").split(/[\s,]+/),r=n.length,o=0;o<r;o++)n[o]&&(t=n[o].replace(/\*/g,".*?"),"-"===t[0]?e.skips.push(new RegExp("^"+t.substr(1)+"$")):e.names.push(new RegExp("^"+t+"$")))}function c(){e.enable("")}function a(t){var n,r;for(n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1}function s(t){return t instanceof Error?t.stack||t.message:t}e=t.exports=o.debug=o.default=o,e.coerce=s,e.disable=c,e.enable=i,e.enabled=a,e.humanize=n(78),e.names=[],e.skips=[],e.formatters={};var u},function(t,e){function n(t){if(t=String(t),!(t.length>100)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*f;case"days":case"day":case"d":return n*u;case"hours":case"hour":case"hrs":case"hr":case"h":return n*s;case"minutes":case"minute":case"mins":case"min":case"m":return n*a;case"seconds":case"second":case"secs":case"sec":case"s":return n*c;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function r(t){return t>=u?Math.round(t/u)+"d":t>=s?Math.round(t/s)+"h":t>=a?Math.round(t/a)+"m":t>=c?Math.round(t/c)+"s":t+"ms"}function o(t){return i(t,u,"day")||i(t,s,"hour")||i(t,a,"minute")||i(t,c,"second")||t+" ms"}function i(t,e,n){if(!(t<e))return t<1.5*e?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}var c=1e3,a=60*c,s=60*a,u=24*s,f=365.25*u;t.exports=function(t,e){e=e||{};var i=typeof t;if("string"===i&&t.length>0)return n(t);if("number"===i&&!1===isNaN(t))return e.long?o(t):r(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},function(t,e,n){"use strict";t.exports={map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(t){var e,n,r,o,i,c,a,s="",u=0,f=this.map;for(t=this.utf8.encode(t);u<t.length;)e=t.charCodeAt(u++),n=t.charCodeAt(u++),r=t.charCodeAt(u++),o=e>>2,i=(3&e)<<4|n>>4,c=isNaN(n)?64:(15&n)<<2|r>>6,a=isNaN(n)||isNaN(r)?64:63&r,s=s+f.charAt(o)+f.charAt(i)+f.charAt(c)+f.charAt(a);return s},decode:function(t){var e,n,r,o,i,c,a,s="",u=0,f=this.map,l=String.fromCharCode;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");u<t.length;)e=f.indexOf(t.charAt(u++)),n=f.indexOf(t.charAt(u++)),r=f.indexOf(t.charAt(u++)),o=f.indexOf(t.charAt(u++)),i=e<<2|n>>4,c=(15&n)<<4|r>>2,a=(3&r)<<6|o,s=s+(l(i)+(64!=r?l(c):""))+(64!=o?l(a):"");return this.utf8.decode(s)},utf8:{encode:function(t){for(var e,n="",r=0,o=String.fromCharCode;r<t.length;)e=t.charCodeAt(r++),n+=e<128?o(e):e>127&&e<2048?o(e>>6|192)+o(63&e|128):o(e>>12|224)+o(e>>6&63|128)+o(63&e|128);return n},decode:function(t){for(var e,n="",r=0,o=String.fromCharCode;r<t.length;)e=t.charCodeAt(r),n+=e<128?[o(e),r++][0]:e>191&&e<224?[o((31&e)<<6|63&t.charCodeAt(r+1)),r+=2][0]:[o((15&e)<<12|(63&t.charCodeAt(r+1))<<6|63&(c3=t.charCodeAt(r+2))),r+=3][0];return n}}}},function(t,e,n){"use strict";function r(t){function e(t){return t?JSON.stringify(t):null}function n(t){if(t)return JSON.parse(t)}function r(){return(new i).toString()}var c=this;c.page={},c.session={};o.defaults={path:"/"};var a=new Date;a.setMinutes(a.getMinutes()+30);var s=n(o.get("ac_session"));s?(o.expire("ac_session"),o.set("ac_session",e(s),{expires:a})):(s={id:r(),startTime:new Date},o.set("ac_session",e(s),{expires:a}));var u=n(o.get("ac_visitor"));u||(u={id:r()},o.set("ac_visitor",e(u),{expires:31536e4})),c.session.visitorId=u.id,c.session.sessionId=s.id,c.session.startTime=s.startTime,c.session.referrerRaw=t.document.referrer,c.session.userAgentRaw=t.navigator.userAgent,c.page.url=t.document.URL,c.page.title=t.document.title}var o=n(81),i=n(82);t.exports=r},function(t,e,n){var r;!function(o,i){"use strict";var c=function(t){if("object"!=typeof t.document)throw new Error("Cookies.js requires a `window` with a `document` object");var e=function(t,n,r){return 1===arguments.length?e.get(t):e.set(t,n,r)};return e._document=t.document,e._cacheKeyPrefix="cookey.",e._maxExpireDate=new Date("Fri, 31 Dec 9999 23:59:59 UTC"),e.defaults={path:"/",secure:!1},e.get=function(t){e._cachedDocumentCookie!==e._document.cookie&&e._renewCache();var n=e._cache[e._cacheKeyPrefix+t];return void 0===n?void 0:decodeURIComponent(n)},e.set=function(t,n,r){return r=e._getExtendedOptions(r),r.expires=e._getExpiresDate(void 0===n?-1:r.expires),e._document.cookie=e._generateCookieString(t,n,r),e},e.expire=function(t,n){return e.set(t,void 0,n)},e._getExtendedOptions=function(t){return{path:t&&t.path||e.defaults.path,domain:t&&t.domain||e.defaults.domain,expires:t&&t.expires||e.defaults.expires,secure:t&&void 0!==t.secure?t.secure:e.defaults.secure}},e._isValidDate=function(t){return"[object Date]"===Object.prototype.toString.call(t)&&!isNaN(t.getTime())},e._getExpiresDate=function(t,n){if(n=n||new Date,"number"==typeof t?t=t===1/0?e._maxExpireDate:new Date(n.getTime()+1e3*t):"string"==typeof t&&(t=new Date(t)),t&&!e._isValidDate(t))throw new Error("`expires` parameter cannot be converted to a valid Date instance");return t},e._generateCookieString=function(t,e,n){t=t.replace(/[^#$&+\^`|]/g,encodeURIComponent),t=t.replace(/\(/g,"%28").replace(/\)/g,"%29"),e=(e+"").replace(/[^!#$&-+\--:<-\[\]-~]/g,encodeURIComponent),n=n||{};var r=t+"="+e;return r+=n.path?";path="+n.path:"",r+=n.domain?";domain="+n.domain:"",r+=n.expires?";expires="+n.expires.toUTCString():"",r+=n.secure?";secure":""},e._getCacheFromString=function(t){for(var n={},r=t?t.split("; "):[],o=0;o<r.length;o++){var i=e._getKeyValuePairFromCookieString(r[o]);void 0===n[e._cacheKeyPrefix+i.key]&&(n[e._cacheKeyPrefix+i.key]=i.value)}return n},e._getKeyValuePairFromCookieString=function(t){var e=t.indexOf("=");e=e<0?t.length:e;var n,r=t.substr(0,e);try{n=decodeURIComponent(r)}catch(t){console&&"function"==typeof console.error&&console.error('Could not decode cookie with key "'+r+'"',t)}return{key:n,value:t.substr(e+1)}},e._renewCache=function(){e._cache=e._getCacheFromString(e._document.cookie),e._cachedDocumentCookie=e._document.cookie},e._areEnabled=function(){var t="1"===e.set("cookies.js",1).get("cookies.js");return e.expire("cookies.js"),t},e.enabled=e._areEnabled(),e},a=o&&"object"==typeof o.document?c(o):c;void 0!==(r=function(){return a}.call(e,n,e,t))&&(t.exports=r)}("undefined"==typeof window?this:window)},function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(){if(!(this instanceof o))return new o(arguments[0],arguments[1],arguments[2],arguments[3]).toString();"object"==r(arguments[0])?(this.timestamp=arguments[0].timestamp,this.machine=arguments[0].machine,this.pid=arguments[0].pid,this.increment=arguments[0].increment):"string"==typeof arguments[0]&&24==arguments[0].length?(this.timestamp=Number("0x"+arguments[0].substr(0,8)),this.machine=Number("0x"+arguments[0].substr(8,6)),this.pid=Number("0x"+arguments[0].substr(14,4)),this.increment=Number("0x"+arguments[0].substr(18,6))):4==arguments.length&&null!=arguments[0]?(this.timestamp=arguments[0],this.machine=arguments[1],this.pid=arguments[2],this.increment=arguments[3]):(this.timestamp=Math.floor((new Date).valueOf()/1e3),this.machine=i,this.pid=n,this.increment=e++,e>16777215&&(e=0))}var e=0,n=Math.floor(32767*Math.random()),i=Math.floor(16777216*Math.random());if("undefined"!=typeof localStorage){var c=parseInt(localStorage.mongoMachineId);c>=0&&c<=16777215&&(i=Math.floor(localStorage.mongoMachineId)),localStorage.mongoMachineId=i,document.cookie="mongoMachineId="+i+";expires=Tue, 19 Jan 2038 05:00:00 GMT"}else{var a=document.cookie.split("; ");for(var s in a){var u=a[s].split("=");if("mongoMachineId"==u[0]&&u[1]>=0&&u[1]<=16777215){i=u[1];break}}document.cookie="mongoMachineId="+i+";expires=Tue, 19 Jan 2038 05:00:00 GMT"}return t}();o.prototype.getDate=function(){return new Date(1e3*this.timestamp)},o.prototype.toArray=function(){var t,e=this.toString(),n=[];for(t=0;t<12;t++)n[t]=parseInt(e.slice(2*t,2*t+2),16);return n},o.prototype.toString=function(){var t=this.timestamp.toString(16),e=this.machine.toString(16),n=this.pid.toString(16),r=this.increment.toString(16);return"00000000".substr(0,8-t.length)+t+"000000".substr(0,6-e.length)+e+"0000".substr(0,4-n.length)+n+"000000".substr(0,6-r.length)+r},t.exports=o},function(t,e){t.exports={name:"autochart-tracker",version:"1.0.6",description:"JavaScript API for tracking visitor activities on automotive websites with Autochart.io",author:"Paul Swail <paul@autochart.io>",license:"MIT",homepage:"https://github.com/WinterWindSoftware/autochart-tracker",main:"./dist/autochart.track.min.js",bugs:{url:"https://github.com/WinterWindSoftware/autochart-tracker/issues"},repository:{type:"git",url:"https://github.com/WinterWindSoftware/autochart-tracker.git"},keywords:["automotive","analytics","tracking","car dealer","autochart"],scripts:{lint:"./node_modules/.bin/eslint . || true",build:"webpack -p",start:"webpack -p && webpack-dev-server","publish-cdn-test":"webpack -p && DEPLOY_ENV=test node deploy/s3-deploy.js","publish-cdn-prod":"webpack -p && DEPLOY_ENV=production node deploy/s3-deploy.js","deploy-azure-latest":"webpack -p && grunt publish","deploy-azure-version":"webpack -p && grunt publish:version",prepublishOnly:"webpack -p"},devDependencies:{"babel-core":"^6.26.0","babel-loader":"^7.1.2","babel-preset-es2015":"^6.24.1",browserify:"^14.3.0",chai:"^1.9.1",eslint:"^4.6.1","eslint-config-airbnb-base":"^12.0.0","eslint-plugin-import":"^2.7.0",grunt:"^1.0.1","grunt-azure-cdn-deploy":"^1.0.1","grunt-cli":"^1.2.0","load-grunt-tasks":"^3.5.2",mocha:"^3.5.3",s3:"^4.4.0",sinon:"^1.9.0",webpack:"^3.5.6","webpack-dev-server":"^2.8.1"},dependencies:{"cookies-js":"^1.2.3",jsonp:"^0.2.1",lodash:"^4.17.4"}}}]);