PageSourceSearch

https://baycitymitsubishi.co.nz/assets/vehicle-filter-radios-BwA0Ksu4.js

js baycitymitsubishi.co.nz collected 2026-10-04 20:32:59 UTC 9,520 bytes, 1 lines download raw bytes

1import{r as u,bb as ce,j as l,bc as j,bd as K,be as C,bf as de,bg as ue,bh as Y,bi as fe,bj as me,bk as he,am as pe,bl as Se,bm as be}from"./index-Mfw5D6Uk.js";var $=["PageUp","PageDown"],X=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],G={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},_="Slider",[z,xe,ge]=de(_),[W]=me(_,[ge]),[ve,A]=W(_),q=u.forwardRef((e,t)=>{const{name:o,min:n=0,max:i=100,step:r=1,orientation:s="horizontal",disabled:c=!1,minStepsBetweenThumbs:d=0,defaultValue:g=[n],value:S,onValueChange:a=()=>{},onValueCommit:f=()=>{},inverted:x=!1,form:y,...b}=e,h=u.useRef(new Set),m=u.useRef(0),v=s==="horizontal"?we:ye,[p=[],M]=ce({prop:S,defaultProp:g,onChange:w=>{[...h.current][m.current]?.focus(),a(w)}}),I=u.useRef(p);function k(w){const R=je(p,w);N(w,R)}function ae(w){N(w,m.current)}function le(){const w=I.current[m.current];p[m.current]!==w&&f(p)}function N(w,R,{commit:B}={commit:!1}){const O=Ne(r),T=Ve(Math.round((w-n)/r)*r+n,O),V=Y(T,[n,i]);M((E=[])=>{const P=De(E,V,R);if(Me(P,d*r)){m.current=P.indexOf(V);const U=String(P)!==String(E);return U&&B&&f(P),U?P:E}else return E})}return l.jsx(ve,{scope:e.__scopeSlider,name:o,disabled:c,min:n,max:i,valueIndexToChangeRef:m,thumbs:h.current,values:p,orientation:s,form:y,children:l.jsx(z.Provider,{scope:e.__scopeSlider,children:l.jsx(z.Slot,{scope:e.__scopeSlider,children:l.jsx(v,{"aria-disabled":c,"data-disabled":c?"":void 0,...b,ref:t,onPointerDown:j(b.onPointerDown,()=>{c||(I.current=p)}),min:n,max:i,inverted:x,onSlideStart:c?void 0:k,onSlideMove:c?void 0:ae,onSlideEnd:c?void 0:le,onHomeKeyDown:()=>!c&&N(n,0,{commit:!0}),onEndKeyDown:()=>!c&&N(i,p.length-1,{commit:!0}),onStepKeyDown:({event:w,direction:R})=>{if(!c){const T=$.includes(w.key)||w.shiftKey&&X.includes(w.key)?10:1,V=m.current,E=p[V],P=r*T*R;N(E+P,V,{commit:!0})}}})})})})});q.displayName=_;var[J,Q]=W(_,{startEdge:"left",endEdge:"right",size:"width",direction:1}),we=u.forwardRef((e,t)=>{const{min:o,max:n,dir:i,inverted:r,onSlideStart:s,onSlideMove:c,onSlideEnd:d,onStepKeyDown:g,...S}=e,[a,f]=u.useState(null),x=C(t,v=>f(v)),y=u.useRef(void 0),b=ue(i),h=b==="ltr",m=h&&!r||!h&&r;function D(v){const p=y.current||a.getBoundingClientRect(),M=[0,p.width],k=L(M,m?[o,n]:[n,o]);return y.current=p,k(v-p.left)}return l.jsx(J,{scope:e.__scopeSlider,startEdge:m?"left":"right",endEdge:m?"right":"left",direction:m?1:-1,size:"width",children:l.jsx(Z,{dir:b,"data-orientation":"horizontal",...S,ref:x,style:{...S.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:v=>{const p=D(v.clientX);s?.(p)},onSlideMove:v=>{const p=D(v.clientX);c?.(p)},onSlideEnd:()=>{y.current=void 0,d?.()},onStepKeyDown:v=>{const M=G[m?"from-left":"from-right"].includes(v.key);g?.({event:v,direction:M?-1:1})}})})}),ye=u.forwardRef((e,t)=>{const{min:o,max:n,inverted:i,onSlideStart:r,onSlideMove:s,onSlideEnd:c,onStepKeyDown:d,...g}=e,S=u.useRef(null),a=C(t,S),f=u.useRef(void 0),x=!i;function y(b){const h=f.current||S.current.getBoundingClientRect(),m=[0,h.height],v=L(m,x?[n,o]:[o,n]);return f.current=h,v(b-h.top)}return l.jsx(J,{scope:e.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:l.jsx(Z,{"data-orientation":"vertical",...g,ref:a,style:{...g.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:b=>{const h=y(b.clientY);r?.(h)},onSlideMove:b=>{const h=y(b.clientY);s?.(h)},onSlideEnd:()=>{f.current=void 0,c?.()},onStepKeyDown:b=>{const m=G[x?"from-bottom":"from-top"].includes(b.key);d?.({event:b,direction:m?-1:1})}})})}),Z=u.forwardRef((e,t)=>{const{__scopeSlider:o,onSlideStart:n,onSlideMove:i,onSlideEnd:r,onHomeKeyDown:s,onEndKeyDown:c,onStepKeyDown:d,...g}=e,S=A(_,o);return l.jsx(K.span,{...g,ref:t,onKeyDown:j(e.onKeyDown,a=>{a.key==="Home"?(s(a),a.preventDefault()):a.key==="End"?(c(a),a.preventDefault()):$.concat(X).includes(a.key)&&(d(a),a.preventDefault())}),onPointerDown:j(e.onPointerDown,a=>{const f=a.target;f.setPointerCapture(a.pointerId),a.preventDefault(),S.thumbs.has(f)?f.focus():n(a)}),onPointerMove:j(e.onPointerMove,a=>{a.target.hasPointerCapture(a.pointerId)&&i(a)}),onPointerUp:j(e.onPointerUp,a=>{const f=a.target;f.hasPointerCapture(a.pointerId)&&(f.releasePointerCapture(a.pointerId),r(a))})})}),ee="SliderTrack",te=u.forwardRef((e,t)=>
1{const{__scopeSlider:o,...n}=e,i=A(ee,o);return l.jsx(K.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...n,ref:t})});te.displayName=ee;var H="SliderRange",ne=u.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,i=A(H,o),r=Q(H,o),s=u.useRef(null),c=C(t,s),d=i.values.length,g=i.values.map(f=>se(f,i.min,i.max)),S=d>1?Math.min(...g):0,a=100-Math.max(...g);return l.jsx(K.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...n,ref:c,style:{...e.style,[r.startEdge]:S+"%",[r.endEdge]:a+"%"}})});ne.displayName=H;var F="SliderThumb",oe=u.forwardRef((e,t)=>{const o=xe(e.__scopeSlider),[n,i]=u.useState(null),r=C(t,c=>i(c)),s=u.useMemo(()=>n?o().findIndex(c=>c.ref.current===n):-1,[o,n]);return l.jsx(Re,{...e,ref:r,index:s})}),Re=u.forwardRef((e,t)=>{const{__scopeSlider:o,index:n,name:i,...r}=e,s=A(F,o),c=Q(F,o),[d,g]=u.useState(null),S=C(t,D=>g(D)),a=d?s.form||!!d.closest("form"):!0,f=fe(d),x=s.values[n],y=x===void 0?0:se(x,s.min,s.max),b=Ee(n,s.values.length),h=f?.[c.size],m=h?Ce(h,y,c.direction):0;return u.useEffect(()=>{if(d)return s.thumbs.add(d),()=>{s.thumbs.delete(d)}},[d,s.thumbs]),l.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${y}% + ${m}px)`},children:[l.jsx(z.ItemSlot,{scope:e.__scopeSlider,children:l.jsx(K.span,{role:"slider","aria-label":e["aria-label"]||b,"aria-valuemin":s.min,"aria-valuenow":x,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...r,ref:S,style:x===void 0?{display:"none"}:e.style,onFocus:j(e.onFocus,()=>{s.valueIndexToChangeRef.current=n})})}),a&&l.jsx(re,{name:i??(s.name?s.name+(s.values.length>1?"[]":""):void 0),form:s.form,value:x},n)]})});oe.displayName=F;var Pe="RadioBubbleInput",re=u.forwardRef(({__scopeSlider:e,value:t,...o},n)=>{const i=u.useRef(null),r=C(i,n),s=he(t);return u.useEffect(()=>{const c=i.current;if(!c)return;const d=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(d,"value").set;if(s!==t&&S){const a=new Event("input",{bubbles:!0});S.call(c,t),c.dispatchEvent(a)}},[s,t]),l.jsx(K.input,{style:{display:"none"},...o,ref:r,defaultValue:t})});re.displayName=Pe;function De(e=[],t,o){const n=[...e];return n[o]=t,n.sort((i,r)=>i-r)}function se(e,t,o){const r=100/(o-t)*(e-t);return Y(r,[0,100])}function Ee(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function je(e,t){if(e.length===1)return 0;const o=e.map(i=>Math.abs(i-t)),n=Math.min(...o);return o.indexOf(n)}function Ce(e,t,o){const n=e/2,r=L([0,50],[0,n]);return(n-r(t)*o)*o}function _e(e){return e.slice(0,-1).map((t,o)=>e[o+1]-t)}function Me(e,t){if(t>0){const o=_e(e);return Math.min(...o)>=t}return!0}function L(e,t){return o=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(o-e[0])}}function Ne(e){return(String(e).split(".")[1]||"").length}function Ve(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}var ie=q,Ke=te,Ae=ne,Ie=oe;const ke=u.forwardRef(({className:e,...t},o)=>{const n=t.value??t.defaultValue??[t.min??0];return l.jsxs(ie,{ref:o,className:pe("relative flex w-full touch-none select-none items-center",e),...t,children:[l.jsx(Ke,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",children:l.jsx(Ae,{className:"absolute h-full bg-primary"})}),n.map((i,r)=>l.jsx(Ie,{className:"block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"},r))]})});ke.displayName=ie.displayName;function Te({groups:e,onChange:t}){const o=e.some(r=>r.value!==r.defaultValue),[n,i]=u.useState(o);return l.jsxs("div",{className:"mt-5",children:[l.jsx("button",{type:"button",onClick:()=>i(r=>!r),className:"flex items-center gap-1 text-sm font-semibold text-primary underline-offset-2 hover:underline","aria-expanded":n,children:n?l.jsxs(l.Fragment,{children:[l.jsx(Se,{className:"h-4 w-4"})," Fewer filters"]}):l.jsxs(l.Fragment,{children:[l.jsx(be,{className:"h-4 w-4"})," More filters"]})}),n&&l.jsx("div",{className:"mt-4 flex flex-col gap-5 border-t-2 border-foreground
1/15 pt-5 md:flex-row md:flex-wrap md:justify-start md:gap-6",children:e.map((r,s)=>{const c=s<e.length-1;return l.jsxs("fieldset",{className:["flex flex-wrap items-center gap-x-6 gap-y-2",c?"border-b-2 border-foreground/15 pb-5 md:w-auto md:shrink-0 md:border-b-0 md:border-r-2 md:border-foreground/15 md:pb-0 md:pr-6":""].join(" "),children:[l.jsx("legend",{className:"sr-only",children:r.legend}),r.options.map(d=>l.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-sm font-medium text-foreground",children:[l.jsx("input",{type:"radio",name:r.name,value:d.value,checked:r.value===d.value,onChange:()=>t(r.name,d.value,r.defaultValue),className:"h-4 w-4 accent-primary"}),d.label]},d.value))]},r.name)})})]})}export{ke as S,Te as V};

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.