PageSourceSearch

https://www.purplebunny.ai/_next/static/chunks/pages/credits-a317d74beaa203f0.js

js purplebunny.ai collected 2026-10-05 14:28:26 UTC 12,477 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1873],{3873:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/credits",function(){return s(685)}])},4081:function(e,t,s){"use strict";s.d(t,{Z:function(){return i}});var r=s(5893);s(7294);var a=s(1664),n=s.n(a),c=s(1964);function i(){let{setShowPreferences:e}=(0,c.Y)();return(0,r.jsxs)("footer",{className:"w-full text-center py-6 text-sm text-chatgpt-muted border-t border-chatgpt-border bg-white mt-auto",children:[(0,r.jsxs)("div",{className:"flex justify-center gap-4 mb-2",children:[(0,r.jsx)(n(),{href:"/",className:"hover:underline text-chatgpt-text transition-colors",children:"Home"}),(0,r.jsx)(n(),{href:"/about",className:"hover:underline text-chatgpt-text transition-colors",children:"About Us"}),(0,r.jsx)(n(),{href:"/terms",className:"hover:underline text-chatgpt-text transition-colors",children:"Terms of Use"}),(0,r.jsx)(n(),{href:"/privacy",className:"hover:underline text-chatgpt-text transition-colors",children:"Privacy Policy"}),(0,r.jsx)(n(),{href:"/donotsell",className:"hover:underline text-chatgpt-text transition-colors",children:"Do Not Sell or Share My Personal Information"})]}),(0,r.jsxs)("div",{className:"text-chatgpt-text",children:["\xa9 2026 ","purplebunny.ai",". All rights reserved."]})]})}},685:function(e,t,s){"use strict";s.r(t);var r=s(5893),a=s(3606),n=s(9008),c=s.n(n),i=s(4100),l=s(7294),d=s(5021),o=s(4081),x=s(3454);let h=[{credits:10,price:10,popular:!1},{credits:25,price:25,popular:!0},{credits:50,price:50,popular:!1},{credits:100,price:100,popular:!1}];t.default=(0,a.tl)(function(){let{user:e}=(0,a.aF)(),[t,s]=(0,l.useState)(h[1]),[n,m]=(0,l.useState)(!1),[u,p]=(0,l.useState)(null),b=async()=>{try{let e=await fetch("/api/paypal/create-order",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({amount:t.price})});return(await e.json()).id}catch(e){throw console.error("Error creating order:",e),e}},f=async e=>{m(!0);try{let t=await fetch("/api/paypal/capture-order",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({orderId:e.orderID})}),s=await t.json();s.success?(p({type:"success",text:"Success! ".concat(s.credits," credits have been added to your account. You can now start using your AI agents!")}),setTimeout(()=>{window.location.reload()},3e3)):p({type:"error",text:"Payment completed but there was an issue adding credits. Please contact support."})}catch(e){p({type:"error",text:"An error occurred while processing your payment. Please contact support."})}finally{m(!1)}};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(c(),{children:[(0,r.jsx)("title",{children:"PurpleBunny - Purchase Credits"}),(0,r.jsx)("meta",{name:"description",content:"PurpleBunny - Purchase Credits"}),(0,r.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1, viewport-fit=cover, user-scalable=no"}),(0,r.jsx)("meta",{name:"apple-mobile-web-app-capable",content:"yes"}),(0,r.jsx)("meta",{name:"apple-mobile-web-app-status-bar-style",content:"black-translucent"})]}),(0,r.jsxs)("main",{className:"min-h-screen w-full bg-chatgpt-secondary has-safe-area",children:[(0,r.jsx)("div",{className:"flex items-center justify-between p-4 border-b border-chatgpt-border bg-white",children:(0,r.jsx)(i.I,{})}),(0,r.jsxs)("div",{className:"flex-grow container mx-auto px-4 py-8 max-w-6xl",children:[(0,r.jsxs)("div",{className:"bg-gray-50 rounded-lg shadow-sm border border-chatgpt-border p-6 text-center mb-6",children:[(0,r.jsx)("h1",{className:"text-2xl font-semibold text-chatgpt-text mb-2 font-inter",children:"Purchase Credits"}),(0,r.jsx)("p",{className:"text-sm text-chatgpt-muted font-inter",children:"Power your AI conversations with credits. Select a package below to get started."})]}),(0,r.jsxs)("section",{className:"bg-white rounded-lg shadow-sm border border-chatgpt-border p-6 mb-6",children:[(0,r.jsxs)("h2",{className:"text-xl font-semibold mb-4 text-chatgpt-text font-inter flex items-center",children:[(0,r.jsx)("svg",{className:"w-5 h-5 mr-2 text-bunny-500",fill:"currentColor",viewBox:"0 0 20 20",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})}),"How Credits Work"]}),(0,r.jsxs)("div",{className:"grid md:grid-cols-3 gap-4",children:[(0,r.jsxs)("div",{className:"flex items-start",children:[(0,r.jsx)("div",{className:"flex-shrink-0 bg-bunny-500 text-white rounded-full w-7 h-7 flex items-center justify-center text-sm font-semibold mr-3",children:"1"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"font-semibold text-chatgpt-text text-sm mb-1 font-inter",children:"Select Package"}),(0,r.jsx)("p",{className:"text-chatgpt-muted text-xs font-inter",children:"Choose the credit package that fits your needs"})]})]}),(0,r.jsxs)("div",{className:"flex items-start",children:[(0,r.jsx)("div",{className:"flex-shrink-0 bg-bunny-500 text-white rounded-full w-7 h-7 flex items-center justify-center text-sm font-semibold mr-3",children:"2"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"font-semibold text-chatgpt-text text-sm mb-1 font-inter",children:"Secure Payment"}),(0,r.jsx)("p",{className:"text-chatgpt-muted text-xs font-inter",children:"Complete purchase using PayPal (no redirect required)"})]})]}),(0,r.jsxs)("div",{className:"flex items-start",children:[(0,r.jsx)("div",{className:"flex-shrink-0 bg-bunny-500 text-white rounded-full w-7 h-7 flex items-center justify-center text-sm font-semibold mr-3",children:"3"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"font-semibold text-chatgpt-text text-sm mb-1 font-inter",children:"Start Using"}),(0,r.jsx)("p",{className:"text-chatgpt-muted text-xs font-inter",children:"Credits are added instantly - start chatting right away!"})]})]})]})]}),(0,r.jsxs)("section",{className:"bg-white rounded-lg shadow-sm border border-chatgpt-border p-6 mb-6",children:[(0,r.jsx)("h2",{className:"text-xl font-semibold mb-4 text-chatgpt-text font-inter",children:"Select Your Credit Package"}),(0,r.jsx)("div",{className:"grid md:grid-cols-4 gap-3 mb-6",children:h.map(e=>(0,r.jsxs)("button",{onClick:()=>s(e),className:"relative p-4 rounded-lg border transition-all font-inter ".concat(t.credits===e.credits?"border-bunny-500 bg-bunny-50 shadow-sm":"border-chatgpt-border hover:border-bunny-300 hover:bg-chatgpt-hover"),children:[e.popular&&(0,r.jsx)("div",{className:"absolute -top-2 left-1/2 transform -translate-x-1/2",children:(0,r.jsx)("span",{className:"bg-bunny-500 text-white text-xs font-semibold px-2 py-0.5 rounded-full",children:"POPULAR"})}),(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("div",{className:"text-2xl font-bold text-chatgpt-text mb-1",children:e.credits}),(0,r.jsx)("div",{className:"text-xs text-chatgpt-muted mb-2",children:"Credits"}),(0,r.jsxs)("div",{className:"text-xl font-bold text-bunny-600",children:["$",e.price]}),(0,r.jsxs)("div",{className:"text-xs text-chatgpt-muted mt-1",children:["$",(e.price/e.credits).toFixed(2),"/credit"]})]})]},e.credits))}),(0,r.jsx)("div",{className:"border-t border-chatgpt-border pt-6",children:(0,r.jsxs)("div",{className:"max-w-md mx-auto",children:[(0,r.jsxs)("div",{className:"bg-chatgpt-secondary rounded-lg p-4 mb-4 border border-chatgpt-border",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,r.jsx)("span",{className:"text-sm text-chatgpt-muted font-inter",children:"Selected Package:"}),(0,r.jsxs)("span",{className:"font-semibold text-chatgpt-text font-inter",children:[t.credits," Credits"]})]}),(0,r.jsxs)("div",{className:"flex justify-between items-center",children:[(0,r.jsx)("span",{className:"text-sm text-chatgpt-muted font-inter",children:"Total Amount:"}),(0,r.jsxs)("span",{className:"text-xl font-bold text-bunny-600 font-inter",children:["$",t.price]})]})]}),u&&(0,r.jsx)("div",{className:"mb-4 p-3 rounded-lg border font-inter ".concat("success"===u.type?"bg-green-50 text-green-800 border-green-200":"bg-red-50 text-red-800 border-red-200"),children:(0,r.jsxs)("div",{className:"flex items-start",children:["success"===u.type?(0,r.jsx)("svg",{className:"w-4 h-4 mr-2 mt
1-0.5",fill:"currentColor",viewBox:"0 0 20 20",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}):(0,r.jsx)("svg",{className:"w-4 h-4 mr-2 mt-0.5",fill:"currentColor",viewBox:"0 0 20 20",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})}),(0,r.jsx)("p",{className:"text-sm",children:u.text})]})}),(0,r.jsx)("div",{className:"bg-bunny-50 border border-bunny-200 rounded-lg p-3 mb-4",children:(0,r.jsxs)("div",{className:"flex items-start",children:[(0,r.jsx)("svg",{className:"w-4 h-4 text-bunny-600 mr-2 mt-0.5",fill:"currentColor",viewBox:"0 0 20 20",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})}),(0,r.jsxs)("div",{className:"text-sm text-bunny-800 font-inter",children:[(0,r.jsx)("p",{className:"font-semibold mb-1",children:"Payment Instructions:"}),(0,r.jsxs)("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[(0,r.jsx)("li",{children:"Click the PayPal button below"}),(0,r.jsx)("li",{children:"Log in to your PayPal account or pay as guest"}),(0,r.jsx)("li",{children:"Complete the payment securely through PayPal"}),(0,r.jsx)("li",{children:"Credits will be added to your account immediately"})]})]})]})}),n&&(0,r.jsxs)("div",{className:"text-center mb-4",children:[(0,r.jsx)("div",{className:"inline-block animate-spin rounded-full h-6 w-6 border-b-2 border-bunny-500"}),(0,r.jsx)("p",{className:"mt-2 text-sm text-chatgpt-muted font-inter",children:"Processing your payment..."})]}),(0,r.jsx)(d.Vv,{options:{clientId:x.env.NEXT_PUBLIC_PAYPAL_CLIENT_ID||"",currency:"USD"},children:(0,r.jsx)(d.ch,{style:{layout:"vertical",color:"gold",shape:"rect",label:"paypal"},createOrder:b,onApprove:f,onError:e=>{console.error("PayPal error:",e),p({type:"error",text:"There was an error processing your payment. Please try again."}),m(!1)},disabled:n})}),(0,r.jsx)("div",{className:"mt-3 text-center text-xs text-chatgpt-muted font-inter",children:(0,r.jsx)("p",{children:"\uD83D\uDD12 Secure payment powered by PayPal"})})]})})]}),(0,r.jsxs)("section",{className:"bg-white rounded-lg shadow-sm border border-chatgpt-border p-6",children:[(0,r.jsx)("h2",{className:"text-xl font-semibold mb-4 text-chatgpt-text font-inter",children:"Frequently Asked Questions"}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"font-semibold text-chatgpt-text text-sm mb-1 font-inter",children:"How quickly will I receive my credits?"}),(0,r.jsx)("p",{className:"text-chatgpt-muted text-xs font-inter",children:"Credits are added to your account immediately after payment confirmation."})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"font-semibold text-chatgpt-text text-sm mb-1 font-inter",children:"What payment methods do you accept?"}),(0,r.jsx)("p",{className:"text-chatgpt-muted text-xs font-inter",children:"We accept all major credit cards, debit cards, and PayPal accounts through our secure PayPal integration."})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"font-semibold text-chatgpt-text text-sm mb-1 font-inter",children:"Do credits expire?"}),(0,r.jsx)("p",{className:"text-chatgpt-muted text-xs font-inter",children:"No, your credits never expire. Use them whenever you're ready to chat with your AI agents."})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"font-semibold text-chatgpt-text text-sm mb-1 font-inter",children:"Can I get a refund?"}),(0,r.jsx)("p",{className:"text-chatgpt-muted text-xs font-inter",children:"Yes, we offer refunds for unused credits within 30 days of purchase. Contact support for assistance."})]})]})]})]}),(0,r.jsx)(o.Z,{})]})]})})}},function(e){e.O(0,[959,2090,5021,4100,2888,9774,179],function(){return e(e.s=3873)}),_N_E=e.O()}]);

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