1import{r as u,j as e}from"./index-s-Xf5UeO.js";import{f as b,g as w,P as v}from"./plate-B-YJ3Be3.js";import{L as j}from"./loader-circle-DbbQwcvv.js";import{A as y}from"./map-pin-CeqNSNw1.js";import{C as N}from"./circle-alert-BkSpL7Ew.js";function A({lang:t,compact:s=!1,targetStep:a,onPlateSubmit:o}){const[r,m]=u.useState(""),[f,p]=u.useState(!1),[i,x]=u.useState(!1),l=v.test(r),n=f&&r.length>0&&!l;return e.jsxs("form",{onSubmit:d=>{if(d.preventDefault(),p(!0),!l)return;if(x(!0),o){o(r,a);return}const g=t==="da"?"/da/saadan-goer-du/forhaandsvurdering":"/en/heres-how-you-do-it/preassessment",c=new URLSearchParams;c.set("plate",r.replace(/\s/g,"")),a&&c.set("step",a);const h=`${g}?${c.toString()}`;typeof window<"u"&&window.location.assign(h)},className:s?"flex flex-col gap-3 text-brand-green-deep":"mx-auto w-fit text-brand-green-deep",children:[e.jsxs("div",{className:"flex flex-col items-stretch gap-3 sm:flex-row sm:justify-center sm:gap-0",children:[e.jsxs("div",{className:`relative flex h-[64px] flex-[3] items-stretch overflow-hidden rounded-lg border-0 shadow-xl transition-colors sm:rounded-r-none md:min-w-[400px] ${n?"bg-destructive/10 ring-2 ring-inset ring-destructive":"bg-surface-raised"}`,children:[e.jsxs("span",{className:"absolute inset-y-0 left-0 z-10 grid place-items-center bg-plate-eu px-2.5 text-[10px] font-bold text-plate-eu-foreground",children:[e.jsx("span",{className:"block leading-none",children:"â
"}),e.jsx("span",{className:"block leading-none",children:"DK"})]}),e.jsx("input",{value:r,onChange:d=>m(b(d.target.value)),onBlur:()=>p(!0),placeholder:"AB 12 345",inputMode:"text",autoCapitalize:"characters",autoComplete:"off",spellCheck:!1,maxLength:9,"aria-invalid":n||void 0,"aria-describedby":n?"plate-error":void 0,"aria-label":"Nummerplade",className:`h-full w-full bg-transparent py-0 pl-10 text-center font-display text-2xl font-bold tracking-[0.22em] placeholder:text-brand-green-deep/30 focus:outline-none sm:text-3xl ${n?"text-destructive":"text-brand-green-deep"}`})]}),e.jsx("button",{type:"submit",disabled:!l||i,className:`inline-flex h-[64px] w-full shrink-0 items-center justify-center gap-3 self-stretch overflow-hidden rounded-lg border-0 px-6 py-0 text-base font-bold uppercase leading-none tracking-wider text-on-brand backdrop-blur-sm transition-all duration-300 ease-in-out focus:outline-none sm:w-auto sm:rounded-l-none sm:rounded-r-lg ${l&&!i?"cursor-pointer bg-brand-deep hover:bg-brand-deep-hover focus:bg-brand-deep-hover":"cursor-not-allowed bg-surface-raised/10"}`,children:i?e.jsx(j,{className:"size-5 animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"Start"}),e.jsx(y,{className:"size-4"})]})})]}),n&&e.jsxs("p",{id:"plate-error",role:"alert",className:"mt-3 flex items-center justify-center gap-2 rounded-lg bg-destructive/10 px-4 py-2.5 text-sm font-semibold text-destructive shadow-sm",children:[e.jsx(N,{className:"size-4 shrink-0","aria-hidden":!0}),w(r,t)]})]})}function k(t,s){return t&&s.trim()!==""}function R(t,s,a=o=>typeof document>"u"?null:document.getElementById(o)){return k(t,s)?(a("wizard-section")?.scrollIntoView({behavior:"smooth",block:"start"}),!0):!1}export{A as P,R as s};
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.