PageSourceSearch

https://autoskola-abc.lv/assets/instructors-CCbEPRtz.js

js autoskola-abc.lv collected 2026-10-09 22:01:21 UTC 7,196 bytes, 1 lines download raw bytes

1import{a as P,b as D,l as K,e as R,m as V,u,s as b,r as i,j as t,B as x,L as f}from"./index-CC7LeppY.js";import{H as z}from"./Header-bowe0gH6.js";import{B as v}from"./badge-CSoMkE9d.js";import{S as N,a as _,b as w,c as y,d as l}from"./select-u_g5UcEG.js";import{t as $}from"./languages-u6O8yafh.js";import{i as G}from"./image-url-Bb3SltRr.js";import{L as H}from"./loader-circle-DNIotRoX.js";import{C as U}from"./calendar-plus-Cna5-dUq.js";import{L as J}from"./lock-Brd3xGWO.js";import"./abc-logo-white.png.asset-Cwt5x36H.js";import"./index-CfRP-hP6.js";import"./index-CLJdEIVw.js";import"./index-DXcqDPk_.js";import"./chevron-right-C3jhp7DR.js";import"./check-sFveOP9a.js";import"./input-CP1rm5Jz.js";import"./label-BDrGmM36.js";import"./textarea-DaLV5Ft2.js";import"./checkbox-BeyvdgSY.js";import"./payments.functions-DtQneDy8.js";import"./StripeEmbeddedCheckout-LGX3HQfF.js";import"./stripe-DgLbGnqx.js";import"./legal.functions-C9v33VLW.js";import"./analytics-BwMd3HQf.js";import"./copy-Dr81kPgO.js";import"./key-round-CUvWpJmK.js";import"./credit-card-CaaGYsVJ.js";import"./shield-5aUExx8u.js";import"./chevron-down-BpZv4uv7.js";const O=P({method:"GET"}).handler(D("ee0f630083aaa479808d0ccc77e17574a9e96feea0004884b39eba290ac6a479")),k="/assets/instructor-1-1AgKUXhk.jpg",Q="/assets/instructor-2-BSNNf-0h.jpg",X="/assets/instructor-3-DDZLDyTa.jpg",Z={"Jānis Bērziņš":k,"Anna Liepa":Q,"Andris Ozols":X};function W(a){return Math.min(Number(a.weekday_student_price),Number(a.weekday_evening_student_price),Number(a.weekend_student_price))}function Cs(){const{user:a,hasRole:h,rolesLoading:S}=K(),{t:e,lang:L}=R(),c=!!a&&!S&&(h("student")||h("admin")),C=V(O),{data:A,isLoading:B}=u({queryKey:["instructors-public"],queryFn:()=>C()}),{data:F}=u({enabled:!!a,queryKey:["favorites-ids",a?.id],queryFn:async()=>{const{data:s}=await b.from("favorite_instructors").select("instructor_id").eq("student_id",a.id);return new Set((s??[]).map(r=>r.instructor_id))}}),{data:I}=u({enabled:!!a,queryKey:["instructor-blocks-of-me",a?.id],queryFn:async()=>{const{data:s}=await b.from("instructor_blocked_students").select("instructor_id").eq("student_id",a.id);return new Set((s??[]).map(r=>r.instructor_id))}}),[m,q]=i.useState("all"),[d,M]=i.useState("all"),p=s=>s?s==="Manuālā"?e("instructors.transmissionManual"):s==="Automāts"||s==="Automātiskā"?e("instructors.transmissionAuto"):s:"",g=s=>$(s,L),o=(A??[]).filter(s=>{const r=s;return!(I?.has(r.id)||r.favorites_only_visible&&!F?.has(r.id))}),T=i.useMemo(()=>{const s=new Set;return o.forEach(r=>(r.languages??[]).forEach(n=>s.add(n))),Array.from(s).sort()},[o]),E=i.useMemo(()=>{const s=new Set;return o.forEach(r=>r.car_transmission&&s.add(r.car_transmission)),Array.from(s).sort()},[o]),j=o.filter(s=>!(m!=="all"&&!(s.languages??[]).includes(m)||d!=="all"&&s.car_transmission!==d));return t.jsxs("div",{className:"min-h-dvh bg-background",children:[t.jsx(z,{}),t.jsxs("main",{className:"mx-auto max-w-6xl px-6 py-16",children:[t.jsxs("div",{className:"max-w-2xl",children:[t.jsx("h1",{className:"text-4xl md:text-5xl font-bold tracking-tight text-balance",children:e("instructors.title")}),t.jsx("p",{className:"mt-3 text-muted-foreground text-lg",children:e(c?"instructors.leadCanBook":"instructors.leadGuest")}),!c&&t.jsx(x,{asChild:!0,className:"mt-5 bg-gradient-dark text-ink-foreground hover:opacity-90",children:t.jsx(f,{to:"/kontakti",children:e("instructors.applyCta")})})]}),B?t.jsx("div",{className:"grid place-items-center py-20",children:t.jsx(H,{className:"w-6 h-6 animate-spin text-muted-foreground"})}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"mt-8 flex flex-col sm:flex-row gap-3 sm:gap-4 sm:items-end",children:[t.jsxs("div",{className:"flex-1 min-w-0 sm:max-w-xs",children:[t.jsx("label",{className:"block text-xs font-medium text-muted-foreground mb-1",children:e("instructors.filterLanguage")}),t.jsxs(N,{value:m,onValueChange:q,children:[t.jsx(_,{children:t.jsx(w,{})}),t.jsxs(y,{children:[t.jsx(l,{value:"all",children:e("instructors.all")}),T.map(s=>t.jsx(l,{value:s,children:g(s)},s))]})]})]}),t.jsxs("div",{className:"flex-1 min-w-0 sm:max-w-xs",children:[t.jsx("label",{className:"block text-xs font-medium text-muted-foreground mb-1",children:e("instructors.filterTransmission")}),t.jsxs(N,{value:d,onValueChange:M,children:[t.jsx(_,{children:t.jsx(w,{})}),t.jsxs(y,{children:[t.jsx(l,{value:"all",children:e("instructors.all")}),E.map(s=>t.jsx(l,{value:s,children:p(s)},s))]})]})]})]}),j.length===0?t.jsx("p",{className:"mt-12 text-center text-muted-foreground",children:e("instructors.noResults")}):t.jsx("div",{className:"mt-6 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:j.map((s,r)=>t.jsxs("article",{className:"group rounded-2xl border border-border bg-card overflow-hidden shadow-soft hover:shadow-elegant motion-safe:transition-all motion-safe:duration-300 motion-safe:hover:-translate-y-1 motion-safe:hover:border-primary/40 flex flex-row md:flex-col motion-safe:animate-fade-in",style:{animationDelay:`${Math.min(r,8)*60}ms`,animationFillMode:"backwards"},children:[t.jsx("div",{className:"w-20 h-20 md:w-auto md:h-80 shrink-0 overflow-hidden bg-muted flex items-center justify-center",children:t.jsx("img",{src:G(s.photo_url,640)||Z[s.name]||k,alt:s.name,width:800,height:800,loading:"lazy",className:"w-full h-full object-cover md:object-contain motion-safe:group-hover:scale-105 motion-safe:transition-transform motion-safe:duration-500"})}),t.jsxs("div",{className:"p-2 md:p-5 flex-1 min-w-0",children:[t.jsx("h2",{className:"text-sm md:text-lg font-semibold",children:s.name}),(s.car_make||s.car_model)&&t.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:[s.car_make,s.car_model].filter(
1Boolean).join(" ")}),s.start_address&&t.jsxs("p",{className:"mt-1 text-xs text-muted-foreground leading-relaxed line-clamp-2",children:[e("instructors.startFrom")," ",s.start_address]}),t.jsxs("div",{className:"mt-2 flex flex-wrap gap-1",children:[t.jsx(v,{variant:"secondary",className:"text-[10px]",children:p(s.car_transmission)}),s.languages.map(n=>t.jsx(v,{variant:"outline",className:"text-[10px]",children:g(n)},n))]}),(()=>{const n=Array.isArray(s.instructor_pricing_public)?s.instructor_pricing_public[0]:s.instructor_pricing_public;return n?t.jsx("p",{className:"mt-1.5 text-xs font-medium text-primary",children:e("instructors.fromPrice",{price:(W(n)/2).toFixed(2)})}):null})(),c?t.jsx(x,{asChild:!0,className:"mt-2 w-full h-8 text-xs bg-gradient-dark text-ink-foreground hover:opacity-90 motion-safe:transition-transform motion-safe:hover:scale-[1.02] motion-safe:active:scale-95",children:t.jsxs(f,{to:"/book/$instructorId",params:{instructorId:s.id},search:{exam:void 0},children:[t.jsx(U,{className:"w-3.5 h-3.5 mr-1 motion-safe:transition-transform motion-safe:group-hover:rotate-6"})," ",e("instructors.book")]})}):t.jsx(x,{asChild:!0,variant:"outline",className:"mt-2 w-full h-8 text-xs motion-safe:transition-transform motion-safe:hover:scale-[1.02] motion-safe:active:scale-95",children:t.jsxs(f,{to:"/kontakti",children:[t.jsx(J,{className:"w-3.5 h-3.5 mr-1"})," ",e("instructors.lockedCta")]})})]})]},s.id))})]})]})]})}export{Cs as component};

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.