PageSourceSearch

https://www.wemtoyota.com/wp-content/themes/magnetis-dealer/dist/js/init-results.CM7g48Gw.js

js wemtoyota.com collected 2026-10-01 23:53:29 UTC 8,035 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["js/CurrencySwitcher.YWuO0Os8.js","js/disclose-version.Bzak7iHL.js","js/index-client.BS_Xzxr-.js","js/effects.Db232aR_.js","js/render.DTZwp_Ey.js","js/snippet.CF5CxJXN.js","js/attributes.BuuSV8ud.js","js/props.lXQ4XAkz.js","js/index.BWxWQ6tn.js","js/searchStore.CbWy9yS2.js","js/constants.Ck-yDKY4.js","js/storage.r200hDvc.js","css/CurrencySwitcher.4B8nCHo4.css"])))=>i.map(i=>d[i]);
2import{m as J}from"./render.DTZwp_Ey.js";import{_ as oe}from"./preload-helper.DpP58caH.js";import"./disclose-version.Bzak7iHL.js";import{onMount as F}from"./index-client.BS_Xzxr-.js";import{p as se,g as r,j as h,b as G,h as ie}from"./effects.Db232aR_.js";import{r as le,a as ae,s as ce}from"./props.lXQ4XAkz.js";import{equalizeCardElements as C,debounceEqualize as ue}from"./card-aligner.BsKmBjLP.js";import{t as g}from"./store.BN9gOzjN.js";import{s as E}from"./searchStore.CbWy9yS2.js";import{d as _,R as de}from"./constants.Ck-yDKY4.js";import"./snippet.CF5CxJXN.js";import"./index.BWxWQ6tn.js";const me=700;function fe(t){const{sentinelId:o,onIntersect:s,rootMargin:f=`0px 0px ${me}px 0px`,threshold:u=.1}=t;let d=null,p=null;function i(){l(),p=document.getElementById(o),p&&(d=new IntersectionObserver(y=>{y.forEach(a=>{a.isIntersecting&&s()})},{root:null,rootMargin:f,threshold:u}),d.observe(p))}function l(){d&&(d.disconnect(),d=null),p=null}return{setup:i,cleanup:l}}function pe(){return{overlay:document.querySelector(`#${_} .results-loading-overlay`),errorOverlay:document.querySelector(`#${_} .results-error-overlay`),loadMoreBtn:document.getElementById("load-more-btn"),infiniteScrollIndicator:document.getElementById("infinite-scroll-loading")}}function ge(t,o,s){var p;const f=document.getElementById(_);if(!f)throw new Error("Results wrapper not found");let u=f.querySelector(".results-error-overlay");if(u){const i=u.querySelector(".error-message"),l=u.querySelector(".error-retry-btn");i&&(i.textContent=t),l&&(l.textContent=o)}else{u=document.createElement("div"),u.className="results-error-overlay";const i=document.createElement("div");i.className="error-overlay-content";const l=document.createElement("i");l.className="fas fa-exclamation-circle error-icon",l.setAttribute("aria-hidden","true");const y=document.createElement("p");y.className="error-message",y.textContent=t;const a=document.createElement("button");a.type="button",a.className="btn btn-primary error-retry-btn",a.textContent=o,i.appendChild(l),i.appendChild(y),i.appendChild(a),u.appendChild(i),f.appendChild(u)}const d=u.querySelector(".error-retry-btn");if(d){const i=d.cloneNode(!0);(p=d.parentNode)==null||p.replaceChild(i,d),i.addEventListener("click",s)}return u}function ye(t,o,s){const f=ge(t,o,s);f.style.display="block"}function he(){const t=document.querySelector(`#${_} .results-error-overlay`);t&&(t.style.display="none")}function j(t){t&&(t.style.display="block")}function Ee(t){t&&(t.style.display="none")}function K(t,o,s,f){t&&(t.classList.toggle("disabled",o),t.setAttribute("aria-disabled",String(o)),t.textContent=o?s:t.getAttribute("data-original-text")||f)}function ve(t){t&&(t.style.display="block")}function we(t){t&&(t.style.display="none")}function Se(t,o){se(o,!0);const s=()=>ae(E,"$searchStore",f),[f,u]=ce(),d=le(o,["$$slots","$$events","$$legacy"]),p=h(()=>s().pagination.currentPage),i=h(()=>s().pagination.hasMore),l=h(()=>s().loading.results),y=h(()=>s().loading.action),a=h(()=>s().pagination.paginationStyle||"numbered"),M=h(()=>s().error),W=h(()=>r(M).message!==null);let L=null,v=null,w=null,S=null;F(()=>{E.hydrateResults(d),sessionStorage.setItem("srp-listing-url",window.location.pathname+window.location.search),o.currencySwitcherEnabled&&oe(async()=>{const{default:e}=await import("./CurrencySwitcher.YWuO0Os8.js");return{default:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(({default:e})=>{const n=document.getElementById("currency-switcher-target");n&&J(e,{target:n,props:{currencySwitcherEnabled:o.currencySwitcherEnabled}})})}),F(()=>{const e=n=>{const{html:m,paginationHtml:c,append:I}=n.detail;X(m,c,I)};return window.addEventListener("resultsUpdated",e),Q(),()=>{window.removeEventListener("resultsUpdated",e),Z()}});function X(e,n,m){var H,U;const c=document.getElementById(de),I=document.getElementById("results-count"),N=document.getElementById("mobile-results-count"),P=document.querySelector(".srp-pagination"),$=document.getElementById("search-page-results-container");if(!c)return;if(I&&(I.innerHTML=te(s().pagination.totalResults)),N&&(N.innerHTML=ne(s().pagination.totalResults)),m){const b=document.createElement("div");b.innerHTML=e;const V=(H=b.querySelector("#search-results-grid"))==null?void 0:H.children,z=c.querySelector("#search-results-grid");
2V&&z&&Array.from(V).forEach(re=>z.appendChild(re))}else c.innerHTML=e;if(P?P.outerHTML=n:$&&$.insertAdjacentHTML("beforeend",n),r(a)==="infinite_scroll"){const b=O();we(b.infiniteScrollIndicator),r(i)?T():B()}const D=(U=s().incentiveConfig)==null?void 0:U.type,k=document.getElementById("search-results-grid");D&&k&&(k.dataset.activePayment=D),requestAnimationFrame(()=>C()),document.dispatchEvent(new CustomEvent("vehicle-listing.ajax-loaded")),sessionStorage.setItem("srp-listing-url",window.location.pathname+window.location.search)}function O(){return L||(L=pe()),L}G(()=>{const e=O();r(l)?r(y)!=="pagination"?j(e.overlay):(r(a)==="numbered"&&j(e.overlay),r(a)==="load_more"&&K(e.loadMoreBtn,!0,g("results.loading"),g("results.loadMore")),r(a)==="infinite_scroll"&&ve(e.infiniteScrollIndicator)):(Ee(e.overlay),r(a)==="load_more"&&K(e.loadMoreBtn,!1,g("results.loading"),g("results.loadMore")))}),G(()=>{if(r(W)&&!r(l)){const e=g(r(M).message||"errors.generic"),n=g("errors.retry");ye(e,n,Y)}else he()});function Y(){E.retryLastAction()}function T(){r(a)!=="infinite_scroll"||!r(i)||(B(),v=fe({sentinelId:"infinite-scroll-sentinel",onIntersect:()=>{if(r(i)&&!r(l)){const e=r(p)+1;E.setPage(e)}}}),v.setup())}function B(){v&&(v.cleanup(),v=null)}function x(e){const n=e.target;if(n.matches(".page-link")||n.closest(".page-link")){e.preventDefault();const m=n.matches(".page-link")?n:n.closest(".page-link"),c=parseInt((m==null?void 0:m.getAttribute("data-page"))||"1",10);c&&c!==r(p)&&(E.setPage(c),ee());return}if(n.matches("#load-more-btn")||n.closest("#load-more-btn")){if(e.preventDefault(),r(l))return;const m=r(p)+1;E.setPage(m)}}function A(e){const n=e.target,[m,c]=n.value.split("-");E.setSort(m,c)}function Q(){document.addEventListener("click",x);const e=document.getElementById("sort-select");e&&e.addEventListener("change",A),w=ue(250),window.addEventListener("resize",w),requestAnimationFrame(()=>C()),document.readyState==="complete"?C():(S=()=>C(),window.addEventListener("load",S)),r(a)==="infinite_scroll"&&T()}function Z(){document.removeEventListener("click",x);const e=document.getElementById("sort-select");e&&e.removeEventListener("change",A),w&&(window.removeEventListener("resize",w),w=null),S&&(window.removeEventListener("load",S),S=null),B()}function ee(){const e=document.getElementById("results-count");if(e){const n=e.getBoundingClientRect().top+window.pageYOffset-70;window.scrollTo({top:n,behavior:"smooth"})}}function te(e){return e===0?g("results.noVehicles"):q("results.vehiclesFound",e)}function ne(e){return e===0?g("results.seeVehicles"):q("results.seeNVehicles",e)}function q(e,n){if(n===1){const c={"results.vehiclesFound":"results.oneVehicle","results.seeNVehicles":"results.seeOneVehicle"}[e];if(c)return g(c)}return g(e,{n})}ie(),u()}const R=document.getElementById("search-page-results-container");if(R){const t=R.getAttribute("data-results-init");if(t)try{const o=JSON.parse(t);J(Se,{target:R,props:o}),document.dispatchEvent(new CustomEvent("srp-results-ready"))}catch(o){console.error("[init-results] Error initializing results grid:",o),document.dispatchEvent(new CustomEvent("srp-results-ready"))}else document.dispatchEvent(new CustomEvent("srp-results-ready"))}else document.dispatchEvent(new CustomEvent("srp-results-ready"));

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.