PageSourceSearch

https://www.kayak.es/news/wp-content/plugins/r9-multi-blocks/build/PostCardList/view.js?ver=36699431923

js kayak.es collected 2026-10-02 05:25:58 UTC 7,077 bytes, 1 lines download raw bytes

1(()=>{"use strict";var t={};const e={};function s(i){const r=e[i];if(void 0!==r)return r.exports;const n=e[i]={exports:{}};return t[i](n,n.exports,s),n.exports}s.m=t,s.d=(t,e)=>{if(Array.isArray(e))for(var i=0;i<e.length;){var r=e[i++],n=e[i++];s.o(t,r)?0===n&&i++:0===n?Object.defineProperty(t,r,{enumerable:!0,value:e[i++]}):Object.defineProperty(t,r,{enumerable:!0,get:n})}else for(var r in e)s.o(e,r)&&!s.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},s.f={},s.e=t=>Promise.all(Object.keys(s.f).reduce((e,i)=>(s.f[i](t,e),e),[])),s.u=t=>(4578===t?"carousel-swiper":t)+".chunk.js",s.miniCssF=t=>{},s.o=(t,e)=>Object.hasOwn(t,e),(()=>{const t={},e="r9-multi-blocks:";s.l=(i,r,n,o)=>{if(t[i])return void t[i].push(r);let a,l;if(void 0!==n){const t=document.getElementsByTagName("script");for(var h=0;h<t.length;h++){const s=t[h];if(s.getAttribute("src")==i||s.getAttribute("data-webpack")==e+n){a=s;break}}}a||(l=!0,a=document.createElement("script"),a.charset="utf-8",s.nc&&a.setAttribute("nonce",s.nc),a.setAttribute("data-webpack",e+n),a.src=i),t[i]=[r];const c=(e,s)=>{a.onerror=a.onload=null,clearTimeout(u);const r=t[i];if(delete t[i],a.parentNode?.removeChild(a),r?.forEach(t=>t(s)),e)return e(s)},u=setTimeout(c.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=c.bind(null,a.onerror),a.onload=c.bind(null,a.onload),l&&document.head.appendChild(a)}})(),(()=>{let t;globalThis.importScripts&&(t=globalThis.location+"");const e=globalThis.document;if(!t&&e&&("SCRIPT"===e.currentScript?.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){const s=e.getElementsByTagName("script");if(s.length){let e=s.length-1;for(;e>-1&&(!t||!/^http(s?):/.test(t));)t=s[e--].src}}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=t+"../"})(),(()=>{const t={453:0};s.f.j=(e,i)=>{let r=s.o(t,e)?t[e]:void 0;if(0!==r)if(r)i.push(r[2]);else{const n=new Promise((s,i)=>r=t[e]=[s,i]);i.push(r[2]=n);const o=s.p+s.u(e),a=new Error,l=i=>{if(s.o(t,e)&&(r=t[e],0!==r&&(t[e]=void 0),r)){const t=i&&("load"===i.type?"missing":i.type),s=i&&i.target&&i.target.src;a.message="Loading chunk "+e+" failed.\n("+t+": "+s+")",a.name="ChunkLoadError",a.type=t,a.request=s,a.event=i,r[1](a)}};s.l(o,l,"chunk-"+e,e)}};const e=(e,i)=>{let[r,n,o]=i;var a,l,h=0;if(r.some(e=>0!==t[e])){for(a in n)s.o(n,a)&&(s.m[a]=n[a]);o&&o(s)}for(e&&e(i);h<r.length;h++)l=r[h],s.o(t,l)&&t[l]&&t[l][0](),t[l]=0},i=globalThis.webpackChunkr9_multi_blocks||=[];i.forEach(e.bind(null,0)),i.push=e.bind(null,i.push.bind(i))})();const i=(t,e=[],s=[])=>{Array.prototype.forEach.call(t,function(t,i){void 0!==e&&0!==e.length&&e.forEach(function(e){""!==e&&t.classList.add(e)}),s&&s.forEach(function(e){""!==e&&t.classList.remove(e)})})};class r{constructor(t,e={}){this.button=t,this.initialized=!1,this.posts=[],this.lastPosts=[],this.isProcessing=!1,this.isDisabled=!1,this.maxPages=!1,this.currentPage=!1,this.insertReferenceNode=!1,this.options={queryPath:"/wapi",eventOnQueryApi:null,eventOnDomInsert:null,useResponseField:null},this.options=Object.assign(this.options,e),this.initialized=this.init()}init(){if(!this.hasValidAttributeParams(this.button))return this.setDisabled(!0),!1;if(this.host=this.button.attributes["data-host"].value,this.queryParams=this.button.attributes["data-load-more-query-params"].value,this.currentPage=parseInt(this.button.attributes["data-page-initial"].value),this.currentPage||(this.currentPage=1),this.maxPages=parseInt(this.button.attributes["data-page-max"].value),!this.canLoadMore())return!1;if(!this.options.useResponseField&&this.button.hasAttribute("data-use-response-field")&&(this.options.useResponseField=this.button.attributes["data-use-response-field"].value),!this.options.useResponseField)return this.canLoadMore(!1),!1;if(this.button.hasAttribute("data-load-more-target")){let t=this.button.attributes["data-load-more-target"].value;this.insertReferenceNode=document.getElementById(t)}return this.insertReferenceNode?(this.button.addEventListener("click",this.handleClick),!0):(this.canLoadMore(!1),!1)}canLoadMore(t=null){return null!=t?(this.setDisabled(!t),t):!(this.currentPage+1>this.maxPages&&(this.setDisabled(!0),1))}refreshLoadMoreState(){this.canLoadMore()}setDisabled(t){this.isDisabled=t,this.updateState({isDisabled:t},[this.button])}startProcessing(){this.updateState({isProcessing:!0},[this.button])}stopProcessing(){this.updateState({isProcessing:!1},[this.button])}handleClick=t=>{t.preventDefault(),this.isDisabled||this.isProcessing||this.doActionGetPosts()};doActionGetPosts(){let t=!1;this.startProcessing(),this.queryApi().then(e=>(this.maxPages=parseInt(e.headers.get("x-wp-totalpages")),200===e.status&&(t=!0),e.json())).then(e=>{if(t)return e;throw e.message}).then(t=>{this.lastPosts=this.filterResponse(t),this.posts=this.posts.concat(this.filterResponse(t)),this.stopProcessing(),this.currentPage++,this.refreshLoadMoreState(),this.options.eventOnQueryApi&&this.emitEvent(this.options.eventOnQueryApi,t),this.injectPosts()}).catch(t=>{this.stopProcessing(),this.refreshLoadMoreState(),this.options.eventOnQueryApi&&this.emitEvent(this.options.eventOnQueryApi,!1),console.error("Error in getting post data -- ",t)})}queryApi(){let t=this.host,e=this.options.queryPath+"/",s=this.queryParams;this.currentPage&&(s+="&page="+(this.currentPage+1));try{return fetch(t+e+s,{method:"GET",headers:{"Content-Type":"application/json"}})}catch(t){console.error(t)}}filterResponse(t){if(this.options.useResponseField)return t.map(t=>t[this.options.useResponseField]);console.error('Missing "data-use-response-field" in the PostCardList component')}injectPosts(){this.insertReferenceNode&&this.lastPosts.length>
10&&(this.lastPosts.forEach(t=>{this.insertReferenceNode.insertAdjacentHTML("beforeend",t)}),this.options.eventOnDomInsert&&this.emitEvent(this.options.eventOnDomInsert,!0))}updateState(t,e){return((t,e)=>{Object.entries(t).forEach(function(t){let s,r,n;s=t[0],r=t[1],self[s]=r,n=s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r?i(e,[n],[]):i(e,[],[n])})})(t,e)}emitEvent(t,e=null){const s=new CustomEvent(t,{bubbles:!0,detail:e});this.button.dispatchEvent(s)}hasValidAttributeParams(t){let e=!0;return["data-action","data-host","data-page-initial","data-page-max","data-use-response-field","data-load-more-target","data-load-more-query-params"].forEach(s=>{const i=!!t.attributes.getNamedItem(s);e&=i}),e}}(()=>{const t=document.querySelectorAll(".post-card-list .swiper-container");t.length&&Promise.all([s.e(4014),s.e(4578)]).then(s.bind(s,43899)).then(({default:e})=>{t.forEach(t=>{const s=t.querySelector(".swiper-button-prev"),i=t.querySelector(".swiper-button-next"),r=t.querySelector(".swiper-pagination");new e({container:t,paginationContainer:r,prev:s,next:i})})})})(),(()=>{const t=document.querySelectorAll(".post-card-list .post-card-list-load-more");[].forEach.call(t,function(t){new r(t,{eventOnQueryApi:"r9-multi-blocks-query-api",eventOnDomInsert:"r9-multi-blocks-dom-insert"})})})()})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.