paydeuk-payment-modal
Version:
Paydeuk Payment Modal Component
81 lines • 54.6 kB
JavaScript
"use strict";const k=require("react"),p=require("prop-types");function er(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const O=er(k);var xe={exports:{}},ie={};/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Ne;function rr(){if(Ne)return ie;Ne=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(o,n,a){var l=null;if(a!==void 0&&(l=""+a),n.key!==void 0&&(l=""+n.key),"key"in n){a={};for(var m in n)m!=="key"&&(a[m]=n[m])}else a=n;return n=a.ref,{$$typeof:e,type:o,key:l,ref:n!==void 0?n:null,props:a}}return ie.Fragment=t,ie.jsx=r,ie.jsxs=r,ie}var le={};/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Re;function tr(){return Re||(Re=1,process.env.NODE_ENV!=="production"&&function(){function e(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===de?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case N:return"Fragment";case T:return"Profiler";case z:return"StrictMode";case U:return"Suspense";case G:return"SuspenseList";case L:return"Activity"}if(typeof i=="object")switch(typeof i.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),i.$$typeof){case P:return"Portal";case H:return(i.displayName||"Context")+".Provider";case q:return(i._context.displayName||"Context")+".Consumer";case D:var g=i.render;return i=i.displayName,i||(i=g.displayName||g.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case J:return g=i.displayName||null,g!==null?g:e(i.type)||"Memo";case b:g=i._payload,i=i._init;try{return e(i(g))}catch{}}return null}function t(i){return""+i}function r(i){try{t(i);var g=!1}catch{g=!0}if(g){g=console;var w=g.error,y=typeof Symbol=="function"&&Symbol.toStringTag&&i[Symbol.toStringTag]||i.constructor.name||"Object";return w.call(g,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",y),t(i)}}function o(i){if(i===N)return"<>";if(typeof i=="object"&&i!==null&&i.$$typeof===b)return"<...>";try{var g=e(i);return g?"<"+g+">":"<...>"}catch{return"<...>"}}function n(){var i=Q.A;return i===null?null:i.getOwner()}function a(){return Error("react-stack-top-frame")}function l(i){if(X.call(i,"key")){var g=Object.getOwnPropertyDescriptor(i,"key").get;if(g&&g.isReactWarning)return!1}return i.key!==void 0}function m(i,g){function w(){F||(F=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",g))}w.isReactWarning=!0,Object.defineProperty(i,"key",{get:w,configurable:!0})}function u(){var i=e(this.type);return I[i]||(I[i]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),i=this.props.ref,i!==void 0?i:null}function h(i,g,w,y,R,_,ee,S){return w=_.ref,i={$$typeof:M,type:i,key:g,props:_,_owner:R},(w!==void 0?w:null)!==null?Object.defineProperty(i,"ref",{enumerable:!1,get:u}):Object.defineProperty(i,"ref",{enumerable:!1,value:null}),i._store={},Object.defineProperty(i._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(i,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(i,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ee}),Object.defineProperty(i,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:S}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i}function v(i,g,w,y,R,_,ee,S){var C=g.children;if(C!==void 0)if(y)if(ue(C)){for(y=0;y<C.length;y++)j(C[y]);Object.freeze&&Object.freeze(C)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else j(C);if(X.call(g,"key")){C=e(i);var V=Object.keys(g).filter(function(ae){return ae!=="key"});y=0<V.length?"{key: someKey, "+V.join(": ..., ")+": ...}":"{key: someKey}",ne[C+y]||(V=0<V.length?"{"+V.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`,y,C,V,C),ne[C+y]=!0)}if(C=null,w!==void 0&&(r(w),C=""+w),l(g)&&(r(g.key),C=""+g.key),"key"in g){w={};for(var Y in g)Y!=="key"&&(w[Y]=g[Y])}else w=g;return C&&m(w,typeof i=="function"?i.displayName||i.name||"Unknown":i),h(i,C,_,R,n(),w,ee,S)}function j(i){typeof i=="object"&&i!==null&&i.$$typeof===M&&i._store&&(i._store.validated=1)}var E=k,M=Symbol.for("react.transitional.element"),P=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),q=Symbol.for("react.consumer"),H=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),de=Symbol.for("react.client.reference"),Q=E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=Object.prototype.hasOwnProperty,ue=Array.isArray,Z=console.createTask?console.createTask:function(){return null};E={"react-stack-bottom-frame":function(i){return i()}};var F,I={},$=E["react-stack-bottom-frame"].bind(E,a)(),f=Z(o(a)),ne={};le.Fragment=N,le.jsx=function(i,g,w,y,R){var _=1e4>Q.recentlyCreatedOwnerStacks++;return v(i,g,w,!1,y,R,_?Error("react-stack-top-frame"):$,_?Z(o(i)):f)},le.jsxs=function(i,g,w,y,R){var _=1e4>Q.recentlyCreatedOwnerStacks++;return v(i,g,w,!0,y,R,_?Error("react-stack-top-frame"):$,_?Z(o(i)):f)}}()),le}process.env.NODE_ENV==="production"?xe.exports=rr():xe.exports=tr();var s=xe.exports;const ke=k.forwardRef((e,t)=>s.jsx("span",{ref:t,className:"sr-only",...e}));ke.displayName="VisuallyHidden";ke.propTypes={children:p.node,className:p.string,style:p.object};/**
* @license lucide-react v0.503.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const or=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),sr=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,o)=>o?o.toUpperCase():r.toLowerCase()),Se=e=>{const t=sr(e);return t.charAt(0).toUpperCase()+t.slice(1)},Me=(...e)=>e.filter((t,r,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===r).join(" ").trim(),nr=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
* @license lucide-react v0.503.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var ar={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
* @license lucide-react v0.503.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ir=k.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:n="",children:a,iconNode:l,...m},u)=>k.createElement("svg",{ref:u,...ar,width:t,height:t,stroke:e,strokeWidth:o?Number(r)*24/Number(t):r,className:Me("lucide",n),...!a&&!nr(m)&&{"aria-hidden":"true"},...m},[...l.map(([h,v])=>k.createElement(h,v)),...Array.isArray(a)?a:[a]]));/**
* @license lucide-react v0.503.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const te=(e,t)=>{const r=k.forwardRef(({className:o,...n},a)=>k.createElement(ir,{ref:a,iconNode:t,className:Me(`lucide-${or(Se(e))}`,`lucide-${e}`,o),...n}));return r.displayName=Se(e),r};/**
* @license lucide-react v0.503.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const lr=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],cr=te("arrow-left",lr);/**
* @license lucide-react v0.503.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const dr=[["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"}]],ur=te("circle-alert",dr);/**
* @license lucide-react v0.503.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const mr=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],fr=te("circle-check-big",mr);/**
* @license lucide-react v0.503.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const pr=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],br=te("refresh-cw",pr);/**
* @license lucide-react v0.503.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const gr=[["polygon",{points:"19 20 9 12 19 4 19 20",key:"o2sva"}],["line",{x1:"5",x2:"5",y1:"19",y2:"5",key:"1ocqjk"}]],hr=te("skip-back",gr);/**
* @license lucide-react v0.503.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const xr=[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]],yr=te("thumbs-up",xr),vr=`
@font-face {
font-family: '양진체';
src: url('https://fastly.jsdelivr.net/gh/supernovice-lab/font@0.9/yangjin.woff') format('woff');
font-weight: normal;
font-style: normal;
}
`;function qe({onClick:e,className:t}){return s.jsxs(s.Fragment,{children:[s.jsx("style",{children:vr}),s.jsxs("h1",{className:`text-black cursor-pointer ${t}`,style:{fontFamily:"양진체"},onClick:e,children:["페이",s.jsx("span",{className:"inline-block ml-1 -rotate-20",children:"득"})]})]})}qe.propTypes={onClick:p.func,className:p.string};function Ie({merchantName:e,productName:t,quantity:r,totalAmount:o}){return s.jsxs("div",{className:"flex-1 p-6",children:[s.jsx("h2",{className:"text-xl font-bold mb-4",children:"결제 정보"}),s.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[s.jsxs("div",{className:"flex justify-between mb-2",children:[s.jsx("span",{className:"text-gray-600",children:"상점명"}),s.jsx("span",{className:"font-medium",children:e})]}),s.jsxs("div",{className:"flex justify-between mb-2",children:[s.jsx("span",{className:"text-gray-600",children:"상품명"}),s.jsx("span",{className:"font-medium",children:t})]}),s.jsxs("div",{className:"flex justify-between mb-2",children:[s.jsx("span",{className:"text-gray-600",children:"수량"}),s.jsxs("span",{className:"font-medium",children:[r,"개"]})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-600",children:"결제 금액"}),s.jsxs("span",{className:"font-bold",children:[o.toLocaleString(),"원"]})]})]}),s.jsxs("div",{className:"mt-4 border border-gray-200 rounded-lg p-4",children:[s.jsx("p",{className:"text-sm text-gray-600",children:"테크몰에 3번이나 방문하셨네요!"}),s.jsx("p",{className:"text-sm text-gray-600",children:"최대 혜택을 받을 수 있는 카드를 추천해드릴까요?"}),s.jsx("div",{className:"flex justify-end mt-2",children:s.jsx("a",{href:"https://pc.wooricard.com/dcpc/main.do",target:"_blank",rel:"noopener noreferrer",className:"text-sm text-blue-600 font-medium hover:underline",children:"카드 추천 받으러 가기 →"})})]}),s.jsx("div",{className:"mt-4 overflow-hidden",children:s.jsx("img",{src:"/starbucks.png",alt:"별이 쏟아지는, 스타벅스 현대카드",className:"w-full h-auto"})})]})}Ie.propTypes={merchantName:p.string.isRequired,productName:p.string.isRequired,quantity:p.number.isRequired,totalAmount:p.number.isRequired};function Le({cards:e,bestDiscountCard:t,selectedCard:r,onCardSelect:o,onProceedToPayment:n}){return s.jsxs("div",{className:"flex-1 p-6",children:[s.jsx("h2",{className:"text-xl font-bold mb-4",children:"결제 카드 선택"}),s.jsxs("div",{className:`${(r==null?void 0:r.id)===t.id?"bg-blue-100 border-2 border-blue-500":"bg-white border border-gray-200 hover:border-gray-300"} rounded-lg overflow-hidden mb-4 flex flex-col cursor-pointer`,onClick:()=>o(t),children:[s.jsxs("div",{className:"flex items-center px-3 pt-3",children:[s.jsx(yr,{className:"text-green-500 mr-2 size-5"}),s.jsx("span",{className:"text-green-500 text-base font-semibold",children:"최고 혜택 추천 카드"}),s.jsx("span",{className:"ml-auto bg-black text-white text-sm px-3 py-0.5 rounded-full",children:"대표"})]}),s.jsxs("div",{className:"flex items-center px-3",children:[s.jsx("div",{className:"flex items-center justify-center min-w-[100px] min-h-[100px] mr-3 overflow-hidden",children:s.jsx("img",{src:"/everydiscount.png",alt:"카드의정석 EVERY DISCOUNT",className:"h-24 w-auto -rotate-90 object-contain"})}),s.jsxs("div",{children:[s.jsxs("p",{className:"text-lg font-bold whitespace-nowrap overflow-hidden text-ellipsis max-w-[270px]",children:[t.number," ",t.name]}),s.jsxs("div",{className:"bg-green-100 text-green-800 text-[10px] font-medium px-2 py-0.5 rounded-full inline-block mt-1",children:[t.discount,"% 할인"]})]})]}),(r==null?void 0:r.id)===t.id&&s.jsx("div",{className:"px-3 pb-3 mt-2",children:s.jsx("button",{onClick:a=>{a.stopPropagation(),n()},className:"w-full bg-blue-500 hover:bg-blue-600 text-white py-2 text-sm font-medium rounded-lg",children:"이 카드로 결제하기"})})]}),e.filter(a=>a.id!==t.id).map(a=>s.jsxs("div",{className:`${(r==null?void 0:r.id)===a.id?"bg-blue-100 border-2 border-blue-500":"bg-white border border-gray-200 hover:border-gray-300"} rounded-lg mb-3 overflow-hidden cursor-pointer`,onClick:()=>o(a),children:[s.jsxs("div",{className:"flex px-4 py-2 items-center",children:[s.jsx("div",{className:"flex items-center justify-center min-w-[60px] min-h-[60px] mr-3 overflow-hidden",children:s.jsx("img",{src:a.logo||"/placeholder.svg",alt:a.name,className:"h-14 w-auto -rotate-90 object-contain"})}),s.jsxs("div",{className:"flex flex-col justify-center",children:[s.jsxs("p",{className:"text-sm font-medium leading-tight",children:[a.number," ",a.name]}),s.jsx("span",{className:"mt-1 bg-gray-100 text-gray-800 text-[10px] font-medium px-2 py-0.5 rounded-full inline-block w-fit",children:a.discount>0?`${a.discount}% 할인`:"할인 없음"})]})]}),(r==null?void 0:r.id)===a.id&&s.jsx("div",{className:"px-3 pb-3",children:s.jsx("button",{onClick:l=>{l.stopPropagation(),n()},className:"w-full bg-blue-500 hover:bg-blue-600 text-white py-2 text-sm font-medium rounded-lg",children:"이 카드로 결제하기"})})]},a.id)),s.jsx("button",{className:"w-full border border-dashed border-gray-300 rounded-lg py-3 mt-2 text-gray-600 hover:bg-gray-50",children:"+ 카드 등록하기"})]})}Le.propTypes={cards:p.arrayOf(p.shape({id:p.string.isRequired,number:p.string.isRequired,name:p.string.isRequired,logo:p.string,discount:p.number.isRequired})).isRequired,bestDiscountCard:p.shape({id:p.string.isRequired,number:p.string.isRequired,name:p.string.isRequired,logo:p.string,discount:p.number.isRequired}).isRequired,selectedCard:p.shape({id:p.string.isRequired,number:p.string.isRequired,name:p.string.isRequired,logo:p.string,discount:p.number.isRequired}),onCardSelect:p.func.isRequired,onProceedToPayment:p.func.isRequired};function Ee(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function wr(...e){return t=>{let r=!1;const o=e.map(n=>{const a=Ee(n,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let n=0;n<o.length;n++){const a=o[n];typeof a=="function"?a():Ee(e[n],null)}}}}function kr(e){const t=Nr(e),r=O.forwardRef((o,n)=>{const{children:a,...l}=o,m=O.Children.toArray(a),u=m.find(Sr);if(u){const h=u.props.children,v=m.map(j=>j===u?O.Children.count(h)>1?O.Children.only(null):O.isValidElement(h)?h.props.children:null:j);return s.jsx(t,{...l,ref:n,children:O.isValidElement(h)?O.cloneElement(h,void 0,v):null})}return s.jsx(t,{...l,ref:n,children:a})});return r.displayName=`${e}.Slot`,r}var jr=kr("Slot");function Nr(e){const t=O.forwardRef((r,o)=>{const{children:n,...a}=r;if(O.isValidElement(n)){const l=Cr(n),m=Er(a,n.props);return n.type!==O.Fragment&&(m.ref=o?wr(o,l):l),O.cloneElement(n,m)}return O.Children.count(n)>1?O.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Rr=Symbol("radix.slottable");function Sr(e){return O.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Rr}function Er(e,t){const r={...t};for(const o in t){const n=e[o],a=t[o];/^on[A-Z]/.test(o)?n&&a?r[o]=(...m)=>{const u=a(...m);return n(...m),u}:n&&(r[o]=n):o==="style"?r[o]={...n,...a}:o==="className"&&(r[o]=[n,a].filter(Boolean).join(" "))}return{...e,...r}}function Cr(e){var o,n;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(n=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Ve(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(r=Ve(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function $e(){for(var e,t,r=0,o="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=Ve(e))&&(o&&(o+=" "),o+=t);return o}const Ce=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ae=$e,Ar=(e,t)=>r=>{var o;if((t==null?void 0:t.variants)==null)return Ae(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:n,defaultVariants:a}=t,l=Object.keys(n).map(h=>{const v=r==null?void 0:r[h],j=a==null?void 0:a[h];if(v===null)return null;const E=Ce(v)||Ce(j);return n[h][E]}),m=r&&Object.entries(r).reduce((h,v)=>{let[j,E]=v;return E===void 0||(h[j]=E),h},{}),u=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((h,v)=>{let{class:j,className:E,...M}=v;return Object.entries(M).every(P=>{let[N,z]=P;return Array.isArray(z)?z.includes({...a,...m}[N]):{...a,...m}[N]===z})?[...h,j,E]:h},[]);return Ae(e,l,u,r==null?void 0:r.class,r==null?void 0:r.className)},je="-",Pr=e=>{const t=_r(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:l=>{const m=l.split(je);return m[0]===""&&m.length!==1&&m.shift(),Ge(m,t)||Tr(l)},getConflictingClassGroupIds:(l,m)=>{const u=r[l]||[];return m&&o[l]?[...u,...o[l]]:u}}},Ge=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const r=e[0],o=t.nextPart.get(r),n=o?Ge(e.slice(1),o):void 0;if(n)return n;if(t.validators.length===0)return;const a=e.join(je);return(l=t.validators.find(({validator:m})=>m(a)))==null?void 0:l.classGroupId},Pe=/^\[(.+)\]$/,Tr=e=>{if(Pe.test(e)){const t=Pe.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},_r=e=>{const{theme:t,classGroups:r}=e,o={nextPart:new Map,validators:[]};for(const n in r)ye(r[n],o,n,t);return o},ye=(e,t,r,o)=>{e.forEach(n=>{if(typeof n=="string"){const a=n===""?t:Te(t,n);a.classGroupId=r;return}if(typeof n=="function"){if(zr(n)){ye(n(o),t,r,o);return}t.validators.push({validator:n,classGroupId:r});return}Object.entries(n).forEach(([a,l])=>{ye(l,Te(t,a),r,o)})})},Te=(e,t)=>{let r=e;return t.split(je).forEach(o=>{r.nextPart.has(o)||r.nextPart.set(o,{nextPart:new Map,validators:[]}),r=r.nextPart.get(o)}),r},zr=e=>e.isThemeGetter,Or=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,o=new Map;const n=(a,l)=>{r.set(a,l),t++,t>e&&(t=0,o=r,r=new Map)};return{get(a){let l=r.get(a);if(l!==void 0)return l;if((l=o.get(a))!==void 0)return n(a,l),l},set(a,l){r.has(a)?r.set(a,l):n(a,l)}}},ve="!",we=":",Mr=we.length,qr=e=>{const{prefix:t,experimentalParseClassName:r}=e;let o=n=>{const a=[];let l=0,m=0,u=0,h;for(let P=0;P<n.length;P++){let N=n[P];if(l===0&&m===0){if(N===we){a.push(n.slice(u,P)),u=P+Mr;continue}if(N==="/"){h=P;continue}}N==="["?l++:N==="]"?l--:N==="("?m++:N===")"&&m--}const v=a.length===0?n:n.substring(u),j=Ir(v),E=j!==v,M=h&&h>u?h-u:void 0;return{modifiers:a,hasImportantModifier:E,baseClassName:j,maybePostfixModifierPosition:M}};if(t){const n=t+we,a=o;o=l=>l.startsWith(n)?a(l.substring(n.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:l,maybePostfixModifierPosition:void 0}}if(r){const n=o;o=a=>r({className:a,parseClassName:n})}return o},Ir=e=>e.endsWith(ve)?e.substring(0,e.length-1):e.startsWith(ve)?e.substring(1):e,Lr=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;const n=[];let a=[];return o.forEach(l=>{l[0]==="["||t[l]?(n.push(...a.sort(),l),a=[]):a.push(l)}),n.push(...a.sort()),n}},Vr=e=>({cache:Or(e.cacheSize),parseClassName:qr(e),sortModifiers:Lr(e),...Pr(e)}),$r=/\s+/,Gr=(e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:n,sortModifiers:a}=t,l=[],m=e.trim().split($r);let u="";for(let h=m.length-1;h>=0;h-=1){const v=m[h],{isExternal:j,modifiers:E,hasImportantModifier:M,baseClassName:P,maybePostfixModifierPosition:N}=r(v);if(j){u=v+(u.length>0?" "+u:u);continue}let z=!!N,T=o(z?P.substring(0,N):P);if(!T){if(!z){u=v+(u.length>0?" "+u:u);continue}if(T=o(P),!T){u=v+(u.length>0?" "+u:u);continue}z=!1}const q=a(E).join(":"),H=M?q+ve:q,D=H+T;if(l.includes(D))continue;l.push(D);const U=n(T,z);for(let G=0;G<U.length;++G){const J=U[G];l.push(H+J)}u=v+(u.length>0?" "+u:u)}return u};function Fr(){let e=0,t,r,o="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Fe(t))&&(o&&(o+=" "),o+=r);return o}const Fe=e=>{if(typeof e=="string")return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=Fe(e[o]))&&(r&&(r+=" "),r+=t);return r};function Wr(e,...t){let r,o,n,a=l;function l(u){const h=t.reduce((v,j)=>j(v),e());return r=Vr(h),o=r.cache.get,n=r.cache.set,a=m,m(u)}function m(u){const h=o(u);if(h)return h;const v=Gr(u,r);return n(u,v),v}return function(){return a(Fr.apply(null,arguments))}}const A=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},We=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,De=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Dr=/^\d+\/\d+$/,Ur=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Yr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Br=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Hr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Jr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,re=e=>Dr.test(e),x=e=>!!e&&!Number.isNaN(Number(e)),B=e=>!!e&&Number.isInteger(Number(e)),ge=e=>e.endsWith("%")&&x(e.slice(0,-1)),W=e=>Ur.test(e),Xr=()=>!0,Zr=e=>Yr.test(e)&&!Br.test(e),Ue=()=>!1,Kr=e=>Hr.test(e),Qr=e=>Jr.test(e),et=e=>!c(e)&&!d(e),rt=e=>oe(e,He,Ue),c=e=>We.test(e),K=e=>oe(e,Je,Zr),he=e=>oe(e,at,x),_e=e=>oe(e,Ye,Ue),tt=e=>oe(e,Be,Qr),fe=e=>oe(e,Xe,Kr),d=e=>De.test(e),ce=e=>se(e,Je),ot=e=>se(e,it),ze=e=>se(e,Ye),st=e=>se(e,He),nt=e=>se(e,Be),pe=e=>se(e,Xe,!0),oe=(e,t,r)=>{const o=We.exec(e);return o?o[1]?t(o[1]):r(o[2]):!1},se=(e,t,r=!1)=>{const o=De.exec(e);return o?o[1]?t(o[1]):r:!1},Ye=e=>e==="position"||e==="percentage",Be=e=>e==="image"||e==="url",He=e=>e==="length"||e==="size"||e==="bg-size",Je=e=>e==="length",at=e=>e==="number",it=e=>e==="family-name",Xe=e=>e==="shadow",lt=()=>{const e=A("color"),t=A("font"),r=A("text"),o=A("font-weight"),n=A("tracking"),a=A("leading"),l=A("breakpoint"),m=A("container"),u=A("spacing"),h=A("radius"),v=A("shadow"),j=A("inset-shadow"),E=A("text-shadow"),M=A("drop-shadow"),P=A("blur"),N=A("perspective"),z=A("aspect"),T=A("ease"),q=A("animate"),H=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],U=()=>[...D(),d,c],G=()=>["auto","hidden","clip","visible","scroll"],J=()=>["auto","contain","none"],b=()=>[d,c,u],L=()=>[re,"full","auto",...b()],de=()=>[B,"none","subgrid",d,c],Q=()=>["auto",{span:["full",B,d,c]},B,d,c],X=()=>[B,"auto",d,c],ue=()=>["auto","min","max","fr",d,c],Z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],F=()=>["start","end","center","stretch","center-safe","end-safe"],I=()=>["auto",...b()],$=()=>[re,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...b()],f=()=>[e,d,c],ne=()=>[...D(),ze,_e,{position:[d,c]}],i=()=>["no-repeat",{repeat:["","x","y","space","round"]}],g=()=>["auto","cover","contain",st,rt,{size:[d,c]}],w=()=>[ge,ce,K],y=()=>["","none","full",h,d,c],R=()=>["",x,ce,K],_=()=>["solid","dashed","dotted","double"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],S=()=>[x,ge,ze,_e],C=()=>["","none",P,d,c],V=()=>["none",x,d,c],Y=()=>["none",x,d,c],ae=()=>[x,d,c],me=()=>[re,"full",...b()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[W],breakpoint:[W],color:[Xr],container:[W],"drop-shadow":[W],ease:["in","out","in-out"],font:[et],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[W],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[W],shadow:[W],spacing:["px",x],text:[W],"text-shadow":[W],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",re,c,d,z]}],container:["container"],columns:[{columns:[x,c,d,m]}],"break-after":[{"break-after":H()}],"break-before":[{"break-before":H()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:U()}],overflow:[{overflow:G()}],"overflow-x":[{"overflow-x":G()}],"overflow-y":[{"overflow-y":G()}],overscroll:[{overscroll:J()}],"overscroll-x":[{"overscroll-x":J()}],"overscroll-y":[{"overscroll-y":J()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{start:L()}],end:[{end:L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[B,"auto",d,c]}],basis:[{basis:[re,"full","auto",m,...b()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[x,re,"auto","initial","none",c]}],grow:[{grow:["",x,d,c]}],shrink:[{shrink:["",x,d,c]}],order:[{order:[B,"first","last","none",d,c]}],"grid-cols":[{"grid-cols":de()}],"col-start-end":[{col:Q()}],"col-start":[{"col-start":X()}],"col-end":[{"col-end":X()}],"grid-rows":[{"grid-rows":de()}],"row-start-end":[{row:Q()}],"row-start":[{"row-start":X()}],"row-end":[{"row-end":X()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ue()}],"auto-rows":[{"auto-rows":ue()}],gap:[{gap:b()}],"gap-x":[{"gap-x":b()}],"gap-y":[{"gap-y":b()}],"justify-content":[{justify:[...Z(),"normal"]}],"justify-items":[{"justify-items":[...F(),"normal"]}],"justify-self":[{"justify-self":["auto",...F()]}],"align-content":[{content:["normal",...Z()]}],"align-items":[{items:[...F(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...F(),{baseline:["","last"]}]}],"place-content":[{"place-content":Z()}],"place-items":[{"place-items":[...F(),"baseline"]}],"place-self":[{"place-self":["auto",...F()]}],p:[{p:b()}],px:[{px:b()}],py:[{py:b()}],ps:[{ps:b()}],pe:[{pe:b()}],pt:[{pt:b()}],pr:[{pr:b()}],pb:[{pb:b()}],pl:[{pl:b()}],m:[{m:I()}],mx:[{mx:I()}],my:[{my:I()}],ms:[{ms:I()}],me:[{me:I()}],mt:[{mt:I()}],mr:[{mr:I()}],mb:[{mb:I()}],ml:[{ml:I()}],"space-x":[{"space-x":b()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":b()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],w:[{w:[m,"screen",...$()]}],"min-w":[{"min-w":[m,"screen","none",...$()]}],"max-w":[{"max-w":[m,"screen","none","prose",{screen:[l]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",r,ce,K]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,d,he]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ge,c]}],"font-family":[{font:[ot,c,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[n,d,c]}],"line-clamp":[{"line-clamp":[x,"none",d,he]}],leading:[{leading:[a,...b()]}],"list-image":[{"list-image":["none",d,c]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",d,c]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:f()}],"text-color":[{text:f()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[..._(),"wavy"]}],"text-decoration-thickness":[{decoration:[x,"from-font","auto",d,K]}],"text-decoration-color":[{decoration:f()}],"underline-offset":[{"underline-offset":[x,"auto",d,c]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:b()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",d,c]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",d,c]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:i()}],"bg-size":[{bg:g()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},B,d,c],radial:["",d,c],conic:[B,d,c]},nt,tt]}],"bg-color":[{bg:f()}],"gradient-from-pos":[{from:w()}],"gradient-via-pos":[{via:w()}],"gradient-to-pos":[{to:w()}],"gradient-from":[{from:f()}],"gradient-via":[{via:f()}],"gradient-to":[{to:f()}],rounded:[{rounded:y()}],"rounded-s":[{"rounded-s":y()}],"rounded-e":[{"rounded-e":y()}],"rounded-t":[{"rounded-t":y()}],"rounded-r":[{"rounded-r":y()}],"rounded-b":[{"rounded-b":y()}],"rounded-l":[{"rounded-l":y()}],"rounded-ss":[{"rounded-ss":y()}],"rounded-se":[{"rounded-se":y()}],"rounded-ee":[{"rounded-ee":y()}],"rounded-es":[{"rounded-es":y()}],"rounded-tl":[{"rounded-tl":y()}],"rounded-tr":[{"rounded-tr":y()}],"rounded-br":[{"rounded-br":y()}],"rounded-bl":[{"rounded-bl":y()}],"border-w":[{border:R()}],"border-w-x":[{"border-x":R()}],"border-w-y":[{"border-y":R()}],"border-w-s":[{"border-s":R()}],"border-w-e":[{"border-e":R()}],"border-w-t":[{"border-t":R()}],"border-w-r":[{"border-r":R()}],"border-w-b":[{"border-b":R()}],"border-w-l":[{"border-l":R()}],"divide-x":[{"divide-x":R()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":R()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[..._(),"hidden","none"]}],"divide-style":[{divide:[..._(),"hidden","none"]}],"border-color":[{border:f()}],"border-color-x":[{"border-x":f()}],"border-color-y":[{"border-y":f()}],"border-color-s":[{"border-s":f()}],"border-color-e":[{"border-e":f()}],"border-color-t":[{"border-t":f()}],"border-color-r":[{"border-r":f()}],"border-color-b":[{"border-b":f()}],"border-color-l":[{"border-l":f()}],"divide-color":[{divide:f()}],"outline-style":[{outline:[..._(),"none","hidden"]}],"outline-offset":[{"outline-offset":[x,d,c]}],"outline-w":[{outline:["",x,ce,K]}],"outline-color":[{outline:f()}],shadow:[{shadow:["","none",v,pe,fe]}],"shadow-color":[{shadow:f()}],"inset-shadow":[{"inset-shadow":["none",j,pe,fe]}],"inset-shadow-color":[{"inset-shadow":f()}],"ring-w":[{ring:R()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:f()}],"ring-offset-w":[{"ring-offset":[x,K]}],"ring-offset-color":[{"ring-offset":f()}],"inset-ring-w":[{"inset-ring":R()}],"inset-ring-color":[{"inset-ring":f()}],"text-shadow":[{"text-shadow":["none",E,pe,fe]}],"text-shadow-color":[{"text-shadow":f()}],opacity:[{opacity:[x,d,c]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[x]}],"mask-image-linear-from-pos":[{"mask-linear-from":S()}],"mask-image-linear-to-pos":[{"mask-linear-to":S()}],"mask-image-linear-from-color":[{"mask-linear-from":f()}],"mask-image-linear-to-color":[{"mask-linear-to":f()}],"mask-image-t-from-pos":[{"mask-t-from":S()}],"mask-image-t-to-pos":[{"mask-t-to":S()}],"mask-image-t-from-color":[{"mask-t-from":f()}],"mask-image-t-to-color":[{"mask-t-to":f()}],"mask-image-r-from-pos":[{"mask-r-from":S()}],"mask-image-r-to-pos":[{"mask-r-to":S()}],"mask-image-r-from-color":[{"mask-r-from":f()}],"mask-image-r-to-color":[{"mask-r-to":f()}],"mask-image-b-from-pos":[{"mask-b-from":S()}],"mask-image-b-to-pos":[{"mask-b-to":S()}],"mask-image-b-from-color":[{"mask-b-from":f()}],"mask-image-b-to-color":[{"mask-b-to":f()}],"mask-image-l-from-pos":[{"mask-l-from":S()}],"mask-image-l-to-pos":[{"mask-l-to":S()}],"mask-image-l-from-color":[{"mask-l-from":f()}],"mask-image-l-to-color":[{"mask-l-to":f()}],"mask-image-x-from-pos":[{"mask-x-from":S()}],"mask-image-x-to-pos":[{"mask-x-to":S()}],"mask-image-x-from-color":[{"mask-x-from":f()}],"mask-image-x-to-color":[{"mask-x-to":f()}],"mask-image-y-from-pos":[{"mask-y-from":S()}],"mask-image-y-to-pos":[{"mask-y-to":S()}],"mask-image-y-from-color":[{"mask-y-from":f()}],"mask-image-y-to-color":[{"mask-y-to":f()}],"mask-image-radial":[{"mask-radial":[d,c]}],"mask-image-radial-from-pos":[{"mask-radial-from":S()}],"mask-image-radial-to-pos":[{"mask-radial-to":S()}],"mask-image-radial-from-color":[{"mask-radial-from":f()}],"mask-image-radial-to-color":[{"mask-radial-to":f()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":D()}],"mask-image-conic-pos":[{"mask-conic":[x]}],"mask-image-conic-from-pos":[{"mask-conic-from":S()}],"mask-image-conic-to-pos":[{"mask-conic-to":S()}],"mask-image-conic-from-color":[{"mask-conic-from":f()}],"mask-image-conic-to-color":[{"mask-conic-to":f()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:i()}],"mask-size":[{mask:g()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",d,c]}],filter:[{filter:["","none",d,c]}],blur:[{blur:C()}],brightness:[{brightness:[x,d,c]}],contrast:[{contrast:[x,d,c]}],"drop-shadow":[{"drop-shadow":["","none",M,pe,fe]}],"drop-shadow-color":[{"drop-shadow":f()}],grayscale:[{grayscale:["",x,d,c]}],"hue-rotate":[{"hue-rotate":[x,d,c]}],invert:[{invert:["",x,d,c]}],saturate:[{saturate:[x,d,c]}],sepia:[{sepia:["",x,d,c]}],"backdrop-filter":[{"backdrop-filter":["","none",d,c]}],"backdrop-blur":[{"backdrop-blur":C()}],"backdrop-brightness":[{"backdrop-brightness":[x,d,c]}],"backdrop-contrast":[{"backdrop-contrast":[x,d,c]}],"backdrop-grayscale":[{"backdrop-grayscale":["",x,d,c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[x,d,c]}],"backdrop-invert":[{"backdrop-invert":["",x,d,c]}],"backdrop-opacity":[{"backdrop-opacity":[x,d,c]}],"backdrop-saturate":[{"backdrop-saturate":[x,d,c]}],"backdrop-sepia":[{"backdrop-sepia":["",x,d,c]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":b()}],"border-spacing-x":[{"border-spacing-x":b()}],"border-spacing-y":[{"border-spacing-y":b()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",d,c]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[x,"initial",d,c]}],ease:[{ease:["linear","initial",T,d,c]}],delay:[{delay:[x,d,c]}],animate:[{animate:["none",q,d,c]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[N,d,c]}],"perspective-origin":[{"perspective-origin":U()}],rotate:[{rotate:V()}],"rotate-x":[{"rotate-x":V()}],"rotate-y":[{"rotate-y":V()}],"rotate-z":[{"rotate-z":V()}],scale:[{scale:Y()}],"scale-x":[{"scale-x":Y()}],"scale-y":[{"scale-y":Y()}],"scale-z":[{"scale-z":Y()}],"scale-3d":["scale-3d"],skew:[{skew:ae()}],"skew-x":[{"skew-x":ae()}],"skew-y":[{"skew-y":ae()}],transform:[{transform:[d,c,"","none","gpu","cpu"]}],"transform-origin":[{origin:U()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:me()}],"translate-x":[{"translate-x":me()}],"translate-y":[{"translate-y":me()}],"translate-z":[{"translate-z":me()}],"translate-none":["translate-none"],accent:[{accent:f()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:f()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",d,c]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":b()}],"scroll-mx":[{"scroll-mx":b()}],"scroll-my":[{"scroll-my":b()}],"scroll-ms":[{"scroll-ms":b()}],"scroll-me":[{"scroll-me":b()}],"scroll-mt":[{"scroll-mt":b()}],"scroll-mr":[{"scroll-mr":b()}],"scroll-mb":[{"scroll-mb":b()}],"scroll-ml":[{"scroll-ml":b()}],"scroll-p":[{"scroll-p":b()}],"scroll-px":[{"scroll-px":b()}],"scroll-py":[{"scroll-py":b()}],"scroll-ps":[{"scroll-ps":b()}],"scroll-pe":[{"scroll-pe":b()}],"scroll-pt":[{"scroll-pt":b()}],"scroll-pr":[{"scroll-pr":b()}],"scroll-pb":[{"scroll-pb":b()}],"scroll-pl":[{"scroll-pl":b()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",d,c]}],fill:[{fill:["none",...f()]}],"stroke-w":[{stroke:[x,ce,K,he]}],stroke:[{stroke:["none",...f()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ct=Wr(lt);function dt(...e){return ct($e(e))}const ut=Ar("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function be({className:e,variant:t,size:r,asChild:o=!1,...n}){const a=o?jr:"button";return s.jsx(a,{"data-slot":"button",className:dt(ut({variant:t,size:r,className:e})),...n})}function Ze({onNumberClick:e,onDeleteClick:t}){const[r,o]=k.useState([]);k.useEffect(()=>{n()},[]);const n=()=>{const l=[1,2,3,4,5,6,7,8,9];for(let m=l.length-1;m>0;m--){const u=Math.floor(Math.random()*(m+1));[l[m],l[u]]=[l[u],l[m]]}o(l)},a=()=>{n()};return s.jsx("div",{className:"flex flex-col gap-4",children:s.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[r.map(l=>s.jsx(be,{type:"button",onClick:()=>e(l),className:"h-16 text-2xl font-medium text-gray-900 hover:bg-gray-50",variant:"ghost",children:l},l)),s.jsx(be,{type:"button",onClick:a,className:"h-16 text-gray-900 hover:bg-gray-50",variant:"ghost",children:s.jsx(br,{className:"size-5"})}),s.jsx(be,{type:"button",onClick:()=>e(0),className:"h-16 text-2xl font-medium bg-white text-gray-900 hover:bg-gray-50",variant:"ghost",children:"0"}),s.jsx(be,{type:"button",onClick:t,className:"h-16 text-gray-900 hover:bg-gray-50",variant:"ghost",children:s.jsx(hr,{className:"size-5"})})]})})}Ze.propTypes={onNumberClick:p.func.isRequired,onDeleteClick:p.func.isRequired};function Ke({selectedCard:e,password:t,onClose:r,onPasswordInput:o,onPasswordDelete:n}){return s.jsxs("div",{className:"absolute inset-0 bg-white z-10 flex flex-col items-center justify-center",children:[s.jsx("button",{onClick:r,className:"absolute left-4 top-4 text-gray-500 hover:text-gray-700","aria-label":"비밀번호 입력 취소",children:s.jsx(cr,{className:"size-6"})}),s.jsxs("div",{className:"mb-6 text-center",children:[s.jsx("h3",{className:"mb-1 text-xl font-bold",children:e.name}),s.jsx("p",{className:"text-sm text-gray-600",children:e.number})]}),s.jsxs("div",{className:"mb-6",children:[s.jsx("p",{className:"mb-12 text-center text-sm text-gray-600",children:"간편 결제를 위한 6자리 비밀번호를 입력해주세요."}),s.jsx("div",{className:"flex justify-center gap-3",children:[0,1,2,3,4,5].map(a=>s.jsx("div",{className:"flex items-center justify-center w-6 h-6",children:t.length>a?s.jsx("div",{className:"w-2 h-2 bg-black rounded-full"}):s.jsx("div",{className:"w-6 h-0.5 bg-black"})},a))})]}),s.jsx("div",{className:"w-64",children:s.jsx(Ze,{onNumberClick:o,onDeleteClick:n})})]})}Ke.propTypes={selectedCard:p.shape({id:p.string.isRequired,number:p.string.isRequired,name:p.string.isRequired,logo:p.string,discount:p.number.isRequired}).isRequired,password:p.string.isRequired,onClose:p.func.isRequired,onPasswordInput:p.func.isRequired,onPasswordDelete:p.func.isRequired};const Oe=[{id:1,name:"카드의정석 EVERY DISCOUNT",number:"(1234)",color:"bg-gradient-to-r from-green-600 to-green-700",logo:"/everydiscount.png",discount:10,benefits:["온라인 쇼핑몰 10% 할인","5만원 이상 결제 시 2천원 할인","해외 직구 무료 배송"]},{id:2,name:"현대카드 MX Black Edition2",number:"(1234)",color:"bg-gradient-to-r from-orange-300 to-orange-400",logo:"/hyundaiblack.png",discount:5,benefits:["프리미엄 서비스 무료 이용","공항 라운지 무료 이용","해외 결제 수수료 면제"]},{id:3,name:"삼성카드 taptap O",number:"(1234)",color:"bg-gradient-to-r from-pink-400 to-pink-500",logo:"/taptap0.png",discount:3,benefits:["온라인몰 7% 할인","생활비 자동이체 할인","영화 티켓 1+1 혜택"]},{id:4,name:"카드의정석 오하CHECK",number:"(1234)",color:"bg-gradient-to-r from-gray-800 to-gray-900",logo:"/ohacheck.png",discount:0,benefits:["현금 할인","무이자 할부 최대 12개월","생일 월 추가 5% 할인"]}];function Qe({paymentInfo:e,onPaymentComplete:t}){const r=k.useRef(null);k.useRef(null),k.useEffect(()=>{r.current&&r.current.focus()},[]);const o=k.useMemo(()=>Oe.reduce((T,q)=>T.discount>q.discount?T:q),[]),[n,a]=k.useState("select-card"),[l,m]=k.useState(o),[u,h]=k.useState(""),v=k.useCallback(T=>{if(u.length<6){const q=u+T;h(q),q.length===6&&(a("processing"),setTimeout(()=>{a("complete")},2e3))}},[u]),j=k.useCallback(()=>{u.length>0&&h(u.slice(0,-1))},[u]),E=k.useCallback(T=>{m(T)},[]),M=k.useCallback(()=>{l&&a("enter-password")},[l]),P=k.useCallback(()=>{t&&(localStorage.setItem("paymentCompleted","true"),t())},[t]),N=k.useMemo(()=>l?Math.round(e.totalAmount*l.discount/100):0,[l,e.totalAmount]),z=k.useMemo(()=>e.totalAmount-N,[e.totalAmount,N]);return k.useCallback(()=>{window.close()},[n]),s.jsxs("div",{ref:r,className:`${n==="select-card"?"sm:max-w-[1000px]":"sm:max-w-[400px]"} transition-none h-[720px] px-6 pb-6 pt-0 gap-0 border-0 overflow-hidden bg-white`,role:"dialog","aria-modal":"true","aria-labelledby":"payment-modal-title",tabIndex:-1,children:[s.jsx(ke,{children:s.jsx("h2",{id:"payment-modal-title",className:"text-lg leading-none font-semibold sr-only",children:"결제 모달"})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("div",{className:"relative flex items-center justify-center h-16",children:s.jsx(qe,{className:"text-2xl"})}),s.jsx("div",{className:"h-px w-19/20 mx-auto bg-gray-200"}),s.jsxs("div",{className:"flex flex-col md:flex-row",children:[s.jsx(Ie,{merchantName:e.merchantName,productName:e.productName,quantity:e.quantity,totalAmount:e.totalAmount}),s.jsx(Le,{cards:Oe,bestDiscountCard:o,selectedCard:l,onCardSelect:E,onProceedToPayment:M})]}),n==="enter-password"&&l&&s.jsx(Ke,{selectedCard:l,password:u,onClose:()=>a("select-card"),onPasswordInput:v,onPasswordDelete:j}),n==="processing"&&s.jsxs("div",{className:"absolute inset-0 bg-white z-10 flex flex-col items-center justify-center",children:[s.jsx("div",{className:"mb-4 flex justify-center",children:s.jsx("div",{className:"size-12 animate-spin rounded-full border-4 border-gray-200 border-t-blue-600"})}),s.jsx("h3",{className:"mb-1 text-lg font-medium",children:"결제 처리 중"}),s.jsx("p",{className:"text-sm text-gray-600",children:"잠시만 기다려주세요..."})]}),n==="complete"&&s.jsx("div",{className:"absolute inset-0 bg-white z-10 flex flex-col",children:s.jsxs("div",{className:"flex-1 flex flex-col items-center px-6 py-24 max-w-md mx-auto w-full",children:[s.jsx("div",{className:"rounded-full bg-green-100 p-4 mb-4",children:s.jsx(fr,{className:"size-8 text-green-500"})}),s.jsx("h3",{className:"text-xl font-bold mb-1",children:"결제 완료"}),s.jsx("p",{className:"text-gray-600 mb-6 text-center",children:"결제가 성공적으로 완료되었습니다."}),s.jsx("div",{className:"bg-blue-50 rounded-lg p-4 mb-6 w-full text-center",children:s.jsx("p",{className:"text-sm text-gray-700",children:"이용해주셔서 감사합니다. 결제 내역은 홈페이지에서 확인하실 수 있습니다."})}),s.jsxs("div",{className:"bg-gray-100 rounded-lg p-4 w-full mb-6",children:[s.jsxs("div",{className:"flex justify-between py-2",children:[s.jsx("span",{className:"text-gray-700",children:"상점명"}),s.jsx("span",{className:"font-medium text-gray-900",children:e.merchantName})]}),s.jsxs("div",{className:"flex justify-between py-2",children:[s.jsx("span",{className:"text-gray-700",children:"상품명"}),s.jsx("span",{className:"font-medium text-gray-900",children:e.productName})]}),s.jsxs("div",{className:"flex justify-between py-2",children:[s.jsx("span",{className:"text-gray-700",children:"수량"}),s.jsxs("span",{className:"font-medium text-gray-900",children:[e.quantity,"개"]})]}),s.jsxs("div",{className:"flex justify-between py-2",children:[s.jsx("span",{className:"text-gray-700",children:"결제 금액"}),s.jsxs("span",{className:"font-bold text-gray-900",children:[e.totalAmount.toLocaleString(),"원"]})]}),s.jsxs("div",{className:"flex justify-between py-2",children:[s.jsx("span",{className:"text-gray-700",children:"할인 금액"}),s.jsxs("span",{className:"font-medium text-green-500",children:["-",N.toLocaleString(),"원"]})]}),s.jsxs("div",{className:"flex justify-between py-2 border-t border-gray-200 mt-2 pt-3",children:[s.jsx("span",{className:"text-gray-900 font-bold",children:"최종 결제 금액"}),s.jsxs("span",{className:"font-bold",children:[z.toLocaleString(),"원"]})]})]}),s.jsx("button",{onClick:P,className:"w-full bg-black hover:bg-gray-800 text-white py-4 font-medium rounded-lg","aria-label":"결제 완료 확인",children:"확인"})]})}),n==="error"&&s.jsxs("div",{className:"absolute inset-0 bg-white z-10 flex flex-col items-center justify-center",children:[s.jsx("div",{className:"mb-4 flex justify-center",children:s.jsx("div",{className:"rounded-full bg-red-100 p-3",children:s.jsx(ur,{className:"size-10 text-red-600"})})}),s.jsx("h3",{className:"mb-1 text-lg font-medium",children:"결제 실패"}),s.jsx("p",{className:"mb-6 text-sm text-gray-600",children:"결제 처리 중 오류가 발생했습니다."}),s.jsx("button",{onClick:()=>a("select-card"),className:"px-4 py-2 bg-black text-white rounded-lg hover:bg-gray-800",children:"다시 시도"})]})]})]})}Qe.propTypes={paymentInfo:p.shape({merchantName:p.string.isRequired,productName:p.string.isRequired,quantity:p.number.isRequired,price:p.number.isRequired,totalAmount:p.number.isRequired,orderId:p.string.isRequired}).isRequired,onPaymentComplete:p.func};exports.PaymentModal=Qe;
//# sourceMappingURL=payment-modal-Z_eyT_KN.js.map