import{b as j,j as e}from"./vendor-BKmmeuxg.js";import{I as l}from"./input-error-LaPr_4wd.js";import{L as u}from"./loading-button-BnTVAMJ7.js";import{S as o}from"./switch-Db09nqXX.js";import{C as g}from"./card-D9_SJYq6.js";import{I as d}from"./input-DM0goJrn.js";import{L as i}from"./label-HmIcv5Yx.js";import{S as v,a as b,b as y,c as _,d as c}from"./select-CD9o3HN1.js";import{o as n}from"./inertia-SZXqLvQm.js";import"./utils-DxSsnXxD.js";import"./button-BpNwv2aE.js";import"./index-WW_1X1qx.js";import"./switch-DFFqeub-.js";const A=({payment:m})=>{const{data:s,setData:r,post:h,errors:a,processing:x}=j({...m.fields,type:"stripe"}),p=t=>{t.preventDefault(),h(route("payouts.settings.update"))};return e.jsxs(g,{className:"p-4 sm:p-6",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-semibold",children:"Stripe Settings"}),e.jsx("p",{className:"text-gray-500",children:"Configure Stripe payment gateway"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(i,{htmlFor:"status",children:s.active?"Enabled":"Disabled"}),e.jsx(o,{id:"status",checked:s.active,onCheckedChange:t=>r("active",t)})]})]}),e.jsxs("form",{onSubmit:p,className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(i,{children:"Currency"}),e.jsxs(v,{value:s.currency,onValueChange:t=>r("currency",t),children:[e.jsx(b,{children:e.jsx(y,{placeholder:"Select Currency"})}),e.jsxs(_,{children:[e.jsx(c,{value:"USD",children:"US Dollar (USD)"}),e.jsx(c,{value:"EUR",children:"Euro (EUR)"}),e.jsx(c,{value:"GBP",children:"British Pound (GBP)"}),e.jsx(c,{value:"CAD",children:"Canadian Dollar (CAD)"}),e.jsx(c,{value:"AUD",children:"Australian Dollar (AUD)"}),e.jsx(c,{value:"JPY",children:"Japanese Yen (JPY)"})]})]}),e.jsx(l,{message:a.currency})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium",children:"Test Mode:"}),e.jsx(o,{id:"status",checked:s.test_mode,onCheckedChange:t=>r("test_mode",t)}),e.jsx(i,{htmlFor:"status",className:"text-gray-500",children:s.test_mode?"Using Test Keys":"Using Live Keys"})]})]}),e.jsxs("div",{className:`border-b pb-6 ${s.test_mode?"":"opacity-60"}`,children:[e.jsx("h3",{className:"mb-4 text-lg font-medium",children:"Test Credentials"}),e.jsxs("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-1",children:[e.jsxs("div",{children:[e.jsx(i,{children:"Public Test Key *"}),e.jsx(d,{name:"test_public_key",value:s.test_public_key||"",onChange:t=>n(t,r),placeholder:"Enter test public key",disabled:!s.test_mode}),e.jsx(l,{message:a.test_public_key})]}),e.jsxs("div",{children:[e.jsx(i,{children:"Secret Test Key *"}),e.jsx(d,{name:"test_secret_key",value:s.test_secret_key||"",onChange:t=>n(t,r),placeholder:"Enter test secret key",disabled:!s.test_mode,type:"password"}),e.jsx(l,{message:a.test_secret_key})]})]})]}),e.jsxs("div",{className:`border-b pb-6 ${s.test_mode?"opacity-60":""}`,children:[e.jsx("h3",{className:"mb-4 text-lg font-medium",children:"Live Credentials"}),e.jsxs("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-1",children:[e.jsxs("div",{children:[e.jsx(i,{children:"Public Live Key *"}),e.jsx(d,{name:"live_public_key",value:s.live_public_key||"",onChange:t=>n(t,r),placeholder:"Enter live public key",disabled:s.test_mode}),e.jsx(l,{message:a.live_public_key})]}),e.jsxs("div",{children:[e.jsx(i,{children:"Secret Live Key *"}),e.jsx(d,{name:"live_secret_key",value:s.live_secret_key||"",onChange:t=>n(t,r),placeholder:"Enter live secret key",disabled:s.test_mode,type:"password"}),e.jsx(l,{message:a.live_secret_key})]})]})]}),e.jsxs("div",{className:"border-b pb-6",children:[e.jsx("h3",{className:"mb-4 text-lg font-medium",children:"Webhook Settings"}),e.jsx("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-1",children:e.jsxs("div",{children:[e.jsx(i,{children:"Webhook Secret"}),e.jsx(d,{name:"webhook_secret",value:s.webhook_secret||"",onChange:t=>n(t,r),placeholder:"Enter webhook secret",type:"password"}),e.jsx(l,{message:a.webhook_secret}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Webhooks are used to handle events from Stripe like successful payments"})]})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-sm text-gray-500",children:s.active?"Stripe is currently enabled":"Stripe is currently disabled"}),e.jsx(u,{loading:x,children:"Save Changes"})]})]})]})};export{A as default};
