PageSourceSearch

https://www.volvotrucks.fi/clientlibs-edge/production/20260917131920/shared/components/structure/search.js

js volvotrucks.fi collected 2026-10-05 03:23:40 UTC 5,634 bytes, 1 lines download raw bytes

1(()=>{"use strict";var e,t,r,i,n,o,s={11634(e,t,r){var i=r(38443),n=r(7967),o=r(8246),s=r(69071),a=r(10996);let c={searchResultClick:"searchResultClick"},l={term:void 0,results:{numberPerPage:void 0,numberTotal:void 0,clickedResult:{index:void 0,title:void 0,url:void 0,category:void 0}},searchResultClick:{value:1},location:void 0,type:"QR"},u={siteSearch:"siteSearch"},d={autoComplete:{clicked:!1,value:void 0},term:void 0,results:{numberPerPage:void 0,numberTotal:void 0},siteSearch:{value:1},selectedOptions:void 0,location:void 0,type:"QR"},h="data-nc";class f extends i.A{constructor(e,t){super(e,t),this.isRedirecting=!1,this.handleSectionInteraction=this.handleSectionInteraction.bind(this),this.onSectionKeydown=this.onSectionKeydown.bind(this),this.init()}init(){this.setRefs(),this.setListeners(),this.setupSectionListObserver(),this.searchInput.setAttribute("autocomplete","off")}setRefs(){this.searchInput=this.find(".cmp-search__input"),this.searchForm=this.find(".cmp-search__form")}onVCDKKeyup(e){e.preventDefault(),"Enter"===e.detail.nativeEvent.key&&""!==e.target.value&&(this.collectDataforAnalytics(),this.redirectPage(e))}setListeners(){this.searchForm.addEventListener("vcdk-keyup",this.onVCDKKeyup.bind(this))}handleSectionInteraction(e){if(!e.target.closest("vcdk-link"))return;let t=e.target.closest(".autocomplete-dropdown__section-list-item");if(t){if(t.getAttribute("data-url"))return;let r=t.textContent,i=this.searchInput.value;this.collectDataforAnalytics({autoComplete:{clicked:!0,value:r},term:i}),this.scheduleInputUpdateAndRedirect(e,r)}}onSectionKeydown(e){"Enter"===e.key&&this.handleSectionInteraction(e)}scheduleInputUpdateAndRedirect(e,t){setTimeout(()=>{this.searchInput.value=t,this.redirectPage(e)})}setupSectionListObserver(){new MutationObserver(e=>{e.forEach(e=>{e?.addedNodes?.forEach(e=>{e?.querySelector&&(e.addEventListener("click",this.handleSectionInteraction),e.addEventListener("keydown",this.onSectionKeydown))})})}).observe(this.el,{childList:!0,subtree:!0})}redirectPage(e){if(this.isRedirecting)return!0;this.isRedirecting=!0;let t=this.searchForm.getAttribute("data-cmp-results-page"),r=this.searchInput.value,i=`${t}?q=${r}`;return window.location=i,e.preventDefault(),!1}collectDataforAnalytics(e={}){let t=this.el.parentElement?.closest(`[${h}]`)?.getAttribute(h);(function(){window.adobeDataLayer=window.adobeDataLayer||[];let e=window.adobeDataLayer,t=[],r={};function i(e,t){return{event:e,_volvo:{universal:{web:{search:t}}},web:{webInteraction:{type:"other"}}}}function n(e){return r=(0,o.$N)({...r},{...e})}return document.addEventListener(a.AUTOCOMPLETE_SUGGESTION_CLICK,function(e){let{text:t}=e.detail;t&&n({autoComplete:{clicked:!0,value:t}})}),{cleanHistory:function(){t.length=0},searchResultClickTrack:function(t){let r=i(c.searchResultClick,{...l,...t});e.push(r)},selectedOptionsGet:function(e={},t=[],r={}){let i=Object.keys(e).map(i=>{if(e[i]?.length>0){let n=e[i],o=n?.map(e=>{let n,o;return(n=t.find(e=>e.type===i).items.find(t=>t.value===e))?r[o=n.translationKey||n.value]||o:void 0});return{attribute:i,value:o.join(", ")}}return null}).filter(e=>null!==e);return i.length>0?i:void 0},siteSearchStateGet:function(){return r},siteSearchStateUpdate:n,siteSearchTrack:function(r){if(!t.some(e=>(0,o.uA)(e,r))){let n=i(u.siteSearch,{...d,...r});e.push(n),t.push(r)}},storageSiteSearchClean:function(){sessionStorage.removeItem(s.gM)},storageSiteSearchGet:function(){let e=sessionStorage.getItem(s.gM);return e?JSON.parse(e):{}},storageSiteSearchSet:function(e){sessionStorage.setItem(s.gM,JSON.stringify(e))}}})().storageSiteSearchSet({location:t,...e})}}(0,n.kz)({Search:f})}},a={};function c(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={exports:{}};return s[e].call(r.exports,r,r.exports,c),r.exports}c.m=s,c.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return c.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,c.t=function(r,i){if(1&i&&(r=this(r)),8&i||"object"==typeof r&&r&&(4&i&&r.__esModule||16&i&&"function"==typeof r.then))return r;var n=Object.create(null);c.r(n);var o={};e=e||[null,t({}),t([]),t(t)];for(var s=2&i&&r;("object"==typeof s||"function"==typeof s)&&!~e.indexOf(s);
1s=t(s))Object.getOwnPropertyNames(s).forEach(e=>{o[e]=()=>r[e]});return o.default=()=>r,c.d(n,o),n},c.d=(e,t)=>{for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.e=()=>Promise.resolve(),c.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r=[],c.O=(e,t,i,n)=>{if(t){n=n||0;for(var o=r.length;o>0&&r[o-1][2]>n;o--)r[o]=r[o-1];r[o]=[t,i,n];return}for(var s=1/0,o=0;o<r.length;o++){for(var t=r[o][0],i=r[o][1],n=r[o][2],a=!0,l=0;l<t.length;l++)(!1&n||s>=n)&&Object.keys(c.O).every(e=>c.O[e](t[l]))?t.splice(l--,1):(a=!1,n<s&&(s=n));if(a){r.splice(o--,1);var u=i();void 0!==u&&(e=u)}}return e},c.rv=()=>"1.7.11",c.j="9331",i={9331:0},c.O.j=e=>0===i[e],n=(e,t)=>{var r,n,o=t[0],s=t[1],a=t[2],l=0;if(o.some(e=>0!==i[e])){for(r in s)c.o(s,r)&&(c.m[r]=s[r]);if(a)var u=a(c)}for(e&&e(t);l<o.length;l++)n=o[l],c.o(i,n)&&i[n]&&i[n][0](),i[n]=0;return c.O(u)},(o=self.webpackChunkvolvo_fe_build=self.webpackChunkvolvo_fe_build||[]).forEach(n.bind(null,0)),o.push=n.bind(null,o.push.bind(o)),c.ruid="[email protected]";var l=c.O(void 0,["8263"],()=>c(11634));l=c.O(l)})();

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.