{"version":3,"sources":["webpack:///webpack/universalModuleDefinition?5ca6","webpack:///vam.js","webpack:///webpack/bootstrap 8ad91b65dbf1724466d3?f75a","webpack:///./src/index.js","webpack:///./package.json","webpack:///./src/dfp-pixel.js","webpack:///./src/publicidad.js","webpack:///./src/constants.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","0","_interopRequireDefault","obj","__esModule","default","Object","defineProperty","value","VERSION","undefined","_package","_package2","_publicidad","_publicidad2","_constants","Voonto","ready","then","app","config","lookup","CONFIG_NAMESPACE","media","options","Error","$","each","printAds","on","event","data","JSON","parse","version","42","name","description","main","scripts","start","build","report","contributors","license","devDependencies","babel-core","babel-loader","babel-polyfill","babel-preset-es2015","chai","chalk","html-webpack-plugin","json-loader","mocha","mocha-loader","webpack","webpack-shell-plugin","43","_ord","Math","random","UserTypes","freeze","ANONYMOUS","Genders","FEM","MAS","_Voonto","when","gigyaux","getUserType","append","userdata","gender","age","responseGetUserInfo","user","44","_classCallCheck","instance","Constructor","TypeError","_createClass","defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","key","protoProps","staticProps","prototype","_app","Publicidad","configGDPMedio","configGDP","debug","checkConfigFromURL","medio","getMedio","listaEstandardDelayed","gpt_inicializado","amazonads_inicializado","listaPosicionesInsertadas","listaIdsInsertados","tipoDispositivo","getTipoDispositivo","tipoPagina","getTipoPagina","tipoFormatoJSON","getTipoFormatoJSON","log","valueUserType","esMedioResponsive","cargaLibreriaGPT","cargaLibreriaAmazonAds","googletag","cmd","push","pubads","collapseEmptyDivs","enableKrux","Krux","vocento","segments","setTargeting","singleRequest","enableSingleRequest","syncRendering","enableSyncRendering","enableServices","GPT_READY","trigger","setTimeout","GPT_TIMEOUT","hayPriorizadas","eval","listaPriorizadas","listaArrayPriorizadas","split","completadasPriorizadas","hayRetrasadas","listaRetrasadas","comprobamosExcepciones","targetings","getTargetingsConfig","addEventListener","ev","div_id","slot","getSlotElementId","position","getTargeting","container$","paramsSlot","isEmpty","SLOT_EMPTY","SLOT_RENDERED","post_callback","post_event","index","inArray","splice","esPriorizada","displayDelayed","pintaPriorizadas","TIMEOUT_POSICIONES_ESTANDAR","datos","esJSON","arguments","params","constructor","normalizaParams","extend","serverType","getServerType","hideNoAds","outOfPage","defineSlot","getDefineSlotParam","refresh","responsive","pre_callback","pre_event","oas","tags","idAds","getIdDiv","attr","existePosEnConfigGDPMedio","getResponsiveParam","scriptText","targetingsTags","size_dc","getSizesGoogle","hideText","targetingText","tag","getValueUser","getGigyaUserType","cadenaTipoDispositivo","location","href","indexOf","pattern","esValida","exec","targetingsURL","targetingsURL_decoded","decodeURIComponent","targetingsURL_trozos","trozo","clave_y_valor","trozo_clave","trozo_valor","e","enableTopics","voc_top","topics","enableTpag","objetoMapping","sizeMapping","defineSizeMapping","isArray","getSizeMapping","definicion","script","getNombreSlot","getOasSitepage","getClavePosicionInsertada","oasSitepage","top","GPT_ID_VOCENTO","err","contieneMacroEdicion","cadenaEdicion","getEdition","startsWith","endsWith","replace","OAS","adunit","add_size_p","responsive_p","viewportSize","responsive_ad","j","singleSize","gigyaUserType","userType","valueUser","arrayUsers","suscriptor","trial","registrado","anonimo","xpath","size","msg","tipo","console","warn","error","cTipoDispositivo","esResponsive","screen_width","parseInt","window","innerWidth","clave","valor","resolucionMaxima","resolucionMinima","maximo","minimo","cTempTipo","toLowerCase","tiposPublicidad","getTipoPaginaABC","getTipoPaginaMujerhoy","getTipoPaginaPortalesLocales","reVideosAntiguos","reVideos","esVideo","pathname","reGaleriasAntiguos2","reGaleriasAntiguos","reGalerias","esGaleria","reGraficos","esGrafico","reNoticiasAntiguos","reNoticias","esNoticia","reVideosOld","reVideosBlogs","hostname","reGaleriasOld","reGaleriasBlogs","reNoticiasBlogs","reNoticiasRecetas","reGraficosOld","reNoticiasOld","reVideochats","esVideochat","configGDPAux","excepciones","keys","match","unix","round","Date","fechaini","fecha_in","fechafin","fecha_fin","targetingsMedio","targetingsPagina","lista","sonPosicionesPriorizadas","pintaListaPosiciones","listaPositions","getScriptText","enableAmazonAds","AMAZONADS_READY","idDiv","display","tieneParamResponsive","createResponsive","dispositivos","dispositivo","dispositivoCapitalizado","charAt","toUpperCase","slice","anchoMinimo","anchoMaximo","dimension","ALTOS_MINIMOS_DISPOSITIVOS","existe","hide","checkActivePosition","forceActivePosition","isActive","tipoDispositivoAux","posicionConfig","desactivadoen","programada","one","isInView","getAdGoogle","priorized","retrasada","esRetrasada","pintarRetrasada","getAdMeta","esPosPriorizada","eventParams","getEventsPosition","tParams","hasPreevent","pintarPosicionRefresh","positionEvents","infoSlot","gads","document","createElement","async","type","useSSL","protocol","src","node","getElementsByTagName","parentNode","insertBefore","amznads","a","s","asyncParams","AMAZONADS_ID_VOCENTO","callbackFn","setTargetingForGPTAsync","timeout","AMAZONADS_TIMEOUT_ERROR_CARGA_JS","editions","EDITIONS_NAMESPACE","current","45","mobile","tablet","desktop","POSITION_FLUID"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,WAAAD,IAEAD,EAAA,WAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAP,WACAS,GAAAF,EACAG,QAAA,EAUA,OANAL,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,QAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KAqCA,OATAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,GAGAR,EAAA,KDgBMS,EACA,SAAUd,EAAQD,EAASM,GAEhC,YAmBA,SAASU,GAAuBC,GAAO,MAAOA,IAAOA,EAAIC,WAAaD,GAAQE,QAASF,GAjBv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OAAU,IACVC,QAAW,KAE9CC,iBAAmC,UACnC3O,gBAAmC,mBACnCD,aAAmC","file":"vam.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"AdsManager\"] = factory();\n\telse\n\t\troot[\"AdsManager\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"AdsManager\"] = factory();\n\telse\n\t\troot[\"AdsManager\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ 0:\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.VERSION = undefined;\n\t\n\tvar _package = __webpack_require__(42);\n\t\n\tvar _package2 = _interopRequireDefault(_package);\n\t\n\t__webpack_require__(43);\n\t\n\tvar _publicidad = __webpack_require__(44);\n\t\n\tvar _publicidad2 = _interopRequireDefault(_publicidad);\n\t\n\tvar _constants = __webpack_require__(45);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tVoonto.ready.then(function (app) {\n\t var config = app.lookup(_constants.CONFIG_NAMESPACE);\n\t\n\t if (!config.media || !config.options) {\n\t throw Error('[Ads Manager] missing configuration');\n\t }\n\t\n\t new _publicidad2.default(app, config.media, config.options, false);\n\t\n\t Voonto.$('[data-voc-vam]').each(function () {\n\t _publicidad2.default.printAds(Voonto.$(this), false);\n\t });\n\t\n\t app.on('vam:refresh', function (event, data) {\n\t data = typeof data === 'string' ? JSON.parse(data) : data;\n\t _publicidad2.default.printAds(data);\n\t });\n\t});\n\t\n\tvar VERSION = exports.VERSION = _package2.default.version;\n\n/***/ }),\n\n/***/ 42:\n/***/ (function(module, exports) {\n\n\tmodule.exports = {\n\t\t\"name\": \"vam\",\n\t\t\"version\": \"3.2.1\",\n\t\t\"description\": \"\",\n\t\t\"main\": \"src/index.js\",\n\t\t\"scripts\": {\n\t\t\t\"start\": \"webpack-dev-server\",\n\t\t\t\"build\": \"./node_modules/webpack/bin/webpack.js\",\n\t\t\t\"report\": \"plato -r -d report -l .jshintrc -t ads-manager src\"\n\t\t},\n\t\t\"contributors\": [\n\t\t\t\"Jose Manuel Ortega <jmortega@vocento.com>\",\n\t\t\t\"Ernesto V. <evladpereda@ces.vocento.com>\",\n\t\t\t\"Iván Pérez <ivanperez@vocento.com>\"\n\t\t],\n\t\t\"license\": \"SEE LICENSE IN LICENSE.md\",\n\t\t\"devDependencies\": {\n\t\t\t\"babel-core\": \"^6.17.0\",\n\t\t\t\"babel-loader\": \"^6.2.5\",\n\t\t\t\"babel-polyfill\": \"^6.16.0\",\n\t\t\t\"babel-preset-es2015\": \"^6.16.0\",\n\t\t\t\"chai\": \"^3.5.0\",\n\t\t\t\"chalk\": \"^1.1.3\",\n\t\t\t\"html-webpack-plugin\": \"^2.24.1\",\n\t\t\t\"json-loader\": \"^0.5.4\",\n\t\t\t\"mocha\": \"^3.1.0\",\n\t\t\t\"mocha-loader\": \"^1.0.0\",\n\t\t\t\"webpack\": \"^1.13.3\",\n\t\t\t\"webpack-shell-plugin\": \"^0.4.3\"\n\t\t}\n\t};\n\n/***/ }),\n\n/***/ 43:\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\tvar UserTypes = Object.freeze({\n\t ANONYMOUS: 'anonimo'\n\t}),\n\t Genders = Object.freeze({\n\t FEM: 'f',\n\t MAS: 'm'\n\t});\n\t\n\tvar _Voonto = Voonto,\n\t $ = _Voonto.$;\n\t\n\t\n\tVoonto.ready.then(function (app) {\n\t app.when('vocuser:ready').then(function (gigyaux) {\n\t\n\t if (gigyaux.getUserType() === UserTypes.ANONYMOUS) {\n\t $('head').append('<img src=\"//pubads.g.doubleclick.net/activity;dc_iu=/4900/pixel.bfp.vocento;ord=' + _ord() + ';dc_seg=76171930?\" width=\"1\" height=\"1\" border=\"0\" />');\n\t } else {\n\t $('head').append('<img src=\"//pubads.g.doubleclick.net/activity;dc_iu=/4900/pixel.bfp.vocento;ord=' + _ord() + ';dc_seg=76172050?\" width=\"1\" height=\"1\" border=\"0\" />');\n\t\n\t app.when('vocuser:userdata').then(function (userdata) {\n\t var gender, age;\n\t\n\t gender = userdata.responseGetUserInfo.user.gender;\n\t age = userdata.responseGetUserInfo.user.age;\n\t\n\t switch (gender) {\n\t case Genders.FEM:\n\t $('head').append('<img src=\"//pubads.g.doubleclick.net/activity;dc_iu=/4900/pixel.bfp.vocento;ord=' + _ord() + ';dc_seg=75868810?\" width=\"1\" height=\"1\" border=\"0\" />');\n\t break;\n\t case Genders.MAS:\n\t $('head').append('<img src=\"\\' + urlProtocol + \\'://pubads.g.doubleclick.net/activity;dc_iu=/4900/pixel.bfp.vocento;ord=' + _ord() + ';dc_seg=75868570?\" width=\"1\" height=\"1\" border=\"0\" />');\n\t break;\n\t }\n\t\n\t switch (true) {\n\t case '' !== age && 17 >= age:\n\t $('head').append('<img src=\"\\' + urlProtocol + \\'://pubads.g.doubleclick.net/activity;dc_iu=/4900/pixel.bfp.vocento;ord=' + _ord() + ';dc_seg=75867610?\" width=\"1\" height=\"1\" border=\"0\" />');\n\t break;\n\t case 18 <= age && 24 >= age:\n\t $('head').append('<img src=\"\\' + urlProtocol + \\'://pubads.g.doubleclick.net/activity;dc_iu=/4900/pixel.bfp.vocento;ord=' + _ord() + ';dc_seg=75867850?\" width=\"1\" height=\"1\" border=\"0\" />');\n\t break;\n\t case 25 <= age && 34 >= age:\n\t $('head').append('<img src=\"\\' + urlProtocol + \\'://pubads.g.doubleclick.net/activity;dc_iu=/4900/pixel.bfp.vocento;ord=' + _ord() + ';dc_seg=75867970?\" width=\"1\" height=\"1\" border=\"0\" />');\n\t break;\n\t case 35 <= age && 44 >= age:\n\t $('head').append('<img src=\"\\' + urlProtocol + \\'://pubads.g.doubleclick.net/activity;dc_iu=/4900/pixel.bfp.vocento;ord=' + _ord() + ';dc_seg=75868210?\" width=\"1\" height=\"1\" border=\"0\" />');\n\t break;\n\t case 45 <= age && 54 >= age:\n\t $('head').append('<img src=\"\\' + urlProtocol + \\'://pubads.g.doubleclick.net/activity;dc_iu=/4900/pixel.bfp.vocento;ord=' + _ord() + ';dc_seg=75868330?\" width=\"1\" height=\"1\" border=\"0\" />');\n\t break;\n\t case '' !== age && 54 > age:\n\t $('head').append('<img src=\"\\' + urlProtocol + \\'://pubads.g.doubleclick.net/activity;dc_iu=/4900/pixel.bfp.vocento;ord=' + _ord() + ';dc_seg=75868450?\" width=\"1\" height=\"1\" border=\"0\" />');\n\t break;\n\t }\n\t });\n\t }\n\t });\n\t});\n\t\n\t/* Private */\n\t\n\tfunction _ord() {\n\t return Math.random() * 10000000000000;\n\t}\n\n/***/ }),\n\n/***/ 44:\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _package = __webpack_require__(42);\n\t\n\tvar _constants = __webpack_require__(45);\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar _Voonto = Voonto,\n\t $ = _Voonto.$;\n\t\n\tvar _app;\n\t\n\tvar Publicidad = function () {\n\t function Publicidad(app, configGDPMedio, configGDP, debug) {\n\t _classCallCheck(this, Publicidad);\n\t\n\t // Inicializacion de variables de instancia estaticas\n\t _app = app;\n\t Publicidad.configGDPMedio = configGDPMedio;\n\t Publicidad.configGDP = configGDP;\n\t Publicidad.debug = debug;\n\t\n\t // Detectamos si se fuerza via URL alguna configuracion\n\t Publicidad.checkConfigFromURL();\n\t\n\t Publicidad.medio = Publicidad.getMedio();\n\t Publicidad.listaEstandardDelayed = [];\n\t Publicidad.gpt_inicializado = false;\n\t Publicidad.amazonads_inicializado = false;\n\t Publicidad.listaPosicionesInsertadas = {};\n\t Publicidad.listaIdsInsertados = [];\n\t Publicidad.tipoDispositivo = Publicidad.getTipoDispositivo();\n\t Publicidad.tipoPagina = Publicidad.getTipoPagina();\n\t Publicidad.tipoFormatoJSON = Publicidad.getTipoFormatoJSON();\n\t Publicidad.log('En constructor. tipoDispositivo: ' + Publicidad.tipoDispositivo + ', tipoPagina: ' + Publicidad.tipoPagina + ', tipoFormatoJSON: ' + Publicidad.tipoFormatoJSON + ' (Version ' + _package.version + ')');\n\t Publicidad.valueUserType = null;\n\t Publicidad.esMedioResponsive = Publicidad.esMedioResponsive();\n\t\n\t // Cargamos las librerias de GTP y de Amazon Ads lo antes posible (para no penalizar la visibilidad de la publicidad).\n\t Publicidad.cargaLibreriaGPT();\n\t Publicidad.cargaLibreriaAmazonAds();\n\t\n\t // Inicializacion de la libreria GPT\n\t googletag.cmd.push(function () {\n\t googletag.pubads().collapseEmptyDivs();\n\t if (typeof Publicidad.configGDPMedio.enableKrux != \"undefined\" && Publicidad.configGDPMedio.enableKrux && typeof Krux != \"undefined\" && typeof Krux.vocento != \"undefined\" && typeof Krux.vocento.segments != \"undefined\" && typeof Krux.vocento.user != \"undefined\") {\n\t googletag.pubads().setTargeting('ksg', Krux.vocento.segments);\n\t googletag.pubads().setTargeting('kuid', Krux.vocento.user);\n\t }\n\t if (Publicidad.configGDPMedio.singleRequest) googletag.pubads().enableSingleRequest();\n\t if (Publicidad.configGDPMedio.syncRendering) googletag.pubads().enableSyncRendering();\n\t googletag.enableServices();\n\t\n\t // Disparamos el evento de GPT inicializada\n\t Publicidad.log('En constructor. Disparamos evento ' + _constants.GPT_READY);\n\t _app.trigger(_constants.GPT_READY);\n\t Publicidad.gpt_inicializado = true;\n\t });\n\t\n\t // Disparamos el evento de GPT inicializado tras N segundos para liberar posibles recursos que esten bloqueados\n\t setTimeout(function () {\n\t if (!Publicidad.gpt_inicializado) {\n\t Publicidad.log('En constructor. Disparamos evento ' + _constants.GPT_READY + ' tras timeout', 'warn');\n\t _app.trigger(_constants.GPT_READY);\n\t }\n\t }, _constants.GPT_TIMEOUT);\n\t\n\t // Gestion de posiciones priorizadas\n\t Publicidad.hayPriorizadas = eval('Publicidad.configGDP.priorizadas.' + Publicidad.tipoDispositivo) !== undefined && eval('Publicidad.configGDP.priorizadas.' + Publicidad.tipoDispositivo + '.listaPosiciones') !== undefined ? true : false;\n\t Publicidad.listaPriorizadas = Publicidad.hayPriorizadas ? eval('Publicidad.configGDP.priorizadas.' + Publicidad.tipoDispositivo + '.listaPosiciones') : '';\n\t if (Publicidad.hayPriorizadas) Publicidad.log('En constructor. Hay posiciones priorizadas: ' + Publicidad.listaPriorizadas);\n\t Publicidad.listaArrayPriorizadas = Publicidad.listaPriorizadas.split(\",\");\n\t Publicidad.completadasPriorizadas = false;\n\t\n\t // Gestion de posiciones retrasadas\n\t Publicidad.hayRetrasadas = eval('Publicidad.configGDP.retrasadas.' + Publicidad.tipoDispositivo) !== undefined && eval('Publicidad.configGDP.retrasadas.' + Publicidad.tipoDispositivo + '.listaPosiciones') !== undefined ? true : false;\n\t Publicidad.listaRetrasadas = Publicidad.hayRetrasadas ? eval('Publicidad.configGDP.retrasadas.' + Publicidad.tipoDispositivo + '.listaPosiciones') : '';\n\t if (Publicidad.hayRetrasadas) Publicidad.log('En constructor. Hay posiciones retrasadas: ' + Publicidad.listaRetrasadas);\n\t\n\t // Tratamiento de excepciones y de targetings\n\t Publicidad.configGDP = Publicidad.comprobamosExcepciones();\n\t Publicidad.targetings = Publicidad.getTargetingsConfig();\n\t\n\t // Gestion de eventos de pintado de publicidad\n\t googletag.cmd.push(function () {\n\t googletag.pubads().addEventListener('slotRenderEnded', function (ev) {\n\t var div_id = ev.slot.getSlotElementId();\n\t var position = ev.slot.getTargeting('pos');\n\t var container$ = $(\"#\" + div_id);\n\t var paramsSlot = container$.data(\"params\");\n\t\n\t if (ev.isEmpty) {\n\t Publicidad.log('En constructor. slotRenderEnded. La posicion ' + position + ' isEmpty');\n\t container$.trigger(_constants.SLOT_EMPTY);\n\t } else {\n\t Publicidad.log('En constructor. slotRenderEnded. La posicion ' + position + ' ha sido pintada en el DIV ' + div_id);\n\t container$.trigger(_constants.SLOT_RENDERED);\n\t }\n\t\n\t // Comprobacion si tiene eventos post_callback o post_event\n\t if (paramsSlot) {\n\t if (paramsSlot.post_callback) {\n\t Publicidad.log('En constructor. slotRenderEnded. La posicion ' + position + ' tiene el siguiente postCallback: ' + paramsSlot.post_callback);\n\t eval(paramsSlot.post_callback);\n\t }\n\t\n\t if (paramsSlot.post_event) {\n\t Publicidad.log('En constructor. slotRenderEnded. La posicion ' + position + ' tiene el siguiente postEvent: ' + paramsSlot.post_event);\n\t _app.trigger(paramsSlot.post_event);\n\t }\n\t }\n\t\n\t // Quitamos la posicion de la lista de posiciones priorizadas\n\t var index = $.inArray(position[0], Publicidad.listaArrayPriorizadas);\n\t if (index != -1) {\n\t Publicidad.listaArrayPriorizadas.splice(index, 1);\n\t }\n\t\n\t // Quitamos la posicion de la lista de posiciones estandar encoladas\n\t if (Publicidad.hayPriorizadas && Publicidad.listaEstandardDelayed.length > 0 && !Publicidad.esPriorizada(paramsSlot)) {\n\t index = $.inArray(position[0], Publicidad.listaEstandardDelayed);\n\t if (index != -1) {\n\t Publicidad.listaEstandardDelayed.splice(index, 1);\n\t }\n\t }\n\t\n\t // Si esta era la ultima priorizada pintamos las estandar\n\t if (!Publicidad.completadasPriorizadas && Publicidad.listaArrayPriorizadas.length === 0) {\n\t Publicidad.completadasPriorizadas = true;\n\t Publicidad.displayDelayed();\n\t }\n\t });\n\t });\n\t\n\t // Si hay posiciones priorizadas las pintamos e invocamos el pintado de las estandar una vez pintadas estas\n\t if (Publicidad.hayPriorizadas) {\n\t Publicidad.pintaPriorizadas(Publicidad.listaPriorizadas);\n\t\n\t // Si han transcurrido N segundos y todavia no se han lanzado las posiciones estandar las forzamos\n\t setTimeout(function () {\n\t if (Publicidad.listaEstandardDelayed.length > 0) {\n\t Publicidad.completadasPriorizadas = true;\n\t Publicidad.displayDelayed();\n\t }\n\t }, _constants.TIMEOUT_POSICIONES_ESTANDAR);\n\t }\n\t\n\t return this;\n\t }\n\t\n\t /**\r\n\t * Normalizacion de parametros\r\n\t */\n\t\n\t\n\t _createClass(Publicidad, [{\n\t key: 'version',\n\t\n\t\n\t /**\r\n\t * Version de la libreria\r\n\t */\n\t value: function version() {\n\t return _package.version;\n\t }\n\t\n\t /**\r\n\t * Funcion que busca el medio en el que nos encontramos, dentro del fichero de configuracion\r\n\t * @return string\r\n\t */\n\t\n\t }, {\n\t key: 'printAds',\n\t\n\t\n\t /**\r\n\t * Llamada de compatibilidad para paginas integradas con version previa de GDP\r\n\t */\n\t value: function printAds(datos) {\n\t var esJSON = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\t\n\t var params = this.constructor.normalizaParams(datos, esJSON);\n\t this.constructor.printAds(params, true);\n\t }\n\t\n\t /**\r\n\t * Muestra la publicidad.\r\n\t * @param {Object} datos - Puede ser un DIV obtenido con jQuery con los atributos de configuracion, o bien un objeto JSON con la configuracion a aplicar\r\n\t * @param boolean esJSON - Indica si el objeto datos es un DIV o bien un objeto JSON\r\n\t *\r\n\t * Descripcion de parametros que puede contener el objeto JSON:\r\n\t * position => string. Posicion publicitaria a mostrar\r\n\t * id => string. ID del elemento HTML en el que se muestra\r\n\t * serverType => string. Servidor de publicidad a usar\r\n\t * hideNoAds => boolean. Oculta el elemento HTML si el adserver no ha devuelto publi\r\n\t * outOfPage => boolean. Determina si el slot de publicidad es outOfPage o no. Por defecto vale false\r\n\t * defineSlot => boolean. Indica si hay que definir o no el slot\r\n\t * refresh => boolean. Se pide la posicion de publicidad aunque ya se hubiera mostrado antes. Por defecto false\r\n\t * responsive => Indicamos si una publi se debe pintar solo en una(s) determinada(s) resolucion(es)\r\n\t * pre_callback=> funcion javascript a la que invocar previamente\r\n\t * pre_event => evento de precondicion\r\n\t * post_callback => funcion javascript a la que invocar una vez disparado el slotRendered\r\n\t * post_event => evento a disparar una vez disparado evento de slotRendered\r\n\t * oas => string. Si se rellena es el OAS a utilizar en la posicion de publicidad\r\n\t *\r\n\t * Objeto Responsive\r\n\t * El primer par de valores indica la resolucion, y en el segundo los tamanos de la posicion de publi a servir, el cual puede definirse como sigue:\r\n\t * - vacio: []\r\n\t * - single array: [ancho, alto]\r\n\t * - multi array: [ [ancho1, alto1], [ancho2, alto2], ... ]\r\n\t * - string: En cuyo caso usa la funcion ads.getSizesGoogle para obtener el array\r\n\t *\r\n\t * Ejemplo llamada:\r\n\t * ads.printAds({'position': 'robapaginas', 'id': 'roba2', 'responsive': [\r\n\t * [[0, 0], []] // Small Mobile\r\n\t * ,[[350, 200], [300,150]] // Mobile\r\n\t * ,[[750, 200], 'robapaginas'] // Tablet\r\n\t * ,[[1050, 300], [[300,150],[300,250]]] // Desktop\r\n\t * ]});\r\n\t */\n\t\n\t }], [{\n\t key: 'normalizaParams',\n\t value: function normalizaParams(datos, esJSON) {\n\t var params = {};\n\t\n\t // Distinguimos entre si recibimos un objeto DOM o bien un objeto JSON\n\t if (esJSON) {\n\t $.extend(params, {\n\t position: datos.position || null,\n\t serverType: datos.serverType || Publicidad.getServerType(params),\n\t hideNoAds: datos.hideNoAds || true,\n\t outOfPage: datos.outOfPage || false,\n\t defineSlot: datos.defineSlot || Publicidad.getDefineSlotParam(),\n\t refresh: datos.refresh || false,\n\t responsive: datos.responsive || false,\n\t pre_callback: datos.pre_callback || '',\n\t pre_event: datos.pre_event || '',\n\t post_callback: datos.post_callback || '',\n\t post_event: datos.post_event || '',\n\t oas: datos.oas || '',\n\t tags: datos.tags\n\t });\n\t } else {\n\t $.extend(params, {\n\t position: datos.data('voc-vam-position') || null,\n\t serverType: datos.data('voc-vam-servertype') || Publicidad.getServerType(params),\n\t hideNoAds: datos.data('voc-vam-hidenoads') || true,\n\t outOfPage: datos.data('voc-vam-outofpage') || false,\n\t defineSlot: datos.data('voc-vam-defineslot') || Publicidad.getDefineSlotParam(),\n\t refresh: datos.data('voc-vam-refresh') || false,\n\t responsive: datos.data('voc-vam-responsive') || false,\n\t pre_callback: datos.data('voc-vam-precallback') || '',\n\t pre_event: datos.data('voc-vam-preevent') || '',\n\t post_callback: datos.data('voc-vam-postcallback') || '',\n\t post_event: datos.data('voc-vam-postevent') || '',\n\t oas: datos.data('voc-vam-oas') || '',\n\t tags: datos.data('voc-vam-tags')\n\t });\n\t }\n\t\n\t // DIV que contendra la publicidad\n\t var idAds = Publicidad.getIdDiv(params);\n\t if (!$('#' + idAds).length && typeof $(\"[data-voc-vam-position = '\" + params.position + \"']\") !== 'undefined' && typeof $(\"[data-voc-vam-position = '\" + params.position + \"']\").attr('id') === 'undefined') {\n\t $(\"[data-voc-vam-position = '\" + params.position + \"']\").attr('id', idAds);\n\t }\n\t params.id = idAds;\n\t\n\t // Si falta algun parametro obligatorio devolvemos null\n\t if (params.position === null) {\n\t Publicidad.log('ERROR: El parametro position es obligatorio', 'warn');\n\t return null;\n\t }\n\t\n\t if (!Publicidad.existePosEnConfigGDPMedio(params.position)) {\n\t Publicidad.log('ERROR: La posicion \"' + params.position + '\" no existe en configGDPMedio', 'warn');\n\t return null;\n\t }\n\t\n\t // Construimos el parametro responsive en caso de que no venga relleno en la propia llamada\n\t if (!params.responsive && Publicidad.esMedioResponsive) params.responsive = Publicidad.getResponsiveParam(params);\n\t\n\t return params;\n\t }\n\t\n\t /**\r\n\t * Funcion que genera el scriptText que pinta la publicidad.\r\n\t * @param object params\r\n\t * @return string\r\n\t */\n\t\n\t }, {\n\t key: 'getScriptText',\n\t value: function getScriptText(params) {\n\t var scriptText;\n\t var size_dc = Publicidad.getSizesGoogle(params.position);\n\t var idAds = Publicidad.getIdDiv(params);\n\t\n\t // Codigo para ocultar el div si no hay publi\n\t var hideText = params.hideNoAds ? '.setCollapseEmptyDiv(true)' : '';\n\t\n\t // Codigo para anadir tags en el caso que la posicion de publi lo necesite\n\t var targetingsTags;\n\t var targetingText = '';\n\t if (params.tags) {\n\t // si llegan en la funcion ads.print\n\t targetingsTags = params.tags;\n\t }\n\t\n\t var tag;\n\t for (tag in targetingsTags) {\n\t targetingText += '.setTargeting(\"' + tag + '\", \"' + targetingsTags[tag] + '\")';\n\t }\n\t for (tag in Publicidad.targetings) {\n\t targetingText += '.setTargeting(\"' + tag + '\", \"' + Publicidad.targetings[tag] + '\")';\n\t }\n\t\n\t // Targeting con tipo de usuario de Gigya\n\t if (Publicidad.valueUserType === null) Publicidad.valueUserType = Publicidad.getValueUser(Publicidad.getGigyaUserType());\n\t var cadenaTipoDispositivo = Publicidad.tipoDispositivo == 'mobile' ? 'm' : 'w';\n\t targetingText += \".setTargeting('st', '\" + Publicidad.valueUserType + \"').setTargeting('stt', '\" + cadenaTipoDispositivo + Publicidad.valueUserType + \"')\";\n\t\n\t // Se comprueba si se fuerza algun targeting via URL con el parametro cmvkey\n\t if (typeof location != 'undefined' && location.href.indexOf('cmvkey=') != -1) {\n\t var pattern = /(\\?|&)cmvkey=([^?&]+)/;\n\t var esValida = pattern.exec(location.href);\n\t if (esValida) {\n\t var targetingsURL = esValida[2];\n\t\n\t try {\n\t var targetingsURL_decoded = decodeURIComponent(targetingsURL);\n\t var targetingsURL_trozos = targetingsURL_decoded.split(',');\n\t\n\t for (var trozo in targetingsURL_trozos) {\n\t var clave_y_valor = targetingsURL_trozos[trozo].split(\"=\");\n\t\n\t var trozo_clave = clave_y_valor[0];\n\t var trozo_valor = clave_y_valor[1];\n\t targetingText += '.setTargeting(\"' + trozo_clave + '\", \"' + trozo_valor + '\")';\n\t }\n\t } catch (e) {\n\t Publicidad.log('ERROR en getScriptText procesando cmvkey: ' + e, 'warn');\n\t }\n\t }\n\t }\n\t\n\t // Se comprueba si enableTopics esta habilitado\n\t try {\n\t if (typeof Publicidad.configGDPMedio != \"undefined\" && typeof Publicidad.configGDPMedio.enableTopics != \"undefined\" && Publicidad.configGDPMedio.enableTopics && typeof voc_top != \"undefined\" && voc_top !== '') {\n\t\n\t var topics = voc_top.split(',');\n\t for (var i = 0; i < topics.length; i++) {\n\t targetingText += '.setTargeting(\"topics\", \"' + topics[i] + '\")';\n\t }\n\t }\n\t } catch (e) {\n\t Publicidad.log('ERROR en getScriptText procesando enableTopics: ' + e, 'warn');\n\t }\n\t\n\t // Se comprueba si enableTpag esta habilitado\n\t try {\n\t if (typeof Publicidad.configGDPMedio != \"undefined\" && typeof Publicidad.configGDPMedio.enableTpag != \"undefined\" && Publicidad.configGDPMedio.enableTpag) {\n\t targetingText += '.setTargeting(\"tpag\", \"' + Publicidad.tipoPagina + '\")';\n\t }\n\t } catch (e) {\n\t Publicidad.log('ERROR en getScriptText procesando tpag: ' + e, 'warn');\n\t }\n\t\n\t // Comprobaciones para medios responsives\n\t var objetoMapping = {};\n\t var sizeMapping = '';\n\t var defineSizeMapping = '';\n\t if (params.responsive && $.isArray(params.responsive) && params.responsive.length > 0) {\n\t objetoMapping = Publicidad.getSizeMapping(params);\n\t sizeMapping = typeof objetoMapping !== 'undefined' && typeof objetoMapping.definicion !== 'undefined' ? objetoMapping.definicion : '';\n\t defineSizeMapping = typeof objetoMapping !== 'undefined' && typeof objetoMapping.script !== 'undefined' ? objetoMapping.script : '';\n\t }\n\t\n\t if (!params.outOfPage) {\n\t if (params.defineSlot) {\n\t scriptText = sizeMapping + Publicidad.getNombreSlot(params) + \" = googletag.defineSlot('\" + Publicidad.getOasSitepage(params) + \"', \" + size_dc + \", '\" + idAds + \"')\" + defineSizeMapping + \".setTargeting('pos','\" + params.position + \"')\" + targetingText + hideText + \".addService(googletag.pubads());\";\n\t }\n\t } else {\n\t if (params.defineSlot) {\n\t scriptText = sizeMapping + Publicidad.getNombreSlot(params) + \" = googletag.defineOutOfPageSlot('\" + Publicidad.getOasSitepage(params) + \"', '\" + idAds + \"')\" + defineSizeMapping + \".setTargeting('pos','\" + params.position + \"')\" + targetingText + hideText + \".addService(googletag.pubads());\";\n\t }\n\t }\n\t\n\t Publicidad.log('En getScriptText. defineSlot: ' + scriptText);\n\t\n\t var key = Publicidad.getClavePosicionInsertada(params);\n\t Publicidad.listaPosicionesInsertadas[key] = scriptText;\n\t Publicidad.listaIdsInsertados.push(idAds);\n\t\n\t return scriptText;\n\t }\n\t\n\t /**\r\n\t * Funcion que obtiene el valor de oas del fichero de configuracion.\r\n\t * @return string\r\n\t */\n\t\n\t }, {\n\t key: 'getOasSitepage',\n\t value: function getOasSitepage(params) {\n\t var oasSitepage;\n\t params = params || {};\n\t\n\t if (typeof params.oas != \"undefined\" && params.oas !== '') {\n\t oasSitepage = params.oas;\n\t } else {\n\t oasSitepage = typeof eval('Publicidad.configGDP.OAS.' + Publicidad.tipoDispositivo + '.' + Publicidad.tipoPagina) != \"undefined\" ? eval('Publicidad.configGDP.OAS.' + Publicidad.tipoDispositivo + '.' + Publicidad.tipoPagina) : '';\n\t }\n\t\n\t // Comprobamos si se fuerza un adunit por defecto via URL\n\t try {\n\t if (typeof top.location !== 'undefined' && top.location.href.indexOf('adunit=') != -1) {\n\t var pattern = /(\\?|&)adunit=([^?&]+)/;\n\t var esValida = pattern.exec(top.location.href);\n\t if (esValida) {\n\t oasSitepage = esValida[2].indexOf('/' + _constants.GPT_ID_VOCENTO + '/') != -1 ? esValida[2] : '/' + _constants.GPT_ID_VOCENTO + '/' + esValida[2];\n\t }\n\t }\n\t } catch (err) {}\n\t\n\t // Comprobamos si tiene alguna macro\n\t try {\n\t var _pattern = /{(\\/)?edicion(\\/)?}/;\n\t var contieneMacroEdicion = _pattern.exec(oasSitepage);\n\t if (contieneMacroEdicion) {\n\t // Lectura de la edicion del medio\n\t var cadenaEdicion = Publicidad.getEdition();\n\t\n\t if (contieneMacroEdicion[0].startsWith('{\\/') && cadenaEdicion !== '') cadenaEdicion = \"\\/\" + cadenaEdicion;\n\t if (contieneMacroEdicion[0].endsWith('\\/}') && cadenaEdicion !== '') cadenaEdicion += \"\\/\";\n\t\n\t oasSitepage = oasSitepage.replace(contieneMacroEdicion[0], cadenaEdicion);\n\t }\n\t } catch (err) {}\n\t\n\t // Guardamos el valor del adunit calculado por si no lo esta\n\t if (typeof Publicidad.configGDP.OAS.adunit === 'undefined') Publicidad.configGDP.OAS.adunit = oasSitepage;\n\t\n\t return oasSitepage;\n\t }\n\t\n\t /**\r\n\t * Funcion que obtiene las medidas en caso de que sea responsive.\r\n\t * @param object responsive\r\n\t * @return string sizeMapping\r\n\t */\n\t\n\t }, {\n\t key: 'getSizeMapping',\n\t value: function getSizeMapping(params) {\n\t var objetoMapping = {\n\t definicion: '',\n\t script: ''\n\t };\n\t\n\t // @var responsive <googletag.SizeMappingArray>\n\t objetoMapping.definicion = 'var mapping = googletag.sizeMapping()';\n\t var responsive = params.responsive;\n\t\n\t for (var i = 0; i < responsive.length; i++) {\n\t var add_size_p = '';\n\t // @var responsive_p <googletag.SizeMapping> Pair viewportSize, slotSize\n\t var responsive_p = responsive[i];\n\t\n\t if (responsive_p.length === 2) {\n\t // @var viewportSize <googletag.SingleSizeArray>\n\t var viewportSize = responsive_p[0];\n\t // @var responsive_ad <googletag.GeneralSize>\n\t var responsive_ad = responsive_p[1];\n\t if (typeof responsive_ad === 'string') {\n\t if (responsive_ad.indexOf('fluid') !== -1) {\n\t responsive_ad = _constants.POSITION_FLUID;\n\t } else {\n\t responsive_ad = Publicidad.getSizesGoogle(responsive_ad);\n\t if (typeof responsive_ad !== 'undefined' && typeof responsive_ad === 'string') responsive_ad = JSON.parse(responsive_ad);\n\t }\n\t }\n\t if ($.isArray(viewportSize) && viewportSize.length === 2 && ($.isArray(responsive_ad) || responsive_ad === _constants.POSITION_FLUID)) {\n\t add_size_p = '[' + viewportSize[0] + ',' + viewportSize[1] + '],';\n\t if (responsive_ad.length > 0 && $.isArray(responsive_ad[0])) {\n\t // @var responsive_ad <googletag.MultiSize>\n\t add_size_p += '[';\n\t for (var j = 0; j < responsive_ad.length; j++) {\n\t // @var singleSize <googletag.SingleSize>\n\t var singleSize = responsive_ad[j];\n\t if (singleSize.length === 2) {\n\t add_size_p += (j === 0 ? '[' : ',[') + singleSize[0] + ',' + singleSize[1] + ']';\n\t }\n\t }\n\t add_size_p += ']';\n\t } else if (responsive_ad.length === 2) {\n\t // @var responsive_ad <googletag.SingleSize>\n\t add_size_p += '[' + responsive_ad[0] + ',' + responsive_ad[1] + ']';\n\t } else if (responsive_ad === _constants.POSITION_FLUID) {\n\t add_size_p += _constants.POSITION_FLUID;\n\t } else {\n\t add_size_p += '[]';\n\t }\n\t objetoMapping.definicion += '.addSize(' + add_size_p + ')';\n\t } else {\n\t Publicidad.log('ERROR En getSizeMapping: Parametro responsive malformado en posicion ' + params.position + '. responsive: ' + responsive, 'warn');\n\t return;\n\t }\n\t } else {\n\t Publicidad.log('ERROR En getSizeMapping: Parametro responsive malformado en posicion ' + params.position + '. responsive: ' + responsive, 'warn');\n\t return;\n\t }\n\t }\n\t\n\t objetoMapping.definicion += '.build();';\n\t objetoMapping.script = '.defineSizeMapping(mapping)';\n\t\n\t return objetoMapping;\n\t }\n\t\n\t /**\r\n\t * Obtiene el tipo de usuario de Gigya para la segmentacion de publicidad consultando la funcion getUserType()\r\n\t * @returns Tipo de usuario adaptado de Gigya para la segmentacion de la publicidad\r\n\t */\n\t\n\t }, {\n\t key: 'getGigyaUserType',\n\t value: function getGigyaUserType() {\n\t var gigyaUserType = 'anonimo';\n\t try {\n\t if (typeof getUserType != 'undefined') gigyaUserType = getUserType();\n\t } catch (err) {\n\t gigyaUserType = 'anonimo';\n\t }\n\t\n\t return gigyaUserType;\n\t }\n\t\n\t /**\r\n\t * Convierte el tipo de usuario de Gigya (en formato adaptado para publicidad)\r\n\t */\n\t\n\t }, {\n\t key: 'getValueUser',\n\t value: function getValueUser(userType) {\n\t var valueUser = \"a\";\n\t\n\t if (typeof userType == 'undefined' || userType === null) userType = Publicidad.getGigyaUserType();\n\t\n\t var arrayUsers = {\n\t suscriptor: \"s\",\n\t trial: \"t\",\n\t registrado: \"r\",\n\t anonimo: \"a\"\n\t };\n\t\n\t if (userType in arrayUsers) {\n\t valueUser = arrayUsers[userType];\n\t }\n\t\n\t return valueUser;\n\t }\n\t\n\t /**\r\n\t * Calcula el array de dimensiones para una posicion dada. Opcionalmente se puede indicar un tipo de dispositivo (si va vacio se usa el tipo actual)\r\n\t * @param {string} position\r\n\t * @param {string} tipoDispositivo\r\n\t * @return object\r\n\t */\n\t\n\t }, {\n\t key: 'getSizesGoogle',\n\t value: function getSizesGoogle(position, tipoDispositivo) {\n\t var tipoDispositivo = tipoDispositivo || Publicidad.tipoDispositivo;\n\t var xpath = Publicidad.tipoFormatoJSON === 2 ? 'Publicidad.configGDPMedio.posicion_' + tipoDispositivo + '[\"' + position + '\"].dimensiones' : 'Publicidad.configGDPMedio.posiciones[\"' + position + '\"]';\n\t var size = typeof eval(xpath) !== \"undefined\" ? eval(xpath) : '[]';\n\t var defineSlot = Publicidad.getDefineSlotParam();\n\t\n\t if (size.indexOf('[fluid]') != -1) {\n\t size = size.replace('[fluid]', '\\'fluid\\'');\n\t\n\t if (!defineSlot) return ['fluid'];\n\t }\n\t\n\t return defineSlot ? size : JSON.parse(size);\n\t }\n\t\n\t /**\r\n\t * Log en la consola\r\n\t * @param (string) msg\r\n\t */\n\t\n\t }, {\n\t key: 'log',\n\t value: function log(msg, tipo) {\n\t try {\n\t tipo = tipo || 'log';\n\t if (typeof console !== 'undefined' && Publicidad.debug) {\n\t switch (tipo) {\n\t case 'warn':\n\t console.warn('[Ads Manager] ' + msg);\n\t break;\n\t\n\t case 'error':\n\t console.error('[Ads Manager] ' + msg);\n\t break;\n\t\n\t default:\n\t console.log('[Ads Manager] ' + msg);\n\t break;\n\t }\n\t }\n\t } catch (err) {}\n\t\n\t return this;\n\t }\n\t }, {\n\t key: 'getMedio',\n\t value: function getMedio() {\n\t var medio = typeof Publicidad.configGDPMedio.medio != \"undefined\" ? Publicidad.configGDPMedio.medio : '';\n\t return medio;\n\t }\n\t\n\t /**\r\n\t * Devuelve el tipo de dispositivo en funcion del tamano de la pagina\r\n\t * @return string\r\n\t */\n\t\n\t }, {\n\t key: 'getTipoDispositivo',\n\t value: function getTipoDispositivo() {\n\t var cTipoDispositivo = 'desktop';\n\t\n\t if (!Publicidad.configGDPMedio.responsive.esResponsive) {\n\t if (Publicidad.configGDPMedio && Publicidad.configGDPMedio.tipoDispositivo) {\n\t cTipoDispositivo = Publicidad.configGDPMedio.tipoDispositivo;\n\t }\n\t } else {\n\t var screen_width = parseInt(top.window.innerWidth);\n\t\n\t $.each(Publicidad.configGDPMedio.responsive, function (clave, valor) {\n\t if (clave !== 'esResponsive' && (valor.resolucionMaxima || valor.resolucionMinima)) {\n\t var maximo = valor.resolucionMaxima ? valor.resolucionMaxima : 999999;\n\t var minimo = valor.resolucionMinima ? valor.resolucionMinima : 0;\n\t\n\t if (screen_width <= maximo && screen_width > minimo) {\n\t var cTempTipo = clave.replace(\"resolucion\", \"\").toLowerCase();\n\t cTipoDispositivo = cTempTipo;\n\t }\n\t }\n\t });\n\t }\n\t\n\t return cTipoDispositivo;\n\t }\n\t\n\t /**\r\n\t * Devuelve la version del tipo de formato JSON: 1 o 2\r\n\t */\n\t\n\t }, {\n\t key: 'getTipoFormatoJSON',\n\t value: function getTipoFormatoJSON() {\n\t var tipo = 1;\n\t\n\t if (typeof Publicidad.configGDPMedio != \"undefined\" && typeof Publicidad.configGDPMedio.tiposPublicidad != \"undefined\") {\n\t tipo = 2;\n\t }\n\t\n\t return tipo;\n\t }\n\t\n\t /**\r\n\t * Detectamos el tipo de pagina a partir del patron de la URL.\r\n\t * NOTA: Cada medio tiene sus propias reglas de URLs por lo que tiene su propia funcion para calcularlas\r\n\t */\n\t\n\t }, {\n\t key: 'getTipoPagina',\n\t value: function getTipoPagina() {\n\t var tipoPagina = 'portada';\n\t if (Publicidad.medio == 'abc' || Publicidad.medio == 'lavozdigital' || Publicidad.medio == 'abcdesevilla') {\n\t tipoPagina = Publicidad.getTipoPaginaABC();\n\t } else if (Publicidad.medio == 'mujerhoy') {\n\t tipoPagina = Publicidad.getTipoPaginaMujerhoy();\n\t } else {\n\t tipoPagina = Publicidad.getTipoPaginaPortalesLocales();\n\t }\n\t\n\t return tipoPagina;\n\t }\n\t\n\t /**\r\n\t * Calculo del tipo de pagina en funcion de la URL para los medios de ABC (ABC, Sevilla y La Voz Digital)\r\n\t */\n\t\n\t }, {\n\t key: 'getTipoPaginaABC',\n\t value: function getTipoPaginaABC() {\n\t var reVideosAntiguos = /\\/videos\\/(.*)?\\/\\d{6}\\/\\d{2}\\/((?!index.html).)*.html/;\n\t var reVideos = /_video.html/;\n\t var esVideo = reVideos.exec(location.pathname) || reVideosAntiguos.exec(location.pathname);\n\t if (esVideo) return 'video';\n\t\n\t var reGaleriasAntiguos2 = /\\/multimedia\\/fotos\\/(.*)?\\/((?!index.html).)*.html/;\n\t var reGaleriasAntiguos = /\\/fotos-(.*)?\\/\\d{8}\\/((?!index.html).)*.html/;\n\t var reGalerias = /_galeria.html/;\n\t var esGaleria = reGalerias.exec(location.pathname) || reGaleriasAntiguos.exec(location.pathname) || reGaleriasAntiguos2.exec(location.pathname);\n\t if (esGaleria) return 'galeria';\n\t\n\t var reGraficos = /\\/multimedia\\/(graficos\\/(.)*|infografias)\\/((?!index.html).)*.html/;\n\t var esGrafico = reGraficos.exec(location.pathname);\n\t if (esGrafico) return 'grafico';\n\t\n\t var reNoticiasAntiguos = /\\d{8}\\/(.*)?((?!index.html).)*.html/;\n\t var reNoticias = /(_noticia.html|_directo.html)/;\n\t var esNoticia = reNoticias.exec(location.pathname) || reNoticiasAntiguos.exec(location.pathname);\n\t if (esNoticia) return 'noticia';\n\t\n\t return 'portada';\n\t }\n\t\n\t /**\r\n\t * Calculo del tipo de pagina en funcion de la URL para Mujerhoy\r\n\t */\n\t\n\t }, {\n\t key: 'getTipoPaginaMujerhoy',\n\t value: function getTipoPaginaMujerhoy() {\n\t var reVideos = /-vi.html/;\n\t var reVideosOld = /\\/videos\\/(.*)?\\/\\d{6}\\/\\d{2}\\/.*-mm.html/;\n\t var reVideosBlogs = /\\/videos\\/\\d{4}\\/\\d{2}\\/\\d{2}\\/(.*).html/;\n\t var esVideo = location.hostname.indexOf('blogs.') == -1 ? reVideos.exec(location.pathname) || reVideosOld.exec(location.pathname) : reVideosBlogs.exec(location.pathname);\n\t if (esVideo) return 'video';\n\t\n\t var reGalerias = /-ga.html/;\n\t var reGaleriasOld = /^\\/galerias\\/(.*)?\\d{6}\\/\\d{2}\\/.*-mm.html/;\n\t var reGaleriasBlogs = /\\/galerias\\/\\d{4}\\/\\d{2}\\/\\d{2}\\/(.*).html/;\n\t var esGaleria = location.hostname.indexOf('blogs.') == -1 ? reGalerias.exec(location.pathname) || reGaleriasOld.exec(location.pathname) : reGaleriasBlogs.exec(location.pathname);\n\t if (esGaleria) return 'galeria';\n\t\n\t var reNoticias = /\\/\\d{6}\\/\\d{2}\\/((?!index.html).)*.html/;\n\t var reNoticiasBlogs = /\\/\\d{4}\\/\\d{2}\\/\\d{2}\\/((?!index.html).)*.html/;\n\t var reNoticiasRecetas = /\\/\\d{6}\\/((?!index.html).)*.html/;\n\t var esNoticia = false;\n\t if (location.hostname.indexOf('blogs.') != -1) esNoticia = reNoticiasBlogs.exec(location.pathname);else if (location.hostname.indexOf('recetas.') != -1) esNoticia = reNoticiasRecetas.exec(location.pathname);else esNoticia = reNoticias.exec(location.pathname);\n\t if (esNoticia) return 'noticia';\n\t\n\t return 'portada';\n\t }\n\t\n\t /**\r\n\t * Calculo del tipo de pagina en funcion de la URL para los Portales Locales\r\n\t */\n\t\n\t }, {\n\t key: 'getTipoPaginaPortalesLocales',\n\t value: function getTipoPaginaPortalesLocales() {\n\t var reVideos = /-(vi|virc|vivo)(_amp)?.html/;\n\t var reVideosOld = /^\\/videos\\/(.*)?\\/\\d{6}\\/\\d{2}\\/.*-mm.html/;\n\t var esVideo = reVideos.exec(location.pathname) || reVideosOld.exec(location.pathname);\n\t if (esVideo) return 'video';\n\t\n\t var reGalerias = /-(ga|garc|gavo|ft|ftrc|ftvo)(_amp)?.html/;\n\t var reGaleriasOld = /^\\/fotos\\/(.*)?\\d{6}\\/\\d{2}\\/.*-mm.html/;\n\t var esGaleria = reGalerias.exec(location.pathname) || reGaleriasOld.exec(location.pathname);\n\t if (esGaleria) return 'galeria';\n\t\n\t var reGraficos = /-(in|inrc|invo)(_amp)?.html/;\n\t var reGraficosOld = /^\\/graficos\\/(.*)?\\/\\d{6}\\/\\d{2}\\/.*-mm.html/;\n\t var esGrafico = reGraficos.exec(location.pathname) || reGraficosOld.exec(location.pathname);\n\t if (esGrafico) return 'grafico';\n\t\n\t var reNoticias = /-(nt|ntrc|ntvo)(_amp)?.html/;\n\t var reNoticiasOld = /\\/\\d{6}\\/\\d{2}\\/((?!index.html).)*.html/;\n\t var esNoticia = reNoticias.exec(location.pathname) || reNoticiasOld.exec(location.pathname);\n\t if (esNoticia) return 'noticia';\n\t\n\t var reVideochats = /\\/videochats\\/((?!index.html).)\\w+/;\n\t var esVideochat = reVideochats.exec(location.pathname);\n\t if (esVideochat) return 'videochat';\n\t\n\t return 'portada';\n\t }\n\t\n\t /**\r\n\t * Funcion donde realiazamos la comprobación de si existen excepciones para la pagina donde nos encontramos.\r\n\t * @return object configGDP\r\n\t */\n\t\n\t }, {\n\t key: 'comprobamosExcepciones',\n\t value: function comprobamosExcepciones() {\n\t var configGDPAux = Publicidad.configGDP;\n\t if (typeof Publicidad.configGDPMedio != 'undefined' && typeof Publicidad.configGDPMedio.excepciones != 'undefined' && Object.keys(Publicidad.configGDPMedio.excepciones).length > 0) {\n\t Publicidad.log('En comprobamosExcepciones. Hay excepciones configuradas');\n\t\n\t $.each(Publicidad.configGDPMedio.excepciones, function (key, value) {\n\t if (key != \"priorizadas\" && key != \"retrasadas\") {\n\t if (location.pathname == key || location.pathname.match(key)) {\n\t var unix = Math.round(new Date() / 1000);\n\t var fechaini = value.fecha_in;\n\t var fechafin = value.fecha_fin;\n\t if ((fechaini === 0 || fechaini <= unix) && (fechafin === 0 || unix <= fechafin)) {\n\t configGDPAux = value;\n\t Publicidad.log('En comprobamosExcepciones. Aplicamos la siguiente excepcion:\"' + value + '\"');\n\t }\n\t }\n\t }\n\t });\n\t }\n\t\n\t return configGDPAux;\n\t }\n\t\n\t /**\r\n\t * Funcion que obtiene los tag definidos en los archivos de configuración\r\n\t * @return object\r\n\t */\n\t\n\t }, {\n\t key: 'getTargetingsConfig',\n\t value: function getTargetingsConfig() {\n\t var targetingsMedio = typeof Publicidad.configGDPMedio.targetings != \"undefined\" ? Publicidad.configGDPMedio.targetings : '';\n\t var targetingsPagina = typeof Publicidad.configGDP.targetings != \"undefined\" ? Publicidad.configGDP.targetings : '';\n\t var targetings = $.extend({}, targetingsMedio, targetingsPagina);\n\t return targetings;\n\t }\n\t\n\t /**\r\n\t * Funcion que comprueba si una posicion esta priorizada\r\n\t */\n\t\n\t }, {\n\t key: 'esPriorizada',\n\t value: function esPriorizada(params) {\n\t var lista = Publicidad.listaPriorizadas.split(',');\n\t for (var i = 0; i < lista.length; i++) {\n\t if (lista[i] == params.position) {\n\t return true;\n\t }\n\t }\n\t return false;\n\t }\n\t\n\t /**\r\n\t * Funcion que comprueba si una posicion es retrasada\r\n\t */\n\t\n\t }, {\n\t key: 'esRetrasada',\n\t value: function esRetrasada(params) {\n\t var lista = Publicidad.listaRetrasadas.split(',');\n\t for (var i = 0; i < lista.length; i++) {\n\t if (lista[i] == params.position) {\n\t return true;\n\t }\n\t }\n\t return false;\n\t }\n\t\n\t /**\r\n\t * Lanza los printAds que se han encolado cuando hay priorizadas\r\n\t */\n\t\n\t }, {\n\t key: 'displayDelayed',\n\t value: function displayDelayed() {\n\t $.each(Publicidad.listaEstandardDelayed, function (i, params) {\n\t Publicidad.printAds(params, true);\n\t });\n\t }\n\t\n\t /**\r\n\t * Funcion que genera el identificador en funcion del medio\r\n\t * @param object params\r\n\t * @return string\r\n\t */\n\t\n\t }, {\n\t key: 'getIdDiv',\n\t value: function getIdDiv(params) {\n\t if (typeof params.id != \"undefined\") {\n\t return params.id.indexOf(\"-id\") == -1 ? params.id + \"-id\" : params.id;\n\t } else {\n\t return params.position + \"-id\";\n\t }\n\t }\n\t\n\t /**\r\n\t * Funcion para pintar la publicidad priorizada\r\n\t * @return object\r\n\t */\n\t\n\t }, {\n\t key: 'pintaPriorizadas',\n\t value: function pintaPriorizadas() {\n\t Publicidad.log('En pintaPriorizadas. Pintaremos las siguientes posiciones: ' + Publicidad.listaPriorizadas);\n\t var sonPosicionesPriorizadas = true;\n\t var lista = Publicidad.listaPriorizadas.split(',');\n\t Publicidad.pintaListaPosiciones(lista, sonPosicionesPriorizadas);\n\t return this;\n\t }\n\t\n\t /**\r\n\t * Funcion que recorre y pinta una lista de posiciones.\r\n\t * Si singleRequest esta habilitado las posiciones priorizadas funcionan como un Roadblock y se piden todas juntas (no llevaran eventos ni callbacks)\r\n\t */\n\t\n\t }, {\n\t key: 'pintaListaPosiciones',\n\t value: function pintaListaPosiciones(listaPositions, sonPosicionesPriorizadas) {\n\t if (Publicidad.configGDPMedio.singleRequest && sonPosicionesPriorizadas) {\n\t Publicidad.log('En pintaListaPosiciones. SingleRequest habilitado y hay posiciones priorizadas -> las pedimos como Roadblock');\n\t\n\t googletag.cmd.push(function () {\n\t for (var i = 0; i < listaPositions.length; i++) {\n\t var params = {\n\t position: listaPositions[i]\n\t };\n\t\n\t if (!Publicidad.existePosEnConfigGDPMedio(params.position)) {\n\t Publicidad.log('ERROR: La posicion priorizada ' + params.position + ' no existe en configGDPMedio', 'warn');\n\t continue;\n\t }\n\t\n\t // Recuperamos los paramteros del DIV en caso de que exista en la pagina\n\t var container$ = $(\"[data-voc-vam-position = '\" + params.position + \"']\");\n\t if (container$.length) {\n\t params = Publicidad.normalizaParams(container$, false);\n\t } else {\n\t params = Publicidad.normalizaParams(params, true);\n\t }\n\t\n\t eval(Publicidad.getScriptText(params));\n\t }\n\t\n\t // Si hay integracion con Amazon Ads hay que esperar al evento amazonads_ready\n\t if (typeof Publicidad.configGDPMedio.enableAmazonAds != \"undefined\" && Publicidad.configGDPMedio.enableAmazonAds && !Publicidad.amazonads_inicializado) {\n\t Publicidad.log('En pintaListaPosiciones. Esperaremos al evento de amazonads_ready');\n\t _app.on(_constants.AMAZONADS_READY, params, function () {\n\t var idDiv = Publicidad.getIdDiv(params);\n\t googletag.display(idDiv);\n\t });\n\t } else {\n\t var idDiv = Publicidad.getIdDiv(params);\n\t googletag.display(idDiv);\n\t }\n\t });\n\t } else {\n\t googletag.cmd.push(function () {\n\t for (var i = 0; i < listaPositions.length; i++) {\n\t var params = {\n\t position: listaPositions[i]\n\t };\n\t\n\t // Recuperamos los paramteros del DIV en caso de que exista en la pagina\n\t var container$ = $(\"[data-voc-vam-position = '\" + params.position + \"']\");\n\t if (container$.length) {\n\t params = Publicidad.normalizaParams(container$, false);\n\t } else {\n\t params = Publicidad.normalizaParams(params, true);\n\t }\n\t\n\t Publicidad.printAds(params, true);\n\t }\n\t });\n\t }\n\t }\n\t\n\t /**\r\n\t * Funcion que obtiene el valor del defineSlot en nuestro objecto de configuracion\r\n\t * @return string\r\n\t */\n\t\n\t }, {\n\t key: 'getDefineSlotParam',\n\t value: function getDefineSlotParam() {\n\t return typeof Publicidad.configGDPMedio.defineSlot != \"undefined\" ? Publicidad.configGDPMedio.defineSlot : '';\n\t }\n\t }, {\n\t key: 'esMedioResponsive',\n\t value: function esMedioResponsive() {\n\t return typeof Publicidad.configGDPMedio.responsive.esResponsive != \"undefined\" ? Publicidad.configGDPMedio.responsive.esResponsive : false;\n\t }\n\t\n\t /**\r\n\t * Construye el parametro responsive de la posicion en caso de que sea responsive\r\n\t * @return object\r\n\t */\n\t\n\t }, {\n\t key: 'getResponsiveParam',\n\t value: function getResponsiveParam(params) {\n\t var tieneParamResponsive = params.responsive && $.isArray(params.responsive) && params.responsive.length > 0;\n\t\n\t // No sera posicion responsive\n\t if (!tieneParamResponsive && !Publicidad.esMedioResponsive) {\n\t return false;\n\t }\n\t // Tiene parametro responsive en la llamada\n\t else if (tieneParamResponsive) {\n\t return params.responsive;\n\t }\n\t // No tiene parametro responsive en la llamada pero es medio responsive por lo que creamos el parametro con resoluciones y dimensiones correspondientes\n\t else if (Publicidad.esMedioResponsive) {\n\t return Publicidad.createResponsive(params);\n\t } else {\n\t return false;\n\t }\n\t }\n\t\n\t /**\r\n\t * Funcion que crea el objeto responsive cuando un medio es responsive y la llamada no tiene el parametro relleno\r\n\t * @return object\r\n\t */\n\t\n\t }, {\n\t key: 'createResponsive',\n\t value: function createResponsive(params) {\n\t var resolucionMinima,\n\t resolucionMaxima,\n\t responsive = [];\n\t var size_dc;\n\t\n\t var dispositivos = ['mobile', 'tablet', 'desktop'];\n\t for (var i = 0; i < dispositivos.length; i++) {\n\t var dispositivo = dispositivos[i];\n\t var dispositivoCapitalizado = dispositivo.charAt(0).toUpperCase() + dispositivo.slice(1);\n\t\n\t if (typeof eval('Publicidad.configGDPMedio.responsive.resolucion' + dispositivoCapitalizado) !== \"undefined\") {\n\t var anchoMinimo = typeof eval('Publicidad.configGDPMedio.responsive.resolucion' + dispositivoCapitalizado + '.resolucionMinima') !== \"undefined\" ? eval('Publicidad.configGDPMedio.responsive.resolucion' + dispositivoCapitalizado + '.resolucionMinima') : '';\n\t var anchoMaximo = typeof eval('Publicidad.configGDPMedio.responsive.resolucion' + dispositivoCapitalizado + '.resolucionMaxima') !== \"undefined\" ? eval('Publicidad.configGDPMedio.responsive.resolucion' + dispositivoCapitalizado + '.resolucionMaxima') : '';\n\t\n\t if (anchoMinimo !== '' || anchoMaximo !== '') {\n\t var dimension = [parseInt(anchoMinimo) || '0', _constants.ALTOS_MINIMOS_DISPOSITIVOS[dispositivo]];\n\t\n\t var size = Publicidad.getSizesGoogle(params.position, dispositivo);\n\t try {\n\t if (size !== null && size.indexOf('fluid') !== -1) {\n\t size_dc = 'fluid';\n\t } else {\n\t size_dc = JSON.parse(size);\n\t }\n\t } catch (e) {\n\t Publicidad.log('ERROR en createResponsive procesando la posicion' + params.position + ': ' + e, 'warn');\n\t size_dc = size;\n\t }\n\t responsive.push([dimension, size_dc]);\n\t }\n\t }\n\t }\n\t\n\t return responsive;\n\t }\n\t\n\t /**\r\n\t * Devuelve el serverType de la posicion pasada como parametro\r\n\t */\n\t\n\t }, {\n\t key: 'getServerType',\n\t value: function getServerType(params) {\n\t var serverType = 'google';\n\t\n\t if (Publicidad.tipoFormatoJSON === 2) {\n\t try {\n\t var xpath = 'Publicidad.configGDPMedio.posicion_' + tipoDispositivo + '.' + params.position;\n\t serverType = typeof eval(xpath) !== \"undefined\" && typeof eval(xpath + '.tipo') !== \"undefined\" ? eval(xpath + '.tipo') : 'google';\n\t } catch (err) {}\n\t }\n\t\n\t return serverType;\n\t }\n\t }, {\n\t key: 'existePosEnConfigGDPMedio',\n\t value: function existePosEnConfigGDPMedio(position) {\n\t var existe = false;\n\t\n\t // Comprobamos que exista en la lista de posiciones de configGDPMedio\n\t var xpath = Publicidad.tipoFormatoJSON === 2 ? 'Publicidad.configGDPMedio.posicion_' + Publicidad.tipoDispositivo + '.' + position : 'Publicidad.configGDPMedio.posiciones.' + position;\n\t if (typeof eval(xpath) !== \"undefined\") existe = true;\n\t\n\t // Si no existe la posicion ocultamos su DIV contenedor\n\t if (!existe) {\n\t var params = {};\n\t params.position = position;\n\t var idAds = Publicidad.getIdDiv(params);\n\t if ($('#' + idAds).length) $('#' + idAds).hide();\n\t }\n\t\n\t return existe;\n\t }\n\t\n\t /**\r\n\t * Funcion que checkea si la publicidad esta activada o desactivada.\r\n\t * @param object params\r\n\t * @return boolean\r\n\t */\n\t\n\t }, {\n\t key: 'checkActivePosition',\n\t value: function checkActivePosition(params) {\n\t // Comprobamos si se ha forzado via URL que todas las posiciones esten activas\n\t if (typeof Publicidad.configGDPMedio !== \"undefined\" && typeof Publicidad.configGDPMedio.forceActivePosition !== \"undefined\" && Publicidad.configGDPMedio.forceActivePosition) {\n\t return true;\n\t }\n\t\n\t //Comprobamos que se ha anadido la configuracion necesaria para el tipo de dispositivo\n\t var isActive = false;\n\t var tipoDispositivoAux = Publicidad.tipoDispositivo;\n\t\n\t if (typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux) != \"undefined\" && typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]') != \"undefined\") {\n\t var posicionConfig = typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]') != \"undefined\" ? eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]') : '';\n\t var desactivadoen = typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.desactivadoen') != \"undefined\" ? eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.desactivadoen') : '';\n\t var fechaini = typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.fecha_in') != \"undefined\" ? eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.fecha_in') : 0;\n\t var fechafin = typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.fecha_fin') != \"undefined\" ? eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.fecha_fin') : 0;\n\t var programada = typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.programada') != \"undefined\" ? eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.programada') : false;\n\t\n\t if (programada) {\n\t if (typeof desactivadoen == 'undefined' || desactivadoen === '' || $.isArray(desactivadoen) && desactivadoen.length === 0) {\n\t var unix = Math.round(+new Date() / 1000);\n\t if ((fechaini === 0 || fechaini <= unix) && (fechafin === 0 || unix <= fechafin)) {\n\t isActive = true;\n\t } else {\n\t Publicidad.log('En checkActivePosition. La posicion \"' + params.position + '\" no esta activa para la hora actual');\n\t }\n\t } else if (desactivadoen.indexOf(Publicidad.tipoPagina) == -1) {\n\t isActive = true;\n\t } else {\n\t Publicidad.log('En checkActivePosition. La posicion \"' + params.position + '\" no esta activa para el tipo de pagina ' + Publicidad.tipoPagina);\n\t }\n\t } else {\n\t Publicidad.log('En checkActivePosition. La posicion \"' + params.position + '\" no esta activa');\n\t }\n\t } else {\n\t Publicidad.log('En checkActivePosition. La posicion \"' + params.position + '\" no esta activa');\n\t }\n\t\n\t return isActive;\n\t }\n\t\n\t /**\r\n\t * Pinta las posiciones retrasadas una vez que llegan al viewport\r\n\t * @param object params [parametros del ad]\r\n\t */\n\t\n\t }, {\n\t key: 'pintarRetrasada',\n\t value: function pintarRetrasada(params) {\n\t var idAds = Publicidad.getIdDiv(params);\n\t\n\t $(\"#\" + idAds).one('inview', function (event, isInView) {\n\t if (isInView) Publicidad.getAdGoogle(params, false);\n\t });\n\t }\n\t\n\t // TODO: completar\n\t\n\t }, {\n\t key: 'getAdMeta',\n\t value: function getAdMeta(params) {}\n\t }, {\n\t key: 'printAds',\n\t value: function printAds(datos) {\n\t var esJSON = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\t\n\t // Normalizacion de parametros\n\t var params = Publicidad.normalizaParams(datos, esJSON);\n\t\n\t if (params == null) return;\n\t\n\t // Comprobamos si la posicion esta activada\n\t var idAds = Publicidad.getIdDiv(params);\n\t if (!Publicidad.checkActivePosition(params)) {\n\t // Ocultamos el DIV contenedor de la publicidad si esta habilitada la directiva hideNoAds\n\t if ($('#' + idAds).length && typeof params.hideNoAds != 'undefined' && params.hideNoAds) $('#' + idAds).hide();\n\t\n\t return;\n\t }\n\t\n\t // Comprobamos si existe el DIV\n\t if ($('#' + idAds).length) {\n\t // Pintado de publicidad dependiendo del servidor\n\t switch (params.serverType) {\n\t case 'google':\n\t // Publicidades priorizadas en la carga\n\t var priorized = Publicidad.esPriorizada(params);\n\t var retrasada = Publicidad.esRetrasada(params);\n\t\n\t // Posicion priorizada\n\t if (priorized && !retrasada) {\n\t Publicidad.getAdGoogle(params, true);\n\t }\n\t // Posicion retrasada -> le anade la class inview\n\t else if (retrasada) {\n\t Publicidad.pintarRetrasada(params);\n\t }\n\t // Posicion estandar\n\t else {\n\t if (!Publicidad.hayPriorizadas) {\n\t Publicidad.getAdGoogle(params, false);\n\t } else {\n\t if (!Publicidad.completadasPriorizadas) {\n\t Publicidad.listaEstandardDelayed.push(params);\n\t } else {\n\t Publicidad.getAdGoogle(params, false);\n\t }\n\t }\n\t }\n\t\n\t break;\n\t\n\t case 'admeta':\n\t Publicidad.getAdMeta(params);\n\t break;\n\t }\n\t } else {\n\t Publicidad.log('ERROR: El DIV con ID ' + idAds + ' no existe', 'warn');\n\t }\n\t\n\t return this;\n\t }\n\t\n\t /**\r\n\t * Pintado de publicidad de GPT\r\n\t */\n\t\n\t }, {\n\t key: 'getAdGoogle',\n\t value: function getAdGoogle(params, esPosPriorizada) {\n\t googletag.cmd.push(function () {\n\t if (!Publicidad.existePosEnConfigGDPMedio(params.position)) {\n\t Publicidad.log('ERROR: La posicion \"' + params.position + '\" no existe en configGDPMedio', 'warn');\n\t return null;\n\t }\n\t\n\t // Gestion de los eventos y callbacks\n\t var idDiv = Publicidad.getIdDiv(params);\n\t var eventParams = Publicidad.getEventsPosition(params);\n\t\n\t var tParams = params;\n\t tParams.pre_callback = eventParams.pre_callback;\n\t tParams.pre_event = eventParams.pre_event;\n\t\n\t // Si hay integracion con Amazon Ads ponemos como evento de pre (en caso de que no tenga ninguno la posicion) el evento amazonads_ready\n\t if (typeof Publicidad.configGDPMedio.enableAmazonAds != \"undefined\" && Publicidad.configGDPMedio.enableAmazonAds && !Publicidad.amazonads_inicializado && tParams.pre_event == '') {\n\t params.pre_event = tParams.pre_event = eventParams.pre_event = _constants.AMAZONADS_READY;\n\t }\n\t\n\t tParams.post_callback = eventParams.post_callback;\n\t tParams.post_event = eventParams.post_event;\n\t $(\"#\" + idDiv).data(\"params\", tParams);\n\t\n\t var key = Publicidad.getClavePosicionInsertada(params);\n\t if (typeof Publicidad.listaPosicionesInsertadas[key] == 'undefined') {\n\t var hasPreevent = false;\n\t if (params.defineSlot) {\n\t // No se trata de una posicion priorizada por lo que puede tener condicion de pre (callback o evento)\n\t if (!esPosPriorizada) {\n\t // Tiene precallback pero no evento\n\t if (eventParams.pre_callback && !eventParams.pre_event) {\n\t eval(eventParams.pre_callback);\n\t eval(Publicidad.getScriptText(params));\n\t }\n\t // Tiene evento de pre\n\t else if (eventParams.pre_event) {\n\t hasPreevent = true;\n\t eval(Publicidad.getScriptText(params));\n\t _app.on(eventParams.pre_event, params, function () {\n\t if (!Publicidad.amazonads_inicializado && params.pre_event == _constants.AMAZONADS_READY) {\n\t Publicidad.amazonads_inicializado = true;\n\t Publicidad.log('En getAdGoogle. Capturado evento de ' + _constants.AMAZONADS_READY);\n\t }\n\t\n\t if (params.pre_callback) {\n\t eval(params.pre_callback);\n\t }\n\t\n\t googletag.cmd.push(function () {\n\t var idDiv = Publicidad.getIdDiv(params);\n\t googletag.display(idDiv);\n\t });\n\t });\n\t } else {\n\t googletag.cmd.push(function () {\n\t eval(Publicidad.getScriptText(params));\n\t });\n\t }\n\t // Se trata de una posicion priorizada\n\t } else {\n\t eval(Publicidad.getScriptText(params));\n\t\n\t // Si hay integracion con Amazon Ads hay que esperar al evento AMAZONADS_READY\n\t if (eventParams.pre_event && params.pre_event == _constants.AMAZONADS_READY) {\n\t hasPreevent = true;\n\t _app.on(eventParams.pre_event, params, function () {\n\t if (!Publicidad.amazonads_inicializado && params.pre_event == _constants.AMAZONADS_READY) {\n\t Publicidad.amazonads_inicializado = true;\n\t Publicidad.log('En getAdGoogle. Capturado evento de ' + _constants.AMAZONADS_READY);\n\t }\n\t\n\t var idDiv = Publicidad.getIdDiv(params);\n\t googletag.display(idDiv);\n\t });\n\t }\n\t }\n\t }\n\t\n\t // No tiene evento de activacion\n\t if (!hasPreevent) {\n\t var idDiv = Publicidad.getIdDiv(params);\n\t\n\t if ($('#' + idDiv).length) {\n\t googletag.display(idDiv);\n\t }\n\t }\n\t } else {\n\t Publicidad.log('En getAdGoogle. La posicion ' + params.position + ' ya ha sido previamente invocada. Comprobamos el valor del parametro refresh: ' + params.refresh);\n\t if (params.refresh) Publicidad.pintarPosicionRefresh(params);\n\t }\n\t });\n\t }\n\t\n\t /**\r\n\t * Funcion que recuperar si tiene evento pre o post callback, los parametros llegados por funcion prevalecen sobre los del CONFIG\r\n\t * @param object params\r\n\t */\n\t\n\t }, {\n\t key: 'getEventsPosition',\n\t value: function getEventsPosition(params) {\n\t var tipoDispositivoAux = Publicidad.tipoDispositivo;\n\t var positionEvents = {};\n\t\n\t if (typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]') === \"undefined\") return positionEvents;\n\t\n\t if (params.pre_callback) {\n\t positionEvents.pre_callback = params.pre_callback;\n\t } else {\n\t positionEvents.pre_callback = typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.pre_callback') != \"undefined\" ? eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.pre_callback') : '';\n\t }\n\t\n\t if (params.pre_event) {\n\t positionEvents.pre_event = params.pre_event;\n\t } else {\n\t positionEvents.pre_event = typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.pre_event') != \"undefined\" ? eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.pre_event') : '';\n\t }\n\t\n\t if (params.post_callback) {\n\t positionEvents.post_callback = params.post_callback;\n\t } else {\n\t positionEvents.post_callback = typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.post_callback') != \"undefined\" ? eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.post_callback') : '';\n\t }\n\t\n\t if (params.post_event) {\n\t positionEvents.post_event = params.post_event;\n\t } else {\n\t positionEvents.post_event = typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.post_event') != \"undefined\" ? eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.post_event') : '';\n\t }\n\t\n\t return positionEvents;\n\t }\n\t\n\t /**\r\n\t * Devuelve el nombre de la variable que almacenara el slot\r\n\t */\n\t\n\t }, {\n\t key: 'getNombreSlot',\n\t value: function getNombreSlot(params) {\n\t return 'top.slot_' + params.position.replace('-', '_');\n\t }\n\t\n\t /**\r\n\t * Clave unica de la posicion\r\n\t */\n\t\n\t }, {\n\t key: 'getClavePosicionInsertada',\n\t value: function getClavePosicionInsertada(params) {\n\t var clave = Publicidad.getNombreSlot(params) + '_' + Publicidad.getIdDiv(params);\n\t return clave;\n\t }\n\t\n\t /**\r\n\t * Refresh de una posicion\r\n\t */\n\t\n\t }, {\n\t key: 'pintarPosicionRefresh',\n\t value: function pintarPosicionRefresh(params) {\n\t Publicidad.log('En pintarPosicionRefresh. Refrescamos la posicion ' + params.position);\n\t eval('googletag.pubads().refresh([' + Publicidad.getNombreSlot(params) + ']);');\n\t }\n\t\n\t /**\r\n\t * Detectamos si se fuerza alguna configuracion via parametro en la URL. Parametros soportados:\r\n\t * adunit\r\n\t * cmvkey\r\n\t * gdp_debug\r\n\t * gdp_enableAmazonAds\r\n\t * gdp_singleRequest\r\n\t * gdp_syncRendering\r\n\t * gdp_enableKrux\r\n\t * gdp_forceActivePosition\r\n\t * gdp_infoSlot\r\n\t */\n\t\n\t }, {\n\t key: 'checkConfigFromURL',\n\t value: function checkConfigFromURL() {\n\t if (typeof top.location === 'undefined') return;\n\t\n\t // Modo debug\n\t if (top.location.href.indexOf('gdp_debug=1') != -1) Publicidad.debug = true;\n\t\n\t // Amazon Ads\n\t if (top.location.href.indexOf('gdp_enableAmazonAds=') != -1) {\n\t Publicidad.configGDPMedio.enableAmazonAds = top.location.href.indexOf('gdp_enableAmazonAds=1') != -1;\n\t }\n\t\n\t // Single Request\n\t if (top.location.href.indexOf('gdp_singleRequest=') != -1) {\n\t Publicidad.configGDPMedio.singleRequest = top.location.href.indexOf('gdp_singleRequest=1') != -1;\n\t }\n\t\n\t // SyncRendering\n\t if (top.location.href.indexOf('gdp_syncRendering=') != -1) {\n\t Publicidad.configGDPMedio.syncRendering = top.location.href.indexOf('gdp_syncRendering=1') != -1;\n\t }\n\t\n\t // Krux\n\t if (top.location.href.indexOf('gdp_enableKrux=') != -1) {\n\t Publicidad.configGDPMedio.enableKrux = top.location.href.indexOf('gdp_enableKrux=1') != -1;\n\t }\n\t\n\t // Force active position\n\t Publicidad.configGDPMedio.forceActivePosition = top.location.href.indexOf('gdp_forceActivePosition=1') != -1;\n\t\n\t // InfoSlot\n\t Publicidad.configGDPMedio.infoSlot = top.location.href.indexOf('gdp_infoSlot=1') != -1;\n\t }\n\t\n\t /**\r\n\t * Carga del JS para la publicidad de Google\r\n\t */\n\t\n\t }, {\n\t key: 'cargaLibreriaGPT',\n\t value: function cargaLibreriaGPT() {\n\t window.googletag = window.googletag || {};\n\t googletag.cmd = googletag.cmd || [];\n\t try {\n\t if ($(\"script[src*='www.googletagservices.com/tag/js/gpt.js']\").length === 0) {\n\t (function () {\n\t var gads = document.createElement('script');\n\t gads.async = true;\n\t gads.type = 'text/javascript';\n\t var useSSL = 'https:' == document.location.protocol;\n\t gads.src = (useSSL ? 'https:' : 'http:') + '//www.googletagservices.com/tag/js/gpt.js';\n\t var node = document.getElementsByTagName('script')[0];\n\t node.parentNode.insertBefore(gads, node);\n\t })();\n\t }\n\t } catch (err) {}\n\t }\n\t\n\t /**\r\n\t * Integracion con Amazon Ads\r\n\t */\n\t\n\t }, {\n\t key: 'cargaLibreriaAmazonAds',\n\t value: function cargaLibreriaAmazonAds() {\n\t window.amznads = window.amznads || {};\n\t try {\n\t if (typeof Publicidad.configGDPMedio != \"undefined\" && typeof Publicidad.configGDPMedio.enableAmazonAds != \"undefined\" && Publicidad.configGDPMedio.enableAmazonAds && $(\"script[src*='c.amazon-adsystem.com/aax2/amzn_ads.js']\").length === 0) {\n\t (function () {\n\t var a,\n\t s = document.getElementsByTagName(\"script\")[0];\n\t a = document.createElement(\"script\");\n\t a.type = \"text/javascript\";\n\t a.async = true;\n\t a.src = \"//c.amazon-adsystem.com/aax2/amzn_ads.js\";\n\t s.parentNode.insertBefore(a, s);\n\t })();\n\t\n\t amznads.asyncParams = {\n\t 'id': _constants.AMAZONADS_ID_VOCENTO,\n\t 'callbackFn': function callbackFn() {\n\t if (!Publicidad.amazonads_inicializado) {\n\t try {\n\t amznads.setTargetingForGPTAsync('amznslots');\n\t } catch (e) {\n\t Publicidad.log('ERROR En cargaLibreriaAmazonAds integrando AmazonAds: ' + e, 'warn');\n\t }\n\t\n\t // Las llamadas a DFP que se hagan a partir de este momento ya incorporan el targeting de Amazon\n\t Publicidad.log('En cargaLibreriaAmazonAds. Disparado evento ' + _constants.AMAZONADS_READY);\n\t Publicidad.amazonads_inicializado = true;\n\t _app.trigger(_constants.AMAZONADS_READY);\n\t }\n\t },\n\t 'timeout': 2e3\n\t };\n\t }\n\t\n\t if (typeof Publicidad.configGDPMedio != \"undefined\" && typeof Publicidad.configGDPMedio.enableAmazonAds != \"undefined\" && Publicidad.configGDPMedio.enableAmazonAds) {\n\t // Comprobamos transcurrido unos segundos si el JS ha sido cargado y sino liberamos el evento para que no se quede pendiente la publicidad\n\t setTimeout(function () {\n\t Publicidad.amazonads_inicializado = true;\n\t _app.trigger(_constants.AMAZONADS_READY);\n\t }, _constants.AMAZONADS_TIMEOUT_ERROR_CARGA_JS);\n\t }\n\t } catch (err) {}\n\t }\n\t\n\t /**\r\n\t * Obtiene la edicion desde el namespace\r\n\t */\n\t\n\t }, {\n\t key: 'getEdition',\n\t value: function getEdition() {\n\t var editions = _app.lookup(_constants.EDITIONS_NAMESPACE);\n\t return editions.current || editions.main || '';\n\t }\n\t }]);\n\t\n\t return Publicidad;\n\t}();\n\t\n\texports.default = Publicidad;\n\n/***/ }),\n\n/***/ 45:\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\tvar CONFIG_NAMESPACE = exports.CONFIG_NAMESPACE = 'vocento.config.vam';\n\tvar EDITIONS_NAMESPACE = exports.EDITIONS_NAMESPACE = 'vocento.site.editions';\n\tvar GPT_ID_VOCENTO = exports.GPT_ID_VOCENTO = '4900';\n\tvar GPT_READY = exports.GPT_READY = 'vam:gpt:ready';\n\tvar GPT_TIMEOUT = exports.GPT_TIMEOUT = 2000;\n\tvar TIMEOUT_POSICIONES_ESTANDAR = exports.TIMEOUT_POSICIONES_ESTANDAR = 3000;\n\tvar AMAZONADS_ID_VOCENTO = exports.AMAZONADS_ID_VOCENTO = '3470';\n\tvar AMAZONADS_READY = exports.AMAZONADS_READY = 'vam:amazonads:ready';\n\tvar AMAZONADS_TIMEOUT_ERROR_CARGA_JS = exports.AMAZONADS_TIMEOUT_ERROR_CARGA_JS = 7000;\n\tvar ALTOS_MINIMOS_DISPOSITIVOS = exports.ALTOS_MINIMOS_DISPOSITIVOS = {\n\t \"mobile\": 0,\n\t \"tablet\": 200,\n\t \"desktop\": 300\n\t};\n\tvar POSITION_FLUID = exports.POSITION_FLUID = \"'fluid'\";\n\tvar SLOT_RENDERED = exports.SLOT_RENDERED = 'vam:slotrendered';\n\tvar SLOT_EMPTY = exports.SLOT_EMPTY = 'vam:isempty';\n\n/***/ })\n\n/******/ })\n});\n;\n\n\n// WEBPACK FOOTER //\n// vam.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 8ad91b65dbf1724466d3","import pkg from '../package.json';\nimport './dfp-pixel';\nimport Publicidad from './publicidad';\nimport {CONFIG_NAMESPACE} from './constants';\n\nVoonto.ready.then((app) => {\n const config = app.lookup(CONFIG_NAMESPACE);\n\n if (!config.media || !config.options) {throw Error('[Ads Manager] missing configuration');}\n\n new Publicidad(app, config.media, config.options, false);\n\n Voonto.$('[data-voc-vam]').each(function() {\n Publicidad.printAds(Voonto.$(this), false);\n });\n\n app.on('vam:refresh', function(event, data) {\n data = typeof data === 'string' ? JSON.parse(data) : data;\n Publicidad.printAds(data);\n });\n});\n\nexport const VERSION = pkg.version;\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","module.exports = {\n\t\"name\": \"vam\",\n\t\"version\": \"3.2.1\",\n\t\"description\": \"\",\n\t\"main\": \"src/index.js\",\n\t\"scripts\": {\n\t\t\"start\": \"webpack-dev-server\",\n\t\t\"build\": \"./node_modules/webpack/bin/webpack.js\",\n\t\t\"report\": \"plato -r -d report -l .jshintrc -t ads-manager src\"\n\t},\n\t\"contributors\": [\n\t\t\"Jose Manuel Ortega <jmortega@vocento.com>\",\n\t\t\"Ernesto V. <evladpereda@ces.vocento.com>\",\n\t\t\"Iván Pérez <ivanperez@vocento.com>\"\n\t],\n\t\"license\": \"SEE LICENSE IN LICENSE.md\",\n\t\"devDependencies\": {\n\t\t\"babel-core\": \"^6.17.0\",\n\t\t\"babel-loader\": \"^6.2.5\",\n\t\t\"babel-polyfill\": \"^6.16.0\",\n\t\t\"babel-preset-es2015\": \"^6.16.0\",\n\t\t\"chai\": \"^3.5.0\",\n\t\t\"chalk\": \"^1.1.3\",\n\t\t\"html-webpack-plugin\": \"^2.24.1\",\n\t\t\"json-loader\": \"^0.5.4\",\n\t\t\"mocha\": \"^3.1.0\",\n\t\t\"mocha-loader\": \"^1.0.0\",\n\t\t\"webpack\": \"^1.13.3\",\n\t\t\"webpack-shell-plugin\": \"^0.4.3\"\n\t}\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./package.json\n// module id = 42\n// module chunks = 1","const\n UserTypes = Object.freeze({\n ANONYMOUS: 'anonimo'\n }),\n Genders = Object.freeze({\n FEM: 'f',\n MAS: 'm'\n })\n;\n\nconst {$} = Voonto;\n\nVoonto.ready.then((app) => {\n app.when('vocuser:ready').then((gigyaux) => {\n\n if (gigyaux.getUserType() === UserTypes.ANONYMOUS) {\n $('head').append(`<img src=\"//pubads.g.doubleclick.net/activity;dc_iu=/4900/pixel.bfp.vocento;ord=${_ord()};dc_seg=76171930?\" width=\"1\" height=\"1\" border=\"0\" />`);\n } else {\n $('head').append(`<img src=\"//pubads.g.doubleclick.net/activity;dc_iu=/4900/pixel.bfp.vocento;ord=${_ord()};dc_seg=76172050?\" width=\"1\" height=\"1\" border=\"0\" />`);\n\n app.when('vocuser:userdata').then((userdata) => {\n var gender, age;\n\n gender = userdata.responseGetUserInfo.user.gender;\n age = userdata.responseGetUserInfo.user.age;\n\n switch (gender) {\n case Genders.FEM:\n $('head').append(`<img src=\"//pubads.g.doubleclick.net/activity;dc_iu=/4900/pixel.bfp.vocento;ord=${_ord()};dc_seg=75868810?\" width=\"1\" height=\"1\" border=\"0\" />`);\n break;\n case Genders.MAS:\n $('head').append(`<img src=\"' + urlProtocol + '://pubads.g.doubleclick.net/activity;dc_iu=/4900/pixel.bfp.vocento;ord=${_ord()};dc_seg=75868570?\" width=\"1\" height=\"1\" border=\"0\" />`);\n break;\n }\n\n switch (true) {\n case '' !== age && 17 >= age:\n $('head').append(`<img src=\"' + urlProtocol + '://pubads.g.doubleclick.net/activity;dc_iu=/4900/pixel.bfp.vocento;ord=${_ord()};dc_seg=75867610?\" width=\"1\" height=\"1\" border=\"0\" />`);\n break;\n case 18 <= age && 24 >= age:\n $('head').append(`<img src=\"' + urlProtocol + '://pubads.g.doubleclick.net/activity;dc_iu=/4900/pixel.bfp.vocento;ord=${_ord()};dc_seg=75867850?\" width=\"1\" height=\"1\" border=\"0\" />`);\n break;\n case 25 <= age && 34 >= age:\n $('head').append(`<img src=\"' + urlProtocol + '://pubads.g.doubleclick.net/activity;dc_iu=/4900/pixel.bfp.vocento;ord=${_ord()};dc_seg=75867970?\" width=\"1\" height=\"1\" border=\"0\" />`);\n break;\n case 35 <= age && 44 >= age:\n $('head').append(`<img src=\"' + urlProtocol + '://pubads.g.doubleclick.net/activity;dc_iu=/4900/pixel.bfp.vocento;ord=${_ord()};dc_seg=75868210?\" width=\"1\" height=\"1\" border=\"0\" />`);\n break;\n case 45 <= age && 54 >= age:\n $('head').append(`<img src=\"' + urlProtocol + '://pubads.g.doubleclick.net/activity;dc_iu=/4900/pixel.bfp.vocento;ord=${_ord()};dc_seg=75868330?\" width=\"1\" height=\"1\" border=\"0\" />`);\n break;\n case '' !== age && 54 > age:\n $('head').append(`<img src=\"' + urlProtocol + '://pubads.g.doubleclick.net/activity;dc_iu=/4900/pixel.bfp.vocento;ord=${_ord()};dc_seg=75868450?\" width=\"1\" height=\"1\" border=\"0\" />`);\n break;\n }\n });\n }\n });\n});\n\n/* Private */\n\nfunction _ord() {\n return Math.random() * 10000000000000;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/dfp-pixel.js","import {version} from '../package.json';\r\n\r\nimport {\r\n GPT_ID_VOCENTO,\r\n GPT_READY,\r\n GPT_TIMEOUT,\r\n TIMEOUT_POSICIONES_ESTANDAR,\r\n AMAZONADS_ID_VOCENTO,\r\n AMAZONADS_READY,\r\n AMAZONADS_TIMEOUT_ERROR_CARGA_JS,\r\n ALTOS_MINIMOS_DISPOSITIVOS,\r\n POSITION_FLUID,\r\n SLOT_RENDERED,\r\n SLOT_EMPTY,\r\n EDITIONS_NAMESPACE\r\n} from './constants';\r\n\r\nconst {$} = Voonto;\r\nvar _app;\r\n\r\nclass Publicidad {\r\n constructor(app, configGDPMedio, configGDP, debug) {\r\n // Inicializacion de variables de instancia estaticas\r\n _app = app;\r\n Publicidad.configGDPMedio = configGDPMedio;\r\n Publicidad.configGDP = configGDP;\r\n Publicidad.debug = debug;\r\n\r\n // Detectamos si se fuerza via URL alguna configuracion\r\n Publicidad.checkConfigFromURL();\r\n\r\n Publicidad.medio = Publicidad.getMedio();\r\n Publicidad.listaEstandardDelayed = [];\r\n Publicidad.gpt_inicializado = false;\r\n Publicidad.amazonads_inicializado = false;\r\n Publicidad.listaPosicionesInsertadas = {};\r\n Publicidad.listaIdsInsertados = [];\r\n Publicidad.tipoDispositivo = Publicidad.getTipoDispositivo();\r\n Publicidad.tipoPagina = Publicidad.getTipoPagina();\r\n Publicidad.tipoFormatoJSON = Publicidad.getTipoFormatoJSON();\r\n Publicidad.log('En constructor. tipoDispositivo: ' + Publicidad.tipoDispositivo + ', tipoPagina: ' + Publicidad.tipoPagina + ', tipoFormatoJSON: ' + Publicidad.tipoFormatoJSON + ' (Version ' + version + ')');\r\n Publicidad.valueUserType = null;\r\n Publicidad.esMedioResponsive = Publicidad.esMedioResponsive();\r\n\r\n // Cargamos las librerias de GTP y de Amazon Ads lo antes posible (para no penalizar la visibilidad de la publicidad).\r\n Publicidad.cargaLibreriaGPT();\r\n Publicidad.cargaLibreriaAmazonAds();\r\n\r\n // Inicializacion de la libreria GPT\r\n googletag.cmd.push(function () {\r\n googletag.pubads().collapseEmptyDivs();\r\n if ((typeof Publicidad.configGDPMedio.enableKrux != \"undefined\") && (Publicidad.configGDPMedio.enableKrux) && (typeof Krux != \"undefined\") &&\r\n (typeof Krux.vocento != \"undefined\") && (typeof Krux.vocento.segments != \"undefined\") && (typeof Krux.vocento.user != \"undefined\")) {\r\n googletag.pubads().setTargeting('ksg', Krux.vocento.segments);\r\n googletag.pubads().setTargeting('kuid', Krux.vocento.user);\r\n }\r\n if (Publicidad.configGDPMedio.singleRequest) googletag.pubads().enableSingleRequest();\r\n if (Publicidad.configGDPMedio.syncRendering) googletag.pubads().enableSyncRendering();\r\n googletag.enableServices();\r\n\r\n // Disparamos el evento de GPT inicializada\r\n Publicidad.log('En constructor. Disparamos evento ' + GPT_READY);\r\n _app.trigger(GPT_READY);\r\n Publicidad.gpt_inicializado = true;\r\n });\r\n\r\n // Disparamos el evento de GPT inicializado tras N segundos para liberar posibles recursos que esten bloqueados\r\n setTimeout(function () {\r\n if (!Publicidad.gpt_inicializado) {\r\n Publicidad.log('En constructor. Disparamos evento ' + GPT_READY + ' tras timeout', 'warn');\r\n _app.trigger(GPT_READY);\r\n }\r\n }, GPT_TIMEOUT);\r\n\r\n // Gestion de posiciones priorizadas\r\n Publicidad.hayPriorizadas = (eval('Publicidad.configGDP.priorizadas.' + Publicidad.tipoDispositivo) !== undefined) && (eval('Publicidad.configGDP.priorizadas.' + Publicidad.tipoDispositivo + '.listaPosiciones') !== undefined) ? true : false;\r\n Publicidad.listaPriorizadas = Publicidad.hayPriorizadas ? eval('Publicidad.configGDP.priorizadas.' + Publicidad.tipoDispositivo + '.listaPosiciones') : '';\r\n if (Publicidad.hayPriorizadas) Publicidad.log('En constructor. Hay posiciones priorizadas: ' + Publicidad.listaPriorizadas);\r\n Publicidad.listaArrayPriorizadas = Publicidad.listaPriorizadas.split(\",\");\r\n Publicidad.completadasPriorizadas = false;\r\n\r\n // Gestion de posiciones retrasadas\r\n Publicidad.hayRetrasadas = (eval('Publicidad.configGDP.retrasadas.' + Publicidad.tipoDispositivo) !== undefined) && (eval('Publicidad.configGDP.retrasadas.' + Publicidad.tipoDispositivo + '.listaPosiciones') !== undefined) ? true : false;\r\n Publicidad.listaRetrasadas = Publicidad.hayRetrasadas ? eval('Publicidad.configGDP.retrasadas.' + Publicidad.tipoDispositivo + '.listaPosiciones') : '';\r\n if (Publicidad.hayRetrasadas) Publicidad.log('En constructor. Hay posiciones retrasadas: ' + Publicidad.listaRetrasadas);\r\n\r\n // Tratamiento de excepciones y de targetings\r\n Publicidad.configGDP = Publicidad.comprobamosExcepciones();\r\n Publicidad.targetings = Publicidad.getTargetingsConfig();\r\n\r\n // Gestion de eventos de pintado de publicidad\r\n googletag.cmd.push(function () {\r\n googletag.pubads().addEventListener('slotRenderEnded', function (ev) {\r\n var div_id = ev.slot.getSlotElementId();\r\n var position = ev.slot.getTargeting('pos');\r\n var container$ = $(\"#\" + div_id);\r\n var paramsSlot = container$.data(\"params\");\r\n\r\n if (ev.isEmpty) {\r\n Publicidad.log('En constructor. slotRenderEnded. La posicion ' + position + ' isEmpty');\r\n container$.trigger(SLOT_EMPTY);\r\n } else {\r\n Publicidad.log('En constructor. slotRenderEnded. La posicion ' + position + ' ha sido pintada en el DIV ' + div_id);\r\n container$.trigger(SLOT_RENDERED);\r\n }\r\n\r\n // Comprobacion si tiene eventos post_callback o post_event\r\n if (paramsSlot) {\r\n if (paramsSlot.post_callback) {\r\n Publicidad.log('En constructor. slotRenderEnded. La posicion ' + position + ' tiene el siguiente postCallback: ' + paramsSlot.post_callback);\r\n eval(paramsSlot.post_callback);\r\n }\r\n\r\n if (paramsSlot.post_event) {\r\n Publicidad.log('En constructor. slotRenderEnded. La posicion ' + position + ' tiene el siguiente postEvent: ' + paramsSlot.post_event);\r\n _app.trigger(paramsSlot.post_event);\r\n }\r\n }\r\n\r\n // Quitamos la posicion de la lista de posiciones priorizadas\r\n var index = $.inArray(position[0], Publicidad.listaArrayPriorizadas);\r\n if (index != -1) {\r\n Publicidad.listaArrayPriorizadas.splice(index, 1);\r\n }\r\n\r\n // Quitamos la posicion de la lista de posiciones estandar encoladas\r\n if (Publicidad.hayPriorizadas && (Publicidad.listaEstandardDelayed.length > 0) && !Publicidad.esPriorizada(paramsSlot)) {\r\n index = $.inArray(position[0], Publicidad.listaEstandardDelayed);\r\n if (index != -1) {\r\n Publicidad.listaEstandardDelayed.splice(index, 1);\r\n }\r\n }\r\n\r\n // Si esta era la ultima priorizada pintamos las estandar\r\n if (!Publicidad.completadasPriorizadas && (Publicidad.listaArrayPriorizadas.length === 0)) {\r\n Publicidad.completadasPriorizadas = true;\r\n Publicidad.displayDelayed();\r\n }\r\n });\r\n });\r\n\r\n // Si hay posiciones priorizadas las pintamos e invocamos el pintado de las estandar una vez pintadas estas\r\n if (Publicidad.hayPriorizadas) {\r\n Publicidad.pintaPriorizadas(Publicidad.listaPriorizadas);\r\n\r\n // Si han transcurrido N segundos y todavia no se han lanzado las posiciones estandar las forzamos\r\n setTimeout(function () {\r\n if (Publicidad.listaEstandardDelayed.length > 0) {\r\n Publicidad.completadasPriorizadas = true;\r\n Publicidad.displayDelayed();\r\n }\r\n }, TIMEOUT_POSICIONES_ESTANDAR);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Normalizacion de parametros\r\n */\r\n static normalizaParams(datos, esJSON) {\r\n var params = {};\r\n\r\n // Distinguimos entre si recibimos un objeto DOM o bien un objeto JSON\r\n if (esJSON) {\r\n $.extend(params, {\r\n position: datos.position || null,\r\n serverType: datos.serverType || Publicidad.getServerType(params),\r\n hideNoAds: datos.hideNoAds || true,\r\n outOfPage: datos.outOfPage || false,\r\n defineSlot: datos.defineSlot || Publicidad.getDefineSlotParam(),\r\n refresh: datos.refresh || false,\r\n responsive: datos.responsive || false,\r\n pre_callback: datos.pre_callback || '',\r\n pre_event: datos.pre_event || '',\r\n post_callback: datos.post_callback || '',\r\n post_event: datos.post_event || '',\r\n oas: datos.oas || '',\r\n tags: datos.tags\r\n });\r\n } else {\r\n $.extend(params, {\r\n position: datos.data('voc-vam-position') || null,\r\n serverType: datos.data('voc-vam-servertype') || Publicidad.getServerType(params),\r\n hideNoAds: datos.data('voc-vam-hidenoads') || true,\r\n outOfPage: datos.data('voc-vam-outofpage') || false,\r\n defineSlot: datos.data('voc-vam-defineslot') || Publicidad.getDefineSlotParam(),\r\n refresh: datos.data('voc-vam-refresh') || false,\r\n responsive: datos.data('voc-vam-responsive') || false,\r\n pre_callback: datos.data('voc-vam-precallback') || '',\r\n pre_event: datos.data('voc-vam-preevent') || '',\r\n post_callback: datos.data('voc-vam-postcallback') || '',\r\n post_event: datos.data('voc-vam-postevent') || '',\r\n oas: datos.data('voc-vam-oas') || '',\r\n tags: datos.data('voc-vam-tags')\r\n });\r\n }\r\n\r\n // DIV que contendra la publicidad\r\n var idAds = Publicidad.getIdDiv(params);\r\n if (!$('#' + idAds).length && (typeof $(\"[data-voc-vam-position = '\" + params.position + \"']\") !== 'undefined') && (typeof $(\"[data-voc-vam-position = '\" + params.position + \"']\").attr('id') === 'undefined')) {\r\n $(\"[data-voc-vam-position = '\" + params.position + \"']\").attr('id', idAds);\r\n }\r\n params.id = idAds;\r\n\r\n // Si falta algun parametro obligatorio devolvemos null\r\n if (params.position === null) {\r\n Publicidad.log('ERROR: El parametro position es obligatorio', 'warn');\r\n return null;\r\n }\r\n\r\n if (!Publicidad.existePosEnConfigGDPMedio(params.position)) {\r\n Publicidad.log('ERROR: La posicion \"' + params.position + '\" no existe en configGDPMedio', 'warn');\r\n return null;\r\n }\r\n\r\n // Construimos el parametro responsive en caso de que no venga relleno en la propia llamada\r\n if (!params.responsive && Publicidad.esMedioResponsive) params.responsive = Publicidad.getResponsiveParam(params);\r\n\r\n return params;\r\n }\r\n\r\n /**\r\n * Funcion que genera el scriptText que pinta la publicidad.\r\n * @param object params\r\n * @return string\r\n */\r\n static getScriptText(params) {\r\n var scriptText;\r\n var size_dc = Publicidad.getSizesGoogle(params.position);\r\n var idAds = Publicidad.getIdDiv(params);\r\n\r\n // Codigo para ocultar el div si no hay publi\r\n var hideText = params.hideNoAds ? '.setCollapseEmptyDiv(true)' : '';\r\n\r\n // Codigo para anadir tags en el caso que la posicion de publi lo necesite\r\n var targetingsTags;\r\n var targetingText = '';\r\n if (params.tags) { // si llegan en la funcion ads.print\r\n targetingsTags = params.tags;\r\n }\r\n\r\n var tag;\r\n for (tag in targetingsTags) {\r\n targetingText += '.setTargeting(\"' + tag + '\", \"' + targetingsTags[tag] + '\")';\r\n }\r\n for (tag in Publicidad.targetings) {\r\n targetingText += '.setTargeting(\"' + tag + '\", \"' + Publicidad.targetings[tag] + '\")';\r\n }\r\n\r\n // Targeting con tipo de usuario de Gigya\r\n if (Publicidad.valueUserType === null) Publicidad.valueUserType = Publicidad.getValueUser(Publicidad.getGigyaUserType());\r\n var cadenaTipoDispositivo = (Publicidad.tipoDispositivo == 'mobile') ? 'm' : 'w';\r\n targetingText += \".setTargeting('st', '\" + Publicidad.valueUserType + \"').setTargeting('stt', '\" + cadenaTipoDispositivo + Publicidad.valueUserType + \"')\";\r\n\r\n // Se comprueba si se fuerza algun targeting via URL con el parametro cmvkey\r\n if ((typeof location != 'undefined') && (location.href.indexOf('cmvkey=') != -1)) {\r\n var pattern = /(\\?|&)cmvkey=([^?&]+)/;\r\n var esValida = pattern.exec(location.href);\r\n if (esValida) {\r\n var targetingsURL = esValida[2];\r\n\r\n try {\r\n var targetingsURL_decoded = decodeURIComponent(targetingsURL);\r\n var targetingsURL_trozos = targetingsURL_decoded.split(',');\r\n\r\n for (var trozo in targetingsURL_trozos) {\r\n var clave_y_valor = targetingsURL_trozos[trozo].split(\"=\");\r\n\r\n var trozo_clave = clave_y_valor[0];\r\n var trozo_valor = clave_y_valor[1];\r\n targetingText += '.setTargeting(\"' + trozo_clave + '\", \"' + trozo_valor + '\")';\r\n }\r\n } catch (e) {\r\n Publicidad.log('ERROR en getScriptText procesando cmvkey: ' + e, 'warn');\r\n }\r\n }\r\n }\r\n\r\n // Se comprueba si enableTopics esta habilitado\r\n try {\r\n if ((typeof Publicidad.configGDPMedio != \"undefined\") && (typeof Publicidad.configGDPMedio.enableTopics != \"undefined\") && (Publicidad.configGDPMedio.enableTopics) &&\r\n (typeof voc_top != \"undefined\") && (voc_top !== '')) {\r\n\r\n var topics = voc_top.split(',');\r\n for (var i = 0; i < topics.length; i++) {\r\n targetingText += '.setTargeting(\"topics\", \"' + topics[i] + '\")';\r\n }\r\n }\r\n } catch (e) {\r\n Publicidad.log('ERROR en getScriptText procesando enableTopics: ' + e, 'warn');\r\n }\r\n\r\n // Se comprueba si enableTpag esta habilitado\r\n try {\r\n if ((typeof Publicidad.configGDPMedio != \"undefined\") && (typeof Publicidad.configGDPMedio.enableTpag != \"undefined\") && (Publicidad.configGDPMedio.enableTpag)) {\r\n targetingText += '.setTargeting(\"tpag\", \"' + Publicidad.tipoPagina + '\")';\r\n }\r\n } catch (e) {\r\n Publicidad.log('ERROR en getScriptText procesando tpag: ' + e, 'warn');\r\n }\r\n\r\n // Comprobaciones para medios responsives\r\n var objetoMapping = {};\r\n var sizeMapping = '';\r\n var defineSizeMapping = '';\r\n if (params.responsive && $.isArray(params.responsive) && params.responsive.length > 0) {\r\n objetoMapping = Publicidad.getSizeMapping(params);\r\n sizeMapping = ((typeof objetoMapping !== 'undefined') && (typeof objetoMapping.definicion !== 'undefined')) ? objetoMapping.definicion : '';\r\n defineSizeMapping = ((typeof objetoMapping !== 'undefined') && (typeof objetoMapping.script !== 'undefined')) ? objetoMapping.script : '';\r\n }\r\n\r\n if (!params.outOfPage) {\r\n if (params.defineSlot) {\r\n scriptText = sizeMapping + Publicidad.getNombreSlot(params) + \" = googletag.defineSlot('\" + Publicidad.getOasSitepage(params) + \"', \" + size_dc + \", '\" + idAds + \"')\" + defineSizeMapping + \".setTargeting('pos','\" + params.position + \"')\" + targetingText + hideText + \".addService(googletag.pubads());\";\r\n }\r\n } else {\r\n if (params.defineSlot) {\r\n scriptText = sizeMapping + Publicidad.getNombreSlot(params) + \" = googletag.defineOutOfPageSlot('\" + Publicidad.getOasSitepage(params) + \"', '\" + idAds + \"')\" + defineSizeMapping + \".setTargeting('pos','\" + params.position + \"')\" + targetingText + hideText + \".addService(googletag.pubads());\";\r\n }\r\n }\r\n\r\n Publicidad.log('En getScriptText. defineSlot: ' + scriptText);\r\n\r\n var key = Publicidad.getClavePosicionInsertada(params);\r\n Publicidad.listaPosicionesInsertadas[key] = scriptText;\r\n Publicidad.listaIdsInsertados.push(idAds);\r\n\r\n return scriptText;\r\n }\r\n\r\n /**\r\n * Funcion que obtiene el valor de oas del fichero de configuracion.\r\n * @return string\r\n */\r\n static getOasSitepage(params) {\r\n var oasSitepage;\r\n params = params || {};\r\n\r\n if ((typeof params.oas != \"undefined\") && (params.oas !== '')) {\r\n oasSitepage = params.oas;\r\n } else {\r\n oasSitepage = (typeof eval('Publicidad.configGDP.OAS.' + Publicidad.tipoDispositivo + '.' + Publicidad.tipoPagina) != \"undefined\") ? eval('Publicidad.configGDP.OAS.' + Publicidad.tipoDispositivo + '.' + Publicidad.tipoPagina) : '';\r\n }\r\n\r\n // Comprobamos si se fuerza un adunit por defecto via URL\r\n try {\r\n if ((typeof top.location !== 'undefined') && (top.location.href.indexOf('adunit=') != -1)) {\r\n let pattern = /(\\?|&)adunit=([^?&]+)/;\r\n let esValida = pattern.exec(top.location.href);\r\n if (esValida) {\r\n oasSitepage = (esValida[2].indexOf('/' + GPT_ID_VOCENTO + '/') != -1) ? esValida[2] : '/' + GPT_ID_VOCENTO + '/' + esValida[2];\r\n }\r\n }\r\n } catch (err) {}\r\n\r\n // Comprobamos si tiene alguna macro\r\n try {\r\n let pattern = /{(\\/)?edicion(\\/)?}/;\r\n let contieneMacroEdicion = pattern.exec(oasSitepage);\r\n if (contieneMacroEdicion) {\r\n // Lectura de la edicion del medio\r\n let cadenaEdicion = Publicidad.getEdition();\r\n\r\n if (contieneMacroEdicion[0].startsWith('{\\/') && (cadenaEdicion !== '')) cadenaEdicion = \"\\/\" + cadenaEdicion;\r\n if (contieneMacroEdicion[0].endsWith('\\/}') && (cadenaEdicion !== '')) cadenaEdicion += \"\\/\";\r\n\r\n oasSitepage = oasSitepage.replace(contieneMacroEdicion[0], cadenaEdicion);\r\n }\r\n } catch (err) {}\r\n\r\n // Guardamos el valor del adunit calculado por si no lo esta\r\n if (typeof Publicidad.configGDP.OAS.adunit === 'undefined') Publicidad.configGDP.OAS.adunit = oasSitepage;\r\n\r\n return oasSitepage;\r\n }\r\n\r\n /**\r\n * Funcion que obtiene las medidas en caso de que sea responsive.\r\n * @param object responsive\r\n * @return string sizeMapping\r\n */\r\n static getSizeMapping(params) {\r\n var objetoMapping = {\r\n definicion: '',\r\n script: ''\r\n };\r\n\r\n // @var responsive <googletag.SizeMappingArray>\r\n objetoMapping.definicion = 'var mapping = googletag.sizeMapping()';\r\n var responsive = params.responsive;\r\n\r\n for (var i = 0; i < responsive.length; i++) {\r\n var add_size_p = '';\r\n // @var responsive_p <googletag.SizeMapping> Pair viewportSize, slotSize\r\n var responsive_p = responsive[i];\r\n\r\n if (responsive_p.length === 2) {\r\n // @var viewportSize <googletag.SingleSizeArray>\r\n var viewportSize = responsive_p[0];\r\n // @var responsive_ad <googletag.GeneralSize>\r\n var responsive_ad = responsive_p[1];\r\n if (typeof responsive_ad === 'string') {\r\n if (responsive_ad.indexOf('fluid') !== -1) {\r\n responsive_ad = POSITION_FLUID;\r\n } else {\r\n responsive_ad = Publicidad.getSizesGoogle(responsive_ad);\r\n if ((typeof responsive_ad !== 'undefined') && (typeof responsive_ad === 'string')) responsive_ad = JSON.parse(responsive_ad);\r\n }\r\n }\r\n if ($.isArray(viewportSize) && viewportSize.length === 2 && ($.isArray(responsive_ad) || (responsive_ad === POSITION_FLUID))) {\r\n add_size_p = '[' + viewportSize[0] + ',' + viewportSize[1] + '],';\r\n if (responsive_ad.length > 0 && $.isArray(responsive_ad[0])) {\r\n // @var responsive_ad <googletag.MultiSize>\r\n add_size_p += '[';\r\n for (var j = 0; j < responsive_ad.length; j++) {\r\n // @var singleSize <googletag.SingleSize>\r\n var singleSize = responsive_ad[j];\r\n if (singleSize.length === 2) {\r\n add_size_p += (j === 0 ? '[' : ',[') + singleSize[0] + ',' + singleSize[1] + ']';\r\n }\r\n }\r\n add_size_p += ']';\r\n } else if (responsive_ad.length === 2) {\r\n // @var responsive_ad <googletag.SingleSize>\r\n add_size_p += '[' + responsive_ad[0] + ',' + responsive_ad[1] + ']';\r\n } else if (responsive_ad === POSITION_FLUID) {\r\n add_size_p += POSITION_FLUID;\r\n } else {\r\n add_size_p += '[]';\r\n }\r\n objetoMapping.definicion += '.addSize(' + add_size_p + ')';\r\n } else {\r\n Publicidad.log('ERROR En getSizeMapping: Parametro responsive malformado en posicion ' + params.position + '. responsive: ' + responsive, 'warn');\r\n return;\r\n }\r\n } else {\r\n Publicidad.log('ERROR En getSizeMapping: Parametro responsive malformado en posicion ' + params.position + '. responsive: ' + responsive, 'warn');\r\n return;\r\n }\r\n }\r\n\r\n objetoMapping.definicion += '.build();';\r\n objetoMapping.script = '.defineSizeMapping(mapping)';\r\n\r\n return objetoMapping;\r\n }\r\n\r\n /**\r\n * Obtiene el tipo de usuario de Gigya para la segmentacion de publicidad consultando la funcion getUserType()\r\n * @returns Tipo de usuario adaptado de Gigya para la segmentacion de la publicidad\r\n */\r\n static getGigyaUserType() {\r\n var gigyaUserType = 'anonimo';\r\n try {\r\n if (typeof getUserType != 'undefined') gigyaUserType = getUserType();\r\n } catch (err) {\r\n gigyaUserType = 'anonimo';\r\n }\r\n\r\n return gigyaUserType;\r\n }\r\n\r\n /**\r\n * Convierte el tipo de usuario de Gigya (en formato adaptado para publicidad)\r\n */\r\n static getValueUser(userType) {\r\n var valueUser = \"a\";\r\n\r\n if ((typeof userType == 'undefined') || (userType === null)) userType = Publicidad.getGigyaUserType();\r\n\r\n var arrayUsers = {\r\n suscriptor: \"s\",\r\n trial: \"t\",\r\n registrado: \"r\",\r\n anonimo: \"a\"\r\n };\r\n\r\n if (userType in arrayUsers) {\r\n valueUser = arrayUsers[userType];\r\n }\r\n\r\n return valueUser;\r\n }\r\n\r\n /**\r\n * Calcula el array de dimensiones para una posicion dada. Opcionalmente se puede indicar un tipo de dispositivo (si va vacio se usa el tipo actual)\r\n * @param {string} position\r\n * @param {string} tipoDispositivo\r\n * @return object\r\n */\r\n static getSizesGoogle(position, tipoDispositivo) {\r\n var tipoDispositivo = tipoDispositivo || Publicidad.tipoDispositivo;\r\n var xpath = (Publicidad.tipoFormatoJSON === 2) ? 'Publicidad.configGDPMedio.posicion_' + tipoDispositivo + '[\"' + position + '\"].dimensiones' : 'Publicidad.configGDPMedio.posiciones[\"' + position + '\"]';\r\n var size = (typeof eval(xpath) !== \"undefined\") ? eval(xpath) : '[]';\r\n var defineSlot = Publicidad.getDefineSlotParam();\r\n\r\n if (size.indexOf('[fluid]') != -1) {\r\n size = size.replace('[fluid]', '\\'fluid\\'');\r\n\r\n if (!defineSlot) return ['fluid'];\r\n }\r\n\r\n return (defineSlot) ? size : JSON.parse(size);\r\n }\r\n\r\n /**\r\n * Log en la consola\r\n * @param (string) msg\r\n */\r\n static log(msg, tipo) {\r\n try {\r\n tipo = tipo || 'log';\r\n if (typeof console !== 'undefined' && Publicidad.debug) {\r\n switch (tipo) {\r\n case 'warn':\r\n console.warn('[Ads Manager] ' + msg);\r\n break;\r\n\r\n case 'error':\r\n console.error('[Ads Manager] ' + msg);\r\n break;\r\n\r\n default:\r\n console.log('[Ads Manager] ' + msg);\r\n break;\r\n }\r\n }\r\n } catch (err) {}\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Version de la libreria\r\n */\r\n version() {\r\n return version;\r\n }\r\n\r\n /**\r\n * Funcion que busca el medio en el que nos encontramos, dentro del fichero de configuracion\r\n * @return string\r\n */\r\n static getMedio() {\r\n var medio = (typeof Publicidad.configGDPMedio.medio != \"undefined\") ? Publicidad.configGDPMedio.medio : '';\r\n return medio;\r\n }\r\n\r\n /**\r\n * Devuelve el tipo de dispositivo en funcion del tamano de la pagina\r\n * @return string\r\n */\r\n static getTipoDispositivo() {\r\n var cTipoDispositivo = 'desktop';\r\n\r\n if (!Publicidad.configGDPMedio.responsive.esResponsive) {\r\n if (Publicidad.configGDPMedio && Publicidad.configGDPMedio.tipoDispositivo) {\r\n cTipoDispositivo = Publicidad.configGDPMedio.tipoDispositivo;\r\n }\r\n } else {\r\n var screen_width = parseInt(top.window.innerWidth);\r\n\r\n $.each(Publicidad.configGDPMedio.responsive, function (clave, valor) {\r\n if ((clave !== 'esResponsive') && (valor.resolucionMaxima || valor.resolucionMinima)) {\r\n var maximo = valor.resolucionMaxima ? valor.resolucionMaxima : 999999;\r\n var minimo = valor.resolucionMinima ? valor.resolucionMinima : 0;\r\n\r\n if ((screen_width <= maximo) && (screen_width > minimo)) {\r\n var cTempTipo = clave.replace(\"resolucion\", \"\").toLowerCase();\r\n cTipoDispositivo = cTempTipo;\r\n }\r\n }\r\n });\r\n }\r\n\r\n return cTipoDispositivo;\r\n }\r\n\r\n /**\r\n * Devuelve la version del tipo de formato JSON: 1 o 2\r\n */\r\n static getTipoFormatoJSON() {\r\n var tipo = 1;\r\n\r\n if ((typeof Publicidad.configGDPMedio != \"undefined\") && (typeof Publicidad.configGDPMedio.tiposPublicidad != \"undefined\")) {\r\n tipo = 2;\r\n }\r\n\r\n return tipo;\r\n }\r\n\r\n /**\r\n * Detectamos el tipo de pagina a partir del patron de la URL.\r\n * NOTA: Cada medio tiene sus propias reglas de URLs por lo que tiene su propia funcion para calcularlas\r\n */\r\n static getTipoPagina() {\r\n var tipoPagina = 'portada';\r\n if (Publicidad.medio == 'abc' || Publicidad.medio == 'lavozdigital' || Publicidad.medio == 'abcdesevilla') {\r\n tipoPagina = Publicidad.getTipoPaginaABC();\r\n } else if (Publicidad.medio == 'mujerhoy') {\r\n tipoPagina = Publicidad.getTipoPaginaMujerhoy();\r\n } else {\r\n tipoPagina = Publicidad.getTipoPaginaPortalesLocales();\r\n }\r\n\r\n return tipoPagina;\r\n }\r\n\r\n /**\r\n * Calculo del tipo de pagina en funcion de la URL para los medios de ABC (ABC, Sevilla y La Voz Digital)\r\n */\r\n static getTipoPaginaABC() {\r\n var reVideosAntiguos = /\\/videos\\/(.*)?\\/\\d{6}\\/\\d{2}\\/((?!index.html).)*.html/;\r\n var reVideos = /_video.html/;\r\n var esVideo = (reVideos.exec(location.pathname) || reVideosAntiguos.exec(location.pathname));\r\n if (esVideo) return 'video';\r\n\r\n var reGaleriasAntiguos2 = /\\/multimedia\\/fotos\\/(.*)?\\/((?!index.html).)*.html/;\r\n var reGaleriasAntiguos = /\\/fotos-(.*)?\\/\\d{8}\\/((?!index.html).)*.html/;\r\n var reGalerias = /_galeria.html/;\r\n var esGaleria = (reGalerias.exec(location.pathname) || reGaleriasAntiguos.exec(location.pathname) || reGaleriasAntiguos2.exec(location.pathname));\r\n if (esGaleria) return 'galeria';\r\n\r\n var reGraficos = /\\/multimedia\\/(graficos\\/(.)*|infografias)\\/((?!index.html).)*.html/;\r\n var esGrafico = reGraficos.exec(location.pathname);\r\n if (esGrafico) return 'grafico';\r\n\r\n var reNoticiasAntiguos = /\\d{8}\\/(.*)?((?!index.html).)*.html/;\r\n var reNoticias = /(_noticia.html|_directo.html)/;\r\n var esNoticia = (reNoticias.exec(location.pathname) || reNoticiasAntiguos.exec(location.pathname));\r\n if (esNoticia) return 'noticia';\r\n\r\n return 'portada';\r\n }\r\n\r\n /**\r\n * Calculo del tipo de pagina en funcion de la URL para Mujerhoy\r\n */\r\n static getTipoPaginaMujerhoy() {\r\n var reVideos = /-vi.html/;\r\n var reVideosOld = /\\/videos\\/(.*)?\\/\\d{6}\\/\\d{2}\\/.*-mm.html/;\r\n var reVideosBlogs = /\\/videos\\/\\d{4}\\/\\d{2}\\/\\d{2}\\/(.*).html/;\r\n var esVideo = (location.hostname.indexOf('blogs.') == -1) ? (reVideos.exec(location.pathname) || reVideosOld.exec(location.pathname)) : reVideosBlogs.exec(location.pathname);\r\n if (esVideo) return 'video';\r\n\r\n var reGalerias = /-ga.html/;\r\n var reGaleriasOld = /^\\/galerias\\/(.*)?\\d{6}\\/\\d{2}\\/.*-mm.html/;\r\n var reGaleriasBlogs = /\\/galerias\\/\\d{4}\\/\\d{2}\\/\\d{2}\\/(.*).html/;\r\n var esGaleria = (location.hostname.indexOf('blogs.') == -1) ? (reGalerias.exec(location.pathname) || reGaleriasOld.exec(location.pathname)) : reGaleriasBlogs.exec(location.pathname);\r\n if (esGaleria) return 'galeria';\r\n\r\n var reNoticias = /\\/\\d{6}\\/\\d{2}\\/((?!index.html).)*.html/;\r\n var reNoticiasBlogs = /\\/\\d{4}\\/\\d{2}\\/\\d{2}\\/((?!index.html).)*.html/;\r\n var reNoticiasRecetas = /\\/\\d{6}\\/((?!index.html).)*.html/;\r\n var esNoticia = false;\r\n if (location.hostname.indexOf('blogs.') != -1) esNoticia = reNoticiasBlogs.exec(location.pathname);\r\n else if (location.hostname.indexOf('recetas.') != -1) esNoticia = reNoticiasRecetas.exec(location.pathname);\r\n else esNoticia = reNoticias.exec(location.pathname);\r\n if (esNoticia) return 'noticia';\r\n\r\n return 'portada';\r\n }\r\n\r\n /**\r\n * Calculo del tipo de pagina en funcion de la URL para los Portales Locales\r\n */\r\n static getTipoPaginaPortalesLocales() {\r\n var reVideos = /-(vi|virc|vivo)(_amp)?.html/;\r\n var reVideosOld = /^\\/videos\\/(.*)?\\/\\d{6}\\/\\d{2}\\/.*-mm.html/;\r\n var esVideo = (reVideos.exec(location.pathname) || reVideosOld.exec(location.pathname));\r\n if (esVideo) return 'video';\r\n\r\n var reGalerias = /-(ga|garc|gavo|ft|ftrc|ftvo)(_amp)?.html/;\r\n var reGaleriasOld = /^\\/fotos\\/(.*)?\\d{6}\\/\\d{2}\\/.*-mm.html/;\r\n var esGaleria = (reGalerias.exec(location.pathname) || reGaleriasOld.exec(location.pathname));\r\n if (esGaleria) return 'galeria';\r\n\r\n var reGraficos = /-(in|inrc|invo)(_amp)?.html/;\r\n var reGraficosOld = /^\\/graficos\\/(.*)?\\/\\d{6}\\/\\d{2}\\/.*-mm.html/;\r\n var esGrafico = (reGraficos.exec(location.pathname) || reGraficosOld.exec(location.pathname));\r\n if (esGrafico) return 'grafico';\r\n\r\n var reNoticias = /-(nt|ntrc|ntvo)(_amp)?.html/;\r\n var reNoticiasOld = /\\/\\d{6}\\/\\d{2}\\/((?!index.html).)*.html/;\r\n var esNoticia = (reNoticias.exec(location.pathname) || reNoticiasOld.exec(location.pathname));\r\n if (esNoticia) return 'noticia';\r\n\r\n var reVideochats = /\\/videochats\\/((?!index.html).)\\w+/;\r\n var esVideochat = reVideochats.exec(location.pathname);\r\n if (esVideochat) return 'videochat';\r\n\r\n return 'portada';\r\n }\r\n\r\n /**\r\n * Funcion donde realiazamos la comprobación de si existen excepciones para la pagina donde nos encontramos.\r\n * @return object configGDP\r\n */\r\n static comprobamosExcepciones() {\r\n var configGDPAux = Publicidad.configGDP;\r\n if ((typeof Publicidad.configGDPMedio != 'undefined') && (typeof Publicidad.configGDPMedio.excepciones != 'undefined') && (Object.keys(Publicidad.configGDPMedio.excepciones).length > 0)) {\r\n Publicidad.log('En comprobamosExcepciones. Hay excepciones configuradas');\r\n\r\n $.each(Publicidad.configGDPMedio.excepciones, function (key, value) {\r\n if (key != \"priorizadas\" && key != \"retrasadas\") {\r\n if (location.pathname == key || location.pathname.match(key)) {\r\n var unix = Math.round(new Date() / 1000);\r\n var fechaini = value.fecha_in;\r\n var fechafin = value.fecha_fin;\r\n if ((fechaini === 0 || fechaini <= unix) && (fechafin === 0 || unix <= fechafin)) {\r\n configGDPAux = value;\r\n Publicidad.log('En comprobamosExcepciones. Aplicamos la siguiente excepcion:\"' + value + '\"');\r\n }\r\n }\r\n }\r\n });\r\n }\r\n\r\n return configGDPAux;\r\n }\r\n\r\n /**\r\n * Funcion que obtiene los tag definidos en los archivos de configuración\r\n * @return object\r\n */\r\n static getTargetingsConfig() {\r\n var targetingsMedio = (typeof Publicidad.configGDPMedio.targetings != \"undefined\") ? Publicidad.configGDPMedio.targetings : '';\r\n var targetingsPagina = (typeof Publicidad.configGDP.targetings != \"undefined\") ? Publicidad.configGDP.targetings : '';\r\n var targetings = $.extend({}, targetingsMedio, targetingsPagina);\r\n return targetings;\r\n }\r\n\r\n /**\r\n * Funcion que comprueba si una posicion esta priorizada\r\n */\r\n static esPriorizada(params) {\r\n var lista = Publicidad.listaPriorizadas.split(',');\r\n for (var i = 0; i < lista.length; i++) {\r\n if (lista[i] == params.position) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Funcion que comprueba si una posicion es retrasada\r\n */\r\n static esRetrasada(params) {\r\n var lista = Publicidad.listaRetrasadas.split(',');\r\n for (var i = 0; i < lista.length; i++) {\r\n if (lista[i] == params.position) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Lanza los printAds que se han encolado cuando hay priorizadas\r\n */\r\n static displayDelayed() {\r\n $.each(Publicidad.listaEstandardDelayed, function (i, params) {\r\n Publicidad.printAds(params, true);\r\n });\r\n }\r\n\r\n /**\r\n * Funcion que genera el identificador en funcion del medio\r\n * @param object params\r\n * @return string\r\n */\r\n static getIdDiv(params) {\r\n if (typeof params.id != \"undefined\") {\r\n return (params.id.indexOf(\"-id\") == -1) ? params.id + \"-id\" : params.id;\r\n } else {\r\n return params.position + \"-id\";\r\n }\r\n }\r\n\r\n /**\r\n * Funcion para pintar la publicidad priorizada\r\n * @return object\r\n */\r\n static pintaPriorizadas() {\r\n Publicidad.log('En pintaPriorizadas. Pintaremos las siguientes posiciones: ' + Publicidad.listaPriorizadas);\r\n var sonPosicionesPriorizadas = true;\r\n var lista = Publicidad.listaPriorizadas.split(',');\r\n Publicidad.pintaListaPosiciones(lista, sonPosicionesPriorizadas);\r\n return this;\r\n }\r\n\r\n /**\r\n * Funcion que recorre y pinta una lista de posiciones.\r\n * Si singleRequest esta habilitado las posiciones priorizadas funcionan como un Roadblock y se piden todas juntas (no llevaran eventos ni callbacks)\r\n */\r\n static pintaListaPosiciones(listaPositions, sonPosicionesPriorizadas) {\r\n if (Publicidad.configGDPMedio.singleRequest && sonPosicionesPriorizadas) {\r\n Publicidad.log('En pintaListaPosiciones. SingleRequest habilitado y hay posiciones priorizadas -> las pedimos como Roadblock');\r\n\r\n googletag.cmd.push(function () {\r\n for (var i = 0; i < listaPositions.length; i++) {\r\n var params = {\r\n position: listaPositions[i]\r\n };\r\n\r\n if (!Publicidad.existePosEnConfigGDPMedio(params.position)) {\r\n Publicidad.log('ERROR: La posicion priorizada ' + params.position + ' no existe en configGDPMedio', 'warn');\r\n continue;\r\n }\r\n\r\n // Recuperamos los paramteros del DIV en caso de que exista en la pagina\r\n var container$ = $(\"[data-voc-vam-position = '\" + params.position + \"']\");\r\n if (container$.length) {\r\n params = Publicidad.normalizaParams(container$, false);\r\n } else {\r\n params = Publicidad.normalizaParams(params, true);\r\n }\r\n\r\n eval(Publicidad.getScriptText(params));\r\n }\r\n\r\n // Si hay integracion con Amazon Ads hay que esperar al evento amazonads_ready\r\n if ((typeof Publicidad.configGDPMedio.enableAmazonAds != \"undefined\") && (Publicidad.configGDPMedio.enableAmazonAds) && !Publicidad.amazonads_inicializado) {\r\n Publicidad.log('En pintaListaPosiciones. Esperaremos al evento de amazonads_ready');\r\n _app.on(AMAZONADS_READY, params, function () {\r\n var idDiv = Publicidad.getIdDiv(params);\r\n googletag.display(idDiv);\r\n });\r\n } else {\r\n var idDiv = Publicidad.getIdDiv(params);\r\n googletag.display(idDiv);\r\n }\r\n });\r\n } else {\r\n googletag.cmd.push(function () {\r\n for (var i = 0; i < listaPositions.length; i++) {\r\n var params = {\r\n position: listaPositions[i]\r\n };\r\n\r\n // Recuperamos los paramteros del DIV en caso de que exista en la pagina\r\n var container$ = $(\"[data-voc-vam-position = '\" + params.position + \"']\");\r\n if (container$.length) {\r\n params = Publicidad.normalizaParams(container$, false);\r\n } else {\r\n params = Publicidad.normalizaParams(params, true);\r\n }\r\n\r\n Publicidad.printAds(params, true);\r\n }\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Funcion que obtiene el valor del defineSlot en nuestro objecto de configuracion\r\n * @return string\r\n */\r\n static getDefineSlotParam() {\r\n return ((typeof Publicidad.configGDPMedio.defineSlot != \"undefined\") ? Publicidad.configGDPMedio.defineSlot : '');\r\n }\r\n\r\n static esMedioResponsive() {\r\n return (typeof Publicidad.configGDPMedio.responsive.esResponsive != \"undefined\") ? Publicidad.configGDPMedio.responsive.esResponsive : false;\r\n }\r\n\r\n /**\r\n * Construye el parametro responsive de la posicion en caso de que sea responsive\r\n * @return object\r\n */\r\n static getResponsiveParam(params) {\r\n var tieneParamResponsive = (params.responsive && $.isArray(params.responsive) && params.responsive.length > 0);\r\n\r\n // No sera posicion responsive\r\n if (!tieneParamResponsive && !Publicidad.esMedioResponsive) {\r\n return false;\r\n }\r\n // Tiene parametro responsive en la llamada\r\n else if (tieneParamResponsive) {\r\n return params.responsive;\r\n }\r\n // No tiene parametro responsive en la llamada pero es medio responsive por lo que creamos el parametro con resoluciones y dimensiones correspondientes\r\n else if (Publicidad.esMedioResponsive) {\r\n return Publicidad.createResponsive(params);\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n /**\r\n * Funcion que crea el objeto responsive cuando un medio es responsive y la llamada no tiene el parametro relleno\r\n * @return object\r\n */\r\n static createResponsive(params) {\r\n var resolucionMinima, resolucionMaxima, responsive = [];\r\n var size_dc;\r\n\r\n var dispositivos = ['mobile', 'tablet', 'desktop'];\r\n for (var i = 0; i < dispositivos.length; i++) {\r\n var dispositivo = dispositivos[i];\r\n var dispositivoCapitalizado = dispositivo.charAt(0).toUpperCase() + dispositivo.slice(1);\r\n\r\n if (typeof eval('Publicidad.configGDPMedio.responsive.resolucion' + dispositivoCapitalizado) !== \"undefined\") {\r\n var anchoMinimo = (typeof eval('Publicidad.configGDPMedio.responsive.resolucion' + dispositivoCapitalizado + '.resolucionMinima') !== \"undefined\") ? eval('Publicidad.configGDPMedio.responsive.resolucion' + dispositivoCapitalizado + '.resolucionMinima') : '';\r\n var anchoMaximo = (typeof eval('Publicidad.configGDPMedio.responsive.resolucion' + dispositivoCapitalizado + '.resolucionMaxima') !== \"undefined\") ? eval('Publicidad.configGDPMedio.responsive.resolucion' + dispositivoCapitalizado + '.resolucionMaxima') : '';\r\n\r\n if (anchoMinimo !== '' || anchoMaximo !== '') {\r\n var dimension = [\r\n parseInt(anchoMinimo) || '0',\r\n ALTOS_MINIMOS_DISPOSITIVOS[dispositivo]\r\n ];\r\n\r\n var size = Publicidad.getSizesGoogle(params.position, dispositivo);\r\n try {\r\n if ((size !== null) && (size.indexOf('fluid') !== -1)) {\r\n size_dc = 'fluid';\r\n } else {\r\n size_dc = JSON.parse(size);\r\n }\r\n } catch (e) {\r\n Publicidad.log('ERROR en createResponsive procesando la posicion' + params.position + ': ' + e, 'warn');\r\n size_dc = size;\r\n }\r\n responsive.push([dimension, size_dc]);\r\n }\r\n }\r\n }\r\n\r\n return responsive;\r\n }\r\n\r\n /**\r\n * Devuelve el serverType de la posicion pasada como parametro\r\n */\r\n static getServerType(params) {\r\n var serverType = 'google';\r\n\r\n if (Publicidad.tipoFormatoJSON === 2) {\r\n try {\r\n var xpath = 'Publicidad.configGDPMedio.posicion_' + tipoDispositivo + '.' + params.position;\r\n serverType = (typeof eval(xpath) !== \"undefined\") && (typeof eval(xpath + '.tipo') !== \"undefined\") ? eval(xpath + '.tipo') : 'google';\r\n } catch (err) {}\r\n }\r\n\r\n return serverType;\r\n }\r\n\r\n static existePosEnConfigGDPMedio(position) {\r\n var existe = false;\r\n\r\n // Comprobamos que exista en la lista de posiciones de configGDPMedio\r\n var xpath = (Publicidad.tipoFormatoJSON === 2) ? 'Publicidad.configGDPMedio.posicion_' + Publicidad.tipoDispositivo + '.' + position : 'Publicidad.configGDPMedio.posiciones.' + position;\r\n if (typeof eval(xpath) !== \"undefined\") existe = true;\r\n\r\n // Si no existe la posicion ocultamos su DIV contenedor\r\n if (!existe) {\r\n var params = {};\r\n params.position = position;\r\n var idAds = Publicidad.getIdDiv(params);\r\n if ($('#' + idAds).length) $('#' + idAds).hide();\r\n }\r\n\r\n return existe;\r\n }\r\n\r\n /**\r\n * Funcion que checkea si la publicidad esta activada o desactivada.\r\n * @param object params\r\n * @return boolean\r\n */\r\n static checkActivePosition(params) {\r\n // Comprobamos si se ha forzado via URL que todas las posiciones esten activas\r\n if ((typeof Publicidad.configGDPMedio !== \"undefined\") && (typeof Publicidad.configGDPMedio.forceActivePosition !== \"undefined\") && Publicidad.configGDPMedio.forceActivePosition) {\r\n return true;\r\n }\r\n\r\n //Comprobamos que se ha anadido la configuracion necesaria para el tipo de dispositivo\r\n var isActive = false;\r\n var tipoDispositivoAux = Publicidad.tipoDispositivo;\r\n\r\n if ((typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux) != \"undefined\") && (typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]') != \"undefined\")) {\r\n var posicionConfig = (typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]') != \"undefined\") ? eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]') : '';\r\n var desactivadoen = (typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.desactivadoen') != \"undefined\") ? eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.desactivadoen') : '';\r\n var fechaini = (typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.fecha_in') != \"undefined\") ? eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.fecha_in') : 0;\r\n var fechafin = (typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.fecha_fin') != \"undefined\") ? eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.fecha_fin') : 0;\r\n var programada = (typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.programada') != \"undefined\") ? eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.programada') : false;\r\n\r\n if (programada) {\r\n if (typeof desactivadoen == 'undefined' || (desactivadoen === '') || ($.isArray(desactivadoen) && (desactivadoen.length === 0))) {\r\n var unix = Math.round(+new Date() / 1000);\r\n if ((fechaini === 0 || fechaini <= unix) && (fechafin === 0 || unix <= fechafin)) {\r\n isActive = true;\r\n } else {\r\n Publicidad.log('En checkActivePosition. La posicion \"' + params.position + '\" no esta activa para la hora actual');\r\n }\r\n } else if (desactivadoen.indexOf(Publicidad.tipoPagina) == -1) {\r\n isActive = true;\r\n } else {\r\n Publicidad.log('En checkActivePosition. La posicion \"' + params.position + '\" no esta activa para el tipo de pagina ' + Publicidad.tipoPagina);\r\n }\r\n } else {\r\n Publicidad.log('En checkActivePosition. La posicion \"' + params.position + '\" no esta activa');\r\n }\r\n } else {\r\n Publicidad.log('En checkActivePosition. La posicion \"' + params.position + '\" no esta activa');\r\n }\r\n\r\n return isActive;\r\n }\r\n\r\n /**\r\n * Pinta las posiciones retrasadas una vez que llegan al viewport\r\n * @param object params [parametros del ad]\r\n */\r\n static pintarRetrasada(params) {\r\n var idAds = Publicidad.getIdDiv(params);\r\n\r\n $(\"#\" + idAds).one('inview', function (event, isInView) {\r\n if (isInView) Publicidad.getAdGoogle(params, false);\r\n });\r\n }\r\n\r\n // TODO: completar\r\n static getAdMeta(params) {\r\n\r\n }\r\n\r\n /**\r\n * Llamada de compatibilidad para paginas integradas con version previa de GDP\r\n */\r\n printAds(datos, esJSON = true) {\r\n var params = this.constructor.normalizaParams(datos, esJSON);\r\n this.constructor.printAds(params, true);\r\n }\r\n\r\n /**\r\n * Muestra la publicidad.\r\n * @param {Object} datos - Puede ser un DIV obtenido con jQuery con los atributos de configuracion, o bien un objeto JSON con la configuracion a aplicar\r\n * @param boolean esJSON - Indica si el objeto datos es un DIV o bien un objeto JSON\r\n *\r\n * Descripcion de parametros que puede contener el objeto JSON:\r\n * position => string. Posicion publicitaria a mostrar\r\n * id => string. ID del elemento HTML en el que se muestra\r\n * serverType => string. Servidor de publicidad a usar\r\n * hideNoAds => boolean. Oculta el elemento HTML si el adserver no ha devuelto publi\r\n * outOfPage => boolean. Determina si el slot de publicidad es outOfPage o no. Por defecto vale false\r\n * defineSlot => boolean. Indica si hay que definir o no el slot\r\n * refresh => boolean. Se pide la posicion de publicidad aunque ya se hubiera mostrado antes. Por defecto false\r\n * responsive => Indicamos si una publi se debe pintar solo en una(s) determinada(s) resolucion(es)\r\n * pre_callback=> funcion javascript a la que invocar previamente\r\n * pre_event => evento de precondicion\r\n * post_callback => funcion javascript a la que invocar una vez disparado el slotRendered\r\n * post_event => evento a disparar una vez disparado evento de slotRendered\r\n * oas => string. Si se rellena es el OAS a utilizar en la posicion de publicidad\r\n *\r\n * Objeto Responsive\r\n * El primer par de valores indica la resolucion, y en el segundo los tamanos de la posicion de publi a servir, el cual puede definirse como sigue:\r\n * - vacio: []\r\n * - single array: [ancho, alto]\r\n * - multi array: [ [ancho1, alto1], [ancho2, alto2], ... ]\r\n * - string: En cuyo caso usa la funcion ads.getSizesGoogle para obtener el array\r\n *\r\n * Ejemplo llamada:\r\n * ads.printAds({'position': 'robapaginas', 'id': 'roba2', 'responsive': [\r\n * [[0, 0], []] // Small Mobile\r\n * ,[[350, 200], [300,150]] // Mobile\r\n * ,[[750, 200], 'robapaginas'] // Tablet\r\n * ,[[1050, 300], [[300,150],[300,250]]] // Desktop\r\n * ]});\r\n */\r\n static printAds(datos, esJSON = true) {\r\n // Normalizacion de parametros\r\n var params = Publicidad.normalizaParams(datos, esJSON);\r\n\r\n if (params == null) return;\r\n\r\n // Comprobamos si la posicion esta activada\r\n var idAds = Publicidad.getIdDiv(params);\r\n if (!Publicidad.checkActivePosition(params)) {\r\n // Ocultamos el DIV contenedor de la publicidad si esta habilitada la directiva hideNoAds\r\n if ($('#' + idAds).length && (typeof params.hideNoAds != 'undefined') && params.hideNoAds) $('#' + idAds).hide();\r\n\r\n return;\r\n }\r\n\r\n // Comprobamos si existe el DIV\r\n if ($('#' + idAds).length) {\r\n // Pintado de publicidad dependiendo del servidor\r\n switch (params.serverType) {\r\n case 'google':\r\n // Publicidades priorizadas en la carga\r\n var priorized = Publicidad.esPriorizada(params);\r\n var retrasada = Publicidad.esRetrasada(params);\r\n\r\n // Posicion priorizada\r\n if (priorized && !retrasada) {\r\n Publicidad.getAdGoogle(params, true);\r\n }\r\n // Posicion retrasada -> le anade la class inview\r\n else if (retrasada) {\r\n Publicidad.pintarRetrasada(params);\r\n }\r\n // Posicion estandar\r\n else {\r\n if (!Publicidad.hayPriorizadas) {\r\n Publicidad.getAdGoogle(params, false);\r\n } else {\r\n if (!Publicidad.completadasPriorizadas) {\r\n Publicidad.listaEstandardDelayed.push(params);\r\n } else {\r\n Publicidad.getAdGoogle(params, false);\r\n }\r\n }\r\n }\r\n\r\n break;\r\n\r\n case 'admeta':\r\n Publicidad.getAdMeta(params);\r\n break;\r\n }\r\n } else {\r\n Publicidad.log('ERROR: El DIV con ID ' + idAds + ' no existe', 'warn');\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Pintado de publicidad de GPT\r\n */\r\n static getAdGoogle(params, esPosPriorizada) {\r\n googletag.cmd.push(function () {\r\n if (!Publicidad.existePosEnConfigGDPMedio(params.position)) {\r\n Publicidad.log('ERROR: La posicion \"' + params.position + '\" no existe en configGDPMedio', 'warn');\r\n return null;\r\n }\r\n\r\n // Gestion de los eventos y callbacks\r\n var idDiv = Publicidad.getIdDiv(params);\r\n var eventParams = Publicidad.getEventsPosition(params);\r\n\r\n var tParams = params;\r\n tParams.pre_callback = eventParams.pre_callback;\r\n tParams.pre_event = eventParams.pre_event;\r\n\r\n // Si hay integracion con Amazon Ads ponemos como evento de pre (en caso de que no tenga ninguno la posicion) el evento amazonads_ready\r\n if ((typeof Publicidad.configGDPMedio.enableAmazonAds != \"undefined\") && (Publicidad.configGDPMedio.enableAmazonAds) && !Publicidad.amazonads_inicializado && (tParams.pre_event == '')) {\r\n params.pre_event = tParams.pre_event = eventParams.pre_event = AMAZONADS_READY;\r\n }\r\n\r\n tParams.post_callback = eventParams.post_callback;\r\n tParams.post_event = eventParams.post_event;\r\n $(\"#\" + idDiv).data(\"params\", tParams);\r\n\r\n var key = Publicidad.getClavePosicionInsertada(params);\r\n if (typeof Publicidad.listaPosicionesInsertadas[key] == 'undefined') {\r\n var hasPreevent = false;\r\n if (params.defineSlot) {\r\n // No se trata de una posicion priorizada por lo que puede tener condicion de pre (callback o evento)\r\n if (!esPosPriorizada) {\r\n // Tiene precallback pero no evento\r\n if (eventParams.pre_callback && !eventParams.pre_event) {\r\n eval(eventParams.pre_callback);\r\n eval(Publicidad.getScriptText(params));\r\n }\r\n // Tiene evento de pre\r\n else if (eventParams.pre_event) {\r\n hasPreevent = true;\r\n eval(Publicidad.getScriptText(params));\r\n _app.on(eventParams.pre_event, params, function () {\r\n if (!Publicidad.amazonads_inicializado && (params.pre_event == AMAZONADS_READY)) {\r\n Publicidad.amazonads_inicializado = true;\r\n Publicidad.log('En getAdGoogle. Capturado evento de ' + AMAZONADS_READY);\r\n }\r\n\r\n if (params.pre_callback) {\r\n eval(params.pre_callback);\r\n }\r\n\r\n googletag.cmd.push(function () {\r\n var idDiv = Publicidad.getIdDiv(params);\r\n googletag.display(idDiv);\r\n });\r\n });\r\n } else {\r\n googletag.cmd.push(function () {\r\n eval(Publicidad.getScriptText(params));\r\n });\r\n }\r\n // Se trata de una posicion priorizada\r\n } else {\r\n eval(Publicidad.getScriptText(params));\r\n\r\n // Si hay integracion con Amazon Ads hay que esperar al evento AMAZONADS_READY\r\n if (eventParams.pre_event && (params.pre_event == AMAZONADS_READY)) {\r\n hasPreevent = true;\r\n _app.on(eventParams.pre_event, params, function () {\r\n if (!Publicidad.amazonads_inicializado && (params.pre_event == AMAZONADS_READY)) {\r\n Publicidad.amazonads_inicializado = true;\r\n Publicidad.log('En getAdGoogle. Capturado evento de ' + AMAZONADS_READY);\r\n }\r\n\r\n var idDiv = Publicidad.getIdDiv(params);\r\n googletag.display(idDiv);\r\n });\r\n }\r\n }\r\n }\r\n\r\n // No tiene evento de activacion\r\n if (!hasPreevent) {\r\n var idDiv = Publicidad.getIdDiv(params);\r\n\r\n if ($('#' + idDiv).length) {\r\n googletag.display(idDiv);\r\n }\r\n }\r\n } else {\r\n Publicidad.log('En getAdGoogle. La posicion ' + params.position + ' ya ha sido previamente invocada. Comprobamos el valor del parametro refresh: ' + params.refresh);\r\n if (params.refresh) Publicidad.pintarPosicionRefresh(params);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Funcion que recuperar si tiene evento pre o post callback, los parametros llegados por funcion prevalecen sobre los del CONFIG\r\n * @param object params\r\n */\r\n static getEventsPosition(params) {\r\n var tipoDispositivoAux = Publicidad.tipoDispositivo;\r\n var positionEvents = {};\r\n\r\n if (typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]') === \"undefined\") return positionEvents;\r\n\r\n if (params.pre_callback) {\r\n positionEvents.pre_callback = params.pre_callback;\r\n } else {\r\n positionEvents.pre_callback = (typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.pre_callback') != \"undefined\") ? eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.pre_callback') : '';\r\n }\r\n\r\n if (params.pre_event) {\r\n positionEvents.pre_event = params.pre_event;\r\n } else {\r\n positionEvents.pre_event = (typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.pre_event') != \"undefined\") ? eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.pre_event') : '';\r\n }\r\n\r\n if (params.post_callback) {\r\n positionEvents.post_callback = params.post_callback;\r\n } else {\r\n positionEvents.post_callback = (typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.post_callback') != \"undefined\") ? eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.post_callback') : '';\r\n }\r\n\r\n if (params.post_event) {\r\n positionEvents.post_event = params.post_event;\r\n } else {\r\n positionEvents.post_event = (typeof eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.post_event') != \"undefined\") ? eval('Publicidad.configGDP.posicion_' + tipoDispositivoAux + '[\"' + params.position + '\"]' + '.post_event') : '';\r\n }\r\n\r\n return positionEvents;\r\n }\r\n\r\n /**\r\n * Devuelve el nombre de la variable que almacenara el slot\r\n */\r\n static getNombreSlot(params) {\r\n return 'top.slot_' + params.position.replace('-', '_');\r\n }\r\n\r\n /**\r\n * Clave unica de la posicion\r\n */\r\n static getClavePosicionInsertada(params) {\r\n var clave = Publicidad.getNombreSlot(params) + '_' + Publicidad.getIdDiv(params);\r\n return clave;\r\n }\r\n\r\n /**\r\n * Refresh de una posicion\r\n */\r\n static pintarPosicionRefresh(params) {\r\n Publicidad.log('En pintarPosicionRefresh. Refrescamos la posicion ' + params.position);\r\n eval('googletag.pubads().refresh([' + Publicidad.getNombreSlot(params) + ']);');\r\n }\r\n\r\n /**\r\n * Detectamos si se fuerza alguna configuracion via parametro en la URL. Parametros soportados:\r\n * adunit\r\n * cmvkey\r\n * gdp_debug\r\n * gdp_enableAmazonAds\r\n * gdp_singleRequest\r\n * gdp_syncRendering\r\n * gdp_enableKrux\r\n * gdp_forceActivePosition\r\n * gdp_infoSlot\r\n */\r\n static checkConfigFromURL() {\r\n if (typeof top.location === 'undefined') return;\r\n\r\n // Modo debug\r\n if (top.location.href.indexOf('gdp_debug=1') != -1) Publicidad.debug = true;\r\n\r\n // Amazon Ads\r\n if (top.location.href.indexOf('gdp_enableAmazonAds=') != -1) {\r\n Publicidad.configGDPMedio.enableAmazonAds = (top.location.href.indexOf('gdp_enableAmazonAds=1') != -1);\r\n }\r\n\r\n // Single Request\r\n if (top.location.href.indexOf('gdp_singleRequest=') != -1) {\r\n Publicidad.configGDPMedio.singleRequest = (top.location.href.indexOf('gdp_singleRequest=1') != -1);\r\n }\r\n\r\n // SyncRendering\r\n if (top.location.href.indexOf('gdp_syncRendering=') != -1) {\r\n Publicidad.configGDPMedio.syncRendering = (top.location.href.indexOf('gdp_syncRendering=1') != -1);\r\n }\r\n\r\n // Krux\r\n if (top.location.href.indexOf('gdp_enableKrux=') != -1) {\r\n Publicidad.configGDPMedio.enableKrux = (top.location.href.indexOf('gdp_enableKrux=1') != -1);\r\n }\r\n\r\n // Force active position\r\n Publicidad.configGDPMedio.forceActivePosition = (top.location.href.indexOf('gdp_forceActivePosition=1') != -1);\r\n\r\n // InfoSlot\r\n Publicidad.configGDPMedio.infoSlot = (top.location.href.indexOf('gdp_infoSlot=1') != -1);\r\n }\r\n\r\n /**\r\n * Carga del JS para la publicidad de Google\r\n */\r\n static cargaLibreriaGPT() {\r\n window.googletag = window.googletag || {};\r\n googletag.cmd = googletag.cmd || [];\r\n try {\r\n if ($(\"script[src*='www.googletagservices.com/tag/js/gpt.js']\").length === 0) {\r\n (function () {\r\n var gads = document.createElement('script');\r\n gads.async = true;\r\n gads.type = 'text/javascript';\r\n var useSSL = 'https:' == document.location.protocol;\r\n gads.src = (useSSL ? 'https:' : 'http:') + '//www.googletagservices.com/tag/js/gpt.js';\r\n var node = document.getElementsByTagName('script')[0];\r\n node.parentNode.insertBefore(gads, node);\r\n })();\r\n }\r\n } catch (err) {}\r\n }\r\n\r\n /**\r\n * Integracion con Amazon Ads\r\n */\r\n static cargaLibreriaAmazonAds() {\r\n window.amznads = window.amznads || {};\r\n try {\r\n if ((typeof Publicidad.configGDPMedio != \"undefined\") && (typeof Publicidad.configGDPMedio.enableAmazonAds != \"undefined\") && (Publicidad.configGDPMedio.enableAmazonAds) && ($(\"script[src*='c.amazon-adsystem.com/aax2/amzn_ads.js']\").length === 0)) {\r\n (function () {\r\n var a, s = document.getElementsByTagName(\"script\")[0];\r\n a = document.createElement(\"script\");\r\n a.type = \"text/javascript\";\r\n a.async = true;\r\n a.src = \"//c.amazon-adsystem.com/aax2/amzn_ads.js\";\r\n s.parentNode.insertBefore(a, s);\r\n })();\r\n\r\n amznads.asyncParams = {\r\n 'id': AMAZONADS_ID_VOCENTO,\r\n 'callbackFn': function () {\r\n if (!Publicidad.amazonads_inicializado) {\r\n try {\r\n amznads.setTargetingForGPTAsync('amznslots');\r\n } catch (e) {\r\n Publicidad.log('ERROR En cargaLibreriaAmazonAds integrando AmazonAds: ' + e, 'warn');\r\n }\r\n\r\n // Las llamadas a DFP que se hagan a partir de este momento ya incorporan el targeting de Amazon\r\n Publicidad.log('En cargaLibreriaAmazonAds. Disparado evento ' + AMAZONADS_READY);\r\n Publicidad.amazonads_inicializado = true;\r\n _app.trigger(AMAZONADS_READY);\r\n }\r\n },\r\n 'timeout': 2e3\r\n };\r\n }\r\n\r\n if ((typeof Publicidad.configGDPMedio != \"undefined\") && (typeof Publicidad.configGDPMedio.enableAmazonAds != \"undefined\") && (Publicidad.configGDPMedio.enableAmazonAds)) {\r\n // Comprobamos transcurrido unos segundos si el JS ha sido cargado y sino liberamos el evento para que no se quede pendiente la publicidad\r\n setTimeout(function () {\r\n Publicidad.amazonads_inicializado = true;\r\n _app.trigger(AMAZONADS_READY);\r\n }, AMAZONADS_TIMEOUT_ERROR_CARGA_JS);\r\n }\r\n } catch (err) {}\r\n }\r\n\r\n /**\r\n * Obtiene la edicion desde el namespace\r\n */\r\n static getEdition() {\r\n const editions = _app.lookup(EDITIONS_NAMESPACE);\r\n return editions.current || (editions.main || '');\r\n }\r\n}\r\n\r\nexport default Publicidad;\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/publicidad.js","export const CONFIG_NAMESPACE = 'vocento.config.vam';\r\nexport const EDITIONS_NAMESPACE = 'vocento.site.editions';\r\nexport const GPT_ID_VOCENTO = '4900';\r\nexport const GPT_READY = 'vam:gpt:ready';\r\nexport const GPT_TIMEOUT = 2000;\r\nexport const TIMEOUT_POSICIONES_ESTANDAR = 3000;\r\nexport const AMAZONADS_ID_VOCENTO = '3470';\r\nexport const AMAZONADS_READY = 'vam:amazonads:ready';\r\nexport const AMAZONADS_TIMEOUT_ERROR_CARGA_JS = 7000;\r\nexport const ALTOS_MINIMOS_DISPOSITIVOS = {\r\n \"mobile\": 0,\r\n \"tablet\": 200,\r\n \"desktop\": 300\r\n };\r\nexport const POSITION_FLUID = \"'fluid'\";\r\nexport const SLOT_RENDERED = 'vam:slotrendered';\r\nexport const SLOT_EMPTY = 'vam:isempty';\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/constants.js"],"sourceRoot":""}