1import{X as N,G as _,j as e}from"./app-Mnt2IEGe.js";import{A as g}from"./AuthenticatedLayout-Dh41BUxo.js";import"./ApplicationLogo-JvKRx6b1.js";import"./ResponsiveNavLink-xYyYAnIm.js";import"./transition-caWIvkel.js";import"./chevron-down-BlAiga6f.js";const y=a=>`â¹${Number(a||0).toFixed(2)}`;function D({transactions:a,settings:t}){var u,h;const{props:l}=N(),p=(u=l==null?void 0:l.auth)==null?void 0:u.user,o=(a==null?void 0:a.data)||[],i=(a==null?void 0:a.links)||[],c=((h=l==null?void 0:l.flash)==null?void 0:h.status)||"",{data:r,setData:n,patch:j,processing:m,errors:d}=_({signup_bonus_enabled:(t==null?void 0:t.signup_bonus_enabled)??!0,signup_bonus_amount:(t==null?void 0:t.signup_bonus_amount)??50,referral_bonus_enabled:(t==null?void 0:t.referral_bonus_enabled)??!0,referral_bonus_amount:(t==null?void 0:t.referral_bonus_amount)??100}),f=s=>{s.preventDefault(),j(route("admin.wallet.settings"),{preserveScroll:!0})};return e.jsx(g,{user:p,header:e.jsx("h1",{className:"text-xl font-bold px-4 py-4",children:"Wallet Transactions"}),children:e.jsxs("div",{className:"px-4 pb-8 space-y-6",children:[e.jsxs("form",{onSubmit:f,className:"bg-white border border-slate-200 rounded-3xl shadow-sm p-6 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-slate-900",children:"Wallet Offers"}),e.jsx("p",{className:"text-xs text-slate-500",children:"Configure automatic signup credits and referral rewards. Disable an offer by toggling it off or setting the amount to zero."})]}),e.jsx("button",{type:"submit",disabled:m,className:"inline-flex items-center gap-2 rounded-full bg-indigo-600 px-4 py-2 text-sm font-semibold text-white shadow hover:bg-indigo-700 disabled:bg-indigo-300",children:m?"Savingâ¦":"Save Changes"})]}),c&&e.jsx("div",{className:"rounded-2xl border border-emerald-200 bg-emerald-50 px-4 py-2 text-sm text-emerald-700",children:c}),e.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[e.jsxs("div",{className:"rounded-2xl border border-slate-200 p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-slate-800",children:"Signup Bonus"}),e.jsx("p",{className:"text-xs text-slate-500",children:"Credit new customers when they join Haslab"})]}),e.jsxs("label",{className:"inline-flex items-center gap-2 text-sm text-slate-600",children:[e.jsx("input",{type:"checkbox",checked:!!r.signup_bonus_enabled,onChange:s=>n("signup_bonus_enabled",s.target.checked)}),"Enable"]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs uppercase tracking-wide text-slate-400",children:"Amount (â¹)"}),e.jsx("input",{type:"number",min:"0",step:"0.01",value:r.signup_bonus_amount,onChange:s=>n("signup_bonus_amount",Number(s.target.value)),className:"mt-1 w-full rounded-xl border border-slate-200 px-3 py-2",disabled:!r.signup_bonus_enabled}),d.signup_bonus_amount&&e.jsx("p",{className:"mt-1 text-xs text-rose-600",children:d.signup_bonus_amount})]})]}),e.jsxs("div",{className:"rounded-2xl border border-slate-200 p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-slate-800",children:"Referral Bonus"}),e.jsx("p",{className:"text-xs text-slate-500",children:"Reward referrers when their invitees place online orders."})]}),e.jsxs("label",{className:"inline-flex items-center gap-2 text-sm text-slate-600",children:[e.jsx("input",{type:"checkbox",checked:!!r.referral_bonus_enabled,onChange:s=>n("referral_bonus_enabled",s.target.checked)}),"Enable"]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs uppercase tracking-wide text-slate-400",children:"Amount (â¹)"}),e.jsx("input",{type:"number",min:"0",step:"0.01",value:r.referral_bonus_amount,onChange:s=>n("referral_bonus_amount",Number(s.target.value)),className:"mt-1 w-full rounded-xl border border-slate-200 px-3 py-2",disabled:!r.referral_bonus_enabled}),d.referral_bonus_amount&&e.jsx("p",{className:"mt-1 text-xs text-rose-600",children:d.referral_bonus_amount})]})]})]})]}),e.jsx("div",{className:"bg-white border border-slate-200 rounded-3xl shadow-sm overflow-hidden",children:e.jsxs("table",{className:"min-w-full text-sm text-slate-600",children:[e.jsx("thead",{className:"bg-slate-50 uppercase text-xs text-slate-400",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-3 text-left",children:"User"}),e.jsx("th",{className:"px-4 py-3 text-left",children:"Tag"}),e.jsx("th",{className:"px-4 py-3 text-left",children:"Meta"}),e.jsx("th",{className:"px-4 py-3 text-right",children:"Amount"}),e.jsx("th",{className:"px-4 py-3 text-left",children:"Date"})]})}),e.jsxs("tbody",{children:[o.map(s=>{var x,b;return e.jsxs("tr",{className:"border-t border-slate-100",children:[e.jsxs("td",{className:"px-4 py-3",children:[e.jsx("div",{className:"font-semibold text-slate-800",children:((x=s.user)==null?void 0:x.name)||"Guest"}),e.jsx("div",{className:"text-xs text-slate-500",children:((b=s.user)==null?void 0:b.email)||"â"})]}),e.jsx("td",{className:"px-4 py-3 text-slate-600",children:s.tag}),e.jsx("td",{className:"px-4 py-3 text-xs text-slate-500",children:s.meta?JSON.stringify(s.meta):"â"}),e.jsx("td",{className:`px-4 py-3 text-right font-semibold ${Number(s.amount)>=0?"text-emerald-600":"text-rose-600"}`,children:y(s.amount)}),e.jsx("td",{className:"px-4 py-3 text-xs text-slate-500",children:new Date(s.created_at).toLocaleStr
1ing()})]},s.id)}),o.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:"5",className:"px-4 py-6 text-center text-sm text-slate-500",children:"No wallet activity yet."})})]})]})}),i.length>1&&e.jsx("nav",{className:"flex flex-wrap gap-2",children:i.map((s,x)=>e.jsx("a",{href:s.url||"#",className:`px-4 py-2 rounded-full text-sm ${s.active?"bg-indigo-600 text-white shadow":s.url?"bg-white border border-slate-200 text-slate-600 hover:border-indigo-200":"bg-slate-100 text-slate-400 cursor-not-allowed"}`,dangerouslySetInnerHTML:{__html:s.label}},x))})]})})}export{D as default};
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.