import{r as e}from"./chunk-DECur_0Z.js";import{t}from"./react-CO2uhaBc.js";import{As as n,Ds as r,Fs as i,Ms as a,Ns as o,Os as s,Ps as c,em as l,js as u,ks as d}from"./messages-Bp0bCjzp.js";import{r as f}from"./route-Bin9ihv_.js";import{d as p,n as m,o as h,r as g,s as _}from"./data-table-C3Nm2K6Z.js";import{t as v}from"./badge-BP05f1dq.js";import{t as y}from"./use-table-url-state-DP0Y4QjR.js";var b=e(t(),1),x=l(),S=[{name:`GMPay`,entries:[{method:`POST`,path:`/payments/gmpay/v1/order/create-transaction`}],requestFields:[`order_id`,`currency`,`token`,`network`,`amount`,`notify_url`,`signature`,`redirect_url?`,`name?`,`payment_type?`],callbackNote:d()},{name:`EPay Compatible`,entries:[{method:`POST`,path:`/payments/epay/v1/order/create-transaction/submit.php`},{method:`GET`,path:`/payments/epay/v1/order/create-transaction/submit.php`}],requestFields:[`pid`,`money`,`out_trade_no`,`notify_url`,`return_url?`,`name?`,`type?`,`sign`,`sign_type?`],callbackNote:s()},{name:`OKPay`,entries:[{method:`POST`,path:`/payments/okpay/v1/notify`}],requestFields:[`OkPay notify payload`],callbackNote:r()}];function C({method:e}){return(0,x.jsx)(v,{className:e===`GET`?`rounded border border-blue-500/30 bg-blue-500/10 font-mono text-blue-600 dark:text-blue-400`:`rounded border border-emerald-500/30 bg-emerald-500/10 font-mono text-emerald-600 dark:text-emerald-400`,variant:`outline`,children:e})}function w({field:e}){return(0,x.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-foreground text-xs`,children:e})}function T({item:e}){let t=e.entries.reduce((e,t)=>(e[t.path]||(e[t.path]=[]),e[t.path].push(t.method),e),{});return(0,x.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:Object.entries(t).map(([e,t])=>(0,x.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,x.jsx)(`div`,{className:`flex gap-1.5`,children:t.map(e=>(0,x.jsx)(C,{method:e},e))}),(0,x.jsx)(`code`,{className:`whitespace-normal break-words font-mono text-sm`,children:e})]},e))})}function E({fields:e}){return(0,x.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.map(e=>(0,x.jsx)(w,{field:e},e))})}var D=f(`/_authenticated/payment-setup/integrations`);function O(){let{pagination:e,onPaginationChange:t,ensurePageInRange:r}=y({search:D.useSearch(),navigate:D.useNavigate(),pagination:{defaultPage:1,defaultPageSize:10}}),s=h({data:S,columns:(0,b.useMemo)(()=>[{accessorKey:`name`,header:o(),cell:({row:e})=>(0,x.jsx)(`span`,{className:`font-medium`,children:e.original.name})},{accessorKey:`entries`,header:a(),cell:({row:e})=>(0,x.jsx)(T,{item:e.original})},{accessorKey:`requestFields`,header:u(),cell:({row:e})=>(0,x.jsx)(E,{fields:e.original.requestFields})},{accessorKey:`callbackNote`,header:n(),cell:({row:e})=>(0,x.jsx)(`span`,{className:`whitespace-normal break-words text-muted-foreground text-sm`,children:e.original.callbackNote})}],[]),state:{pagination:e},onPaginationChange:t,getCoreRowModel:_(),getPaginationRowModel:p()});return(0,b.useEffect)(()=>{r(s.getPageCount())},[s,r]),(0,x.jsxs)(`div`,{className:`flex flex-1 flex-col gap-4`,children:[(0,x.jsxs)(`div`,{className:`space-y-1`,children:[(0,x.jsx)(`h3`,{className:`font-semibold text-lg`,children:i()}),(0,x.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:c()})]}),(0,x.jsx)(g,{table:s}),(0,x.jsx)(m,{className:`mt-auto`,table:s})]})}function k(){return(0,x.jsx)(O,{})}var A=k;export{A as component};