import{b as j,j as e}from"./vendor-BKmmeuxg.js";import{I as d}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 l}from"./input-DM0goJrn.js";import{L as r}from"./label-HmIcv5Yx.js";import{S as y,a as b,b as v,c as _,d as i}from"./select-CD9o3HN1.js";import{o as c}from"./inertia-SZXqLvQm.js";import"./utils-DxSsnXxD.js";import"./button-BpNwv2aE.js";import"./index-WW_1X1qx.js";import"./switch-DFFqeub-.js";const L=({payment:m})=>{const{data:s,setData:t,post:x,errors:n,processing:h}=j({...m.fields,type:"paypal"}),p=a=>{a.preventDefault(),x(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:"PayPal Settings"}),e.jsx("p",{className:"text-gray-500",children:"Configure PayPal payment gateway"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(r,{htmlFor:"status",children:s.active?"Enabled":"Disabled"}),e.jsx(o,{id:"status",checked:s.active,onCheckedChange:a=>t("active",a)})]})]}),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(r,{children:"Currency"}),e.jsxs(y,{value:s.currency,onValueChange:a=>t("currency",a),children:[e.jsx(b,{children:e.jsx(v,{placeholder:"Select Currency"})}),e.jsxs(_,{children:[e.jsx(i,{value:"USD",children:"US Dollar (USD)"}),e.jsx(i,{value:"EUR",children:"Euro (EUR)"}),e.jsx(i,{value:"GBP",children:"British Pound (GBP)"}),e.jsx(i,{value:"CAD",children:"Canadian Dollar (CAD)"}),e.jsx(i,{value:"AUD",children:"Australian Dollar (AUD)"}),e.jsx(i,{value:"JPY",children:"Japanese Yen (JPY)"})]})]}),e.jsx(d,{message:n.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:a=>t("test_mode",a)}),e.jsx(r,{htmlFor:"status",className:"text-gray-500",children:s.test_mode?"Using Sandbox Environment":"Using Production Environment"})]})]}),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:"Sandbox Credentials"}),e.jsxs("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-1",children:[e.jsxs("div",{children:[e.jsx(r,{children:"Client ID *"}),e.jsx(l,{name:"sandbox_client_id",value:s.sandbox_client_id||"",onChange:a=>c(a,t),placeholder:"Enter sandbox client ID",disabled:!s.test_mode}),e.jsx(d,{message:n.sandbox_client_id})]}),e.jsxs("div",{children:[e.jsx(r,{children:"Secret Key *"}),e.jsx(l,{name:"sandbox_secret_key",value:s.sandbox_secret_key||"",onChange:a=>c(a,t),placeholder:"Enter sandbox secret key",disabled:!s.test_mode,type:"password"}),e.jsx(d,{message:n.sandbox_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:"Production Credentials"}),e.jsxs("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-1",children:[e.jsxs("div",{children:[e.jsx(r,{children:"Client ID *"}),e.jsx(l,{name:"production_client_id",value:s.production_client_id||"",onChange:a=>c(a,t),placeholder:"Enter production client ID",disabled:s.test_mode}),e.jsx(d,{message:n.production_client_id})]}),e.jsxs("div",{children:[e.jsx(r,{children:"Secret Key *"}),e.jsx(l,{name:"production_secret_key",value:s.production_secret_key||"",onChange:a=>c(a,t),placeholder:"Enter production secret key",disabled:s.test_mode,type:"password"}),e.jsx(d,{message:n.production_secret_key})]})]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-sm text-gray-500",children:s.active?"PayPal is currently enabled":"PayPal is currently disabled"}),e.jsx(u,{loading:h,children:"Save Changes"})]})]})]})};export{L as default};