\n\n\x3c!-- Rubicon Project Ad Tag --\x3e\n
\n \n`),[e.width,e.height]=y[r.size_id].split("x").map((e=>Number(e)))),e.rubiconTargeting=(Array.isArray(r.targeting)?r.targeting:[]).reduce(((e,t)=>(e[t.key]=t.values[0],e)),{rpfl_elemid:a.adUnitCode}),t.push(e)}else(0,p.logError)(`Rubicon: bidRequest undefined at index position:${n}`,s,e);var c;return t}),[]).sort(((e,t)=>(t.cpm||0)-(e.cpm||0))),c=e.component_auction_config?.map((e=>({config:e,bidId:e.bidId})));return c?{bids:a,paapi:c}:a},getUserSyncs:function(e,t,r,i,n){if(!w&&e.iframeEnabled){let e=(0,b.d)(r,i,n);return e=Object.keys(e).length?`?${(0,p.formatQS)(e)}`:"",w=!0,{type:"iframe",url:`https://${x.syncHost||"eus"}.rubiconproject.com/usync.html`+e}}}};function v(e,t){let r;return r=e.params.referrer?e.params.referrer:t.refererInfo.page,e.params.secure?r.replace(/^http:/i,"https:"):r}function A(e){const t=document.getElementById(e.adUnitCode);!function(e){const t=e.querySelector("div[id^='google_ads']");t&&t.style.setProperty("display","none")}(t),function(e){const t=e.querySelector("script[id^='sas_script']"),r=t&&t.nextSibling;r&&"iframe"===r.localName&&r.style.setProperty("display","none")}(t);const r={...{align:"center",position:"append",closeButton:!1,label:void 0,collapse:!0},...e.renderer.getConfig()};e.renderer.push((()=>{window.MagniteApex.renderAd({width:e.width,height:e.height,vastUrl:e.vastUrl,placement:{attachTo:`#${e.adUnitCode}`,align:r.align,position:r.position},closeButton:r.closeButton,label:r.label,collapse:r.collapse})}))}function j(e,t){let r=e.params;if(t===d.G_){let t=[];return r.video&&r.video.playerWidth&&r.video.playerHeight?t=[r.video.playerWidth,r.video.playerHeight]:Array.isArray((0,l.A)(e,"mediaTypes.video.playerSize"))&&1===e.mediaTypes.video.playerSize.length?t=e.mediaTypes.video.playerSize[0]:Array.isArray(e.sizes)&&e.sizes.length>0&&Array.isArray(e.sizes[0])&&e.sizes[0].length>1&&(t=e.sizes[0]),t}let i=[];return Array.isArray(r.sizes)?i=r.sizes:void 0!==(0,l.A)(e,"mediaTypes.banner.sizes")?i=k(e.mediaTypes.banner.sizes):Array.isArray(e.sizes)&&e.sizes.length>0?i=k(e.sizes):(0,p.logWarn)("Rubicon: no sizes are setup or found"),function(e){const t=[15,2,9];return e.sort(((e,r)=>{const i=t.indexOf(e),n=t.indexOf(r);return i>-1||n>-1?-1===i?1:-1===n?-1:i-n:e-r}))}(i)}function $(e,t,r){return i=>{const n=Number(i.ext?.segtax);r.includes(n)&&(e[`tg_${t}.tax${n}`]=i.segment?.map((e=>e.id)).join(","))}}function k(e){return(0,p.parseSizesInput)(e).reduce(((e,t)=>{let r=parseInt(y[t],10);return r&&e.push(r),e}),[])}function S(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=[];if(function(e){let t=void 0!==(0,l.A)(e,`mediaTypes.${d.G_}`),r=void 0!==(0,l.A)(e,`mediaTypes.${d.D4}`),i=void 0!==(0,l.A)(e,"params.bidonmultiformat"),n="object"!=typeof(0,l.A)(e,"params.video");return!(!t||!i)||(r&&n&&(t=!1),t&&n&&(0,u.J)(e,"params.video",{}),t)}(e)){if(-1===["outstream","instream"].indexOf((0,l.A)(e,`mediaTypes.${d.G_}.context`)))return t&&(0,p.logError)("Rubicon: mediaTypes.video.context must be outstream or instream"),r;if(j(e,d.G_).length<2)return t&&(0,p.logError)("Rubicon: could not determine the playerSize of the video"),r;t&&(0,p.logMessage)("Rubicon: making video request for adUnit",e.adUnitCode),r.push(d.G_)}if(void 0!==(0,l.A)(e,`mediaTypes.${d.s6}`)&&r.push(d.s6),void 0!==(0,l.A)(e,`mediaTypes.${d.D4}`)){if(0===j(e,d.D4).length)return t&&(0,p.logError)("Rubicon: could not determine the sizes for banner request"),r;t&&(0,p.logMessage)("Rubicon: making banner request for adUnit",e.adUnitCode),r.push(d.D4)}return r}const R=()=>f={};function C(e){let t=!1;const r=["asi","sid","hp"];return e.nodes?(t=e.nodes.reduce(((e,t)=>e?r.every((e=>t.hasOwnProperty(e))):e),!0),t||(0,p.logError)("Rubicon: required schain params missing"),t):t}function I(e,t){return"rp_schain"===e?`rp_schain=${t}`:`${e}=${encodeURIComponent(t)}`}var w=!1;(0,s.a$)(_),(0,i.E)("rubiconBidAdapter")}},e=>{e.O(0,[60802,58498,97247,47618,46550,51085],(()=>{return t=99293,e(e.s=t);var t}));e.O()}]); (self.pbjsChunk=self.pbjsChunk||[]).push([[4085],{43297:(e,n,t)=>{var r=t(7873),o=t(91069),u=t(70433),s=t(43272),p=t(11445),i=t(16916),l=t(75023),c=t(78969),a=t(45569),d=t(2604),f=t(95139),g=t(76811);const h={purpose:{},feature:{}},v={purpose:!1,feature:"specialFeatureOptins"},m={storage:{type:"purpose",default:{purpose:"storage",enforcePurpose:!0,enforceVendor:!0,vendorExceptions:[]},id:1},basicAds:{type:"purpose",id:2,default:{purpose:"basicAds",enforcePurpose:!0,enforceVendor:!0,vendorExceptions:[]}},personalizedAds:{type:"purpose",id:4},measurement:{type:"purpose",id:7},transmitPreciseGeo:{type:"feature",id:1}},y=new Set,B=new Set,E=new Set,k=new Set,q=new Set,A=new Set;let $=!1,b=!1;const C=[a.tW,a.fW,a.Tn,a.zu],D="TCF2",w=[],O=[2],W=[2,7,9,10];function P(e,n,t,r){const o=(0,u.A)(e,`vendorData.${n}`);return!!o?.consents?.[t]||r&&!!o?.legitimateInterests?.[t]}function S(e,n,t,r){let o;if(!1!==v[n])o=!!(0,u.A)(e,`vendorData.${v[n]}.${t}`);else{const[n,u]=r===i.B1?["publisher",W]:["purpose",O];o=P(e,n,t,u.includes(t))}return{purpose:o,vendor:P(e,"vendor",r,O.includes(t))}}function T(e,n,t,r){const o=m[e.purpose];if((e.vendorExceptions||[]).includes(t))return!0;const u=e.enforceVendor&&!(r===i.B1||(e.softVendorExceptions||[]).includes(t)),{purpose:s,vendor:p}=S(n,o.type,o.id,r);return(!e.enforcePurpose||s)&&(!u||p)}function x(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:()=>null;return function(u){const p=i.mW.getConsentData(),l=u[d.iK];if(function(e,n,t){return null==e&&i.mW.enabled?((0,o.logWarn)(`Attempting operation that requires purpose ${n} consent while consent data is not available${t?` (module: ${t})`:""}. Assuming no consent was given.`),!0):e&&e.gdprApplies}(p,e,l)){const e=function(e,n,t){if(n){const r=s.$W.getConfig("gvlMapping");if(r&&r[n])return r[n];if(e===a.tp)return i.B1;{let{gvlid:r,modules:u}=i.o2.get(n);if(null==r&&Object.keys(u).length>0)for(const t of C)if(u.hasOwnProperty(t)){r=u[t],t!==e&&(0,o.logWarn)(`Multiple GVL IDs found for module '${n}'; using the ${t} module's ID (${r}) instead of the ${e}'s ID (${u[e]})`);break}return null==r&&t&&(r=t()),r||null}}return null}(u[d.Dk],l,r(u));let c=!!n(p,l,e);if(!c)return t&&t.add(l),{allow:c}}}}function F(e){return x(e,((n,t,r)=>!!T(h.purpose[e],n,t,r)),arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>null)}function M(e){return function(n){if(n[d.Dk]!==a.tp)return e(n)}}const V=(j=F(1,y),function(e){if(e[d.Dk]!==a.tp||b)return j(e)});var j;const I=F(1,y),N=F(1,y),z=M(F(2,B)),G=F(7,E,(e=>function(e,n){const t=p.Ay.getAnalyticsAdapter(e);return(r=>{if("function"!=typeof r)return r;try{return r.call(t.adapter,n)}catch(n){(0,o.logError)(`Error invoking ${e} adapter.gvlid()`,n)}})(t?.adapter?.gvlid)}(e[d.iK],e[d.TQ]))),K=F(4,k),L=M((()=>{const e=x("2-10",(function(e,n,t){for(let r=2;r<=10;r++){if(h.purpose[r]?.vendorExceptions?.includes(n))return!0;const{purpose:o,vendor:u}=S(e,"purpose",r,t);if(o&&(u||h.purpose[r]?.softVendorExceptions?.includes(n)))return!0}return!1}),q),n=F(4,q);return function(){return(h.purpose[4]?.eidsRequireP4Consent?n:e).apply(this,arguments)}})()),R=x("Special Feature 1",((e,n,t)=>T(h.feature[1],e,n,t)),A);l.on(c.qY.AUCTION_END,(function(){const e=function(e){return Array.from(e.keys()).filter((e=>null!=e))},n={storageBlocked:e(y),biddersBlocked:e(B),analyticsBlocked:e(E),ufpdBlocked:e(k),eidsBlocked:e(q),geoBlocked:e(A)};l.emit(c.qY.TCF2_ENFORCEMENT,n),[y,B,E,k,q,A].forEach((e=>e.clear()))})),s.$W.getConfig("consentManagement",(e=>function(e){let n=(0,u.A)(e,"gdpr.rules");n||(0,o.logWarn)("TCF2: enforcing P1 and P2 by default"),n=Object.fromEntries((n||[]).map((e=>[e.purpose,e]))),b=!!(0,u.A)(e,"strictStorageEnforcement"),Object.entries(m).forEach((e=>{let[t,r]=e;h[r.type][r.id]=n[t]??r.default})),$||(null!=h.purpose[1]&&($=!0,w.push((0,f.qB)(g.Ue,D,V)),w.push((0,f.qB)(g.Ml,D,I)),w.push((0,f.qB)(g.yl,D,N))),null!=h.purpose[2]&&w.push((0,f.qB)(g.uc,D,z)),null!=h.purpose[4]&&w.push((0,f.qB)(g.DL,D,K),(0,f.qB)(g.qX,D,K)),null!=h.purpose[7]&&w.push((0,f.qB)(g.mo,D,G)),null!=h.feature[1]&&w.push((0,f.qB)(g.hE,D,R)),w.push((0,f.qB)(g.hq,D,L)))}(e.consentManagement))),(0,r.E)("tcfControl")}},e=>{e.O(0,[60802,51085],(()=>{return n=43297,e(e.s=n);var n}));e.O()}]); (self.pbjsChunk=self.pbjsChunk||[]).push([[98282],{26504:(e,t,r)=>{var n=r(7873),i=r(70433),o=r(91069),a=r(71371),s=r(57377),p=r(43272),d=r(12938),l=r(76568);const u="triplelift";let c=null,m=null;const f=(0,d.vM)({bidderCode:u}),g={gvlid:28,code:u,supportedMediaTypes:[a.D4,a.G_],isBidRequestValid:function(e){return void 0!==e.params.inventoryCode},buildRequests:function(e,t){let r="https://tlx.3lift.com/header/auction?",n=function(e,t){let r={},{schain:n}=e[0];const a=function(e){const t={},r={},n={},i=e.ortb2||{},a=function(){const e=f.getDataFromLocalStorage("opecloud_ctx");if(!e)return null;try{return JSON.parse(e)}catch(e){return(0,o.logError)("Triplelift: error parsing JSON: ",e),null}}(),s=Object.assign({},i.site),p=Object.assign({},i.user);if(a){p.data=p.data||[];try{p.data.push({name:"www.1plusx.com",ext:a})}catch(e){(0,o.logError)("Triplelift: error adding 1plusX segments: ",e)}}x(r,s),x(n,p),(0,o.isEmpty)(r)||(t.context=r);(0,o.isEmpty)(n)||(t.user=n);return t}(t);r.imp=e.map((function(e,t){let r={id:t,tagid:e.params.inventoryCode,floor:h(e)};return b(e)&&(r.video=function(e){let t={...e.params.video,...e.mediaTypes.video};try{t.w||(t.w=t.playerSize[0][0]),t.h||(t.h=t.playerSize[0][1])}catch(e){(0,o.logWarn)("Video size not defined",e)}t.playbackmethod&&Number.isInteger(t.playbackmethod)&&(t.playbackmethod=Array.from(String(t.playbackmethod),Number));return delete t.playerSize,t}(e)),e.mediaTypes.banner&&!y(e)&&(r.banner={format:_(e.sizes)}),(0,o.isEmpty)(e.ortb2Imp)||(r.fpd=function(e){const t={},r={};x(r,e.ext),(0,o.isEmpty)(r)||(t.context=r);return t}(e.ortb2Imp),(0,o.isEmpty)(e.ortb2Imp.ext)||(r.ext={...e.ortb2Imp.ext})),r}));let s=[];e[0].userIdAsEids&&(s=i.A(e[0],"userIdAsEids"),r.user={ext:{eids:s}});let p=function(e,t){let r={};(0,o.isEmpty)(e)||(r.schain={...e});(0,o.isEmpty)(t)||(r.fpd={...t});return r}(n,a);(0,o.isEmpty)(p)||(r.ext=p);t?.ortb2?.regs?.gpp&&(r.regs=Object.assign({},t.ortb2.regs));t?.ortb2&&(r.ext.ortb2=Object.assign({},t.ortb2));return r}(e,t);if(r=(0,l.v)(r,"lib","prebid"),r=(0,l.v)(r,"v","9.22.0"),t&&t.refererInfo){let e=t.refererInfo.page;r=(0,l.v)(r,"referrer",e)}return t&&t.timeout&&(r=(0,l.v)(r,"tmax",t.timeout)),t&&t.gdprConsent&&(c=void 0===t.gdprConsent.gdprApplies||t.gdprConsent.gdprApplies,r=(0,l.v)(r,"gdpr",c.toString()),void 0!==t.gdprConsent.consentString&&(m=t.gdprConsent.consentString,r=(0,l.v)(r,"cmp_cs",m))),t&&t.uspConsent&&(r=(0,l.v)(r,"us_privacy",t.uspConsent)),t?.paapi?.enabled&&(r=(0,l.v)(r,"fledge",t.paapi.enabled)),!0===p.$W.getConfig("coppa")&&(r=(0,l.v)(r,"coppa",!0)),r.lastIndexOf("&")===r.length-1&&(r=r.substring(0,r.length-1)),(0,o.logMessage)("tlCall request built: "+r),{method:"POST",url:r,data:n,bidderRequest:t}},interpretResponse:function(e,t){let{bidderRequest:r}=t,n=e.body.bids||[];const i=e.body.paapi||[];if(n=n.map((e=>function(e,t){let r={},n=t.width||1,i=t.height||1,o=t.deal_id||"",a=t.crid||"",s=e.bids[t.imp_id];0!=t.cpm&&t.ad&&(r={requestId:s.bidId,cpm:t.cpm,width:n,height:i,netRevenue:!0,ad:t.ad,creativeId:a,dealId:o,currency:"USD",ttl:300,tl_source:t.tl_source,meta:{}},b(s)&&"video"===t.media_type&&(r.vastXml=t.ad,r.mediaType="video",r.ttl=3600),t.advertiser_name&&(r.meta.advertiserName=t.advertiser_name),t.adomain&&t.adomain.length&&(r.meta.advertiserDomains=t.adomain),t.tl_source&&"hdx"==t.tl_source&&(b(s)&&"video"===t.media_type?r.meta.mediaType="video":r.meta.mediaType="banner"),t.tl_source&&"tlx"==t.tl_source&&(r.meta.mediaType="native"),a&&(r.meta.networkId=a.slice(0,a.indexOf("_"))));return r}(r,e))),i.length>0){const e=i.map((e=>({bidId:r.bids[e.imp_id].bidId,config:e.auctionConfig})));return(0,o.logMessage)("Response with FLEDGE:",{bids:n,fledgeAuctionConfigs:e}),{bids:n,paapi:e}}return n},getUserSyncs:function(e,t,r,n,i){let o=function(e){if(!e)return;if(e.iframeEnabled)return"iframe";if(e.pixelEnabled)return"image"}(e);if(!o)return;let a="https://eb2.3lift.com/sync?";return"image"===o&&(a=(0,l.v)(a,"px",1),a=(0,l.v)(a,"src","prebid")),(null!==m||c)&&(a=(0,l.v)(a,"gdpr",c),a=(0,l.v)(a,"cmp_cs",m)),n&&(a=(0,l.v)(a,"us_privacy",n)),i&&(i.gppString&&(a=(0,l.v)(a,"gpp",i.gppString)),i.applicableSections&&0!==i.applicableSections.length&&(a=(0,l.v)(a,"gpp_sid",i.applicableSections.filter((e=>Number.isInteger(e))).join(",")))),[{type:o,url:a}]}};function b(e){return v(e)&&(y(e)||function(e){return v(e)&&"outstream"===e.mediaTypes.video.context.toLowerCase()}(e))}function y(e){return v(e)&&"instream"===e.mediaTypes.video.context.toLowerCase()}function v(e){return e.mediaTypes.video&&e.mediaTypes.video.context}function h(e){let t=null;if("function"==typeof e.getFloor)try{const r=e.getFloor({currency:"USD",mediaType:b(e)?"video":"banner",size:"*"});o.isPlainObject(r)&&"USD"===r.currency&&!isNaN(parseFloat(r.floor))&&(t=parseFloat(r.floor))}catch(e){(0,o.logError)("Triplelift: getFloor threw an error: ",e)}return null!==t?t:e.params.floor}function x(e,t){(0,o.isEmpty)(t)||Object.keys(t).forEach((r=>{null!=t[r]&&(e[r]=t[r])}))}function _(e){return e.filter(E).map((function(e){return{w:e[0],h:e[1]}}))}function E(e){return 2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]}(0,s.a$)(g),(0,n.E)("tripleliftBidAdapter")}},e=>{e.O(0,[14577,60802,51085],(()=>{return t=26504,e(e.s=t);var t}));e.O()}]); })(),pbjs.processQueue();KL.Modules.movements = new function() { var self = this; this.drag = 0; this.velocity = 0; this.captured = null; var draglisteners = {}; this.adddraglistener = adddraglistener; function adddraglistener(id, rules) { draglisteners[id] = rules; } this.removedraglistener = removedraglistener; function removedraglistener(id) { delete draglisteners[id]; } function startdrag(node) { // limpiamos los listeners que ya no funcionan (en caso de recargar la página) // buscamos el nodo afin for (var i in draglisteners) { if (draglisteners[i].startleft) { if (self.dragstartx >= draglisteners[i].startleft[0] && self.dragstartx <= draglisteners[i].startleft[1]) { self.captured = i; draglisteners[i].listener('start', buildmetrics()); break; } } if (draglisteners[i].startright) { var w = WA.browser.getScreenWidth(); if (self.dragstartx >= draglisteners[i].startright[0]+w && self.dragstartx <= draglisteners[i].startright[1]+w) { self.captured = i; draglisteners[i].listener('start', buildmetrics()); break; } } if (draglisteners[i].node) { var n = WA.toDOM(draglisteners[i].node); var p = node; while (n != p && p != window && p != null) p = p.parentNode; if (p == n) { self.captured = i; draglisteners[i].listener('start', buildmetrics()); break; } } } } function drag() { if (self.captured) draglisteners[self.captured].listener('drag', buildmetrics()); } function stopdrag() { if (self.captured) draglisteners[self.captured].listener(self.velocity<0?'izquierda':'derecha', buildmetrics()); } function buildmetrics() { return {startx:self.dragstartx, x:self.dragx, dx:self.dragdx, velocity: self.velocity}; } function touchstart(e) { self.drag = 1; self.dragstartx = WA.browser.getTouchDocumentX(e); self.dragstarty = WA.browser.getTouchDocumentY(e); self.dragdx = 0; self.dragx = self.dragstartx; self.velocity = 0; self.draglasttime = new Date().getTime(); self.draglasttimex = self.dragstartx; startdrag(e.target); } function touchmove(e) { var deltax = self.dragstartx - WA.browser.getTouchDocumentX(e); var deltay = self.dragstarty - WA.browser.getTouchDocumentY(e); if (self.drag == 1) { // start drag when Delta move > 10 px if (Math.abs(deltax) < 5 && Math.abs(deltay) < 5) return; if (Math.abs(deltax) > Math.abs(deltay)) self.drag = 2; // move horizontaly } if (self.drag == 2) { // in cuadrant 2 and 4 (< and >) start drag; self.dragx = WA.browser.getTouchDocumentX(e); self.dragdx = self.dragx - self.dragstartx; var deltat = new Date().getTime() - self.draglasttime; if (deltat < 1) deltat = 1; var deltah = self.dragx - self.draglasttimex; self.draglasttime = new Date().getTime(); self.draglasttimex = self.dragx; self.velocity = deltah / deltat * 700; drag(); } } function touchend(e) { if (self.drag == 2) { if (Math.abs(self.velocity) < 50) self.velocity = 0; if (self.velocity > 1000) self.velocity = 1000; if (self.velocity < -1000) self.velocity = -1000; stopdrag(); } self.drag = 0; self.captured = null; } function start() { WA.Managers.event.on('touchstart', document, touchstart, false); WA.Managers.event.on('touchmove', document, touchmove, false); WA.Managers.event.on('touchend', document, touchend, false); } KL.loader.addHookStart('general', start); } var flagFB = false; KL.Modules.facebook = new function () { var self = this; var cargado = false; var FBresponse = null; this.facebookok = false; var serversent = false; var called = null; // Facebook asyncronous //this.fbAsyncInit = window.fbAsyncInit(); window.fbAsyncInit = function () { //console.log("async fb") FB.init({ appId: KL.fbid, cookie: true, // enable cookies to allow the server to access xfbml: true, // parse social plugins on this page version: 'v9.0' // use version 3.0 }); // to send the response of authorization google FB.getLoginStatus(function (response) { self.FBlistener(response); // th Listener in the new structure is the start function }); FB.Event.subscribe('auth.login', self.FBlistener); //FB.Event.subscribe('auth.logout', self.FBlistener); FB.Event.subscribe('auth.authResponseChange', self.FBlistener); }; // FBlistener this.FBlistener = FBlistener; function FBlistener(response) { // console.log("fb listener") // console.log(response) FBresponse = response; if (called < new Date().getTime() / 1000 - 1) { called = null; } if (self.facebookok && FBresponse!==undefined && !called) { called = new Date().getTime() / 1000; loginFacebook(); return; } } // login facebook function loginFacebook() { //console.log("fb login") if (FBresponse.status === 'connected') { // && flagFB let auxAccessToken = FBresponse.authResponse.accessToken; let auxSignedRequest = FBresponse.authResponse.signedRequest; if (serversent == true) return; WA.Managers.ajax.createPromiseRequest({ url: KL.identitydomains + '/sociallogin/fb', method: 'POST', send: false }) .then(function (request) { request.addParameter('language', KL.language); //language=es|en request.addParameter('device', KL.device); //device="pc", "mobile", "ios", "android" request.addParameter('user', "{ \"signedRequest\" : \"" + auxSignedRequest + "\", \"accessToken\" : \"" + auxAccessToken + "\" } "); //language=es|en serversent = true; return request.send(); // }) .then(function (response) { self.facebookok = false; serversent = false; var code = JSON.parse(response); // proceso... mismo para todas las redes sociales... switch (code.status) { case "REGISTER": KL.Modules.stat.registerEvent('loginset', 'loginset/social/fb/register'); KL.Modules.stat.registerEventGA4('loginset/social/fb/register', {'send_to': 'G-X0MHE23QYB'}); KL.Modules.client.loadclient(); KL.Modules.loginset.forms['enlaza'].fill(code, 'fb'); break; case "OK": KL.Modules.stat.registerEvent('loginset', 'loginset/social/fb/login'); KL.Modules.stat.registerEventGA4('loginset/social/fb/login', {'send_to': 'G-X0MHE23QYB'}); KL.Modules.client.loadclient(); KL.Modules.loginset.Logged(); break; case "Error": KL.Modules.stat.registerEvent('loginset', 'loginset/sociallogin/facebook/' + respuesta.code); KL.Modules.stat.registerEventGA4('loginset/sociallogin/facebook/', {'send_to': 'G-X0MHE23QYB'}); KL.Modules.loginset.errorlogin('loginset-social-facebook' + respuesta.code, respuesta.message); break; } }) .catch(function (code, err) { KL.Modules.stat.registerEvent('loginset', 'loginset/sociallogin/' + code); KL.Modules.stat.registerEventGA4('loginset/sociallogin/' + code, {'send_to': 'G-X0MHE23QYB'}); }); } else if (FBresponse.status === 'not_authorized') { //console.log("No autorizado"); }/* else { } */ } this.show = show; function show() { self.node.style.display = 'block'; } this.hide = hide; function hide() { self.node.style.display = 'none'; } this.loadFacebookBtn = loadFacebookBtn; function loadFacebookBtn() { if (window.FB && FB.XFBML) { self.facebookok = true; //console.log("FB loaded") } if (!self.facebookok) { //console.log("no carga window.FB") setTimeout(function () { loadFacebookBtn(); }, 100); return; } window.fbAsyncInit(); } this.cargasdk = cargasdk; function cargasdk() { /* Facebook SDK */ // already loaded ??? if(cargado) { return; } WA.Managers.externloader.loadexterncode("https://connect.facebook.net/" + KL.locale + "/sdk.js#xfbml=1&version=v3.2&appId=" + KL.fbid); cargado=true; } this.share = share; function share(shareQuote, shareUrl) { var url = document.location.href; var quote = false; if (shareUrl && (typeof(shareUrl) === "string")) url = shareUrl; if (shareQuote && (typeof(shareQuote) === "string") && !(shareQuote === "")) quote = shareQuote; var params = {href: url, method: "share", display: "popup"}; if (quote) params.quote = quote; if (url.indexOf('/quiz/') !== -1) ga('send', 'event', 'quiz', 'quiz/share', 'share', 0); // second parameter is a callback FB.ui(params, null); } this.start = start; function start() { self.cargasdk(); } this.load = load; function load(){ if (!WA.toDOM('botonfacebook')) return; self.loadFacebookBtn(); } // KL.loader.addHookStart('facebook', start); KL.loader.addHookLoad('facebook', load); } /* function KiwiFBlistener(response) { flagFB = true; KL.Modules.facebook.FBlistener(response); } */ /* Manejo de los datos del cliente, conectado o no */ /* Escrito por: Phil Fecha: Julio 2016 Control de cambios: 10/07/2016: Phil, Creación 18/08/2016: Phil, agregar control de notificaciones y tiempo de ultima lectura, depuración de atributos no usados 15/02/2019: Wilmer, boton para el nuevo menu desplegable 15/04/2019: Wilmer, manejo de origen */ KL.Modules.client = new function() { var self = this; this.clientready = false; // true cuando ya sabemos la info del client (o sin client) this.clientlogged = false; // true si el client esta conectado this.clientpro = false; // true si el client es PRO this.node = null; this.nodemenu = null; this.opened = false; this.closecandidate = false; this.loaded = false; var clientcode = null; // codigo del client var hooksloaded = {}; // llamar cuando recibimos los datos del client (sea conectado o no) var hooksconnect = {}; // llamar cuando se conecta un client var hooksdisconnect = {}; // llamar cuando se desconecta un client this.addHookLoad = addHookLoad; function addHookLoad(id, hook) { hooksloaded[id] = hook; // Si ya paso por aqui, tenemos que llamar el hook ! if (self.clientready) hook(); } this.delHookLoad = delHookLoad; function delHookLoad(id) { delete hooksloaded[id]; } function callHooksLoad() { for (var i in hooksloaded) { hooksloaded[i](); } } /* Chef conectado*/ this.addHookConnect = addHookConnect; function addHookConnect(id, hook) { hooksconnect[id] = hook; if (self.clientready) hook(); } this.callHooksConnect = callHooksConnect; function callHooksConnect() { for (var i in hooksconnect) { hooksconnect[i](); } } this.delHookConnect = delHookConnect; function delHookConnect(id) { delete hooksconnect[id]; } /* Chef conectado*/ /* Chef desconectado*/ this.addHookDisconnect = addHookDisconnect; function addHookDisconnect(id, hook) { hooksdisconnect[id] = hook; if (self.clientready) hook(); } this.callHooksDisconnect = callHooksDisconnect; function callHooksDisconnect() { for (var i in hooksdisconnect) { hooksdisconnect[i](); } } function buildClient() { if (clientcode == null) { self.clientready = false; return; } self.clientready = true; self.clientlogged = !!clientcode.client; self.clientpro = self.clientlogged && clientcode.client && (!!clientcode.client.p); node = WA.toDOM("header-client"); if (self.clientlogged){ temp = WA.templates['client_connected'](clientcode); if((KL.Modules.client.clientpro) && (KL.rootsite == "kiwi")){ //WA.toDOM("header-icono-kiwipro").style.display = "block"; WA.toDOM("header-div-logo-normal").style.display = "none"; WA.toDOM("header-div-logo-pro").style.display = "block"; WA.toDOM("header").style.backgroundColor = "var(--azul-kiwipro)"; //WA.toDOM("header").style.backgroundImage = "url('" + KL.cdn7domains + "/img/static/header-azul-desk-fest.jpg')"; WA.toDOM("header").style.backgroundRepeat = "repeat-x"; WA.toDOM("footer-divfooter").style.backgroundColor = "var(--azul-kiwipro)"; //WA.toDOM("footer-divfooter").style.backgroundImage = "url('" + KL.cdn7domains + "/img/static/footer-azul-desk-fest.jpg')"; WA.toDOM("footer-divfooter").style.backgroundRepeat = "repeat-x"; if (KL.device == "pc") WA.toDOM("header-search-go").style.backgroundColor = "#9fc7c4"; } if((!KL.Modules.client.clientpro) && (KL.rootsite == "kiwi")){ WA.toDOM("header-div-logo-normal").style.display = "block"; WA.toDOM("header-div-logo-pro").style.display = "none"; WA.toDOM("header").style.backgroundColor = "var(--verde-kiwi)"; //WA.toDOM("header").style.backgroundImage = "url('" + KL.cdn7domains + "/img/static/header-verde-desk-fest.jpg')"; WA.toDOM("header").style.backgroundRepeat = "repeat-x"; //WA.toDOM("footer-divfooter").style.backgroundImage = "url('" + KL.cdn7domains + "/img/static/footer-verde-desk-fest.jpg')"; WA.toDOM("footer-divfooter").style.backgroundRepeat = "repeat-x"; } } else{ temp = WA.templates['client_notconnected'](clientcode); if(KL.rootsite == "kiwi"){ //WA.toDOM("header-icono-kiwipro").style.display = "none"; WA.toDOM("header-div-logo-normal").style.display = "block"; WA.toDOM("header-div-logo-pro").style.display = "none"; WA.toDOM("header").style.backgroundColor = "var(--verde-kiwi)"; //WA.toDOM("header").style.backgroundImage = "url('" + KL.cdn7domains + "/img/static/header-verde-desk-fest.jpg')"; WA.toDOM("header").style.backgroundRepeat = "repeat-x"; //WA.toDOM("footer-divfooter").style.backgroundImage = "url('" + KL.cdn7domains + "/img/static/footer-verde-desk-fest.jpg')"; WA.toDOM("footer-divfooter").style.backgroundRepeat = "repeat-x"; //WA.toDOM("header-search-go").style.backgroundColor = "#a8e05c"; } } node.innerHTML = temp; if ((self.clientlogged) && (!KL.Modules.client.clientpro) && (KL.rootsite == "kiwi")) { //WA.toDOM("header-urliconpro").style.display = "block"; WA.toDOM("header-urliconpro").style.display = "flex"; } // Link menus self.loaded = false; self.node = WA.toDOM("header-client-button"); self.nodemenu = WA.toDOM("header-client-menu"); if (self.node) { self.node.onclick=switchmenu; self.node.ontouchstart=switchmenu; self.node.onmouseover=switchon; self.node.onmouseout=tryswitchoff; } if (self.nodemenu) { self.nodemenu.onmouseover=switchon; self.nodemenu.onmouseout=tryswitchoff; } } // MANEJO DEL MENU DEL CLIENTE: function switchmenu(event) { if (!self.opened) return switchon(event); switchoff(); return WA.browser.cancelEvent(event); } function switchon(event) { self.closecandidate = false; if (self.closetimer) { clearTimeout(self.closetimer); self.closetimer = null; } if (self.opened) return; KL.Modules.menu.switchoff(); KL.Modules.language.switchoff(); KL.Modules.search.switchoff(); KL.Modules.stat.registerEvent('headclient', 'head/client/open'); KL.Modules.stat.registerEventGA4('head/client/open', {'send_to': 'G-X0MHE23QYB'}); self.opened = true; if (KL.device == "mobile") { self.nodemenu.style.top = "46px"; if((KL.Modules.client.clientpro) && (KL.rootsite == "kiwi")){ self.node.className = "anim onpro"; WA.toDOM('header-client-menu').classList.add("divmenupro"); } else{ self.node.className = "anim on"; } } else { self.nodemenu.style.top = "60px"; if((KL.Modules.client.clientpro) && (KL.rootsite == "kiwi")){ self.node.className = "anim onpro"; WA.toDOM('header-client-menu').classList.add("divmenupro"); } else{ self.node.className = "anim on"; } } if (!self.loaded) load(); return WA.browser.cancelEvent(event); } function tryswitchoff() { self.closecandidate = true; self.closetimer = setTimeout(switchoff, 200); } this.switchoff = switchoff; function switchoff(event) { self.closecandidate = false; if (self.closetimer) { clearTimeout(self.closetimer); self.closetimer = null; } if (!self.opened) return; KL.Modules.stat.registerEvent('headclient', 'head/client/close'); KL.Modules.stat.registerEventGA4('head/client/close', {'send_to': 'G-X0MHE23QYB'}); self.opened = false; // gets height of node h = WA.browser.getNodeOuterHeight(self.nodemenu); self.nodemenu.style.top = -h + "px"; self.node.className = "anim"; return WA.browser.cancelEvent(event); } function load() { var request = WA.Managers.ajax.createRequest('/data/menuclient' + (self.clientlogged ? '' : 'nc'), 'POST', null, loaded, true); } function loaded(request) { self.nodemenu.innerHTML = request.responseText; // Quita la coronita cuando el usuario no es pro if ((self.clientlogged) && (KL.Modules.client.clientpro) && (KL.rootsite == "kiwi")) { WA.toDOM("menuclient-padlock-planeador").style.display = "none"; } // reajustar top -X si cerrado if (self.opened == false) { h = WA.browser.getNodeOuterHeight(self.nodemenu); self.nodemenu.style.top = -h + "px"; } self.loaded = true; KL.loader.callHooksPostLoad(); } function start() { // Start: load the 1rst time client data // Toma el objeto del cliente del JS precargado // Pone la plantilla correspondiente al client clientcode = KL.pagedata.client; buildClient(); } this.getClaveChef = getClaveChef; function getClaveChef() { return clientcode.client.c; } this.getCountry = getCountry; function getCountry() { return clientcode.gep; } this.loadclient = loadclient; function loadclient() { var urlClient = self.clientlogged ? KL.graphdomains + '/v6/client' : KL.identitydomains + '/client'; var request = WA.Managers.ajax.createRequest(urlClient, 'POST', 'device=' + KL.device + '&language=' + KL.language, getloadclient, true); } function getloadclient(request) { clientcode = JSON.parse(request.responseText); buildClient(); updateCache(); // para evitar display de publicidad usuario pro if(self.clientlogged && self.clientpro) KL.loader.reloadPro = true; } this.loadAvatarChef = loadAvatarChef; function loadAvatarChef() { var image = new Image(); image.addEventListener('error', event => { var imgUrl = KL.rootsite == 'crafto' ? KL.cdn7domains + "/craftologia/static/icono-usuario.svg" : KL.cdn7domains + "/kiwilimon/static/icono-usuario.svg"; var imgChef = WA.toDOM('img-avatar-chef'); imgChef.style.backgroundImage = 'url(' + imgUrl + ')'; }) image.src = clientcode.client.i; } this.disconnect = disconnect; function disconnect() { KL.Modules.client.clientlogged = false; var request = WA.Managers.ajax.createRequest(KL.identitydomains + '/client', 'DELETE', 'device=' + KL.device+'&language=' + KL.language, loadclient, true); //var request = WA.Managers.ajax.createRequest(KL.graphdomains + '/v6/client', 'DELETE', 'device=' + KL.device+'&language=' + KL.language, loadclient, true); esté se va a manejar por el im 27/11/2023 //delete cookie? var date = new Date(); date.setTime(date.getTime()+(-24*60*60*1000)); var expires = "; expires="+date.toGMTString(); // Desconecta cierra session de facebook DAG FB.getLoginStatus(function (response) { if(response.status == "connected") KL.Modules.facebook.logout(); }); if(KL.devel) { document.cookie = "siteSessionDevel=" + expires + "; domain=" + KL.cookiedomain + "; path=/"; } else { document.cookie = "siteSession=" + expires + "; domain=" + KL.cookiedomain + "; path=/"; } KL.Modules.client.switchoff(); } // llamado cada 30 segundos para saber si hay notificaciones nuevas del cliente function recon() { var request = WA.Managers.ajax.createRequest(KL.identitydomains + '/notification', 'GET', 'device=' + KL.device + '&language=' + KL.language, getnotif, true); } // newsletter this.sendnewsletter = sendnewsletter; function sendnewsletter() { const mail = WA.toDOM('newsletter').value; if (mail == "") { return; } WA.Managers.ajax.createPromiseRequest({ url: KL.identitydomains + '/newsletter', method: 'POST', send: false }) .then(function (request) { request.addParameter('language', KL.language); request.addParameter('device', KL.device); request.addParameter('user', mail); return request.send(); }) .then(function (response) { const resp = JSON.parse(response); /* if (resp.status == "OK") { KL.Modules.modal.notifica(resp.message); } else { */ /* se modificó este pedacito para que si estamos parados en la landing newsletter entonces muestre un mensaje de bienvenida */ if (resp.status == "OK") { var landingnews = window.location.pathname; if( landingnews == '/newsletter-registro' ){ var bloqprincipalnews = WA.toDOM('newsletter-principal'); var bloqregistronews = WA.toDOM('newsletter-area-registro-mail'); var bloqrespregistronews = WA.toDOM('newsletter-respuesta-registro-mail'); KL.Modules.modal.notifica(resp.message); setTimeout( function() { bloqprincipalnews.removeChild(bloqregistronews); bloqrespregistronews.style.display = 'flex'; }, 4000); } else{ KL.Modules.modal.notifica(resp.message); } } else { switch (resp.code) { case 1504: KL.Modules.modal.notifica(resp.message); break; default: KL.Modules.modal.alerta(resp.message); break; } } }) .catch(function (code, err) { // }); } function updateCache() { caches.keys() .then(function(cacheNames){ for(var name of cacheNames) { if(name.search(/kiwi/) != -1) { caches.open(name).then((cache) => cache.add("/")); caches.open(name).then((cache) => cache.add(document.location.origin + "/login/social?p=" + document.location.pathname)); caches.open(name).then((cache) => cache.add(document.location.href)); } } }) } KL.loader.addHookRecon('client', recon); KL.loader.addHookStart('client', start); } /* search, main search field */ KL.Modules.search = new function() { var self = this; this.node = null; this.nodesearch = null; this.nodeclose = null; this.nodego = null; this.nodesugg = null; this.opened = false; this.trx = 0; var flagsearch = false; // Set to true when searching data from the server. Only 1 search authorize at the same time. If more we ignore them, just get the last one. var timer = null; // timer set to search from server (delay 300ms) function hidesuggestion() { if (!self.nodesugg) return; self.nodesugg.style.display = "none"; } function showsuggestion() { if (!self.nodesugg) { // No suggestions support return; } KL.Modules.menu.switchoff(); KL.Modules.language.switchoff(); KL.Modules.client.switchoff(); self.nodesugg.style.display = "block"; KL.Modules.stat.registerEvent('headsearch', 'head/search/suggest'); KL.Modules.stat.registerEventGA4('head/search/suggest', {'send_to': 'G-X0MHE23QYB'}); } // Activated only on mobile function hidesearch() { if (!self.nodesearch) return; hidesuggestion(); self.opened = false; self.nodesearch.className = "anim"; self.nodego.className = "icon-k7-search anim"; self.node.value=""; } // Activated only on mobile function showsearch() { if (!self.nodesearch) return; KL.Modules.menu.switchoff(); KL.Modules.language.switchoff(); KL.Modules.client.switchoff(); self.opened = true; self.nodesearch.className = "anim on"; if((KL.Modules.client.clientpro) && (KL.rootsite == "kiwi")) self.nodego.className = "icon-k7-search anim onpro"; else self.nodego.className = "icon-k7-search anim on"; self.node.focus(); } function changeq(event) { setTimeout(function () {verificaq();}, 0); } function verificaq() { if (timer) { clearTimeout(timer); timer = null; } var numc = self.node.value.trim().length; var word = self.node.value.trim(); if (numc >= 3) // Intentamos con timeout a 0: cada caracter es enviado a sugerencias timer = setTimeout(function() { gosuggestion(word); }, 0); else hidesuggestion(); } function gosuggestion(word) { var request = WA.Managers.ajax.createRequest(KL.graphdomains + '/v6/suggestions', 'POST', null, getsuggestion, false); request.addParameter('q', word); request.addParameter('language', KL.language); request.addParameter('device', KL.device); request.addParameter('trx', ++self.trx); request.send(); } function getsuggestion(request) { var resp = JSON.parse(request.responseText); if (resp.trx < self.trx) return; text = ""; for (var i = 0, l = resp.payload.length; i < l; i++) { text += '
' + resp.payload[i] + '
'; } WA.toDOM("header-search-suggestions-result").innerHTML = text; showsuggestion(); } function search(event) { if (KL.device == "mobile") { // switch on/off barra if (!self.nodesearch) return; if (self.opened) { hidesearch(); } else { showsearch(); } return; } KL.Modules.stat.registerEvent('headsearch', 'head/search/go'); KL.Modules.stat.registerEventGA4('head/search/go', {'send_to': 'G-X0MHE23QYB'}); var numc = self.node.value.trim().length; var word = self.node.value.trim(); if (numc < 3) return; hidesuggestion(); // window.location = "/buscar?q="+word; if(KL.rootsite == 'kiwirec') window.location = "/search?q="+word; else window.location = "/buscar?q="+word; // KL.loader.loadPage("/buscar?q="+word, null, true); } this.select = select; function select(node) { KL.Modules.stat.registerEvent('headsearch', 'head/search/gosuggest'); KL.Modules.stat.registerEventGA4('head/search/gosuggest', {'send_to': 'G-X0MHE23QYB'}); var word = node.innerHTML; self.node.value = word; if (KL.device=="mobile") { // window.location = "/buscar?q="+word; if(KL.rootsite == 'kiwirec') window.location = "/search?q="+word; else window.location = "/buscar?q="+word; return; } search(); } function clean(event) { KL.Modules.stat.registerEvent('headsearch', 'head/search/clean'); KL.Modules.stat.registerEventGA4('head/search/clean', {'send_to': 'G-X0MHE23QYB'}); if (KL.device == "mobile") { if (self.node.value.trim().length == 0) { hidesearch(); return; } self.node.value = ""; hidesuggestion(); self.node.focus(); return; } self.node.value = ""; hidesuggestion(); } // MENU: this.switchoff = switchoff; function switchoff(event) { hidesuggestion(); hidesearch(); } function start() { self.nodesearch = WA.toDOM("header-search"); self.node = WA.toDOM("header-search-q"); self.nodeclose = WA.toDOM("header-search-close"); self.nodego = WA.toDOM("header-search-go"); self.nodesugg = WA.toDOM("header-search-suggestions"); if (self.node) { self.node.onkeyup=changeq; } if (self.nodeclose) { self.nodeclose.onclick=clean; } if (self.nodego) { self.nodego.onclick=search; } } KL.loader.addHookStart('search', start); } /* language, menu to change language */ KL.Modules.language = new function() { var self = this; this.activated = false; this.node1 = null; this.node2 = null; this.nodemenu = null; this.opened = false; // MENU: function switchmenu(event) { if (!self.opened) return switchon(event); setTimeout(switchoff, 100); return WA.browser.cancelEvent(event); } function switchon(event) { KL.Modules.menu.switchoff(); KL.Modules.search.switchoff(); KL.Modules.client.switchoff(); KL.Modules.stat.registerEvent('headlanguage', 'head/lang/open'); KL.Modules.stat.registerEventGA4('head/lang/open', {'send_to': 'G-X0MHE23QYB'}); self.opened = true; self.nodemenu.style.display = "block"; } this.switchoff = switchoff; function switchoff(event) { if (!self.activated) return; KL.Modules.stat.registerEvent('headlanguage', 'head/lang/close'); KL.Modules.stat.registerEventGA4('head/lang/close', {'send_to': 'G-X0MHE23QYB'}); self.opened = false; self.nodemenu.style.display = "none"; } function click(event) { if (KL.language == "es" && KL.pagedata.page.pathen) { KL.Modules.stat.registerEvent('headlanguage', 'head/lang/go-en'); KL.Modules.stat.registerEventGA4('head/lang/go-en', {'send_to': 'G-X0MHE23QYB'}); window.location = KL.pagedata.page.pathen; } if (KL.language == "en" && KL.pagedata.page.pathes) { window.location = KL.pagedata.page.pathes; KL.Modules.stat.registerEvent('headlanguage', 'head/lang/go-es'); KL.Modules.stat.registerEventGA4('head/lang/go-es', {'send_to': 'G-X0MHE23QYB'}); } return false; } function start() { self.node1 = WA.toDOM("header-language-button1"); self.node2 = WA.toDOM("header-language-button2"); self.nodemenu = WA.toDOM("header-language-menu"); if (!self.node1 || !self.node2 || !self.nodemenu) return; self.activated = true; self.node1.onclick=switchmenu; self.node1.ontouchstart=switchmenu; self.node2.onclick=switchmenu; self.node2.ontouchstart=switchmenu; if (KL.language == "es") { var n = WA.toDOM("header-language-espanol"); var m = WA.toDOM("header-language-ingles"); } else { var n = WA.toDOM("header-language-ingles"); var m = WA.toDOM("header-language-espanol"); } n.className = "icon-k7-paloma on"; m.parentNode.onclick = click; } KL.loader.addHookStart('language', start); } /* menu, main header menu */ KL.Modules.menu = new function() { var self = this; this.node = null; this.nodemenu = null; this.nodemenupro = null; this.nodemenunormal = null; this.opened = false; this.closecandidate = false; this.closetimer = null; this.loaded = false; var fannode = null; var fannum = 0; var fanyear = 0; var fanmonth = 0; var fanday = 0; var fanhour = 0; var fanperday = 0; var fanstart = null; function switchmenu(event) { if (!self.opened) return switchon(event); switchoff(); return WA.browser.cancelEvent(event); } function switchon(event) { self.closecandidate = false; if (self.closetimer) { clearTimeout(self.closetimer); self.closetimer = null; } if (self.opened) return; KL.Modules.language.switchoff(); KL.Modules.search.switchoff(); KL.Modules.client.switchoff(); KL.Modules.stat.registerEvent('headmenu', 'head/menu/open'); KL.Modules.stat.registerEventGA4('head/menu/open', {'send_to': 'G-X0MHE23QYB'}); self.opened = true; if (KL.device == "mobile") { self.nodemenu.style.top = "46px"; if((KL.Modules.client.clientpro) && (KL.rootsite == "kiwi")) self.node.className = "icon-k7-menu anim onpro"; else self.node.className = "icon-k7-menu anim on"; } else { self.nodemenu.style.top = "60px"; if((KL.Modules.client.clientpro) && (KL.rootsite == "kiwi")) self.node.className = "icon-k7-menu anim onpro"; else self.node.className = "icon-k7-menu anim on"; } if (!self.loaded) load(); return WA.browser.cancelEvent(event); } function tryswitchoff() { // TODO(phil) poner un timer self.closecandidate = true; self.closetimer = setTimeout(switchoff, 200); } this.switchoff = switchoff; function switchoff(event) { self.closecandidate = false; if (self.closetimer) { clearTimeout(self.closetimer); self.closetimer = null; } if (!self.opened) return; KL.Modules.stat.registerEvent('headmenu', 'head/menu/close'); KL.Modules.stat.registerEventGA4('head/menu/close', {'send_to': 'G-X0MHE23QYB'}); self.opened = false; if (KL.device == "mobile") { self.nodemenu.style.top = "-500px"; self.node.className = "icon-k7-menu anim"; } else { self.nodemenu.style.top = "-320px"; self.node.className = "icon-k7-menu anim"; } return WA.browser.cancelEvent(event); } function fancount() { fannode = WA.toDOM("header-menu-fans"); if (!fannode) return; fannum = fannode.dataset.num; fanyear = fannode.dataset.year; fanmonth = fannode.dataset.month; fanday = fannode.dataset.day; fanhour = fannode.dataset.hour; fanperday = fannode.dataset.perday; fanstart = new Date(); fanstart.setUTCFullYear(fanyear); fanstart.setUTCMonth(parseInt(fanmonth, 10)-1); fanstart.setUTCDate(fanday); fanstart.setUTCHours(fanhour); fanstart.setUTCMinutes(0); fanstart.setUTCSeconds(0); calcFans(); } function calcFans() { var diffTime = Math.abs(new Date() - fanstart) / 1000 / 60 / 60 / 24; var newnum = Math.round(parseInt(fannum, 10) * 1.0 + diffTime * parseInt(fanperday, 10)); fannode.innerHTML = newnum.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); // act each 1 sec setTimeout(function() { calcFans(); }, 1000); } function load() { var request = WA.Managers.ajax.createRequest('/data/menu', 'POST', null, loaded, true); } function loaded(request) { self.nodemenu.innerHTML = request.responseText; /* para mostrar opciones kiwipro en el menu */ self.nodemenupro = WA.toDOM("menu-header-kiwipro"); self.nodemenunormal = WA.toDOM("menu-header-normal"); if ((KL.rootsite == "kiwi") || (KL.rootsite == "kiwirec")){ if (KL.Modules.client.clientpro) { // console.log('chef es pro'); self.nodemenupro.style.display = 'block'; self.nodemenunormal.style.display = 'none'; } else { // console.log('chef no es pro'); self.nodemenunormal.style.display = 'block'; self.nodemenupro.style.display = 'none'; } } self.loaded = true; KL.loader.callHooksPostLoad(); // start fans count fancount(); } function start() { self.node = WA.toDOM("header-button-menu"); self.nodemenu = WA.toDOM("header-menu"); if (self.node) { self.node.onclick=switchmenu; self.node.ontouchstart=switchmenu; self.node.onmouseover=switchon; self.node.onmouseout=tryswitchoff; } if (self.nodemenu) { self.nodemenu.onmouseover=switchon; self.nodemenu.onmouseout=tryswitchoff; } } // this.container.style.transform = "translate("+this.position+"px,0)"; // KL.Modules.general.adddraglistener('slider_' + this.node.id, {node: node, listener:listener}); KL.loader.addHookStart('menu', start); } KL.Modules.wall = new function() { var self = this; this.node = null; function load(wall){ var request = WA.Managers.ajax.createRequest('/data/' + wall, 'POST', null, loaded, true); } function loaded(request){ let auxnode = WA.toDOM("page_container"); if (!self.node) { self.node = WA.createDomNode('div', 'wall', 'wall'); } auxnode.appendChild(self.node); self.node.innerHTML = request.responseText; } this.removeWall = removeWall; function removeWall(){ if (!WA.toDOM('wall')) return; //console.log('remueve wall'); const wallElement = WA.toDOM('wall'); //console.log(wallElement); const parentWall = wallElement.parentElement; //console.log(parentWall); parentWall.removeChild(wallElement); } function start(){ if (KL.pagedata.page === null || typeof KL.pagedata.page.wall === undefined){ return; } if ( KL.pagedata.page.wall!==undefined ){ if (KL.pagedata.page.wall == 'register') { load('paywall-registro'); KL.Modules.stat.registerEvent('wall', 'wall/register/show' + KL.pagedata.page.wallgroup); KL.Modules.stat.registerEventGA4('wall/register/show' + KL.pagedata.page.wallgroup, {'send_to': 'G-X0MHE23QYB'}); // ga('send', 'event', 'wall', 'wall/register', 'wall/reg/show7', null); } else if (KL.pagedata.page.wall == 'pay') { load('paywall-suscripcion'); KL.Modules.stat.registerEvent('wall', 'wall/subscription/show' + KL.pagedata.page.wallgroup); KL.Modules.stat.registerEventGA4('wall/subscription/show' + KL.pagedata.page.wallgroup, {'send_to': 'G-X0MHE23QYB'}); // ga('send', 'event', 'wall', 'wall/subscription', 'wall/sub/show7', null); } } } KL.loader.addHookStart('wall', start); KL.loader.addHookLoad('wall', start); //KL.loader.addHookPostLoad('wall', start); } KL.device="mobile"; KL.language="es"; KL.pagedata={"client":{"client":null,"device":"mobile","geo":"US","gep":"US","ip":"172.70.126.41","locallanguage":"en","origin":"kiwi","server":"api7","skin":"","t":1736676013},"page":{"adprefix":"kiwi_","crosslink":[{"cl":6195,"cln":"De Kiwilimón para ti","cn":"Shadia Asencio","i":"29155.jpg","ip":"/articuloimagen/30560/th5-320x320-29155.jpg","k":30560,"level":1,"m":1,"ms":"\n¿Otra vez arroz? Las cifras lo confirman: la gramínea salvaje favorita de todos se siembra en treinta y cuatro países; sus campos cubren más del 10% de las tierras fértiles del mundo y de él se...","mstc":"\n¿Otra vez arroz? Las cifras lo confirman: la gramínea salvaje favorita de todos se siem...","mt":"normal","n":"Arroooooozzzzzz: nosotros también te amamos","pa":"/blog/tips-y-consejos/de-kiwilimon-para-ti/arroooooozzzzzz-nosotros-tambien-te-amamos","pr":"0.0%","s":"1","t":"articuloslider","vr":null,"x":"p|kiwi|crosslink||1|0|1"},{"cn":"Eloísa Carmona","date":"2021-04-15T11:09:02Z","fv":0,"i":"2962.jpg","k":2962,"level":2,"m":1,"ms":"Chuletas, salmón o incluso vegetales, el sabor ahumado le va bien a muchos alimentos. Este sabor característico se logra a patir de someter los alimentos a una fuente de humo. Aunque esta técnica s...","mt":"normal","n":" 8 recetas para disfrutar de un toque de sabor ahumado","pa":"/tips/cocina/metodos-de-coccion/8-recetas-para-disfrutar-de-un-toque-de-sabor-ahumado","pr":"100.0%","s":1,"t":"tipslider","v":"","vh":"100.00%","vp":"","vr":"5.0","x":"p|kiwi|crosslink||1|0|2"},{"cn":"Adriana sanchez ","date":"2021-03-23T14:44:05Z","fv":0,"i":"2890.jpg","k":2890,"level":2,"m":1,"ms":"El pollo al limón es un platillo muy popular debido a que es súper fácil de preparar y se hace con ingredientes que comúnmente encontramos en la cocina, pero a que no sabías que existen tantas fo...","mt":"normal","n":"8 formas diferentes de preparar pollo al limón ","pa":"/tips/cocina/tips-de-platillos/8-formas-diferentes-de-preparar-pollo-al-limon","pr":"100.0%","s":1,"t":"tipslider","v":"","vh":"100.00%","vp":"","vr":"5.0","x":"p|kiwi|crosslink||1|0|3"},{"cn":"Adriana sanchez ","date":"2021-02-19T09:39:56Z","fv":0,"i":"2815.jpg","k":2815,"level":2,"m":1,"ms":"Porque la milanesa es uno de los platillos favoritos para comer en familia, te invitamos a darle la vuelta a las clásicas recetas aburridas con estas increíbles formas diferentes de preparar milanes...","mt":"normal","n":"10 recetas diferentes para preparar milanesa ","pa":"/tips/cocina/tips-de-platillos/10-recetas-diferentes-para-preparar-milanesa","pr":"93.3%","s":1,"t":"tipslider","v":"","vh":"100.00%","vp":"","vr":"4.7","x":"p|kiwi|crosslink||1|0|4"},{"cl":36,"cln":"Consejos de Belleza","cn":"Eloísa Carmona","i":"29126.jpg","ip":"/articuloimagen/30548/th5-320x320-29126.jpg","k":30548,"level":1,"m":1,"ms":"\nRead in EnglishEl aceite de jojoba tiene propiedades benéficas principalmente usadas en la cosmética, por lo que es muy común encontrarlo en una variedad de productos para el cabello, la piel y la...","mstc":"\nRead in EnglishEl aceite de jojoba tiene propiedades benéficas principalmente usadas en ...","mt":"normal","n":"Los beneficios del aceite de jojoba en el cabello","pa":"/blog/tips-y-consejos/consejos-de-belleza/los-beneficios-del-aceite-de-jojoba-en-el-cabello","pr":"0.0%","s":"1","t":"articuloslider","vr":null,"x":"p|kiwi|crosslink||1|0|5"},{"cn":"Eloísa Carmona","date":"2020-09-03T16:40:56Z","fv":0,"i":"2262.jpg","k":2262,"level":2,"m":1,"ms":"Todos tenemos elote en lata en la alacena, así que prepárate para sacarlo y aprovecharlo con estas recetas fáciles y deliciosas, en una variedad de platillos dulces y salados. Desde una salsa de el...","mt":"normal","n":"7 recetas deliciosas con elote en lata","pa":"/tips/cocina/tips-de-platillos/7-recetas-deliciosas-con-elote-en-lata","pr":"100.0%","s":1,"t":"tipslider","v":"","vh":"100.00%","vp":"","vr":"5.0","x":"p|kiwi|crosslink||1|0|6"},{"c":2370,"cn":" ","d":"La gastronomía yucateca tiene platillos mundialmente reconocidos, como la cochinita pibil o la sopa de lima. Para que lleves un poquito de sus sabores a tu mesa, te dejamos aquí 4 recetas tradicionales de Yucatán, perfectas para el antojo de fin de semana.","i":"2370.jpg","k":2370,"level":1,"m":2,"mt":"normal","n":"Recetas tradicionales de Yucatán ","pa":"/compilacion/recetas-tradicionales-de-yucatan","rt":"","s":1,"sh":1,"t":"compilacionrecetaslider","v":"392655352264332","vh":"100.00%","vp":"B1xDbuGM","x":"p|kiwi|crosslink||1|0|7"},{"c":2124,"cn":" ","d":"Las salchichas cocteleras son un ingrediente fácil para preparar botanas deliciosas, como estas tres recetas que te dejamos aquí, con jalapeño y habanero, queso o una salsa agriculce con tocino.","i":"2124.jpg","k":2124,"level":1,"m":2,"mt":"normal","n":"Salchichas cocteleras","pa":"/compilacion/salchichas-cocteleras","rt":"","s":1,"sh":1,"t":"compilacionrecetaslider","v":"397192972459542","vh":"100.00%","vp":"B1xDbuGM","x":"p|kiwi|crosslink||1|0|8"},{"cn":"Eva ","cooktime":"35","difficulty":"1","fv":123,"i":"52014.jpg","k":39676,"level":1,"m":2,"mt":"normal","n":"Enchiladas Veracruzanas ","pa":"/receta/platos-fuertes/mexicanos/enchiladas-veracruzanas","pr":"100.0%","preptime":"20","pub":"07 Sep 22 17:23 +0000","s":1,"t":"recetaslider","totaltime":"55","v":"040256186907605","vh":"100.00%","vp":"B1xDbuGM","vr":"5.0","x":"p|kiwi|crosslink||1|0|9"},{"c":2117,"cn":" ","d":"¡Consiente a toda la familia con estas exquisitas recetas con salsa de tomate! Puedes escoger entre el pollo hasselback al sartén, las calabacitas gratinadas con salsa de tomate, la milanesa napolitana y la pizza baguette hawaiana. ","i":"2117.jpg","k":2117,"level":1,"m":2,"mt":"normal","n":"Recetas con salsa de tomate","pa":"/compilacion/recetas-con-salsa-de-tomate","rt":"","s":1,"sh":1,"t":"compilacionrecetaslider","v":"766390689435469","vh":"100.00%","vp":"B1xDbuGM","x":"p|kiwi|crosslink||1|0|10"}],"device":"mobile","keywords":["receta","postres","postres-faciles","pan-de-platano-facil"],"language":"es","pathen":"https://us.kiwilimon.com","pathes":"https://www.kiwilimon.com","status":"OK","type":"sin-video","wallgroup":0}};