1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[532],{46171:function(e,t,s){var r=s(57437),a=s(94508),n=s(38588),l=s(5037);t.Z=e=>{let{className:t,code:s}=e,i=l.P.alertCircle,o=(0,n.useTranslations)("apiErrors"),c=o(""+s)!=="apiErrors."+s;return(0,r.jsxs)("p",{className:(0,a.cn)("text-sm text-red-500 flex gap-1 items-center",t),children:[(0,r.jsx)(i,{size:20}),o(c?""+s:"generic")]})}},79958:function(e,t,s){var r=s(57437);let a=(0,s(92767).j)("focus:border-cyan-500 p-2 drop-shadow min-h-[50px] placeholder:text-gray-200 w-full border-gray-600 border-[3px] text-gray-900 text-center text-xl sm:text-4xl font-bold rounded-lg w-content outline-none",{variants:{error:{true:"border-red-500 focus:border-red-500 bg-red-50 focus:bg-red-50"}}});t.Z=e=>{let{name:t,value:s,error:n,onChange:l,onFocus:i,disabled:o}=e;return(0,r.jsx)("div",{"data-cy":"licensePlateInput",className:"relative bg-white w-full md:w-fit before:border before:border-gray-200 shadow p-0.5 border border-gray-300 rounded-xl before:w-3 before:h-3 before:z-50 before:absolute before:top-1/2 before:-translate-y-1/2 before:rounded-full before:left-5 before:shadow after:w-3 after:h-3 after:shadow after:absolute after:top-1/2 after:-translate-y-1/2 after:rounded-full after:right-5 ",children:(0,r.jsx)("input",{lang:"ko",name:t,disabled:o,value:s,onFocus:i,onChange:e=>(e.target.value=e.target.value.replace(/\s/g,""),l(e)),placeholder:"123ìº1234",className:a({error:n})})})}},30532:function(e,t,s){s.d(t,{Z:function(){return G}});var r=s(57437),a=s(36351),n=s(5037),l=s(77314),i=s(67505),o=s(14576),c=s(61428),d=s(2751),u=s(42357),p=s(5305);let g=(e,t)=>{let s=e.trim();if(!/^\d+$/.test(s))return null;let r=parseInt(s,10);return Number.isFinite(r)?"ten-thousand-won"===t?1e4*r:r:null},h=e=>{let{licensePlate:t,priceInput:s,priceUnit:r}=e,a=t.trim(),n=s.trim(),l=g(n,r);return!p.N3.test(a)||0===n.length||"ten-thousand-won"===r&&n.length>5||null===l||l<1e5?null:{licensePlate:a,price:l}},x=e=>{let t=h(e);return t?((0,u.G5)(t),!0):((0,u.Xt)(),!1)};var f=s(94508),m=s(76865),v=s(30401),b=s(32489),y=s(80605),w=s(38588),j=s(33145),N=s(99376),k=s(2265),P=s(5045),C=s(10950),S=s(46171),F=s(62869),I=s(79958),G=e=>{let{toggleSearch:t,licensePlate:s,reportSearchEvent:u,variant:g="modal",submitLabel:h,secondaryAction:G}=e,[R,Z]=(0,k.useState)({title:"ë§ì",value:0}),[W,z]=(0,k.useState)(!1),[D,L]=(0,k.useState)(!1),[E,B]=(0,k.useState)(!1),[U,V]=(0,k.useState)(!1),[Y,_]=(0,k.useState)(!1),{status:M}=(0,y.useSession)(),O="authenticated"===M,{mutate:A,isLoading:K,isError:T,error:$}=(0,o.Rx)(),{data:X,mutate:q}=(0,o.V0)(),{coinsLeft:H}=(0,i.FB)(O),J=(0,w.useTranslations)("licensePlateSearch"),Q=(0,w.useTranslations)("validationErrors"),ee=(0,N.useRouter)(),et=(0,N.usePathname)(),es=(0,N.useSearchParams)(),er=n.P.alertCircle,ea=n.P.chevronDown,en=n.P.chevronRight,el="inlineHero"===g,ei=()=>{null==t||t()},eo=()=>{u&&(0,P.N)(u)},ec=()=>{let e=es.toString();return e?"".concat(et,"?").concat(e):et},ed=(0,l.TA)({validateOnBlur:!1,validateOnChange:!1,initialValues:{licensePlate:s||"",price:""},validationSchema:p.aX,onSubmit:e=>{if("loading"===M)return;if(el&&e.price.trim().length>5){z(!0);return}if(!O){ee.push((0,c.S1)(ec()));return}if(!(0,d.H)(H,"report")){B(!0);return}let t={licensePlate:e.licensePlate,price:0===R.value?1e4*parseInt(e.price):parseInt(e.price)};if(t.price<1e5){z(!0);return}z(!1),q(t,{onSuccess:e=>{(null==e?void 0:e.exist)?L(!0):A(t,{onSuccess:()=>{eo(),ei()}})},onError:()=>{A(t,{onSuccess:()=>{eo(),ei()}})}})}}),eu=()=>{ed.resetForm({values:{licensePlate:"",price:""}}),Z({title:"ë§ì",value:0}),z(!1),L(!1),B(!1),V(!1),_(!1)},ep=()=>{if(el){eu();return}ei()},eg=()=>{D&&ep()},eh=ed.values.licensePlate.trim(),ex=eh.length>0,ef=ex&&p.N3.test(eh),em=()=>x({licensePlate:ed.values.licensePlate,priceInput:ed.values.price,priceUnit:0===R.value?"ten-thousand-won":"won"}),ev=e=>{if(e.preventDefault(),"loading"!==M){if(!O){em(),ee.push((0,c.S1)(ec()));return}if(!eh){alert("ì°¨ëë²í¸ë¥¼ ì
ë ¥í´ì£¼ì¸ì.");return}if(!ef){alert("ì í¨í ì°¨ëë²í¸ë¥¼ ì
ë ¥í´ì£¼ì¸ì.");return}if(!ed.values.price.trim()){alert("í매ê°ê²©ì ì
ë ¥í´ì£¼ì¸ì.");return}
1ed.submitForm()}};return(0,r.jsxs)("form",{className:el?"w-full max-w-[320px] space-y-3 lg:max-w-[480px]":"space-y-5",onSubmit:e=>{if(el){ev(e);return}ed.handleSubmit(e)},children:[(0,r.jsx)("div",{className:el?"space-y-2":"space-y-3",children:(0,r.jsxs)("div",{className:el?"w-full space-y-2 bg-white p-5 lg:px-20":"space-y-3",children:[(0,r.jsxs)("div",{className:el?"flex h-11 items-center gap-[9px] lg:gap-4":"contents",children:[el?(0,r.jsx)("label",{className:"w-[56px] shrink-0 text-[14px] font-bold leading-5 text-black lg:w-[72px]",children:J("licensePlate")}):null,el?(0,r.jsxs)("div",{className:"relative h-11 min-w-0 flex-1",children:[(0,r.jsx)("input",{lang:"ko",disabled:K,value:ed.values.licensePlate,name:"licensePlate",onChange:e=>{e.target.value=e.target.value.replace(/\s/g,""),ed.handleChange(e)},onFocus:()=>{eg(),V(!0)},onBlur:()=>V(!1),placeholder:U?"":"123ìº1234",className:(0,f.cn)("h-full w-full rounded-[8px] border-0 bg-[#f1f5f9] px-4 text-center text-[24px] font-bold leading-8 text-black outline-none placeholder:text-black/20 disabled:opacity-60",ed.values.licensePlate?"pr-14":"")}),(e=>{let{hasError:t,isValid:s,value:a,onClear:n}=e;return a||t?(0,r.jsxs)("div",{className:"absolute right-3 top-1/2 flex -translate-y-1/2 items-center gap-2",children:[t?(0,r.jsx)(m.Z,{"aria-hidden":"true",className:"h-5 w-5 text-[#ef3333]",strokeWidth:2.25}):s?(0,r.jsx)(v.Z,{"aria-hidden":"true",className:"h-5 w-5 text-[#18b2a8]",strokeWidth:3}):null,a?(0,r.jsx)("button",{"aria-label":"ì
ë ¥ê° ì§ì°ê¸°",className:"flex h-4 w-4 items-center justify-center rounded-full bg-[#a9b3bf] text-white",type:"button",onClick:n,children:(0,r.jsx)(b.Z,{className:"h-3 w-3",strokeWidth:3})}):null]}):null})({hasError:ex&&!ef,isValid:ef,value:ed.values.licensePlate,onClear:()=>{eg(),ed.setFieldValue("licensePlate","")}})]}):(0,r.jsx)(I.Z,{disabled:K,value:ed.values.licensePlate,name:"licensePlate",onChange:ed.handleChange,onFocus:eg,error:ed.touched.licensePlate&&!!ed.errors.licensePlate})]}),!el&&(ed.errors.licensePlate||T)?T?(0,r.jsx)(S.Z,{code:null==$?void 0:$.code}):(0,r.jsxs)("p",{"data-cy":"invalidLicensePlate",className:"text-xs font-bold text-red-500 flex items-center gap-1",children:[(0,r.jsx)(er,{size:15})," ",Q(ed.errors.licensePlate)]}):null,(0,r.jsxs)("div",{className:el?"flex h-11 items-center gap-[9px] lg:gap-4":"contents",children:[el?(0,r.jsx)("label",{className:"w-[56px] shrink-0 text-[14px] font-bold leading-5 text-black lg:w-[72px]",children:J("sellingPrice")}):null,(()=>{if(el){let e=ed.values.price.length>0;return(0,r.jsxs)("div",{className:"relative h-11 min-w-0 flex-1 rounded-[8px] bg-[#f1f5f9]",children:[(0,r.jsxs)("div",{className:(0,f.cn)("flex h-full items-center",e?"justify-center pl-4 pr-10":""),children:[(0,r.jsx)("input",{value:ed.values.price,onChange:e=>{z(!1),ed.setFieldValue("price",e.target.value.replace(/\D/g,""))},onKeyDown:e=>{1!==e.key.length||/^\d$/.test(e.key)||e.metaKey||e.ctrlKey||e.altKey||e.preventDefault()},onPaste:e=>{let t=e.clipboardData.getData("text");/^\d*$/.test(t)||e.preventDefault()},onFocus:()=>{eg(),_(!0)},onBlur:()=>_(!1),placeholder:Y?"":J("placeholder"),type:"text",pattern:"\\d*",name:"price",inputMode:"numeric",className:(0,f.cn)("h-full border-0 bg-transparent text-[24px] font-bold leading-8 text-black outline-none placeholder:text-black/20 focus:outline-none focus:ring-0 focus:ring-offset-0 focus:shadow-none",e?"min-w-[1ch] max-w-[9ch] p-0 text-right":"w-full px-4 text-center"),style:e?{width:"".concat(Math.min(Math.max(ed.values.price.length,1),9),"ch")}:void 0,maxLength:5}),e?(0,r.jsx)("span",{className:"ml-1 shrink-0 text-[20px] font-bold leading-7 text-black",children:"ë§ì"}):null]}),e?(0,r.jsx)("button",{"aria-label":"ì
ë ¥ê° ì§ì°ê¸°",className:"absolute right-3 top-1/2 flex h-4 w-4 -translate-y-1/2 items-center justify-center rounded-full bg-[#a9b3bf] text-white",type:"button",onClick:()=>{eg(),z(!1),ed.setFieldValue("price","")},children:(0,r.jsx)(b.Z,{className:"h-3 w-3",strokeWidth:3})}):null]})}return(0,r.jsxs)("div",{id:"price",className:(0,f.cn)("w-full gap-1 h-14 flex",ed.errors.price?"border-red-500":""),children:[(0,r.jsx)("input",{value:ed.values.price,onChange:ed.handleChange,onFocus:eg,placeholder:J("price"),type:"text",pattern:"\\d*",name:"price",inputMode:"numeric",className:"font-bold placeholder:text-gray-400/50 placeholder:font-normal placeholder:text-lg w-2/3 text-slate-700 text-2xl flex-1 h-full border border-slate-200 bg-slate-100 text-right rounded",maxLength:0===R.value?5:9}),(0,r.jsx)("div",{className:"h-full text-slate-500 font-semibold bg-slate-100 gap-2 flex justify-between",children:(0,r.jsx)("div",{className:"relative flex items-center p-3 w-full border border-slate-200 rounded",children:(0,r.jsxs)(a.R,{onChange:Z,children:[(0,r.jsxs)(a.R.Button,{className:"w-full text-left text-lg flex justify-between items-center",children:[R.title," ",(0,r.jsx)(ea,{size:20})]}),(0,r.jsxs)(a.R.Options,{className:"cursor-pointer absolute top-full left-0 bg-white w-full border border-slate-200 rounded",children:[(0,r.jsx)(a.R.Option,{className:"p-2 hover:bg-slate-100",value:{title:"ë§ì",value:0},children:"ë§ì"}),(0,r.jsx)(a.R.Option,{className:"p-2 hover:bg-slate-100",value:{title:"ì",value:1},children:"ì"})]})]})})})]})})()]}),!el&&(W||ed.errors.price)?(0,r.jsxs)("p",{className:"text-red-500 text-sm flex items-center gap-1","data-cy":"invalidPrice",children:[(0,r.jsx)(er,{size:15}),W?J("priceError"):Q(ed.errors.price)]}):null]})}),D?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex gap-3 items-center",children:[(0,r.jsx)(er,{className:"text-red-500"}),(0,r.jsx)("p",{className:"text-sm text-red-500",children:J("exists")})]}),(0,r.jsxs)("div",{className:"flex gap-5",children:[(0,r.jsx)(F.Z,{type:"button",onClick:ep,intent:"outlinedGray",size:"md",fullWidth:!0,children:J("decline")}),(0,r.jsx)(F.Z,{type:"button",onClick:()=>ee.push("/report/"+X.requestId),intent:"primary",size:"md",fullWidth:!0,children:J("confirm")})]})]}):(null==$?void 0:$.code)==30?(0,r.jsxs)("div",{className:"flex gap-5",children:[(0,r.jsx)(F.Z,{type:"button",onClick:ei,intent:"outlinedGray",size:"md",fullWidth:!0,children:J("decline")}),(0,r.jsx)(F.Z,{type:"button",onClick:()=>{A({licensePlate:ed.values.licensePlate,price:0===R.value?1e4*parseInt(ed.values.price):parseInt(ed.values.price)},{onSuccess:eo})},intent:"primary",size:"md",fullWidth:!0,children:J("confirm")})]}):E?(0,r.jsxs)("div",{"data-cy":"noBalanceAlert",className:(0,f.cn)("space-y-5",el?"space-y-3"
1:""),children:[(0,r.jsx)(S.Z,{code:1,className:el?"items-start text-[12px] font-semibold leading-5 text-red-500":""}),(0,r.jsxs)("div",{className:(0,f.cn)("flex gap-5",el?"gap-2":""),children:[(0,r.jsx)(F.Z,{type:"button",onClick:()=>B(!1),intent:el?"white":"outlinedGray",size:el?void 0:"md",fullWidth:!0,className:el?"h-11 min-w-0 rounded-[8px] border border-[#CBD5E1] bg-white px-2 py-0 text-[15px] font-semibold leading-5 text-[#4E5567] hover:bg-[#F8FAFC] hover:text-[#0F172A]":"",children:"ì·¨ì"}),(0,r.jsx)(F.Z,{type:"button",intent:el?"blue":"primary",size:el?void 0:"md",fullWidth:!0,onClick:()=>{if(!em()){B(!1),z(!0);return}ei(),ee.push("/buy-items")},"data-cy":"buyItemsLink",className:el?"h-11 min-w-0 rounded-[8px] bg-blue-500 px-2 py-0 text-[15px] font-semibold leading-5 text-white hover:bg-blue-600":"",children:"íì¸"})]})]}):(0,r.jsxs)("div",{className:el?"grid grid-cols-2 gap-2":void 0,children:[el?G:null,(0,r.jsxs)(F.Z,{type:"submit",size:el?void 0:"md",fullWidth:!0,intent:el?"blue":"primary","data-cy":"submitReport",disabled:"loading"===M||K,className:(0,f.cn)(el?"h-11 min-w-0 rounded-[8px] bg-blue-500 px-2 py-0 text-[15px] font-semibold leading-5 text-white hover:bg-blue-600 lg:px-5":""),children:[h||J("runReport"),el?(0,r.jsx)(en,{className:"h-4 w-4"}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(j.default,{className:"block shrink-0",alt:"Candr point",src:C.SD.candrPoint,width:20,height:20}),"10"]})]})]})]})}},61428:function(e,t,s){s.d(t,{Be:function(){return u},PW:function(){return c},S1:function(){return d},eX:function(){return o}});let r="/reports",a=new Set(["/login","/join"]),n="https://internal.invalid",l=e=>{try{return new URL(e,n).pathname.replace(/\/+$/,"")}catch(e){return""}},i=e=>{let t=null==e?void 0:e.trim();if(!t||t.startsWith("//"))return r;if(/^https?:\/\//i.test(t))try{let e=new URL(t);return"".concat(e.pathname).concat(e.search).concat(e.hash)||r}catch(e){return r}return t.startsWith("/")?t:r},o=e=>{let t=i(e),s=l(t);if("/join"===s){let e=i(new URL(t,n).searchParams.get("callbackUrl")),s=l(e);return a.has(s)?r:e}return a.has(s)?r:t},c=(e,t)=>{let s=null==t?void 0:t.trim();return s?"".concat(e,"?callbackUrl=").concat(encodeURIComponent(s)):e},d=e=>c("/join",e),u=e=>c("/login",e)},5045:function(e,t,s){s.d(t,{N:function(){return r}});function r(e,t){var s;null===(s=window.dataLayer)||void 0===s||s.push({event:e,...t})}},10950:function(e,t,s){s.d(t,{Mh:function(){return l},SD:function(){return a},Wq:function(){return n},l5:function(){return r}});let r={accidents:"/assets/icons/report/accidentsFilled.svg",accidentsRealistic:"/assets/icons/report/accidentsRealistic.svg",aiIcon:"/assets/icons/report/ai.svg",blackouts:"/assets/icons/report/blackoutFilled.svg",caution:"/assets/icons/report/caution.svg",changes:"/assets/icons/report/changesFilled.svg",damage:"/assets/icons/report/damageFilled.svg",flood:"/assets/icons/report/floodIcon.svg",floodGray:"/assets/icons/report/floodIconGray.svg",good:"/assets/icons/report/good.svg",government:"/assets/icons/report/governmentIcon.svg",governmentGray:"/assets/icons/report/governmentIconGray.svg",magnifyingGlass:"/assets/icons/report/magnifyingGlass.svg",ownerCalendar:"/assets/icons/report/ownerCalendar.svg",ownerChange:"/assets/icons/report/ownerChange.svg",ownerGray:"/assets/icons/report/ownersGray.svg",ownerGreen:"/assets/icons/report/ownersGreen.svg",ownerRed:"/assets/icons/report/ownersRed.svg",ownerYellow:"/assets/icons/report/ownersYellow.svg",owners:"/assets/icons/report/ownersFilled.svg",plateChange:"/assets/icons/report/plateChange.svg",repair:"/assets/icons/report/repairsFilled.svg",rental:"/assets/icons/report/rentalIcon.svg",rentalGray:"/assets/icons/report/rentalIconGray.svg",reportResult:"/assets/icons/report/reportResult.svg",robot:"/assets/icons/report/robot.svg",sparkle:"/assets/icons/report/sparkle.svg",taxi:"/assets/icons/report/taxiIcon.svg",taxiGray:"/assets/icons/report/taxiIconGray.svg",totalLoss:"/assets/icons/report/totalLossIcon.svg",totalLossGray:"/assets/icons/report/totalLossIconGray.svg",warning:"/assets/icons/report/warning.svg"},a={logoDark:"/assets/logos/logo-gray-cyan.svg",candrPoint:"/assets/icons/candrPoint.png"},n={top:"/assets/images/report/car-top.png",side:"/assets/images/report/car-left.png",inner:"/assets/images/report/car-inside.png",topY:"/assets/images/report/car-top-y.png",leftY:"/assets/images/report/car-left-y.png",rightY:"/assets/images/report/car-right-y.png",innerY:"/assets/images/report/car-inside-y.png",allParts:"/assets/images/dreport/carplane_bg_v2.png"},l={kakaoPay:"/assets/brands/kakaoPaySmall.png",naver:"/assets/brands/naver.png",kgInicis:"/assets/brands/kg-inicis.svg",tossPayments:"/assets/brands/toss-payments.svg"}}}]);
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.