import{r as c,x as le,f as Y,j as a,P as M,G as R,H as Ne,I as at,e as ot,g as O,h as ae,D as st,J as it,k as ct,y as lt,z as ut,b as F,X as dt,u as ft,B as ue}from"./index-B8VidBSF.js";import{u as z}from"./index-CT0wPN1H.js";import{S as mt}from"./switch-C-anknk1.js";import{d as vt,g as ht}from"./currency-BnYXjSXj.js";import{S as de}from"./sparkles-CPxxCvlX.js";import{C as L}from"./check-CtONhx55.js";var Z="focusScope.autoFocusOnMount",q="focusScope.autoFocusOnUnmount",fe={bubbles:!1,cancelable:!0},gt="FocusScope",Ce=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...u}=e,[o,d]=c.useState(null),v=le(s),g=le(i),f=c.useRef(null),p=Y(t,l=>d(l)),y=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let l=function(b){if(y.paused||!o)return;const E=b.target;o.contains(E)?f.current=E:D(f.current,{select:!0})},m=function(b){if(y.paused||!o)return;const E=b.relatedTarget;E!==null&&(o.contains(E)||D(f.current,{select:!0}))},h=function(b){if(document.activeElement===document.body)for(const N of b)N.removedNodes.length>0&&D(o)};document.addEventListener("focusin",l),document.addEventListener("focusout",m);const x=new MutationObserver(h);return o&&x.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",l),document.removeEventListener("focusout",m),x.disconnect()}}},[r,o,y.paused]),c.useEffect(()=>{if(o){ve.add(y);const l=document.activeElement;if(!o.contains(l)){const h=new CustomEvent(Z,fe);o.addEventListener(Z,v),o.dispatchEvent(h),h.defaultPrevented||(pt(Nt(Se(o)),{select:!0}),document.activeElement===l&&D(o))}return()=>{o.removeEventListener(Z,v),setTimeout(()=>{const h=new CustomEvent(q,fe);o.addEventListener(q,g),o.dispatchEvent(h),h.defaultPrevented||D(l??document.body,{select:!0}),o.removeEventListener(q,g),ve.remove(y)},0)}}},[o,v,g,y]);const C=c.useCallback(l=>{if(!n&&!r||y.paused)return;const m=l.key==="Tab"&&!l.altKey&&!l.ctrlKey&&!l.metaKey,h=document.activeElement;if(m&&h){const x=l.currentTarget,[b,E]=yt(x);b&&E?!l.shiftKey&&h===E?(l.preventDefault(),n&&D(b,{select:!0})):l.shiftKey&&h===b&&(l.preventDefault(),n&&D(E,{select:!0})):h===x&&l.preventDefault()}},[n,r,y.paused]);return a.jsx(M.div,{tabIndex:-1,...u,ref:p,onKeyDown:C})});Ce.displayName=gt;function pt(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(D(r,{select:t}),document.activeElement!==n)return}function yt(e){const t=Se(e),n=me(t,e),r=me(t.reverse(),e);return[n,r]}function Se(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function me(e,t){for(const n of e)if(!xt(n,{upTo:t}))return n}function xt(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function bt(e){return e instanceof HTMLInputElement&&"select"in e}function D(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&bt(e)&&t&&e.select()}}var ve=Et();function Et(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=he(e,t),e.unshift(t)},remove(t){var n;e=he(e,t),(n=e[0])==null||n.resume()}}}function he(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Nt(e){return e.filter(t=>t.tagName!=="A")}var Q=0;function Ct(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ge()),document.body.insertAdjacentElement("beforeend",e[1]??ge()),Q++,()=>{Q===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Q--}},[])}function ge(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var H="right-scroll-bar-position",G="width-before-scroll-bar",St="with-scroll-bars-hidden",wt="--removed-body-scroll-bar-size";function J(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Dt(e,t){var n=c.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var Rt=typeof window<"u"?c.useLayoutEffect:c.useEffect,pe=new WeakMap;function jt(e,t){var n=Dt(null,function(r){return e.forEach(function(s){return J(s,r)})});return Rt(function(){var r=pe.get(n);if(r){var s=new Set(r),i=new Set(e),u=n.current;s.forEach(function(o){i.has(o)||J(o,null)}),i.forEach(function(o){s.has(o)||J(o,u)})}pe.set(n,e)},[e]),n}function At(e){return e}function Tt(e,t){t===void 0&&(t=At);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var u=t(i,r);return n.push(u),function(){n=n.filter(function(o){return o!==u})}},assignSyncMedium:function(i){for(r=!0;n.length;){var u=n;n=[],u.forEach(i)}n={push:function(o){return i(o)},filter:function(){return n}}},assignMedium:function(i){r=!0;var u=[];if(n.length){var o=n;n=[],o.forEach(i),u=n}var d=function(){var g=u;u=[],g.forEach(i)},v=function(){return Promise.resolve().then(d)};v(),n={push:function(g){u.push(g),v()},filter:function(g){return u=u.filter(g),n}}}};return s}function Pt(e){e===void 0&&(e={});var t=Tt(null);return t.options=R({async:!0,ssr:!1},e),t}var we=function(e){var t=e.sideCar,n=Ne(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return c.createElement(r,R({},n))};we.isSideCarExport=!0;function kt(e,t){return e.useMedium(t),we}var De=Pt(),ee=function(){},V=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:ee,onWheelCapture:ee,onTouchMoveCapture:ee}),s=r[0],i=r[1],u=e.forwardProps,o=e.children,d=e.className,v=e.removeScrollBar,g=e.enabled,f=e.shards,p=e.sideCar,y=e.noRelative,C=e.noIsolation,l=e.inert,m=e.allowPinchZoom,h=e.as,x=h===void 0?"div":h,b=e.gapMode,E=Ne(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=p,A=jt([n,t]),w=R(R({},E),s);return c.createElement(c.Fragment,null,g&&c.createElement(N,{sideCar:De,removeScrollBar:v,shards:f,noRelative:y,noIsolation:C,inert:l,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:b}),u?c.cloneElement(c.Children.only(o),R(R({},w),{ref:A})):c.createElement(x,R({},w,{className:d,ref:A}),o))});V.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};V.classNames={fullWidth:G,zeroRight:H};var It=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Mt(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=It();return t&&e.setAttribute("nonce",t),e}function Ft(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ot(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var _t=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Mt())&&(Ft(t,n),Ot(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Lt=function(){var e=_t();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Re=function(){var e=Lt(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},Wt={left:0,top:0,right:0,gap:0},te=function(e){return parseInt(e||"",10)||0},Bt=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[te(n),te(r),te(s)]},Ut=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Wt;var t=Bt(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},$t=Re(),I="data-scroll-locked",Ht=function(e,t,n,r){var s=e.left,i=e.top,u=e.right,o=e.gap;return n===void 0&&(n="margin"),`
  .`.concat(St,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(o,"px ").concat(r,`;
  }
  body[`).concat(I,`] {
    overflow: hidden `).concat(r,`;
    overscroll-behavior: contain;
    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
    padding-left: `.concat(s,`px;
    padding-top: `).concat(i,`px;
    padding-right: `).concat(u,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(o,"px ").concat(r,`;
    `),n==="padding"&&"padding-right: ".concat(o,"px ").concat(r,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(H,` {
    right: `).concat(o,"px ").concat(r,`;
  }
  
  .`).concat(G,` {
    margin-right: `).concat(o,"px ").concat(r,`;
  }
  
  .`).concat(H," .").concat(H,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(G," .").concat(G,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body[`).concat(I,`] {
    `).concat(wt,": ").concat(o,`px;
  }
`)},ye=function(){var e=parseInt(document.body.getAttribute(I)||"0",10);return isFinite(e)?e:0},Gt=function(){c.useEffect(function(){return document.body.setAttribute(I,(ye()+1).toString()),function(){var e=ye()-1;e<=0?document.body.removeAttribute(I):document.body.setAttribute(I,e.toString())}},[])},Kt=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;Gt();var i=c.useMemo(function(){return Ut(s)},[s]);return c.createElement($t,{styles:Ht(i,!t,s,n?"":"!important")})},re=!1;if(typeof window<"u")try{var W=Object.defineProperty({},"passive",{get:function(){return re=!0,!0}});window.addEventListener("test",W,W),window.removeEventListener("test",W,W)}catch{re=!1}var T=re?{passive:!1}:!1,Yt=function(e){return e.tagName==="TEXTAREA"},je=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Yt(e)&&n[t]==="visible")},Vt=function(e){return je(e,"overflowY")},Xt=function(e){return je(e,"overflowX")},xe=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=Ae(e,r);if(s){var i=Te(e,r),u=i[1],o=i[2];if(u>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},zt=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Zt=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Ae=function(e,t){return e==="v"?Vt(t):Xt(t)},Te=function(e,t){return e==="v"?zt(t):Zt(t)},qt=function(e,t){return e==="h"&&t==="rtl"?-1:1},Qt=function(e,t,n,r,s){var i=qt(e,window.getComputedStyle(t).direction),u=i*r,o=n.target,d=t.contains(o),v=!1,g=u>0,f=0,p=0;do{if(!o)break;var y=Te(e,o),C=y[0],l=y[1],m=y[2],h=l-m-i*C;(C||h)&&Ae(e,o)&&(f+=h,p+=C);var x=o.parentNode;o=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!d&&o!==document.body||d&&(t.contains(o)||t===o));return(g&&(Math.abs(f)<1||!s)||!g&&(Math.abs(p)<1||!s))&&(v=!0),v},B=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},be=function(e){return[e.deltaX,e.deltaY]},Ee=function(e){return e&&"current"in e?e.current:e},Jt=function(e,t){return e[0]===t[0]&&e[1]===t[1]},en=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},tn=0,P=[];function nn(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),s=c.useState(tn++)[0],i=c.useState(Re)[0],u=c.useRef(e);c.useEffect(function(){u.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var l=at([e.lockRef.current],(e.shards||[]).map(Ee),!0).filter(Boolean);return l.forEach(function(m){return m.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),l.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var o=c.useCallback(function(l,m){if("touches"in l&&l.touches.length===2||l.type==="wheel"&&l.ctrlKey)return!u.current.allowPinchZoom;var h=B(l),x=n.current,b="deltaX"in l?l.deltaX:x[0]-h[0],E="deltaY"in l?l.deltaY:x[1]-h[1],N,A=l.target,w=Math.abs(b)>Math.abs(E)?"h":"v";if("touches"in l&&w==="h"&&A.type==="range")return!1;var _=xe(w,A);if(!_)return!0;if(_?N=w:(N=w==="v"?"h":"v",_=xe(w,A)),!_)return!1;if(!r.current&&"changedTouches"in l&&(b||E)&&(r.current=N),!N)return!0;var ce=r.current||N;return Qt(ce,m,l,ce==="h"?b:E,!0)},[]),d=c.useCallback(function(l){var m=l;if(!(!P.length||P[P.length-1]!==i)){var h="deltaY"in m?be(m):B(m),x=t.current.filter(function(N){return N.name===m.type&&(N.target===m.target||m.target===N.shadowParent)&&Jt(N.delta,h)})[0];if(x&&x.should){m.cancelable&&m.preventDefault();return}if(!x){var b=(u.current.shards||[]).map(Ee).filter(Boolean).filter(function(N){return N.contains(m.target)}),E=b.length>0?o(m,b[0]):!u.current.noIsolation;E&&m.cancelable&&m.preventDefault()}}},[]),v=c.useCallback(function(l,m,h,x){var b={name:l,delta:m,target:h,should:x,shadowParent:rn(h)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(E){return E!==b})},1)},[]),g=c.useCallback(function(l){n.current=B(l),r.current=void 0},[]),f=c.useCallback(function(l){v(l.type,be(l),l.target,o(l,e.lockRef.current))},[]),p=c.useCallback(function(l){v(l.type,B(l),l.target,o(l,e.lockRef.current))},[]);c.useEffect(function(){return P.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",d,T),document.addEventListener("touchmove",d,T),document.addEventListener("touchstart",g,T),function(){P=P.filter(function(l){return l!==i}),document.removeEventListener("wheel",d,T),document.removeEventListener("touchmove",d,T),document.removeEventListener("touchstart",g,T)}},[]);var y=e.removeScrollBar,C=e.inert;return c.createElement(c.Fragment,null,C?c.createElement(i,{styles:en(s)}):null,y?c.createElement(Kt,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function rn(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const an=kt(De,nn);var Pe=c.forwardRef(function(e,t){return c.createElement(V,R({},e,{ref:t,sideCar:an}))});Pe.classNames=V.classNames;var on=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},k=new WeakMap,U=new WeakMap,$={},ne=0,ke=function(e){return e&&(e.host||ke(e.parentNode))},sn=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=ke(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},cn=function(e,t,n,r){var s=sn(t,Array.isArray(e)?e:[e]);$[n]||($[n]=new WeakMap);var i=$[n],u=[],o=new Set,d=new Set(s),v=function(f){!f||o.has(f)||(o.add(f),v(f.parentNode))};s.forEach(v);var g=function(f){!f||d.has(f)||Array.prototype.forEach.call(f.children,function(p){if(o.has(p))g(p);else try{var y=p.getAttribute(r),C=y!==null&&y!=="false",l=(k.get(p)||0)+1,m=(i.get(p)||0)+1;k.set(p,l),i.set(p,m),u.push(p),l===1&&C&&U.set(p,!0),m===1&&p.setAttribute(n,"true"),C||p.setAttribute(r,"true")}catch(h){console.error("aria-hidden: cannot operate on ",p,h)}})};return g(t),o.clear(),ne++,function(){u.forEach(function(f){var p=k.get(f)-1,y=i.get(f)-1;k.set(f,p),i.set(f,y),p||(U.has(f)||f.removeAttribute(r),U.delete(f)),y||f.removeAttribute(n)}),ne--,ne||(k=new WeakMap,k=new WeakMap,U=new WeakMap,$={})}},ln=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=on(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),cn(r,s,n,"aria-hidden")):function(){return null}},X="Dialog",[Ie,kn]=ot(X),[un,S]=Ie(X),Me=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:u=!0}=e,o=c.useRef(null),d=c.useRef(null),[v,g]=ct({prop:r,defaultProp:s??!1,onChange:i,caller:X});return a.jsx(un,{scope:t,triggerRef:o,contentRef:d,contentId:z(),titleId:z(),descriptionId:z(),open:v,onOpenChange:g,onOpenToggle:c.useCallback(()=>g(f=>!f),[g]),modal:u,children:n})};Me.displayName=X;var Fe="DialogTrigger",Oe=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=S(Fe,n),i=Y(t,s.triggerRef);return a.jsx(M.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":ie(s.open),...r,ref:i,onClick:O(e.onClick,s.onOpenToggle)})});Oe.displayName=Fe;var oe="DialogPortal",[dn,_e]=Ie(oe,{forceMount:void 0}),Le=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,i=S(oe,t);return a.jsx(dn,{scope:t,forceMount:n,children:c.Children.map(r,u=>a.jsx(ae,{present:n||i.open,children:a.jsx(lt,{asChild:!0,container:s,children:u})}))})};Le.displayName=oe;var K="DialogOverlay",We=c.forwardRef((e,t)=>{const n=_e(K,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=S(K,e.__scopeDialog);return i.modal?a.jsx(ae,{present:r||i.open,children:a.jsx(mn,{...s,ref:t})}):null});We.displayName=K;var fn=ut("DialogOverlay.RemoveScroll"),mn=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=S(K,n);return a.jsx(Pe,{as:fn,allowPinchZoom:!0,shards:[s.contentRef],children:a.jsx(M.div,{"data-state":ie(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),j="DialogContent",Be=c.forwardRef((e,t)=>{const n=_e(j,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=S(j,e.__scopeDialog);return a.jsx(ae,{present:r||i.open,children:i.modal?a.jsx(vn,{...s,ref:t}):a.jsx(hn,{...s,ref:t})})});Be.displayName=j;var vn=c.forwardRef((e,t)=>{const n=S(j,e.__scopeDialog),r=c.useRef(null),s=Y(t,n.contentRef,r);return c.useEffect(()=>{const i=r.current;if(i)return ln(i)},[]),a.jsx(Ue,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:O(e.onCloseAutoFocus,i=>{var u;i.preventDefault(),(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:O(e.onPointerDownOutside,i=>{const u=i.detail.originalEvent,o=u.button===0&&u.ctrlKey===!0;(u.button===2||o)&&i.preventDefault()}),onFocusOutside:O(e.onFocusOutside,i=>i.preventDefault())})}),hn=c.forwardRef((e,t)=>{const n=S(j,e.__scopeDialog),r=c.useRef(!1),s=c.useRef(!1);return a.jsx(Ue,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var u,o;(u=e.onCloseAutoFocus)==null||u.call(e,i),i.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var d,v;(d=e.onInteractOutside)==null||d.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const u=i.target;((v=n.triggerRef.current)==null?void 0:v.contains(u))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),Ue=c.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...u}=e,o=S(j,n),d=c.useRef(null),v=Y(t,d);return Ct(),a.jsxs(a.Fragment,{children:[a.jsx(Ce,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(st,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":ie(o.open),...u,ref:v,onDismiss:()=>o.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(gn,{titleId:o.titleId}),a.jsx(yn,{contentRef:d,descriptionId:o.descriptionId})]})]})}),se="DialogTitle",$e=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=S(se,n);return a.jsx(M.h2,{id:s.titleId,...r,ref:t})});$e.displayName=se;var He="DialogDescription",Ge=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=S(He,n);return a.jsx(M.p,{id:s.descriptionId,...r,ref:t})});Ge.displayName=He;var Ke="DialogClose",Ye=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=S(Ke,n);return a.jsx(M.button,{type:"button",...r,ref:t,onClick:O(e.onClick,()=>s.onOpenChange(!1))})});Ye.displayName=Ke;function ie(e){return e?"open":"closed"}var Ve="DialogTitleWarning",[In,Xe]=it(Ve,{contentName:j,titleName:se,docsSlug:"dialog"}),gn=({titleId:e})=>{const t=Xe(Ve),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.

If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.

For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return c.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},pn="DialogDescriptionWarning",yn=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Xe(pn).contentName}}.`;return c.useEffect(()=>{var i;const s=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},xn=Me,bn=Oe,En=Le,ze=We,Ze=Be,qe=$e,Qe=Ge,Nn=Ye;const Cn=xn,Mn=bn,Sn=En,Je=c.forwardRef(({className:e,...t},n)=>a.jsx(ze,{ref:n,className:F("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Je.displayName=ze.displayName;const et=c.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(Sn,{children:[a.jsx(Je,{}),a.jsxs(Ze,{ref:r,className:F("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,a.jsxs(Nn,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[a.jsx(dt,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));et.displayName=Ze.displayName;const tt=({className:e,...t})=>a.jsx("div",{className:F("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});tt.displayName="DialogHeader";const wn=({className:e,...t})=>a.jsx("div",{className:F("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});wn.displayName="DialogFooter";const nt=c.forwardRef(({className:e,...t},n)=>a.jsx(qe,{ref:n,className:F("text-lg font-semibold leading-none tracking-tight",e),...t}));nt.displayName=qe.displayName;const rt=c.forwardRef(({className:e,...t},n)=>a.jsx(Qe,{ref:n,className:F("text-sm text-muted-foreground",e),...t}));rt.displayName=Qe.displayName;const Fn=({open:e,onOpenChange:t,defaultYearly:n=!1})=>{const r=ft(),[s,i]=c.useState("USD"),[u,o]=c.useState(n);c.useEffect(()=>{vt().then(i)},[]),c.useEffect(()=>{e&&o(n)},[e,n]);const d=ht(s),v=u?d.yearlyAmount:d.amount,g=u?(d.amount*12-d.yearlyAmount).toFixed(2):null,f=()=>{t(!1),r(`/checkout?yearly=${u}`)};return a.jsx(Cn,{open:e,onOpenChange:t,children:a.jsxs(et,{className:"sm:max-w-md",children:[a.jsxs(tt,{children:[a.jsxs(nt,{className:"flex items-center gap-2 text-2xl",children:[a.jsx(de,{className:"w-6 h-6 text-primary"}),"Upgrade to Premium"]}),a.jsx(rt,{className:"text-base pt-4",children:"Subscribe to Premium to start creating and sharing unlimited cards."})]}),a.jsxs("div",{className:"space-y-4 py-4",children:[a.jsxs("div",{className:"bg-primary/5 rounded-lg p-6 space-y-3",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(L,{className:"w-5 h-5 text-primary mt-0.5"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-semibold",children:"Unlimited Card Sharing"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Share your cards as many times as you want"})]})]}),a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(L,{className:"w-5 h-5 text-primary mt-0.5"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-semibold",children:"Create Unlimited Cards"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No limits on card creation"})]})]}),a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(L,{className:"w-5 h-5 text-primary mt-0.5"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-semibold",children:"Save All Your Creations"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Keep all your cards forever"})]})]}),a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(L,{className:"w-5 h-5 text-primary mt-0.5"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-semibold",children:"Priority Support"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Get help when you need it"})]})]})]}),a.jsx("div",{className:"bg-gradient-to-r from-primary/5 to-primary/10 rounded-lg p-4 border border-primary/20",children:a.jsxs("div",{className:"flex items-center justify-center gap-4",children:[a.jsx("span",{className:`text-sm font-medium transition-colors ${u?"text-muted-foreground":"text-foreground"}`,children:"Monthly"}),a.jsx(mt,{checked:u,onCheckedChange:o,className:"data-[state=checked]:bg-primary"}),a.jsx("span",{className:`text-sm font-medium transition-colors ${u?"text-foreground":"text-muted-foreground"}`,children:"Yearly"}),a.jsx("span",{className:"text-xs font-bold text-white bg-gradient-to-r from-primary to-primary/80 px-3 py-1.5 rounded-full shadow-sm",children:"Save 25%"})]})}),a.jsx("div",{className:"text-center space-y-2",children:u?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-center gap-2",children:[a.jsxs("p",{className:"text-lg text-muted-foreground line-through",children:[d.symbol,d.amount]}),a.jsxs("p",{className:"text-3xl font-bold text-primary",children:[d.symbol,(d.yearlyAmount/12).toFixed(2),a.jsx("span",{className:"text-base font-normal text-muted-foreground",children:"/month"})]})]}),a.jsxs("p",{className:"text-sm font-medium text-muted-foreground",children:["Billed annually at ",d.symbol,v,"/year"]}),a.jsxs("p",{className:"text-sm font-medium text-primary",children:["You save ",d.symbol,g," per year!"]})]}):a.jsxs("p",{className:"text-3xl font-bold",children:[d.symbol,v,a.jsx("span",{className:"text-base font-normal text-muted-foreground",children:"/month"})]})})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(ue,{variant:"outline",onClick:()=>t(!1),className:"flex-1",children:"Maybe Later"}),a.jsxs(ue,{onClick:f,className:"flex-1",children:[a.jsx(de,{className:"w-4 h-4 mr-2"}),"Subscribe Now"]})]})]})})};export{Ze as C,Qe as D,Ce as F,ze as O,En as P,xn as R,Fn as S,bn as T,In as W,qe as a,Nn as b,kn as c,Cn as d,Mn as e,et as f,tt as g,nt as h,rt as i,wn as j,ln as k,Pe as l,Ct as u};