1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1086],{87865:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/payment/subscription",function(){return n(63494)}])},4566:function(e,t,n){"use strict";function isAnnualBilling(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e?.periodMonths===12}function isAllPassSubscriptionName(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return/ALL\s*PASS|ì¬í¨ì¤/i.test(e)}function isAnnualSubscription(e){return e?.isAnnual===!0}function getDisplayMonthlyPrice(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Number(e.periodMonths)||1;return t>1?Math.round(e.price/t):e.price}function getBillingOptionsFromResponse(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Array.isArray(e.billingOptions)?e.billingOptions:[]}function findSelectedBillingOption(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return e.find(e=>e.subscriptionId===t)}n.d(t,{Fv:function(){return getBillingOptionsFromResponse},NZ:function(){return isAllPassSubscriptionName},Su:function(){return findSelectedBillingOption},jv:function(){return i},k8:function(){return getDisplayMonthlyPrice},l$:function(){return isAnnualBilling},x$:function(){return isAnnualSubscription}});let i="ì ì í ë¤ì ìëí´ì£¼ì¸ì. ê²°ì 주기 ìµì
ë³ê²½ ëì¤ ì¤ë¥ê° ë°ìíì´ì."},17328:function(e,t,n){"use strict";n.d(t,{Z:function(){return DiscountCodeSelector}});var i=n(24246),s=n(27378),a=n(40245),r=n(9758),o=n(13793),l=n(78496),c=n.n(l),u=n(46283),d=n(20534),p=n(97898),h=n(7951),m=n(52673),f=n(18025),g=n(44411),b=n.n(g),x=n(38125),y=n(83922),C=n.n(y),N=n(41773);let P=["ì£¼ë¬¸ë¹ 1ê°ì íë¡ëª¨ì
ì½ë를 ì
ë ¥í ì ìì¼ë©°, ì¿ í°ê³¼ ì¤ë³µì¬ì©ì´ ë¶ê°í´ì.","[1íê¶] í°ì¼ì íë²ì ì¬ë¬ì¥ 구매í ê²½ì°, í°ì¼ 1ì¥ìë§ í ì¸ì´ ì ì©ë¼ì.","[ì 기구ë
] ì°ìë ííì ë°ì ê²½ì°, ì¤ê° 구ë
í´ì§ ì ëì´ì ííì ë°ì ì ìì´ì."];function DiscountCodeModal(e){let{open:t,initData:n,onOpenChange:s,onConfirm:a}=e;return(0,f.t)(t,()=>s(!1)),(0,i.jsx)(m.FP,{open:t,onOpenChange:s,disablePointerDismissal:!0,children:(0,i.jsxs)(m._d,{children:[(0,i.jsxs)(m.b1,{children:[(0,i.jsx)(m.fV,{children:"ì½ë ì ì©í기"}),(0,i.jsx)(m.QW,{})]}),(0,i.jsx)(DiscountCodeContent,{initData:n,onConfirm:a})]})})}function DiscountCodeContent(e){let{initData:t,onConfirm:n}=e,[l,h]=(0,u.P)(()=>(function(e){let{promotionCode:t,promotionId:n,promotionTitle:i,promotionPutType:s,promotionApplyType:a,endDate:r,round:o,discountPrice:l,plateNum:c}=e;return{code:"",error:null,plateNum:c,promotionCode:t,promotionId:n,promotionTitle:i,promotionPutType:s,promotionApplyType:a,endDate:r,round:o,discountPrice:l}})(t)),f=(0,N.ml)("availablePromotionCode"),g=(0,s.useCallback)(async()=>{let{code:e}=await h();if(!e){h({error:{code:"",message:"ì½ë를 ì
ë ¥í´ì£¼ì¸ì"}});return}let n=function(e,t){let{hasPromotion:n}=t;return n&&/^[A-Z0-9ê°-í£_\-+%]{5,16}$/.test(e)&&!/^A[A-Z0-9]{11}[A-Z]{1}$/.test(e)?"promotionCode":""}(e,t);if("promotionCode"===n&&t.hasPromotion){let n=await availablePromotionCode(f,{reservationId:t.reservationId,promotionCode:e});h(n)}else h({error:{code:e,message:"ì
ë ¥íì ì½ëê° ë§ëì§ ë¤ì í ë² íì¸í´ 주ì¸ì"}})},[t,f,h]),b=(0,s.useCallback)(e=>{let t=e.target.value;h(n=>({...n,[e.target.name]:t,error:t?n.error:null}))},[h]),x=(0,s.useCallback)(e=>{h({code:"",error:null})},[h]),y=(0,s.useCallback)(()=>{h({promotionId:"",promotionCode:"",promotionTitle:"",promotionPutType:"",promotionApplyType:"",endDate:"",round:0,discountPrice:0,plateNum:"",verifiedPromotionCode:"",isDeletedPromo:!0})},[h]),C=(0,s.useCallback)(async()=>{if(l.code&&l.promotionCode!==l.verifiedPromotionCode){h({error:{code:l.code,message:"ì½ë íì¸ì í´ì£¼ì¸ì"}}),await (0,r.openAlert)({description:'"ì½ë íì¸"ì í´ì£¼ì¸ì'});return}let e={...l};delete e.verifiedPromotionCode,n(e)},[n,l,h]),P=f.isPending,v=!!l.error,S=l.error?.message,j=(0,i.jsx)(o.K,{type:"button",variant:"brandSolid",size:"large",className:"w-full","data-analytics-label":"ì½ë ì ì©í기","data-analytics-name":"discount_code_apply","data-analytics-section":"discount_code_modal","data-analytics-location":"discount_code_footer",onClick:C,children:"ì½ë ì ì©í기"});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(m.cj,{padded:!1,children:(0,i.jsxs)("div",{className:"flex min-h-full flex-col bg-bg-layer-default",children:[(0,i.jsxs)("div",{className:"flex flex-col gap-x6 px-x4 pb-x8 pt-x6",children:[(0,i.jsxs)("h2",{className:"m-0 whitespace-pre-line t8-bold text-fg-neutral",children:[t.hasPromotion&&"매ì¥ë³ íë¡ëª¨ì
ì½ë를","\nì
ë ¥í´ì£¼ì¸ì"]}),(0,i.jsxs)(d.Tn,{name:"code",invalid:v,disabled:P,children:[(0,i.jsx)(d.Qy,{className:"sr-only",children:"ì½ë"}),(0,i.jsxs)("div",{className:"flex items-start gap-x2",children:[(0,i.jsxs)(p.k4,{className:"flex-1",value:l.code,invalid:v,disabled:P,children:[(0,i.jsx)(p.Nl,{type:"text",name:"code",inputMode:"text",placeholder:"ì½ë를 ì
ë ¥í´ì£¼ì¸ì",disabled:P,value:l.code,onChange:b}),l.code&&(0,i.jsx)(o.K,{type:"button",variant:"ghost",size:"small",layout:"iconOnly",className:"mr-x2 text-fg-neutral-muted","aria-label":"ì½ë ì§ì°ê¸°",onClick:x,children:(0,i.jsx)(a.Z,{"aria-hidden":!0})})]}),(0,i.jsx)(o.K,{type:"button",variant:"neutralWeak",size:"large","data-analytics-label":"ì½ë íì¸","data-analytics-name":"discount_code_check","data-analytics-section":"discount_code_modal","data-analytics-location":"discount_code_form",disabled:P||!l.code,loading:P,onClick:g,children:"ì½ëíì¸"})]}),S&&(0,i.jsx)(d.du,{children:S})]}),l.promotionId&&(0,i.jsxs)("div",{className:"relative h-fit w-full rounded-r2 bg-bg-layer-fill p-x3",children:[(0,i.jsxs)("span",{className:"mb-x1 inline-block t4-regular text-fg-neutral",children:[(0,i.jsx)("em",{className:"font-bold not-italic",children:l.promotionTitle})," ì ì©"]}),(0,i.jsx)("p",{className:"t2-regular text-fg-placeholder",children:getDescription(l)}),(0,i.jsxs)("p",{className:"mt-x3 t7-bold text-fg-brand",children:[c().number(l.discountPrice),"ì í ì¸"]}),(0,i.jsx)(o.K,{type:"button",variant:"ghost",size:"small",layout:"iconOnly",className:"absolute right-x3 top-x3 text-fg-neutral","aria-label":"íë¡ëª¨ì
ì½ë ìì ",onClick:y,children:(0,i.jsx)(a.Z,{"aria-hidden":!0})})]})]}),(0,i.jsxs)("div",{className:"flex-1 bg-bg-layer-basement px-x4 pb-x8 pt-x5",children:[(0,i.jsx)("strong",{className:"t5-bold text-fg-neutral",children:"ìë´ì¬í"}),(0,i.jsx)(NoticeContent,{hasPromotion:t.hasPromotion})]})]})}),(0,i.jsx)(m.Xd,{padded:!1,className:"bg-bg-layer-default px-x4 pt-x3 pb-[var(--safe-bottom-gap)]",children:j})]})}async function availablePromotionCode(e,t){let{mutateAsync:n}=e,{reservationId:i,promotionCode:s}=t,a="íë¡ëª¨ì
";try{let{data:e}=await n({reservationId:i,promotionCode:s});return{error:null,promotionCode:s,promotionId:e.promotionId,promotionTitle:e.promotionTitle,promotionPutType:e.promotionPutType,promotionApplyType:e.promotionApplyType,endDate:e.endDate,round:e.round,discountPrice:e.discountPrice,verifiedPromotionCode:s}}catch(n){let{response:e}=n,t=e&&e.data||{};return 872===t.errCode?await C().alert(`기ê°ì´ ì¢
ë£ëì´ ì¬ì©í ì ìë ${a} ì½ëì
ëë¤`,t):873===t.errCode?await C().alert(`ë§ê°ë ${a} ì½ëì
ëë¤`,t):874===t.errCode?await C().alert(`íìë¹ ë±ë¡í ì ìë ìëì ì´ê³¼íì¬ í´ë¹ ì½ëë ì¬ì©í ì ììµëë¤`,t):await C().alert(`ì í¨í ${a} ì½ëê° ìëëë¤`,t),{error:{code:s,message:""}}}}function getDescription(e){let{promotionPutType:t,promotionApplyType:n,endDate:i,round:s}=e;return t===x.PromotionPutTypes.TICKET_PAY?"1ê°ì ì¸ì°¨í°ì¼ì ì ì©ë¨":n===x.PromotionApplyTypes.DATE?`${b()(i).format("YY.MM.DD")}
1ê¹ì§ ì 기결ì ê±´ 매ì ì ì© ìì `:n===x.PromotionApplyTypes.COUNT?`구ë
${s}ê°ìì°¨ ê¹ì§ í ì¸ ì ì© ìì `:`구ë
첫 ê²°ì 1í ì ì©`}function NoticeContent(e){let{hasPromotion:t=!1}=e;return(0,i.jsx)("div",{className:"mt-x3 flex flex-col gap-x4",children:t&&(0,i.jsxs)("section",{children:[(0,i.jsx)("strong",{className:"t4-bold text-fg-neutral",children:"매ì¥ë³ íë¡ëª¨ì
ì½ëë?"}),(0,i.jsx)("p",{className:"mt-x1 t4-regular text-fg-neutral-subtle",children:"ê° ë§¤ì¥ë³ë¡ ì ì© ê°ë¥í íë¡ëª¨ì
ì½ë를 ì
ë ¥í ì ìì´ì. (문ìì¬íì í´ë¹ 매ì¥ì¼ë¡ ìì²í´ì£¼ì¸ì.)"}),(0,i.jsx)(h.D,{className:"mt-x3",itemClassName:"text-fg-neutral-subtle",lines:P})]})})}let v={promotionCode:"",promotionId:"",promotionTitle:"",promotionApplyType:"",promotionPutType:"",endDate:"",round:0,discountPrice:0};function DiscountCodeSelector(e){let{reservationId:t,couponDownId:n,hasPromotion:l,isSubscription:d,plateNum:p,onChange:h}=e,m=(0,s.useRef)({reservationId:t,hasPromotion:l,onChange:h}),[f,g]=(0,u.P)(()=>
1v),[b,x]=(0,s.useState)({open:!1,initData:{}}),y=(0,s.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{promotionCode:t,promotionId:n,promotionTitle:i,promotionPutType:s,promotionApplyType:a,endDate:r,discountPrice:o,round:l,isDeletedPromo:c,cashImmediately:u}=e;await g(e=>({...e,promotionCode:t||"",promotionId:n||"",promotionTitle:i||"",promotionApplyType:a||"",promotionPutType:s||"",endDate:r||"",round:l||0,discountPrice:o||0,plateNum:p,isDeletedPromo:c,cashImmediately:u})),"function"==typeof m.current.onChange&&m.current.onChange({promotionCode:t,discountPrice:o||0,isDeletedPromo:c,cashImmediately:u})},[g,p]),C=(0,s.useCallback)(async e=>{let{couponDownId:t}=m.current;if(x(e=>({...e,open:!1})),e){if(t&&e.promotionId){let t=await (0,r.openConfirm)({title:"ì¿ í°ê³¼ ì¤ë³µì¬ì© ë¶ê°",description:"íë¡ëª¨ì
ì½ëë ì¿ í°ê³¼ í¨ê» ì¬ì©í ì ìì´ì.\nì ì©íë©´ ì íë ì¿ í°ì´ ì·¨ìë¼ì.\níë¡ëª¨ì
ì½ë를 ì ì©í ê¹ì?",actionLabel:"íì¸",cancelLabel:"ì·¨ì"});t&&y(e);return}y(e)}},[y]),N=(0,s.useCallback)(e=>{x(t=>({...t,open:e}))},[]),P=(0,s.useCallback)(async()=>{let{reservationId:e,hasPromotion:t}=m.current,n=await g();d&&!p?await (0,r.openAlert)({description:"구ë
í ì°¨ëë²í¸ë¥¼ ì í í ë¤ì ìëí´ ì£¼ì¸ì."}):x({open:!0,initData:{reservationId:e,hasPromotion:t,plateNum:p,...n}})},[d,p,g]),S=(0,s.useCallback)(async()=>{let e=await g();y({...e,promotionCode:"",promotionId:"",promotionTitle:"",promotionPutType:"",promotionApplyType:"",endDate:"",round:0,discountPrice:0,isDeletedPromo:!0})},[y,g]);return(0,s.useEffect)(()=>{let e={...v,plateNum:p};g(e),y(e)},[p,y,g]),(0,s.useEffect)(()=>{m.current.reservationId=t,m.current.couponDownId=n,m.current.hasPromotion=l,m.current.onChange=h,n&&g({...v})},[n,l,h,t,g]),(0,i.jsxs)("div",{className:"box-border w-full rounded-r3 bg-bg-layer-default px-x4 py-x5",children:[(0,i.jsx)("div",{className:"mb-x3",children:(0,i.jsx)("span",{className:"t5-bold text-fg-neutral",children:"ì½ë ì
ë ¥"})}),(0,i.jsxs)(o.K,{className:"w-full",variant:"neutralWeak",size:"large",type:"button","data-analytics-label":"ì½ë ì ì©í기","data-analytics-name":"discount_code_open","data-analytics-section":"discount_code","data-analytics-location":"payment_discount",onClick:P,children:["ì½ë ",f.promotionId?"ë³ê²½":"ì ì©","íë¬ ê°ê¸°"]}),!f.promotionId&&(0,i.jsx)("p",{className:"mt-x2_5 t2-medium text-fg-placeholder",children:"ê³µì ë°ì ì½ë를 ì
ë ¥í´ ì£¼ì¸ì!"}),f.promotionId&&(0,i.jsxs)("div",{className:"relative mt-x0_5 h-fit w-full rounded-r2 bg-bg-layer-fill p-x3",children:[(0,i.jsxs)("span",{className:"mb-x1 inline-block t4-regular text-fg-neutral",children:[(0,i.jsx)("em",{className:"font-bold not-italic",children:f.promotionTitle})," ì ì©"]}),(0,i.jsx)("p",{className:"t2-regular text-fg-placeholder",children:getDescription(f)}),(0,i.jsxs)("p",{className:"mt-x3 t7-bold text-fg-brand",children:[c().number(f.discountPrice),"ì í ì¸"]}),(0,i.jsx)(o.K,{type:"button",variant:"ghost",size:"small",layout:"iconOnly",className:"absolute right-x3 top-x3 text-fg-neutral","aria-label":"íë¡ëª¨ì
ì½ë ìì ",onClick:S,children:(0,i.jsx)(a.Z,{"aria-hidden":!0})})]}),(0,i.jsx)(DiscountCodeModal,{open:b.open,initData:b.initData,onOpenChange:N,onConfirm:C})]})}},20178:function(e,t,n){"use strict";n.d(t,{ub:function(){return EmptyState}});var i=n(24246);n(27378);var s=n(12430),a=n(29962);let r=(0,s.j)("",{variants:{layout:{bare:"",list:"w-full whitespace-pre-wrap break-words py-x12 text-center"}},defaultVariants:{layout:"bare"}}),o=(0,s.j)("",{variants:{size:{md:"text-t13",sm:"text-t10"}},defaultVariants:{size:"md"}}),l=(0,s.j)("",{variants:{size:{md:"mt-x3 t5-bold",sm:"mt-x2 t3-bold"},titleTone:{heading:"text-fg-neutral",inherit:""}},defaultVariants:{size:"md",titleTone:"heading"}}),c=(0,s.j)("text-fg-neutral-subtle",{variants:{size:{md:"mt-x1_5 t3-regular",sm:"mt-x1 t2-regular"}},defaultVariants:{size:"md"}});function EmptyState(e){let{className:t,size:n,titleTone:s,layout:u,icon:d,title:p,description:h,children:m,...f}=e;return(0,i.jsxs)("div",{className:(0,a.cn)(r({layout:u}),t),...f,children:[(0,i.jsx)("div",{className:o({size:n}),children:d}),(0,i.jsx)("div",{className:l({size:n,titleTone:s}),children:p}),h?(0,i.jsx)("div",{className:c({size:n}),children:h}):null,m]})}},43192:function(e,t,n){"use strict";n.d(t,{F:function(){return PlateNumCard}});var i=n(24246),s=n(96603),a=n(63058);function PlateNumCard(e){let{plateNum:t,disabled:n,isDefault:r,description:o,showRadiomark:l=!0}=e;return(0,i.jsx)(a.aY,{value:t,disabled:n,label:r?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:"t6-bold",children:t}),(0,i.jsx)(s.Ct,{size:"medium",variant:"weak",tone:"neutral",children:"기본차ë"})]}):(0,i.jsx)("span",{className:"t6-bold",children:t}),description:o,suffix:l?(0,i.jsx)(a.Sl,{}):void 0})}},96605:function(e,t,n){"use strict";n.d(t,{s:function(){return PlateNumRadioList}});var i=n(24246),s=n(83861),a=n(63058),r=n(43192),o=n(97578),l=n(6110);function PlateNumRadioList(e){let{rows:t,value:n,onValueChange:c,disabled:u=!1,disabledPlateNum:d,hintPlateNum:p,hint:h,"aria-label":m="ë±ë¡ì°¨ë"}=e;return(0,i.jsx)(a.KH,{"aria-label":m,value:n,onValueChange:c,children:t.map(e=>(0,i.jsx)(r.F,{plateNum:e.plateNum,disabled:u||!!(0,l.Wd)(e)||e.plateNum===d,isDefault:e.isDefault,description:function(e,t){let n=(0,l.Wd)(e),a=(0,l.DH)(e),r=(0,l.GX)(e);if(e.userSubscriptions.length||n||t)return(0,i.jsxs)("span",{className:"flex flex-col gap-x0_5",children:[t&&(0,i.jsx)("span",{children:t}),(0,i.jsx)(o.l,{subscriptions:e.userSubscriptions}),n&&(0,i.jsxs)("span",{className:"flex items-center gap-x1",children:[(0,i.jsx)(s.Z,{"aria-hidden":!0,
1className:"size-x4 shrink-0"}),n]}),a&&(0,i.jsx)("span",{className:"pl-x5",children:a}),r.map(e=>(0,i.jsx)("span",{children:e},e))]})}(e,h&&e.plateNum===p?h:void 0)},e.plateNumId))})}},55189:function(e,t,n){"use strict";n.d(t,{Z:function(){return SelectPlateNumSheet}});var i=n(24246),s=n(27378),a=n(73073),r=n.n(a),o=n(34779),l=n(83922),c=n.n(l),u=n(13793),d=n(51301),p=n(20178),h=n(52673),m=n(18025),f=n(42320),g=n(96605),b=n(6110),x=n(41773);let y="ì°¨ëë²í¸ ì í",C="ì íí기";function SelectPlateNumSheet(e){let{open:t,title:n=y,confirmLabel:a=C,disabled:r=!1,userSubscriptionId:o,plateNum:l,subscriptionId:c,onOpenChange:u,onSelect:d,onPlateNumsChange:p}=e,[f,g]=(0,s.useState)(!1);function handleOpenChange(e){e||g(!1),u(e)}return(0,m.t)(t,()=>{f?g(!1):handleOpenChange(!1)}),(0,i.jsx)(h.FP,{open:t,onOpenChange:handleOpenChange,modal:!f,children:(0,i.jsx)(h._d,{children:(0,i.jsx)(SelectPlateNumSheetBody,{open:t,title:n,confirmLabel:a,disabled:r,userSubscriptionId:o,plateNum:l,subscriptionId:c,onOpenChange:handleOpenChange,addSheetOpen:f,setAddSheetOpen:g,onSelect:d,onPlateNumsChange:p})})})}function SelectPlateNumSheetBody(e){let{open:t,addSheetOpen:n,setAddSheetOpen:a,title:l=y,confirmLabel:m=C,disabled:N=!1,userSubscriptionId:P,plateNum:v,subscriptionId:S,onOpenChange:j,onSelect:I,onPlateNumsChange:w}=e,[T,k]=(0,s.useState)(v||""),[O,A]=(0,s.useState)(!1),_=(0,s.useRef)(!1),D=N||O,[R,B]=(0,s.useState)(!1),{isFetching:$,isError:M,data:z,error:E,refetch:Z}=(0,x.IN)("myPlateNums",S?{subscriptionId:S}:{},!0),F=(0,b.pB)(z,S,P);(0,s.useEffect)(()=>{B(!0)},[]);let U=(0,s.useRef)(t);(0,s.useEffect)(()=>{t&&!U.current&&k(v||""),U.current=t},[t,v]);let G=(0,s.useRef)(w);G.current=w;let q=(0,s.useRef)(F);q.current=F,(0,s.useEffect)(()=>{!z||$||M||G.current?.((z.plateNums||[]).map(e=>{let{plateNum:t}=e;return{plateNum:t}}),q.current)},[z,$,M]);let L=!D&&!$&&!M&&F.some(e=>e.plateNum===T&&!(0,b.Wd)(e));async function handleConfirm(){if(L&&!_.current){_.current=!0,A(!0);try{await I(T)!==!1&&j(!1)}finally{_.current=!1,A(!1)}}}let V=(0,s.useCallback)(()=>a(!0),[a]),H=(0,s.useCallback)(e=>{e||a(!1)},[a]),W=(0,s.useCallback)(e=>{a(!1),e?.plateNum&&(r().toast({position:"TOP",message:`"${e.plateNum}"를 ì¶ê°ëììµëë¤.`}),k(e.plateNum),Z())},[Z,a]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(h.b1,{children:[(0,i.jsx)(h.fV,{children:l}),(0,i.jsx)(h.QW,{})]}),(0,i.jsx)(f.Z,{open:n,onOpenChange:H,onComplete:W}),(0,i.jsx)(h.cj,{padded:!1,children:(0,i.jsxs)("div",{className:"flex flex-col gap-x6 py-x4",children:[!$&&z&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("section",{className:"flex flex-col gap-x2 px-spacing-x-global-gutter",children:[(0,i.jsx)("h2",{className:"t6-bold text-fg-neutral",children:"ë±ë¡ì°¨ë"}),(0,i.jsx)(g.s,{rows:F,value:T,onValueChange:k,disabled:D})]})}),R&&$&&(0,i.jsx)("div",{className:"flex justify-center py-x16",children:(0,i.jsx)(d._,{size:"40"})}),M&&(0,i.jsx)("div",{className:"px-spacing-x-global-gutter py-x10",children:(0,i.jsx)(p.ub,{icon:"\uD83D\uDE22",title:"ì°¨ë 목ë¡ì ë¶ë¬ì¤ì§ 못íì´ì",description:c().toErrorCodeStr(E)})})]})}),(0,i.jsx)(h.Xd,{children:(0,i.jsxs)("div",{className:"flex gap-x2",children:[(0,i.jsx)(u.K,{type:"button",variant:"neutralWeak",size:"large",className:"flex-1",disabled:D||$||M||!z||F.length>=o.x,onClick:V,children:"ì°¨ëë²í¸ ì¶ê°"}),(0,i.jsx)(u.K,{type:"button",variant:"brandSolid",size:"large",className:"flex-1",disabled:!L,onClick:handleConfirm,children:m})]})})]})}},6110:function(e,t,n){"use strict";n.d(t,{DH:function(){return getCancelReservedHint},GX:function(){return getRemainingLines},Wd:function(){return getBlockReason},eQ:function(){return getPaymentPlateNumGuard},pB:function(){return getPlateNumRows}});var i=n(44411),s=n.n(i);function getPlateNumRows(e,t,n){let{plateNums:i=[],userSubscriptions:s=[]}=e||{},a=s.find(e=>n?e.userSubscriptionId===n:e.subscriptionId===t),r=t??a?.subscriptionId,o=a?.groupId,l=!!n,isSamePass=e=>e.userSubscriptionId!==n&&(!!e.isSamePass||(o&&e.groupId?e.groupId===o:e.subscriptionId===r));return i.map(e=>{let t=s.filter(t=>t.plateNum===e.plateNum),n=t.filter(isSamePass);return{plateNumId:e.plateNumId,plateNum:e.plateNum,userSubscriptions:t,isDefault:e.isDefault,isSameSubscription:n.length>0,hasOverlapPass:!l&&t.some(e=>!!e.isStoreOverlap&&!e.isCancelReserved&&!isSamePass(e)),sameSubscriptionEndDate:!l&&n.length>0&&n.every(e=>!!e.isCancelReserved&&!!e.endDate)?n.map(e=>e.endDate).sort()[n.length-1]:null,isVehicleChange:l}})}function getBlockReason(e){return e?e.isSameSubscription?"ê°ì 구ë
ì ì´ì© ì¤ì´ìì":e.hasOverlapPass?"ë¤ë¥¸ 구ë
ì¼ë¡ ì´ì© ì¤ì¸ 매ì¥ì´ìì":"":""}function getCancelReservedHint(e){return e?.isSameSubscription&&e.sameSubscriptionEndDate?`${s()(e.sameSubscriptionEndDate).format("Mì Dì¼")}ê¹ì§ ì´ì©í ì ìì´ì`:""}function getRemainingLines(e){if(!e||e.isVehicleChange||getBlockReason(e))return[];let t=e.userSubscriptions.length>1;return e.userSubscriptions.filter(e=>!!e.isCancelReserved&&!!e.endDate).map(e=>{let n=t&&e.subscriptionName?`${e.subscriptionName} 구ë
ì´`:"기존 구ë
ì´";return`${n} ${s()(e.endDate).format("Mì Dì¼")}ì ì¢
ë£ë¼ì`})}function getPaymentPlateNumGuard(e,t,n){if("loading"===e)return{blocked:!0,reason:""};if("failed"===e)return{blocked:!1,reason:""};let i=getBlockReason(t.find(e=>e.plateNum===n));return{blocked:!!i,reason:i}}},54387:function(e,t,n){"use strict";n.d(t,{E4:function(){return savePendingOfferToken},Fd:function(){return transferOfferTokenToPayment},Gj:function(){return getOfferTokenFromSearch},NU:function(){return clearPaymentOfferToken},Ul:function(){return getPendingOfferToken},ag:function(){return getPaymentOfferToken},fV:function(){return getPaymentOfferPlateNum},nz:function(){return getOfferLandingUrl},zj:function(){return removeOfferTokenFromUrl}}
1);let i="subscription_offer_pending",s="subscription_offer_payment:",a="subscription_offer_payment_plate:",r="/subscription/offer";function normalizeToken(e){if("string"!=typeof e)return null;let t=e.trim();return t.length>0?t:null}function normalizePlateNum(e){if("string"!=typeof e)return null;let t=e.trim();return t.length>0?t:null}function getSessionStorage(){try{return window.sessionStorage}catch{return null}}function getOfferTokenFromSearch(e){return normalizeToken(new URLSearchParams(e).get("offerToken"))}function getOfferLandingUrl(e){let t=normalizeToken(e);return t?`${r}?offerToken=${encodeURIComponent(t)}`:r}function removeOfferTokenFromUrl(e){let t=new URL(e,"https://www.autostay.kr");t.searchParams.delete("offerToken");let n=t.searchParams.toString();return`${t.pathname}${n?`?${n}`:""}${t.hash}`}function savePendingOfferToken(e){let t=getSessionStorage(),n=normalizeToken(e);t&&n&&t.setItem(i,n)}function getPendingOfferToken(){return normalizeToken(getSessionStorage()?.getItem(i))}function transferOfferTokenToPayment(e,t,n){let r=getSessionStorage(),o=normalizeToken(t);if(!r||!o||!String(e))return;r.setItem(`${s}${e}`,o);let l=normalizePlateNum(n);l?r.setItem(`${a}${e}`,l):r.removeItem(`${a}${e}`),r.removeItem(i)}function getPaymentOfferToken(e){return normalizeToken(getSessionStorage()?.getItem(`${s}${e}`))}function getPaymentOfferPlateNum(e){return normalizePlateNum(getSessionStorage()?.getItem(`${a}${e}`))}function clearPaymentOfferToken(e){let t=getSessionStorage();t?.removeItem(`${s}${e}`),t?.removeItem(`${a}${e}`)}},63494:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return L}});var i=n(24246);n(27378);var s=n(86677),a=n.n(s),r=n(76675),o=n(9758),l=n(13793),c=n(99578),u=n(51301),d=n(3150),p=n(51193),h=n(90437),m=n.n(h),f=n(88679),g=n(78496),b=n.n(g),x=n(4566),y=n(38125),C=n(66723),N=n(79117),P=n(80029),v=n(96603),S=n(38342),j=n(13075),I=n(63058);function getBillingCycleOptionViewModel(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=normalizeBillingOption(e),n=t.isAnnual?12*t.monthlyOriginPrice:0,i=t.isAnnual?t.price:0;return{id:t.id,isAnnual:t.isAnnual,title:t.isAnnual?"12ê°ì ì°ê²°ì ":"ì ì 기결ì ",primaryPrice:t.isAnnual?Math.round(t.price/12):t.price,primaryUnit:"ì/ì",description:t.isAnnual?"":"매 ì ìëê²°ì ",listPrice:n,discountedAnnualPrice:i,savings:Math.max(n-i,0),isRecommended:t.isAnnual}}function normalizeBillingOption(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{raw:e,id:toId(e.subscriptionId),price:toNumber(e.price),monthlyOriginPrice:toNumber(e.monthlyOriginPrice),isAnnual:(0,x.l$)(e)}}function toId(e){return null==e?"":String(e)}function toNumber(e){let t=Number(e);return Number.isFinite(t)?t:0}function BillingCycleSelectGroup(e){let{options:t=[],selectedSubscriptionId:n,disabled:s=!1,onChange:a}=e,r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,{monthlyOption:n,annualOption:i,selectedOption:s}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=e.map(normalizeBillingOption),i=toId(t),s=n.find(e=>e.id===i)||null,a=n.filter(e=>!e.isAnnual),r=n.filter(e=>e.isAnnual);if(!a.length||!r.length)return{monthlyOption:a[0]?.raw||null,annualOption:r[0]?.raw||null,selectedOption:s?.raw||null};if(s?.isAnnual)return{monthlyOption:(a.find(e=>e.price===s.monthlyOriginPrice)||a.find(e=>e.price===Math.round(s.price/12))||null)?.raw||a[0].raw,annualOption:s.raw,selectedOption:s.raw};let o=s&&!s.isAnnual?s:a[0];return{monthlyOption:o.raw,annualOption:(r.find(e=>e.monthlyOriginPrice===o.price)||r.find(e=>Math.round(e.price/12)===o.price)||null)?.raw||r[0].raw,selectedOption:s?.raw||o.raw}}(e,t),a=toId(s?.subscriptionId??t),r=[n,i].filter(Boolean),o=r.map(e=>{let t=getBillingCycleOptionViewModel(e);return{...t,option:e,isSelected:t.id===a}}),l=s?getBillingCycleOptionViewModel(s):null;return{options:o,annualSavings:l?.isAnnual?l.savings:0}}(t,n);if(r.options.length<2)return null;let o=r.options.find(e=>e.isSelected)?.id??"";return(0,i.jsxs)("div",{className:"box-border w-full rounded-r3 bg-bg-layer-default px-x4 py-x5",children:[(0,i.jsx)("div",{className:"mb-x3",children:(0,i.jsx)("span",{className:"t5-bold text-fg-neutral",children:"ê²°ì 주기 ì í"})}),(0,i.jsx)(I.KH,{"aria-label":"ê²°ì 주기 ì í",columns:2,value:o,disabled:s,onValueChange:e=>{let t=r.options.find(t=>
1t.id===e);t&&a?.(t.option)},children:r.options.map(e=>(0,i.jsx)(I.aY,{value:e.id,className:"[&_.gap-x2\\\\_5]:min-w-0 [&_.gap-x2\\\\_5]:grow [&_.mr-auto]:mr-0",label:(0,i.jsxs)("span",{className:"flex w-full flex-col",children:[(0,i.jsxs)("span",{className:"mb-x2_5 flex h-x5 w-full items-center justify-between gap-x2",children:[(0,i.jsx)(j.Tt,{size:"medium"}),e.isRecommended?(0,i.jsx)(v.Ct,{size:"medium",variant:"solid",tone:"brand",children:"ì¶ì²"}):null]}),(0,i.jsx)("span",{className:"t4-regular text-fg-neutral-subtle",children:e.title}),(0,i.jsxs)("span",{className:"flex items-baseline whitespace-nowrap",children:[(0,i.jsx)("strong",{className:"t6-bold text-fg-neutral",children:b().number(e.primaryPrice)}),(0,i.jsx)("span",{className:"t2-regular text-fg-neutral-subtle",children:e.primaryUnit})]})]}),description:e.isAnnual?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("span",{className:"block text-fg-placeholder line-through",children:["ì ìê° ",b().number(e.listPrice),"ì"]}),(0,i.jsxs)("span",{className:"block",children:[b().number(e.discountedAnnualPrice),"ì/ë
"]})]}):e.description},e.id))}),r.annualSavings>0&&(0,i.jsx)(S.UW,{className:"mt-x3",tone:"informative",description:`ì°ê²°ì ë¡ 1ë
ì ${b().number(r.annualSavings)}ì ì ì½í´ì`})]})}var w=n(62407),T=n(85617),k=n(17328),O=n(1780),A=n(23887),_=n(78497),D=n(33541);let R="USE_ALL",B="USE_NONE";function SubscriptionCashToggle(e){let{checked:t=!1,disabled:n=!1,cash:s=0,totalCash:a=0,onChange:r}=e;return(0,i.jsxs)("div",{className:"box-border w-full rounded-r3 bg-bg-layer-default px-x4 py-x5",children:[(0,i.jsxs)("div",{className:"mb-x3 flex items-center justify-between",children:[(0,i.jsx)("span",{className:"t5-bold text-fg-neutral",children:"ìºì"}),(0,i.jsxs)("span",{className:"t4-regular text-fg-neutral",children:[(0,i.jsx)("strong",{className:"t4-bold text-fg-neutral",children:b().number(a-s)}),"ìºì ë³´ì "]})]}),(0,i.jsxs)(I.KH,{"aria-label":"구ë
ê²°ì ì ìºì ì¬ì©",name:"isCashPay",value:t?R:B,disabled:n,onValueChange:e=>r?.(e===R),children:[(0,i.jsx)(I.aY,{value:R,label:"ì ì¡ ì¬ì©",suffix:(0,i.jsx)(I.Sl,{})}),(0,i.jsx)(I.aY,{value:B,label:"ì¬ì© ì í¨",suffix:(0,i.jsx)(I.Sl,{})})]}),(0,i.jsxs)("ul",{className:"ml-x2_5 mt-x3 list-['-_']",children:[(0,i.jsx)("li",{className:"t2-regular text-fg-neutral-subtle",children:"매 ì ì 기결ì ì ë³´ì í ìºì를 ì ì¡ ì¬ì©í©ëë¤."}),(0,i.jsx)("li",{className:"t2-regular text-fg-neutral-subtle",children:"ë³´ì ìºì ì°ì ì¬ì© í ë¶ì¡±í ê¸ì¡ì ë±ë¡ë ì¹´ëë¡ ê²°ì ë©ëë¤."})]})]})}var $=n(8364),M=n(30788),z=n(6110),E=n(55189),Z=n(54387),F=n(18132),U=n(83249),G=n(52186);let q="payment_plate_num:";let PaymentSubscription=class PaymentSubscription extends N.Z{static #e=this.getInitialProps=(0,G.ZP)(async(e,t)=>{let{pathname:n,query:i,asPath:s,req:a,res:r,err:o}=e;return{...t,meta:{title:"ê²°ì í기"}}},!0);constructor(e){super(e),this.state={loading:!0,error:{},reserveInfo:null,submitting:!1,payAgree:!1,paymentType:y.PaymentTypes.REGISTED_CARD,payMethod:y.PayMethods.CARD,ticketId:"",couponTitle:"",couponDownId:"",discountPrice:0,plateNum:"",plateSheetOpen:!1,plateNumRows:[],plateNumRowsStatus:"loading",cash:0,totalCash:0,productTotalPrice:0,tickets:[],promotionCode:"",isCashPay:!1,userCards:[],selectedBillingId:null,billingOptions:[],switchingCycle:!1,offerToken:null,offerPlateNum:null,subscriptionInfo:null},this.handleCoupon=this.handleCoupon.bind(this),this.handlePayAgree=this.handlePayAgree.bind(this),this.handleCash=this.handleCash.bind(this),this.handleSubscriptionCashToggle=this.handleSubscriptionCashToggle.bind(this),this.handlePaymentMethodChange=this.handlePaymentMethodChange.bind(this),this.fetchBillingCards=this.fetchBillingCards.bind(this),this.handleModifyPlateNum=this.handleModifyPlateNum.bind(this),this.handleSelectPlateNum=this.handleSelectPlateNum.bind(this),this.handlePlateNumsChange=this.handlePlateNumsChange.bind(this),this.handleDiscountCode=this.handleDiscountCode.bind(this),this.autoApplyPromotionCode=this.autoApplyPromotionCode.bind(this),this.handleSubmit=this.handleSubmit.bind(this),this.handleBillingOptionChange=this.handleBillingOptionChange.bind(this),this.plateNumRowsToken=0}componentDidMount(){let{query:e}=this.props,{offerToken:t,offerPlateNum:n}="number"==typeof e.reservationId?function(e){let t=(0,Z.ag)(e);return{offerToken:t,offerPlateNum:t?(0,Z.fV)(e):null}}(e.reservationId):{offerToken:null,offerPlateNum:null};this.fetchBillingCards(),"number"==typeof e.reservationId?(this.abort("beforePaymentSubscription"),Promise.all([this.request("beforePaymentSubscription",{reservationId:e.reservationId}),t?Promise.resolve([]):this.fetchBillingOptions(e.reservationId)]).then(async e=>{let[i,s]=e,{data:a}
1=i,r=(0,T.q)(a.coupons),o=await this.fetchSubscriptionInfo(a.subscriptionId,t);this.setState({loading:!1,reserveInfo:a,totalCash:a.cash||0,productTotalPrice:a.price,tickets:(0,M.m)([{subscriptionName:a.subscriptionName,price:a.price}],a.serviceType,y.TicketTypes.SUBSCRIPTION),plateNum:function(e){let{offerPlateNum:t,savedPlateNum:n,reservationPlateNum:i}=e;return t||n||i||""}({offerPlateNum:n,savedPlateNum:this.getSavedPlateNum(),reservationPlateNum:a.plateNum}),billingOptions:s,offerToken:t,offerPlateNum:n,subscriptionInfo:o,...r}),this.autoApplyPromotionCode(a,r),this.fetchPlateNumRows(a.subscriptionId)}).catch(e=>{let{response:t}=e,n=t&&t.data||{},i={};i=423===n.errCode?{message:`구ë ìíì ìì¬ìëì´ ë¶ì¡±íì¬ 2ê²°ì 를 ì§íí ì ììµëë¤. 3ë¤ìì ìëí´ ì£¼ì기 ë°ëëë¤.`}:446===n.errCode?{message:"ì´ë¯¸ 구ë ì¤ì¸ ìíì ëë¤.",errCode:n.errCode}:{message:"ì 보를 ë¶ë¬ì¤ì§ 못íìµëë¤.",errCode:n.errCode},this.setState({loading:!1,error:i})})):this.setState({loading:!1,error:{message:"â ï¸ ì못ë ì ê·¼ì ëë¤."}})}fetchPlateNumRows(e){this.abort("myPlateNums");let t=++this.plateNumRowsToken;return this.setState({plateNumRows:[],plateNumRowsStatus:"loading"}),this.request("myPlateNums",{subscriptionId:e}).then(n=>{let{data:i}=n;t===this.plateNumRowsToken&&this.setState({plateNumRows:(0,z.pB)(i,e),plateNumRowsStatus:"ready"})}).catch(e=>{t===this.plateNumRowsToken&&(console.error("Failed to fetch plate nums:",e),this.setState({plateNumRowsStatus:"failed"}))})}fetchSubscriptionInfo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state.offerToken,{query:n,deviceInfo:i}=this.props;return!0!==n.showSubscriptionAgree?Promise.resolve(null):(this.abort("subscription"),this.request("subscription",{subscriptionId:e,viewHideSubscription:!!i.staging||!!t}).then(e=>{let{data:t}=e;return t}))}componentDidUpdate(e,t){let{discountPrice:n,isCashPay:i}=this.state,s=t.discountPrice!==n;i&&s&&this.setState({cash:this.correctCash(i,n)})}fetchBillingOptions(e){return this.request("billingOptions",{reservationId:e}).then(e=>{let{data:t}=e;return(0,x.Fv)(t)}).catch(e=>(console.error("Failed to fetch billing options:",e),[]))}handleBillingOptionChange(e){let{reserveInfo:t,billingOptions:n}=this.state,{query:i}=this.props;e.subscriptionId!==t.subscriptionId&&(this.setState({switchingCycle:!0}),this.request("orderCreateSubscription",{subscriptionId:e.subscriptionId,previousSubscriptionId:t.subscriptionId}).then(t=>{let{data:n}=t;return Promise.all([this.request("beforePaymentSubscription",{reservationId:n.reservationId}),this.fetchSubscriptionInfo(e.subscriptionId)])}).then(e=>{let[{data:t},s]=e,r=(0,T.q)(t.coupons);a().replace({pathname:"/payment/subscription",query:{...i,reservationId:t.reservationId}},void 0,{shallow:!0}),this.setState({reserveInfo:t,productTotalPrice:t.price,tickets:(0,M.m)([{subscriptionName:t.
3subscriptionName,price:t.price}],t.serviceType,y.TicketTypes.SUBSCRIPTION),billingOptions:n,subscriptionInfo:s,switchingCycle:!1,couponDownId:"",discountPrice:0,ticketId:"",couponTitle:"",promotionCode:"",isCashPay:!1,cash:0,...!0===i.showSubscriptionAgree?{payAgree:!1}:{},...r}),this.fetchPlateNumRows(t.subscriptionId)}).catch(async n=>{console.error("Cycle switch error:",n),(0,f.captureBillingCycleSwitchError)(n,{reservationId:t?.reservationId,previousSubscriptionId:t?.subscriptionId,nextSubscriptionId:e.subscriptionId}),await (0,o.openAlert)({description:x.jv}),this.setState({switchingCycle:!1})}))}async fetchBillingCards(){try{let e=await U.l.query({query:F.lYx,fetchPolicy:"network-only"}),t=e.data?.billingsByUserId||[];this.setState({userCards:t,selectedBillingId:t.length>0?t[0].id:null})}catch(e){console.error("Failed to fetch billing cards:",e)}}isSubscribingPlateNum(e){let{reserveInfo:t}=this.state;return(t.userSubscriptionPlateNums||[]).includes(e)}getSavedPlateNum(){try{let{reservationId:e}=this.props.query;return sessionStorage.getItem(q+e)||""}catch(e){return""}}savePlateNum(e){try{let{reservationId:t}=this.props.query,n=q+t;e?sessionStorage.setItem(n,e):sessionStorage.removeItem(n)}catch(e){}}async valid(){let{payAgree:e,plateNum:t,selectedBillingId:n,plateNumRows:i,plateNumRowsStatus:s}=this.state,a=(0,z.eQ)(s,i,t),r="";return n||(r="ê²°ì í ì¹´ë를 ë±ë¡í´ì£¼ì¸ì."),t||(r="ì°¨ëì ì íí´ì£¼ì¸ì."),this.isSubscribingPlateNum(t)&&(r=`"${t}"ì°¨ëë²í¸ë¡ í´ë¹ 구ë ìíì 구ë ì¤ì´ìëë¤. 4ë¤ë¥¸ ì°¨ëë²í¸ë¥¼ ì íí´ì£¼ì¸ì.`),a.blocked&&(r=a.reason||"ì°¨ë ì 보를 ë¶ë¬ì¤ê³ ìì´ì.\nì ì í ë¤ì ìëí´ì£¼ì¸ì."),r||e||(r="íë¶ì¡°ê±´ ë° ê²°ì ì§í ëì를 íì§ ìììµëë¤."),r&&await (0,o.openAlert)({description:r}),!r}correctCash(e,t){let{totalCash:n,productTotalPrice:i}=this.state,s=0;if(e){n<i?s=n:i&&(s=i),t&&i-t<s?s=i-t:i<s&&(s=i);let e=this.getTotalPrice(s,t);e&&e<100&&(s-=100-e)}return s}handlePayAgree(e){this.setState({payAgree:e})}handlePaymentMethodChange(e){let{payMethod:t,paymentType:n,selectedCard:i}=e;this.setState({payMethod:t,paymentType:n,selectedBillingId:i?.id||null})}handleModifyPlateNum(){this.state.offerPlateNum||this.setState({plateSheetOpen:!0})}handleSelectPlateNum(e){if(this.state.offerPlateNum)return;let{promotionCode:t}=this.state,n={plateSheetOpen:!1,plateNum:e||""};t&&(n.discountPrice=0),this.setState(n),this.savePlateNum(n.plateNum)}handlePlateNumsChange(e,t){let{offerPlateNum:n,plateNum:i}=this.state;t&&(this.plateNumRowsToken+=1,this.setState({plateNumRows:t,plateNumRowsStatus:"ready"})),n||e.find(e=>Object.entries({plateNum:i}).every(t=>{let[n,i]=t;return e[n]===i}))||(this.setState({plateNum:""}),this.savePlateNum(""))}handleCash(e){this.setState({cash:e,isCashPay:!1})}handleSubscriptionCashToggle(e){let{discountPrice:t}=this.state;this.setState({isCashPay:e,cash:this.correctCash(e,t)})}handleCoupon(e){let{couponDownId:t,couponTitle:n,discountPrice:i,ticketId:s}=e;this.setState(e=>{let a={};return t&&(a.promotionCode=""),{...e,couponDownId:t,couponTitle:n,discountPrice:i,ticketId:s,...a}})}autoApplyPromotionCode(e,t){let{query:n}=this.props,i=n.promotionCode?String(n.promotionCode):"";(function(e){let{couponDownId:t,promotionCode:n,hasPromotion:i}=e;return!t&&!!n&&!!i})({couponDownId:t.couponDownId,promotionCode:i,hasPromotion:e.hasPromotion})&&(this.abort("availablePromotionCode"),this.request("availablePromotionCode",{reservationId:n.reservationId,promotionCode:i}).then(e=>{let{data:t}=e;this.handleDiscountCode({promotionCode:i,discountPrice:t.discountPrice})}).catch(()=>{}))}handleDiscountCode(e){let{promotionCode:t,discountPrice:n,isDeletedPromo:i}=e,{discountPrice:s}=this.state,a=t?n:s;this.setState(n=>{let s={...e,discountPrice:a};return t&&(s.couponDownId="",s.couponTitle="",s.ticketId=""),i&&(s.discountPrice=0,delete s.isDeletedPromo),{...n,promotionCode:t,...s}})}async handleSubmit(){if(!await this.valid())return;let{cash:e,discountPrice:t}=this.state,n=this.getTotalPrice(e,t);this.setState({submitting:!0});try{await this.requestBillingPayment(n)}catch(e){console.error("Payment error:",e),await (0,o.openAlert)({description:e.message||"ê²°ì ì¤ ì¤ë¥ê° ë°ìíìµëë¤."}),this.setState({submitting:!1})}}async requestBillingPayment(e){let{reserveInfo:t,ticketId:n,couponDownId:i,discountPrice:s,cash:a,promotionCode:r,plateNum:l,isCashPay:c,selectedBillingId:u,offerToken:d}=this.state,p=(0,x.l$)((0,x.Su)(this.state.billingOptions,t?.subscriptionId));if(!u){await (0,o.openAlert)({description:"ë±ë¡ë ì¹´ëê° ììµëë¤. ì¹´ë를 먼ì ë±ë¡í´ì£¼ì¸ì."}),this.setState({submitting:!1});return}let h=(0,C.R)(),f=t.subscriptionName||"AUTOSTAY";try{let g=await m().payConfirmSubscriptionV2({paymentType:y.PaymentTypes.REGISTED_CARD,billingId:u,orderId:h,reservationId:t.reservationId,ticketId:n||0,couponDownId:i||0,discountPrice:s||0,cash:a||0,promotionCode:r||"",rewardCode:"",plateNum:l||"",isCashPay:!p&&(c||!1),payment:e,goodsName:f,...d?{offerToken:d}:{}}).promise();g.data?.errCode&&0!==g.data.errCode?(await (0,o.openAlert)({title:"ê²°ì ì¹ì¸ ì¤í¨",description:`ìë¬ ì½ë: ${g.data?.errCode} 5ë©ìì§: ${g.data?.resultMsg||"ì ì ìë ì¤ë¥"}`}),this.setState({submitting:!1}
5)):(this.savePlateNum(""),d&&(0,Z.NU)(t.reservationId),window.location.href=`/payment/complete?reservationId=${t.reservationId}&serviceType=2&ticketType=${y.TicketTypes.SUBSCRIPTION}`)}catch(t){(0,$.W)(t)&&console.error("Billing payment error:",t);let e=(0,$.H)(t)||t.response?.data?.resultMsg||"ê²°ì ì¤ ì¤ë¥ê° ë°ìíìµëë¤.";await (0,o.openAlert)({description:e}),this.setState({submitting:!1})}}getStoreName(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.length?e[0].storeName:""}getSubscriptionStoreName(e){return(0,x.NZ)(e?.subscriptionName)?"ì êµ ì¤í ì¤í
ì´ ë§¤ì¥":this.getStoreName(e?.stores)}getTotalPrice(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,{productTotalPrice:n}=this.state,i=n-t;return i>e?i-e:0}render(){let{meta:e,query:t}=this.props,{loading:n,error:s,reserveInfo:a,tickets:o,submitting:h,payAgree:m,ticketId:f,couponTitle:g,couponDownId:y,discountPrice:C,cash:N,totalCash:v,productTotalPrice:S,plateNum:j,isCashPay:I,promotionCode:R,userCards:B,billingOptions:$,switchingCycle:M,offerToken:Z,offerPlateNum:F,subscriptionInfo:U,plateSheetOpen:G,plateNumRows:q,plateNumRowsStatus:L}=this.state,V=a?this.getTotalPrice(N,C):0,H=(0,z.eQ)(L,q,j),W=(0,x.Su)($,a?.subscriptionId),K=(0,x.l$)(W),Y=!0===t.showSubscriptionAgree,X=a?(0,i.jsx)(O.Z,{serviceType:a.serviceType,isSubscription:!0,isAnnualSubscription:K,showSubscriptionAgree:Y,subscriptionInfo:U,onChange:this.handlePayAgree},Y?a.reservationId:void 0):null;return(0,i.jsxs)(P.Z,{pageTitle:e.title,pageError:s,backButton:!0,children:[!!a&&(0,i.jsx)("div",{className:"screen-fill payment",children:(0,i.jsxs)("div",{className:`flex flex-col gap-x3 bg-bg-layer-basement px-x5 pt-x5 ${Y?"pb-[calc(180px+var(--safe-bottom-gap))]":"pb-[calc(136px+var(--safe-bottom-gap))]"}`,children:[(0,i.jsx)(D.Z,{productName:a.subscriptionName,storeName:this.getSubscriptionStoreName(a),storeCount:a.stores.length,tickets:o,serviceType:a.serviceType,isSubscription:!0,subscriptionBillingLabel:K?"ì°ê²°ì ":"매ì ì 기결ì "}),!Z&&(0,i.jsx)(BillingCycleSelectGroup,{options:$,selectedSubscriptionId:a.subscriptionId,disabled:M,onChange:this.handleBillingOptionChange}),(0,i.jsxs)("div",{className:"box-border w-full rounded-r3 bg-bg-layer-default px-x4 py-x5",children:[(0,i.jsx)("div",{className:"mb-x4 flex items-center justify-between",children:(0,i.jsx)("div",{className:"t5-bold text-fg-neutral",children:"ì°¨ëì í"})}),(0,i.jsx)(c.GX,{values:j?[j]:[],children:(0,i.jsxs)(c.n2,{children:[(0,i.jsx)(c.MG,{"aria-label":F?`ì¬ê°ì
ëì ì°¨ë ${j}`:j?`ì íí ì°¨ë ${j}, ì°¨ë ë³ê²½í기`:"ì°¨ë ì íí기",disabled:!!F,onClick:this.handleModifyPlateNum}),j?(0,i.jsx)(c.XM,{children:j}):(0,i.jsx)(c.xh,{children:"ì°¨ëì ì íí´ì£¼ì¸ì"}),!F&&(0,i.jsx)(c.rl,{svg:(0,i.jsx)(r.Z,{})})]})})]}),(0,i.jsx)(T.Z,{coupons:a.coupons,defaultCoupon:{ticketId:f,couponTitle:g,couponDownId:y,discountPrice:C},promotionCode:R,onChange:this.handleCoupon}),K?(0,i.jsx)(w.Z,{discountPrice:C,productTotalPrice:S,totalCash:v,onChange:this.handleCash}):(0,i.jsx)(SubscriptionCashToggle,{checked:I,cash:N,totalCash:v,onChange:this.handleSubscriptionCashToggle}),a.hasPromotion&&(0,i.jsx)(k.Z,{reservationId:a.reservationId,hasPromotion:a.hasPromotion,couponDownId:y,isSubscription:!0,plateNum:j,onChange:this.handleDiscountCode},a.reservationId),(0,i.jsx)(_.w,{userCards:B,onChange:this.handlePaymentMethodChange,onCardsChanged:this.fetchBillingCards,onlyRegisteredCard:!0}),(0,i.jsx)(A.Z,{totalPrice:V,productTotalPrice:S,discountPrice:C,cash:N,promotionCode:R}),(0,i.jsxs)(d.GI,{children:[X,(0,i.jsx)(l.K,{type:"button",variant:"brandSolid",size:"large","data-ga-element":"subs-payment","data-analytics-label":"ê²°ì í기","data-analytics-name":"subscription_payment_submit","data-analytics-section":"payment","data-analytics-location":"payment_footer","data-dd-action-name":"subscription.checkout.submit",className:"w-full",disabled:!!h||M||!m||H.blocked,loading:!!h||M,onClick:this.handleSubmit,children:H.reason||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("strong",{children:[b().number(V),"ì"]})," ê²°ì í기"]})})]})]})}),n&&(0,i.jsx)("div",{className:p.O2,children:(0,i.jsx)(u._,{size:"40"})}),(0,i.jsx)(E.Z,{open:G,plateNum:j,subscriptionId:a?.subscriptionId,onOpenChange:e=>this.setState({plateSheetOpen:e}
5),onSelect:this.handleSelectPlateNum,onPlateNumsChange:this.handlePlateNumsChange})]})}};var L=PaymentSubscription},86669:function(e,t,n){"use strict";n.d(t,{C:function(){return m},a:function(){return p},b:function(){return h},c:function(){return d},d:function(){return useCollapsible},u:function(){return useCollapsibleContext}});var i=n(24246),s=n(62921),a=n(68854),r=n(47486),o=n(27378),l=n(37517),c=n(39447);let getContentId=e=>`collapsible:${e}:content`;function useCollapsible(e){let{open:t,setOpen:n}=function(e){let[t,n]=(0,l.T)({prop:e.open,defaultProp:e.defaultOpen??!1,onChange:e.onOpenChange});return(0,o.useMemo)(()=>({open:t,setOpen:n}),[t,n])}(e),{disabled:i}=e,s=(0,o.useId)(),r=getContentId(s),u=(0,o.useRef)(null),[d,p]=(0,o.useState)(void 0),[h,m]=(0,o.useState)(t),f=!t&&!h;(0,c.b)(()=>{if(!u.current)return;let updateHeight=()=>{u.current&&p(u.current.scrollHeight)};updateHeight();let e=new ResizeObserver(updateHeight);return e.observe(u.current),()=>e.disconnect()},[t]),(0,o.useEffect)(()=>{t&&m(!0)},[t]);let g=t?`${d}px`:"0px",b=(0,o.useMemo)(()=>(0,a.uG)({"data-collapsible":"","data-open":(0,a.PB)(t),"data-disabled":(0,a.PB)(i)}),[t,i]);return(0,o.useMemo)(()=>({open:t,setOpen:n,disabled:i,stateProps:b,triggerAriaProps:(0,a.uG)({"aria-expanded":t,"aria-controls":r,"aria-disabled":i}),triggerHandlers:(0,a.uG)({onClick:e=>{!e.defaultPrevented&&(i||n(e=>!e))}}),contentProps:(0,a.uG)({...b,id:r,hidden:f,style:{"--collapsible-content-height":void 0!==d?g:void 0},onTransitionEnd:e=>{"height"===e.propertyName&&(t||m(!1))}}),refs:{content:u}}),[t,n,i,b,r,f,d,g])}let u=(0,o.createContext)(null),d=u.Provider;function useCollapsibleContext({strict:e=!0}={}){let t=(0,o.useContext)(u);if(!t&&e)throw Error("useCollapsibleContext must be used within a CollapsibleRoot");return t}let p=(0,o.forwardRef)((e,t)=>{let{open:n,defaultOpen:s,onOpenChange:o,disabled:l,...c}=e,u=useCollapsible({open:n,defaultOpen:s,onOpenChange:o,disabled:l});return(0,i.jsx)(d,{value:u,children:(0,i.jsx)(r.W.div,{ref:t,...(0,a.dG)(u.stateProps,c)})})});p.displayName="CollapsibleRoot";let h=(0,o.forwardRef)((e,t)=>{let n=useCollapsibleContext();return(0,i.jsx)(r.W.button,{ref:t,...(0,a.dG)(n.stateProps,n.triggerAriaProps,n.triggerHandlers,e)})});h.displayName="CollapsibleTrigger";let m=(0,o.forwardRef)((e,t)=>{let n=useCollapsibleContext();return(0,i.jsx)(r.W.div,{ref:(0,s.F)(t,n.refs.content),...(0,a.dG)(n.contentProps,e)})});m.displayName="CollapsibleContent"},78081:function(e,t,n){"use strict";n.d(t,{zF:function(){return s}});var i=n(86669),s={__proto__:null,Content:i.C,Root:i.a,Trigger:i.b}},63164:function(e,t,n){"use strict";n.d(t,{pg:function(){return s}});var i=n(89661),s={__proto__:null,Description:i.F,ErrorMessage:i.a,Label:i.b,Root:i.c}},83861:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var i=n(38149);let s=(0,i.Z)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},62664:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var i=n(38149);let s=(0,i.Z)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])}},function(e){e.O(0,[9488,9935,9894,2051,284,7987,2584,1839,5016,29,7898,7908,6518,466,4653,3058,3659,6636,9173,3290,9595,9596,4673,11,9774,2888,179],function(){return e(e.s=87865)}),_N_E=e.O()}]);
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.