PageSourceSearch

https://portal.continental-industry.com/assets/HoseSelectSearchPage-DpwNvQXw.js

js continental-industry.com collected 2026-10-02 10:03:04 UTC 9,026 bytes, 1 lines download raw bytes

1import{r as d,j as s,bW as V,aa as X,bX as A,aO as K,bZ as Q,b_ as U,U as W,u as Z,D as _,h as G,i as M,aQ as u,a2 as Y,B as R}from"../index.js";import{u as ee,f as se,a as B,b as ae,c as te}from"./labels-D8jWKZC9.js";import{u as f,d as le,a as re,e as oe}from"./store-jIIUoEej.js";import{F as ne}from"./MagnifyingGlassIcon-xKR1UHFR.js";import{F as ie}from"./ArrowTurnDownLeftIcon-DZ980ymh.js";import{F as ce}from"./ArrowRightIcon-B7UHJ8q6.js";import"./react-BXC0u6k7.js";function de({text:r,query:n}){const a=n.trim();if(!a)return s.jsx(s.Fragment,{children:r});const l=r.toLowerCase().indexOf(a.toLowerCase());return l<0?s.jsx(s.Fragment,{children:r}):s.jsxs(s.Fragment,{children:[r.slice(0,l),s.jsx("mark",{className:"bg-primary-yellow/40 text-inherit rounded-sm px-0.5",children:r.slice(l,l+a.length)}),r.slice(l+a.length)]})}function ue({value:r,hoseType:n,onChange:a,onSelectHose:l,onSubmit:N}){const b=d.useId(),{t}=B(),{suggestions:o}=ee(r,n),[y,h]=d.useState(!1);return s.jsxs("div",{className:"relative w-full",children:[s.jsx("label",{htmlFor:b,className:"block text-base font-medium text-primary-black mb-1.5",children:t.keywordLabel}),s.jsx(V,{value:null,onChange:i=>{i&&(l(i),a(""),h(!1))},immediate:!0,children:s.jsxs("div",{className:"relative",children:[s.jsx(X,{"aria-hidden":"true",className:"size-5 absolute top-1/2 left-3 -translate-y-1/2 text-gray-400 pointer-events-none"}),s.jsx(A,{id:b,displayValue:()=>r,placeholder:t.keywordPlaceholder,autoComplete:"off",spellCheck:!1,onChange:i=>{a(i.target.value),h(!0)},onKeyDown:i=>{i.key==="Enter"&&!o.length&&(i.preventDefault(),r.trim()&&N())},className:"!pl-10 !pr-10"}),r&&s.jsx("button",{type:"button",onClick:()=>{a(""),h(!1)},className:"absolute top-1/2 right-2 -translate-y-1/2 text-gray-400 hover:text-gray-600 cursor-pointer p-1",children:s.jsx(K,{className:"size-5"})}),y&&r.trim().length>=2&&s.jsxs(Q,{className:"!max-h-80 mt-1 border border-gray-200 shadow-lg",static:!0,children:[o.length===0?s.jsxs("div",{className:"px-4 py-6 text-center text-sm text-gray-500",children:[s.jsx(ne,{className:"size-6 mx-auto text-gray-300 mb-2"}),s.jsx("p",{children:se(t.typeaheadNoMatches,{value:r})}),s.jsx("p",{className:"text-xs mt-1 text-gray-400",children:t.typeaheadHint})]}):o.map(i=>s.jsx(U,{value:i,className:"!py-2.5 !pl-3 !pr-3 group/opt",children:s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx("span",{className:"font-medium text-sm text-primary-black truncate group-data-focus/opt:text-white",children:s.jsx(de,{text:i.name,query:r})}),s.jsx("span",{className:"shrink-0 text-[10px] uppercase tracking-wider font-semibold text-gray-400 group-data-focus/opt:text-white/80",children:i.hoseType==="industrial"?t.badgeIndustrial:t.badgeHydraulic})]})},i.documentId)),s.jsxs("div",{className:"border-t border-gray-100 px-3 py-2 flex items-center gap-2 text-[11px] text-gray-400 bg-gray-50",children:[s.jsx("kbd",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 bg-white border border-gray-300 font-mono text-[10px]",children:s.jsx(ie,{className:"size-3"})}),s.jsx("span",{children:o.length>0?t.typeaheadSelect:t.typeaheadSearch})]})]})]})})]})}function x(r){return r.map((n,a)=>({id:a,title:n.name??"",docId:n.documentId}))}function j(r){return r.map((n,a)=>({id:a,title:String(n)}))}function g(r,n){return n?r.find(a=>a.docId===n)??null:null}function I(r,n){return n!==null?r.find(a=>a.title===String(n))??null:null}function fe(){const r=W(),[n]=Z(),{t:a}=B(),{config:l,error:N,isLoading:b}=ae(),t=f(e=>e.draft),o=f(e=>e.setDraft),y=f(e=>e.seedDraft),h=f(e=>e.resetDraft),i=n.get("state");d.useEffect(()=>{if(!i)return;const e=le(i);e&&y({...e,page:1})},[i,y]);const{options:c}=te(t.hoseType),v=d.useMemo(()=>x(((l==null?void 0:l.categories)??[]).filter(e=>!t.hoseType||e.hoseType===t.hoseType)),[l,t.hoseType]),S=d.useMemo(()=>x((l==null?void 0:l.industries)??[]),[l]),w=d.useMemo(()=>x(((l==null?void 0:l.subCategories)??[]).filter(e=>!t.categoryId||e.parentCategoryId===t.categoryId)),[l,t.categoryId]),C=d.useMemo(()=>x((l==null?void 0:l.foods)??[]),[l]),O=d.useMemo(()=>x((l==null?void 0:l.chemicals)??[]),[l]),k=d.useMemo(()=>j((c==null?void 0:c.sizesIn)??[]),[c]),T=d.useMemo(()=>j((c==null?void 0:c.pressuresPsi)??[]),[c]),F=d.useMemo(()=>j((c==null?void 0:c.tempsMinF)??[]),[c]),L=d.useMemo(()=>j((c==null?void 0:c.tempsMaxF)??[]),[c]);if(b)return s.jsx(_,{});if(N||!l)return s.jsx("main",{className:"grow px-4 pt-6 lg:px-6 pb-20",children:s.jsx("p",{className:"text-red-600",children:a.resultsLoadError})});const m=l.industries.find(e=>e.documentId===t.industryId),p=l.categories.find(e=>e.documentId===t.categoryId),$=!!(m!=null&&m.isFoodRelated)||!!(p!=null&&p.isFoodRelated),E=!!(m!=null&&m.isChemicalRelated)||!!(p!=null&&p.isChemicalRelated),P=t.hoseType!=="hydraulic",q=JSON.stringify({...t,page:1,pageSize:t.pageSize})!==JSON.stringify({...re,pageSize:t.pageSize}),z=(e=t)=>{r(`${M.hoseSelectResults}?state=${oe({...e,page:1})}`)},J=[{value:null,label:a.typeAll},{value:"industrial",label:a.typeIndustrial},{value:"hydraulic",label:a.typeHydraulic}];return s.jsx("main",{className:"grow px-4 pt-6 lg:px-6 pb-6",children:s.jsxs("div",{className:"max-w-5xl mx-auto",children:[s.jsxs("header",{className:"mb-4",children:[s.jsx("h1",{className:"text-2xl lg:text-3xl font-bold text-primary-black",children:a.pageTitle}),s.jsx("p",{className:"mt-1 text-sm text-gray-600 max-w-2xl",children:a.pageSubtitle})]}),s.jsxs("form",{className:"bg-white shadow-sm",onSubmit:e=>{e.preventDefault(),z()},children:[s.jsxs("div",{className:"px-6 lg:px-10 pt-6 pb-5",children:[s.jsx("div",{role:"radiogroup","aria-label":a.criteriaType,className:"inline-flex border border-gray-300",children:J.map(e=>{const D=t.hoseType===e.value;return s.jsx("button",{type:"button",role:"radio","aria-checked":D,onClick:()=>
1{const H={hoseType:e.value,categoryId:null,subCategoryId:null,foodId:null,chemicalId:null,sizeIn:null,pressurePsi:null};e.value==="hydraulic"&&(H.industryId=null),o(H)},className:G("px-4 py-2 text-sm font-semibold uppercase tracking-wide transition-colors cursor-pointer",D?"bg-primary-black text-white":"bg-white text-gray-600 hover:text-primary-black"),children:e.label},e.label)})}),s.jsx("div",{className:"mt-5",children:s.jsx(ue,{value:t.q,hoseType:t.hoseType,onChange:e=>o({q:e}),onSelectHose:e=>void r(`${M.hoseSelectDetail}?id=${e.documentId}`),onSubmit:()=>z()})}),s.jsxs("div",{className:"mt-6 flex items-center gap-3 mb-4",children:[s.jsx("div",{className:"h-px bg-gray-200 grow"}),s.jsx("span",{className:"text-xs uppercase tracking-wider text-gray-400 font-medium",children:a.dividerRefine}),s.jsx("div",{className:"h-px bg-gray-200 grow"})]}),s.jsxs("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-x-6 gap-y-4",children:[P&&s.jsx(u,{label:a.industryLabel,placeholder:a.industryPlaceholder,options:S,selectedOption:g(S,t.industryId),onChange:e=>o({industryId:(e==null?void 0:e.docId)??null,foodId:null,chemicalId:null})}),s.jsx(u,{label:a.categoryLabel,placeholder:a.categoryPlaceholder,options:v,selectedOption:g(v,t.categoryId),onChange:e=>o({categoryId:(e==null?void 0:e.docId)??null,subCategoryId:null,foodId:null,chemicalId:null})}),P&&s.jsx(u,{label:a.subCategoryLabel,placeholder:a.subCategoryPlaceholder,options:w,selectedOption:g(w,t.subCategoryId),onChange:e=>o({subCategoryId:(e==null?void 0:e.docId)??null}),disabled:!t.categoryId}),$&&s.jsx(u,{label:a.foodLabel,placeholder:a.foodPlaceholder,options:C,selectedOption:g(C,t.foodId),onChange:e=>o({foodId:(e==null?void 0:e.docId)??null})}),E&&s.jsx(u,{label:a.chemicalLabel,placeholder:a.chemicalPlaceholder,options:O,selectedOption:g(O,t.chemicalId),onChange:e=>o({chemicalId:(e==null?void 0:e.docId)??null})}),s.jsx(u,{label:a.sizeLabel,placeholder:a.sizePlaceholder,options:k,selectedOption:I(k,t.sizeIn),onChange:e=>o({sizeIn:(e==null?void 0:e.title)??null})}),s.jsx(u,{label:a.pressureLabel,placeholder:a.pressurePlaceholder,options:T,selectedOption:I(T,t.pressurePsi!==null?String(t.pressurePsi):null),onChange:e=>o({pressurePsi:e?Number(e.title):null})}),s.jsx(u,{label:a.tempFromLabel,placeholder:a.tempFromPlaceholder,options:F,selectedOption:I(F,t.tempFrom!==null?String(t.tempFrom):null),onChange:e=>o({tempFrom:e?Number(e.title):null})}),s.jsx(u,{label:a.tempToLabel,placeholder:a.tempToPlaceholder,options:L,selectedOption:I(L,t.tempTo!==null?String(t.tempTo):null),onChange:e=>o({tempTo:e?Number(e.title):null})}),s.jsx("div",{className:"self-end pb-2.5",children:s.jsx(Y,{label:a.vacuumLabel,checked:t.vacuumRequired,onChange:e=>o({vacuumRequired:e.target.checked})})})]})]}),s.jsxs("div",{className:"px-6 lg:px-10 py-4 bg-gray-50 border-t border-gray-100 flex flex-col-reverse sm:flex-row sm:items-center sm:justify-end gap-3",children:[s.jsx(R,{type:"button",variant:"light",onClick:h,disabled:!q,children:a.resetButton}),s.jsx(R,{type:"submit",children:s.jsxs("span",{className:"flex items-center gap-2",children:[a.searchButton,s.jsx(ce,{className:"size-4"})]})})]})]})]})})}export{fe as default};

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.