darianst
1/18/2017 - 11:29 AM

ve-ads.min.18.01.2017.js

!function e(t,n,r){function o(s,c){if(!n[s]){if(!t[s]){var a="function"==typeof require&&require;if(!c&&a)return a(s,!0);if(i)return i(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var d=n[s]={exports:{}};t[s][0].call(d.exports,function(e){var n=t[s][1][e];return o(n?n:e)},d,d.exports,e,t,n,r)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s<r.length;s++)o(r[s]);return o}({1:[function(e,t,n){"use strict";var r;e("./utils").type;t.exports=r={always:function(){return!0},equal:function(e,t,n){return e=String(e),t=String(t),n||(e=e.toLowerCase(),t=t.toLowerCase()),e===t},notEqual:function(e,t,n){return!r.equal(e,t,n)},contains:function(e,t,n){return e=String(e),t=String(t),n||(e=e.toLowerCase(),t=t.toLowerCase()),t.indexOf(e)>-1},notContains:function(e,t,n){return!r.contains(e,t,n)}}},{"./utils":8}],2:[function(e,t,n){"use strict";t.exports=function(e){return"true"===window.localStorage.getItem("VeAdsConsoleLogEnabled")?function(t){console.log((e?e+" : ":"")+(t||""))}:function(){}}},{}],3:[function(e,t,n){"use strict";function r(e){return p.type(e,"jquery")||(e=l(e)),e.length?(e=e.first(),e.val()?l.trim(e.val()):l.trim(e.text())):""}function o(e){var t=[];return e.each(function(e,n){var o=r(l(n));t.push(l.trim(o))}),t}function i(e){var t,n,r;t=0,n=d.ELEMENT_MS,r=d.ELEMENT_MAX_RETRIES;var o=setInterval(function(){var n=e();t++,(n||r&&t>=r)&&clearInterval(o)},n);return o}function s(e){return l(e)}function c(e){var t=s(e),n=l.Deferred();return t.length&&n.resolve(t),i(function(){return t=s(e),!!t.length&&(n.resolve(t),!0)}),n.promise()}function a(e){var t={complete:!1,value:null,fail:!1},n=null,o=s(e),c=l.Deferred();return t.remove=function(e){e?t.complete=!0:t.fail=!0},o.length&&(t.value=r(o),c.notify(o,t)),t.complete?(c.resolve(o),!0):t.fail?(c.reject(),!0):(m("#progressCheck - calling interval",t),i(function(){return o=s(e),t.value=r(o),p.type(t.value,"nan")||p.type(t.value,"undefined")||p.type(t.value,"null")||n===t.value||(n=t.value,c.notify(o,t)),t.complete?(c.resolve(o),m("#progressCheck - success",t),!0):t.fail?(c.reject(),m("#progressCheck - rejection",t),!0):void 0}),c.promise())}var u,d=e("../settings"),l=e("./jq"),p=e("./utils"),m=e("./debug")("ve:elements");t.exports=u={instantCheck:s,dynamicCheck:c,progressCheck:a,obtainValue:r,obtainValues:o}},{"../settings":30,"./debug":2,"./jq":5,"./utils":8}],4:[function(e,t,n){"use strict";function r(e){if(e)return o(e)}function o(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}t.exports=r,r.prototype.on=r.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},r.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var r,o=0;o<n.length;o++)if(r=n[o],r===t||r.fn===t){n.splice(o,1);break}return this},r.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks["$"+e];if(n){n=n.slice(0);for(var r=0,o=n.length;r<o;++r)n[r].apply(this,t)}return this},r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}},{}],5:[function(e,t,n){"use strict";t.exports=window.VEjQuery||window.$},{}],6:[function(e,t,n){"use strict";var r=e("./utils").type,o=/[\$\xA2-\xA5\u058F\u060B\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BD\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6]/,i={number:function(e){var t=String(e).match(/([\d]{3,25})/);return r(t,"array")?t[1]:""},alphanumeric:function(e){var t=String(e).match(/([\dA-Za-z]{4,100})/);return r(t,"array")?t[1]:""},currency:function(e){return String(e).replace(/[^0-9\.,]/g,"")},symbol:function(e){var t=String(e).match(o);return r(t,"array")?t[0]:""},nothing:function(e){return String(e)}};t.exports=i},{"./utils":8}],7:[function(e,t,n){"use strict";function r(e){this.pageURL=e||this.generatePageURL(),this.searchObject=this.generateSearchObject()}function o(e){if(""===e||"?"===e)return{};var t,n,r,o={};for(t=e.replace(/^\?/,"").split("&"),n=0;n<t.length;n++)r=t[n].split("="),o[r[0]]=r[1];return o}function i(e){try{var t=(e+"").toLowerCase();return t=t.replace(/http[s]?:\/\//,""),t=t.replace("#","?"),t=t.replace(";","?"),"www."===t.substr(0,4)&&(t=t.replace("www.","")),t}catch(n){return""}}var s,c=e("./utils"),a=e("./jq"),u="__MATCH__",d=/\((.*?)\)/g,l=/(\(\?)?:\w+/g,p=/[*]{1}/g,m=/[*]{2}/g,h=/[\-{}\[\]+?.,\\\^$|#\s]/g;r.prototype._getPageURL=function(){return this.locationObj?this.locationObj:this.locationObj=c.parseURL(window.location.href)},r.prototype.generateSearchObject=function(){var e=this._getPageURL();return o(e.query)},r.prototype.generatePageURL=function(){var e=this._getPageURL(),t=e.hostname+(e.pathname.length>1?e.pathname:"");return i(t)},r.prototype._patternToRegex=function(e){return e=e.replace(h,"\\$&").replace(d,"(?:$1)?").replace(l,function(e,t){return t?e:"([^/?]+)"}).replace(m,"([^?]+|[^?]?)").replace(p,"([^\\/?]*?)"),new RegExp("^"+e+"(?:\\?([\\s\\S]*))?$")},r.prototype.match=function(e){var t,n,r={},o={};return c.type(e,"object")?r=e:r.url=e,t=this.checkPatternMatches(r.url),n=this.checkParamMatches(r.params),t[u]&&n[u]?a.extend({},t,n):(o[u]=!1,o)},r.prototype.checkPatternMatches=function(e,t){var n,r,o,s,c,a,d={};if(d[u]=!1,t||(e=i(e)),n=this._patternToRegex(e),r=this._getNamedParameters(e),o=n.exec(t||this.pageURL),!o)return d;for(s=o.slice(1),d[u]=!0,c=0;c<s.length;c++)a=r[c],s[c]&&("_"===a?(d._=d._||[],d._.push(s[c])):d[a]=s[c]);return d},r.prototype.checkParamMatches=function(e){var t,n,r={},o=this;return r[u]=!0,c.objectLength(e)?(a.each(e,function(e,i){var s;return e=String(e),i=String(i),s=decodeURIComponent(i),null==o.searchObject[e]?(r[u]=!1,!1):(t=o.checkPatternMatches(i,o.searchObject[e]),n=o.checkPatternMatches(s,o.searchObject[e]),t[u]?(a.extend(r,t),"continue"):n[u]?(a.extend(r,n),"continue"):(r[u]=!1,!1))}),r):r},r.prototype._getNamedParameters=function(e){var t,n,r,o;for(t=new RegExp("((:?:[^\\/()]+)|(?:[*])|(?:[**]))","g"),n=[],r=t.exec(e);r;){if(o=r[1].slice(1),"_"==o)throw new TypeError(":_ can't be used as a pattern name in pattern: "+e);if(a.inArray(o,n)>-1)throw new TypeError("duplicate pattern name :"+o+" in pattern: "+e);n.push(o||"_"),r=t.exec(e)}return n},t.exports=s=new r,s.MATCH_PROPERTY=u,s.Matcher=r,s.escapeRegExp=h},{"./jq":5,"./utils":8}],8:[function(e,t,n){"use strict";function r(e){var t=document.createElement("a");return t.href=e,{element:t,href:t.href,host:t.host,port:"0"===t.port||""===t.port?"":t.port,hash:t.hash,hostname:t.hostname,pathname:"/"!==t.pathname.charAt(0)?"/"+t.pathname:t.pathname,protocol:t.protocol&&":"!==t.protocol?t.protocol:"https:",search:t.search,query:t.search.slice(1)}}function o(e,t){switch(l.call(e)){case"[object Date]":return t?"date"===t:"date";case"[object RegExp]":return t?"regexp"===t:"regexp";case"[object Arguments]":return t?"arguments"===t:"arguments";case"[object Array]":return t?"array"===t:"array";case"[object Error]":return t?"error"===t:"error"}return null===e?t?"null"===t:"null":void 0===e?t?"undefined"===t:"undefined":e!==e?t?"nan"===t:"nan":d&&e instanceof d?t?"jquery"===t:"jQuery":e&&1===e.nodeType?t?"element"===t:"element":(e=e.valueOf?e.valueOf():Object.prototype.valueOf.apply(e),t?t===typeof e:typeof e)}function i(e){var t,n=0;for(t in e)e.hasOwnProperty(t)&&n++;return n}function s(e){var t=d.Deferred();return arguments.length>1&&(e=Array.prototype.slice.call(arguments)),d.each(e,function(e,n){n.done(function(){var e=[].slice.call(arguments);t.resolve.apply(t,e)})}),t.promise()}function c(e,t){return d.ajax({type:"GET",url:e,data:null,success:t,dataType:"script",cache:!0})}function a(e){var t=new Image(1,1),n=d.Deferred();return t.onload=function(){n.resolve()},t.src=e,n.promise()}function u(e){var t=document.createElement("script");t.type="text/javascript",t.appendChild(document.createTextNode(e)),document.head.appendChild(t)}var d=e("./jq"),l=Object.prototype.toString;t.exports={parseURL:r,type:o,objectLength:i,whenAny:s,getScript:c,getImage:a,insertTagIntoDOM:u}},{"./jq":5}],9:[function(e,t,n){"use strict";function r(e,t){t instanceof a&&(this.page=t,this.currentPage=!0),t=t||{},this.storeConfig(e,t)}var o=(e("../common/utils"),e("./capture")),i=e("../common/emitter"),s=(e("../storage/store"),e("../settings")),c=e("../common/jq"),a=e("../pages/Page"),u=e("./types"),d=e("../common/debug"),l={__timestamp__:(new Date).toUTCString().replace(/[\s,]+/g,"-"),__random__:("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)};i(r.prototype),r.prototype.storeConfig=function(e,t){this.config=e,this.name=e.name,this.type=e.type,this.valueType=u[e.type],this.id=e.id,this.capture=e.capture,this.fallback=e.fallback,this.urlData=t.matchingURLs||[{}],this.key=this.generateKey(),this.logger()},r.prototype.logger=function(){this.log=d("ve:dataElement:"+this.type+":"+this.id)},r.prototype.setData=function(){this.log("About to set data with the following object",this.config),o[this.capture.type](this.config,this)},r.prototype.getValue=function(){this.log("VALUE!!",this.value);var e=this.value||("list"===this.valueType?[]:"");return this.log("#getValue with value",e),e},r.prototype.generateKey=function(){return s.fromObjectConfig("uuid")+this.type+this.id},r.prototype.cacheValue=function(e){this.lastUpdated=c.now(),this.log("Caching value",e,this.lastUpdated),this.value=e},r.prototype.getFallback=function(){var e=String(l[this.fallback]||this.fallback);return this.log("#getFallback - The fallback value being obtained",e),e},t.exports=r},{"../common/debug":2,"../common/emitter":4,"../common/jq":5,"../common/utils":8,"../pages/Page":13,"../settings":30,"../storage/store":32,"./capture":10,"./types":11}],10:[function(e,t,n){"use strict";function r(e,t){var n=t.include,r=t.exclude;return y.type(n,"string")&&(n=[n]),y.type(r,"string")&&(r=[r]),y.type(n,"array")&&n.length&&(e=i(e,n)),y.type(r,"array")&&r.length&&(e=o(e,r)),e}function o(e,t){return w.each(t,function(t,n){var r;r=new RegExp(n,"gim"),e=e.replace(r,"")}),E("Matching with REGEX exclude",e,t),e}function i(e,t){return w.each(t,function(t,n){var r,o=e;r=new RegExp(n,"gi"),o=o.match(r)||o,o[1]&&(e=o),e instanceof Array&&(e=e.join(""))}),E("Matching with REGEX",e,t),e}function s(e,t){var n=I[t]||I.nothing;return n(e)}function c(e,t){return y.objectLength(t)?t[e]||e:e}function a(e,t){return y.type(e,"array")?(E("#runTransformations - running on a LIST of values"),w.each(e,function(n,r){e[n]=u(r,t)}),e):(E("#runTransformations - SINLE value type"),u(e,t))}function u(e,t){return E("#transform - running on value"),e=r(e,t.regex),e=s(e,t.mask),e=c(e,t.mappings)}function d(e,t){e.cacheValue(t),e.emit("store"),x.set(e.key,t)}function l(e){var t=window,n=e.split(".");return w.each(n,function(e,r){t=t[n[e]]}),String(t)}function p(e,t){E("Running via DOM #selector",e,t);var n=e.capture.element,r="",o=function(n,o){E("#selector value found about to run transformations",n),r=k[t.valueType](n),E("#selector VALUES",r,t),r=a(r,e),d(t,r)};e.capture.keepChecking&&"list"!==t.valueType?(E("#selector keep checking active setting up progress check"),b.progressCheck(n).progress(o)):(E("#selector keep checking NOT active simpler check for element "),b.dynamicCheck(n).then(o))}function m(e,t){var n=l(e.capture.element);n=a(n,e),d(t,n)}function h(e,t){var n="";w.each(t.urlData,function(t,r){if(r.matches[e.capture.element])return n=r.matches[e.capture.element],!1}),n=a(n,e),d(t,n)}function g(e,t){var n=window.dataLayer;if(!n)return"";for(var r=t?n.reverse():n,o="",i=0;i<r.length;i++)if(r[i][e]){o=r[i][e];break}return o}function f(e,t,n){var r=g(e.capture.element,n);r=a(r,e),d(t,r)}function v(e,t){f(e,t,!0)}var y=e("../common/utils"),b=e("../common/elements"),w=e("../common/jq"),I=(e("../common/url-matcher").escapeRegExp,e("../common/masks")),x=e("../storage/store"),E=e("../common/debug")("ve:capture");t.exports={selector:p,globalVariable:m,url:h,dataLayer:f,dataLayerReverse:v};var k={single:function(e){return E("#singleOrList.single - Obtaining single value from element."),b.obtainValue(e)},list:function(e){return E("#singleOrList.list - Obtaining multiple values from element."),b.obtainValues(e)}}},{"../common/debug":2,"../common/elements":3,"../common/jq":5,"../common/masks":6,"../common/url-matcher":7,"../common/utils":8,"../storage/store":32}],11:[function(e,t,n){var r={orderId:"single",orderVal:"single",productId:"single",productList:"list",priceList:"list",currency:"single",contentId:"list"};t.exports=r},{}],12:[function(e,t,n){"use strict";function r(e){var t=this;this.log=g("ve:main"),this.veAdsConfig=e||this.getVeAdsConfig(),this.veAdsConfig.config.consoleMessagesEnabled?window.localStorage.setItem("VeAdsConsoleLogEnabled","true"):window.localStorage.removeItem("VeAdsConsoleLogEnabled"),this.runChecks().then(function(){t.instantiatePages()})}function o(e,t,n){var r=!1;return u.each(e,function(e,o){if(o[t]===n)return r=!0,!1}),r}function i(e,t){return y[e.type]-y[t.type]}function s(e,t,n){if(e.getValue().length)return e.getValue();var r=n.getValue(e.key)||[];return r}function c(e,t){var n=[];return u.each(e,function(e,r){r.type===t&&n.push(r)}),n}var a=e("./common/utils"),u=e("./common/jq"),d=e("./pages/Page"),l=e("./storage/store"),p=e("./data/DataElement"),m=e("./settings"),h=e("./pixels/type"),g=e("./common/debug"),f=e("./data/types"),v=e("./pixels/Pixel");t.exports=r;var y={ros:1,conversion:2,product:3,category:4,basket:5,custom:6,completeReg:7,viewContent:8,search:9,addToCart:10,addToWishlist:11,initiateCheckout:12,addPaymentInfo:13,lead:14},b={id:0,name:"ROS Injected Page",type:"ros",urls:["**"],dynamicIdentifiers:[]};r.prototype.getVeAdsConfig=function(){try{return u.extend({},window.veTagData.settings.veAds)}catch(e){this.log(new Error("Please define a valid veAds object"),e)}},r.prototype.testJSON=function(){return window.JSON&&"parse"in window.JSON&&"stringify"in window.JSON},r.prototype.runChecks=function(){var e=u.Deferred();return this.testJSON()?(this.jsonAvailable=!0,this.log("JSON natively available"),e.resolve()):(this.log("NO JSON on this page, adding a script to the page."),this.jsonAvailable=!1,this.jsonPromise=u.getScript("https://cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.min.js").done(function(){e.resolve()})),e.promise()},r.prototype.instantiatePages=function(){this.log("Instantiating PAGES");var e=this;o(this.veAdsConfig.pages,"type","ros")||this.veAdsConfig.pages.unshift(b),this.veAdsConfig.pages.sort(i),this.log("Pages have been sorted into a running order",this.veAdsConfig.pages),u.each(e.veAdsConfig.pages,function(t,n){if(n[m.MAIN_PAGE_PROPERTY])return"continue";var r=new d(n);n[m.MAIN_PAGE_PROPERTY]=r,e.setupPageListeners(r)})},r.prototype.setupPageListeners=function(e){this.log("Setting page listener for: "+e.name),e.once("success",u.proxy(this.setPageElements,this,e)),e.once("success",u.proxy(this.runPagePixels,this,e)),e.once("fail",u.proxy(e.off,e)),e.checkURLs()},r.prototype.setupDataListeners=function(e){this.log("#setupDataListeners - setting up data listeners for: "+e.name,e),e.once("store",u.proxy(this.storeValue,this,e))},r.prototype.storeValue=function(e){var t=e.key,n=e.getValue();return this.log("#storeValue - storing key: "+t+", with value: "+n),l.set(t,n)},r.prototype.getValue=function(e){return l.get(e)},r.prototype.setPageElements=function(e){this.log("Setting DataElements for identified page "+e.name,e);var t=this;u.each(this.veAdsConfig.dataElements,function(n,r){var o;return r[m.MAIN_DATA_ELEMENT]?(t.log("dataElement object already exists for dataElement: "+r.name,r),o=r[m.MAIN_DATA_ELEMENT],o.setData(),"continue"):void(a.type(r.pages,"array")&&r.pages.length&&u.inArray(e.id,r.pages)>-1&&(o=new p(r,e),r[m.MAIN_DATA_ELEMENT]=o,t.setupDataListeners(o),o.setData()))})},r.prototype.runPagePixels=function(e){var t=this,n=u.proxy(this.obtainDataFromStorage,this);u.each(this.veAdsConfig.pixels,function(r,o){var i,s=h[o.type];return s.hasOwnProperty(e.type)?(o[m.MAIN_PIXEL]?i=o[m.MAIN_PIXEL]:(i=new v(o,n),o[m.MAIN_PIXEL]=i),void i.run(n,e.type,e.id)):(t.log("Page type: "+e.type+" not supported by pixel: "+o.name),"continue")})},r.prototype.obtainDataFromStorage=function(e,t){var n=this,r={};return u.each(e,function(e,t){var o=c(n.veAdsConfig.dataElements,t);r[t]=n._obtainDataValue(o,f[t])}),r},r.prototype._obtainDataValue=function(e,t){var n="list"===t?[]:"",r=this;return u.each(e,function(e,t){var o=t[m.MAIN_DATA_ELEMENT]||(t[m.MAIN_DATA_ELEMENT]=new p(t));n="single"!==o.valueType||n?s(o,n,r):o.getValue()||r.getValue(o.key)}),"single"!==t||n||(this.log("FALLBACK: No value has been found checking for fallbacks"),u.each(e,function(e,t){var o=t[m.MAIN_DATA_ELEMENT];n=o.getFallback(),r.log("FALLBACK VALUE USED: Current value found for this.",n,o)})),n}},{"./common/debug":2,"./common/jq":5,"./common/utils":8,"./data/DataElement":9,"./data/types":11,"./pages/Page":13,"./pixels/Pixel":14,"./pixels/type":24,"./settings":30,"./storage/store":32}],13:[function(e,t,n){"use strict";function r(e){if(!o.type(e,"object"))throw new Error("Pages need to be called with a configuration object");this.storeConfig(e),this.logger(),this.matchingURLs=[],this.dynamic=this._checkDynamic(),this.log("Page object created")}var o=e("../common/utils"),i=e("../common/emitter"),s=e("../common/url-matcher"),c=e("../common/jq"),a=e("../settings"),u=e("../common/elements"),d=e("../common/criteria"),l=e("../common/debug");i(r.prototype),r.prototype.checkURLs=function(){var e=this;this.log("Checking through URLs"),c.each(this.urls,function(t,n){var r=s.match(n);r[s.MATCH_PROPERTY]&&e.matchingURLs.push({url:n,matches:r})}),this.matchingURLs.length&&!this.dynamic?(this.log("Page URL matches with object",this.matchingURLs),this.pageIdentified()):this.matchingURLs.length&&this.dynamic?(this.log("Page URL matches but dynamic tests are needed",this.matchingURLs),this.runDynamics()):(this.emit("fail"),this.log("ZERO MATCHES for: "+this.name))},r.prototype.runDynamics=function(){var e=[],t=this;this.log("Dynamically testing"),c.each(this.dynamicIdentifiers,function(n,r){var o;return!r.selector||r.criteria&&!r.values?(t.log("Dynamic Identifier: "+n+"1 can't run",r),"continue"):(o=u.progressCheck(r.selector),e.push(o),void o.progress(function(e,n){t.log("Update in element value",e,n),c.each(r.values,function(e,o){if(t.log("Checking against: "+o),d[r.criteria](o,n.value))return t.log("Value has been found for: "+n.value),n.remove(!0),!1}),t.stopChecks&&(t.log("Another dynamic Identifier has already passed"),n.remove())}))}),o.whenAny(e).done(function(e){t.pageIdentified()})},r.prototype.pageIdentified=function(e){this.log("Page Matches for: "+this.name,this.matchingURLs),this.stopChecks=!0,this.emit("success",this)},r.prototype.storeConfig=function(e){if(!o.type(e.id,"number"))throw new Error("Must provide an ID with every page ",e);if(!o.type(e.type,"string"))throw new Error("Must be provided with a valid type");this.config=e,this.id=e.id,this.urls=e.urls||[],this.type=e.type||a.DEFAULT_PAGE_TYPE,this.dynamicIdentifiers=e.dynamicIdentifiers||[],this.name=e.name},r.prototype.logger=function(){this.log=l("ve:page:"+this.type+":"+this.id)},r.prototype._checkDynamic=function(){return!!this.dynamicIdentifiers.length},t.exports=r},{"../common/criteria":1,"../common/debug":2,"../common/elements":3,"../common/emitter":4,"../common/jq":5,"../common/url-matcher":7,"../common/utils":8,"../settings":30}],14:[function(e,t,n){"use strict";function r(e,t){this.storeConfig(e),this.logger()}var o=e("../common/utils"),i=e("../common/emitter"),s=e("./type"),c=e("../common/debug"),a=e("../common/jq");i(r.prototype),r.prototype.run=function(e,t,n){this.pages.push(n),this.data=this.collateData(this._pixel[t].needs,e),this.generatePixels(this.data,this.config,t,n)},r.prototype.storeConfig=function(e){this.settings=e,this.config=e.config,this.id=e.id,this.type=e.type,this.name=e.name,this.overrides=e.overrides,this._pixel=s[this.type],this.pages=[]},r.prototype.logger=function(){this.log=c("ve:pixel:"+this.type+":"+this.id)},r.prototype.collateData=function(e,t){return this.log("Collating data for: ",e),t(e,this)},r.prototype.checkOverrides=function(e,t){return this.log("Checking for pixel OVERRIDES"),!this.overrides.active||(!(!this.overrides.ros||"ros"!==e||this.overrides.pages.length)||(!this.overrides.pages.length||(!!(this.overrides.pages.length&&a.inArray(t,this.overrides.pages)>-1)||(this.log("The pixel has been OVERRIDDEN"),!1))))},r.prototype.generatePixels=function(e,t,n,r){var i,s=this;return this.checkOverrides(n,r)?(i=this._pixel[n]&&this._pixel[n].produces||[],i.length?(this.log("Generating Pixel(s) for: "+this.name+" with type: "+this.type),this.log("Data to be passed in will be ",e,t),void a.each(i,function(n,i){var c=i(e,t,r);c&&(o.getImage(c),s.log("Image pixel generated with `src`: "+c))})):void this.log("There are ZERO runners for this pageType:"+n)):void this.log("Pixels will not be generated")},t.exports=r},{"../common/debug":2,"../common/emitter":4,"../common/jq":5,"../common/utils":8,"./type":24}],15:[function(e,t,n){"use strict";function r(e){var t="https://track.adform.net/serving/scripts/trackpoint/async/";return window._adftrack=Array.isArray(window._adftrack)?window._adftrack:window._adftrack?[window._adftrack]:[],window._adftrack.push(e),s.getScript(t),!1}function o(e,t){r({pm:t.pmId,divider:encodeURIComponent("|"),pagename:encodeURIComponent("Complete"),order:{sales:e.orderVal,orderid:e.orderId,sv8:e.currency}})}function i(e){return function(t,n){r({pm:n.pmId,divider:encodeURIComponent("|"),pagename:encodeURIComponent(e)})}}var s=(e("../../common/debug")("ve:pixels:type:adForm"),e("../../common/utils"));t.exports={conversion:{needs:["orderVal","orderId","currency"],produces:[o]},ros:{needs:[],produces:[i("ROS")]},product:{needs:[],produces:[i("Product")]},home:{needs:[],produces:[i("Homepage")]}}},{"../../common/debug":2,"../../common/utils":8}],16:[function(e,t,n){"use strict";function r(e,t){return s("#conversion - 0.data 1.config",e,t),"https://secure.adnxs.com/px?id="+t.conversionId+"&seg="+t.segmentConversion+"&order_id="+e.orderId+"&value="+e.orderVal+"&other=["+e.currency+"]&t=2"}function o(e,t){return"//secure.adnxs.com/seg?add="+t.segmentROS+"&t=2"}function i(e,t){return"//secure.adnxs.com/seg?add="+t.segmentProduct+"&t=2"}var s=e("../../common/debug")("ve:pixels:type:appNexus");t.exports={product:{needs:[],produces:[i]},conversion:{needs:["orderVal","orderId","currency"],produces:[r]},ros:{needs:[],produces:[o]}}},{"../../common/debug":2}],17:[function(e,t,n){function r(e,t){return"script"===t.type&&t.src?(i("adding script to the page"),o.getScript(t.src),!1):t.src}var o=e("../../common/utils"),i=e("../../common/debug")("ve:pixels:type:customConversion");t.exports={conversion:{needs:[],produces:[r]}}},{"../../common/debug":2,"../../common/utils":8}],18:[function(e,t,n){"use strict";function r(e,t,n){return s("Checking customPage Pixel",o.type(t.pages,"array"),i.inArray(n,t.pages)),(!o.type(t.pages,"array")||i.inArray(n,t.pages)!==-1)&&("script"===t.type&&t.src?(o.getScript(t.src),!1):t.src)}var o=e("../../common/utils"),i=e("../../common/jq"),s=e("../../common/debug")("ve:pixels:type:customPage");t.exports={custom:{needs:[],produces:[r]}}},{"../../common/debug":2,"../../common/jq":5,"../../common/utils":8}],19:[function(e,t,n){function r(e,t){return"script"===t.type&&t.src?(o.getScript(t.src),!1):t.src}var o=e("../../common/utils");t.exports={ros:{needs:[],produces:[r]}}},{"../../common/utils":8}],20:[function(e,t,n){function r(e,t){if("script"===t.type&&t.src)return o.insertTagIntoDOM(t.src),!1}var o=e("../../common/utils");t.exports={conversion:{needs:[],produces:[r]},ros:{needs:[],produces:[r]},product:{needs:[],produces:[r]},basket:{needs:[],produces:[r]},custom:{needs:[],produces:[r]}}},{"../../common/utils":8}],21:[function(e,t,n){"use strict";function r(e,t){return t.catConversion?"https://ad.doubleclick.net/ddm/activity/src="+t.src+";type=sales;cat="+t.catConversion+";qty=1;cost="+e.orderVal+";ord="+e.orderId+"?":void s("No catConversion provided for Conversion page")}function o(e,t){var n=e.productId,r=1e13*(Math.random()+"");return t.catProduct?"https://ad.doubleclick.net/ddm/activity/src="+t.src+";type=invmedia;cat="+t.catProduct+";u1="+n+";dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;ord="+r+"?":void s("No catProduct provided for Product page DBM Pixel")}function i(e){var t="cat"+e;return function(n,r){if(!r[t])return void s("No property provided for page type: "+e);var o=1e13*(Math.random()+"");return"https://ad.doubleclick.net/ddm/activity/src="+r.src+";type=invmedia;cat="+r[t]+";ord="+o}}var s=e("../../common/debug")("ve:pixels:type:dbm");t.exports={conversion:{needs:["orderVal","orderId"],produces:[r]},ros:{needs:[],produces:[i("ROS")]},product:{needs:["productId"],produces:[o]},basket:{needs:[],produces:[i("Basket")]},custom:{needs:[],produces:[i("Custom")]}}},{"../../common/debug":2}],22:[function(e,t,n){"use strict";function r(){var e;window.fbq||(e=window.fbq=function(){e.callMethod?e.callMethod.apply(e,arguments):e.queue.push(arguments)},window._fbq||(window._fbq=e),e.push=e,e.loaded=!0,e.version="2.0",e.queue=[])}function o(){r(),y.getScript("https://connect.facebook.net/en_US/fbevents.js"),w=!0}function i(e){return e.contentId.length>1?"productGroup":"product"}function s(e,t){b.each(I,function(t,n,r){return!(!e[n]||!e[n].selector)&&void b.each(e[n].selector,function(e,t){b(t).click(function(){fbq("track",n,{content_ids:r.contentId,content_type:i(r)})})})})}function c(e,t){o(),s(e,t),window.fbq("init",""+e.facebookId),window.fbq("track","PageView")}function a(e,t){return w||c(t),!1}function u(e,t){return w||c(t),e.contentId.length||"%5B%5D"!=e.contentId?window.fbq("track","Purchase",{value:e.orderVal,currency:e.currency,content_ids:e.contentId}):window.fbq("track","Purchase",{value:e.orderVal,currency:e.currency}),!1}function d(e,t){return w||c(t),window.fbq("track","CompleteRegistration"),!1}function l(e,t){return w||c(t),e.contentId.length||"%5B%22%22%5B"!=e.contentId?window.fbq("track","ViewContent",{content_ids:e.contentId,content_type:i(e)}):window.fbq("track","ViewContent"),!1}function p(e,t){return w||c(t),t.Search.clickOnly||window.fbq("track","Search"),!1}function m(e,t){return w||c(t),t.AddToCart.clickOnly||(e.contentId.length?window.fbq("track","AddToCart",{content_ids:e.contentId,content_type:i(e)}):window.fbq("track","AddToCart")),!1}function h(e,t){return w||c(t),t.AddToWishlist.clickOnly||window.fbq("track","AddToWishlist"),!1}function g(e,t){return w||c(t),window.fbq("track","InitiateCheckout"),!1}function f(e,t){return w||c(t),t.AddPaymentInfo.clickOnly||window.fbq("track","AddPaymentInfo"),!1}function v(e,t){return w||c(t),t.Lead.clickOnly||window.fbq("track","Lead"),!1}var y=e("../../common/utils"),b=e("../../common/jq"),w=!1,I=(e("../../common/debug")("ve:pixels:type:facebook"),["Search","AddToCart","AddToWishlist","AddPaymentInfo","Lead"]);t.exports={ros:{needs:[],produces:[a]},conversion:{needs:["orderVal","currency","orderId","contentId"],produces:[u]},viewContent:{needs:["contentId"],produces:[l]},search:{needs:[],produces:[p]},addToCart:{needs:["contentId"],produces:[m]},addToWishlist:{needs:[],produces:[h]},initiateCheckout:{needs:[],produces:[g]},addPaymentInfo:{needs:[],produces:[f]},lead:{needs:[],produces:[v]},completeReg:{needs:[],produces:[d]}}},{"../../common/debug":2,"../../common/jq":5,"../../common/utils":8}],23:[function(e,t,n){"use strict";function r(e,t){var n,r=t.flexId;return function(e){var t=document,n=t.createElement("script");n.async=!0,n.defer=!0,n.src=e,t.getElementsByTagName("head")[0].appendChild(n)}((n=window.location.href.indexOf("iatDev=1")>-1||document.cookie.indexOf("iatDev=1")>-1,"//"+("http:"!=window.location.protocol||n?"":"h")+"fp.gdmdigital.com/"+r+".js?r="+1e16*Math.random()+"&m=992&a="+r+(n?"&d=1":""))),!1}t.exports={ros:{needs:[],produces:[r]}}},{}],24:[function(e,t,n){"use strict";t.exports={ve:e("./ve"),dbm:e("./dbm"),flex:e("./flex"),smartFlex:e("./smartFlex"),appNexus:e("./appNexus"),customROS:e("./customROS"),customConversion:e("./customConversion"),customTag:e("./customTag"),customPage:e("./customPage"),facebook:e("./facebook"),mediaMath:e("./mediaMath"),volvelle:e("./volvelle"),adForm:e("./adForm")}},{"./adForm":15,"./appNexus":16,"./customConversion":17,"./customPage":18,"./customROS":19,"./customTag":20,"./dbm":21,"./facebook":22,"./flex":23,"./mediaMath":25,"./smartFlex":26,"./ve":27,"./volvelle":28}],25:[function(e,t,n){"use strict";function r(e,t){if(t.conversionId&&t.advertiserId){var n="//pixel.mathtag.com/event/js?mt_id="+t.conversionId+"&mt_adid="+t.advertiserId+"&v1="+e.orderId+"&v2=&v3=&s1="+e.orderVal+"&s2="+e.currency+"&s3=";return i.getScript(n),!1}}function o(e,t){if(t.rosId&&t.advertiserId){var n="//pixel.mathtag.com/event/js?mt_id="+t.rosId+"&mt_adid="+t.advertiserId+"&v1=&v2=&v3=&s1=&s2=&s3=";return i.getScript(n),!1}}var i=e("../../common/utils");e("../../common/debug")("ve:pixels:type:mediaMath");t.exports={conversion:{needs:["orderVal","orderId","currency"],produces:[r]},ros:{needs:[],produces:[o]}}},{"../../common/debug":2,"../../common/utils":8}],26:[function(e,t,n){"use strict";function r(e,t){var n=t.flexId,r=function(){s("Generating Script"),function(e){var t=document,n=t.createElement("script");n.async=!0,n.defer=!0,n.src=e,t.getElementsByTagName("head")[0].appendChild(n)}("//c.vepxl1.net/4-"+n+".js?id="+n+"&m=4")};return o(r),r(),!1}function o(e){s("Listening to page changes"),i(window.history,"push",e),i(window.history,"replace",e),addEventListener(window,"hashchange",e,!1),addEventListener(window,"popstate",e,!1)}function i(e,t,n){var r=t+"State",o="on"+t+"state",i=e[r];e[r]=function(r){return"function"==typeof e[o]&&e[o]({state:r}),s("Setting up stateListener with type: "+t),n({state:r,event:o}),i.apply(e,arguments)}}var s=e("../../common/debug")("ve:pixels:type:smartFlex");t.exports={ros:{needs:[],produces:[r]}}},{"../../common/debug":2}],27:[function(e,t,n){"use strict";function r(e,t,n){return"//veads.veinteractive.com/genieTracker.php?adgCompanyID="+t.journeyCode+"&adgItem="+encodeURIComponent(e.productId)}function o(e,t){var n=u(e.priceList);return"//veads.veinteractive.com/conversion.php?companyId="+t.journeyCode+"&items="+(n?n+"|":"")+"BASKETVAL:"+e.orderVal+"&orderId="+e.orderId}function i(e,t){var n=a(e.productList);return"//veads.veinteractive.com/genieTracker.php?adgCompanyID="+t.journeyCode+"&adgPurchasedItems="+n}function s(e,t){return"//veads.veinteractive.com/genieTracker.php?adgCompanyID="+t.journeyCode+"&adgItem="+a(e.productList)}function c(e,t){return"//veads.veinteractive.com/genieTracker.php?adgCompanyID="+t.journeyCode+"&adgBasketItems="+a(e.productList)}function a(e){var t="";return e=e||[],d.each(e,function(n,r){r=encodeURIComponent(r),t+=r+(n<e.length-1?"|":"")}),t}function u(e){var t="";return e=e||[],d.each(e,function(n,r){r=encodeURIComponent(r),t+="PROD"+(n+1)+":"+r+(n<e.length-1?"|":"")}),t}var d=e("../../common/jq");t.exports={product:{needs:["productId"],produces:[r]},conversion:{needs:["orderVal","orderId","productList","priceList"],produces:[o,i]},basket:{needs:["productList","priceList"],produces:[c]},category:{needs:["productList"],produces:[s]}}},{"../../common/jq":5}],28:[function(e,t,n){"use strict";function r(e,t){var n=(new Date).toUTCString().replace(/[\s,]+/g,"-");return"https://a.volvelle.tech/pixel?id="+t.conversionId+"&type=img&aid="+t.advertiserId+"&c1="+e.orderId+"&c2="+e.orderVal+"&c3="+e.currency+"&c4="+n;
}e("../../common/debug")("ve:pixels:type:volvelle"),e("../../common/utils");t.exports={conversion:{needs:["conversionId","orderId","orderVal","currency"],produces:[r]}}},{"../../common/debug":2,"../../common/utils":8}],29:[function(e,t,n){var r=e("./common/debug")("ve:run");try{r("Code is starting");var o=e("./main");new o}catch(i){r("There was an error OOPS",i)}},{"./common/debug":2,"./main":12}],30:[function(e,t,n){var r=e("./common/debug")("ve:settings");t.exports={DEFAULT_PAGE_TYPE:"custom",MAIN_PAGE_PROPERTY:"_pageObject",MAIN_DATA_ELEMENT:"_dataElementObject",MAIN_PIXEL:"_pixelObject",ELEMENT_MS:750,ELEMENT_MAX_RETRIES:3e3,fromObjectConfig:function(e){try{return window.veTagData.settings.veAds.config[e]}catch(t){r("Unable to load veAds config",t)}}}},{"./common/debug":2}],31:[function(e,t,n){"use strict";var r={getItem:function(e){return e?decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null:null},setItem:function(e,t,n,r,o,i){if(!e||/^(?:expires|max\-age|path|domain|secure)$/i.test(e))return!1;var s="";if(n)switch(n.constructor){case Number:s=n===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+n;break;case String:s="; expires="+n;break;case Date:s="; expires="+n.toUTCString()}return document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+s+(o?"; domain="+o:"")+(r?"; path="+r:"")+(i?"; secure":""),!0},removeItem:function(e,t,n){return!!this.hasItem(e)&&(document.cookie=encodeURIComponent(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"+(n?"; domain="+n:"")+(t?"; path="+t:""),!0)},hasItem:function(e){return!!e&&new RegExp("(?:^|;\\s*)"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(document.cookie)},keys:function(){for(var e=document.cookie.replace(/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g,"").split(/\s*(?:\=[^;]*)?;\s*/),t=e.length,n=0;n<t;n++)e[n]=decodeURIComponent(e[n]);return e}};t.exports=r},{}],32:[function(e,t,n){"use strict";function r(){try{return a in s&&s[a]}catch(e){return!1}}var o,i={},s=window,c=s.document,a="localStorage",u="script",d=e("../common/utils"),l=e("../settings").fromObjectConfig("storageAcrossProtocols"),p=e("./cookies"),m=3600;if(i.disabled=!1,i.version="1.3.17",i.set=function(e,t){},i.get=function(e,t){},i.has=function(e){return void 0!==i.get(e)},i.remove=function(e){},i.clear=function(){},i.transact=function(e,t,n){null==n&&(n=t,t=null),null==t&&(t={});var r=i.get(e,t);n(r),i.set(e,r)},i.getAll=function(){},i.forEach=function(){},i.serialize=function(e){return JSON.stringify(e)},i.deserialize=function(e){if(d.type("string"))try{return JSON.parse(e)}catch(t){return e||void 0}},r())o=s[a],i.set=function(e,t){return d.type(t,"undefined")?i.remove(e):(o.setItem(e,i.serialize(t)),l&&p.setItem(e,i.serialize(t),m),t)},i.get=function(e,t){var n=i.deserialize(o.getItem(e));return n||(n=i.deserialize(p.getItem(e))),void 0===n?t:n},i.remove=function(e){o.removeItem(e)},i.clear=function(){o.clear()},i.getAll=function(){var e={};return i.forEach(function(t,n){e[t]=n}),e},i.forEach=function(e){for(var t=0;t<o.length;t++){var n=o.key(t);e(n,i.get(n))}};else if(c.documentElement.addBehavior){var h,g;try{g=new ActiveXObject("htmlfile"),g.open(),g.write("<"+u+">document.w=window</"+u+'><iframe src="/favicon.ico"></iframe>'),g.close(),h=g.w.frames[0].document,o=h.createElement("div")}catch(f){o=c.createElement("div"),h=c.body}var v=function(e){return function(){var t=Array.prototype.slice.call(arguments,0);t.unshift(o),h.appendChild(o),o.addBehavior("#default#userData"),o.load(a);var n=e.apply(i,t);return h.removeChild(o),n}},y=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g"),b=function(e){return e.replace(/^d/,"___$&").replace(y,"___")};i.set=v(function(e,t,n){return t=b(t),void 0===n?i.remove(t):(e.setAttribute(t,i.serialize(n)),e.save(a),n)}),i.get=v(function(e,t,n){t=b(t);var r=i.deserialize(e.getAttribute(t));return void 0===r?n:r}),i.remove=v(function(e,t){t=b(t),e.removeAttribute(t),e.save(a)}),i.clear=v(function(e){var t=e.XMLDocument.documentElement.attributes;for(e.load(a);t.length;)e.removeAttribute(t[0].name);e.save(a)}),i.getAll=function(e){var t={};return i.forEach(function(e,n){t[e]=n}),t},i.forEach=v(function(e,t){for(var n,r=e.XMLDocument.documentElement.attributes,o=0;n=r[o];++o)t(n.name,i.deserialize(e.getAttribute(n.name)))})}try{var w="__storejs__";i.set(w,w),i.get(w)!=w&&(i.disabled=!0),i.remove(w)}catch(f){i.disabled=!0}i.enabled=!i.disabled,t.exports=i},{"../common/utils":8,"../settings":30,"./cookies":31}]},{},[29]);