import{c as Be,p as js,e as Cs,q as ht,r as t,f as he,j as e,A as vs,P as le,g as $,t as ke,v as ft,D as ws,C as Ss,w as ks,V as Ns,x as Bs,k as Wa,R as Ts,y as Ds,z as Rs,b as Ne,B as _,a as w,s as J,X as xt,E as _s,F as Ps,d as Is,u as As,_ as Es}from"./index-BL0y_fpc.js";import{d as yt,g as Sa}from"./currency-BnYXjSXj.js";import{I as ce}from"./input-C0ZJbgJ-.js";import{L as I}from"./label-PZFLDDFg.js";import{T as Va}from"./textarea-DH087kis.js";import{C as xa,a as Ls}from"./card-CmTQIX9U.js";import{u as Ms,C as bt}from"./index-CY2Ga7fr.js";import{k as Os,u as Hs,l as Fs,F as Gs,S as jt}from"./SubscriptionDialog-BTlEObUE.js";import{u as Ra}from"./index-C91EftaG.js";import{u as Us}from"./index-BzvWNLev.js";import{C as Ct}from"./check-bfncYjgZ.js";import{S as Fe}from"./sparkles-DUpGt3jz.js";import{L as vt}from"./loader-circle-CPVHBfFt.js";import{C as Ka}from"./calendar-BXSZhH4P.js";import{S as Ys}from"./send-OP_rWq4V.js";import{C as qa,T as zs}from"./trending-up-CdUcPVhz.js";import{B as Ws,a as Xa,I as Ja,b as Vs}from"./BackgroundEffects-DyoJ7JPG.js";import{S as Ks}from"./switch-CZGf05Mi.js";import{u as qs,C as Xs,T as Js,L as ya}from"./useCustomerPortal-CRVuiLnU.js";import{C as $s}from"./chevron-right-C69lqgvq.js";import{l as Zs}from"./lionpost_logo-D5RcADIY.js";import{p as $a,b as ba,a as Qs,h as en,c as an,d as tn,e as sn,g as nn,f as on,i as rn,r as ln,s as cn}from"./sparkler-cake-CuKi_55Z.js";import{A as dn}from"./arrow-left-BSJdqQAo.js";import{S as mn}from"./share-2-69Ksmrt4.js";import{o as un,s as ja,a as Za,b as Qa}from"./types-3iKgNyo7.js";/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const pn=Be("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const gn=Be("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const hn=Be("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const et=Be("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ca=Be("PawPrint",[["circle",{cx:"11",cy:"4",r:"2",key:"vol9p0"}],["circle",{cx:"18",cy:"8",r:"2",key:"17gozi"}],["circle",{cx:"20",cy:"16",r:"2",key:"1v9bxh"}],["path",{d:"M9 10a5 5 0 0 1 5 5v3.5a3.5 3.5 0 0 1-6.84 1.045Q6.52 17.48 4.46 16.84A3.5 3.5 0 0 1 5.5 10Z",key:"1ydw1z"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const be=Be("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const fn=Be("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const at=Be("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);function tt(n,[r,s]){return Math.min(s,Math.max(r,n))}var xn=[" ","Enter","ArrowUp","ArrowDown"],yn=[" ","Enter"],Re="Select",[la,ca,bn]=js(Re),[Ge,wu]=Cs(Re,[bn,ht]),da=ht(),[jn,Te]=Ge(Re),[Cn,vn]=Ge(Re),wt=n=>{const{__scopeSelect:r,children:s,open:o,defaultOpen:m,onOpenChange:y,value:i,defaultValue:c,onValueChange:d,dir:h,name:T,autoComplete:R,disabled:S,required:B,form:k}=n,x=da(r),[C,f]=t.useState(null),[p,N]=t.useState(null),[P,H]=t.useState(!1),oe=Ms(h),[L,q]=Wa({prop:o,defaultProp:m??!1,onChange:y,caller:Re}),[Z,E]=Wa({prop:i,defaultProp:c,onChange:d,caller:Re}),X=t.useRef(null),Q=C?k||!!C.closest("form"):!0,[U,V]=t.useState(new Set),z=Array.from(U).map(W=>W.props.value).join(";");return e.jsx(Ts,{...x,children:e.jsxs(jn,{required:B,scope:r,trigger:C,onTriggerChange:f,valueNode:p,onValueNodeChange:N,valueNodeHasChildren:P,onValueNodeHasChildrenChange:H,contentId:Ra(),value:Z,onValueChange:E,open:L,onOpenChange:q,dir:oe,triggerPointerDownPosRef:X,disabled:S,children:[e.jsx(la.Provider,{scope:r,children:e.jsx(Cn,{scope:n.__scopeSelect,onNativeOptionAdd:t.useCallback(W=>{V(te=>new Set(te).add(W))},[]),onNativeOptionRemove:t.useCallback(W=>{V(te=>{const se=new Set(te);return se.delete(W),se})},[]),children:s})}),Q?e.jsxs(Kt,{"aria-hidden":!0,required:B,tabIndex:-1,name:T,autoComplete:R,value:Z,onChange:W=>E(W.target.value),disabled:S,form:k,children:[Z===void 0?e.jsx("option",{value:""}):null,Array.from(U)]},z):null]})})};wt.displayName=Re;var St="SelectTrigger",kt=t.forwardRef((n,r)=>{const{__scopeSelect:s,disabled:o=!1,...m}=n,y=da(s),i=Te(St,s),c=i.disabled||o,d=he(r,i.onTriggerChange),h=ca(s),T=t.useRef("touch"),[R,S,B]=Xt(x=>{const C=h().filter(N=>!N.disabled),f=C.find(N=>N.value===i.value),p=Jt(C,x,f);p!==void 0&&i.onValueChange(p.value)}),k=x=>{c||(i.onOpenChange(!0),B()),x&&(i.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return e.jsx(vs,{asChild:!0,...y,children:e.jsx(le.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":qt(i.value)?"":void 0,...m,ref:d,onClick:$(m.onClick,x=>{x.currentTarget.focus(),T.current!=="mouse"&&k(x)}),onPointerDown:$(m.onPointerDown,x=>{T.current=x.pointerType;const C=x.target;C.hasPointerCapture(x.pointerId)&&C.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(k(x),x.preventDefault())}),onKeyDown:$(m.onKeyDown,x=>{const C=R.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&S(x.key),!(C&&x.key===" ")&&xn.includes(x.key)&&(k(),x.preventDefault())})})})});kt.displayName=St;var Nt="SelectValue",Bt=t.forwardRef((n,r)=>{const{__scopeSelect:s,className:o,style:m,children:y,placeholder:i="",...c}=n,d=Te(Nt,s),{onValueNodeHasChildrenChange:h}=d,T=y!==void 0,R=he(r,d.onValueNodeChange);return ke(()=>{h(T)},[h,T]),e.jsx(le.span,{...c,ref:R,style:{pointerEvents:"none"},children:qt(d.value)?e.jsx(e.Fragment,{children:i}):y})});Bt.displayName=Nt;var wn="SelectIcon",Tt=t.forwardRef((n,r)=>{const{__scopeSelect:s,children:o,...m}=n;return e.jsx(le.span,{"aria-hidden":!0,...m,ref:r,children:o||"▼"})});Tt.displayName=wn;var Sn="SelectPortal",Dt=n=>e.jsx(Ds,{asChild:!0,...n});Dt.displayName=Sn;var _e="SelectContent",Rt=t.forwardRef((n,r)=>{const s=Te(_e,n.__scopeSelect),[o,m]=t.useState();if(ke(()=>{m(new DocumentFragment)},[]),!s.open){const y=o;return y?ft.createPortal(e.jsx(_t,{scope:n.__scopeSelect,children:e.jsx(la.Slot,{scope:n.__scopeSelect,children:e.jsx("div",{children:n.children})})}),y):null}return e.jsx(Pt,{...n,ref:r})});Rt.displayName=_e;var me=10,[_t,De]=Ge(_e),kn="SelectContentImpl",Nn=Rs("SelectContent.RemoveScroll"),Pt=t.forwardRef((n,r)=>{const{__scopeSelect:s,position:o="item-aligned",onCloseAutoFocus:m,onEscapeKeyDown:y,onPointerDownOutside:i,side:c,sideOffset:d,align:h,alignOffset:T,arrowPadding:R,collisionBoundary:S,collisionPadding:B,sticky:k,hideWhenDetached:x,avoidCollisions:C,...f}=n,p=Te(_e,s),[N,P]=t.useState(null),[H,oe]=t.useState(null),L=he(r,D=>P(D)),[q,Z]=t.useState(null),[E,X]=t.useState(null),Q=ca(s),[U,V]=t.useState(!1),z=t.useRef(!1);t.useEffect(()=>{if(N)return Os(N)},[N]),Hs();const W=t.useCallback(D=>{const[Y,...ne]=Q().map(O=>O.ref.current),[F]=ne.slice(-1),G=document.activeElement;for(const O of D)if(O===G||(O==null||O.scrollIntoView({block:"nearest"}),O===Y&&H&&(H.scrollTop=0),O===F&&H&&(H.scrollTop=H.scrollHeight),O==null||O.focus(),document.activeElement!==G))return},[Q,H]),te=t.useCallback(()=>W([q,N]),[W,q,N]);t.useEffect(()=>{U&&te()},[U,te]);const{onOpenChange:se,triggerPointerDownPosRef:j}=p;t.useEffect(()=>{if(N){let D={x:0,y:0};const Y=F=>{var G,O;D={x:Math.abs(Math.round(F.pageX)-(((G=j.current)==null?void 0:G.x)??0)),y:Math.abs(Math.round(F.pageY)-(((O=j.current)==null?void 0:O.y)??0))}},ne=F=>{D.x<=10&&D.y<=10?F.preventDefault():N.contains(F.target)||se(!1),document.removeEventListener("pointermove",Y),j.current=null};return j.current!==null&&(document.addEventListener("pointermove",Y),document.addEventListener("pointerup",ne,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Y),document.removeEventListener("pointerup",ne,{capture:!0})}}},[N,se,j]),t.useEffect(()=>{const D=()=>se(!1);return window.addEventListener("blur",D),window.addEventListener("resize",D),()=>{window.removeEventListener("blur",D),window.removeEventListener("resize",D)}},[se]);const[ee,ue]=Xt(D=>{const Y=Q().filter(G=>!G.disabled),ne=Y.find(G=>G.ref.current===document.activeElement),F=Jt(Y,D,ne);F&&setTimeout(()=>F.ref.current.focus())}),fe=t.useCallback((D,Y,ne)=>{const F=!z.current&&!ne;(p.value!==void 0&&p.value===Y||F)&&(Z(D),F&&(z.current=!0))},[p.value]),je=t.useCallback(()=>N==null?void 0:N.focus(),[N]),re=t.useCallback((D,Y,ne)=>{const F=!z.current&&!ne;(p.value!==void 0&&p.value===Y||F)&&X(D)},[p.value]),Ce=o==="popper"?ka:It,pe=Ce===ka?{side:c,sideOffset:d,align:h,alignOffset:T,arrowPadding:R,collisionBoundary:S,collisionPadding:B,sticky:k,hideWhenDetached:x,avoidCollisions:C}:{};return e.jsx(_t,{scope:s,content:N,viewport:H,onViewportChange:oe,itemRefCallback:fe,selectedItem:q,onItemLeave:je,itemTextRefCallback:re,focusSelectedItem:te,selectedItemText:E,position:o,isPositioned:U,searchRef:ee,children:e.jsx(Fs,{as:Nn,allowPinchZoom:!0,children:e.jsx(Gs,{asChild:!0,trapped:p.open,onMountAutoFocus:D=>{D.preventDefault()},onUnmountAutoFocus:$(m,D=>{var Y;(Y=p.trigger)==null||Y.focus({preventScroll:!0}),D.preventDefault()}),children:e.jsx(ws,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:y,onPointerDownOutside:i,onFocusOutside:D=>D.preventDefault(),onDismiss:()=>p.onOpenChange(!1),children:e.jsx(Ce,{role:"listbox",id:p.contentId,"data-state":p.open?"open":"closed",dir:p.dir,onContextMenu:D=>D.preventDefault(),...f,...pe,onPlaced:()=>V(!0),ref:L,style:{display:"flex",flexDirection:"column",outline:"none",...f.style},onKeyDown:$(f.onKeyDown,D=>{const Y=D.ctrlKey||D.altKey||D.metaKey;if(D.key==="Tab"&&D.preventDefault(),!Y&&D.key.length===1&&ue(D.key),["ArrowUp","ArrowDown","Home","End"].includes(D.key)){let F=Q().filter(G=>!G.disabled).map(G=>G.ref.current);if(["ArrowUp","End"].includes(D.key)&&(F=F.slice().reverse()),["ArrowUp","ArrowDown"].includes(D.key)){const G=D.target,O=F.indexOf(G);F=F.slice(O+1)}setTimeout(()=>W(F)),D.preventDefault()}})})})})})})});Pt.displayName=kn;var Bn="SelectItemAlignedPosition",It=t.forwardRef((n,r)=>{const{__scopeSelect:s,onPlaced:o,...m}=n,y=Te(_e,s),i=De(_e,s),[c,d]=t.useState(null),[h,T]=t.useState(null),R=he(r,L=>T(L)),S=ca(s),B=t.useRef(!1),k=t.useRef(!0),{viewport:x,selectedItem:C,selectedItemText:f,focusSelectedItem:p}=i,N=t.useCallback(()=>{if(y.trigger&&y.valueNode&&c&&h&&x&&C&&f){const L=y.trigger.getBoundingClientRect(),q=h.getBoundingClientRect(),Z=y.valueNode.getBoundingClientRect(),E=f.getBoundingClientRect();if(y.dir!=="rtl"){const G=E.left-q.left,O=Z.left-G,de=L.left-O,A=L.width+de,ae=Math.max(A,q.width),Pe=window.innerWidth-me,Ie=tt(O,[me,Math.max(me,Pe-ae)]);c.style.minWidth=A+"px",c.style.left=Ie+"px"}else{const G=q.right-E.right,O=window.innerWidth-Z.right-G,de=window.innerWidth-L.right-O,A=L.width+de,ae=Math.max(A,q.width),Pe=window.innerWidth-me,Ie=tt(O,[me,Math.max(me,Pe-ae)]);c.style.minWidth=A+"px",c.style.right=Ie+"px"}const X=S(),Q=window.innerHeight-me*2,U=x.scrollHeight,V=window.getComputedStyle(h),z=parseInt(V.borderTopWidth,10),W=parseInt(V.paddingTop,10),te=parseInt(V.borderBottomWidth,10),se=parseInt(V.paddingBottom,10),j=z+W+U+se+te,ee=Math.min(C.offsetHeight*5,j),ue=window.getComputedStyle(x),fe=parseInt(ue.paddingTop,10),je=parseInt(ue.paddingBottom,10),re=L.top+L.height/2-me,Ce=Q-re,pe=C.offsetHeight/2,D=C.offsetTop+pe,Y=z+W+D,ne=j-Y;if(Y<=re){const G=X.length>0&&C===X[X.length-1].ref.current;c.style.bottom="0px";const O=h.clientHeight-x.offsetTop-x.offsetHeight,de=Math.max(Ce,pe+(G?je:0)+O+te),A=Y+de;c.style.height=A+"px"}else{const G=X.length>0&&C===X[0].ref.current;c.style.top="0px";const de=Math.max(re,z+x.offsetTop+(G?fe:0)+pe)+ne;c.style.height=de+"px",x.scrollTop=Y-re+x.offsetTop}c.style.margin=`${me}px 0`,c.style.minHeight=ee+"px",c.style.maxHeight=Q+"px",o==null||o(),requestAnimationFrame(()=>B.current=!0)}},[S,y.trigger,y.valueNode,c,h,x,C,f,y.dir,o]);ke(()=>N(),[N]);const[P,H]=t.useState();ke(()=>{h&&H(window.getComputedStyle(h).zIndex)},[h]);const oe=t.useCallback(L=>{L&&k.current===!0&&(N(),p==null||p(),k.current=!1)},[N,p]);return e.jsx(Dn,{scope:s,contentWrapper:c,shouldExpandOnScrollRef:B,onScrollButtonChange:oe,children:e.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P},children:e.jsx(le.div,{...m,ref:R,style:{boxSizing:"border-box",maxHeight:"100%",...m.style}})})})});It.displayName=Bn;var Tn="SelectPopperPosition",ka=t.forwardRef((n,r)=>{const{__scopeSelect:s,align:o="start",collisionPadding:m=me,...y}=n,i=da(s);return e.jsx(Ss,{...i,...y,ref:r,align:o,collisionPadding:m,style:{boxSizing:"border-box",...y.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ka.displayName=Tn;var[Dn,_a]=Ge(_e,{}),Na="SelectViewport",At=t.forwardRef((n,r)=>{const{__scopeSelect:s,nonce:o,...m}=n,y=De(Na,s),i=_a(Na,s),c=he(r,y.onViewportChange),d=t.useRef(0);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),e.jsx(la.Slot,{scope:s,children:e.jsx(le.div,{"data-radix-select-viewport":"",role:"presentation",...m,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...m.style},onScroll:$(m.onScroll,h=>{const T=h.currentTarget,{contentWrapper:R,shouldExpandOnScrollRef:S}=i;if(S!=null&&S.current&&R){const B=Math.abs(d.current-T.scrollTop);if(B>0){const k=window.innerHeight-me*2,x=parseFloat(R.style.minHeight),C=parseFloat(R.style.height),f=Math.max(x,C);if(f<k){const p=f+B,N=Math.min(k,p),P=p-N;R.style.height=N+"px",R.style.bottom==="0px"&&(T.scrollTop=P>0?P:0,R.style.justifyContent="flex-end")}}}d.current=T.scrollTop})})})]})});At.displayName=Na;var Et="SelectGroup",[Rn,_n]=Ge(Et),Pn=t.forwardRef((n,r)=>{const{__scopeSelect:s,...o}=n,m=Ra();return e.jsx(Rn,{scope:s,id:m,children:e.jsx(le.div,{role:"group","aria-labelledby":m,...o,ref:r})})});Pn.displayName=Et;var Lt="SelectLabel",Mt=t.forwardRef((n,r)=>{const{__scopeSelect:s,...o}=n,m=_n(Lt,s);return e.jsx(le.div,{id:m.id,...o,ref:r})});Mt.displayName=Lt;var oa="SelectItem",[In,Ot]=Ge(oa),Ht=t.forwardRef((n,r)=>{const{__scopeSelect:s,value:o,disabled:m=!1,textValue:y,...i}=n,c=Te(oa,s),d=De(oa,s),h=c.value===o,[T,R]=t.useState(y??""),[S,B]=t.useState(!1),k=he(r,p=>{var N;return(N=d.itemRefCallback)==null?void 0:N.call(d,p,o,m)}),x=Ra(),C=t.useRef("touch"),f=()=>{m||(c.onValueChange(o),c.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return e.jsx(In,{scope:s,value:o,disabled:m,textId:x,isSelected:h,onItemTextChange:t.useCallback(p=>{R(N=>N||((p==null?void 0:p.textContent)??"").trim())},[]),children:e.jsx(la.ItemSlot,{scope:s,value:o,disabled:m,textValue:T,children:e.jsx(le.div,{role:"option","aria-labelledby":x,"data-highlighted":S?"":void 0,"aria-selected":h&&S,"data-state":h?"checked":"unchecked","aria-disabled":m||void 0,"data-disabled":m?"":void 0,tabIndex:m?void 0:-1,...i,ref:k,onFocus:$(i.onFocus,()=>B(!0)),onBlur:$(i.onBlur,()=>B(!1)),onClick:$(i.onClick,()=>{C.current!=="mouse"&&f()}),onPointerUp:$(i.onPointerUp,()=>{C.current==="mouse"&&f()}),onPointerDown:$(i.onPointerDown,p=>{C.current=p.pointerType}),onPointerMove:$(i.onPointerMove,p=>{var N;C.current=p.pointerType,m?(N=d.onItemLeave)==null||N.call(d):C.current==="mouse"&&p.currentTarget.focus({preventScroll:!0})}),onPointerLeave:$(i.onPointerLeave,p=>{var N;p.currentTarget===document.activeElement&&((N=d.onItemLeave)==null||N.call(d))}),onKeyDown:$(i.onKeyDown,p=>{var P;((P=d.searchRef)==null?void 0:P.current)!==""&&p.key===" "||(yn.includes(p.key)&&f(),p.key===" "&&p.preventDefault())})})})})});Ht.displayName=oa;var Ke="SelectItemText",Ft=t.forwardRef((n,r)=>{const{__scopeSelect:s,className:o,style:m,...y}=n,i=Te(Ke,s),c=De(Ke,s),d=Ot(Ke,s),h=vn(Ke,s),[T,R]=t.useState(null),S=he(r,f=>R(f),d.onItemTextChange,f=>{var p;return(p=c.itemTextRefCallback)==null?void 0:p.call(c,f,d.value,d.disabled)}),B=T==null?void 0:T.textContent,k=t.useMemo(()=>e.jsx("option",{value:d.value,disabled:d.disabled,children:B},d.value),[d.disabled,d.value,B]),{onNativeOptionAdd:x,onNativeOptionRemove:C}=h;return ke(()=>(x(k),()=>C(k)),[x,C,k]),e.jsxs(e.Fragment,{children:[e.jsx(le.span,{id:d.textId,...y,ref:S}),d.isSelected&&i.valueNode&&!i.valueNodeHasChildren?ft.createPortal(y.children,i.valueNode):null]})});Ft.displayName=Ke;var Gt="SelectItemIndicator",Ut=t.forwardRef((n,r)=>{const{__scopeSelect:s,...o}=n;return Ot(Gt,s).isSelected?e.jsx(le.span,{"aria-hidden":!0,...o,ref:r}):null});Ut.displayName=Gt;var Ba="SelectScrollUpButton",Yt=t.forwardRef((n,r)=>{const s=De(Ba,n.__scopeSelect),o=_a(Ba,n.__scopeSelect),[m,y]=t.useState(!1),i=he(r,o.onScrollButtonChange);return ke(()=>{if(s.viewport&&s.isPositioned){let c=function(){const h=d.scrollTop>0;y(h)};const d=s.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[s.viewport,s.isPositioned]),m?e.jsx(Wt,{...n,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=s;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});Yt.displayName=Ba;var Ta="SelectScrollDownButton",zt=t.forwardRef((n,r)=>{const s=De(Ta,n.__scopeSelect),o=_a(Ta,n.__scopeSelect),[m,y]=t.useState(!1),i=he(r,o.onScrollButtonChange);return ke(()=>{if(s.viewport&&s.isPositioned){let c=function(){const h=d.scrollHeight-d.clientHeight,T=Math.ceil(d.scrollTop)<h;y(T)};const d=s.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[s.viewport,s.isPositioned]),m?e.jsx(Wt,{...n,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=s;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});zt.displayName=Ta;var Wt=t.forwardRef((n,r)=>{const{__scopeSelect:s,onAutoScroll:o,...m}=n,y=De("SelectScrollButton",s),i=t.useRef(null),c=ca(s),d=t.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return t.useEffect(()=>()=>d(),[d]),ke(()=>{var T;const h=c().find(R=>R.ref.current===document.activeElement);(T=h==null?void 0:h.ref.current)==null||T.scrollIntoView({block:"nearest"})},[c]),e.jsx(le.div,{"aria-hidden":!0,...m,ref:r,style:{flexShrink:0,...m.style},onPointerDown:$(m.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(o,50))}),onPointerMove:$(m.onPointerMove,()=>{var h;(h=y.onItemLeave)==null||h.call(y),i.current===null&&(i.current=window.setInterval(o,50))}),onPointerLeave:$(m.onPointerLeave,()=>{d()})})}),An="SelectSeparator",Vt=t.forwardRef((n,r)=>{const{__scopeSelect:s,...o}=n;return e.jsx(le.div,{"aria-hidden":!0,...o,ref:r})});Vt.displayName=An;var Da="SelectArrow",En=t.forwardRef((n,r)=>{const{__scopeSelect:s,...o}=n,m=da(s),y=Te(Da,s),i=De(Da,s);return y.open&&i.position==="popper"?e.jsx(ks,{...m,...o,ref:r}):null});En.displayName=Da;var Ln="SelectBubbleInput",Kt=t.forwardRef(({__scopeSelect:n,value:r,...s},o)=>{const m=t.useRef(null),y=he(o,m),i=Us(r);return t.useEffect(()=>{const c=m.current;if(!c)return;const d=window.HTMLSelectElement.prototype,T=Object.getOwnPropertyDescriptor(d,"value").set;if(i!==r&&T){const R=new Event("change",{bubbles:!0});T.call(c,r),c.dispatchEvent(R)}},[i,r]),e.jsx(le.select,{...s,style:{...Ns,...s.style},ref:y,defaultValue:r})});Kt.displayName=Ln;function qt(n){return n===""||n===void 0}function Xt(n){const r=Bs(n),s=t.useRef(""),o=t.useRef(0),m=t.useCallback(i=>{const c=s.current+i;r(c),function d(h){s.current=h,window.clearTimeout(o.current),h!==""&&(o.current=window.setTimeout(()=>d(""),1e3))}(c)},[r]),y=t.useCallback(()=>{s.current="",window.clearTimeout(o.current)},[]);return t.useEffect(()=>()=>window.clearTimeout(o.current),[]),[s,m,y]}function Jt(n,r,s){const m=r.length>1&&Array.from(r).every(h=>h===r[0])?r[0]:r,y=s?n.indexOf(s):-1;let i=Mn(n,Math.max(y,0));m.length===1&&(i=i.filter(h=>h!==s));const d=i.find(h=>h.textValue.toLowerCase().startsWith(m.toLowerCase()));return d!==s?d:void 0}function Mn(n,r){return n.map((s,o)=>n[(r+o)%n.length])}var On=wt,$t=kt,Hn=Bt,Fn=Tt,Gn=Dt,Zt=Rt,Un=At,Qt=Mt,es=Ht,Yn=Ft,zn=Ut,as=Yt,ts=zt,ss=Vt;const ra=On,ia=Hn,qe=t.forwardRef(({className:n,children:r,...s},o)=>e.jsxs($t,{ref:o,className:Ne("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",n),...s,children:[r,e.jsx(Fn,{asChild:!0,children:e.jsx(bt,{className:"h-4 w-4 opacity-50"})})]}));qe.displayName=$t.displayName;const ns=t.forwardRef(({className:n,...r},s)=>e.jsx(as,{ref:s,className:Ne("flex cursor-default items-center justify-center py-1",n),...r,children:e.jsx(gn,{className:"h-4 w-4"})}));ns.displayName=as.displayName;const os=t.forwardRef(({className:n,...r},s)=>e.jsx(ts,{ref:s,className:Ne("flex cursor-default items-center justify-center py-1",n),...r,children:e.jsx(bt,{className:"h-4 w-4"})}));os.displayName=ts.displayName;const Xe=t.forwardRef(({className:n,children:r,position:s="popper",...o},m)=>e.jsx(Gn,{children:e.jsxs(Zt,{ref:m,className:Ne("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n),position:s,...o,children:[e.jsx(ns,{}),e.jsx(Un,{className:Ne("p-1",s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),e.jsx(os,{})]})}));Xe.displayName=Zt.displayName;const Wn=t.forwardRef(({className:n,...r},s)=>e.jsx(Qt,{ref:s,className:Ne("py-1.5 pl-8 pr-2 text-sm font-semibold",n),...r}));Wn.displayName=Qt.displayName;const K=t.forwardRef(({className:n,children:r,...s},o)=>e.jsxs(es,{ref:o,className:Ne("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",n),...s,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(zn,{children:e.jsx(Ct,{className:"h-4 w-4"})})}),e.jsx(Yn,{children:r})]}));K.displayName=es.displayName;const Vn=t.forwardRef(({className:n,...r},s)=>e.jsx(ss,{ref:s,className:Ne("-mx-1 my-1 h-px bg-muted",n),...r}));Vn.displayName=ss.displayName;const Kn=({onSelectMessage:n,isPremium:r,onUpgradeClick:s})=>{const[o,m]=t.useState(!1),[y,i]=t.useState(!1),[c,d]=t.useState([]),[h,T]=t.useState("birthday"),[R,S]=t.useState(""),[B,k]=t.useState("warm and sincere"),x=async()=>{if(!r){s();return}i(!0);try{const{data:C,error:f}=await J.functions.invoke("suggest-message",{body:{occasion:h,recipientName:R,tone:B}});if(f)throw f;if(C!=null&&C.error){w.error(C.error);return}d(C.suggestions||[])}catch(C){console.error("AI suggestion error:",C),w.error("Failed to generate suggestions. Please try again.")}finally{i(!1)}};return o?e.jsxs("div",{className:"space-y-3 p-4 border-2 border-primary/20 rounded-lg bg-primary/5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(I,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Fe,{className:"w-4 h-4 text-primary"}),"AI Message Suggestions"]}),e.jsx(_,{variant:"ghost",size:"sm",onClick:()=>m(!1),children:"✕"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{children:[e.jsx(I,{className:"text-xs",children:"Occasion"}),e.jsxs(ra,{value:h,onValueChange:T,children:[e.jsx(qe,{className:"h-8 text-xs",children:e.jsx(ia,{})}),e.jsxs(Xe,{children:[e.jsx(K,{value:"birthday",children:"Birthday"}),e.jsx(K,{value:"wedding",children:"Wedding"}),e.jsx(K,{value:"anniversary",children:"Anniversary"}),e.jsx(K,{value:"christmas",children:"Christmas"}),e.jsx(K,{value:"valentine",children:"Valentine's Day"}),e.jsx(K,{value:"thank you",children:"Thank You"}),e.jsx(K,{value:"get well",children:"Get Well"}),e.jsx(K,{value:"congratulations",children:"Congratulations"}),e.jsx(K,{value:"graduation",children:"Graduation"}),e.jsx(K,{value:"mothers day",children:"Mother's Day"}),e.jsx(K,{value:"fathers day",children:"Father's Day"}),e.jsx(K,{value:"good luck",children:"Good Luck"})]})]})]}),e.jsxs("div",{children:[e.jsx(I,{className:"text-xs",children:"Tone"}),e.jsxs(ra,{value:B,onValueChange:k,children:[e.jsx(qe,{className:"h-8 text-xs",children:e.jsx(ia,{})}),e.jsxs(Xe,{children:[e.jsx(K,{value:"warm and sincere",children:"Warm & Sincere"}),e.jsx(K,{value:"funny and playful",children:"Funny & Playful"}),e.jsx(K,{value:"formal and elegant",children:"Formal & Elegant"}),e.jsx(K,{value:"casual and friendly",children:"Casual & Friendly"}),e.jsx(K,{value:"romantic",children:"Romantic"}),e.jsx(K,{value:"inspirational",children:"Inspirational"})]})]})]})]}),e.jsxs("div",{children:[e.jsx(I,{className:"text-xs",children:"Recipient Name (optional)"}),e.jsx(ce,{placeholder:"e.g., Sarah",value:R,onChange:C=>S(C.target.value),className:"h-8 text-sm"})]}),e.jsxs(_,{onClick:x,disabled:y,size:"sm",className:"w-full",children:[y?e.jsx(vt,{className:"w-4 h-4 mr-2 animate-spin"}):e.jsx(Fe,{className:"w-4 h-4 mr-2"}),y?"Generating...":"Generate Suggestions"]}),c.length>0&&e.jsx("div",{className:"space-y-2",children:c.map((C,f)=>e.jsx("button",{type:"button",onClick:()=>{n(C),m(!1),w.success("Message applied!")},className:"w-full text-left p-3 rounded-lg border border-border hover:border-primary/50 hover:bg-primary/5 transition-all text-sm",children:C},f))})]}):e.jsxs(_,{type:"button",variant:"outline",onClick:()=>{if(!r){s();return}m(!0)},className:"w-full gap-2 border-primary/30 hover:border-primary hover:bg-primary/5",children:[e.jsx(Fe,{className:"w-4 h-4 text-primary"}),"AI Suggest Message",!r&&e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-2 py-0.5 rounded-full",children:"Premium"})]})},qn=({cardId:n,onScheduled:r})=>{const[s,o]=t.useState(!1),[m,y]=t.useState(!1),[i,c]=t.useState(""),[d,h]=t.useState(""),[T,R]=t.useState(""),[S,B]=t.useState("email"),[k,x]=t.useState(""),[C,f]=t.useState("09:00"),[p,N]=t.useState(""),P=async()=>{if(!k){w.error("Please select a date");return}if(S!=="sms"&&!d){w.error("Please enter an email address");return}if(S!=="email"&&!T){w.error("Please enter a phone number");return}y(!0);try{const L=new Date(`${k}T${C}`).toISOString(),{data:{user:q}}=await J.auth.getUser();if(!q)throw new Error("Not authenticated");const{error:Z}=await J.from("scheduled_sends").insert({user_id:q.id,card_id:n,recipient_name:i||null,recipient_email:S!=="sms"?d:null,recipient_phone:S!=="email"?T:null,delivery_method:S,scheduled_at:L,personal_message:p||null});if(Z)throw Z;w.success(`Card scheduled for ${new Date(L).toLocaleString()}`),o(!1),r()}catch(L){console.error("Schedule error:",L),w.error("Failed to schedule send")}finally{y(!1)}};if(!s)return e.jsxs(_,{type:"button",variant:"outline",onClick:()=>o(!0),className:"w-full gap-2 hover:scale-105 glass-button",children:[e.jsx(Ka,{className:"w-4 h-4"}),"Schedule Send"]});const H=new Date;H.setDate(H.getDate()+1);const oe=H.toISOString().split("T")[0];return e.jsxs("div",{className:"space-y-3 p-4 border-2 border-primary/20 rounded-lg bg-primary/5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(I,{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(Ka,{className:"w-4 h-4 text-primary"}),"Schedule Card Delivery"]}),e.jsx(_,{variant:"ghost",size:"sm",onClick:()=>o(!1),children:"✕"})]}),e.jsxs("div",{children:[e.jsx(I,{className:"text-xs",children:"Recipient Name"}),e.jsx(ce,{placeholder:"e.g., Sarah",value:i,onChange:L=>c(L.target.value),className:"h-8 text-sm"})]}),e.jsxs("div",{children:[e.jsx(I,{className:"text-xs",children:"Delivery Method"}),e.jsxs(ra,{value:S,onValueChange:L=>B(L),children:[e.jsx(qe,{className:"h-8 text-xs",children:e.jsx(ia,{})}),e.jsxs(Xe,{children:[e.jsx(K,{value:"email",children:"Email"}),e.jsx(K,{value:"sms",children:"SMS"}),e.jsx(K,{value:"both",children:"Email + SMS"})]})]})]}),(S==="email"||S==="both")&&e.jsxs("div",{children:[e.jsx(I,{className:"text-xs",children:"Recipient Email"}),e.jsx(ce,{type:"email",placeholder:"email@example.com",value:d,onChange:L=>h(L.target.value),className:"h-8 text-sm"})]}),(S==="sms"||S==="both")&&e.jsxs("div",{children:[e.jsx(I,{className:"text-xs",children:"Recipient Phone"}),e.jsx(ce,{type:"tel",placeholder:"+1234567890",value:T,onChange:L=>R(L.target.value),className:"h-8 text-sm"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{children:[e.jsx(I,{className:"text-xs",children:"Date"}),e.jsx(ce,{type:"date",min:oe,value:k,onChange:L=>x(L.target.value),className:"h-8 text-sm"})]}),e.jsxs("div",{children:[e.jsx(I,{className:"text-xs",children:"Time"}),e.jsx(ce,{type:"time",value:C,onChange:L=>f(L.target.value),className:"h-8 text-sm"})]})]}),e.jsxs("div",{children:[e.jsx(I,{className:"text-xs",children:"Personal Message (optional)"}),e.jsx(ce,{placeholder:"A note to include with the delivery...",value:p,onChange:L=>N(L.target.value),className:"h-8 text-sm"})]}),e.jsxs(_,{onClick:P,disabled:m,size:"sm",className:"w-full",children:[m?e.jsx(vt,{className:"w-4 h-4 mr-2 animate-spin"}):e.jsx(Ys,{className:"w-4 h-4 mr-2"}),m?"Scheduling...":"Schedule Delivery"]})]})},Xn=({cardId:n})=>{const[r,s]=t.useState(!1),[o,m]=t.useState([]),[y,i]=t.useState(!1);t.useEffect(()=>{r&&c()},[r]);const c=async()=>{i(!0);try{const{data:B,error:k}=await J.from("card_views").select("*").eq("card_id",n).order("viewed_at",{ascending:!1}).limit(100);if(k)throw k;m(B||[])}catch(B){console.error("Error loading analytics:",B)}finally{i(!1)}},d=o.length,h=new Set(o.map(B=>B.viewer_ip)).size,R=Array.from({length:7},(B,k)=>{const x=new Date;return x.setDate(x.getDate()-(6-k)),x.toISOString().split("T")[0]}).map(B=>({day:new Date(B).toLocaleDateString("en",{weekday:"short"}),count:o.filter(k=>k.viewed_at.startsWith(B)).length})),S=Math.max(...R.map(B=>B.count),1);return r?e.jsxs("div",{className:"space-y-3 p-4 border-2 border-primary/20 rounded-lg bg-primary/5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(qa,{className:"w-4 h-4 text-primary"}),"Card Analytics"]}),e.jsx("button",{onClick:()=>s(!1),className:"text-sm text-muted-foreground hover:text-foreground",children:"✕"})]}),y?e.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading..."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{className:"p-3 bg-background rounded-lg border text-center",children:[e.jsx(hn,{className:"w-4 h-4 mx-auto mb-1 text-primary"}),e.jsx("p",{className:"text-lg font-bold",children:d}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Views"})]}),e.jsxs("div",{className:"p-3 bg-background rounded-lg border text-center",children:[e.jsx(zs,{className:"w-4 h-4 mx-auto mb-1 text-primary"}),e.jsx("p",{className:"text-lg font-bold",children:h}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Unique Viewers"})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:"Last 7 Days"}),e.jsx("div",{className:"flex items-end gap-1 h-16",children:R.map((B,k)=>e.jsxs("div",{className:"flex-1 flex flex-col items-center",children:[e.jsx("div",{className:"w-full bg-primary/60 rounded-t",style:{height:`${B.count/S*100}%`,minHeight:B.count>0?"4px":"0"}}),e.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:B.day})]},k))})]})]})]}):e.jsxs("button",{type:"button",onClick:()=>s(!0),className:"w-full flex items-center gap-2 p-3 rounded-lg border border-border hover:border-primary/50 hover:bg-primary/5 transition-all text-sm",children:[e.jsx(qa,{className:"w-4 h-4 text-primary"}),e.jsx("span",{children:"View Analytics"}),d>0&&e.jsxs("span",{className:"ml-auto text-xs bg-primary/10 text-primary px-2 py-0.5 rounded-full",children:[d," views"]})]})},Jn=({text:n,x:r,y:s,size:o,font:m,color:y,bold:i=!1,onUpdate:c,onDelete:d,isPreview:h=!1,fontSizeMap:T,fontFamilyMap:R})=>{const[S,B]=t.useState(!1),[k,x]=t.useState(!1),[C,f]=t.useState(!1),p=t.useRef(null),N=t.useRef(null),P=t.useRef({x:0,y:0,textX:0,textY:0,size:""}),H=["sm","base","lg","xl","2xl","3xl","4xl"];t.useEffect(()=>{const E=(V,z)=>{if(!N.current||!p.current)return;const W=N.current.getBoundingClientRect();if(S){const te=V-P.current.x,se=z-P.current.y,j=Math.max(0,Math.min(100,P.current.textX+te/W.width*100)),ee=Math.max(0,Math.min(100,P.current.textY+se/W.height*100));c({x:j,y:ee})}else if(k){const te=V-P.current.x,se=H.indexOf(P.current.size),j=Math.floor(te/30),ee=Math.max(0,Math.min(H.length-1,se+j));H[ee]!==o&&c({size:H[ee]})}},X=V=>{E(V.clientX,V.clientY)},Q=V=>{V.touches.length>0&&(V.preventDefault(),E(V.touches[0].clientX,V.touches[0].clientY))},U=()=>{B(!1),x(!1)};if(S||k)return document.addEventListener("mousemove",X),document.addEventListener("mouseup",U),document.addEventListener("touchmove",Q,{passive:!1}),document.addEventListener("touchend",U),()=>{document.removeEventListener("mousemove",X),document.removeEventListener("mouseup",U),document.removeEventListener("touchmove",Q),document.removeEventListener("touchend",U)}},[S,k,c,o]);const oe=E=>{E.stopPropagation(),!h&&(f(!0),B(!0),P.current={x:E.clientX,y:E.clientY,textX:r,textY:s,size:o})},L=E=>{E.stopPropagation(),!(h||E.touches.length===0)&&(f(!0),B(!0),P.current={x:E.touches[0].clientX,y:E.touches[0].clientY,textX:r,textY:s,size:o})},q=E=>{E.stopPropagation(),!h&&(x(!0),P.current={x:E.clientX,y:E.clientY,textX:r,textY:s,size:o})},Z=E=>{E.stopPropagation(),!(h||E.touches.length===0)&&(x(!0),P.current={x:E.touches[0].clientX,y:E.touches[0].clientY,textX:r,textY:s,size:o})};return t.useEffect(()=>{const E=X=>{p.current&&!p.current.contains(X.target)&&f(!1)};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[]),t.useEffect(()=>{if(p.current){const E=p.current.closest("[data-card-container]");E&&(N.current=E)}},[]),e.jsxs("div",{ref:p,className:`absolute text-interactive ${h?"pointer-events-none":"cursor-move"} select-none max-w-[90%]`,style:{left:`${r}%`,top:`${s}%`,transform:"translate(-50%, -50%)",zIndex:C?50:20},onMouseDown:oe,onTouchStart:L,children:[e.jsx("p",{className:`text-center drop-shadow-lg px-2 break-words ${i?"font-bold":"font-normal"}`,style:{color:y,fontSize:T[o]||"1.5rem",fontFamily:R[m]||"system-ui, sans-serif",textShadow:"2px 2px 4px rgba(0,0,0,0.5)",wordWrap:"break-word",overflowWrap:"break-word",hyphens:"auto"},children:n}),C&&!h&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:E=>{E.stopPropagation(),d()},className:"absolute -top-6 -right-6 w-5 h-5 bg-destructive text-destructive-foreground rounded-full flex items-center justify-center hover:bg-destructive/90 transition-colors",style:{fontSize:"0.75rem"},children:e.jsx(xt,{className:"w-3 h-3"})}),e.jsx("div",{onMouseDown:q,onTouchStart:Z,className:"absolute -bottom-4 -right-4 w-4 h-4 bg-primary rounded-full cursor-nwse-resize border-2 border-background hover:scale-110 transition-transform"}),e.jsx("div",{className:"absolute inset-0 border-2 border-dashed border-primary rounded -m-2 pointer-events-none",style:{transform:"scale(1.2)"}})]})]})},$n=()=>{const[n,r]=t.useState("USD"),[s,o]=t.useState(!0),[m,y]=t.useState(!1);t.useEffect(()=>{yt().then(r)},[]);const i=Sa(n),c=s?i.yearlyAmount:i.amount,d=s?(i.amount*12-i.yearlyAmount).toFixed(2):null;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-full bg-gradient-to-br from-primary/5 via-primary/10 to-accent/10 border-t border-primary/20",children:e.jsxs("div",{className:"max-w-3xl mx-auto px-6 py-10 space-y-6",children:[e.jsxs("div",{className:"text-center space-y-2",children:[e.jsxs("h2",{className:"text-2xl font-bold flex items-center justify-center gap-2",children:[e.jsx(Fe,{className:"w-6 h-6 text-primary"}),"Upgrade to Premium Pride",e.jsx(Fe,{className:"w-6 h-6 text-primary"})]}),e.jsx("p",{className:"text-muted-foreground",children:"Subscribe to unlock unlimited card creation and sharing"})]}),e.jsx("div",{className:"grid grid-cols-3 gap-3",children:[{title:"Unlimited Sharing",desc:"Share as many times as you want"},{title:"Unlimited Cards",desc:"No limits on creation"},{title:"Save All Creations",desc:"Keep your cards forever"}].map(h=>e.jsxs("div",{className:"bg-background/60 rounded-lg p-3 text-center border border-primary/10",children:[e.jsx(Ct,{className:"w-4 h-4 text-primary mx-auto mb-1"}),e.jsx("p",{className:"text-sm font-semibold",children:h.title}),e.jsx("p",{className:"text-xs text-muted-foreground",children:h.desc})]},h.title))}),e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:`text-sm font-medium transition-colors ${s?"text-muted-foreground":"text-foreground"}`,children:"Monthly"}),e.jsx(Ks,{checked:s,onCheckedChange:o,className:"data-[state=checked]:bg-primary"}),e.jsx("span",{className:`text-sm font-medium transition-colors ${s?"text-foreground":"text-muted-foreground"}`,children:"Yearly"}),e.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%"})]}),e.jsx("div",{className:"text-center",children:s?e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2",children:[e.jsxs("span",{className:"text-lg text-muted-foreground line-through",children:[i.symbol,(i.amount*12).toFixed(2)]}),e.jsxs("span",{className:"text-3xl font-bold text-primary",children:[i.symbol,c,e.jsx("span",{className:"text-base font-normal text-muted-foreground",children:"/year"})]})]}),e.jsxs("p",{className:"text-sm font-medium text-primary",children:["You save ",i.symbol,d," per year!"]})]}):e.jsxs("span",{className:"text-3xl font-bold",children:[i.symbol,c,e.jsx("span",{className:"text-base font-normal text-muted-foreground",children:"/month"})]})}),e.jsxs(_,{size:"lg",onClick:()=>y(!0),className:"px-8",children:[e.jsx(Fe,{className:"w-4 h-4 mr-2"}),"Subscribe Now"]})]})]})}),e.jsx(jt,{open:m,onOpenChange:y,defaultYearly:!1})]})},Ve=[{target:"upload-image",title:"Upload Your Photo",emoji:"📸",description:"Start by uploading your own photo, or pick one of our beautiful templates below!"},{target:"choose-template",title:"Choose a Template",emoji:"🎨",description:"No photo? No problem! Browse hundreds of templates for every occasion."},{target:"your-message",title:"Write Your Message",emoji:"💌",description:"Add a heartfelt message on the back of your card. You can even get AI suggestions!"},{target:"share-section",title:"Save & Share!",emoji:"🚀",description:"Save your card and share it instantly via link, WhatsApp, SMS, or email!"}],st="lionpost_tour_completed",Zn=()=>{const[n,r]=t.useState(0),[s,o]=t.useState(!1),[m,y]=t.useState({top:0,left:0,arrowDir:"top"});t.useEffect(()=>{if(!localStorage.getItem(st)){const k=setTimeout(()=>o(!0),1500);return()=>clearTimeout(k)}},[]);const i=t.useCallback(()=>{const B=Ve[n],k=document.querySelector(`[data-tour="${B.target}"]`);if(!k)return;k.getBoundingClientRect();const x=300,C=180,f=12;k.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{const p=k.getBoundingClientRect();let N,P,H="top";p.bottom+C+f<window.innerHeight?(N=p.bottom+f,P=Math.max(f,Math.min(p.left+p.width/2-x/2,window.innerWidth-x-f)),H="top"):p.top-C-f>0?(N=p.top-C-f,P=Math.max(f,Math.min(p.left+p.width/2-x/2,window.innerWidth-x-f)),H="bottom"):(N=Math.max(f,p.top),P=Math.min(p.right+f,window.innerWidth-x-f),H="left"),y({top:N,left:P,arrowDir:H})},400)},[n]);t.useEffect(()=>{if(s)return i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[s,n,i]);const c=()=>{n<Ve.length-1?r(n+1):h()},d=()=>{n>0&&r(n-1)},h=()=>{localStorage.setItem(st,"true"),o(!1)};if(!s)return null;const T=Ve[n],R=document.querySelector(`[data-tour="${T.target}"]`),S=R==null?void 0:R.getBoundingClientRect();return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-[9998] pointer-events-none",children:e.jsxs("svg",{className:"w-full h-full",children:[e.jsx("defs",{children:e.jsxs("mask",{id:"tour-mask",children:[e.jsx("rect",{width:"100%",height:"100%",fill:"white"}),S&&e.jsx("rect",{x:S.left-6,y:S.top-6,width:S.width+12,height:S.height+12,rx:"8",fill:"black"})]})}),e.jsx("rect",{width:"100%",height:"100%",fill:"rgba(0,0,0,0.5)",mask:"url(#tour-mask)",className:"pointer-events-auto",onClick:h})]})}),S&&e.jsx("div",{className:"fixed z-[9999] pointer-events-none rounded-lg ring-2 ring-primary ring-offset-2 ring-offset-transparent animate-pulse",style:{top:S.top-6,left:S.left-6,width:S.width+12,height:S.height+12}}),e.jsxs("div",{className:"fixed z-[10000] w-[300px] bg-card border-2 border-primary/30 rounded-xl shadow-2xl p-4 animate-fade-in",style:{top:m.top,left:m.left},children:[e.jsx("button",{onClick:h,className:"absolute top-2 right-2 p-1 rounded-full hover:bg-muted transition-colors","aria-label":"Close tour",children:e.jsx(xt,{className:"w-4 h-4 text-muted-foreground"})}),e.jsx("div",{className:"mb-2",children:e.jsx("span",{className:"text-2xl",children:T.emoji})}),e.jsx("h4",{className:"text-sm font-bold text-foreground mb-1",children:T.title}),e.jsx("p",{className:"text-xs text-muted-foreground mb-4 leading-relaxed",children:T.description}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"flex gap-1.5",children:Ve.map((B,k)=>e.jsx("div",{className:`w-2 h-2 rounded-full transition-colors ${k===n?"bg-primary":"bg-muted"}`},k))}),e.jsxs("div",{className:"flex gap-2",children:[n>0&&e.jsxs(_,{size:"sm",variant:"ghost",onClick:d,className:"h-7 px-2 text-xs",children:[e.jsx(pn,{className:"w-3 h-3 mr-1"})," Back"]}),e.jsx(_,{size:"sm",onClick:c,className:"h-7 px-3 text-xs",children:n===Ve.length-1?"Got it! 🎉":e.jsxs(e.Fragment,{children:["Next ",e.jsx($s,{className:"w-3 h-3 ml-1"})]})})]})]})]})]})},Qn=({src:n,alt:r,className:s="",placeholderClassName:o=""})=>{const[m,y]=t.useState(!1),[i,c]=t.useState(!1),d=t.useRef(null);return t.useEffect(()=>{const h=new IntersectionObserver(([T])=>{T.isIntersecting&&(c(!0),h.disconnect())},{rootMargin:"50px",threshold:.01});return d.current&&h.observe(d.current),()=>h.disconnect()},[]),e.jsxs("div",{ref:d,className:`relative ${s}`,children:[!m&&e.jsx("div",{className:`absolute inset-0 bg-muted animate-pulse rounded ${o}`}),i&&e.jsx("img",{src:n,alt:r,className:`${s} transition-opacity duration-300 ${m?"opacity-100":"opacity-0"}`,onLoad:()=>y(!0)})]})},eo="/assets/award-badge-2025-CT6nZ3dL.png",ao="/assets/anonymous-mask-Cjh1IYM7.png",to="/assets/teal-donuts-candles-CER36mdZ.jpg",so="/assets/sparkler-cake-BX5PCX1J.jpg",no="/assets/letterboard-birthday-GDsALpbS.jpg",oo="/assets/sparkler-bokeh-6x87zjbn.jpg",ro="/assets/chocolate-drip-cake-B0CXeaUs.jpg",io="/assets/white-frosting-cake-DBLhRB-2.jpg",lo="/assets/pink-rose-cake-CTmg7nR1.jpg",co="/assets/strawberry-cake-DXR0I6kx.jpg",mo="/assets/white-balloon-setup-5PTmxRS1.jpg",uo="/assets/colorful-balloons-sky-BHU5Helq.jpg",po="/assets/party-pineapple-BfexAM4M.jpg",go="/assets/birthday-balloon-C5ycJ4HD.jpg",ho="/assets/lit-candles-close-B6EDxzlw.jpg",fo="/assets/ice-cream-cone-cake-BU56jWF1.jpg",xo="/assets/yellow-sprinkles-BAbaqbOA.jpg",yo="/assets/happy-birthday-sprinkles-1moG9IQ1.jpg",bo="/assets/cake-slice-confetti-C47yb2DA.jpg",jo="/assets/white-cake-candles-kLMH5TYk.jpg",Co="/assets/gifts-pastel-Dthw2FqT.jpg",vo="/assets/cupcake-candle-dark-bjoIlHmV.jpg",wo="/assets/happy-birthday-candles-pink-CRJ8apa6.jpg",So="/assets/cake-party-coral-BdOiAGd4.jpg",ko="/assets/party-table-banner-DBfXRFP8.jpg",No="/assets/elegant-flower-cake-CEnLlD94.jpg",Bo="/assets/pink-drip-cake-Bi4Etgxa.jpg",To="/assets/cranberry-candle-cake-CUHDFH4P.jpg",Do="/assets/balloons-stars-iBMSLuNJ.jpg",Ro="/assets/cake-purple-BZ91qz-p.jpg",_o="/assets/happy-birthday-navy-CXadcTyq.jpg",Po="/assets/minimalist-branches-6YnOqwfR.jpg",Io="/assets/pink-glitter-CjpJzuAS.jpg",Ao="/assets/balloons-black-Bm5YFbqB.jpg",Eo="/assets/confetti-celebration-mJ-fq5FW.jpg",Lo="/assets/rainbow-stars--SzEXS7n.jpg",Mo="/assets/gold-navy-elegant-ytZMJOEk.jpg",Oo="/assets/cupcakes-mint-CvOF2Awz.jpg",Ho="/assets/geometric-modern-CoaDFh0t.jpg",Fo="/assets/watercolor-flowers-DB0sqQct.jpg",Go="/assets/vintage-lace-RmHsbgky.jpg",Uo="/assets/party-hats-yellow-BAxaVC8_.jpg",Yo="/assets/fireworks-night-D8rK9hHu.jpg",zo="/assets/art-deco-gold-BJY-8wyM.jpg",Wo="/assets/unicorn-rainbow-BBlI6YBe.jpg",Vo="/assets/marble-rose-gold-DkBvmZjW.jpg",Ko="/assets/space-galaxy-Ceg2Rr3w.jpg",qo="/assets/donuts-sprinkles-DOIFI_1Y.jpg",Xo="/assets/silver-glitter-white-Cr5hvPsG.jpg",Jo="/assets/pets-playful-DKKL8CYy.jpg",$o="/assets/ice-cream-summer-DypLQO33.jpg",Zo="/assets/nautical-navy-DhKTs0_5.jpg",Qo="/assets/cherry-blossom-pink-DvMdKyEg.jpg",er="/assets/neon-city-D1KQFjr1.jpg",ar="/assets/tribal-southwestern-BL09zN3y.jpg",tr="/assets/hot-air-balloons-BC3q6wgj.jpg",sr="/assets/bubbles-light-blue-Bm49-6mw.jpg",nr="/assets/steampunk-gears-qf74lYGx.jpg",or="/assets/beach-seashells-CGq7vm0G.jpg",rr="/assets/paris-eiffel-BREJKJao.jpg",ir="/assets/moroccan-tiles-BsuWjqYU.jpg",lr="/assets/cupcake-candle-dark-bjoIlHmV.jpg",cr="/assets/pink-drip-cake-Bi4Etgxa.jpg",dr="/assets/birthday-balloon-C5ycJ4HD.jpg",mr="/assets/lit-candles-close-B6EDxzlw.jpg",ur="/assets/berry-birthday-cake-Co2CPpD3.jpg",pr="/assets/golden-retriever-party-CTqruRmY.jpg",gr="/assets/white-dog-balloons-H3IKDX1l.jpg",hr="/assets/party-pineapple-BfexAM4M.jpg",fr="/assets/frenchie-party-hat-B2-acNaP.jpg",xr="/assets/sparklers-celebration-B7YB2f2w.jpg",nt="/assets/red-ornaments-D8ZuZpyF.jpg",yr="/assets/golden-bells-BHUjny-K.jpg",br="/assets/festive-wreath-6ZRT5K5A.jpg",jr="/assets/snow-tree-v6II_MIQ.jpg",Cr="/assets/cozy-cabin-BVYlAsmJ.jpg",vr="/assets/santa-sleigh-D2Nt-wPJ.jpg",wr="/assets/elegant-ornaments-D0BtlvWh.jpg",Sr="/assets/festive-gifts-CH18s3pD.jpg",kr="/assets/sparkling-snowflakes-BdfWM91P.jpg",Nr="/assets/fireplace-stockings-DRhMIBdQ.jpg",Br="/assets/candy-cane-delight-Bl0f8s6m.jpg",Tr="/assets/reindeer-moonlight-DT8T_Cxa.jpg",Dr="/assets/gingerbread-village-BRNFup4C.jpg",Rr="/assets/poinsettia-elegance-Du0CfEY-.jpg",_r="/assets/presents-under-tree-DO-cVSIn.jpg",Pr="/assets/snow-globe-magic-Ckk0C8cX.jpg",Ir="/assets/holly-pine-border-RW56-i_d.jpg",Ar="/assets/ice-skating-pond-B-Hx3Y0O.jpg",Er="/assets/nutcracker-soldier-CIjrVora.jpg",Lr="/assets/frosted-window-BjDUwZ7k.jpg",Mr="/assets/hot-chocolate-cozy-Bo5xpJ_q.jpg",Or="/assets/mistletoe-holly-Cgp6oXIf.jpg",Hr="/assets/advent-calendar-B7kzTXku.jpg",Fr="/assets/carolers-singing-CUCXTLAs.jpg",Gr="/assets/penguins-winter-IJ7aGUPU.jpg",Ur="/assets/church-village-CZsL4leI.jpg",Yr="/assets/rustic-wooden-sign-sicyPvVr.jpg",zr="/assets/angels-gold-eAnyyPEF.jpg",Wr="/assets/mountain-cabin-night-CxHUQyGN.jpg",Vr="/assets/knitted-sweater-jHZCA_1L.jpg",Kr="/assets/polar-bears-arctic-XKYWWW0-.jpg",qr="/assets/string-lights-dark-D3d3vTHl.jpg",Xr="/assets/vintage-truck-tree-CAguHoJG.jpg",Jr="/assets/cookies-milk-santa-Dyc69n47.jpg",$r="/assets/cardinal-snow-branch-B0GNsS1z.jpg",Zr="/assets/silver-bells-blue-Bkld3Xlj.jpg",Qr="/assets/christmas-puppy-mistletoe-BhTULHyL.jpg",ei="/assets/christmas-dog-santa-hat-Dzhne9Lg.jpg",ai="/assets/christmas-holly-1zjvw1UU.jpg",ti="/assets/christmas-tree-scene-B0O7nQ5U.jpg",si="/assets/christmas-ornaments-B7ttA_Tt.jpg",ni="/assets/christmas-pinecones-BcsSOcTd.jpg",oi="/assets/christmas-gift-BFrexyPq.jpg",ri="/assets/christmas-mini-trees-CbQ_0FY9.jpg",ii="/assets/christmas-flatlay-BlP21Kdr.jpg",li="/assets/christmas-wreath-D2tpEq3Z.jpg",ci="/assets/christmas-stars-BAmlRbES.jpg",di="/assets/christmas-stockings-CaRxDC27.jpg",mi="/assets/christmas-wreath-D2tpEq3Z.jpg",ui="/assets/christmas-stars-BAmlRbES.jpg",pi="/assets/christmas-stockings-CaRxDC27.jpg",gi="/assets/christmas-pine-branches-CqVkal_O.jpg",hi="/assets/floral-elegance-3_Y1lMSd.jpg",fi="/assets/golden-frame-DfQeaG0I.jpg",xi="/assets/vintage-roses-Vu898JFE.jpg",yi="/assets/botanical-wreath--h5j3VYS.jpg",bi="/assets/elegant-border-DLFuOvke.jpg",ji="/assets/classic-floral-D-QldAaQ.jpg",Ci="/assets/generic-classic-CqAut46X.jpg",vi="/assets/mountain-sunset-Dc4UUq2j.jpg",ot="/assets/floral-balloon-BQH7TKnX.jpg",wi="/assets/blue-garden-B1Z3eDOc.jpg",Si="/assets/pink-floral-CQvXpt5Q.jpg",ki="/assets/starry-sky-j2uJkEe6.jpg",Ni="/assets/lanterns-floral-C8B12cS6.jpg",Bi="/assets/golden-clover-stars-CRtotr69.jpg",Ti="/assets/horseshoe-roses-DQ8n0qFT.jpg",Di="/assets/rainbow-clovers-gold-KqcnYEPj.jpg",Ri="/assets/lucky-cat-cherry-CJqCaVja.jpg",_i="/assets/shooting-stars-purple-h3VIBtcY.jpg",Pi="/assets/golden-key-magic-D0mh4B3m.jpg",Ii="/assets/dreamcatcher-sunset-BS0_CkDm.jpg",Ai="/assets/ladybug-clover-dew-BRJqn5Vu.jpg",Ei="/assets/lucky-dice-vegas-CK-Oc3aB.jpg",Li="/assets/wise-owl-moon-3hFzGjR4.jpg",Mi="/assets/red-rose-petals-BeCVIEzN.jpg",Oi="/assets/pastel-hearts-3d-ChNTZJcB.jpg",Hi="/assets/pink-heart-balloon-B2TYOwbl.jpg",Fi="/assets/red-roses-dark-AGqFxHL5.jpg",Gi="/assets/heart-sprinkles-bowl-BLXD8OZR.jpg",Ui="/assets/love-paint-art-BSMpsv0f.jpg",Yi="/assets/flower-heart-wall-ChwwEGNy.jpg",zi="/assets/red-roses-flat-DZw2-qsm.jpg",Wi="/assets/pink-rose-vase-CLR7CTgd.jpg",Vi="/assets/love-scrabble-tiles-DMKKwP01.jpg",Ki="/assets/heart-macarons-DsGPXSfI.jpg",qi="/assets/heart-latte-art-WIJWSjPI.jpg",Xi="/assets/coffee-heart-foam-CJB21Ko0.jpg",Ji="/assets/coffee-heart-swirl-CR3nD49Z.jpg",$i="/assets/pink-rose-bouquet-gRyDrHQn.jpg",Zi="/assets/red-hearts-decor-BVvEdkhi.jpg",Qi="/assets/heart-cupcakes-CCmX7zDq.jpg",el="/assets/red-tulips-field-CnMGp209.jpg",al="/assets/couple-holding-hands-BTlY_zKH.jpg",tl="/assets/couple-embrace-BiRonWw1.jpg",sl="/assets/red-rose-bokeh-DJjYBMub.jpg",nl="/assets/dog-with-rose-Br7FCwol.jpg",ol="/assets/heart-chocolates-sugar-CcjFkHPM.jpg",rl="/assets/red-flower-closeup-D-d7goei.jpg",il="/assets/orange-heart-balloons-BzZ1qzBp.jpg",ll="/assets/heart-cake-love-BYct3heA.jpg",cl="/assets/heart-cookie-hand-BGtQo2NZ.jpg",dl="/assets/heart-cookies-spread-CmhrwYUW.jpg",ml="/assets/red-gift-box-BZ-MDDGk.jpg",ul="/assets/pink-heart-marble-Dz7jmOPF.jpg",pl="/assets/pink-heart-lollipop-DSufIqT1.jpg",gl="/assets/love-letter-roses-bJlC1-B7.jpg",hl="/assets/red-rose-classic-CrQsE3E8.jpg",fl="/assets/heart-bokeh-lights-gtAdPmGk.jpg",xl="/assets/candy-hearts-pile-BiL5ye_E.jpg",yl="/assets/red-valentines-envelope-CPGRs-NI.jpg",bl="/assets/pink-rose-water-BoDhEd8F.jpg",jl="/assets/dried-flower-bouquet-DpwLsiuV.jpg",Cl="/assets/heart-balloons-pink-ClP6hLN6.jpg",vl="/assets/red-heart-balloons-0-AhjkEb.jpg",wl="/assets/teddy-bear-love-D9qceuAY.jpg",Sl="/assets/red-heart-candies-BSlL_PW1.jpg",kl="/assets/red-roses-bouquet-DjhAcevH.jpg",Nl="/assets/pink-roses-frame-k5sZdgQb.jpg",Bl="/assets/rose-on-books-CXi4Y42d.jpg",Tl="/assets/watercolor-peach-Dc_DUhEY.jpg",Dl="/assets/heart-candy-sticks-C23Ls409.jpg",Rl="/assets/love-sign-hearts-BjosgS9y.jpg",_l="/assets/pink-roses-macarons-DKH4DWpa.jpg",Pl="/assets/macarons-flowers-love-Bvh2EUr5.jpg",Il="/assets/neon-heart-glow-BUW3EKEc.jpg",Al="/assets/rose-in-glass-ddrqY0zw.jpg",El="/assets/pink-hearts-DNClcfH5.jpg",va="/assets/romantic-roses-D6HvSlSG.jpg",Ll="/assets/love-letters-CnL6IwIV.jpg",Ml="/assets/heart-balloons-qVQ65L0f.jpg",Ol="/assets/red-roses-DS1JuYIH.jpg",Hl="/assets/infinity-roses-DHE2A1Cu.jpg",Fl="/assets/sunset-couple-beach-CIL8_xwo.jpg",Gl="/assets/watercolor-hearts-sWKKJ7Eh.jpg",Ul="/assets/heart-lights-jN9OQ6SX.jpg",Yl="/assets/coffee-hearts-CZpq8RRX.jpg",zl="/assets/doves-ribbon-CC4-b5Cw.jpg",Wl="/assets/paris-bicycle-B3hk99DI.jpg",Vl="/assets/cherry-blossom-heart-J7Jv75tg.jpg",rt="/assets/workshop-tools-CcdTYuRV.jpg",Kl="/assets/golf-green-Bn84Wzjn.jpg",ql="/assets/morning-coffee-B45ZlJoZ.jpg",Xl="/assets/mountain-adventure-D7TjFI7x.jpg",Jl="/assets/gentleman-style-DioADlHH.jpg",$l="/assets/sports-fan-BWcPagkV.jpg",Zl="/assets/swans-moonlight-BFj5TPxK.jpg",it="/assets/caps-in-air-DRP_FfJv.jpg",Ql="/assets/grumpy-cat-monday-BMVCSXDk.jpg",ec="/assets/lazy-sloth-B6xDXL5u.jpg",ac="/assets/office-dinosaur-JicPKNO-.jpg",tc="/assets/tipsy-wine-dAqEki7D.jpg",sc="/assets/avocado-friends-D4qGPczc.jpg",nc="/assets/cool-pizza-BZKAe39B.jpg",oc="/assets/confused-party-dog-cgo5JxEW.jpg",rc="/assets/sassy-cactus-Dgi3IJ2V.jpg",ic="/assets/eye-roll-unicorn-D21idasO.jpg",lc="/assets/judgmental-taco-D7m7x-Dm.jpg",cc="/assets/drama-llama-BHoFwTlv.jpg",dc="/assets/shocked-donut-XCN6I7Bk.jpg",mc="/assets/dramatic-pug-DGknou5V.jpg",uc="/assets/wired-coffee-QesZu4W0.jpg",pc="/assets/dumpster-fire-CFNubA67.jpg",gc="/assets/cheesy-wink-D_DG1wTj.jpg",hc="/assets/cheerful-skeleton-DvjySBoT.jpg",fc="/assets/over-it-chicken-DCj8WjAK.jpg",xc="/assets/suave-hotdog-BSZyvYLo.jpg",yc="/assets/done-frog-CBZvFSI4.jpg",bc="/assets/business-penguin-Cj16PGUP.jpg",jc="/assets/evil-cupcake-CWcQm0nB.jpg",Cc="/assets/angry-alarm-IdwdlLjX.jpg",vc="/assets/stressed-octopus-bFeMJQea.jpg",wc="/assets/scared-toilet-paper-DlD4oOGZ.jpg",Sc="/assets/party-pickle-CIc_bQue.jpg",kc="/assets/slipping-banana-C5jo8t7r.jpg",Nc="/assets/burnt-toast-DYfanJka.jpg",Bc="/assets/guilty-raccoon-DA18bJXx.jpg",Tc="/assets/happy-beer-BHX6d84r.jpg",Dc="/assets/fabulous-croissant-BOfDzFSH.jpg",Rc="/assets/lonely-sock-D-q_QhgA.jpg",_c="/assets/dramatic-plant-4YnH5UaO.jpg",Pc="/assets/diploma-scroll-Cs_WlWhi.jpg",Ic="/assets/celebration-balloons-D5kkMT3P.jpg",Ac="/assets/tassel-closeup-DaMoyq7O.jpg",Ec="/assets/books-and-cap-CEqy_wma.jpg",Lc="/assets/confetti-purple-Mm7teND7.jpg",Mc="/assets/university-building-5_l_140X.jpg",Oc="/assets/stars-achievement-DqByZdNB.jpg",Hc="/assets/laurel-wreath-bID-Ht5P.jpg",Fc="/assets/modern-geometric-CBHWbPYR.jpg",Gc="/assets/sunrise-silhouette-Cw6rHvSs.jpg",Uc="/assets/red-gold-elegant-CNzl8VPm.jpg",Yc="/assets/champagne-toast-MUxrar64.jpg",zc="/assets/emerald-green-Bfn9KdAn.jpg",Wc="/assets/fireworks-night-h4r5xDJF.jpg",Vc="/assets/blue-silver-BEtfS79W.jpg",Kc="/assets/bright-future-CTGx8g3S.jpg",lt="/assets/pastel-gradient-BuQv-yOc.jpg",qc="/assets/floral-border-C0mHaU58.jpg",Xc="/assets/eucalyptus-roses-LloYrIWk.jpg",Jc="/assets/pressed-flowers-vintage-BIRcvlxQ.jpg",$c="/assets/sunset-birds-BsXx3X3H.jpg",Zc="/assets/marble-gold-modern-p7m_TJ6x.jpg",Qc="/assets/butterfly-garden-BU11OCB5.jpg",ed="/assets/constellation-stars-hPqkjXsB.jpg",ad="/assets/autumn-harvest-DnlIxjXe.jpg",td="/assets/peony-elegance-D4Ruzhwc.jpg",ct="/assets/eucalyptus-bouquet-91DhB8zG.jpg",sd="/assets/donut-flowers-BBlBLIeb.jpg",dt="/assets/decorated-eggs-D_2_1BQP.jpg",nd="/assets/spring-flowers-D48elpXQ.jpg",od="/assets/bunny-ears-B-XmsPsM.jpg",rd="/assets/pink-eggs-BjbdqIMJ.jpg",id="/assets/egg-hunt-CjUpK-cu.jpg",ld="/assets/pastel-eggs-yt0YoOAf.jpg",cd="/assets/spring-nest-MDmbYBbN.jpg",dd="/assets/colorful-eggs-CdfkFiJJ.jpg",md="/assets/easter-basket-CILlzc0U.jpg",ud="/assets/spring-tulips-BrO2bR-w.jpg",pd="/assets/gerbera-daisies-CTujQMP4.jpg",gd="/assets/mother-child-art-CiQVktRY.jpg",hd="/assets/handmade-card-CsJqStSq.jpg",fd="/assets/forest-walk-DkzIAzYh.jpg",xd="/assets/mother-baby-C_IsRj8a.jpg",yd="/assets/i-love-mom-B31ffZOM.jpg",bd="/assets/best-mom-ever-C0bIb0QX.jpg",jd="/assets/tulip-bouquet-C-qOChzq.jpg",Cd="/assets/baby-panda-BIQp-FP7.jpg",vd="/assets/fluffy-kitten-CRnaywat.jpg",wd="/assets/golden-puppy-D8P7s4iJ.jpg",Sd="/assets/hedgehog-flower-CFVAOy3m.jpg",kd="/assets/baby-bunny-T5BWaynq.jpg",Nd="/assets/playful-otter-Cry6JiRf.jpg",Bd="/assets/baby-koala-DPHpa7iV.jpg",Td="/assets/fox-kit-BFgMhqHx.jpg",Dd="/assets/penguin-bowtie-CKiCVYCk.jpg",Rd="/assets/baby-deer-DBXb4UEZ.jpg",_d="/assets/red-squirrel-igbYN3aA.jpg",Pd="/assets/baby-chicks-DtaW3qrb.jpg",Id="/assets/baby-lamb-ZEP1Tlpf.jpg",Ad="/assets/puppy-basket-B2PKUUT8.jpg",Ed="/assets/lion-sunglasses-wP2NBbpa.jpeg",mt="/assets/boat-mountain-lake-B7HRkCJx.jpg",Ld="/assets/hobbit-door-DNPJLtyq.jpg",Md="/assets/garden-pond-CjhTz3Zs.jpg",Od="/assets/alpine-meadow-BYSVHupJ.jpg",Hd="/assets/castle-starry-night-CgfG1CwG.jpg",Fd="/assets/alpine-lake-BswaRdz2.jpg",Gd="/assets/beach-sunset-surfer-CtbmEpDb.jpg",Ud="/assets/snowy-bench-D8pbVcj5.jpg",Yd="/assets/mountain-river-D_fP33as.jpg",zd="/assets/cherry-blossom-reflection-BdONpL-l.jpg",Wd="/assets/lake-dock-sunset-h2Re1VyE.jpg",Vd="/assets/tuscany-road-CtiKdqPZ.jpg",Kd="/assets/tuscany-hills-D66c6I4w.jpg",qd="/assets/beach-drone-DptlEwAt.jpg",Xd="/assets/mountain-peaks-BQS2xM3M.jpg",Jd="/assets/night-sky-tent-C9azYF7C.jpg",$d="/assets/mountain-lake-reflection-4UnC8FXG.jpg",Zd="/assets/starry-mountain-C5LLSQe0.jpg",Qd="/assets/misty-forest-CiIfmE-4.jpg",em="/assets/mountain-sunrise-B_3yMr_R.jpg",am="/assets/mountain-silhouette-BjWMrs3W.jpg",tm="/assets/northern-lights-C19P4xGQ.jpg",sm="/assets/sunset-reflection-j2qOsKsH.jpg",nm="/assets/pink-tree-river-C3P7T7jE.jpg",om="/assets/pink-dahlias-14bz1tNn.jpg",rm="/assets/palm-tree-sky-0frjauBy.jpg",ut="/assets/autumn-path-CeZO_pGA.jpg",im="/assets/forest-waterfall-Bwi8UBub.jpg",lm="/assets/mountain-painting-DFenLL-B.jpg",cm="/assets/cliff-waterfall-C2ht9rRu.jpg",dm="/assets/autumn-trees-9RTxdZsP.jpg",mm="/assets/forest-stream-CVWKLH9v.jpg",um="/assets/green-canyon-ClEyP1hv.jpg",pm="/assets/mountain-lake-sunrise-HGCygb2H.jpg",gm="/assets/tropical-beach-sunset-DBDa6hYx.jpg",hm="/assets/lavender-field-D0CebF02.jpg",fm="/assets/aurora-borealis-Bh90-F-I.jpg",xm="/assets/cherry-blossom-garden-S28rZBQS.jpg",ym="/assets/tropical-waterfall-Doz8lGg7.jpg",bm="/assets/wheat-field-sunset-BEwwUppH.jpg",jm="/assets/ocean-waves-rocks-DeqYAoAE.jpg",pt="/assets/rings-vinyl-Bm343YtY.jpg",Cm="/assets/rustic-table-4lrRBqSB.jpg",vm="/assets/garden-table-DKo1yVFn.jpg",wm="/assets/burgundy-bouquet-umunrUwI.jpg",Sm="/assets/blush-bouquet-CbTLW7xl.jpg",km="/assets/canoe-couple-DCmLrvAs.jpg",Nm="/assets/elegant-reception-BJMGcZAW.jpg",Bm="/assets/adventure-cake-CUArZDwY.jpg",Tm="/assets/rose-cake-DfCz2tz0.jpg",Dm="/assets/bride-bouquet-D-w_DTrn.jpg",Rm="/assets/white-rose-centerpiece-BC-nbtdY.jpg",_m="/assets/bridal-shoes-D2tQj2TV.jpg",Pm="/assets/bridesmaid-bouquets-CxKODXOk.jpg",Im="/assets/pink-florals-CMc7Euh1.jpg",Am="/assets/outdoor-ceremony-BNs4sqd3.jpg",Em="/assets/romantic-table-BnVQBo_i.jpg",Lm="/assets/invitation-florals-DYVFReR9.jpg",Mm="/assets/greenery-arch-CaIdcbYR.jpg",Om="/assets/bride-portrait--VhIjz_B.jpg",Hm="/assets/couple-sunset-BeMZgRtd.jpg",Fm="/assets/golden-hour-couple-oXK83F0b.jpg",gt="/assets/black-lab-puppy-BFmE9DcA.jpg",Gm="/assets/baby-seal-JOogIPil.jpg",Um="/assets/baby-giraffe-DXhAImEl.jpg",Ym="/assets/baby-elephant-6zXxD6AH.jpg",zm="/assets/orange-kitten-BbJ8u4YF.jpg",Wm="/assets/baby-pig-xeSgnk97.jpg",Vm="/assets/baby-ducklings-BdZAkD9x.jpg",Km="/assets/boxer-puppy-F_F1z7Bk.jpg",qm="/assets/yawning-puppy-B2BP9Sjl.jpg",wa="/assets/dog-with-star-CArUTdrp.jpg",Xm=un({title:ja().max(200,"Title must be less than 200 characters"),text_content:ja().max(1e4,"Message must be less than 10,000 characters"),frontEmojis:Za(Qa()).max(50,"Maximum 50 emojis allowed on front"),backEmojis:Za(Qa()).max(50,"Maximum 50 emojis allowed on back"),giftCardCode:ja().max(100,"Gift card code too long")});function Su(){var za;const{id:n}=_s(),r=Ps(),{user:s,subscription:o,refreshSubscription:m}=Is(),{openCustomerPortal:y,loading:i}=qs(),c=As(),d=t.useRef(null),[h,T]=t.useState(null),[R,S]=t.useState(""),[B,k]=t.useState("portrait"),[x,C]=t.useState(null),[f,p]=t.useState(""),[N,P]=t.useState(""),[H,oe]=t.useState(!1),[L,q]=t.useState(0),[Z,E]=t.useState(null),[X,Q]=t.useState(null),[U,V]=t.useState(""),[z,W]=t.useState(""),[te,se]=t.useState(null),j=t.useRef(null),[ee,ue]=t.useState(""),[fe,je]=t.useState(""),[re,Ce]=t.useState({x:50,y:85}),[pe,D]=t.useState("2xl"),[Y,ne]=t.useState("sans"),[F,G]=t.useState(""),[O,de]=t.useState(""),[A,ae]=t.useState({backgroundColor:"#ffffff",borderStyle:"4px solid #1e40af",pattern:"",frontTextColor:"#000000",backTextColor:"#000000",backTextSize:"2xl",backFontFamily:"sans",imageBorderStyle:"",backgroundEffect:"none"}),[Pe,Ie]=t.useState("sans"),[Je,ma]=t.useState(!0),[$e,ua]=t.useState(!0),[Ze,Ue]=t.useState(!1),[pa,Pa]=t.useState(!1),[Ae,Qe]=t.useState([]),[Ee,ea]=t.useState([]),[ve,Le]=t.useState(null),[Me,Jm]=t.useState(!1),[Ia,aa]=t.useState(""),[Ye,ta]=t.useState(""),[rs,xe]=t.useState(!1),[$m,ze]=t.useState(""),[Aa,Ea]=t.useState(!1),[sa,La]=t.useState(""),[Ma,ga]=t.useState(!1),[Oa,is]=t.useState("USD");t.useEffect(()=>{yt().then(is)},[]);const we={female:{christmas:[{path:"/audio/female/christmas/christmas-1.mp3",name:"Classic #1"},{path:"/audio/female/christmas/christmas-2.mp3",name:"Classic #2"},{path:"/audio/female/christmas/christmas-3.mp3",name:"Classic #3"},{path:"/audio/female/christmas/christmas-4.mp3",name:"Classic #4"},{path:"/audio/female/christmas/christmas-5.mp3",name:"Classic #5"},{path:"/audio/female/christmas/christmas-6.mp3",name:"Classic #6"},{path:"/audio/female/christmas/christmas-7.mp3",name:"Classic #7"},{path:"/audio/female/christmas/christmas-8.mp3",name:"Classic #8"},{path:"/audio/female/christmas/christmas-9.mp3",name:"Classic #9"},{path:"/audio/female/christmas/christmas-10.mp3",name:"Classic #10"},{path:"/audio/female/christmas/christmas-11.mp3",name:"Classic #11"},{path:"/audio/female/christmas/christmas-12.mp3",name:"Classic #12"},{path:"/audio/female/christmas/christmas-13.mp3",name:"Classic #13"},{path:"/audio/female/christmas/christmas-14.mp3",name:"Classic #14"}],congratulations:[{path:"/audio/female/congratulations/congrats-1.mp3",name:"Classic #1"},{path:"/audio/female/congratulations/congrats-2.mp3",name:"Classic #2"},{path:"/audio/female/congratulations/congrats-3.mp3",name:"Classic #3"},{path:"/audio/female/congratulations/congrats-4.mp3",name:"Classic #4"},{path:"/audio/female/congratulations/congrats-5.mp3",name:"Classic #5"},{path:"/audio/female/congratulations/congrats-6.mp3",name:"Classic #6"},{path:"/audio/female/congratulations/congrats-7.mp3",name:"Classic #7"},{path:"/audio/female/congratulations/congrats-8.mp3",name:"Classic #8"},{path:"/audio/female/congratulations/congrats-9.mp3",name:"Classic #9"},{path:"/audio/female/congratulations/congrats-10.mp3",name:"Classic #10"},{path:"/audio/female/congratulations/congrats-11.mp3",name:"Classic #11"},{path:"/audio/female/congratulations/congrats-12.mp3",name:"Classic #12"},{path:"/audio/female/congratulations/congrats-13.mp3",name:"Classic #13"},{path:"/audio/female/congratulations/congrats-14.mp3",name:"Classic #14"},{path:"/audio/female/congratulations/congrats-drill-sergeant.mp3",name:"Drill Sergeant"},{path:"/audio/female/congratulations/congrats-jessie.mp3",name:"Jessie"},{path:"/audio/female/congratulations/congrats-julieandrews.mp3",name:"Julie Andrews"},{path:"/audio/female/congratulations/poshlady.mp3",name:"Posh Lady"},{path:"/audio/female/congratulations/surferchick.mp3",name:"Surfer Chick"},{path:"/audio/female/congratulations/witch.mp3",name:"Witch"}],goodLuck:[{path:"/audio/female/good-luck/GOOD_LUCK_1.mp3",name:"Classic #1"},{path:"/audio/female/good-luck/GOOD_LUCK_2.mp3",name:"Classic #2"},{path:"/audio/female/good-luck/GOOD_LUCK_3.mp3",name:"Classic #3"},{path:"/audio/female/good-luck/GOOD_LUCK_4.mp3",name:"Classic #4"},{path:"/audio/female/good-luck/GOOD_LUCK_5.mp3",name:"Classic #5"},{path:"/audio/female/good-luck/GOOD_LUCK_6.mp3",name:"Classic #6"},{path:"/audio/female/good-luck/GOOD_LUCK_7.mp3",name:"Classic #7"},{path:"/audio/female/good-luck/GOOD_LUCK_8.mp3",name:"Classic #8"},{path:"/audio/female/good-luck/GOOD_LUCK_9.mp3",name:"Classic #9"},{path:"/audio/female/good-luck/GOOD_LUCK_10.mp3",name:"Classic #10"},{path:"/audio/female/good-luck/GOOD_LUCK_11.mp3",name:"Classic #11"},{path:"/audio/female/good-luck/GOOD_LUCK_12.mp3",name:"Classic #12"},{path:"/audio/female/good-luck/GOOD_LUCK_13.mp3",name:"Classic #13"},{path:"/audio/female/good-luck/GOOD_LUCK_14.mp3",name:"Classic #14"},{path:"/audio/female/good-luck/GOOD_LUCK_15.mp3",name:"Classic #15"},{path:"/audio/female/good-luck/GOOD_LUCK_16.mp3",name:"Classic #16"},{path:"/audio/female/good-luck/GOOD_LUCK_DRILL_SERGEANT.mp3",name:"Drill Sergeant"},{path:"/audio/female/good-luck/JESSIE_GOOD_LUCK.mp3",name:"Jessie"},{path:"/audio/female/good-luck/JULIEANDREWS_GOOD_LUCK.mp3",name:"Julie Andrews"},{path:"/audio/female/good-luck/POSHLADY_GOOD_LUCK.mp3",name:"Posh Lady"},{path:"/audio/female/good-luck/SURFERCHICK_GOOD_LUCK.mp3",name:"Surfer Chick"},{path:"/audio/female/good-luck/WITCH_GOOD_LUCK.mp3",name:"Witch"}],happyBirthday:[{path:"/audio/female/birthday/BIRTHDAY_1.mp3",name:"Classic #1"},{path:"/audio/female/birthday/BIRTHDAY_2.mp3",name:"Classic #2"},{path:"/audio/female/birthday/BIRTHDAY_3.mp3",name:"Classic #3"},{path:"/audio/female/birthday/BIRTHDAY_4.mp3",name:"Classic #4"},{path:"/audio/female/birthday/BIRTHDAY_5.mp3",name:"Classic #5"},{path:"/audio/female/birthday/BIRTHDAY_6.mp3",name:"Classic #6"},{path:"/audio/female/birthday/BIRTHDAY_7.mp3",name:"Classic #7"},{path:"/audio/female/birthday/BIRTHDAY_8.mp3",name:"Classic #8"},{path:"/audio/female/birthday/BIRTHDAY_9.mp3",name:"Classic #9"},{path:"/audio/female/birthday/BIRTHDAY_10.mp3",name:"Classic #10"},{path:"/audio/female/birthday/BIRTHDAY_11.mp3",name:"Classic #11"},{path:"/audio/female/birthday/BIRTHDAY_12.mp3",name:"Classic #12"},{path:"/audio/female/birthday/BIRTHDAY_13.mp3",name:"Classic #13"},{path:"/audio/female/birthday/BIRTHDAY_14.mp3",name:"Classic #14"},{path:"/audio/female/birthday/BIRTHDAY_15.mp3",name:"Classic #15"},{path:"/audio/female/birthday/BIRTHDAY_16.mp3",name:"Classic #16"},{path:"/audio/female/birthday/BIRTHDAY_17.mp3",name:"Classic #17"},{path:"/audio/female/birthday/BIRTHDAY_18.mp3",name:"Classic #18"},{path:"/audio/female/birthday/BIRTHDAY_19.mp3",name:"Classic #19"},{path:"/audio/female/birthday/BIRTHDAY_20.mp3",name:"Classic #20"},{path:"/audio/female/birthday/BIRTHDAY_21.mp3",name:"Classic #21"},{path:"/audio/female/birthday/BIRTHDAY_22.mp3",name:"Classic #22"},{path:"/audio/female/birthday/BIRTHDAY_23.mp3",name:"Classic #23"},{path:"/audio/female/birthday/BIRTHDAY_24.mp3",name:"Classic #24"},{path:"/audio/female/birthday/BIRTHDAY_25.mp3",name:"Classic #25"},{path:"/audio/female/birthday/BIRTHDAY_26.mp3",name:"Classic #26"},{path:"/audio/female/birthday/BIRTHDAY_27.mp3",name:"Classic #27"},{path:"/audio/female/birthday/BIRTHDAY_28.mp3",name:"Classic #28"},{path:"/audio/female/birthday/BIRTHDAY_29.mp3",name:"Classic #29"},{path:"/audio/female/birthday/DRILLSERGEANT_1.mp3",name:"Drill Sergeant #1"},{path:"/audio/female/birthday/DRILLSERGEANT_2.mp3",name:"Drill Sergeant #2"},{path:"/audio/female/birthday/JESSIE_1.mp3",name:"Jessie #1"},{path:"/audio/female/birthday/JESSIE_2.mp3",name:"Jessie #2"},{path:"/audio/female/birthday/JULIEANDREWS_1.mp3",name:"Julie Andrews #1"},{path:"/audio/female/birthday/JULIEANDREWS_2.mp3",name:"Julie Andrews #2"},{path:"/audio/female/birthday/POSHLADY_1.mp3",name:"Posh Lady #1"},{path:"/audio/female/birthday/POSHLADY_2.mp3",name:"Posh Lady #2"},{path:"/audio/female/birthday/SURFERCHICK_1.mp3",name:"Surfer Chick #1"},{path:"/audio/female/birthday/SURFERCHICK_2.mp3",name:"Surfer Chick #2"},{path:"/audio/female/birthday/WITCH_1.mp3",name:"Witch #1"},{path:"/audio/female/birthday/WITCH_2.mp3",name:"Witch #2"}]},male:{christmas:[{path:"/audio/male/christmas/CHRISTMAS_15.mp3",name:"Classic #15"},{path:"/audio/male/christmas/CHRISTMAS_16.mp3",name:"Classic #16"},{path:"/audio/male/christmas/CHRISTMAS_17.mp3",name:"Classic #17"},{path:"/audio/male/christmas/CHRISTMAS_18.mp3",name:"Classic #18"},{path:"/audio/male/christmas/CHRISTMAS_19.mp3",name:"Classic #19"},{path:"/audio/male/christmas/CHRISTMAS_20.mp3",name:"Classic #20"},{path:"/audio/male/christmas/CHRISTMAS_21.mp3",name:"Classic #21"},{path:"/audio/male/christmas/CHRISTMAS_22.mp3",name:"Classic #22"},{path:"/audio/male/christmas/CHRISTMAS_23.mp3",name:"Classic #23"},{path:"/audio/male/christmas/CHRISTMAS_24.mp3",name:"Classic #24"},{path:"/audio/male/christmas/CHRISTMAS_25.mp3",name:"Classic #25"},{path:"/audio/male/christmas/CHRISTMAS_26.mp3",name:"Classic #26"},{path:"/audio/male/christmas/CHRISTMAS_27.mp3",name:"Classic #27"},{path:"/audio/male/christmas/CHRISTMAS_28.mp3",name:"Classic #28"}],congratulations:[{path:"/audio/male/congratulations/BUILDER_CONGRATS.mp3",name:"Builder"},{path:"/audio/male/congratulations/CONGRATS_15.mp3",name:"Classic #15"},{path:"/audio/male/congratulations/CONGRATS_16.mp3",name:"Classic #16"},{path:"/audio/male/congratulations/CONGRATS_17.mp3",name:"Classic #17"},{path:"/audio/male/congratulations/CONGRATS_18.mp3",name:"Classic #18"},{path:"/audio/male/congratulations/CONGRATS_19.mp3",name:"Classic #19"},{path:"/audio/male/congratulations/CONGRATS_20.mp3",name:"Classic #20"},{path:"/audio/male/congratulations/CONGRATS_21.mp3",name:"Classic #21"},{path:"/audio/male/congratulations/CONGRATS_22.mp3",name:"Classic #22"},{path:"/audio/male/congratulations/CONGRATS_23.mp3",name:"Classic #23"},{path:"/audio/male/congratulations/CONGRATS_24.mp3",name:"Classic #24"},{path:"/audio/male/congratulations/CONGRATS_25.mp3",name:"Classic #25"},{path:"/audio/male/congratulations/CONGRATS_26.mp3",name:"Classic #26"},{path:"/audio/male/congratulations/CONGRATS_27.mp3",name:"Classic #27"},{path:"/audio/male/congratulations/CONGRATS_28.mp3",name:"Classic #28"},{path:"/audio/male/congratulations/CONGRATS_29.mp3",name:"Classic #29"},{path:"/audio/male/congratulations/DRILL_SERGEANT_CONGRATS.mp3",name:"Drill Sergeant"},{path:"/audio/male/congratulations/GANDLAF_CONGRATS.mp3",name:"Gandalf"},{path:"/audio/male/congratulations/GORDON_RAMSEY.mp3",name:"Gordon Ramsay"},{path:"/audio/male/congratulations/PILOT_CONGRATS.mp3",name:"Pilot"},{path:"/audio/male/congratulations/PIRATE_CONGRATS.mp3",name:"Pirate"},{path:"/audio/male/congratulations/RON_BURGUNDY_CONGRATS.mp3",name:"Ron Burgundy"}],goodLuck:[{path:"/audio/male/good-luck/GOOD_LUCK_BUILDER.mp3",name:"Builder"},{path:"/audio/male/good-luck/GOOD_LUCK_17.mp3",name:"Classic #17"},{path:"/audio/male/good-luck/GOOD_LUCK_18.mp3",name:"Classic #18"},{path:"/audio/male/good-luck/GOOD_LUCK_19.mp3",name:"Classic #19"},{path:"/audio/male/good-luck/GOOD_LUCK_20.mp3",name:"Classic #20"},{path:"/audio/male/good-luck/GOOD_LUCK_21.mp3",name:"Classic #21"},{path:"/audio/male/good-luck/GOOD_LUCK_22.mp3",name:"Classic #22"},{path:"/audio/male/good-luck/GOOD_LUCK_23.mp3",name:"Classic #23"},{path:"/audio/male/good-luck/GOOD_LUCK_24.mp3",name:"Classic #24"},{path:"/audio/male/good-luck/GOOD_LUCK_25.mp3",name:"Classic #25"},{path:"/audio/male/good-luck/GOOD_LUCK_26.mp3",name:"Classic #26"},{path:"/audio/male/good-luck/GOOD_LUCK_27.mp3",name:"Classic #27"},{path:"/audio/male/good-luck/GOOD_LUCK_28.mp3",name:"Classic #28"},{path:"/audio/male/good-luck/GOOD_LUCK_29.mp3",name:"Classic #29"},{path:"/audio/male/good-luck/GOOD_LUCK_30.mp3",name:"Classic #30"},{path:"/audio/male/good-luck/DRILL_SERGEANT_GOOD_LUCK.mp3",name:"Drill Sergeant"},{path:"/audio/male/good-luck/GANDLAF_GOOD_LUCK.mp3",name:"Gandalf"},{path:"/audio/male/good-luck/GOOD_LUCK_GORDON_RAMSEY.mp3",name:"Gordon Ramsay"},{path:"/audio/male/good-luck/GOOD_LUCK_PILOT.mp3",name:"Pilot"},{path:"/audio/male/good-luck/GOOD_LUCK_PIRATE.mp3",name:"Pirate"},{path:"/audio/male/good-luck/GOOD_LUCK_SURFER.mp3",name:"Surfer Dude"}],happyBirthday:[{path:"/audio/male/birthday/BIRTHDAY_30.mp3",name:"Classic #30"},{path:"/audio/male/birthday/BIRTHDAY_31.mp3",name:"Classic #31"},{path:"/audio/male/birthday/BIRTHDAY_32.mp3",name:"Classic #32"},{path:"/audio/male/birthday/BIRTHDAY_33.mp3",name:"Classic #33"},{path:"/audio/male/birthday/BIRTHDAY_34.mp3",name:"Classic #34"},{path:"/audio/male/birthday/BIRTHDAY_36.mp3",name:"Classic #36"},{path:"/audio/male/birthday/BIRTHDAY_37.mp3",name:"Classic #37"},{path:"/audio/male/birthday/BIRTHDAY_38.mp3",name:"Classic #38"},{path:"/audio/male/birthday/BIRTHDAY_39.mp3",name:"Classic #39"},{path:"/audio/male/birthday/BIRTHDAY_40.mp3",name:"Classic #40"},{path:"/audio/male/birthday/BIRTHDAY_41.mp3",name:"Classic #41"},{path:"/audio/male/birthday/BIRTHDAY_42.mp3",name:"Classic #42"},{path:"/audio/male/birthday/BIRTHDAY_43.mp3",name:"Classic #43"},{path:"/audio/male/birthday/BIRTHDAY_44.mp3",name:"Classic #44"},{path:"/audio/male/birthday/BIRTHDAY_45.mp3",name:"Classic #45"},{path:"/audio/male/birthday/BIRTHDAY_46.mp3",name:"Classic #46"},{path:"/audio/male/birthday/BIRTHDAY_47.mp3",name:"Classic #47"},{path:"/audio/male/birthday/BIRTHDAY_48.mp3",name:"Classic #48"},{path:"/audio/male/birthday/BIRTHDAY_49.mp3",name:"Classic #49"},{path:"/audio/male/birthday/BIRTHDAY_50.mp3",name:"Classic #50"},{path:"/audio/male/birthday/BIRTHDAY_51.mp3",name:"Classic #51"},{path:"/audio/male/birthday/BIRTHDAY_52.mp3",name:"Classic #52"},{path:"/audio/male/birthday/BIRTHDAY_53.mp3",name:"Classic #53"},{path:"/audio/male/birthday/BIRTHDAY_54.mp3",name:"Classic #54"},{path:"/audio/male/birthday/BIRTHDAY_55.mp3",name:"Classic #55"},{path:"/audio/male/birthday/BIRTHDAY_56.mp3",name:"Classic #56"},{path:"/audio/male/birthday/BIRTHDAY_BUILDER.mp3",name:"Builder #1"},{path:"/audio/male/birthday/BIRTHDAY_BUILDER_2.mp3",name:"Builder #2"},{path:"/audio/male/birthday/BIRTHDAY_GANDLAF.mp3",name:"Gandalf #1"},{path:"/audio/male/birthday/BIRTHDAY_GANDLAF_2.mp3",name:"Gandalf #2"},{path:"/audio/male/birthday/BIRTHDAY_GORDON.mp3",name:"Gordon Ramsay"},{path:"/audio/male/birthday/DRILL_SERGEANT_3.mp3",name:"Drill Sergeant #1"},{path:"/audio/male/birthday/DRILL_SERGEANT_4.mp3",name:"Drill Sergeant #2"},{path:"/audio/male/birthday/PILOT_BIRTHDAY.mp3",name:"Pilot #1"},{path:"/audio/male/birthday/PILOT_BIRTHDAY_2.mp3",name:"Pilot #2"},{path:"/audio/male/birthday/PIRATE_BIRTHDAY.mp3",name:"Pirate"},{path:"/audio/male/birthday/RONBURGUNDY_BIRTHDAY.mp3",name:"Ron Burgundy #1"},{path:"/audio/male/birthday/RONBURGUNDY_BIRTHDAY_2.mp3",name:"Ron Burgundy #2"},{path:"/audio/male/birthday/SURFER_BIRTHDAY.mp3",name:"Surfer Dude"}]}},Ha={birthday:[{id:"bd-new-27",name:"Party Cat",image:$a},{id:"bd-new-29",name:"Birthday Cake Dark",image:ba},{id:"bd-new-30",name:"Purple Balloon Yellow",image:Qs},{id:"bd-new-31",name:"Happy Birthday Gold Sign",image:en},{id:"bd-new-32",name:"Teal Donuts Candles",image:to},{id:"bd-new-33",name:"Polka Dot Balloons",image:an},{id:"bd-new-34",name:"Sparkler Cake Citrus",image:so},{id:"bd-new-35",name:"Letterboard Birthday",image:no},{id:"bd-new-36",name:"Sparkler Bokeh",image:oo},{id:"bd-new-19",name:"Pink Sprinkle Cake",image:tn},{id:"bd-new-20",name:"Colorful Sprinkle Cake",image:sn},{id:"bd-new-21",name:"Chocolate Drip Cake",image:ro},{id:"bd-new-22",name:"White Frosting Cake",image:io},{id:"bd-new-23",name:"Pink Rose Cake",image:lo},{id:"bd-new-24",name:"Strawberry Cake",image:co},{id:"bd-new-25",name:"White Balloon Setup",image:mo},{id:"bd-new-26",name:"Colorful Balloons Sky",image:uo},{id:"bd-new-28",name:"Pineapple Party",image:po},{id:"bd-new-10",name:"Birthday Balloon Street",image:go},{id:"bd-new-11",name:"Lit Candles Close",image:ho},{id:"bd-new-12",name:"Gold Balloons Party",image:nn},{id:"bd-new-13",name:"Ice Cream Cone Cake",image:fo},{id:"bd-new-14",name:"Yellow Sprinkles",image:xo},{id:"bd-new-15",name:"Colorful Cupcakes",image:on},{id:"bd-new-16",name:"Happy Birthday Sprinkles",image:yo},{id:"bd-new-17",name:"Cake Slice Confetti",image:bo},{id:"bd-new-18",name:"White Cake Candles",image:jo},{id:"bd-new-1",name:"Pastel Gifts",image:Co},{id:"bd-new-2",name:"Cupcake Candle Dark",image:vo},{id:"bd-new-3",name:"Happy Birthday Candles",image:wo},{id:"bd-new-4",name:"Cake Party Coral",image:So},{id:"bd-new-5",name:"Party Table Banner",image:ko},{id:"bd-new-6",name:"Elegant Flower Cake",image:No},{id:"bd-new-7",name:"Pink Drip Cake",image:Bo},{id:"bd-new-8",name:"Cranberry Candle Cake",image:To},{id:"bd-new-9",name:"Party Dog",image:rn},{id:"bd-1",name:"Balloons & Stars",image:Do},{id:"bd-2",name:"Purple Cake",image:Ro},{id:"bd-3",name:"Happy Birthday Navy",image:_o},{id:"bd-5",name:"Minimalist",image:Po},{id:"bd-7",name:"Pink Glitter",image:Io},{id:"bd-8",name:"Black Balloons",image:Ao},{id:"bd-9",name:"Confetti Celebration",image:Eo},{id:"bd-10",name:"Rainbow Stars",image:Lo},{id:"bd-11",name:"Gold Navy Elegant",image:Mo},{id:"bd-12",name:"Cupcakes Mint",image:Oo},{id:"bd-13",name:"Geometric Modern",image:Ho},{id:"bd-14",name:"Watercolor Flowers",image:Fo},{id:"bd-17",name:"Vintage Lace",image:Go},{id:"bd-18",name:"Party Hats Yellow",image:Uo},{id:"bd-20",name:"Fireworks Night",image:Yo},{id:"bd-21",name:"Art Deco Gold",image:zo},{id:"bd-22",name:"Unicorn Rainbow",image:Wo},{id:"bd-26",name:"Marble Rose Gold",image:Vo},{id:"bd-27",name:"Space Galaxy",image:Ko},{id:"bd-29",name:"Donuts Sprinkles",image:qo},{id:"bd-30",name:"Silver Glitter White",image:Xo},{id:"bd-31",name:"Pets Playful",image:Jo},{id:"bd-33",name:"Ice Cream Summer",image:$o},{id:"bd-34",name:"Nautical Navy",image:Zo},{id:"bd-37",name:"Cherry Blossom Pink",image:Qo},{id:"bd-38",name:"Neon City",image:er},{id:"bd-39",name:"Tribal Southwestern",image:ar},{id:"bd-40",name:"Hot Air Balloons",image:tr},{id:"bd-42",name:"Bubbles Light Blue",image:sr},{id:"bd-43",name:"Steampunk Gears",image:nr},{id:"bd-45",name:"Beach Seashells",image:or},{id:"bd-46",name:"Paris Eiffel",image:rr},{id:"bd-47",name:"Moroccan Tiles",image:ir},{id:"bd-48",name:"Birthday Cupcake",image:lr},{id:"bd-49",name:"Pink Celebration Cake",image:cr},{id:"bd-50",name:"Rainbow Cupcakes",image:ln},{id:"bd-51",name:"Birthday Balloon",image:dr},{id:"bd-52",name:"Colorful Candles Cake",image:mr},{id:"bd-53",name:"Berry Birthday Cake",image:ur},{id:"bd-54",name:"Golden Retriever Party",image:pr},{id:"bd-55",name:"Dog with Balloons",image:gr},{id:"bd-56",name:"Party Pineapple",image:hr},{id:"bd-57",name:"Sparkler Cake",image:cn},{id:"bd-58",name:"Frenchie Party Hat",image:fr},{id:"bd-59",name:"Sparklers",image:xr},{id:"bd-60",name:"Dog with Star",image:wa}],"Valentines/Love":[{id:"vl-41",name:"Red Rose Petals",image:Mi},{id:"vl-42",name:"Pastel Hearts 3D",image:Oi},{id:"vl-43",name:"Pink Heart Balloon",image:Hi},{id:"vl-44",name:"Red Roses Dark",image:Fi},{id:"vl-45",name:"Heart Sprinkles Bowl",image:Gi},{id:"vl-46",name:"Love Paint Art",image:Ui},{id:"vl-47",name:"Flower Heart Wall",image:Yi},{id:"vl-48",name:"Red Roses Flat",image:zi},{id:"vl-49",name:"Pink Rose Vase",image:Wi},{id:"vl-50",name:"Love Scrabble Tiles",image:Vi},{id:"vl-31",name:"Heart Macarons",image:Ki},{id:"vl-32",name:"Heart Latte Art",image:qi},{id:"vl-33",name:"Coffee Heart Foam",image:Xi},{id:"vl-34",name:"Coffee Heart Swirl",image:Ji},{id:"vl-35",name:"Pink Rose Bouquet",image:$i},{id:"vl-36",name:"Red Hearts Decor",image:Zi},{id:"vl-37",name:"Heart Cupcakes",image:Qi},{id:"vl-38",name:"Red Tulips Field",image:el},{id:"vl-39",name:"Couple Holding Hands",image:al},{id:"vl-40",name:"Couple Embrace",image:tl},{id:"vl-21",name:"Red Rose Bokeh",image:sl},{id:"vl-22",name:"Dog with Rose",image:nl},{id:"vl-23",name:"Heart Chocolates Sugar",image:ol},{id:"vl-24",name:"Red Flower Closeup",image:rl},{id:"vl-25",name:"Orange Heart Balloons",image:il},{id:"vl-26",name:"Heart Cake Love",image:ll},{id:"vl-27",name:"Heart Cookie Hand",image:cl},{id:"vl-28",name:"Heart Cookies Spread",image:dl},{id:"vl-29",name:"Red Gift Box",image:ml},{id:"vl-30",name:"Pink Heart Marble",image:ul},{id:"vl-11",name:"Pink Heart Lollipop",image:pl},{id:"vl-12",name:"Love Letter Roses",image:gl},{id:"vl-13",name:"Red Rose Classic",image:hl},{id:"vl-14",name:"Heart Bokeh Lights",image:fl},{id:"vl-15",name:"Candy Hearts Pile",image:xl},{id:"vl-16",name:"Red Valentines Envelope",image:yl},{id:"vl-17",name:"Pink Rose Water",image:bl},{id:"vl-18",name:"Dried Flower Bouquet",image:jl},{id:"vl-19",name:"Heart Balloons Pink",image:Cl},{id:"vl-20",name:"Red Heart Balloons",image:vl},{id:"vl-1",name:"Teddy Bear Love",image:wl},{id:"vl-2",name:"Red Heart Candies",image:Sl},{id:"vl-3",name:"Red Roses Bouquet",image:kl},{id:"vl-4",name:"Pink Roses Frame",image:Nl},{id:"vl-5",name:"Rose on Books",image:Bl},{id:"vl-6",name:"Watercolor Peach",image:Tl},{id:"vl-7",name:"Pink Roses Macarons",image:_l},{id:"vl-8",name:"Macarons Flowers Love",image:Pl},{id:"vl-9",name:"Neon Heart Glow",image:Il},{id:"vl-10",name:"Rose in Glass",image:Al},{id:"l-1",name:"Pink Hearts",image:El},{id:"l-2",name:"Romantic Roses",image:va},{id:"l-3",name:"Love Letters",image:Ll},{id:"l-4",name:"Heart Balloons",image:Ml},{id:"l-5",name:"Red Roses",image:Ol},{id:"l-6",name:"Infinity Roses",image:Hl},{id:"l-7",name:"Sunset Beach",image:Fl},{id:"l-8",name:"Watercolor Hearts",image:Gl},{id:"l-9",name:"Heart Lights",image:Ul},{id:"l-10",name:"Coffee Hearts",image:Yl},{id:"l-11",name:"Doves & Ribbon",image:zl},{id:"l-12",name:"Paris Bicycle",image:Wl},{id:"l-13",name:"Cherry Blossom Heart",image:Vl},{id:"l-14",name:"Swans Moonlight",image:Zl},{id:"vl-51",name:"Heart Candy Sticks",image:Dl},{id:"vl-52",name:"Love Sign Hearts",image:Rl}],Easter:[{id:"easter-1",name:"Decorated Eggs",image:dt},{id:"easter-2",name:"Spring Flowers",image:nd},{id:"easter-3",name:"Bunny Ears",image:od},{id:"easter-4",name:"Pink Eggs",image:rd},{id:"easter-5",name:"Egg Hunt",image:id},{id:"easter-6",name:"Pastel Eggs",image:ld},{id:"easter-7",name:"Spring Nest",image:cd},{id:"easter-8",name:"Colorful Eggs",image:dd},{id:"easter-9",name:"Easter Basket",image:md},{id:"easter-10",name:"Spring Tulips",image:ud}],christmas:[{id:"xmas-1",name:"Red Ornaments",image:nt},{id:"xmas-2",name:"Golden Bells",image:yr},{id:"xmas-4",name:"Festive Wreath",image:br},{id:"xmas-5",name:"Snow Tree",image:jr},{id:"xmas-6",name:"Cozy Cabin",image:Cr},{id:"xmas-7",name:"Santa Sleigh",image:vr},{id:"xmas-8",name:"Elegant Ornaments",image:wr},{id:"xmas-9",name:"Festive Gifts",image:Sr},{id:"xmas-10",name:"Sparkling Snowflakes",image:kr},{id:"xmas-11",name:"Fireplace & Stockings",image:Nr},{id:"xmas-12",name:"Candy Cane Delight",image:Br},{id:"xmas-13",name:"Reindeer Moonlight",image:Tr},{id:"xmas-14",name:"Gingerbread Village",image:Dr},{id:"xmas-15",name:"Poinsettia Elegance",image:Rr},{id:"xmas-16",name:"Presents Under Tree",image:_r},{id:"xmas-17",name:"Snow Globe Magic",image:Pr},{id:"xmas-18",name:"Holly & Pine Border",image:Ir},{id:"xmas-19",name:"Ice Skating Pond",image:Ar},{id:"xmas-20",name:"Nutcracker Soldier",image:Er},{id:"xmas-21",name:"Frosted Window",image:Lr},{id:"xmas-22",name:"Hot Chocolate Cozy",image:Mr},{id:"xmas-23",name:"Mistletoe Holly",image:Or},{id:"xmas-24",name:"Advent Calendar",image:Hr},{id:"xmas-25",name:"Carolers Singing",image:Fr},{id:"xmas-26",name:"Penguins Winter",image:Gr},{id:"xmas-27",name:"Church Village",image:Ur},{id:"xmas-29",name:"Rustic Wooden Sign",image:Yr},{id:"xmas-30",name:"Angels Gold",image:zr},{id:"xmas-31",name:"Mountain Cabin Night",image:Wr},{id:"xmas-33",name:"Knitted Sweater",image:Vr},{id:"xmas-34",name:"Polar Bears Arctic",image:Kr},{id:"xmas-35",name:"String Lights Dark",image:qr},{id:"xmas-36",name:"Vintage Truck Tree",image:Xr},{id:"xmas-37",name:"Cookies Milk Santa",image:Jr},{id:"xmas-38",name:"Cardinal Snow Branch",image:$r},{id:"xmas-39",name:"Silver Bells Blue",image:Zr},{id:"xmas-40",name:"Christmas Puppy Mistletoe",image:Qr},{id:"xmas-41",name:"Christmas Dog Santa Hat",image:ei},{id:"xmas-42",name:"Holly Berries",image:ai},{id:"xmas-43",name:"Christmas Tree Scene",image:ti},{id:"xmas-44",name:"Tree Ornaments",image:si},{id:"xmas-45",name:"Pinecones & Star",image:ni},{id:"xmas-46",name:"Wrapped Gift",image:oi},{id:"xmas-47",name:"Mini Trees",image:ri},{id:"xmas-48",name:"Christmas Flatlay",image:ii},{id:"xmas-49",name:"Door Wreath",image:li},{id:"xmas-50",name:"Stars & Lights",image:ci},{id:"xmas-51",name:"Red Stockings",image:di},{id:"xmas-52",name:"Wreath on Door",image:mi},{id:"xmas-53",name:"Gold Stars & Lights",image:ui},{id:"xmas-54",name:"Festive Red Stockings",image:pi},{id:"xmas-55",name:"Pine Branches",image:gi}],"generic-classic":[{id:"gc-1",name:"Floral Elegance",image:hi},{id:"gc-2",name:"Golden Frame",image:fi},{id:"gc-3",name:"Vintage Roses",image:xi},{id:"gc-4",name:"Botanical Wreath",image:yi},{id:"gc-5",name:"Elegant Border",image:bi},{id:"gc-6",name:"Classic Floral",image:ji},{id:"gc-7",name:"Mountain Flower",image:Ci},{id:"gc-8",name:"Mountain Sunset",image:vi}],"get-well":[{id:"gw-1",name:"Floral Balloon",image:ot},{id:"gw-2",name:"Blue Garden",image:wi},{id:"gw-3",name:"Pink Floral",image:Si},{id:"gw-4",name:"Starry Sky",image:ki}],"good-luck":[{id:"gl-1",name:"Lanterns Floral",image:Ni},{id:"gl-2",name:"Golden Clover Stars",image:Bi},{id:"gl-3",name:"Horseshoe Roses",image:Ti},{id:"gl-4",name:"Rainbow Clovers",image:Di},{id:"gl-5",name:"Lucky Cat",image:Ri},{id:"gl-6",name:"Shooting Stars",image:_i},{id:"gl-7",name:"Golden Key",image:Pi},{id:"gl-8",name:"Dreamcatcher",image:Ii},{id:"gl-9",name:"Ladybug Clover",image:Ai},{id:"gl-10",name:"Lucky Dice",image:Ei},{id:"gl-11",name:"Wise Owl",image:Li}],"thank-you":[{id:"ty-1",name:"Pastel Gradient",image:lt},{id:"ty-2",name:"Floral Border",image:qc},{id:"ty-3",name:"Eucalyptus Roses",image:Xc},{id:"ty-4",name:"Pressed Flowers",image:Jc},{id:"ty-5",name:"Sunset Birds",image:$c},{id:"ty-6",name:"Marble Gold",image:Zc},{id:"ty-7",name:"Butterfly Garden",image:Qc},{id:"ty-8",name:"Constellation Stars",image:ed},{id:"ty-9",name:"Autumn Harvest",image:ad},{id:"ty-10",name:"Peony Elegance",image:td}],"cute-animals":[{id:"ca-22",name:"Black Lab Puppy",image:gt},{id:"ca-23",name:"Boxer Puppy",image:Km},{id:"ca-24",name:"Yawning Puppy",image:qm},{id:"ca-25",name:"Dog with Star",image:wa},{id:"ca-1",name:"Baby Panda",image:Cd},{id:"ca-2",name:"Fluffy Kitten",image:vd},{id:"ca-3",name:"Golden Puppy",image:wd},{id:"ca-4",name:"Hedgehog with Flower",image:Sd},{id:"ca-5",name:"Baby Bunny",image:kd},{id:"ca-6",name:"Playful Otter",image:Nd},{id:"ca-7",name:"Baby Koala",image:Bd},{id:"ca-8",name:"Fox Kit",image:Td},{id:"ca-9",name:"Penguin with Bowtie",image:Dd},{id:"ca-10",name:"Baby Deer",image:Rd},{id:"ca-11",name:"Red Squirrel",image:_d},{id:"ca-12",name:"Baby Chicks",image:Pd},{id:"ca-13",name:"Baby Lamb",image:Id},{id:"ca-14",name:"Puppy in Basket",image:Ad},{id:"ca-15",name:"Baby Seal",image:Gm},{id:"ca-16",name:"Baby Giraffe",image:Um},{id:"ca-17",name:"Baby Elephant",image:Ym},{id:"ca-18",name:"Orange Kitten",image:zm},{id:"ca-19",name:"Baby Pig",image:Wm},{id:"ca-20",name:"Baby Ducklings",image:Vm},{id:"ca-21",name:"Lion with Sunglasses",image:Ed}],"Beautiful Scenery":[{id:"bs-39",name:"Boat Mountain Lake",image:mt},{id:"bs-40",name:"Hobbit Door",image:Ld},{id:"bs-41",name:"Garden Pond",image:Md},{id:"bs-29",name:"Alpine Meadow",image:Od},{id:"bs-30",name:"Castle Starry Night",image:Hd},{id:"bs-31",name:"Alpine Lake",image:Fd},{id:"bs-32",name:"Beach Sunset Surfer",image:Gd},{id:"bs-33",name:"Snowy Bench",image:Ud},{id:"bs-34",name:"Mountain River",image:Yd},{id:"bs-35",name:"Cherry Blossom Reflection",image:zd},{id:"bs-36",name:"Lake Dock Sunset",image:Wd},{id:"bs-37",name:"Tuscany Road",image:Vd},{id:"bs-38",name:"Tuscany Hills",image:Kd},{id:"bs-19",name:"Beach Drone View",image:qd},{id:"bs-20",name:"Mountain Peaks",image:Xd},{id:"bs-21",name:"Night Sky Tent",image:Jd},{id:"bs-22",name:"Mountain Lake Reflection",image:$d},{id:"bs-23",name:"Starry Mountain",image:Zd},{id:"bs-24",name:"Misty Forest",image:Qd},{id:"bs-25",name:"Mountain Sunrise",image:em},{id:"bs-26",name:"Mountain Silhouette",image:am},{id:"bs-27",name:"Northern Lights",image:tm},{id:"bs-28",name:"Sunset Reflection",image:sm},{id:"bs-9",name:"Pink Tree River",image:nm},{id:"bs-10",name:"Pink Dahlias",image:om},{id:"bs-11",name:"Palm Tree Sky",image:rm},{id:"bs-12",name:"Autumn Path",image:ut},{id:"bs-13",name:"Forest Waterfall",image:im},{id:"bs-14",name:"Mountain Painting",image:lm},{id:"bs-15",name:"Cliff Waterfall",image:cm},{id:"bs-16",name:"Autumn Trees",image:dm},{id:"bs-17",name:"Forest Stream",image:mm},{id:"bs-18",name:"Green Canyon",image:um},{id:"bs-1",name:"Mountain Lake Sunrise",image:pm},{id:"bs-2",name:"Tropical Beach Sunset",image:gm},{id:"bs-3",name:"Lavender Field",image:hm},{id:"bs-4",name:"Aurora Borealis",image:fm},{id:"bs-5",name:"Cherry Blossom Garden",image:xm},{id:"bs-6",name:"Tropical Waterfall",image:ym},{id:"bs-7",name:"Wheat Field Sunset",image:bm},{id:"bs-8",name:"Ocean Waves",image:jm}],"Wedding/Engagement":[{id:"wed-1",name:"Rings on Vinyl",image:pt},{id:"wed-2",name:"Rustic Table Setting",image:Cm},{id:"wed-3",name:"Garden Table",image:vm},{id:"wed-4",name:"Burgundy Bouquet",image:wm},{id:"wed-5",name:"Blush Bouquet",image:Sm},{id:"wed-6",name:"Canoe Couple",image:km},{id:"wed-7",name:"Elegant Reception",image:Nm},{id:"wed-8",name:"Adventure Cake",image:Bm},{id:"wed-9",name:"Rose Wedding Cake",image:Tm},{id:"wed-10",name:"Bride with Bouquet",image:Dm},{id:"wed-11",name:"White Rose Centerpiece",image:Rm},{id:"wed-12",name:"Bridal Shoes",image:_m},{id:"wed-13",name:"Bridesmaid Bouquets",image:Pm},{id:"wed-14",name:"Pink Florals",image:Im},{id:"wed-15",name:"Outdoor Ceremony",image:Am},{id:"wed-16",name:"Romantic Table",image:Em},{id:"wed-17",name:"Invitation Florals",image:Lm},{id:"wed-18",name:"Greenery Arch",image:Mm},{id:"wed-19",name:"Bride Portrait",image:Om},{id:"wed-20",name:"Couple Sunset",image:Hm},{id:"wed-21",name:"Golden Hour Couple",image:Fm}],"Mothers Day":[{id:"md-1",name:"Eucalyptus Bouquet",image:ct},{id:"md-2",name:"Donut Flowers",image:sd},{id:"md-3",name:"Gerbera Daisies",image:pd},{id:"md-4",name:"Mother & Child Art",image:gd},{id:"md-5",name:"Handmade Card",image:hd},{id:"md-6",name:"Forest Walk",image:fd},{id:"md-7",name:"Mother & Baby",image:xd},{id:"md-8",name:"I Love Mom",image:yd},{id:"md-9",name:"Best Mom Ever",image:bd},{id:"md-10",name:"Tulip Bouquet",image:jd}],"Fathers Day":[{id:"fd-1",name:"Workshop Tools",image:rt},{id:"fd-2",name:"Golf Green",image:Kl},{id:"fd-3",name:"Morning Coffee",image:ql},{id:"fd-4",name:"Mountain Adventure",image:Xl},{id:"fd-5",name:"Gentleman Style",image:Jl},{id:"fd-6",name:"Sports Fan",image:$l}],Graduation:[{id:"grad-1",name:"Caps in Air",image:it},{id:"grad-2",name:"Diploma Scroll",image:Pc},{id:"grad-3",name:"Celebration Balloons",image:Ic},{id:"grad-4",name:"Tassel Closeup",image:Ac},{id:"grad-5",name:"Books & Cap",image:Ec},{id:"grad-6",name:"Confetti Purple",image:Lc},{id:"grad-7",name:"University Building",image:Mc},{id:"grad-8",name:"Stars Achievement",image:Oc},{id:"grad-9",name:"Laurel Wreath",image:Hc},{id:"grad-10",name:"Modern Geometric",image:Fc},{id:"grad-11",name:"Sunrise Silhouette",image:Gc},{id:"grad-12",name:"Red Gold Elegant",image:Uc},{id:"grad-13",name:"Champagne Toast",image:Yc},{id:"grad-14",name:"Emerald Green",image:zc},{id:"grad-15",name:"Fireworks Night",image:Wc},{id:"grad-16",name:"Blue Silver",image:Vc},{id:"grad-17",name:"Bright Future",image:Kc}],Funny:[{id:"fun-1",name:"Grumpy Cat Monday",image:Ql},{id:"fun-2",name:"Lazy Sloth",image:ec},{id:"fun-3",name:"Office Dinosaur",image:ac},{id:"fun-4",name:"Tipsy Wine",image:tc},{id:"fun-5",name:"Avocado Friends",image:sc},{id:"fun-6",name:"Cool Pizza",image:nc},{id:"fun-7",name:"Confused Party Dog",image:oc},{id:"fun-8",name:"Sassy Cactus",image:rc},{id:"fun-9",name:"Eye Roll Unicorn",image:ic},{id:"fun-10",name:"Judgmental Taco",image:lc},{id:"fun-11",name:"Drama Llama",image:cc},{id:"fun-12",name:"Shocked Donut",image:dc},{id:"fun-13",name:"Dramatic Pug",image:mc},{id:"fun-14",name:"Wired Coffee",image:uc},{id:"fun-15",name:"Dumpster Fire",image:pc},{id:"fun-16",name:"Cheesy Wink",image:gc},{id:"fun-17",name:"Cheerful Skeleton",image:hc},{id:"fun-18",name:"Over It Chicken",image:fc},{id:"fun-19",name:"Suave Hotdog",image:xc},{id:"fun-20",name:"Done Frog",image:yc},{id:"fun-21",name:"Business Penguin",image:bc},{id:"fun-22",name:"Evil Cupcake",image:jc},{id:"fun-23",name:"Angry Alarm",image:Cc},{id:"fun-24",name:"Stressed Octopus",image:vc},{id:"fun-25",name:"Scared Toilet Paper",image:wc},{id:"fun-26",name:"Party Pickle",image:Sc},{id:"fun-27",name:"Slipping Banana",image:kc},{id:"fun-28",name:"Burnt Toast",image:Nc},{id:"fun-29",name:"Guilty Raccoon",image:Bc},{id:"fun-30",name:"Happy Beer",image:Tc},{id:"fun-31",name:"Fabulous Croissant",image:Dc},{id:"fun-32",name:"Lonely Sock",image:Rc},{id:"fun-33",name:"Dramatic Plant",image:_c}]},ls=a=>{const u=a.replace("#",""),l=parseInt(u.substring(0,2),16),g=parseInt(u.substring(2,4),16),v=parseInt(u.substring(4,6),16);return .299*l+.587*g+.114*v>128?"#000000":"#ffffff"},ha=async a=>{S(a);try{const g=await(await fetch(a)).blob(),v=a.split("/").pop()||"template.jpg",b=new File([g],v,{type:g.type});T(b)}catch(l){console.error("Error converting template to file:",l)}const u=new Image;u.onload=async()=>{const l=u.width>u.height?"landscape":"portrait";k(l),ae(g=>({...g,frontTextColor:"#000000",backTextColor:"#000000"}))},u.src=a,ta(""),w.success("Template applied!")},Fa={sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"},Ga={sans:"system-ui, sans-serif",serif:"Georgia, serif",mono:"Courier New, monospace",playfair:'"Playfair Display", serif',dancing:'"Dancing Script", cursive',pacifico:'"Pacifico", cursive'};t.useEffect(()=>{var l;if(new URLSearchParams(window.location.search).get("restore_draft")&&s){const g=localStorage.getItem("lionpost_draft_card");if(g)try{const v=JSON.parse(g);S(v.imageUrl||""),ue(v.text||""),je(v.frontText||""),de(v.theme||"");const b=v.cardStyle||{};ae({backgroundColor:b.backgroundColor||"#ffffff",borderStyle:b.borderStyle||"4px solid #1e40af",pattern:b.pattern||"",frontTextColor:b.frontTextColor||"#000000",backTextColor:b.backTextColor||"#000000",backTextSize:b.backTextSize||"2xl",backFontFamily:b.backFontFamily||"sans",imageBorderStyle:b.imageBorderStyle||"",backgroundEffect:b.backgroundEffect||"none"}),Qe(v.frontEmojis||[]),ea(v.backEmojis||[]),Le(v.googlyEyes||null),Ce(v.frontTextPosition||{x:50,y:85}),D(v.frontTextSize||"2xl"),G(v.giftCardCode||""),Ie(v.textFont||"sans"),ma(v.frontTextBold??!0),ua(v.backTextBold??!0),localStorage.removeItem("lionpost_draft_card"),setTimeout(()=>{na(!0),w.success("Your card has been saved!")},500),window.history.replaceState({},"","/editor")}catch(v){console.error("Error restoring draft card:",v),w.error("Failed to restore your card"),localStorage.removeItem("lionpost_draft_card")}}else if(n&&s)cs();else if(!n){const g=r.state,v=(l=g==null?void 0:g.occasion)==null?void 0:l.toLowerCase(),M=v?{birthdays:{category:"birthday",templateId:"bd-new-27",image:$a},weddings:{category:"Wedding/Engagement",templateId:"wed-1",image:pt},christmas:{category:"christmas",templateId:"xmas-1",image:nt},anniversaries:{category:"Valentines/Love",templateId:"l-2",image:va},"thank you":{category:"thank-you",templateId:"ty-1",image:lt},"get well":{category:"get-well",templateId:"gw-1",image:ot},graduation:{category:"Graduation",templateId:"grad-1",image:it},"new baby":{category:"cute-animals",templateId:"ca-22",image:gt},valentines:{category:"Valentines/Love",templateId:"l-2",image:va},retirement:{category:"Beautiful Scenery",templateId:"bs-39",image:mt},"mothers day":{category:"Mothers Day",templateId:"md-1",image:ct},"fathers day":{category:"Fathers Day",templateId:"fd-1",image:rt},easter:{category:"Easter",templateId:"easter-1",image:dt},halloween:{category:"birthday",templateId:"bd-new-29",image:ba},"new year":{category:"birthday",templateId:"bd-new-29",image:ba},thanksgiving:{category:"Beautiful Scenery",templateId:"bs-12",image:ut}}[v]:null;M?(ha(M.image),aa(M.templateId),ta(M.category)):(ha(wa),aa("bd-60"),ta("birthday")),g!=null&&g.occasion&&window.history.replaceState({},"","/editor")}},[s,n,r.state]);const cs=async()=>{try{const{data:a,error:u}=await J.from("cards").select("*").eq("id",n).single();if(u)throw u;if(a){if(S(a.image_url||""),ue(a.text_content||""),je(a.title||""),de(a.theme||""),p(a.audio_url||""),a.background_style){const l=a.background_style;ae({backgroundColor:l.backgroundColor||"#ffffff",borderStyle:l.borderStyle||"4px solid #1e40af",pattern:l.pattern||"",frontTextColor:l.frontTextColor||"#000000",backTextColor:l.backTextColor||"#000000",backTextSize:l.backTextSize||"2xl",backFontFamily:l.backFontFamily||"sans",imageBorderStyle:l.imageBorderStyle||"",backgroundEffect:l.backgroundEffect||"none"}),l.frontEmojis&&Qe(l.frontEmojis),l.backEmojis&&ea(l.backEmojis),l.frontTextPosition&&Ce(l.frontTextPosition),l.frontTextSize&&D(l.frontTextSize),l.giftCardCode&&G(l.giftCardCode),l.googlyEyes&&Le(l.googlyEyes),!l.backTextSize&&a.text_size&&ae(g=>({...g,backTextSize:a.text_size}))}else a.text_size&&ae(l=>({...l,backTextSize:a.text_size}));Ie(a.text_font||"sans"),ma(a.text_bold??!0),ua(a.text_bold??!0)}}catch(a){console.error("Error loading card:",a),w.error("Failed to load card")}},ds=async a=>{var b;const u=(b=a.target.files)==null?void 0:b[0];if(!u)return;const{compressImage:l}=await Es(async()=>{const{compressImage:M}=await import("./imageCompression-DBJzToy7.js");return{compressImage:M}},[]),g=await l(u);T(g);const v=new FileReader;v.onload=async M=>{var ie;const ye=(ie=M.target)==null?void 0:ie.result;S(ye);const ge=document.createElement("img");ge.onload=async()=>{const Oe=ge.width>ge.height?"landscape":"portrait";k(Oe),ae(Se=>({...Se,frontTextColor:"#000000",backTextColor:"#000000"}))},ge.src=ye},v.readAsDataURL(u)},Ua=async()=>{try{if(typeof window>"u"||typeof window.MediaRecorder>"u"){console.error("MediaRecorder is not supported in this browser"),w.error("Recording not supported in this browser.");return}f&&f.startsWith("blob:")&&URL.revokeObjectURL(f),C(null),p(""),P("");const a=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,channelCount:1}}),g=(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?["audio/mp4","audio/aac","audio/mp4;codecs=mp4a.40.2","audio/webm;codecs=opus","audio/webm"]:["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4","audio/aac"]).find(ie=>window.MediaRecorder&&MediaRecorder.isTypeSupported(ie))||"";console.log("[Recorder] Selected MIME type:",g);const v=g?{mimeType:g,audioBitsPerSecond:128e3}:void 0,b=new MediaRecorder(a,v),M=[];b.onstart=()=>console.log("[Recorder] started"),b.onerror=ie=>console.error("[Recorder] error",ie),b.ondataavailable=ie=>{ie.data&&ie.data.size>0&&M.push(ie.data)},b.onstop=()=>{var ie;try{const Oe=((ie=M[0])==null?void 0:ie.type)||g||"",Se=new Blob(M,Oe?{type:Oe}:void 0);if(console.log("[Recorder] onstop, blob type:",Se.type,"size:",Se.size),!Se.size){w.error("No audio captured. Please try again or switch browser/device."),a.getTracks().forEach(fa=>fa.stop()),oe(!1);return}const He=Se.type||g||"audio/webm";let We="webm";He.includes("ogg")?We="ogg":He.includes("mp4")?We="m4a":He.includes("aac")?We="aac":He.includes("webm")&&(We="webm");const ys=new File([Se],`recording.${We}`,{type:He}),bs=URL.createObjectURL(Se);C(ys),p(bs),P(He),oe(!1),a.getTracks().forEach(fa=>fa.stop()),w.success("Recording saved!")}catch(Oe){console.error("[Recorder] onstop processing error",Oe),w.error("Failed to process recording.")}},b.start(),E(b),oe(!0),q(0);let ye=0;const ge=setInterval(()=>{ye+=1,q(ye),ye>=30&&(clearInterval(ge),b.state==="recording"&&b.stop())},1e3);Q(ge)}catch(a){console.error("Error accessing microphone:",a),w.error("Failed to access microphone. Please grant permission.")}},ms=()=>{if(Z&&H)try{Z.stop()}catch{console.warn("stopRecording called but recorder already stopped")}X&&(clearInterval(X),Q(null))},us=async a=>{var v;const u=(v=a.target.files)==null?void 0:v[0];if(!u)return;if(!u.type.startsWith("audio/")){w.error("Please upload an audio file");return}const l=document.createElement("audio"),g=URL.createObjectURL(u);l.src=g,l.onloadedmetadata=()=>{if(l.duration>30){w.error("Audio must be 30 seconds or less"),URL.revokeObjectURL(g);return}C(u),p(g),P(u.type||""),w.success("Audio uploaded successfully")},l.onerror=()=>{w.error("Failed to load audio file"),URL.revokeObjectURL(g)}},Ya=()=>{f&&URL.revokeObjectURL(f),C(null),p(""),P(""),q(0),X&&(clearInterval(X),Q(null))},ps=async()=>{if(!h||!s)return null;try{const a=h.name.split(".").pop(),u=`${s.id}/${Date.now()}.${a}`,{error:l}=await J.storage.from("card-images").upload(u,h);if(l)throw l;const{data:g,error:v}=await J.storage.from("card-images").createSignedUrl(u,31536e3);if(v)throw v;return g.signedUrl}catch(a){return console.error("Error uploading image:",a),w.error("Failed to upload image"),null}},gs=async()=>{if(!x||!s)return null;try{const a=x.name.split(".").pop(),u=`${s.id}/${Date.now()}.${a}`,{error:l}=await J.storage.from("card-audio").upload(u,x);if(l)throw l;const{data:g,error:v}=await J.storage.from("card-audio").createSignedUrl(u,31536e3);if(v)throw v;return g.signedUrl}catch(a){return console.error("Error uploading audio:",a),w.error("Failed to upload audio"),null}},hs=async()=>{if(!O.trim()){w.error("Please enter a theme description");return}Ue(!0);try{const{data:a,error:u}=await J.functions.invoke("generate-card-theme",{body:{theme:O}});if(u)throw u;if(a.theme){const l=a.theme.backgroundColor||"#ffffff",g=ls(l);ae({backgroundColor:l,borderStyle:a.theme.borderStyle,pattern:a.theme.pattern,frontTextColor:a.theme.frontTextColor||a.theme.textColor||g,backTextColor:a.theme.backTextColor||a.theme.textColor||g,backTextSize:A.backTextSize,backFontFamily:A.backFontFamily,imageBorderStyle:a.theme.imageBorderStyle||"",backgroundEffect:A.backgroundEffect}),a.theme.suggestions&&a.theme.suggestions.length>0&&ue(a.theme.suggestions[0]),w.success("Theme generated!")}}catch(a){console.error("Error generating theme:",a),w.error(a.message||"Failed to generate theme")}finally{Ue(!1)}},na=async(a=!1)=>{if(!s){w.error("Please sign in to save your card",{action:{label:"Sign In",onClick:()=>c("/auth")}});return}Ue(!0);try{const u=fe,l=Xm.safeParse({title:u,text_content:ee,frontEmojis:Ae,backEmojis:Ee,giftCardCode:F||""});if(!l.success){const M=l.error.errors[0];w.error(M.message),Ue(!1);return}let g=R,v=f;if(h){const M=await ps();M&&(g=M)}if(x){const M=await gs();M&&(v=M)}const b={user_id:s.id,image_url:g,audio_url:v||null,text_content:ee,theme:O,background_style:{...A,frontEmojis:Ae,backEmojis:Ee,googlyEyes:ve,frontTextPosition:re,frontTextSize:pe,giftCardCode:F},text_size:A.backTextSize,text_font:Pe,text_bold:$e,front_text_bold:Je,title:u};if(n){const{error:M}=await J.from("cards").update(b).eq("id",n);if(M)throw M;w.success("Card updated!")}else{const{data:M,error:ye}=await J.from("cards").insert(b).select("id").single();if(ye)throw ye;const{data:ge}=await J.from("subscriptions").select("cards_created").eq("user_id",s.id).single();ge&&await J.from("subscriptions").update({cards_created:(ge.cards_created||0)+1}).eq("user_id",s.id),w.success("Card saved!"),M!=null&&M.id&&!a&&c(`/editor/${M.id}`,{replace:!0})}}catch(u){console.error("Error saving card:",u),w.error("Failed to save card")}finally{Ue(!1)}},fs=async()=>{if(!s){w.error("Please sign in to share your card",{action:{label:"Sign In",onClick:()=>c("/auth")}});return}if(!n){w.error("Please save the card first before sharing");return}const a=`${window.location.origin}/share/${n}`;let u=!1;const l=async v=>{try{const b=document.createElement("input");b.setAttribute("type","text"),b.setAttribute("value",v),b.setAttribute("readonly","readonly"),b.style.position="fixed",b.style.top="50%",b.style.left="50%",b.style.transform="translate(-50%, -50%)",b.style.width="1px",b.style.height="1px",b.style.padding="0",b.style.border="none",b.style.outline="none",b.style.boxShadow="none",b.style.background="white",b.style.color="black",b.style.fontSize="16px",b.style.opacity="0.01",b.style.zIndex="99999",document.body.appendChild(b),b.focus(),b.setSelectionRange(0,v.length),b.select();const M=document.execCommand("copy");if(document.body.removeChild(b),M)return!0}catch(b){console.log("execCommand copy failed:",b)}try{return await navigator.clipboard.writeText(v),!0}catch(b){console.log("Clipboard API failed:",b)}return!1},g=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2;if((!g||!navigator.share)&&(u=await l(a),u||(ze(a),w.info("Long-press to copy link:",{description:a,duration:1e4}),u=!0)),await na(!0),g&&navigator.share&&!u)try{await navigator.share({title:"Check out my card!",url:a}),u=!0}catch(v){if(v.name==="AbortError")return;console.error("Share failed:",v),u=await l(a),u||(ze(a),w.info("Long-press to copy link:",{description:a,duration:1e4}),u=!0)}try{const{data:v,error:b}=await J.rpc("share_card",{card_id:n});if(b){console.error("Error calling share_card function:",b),u&&(ze(a),w.success("Link copied to clipboard!"));return}const M=v;if(M&&!M.success){M.error==="subscription_required"||M.error==="share_limit_exceeded"?(xe(!0),w.error(M.message||"Subscribe to Premium to share cards.")):u&&(ze(a),w.success("Link copied! Note: Share limit may be reached."));return}s&&await m()}catch(v){console.error("Error updating share count:",v)}if(u){if(ze(a),w.success("✅ Link Copied to Clipboard!",{description:"Ready to paste and share your card anywhere",duration:5e3}),s)try{const{data:v}=await J.functions.invoke("manage-referral",{body:{action:"get-or-create-code"}});if(v!=null&&v.code){const b=`${window.location.origin}/checkout?ref=${v.code}`;setTimeout(()=>{w("🦁 Know someone who'd love this? Refer them!",{description:"You both get 1 month free when they subscribe.",duration:8e3,action:{label:"Copy Referral Link",onClick:async()=>{try{await navigator.clipboard.writeText(b),w.success("Referral link copied!")}catch{w.info(b,{duration:1e4})}}}})},2e3)}}catch{}}else w.error("Unable to copy link. Please try again.")},xs=async()=>{if(!s){w.error("Please sign in to send SMS",{action:{label:"Sign In",onClick:()=>c("/auth")}});return}if(!(o!=null&&o.subscribed)){xe(!0),w.error("Anonymous SMS sending requires a premium subscription");return}if(!n){w.error("Please save the card first before sending via SMS");return}if(!/^\+[1-9]\d{1,14}$/.test(sa)){w.error("Invalid phone number. Use international format (e.g., +447723494628 for UK or +15103694515 for US)");return}ga(!0);try{await na(!0);const{data:{session:u}}=await J.auth.getSession();if(!u){w.error("Session expired. Please sign in again."),ga(!1);return}const l=`${window.location.origin}/share/${n}`,{data:g,error:v}=await J.functions.invoke("send-anonymous-sms",{body:{cardId:n,recipientPhone:sa,shareUrl:l},headers:{Authorization:`Bearer ${u.access_token}`}});if(v)throw v;if(!g.success){g.error==="subscription_required"?(xe(!0),w.error(g.message||"Anonymous SMS sending requires a premium subscription.")):g.error==="daily_limit_exceeded"?w.error(g.message||"Daily SMS limit reached. Try again tomorrow."):w.error(g.message||"Failed to send SMS");return}const b=g.remaining!==void 0?` (${g.remaining}/50 remaining today)`:"";w.success(`SMS sent successfully! 🎉${b}`),La(""),Ea(!1),m&&await m()}catch(u){console.error("Error sending SMS:",u),w.error(u.message||"Failed to send SMS")}finally{ga(!1)}};return e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-primary/10 via-background to-accent/10 p-1 sm:p-4 relative overflow-hidden",children:[e.jsx(Zn,{}),e.jsxs("div",{className:"absolute inset-0 -z-10",children:[e.jsx("div",{className:"absolute top-20 left-10 w-72 h-72 bg-primary/5 rounded-full blur-3xl animate-pulse"}),e.jsx("div",{className:"absolute bottom-20 right-10 w-96 h-96 bg-accent/5 rounded-full blur-3xl animate-pulse",style:{animationDelay:"1s"}})]}),e.jsxs("div",{className:"mx-auto max-w-full sm:max-w-6xl sm:container",children:[!s&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-center mb-6 animate-fade-in",children:[e.jsx("h1",{className:"text-3xl sm:text-4xl font-bold bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent",children:"Instant Smiles, Delivered Digitally"}),e.jsx("p",{className:"mt-3 text-lg sm:text-xl font-semibold bg-gradient-to-r from-accent to-primary bg-clip-text text-transparent animate-fade-in",style:{animationDelay:"0.2s"},children:"Subscribe for unlimited ecards ✨"})]}),e.jsxs("a",{href:"https://lionpost.com/blog/award-winner-2025",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center gap-3 mb-6 hover:scale-105 transition-all duration-300 animate-fade-in group",style:{animationDelay:"0.1s"},children:[e.jsx("img",{src:eo,alt:"Best of Best Review 2025",className:"w-10 h-10 sm:w-12 sm:h-12 object-contain animate-pulse"}),e.jsx("span",{className:"text-sm sm:text-base text-muted-foreground group-hover:text-foreground transition-colors",children:"Named best greeting card website in the UK - 2025"})]})]}),s&&e.jsx("div",{className:"mb-4 sm:mb-6 animate-fade-in",children:e.jsxs(_,{variant:"ghost",onClick:()=>c("/dashboard"),size:"sm",className:"glass-button",children:[e.jsx(dn,{className:"w-4 h-4 mr-2"}),"Back to Dashboard"]})}),s&&e.jsx(xa,{className:"mb-6 border-2 animate-fade-in",children:e.jsxs(Ls,{className:"p-4 sm:p-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(Xs,{className:"w-5 h-5"}),e.jsx("h3",{className:"text-lg font-semibold",children:"Subscription Status"})]}),o!=null&&o.subscribed?e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-base font-semibold text-green-600",children:"Premium - Unlimited Cards"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Cards created: ",o.cardsCreated]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Shares remaining: Unlimited"}),o.subscriptionEnd&&e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Renews: ",new Date(o.subscriptionEnd).toLocaleDateString()]}),e.jsx(_,{variant:"outline",size:"sm",onClick:y,disabled:i,className:"w-full sm:w-auto mt-1",children:i?"Loading...":"Manage Subscription"})]}):e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-base font-semibold",children:"No Active Subscription"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Subscribe to create and share unlimited cards"})]}),e.jsxs(_,{onClick:()=>xe(!0),size:"sm",className:"w-full sm:w-auto",children:["Upgrade to Premium - ",Sa(Oa).symbol,Sa(Oa).amount,"/month"]})]})]})}),e.jsxs("div",{className:"grid lg:grid-cols-2 gap-4 sm:gap-8 overflow-x-hidden",children:[e.jsx("div",{className:"space-y-4 sm:space-y-6 animate-fade-in min-w-0",style:{animationDelay:"0.1s"},children:e.jsxs(xa,{className:"glass-card p-4 sm:p-6 smooth-shadow-lg border-0",children:[e.jsxs("div",{className:"mb-4 sm:mb-6",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("img",{src:Zs,alt:"LionPost Logo",className:"w-12 h-12 sm:w-16 sm:h-16 object-cover rounded-lg shadow-md"}),e.jsx("h2",{className:"text-xl sm:text-2xl font-bold bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent",children:"Create Card"})]}),!s&&e.jsxs("div",{className:"mt-4 p-4 border-2 border-primary/30 rounded-lg bg-primary/5 space-y-3",children:[e.jsx("p",{className:"text-base font-semibold text-foreground",children:"Sign in to save and share your creation"}),e.jsx(_,{variant:"default",size:"lg",onClick:()=>{const a={imageUrl:R,text:ee,frontText:fe,theme:O,cardStyle:A,frontEmojis:Ae,backEmojis:Ee,googlyEyes:ve,frontTextPosition:re,frontTextSize:pe,giftCardCode:F,textFont:Pe,frontTextBold:Je,backTextBold:$e};localStorage.setItem("lionpost_draft_card",JSON.stringify(a)),w.success("Your card will be saved after you sign in!"),c("/auth")},className:"w-full text-lg font-semibold",children:"Sign Up / Sign In"})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-4 p-4 border-2 border-primary/20 rounded-lg bg-primary/5",children:[e.jsxs("h3",{className:"text-lg font-bold text-primary flex items-center gap-2",children:[e.jsx("span",{children:"📝"})," Front Side"]}),e.jsxs("div",{className:"space-y-2","data-tour":"upload-image",children:[e.jsx(I,{htmlFor:"image",className:"text-sm font-semibold",children:"Upload Image"}),e.jsxs("div",{className:"mt-2",children:[e.jsx("input",{id:"image",type:"file",accept:"image/*",onChange:ds,className:"hidden"}),e.jsx(_,{type:"button",variant:"outline",onClick:()=>{var a;return(a=document.getElementById("image"))==null?void 0:a.click()},className:"w-full justify-start gap-2 h-auto py-3 transition-all hover:border-primary hover:scale-[1.02]",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ca,{className:"w-5 h-5 text-primary"}),e.jsx("span",{className:"text-sm font-medium",children:"Upload image"})]})})]})]}),e.jsxs("div",{className:"space-y-2","data-tour":"choose-template",children:[e.jsx(I,{className:"text-sm font-semibold",children:"Choose a Template"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"No image? No problem. Pick from our beautiful templates"}),e.jsxs(ra,{value:Ye,onValueChange:a=>{ta(a),aa("")},children:[e.jsx(qe,{className:"w-full",children:e.jsx(ia,{placeholder:"Select a category..."})}),e.jsx(Xe,{children:Object.keys(Ha).sort((a,u)=>a===Ye?-1:u===Ye?1:0).map(a=>e.jsx(K,{value:a,className:"cursor-pointer capitalize",children:a.replace(/-/g," ")},a))})]}),Ye&&e.jsx("div",{className:"grid grid-cols-2 gap-3 mt-3 max-h-[400px] overflow-y-auto p-1",children:(za=Ha[Ye])==null?void 0:za.map(a=>e.jsxs("button",{type:"button",onClick:()=>{aa(a.id),ha(a.image)},className:`relative group cursor-pointer rounded-lg overflow-hidden border-2 transition-all hover:scale-105 hover:shadow-lg ${Ia===a.id?"border-primary shadow-lg":"border-border hover:border-primary/50"}`,children:[e.jsx("div",{className:"aspect-[3/4] w-full",children:e.jsx(Qn,{src:a.image,alt:a.name,className:"w-full h-full object-cover"})}),e.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 to-transparent p-2",children:e.jsx("p",{className:"text-xs text-white font-medium truncate",children:a.name})}),Ia===a.id&&e.jsx("div",{className:"absolute top-2 right-2 bg-primary text-primary-foreground rounded-full p-1",children:e.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})]},a.id))})]}),e.jsxs("div",{className:"space-y-2 p-4 border-2 border-accent/30 rounded-lg bg-accent/5",children:[e.jsxs(I,{htmlFor:"theme",className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx(at,{className:"w-4 h-4"}),"AI-Powered Theme"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Describe your card theme and let AI design it for you"}),e.jsx(ce,{id:"theme",placeholder:"e.g., Birthday party with balloons, Elegant wedding, Tropical vacation...",value:O,onChange:a=>de(a.target.value),className:"mt-2"}),e.jsxs(_,{type:"button",onClick:hs,disabled:Ze||!O.trim(),variant:"secondary",className:"w-full mt-2",children:[e.jsx(at,{className:"w-4 h-4 mr-2"}),Ze?"Generating...":"Generate Theme"]})]}),e.jsxs("div",{children:[e.jsx(I,{htmlFor:"frontText",children:"Front Text"}),e.jsx(Va,{id:"frontText",placeholder:"Add your message here...",value:fe,onChange:a=>je(a.target.value),className:"mt-2 min-h-[80px]",maxLength:1e3})]}),e.jsxs("div",{children:[e.jsx(I,{htmlFor:"frontTextColor",children:"Front Text Color"}),e.jsx(ce,{id:"frontTextColor",type:"color",value:A.frontTextColor,onChange:a=>ae({...A,frontTextColor:a.target.value}),className:"mt-2 h-10 cursor-pointer"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(I,{children:"Front Text Size"}),e.jsxs("select",{value:pe,onChange:a=>D(a.target.value),className:"mt-2 w-full h-10 rounded-md border border-input bg-background px-3 py-2 text-sm",children:[e.jsx("option",{value:"sm",children:"Small"}),e.jsx("option",{value:"base",children:"Medium"}),e.jsx("option",{value:"lg",children:"Large"}),e.jsx("option",{value:"xl",children:"X-Large"}),e.jsx("option",{value:"2xl",children:"2X-Large"}),e.jsx("option",{value:"3xl",children:"3X-Large"}),e.jsx("option",{value:"4xl",children:"4X-Large"}),e.jsx("option",{value:"5xl",children:"5X-Large"}),e.jsx("option",{value:"6xl",children:"6X-Large"}),e.jsx("option",{value:"7xl",children:"7X-Large"}),e.jsx("option",{value:"8xl",children:"8X-Large"}),e.jsx("option",{value:"9xl",children:"9X-Large"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(I,{children:"Front Font Family"}),e.jsxs("select",{value:Y,onChange:a=>ne(a.target.value),className:"mt-2 w-full h-10 rounded-md border border-input bg-background px-3 py-2 text-sm",children:[e.jsx("option",{value:"serif",children:"Serif"}),e.jsx("option",{value:"sans",children:"Sans-serif"}),e.jsx("option",{value:"mono",children:"Monospace"}),e.jsx("option",{value:"cursive",children:"Cursive"}),e.jsx("option",{value:"fantasy",children:"Fantasy"})]})]}),e.jsxs("div",{children:[e.jsx(I,{htmlFor:"frontTextBold",children:"Front Text Style"}),e.jsxs("div",{className:"flex items-center space-x-2 mt-2",children:[e.jsx("input",{type:"checkbox",id:"frontTextBold",checked:Je,onChange:a=>ma(a.target.checked),className:"h-4 w-4 rounded border-input"}),e.jsx("label",{htmlFor:"frontTextBold",className:"text-sm font-medium cursor-pointer",children:"Bold Text"})]})]}),e.jsxs("div",{children:[e.jsx(I,{children:"Googly Eyes"}),e.jsx("div",{className:"mt-2",children:ve?e.jsx(_,{type:"button",variant:"outline",onClick:()=>Le(null),className:"w-full",children:"Remove Googly Eyes"}):e.jsx(_,{type:"button",variant:"outline",onClick:()=>Le({enabled:!0,x:50,y:40,size:3}),className:"w-full",children:"👀 Add Googly Eyes"})}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Click to add animated googly eyes. Drag to position, scroll/pinch to resize."})]})]}),e.jsxs("div",{className:"space-y-4 p-4 border-2 border-accent/20 rounded-lg bg-accent/5",children:[e.jsxs("h3",{className:"text-lg font-bold text-accent flex items-center gap-2",children:[e.jsx("span",{children:"💌"})," Inside"]}),e.jsxs("div",{"data-tour":"your-message",children:[e.jsx(I,{htmlFor:"text",children:"Your Message"}),e.jsx(Va,{id:"text",placeholder:"Write your heartfelt message here...",value:ee,onChange:a=>ue(a.target.value),className:"mt-2 min-h-[120px] resize-none",maxLength:1e4}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[ee.length,"/10,000 characters"]}),e.jsx(Kn,{onSelectMessage:a=>ue(a),isPremium:!!(o!=null&&o.subscribed),onUpgradeClick:()=>xe(!0)})]}),e.jsxs("div",{children:[e.jsx(I,{htmlFor:"giftCardCode",children:"Amazon Gift Card Code (Optional)"}),e.jsx(ce,{id:"giftCardCode",placeholder:"Enter Amazon gift card code...",value:F,onChange:a=>G(a.target.value),className:"mt-2",maxLength:50}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Paste your pre-purchased Amazon gift card code here"})]}),e.jsxs("div",{children:[e.jsx(I,{children:"Add Audio (Optional - Max 30 seconds)"}),e.jsxs("div",{className:"mt-2 space-y-3",children:[!H&&e.jsxs(e.Fragment,{children:[!f&&e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsxs(_,{type:"button",variant:"outline",onClick:Ua,className:"flex-1",children:[e.jsx(et,{className:"w-4 h-4 mr-2"}),e.jsx("span",{className:"text-sm",children:"Record"})]}),e.jsxs("div",{className:"relative flex-1",children:[e.jsx("input",{id:"audio",type:"file",accept:"audio/*",onChange:us,className:"hidden"}),e.jsxs(_,{type:"button",variant:"outline",onClick:()=>{var a;return(a=document.getElementById("audio"))==null?void 0:a.click()},className:"w-full justify-start gap-2",children:[e.jsx(Ca,{className:"w-4 h-4 text-primary shrink-0"}),e.jsx("span",{className:"text-sm truncate",children:"Upload audio"})]})]})]}),e.jsxs("div",{className:"border rounded-lg p-4 space-y-3 bg-muted/30",children:[e.jsx(I,{className:"text-sm font-medium",children:"Or Select Audio Template"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(I,{className:"text-xs text-muted-foreground",children:"Voice Type"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx(_,{type:"button",variant:U==="female"?"default":"outline",onClick:()=>{V("female"),W("")},className:"w-full",size:"sm",children:"Female Voice"}),e.jsx(_,{type:"button",variant:U==="male"?"default":"outline",onClick:()=>{V("male"),W("")},className:"w-full",size:"sm",children:"Male Voice"})]})]}),U&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(I,{className:"text-xs text-muted-foreground",children:"Occasion"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx(_,{type:"button",variant:z==="christmas"?"default":"outline",onClick:()=>W("christmas"),className:"w-full",size:"sm",children:"Christmas"}),e.jsx(_,{type:"button",variant:z==="congratulations"?"default":"outline",onClick:()=>W("congratulations"),className:"w-full",size:"sm",children:"Congratulations"}),e.jsx(_,{type:"button",variant:z==="goodLuck"?"default":"outline",onClick:()=>W("goodLuck"),className:"w-full",size:"sm",children:"Good Luck"}),e.jsx(_,{type:"button",variant:z==="happyBirthday"?"default":"outline",onClick:()=>W("happyBirthday"),className:"w-full",size:"sm",children:"Happy Birthday"})]}),z==="christmas"&&U==="female"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(I,{className:"text-xs text-muted-foreground",children:"Select Christmas Message (Click to preview & select)"}),e.jsx("div",{className:"grid grid-cols-2 gap-2 max-h-64 overflow-y-auto p-1",children:we.female.christmas.map((a,u)=>e.jsxs(_,{type:"button",variant:f===a.path?"default":"outline",onClick:l=>{l.preventDefault(),l.stopPropagation(),j.current&&(j.current.pause(),j.current.currentTime=0),p(a.path),P("audio/mpeg"),setTimeout(()=>{j.current&&(j.current.src=a.path,j.current.play().catch(g=>{console.error("Audio play failed:",g)}))},50)},className:"w-full relative",size:"sm",children:[f===a.path&&e.jsx(be,{className:"w-3 h-3 mr-1 fill-current"}),a.name]},u))})]}),z==="christmas"&&U==="male"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(I,{className:"text-xs text-muted-foreground",children:"Select Christmas Message (Click to preview & select)"}),e.jsx("div",{className:"grid grid-cols-2 gap-2 max-h-64 overflow-y-auto p-1",children:we.male.christmas.map((a,u)=>e.jsxs(_,{type:"button",variant:f===a.path?"default":"outline",onClick:l=>{l.preventDefault(),l.stopPropagation(),j.current&&(j.current.pause(),j.current.currentTime=0),p(a.path),P("audio/mpeg"),setTimeout(()=>{j.current&&(j.current.src=a.path,j.current.play().catch(g=>{console.error("Audio play failed:",g)}))},50)},className:"w-full relative",size:"sm",children:[f===a.path&&e.jsx(be,{className:"w-3 h-3 mr-1 fill-current"}),a.name]},u))})]}),z==="congratulations"&&U==="female"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(I,{className:"text-xs text-muted-foreground",children:"Select Congratulations Message (Click to preview & select)"}),e.jsx("div",{className:"grid grid-cols-2 gap-2 max-h-64 overflow-y-auto p-1",children:we.female.congratulations.map((a,u)=>e.jsxs(_,{type:"button",variant:f===a.path?"default":"outline",onClick:l=>{l.preventDefault(),l.stopPropagation(),j.current&&(j.current.pause(),j.current.currentTime=0),p(a.path),P("audio/mpeg"),setTimeout(()=>{j.current&&(j.current.src=a.path,j.current.play().catch(g=>{console.error("Audio play failed:",g)}))},50)},className:"w-full relative",size:"sm",children:[f===a.path&&e.jsx(be,{className:"w-3 h-3 mr-1 fill-current"}),a.name]},u))})]}),z==="congratulations"&&U==="male"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(I,{className:"text-xs text-muted-foreground",children:"Select Congratulations Message (Click to preview & select)"}),e.jsx("div",{className:"grid grid-cols-2 gap-2 max-h-64 overflow-y-auto p-1",children:we.male.congratulations.map((a,u)=>e.jsxs(_,{type:"button",variant:f===a.path?"default":"outline",onClick:l=>{l.preventDefault(),l.stopPropagation(),j.current&&(j.current.pause(),j.current.currentTime=0),p(a.path),P("audio/mpeg"),setTimeout(()=>{j.current&&(j.current.src=a.path,j.current.play().catch(g=>{console.error("Audio play failed:",g)}))},50)},className:"w-full relative",size:"sm",children:[f===a.path&&e.jsx(be,{className:"w-3 h-3 mr-1 fill-current"}),a.name]},u))})]}),z==="goodLuck"&&U==="female"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(I,{className:"text-xs text-muted-foreground",children:"Select Good Luck Message (Click to preview & select)"}),e.jsx("div",{className:"grid grid-cols-2 gap-2 max-h-64 overflow-y-auto p-1",children:we.female.goodLuck.map((a,u)=>e.jsxs(_,{type:"button",variant:f===a.path?"default":"outline",onClick:l=>{l.preventDefault(),l.stopPropagation(),j.current&&(j.current.pause(),j.current.currentTime=0),p(a.path),P("audio/mpeg"),setTimeout(()=>{j.current&&(j.current.src=a.path,j.current.play().catch(g=>{console.error("Audio play failed:",g)}))},50)},className:"w-full relative",size:"sm",children:[f===a.path&&e.jsx(be,{className:"w-3 h-3 mr-1 fill-current"}),a.name]},u))})]}),z==="goodLuck"&&U==="male"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(I,{className:"text-xs text-muted-foreground",children:"Select Good Luck Message (Click to preview & select)"}),e.jsx("div",{className:"grid grid-cols-2 gap-2 max-h-64 overflow-y-auto p-1",children:we.male.goodLuck.map((a,u)=>e.jsxs(_,{type:"button",variant:f===a.path?"default":"outline",onClick:l=>{l.preventDefault(),l.stopPropagation(),j.current&&(j.current.pause(),j.current.currentTime=0),p(a.path),P("audio/mpeg"),setTimeout(()=>{j.current&&(j.current.src=a.path,j.current.play().catch(g=>{console.error("Audio play failed:",g)}))},50)},className:"w-full relative",size:"sm",children:[f===a.path&&e.jsx(be,{className:"w-3 h-3 mr-1 fill-current"}),a.name]},u))})]}),z==="happyBirthday"&&U==="female"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(I,{className:"text-xs text-muted-foreground",children:"Select Birthday Message (Click to preview & select)"}),e.jsx("div",{className:"grid grid-cols-2 gap-2 max-h-64 overflow-y-auto p-1",children:we.female.happyBirthday.map((a,u)=>e.jsxs(_,{type:"button",variant:f===a.path?"default":"outline",onClick:l=>{l.preventDefault(),l.stopPropagation(),j.current&&(j.current.pause(),j.current.currentTime=0),p(a.path),P("audio/mpeg"),setTimeout(()=>{j.current&&(j.current.src=a.path,j.current.play().catch(g=>{console.error("Audio play failed:",g)}))},50)},className:"w-full relative",size:"sm",children:[f===a.path&&e.jsx(be,{className:"w-3 h-3 mr-1 fill-current"}),a.name]},u))})]}),z==="happyBirthday"&&U==="male"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(I,{className:"text-xs text-muted-foreground",children:"Select Birthday Message (Click to preview & select)"}),e.jsx("div",{className:"grid grid-cols-2 gap-2 max-h-64 overflow-y-auto p-1",children:we.male.happyBirthday.map((a,u)=>e.jsxs(_,{type:"button",variant:f===a.path?"default":"outline",onClick:l=>{l.preventDefault(),l.stopPropagation(),j.current&&(j.current.pause(),j.current.currentTime=0),p(a.path),P("audio/mpeg"),setTimeout(()=>{j.current&&(j.current.src=a.path,j.current.play().catch(g=>{console.error("Audio play failed:",g)}))},50)},className:"w-full relative",size:"sm",children:[f===a.path&&e.jsx(be,{className:"w-3 h-3 mr-1 fill-current"}),a.name]},u))})]})]})]}),e.jsx("audio",{ref:j,onEnded:()=>se(null),style:{display:"none"}})]}),H&&e.jsxs("div",{className:"p-4 border-2 border-destructive rounded-lg bg-destructive/5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-3 h-3 bg-destructive rounded-full animate-pulse"}),e.jsx("span",{className:"text-sm font-medium",children:"Recording..."})]}),e.jsxs("span",{className:"text-sm font-mono",children:[L,"s / 30s"]})]}),e.jsxs(_,{type:"button",variant:"destructive",size:"sm",onClick:ms,className:"w-full",children:[e.jsx(fn,{className:"w-4 h-4 mr-2"}),"Stop Recording"]})]}),f&&!H&&e.jsxs("div",{className:"p-4 border rounded-lg bg-muted/50 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(be,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium",children:"Audio Ready"})]}),e.jsxs("audio",{controls:!0,className:"w-full",children:[e.jsx("source",{src:f,type:N||void 0}),"Your browser does not support the audio element."]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(_,{type:"button",variant:"ghost",size:"sm",onClick:Ya,className:"flex-1",children:[e.jsx(Js,{className:"w-4 h-4 mr-2"}),"Remove"]}),e.jsxs(_,{type:"button",variant:"outline",size:"sm",onClick:()=>{Ya(),setTimeout(()=>Ua(),100)},className:"flex-1",children:[e.jsx(et,{className:"w-4 h-4 mr-2"}),"Re-record"]})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Record a personal message or upload an audio file"})]})]}),e.jsxs("div",{children:[e.jsx(I,{htmlFor:"backTextColor",children:"Back Text Color"}),e.jsx(ce,{id:"backTextColor",type:"color",value:A.backTextColor,onChange:a=>ae({...A,backTextColor:a.target.value}),className:"mt-2 h-10 cursor-pointer"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(I,{children:"Back Text Size"}),e.jsxs("select",{value:A.backTextSize,onChange:a=>ae({...A,backTextSize:a.target.value}),className:"mt-2 w-full h-10 rounded-md border border-input bg-background px-3 py-2 text-sm",children:[e.jsx("option",{value:"sm",children:"Small"}),e.jsx("option",{value:"base",children:"Medium"}),e.jsx("option",{value:"lg",children:"Large"}),e.jsx("option",{value:"xl",children:"X-Large"}),e.jsx("option",{value:"2xl",children:"2X-Large"}),e.jsx("option",{value:"3xl",children:"3X-Large"}),e.jsx("option",{value:"4xl",children:"4X-Large"}),e.jsx("option",{value:"5xl",children:"5X-Large"}),e.jsx("option",{value:"6xl",children:"6X-Large"}),e.jsx("option",{value:"7xl",children:"7X-Large"}),e.jsx("option",{value:"8xl",children:"8X-Large"}),e.jsx("option",{value:"9xl",children:"9X-Large"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(I,{children:"Back Font Family"}),e.jsxs("select",{value:A.backFontFamily,onChange:a=>ae({...A,backFontFamily:a.target.value}),className:"mt-2 w-full h-10 rounded-md border border-input bg-background px-3 py-2 text-sm",children:[e.jsx("option",{value:"serif",children:"Serif"}),e.jsx("option",{value:"sans",children:"Sans-serif"}),e.jsx("option",{value:"mono",children:"Monospace"}),e.jsx("option",{value:"cursive",children:"Cursive"}),e.jsx("option",{value:"fantasy",children:"Fantasy"})]})]}),e.jsxs("div",{children:[e.jsx(I,{htmlFor:"backTextBold",children:"Back Text Style"}),e.jsxs("div",{className:"flex items-center space-x-2 mt-2",children:[e.jsx("input",{type:"checkbox",id:"backTextBold",checked:$e,onChange:a=>ua(a.target.checked),className:"h-4 w-4 rounded border-input"}),e.jsx("label",{htmlFor:"backTextBold",className:"text-sm font-medium cursor-pointer",children:"Bold Text"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(I,{children:"Background Effect"}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:Ws.map(a=>e.jsxs("button",{type:"button",onClick:()=>ae({...A,backgroundEffect:a.value}),className:`p-2 rounded-md border text-center transition-all ${A.backgroundEffect===a.value?"border-primary bg-primary/10 ring-2 ring-primary":"border-input hover:border-primary/50"}`,children:[e.jsx("span",{className:"text-lg",children:a.icon}),e.jsx("p",{className:"text-xs mt-1",children:a.label})]},a.value))})]})]}),e.jsxs("div",{className:"space-y-3 pt-2","data-tour":"share-section",children:[e.jsxs(_,{onClick:()=>na(),disabled:Ze,className:"w-full transition-all hover:scale-105 hover:shadow-lg bg-gradient-to-r from-primary to-primary/90",children:[e.jsx(Ca,{className:"w-4 h-4 mr-2"}),Ze?"Saving...":"Save Card"]}),e.jsx("div",{className:"text-center text-sm text-muted-foreground mb-1",children:o!=null&&o.subscribed?e.jsx("span",{className:"text-primary font-medium",children:"✨ Unlimited shares"}):e.jsx("span",{className:"text-amber-600 font-medium",children:"Subscribe to share"})}),e.jsxs("div",{className:"space-y-2",children:[o!=null&&o.subscribed?e.jsxs(_,{onClick:n&&s?fs:()=>w.error("Please save your card first"),variant:"outline",className:"w-full glass-button hover:scale-105",children:[e.jsx(mn,{className:"w-4 h-4 mr-2"}),"Share Card"]}):e.jsxs(_,{onClick:()=>xe(!0),variant:"outline",className:"w-full glass-button opacity-60 cursor-pointer",children:[e.jsx(ya,{className:"w-4 h-4 mr-2"}),"Share Card"]}),o!=null&&o.subscribed?e.jsxs(_,{onClick:n&&s?()=>Ea(!Aa):()=>w.error("Please save your card first"),variant:"outline",className:"w-full glass-button hover:scale-105",children:[e.jsx("img",{src:ao,alt:"Anonymous",className:"w-6 h-6 mr-2"}),"Send anonymously via SMS"]}):e.jsxs(_,{onClick:()=>xe(!0),variant:"outline",className:"w-full glass-button opacity-60 cursor-pointer",children:[e.jsx(ya,{className:"w-4 h-4 mr-2"}),"Send anonymously via SMS"]}),Aa&&(o==null?void 0:o.subscribed)&&n&&s&&e.jsxs("div",{className:"space-y-2 p-3 rounded-md border border-primary/20 bg-primary/5",children:[e.jsx(I,{htmlFor:"recipientPhone",className:"text-sm",children:"Recipient Phone Number"}),e.jsx(ce,{id:"recipientPhone",type:"tel",placeholder:"+1234567890",value:sa,onChange:a=>La(a.target.value),className:"w-full"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Use international format (e.g., +447723494628 for UK or +15103694515 for US)"}),e.jsx(_,{onClick:xs,disabled:Ma||!sa,className:"w-full",children:Ma?"Sending...":"Send Anonymous SMS"}),e.jsx("p",{className:"text-xs text-center text-muted-foreground",children:"Premium: 50 SMS/day"})]})]}),o!=null&&o.subscribed?n&&s?e.jsxs(e.Fragment,{children:[e.jsx(qn,{cardId:n,onScheduled:()=>w.success("Card delivery scheduled!")}),e.jsx(Xn,{cardId:n})]}):null:e.jsxs(_,{onClick:()=>xe(!0),variant:"outline",className:"w-full glass-button opacity-60 cursor-pointer",children:[e.jsx(ya,{className:"w-4 h-4 mr-2"}),"Schedule Send"]})]})]})]})}),e.jsx("div",{className:"space-y-4 animate-fade-in flex flex-col items-center min-w-0",style:{animationDelay:"0.2s"},children:e.jsxs(xa,{className:"glass-card p-4 sm:p-6 smooth-shadow-lg border-0 w-full",children:[e.jsx("h2",{className:"text-xl sm:text-2xl font-bold mb-4 sm:mb-6 bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent",children:"Live Preview"}),e.jsx("div",{className:"perspective-1000 flex justify-center overflow-hidden",children:e.jsxs("div",{ref:d,className:`relative w-full max-w-md ${B==="portrait"?"aspect-[3/4]":"aspect-[4/3]"} transition-all duration-700 transform-style-3d hover:scale-[1.02]`,style:{transformStyle:"preserve-3d",transform:pa?"rotateX(-180deg)":"rotateX(0deg)"},children:[e.jsxs("div",{"data-card-container":!0,className:"absolute inset-0 rounded-2xl overflow-hidden shadow-2xl backface-hidden",style:{backgroundColor:A.backgroundColor,border:A.borderStyle,background:A.pattern||A.backgroundColor,backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"rotateX(0deg)",boxShadow:"0 20px 60px -15px rgba(0, 0, 0, 0.3)"},children:[e.jsx(Xa,{effect:A.backgroundEffect,isPreview:!0}),R&&e.jsx("img",{src:R,alt:"Card Front",crossOrigin:"anonymous",className:"w-full h-full object-contain",style:{border:A.imageBorderStyle,boxSizing:"border-box",objectPosition:"center"}}),fe&&e.jsx(Jn,{text:fe,x:re.x,y:re.y,size:pe,font:Y,color:A.frontTextColor,bold:Je,onUpdate:a=>{(a.x!==void 0||a.y!==void 0)&&Ce({x:a.x??re.x,y:a.y??re.y}),a.size!==void 0&&D(a.size)},onDelete:()=>je(""),isPreview:Me,fontSizeMap:Fa,fontFamilyMap:Ga}),Ae.map((a,u)=>e.jsx(Ja,{emoji:a.emoji,x:a.x,y:a.y,size:a.size,rotation:a.rotation||0,onUpdate:l=>{const g=[...Ae];g[u]={...g[u],...l},Qe(g)},onDelete:()=>{Qe(Ae.filter((l,g)=>g!==u))},isPreview:Me},u)),ve&&e.jsx(Vs,{x:ve.x,y:ve.y,size:ve.size,onUpdate:a=>{Le({...ve,...a})},onDelete:()=>Le(null),isPreview:Me}),!pa&&!Me&&e.jsx("div",{className:"absolute -top-2 left-1/2 -translate-x-1/2 bg-gradient-to-r from-primary to-accent text-primary-foreground px-5 py-2 rounded-t-lg text-xs font-semibold shadow-lg cursor-pointer hover:shadow-xl transition-all hover:-translate-y-0.5 z-50 animate-pulse",onClick:a=>{a.stopPropagation(),Pa(!0)},children:"✨ Click to open"})]}),e.jsxs("div",{"data-card-container":!0,className:"absolute inset-0 rounded-2xl overflow-hidden shadow-2xl backface-hidden",style:{backgroundColor:A.backgroundColor,border:A.borderStyle,background:A.pattern||A.backgroundColor,transform:"rotateX(180deg)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",boxShadow:"0 20px 60px -15px rgba(0, 0, 0, 0.3)"},children:[e.jsx(Xa,{effect:A.backgroundEffect,isPreview:!0}),pa&&!Me&&e.jsx("div",{className:"absolute -top-2 left-1/2 -translate-x-1/2 bg-gradient-to-r from-accent to-primary text-primary-foreground px-5 py-2 rounded-t-lg text-xs font-semibold shadow-lg cursor-pointer hover:shadow-xl transition-all hover:-translate-y-0.5 z-50",onClick:a=>{a.stopPropagation(),Pa(!1)},children:"🔄 Click to flip"}),e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center p-8 gap-6",children:[ee&&e.jsx("p",{className:"text-center",style:{color:A.backTextColor,fontSize:Fa[A.backTextSize]||"1.5rem",fontFamily:Ga[A.backFontFamily]||"system-ui, sans-serif",fontWeight:$e?"700":"400"},children:ee}),f&&e.jsx("div",{className:"flex justify-center w-full max-w-sm",children:e.jsxs("audio",{controls:!0,className:"w-full",children:[e.jsx("source",{src:f}),"Your browser does not support the audio element."]})}),F&&e.jsxs("div",{className:"rounded-lg p-4 border-2 border-dashed shadow-lg",style:{backgroundColor:"#ffffff",borderColor:"#666666"},children:[e.jsx("p",{className:"text-xs font-semibold mb-2 text-center",style:{color:"#000000"},children:"🎁 Amazon Gift Card"}),e.jsx("p",{className:"font-mono font-bold text-center tracking-wider",style:{color:"#000000",fontSize:"0.875rem"},children:F})]})]}),Ee.map((a,u)=>e.jsx(Ja,{emoji:a.emoji,x:a.x,y:a.y,size:a.size,rotation:a.rotation||0,onUpdate:l=>{const g=[...Ee];g[u]={...g[u],...l},ea(g)},onDelete:()=>{ea(Ee.filter((l,g)=>g!==u))},isPreview:Me},u))]})]})})]})})]})]}),(!s||!(o!=null&&o.subscribed))&&e.jsx($n,{}),e.jsx(jt,{open:rs,onOpenChange:xe,defaultYearly:!1})]})}export{Su as default};