1import{j as o,y as ee,V as k,S as oe,T as i,B as n,H as S,K as _,b as H,J as re,L as te,F as v,f as ne}from"./vendor-chakra-CUBmpbUu.js";import{u as ie,r as d}from"./vendor-react-VBNpZeLZ.js";import{S as B}from"./SubPageLayout-nIlpZHjn.js";import{u as se}from"./useKeyboardHeight-CVpm21Km.js";import{m as a,t as h,l as le,z as E,s as x,n as s,A as p,o as ae,H as g}from"./index-ovY1Yr_X.js";import{P as I,R as P,a as M,A as ce,B as de,L as ue}from"./realEstateCalcData-y2RO55ik.js";import{g as pe}from"./dataProvider-8KrkFTg3.js";function he(R){const m=[],j={apt_under85:{propertyTypes:["RER001","RER002"],isOver85:!1},apt_over85:{propertyTypes:["RER001","RER002"],isOver85:!0},commercial:{propertyTypes:["RER003"]},farm_general:{propertyTypes:["RER004"],farmlandReduction:"1"},farm_self:{propertyTypes:["RER004"],farmlandReduction:"2"},land_other:{propertyTypes:["RER005"]}};return R.filter(u=>u.isActive&&u.dataType==="acquisition_tax").forEach(u=>{const e=j[u.subType];if(!e)return;const l=u.rate,C=e.isOver85,y=Number((l*.1).toFixed(2)),b=C===!0||["RER003","RER005"].some(f=>e.propertyTypes.includes(f))?.2:0;e.propertyTypes.forEach(f=>{m.push({registrationType:"QRT001",propertyType:f,isOver85:e.isOver85,farmlandReduction:e.farmlandReduction,minAmount:u.minAmount??void 0,maxAmount:u.maxAmount,acquisitionTaxRate:l,localEducationTaxRate:y,ruralSpecialTaxRate:b})})}),m}function xe(R){if(R===0)return"";const m=["","ë§","ìµ","ì¡°","ê²½"],j=["","ì¼","ì´","ì¼","ì¬","ì¤","ì¡","ì¹ ","í","구"],u=["","ì","ë°±","ì²"];let e="",l=0;for(;R>0;){const C=R%1e4;if(C>0){let y="",b=C,f=0;for(;b>0;){const z=b%10;z>0&&(y=(z===1&&f>0?"":j[z])+u[f]+y),b=Math.floor(b/10),f++}e=y+m[l]+e}R=Math.floor(R/1e4),l++}return e+"ì"}const Re={RER001:{label:"íì¸í기 (pcë¡ íì¸ê°ë¥)",url:"https://www.realtyprice.kr/notice/main/mainBody.htm",isLink:!0},RER002:{label:"íì¸í기 (pcë¡ íì¸ê°ë¥)",url:"https://www.realtyprice.kr/notice/main/mainBody.htm",isLink:!0},RER003:{label:"ë¶ëì° ìì¬ì§ ì,êµ°,구ì²ì 문ìí기",url:"",isLink:!1},RER004:{label:"íì¸í기 (pcë¡ íì¸ê°ë¥)",url:"https://www.realtyprice.kr/notice/main/mainBody.htm",isLink:!0},RER005:{label:"íì¸í기 (pcë¡ íì¸ê°ë¥)",url:"https://www.realtyprice.kr/notice/main/mainBody.htm",isLink:!0}},we=()=>{const R=ie(),m=se(),j=P[0].value,u=I[j]?.[0]?.value||"",[e,l]=d.useState({registrationType:j,propertyType:u,transactionAmount:"",isOver85:!1,houseCountType:"under3",lotCount:"1",farmlandReduction:"1",noHouseReduction:"2",bondRatio:"100"}),[C,y]=d.useState(M),[b,f]=d.useState(!0);d.useEffect(()=>{(async()=>{try{const t=await pe("/extif/getCalcConfig.do?calcType=real_estate");if(t.data.result==="true"&&t.data.configList){const c=he(t.data.configList),w=M.filter(T=>T.registrationType!=="QRT001"),W=[...c,...w];y(W)}}catch{}finally{f(!1)}})()},[]);const z=d.useMemo(()=>I[e.registrationType]||[],[e.registrationType]),Q=d.useMemo(()=>ce[e.registrationType]||"ê±°ëê¸ì¡",[e.registrationType]),N=d.useMemo(()=>{const{registrationType:r,propertyType:t}=e;return r==="QRT001"&&(t==="RER001"||t==="RER002")||r==="QRT004"&&(t==="RER001"||t==="RER002")||r==="QRT005"&&(t==="RER001"||t==="RER002")},[e.registrationType,e.propertyType]),D=d.useMemo(()=>{const{registrationType:r,propertyType:t}=e;return r==="QRT001"&&(t==="RER001"||t==="RER002")},[e.registrationType,e.propertyType]),V=d.useMemo(()=>e.registrationType==="QRT003",[e.registrationType]),K=d.useMemo(()=>{const{registrationType:r,propertyType:t}=e;return r==="QRT001"?t==="RER002"||t==="RER004"||t==="RER005":r==="QRT002"?!1:r==="QRT003"?t==="RER002"||t==="RER003"||t==="RER004"||t==="RER005":r==="QRT004"||r==="QRT005"?t==="RER002"||t==="RER004"||t==="RER005":!1},[e.registrationType,e.propertyType]),F=d.useMemo(()=>{const{registrationType:r,propertyType:t}=e;return["QRT001","QRT004","QRT005"].includes(r)&&t==="RER004"},[e.registrationType,e.propertyType]),U=d.useMemo(()=>{const{registrationType:r,propertyType:t}=e;return r==="QRT005"&&(t==="RER001"||t==="RER002")},[e.registrationType,e.propertyType]),Y=d.useMemo(()=>{const{registrationType:r,propertyType:t}=e;return(r==="QRT004"||r==="QRT005")&&t!==""},[e.registrationType,e.propertyType]),L=d.useRef(null),q=r=>{const t=r.target,c=t.value,w=t.selectionStart||0,W=c.replace(/[^0-9]/g,"");if(W.length>11)return;
1const T=W?Number(W).toLocaleString("ko-KR"):"",X=(e.transactionAmount.slice(0,w).match(/,/g)||[]).length,Z=(T.slice(0,w+(T.length-c.length+1)).match(/,/g)||[]).length;l({...e,transactionAmount:T}),setTimeout(()=>{if(L.current){let A=w+(Z-X);c.endsWith("ì")&&w>=c.length-1&&(A=T.length),A=Math.max(0,Math.min(A,T.length)),L.current.setSelectionRange(A,A)}},0)},$=r=>{const t=I[r]?.[0]?.value||"";l({...e,registrationType:r,propertyType:t,isOver85:!1,houseCountType:"under3",lotCount:"1",farmlandReduction:"1",noHouseReduction:"2",bondRatio:"100"})},G=r=>{l({...e,propertyType:r,isOver85:!1,houseCountType:"under3",lotCount:"1",farmlandReduction:"1",noHouseReduction:"2"})},J=()=>{if(!e.registrationType||!e.propertyType||!e.transactionAmount){alert("íì í목ì 모ë ì
ë ¥í´ì£¼ì¸ì.");return}const r=Number(e.transactionAmount.replace(/,/g,""));R("/calculator/property/result",{state:{...e,amount:r,lotCount:Number(e.lotCount),bondRatio:Number(e.bondRatio),rateTable:C}})},O=e.propertyType?Re[e.propertyType]:null;return b?o.jsx(B,{title:"ë¶ëì°ë±ê¸°ë¹ì© ê³ì°ê¸°",children:o.jsx(ee,{h:"300px",children:o.jsxs(k,{children:[o.jsx(oe,{size:"lg",color:a}),o.jsx(i,{color:h,mt:4,children:"ì¤ì ì ë¶ë¬ì¤ë ì¤..."})]})})}):o.jsx(B,{title:"ë¶ëì°ë±ê¸°ë¹ì© ê³ì°ê¸°",children:o.jsxs(n,{p:4,pb:m>0?`${m}px`:4,children:[o.jsx(n,{bg:le,borderRadius:"lg",p:4,mb:6,children:o.jsx(i,{fontSize:"sm",color:E,children:"ë¹¨ê° ì²´í¬íë íìì
ë ¥ì¬íì
ëë¤."})}),o.jsxs(k,{spacing:5,align:"stretch",children:[o.jsxs(n,{children:[o.jsxs(S,{mb:2,align:"flex-start",children:[o.jsx(i,{fontSize:"sm",fontWeight:"bold",color:x,children:"ë±ê¸° ì¢
ë¥"}),o.jsx(i,{color:E,fontSize:"xs",mt:"-2px",children:"*"})]}),o.jsx(_,{value:e.registrationType,onChange:r=>$(r.target.value),bg:"white",borderColor:s,borderRadius:"lg",size:"lg",fontSize:"14px",icon:o.jsx(H,{src:"/icons/icon_arrow_down.svg"}),iconSize:"12px",children:P.map(r=>o.jsx("option",{value:r.value,children:r.label},r.value))})]}),o.jsxs(n,{children:[o.jsxs(S,{mb:2,align:"flex-start",children:[o.jsx(i,{fontSize:"sm",fontWeight:"bold",color:x,children:"ë¶ëì° ì¢
ë¥"}),o.jsx(i,{color:E,fontSize:"xs",mt:"-2px",children:"*"})]}),o.jsx(_,{value:e.propertyType,onChange:r=>G(r.target.value),bg:"white",borderColor:s,borderRadius:"lg",size:"lg",fontSize:"14px",isDisabled:!e.registrationType,icon:o.jsx(H,{src:"/icons/icon_arrow_down.svg"}),iconSize:"12px",children:z.map(r=>o.jsx("option",{value:r.value,children:r.label},r.value))})]}),o.jsxs(n,{children:[o.jsxs(S,{mb:2,align:"flex-start",children:[o.jsx(i,{fontSize:"sm",fontWeight:"bold",color:x,children:Q}),o.jsx(i,{color:E,fontSize:"xs",mt:"-2px",children:"*"})]}),o.jsx(re,{ref:L,placeholder:"ì: 100,000,000",value:e.transactionAmount?`${e.transactionAmount}ì`:"",onChange:q,onSelect:r=>{const t=r.target,c=e.transactionAmount.length;t.selectionStart!==null&&t.selectionStart>c&&t.setSelectionRange(c,c)},onClick:r=>{const t=r.target,c=e.transactionAmount.length;t.selectionStart!==null&&t.selectionStart>c&&t.setSelectionRange(c,c)},bg:"white",borderColor:s,borderRadius:"lg",size:"lg",fontSize:"14px",inputMode:"numeric",_focus:{borderColor:a}}),e.transactionAmount&&o.jsx(i,{fontSize:"sm",color:p,mt:2,textAlign:"right",children:xe(Number(e.transactionAmount.replace(/,/g,"")))})]}),Y&&O&&o.jsxs(n,{children:[o.jsx(i,{fontSize:"sm",fontWeight:"bold",color:x,mb:2,children:"ê³µìì§ê°íì¸"}),O.isLink?o.jsx(n,{p:4,borderRadius:"lg",borderWidth:"1px",borderColor:s,bg:"white",children:o.jsx(te,{href:O.url,isExternal:!0,color:p,fontSize:"sm",textDecoration:"underline",children:O.label})}):o.jsxs(i,{fontSize:"sm",color:ae,fontStyle:"italic",children:["â» ",O.label]})]}),D&&o.jsxs(n,{children:[o.jsxs(S,{mb:2,align:"flex-start",children:[o.jsx(i,{fontSize:"sm",fontWeight:"bold",color:x,children:"ë³´ì 주íì"}),o.jsx(i,{color:E,fontSize:"xs",mt:"-2px",children:"*"})]}),o.jsxs(S,{spacing:3,children:[o.jsx(n,{flex:1,p:4,borderRadius:"lg",borderWidth:"1px",borderColor:e.houseCountType==="under3"?a:s,bg:e.houseCountType==="under3"?g:"white",cursor:"pointer",onClick:()=>l({...e,houseCountType:"under3"}),textAlign:"center",children:o.jsx(i,{fontSize:"14px",color:e.houseCountType==="under3"?p:h,fontWeight:e.houseCountType==="under3"?"bold":"normal",children:"1~2주í"})}),o.jsx(n,{flex:1,p:4,borderRadius:"lg",borderWidth:"1px",borderColor:e.houseCountType==="three"?a:s,bg:e.houseCountType==="three"?g:"white",cursor:"pointer",onClick:()=>l({...e,houseCountType:"three"}),textAlign:"center",children:o.jsx(i,{fontSize:"14px",color:e.houseCountType==="three"?p:h,fontWeight:e.houseCountType==="three"?"bold":"normal",children:"3주í"})}),o.jsx(n,{flex:1,p:4,borderRadius:"lg",borderWidth:"1px",borderColor:e.houseCountType==="over4"?a:s,bg:e.houseCountType==="over4"?g:"white",cursor:"pointer",onClick:()=>l({...e,houseCountType:"over4"}),textAlign:"center",children:o.jsx(i,{fontSize:"14px",color:e.houseCountType==="over4"?p:h,fontWeight:e.houseCountType==="over4"?"bold":"normal",children:"4주í ì´ì"})})]})]}),N&&o.jsxs(n,{children:[o.jsxs(S,{mb:2,align:"flex-start",children:[o.jsx(i,{fontSize:"sm",fontWeight:"bold",color:x,children:"ì ì©ë©´ì "}),o.jsx(i,{color:E,fontSize:"xs",mt:"-2px",children:"*"})]}),o.jsxs(k,{spacing:2,align:"stretch",children:[o.jsx(n,{p:4,borderRadius:"lg",borderWidth:"1px",borderColor:e.isOver85?s:a,bg:e.isOver85?"white":g,cursor:"pointer",onClick:()=>l({...e,isOver85:!1}),children:o.jsxs(v,{justify:"space-between",align:"center",children:[o.jsx(i,{fontSize:"14px",color:e.isOver85?h:p,fontWeight:e.isOver85?"normal":"bold",children:"ì ì©ë©´ì 85ã¡ ì´í"}),o.jsx(n,{w:"20px",h:"20px",borderRadius:"full",bg:e.isOver85?"white":a,borderWidth:e.isOver85?"1px":"0",borderColor:s,display:"flex",alignItems:"center",justifyContent:"center",children:!e.isOver85&&o.jsx(n,{w:"8px",h:"8px",borderRadius:"full",bg:"white"})})]})}),o.jsx(n,{p:4,borderRadius:"lg",borderWidth:"1px",borderColor:e.isOver85?a:s,bg:e.isOver85?g
1:"white",cursor:"pointer",onClick:()=>l({...e,isOver85:!0}),children:o.jsxs(v,{justify:"space-between",align:"center",children:[o.jsx(i,{fontSize:"14px",color:e.isOver85?p:h,fontWeight:e.isOver85?"bold":"normal",children:"ì ì©ë©´ì 85ã¡ ì´ê³¼"}),o.jsx(n,{w:"20px",h:"20px",borderRadius:"full",bg:e.isOver85?a:"white",borderWidth:e.isOver85?"0":"1px",borderColor:s,display:"flex",alignItems:"center",justifyContent:"center",children:e.isOver85&&o.jsx(n,{w:"8px",h:"8px",borderRadius:"full",bg:"white"})})]})})]})]}),V&&o.jsxs(n,{children:[o.jsx(i,{fontSize:"sm",fontWeight:"bold",color:x,mb:2,children:"ì±ê¶ìµê³ ì¡"}),o.jsx(_,{value:e.bondRatio,onChange:r=>l({...e,bondRatio:r.target.value}),bg:"white",borderColor:s,borderRadius:"lg",size:"lg",fontSize:"14px",icon:o.jsx(H,{src:"/icons/icon_arrow_down.svg"}),iconSize:"12px",children:de.map(r=>o.jsx("option",{value:r.value,children:r.label},r.value))})]}),K&&o.jsxs(n,{children:[o.jsx(i,{fontSize:"sm",fontWeight:"bold",color:x,mb:2,children:"íì§ ì"}),o.jsx(_,{value:e.lotCount,onChange:r=>l({...e,lotCount:r.target.value}),bg:"white",borderColor:s,borderRadius:"lg",size:"lg",fontSize:"14px",icon:o.jsx(H,{src:"/icons/icon_arrow_down.svg"}),iconSize:"12px",children:ue.map(r=>o.jsx("option",{value:r.value,children:r.label},r.value))})]}),F&&o.jsxs(n,{children:[o.jsx(i,{fontSize:"sm",fontWeight:"bold",color:x,mb:2,children:"ê°ë©´ì¡°í"}),o.jsxs(k,{spacing:2,align:"stretch",children:[o.jsx(n,{p:4,borderRadius:"lg",borderWidth:"1px",borderColor:e.farmlandReduction==="2"?a:s,bg:e.farmlandReduction==="2"?g:"white",cursor:"pointer",onClick:()=>l({...e,farmlandReduction:"2"}),children:o.jsxs(v,{justify:"space-between",align:"center",children:[o.jsx(i,{fontSize:"14px",color:e.farmlandReduction==="2"?p:h,fontWeight:e.farmlandReduction==="2"?"bold":"normal",children:"ëì§ìë¶ 2ë
ì´ì ë³´ì "}),o.jsx(n,{w:"20px",h:"20px",borderRadius:"full",bg:e.farmlandReduction==="2"?a:"white",borderWidth:e.farmlandReduction==="2"?"0":"1px",borderColor:s,display:"flex",alignItems:"center",justifyContent:"center",children:e.farmlandReduction==="2"&&o.jsx(n,{w:"8px",h:"8px",borderRadius:"full",bg:"white"})})]})}),o.jsx(n,{p:4,borderRadius:"lg",borderWidth:"1px",borderColor:e.farmlandReduction==="1"?a:s,bg:e.farmlandReduction==="1"?g:"white",cursor:"pointer",onClick:()=>l({...e,farmlandReduction:"1"}),children:o.jsxs(v,{justify:"space-between",align:"center",children:[o.jsx(i,{fontSize:"14px",color:e.farmlandReduction==="1"?p:h,fontWeight:e.farmlandReduction==="1"?"bold":"normal",children:"ê°ë©´ì¬í ìì"}),o.jsx(n,{w:"20px",h:"20px",borderRadius:"full",bg:e.farmlandReduction==="1"?a:"white",borderWidth:e.farmlandReduction==="1"?"0":"1px",borderColor:s,display:"flex",alignItems:"center",justifyContent:"center",children:e.farmlandReduction==="1"&&o.jsx(n,{w:"8px",h:"8px",borderRadius:"full",bg:"white"})})]})})]})]}),U&&o.jsxs(n,{children:[o.jsx(i,{fontSize:"sm",fontWeight:"bold",color:x,mb:2,children:"무주íì ê°ë©´"}),o.jsxs(k,{spacing:2,align:"stretch",children:[o.jsx(n,{p:4,borderRadius:"lg",borderWidth:"1px",borderColor:e.noHouseReduction==="1"?a:s,bg:e.noHouseReduction==="1"?g:"white",cursor:"pointer",onClick:()=>l({...e,noHouseReduction:"1"}),children:o.jsxs(v,{justify:"space-between",align:"center",children:[o.jsx(i,{fontSize:"14px",color:e.noHouseReduction==="1"?p:h,fontWeight:e.noHouseReduction==="1"?"bold":"normal",children:"무주í"}),o.jsx(n,{w:"20px",h:"20px",borderRadius:"full",bg:e.noHouseReduction==="1"?a:"white",borderWidth:e.noHouseReduction==="1"?"0":"1px",borderColor:s,display:"flex",alignItems:"center",justifyContent:"center",children:e.noHouseReduction==="1"&&o.jsx(n,{w:"8px",h:"8px",borderRadius:"full",bg:"white"})})]})}),o.jsx(n,{p:4,borderRadius:"lg",borderWidth:"1px",borderColor:e.noHouseReduction==="2"?a:s,bg:e.noHouseReduction==="2"?g:"white",cursor:"pointer",onClick:()=>l({...e,noHouseReduction:"2"}),children:o.jsxs(v,{justify:"space-between",align:"center",children:[o.jsx(i,{fontSize:"14px",color:e.noHouseReduction==="2"?p:h,fontWeight:e.noHouseReduction==="2"?"bold":"normal",children:"1주í ì´ì"}),o.jsx(n,{w:"20px",h:"20px",borderRadius:"full",bg:e.noHouseReduction==="2"?a:"white",borderWidth:e.noHouseReduction==="2"?"0":"1px",borderColor:s,display:"flex",alignItems:"center",justifyContent:"center",children:e.noHouseReduction==="2"&&o.jsx(n,{w:"8px",h:"8px",borderRadius:"full",bg:"white"})})]})})]})]})]}),o.jsx(n,{mt:8,children:o.jsx(ne,{w:"100%",bg:a,color:"white",py:7,borderRadius:"lg",fontSize:"md",fontWeight:"bold",_hover:{opacity:.9},onClick:J,children:"ë¹ì©ê³ì°í기"})})]})})};export{we 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.