PageSourceSearch

https://nanabanana2.ai/_next/static/chunks/4088-ceb4318c985cc735.js?dpl=dpl_47eJtRgP4dLhrjVC2QevYdzK5Uf9

js nanabanana2.ai collected 2026-10-05 12:17:32 UTC 50,211 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4088],{197:(e,t,a)=>{a.r(t),a.d(t,{default:()=>l});var r=a(88795);let s={Ri:a(20414)};function l(e){let{name:t,className:a,onClick:l}=e,n=function(e){let t=s[e.slice(0,2)];return t&&t[e]||null}(t);return n?(0,r.jsx)(n,{className:"".concat(a," cursor-pointer"),onClick:l,style:{cursor:l?"pointer":"default"}}):null}},1689:(e,t,a)=>{a.d(t,{E:()=>o});var r=a(88795);a(68939);var s=a(36156),l=a(71420),n=a(11911);let i=(0,l.F)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function o(e){let{className:t,variant:a,asChild:l=!1,...o}=e,d=l?s.DX:"span";return(0,r.jsx)(d,{"data-slot":"badge",className:(0,n.cn)(i({variant:a}),t),...o})}},4088:(e,t,a)=>{a.d(t,{default:()=>z});var r=a(88795),s=a(81817),l=a(83119),n=a(45697),i=a(26374),o=a(39862),d=a(68939),c=a(67957),m=a(68634),u=a(11911);let p=d.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(c.bL,{className:(0,u.cn)("grid gap-2",a),...s,ref:t})});p.displayName=c.bL.displayName;let x=d.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(c.q7,{ref:t,className:(0,u.cn)("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a),...s,children:(0,r.jsx)(c.C1,{className:"flex items-center justify-center",children:(0,r.jsx)(m.A,{className:"h-2.5 w-2.5 fill-current text-current"})})})});x.displayName=c.q7.displayName;var h=a(1689),v=a(94696),f=a(197),g=a(47010),y=a(82029),b=a(90987),j=a(7342),N=a(83488),w=a(80320),P=a(80296),k=a(12364);function _(){let{user:e,setUser:t,setShowSignModal:a}=(0,j.U)(),[s,l]=(0,d.useState)(null),[n,i]=(0,d.useState)(!1),[o,c]=(0,d.useState)(""),[m,u]=(0,d.useState)(!1),p=(0,k.c3)("daily_claim"),x=async()=>{try{let e=await fetch("/api/claim-daily-credits");if(e.ok){let t=await e.json();l(t)}else 401===e.status?l({canClaim:!0,remainingMinutes:0,nextClaimTime:null,lastClaimTime:null}):console.error("Failed to fetch claim status")}catch(e){console.error("Failed to fetch claim status:",e)}},f=async()=>{if(!e){a(!0);return}y(),i(!0);try{let e=await fetch("/api/claim-daily-credits",{method:"POST"}),a=await e.json();if(e.ok){b.oR.success(p("claim_success")),l(e=>e?{...e,canClaim:!1}:null);try{let e=await fetch("/api/get-user-info",{method:"POST"});if(e.ok){let{code:a,data:r}=await e.json();0===a&&t(r)}}catch(e){console.error("Failed to refresh user info:",e)}setTimeout(x,1e3)}else b.oR.error(a.error||p("claim_failed"))}catch(e){console.error("Claim failed:",e),b.oR.error(p("claim_failed"))}finally{i(!1)}},g=()=>{if(!(null==s?void 0:s.nextClaimTime)||s.canClaim){c("");return}let e=new Date().getTime(),t=new Date(s.nextClaimTime).getTime()-e;if(t<=0){c(""),m&&x();return}let a=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4),l=Math.floor(t%6e4/1e3);c("".concat(a.toString().padStart(2,"0"),":").concat(r.toString().padStart(2,"0"),":").concat(l.toString().padStart(2,"0")))};(0,d.useEffect)(()=>{m&&e&&x()},[e,m]);let y=()=>{m||(u(!0),x())};return((0,d.useEffect)(()=>{let e=setInterval(g,1e3);return()=>clearInterval(e)},[s]),s)?(0,r.jsxs)("div",{className:"relative group",children:[(0,r.jsx)("div",{className:"absolute -inset-1 bg-gradient-to-r from-amber-600/30 via-amber-500/50 to-amber-600/30 rounded-3xl blur-md opacity-50"}),(0,r.jsx)("div",{className:"relative bg-gradient-to-r from-black/80 via-gray-900/90 to-black/80 px-8 py-4 rounded-2xl border border-amber-500/20 shadow-lg shadow-amber-500/10 backdrop-blur-sm overflow-hidden",children:(0,r.jsxs)("div",{className:"relative flex flex-col gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(N.A,{className:"w-4 h-4 text-amber-400"}),(0,r.jsx)("h3",{className:"text-sm font-bold text-amber-50",children:p("title")})]}),(0,r.jsx)(h.E,{className:"bg-gradient-to-r from-amber-500 to-yellow-500 text-white border-amber-400 shadow-md text-xs",children:p("badge")})]}),(0,r.jsx)("p",{className:"text-xs text-amber-400/80 font-medium",children:p("description")}),(0,r.jsx)("div",{className:"pt-1",children:s.canClaim?(0,r.jsx)(v.$,{onClick:f,disabled:n,className:"w-full bg-gradient-to-r from-amber-600 to-yellow-600 hover:from-amber-700 hover:to-yellow-700 text-white shadow-lg shadow-amber-500/30 font-semibold text-xs h-8",size:"sm",children:n?(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("div",{className:"w-3 h-3 border-2 border-white/30 border-t-white rounded-full"}),p("claiming")]}):(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)(N.A,{className:"w-3 h-3"}),e?p("claim_button"):p("sign_in_to_claim")]})}):(0,r.jsxs)("div",{className:"space-y-1.5",children:[o?(0,r.jsxs)("div",{className:"flex items-center justify-center gap-1.5 py-1.5 px-2 bg-black/50 border border-amber-500/20 rounded-lg",children:[(0,r.jsx)(w.A,{className:"w-3 h-3 text-amber-400"}),(0,r.jsx)("span",{className:"font-mono text-xs font-semibold text-amber-400",children:o})]}):(0,r.jsxs)("div",{className:"flex items-center justify-center gap-1.5 py-1.5 px-2 bg-black/50 border border-amber-500/20 rounded-lg",children:[(0,r.jsx)(P.A,{className:"w-3 h-3 text-amber-400"}),(0,r.jsx)("span",{className:"text-amber-400 font-medium text-xs",children:p("already_claimed")})]}),(0,r.jsx)(v.$,{disabled:!0,className:"w-full border-amber-500/20 text-amber-400 hover:bg-black/50 text-xs h-8",variant:"outline",size:"sm",children:(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)(N.A,{className:"w-3 h-3"}),(0,r.jsx)("span",{className:"text-xs",children:o?p("come_back_later"):p("check_tomorrow")})]})})]})})]})})]}):(0,r.jsxs)("div",{className:"relative group",children:[(0,r.jsx)("div",{className:"absolute -inset-1 bg-gradient-to-r from-amber-600/30 via-amber-500/50 to-amber-600/30 rounded-3xl blur-md opacity-50"}),(0,r.jsx)("div",{className:"relative bg-gradient-to-r from-black/80 via-gray-900/90 to-black/80 px-8 py-4 rounded-2xl border border-amber-500/20 shadow-lg shadow-amber-500/10 backdrop-blur-sm overflow-hidden",children:(0,r.jsxs)("div",{className:"relative flex flex-col gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(N.A,{className:"w-4 h-4 text-amber-400"}),(0,r.jsx)("h3",{className:"text-sm font-bold text-amber-50",children:p("title")})]}),(0,r.jsx)(h.E,{className:"bg-gradient-to-r from-amber-500 to-yellow-500 text-white border-amber-400 shadow-md text-xs",children:p("badge")})]}),(0,r.jsx)("p",{className:"text-xs text-amber-400/80 font-medium",children:p("description")}),(0,r.jsx)("div",{className:"pt-1",children:(0,r.jsx)(v.$,{onClick:y,disabled:n,className:"w-full bg-gradient-to-r from-amber-600 to-yellow-600 hover:from-amber-700 hover:to-yellow-700 text-white shadow-lg shadow-amber-500/30 font-semibold text-xs h-8",size:"sm",children:n?(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("div",{className:"w-3 h-3 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Loading..."]}):(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)(N.A,{className:"w-3 h-3"}),e?"Check Daily Credits":p("sign_in_to_claim")]})})})]})})]})}var C=a(1128),S=a(95418),E=a(59941);let U={veo3:{apiKey:E.env.VEO3_API_KEY||"",apiUrl:E.env.VEO3_API_URL||"",defaultConfig:{duration:Number(E.env.VEO3_DEFAULT_DURATION)||5,seed:Number(E.env.VEO3_DEFAULT_SEED)||123,generateAudio:"true"===E.env.VEO3_GENERATE_AUDIO,defaultRatio:E.env.VEO3_DEFAULT_RATIO||"16:9"}},kie:{apiKey:E.env.KIE_API_KEY,callbackBaseUrl:"https://nanabanana2.ai"},payment:{enablePayPal:!1,enableNowPayments:!0}};function T(e){var t,a,s,l,n,o,c,m,u,p,x,h,f,g,y,b,j,N,w,P,k,_,E,T,R,A,L,O,D,I,F,M;let{isOpen:B,onClose:J,item:$,onSelectPayment:Y,ui:z}=e,[V,Z]=(0,d.useState)("stripe"),[G,H]=(0,d.useState)(new Set),[K,W]=(0,d.useState)(new Set);(0,d.useEffect)(()=>
1{U.payment.enablePayPal||"paypal"!==V||Z("stripe"),U.payment.enableNowPayments||"nowpayments"!==V||Z("stripe")},[V]);let q=e=>{H(t=>new Set([...t,e])),W(t=>{let a=new Set(t);return a.delete(e),a})},X=e=>{W(t=>new Set([...t,e])),H(t=>{let a=new Set(t);return a.delete(e),a})},Q=e=>G.has(e),ee=e=>K.has(e);return(0,d.useEffect)(()=>{B||(H(new Set),W(new Set))},[B]),(0,r.jsx)(C.lG,{open:B,onOpenChange:J,children:(0,r.jsxs)(C.Cf,{className:"sm:max-w-md",children:[(0,r.jsxs)(C.c7,{children:[(0,r.jsx)(C.L3,{children:(null==z?void 0:null===(a=z.modal)||void 0===a?void 0:null===(t=a.payment_method)||void 0===t?void 0:t.title)||"Choose Payment Method"}),(0,r.jsx)(C.rr,{children:((null==z?void 0:null===(l=z.modal)||void 0===l?void 0:null===(s=l.payment_method)||void 0===s?void 0:s.description)||"Pay for {title}").replace("{title}",(null==$?void 0:$.title)||"this item")})]}),(0,r.jsxs)("div",{className:"grid gap-2 py-4",children:[(0,r.jsx)(S.Zp,{className:"cursor-pointer transition-all border ".concat("stripe"===V?"ring-2 ring-primary border-primary":"border-border"),onClick:()=>Z("stripe"),children:(0,r.jsxs)(S.Wu,{className:"p-2 flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("p",{className:"font-medium",children:(null==z?void 0:null===(c=z.modal)||void 0===c?void 0:null===(o=c.payment_method)||void 0===o?void 0:null===(n=o.stripe)||void 0===n?void 0:n.title)||"Credit Card"}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:(null==z?void 0:null===(p=z.modal)||void 0===p?void 0:null===(u=p.payment_method)||void 0===u?void 0:null===(m=u.stripe)||void 0===m?void 0:m.subtitle)||"Pay with Stripe"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsxs)("div",{className:"relative w-8 h-5 bg-gray-100 rounded overflow-hidden",children:[!Q("https://file.v03ai.com/pay/visa.svg")&&!ee("https://file.v03ai.com/pay/visa.svg")&&(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-r from-gray-200 via-gray-100 to-gray-200 animate-pulse"}),ee("https://file.v03ai.com/pay/visa.svg")&&(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center text-gray-400 text-xs",children:"?"}),(0,r.jsx)("img",{src:"https://file.v03ai.com/pay/visa.svg",alt:"Visa",className:"w-8 h-5 object-contain transition-opacity duration-300 ".concat(Q("https://file.v03ai.com/pay/visa.svg")?"opacity-100":"opacity-0"),onLoad:()=>q("https://file.v03ai.com/pay/visa.svg"),onError:()=>X("https://file.v03ai.com/pay/visa.svg")})]}),(0,r.jsxs)("div",{className:"relative w-8 h-5 bg-gray-100 rounded overflow-hidden",children:[!Q("https://file.v03ai.com/pay/mastercard.svg")&&!ee("https://file.v03ai.com/pay/mastercard.svg")&&(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-r from-gray-200 via-gray-100 to-gray-200 animate-pulse"}),ee("https://file.v03ai.com/pay/mastercard.svg")&&(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center text-gray-400 text-xs",children:"?"}),(0,r.jsx)("img",{src:"https://file.v03ai.com/pay/mastercard.svg",alt:"Mastercard",className:"w-8 h-5 object-contain transition-opacity duration-300 ".concat(Q("https://file.v03ai.com/pay/mastercard.svg")?"opacity-100":"opacity-0"),onLoad:()=>q("https://file.v03ai.com/pay/mastercard.svg"),onError:()=>X("https://file.v03ai.com/pay/mastercard.svg")})]}),(0,r.jsxs)("div",{className:"relative w-8 h-5 bg-gray-100 rounded overflow-hidden",children:[!Q("https://file.v03ai.com/pay/amex.png")&&!ee("https://file.v03ai.com/pay/amex.png")&&(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-r from-gray-200 via-gray-100 to-gray-200 animate-pulse"}),ee("https://file.v03ai.com/pay/amex.png")&&(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center text-gray-400 text-xs",children:"?"}),(0,r.jsx)("img",{src:"https://file.v03ai.com/pay/amex.png",alt:"Amex",className:"w-8 h-5 object-contain transition-opacity duration-300 ".concat(Q("https://file.v03ai.com/pay/amex.png")?"opacity-100":"opacity-0"),onLoad:()=>q("https://file.v03ai.com/pay/amex.png"),onError:()=>X("https://file.v03ai.com/pay/amex.png")})]}),(0,r.jsxs)("div",{className:"relative w-8 h-5 bg-gray-100 rounded overflow-hidden",children:[!Q("https://file.v03ai.com/pay/link.svg")&&!ee("https://file.v03ai.com/pay/link.svg")&&(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-r from-gray-200 via-gray-100 to-gray-200 animate-pulse"}),ee("https://file.v03ai.com/pay/link.svg")&&(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center text-gray-400 text-xs",children:"?"}),(0,r.jsx)("img",{src:"https://file.v03ai.com/pay/link.svg",alt:"LINK",className:"w-8 h-5 object-contain transition-opacity duration-300 ".concat(Q("https://file.v03ai.com/pay/link.svg")?"opacity-100":"opacity-0"),onLoad:()=>q("https://file.v03ai.com/pay/link.svg"),onError:()=>X("https://file.v03ai.com/pay/link.svg")})]})]}),(0,r.jsx)("div",{className:"w-7 flex justify-center",children:"stripe"===V&&(0,r.jsx)(i.A,{className:"w-5 h-5 text-primary"})})]})]})}),U.payment.enablePayPal&&(0,r.jsx)(S.Zp,{className:"cursor-pointer transition-all border ".concat("paypal"===V?"ring-2 ring-primary border-primary":"border-border"),onClick:()=>Z("paypal"),children:(0,r.jsxs)(S.Wu,{className:"p-2 flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("p",{className:"font-medium",children:(null==z?void 0:null===(f=z.modal)||void 0===f?void 0:null===(h=f.payment_method)||void 0===h?void 0:null===(x=h.paypal)||void 0===x?void 0:x.title)||"PayPal"}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:(null==z?void 0:null===(b=z.modal)||void 0===b?void 0:null===(y=b.payment_method)||void 0===y?void 0:null===(g=y.paypal)||void 0===g?void 0:g.subtitle)||"Pay with PayPal account"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("div",{className:"relative w-12 h-8 bg-gray-100 rounded overflow-hidden",children:[!Q("https://file.v03ai.com/pay/paypal.svg")&&!ee("https://file.v03ai.com/pay/paypal.svg")&&(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-r from-gray-200 via-gray-100 to-gray-200 animate-pulse"}),ee("https://file.v03ai.com/pay/paypal.svg")&&(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center text-gray-400 text-xs",children:"PayPal"}),(0,r.jsx)("img",{src:"https://file.v03ai.com/pay/paypal.svg",alt:"PayPal",className:"w-12 h-8 object-contain transition-opacity duration-300 ".concat(Q("https://file.v03ai.com/pay/paypal.svg")?"opacity-100":"opacity-0"),onLoad:()=>q("https://file.v03ai.com/pay/paypal.svg"),onError:()=>X("https://file.v03ai.com/pay/paypal.svg")})]}),(0,r.jsx)("div",{className:"w-7 flex justify-center",children:"paypal"===V&&(0,r.jsx)(i.A,{className:"w-5 h-5 text-primary"})})]})]})}),U.payment.enableNowPayments&&(0,r.jsx)(S.Zp,{className:"cursor-pointer transition-all border ".concat("nowpayments"===V?"ring-2 ring-primary border-primary":"border-border"),onClick:()=>Z("nowpayments"),children:(0,r.jsxs)(S.Wu,{className:"p-2 flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("p",{className:"font-medium",children:(null==z?void 0:null===(w=z.modal)||void 0===w?void 0:null===(N=w.payment_method)||void 0===N?void 0:null===(j=N.nowpayments)||void 0===j?void 0:j.title)||"Cryptocurrency"}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:(null==z?void 0:null===(_=z.modal)||void 0===_?void 0:null===(k=_.payment_method)||void 0===k?void 0:null===(P=k.nowpayments)||void 0===P?void 0:P.subtitle)||"Pay with BTC, ETH, USDT & 300+ coins"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)("div",{className:"relative w-8 h-5 bg-gray-100 dark:bg-gray-800 rounded overflow-hidden flex items-center justify-center",children:(0,r.jsx)("span",{className:"text-[10px] font-bold text-orange-500",children:"BTC"})}),(0,r.jsx)("div",{className:"relative w-8 h-5 bg-gray-100 dark:bg-gray-800 rounded overflow-hidden flex items-center justify-center",children:(0,r.jsx)("span",{className:"text-[10px] font-bold text-blue-500",children:"ETH"})}),(0,r.jsx)("div",{className:"relative w-8 h-5 bg-gray-100 dark:bg-gray-800 rounded overflow-hidden flex items-center justify-center",children:(0,r.jsx)("span",{className:"text-[10px] font-bold text-green-500",children:"USDT"})})]}),(0,r.jsx)("div",{className:"w-7 flex justify-center",children:"nowpayments"===V&&(0,r.jsx)(i.A,{className:"w-5 h-5 text-primary"})})]})]})})]}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"flex gap-3",children:[(0,r.jsx)(v.$,{variant:"outline",className:"flex-1",onClick:J,children:(null==z?void 0:null===(T=z.modal)||void 0===T?void 0:null===(E=T.payment_method)||void 0===E?void 0:E.
1cancel)||"Cancel"}),(0,r.jsx)(v.$,{className:"flex-1",onClick:()=>{V&&$&&(Y(V,$),J())},disabled:!V,children:(null==z?void 0:null===(A=z.modal)||void 0===A?void 0:null===(R=A.payment_method)||void 0===R?void 0:R.continue)||"Continue"})]}),(0,r.jsx)("div",{className:"flex items-center gap-2 text-center text-gray-500",children:(null==$?void 0:$.interval)!=="one-time"&&(0,r.jsx)("span",{className:"block mt-2 text-sm",children:(null==z?void 0:null===(O=z.modal)||void 0===O?void 0:null===(L=O.payment_method)||void 0===L?void 0:L.secure_note)||"Your payment is processed securely, with the flexibility to cancel anytime."})}),(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 text-xs text-green-500",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),(0,r.jsx)("span",{children:(null==z?void 0:null===(I=z.modal)||void 0===I?void 0:null===(D=I.payment_method)||void 0===D?void 0:D.secure_payment)||"Secure payment"})]}),(0,r.jsx)("span",{className:"text-gray-300",children:"•"}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})}),(0,r.jsx)("span",{children:(null==z?void 0:null===(M=z.modal)||void 0===M?void 0:null===(F=M.payment_method)||void 0===F?void 0:F.ssl_encrypted)||"SSL encrypted"})]})]})]})]})})}var R=a(80891),A=a(56929),L=a(65100);function O(e){let{isOpen:t,onClose:a,item:s,onSuccess:l,onPaymentError:n,onPaymentCancel:i}=e,[o,c]=(0,d.useState)(!1),m="year"===s.interval?(0,A.$g)(Math.round(s.amount/12),s.currency||"USD"):(0,A.$g)(s.amount,s.currency||"USD"),u="year"===s.interval?(0,A.$g)(s.amount,s.currency||"USD"):null,p="month"===s.interval||"year"===s.interval;(0,d.useEffect)(()=>{t&&(c(!1),console.log("PayPal popup opened with item:",{product_id:s.product_id,amount:s.amount,currency:s.currency,interval:s.interval,displayPrice:m,yearlyTotalPrice:u,isSubscription:p}))},[t,s,m,u,p]);let x=async()=>{try{let e={product_id:s.product_id,currency:(s.currency||"USD").toUpperCase(),tier_index:s.tier_index};console.log("Creating PayPal subscription with params:",e);let t=await fetch("/api/paypal/subscription",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){let e=await t.text();throw Error("HTTP ".concat(t.status,": ").concat(e))}let a=await t.json();if(console.log("PayPal subscription response:",a),a.error)throw Error(a.error);if(a.approval_url)console.log("Redirecting to PayPal subscription approval:",a.approval_url),window.location.href=a.approval_url;else throw Error("No approval URL received from PayPal subscription")}catch(e){console.error("PayPal subscription creation failed:",e),b.oR.error("PayPal Subscription Error: ".concat(e instanceof Error?e.message:"Unknown error")),n&&n(s)}},h=async()=>{if(p)return console.warn("createOrder called for subscription - this should not happen"),"";console.log("PayPal createOrder function called for one-time payment");try{let e={product_id:s.product_id,currency:(s.currency||"USD").toUpperCase(),tier_index:s.tier_index};console.log("Creating PayPal order with params:",e);let t=await fetch("/api/paypal/checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(console.log("PayPal checkout response status:",t.status),!t.ok){console.error("PayPal checkout HTTP error:",{status:t.status,statusText:t.statusText,url:t.url});let e="";try{e=await t.text(),console.error("Error response text:",e)}catch(e){console.error("Could not read error response:",e)}throw Error("HTTP ".concat(t.status,": ").concat(t.statusText).concat(e?" - ".concat(e):""))}let a=await t.json();console.log("PayPal checkout response:",a);
1let{code:r,message:l,data:n}=a;if(0!==r)return console.error("PayPal checkout API error:",{code:r,message:l,data:n,itemData:{product_id:s.product_id,amount:s.amount,currency:s.currency,interval:s.interval}}),b.oR.error("PayPal Error: ".concat(l)),"";return console.log("PayPal order created successfully, order_id:",n.order_id),n.order_id}catch(e){return console.error("PayPal create order failed:",{error:e,message:e instanceof Error?e.message:"Unknown error",itemData:{product_id:s.product_id,amount:s.amount,currency:s.currency,interval:s.interval}}),b.oR.error("Failed to create PayPal order: ".concat(e instanceof Error?e.message:"Unknown error")),""}},v=async e=>{try{console.log("PayPal onApprove called with data:",e),p||c(!0);let t="/api/paypal/success?token=".concat(e.orderID);console.log("Redirecting to PayPal success handler:",t),window.location.href=t}catch(e){console.error("PayPal approve failed:",e),b.oR.error("Failed to complete payment"),c(!1)}};return(0,r.jsx)(C.lG,{open:t,onOpenChange:a,children:(0,r.jsxs)(C.Cf,{className:"sm:max-w-md",children:[(0,r.jsx)(C.c7,{children:(0,r.jsx)(C.L3,{children:"Complete Payment with PayPal"})}),(0,r.jsxs)("div",{className:"py-4",children:[(0,r.jsxs)("div",{className:"text-center mb-4",children:[(0,r.jsx)("p",{className:"text-lg font-medium",children:s.title}),(0,r.jsxs)("p",{className:"text-2xl font-bold text-blue-600",children:[m,"year"===s.interval&&(0,r.jsx)("span",{className:"text-base font-medium text-muted-foreground",children:"/month"})]}),(0,r.jsxs)("p",{className:"text-sm text-muted-foreground mt-2",children:[s.credits," credits • ",s.interval]}),"year"===s.interval&&u&&(0,r.jsxs)("p",{className:"text-xs text-muted-foreground mt-1",children:["Billed annually as ",u]})]}),(0,r.jsx)("div",{className:"mt-6",children:p?(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("button",{onClick:x,className:"w-full bg-[#0070ba] hover:bg-[#005ea6] text-white font-medium py-3 px-4 rounded-lg transition-colors",children:"Continue with PayPal"}),(0,r.jsx)("p",{className:"text-xs text-center text-muted-foreground",children:"You'll be redirected to PayPal to set up your recurring subscription"})]}):(0,r.jsx)(R.JV,{style:{layout:"vertical",color:"blue",shape:"rect",label:"paypal"},createOrder:h,onApprove:v,onCancel:()=>{c(!1),"year"===s.interval&&i&&i(s),a()},onError:e=>{console.error("PayPal error details:",{error:e,errorType:typeof e,errorKeys:e?Object.keys(e):"none",errorString:JSON.stringify(e,null,2),item:{product_id:s.product_id,amount:s.amount,currency:s.currency,interval:s.interval}});let t="Payment error occurred";e&&e.message?t="PayPal Error: ".concat(e.message):e&&e.name?t="PayPal Error: ".concat(e.name):"string"==typeof e&&(t="PayPal Error: ".concat(e)),console.error("Processed error message:",t),c(!1),"year"===s.interval&&n&&n(s),b.oR.error(t)}})})]}),o&&!p&&(0,r.jsx)("div",{className:"absolute inset-0 bg-white/90 backdrop-blur-sm flex items-center justify-center z-50 rounded-lg",children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)(L.A,{className:"w-8 h-8 animate-spin text-blue-600 mx-auto mb-3"}),(0,r.jsx)("h3",{className:"text-lg font-medium mb-2",children:"Processing Payment..."}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground max-w-xs",children:"Please wait while we process your payment. You will be redirected to the success page shortly."})]})})]})})}function D(e){let{isOpen:t,onClose:a,annualPlan:s,monthlyPlan:l,onSelectMonthlyPlan:n,onRetryAnnualPlan:i}=e,o=s.amount/12;return null==l||l.amount,(0,r.jsx)(C.lG,{open:t,onOpenChange:a,children:(0,r.jsxs)(C.Cf,{className:"w-[95vw] max-w-[400px] bg-background border border-primary/30 shadow-2xl backdrop-blur-sm",children:[(0,r.jsxs)(C.c7,{children:[(0,r.jsx)(C.L3,{className:"text-xl font-bold text-primary text-center",children:"Payment Issue?"}),(0,r.jsx)("div",{className:"text-center pt-2",children:(0,r.jsx)("p",{className:"text-[13px] text-muted-foreground font-medium",children:"Common reasons: Insufficient balance or want to try first"})})]}),(0,r.jsxs)("div",{className:"space-y-6",children:[l&&(0,r.jsx)("div",{className:"bg-gradient-to-br from-primary/10 to-primary/5 border-2 border-primary/40 rounded-lg p-4 backdrop-blur-sm",children:(0,r.jsxs)("div",{className:"text-center space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,r.jsx)("div",{className:"w-2 h-2 bg-primary rounded-full shadow-lg shadow-primary/50"}),(0,r.jsx)("span",{className:"text-primary font-semibold text-[14px]",children:"Recommended"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-4xl font-bold text-primary tracking-tight",children:l.price}
1),(0,r.jsxs)("div",{className:"text-foreground/80 text-[14px] font-medium mt-1",children:["per month • ",l.credits," credits"]})]}),(0,r.jsx)("div",{className:"text-[13px] text-primary/80 font-medium",children:"✓ Try first, then upgrade for savings"})]})}),(0,r.jsx)("div",{className:"bg-gradient-to-br from-muted/50 to-muted/30 border border-border rounded-lg p-3 backdrop-blur-sm",children:(0,r.jsxs)("div",{className:"text-center space-y-2",children:[(0,r.jsx)("div",{className:"text-[14px] font-semibold text-foreground/90",children:"Annual Plan Benefits"}),(0,r.jsxs)("div",{className:"text-[13px] text-muted-foreground font-medium space-y-1",children:[(0,r.jsx)("div",{children:"Save 30% compared to monthly"}),(0,r.jsxs)("div",{children:["Only $",(o/100).toFixed(2),"/month when paid yearly"]})]})]})}),(0,r.jsxs)("div",{className:"space-y-3",children:[l&&(0,r.jsxs)(v.$,{onClick:()=>{l&&n(l),a()},className:"w-full bg-primary hover:bg-primary/90 text-primary-foreground font-bold h-11 text-[15px] shadow-lg shadow-primary/30 border border-primary/50",children:["Choose Monthly Plan ",l.price]}),(0,r.jsx)(v.$,{variant:"outline",onClick:()=>{i(s),a()},className:"w-full border-2 border-primary/40 bg-background/50 text-primary hover:bg-primary/10 hover:border-primary font-semibold h-10 text-[14px] backdrop-blur-sm",children:"Retry Annual Payment"}),(0,r.jsx)(v.$,{variant:"ghost",onClick:a,className:"w-full text-muted-foreground hover:text-foreground hover:bg-muted/50 font-medium h-9 text-[13px]",children:"Maybe Later"})]})]})]})})}var I=a(38260),F=a(58853);let M=[{code:"USD",name:"US Dollar",symbol:"$",flag:"\uD83C\uDDFA\uD83C\uDDF8"},{code:"EUR",name:"Euro",symbol:"€",flag:"\uD83C\uDDEA\uD83C\uDDFA"},{code:"GBP",name:"British Pound",symbol:"\xa3",flag:"\uD83C\uDDEC\uD83C\uDDE7"},{code:"JPY",name:"Japanese Yen",symbol:"\xa5",flag:"\uD83C\uDDEF\uD83C\uDDF5"},{code:"CNY",name:"Chinese Yuan",symbol:"\xa5",flag:"\uD83C\uDDE8\uD83C\uDDF3"},{code:"INR",name:"Indian Rupee",symbol:"₹",flag:"\uD83C\uDDEE\uD83C\uDDF3"},{code:"BRL",name:"Brazilian Real",symbol:"R$",flag:"\uD83C\uDDE7\uD83C\uDDF7"}],B="preferred-currency";function J(e){let{selectedCurrency:t,onCurrencyChange:a,className:s}=e,l=M.find(e=>e.code===t)||M[0],n=e=>{try{localStorage.setItem(B,e)}catch(e){console.warn("Failed to save currency preference to localStorage:",e)}a(e)};return(0,r.jsxs)(F.rI,{children:[(0,r.jsx)(F.ty,{asChild:!0,children:(0,r.jsxs)(v.$,{variant:"outline",className:"flex h-10 md:h-12 w-auto items-center gap-2 rounded-full bg-gray-800/60 border-gray-700 text-white hover:bg-gray-700/60 px-3 md:px-4 ".concat(null!=s?s:""),children:[(0,r.jsx)("span",{className:"font-semibold tracking-wide text-sm md:text-base",children:l.code}),(0,r.jsx)(I.A,{className:"h-4 w-4"})]})}),(0,r.jsx)(F.SQ,{align:"start",className:"w-fit bg-gray-800 border-gray-700 text-white",children:M.map(e=>(0,r.jsx)(F._2,{onClick:()=>n(e.code),className:"flex items-center gap-3 px-2 py-1.5 cursor-pointer hover:bg-gray-700 ".concat(t===e.code?"bg-gray-700 text-amber-400":""),children:(0,r.jsx)("div",{className:"flex flex-col",children:(0,r.jsx)("span",{className:"font-medium",children:e.code})})},e.code))})]})}let $={year:[{amount:71880,credits:18e3},{amount:89880,credits:24e3},{amount:107880,credits:32e3},{amount:125880,credits:4e4},{amount:143880,credits:48e3}],month:[{amount:9990,credits:2100},{amount:12490,credits:2800},{amount:14990,credits:3500},{amount:17490,credits:4200},{amount:19990,credits:5e3}],"one-time":[{amount:14990,credits:3e3},{amount:29990,credits:6400},{amount:44990,credits:1e4},{amount:59990,credits:14e3},{amount:74990,credits:18300},{amount:89990,credits:23e3},{amount:104990,credits:27600},{amount:119990,credits:32400},{amount:134990,credits:37500},{amount:149990,credits:42850}]};function Y(e){var t;if(!e.product_id.includes("_pro_max")||"pack"===e.interval)return e;let a=null===(t=$[e.interval])||void 0===t?void 0:t[0];return a?{...e,amount:a.amount,credits:a.credits,tier_index:0}:e}function z(e){var t,a,c,m,u,N;let{pricing:w,errorFromUrl:P,failedProductId:k,testAnnualModal:C}=e;if(w.disabled)return null;let{user:S,setShowSignModal:E}=(0,j.U)(),[L,I]=(0,d.useState)(null===(a=w.groups)||void 0===a?void 0:null===(t=a[0])||void 0===t?void 0:t.name),[F,$]=(0,d.useState)(!1),[z,V]=(0,d.useState)(null),[Z,G]=(0,d.useState)("year"),[H,K]=(0,d.useState)(!1),[W,q]=(0,d.useState)(!1),[X,Q]=(0,d.useState)(null),[ee,et]=(0,d.useState)(!1),[ea,er]=(0,d.useState)(null),[es,el]=(0,d.useState)("USD");(0,d.useEffect)(()=>{el(function(){try{let e=localStorage.getItem(B);if(e&&M.some(t=>t.code===e))return e}catch(e){console.warn("Failed to read currency preference from localStorage:",e)}return"USD"}())},[]);let en=async e=>{try{if(!S){E(!0);return}let t=(0,A.hZ)(e.amount,es),a={product_id:e.product_id,product_name:e.product_name,credits:e.credits,interval:e.interval,amount:t,currency:es.toUpperCase(),valid_months:e.valid_months,tier_index:e.tier_index};$(!0),V(e.product_id);let r=await fetch("/api/nowpayments/checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});
1if(401===r.status){$(!1),V(null),E(!0);return}let{code:s,message:l,data:n}=await r.json();if(0!==s){b.oR.error(l);return}window.location.href=n.invoice_url}catch(e){b.oR.error("Crypto checkout failed")}finally{$(!1),V(null)}},ei=async e=>{try{if(!S){E(!0);return}let t=(0,A.hZ)(e.amount,es),a={product_id:e.product_id,product_name:e.product_name,credits:e.credits,interval:e.interval,amount:t,currency:es.toUpperCase(),valid_months:e.valid_months,tier_index:e.tier_index};$(!0),V(e.product_id);let r=await fetch("/api/checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(401===r.status){$(!1),V(null),E(!0);return}let{code:s,message:l,data:n}=await r.json();if(0!==s){b.oR.error(l);return}let{public_key:i,session_id:o}=n,d=await (0,y.c)(i);if(!d){b.oR.error("checkout failed");return}let c=await d.redirectToCheckout({sessionId:o});c.error&&(console.log("Stripe payment error - Product:",e.product_id,"Interval:",e.interval),"year"===e.interval?(console.log("Showing annual fallback dialog for Stripe error"),ed(e)):console.log("Not showing fallback dialog - not annual plan"),b.oR.error(c.error.message))}catch(t){console.log("Stripe checkout failed - Product:",e.product_id,"Interval:",e.interval,"Error:",t),"year"===e.interval?(console.log("Showing annual fallback dialog for Stripe exception"),ed(e)):console.log("Not showing fallback dialog - not annual plan"),b.oR.error("checkout failed")}finally{$(!1),V(null)}},eo=e=>{if(!S){E(!0);return}if(!U.payment.enablePayPal&&!U.payment.enableNowPayments){ei(e);return}Q(e),K(!0)},ed=e=>{"year"===e.interval&&(er(e),et(!0))},ec=()=>{et(!1),er(null)};(0,d.useEffect)(()=>{w.items&&(I(w.items[0].group),V(w.items[0].product_id),$(!1))},[w.items]),(0,d.useEffect)(()=>{if(console.log("URL error check:",{errorFromUrl:P,failedProductId:k,testAnnualModal:C,hasItems:!!w.items}),"true"===C&&w.items){let e=w.items.find(e=>"year"===e.interval);if(e){console.log("Test mode: triggering annual fallback modal"),setTimeout(()=>{ed(e)},1e3);return}}if(P&&k&&w.items){console.log("Checking for failed product:",k);let e=w.items.find(e=>e.product_id===k);console.log("Found failed item:",e),e&&(console.log("Failed item interval:",e.interval),"year"===e.interval?(console.log("Triggering annual fallback modal for URL error:",e.title),setTimeout(()=>{ed(e)},500)):console.log("Not showing fallback dialog - failed item is not annual plan"))}},[P,k,C,w.items]);let em=null===(c=w.items)||void 0===c?void 0:c.filter(e=>"pack"===Z?"one-time"===e.interval:e.interval===Z).map(Y);return(0,r.jsxs)("section",{id:w.name,className:"py-16",children:[(0,r.jsxs)("div",{className:"container",children:[(0,r.jsxs)("div",{className:"mx-auto mb-12 text-center",children:[(0,r.jsx)("h2",{className:"mb-2 text-2xl font-semibold lg:text-4xl",children:w.title}),(0,r.jsx)("p",{className:"text-muted-foreground lg:text-lg",children:w.description}),(0,r.jsxs)("div",{className:"w-full flex flex-col items-center justify-center gap-6 mb-12 mt-6",children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("div",{className:"absolute -inset-1 bg-gradient-to-r from-amber-600/30 via-amber-500/50 to-amber-600/30 rounded-3xl blur-md opacity-50"}),(0,r.jsx)("div",{className:"relative bg-gradient-to-r from-black/80 via-gray-900/90 to-black/80 px-7 py-5 rounded-2xl border border-amber-500/20 shadow-lg shadow-amber-500/10 backdrop-blur-sm overflow-hidden",children:(0,r.jsx)("div",{className:"relative flex flex-col gap-2.5",children:(0,r.jsx)("div",{className:"flex justify-center mb-2",children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("div",{className:"absolute -inset-0.5 bg-gradient-to-r from-red-500/40 to-orange-500/40 rounded-full blur-sm"}),(0,r.jsx)("div",{className:"relative bg-gradient-to-r from-red-600/90 to-orange-600/90 px-2.5 py-0.5 rounded-full border border-red-500/30",children:(0,r.jsxs)("div",{className:"flex items-center gap-1.5 text-white",children:[(0,r.jsx)("div",{className:"w-1.5 h-1.5 bg-red-300 rounded-full animate-pulse"}),(0,r.jsx)("span",{className:"text-xs font-bold",children:"Price increase coming soon! Subscribe now to lock in low prices!"}),(0,r.jsx)("div",{className:"w-1.5 h-1.5 bg-red-300 rounded-full animate-pulse"})]})})]})})})})]}),(0,r.jsx)(_,{})]}),(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 text-center",children:[(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:"Need More Credits or Get A Trial?"}),(0,r.jsxs)("button",{onClick:()=>G("pack"),className:"text-xs text-blue-400 hover:text-blue-300 flex items-center gap-1",children:["Buy One-Time Credits",(0,r.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",children:(0,r.jsx)("path",{d:"M3.64645 11.3536C3.45118 11.1583 3.45118 10.8417 3.64645 10.6465L10.2929 4L6 4C5.72386 4 5.5 3.77614 5.5 3.5C5.5 3.22386 5.72386 3 6 3L11.5 3C11.6326 3 11.7598 3.05268 11.8536 3.14645C11.9473 3.24022 12 3.36739 12 3.5L12 9.00001C12 9.27615 11.7761 9.50001 11.5 9.50001C11.2239 9.50001 11 9.27615 11 9.00001V4.70711L4.35355 11.3536C4.15829 11.5488 3.84171 11.5488 3.64645 11.3536Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})]})]}),!1,(0,r.jsxs)("div",{className:"flex flex-col md:flex-row items-stretch md:items-center justify-center gap-3 mt-8 w-full max-w-xl mx-auto px-4 md:px-0",children:[(0,r.jsx)("div",{className:"w-1/3 min-w-[140px] self-center md:self-auto md:w-auto mx-auto md:mx-0 flex justify-center",children:(0,r.jsx)(J,{selectedCurrency:es,onCurrencyChange:el})}),(0,r.jsx)("div",{className:"inline-flex h-10 md:h-12 w-full md:w-auto items-center rounded-full bg-gradient-to-r from-gray-900 to-black p-1.5 shadow-lg shadow-black/50",children:(0,r.jsxs)(p,{value:Z,className:"grid w-full grid-cols-3",onValueChange:e=>G(e),children:[(0,r.jsx)("div",{className:"relative",children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("div",{className:"absolute -top-2 md:-top-3 -right-1 md:-right-2",children:(0,r.jsx)("span",{className:"inline-flex items-center rounded-full bg-amber-400/90 px-1.5 md:px-2 py-0.5 text-[10px] md:text-xs font-bold text-white",children:"-30%"})}),(0,r.jsx)(x,{value:"year",id:"year",className:"peer sr-only"}),(0,r.jsx)(g.J,{htmlFor:"year",className:"flex h-8 md:h-9 cursor-pointer items-center justify-center rounded-lg px-3 md:px-4 text-sm md:text-base font-semibold text-gray-400 transition-all hover:text-white peer-data-[state=checked]:bg-gradient-to-r peer-data-[state=checked]:from-amber-500 peer-data-[state=checked]:to-amber-600 peer-data-[state=checked]:text-white peer-data-[state=checked]:shadow-md",children:null===(m=w.toggle)||void 0===m?void 0:m.yearly})]})}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(x,{value:"month",id:"month",className:"peer sr-only"}),(0,r.jsx)(g.J,{htmlFor:"month",className:"flex h-9 cursor-pointer items-center justify-center rounded-lg px-4 text-base font-semibold text-gray-400 transition-all hover:text-white peer-data-[state=checked]:bg-gradient-to-r peer-data-[state=checked]:from-amber-500 peer-data-[state=checked]:to-amber-600 peer-data-[state=checked]:text-white peer-data-[state=checked]:shadow-md",children:null===(u=w.toggle)||void 0===u?void 0:u.monthly})]}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(x,{value:"pack",id:"pack",className:"peer sr-only"}),(0,r.jsx)(g.J,{htmlFor:"pack",className:"flex h-8 md:h-9 cursor-pointer items-center justify-center rounded-lg px-3 md:px-4 text-sm md:text-base font-semibold text-gray-400 transition-all hover:text-white peer-data-[state=checked]:bg-gradient-to-r peer-data-[state=checked]:from-amber-500 peer-data-[state=checked]:to-amber-600 peer-data-[state=checked]:text-white peer-data-[state=checked]:shadow-md",children:null===(N=w.toggle)||void 0===N?void 0:N.pack})]})]})})]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:null==em?void 0:em.map((e,t)=>{var a;let d=F&&z===e.product_id,c=e.amount,m=e.amount,u="year"===e.interval,p=(0,A.yX)(c,m,es,u);return(0,r.jsxs)("div",{className:"relative rounded-xl border-2 bg-card text-card-foreground shadow-lg ".concat(e.is_featured?"border-amber-500/80 shadow-amber-500/20":"border-gray-600/80 shadow-gray-700/20"),children:[e.is_featured&&(0,r.jsx)("div",{className:"absolute inset-x-0 -top-3 mx-auto w-fit",children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-amber-500/30 rounded-lg blur-md"}),(0,r.jsxs)("div",{className:"relative bg-gradient-to-r from-amber-500 to-yellow-500 text-black px-3 py-1 rounded-lg border-2 border-amber-400 flex items-center gap-1.5 shadow-lg",children:[(0,r.jsx)(s.A,{className:"w-3.5 h-3.5 animate-pulse"}),(0,r.jsx)("span",{className:"text-xs font-bold",children:"Most Popular"})]})]})}),(0,r.jsx)("div",{className:"p-4",children:(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h3",{className:"text-xl font-semibold",children:e.title}),"one-time"===e.interval&&(0,r.jsxs)("div",{className:"flex items-center gap-1 px-3 py-1 bg-amber-500/15 rounded-full",children:[(0,r.jsx)(l.A,{className:"w-3.5 h-3.5 text-amber-400"}),(0,r.jsx)("span",{className:"text-xs font-medium text-amber-400/90",children:"No Extra Charges"})]}),e.discount&&(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-amber-500/10 rounded-md blur-[1px]"}),(0,r.jsxs)("div",{className:"relative bg-gradient-to-r from-amber-600/10 to-amber-500/10 text-amber-500 px-2 py-0.5 rounded-md border border-amber-500/20 flex items-center gap-1 text-xs",children:[(0,r.jsx)(l.A,{className:"w-3 h-3"}),(0,r.jsxs)("span",{children:["Save ",e.discount]})]})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 mt-1 text-sm text-muted-foreground",children:[!1,(0,r.jsxs)("span",{className:"inline-flex items-center",children:["$",(e.amount/100/e.credits).toFixed(3)," /Credit"]})]})]}),(0,r.jsxs)("div",{className:"flex items-baseline gap-1.5",children:[e.original_price&&p.originalPrice!==p.price&&(0,r.jsx)("span",{className:"text-lg line-through text-muted-foreground",children:p.originalPrice}),(0,r.jsx)("span",{className:"text-3xl font-bold tracking-tight",children:p.price}),(0,r.jsx)("span",{className:"text-base font-medium text-muted-foreground",children:"year"===e.interval?"/month":""})]}),(0,r.jsxs)(v.$,{className:"w-full bg-gradient-to-r from-amber-500 to-amber-600 hover:from-amber-600 hover:to-amber-700",onClick:()=>eo(e),disabled:d,children:[d?(0,r.jsx)(n.A,{className:"mr-2 h-5 w-5 animate-spin"}):(0,r.jsx)(f.default,{name:e.button.icon,className:"mr-2 h-5 w-5"}),(0,r.jsx)("span",{className:"text-base",children:e.button.title})]}),(0,r.jsx)("div",{children:(0,r.jsx)("ul",{className:"mt-2 space-y-2 text-sm",children:null===(a=e.features)||void 0===a?void 0:a.map((e,t)=>{let a=!e.startsWith("!"),s=a?e:e.substring(1);return(0,r.jsxs)("li",{className:"flex items-center gap-2",children:[a?(0,r.jsx)(i.A,{className:"h-5 w-5 text-green-500"}):(0,r.jsx)(o.A,{className:"h-5 w-5 text-red-500/70"}),(0,r.jsx)("span",{className:a?"":"text-muted-foreground",children:s})]},t)})})}),e.tag&&(0,r.jsx)("p",{className:"text-sm text-center text-muted-foreground",children:e.tag})]})})]},t)})}),w.groups&&w.groups.length>0&&(0,r.jsx)("div",{className:"flex h-12 mb-12 items-center rounded-md bg-muted p-1 text-lg",children:(0,r.jsx)(p,{value:L,className:"h-full grid-cols-".concat(w.groups.length),onValueChange:e=>{I(e)},children:w.groups.map((e,t)=>(0,r.jsxs)("div",{className:'h-full rounded-md transition-all has-[button[data-state="checked"]]:bg-white',children:[(0,r.jsx)(x,{value:e.name||"",id:e.name,className:"peer sr-only"}),(0,r.jsxs)(g.J,{htmlFor:e.name,className:"flex h-full cursor-pointer items-center justify-center px-7 font-semibold text-muted-foreground peer-data-[state=checked]:text-primary",children:[e.title,e.label&&(0,r.jsx)(h.E,{variant:"outline",className:"ml-2",children:e.label})]})]},t))})})]}),(U.payment.enablePayPal||U.payment.enableNowPayments)&&(0,r.jsx)(T,{isOpen:H,onClose:()=>K(!1),item:X,onSelectPayment:(e,t)=>
1{if("nowpayments"===e)en(t);else if("paypal"===e){let e=["USD","EUR","GBP","JPY","CAD","AUD","BRL"],a=es.toUpperCase();if(!e.includes(a)){b.oR.error("PayPal does not support ".concat(a,". Please use Stripe or switch to a supported currency (").concat(e.join(", "),")."));return}let r=(0,A.hZ)(t.amount,es);Q({...t,amount:r,currency:es.toUpperCase()}),q(!0)}else ei(t)}}),U.payment.enablePayPal&&X&&(0,r.jsx)(R.ag,{options:{clientId:"ATKCrY90p-GOR8bMHctxD1EgHbxSUwTiJFcFwijw3LTaqVM0sUzSOLMazcEEWpvhFXp6OmT15pQ-osPk",currency:(X.currency||"USD").toUpperCase(),intent:"capture"},children:(0,r.jsx)(O,{isOpen:W,onClose:()=>{q(!1),Q(null)},item:X,onSuccess:()=>{b.oR.success("Payment successful!"),Q(null)},onPaymentError:e=>{console.log("PayPal payment error - Product:",e.product_id,"Interval:",e.interval),"year"===e.interval?(console.log("Showing annual fallback dialog for PayPal error"),ed(e)):console.log("Not showing fallback dialog - not annual plan")},onPaymentCancel:e=>{console.log("PayPal payment cancelled - Product:",e.product_id,"Interval:",e.interval),"year"===e.interval?(console.log("Showing annual fallback dialog for PayPal cancel"),ed(e)):console.log("Not showing fallback dialog - not annual plan")}})},"pp-".concat((X.currency||"USD").toUpperCase())),ea&&(0,r.jsx)(D,{isOpen:ee,onClose:ec,annualPlan:ea,monthlyPlan:w.items&&w.items.find(e=>"month"===e.interval&&"v03_ai_pro"===e.product_id)||null,onSelectMonthlyPlan:e=>{ec(),Q(e),K(!0)},onRetryAnnualPlan:e=>{ec(),Q(e),K(!0)}})]})}},56929:(e,t,a)=>{a.d(t,{$g:()=>n,hZ:()=>l,yX:()=>i});let r={USD:1,EUR:.85,GBP:.73,JPY:140,CNY:7.1,INR:87,BRL:5.2},s={USD:"$",EUR:"€",GBP:"\xa3",JPY:"\xa5",CNY:"\xa5",INR:"₹",BRL:"R$"};function l(e,t){let a,s=t.toUpperCase();if("USD"===s)return e;let l=r[s];if(!l)return console.warn("Exchange rate not found for currency: ".concat(s)),e;let n=e/100*l;return"JPY"===s?Math.round(n):Math.round(100*n)}function n(e,t){let a=t.toUpperCase(),r=s[a]||a;return"JPY"===a?"".concat(r).concat(Math.round(e).toLocaleString()):"".concat(r).concat((e/100).toFixed(2))}function i(e,t,a){let r,i,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],d=a.toUpperCase();if(o){let a=Math.round(t/12);r=l(Math.round(e/12),d),i=l(a,d)}else r=l(e,d),i=l(t,d);l(e,d);let c=l(t,d);return{originalPrice:n(r,d),price:n(i,d),amount:c,displayAmount:i,currency:d,symbol:s[d]||d,isYearly:o}}},58853:(e,t,a)=>{a.d(t,{I:()=>d,SQ:()=>o,_2:()=>c,lp:()=>m,mB:()=>u,rI:()=>n,ty:()=>i});var r=a(88795);a(68939);var s=a(55894),l=a(11911);function n(e){let{...t}=e;return(0,r.jsx)(s.bL,{"data-slot":"dropdown-menu",...t})}function i(e){let{...t}=e;return(0,r.jsx)(s.l9,{"data-slot":"dropdown-menu-trigger",...t})}function o(e){let{className:t,sideOffset:a=4,...n}=e;return(0,r.jsx)(s.ZL,{children:(0,r.jsx)(s.UC,{"data-slot":"dropdown-menu-content",sideOffset:a,className:(0,l.cn)("bg-popover text-popover-foreground 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",t),...n})})}function d(e){let{...t}=e;return(0,r.jsx)(s.YJ,{"data-slot":"dropdown-menu-group",...t})}function c(e){let{className:t,inset:a,variant:n="default",...i}=e;return(0,r.jsx)(s.q7,{"data-slot":"dropdown-menu-item","data-inset":a,"data-variant":n,className:(0,l.cn)("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...i})}function m(e){let{className:t,inset:a,...n}=e;return(0,r.jsx)(s.JU,{"data-slot":"dropdown-menu-label","data-inset":a,className:(0,l.cn)("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),...n})}function u(e){let{className:t,...a}=e;return(0,r.jsx)(s.wv,{"data-slot":"dropdown-menu-separator",className:(0,l.cn)("bg-border -mx-1 my-1 h-px",t),...a})}},95418:(e,t,a)=>{a.d(t,{BT:()=>o,Wu:()=>c,X9:()=>d,ZB:()=>i,Zp:()=>l,aR:()=>n});var r=a(88795);a(68939);var s=a(11911);function l(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card",className:(0,s.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...a})}function n(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-header",className:(0,s.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...a})}function i(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-title",className:(0,s.cn)("leading-none font-semibold",t),...a})}function o(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-description",className:(0,s.cn)("text-muted-foreground text-sm",t),...a})}function d(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-action",className:(0,s.cn)("col-start-2 row-span-2 row-start-1 self-start justify-self-end",t),...a})}function c(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-content",className:(0,s.cn)("px-6",t),...a})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.