/*! geci.js v0.2.26-77-47e04a5 201512101046 */ Array.prototype.forEach || (Array.prototype.forEach = function(a, b) { var c, d = 0, e = this.length; for (arguments.length >= 2 && (c = b); e > d;) d in this && a.call(c, this[d], d, this), d++ }), Array.prototype.indexOf || (Array.prototype.indexOf = function(a) { "use strict"; var b, c, d = Object(this), e = d.length >>> 0; if (0 === e) return -1; if (b = 0, arguments.length > 1 && (b = Number(arguments[1]), b != b ? b = 0 : 0 !== b && b != 1 / 0 && b != -(1 / 0) && (b = (b > 0 || -1) * Math.floor(Math.abs(b)))), b >= e) return -1; for (c = b >= 0 ? b : Math.max(e - Math.abs(b), 0); e > c; c++) if (c in d && d[c] === a) return c; return -1 }), Array.prototype.map || (Array.prototype.map = function(a, b) { var c, d, e; if (null === this) throw new TypeError(" this is null or not defined"); var f = Object(this), g = f.length >>> 0; if ("function" != typeof a) throw new TypeError(a + " is not a function"); for (arguments.length > 1 && (c = b), d = new Array(g), e = 0; g > e;) { var h, i; e in f && (h = f[e], i = a.call(c, h, e, f), d[e] = i), e++ } return d }), Array.prototype.filter || (Array.prototype.filter = function(a) { "use strict"; if (void 0 === this || null === this) throw new TypeError; var b = Object(this), c = b.length >>> 0; if ("function" != typeof a) throw new TypeError; for (var d = [], e = arguments.length >= 2 ? arguments[1] : void 0, f = 0; c > f; f++) if (f in b) { var g = b[f]; a.call(e, g, f, b) && d.push(g) } return d }), function() { "use strict"; var a = Array.prototype.slice; try { a.call(document.documentElement) } catch (b) { Array.prototype.slice = function(b, c) { if (c = "undefined" != typeof c ? c : this.length, "[object Array]" === Object.prototype.toString.call(this)) return a.call(this, b, c); var d, e, f = [], g = this.length, h = b || 0; h = h >= 0 ? h : g + h; var i = c ? c : g; if (0 > c && (i = g + c), e = i - h, e > 0) if (f = new Array(e), this.charAt) for (d = 0; e > d; d++) f[d] = this.charAt(h + d); else for (d = 0; e > d; d++) f[d] = this[h + d]; return f } } }(), Function.prototype.bind || (Function.prototype.bind = function(a) { var b = Array.prototype.slice, c = b.call(arguments, 1), d = this, e = function() {}, f = function() { return d.apply(this instanceof e && a ? this : a, c.concat(b.call(arguments))) }; return e.prototype = this.prototype, f.prototype = new e, f }), Object.keys || (Object.keys = function() { "use strict"; var a = Object.prototype.hasOwnProperty, b = !{ toString: null }.propertyIsEnumerable("toString"), c = ["toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor"], d = c.length; return function(e) { if ("object" != typeof e && ("function" != typeof e || null === e)) throw new TypeError("Object.keys called on non-object"); var f, g, h = []; for (f in e) a.call(e, f) && h.push(f); if (b) for (g = 0; d > g; g++) a.call(e, c[g]) && h.push(c[g]); return h } }()), Array.prototype.some || (Array.prototype.some = function(a) { "use strict"; if (null == this) throw new TypeError("Array.prototype.some called on null or undefined"); if ("function" != typeof a) throw new TypeError; for (var b = Object(this), c = b.length >>> 0, d = arguments.length >= 2 ? arguments[1] : void 0, e = 0; c > e; e++) if (e in b && a.call(d, b[e], e, b)) return !0; return !1 }), String.prototype.trim || ! function() { var a = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; String.prototype.trim = function() { return this.replace(a, "") } }(), function(window, document) { "use strict"; var scriptsLoaded = [], s4 = function() { return Math.floor(65536 * (1 + Math.random())).toString(16).substring(1) }, groupCall = function(a, b) { return b ? function() { b.forEach(function(b) { a[b]() }) } : void 0 }, htmlEvents = "load unload blur change focus reset select submit abort keydown keypress keyup click dblclick mousedown mousemove mouseout mouseover mouseup readystatechange".split(" "), eventHandlers = {}; window.geci = { domReady: null, libraryBase: window.GECI_LIBRARY_BASE || "", createDispatcher: function(a) { a.listeners = {}, a.createEvent = function(a, b) { var c, d = document; return d.createEvent ? (c = d.createEvent("CustomEvent"), c.initCustomEvent(a, !0, !0, b)) : d.createEventObject && (c = d.createEventObject(), c.customType = a, c.detail = b), c }, a.dispatchEvent = function(a, b) { "string" == typeof a ? a = this.createEvent(a, b) : b && (a.detail = b); var c = this.listeners; if (void 0 !== c) { var d = c[a.type ? a.type : a.customType]; if (void 0 !== d) { void 0 === a.target && (a.target = this); for (var e = 0; e < d.length; e++) d[e].call(this, a) } } }, a.addEventListener = function(a, b) { var c = this.listeners; void 0 === c[a] ? c[a] = [b] : -1 === c[a].indexOf(b) && c[a].push(b) }, a.hasEventListener = function(a, b) { var c = this.listeners; return void 0 !== c[a] && -1 !== c[a].indexOf(b) ? !0 : !1 }, a.removeEventListener = function(a, b) { var c = this.listeners, d = c[a].indexOf(b); - 1 !== d && c[a].splice(d, 1) }, a.createEvent = function(a, b) { var c, d = document; return d.createEvent ? (c = d.createEvent("CustomEvent"), c.initCustomEvent(a, !0, !0, b)) : d.createEventObject && (c = d.createEventObject(), c.customType = a, c.detail = b), c } }, setLibraryBase: function(a) { this.libraryBase || (this.libraryBase = a) }, getLibraryBase: function() { return this.libraryBase }, option: function(a, b) { return "undefined" == typeof a ? b : a }, defaultLocale: "es", getLocale: function(a) { return a[this.defaultLocale] }, ns: function(a, b) { for (var c = geci, d = a.split("."), e = "geci" == d[0] ? 1 : 0; e < d.length; e++) c[d[e]] = c[d[e]] || {}, e == d.length - 1 && b && (c[d[e]] = b), c = c[d[e]]; return c }, toArray: function(a) { if (!a) return []; if ("toArray" in Object(a)) return a.toArray(); for (var b = a.length || 0, c = new Array(b); b--;) c[b] = a[b]; return c }, isHTMLCollection: function(a) { var b = Object.prototype.toString.call(a); return "object" == typeof a && /^\[object (HTMLCollection|NodeList|Object)\]$/.test(b) && "length" in a && void 0 !== a.length && (0 === a.length || "object" == typeof a[0] && a[0].nodeType > 0) }, extend: function(a, b) { for (var c in a) b.hasOwnProperty(c) || (b[c] = a[c]); return b }, resolveVariable: function(a, b) { if (!b) return null; for (var c, d, e = b, f = /([\w-_])+/g; d = f.exec(a);) { if (c = d[0], !e.hasOwnProperty(c)) { e = void 0; break } e = e[c] } return e }, guid: function() { return s4() + s4() + "-" + s4() + "-" + s4() + "-" + s4() + "-" + s4() + s4() + s4() }, stopEvent: function(a) { a.preventDefault ? a.preventDefault() : a.returnValue = !1 }, filterHandler: function(a, b) { return function(c) { c.customType == a && b(c) } }, addHandler: function(a, b, c, d) { if (a instanceof Array) { for (var e = [], f = 0; f < a.length; f++) e.push(this.addHandler(a[f], b, c, d)); return e } var g; if (d = d || !1, this.eventModel(a)) g = c, a.addEventListener(b, g, d); else { var h = -1 == htmlEvents.indexOf(b); h ? a.attachEvent("ondataavailable", this.filterHandler(b, c)) : (g = function() { c.apply(a, arguments) }, a.attachEvent("on" + b, g)) } var i = geci.dom.getUID(a); return i in eventHandlers || (eventHandlers[i] = {}), b in eventHandlers[i] || (eventHandlers[i][b] = []), eventHandlers[i][b].push([g, d]), g }, removeHandler: function(a, b, c, d) { d = d || !1; var e = this.getHandlerIndex(a, b, c, d); if (~e) { this.eventModel(a) ? a.removeEventListener(b, c, d) : a.detachEvent("on" + b, c); var f = geci.dom.getUID(a); eventHandlers[f][b].splice(e, 1) } }, removeAllHandlers: function(a, b) { var c = geci.dom.getUID(a); if (c in eventHandlers && b in eventHandlers[c]) { for (var d = 0; d < eventHandlers[c][b].length; d++) { var e = eventHandlers[c][b][d]; this.eventModel(a) ? a.removeEventListener(b, e[0], e[1]) : a.detachEvent("on" + b, e[0]) } delete eventHandlers[c][b] } }, getHandlerIndex: function(a, b, c, d) { var e = geci.dom.getUID(a); if (!(e in eventHandlers)) return -1; if (!(b in eventHandlers[e])) return -1; for (var f = 0; f < eventHandlers[e][b].length; f++) { var g = eventHandlers[e][b][f]; if (c == g[0] && d == g[1]) return f } return -1 }, eventModel: function(a) { return "undefined" != typeof a.addEventListener }, shouldDefer: function(a) { for (var b = 0; b < a.length; b++) { var c = a[b]; if (c instanceof Array) return this.shouldDefer(c); if (c.match(/\/.*\//)) return !1 } return !0 }, matchesConditions: function(conditions, and) { if (!conditions) return !0; for (var matchAll = !!and, matches = !1, i = 0; i < conditions.length; i++) { var condition = conditions[i]; if (condition instanceof Array) matches = this.matchesConditions(condition, !0); else if (condition.match(/\/.*\//)) { var regex = eval(condition), ua = window.navigator.userAgent; matches = regex.test(ua) } else matches = geci.dom.test(condition); if (!matches && matchAll) return !1; if (matches && !matchAll) return !0 } return matches }, isRunnable: function(a, b) { if (!a) return !0; var c = a.only || null, d = a.except || null, e = c ? this.shouldDefer(c) : !1, f = d ? this.shouldDefer(d) : !1, g = e || f; if (!this.domReady && g) return this.bindOnReady(b); var h = !0; return c && (h = this.matchesConditions(c)), h && d && (h = !this.matchesConditions(d)), h }, isLoaded: function(a) { return !!~scriptsLoaded.indexOf(a) }, load: function(url, options) { options = options || {}; var defer = this.load.bind(this, url, options); if (this.isRunnable(options, defer)) { var done = !1, d = document, t = "script", el = d.createElement(t); if (options.data) for (var i in options.data) el.setAttribute("data-" + i, options.data[i]); var external = url.match(/^(http|\/\/)/) || options.external; external || (url = this.libraryBase + url), el.async = "undefined" != typeof options.async ? options.async : !0, el.src = url; var p = d.getElementsByTagName(t)[0]; p.parentNode.insertBefore(el, p), el.onreadystatechange = el.onload = function() { var state = el.readyState; done || state && !/loaded|complete/.test(state) || (done = !0, options.name && (scriptsLoaded.push(options.name), geci.dispatchEvent("scriptLoad", options)), options.callback ? options.callback() : options.scope && options.onLoad && groupCall(eval(options.scope), options.onLoad)()) } } }, runStack: function(a, b, c, d) { var e = this.runStack.bind(this, a, b, c, d); this.isRunnable(b, e) && (c || d) && (this.bindOnReady(groupCall(a, c)), this.bindOnLoad(groupCall(a, d))) }, loadVendor: function(a, b, c, d) { var e = geci.vendors, f = e[a], g = this.loadVendor.bind(this, a, b, c, d); this.isRunnable(b, g) && (f.enable && f.enable(b), c && this.bindOnReady(groupCall(f, c)), d && this.bindOnLoad(groupCall(f, d))) }, bindOnReady: function(a, b) { if (a) { var c = this, d = document, e = this.eventModel(d), f = e ? "DOMContentLoaded" : "readystatechange", g = e ? "interactive" : "complete", h = function() { d.readyState === g && (c.domReady = !0, c.removeHandler(d, f, h), a.call(b)) }; c.domReady ? a.call(b) : this.addHandler(d, f, h) } }, getQueryObject: function(a, b) { var c; if ("string" == typeof a && (b = a, a = {}), b) { var d = b.indexOf("?"); c = ~d ? b.split("#")[0].substr(d) : null } else c = document.location.search; if (c) { c = c.substr(1); var e = c.split("&"), f = {}; e.forEach(function(a) { var b = a.split("="); f[b[0]] = decodeURIComponent(b[1]) }); for (var g in a) f[g] = a[g]; return f } return a || {} }, getHashObject: function() { var a = {}, b = window.location.hash.substr(1).split("&"), c = {}; b.forEach(function(a) { var b = a.split("="); c[b[0]] = decodeURIComponent(b[1]) }); for (var d in a) c[d] = a[d]; return c }, getQueryString: function(a, b) { "string" == typeof a && (b = a, a = {}); var c = [], d = this.getQueryObject(a, b); for (var e in d) c.push(e + "=" + encodeURIComponent(d[e])); return c ? "?" + c.join("&") : null }, isEnabled: function(a) { return "undefined" != typeof geci.vendors[a] }, bindOnLoad: function(a, b) { a && this.addHandler(window, "load", a.bind(b)) }, render: function(a, b, c, d) { if (!this.isLoaded("dustjs") || !this.isLoaded("dustjs-templates")) { var e = this.render.bind(this, a, b, c, !0); return d ? !1 : geci.addEventListener("scriptLoad", e) } dust.render(a, b, c) } }, window.geci.createDispatcher(window.geci) }(window, document), geci.ns("dom", function() { return { test: function(a) { switch (a.charAt(0)) { case ".": return this.allByClass(a.substr(1)).length > 0; case "#": return !!this.findById(a.substr(1)); default: return this.allByTag(a).length > 0 } }, getPosition: function(a) { for (var b = 0, c = 0; null !== a;) b += a.offsetLeft, c += a.offsetTop, a = a.offsetParent; return { x: b, y: c } }, replace: function(a, b) { var c = a.nextSibling, d = a.parentNode; this.remove(a), c ? d.insertBefore(b, c) : d.appendChild(b) }, remove: function(a) { a.parentNode.removeChild(a) }, empty: function(a) { for (; a.hasChildNodes();) a.removeChild(a.firstChild) }, triggerEvent: function(a, b) { "string" == typeof b && (b = geci.createEvent(b)), a.dispatchEvent ? a.dispatchEvent(b) : a.fireEvent && a.fireEvent("ondataavailable", b) }, pipeEvent: function(a, b, c) { var d = this; geci.addHandler(a, c, function(a) { d.triggerEvent(b, a) }) }, addClass: function(a, b) { var c = a instanceof Array ? geci.toArray(a) : [a]; c.forEach(function(a) { var c; a.className ? (c = a.className.split(" "), c.indexOf(b) < 0 && c.push(b)) : c = [b], a.className = c.join(" ") }) }, removeClass: function(a, b) { if (!a) return null; var c = a instanceof Array ? geci.toArray(a) : [a]; c.forEach(function(a) { if (a.className) { var c = a.className.split(" "); if (!(b in c)) { var d = []; c.forEach(function(a) { a != b && d.push(a) }), a.className = d.join(" ") } } }) }, hasClass: function(a, b) { var c = " "; return (c + a.className + c).indexOf(c + b + c) > -1 }, toggleClass: function(a, b) { if (a.classList) a.classList.toggle(b); else { for (var c = a.className.split(" "), d = -1, e = c.length; e--;) c[e] === b && (d = e); d >= 0 ? c.splice(d, 1) : c.push(b), a.className = c.join(" ") } }, create: function(a, b) { var c = document.createElement(a); return b && (c.innerHTML = b), c }, findById: function(a) { return document.getElementById(a) }, allByTag: function(a, b) { return geci.toArray((b || document).getElementsByTagName(a)) }, deepFind: function(a, b) { var c, d = []; do { if (this.hasClass(a, b)) d.push(a); else for (c = a.previousSibling; c;) { if (this.hasClass(c, b)) { d.push(c); break } c = c.previousSibling } a = a.parentNode } while (a); return d }, allByClass: function(a, b) { var c = "getElementsByClassName", d = this; if ((b || document)[c]) return geci.toArray((b || document)[c](a)); var e = [], f = this.allByTag("*", b || document); return f.forEach(function(b) { d.hasClass(b, a) && e.push(b) }), geci.toArray(e) }, scrollToElement: function(a, b, c) { var d = this.getOffset(a).top + this.getScrollTop(); c && (d -= c), window.scroll(b || 0, d) }, scrollTo: function(a, b) { if (!(0 >= b)) { var c = document.documentElement.scrollTop || document.body.scrollTop, d = a - c, e = d / b * 10; setTimeout(function() { document.documentElement.scrollTop = c + e, document.body.scrollTop = c + e, c != a && geci.dom.scrollTo(a, b - 10) }, 10) } }, getScrollTop: function() { if ("pageYOffset" in window) return window.pageYOffset; var a = document.body, b = document.documentElement; return b = b.clientHeight ? b : a, b.scrollTop }, getWindowWidth: function() { return window.innerWidth ? window.innerWidth : document.documentElement.clientWidth }, getWindowHeight: function() { return window.innerHeight ? window.innerHeight : document.documentElement.clientHeight }, getOffset: function(a) { for (var b = 0, c = 0; a && !isNaN(a.offsetLeft) && !isNaN(a.offsetTop);) b += a.offsetLeft - a.scrollLeft, c += a.offsetTop - a.scrollTop, a = a.offsetParent; return { top: c, left: b } }, getData: function(a, b) { var c, d = new RegExp("data" + (b ? "-" + b + "-(.*)" : "-(.*)")); return geci.toArray(a.attributes).forEach(function(a) { var b = d.exec(a.name); b && (c = c || {}, c[b[1]] = a.value) }), c || !1 }, setData: function(a, b, c) { a.setAttribute("data-" + b, c) }, clearData: function(a, b) { var c = new RegExp("data" + (b ? "-" + b + "-(.*)" : "-(.*)")); geci.toArray(a.attributes).forEach(function(b) { var d = c.exec(b.name); d && a.removeAttribute(b.name) }) }, getUID: function(a) { return "undefined" == typeof a.uid && (a.uid = geci.guid()), a.uid }, str2html: function(a) { var b = geci.dom.create("div"); return b.innerHTML = a, b.firstChild }, getParameterByName: function(a) { a = a.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); var b = new RegExp("[\\?&]" + a + "=([^&#]*)"), c = b.exec(window.location.search); return null === c ? "" : decodeURIComponent(c[1].replace(/\+/g, " ")) }, setAttribute: function(a, b, c) { if (!a) return null; for (var d = geci.isHTMLCollection(a) ? a : [a], e = 0; e < d.length; e++) d[e].setAttribute(b, c) }, removeAttribute: function(a, b) { if (!a) return null; for (var c = geci.isHTMLCollection(a) ? a : [a], d = 0; d < c.length; d++) c[d].removeAttribute(b) } } }()), geci.ns("error", function() { return { general: function(a) { this.description = a }, service: function(a, b) { this.status = a, this.description = b } } }()); var dom = geci.dom; geci.ns("hooks", function() { return { hookClickEvents: function() { for (var a = dom.allByClass("event"), b = 0; b < a.length; b++) { var c = a[b]; if (!c.gtmHookClick) { c.gtmHookClick = !0; var d = dom.getData(c).trigger || "click"; geci.vendors.gtm2.eventHandler(c, d) } } } } }()), geci.ns("storage", function() { function a(a) { return a && Object.keys(a) && 0 === Object.keys(a).length } return geci.bindOnReady(function() { function b(a, b, c) { a.addEventListener ? a.addEventListener(b, c, !1) : a.attachEvent("on" + b, c) } return "undefined" == typeof Storage ? void console.warn("Your browser does not support storage, consider update it") : (window.memoryStorage = {}, a(window.memoryStorage) && window.localStorage.setItem("getSessionStorage", Date.now()), void b(window, "storage", function(b) { if ("getSessionStorage" == b.key) window.localStorage.setItem("sessionStorage", JSON.stringify(window.memoryStorage)), window.localStorage.removeItem("sessionStorage"); else if ("sessionStorage" == b.key && a(window.memoryStorage)) { var c = JSON.parse(b.newValue); for (var d in c) window.memoryStorage[d] = c[d] } })) }), { set: function(a, b, c) { if ("object" != typeof b) { var d = {}; d.data = b, b = d } if (!a || !b) return !1; if (a && b) { var e = 864e5; b.expiration = c ? c : e; var f = JSON.stringify(b); return window.sessionStorage.setItem(a, f), window.memoryStorage[a] = f, b } }, get: function(b) { a(window.memoryStorage) && (window.memoryStorage = window.sessionStorage); var c = window.memoryStorage[b]; if (!c) return null; var d, e = JSON.parse(c); if (!e.expiration) return e; d = Number(e.expiration); var f = Number(window.localStorage.getItem("getSessionStorage")); return f ? Date.now() > f + d ? (console.warn("El objeto " + b + " ha expirado"), geci.storage.clearItem(b), null) : e : (console.warn("El objeto " + b + " ha expirado"), geci.storage.clearItem(b), null) }, clearItem: function(a) { window.sessionStorage.removeItem(a), window.localStorage.removeItem(a) }, clear: function() { for (var a in window.memoryStorage) window.sessionStorage.getItem(a) && window.sessionStorage.removeItem(a), window.localStorage.getItem(a) && window.localStorage.removeItem(a); return window.memoryStorage = {}, !0 } } }()); var dom = geci.dom; geci.ns("vendors.gtm2", function() { var a = window; return { dataLayerName: "dataLayer", url: "//www.googletagmanager.com/gtm.js?id=", push: function(b) { a[this.dataLayerName].push(b) }, getData: function(a) { for (var b = {}, c = dom.deepFind(a, "dataholder"), d = 0; d < c.length; d++) { var e = dom.getData(c[d]); if (e.json) { if (!e.scope || b[e.scope]) return JSON.parse(e.json); b[e.scope] = JSON.parse(e.json) } } return b }, eventHandler: function(a, b) { var c = this; geci.addHandler(a, b, function(d) { var e = dom.getData(a).event || null, f = c.getData(a); ("product_click" === e || "promotion_click" === e) && "_blank" != a.target && a.className.indexOf("modal") < 0 && (geci.stopEvent(d), f.eventCallback = function() { window.location.assign(a.href) }), e && (f.event = e), "click" != b && (f.domValue = (d.target || {}).value), c.push(f) }) }, enable: function(b) { var c = b.dataLayer || "dataLayer", d = "dataLayer" != c ? "&l=" + c : ""; this.dataLayerName = c, a[c] = a[c] || [], a[c].push({ "gtm.start": (new Date).getTime(), event: "gtm.js" }), geci.load(this.url + b.id + d), geci.bindOnLoad(geci.hooks.hookClickEvents.bind(this)) /*,geci.moonshine.dispatchEvent("loadedGTM")*/ } } }()), function() { geci.loadVendor("gtm2", { id: "GTM-MKP34N" }), geci.load("//nexus.ensighten.com/elcorteingles/sfera/Bootstrap.js", { name: "ensighten" }) }(); //# sourceMappingURL=geci.sfera.min.js.map