module.exports=[9529,a=>{"use strict";var b=a.i(87924);function c(...a){return a.filter(Boolean).join(" ")}a.i(38246);let d={primary:"bg-brand-green text-white hover:bg-brand-green-deep focus-visible:ring-brand-green",secondary:"border border-be-border bg-be-surface text-be-text hover:bg-be-surface-2 focus-visible:ring-brand-green",ghost:"text-be-muted hover:text-be-text hover:bg-be-surface-2 focus-visible:ring-brand-green",danger:"bg-[color:var(--pill-danger-fg)] text-white hover:opacity-90 focus-visible:ring-[color:var(--pill-danger-fg)]"};a.s(["Card",0,function({className:a,children:d}){return(0,b.jsx)("div",{className:c("be-card p-5",a),children:d})},"buttonClass",0,function(a="primary",b){return c("inline-flex items-center justify-center gap-1.5 rounded-lg px-4 py-2 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-be-bg disabled:opacity-50 disabled:pointer-events-none",d[a],b)}])},20040,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(50944),e=a.i(9529);a.s(["default",0,function(){let a=(0,d.useRouter)(),[f,g]=(0,c.useState)(""),[h,i]=(0,c.useState)(""),[j,k]=(0,c.useState)(null),[l,m]=(0,c.useState)(!1);async function n(b){b.preventDefault();let c=Math.round(100*Number(f));if(!Number.isFinite(c)||c<=0)return void k("Enter a valid amount");k(null),m(!0);let d=await fetch("/api/financing/request",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({amountCents:c,note:h.trim()||void 0})}),e=await d.json().catch(()=>({}));(m(!1),d.ok)?a.refresh():k(e.error||"Request failed")}return(0,b.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-sm font-medium mb-1 text-be-text",children:"Amount (KES)"}),(0,b.jsx)("input",{required:!0,type:"number",min:"1",step:"1",placeholder:"500000",value:f,onChange:a=>g(a.target.value),className:"input"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-sm font-medium mb-1 text-be-text",children:"What's it for? (optional)"}),(0,b.jsx)("textarea",{rows:3,placeholder:"Working capital for next event's venue deposit",value:h,onChange:a=>i(a.target.value),className:"input"})]}),j&&(0,b.jsx)("p",{className:"text-sm text-[color:var(--pill-danger-fg)]",children:j}),(0,b.jsx)("button",{type:"submit",disabled:l,className:(0,e.buttonClass)("primary"),children:l?"Requesting…":"Request funds"}),(0,b.jsx)("p",{className:"text-xs text-be-muted",children:"Repayment is a flat 12% of each future payout until the advance is repaid. Approval typically takes under 48h."})]})}])}];

//# sourceMappingURL=src_1r99tmb._.js.map