PageSourceSearch

https://www.dekra.lu/_nuxt/CtOzmkPA.js

js dekra.lu collected 2026-10-07 06:52:20 UTC 2,581 bytes, 1 lines download raw bytes

1import{L as i,bm as u,f,ar as h}from"./COfh4MUy.js";import{i as p}from"./D-_E0le2.js";const S=(r,e)=>{const{projectId:t,remoteProjectId:a}=h().public,s=new URLSearchParams({query:e.searchQuery||"*",numRows:String(e.rows||100),page:String(e.page||1),"facet.filter.FS_show_in_this_language":"true","facet.filter.locale":r,...e.filterQuery?{fq:e.filterQuery}:{},...e.parameters});return t&&(s.set("facet.filter.FS_subscribed_projects",t),s.append("facet.filter.FS_project_uuid",t)),a&&s.append("facet.filter.FS_project_uuid",a),e.filters&&Object.entries(e.filters).forEach(([c,n])=>{if(n){if(!c.match(/^\w+$/)){i.warn(u,f("generateSearchParams"),`Filter key "${c}" is invalid and will be ignored`);return}Array.isArray(n)?n.forEach(o=>s.append(`facet.filter.${c}`,o)):s.set(`facet.filter.${c}`,n)}}),s},l=r=>{if(p(r)){if(!Array.isArray(r))return r;if(r.length!==0)return r.length===1?r[0]:r}},d=r=>Object.entries(r).reduce((e,[t,a])=>{const s=l(a);return p(s)&&(e[t]=s),e},{}),g=({record:r,fields:e})=>e.reduce((t,a)=>(typeof a=="string"?t[a]=l(r[a]):Object.entries(a).forEach(([s,c])=>t[s]=l(r[c])),t),{}),w=r=>r.reduce((e,t)=>{const a=t.name.replace(/_facet_[a-z]+$/,"");return e[a]=t.counts.map(s=>s.value),e},{}),_=(r,e)=>e?r.map(t=>g({record:t,fields:e})):r.map(t=>d(t)),y=async({preparedSearch:r,host:e,locale:t,options:a})=>{try{const s=S(t,a),c=`${e}/v1/prepared_search/${r}/execute/?${s.toString()}`,o=await(await fetch(c)).json();return{filters:a.filters||{},filterValues:w(o.facets),total:o.numRows,results:_(o.results,a.fields)}}catch(s){return i.error(u,f("useSmartSearch"),s),{error:"Failed to call SmartSearch",filters:a.filters||{},filterValues:{},total:0,results:[]}}},$=async({host:r,locale:e,preparedSearch:t,params:a})=>{try{const s=new URLSearchParams({prefix:a.prefix,language:e.toLowerCase().includes("cn")?e.toLowerCase():e.substring(0,2),field:"autocomplete_expanded"}),c=`${r}/v1/prepared_search/${t}/autocomplete?${s.toString()}`,n=await fetch(c);return n.status!==200?(i.error(u,f("useSmartSearch"),n.status,n.statusText),[]):(await n.json()).filter(m=>!m.startsWith("_ ")&&!m.endsWith(" _"))}catch(s){return i.error(u,f("useSmartSearch"),s),Promise.resolve([])}},j=(r,e)=>{if(!r.match(/^\w+$/))return i.error(u,f("useSmartSearch"),`Prepared search "${r}" is invalid`),{error:`Prepared search "${r}" is invalid`,search:async()=>({}),autocomplete:async()=>[]};const t=h().public.smartSearchHost;return{error:null,search:(a={})=>y({preparedSearch:r,host:t,locale:e,options:a}),autocomplete:a=>$({host:t,locale:e,preparedSearch:r,params:a})}};export{j as u};

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.