spaark-payapi-sdk 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -18,13 +18,24 @@ pnpm add spaark-payapi-sdk
18
18
  yarn add spaark-payapi-sdk
19
19
  ```
20
20
 
21
- ### For React Components
21
+ ### For React Components (shadcn/ui)
22
22
 
23
- The SDK includes React components that require additional peer dependencies:
23
+ The SDK includes React components built with shadcn/ui patterns. Install the required peer dependencies:
24
24
 
25
25
  ```bash
26
- # Required for React components
27
- npm install react react-dom lucide-react @radix-ui/react-tabs @radix-ui/react-select @radix-ui/react-dialog
26
+ # Core React dependencies
27
+ npm install react react-dom
28
+
29
+ # shadcn/ui prerequisites (via shadcn CLI)
30
+ pnpm dlx shadcn@latest add button
31
+ pnpm dlx shadcn@latest add tabs
32
+ pnpm dlx shadcn@latest add select
33
+ pnpm dlx shadcn@latest add chart
34
+ pnpm dlx shadcn@latest add skeleton
35
+ pnpm dlx shadcn@latest add spinner
36
+
37
+ # Or install manually
38
+ npm install lucide-react @radix-ui/react-tabs @radix-ui/react-select @radix-ui/react-dialog recharts @tanstack/react-table
28
39
 
29
40
  # The following are bundled with the SDK (no need to install):
30
41
  # - clsx
@@ -32,6 +43,8 @@ npm install react react-dom lucide-react @radix-ui/react-tabs @radix-ui/react-se
32
43
  # - class-variance-authority
33
44
  ```
34
45
 
46
+ > **Note**: The components use shadcn/ui styling conventions. Make sure your project has Tailwind CSS configured with the shadcn/ui theme variables.
47
+
35
48
  ## Quick Start
36
49
 
37
50
  ```typescript
@@ -61,7 +74,9 @@ console.log(deposit.depositId, deposit.status);
61
74
  - **Toolkit**: Predict Provider, Active Configuration, Provider Availability
62
75
  - **Finances**: Wallet Balances, Statement Generation
63
76
  - **Webhooks**: Signature verification, Event parsing
64
- - **React Components**: Test dashboard + Finance dashboard
77
+ - **React Components**: Test Dashboard + Finance Dashboard with Charts
78
+ - **shadcn/ui**: Button, Tabs, Select, Card, Input components
79
+ - **Charts**: Area, Bar, Pie charts with recharts
65
80
  - **Full TypeScript**: Complete type definitions
66
81
  - **i18n**: French/English support
67
82
 
@@ -348,45 +363,106 @@ export default function FinancePage() {
348
363
  return (
349
364
  <SpaarkPaySdkFinanceDashboard
350
365
  transactions={transactions}
351
- title="My Finance Dashboard" // Customizable
352
- locale="fr" // 'fr' | 'en'
353
- onRefresh={() => fetchData()} // Refresh button handler
354
- onTransactionClick={(tx) => {}} // Row click handler
355
- onExpertModeClick={() => {}} // Expert mode button
356
- showExpertMode={true} // Show/hide expert button
357
- isLoading={false} // Loading state
366
+ title="My Finance Dashboard"
367
+ subtitle="Overview of your transactions"
368
+ locale="fr" // 'fr' | 'en'
369
+ onRefresh={() => fetchData()} // Refresh button
370
+ onSettings={() => openSettings()} // Settings button (gear icon)
371
+ onAddTransaction={() => openForm()} // CTA when empty
372
+ onTransactionClick={(tx) => {}} // Row click
373
+ onExpertModeClick={() => {}} // Expert mode button
374
+ showExpertMode={true}
375
+ isLoading={false}
358
376
  />
359
377
  );
360
378
  }
361
379
  ```
362
380
 
381
+ **Props:**
382
+
383
+ | Prop | Type | Description |
384
+ |------|------|-------------|
385
+ | `transactions` | `Transaction[]` | Array of transactions to display |
386
+ | `title` | `string` | Dashboard title (default: "Tableau de bord financier") |
387
+ | `subtitle` | `string` | Dashboard subtitle |
388
+ | `locale` | `'fr' \| 'en'` | Language (default: 'fr') |
389
+ | `onRefresh` | `() => void` | Refresh button callback |
390
+ | `onSettings` | `() => void` | Settings button callback (gear icon) |
391
+ | `onAddTransaction` | `() => void` | CTA button callback when no transactions |
392
+ | `onTransactionClick` | `(tx) => void` | Table row click callback |
393
+ | `onExpertModeClick` | `() => void` | Expert mode button callback |
394
+ | `showExpertMode` | `boolean` | Show/hide expert mode button |
395
+ | `isLoading` | `boolean` | Show loading spinner |
396
+
363
397
  **Features:**
364
- - 5 KPI cards (Total Volume, Deposits, Payouts, Failed, Refunds)
398
+
399
+ **Dashboard Tab:**
400
+ - 8 KPI cards in 2 rows:
401
+ - Row 1: Total Volume, Deposits, Payouts, Refunds
402
+ - Row 2: Pending, Completed, Failed, Cancelled
365
403
  - Search by transaction ID or phone number
366
- - Filter by type (deposit/payout/refund) and status
367
- - Paginated transactions table
368
- - Copy transaction ID to clipboard
369
- - i18n support (French/English)
370
- - Customizable title
371
- - Expert Mode button integration
404
+ - Dropdown filters (shadcn/ui Select) for type and status
405
+ - Paginated transactions table with copy ID button
406
+ - Empty state with CTA button
407
+
408
+ **Charts Tab:**
409
+ - Area Chart: Volume over time (deposits vs payouts)
410
+ - Bar Chart: Transaction amounts by type
411
+ - Pie Chart: Status distribution (donut style)
412
+
413
+ **UI Components (shadcn/ui style):**
414
+ - Button (default, outline, ghost, secondary variants)
415
+ - Tabs (Dashboard / Charts)
416
+ - Select with dropdown
417
+ - Card with header and content
418
+ - Input with search icon
419
+ - Spinner for loading states
420
+
421
+ **i18n:**
422
+ - French (default) and English support
423
+ - All labels, buttons, and chart legends translated
372
424
 
373
425
  ## TypeScript Types
374
426
 
375
427
  ```typescript
376
428
  import type {
429
+ // SDK Config
377
430
  SpaarkPayApiSdkConfig,
431
+
432
+ // Transactions
378
433
  DepositRequest,
379
434
  DepositResponse,
380
435
  PayoutRequest,
381
436
  PayoutResponse,
382
437
  TransactionStatus,
383
438
  TransactionStatusResponse,
439
+
440
+ // Providers
384
441
  Correspondent,
385
442
  Currency,
443
+
444
+ // React Components
386
445
  Transaction,
387
446
  TransactionType,
388
- // ... and more
447
+ TransactionStatus,
448
+ SpaarkPaySdkFinanceDashboardProps,
449
+ SpaarkPaySdkTestDashboardProps,
389
450
  } from 'spaark-payapi-sdk';
451
+
452
+ // Transaction type for Finance Dashboard
453
+ type Transaction = {
454
+ id: string;
455
+ type: 'deposit' | 'payout' | 'refund';
456
+ amount: number;
457
+ currency: string;
458
+ status: 'ACCEPTED' | 'PENDING' | 'ENQUEUED' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'REJECTED';
459
+ provider: Correspondent;
460
+ phoneNumber: string;
461
+ description?: string;
462
+ createdAt: string;
463
+ updatedAt?: string;
464
+ failureReason?: string;
465
+ };
390
466
  ```
391
467
 
392
468
  ## Error Handling
package/dist/react.js CHANGED
@@ -1,7 +1,7 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var react=require('react'),G=require('@radix-ui/react-tabs'),k=require('@radix-ui/react-select'),lucideReact=require('lucide-react'),recharts=require('recharts'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var G__namespace=/*#__PURE__*/_interopNamespace(G);var k__namespace=/*#__PURE__*/_interopNamespace(k);var re=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,s=>{let l=Math.random()*16|0;return (s==="x"?l:l&3|8).toString(16)});function jt(s,l={}){let{transactionId:c=re(),amount:N="5000",currency:f="XAF",correspondent:I="MTN_MOMO_CMR",phoneNumber:j="237670000000",status:v=s==="deposit.failed"?"FAILED":"COMPLETED",failureCode:p="INSUFFICIENT_FUNDS",failureMessage:H="The payer has insufficient funds"}=l,u=new Date().toISOString(),w={depositId:c,status:v,amount:N,currency:f,correspondent:I,payer:{type:"MSISDN",address:{value:j}},customerTimestamp:u,created:u};return v==="COMPLETED"&&(w.receivedByPayer=u),v==="FAILED"&&(w.failureReason={failureCode:p,failureMessage:H}),{eventId:re(),eventType:s,timestamp:u,data:w}}function _t(s,l={}){let{transactionId:c=re(),amount:N="5000",currency:f="XAF",correspondent:I="MTN_MOMO_CMR",phoneNumber:j="237670000000",status:v=s==="payout.failed"?"FAILED":"COMPLETED",failureCode:p="RECIPIENT_NOT_FOUND",failureMessage:H="The recipient account was not found"}=l,u=new Date().toISOString(),w={payoutId:c,status:v,amount:N,currency:f,correspondent:I,recipient:{type:"MSISDN",address:{value:j}},customerTimestamp:u,created:u};return v==="COMPLETED"&&(w.receivedByRecipient=u),v==="FAILED"&&(w.failureReason={failureCode:p,failureMessage:H}),{eventId:re(),eventType:s,timestamp:u,data:w}}function Gt(s,l={}){let{transactionId:c=re(),depositId:N=re(),amount:f="5000",currency:I="XAF",correspondent:j="MTN_MOMO_CMR",phoneNumber:v="237670000000",status:p=s==="refund.failed"?"FAILED":"COMPLETED",failureCode:H="REFUND_LIMIT_EXCEEDED",failureMessage:u="The refund limit has been exceeded"}=l,w=new Date().toISOString(),i={refundId:c,depositId:N,status:p,amount:f,currency:I,correspondent:j,recipient:{type:"MSISDN",address:{value:v}},created:w};return p==="FAILED"&&(i.failureReason={failureCode:H,failureMessage:u}),{eventId:re(),eventType:s,timestamp:w,data:i}}function Je(s,l={}){return s.startsWith("deposit.")?jt(s,l):s.startsWith("payout.")?_t(s,l):Gt(s,l)}var Ke=["deposit.accepted","deposit.completed","deposit.failed","payout.accepted","payout.completed","payout.failed","refund.completed","refund.failed"];function T(...s){return tailwindMerge.twMerge(clsx.clsx(s))}var da={fr:{title:"Tableau de bord financier",subtitle:"Vue d'ensemble de vos transactions",totalVolume:"Volume Total",deposits:"D\xE9p\xF4ts",payouts:"Retraits",failed:"\xC9checs",refunds:"Remboursements",pending:"En attente",completed:"Compl\xE9t\xE9es",cancelled:"Annul\xE9es",search:"Rechercher par ID ou t\xE9l\xE9phone...",allTypes:"Tous les types",allStatuses:"Tous les statuts",deposit:"D\xE9p\xF4t",payout:"Retrait",refund:"Remboursement",expertMode:"Mode Expert",refresh:"Actualiser",settings:"Param\xE8tres",noTransactions:"Aucune transaction",noTransactionsDesc:"Les transactions appara\xEEtront ici une fois effectu\xE9es.",addTransaction:"Nouvelle transaction",id:"ID",type:"Type",amount:"Montant",status:"Statut",provider:"Op\xE9rateur",phone:"T\xE9l\xE9phone",date:"Date",page:"Page",of:"sur",transactions:"transactions",copied:"Copi\xE9 !",dashboard:"Tableau de bord",charts:"Graphiques",volumeOverTime:"Volume dans le temps",transactionsByType:"Par type",statusDistribution:"Par statut",noDataForCharts:"Pas de donn\xE9es pour les graphiques"},en:{title:"Finance Dashboard",subtitle:"Overview of your transactions",totalVolume:"Total Volume",deposits:"Deposits",payouts:"Payouts",failed:"Failed",refunds:"Refunds",pending:"Pending",completed:"Completed",cancelled:"Cancelled",search:"Search by ID or phone...",allTypes:"All types",allStatuses:"All statuses",deposit:"Deposit",payout:"Payout",refund:"Refund",expertMode:"Expert Mode",refresh:"Refresh",settings:"Settings",noTransactions:"No transactions",noTransactionsDesc:"Transactions will appear here once made.",addTransaction:"New transaction",id:"ID",type:"Type",amount:"Amount",status:"Status",provider:"Provider",phone:"Phone",date:"Date",page:"Page",of:"of",transactions:"transactions",copied:"Copied!",dashboard:"Dashboard",charts:"Charts",volumeOverTime:"Volume over time",transactionsByType:"By type",statusDistribution:"By status",noDataForCharts:"No data for charts"}},la={COMPLETED:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",ACCEPTED:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",PENDING:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",ENQUEUED:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",PROCESSING:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",FAILED:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",CANCELLED:"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200",REJECTED:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"},D={deposit:"#22c55e",payout:"#3b82f6",refund:"#f97316",COMPLETED:"#22c55e",PENDING:"#eab308",FAILED:"#ef4444",CANCELLED:"#6b7280"},ee=react.forwardRef(({className:s,variant:l="default",size:c="default",...N},f)=>jsxRuntime.jsx("button",{ref:f,className:T("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{"bg-primary text-primary-foreground hover:bg-primary/90":l==="default","border border-input bg-background hover:bg-accent hover:text-accent-foreground":l==="outline","hover:bg-accent hover:text-accent-foreground":l==="ghost","bg-secondary text-secondary-foreground hover:bg-secondary/80":l==="secondary"},{"h-10 px-4 py-2":c==="default","h-9 rounded-md px-3":c==="sm","h-11 rounded-md px-8":c==="lg","h-10 w-10":c==="icon"},s),...N}));ee.displayName="Button";var ca=G__namespace.Root,lt=react.forwardRef(({className:s,...l},c)=>jsxRuntime.jsx(G__namespace.List,{ref:c,className:T("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...l}));lt.displayName=G__namespace.List.displayName;var Ae=react.forwardRef(({className:s,...l},c)=>jsxRuntime.jsx(G__namespace.Trigger,{ref:c,className:T("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",s),...l}));Ae.displayName=G__namespace.Trigger.displayName;var Re=react.forwardRef(({className:s,...l},c)=>jsxRuntime.jsx(G__namespace.Content,{ref:c,className:T("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...l}));Re.displayName=G__namespace.Content.displayName;var ot=k__namespace.Root,st=k__namespace.Value,Oe=react.forwardRef(({className:s,children:l,...c},N)=>jsxRuntime.jsxs(k__namespace.Trigger,{ref:N,className:T("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s),...c,children:[l,jsxRuntime.jsx(k__namespace.Icon,{asChild:true,children:jsxRuntime.jsx(lucideReact.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Oe.displayName=k__namespace.Trigger.displayName;var Le=react.forwardRef(({className:s,children:l,position:c="popper",...N},f)=>jsxRuntime.jsx(k__namespace.Portal,{children:jsxRuntime.jsx(k__namespace.Content,{ref:f,className:T("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",c==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",s),position:c,...N,children:jsxRuntime.jsx(k__namespace.Viewport,{className:T("p-1",c==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:l})})}));Le.displayName=k__namespace.Content.displayName;var M=react.forwardRef(({className:s,children:l,...c},N)=>jsxRuntime.jsxs(k__namespace.Item,{ref:N,className:T("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...c,children:[jsxRuntime.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(k__namespace.ItemIndicator,{children:jsxRuntime.jsx(lucideReact.Check,{className:"h-4 w-4"})})}),jsxRuntime.jsx(k__namespace.ItemText,{children:l})]}));M.displayName=k__namespace.Item.displayName;var S=react.forwardRef(({className:s,...l},c)=>jsxRuntime.jsx("div",{ref:c,className:T("rounded-lg border bg-card text-card-foreground shadow-sm",s),...l}));S.displayName="Card";var O=react.forwardRef(({className:s,...l},c)=>jsxRuntime.jsx("div",{ref:c,className:T("flex flex-col space-y-1.5 p-6",s),...l}));O.displayName="CardHeader";var ye=react.forwardRef(({className:s,...l},c)=>jsxRuntime.jsx("h3",{ref:c,className:T("text-lg font-semibold leading-none tracking-tight",s),...l}));ye.displayName="CardTitle";var L=react.forwardRef(({className:s,...l},c)=>jsxRuntime.jsx("div",{ref:c,className:T("p-6 pt-0",s),...l}));L.displayName="CardContent";var ct=react.forwardRef(({className:s,type:l,...c},N)=>jsxRuntime.jsx("input",{type:l,className:T("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s),ref:N,...c}));ct.displayName="Input";var ut=({className:s})=>jsxRuntime.jsxs("svg",{className:T("animate-spin",s),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),ua=({status:s})=>{switch(s){case "COMPLETED":return jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3.5 h-3.5"});case "FAILED":case "REJECTED":return jsxRuntime.jsx(lucideReact.XCircle,{className:"w-3.5 h-3.5"});case "CANCELLED":return jsxRuntime.jsx(lucideReact.Ban,{className:"w-3.5 h-3.5"});case "PENDING":case "ENQUEUED":return jsxRuntime.jsx(lucideReact.Clock,{className:"w-3.5 h-3.5"});case "PROCESSING":case "ACCEPTED":return jsxRuntime.jsx(ut,{className:"w-3.5 h-3.5"});default:return jsxRuntime.jsx(lucideReact.AlertCircle,{className:"w-3.5 h-3.5"})}},le=(s,l)=>new Intl.NumberFormat("fr-FR",{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0}).format(s)+" "+l,ma=(s,l)=>{let c=new Date(s);return new Intl.DateTimeFormat(l==="fr"?"fr-FR":"en-US",{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(c)},Ie=10;function pa({transactions:s,title:l,subtitle:c,locale:N="fr",className:f="",showExpertMode:I=true,onExpertModeClick:j,onTransactionClick:v,onRefresh:p,onAddTransaction:H,onSettings:u,isLoading:w=false}){let i=da[N],[V,h]=react.useState(""),[ae,E]=react.useState("all"),[_,A]=react.useState("all"),[z,R]=react.useState(1),[pe,J]=react.useState(null),[ge,Y]=react.useState("dashboard"),C=react.useMemo(()=>{let n=s.filter(b=>b.type==="deposit"),m=s.filter(b=>b.type==="payout"),$=s.filter(b=>b.type==="refund"),se=s.filter(b=>b.status==="FAILED"||b.status==="REJECTED"),P=s.filter(b=>["PENDING","ENQUEUED","PROCESSING","ACCEPTED"].includes(b.status)),X=s.filter(b=>b.status==="COMPLETED"),ne=s.filter(b=>b.status==="CANCELLED"),Ce=s.filter(b=>b.status==="COMPLETED").reduce((b,B)=>b+B.amount,0),fe=n.filter(b=>b.status==="COMPLETED").reduce((b,B)=>b+B.amount,0),ke=m.filter(b=>b.status==="COMPLETED").reduce((b,B)=>b+B.amount,0),be=$.filter(b=>b.status==="COMPLETED").reduce((b,B)=>b+B.amount,0);return {totalVolume:Ce,depositsCount:n.length,depositsTotal:fe,payoutsCount:m.length,payoutsTotal:ke,failedCount:se.length,refundsCount:$.length,refundsTotal:be,pendingCount:P.length,completedCount:X.length,cancelledCount:ne.length}},[s]),K=react.useMemo(()=>{let n={};s.forEach(P=>{let X=new Date(P.createdAt).toLocaleDateString(N==="fr"?"fr-FR":"en-US",{day:"2-digit",month:"short"});n[X]||(n[X]={date:X,deposits:0,payouts:0,refunds:0}),P.status==="COMPLETED"&&(n[X][P.type==="deposit"?"deposits":P.type==="payout"?"payouts":"refunds"]+=P.amount);});let m=Object.values(n).slice(-7),$=[{name:i.deposit,value:C.depositsTotal,count:C.depositsCount,fill:D.deposit},{name:i.payout,value:C.payoutsTotal,count:C.payoutsCount,fill:D.payout},{name:i.refund,value:C.refundsTotal,count:C.refundsCount,fill:D.refund}],se=[{name:"Completed",value:C.completedCount,fill:D.COMPLETED},{name:"Pending",value:C.pendingCount,fill:D.PENDING},{name:"Failed",value:C.failedCount,fill:D.FAILED},{name:"Cancelled",value:C.cancelledCount,fill:D.CANCELLED}].filter(P=>P.value>0);return {volumeData:m,typeData:$,statusData:se}},[s,C,N,i]),oe=react.useMemo(()=>s.filter(n=>{let m=V===""||n.id.toLowerCase().includes(V.toLowerCase())||n.phoneNumber.includes(V),$=ae==="all"||n.type===ae,se=_==="all"||n.status===_;return m&&$&&se}),[s,V,ae,_]),U=react.useMemo(()=>{let n=(z-1)*Ie;return oe.slice(n,n+Ie)},[oe,z]),q=Math.ceil(oe.length/Ie),ce=react.useCallback(n=>{navigator.clipboard.writeText(n),J(n),setTimeout(()=>J(null),2e3);},[]),Z=s[0]?.currency||"XAF";return jsxRuntime.jsxs("div",{className:T("space-y-6",f),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:l||i.title}),jsxRuntime.jsx("p",{className:"text-muted-foreground mt-1",children:c||i.subtitle})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[p&&jsxRuntime.jsxs(ee,{variant:"outline",size:"sm",onClick:p,disabled:w,children:[jsxRuntime.jsx(lucideReact.RefreshCw,{className:T("w-4 h-4",w&&"animate-spin")}),i.refresh]}),u&&jsxRuntime.jsx(ee,{variant:"outline",size:"icon",onClick:u,title:i.settings,children:jsxRuntime.jsx(lucideReact.Settings,{className:"w-4 h-4"})}),I&&j&&jsxRuntime.jsx(ee,{onClick:j,children:i.expertMode})]})]}),jsxRuntime.jsxs(ca,{value:ge,onValueChange:Y,children:[jsxRuntime.jsxs(lt,{children:[jsxRuntime.jsxs(Ae,{value:"dashboard",className:"gap-2",children:[jsxRuntime.jsx(lucideReact.LayoutDashboard,{className:"w-4 h-4"}),i.dashboard]}),jsxRuntime.jsxs(Ae,{value:"charts",className:"gap-2",children:[jsxRuntime.jsx(lucideReact.BarChart3,{className:"w-4 h-4"}),i.charts]})]}),jsxRuntime.jsxs(Re,{value:"dashboard",className:"space-y-6",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[jsxRuntime.jsxs(S,{children:[jsxRuntime.jsx(O,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"p-2 rounded-md bg-primary/10",children:jsxRuntime.jsx(lucideReact.TrendingUp,{className:"w-4 h-4 text-primary"})}),jsxRuntime.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:i.totalVolume})]})}),jsxRuntime.jsxs(L,{children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:le(C.totalVolume,Z)}),jsxRuntime.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.length," ",i.transactions]})]})]}),jsxRuntime.jsxs(S,{children:[jsxRuntime.jsx(O,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"p-2 rounded-md bg-green-500/10",children:jsxRuntime.jsx(lucideReact.ArrowDownCircle,{className:"w-4 h-4 text-green-600 dark:text-green-400"})}),jsxRuntime.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:i.deposits})]})}),jsxRuntime.jsxs(L,{children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:le(C.depositsTotal,Z)}),jsxRuntime.jsxs("p",{className:"text-xs text-muted-foreground",children:[C.depositsCount," ",i.transactions]})]})]}),jsxRuntime.jsxs(S,{children:[jsxRuntime.jsx(O,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"p-2 rounded-md bg-blue-500/10",children:jsxRuntime.jsx(lucideReact.ArrowUpCircle,{className:"w-4 h-4 text-blue-600 dark:text-blue-400"})}),jsxRuntime.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:i.payouts})]})}),jsxRuntime.jsxs(L,{children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:le(C.payoutsTotal,Z)}),jsxRuntime.jsxs("p",{className:"text-xs text-muted-foreground",children:[C.payoutsCount," ",i.transactions]})]})]}),jsxRuntime.jsxs(S,{children:[jsxRuntime.jsx(O,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"p-2 rounded-md bg-orange-500/10",children:jsxRuntime.jsx(lucideReact.RefreshCw,{className:"w-4 h-4 text-orange-600 dark:text-orange-400"})}),jsxRuntime.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:i.refunds})]})}),jsxRuntime.jsxs(L,{children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:le(C.refundsTotal,Z)}),jsxRuntime.jsxs("p",{className:"text-xs text-muted-foreground",children:[C.refundsCount," ",i.transactions]})]})]}),jsxRuntime.jsxs(S,{children:[jsxRuntime.jsx(O,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"p-2 rounded-md bg-yellow-500/10",children:jsxRuntime.jsx(lucideReact.Hourglass,{className:"w-4 h-4 text-yellow-600 dark:text-yellow-400"})}),jsxRuntime.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:i.pending})]})}),jsxRuntime.jsxs(L,{children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:C.pendingCount}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:i.transactions})]})]}),jsxRuntime.jsxs(S,{children:[jsxRuntime.jsx(O,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"p-2 rounded-md bg-green-500/10",children:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4 text-green-600 dark:text-green-400"})}),jsxRuntime.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:i.completed})]})}),jsxRuntime.jsxs(L,{children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:C.completedCount}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:i.transactions})]})]}),jsxRuntime.jsxs(S,{children:[jsxRuntime.jsx(O,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"p-2 rounded-md bg-red-500/10",children:jsxRuntime.jsx(lucideReact.XCircle,{className:"w-4 h-4 text-red-600 dark:text-red-400"})}),jsxRuntime.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:i.failed})]})}),jsxRuntime.jsxs(L,{children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:C.failedCount}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:i.transactions})]})]}),jsxRuntime.jsxs(S,{children:[jsxRuntime.jsx(O,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"p-2 rounded-md bg-gray-500/10",children:jsxRuntime.jsx(lucideReact.Ban,{className:"w-4 h-4 text-gray-600 dark:text-gray-400"})}),jsxRuntime.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:i.cancelled})]})}),jsxRuntime.jsxs(L,{children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:C.cancelledCount}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:i.transactions})]})]})]}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-3",children:[jsxRuntime.jsxs("div",{className:"relative flex-1 min-w-[200px]",children:[jsxRuntime.jsx(lucideReact.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground pointer-events-none"}),jsxRuntime.jsx(ct,{type:"text",placeholder:i.search,value:V,onChange:n=>{h(n.target.value),R(1);},className:"pl-9"})]}),jsxRuntime.jsxs(ot,{value:ae,onValueChange:n=>{E(n),R(1);},children:[jsxRuntime.jsx(Oe,{className:"w-[160px]",children:jsxRuntime.jsx(st,{placeholder:i.allTypes})}),jsxRuntime.jsxs(Le,{children:[jsxRuntime.jsx(M,{value:"all",children:i.allTypes}),jsxRuntime.jsx(M,{value:"deposit",children:i.deposit}),jsxRuntime.jsx(M,{value:"payout",children:i.payout}),jsxRuntime.jsx(M,{value:"refund",children:i.refund})]})]}),jsxRuntime.jsxs(ot,{value:_,onValueChange:n=>{A(n),R(1);},children:[jsxRuntime.jsx(Oe,{className:"w-[160px]",children:jsxRuntime.jsx(st,{placeholder:i.allStatuses})}),jsxRuntime.jsxs(Le,{children:[jsxRuntime.jsx(M,{value:"all",children:i.allStatuses}),jsxRuntime.jsx(M,{value:"COMPLETED",children:"COMPLETED"}),jsxRuntime.jsx(M,{value:"PENDING",children:"PENDING"}),jsxRuntime.jsx(M,{value:"PROCESSING",children:"PROCESSING"}),jsxRuntime.jsx(M,{value:"ACCEPTED",children:"ACCEPTED"}),jsxRuntime.jsx(M,{value:"FAILED",children:"FAILED"}),jsxRuntime.jsx(M,{value:"CANCELLED",children:"CANCELLED"}),jsxRuntime.jsx(M,{value:"REJECTED",children:"REJECTED"})]})]})]}),jsxRuntime.jsx(S,{children:w?jsxRuntime.jsx("div",{className:"p-12 text-center",children:jsxRuntime.jsx(ut,{className:"w-8 h-8 mx-auto text-muted-foreground"})}):oe.length===0?jsxRuntime.jsxs("div",{className:"p-12 text-center",children:[jsxRuntime.jsx("div",{className:"w-16 h-16 rounded-full bg-muted mx-auto mb-4 flex items-center justify-center",children:jsxRuntime.jsx(lucideReact.CircleDot,{className:"w-8 h-8 text-muted-foreground"})}),jsxRuntime.jsx("p",{className:"font-semibold text-lg",children:i.noTransactions}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground mt-1 mb-6",children:i.noTransactionsDesc}),H&&jsxRuntime.jsxs(ee,{onClick:H,children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),i.addTransaction]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:"w-full text-sm",children:[jsxRuntime.jsx("thead",{className:"bg-muted/50 border-b",children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{className:"text-left p-3 font-medium text-muted-foreground",children:i.id}),jsxRuntime.jsx("th",{className:"text-left p-3 font-medium text-muted-foreground",children:i.type}),jsxRuntime.jsx("th",{className:"text-left p-3 font-medium text-muted-foreground",children:i.amount}),jsxRuntime.jsx("th",{className:"text-left p-3 font-medium text-muted-foreground",children:i.status}),jsxRuntime.jsx("th",{className:"text-left p-3 font-medium text-muted-foreground",children:i.provider}),jsxRuntime.jsx("th",{className:"text-left p-3 font-medium text-muted-foreground",children:i.phone}),jsxRuntime.jsx("th",{className:"text-left p-3 font-medium text-muted-foreground",children:i.date})]})}),jsxRuntime.jsx("tbody",{className:"divide-y",children:U.map(n=>jsxRuntime.jsxs("tr",{className:T("hover:bg-muted/50 transition-colors",v&&"cursor-pointer"),onClick:()=>v?.(n),children:[jsxRuntime.jsx("td",{className:"p-3",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:"font-mono text-xs truncate max-w-[100px]",title:n.id,children:[n.id.slice(0,8),"..."]}),jsxRuntime.jsx(ee,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:m=>{m.stopPropagation(),ce(n.id);},title:"Copy ID",children:pe===n.id?jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5 text-green-600"}):jsxRuntime.jsx(lucideReact.Copy,{className:"w-3.5 h-3.5 text-muted-foreground"})})]})}),jsxRuntime.jsx("td",{className:"p-3",children:jsxRuntime.jsxs("span",{className:T("inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium rounded-full",n.type==="deposit"&&"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",n.type==="payout"&&"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",n.type==="refund"&&"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200"),children:[n.type==="deposit"&&jsxRuntime.jsx(lucideReact.ArrowDownCircle,{className:"w-3 h-3"}),n.type==="payout"&&jsxRuntime.jsx(lucideReact.ArrowUpCircle,{className:"w-3 h-3"}),n.type==="refund"&&jsxRuntime.jsx(lucideReact.RefreshCw,{className:"w-3 h-3"}),i[n.type]]})}),jsxRuntime.jsx("td",{className:"p-3 font-semibold",children:le(n.amount,n.currency)}),jsxRuntime.jsx("td",{className:"p-3",children:jsxRuntime.jsxs("span",{className:T("inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium rounded-full",la[n.status]),children:[jsxRuntime.jsx(ua,{status:n.status}),n.status]})}),jsxRuntime.jsx("td",{className:"p-3 text-muted-foreground",children:n.provider.replace(/_/g," ")}),jsxRuntime.jsx("td",{className:"p-3 font-mono text-muted-foreground",children:n.phoneNumber}),jsxRuntime.jsx("td",{className:"p-3 text-muted-foreground",children:ma(n.createdAt,N)})]},n.id))})]})}),q>1&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t",children:[jsxRuntime.jsxs("p",{className:"text-sm text-muted-foreground",children:[oe.length," ",i.transactions]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(ee,{variant:"outline",size:"icon",onClick:()=>R(n=>Math.max(1,n-1)),disabled:z===1,children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-4 h-4"})}),jsxRuntime.jsxs("span",{className:"text-sm px-2",children:[i.page," ",z," ",i.of," ",q]}),jsxRuntime.jsx(ee,{variant:"outline",size:"icon",onClick:()=>R(n=>Math.min(q,n+1)),disabled:z===q,children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-4 h-4"})})]})]})]})})]}),jsxRuntime.jsx(Re,{value:"charts",className:"space-y-6",children:s.length===0?jsxRuntime.jsx(S,{children:jsxRuntime.jsxs("div",{className:"p-12 text-center",children:[jsxRuntime.jsx("div",{className:"w-16 h-16 rounded-full bg-muted mx-auto mb-4 flex items-center justify-center",children:jsxRuntime.jsx(lucideReact.BarChart3,{className:"w-8 h-8 text-muted-foreground"})}),jsxRuntime.jsx("p",{className:"font-semibold text-lg",children:i.noDataForCharts}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:i.noTransactionsDesc})]})}):jsxRuntime.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[jsxRuntime.jsxs(S,{className:"col-span-1 lg:col-span-2",children:[jsxRuntime.jsx(O,{children:jsxRuntime.jsx(ye,{children:i.volumeOverTime})}),jsxRuntime.jsx(L,{children:jsxRuntime.jsx("div",{className:"h-[300px]",children:jsxRuntime.jsx(recharts.ResponsiveContainer,{width:"100%",height:"100%",children:jsxRuntime.jsxs(recharts.AreaChart,{data:K.volumeData,children:[jsxRuntime.jsxs("defs",{children:[jsxRuntime.jsxs("linearGradient",{id:"colorDeposits",x1:"0",y1:"0",x2:"0",y2:"1",children:[jsxRuntime.jsx("stop",{offset:"5%",stopColor:D.deposit,stopOpacity:.3}),jsxRuntime.jsx("stop",{offset:"95%",stopColor:D.deposit,stopOpacity:0})]}),jsxRuntime.jsxs("linearGradient",{id:"colorPayouts",x1:"0",y1:"0",x2:"0",y2:"1",children:[jsxRuntime.jsx("stop",{offset:"5%",stopColor:D.payout,stopOpacity:.3}),jsxRuntime.jsx("stop",{offset:"95%",stopColor:D.payout,stopOpacity:0})]})]}),jsxRuntime.jsx(recharts.CartesianGrid,{strokeDasharray:"3 3",className:"stroke-muted"}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"date",className:"text-xs"}),jsxRuntime.jsx(recharts.YAxis,{className:"text-xs"}),jsxRuntime.jsx(recharts.Tooltip,{contentStyle:{backgroundColor:"hsl(var(--popover))",border:"1px solid hsl(var(--border))",borderRadius:"8px"}}),jsxRuntime.jsx(recharts.Legend,{}),jsxRuntime.jsx(recharts.Area,{type:"monotone",dataKey:"deposits",name:i.deposits,stroke:D.deposit,fillOpacity:1,fill:"url(#colorDeposits)"}),jsxRuntime.jsx(recharts.Area,{type:"monotone",dataKey:"payouts",name:i.payouts,stroke:D.payout,fillOpacity:1,fill:"url(#colorPayouts)"})]})})})})]}),jsxRuntime.jsxs(S,{children:[jsxRuntime.jsx(O,{children:jsxRuntime.jsx(ye,{children:i.transactionsByType})}),jsxRuntime.jsx(L,{children:jsxRuntime.jsx("div",{className:"h-[300px]",children:jsxRuntime.jsx(recharts.ResponsiveContainer,{width:"100%",height:"100%",children:jsxRuntime.jsxs(recharts.BarChart,{data:K.typeData,children:[jsxRuntime.jsx(recharts.CartesianGrid,{strokeDasharray:"3 3",className:"stroke-muted"}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"name",className:"text-xs"}),jsxRuntime.jsx(recharts.YAxis,{className:"text-xs"}),jsxRuntime.jsx(recharts.Tooltip,{contentStyle:{backgroundColor:"hsl(var(--popover))",border:"1px solid hsl(var(--border))",borderRadius:"8px"},formatter:n=>le(n,Z)}),jsxRuntime.jsx(recharts.Bar,{dataKey:"value",name:i.amount,radius:[4,4,0,0],children:K.typeData.map((n,m)=>jsxRuntime.jsx(recharts.Cell,{fill:n.fill},`cell-${m}`))})]})})})})]}),jsxRuntime.jsxs(S,{children:[jsxRuntime.jsx(O,{children:jsxRuntime.jsx(ye,{children:i.statusDistribution})}),jsxRuntime.jsx(L,{children:jsxRuntime.jsx("div",{className:"h-[300px]",children:jsxRuntime.jsx(recharts.ResponsiveContainer,{width:"100%",height:"100%",children:jsxRuntime.jsxs(recharts.PieChart,{children:[jsxRuntime.jsx(recharts.Pie,{data:K.statusData,cx:"50%",cy:"50%",innerRadius:60,outerRadius:100,paddingAngle:2,dataKey:"value",label:({name:n,percent:m})=>`${n} ${(m*100).toFixed(0)}%`,labelLine:false,children:K.statusData.map((n,m)=>jsxRuntime.jsx(recharts.Cell,{fill:n.fill},`cell-${m}`))}),jsxRuntime.jsx(recharts.Tooltip,{contentStyle:{backgroundColor:"hsl(var(--popover))",border:"1px solid hsl(var(--border))",borderRadius:"8px"}}),jsxRuntime.jsx(recharts.Legend,{})]})})})})]})]})})]})]})}var fa=s=>({depositId:s,status:"ACCEPTED",created:new Date().toISOString(),nextStep:"FINAL_STATUS"}),ba=s=>({payoutId:s,status:"ACCEPTED",created:new Date().toISOString()}),xa=s=>({depositId:s,status:["COMPLETED","ACCEPTED","PROCESSING","ENQUEUED"][Math.floor(Math.random()*4)],created:new Date(Date.now()-6e4).toISOString(),amount:"5000",currency:"XAF",country:"CMR",payer:{type:"MMO",accountDetails:{phoneNumber:"237670000000",provider:"MTN_MOMO_CMR"}}}),va=()=>[{country:"CMR",providers:[{provider:"MTN_MOMO_CMR",operationTypes:[{operationType:"DEPOSIT",status:"OPERATIONAL"},{operationType:"PAYOUT",status:"OPERATIONAL"}]},{provider:"ORANGE_CMR",operationTypes:[{operationType:"DEPOSIT",status:"OPERATIONAL"},{operationType:"PAYOUT",status:"DELAYED"}]}]}],ya=s=>({country:"CMR",provider:s.startsWith("23767")?"MTN_MOMO_CMR":"ORANGE_CMR",phoneNumber:s.replace(/\D/g,"")}),ha=()=>({companyName:"Demo Company",signatureConfiguration:{signedRequestsOnly:false,signedCallbacks:true},countries:[{country:"CMR",displayName:{en:"Cameroon",fr:"Cameroun"},prefix:"237",flag:"https://cdn.pawapay.io/flags/cmr.svg",providers:[{provider:"MTN_MOMO_CMR",displayName:"MTN Mobile Money",nameDisplayedToCustomer:"MTN MoMo",currencies:[{currency:"XAF",displayName:"CFA Franc",operationTypes:{DEPOSIT:{minAmount:"100",maxAmount:"1000000",status:"OPERATIONAL"},PAYOUT:{minAmount:"100",maxAmount:"500000",status:"OPERATIONAL"}}}]}]}]}),Na=()=>({balances:[{country:"CMR",currency:"XAF",balance:"1250000.00"},{country:"COG",currency:"XAF",balance:"450000.00"},{country:"GAB",currency:"XAF",balance:"780000.00"}]}),Ca=()=>[{id:"key-001",key:"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA..."}],te=(s=800)=>new Promise(l=>setTimeout(l,s+Math.random()*400));async function mt(s,l){let c=new TextEncoder,N=await crypto.subtle.importKey("raw",c.encode(l),{name:"HMAC",hash:"SHA-256"},false,["sign"]),f=await crypto.subtle.sign("HMAC",N,c.encode(s));return Array.from(new Uint8Array(f)).map(I=>I.toString(16).padStart(2,"0")).join("")}var he=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,s=>{let l=Math.random()*16|0;return (s==="x"?l:l&3|8).toString(16)}),Fe=[{value:"MTN_MOMO_CMR",label:"MTN Mobile Money",country:"Cameroun"},{value:"ORANGE_CMR",label:"Orange Money",country:"Cameroun"},{value:"MTN_MOMO_COG",label:"MTN Mobile Money",country:"Congo"},{value:"AIRTEL_COG",label:"Airtel Money",country:"Congo"},{value:"MTN_MOMO_GAB",label:"MTN Mobile Money",country:"Gabon"},{value:"AIRTEL_GAB",label:"Airtel Money",country:"Gabon"}],pt=[{value:"XAF",label:"XAF (CFA Franc BEAC)"},{value:"XOF",label:"XOF (CFA Franc BCEAO)"},{value:"GHS",label:"GHS (Ghana Cedi)"},{value:"KES",label:"KES (Kenyan Shilling)"},{value:"RWF",label:"RWF (Rwandan Franc)"},{value:"TZS",label:"TZS (Tanzanian Shilling)"},{value:"UGX",label:"UGX (Ugandan Shilling)"},{value:"ZMW",label:"ZMW (Zambian Kwacha)"}];function ka({apiKey:s="",environment:l="sandbox",className:c="",demoMode:N=false,apiBasePath:f="/api/pawapay",onDepositComplete:I,onPayoutComplete:j,onError:v}){let[p,H]=react.useState(s),[u,w]=react.useState(l),[i,V]=react.useState(!!s||N),[h,ae]=react.useState(N),[E,_]=react.useState("deposit"),[A,z]=react.useState("237670000000"),[R,pe]=react.useState("5000"),[J,ge]=react.useState("XAF"),[Y,C]=react.useState("MTN_MOMO_CMR"),[K,oe]=react.useState("Test Payment"),[U,q]=react.useState(""),[ce,Z]=react.useState([]),[n,m]=react.useState("idle"),[$,se]=react.useState("whsec_test_secret_key"),[P,X]=react.useState([]),[ne,Ce]=react.useState("deposit.completed"),[fe,ke]=react.useState("5000"),[be,b]=react.useState("237670000000"),[B,yt]=react.useState("MTN_MOMO_CMR"),[Te,ht]=react.useState(""),[je,Nt]=react.useState(""),[_e,Ct]=react.useState(""),[we,kt]=react.useState(""),[Ge,Tt]=react.useState(""),[xe,He]=react.useState(null),[Ue,wt]=react.useState(""),[ie,Be]=react.useState(null),[Ve,ze]=react.useState(""),[ue,Et]=react.useState("all"),g=react.useCallback((t,d,x,Q)=>{let Se={id:he(),operation:t,status:d,response:x,error:Q,timestamp:new Date().toLocaleTimeString()};Z(Wt=>[Se,...Wt].slice(0,20));},[]),St=react.useCallback(()=>{if(!p.trim()){g("Configuration","error",void 0,"API Key is required");return}V(true),ae(false),g("Configuration","success",{environment:u,configured:true,apiBasePath:f});},[p,u,f,g]),Pt=react.useCallback(()=>{ae(true),V(true),g("Configuration","success",{mode:"demo",message:"Demo mode activated - responses are simulated"});},[g]),Dt=react.useCallback(async()=>{if(!(!p&&!h)){m("loading");try{let t=he();q(t);let d;if(h)await te(),d=fa(t);else {let x=await fetch(`${f}/deposit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:p,environment:u,amount:parseFloat(R),currency:J,provider:Y,phoneNumber:A,customerMessage:K.slice(0,22),transactionId:t})}),Q=await x.json();if(!x.ok)throw new Error(Q.error||"Deposit failed");d=Q;}m("success"),g("Deposit","success",d),I?.(d);}catch(t){m("error");let d=t instanceof Error?t.message:"Deposit failed";g("Deposit","error",void 0,d),v?.(t instanceof Error?t:new Error(d));}}},[p,f,u,h,R,J,Y,A,K,g,I,v]),Mt=react.useCallback(async()=>{if(!(!p&&!h)){m("loading");try{let t=he();q(t);let d;if(h)await te(),d=ba(t);else {let x=await fetch(`${f}/payout`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:p,environment:u,amount:parseFloat(R),currency:J,provider:Y,phoneNumber:A,transactionId:t})}),Q=await x.json();if(!x.ok)throw new Error(Q.error||"Payout failed");d=Q;}m("success"),g("Payout","success",d),j?.(d);}catch(t){m("error");let d=t instanceof Error?t.message:"Payout failed";g("Payout","error",void 0,d),v?.(t instanceof Error?t:new Error(d));}}},[p,f,u,h,R,J,Y,A,g,j,v]),It=react.useCallback(async()=>{if(!p&&!h||!U){g("Check Status","error",void 0,"No transaction ID");return}m("loading");try{let t;if(h)await te(),t=xa(U);else {let d=await fetch(`${f}/status`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:p,environment:u,transactionId:U})}),x=await d.json();if(!d.ok)throw new Error(x.error||"Status check failed");t=x;}m("success"),g("Check Status","success",t);}catch(t){m("error");let d=t instanceof Error?t.message:"Status check failed";g("Check Status","error",void 0,d),v?.(t instanceof Error?t:new Error(d));}},[p,f,u,h,U,g,v]),At=react.useCallback(async()=>{if(!(!p&&!h)){m("loading");try{let t;if(h)await te(),t=va();else {let d=await fetch(`${f}/availability`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:p,environment:u})}),x=await d.json();if(!d.ok)throw new Error(x.error||"Availability check failed");t=x;}m("success"),g("Provider Availability","success",t);}catch(t){m("error");let d=t instanceof Error?t.message:"Availability check failed";g("Provider Availability","error",void 0,d),v?.(t instanceof Error?t:new Error(d));}}},[p,f,u,h,g,v]),Rt=react.useCallback(async()=>{if(!(!p&&!h)){m("loading");try{let t;if(h)await te(),t=ya(A);else {let d=await fetch(`${f}/predict-provider`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:p,environment:u,phoneNumber:A})}),x=await d.json();if(!d.ok)throw new Error(x.error||"Prediction failed");t=x;}m("success"),g("Predict Provider","success",t);}catch(t){m("error");let d=t instanceof Error?t.message:"Prediction failed";g("Predict Provider","error",void 0,d),v?.(t instanceof Error?t:new Error(d));}}},[p,f,u,h,A,g,v]),Ot=react.useCallback(async()=>{if(!(!p&&!h)){m("loading");try{let t;if(h)await te(),t=ha();else {let d=await fetch(`${f}/active-config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:p,environment:u})}),x=await d.json();if(!d.ok)throw new Error(x.error||"Failed to get config");t=x;}m("success"),g("Active Configuration","success",t);}catch(t){m("error");let d=t instanceof Error?t.message:"Failed to get config";g("Active Configuration","error",void 0,d),v?.(t instanceof Error?t:new Error(d));}}},[p,f,u,h,g,v]),Lt=react.useCallback(async()=>{if(!(!p&&!h)){m("loading");try{let t;if(h)await te(),t=Ca();else {let d=await fetch(`${f}/public-keys`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:p,environment:u})}),x=await d.json();if(!d.ok)throw new Error(x.error||"Failed to get public keys");t=x;}m("success"),g("Public Keys","success",t);}catch(t){m("error");let d=t instanceof Error?t.message:"Failed to get public keys";g("Public Keys","error",void 0,d),v?.(t instanceof Error?t:new Error(d));}}},[p,f,u,h,g,v]),Ft=react.useCallback(async()=>{if(!(!p&&!h)){m("loading");try{let t;if(h)await te(),t=Na();else {let d=await fetch(`${f}/wallet-balances`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:p,environment:u})}),x=await d.json();if(!d.ok)throw new Error(x.error||"Failed to get balances");t=x;}m("success"),g("Wallet Balances","success",t);}catch(t){m("error");let d=t instanceof Error?t.message:"Failed to get balances";g("Wallet Balances","error",void 0,d),v?.(t instanceof Error?t:new Error(d));}}},[p,f,u,h,g,v]),Ee=react.useCallback(t=>{navigator.clipboard.writeText(t);},[]);return i?jsxRuntime.jsxs("div",{className:`space-y-6 ${c}`,children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Spaark Pay Console"}),h?jsxRuntime.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-amber-100 text-amber-800 dark:bg-amber-900 dark:text-amber-200",children:"DEMO"}):u==="production"?jsxRuntime.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",children:"PRODUCTION"}):jsxRuntime.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",children:"SANDBOX"})]}),jsxRuntime.jsx("p",{className:"text-muted-foreground mt-1",children:h?"Mode d\xE9mo - Les r\xE9ponses sont simul\xE9es":u==="production"?"Mode production - Transactions r\xE9elles":"Mode sandbox - Environnement de test"})]}),jsxRuntime.jsxs("button",{onClick:()=>V(false),className:"h-8 px-3 text-xs font-medium border border-border bg-background hover:bg-muted transition-colors flex items-center gap-2",children:[jsxRuntime.jsx(We,{}),"Reconfigure"]})]}),jsxRuntime.jsxs("div",{className:"grid lg:grid-cols-3 gap-6",children:[jsxRuntime.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-1 bg-muted p-1",children:[jsxRuntime.jsxs("button",{onClick:()=>_("deposit"),className:`flex-1 min-w-[80px] h-8 px-3 text-xs font-medium transition-colors flex items-center justify-center gap-1.5 ${E==="deposit"?"bg-background text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[jsxRuntime.jsx(gt,{}),"Deposit"]}),jsxRuntime.jsxs("button",{onClick:()=>_("payout"),className:`flex-1 min-w-[80px] h-8 px-3 text-xs font-medium transition-colors flex items-center justify-center gap-1.5 ${E==="payout"?"bg-background text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[jsxRuntime.jsx(Ta,{}),"Payout"]}),jsxRuntime.jsxs("button",{onClick:()=>_("status"),className:`flex-1 min-w-[80px] h-8 px-3 text-xs font-medium transition-colors flex items-center justify-center gap-1.5 ${E==="status"?"bg-background text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[jsxRuntime.jsx(ft,{}),"Status"]}),jsxRuntime.jsxs("button",{onClick:()=>_("toolkit"),className:`flex-1 min-w-[80px] h-8 px-3 text-xs font-medium transition-colors flex items-center justify-center gap-1.5 ${E==="toolkit"?"bg-background text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[jsxRuntime.jsx(Ea,{}),"Toolkit"]}),jsxRuntime.jsxs("button",{onClick:()=>_("finances"),className:`flex-1 min-w-[80px] h-8 px-3 text-xs font-medium transition-colors flex items-center justify-center gap-1.5 ${E==="finances"?"bg-background text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[jsxRuntime.jsx(Sa,{}),"Finances"]}),jsxRuntime.jsxs("button",{onClick:()=>_("webhooks"),className:`flex-1 min-w-[80px] h-8 px-3 text-xs font-medium transition-colors flex items-center justify-center gap-1.5 ${E==="webhooks"?"bg-background text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[jsxRuntime.jsx(Ia,{}),"Webhooks"]})]}),E==="deposit"&&jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Initiate Deposit"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Collect payment from a Mobile Money user"})]}),jsxRuntime.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Phone Number"}),jsxRuntime.jsx("input",{placeholder:"237670000000",value:A,onChange:t=>z(t.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Amount"}),jsxRuntime.jsx("input",{type:"number",placeholder:"5000",value:R,onChange:t=>pe(t.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Currency"}),jsxRuntime.jsx("select",{value:J,onChange:t=>ge(t.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring",children:pt.map(t=>jsxRuntime.jsx("option",{value:t.value,children:t.label},t.value))})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Provider"}),jsxRuntime.jsx("select",{value:Y,onChange:t=>C(t.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring",children:Fe.map(t=>jsxRuntime.jsxs("option",{value:t.value,children:[t.label," (",t.country,")"]},t.value))})]}),jsxRuntime.jsxs("div",{className:"space-y-2 sm:col-span-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Customer Message (4-22 chars)"}),jsxRuntime.jsx("input",{placeholder:"Payment description",value:K,onChange:t=>oe(t.target.value),maxLength:22,className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring"})]})]}),jsxRuntime.jsxs("button",{onClick:Dt,disabled:n==="loading",className:"w-full h-8 px-3 text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 transition-colors flex items-center justify-center gap-2",children:[n==="loading"?jsxRuntime.jsx(me,{}):jsxRuntime.jsx(Ne,{}),"Execute Deposit"]})]}),E==="payout"&&jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Initiate Payout"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Send money to a Mobile Money account"})]}),jsxRuntime.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Recipient Phone"}),jsxRuntime.jsx("input",{placeholder:"237670000000",value:A,onChange:t=>z(t.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Amount"}),jsxRuntime.jsx("input",{type:"number",placeholder:"5000",value:R,onChange:t=>pe(t.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Currency"}),jsxRuntime.jsx("select",{value:J,onChange:t=>ge(t.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring",children:pt.map(t=>jsxRuntime.jsx("option",{value:t.value,children:t.label},t.value))})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Provider"}),jsxRuntime.jsx("select",{value:Y,onChange:t=>C(t.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring",children:Fe.map(t=>jsxRuntime.jsxs("option",{value:t.value,children:[t.label," (",t.country,")"]},t.value))})]})]}),jsxRuntime.jsxs("button",{onClick:Mt,disabled:n==="loading",className:"w-full h-8 px-3 text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 transition-colors flex items-center justify-center gap-2",children:[n==="loading"?jsxRuntime.jsx(me,{}):jsxRuntime.jsx(Ne,{}),"Execute Payout"]})]}),E==="status"&&jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Check Transaction Status"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Query the status of a transaction"})]}),jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Transaction ID"}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsx("input",{placeholder:"Enter transaction ID (UUID)",value:U,onChange:t=>q(t.target.value),className:"flex-1 h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring font-mono"}),U&&jsxRuntime.jsx("button",{onClick:()=>Ee(U),className:"w-8 h-8 border border-border bg-background hover:bg-muted transition-colors flex items-center justify-center",title:"Copy to clipboard",children:jsxRuntime.jsx(bt,{})})]})]}),jsxRuntime.jsxs("button",{onClick:It,disabled:n==="loading"||!U,className:"w-full h-8 px-3 text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 transition-colors flex items-center justify-center gap-2",children:[n==="loading"?jsxRuntime.jsx(me,{}):jsxRuntime.jsx(ft,{}),"Check Status"]})]})]}),E==="toolkit"&&jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Predict Provider"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Predict the provider from a phone number"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Phone Number"}),jsxRuntime.jsx("input",{placeholder:"+237 670 000 000",value:A,onChange:t=>z(t.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring"})]}),jsxRuntime.jsxs("button",{onClick:Rt,disabled:n==="loading",className:"w-full h-8 px-3 text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 transition-colors flex items-center justify-center gap-2",children:[n==="loading"?jsxRuntime.jsx(me,{}):jsxRuntime.jsx(Pa,{}),"Predict Provider"]})]}),jsxRuntime.jsxs("div",{className:"grid sm:grid-cols-3 gap-3",children:[jsxRuntime.jsxs("button",{onClick:At,disabled:n==="loading",className:"h-10 px-3 text-xs font-medium border border-border bg-background hover:bg-muted disabled:opacity-50 transition-colors flex items-center justify-center gap-2",children:[jsxRuntime.jsx(Da,{}),"Provider Availability"]}),jsxRuntime.jsxs("button",{onClick:Ot,disabled:n==="loading",className:"h-10 px-3 text-xs font-medium border border-border bg-background hover:bg-muted disabled:opacity-50 transition-colors flex items-center justify-center gap-2",children:[jsxRuntime.jsx(We,{}),"Active Config"]}),jsxRuntime.jsxs("button",{onClick:Lt,disabled:n==="loading",className:"h-10 px-3 text-xs font-medium border border-border bg-background hover:bg-muted disabled:opacity-50 transition-colors flex items-center justify-center gap-2",children:[jsxRuntime.jsx(Ma,{}),"Public Keys"]})]})]}),E==="finances"&&jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Wallet Balances"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"View balances for all your wallets"})]}),jsxRuntime.jsxs("button",{onClick:Ft,disabled:n==="loading",className:"w-full h-8 px-3 text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 transition-colors flex items-center justify-center gap-2",children:[n==="loading"?jsxRuntime.jsx(me,{}):jsxRuntime.jsx(gt,{}),"Get Wallet Balances"]})]}),jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Statements"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Generate financial statements for your wallets"})]}),jsxRuntime.jsxs("div",{className:"p-4 bg-muted/50 text-xs text-muted-foreground",children:["Statement generation requires callback URL configuration. Use the SDK directly:",jsxRuntime.jsx("pre",{className:"mt-2 p-2 bg-background overflow-x-auto",children:`await sdk.finances.generateStatement({
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var react=require('react'),z=require('@radix-ui/react-tabs'),w=require('@radix-ui/react-select'),reactTable=require('@tanstack/react-table'),lucideReact=require('lucide-react'),recharts=require('recharts'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var z__namespace=/*#__PURE__*/_interopNamespace(z);var w__namespace=/*#__PURE__*/_interopNamespace(w);var ne=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,s=>{let n=Math.random()*16|0;return (s==="x"?n:n&3|8).toString(16)});function Jt(s,n={}){let{transactionId:d=ne(),amount:x="5000",currency:g="XAF",correspondent:F="MTN_MOMO_CMR",phoneNumber:_="237670000000",status:v=s==="deposit.failed"?"FAILED":"COMPLETED",failureCode:m="INSUFFICIENT_FUNDS",failureMessage:K="The payer has insufficient funds"}=n,u=new Date().toISOString(),E={depositId:d,status:v,amount:x,currency:g,correspondent:F,payer:{type:"MSISDN",address:{value:_}},customerTimestamp:u,created:u};return v==="COMPLETED"&&(E.receivedByPayer=u),v==="FAILED"&&(E.failureReason={failureCode:m,failureMessage:K}),{eventId:ne(),eventType:s,timestamp:u,data:E}}function $t(s,n={}){let{transactionId:d=ne(),amount:x="5000",currency:g="XAF",correspondent:F="MTN_MOMO_CMR",phoneNumber:_="237670000000",status:v=s==="payout.failed"?"FAILED":"COMPLETED",failureCode:m="RECIPIENT_NOT_FOUND",failureMessage:K="The recipient account was not found"}=n,u=new Date().toISOString(),E={payoutId:d,status:v,amount:x,currency:g,correspondent:F,recipient:{type:"MSISDN",address:{value:_}},customerTimestamp:u,created:u};return v==="COMPLETED"&&(E.receivedByRecipient=u),v==="FAILED"&&(E.failureReason={failureCode:m,failureMessage:K}),{eventId:ne(),eventType:s,timestamp:u,data:E}}function Xt(s,n={}){let{transactionId:d=ne(),depositId:x=ne(),amount:g="5000",currency:F="XAF",correspondent:_="MTN_MOMO_CMR",phoneNumber:v="237670000000",status:m=s==="refund.failed"?"FAILED":"COMPLETED",failureCode:K="REFUND_LIMIT_EXCEEDED",failureMessage:u="The refund limit has been exceeded"}=n,E=new Date().toISOString(),l={refundId:d,depositId:x,status:m,amount:g,currency:F,correspondent:_,recipient:{type:"MSISDN",address:{value:v}},created:E};return m==="FAILED"&&(l.failureReason={failureCode:K,failureMessage:u}),{eventId:ne(),eventType:s,timestamp:E,data:l}}function Xe(s,n={}){return s.startsWith("deposit.")?Jt(s,n):s.startsWith("payout.")?$t(s,n):Xt(s,n)}var Qe=["deposit.accepted","deposit.completed","deposit.failed","payout.accepted","payout.completed","payout.failed","refund.completed","refund.failed"];function k(...s){return tailwindMerge.twMerge(clsx.clsx(s))}var ha={fr:{title:"Tableau de bord financier",subtitle:"Vue d'ensemble de vos transactions",totalVolume:"Volume Total",deposits:"D\xE9p\xF4ts",payouts:"Retraits",failed:"\xC9checs",refunds:"Remboursements",pending:"En attente",completed:"Compl\xE9t\xE9es",cancelled:"Annul\xE9es",search:"Rechercher par ID ou t\xE9l\xE9phone...",allTypes:"Tous les types",allStatuses:"Tous les statuts",deposit:"D\xE9p\xF4t",payout:"Retrait",refund:"Remboursement",expertMode:"Mode Expert",refresh:"Actualiser",settings:"Param\xE8tres",noTransactions:"Aucune transaction",noTransactionsDesc:"Les transactions appara\xEEtront ici une fois effectu\xE9es.",addTransaction:"Nouvelle transaction",id:"ID",type:"Type",amount:"Montant",status:"Statut",provider:"Op\xE9rateur",phone:"T\xE9l\xE9phone",date:"Date",page:"Page",of:"sur",transactions:"transactions",copied:"Copi\xE9 !",dashboard:"Tableau de bord",charts:"Graphiques",volumeOverTime:"Volume dans le temps",transactionsByType:"Par type",statusDistribution:"Par statut",noDataForCharts:"Pas de donn\xE9es pour les graphiques",loading:"Chargement...",previous:"Pr\xE9c\xE9dent",next:"Suivant"},en:{title:"Finance Dashboard",subtitle:"Overview of your transactions",totalVolume:"Total Volume",deposits:"Deposits",payouts:"Payouts",failed:"Failed",refunds:"Refunds",pending:"Pending",completed:"Completed",cancelled:"Cancelled",search:"Search by ID or phone...",allTypes:"All types",allStatuses:"All statuses",deposit:"Deposit",payout:"Payout",refund:"Refund",expertMode:"Expert Mode",refresh:"Refresh",settings:"Settings",noTransactions:"No transactions",noTransactionsDesc:"Transactions will appear here once made.",addTransaction:"New transaction",id:"ID",type:"Type",amount:"Amount",status:"Status",provider:"Provider",phone:"Phone",date:"Date",page:"Page",of:"of",transactions:"transactions",copied:"Copied!",dashboard:"Dashboard",charts:"Charts",volumeOverTime:"Volume over time",transactionsByType:"By type",statusDistribution:"By status",noDataForCharts:"No data for charts",loading:"Loading...",previous:"Previous",next:"Next"}},Na={COMPLETED:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",ACCEPTED:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",PENDING:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",ENQUEUED:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",PROCESSING:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",FAILED:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",CANCELLED:"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200",REJECTED:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"},R={deposit:"#22c55e",payout:"#3b82f6",refund:"#f97316",COMPLETED:"#22c55e",PENDING:"#eab308",FAILED:"#ef4444",CANCELLED:"#6b7280"},oe=react.forwardRef(({className:s,variant:n="default",size:d="default",...x},g)=>jsxRuntime.jsx("button",{ref:g,className:k("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{"bg-primary text-primary-foreground hover:bg-primary/90":n==="default","border border-input bg-background hover:bg-accent hover:text-accent-foreground":n==="outline","hover:bg-accent hover:text-accent-foreground":n==="ghost","bg-secondary text-secondary-foreground hover:bg-secondary/80":n==="secondary"},{"h-10 px-4 py-2":d==="default","h-9 rounded-md px-3":d==="sm","h-11 rounded-md px-8":d==="lg","h-10 w-10":d==="icon"},s),...x}));oe.displayName="Button";var Ca=z__namespace.Root,bt=react.forwardRef(({className:s,...n},d)=>jsxRuntime.jsx(z__namespace.List,{ref:d,className:k("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...n}));bt.displayName=z__namespace.List.displayName;var Le=react.forwardRef(({className:s,...n},d)=>jsxRuntime.jsx(z__namespace.Trigger,{ref:d,className:k("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",s),...n}));Le.displayName=z__namespace.Trigger.displayName;var Oe=react.forwardRef(({className:s,...n},d)=>jsxRuntime.jsx(z__namespace.Content,{ref:d,className:k("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...n}));Oe.displayName=z__namespace.Content.displayName;var it=w__namespace.Root,lt=w__namespace.Value,Fe=react.forwardRef(({className:s,children:n,...d},x)=>jsxRuntime.jsxs(w__namespace.Trigger,{ref:x,className:k("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s),...d,children:[n,jsxRuntime.jsx(w__namespace.Icon,{asChild:true,children:jsxRuntime.jsx(lucideReact.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Fe.displayName=w__namespace.Trigger.displayName;var He=react.forwardRef(({className:s,children:n,position:d="popper",...x},g)=>jsxRuntime.jsx(w__namespace.Portal,{children:jsxRuntime.jsx(w__namespace.Content,{ref:g,className:k("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",d==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",s),position:d,...x,children:jsxRuntime.jsx(w__namespace.Viewport,{className:k("p-1",d==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n})})}));He.displayName=w__namespace.Content.displayName;var A=react.forwardRef(({className:s,children:n,...d},x)=>jsxRuntime.jsxs(w__namespace.Item,{ref:x,className:k("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...d,children:[jsxRuntime.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(w__namespace.ItemIndicator,{children:jsxRuntime.jsx(lucideReact.Check,{className:"h-4 w-4"})})}),jsxRuntime.jsx(w__namespace.ItemText,{children:n})]}));A.displayName=w__namespace.Item.displayName;var D=react.forwardRef(({className:s,...n},d)=>jsxRuntime.jsx("div",{ref:d,className:k("rounded-lg border bg-card text-card-foreground shadow-sm",s),...n}));D.displayName="Card";var L=react.forwardRef(({className:s,...n},d)=>jsxRuntime.jsx("div",{ref:d,className:k("flex flex-col space-y-1.5 p-6",s),...n}));L.displayName="CardHeader";var Ce=react.forwardRef(({className:s,...n},d)=>jsxRuntime.jsx("h3",{ref:d,className:k("text-lg font-semibold leading-none tracking-tight",s),...n}));Ce.displayName="CardTitle";var O=react.forwardRef(({className:s,...n},d)=>jsxRuntime.jsx("div",{ref:d,className:k("p-6 pt-0",s),...n}));O.displayName="CardContent";var ft=react.forwardRef(({className:s,type:n,...d},x)=>jsxRuntime.jsx("input",{type:n,className:k("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s),ref:x,...d}));ft.displayName="Input";var xt=react.forwardRef(({className:s,...n},d)=>jsxRuntime.jsx("div",{className:"relative w-full overflow-auto",children:jsxRuntime.jsx("table",{ref:d,className:k("w-full caption-bottom text-sm",s),...n})}));xt.displayName="Table";var vt=react.forwardRef(({className:s,...n},d)=>jsxRuntime.jsx("thead",{ref:d,className:k("[&_tr]:border-b",s),...n}));vt.displayName="TableHeader";var yt=react.forwardRef(({className:s,...n},d)=>jsxRuntime.jsx("tbody",{ref:d,className:k("[&_tr:last-child]:border-0",s),...n}));yt.displayName="TableBody";var We=react.forwardRef(({className:s,...n},d)=>jsxRuntime.jsx("tr",{ref:d,className:k("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",s),...n}));We.displayName="TableRow";var ht=react.forwardRef(({className:s,...n},d)=>jsxRuntime.jsx("th",{ref:d,className:k("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...n}));ht.displayName="TableHead";var Nt=react.forwardRef(({className:s,...n},d)=>jsxRuntime.jsx("td",{ref:d,className:k("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...n}));Nt.displayName="TableCell";var V=({className:s,...n})=>jsxRuntime.jsx("div",{className:k("animate-pulse rounded-md bg-muted",s),...n}),ka=({className:s})=>jsxRuntime.jsxs("svg",{className:k("animate-spin",s),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),dt=({icon:s=lucideReact.Inbox,title:n,description:d,action:x})=>jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-4 text-center",children:[jsxRuntime.jsx("div",{className:"flex h-20 w-20 items-center justify-center rounded-full bg-muted",children:jsxRuntime.jsx(s,{className:"h-10 w-10 text-muted-foreground"})}),jsxRuntime.jsx("h3",{className:"mt-4 text-lg font-semibold",children:n}),d&&jsxRuntime.jsx("p",{className:"mt-2 text-sm text-muted-foreground max-w-sm",children:d}),x&&jsxRuntime.jsx("div",{className:"mt-6",children:x})]}),Ta=({status:s})=>{switch(s){case "COMPLETED":return jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3.5 h-3.5"});case "FAILED":case "REJECTED":return jsxRuntime.jsx(lucideReact.XCircle,{className:"w-3.5 h-3.5"});case "CANCELLED":return jsxRuntime.jsx(lucideReact.Ban,{className:"w-3.5 h-3.5"});case "PENDING":case "ENQUEUED":return jsxRuntime.jsx(lucideReact.Clock,{className:"w-3.5 h-3.5"});case "PROCESSING":case "ACCEPTED":return jsxRuntime.jsx(ka,{className:"w-3.5 h-3.5"});default:return jsxRuntime.jsx(lucideReact.AlertCircle,{className:"w-3.5 h-3.5"})}},ce=(s,n)=>new Intl.NumberFormat("fr-FR",{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0}).format(s)+" "+n,wa=(s,n)=>{let d=new Date(s);return new Intl.DateTimeFormat(n==="fr"?"fr-FR":"en-US",{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(d)};function Ea({transactions:s,title:n,subtitle:d,locale:x="fr",className:g="",showExpertMode:F=true,onExpertModeClick:_,onTransactionClick:v,onRefresh:m,onAddTransaction:K,onSettings:u,isLoading:E=false}){let l=ha[x],[$,N]=react.useState(""),[re,M]=react.useState("all"),[j,H]=react.useState("all"),[ie,X]=react.useState(null),[be,Z]=react.useState("dashboard"),[fe,ee]=react.useState([]),T=react.useMemo(()=>{let i=s.filter(b=>b.type==="deposit"),y=s.filter(b=>b.type==="payout"),J=s.filter(b=>b.type==="refund"),te=s.filter(b=>b.status==="FAILED"||b.status==="REJECTED"),I=s.filter(b=>["PENDING","ENQUEUED","PROCESSING","ACCEPTED"].includes(b.status)),ae=s.filter(b=>b.status==="COMPLETED"),xe=s.filter(b=>b.status==="CANCELLED"),we=s.filter(b=>b.status==="COMPLETED").reduce((b,B)=>b+B.amount,0),ve=i.filter(b=>b.status==="COMPLETED").reduce((b,B)=>b+B.amount,0),Ee=y.filter(b=>b.status==="COMPLETED").reduce((b,B)=>b+B.amount,0),ye=J.filter(b=>b.status==="COMPLETED").reduce((b,B)=>b+B.amount,0);return {totalVolume:we,depositsCount:i.length,depositsTotal:ve,payoutsCount:y.length,payoutsTotal:Ee,failedCount:te.length,refundsCount:J.length,refundsTotal:ye,pendingCount:I.length,completedCount:ae.length,cancelledCount:xe.length}},[s]),Q=react.useMemo(()=>{let i={};s.forEach(I=>{let ae=new Date(I.createdAt).toLocaleDateString(x==="fr"?"fr-FR":"en-US",{day:"2-digit",month:"short"});i[ae]||(i[ae]={date:ae,deposits:0,payouts:0,refunds:0}),I.status==="COMPLETED"&&(i[ae][I.type==="deposit"?"deposits":I.type==="payout"?"payouts":"refunds"]+=I.amount);});let y=Object.values(i).slice(-7),J=[{name:l.deposit,value:T.depositsTotal,count:T.depositsCount,fill:R.deposit},{name:l.payout,value:T.payoutsTotal,count:T.payoutsCount,fill:R.payout},{name:l.refund,value:T.refundsTotal,count:T.refundsCount,fill:R.refund}],te=[{name:"Completed",value:T.completedCount,fill:R.COMPLETED},{name:"Pending",value:T.pendingCount,fill:R.PENDING},{name:"Failed",value:T.failedCount,fill:R.FAILED},{name:"Cancelled",value:T.cancelledCount,fill:R.CANCELLED}].filter(I=>I.value>0);return {volumeData:y,typeData:J,statusData:te}},[s,T,x,l]),ue=react.useMemo(()=>s.filter(i=>{let y=$===""||i.id.toLowerCase().includes($.toLowerCase())||i.phoneNumber.includes($),J=re==="all"||i.type===re,te=j==="all"||i.status===j;return y&&J&&te}),[s,$,re,j]),G=react.useCallback(i=>{navigator.clipboard.writeText(i),X(i),setTimeout(()=>X(null),2e3);},[]),Y=s[0]?.currency||"XAF",me=react.useMemo(()=>[{accessorKey:"id",header:l.id,cell:({row:i})=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:"font-mono text-xs truncate max-w-[100px]",title:i.original.id,children:[i.original.id.slice(0,8),"..."]}),jsxRuntime.jsx(oe,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:y=>{y.stopPropagation(),G(i.original.id);},children:ie===i.original.id?jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5 text-green-600"}):jsxRuntime.jsx(lucideReact.Copy,{className:"w-3.5 h-3.5 text-muted-foreground"})})]})},{accessorKey:"type",header:l.type,cell:({row:i})=>jsxRuntime.jsxs("span",{className:k("inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium rounded-full",i.original.type==="deposit"&&"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",i.original.type==="payout"&&"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",i.original.type==="refund"&&"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200"),children:[i.original.type==="deposit"&&jsxRuntime.jsx(lucideReact.ArrowDownCircle,{className:"w-3 h-3"}),i.original.type==="payout"&&jsxRuntime.jsx(lucideReact.ArrowUpCircle,{className:"w-3 h-3"}),i.original.type==="refund"&&jsxRuntime.jsx(lucideReact.RefreshCw,{className:"w-3 h-3"}),l[i.original.type]]})},{accessorKey:"amount",header:l.amount,cell:({row:i})=>jsxRuntime.jsx("span",{className:"font-semibold",children:ce(i.original.amount,i.original.currency)})},{accessorKey:"status",header:l.status,cell:({row:i})=>jsxRuntime.jsxs("span",{className:k("inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium rounded-full",Na[i.original.status]),children:[jsxRuntime.jsx(Ta,{status:i.original.status}),i.original.status]})},{accessorKey:"provider",header:l.provider,cell:({row:i})=>jsxRuntime.jsx("span",{className:"text-muted-foreground",children:i.original.provider.replace(/_/g," ")})},{accessorKey:"phoneNumber",header:l.phone,cell:({row:i})=>jsxRuntime.jsx("span",{className:"font-mono text-muted-foreground",children:i.original.phoneNumber})},{accessorKey:"createdAt",header:l.date,cell:({row:i})=>jsxRuntime.jsx("span",{className:"text-muted-foreground",children:wa(i.original.createdAt,x)})}],[l,x,ie,G]),U=reactTable.useReactTable({data:ue,columns:me,getCoreRowModel:reactTable.getCoreRowModel(),getPaginationRowModel:reactTable.getPaginationRowModel(),getFilteredRowModel:reactTable.getFilteredRowModel(),onColumnFiltersChange:ee,state:{columnFilters:fe},initialState:{pagination:{pageSize:10}}}),P=()=>jsxRuntime.jsx("div",{className:"space-y-3 p-4",children:Array.from({length:5}).map((i,y)=>jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[jsxRuntime.jsx(V,{className:"h-4 w-24"}),jsxRuntime.jsx(V,{className:"h-6 w-16 rounded-full"}),jsxRuntime.jsx(V,{className:"h-4 w-20"}),jsxRuntime.jsx(V,{className:"h-6 w-20 rounded-full"}),jsxRuntime.jsx(V,{className:"h-4 w-24"}),jsxRuntime.jsx(V,{className:"h-4 w-28"}),jsxRuntime.jsx(V,{className:"h-4 w-32"})]},y))}),C=()=>jsxRuntime.jsxs(D,{children:[jsxRuntime.jsx(L,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(V,{className:"h-8 w-8 rounded-md"}),jsxRuntime.jsx(V,{className:"h-4 w-24"})]})}),jsxRuntime.jsxs(O,{children:[jsxRuntime.jsx(V,{className:"h-8 w-32 mb-2"}),jsxRuntime.jsx(V,{className:"h-3 w-20"})]})]});return jsxRuntime.jsxs("div",{className:k("space-y-6",g),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:n||l.title}),jsxRuntime.jsx("p",{className:"text-muted-foreground mt-1",children:d||l.subtitle})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[m&&jsxRuntime.jsxs(oe,{variant:"outline",size:"sm",onClick:m,disabled:E,children:[jsxRuntime.jsx(lucideReact.RefreshCw,{className:k("w-4 h-4",E&&"animate-spin")}),l.refresh]}),u&&jsxRuntime.jsx(oe,{variant:"outline",size:"icon",onClick:u,title:l.settings,children:jsxRuntime.jsx(lucideReact.Settings,{className:"w-4 h-4"})}),F&&_&&jsxRuntime.jsx(oe,{onClick:_,children:l.expertMode})]})]}),jsxRuntime.jsxs(Ca,{value:be,onValueChange:Z,children:[jsxRuntime.jsxs(bt,{children:[jsxRuntime.jsxs(Le,{value:"dashboard",className:"gap-2",children:[jsxRuntime.jsx(lucideReact.LayoutDashboard,{className:"w-4 h-4"}),l.dashboard]}),jsxRuntime.jsxs(Le,{value:"charts",className:"gap-2",children:[jsxRuntime.jsx(lucideReact.BarChart3,{className:"w-4 h-4"}),l.charts]})]}),jsxRuntime.jsxs(Oe,{value:"dashboard",className:"space-y-6",children:[jsxRuntime.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:E?jsxRuntime.jsx(jsxRuntime.Fragment,{children:Array.from({length:8}).map((i,y)=>jsxRuntime.jsx(C,{},y))}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(D,{children:[jsxRuntime.jsx(L,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"p-2 rounded-md bg-primary/10",children:jsxRuntime.jsx(lucideReact.TrendingUp,{className:"w-4 h-4 text-primary"})}),jsxRuntime.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:l.totalVolume})]})}),jsxRuntime.jsxs(O,{children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:ce(T.totalVolume,Y)}),jsxRuntime.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.length," ",l.transactions]})]})]}),jsxRuntime.jsxs(D,{children:[jsxRuntime.jsx(L,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"p-2 rounded-md bg-green-500/10",children:jsxRuntime.jsx(lucideReact.ArrowDownCircle,{className:"w-4 h-4 text-green-600 dark:text-green-400"})}),jsxRuntime.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:l.deposits})]})}),jsxRuntime.jsxs(O,{children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:ce(T.depositsTotal,Y)}),jsxRuntime.jsxs("p",{className:"text-xs text-muted-foreground",children:[T.depositsCount," ",l.transactions]})]})]}),jsxRuntime.jsxs(D,{children:[jsxRuntime.jsx(L,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"p-2 rounded-md bg-blue-500/10",children:jsxRuntime.jsx(lucideReact.ArrowUpCircle,{className:"w-4 h-4 text-blue-600 dark:text-blue-400"})}),jsxRuntime.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:l.payouts})]})}),jsxRuntime.jsxs(O,{children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:ce(T.payoutsTotal,Y)}),jsxRuntime.jsxs("p",{className:"text-xs text-muted-foreground",children:[T.payoutsCount," ",l.transactions]})]})]}),jsxRuntime.jsxs(D,{children:[jsxRuntime.jsx(L,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"p-2 rounded-md bg-orange-500/10",children:jsxRuntime.jsx(lucideReact.RefreshCw,{className:"w-4 h-4 text-orange-600 dark:text-orange-400"})}),jsxRuntime.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:l.refunds})]})}),jsxRuntime.jsxs(O,{children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:ce(T.refundsTotal,Y)}),jsxRuntime.jsxs("p",{className:"text-xs text-muted-foreground",children:[T.refundsCount," ",l.transactions]})]})]}),jsxRuntime.jsxs(D,{children:[jsxRuntime.jsx(L,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"p-2 rounded-md bg-yellow-500/10",children:jsxRuntime.jsx(lucideReact.Hourglass,{className:"w-4 h-4 text-yellow-600 dark:text-yellow-400"})}),jsxRuntime.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:l.pending})]})}),jsxRuntime.jsxs(O,{children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:T.pendingCount}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:l.transactions})]})]}),jsxRuntime.jsxs(D,{children:[jsxRuntime.jsx(L,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"p-2 rounded-md bg-green-500/10",children:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4 text-green-600 dark:text-green-400"})}),jsxRuntime.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:l.completed})]})}),jsxRuntime.jsxs(O,{children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:T.completedCount}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:l.transactions})]})]}),jsxRuntime.jsxs(D,{children:[jsxRuntime.jsx(L,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"p-2 rounded-md bg-red-500/10",children:jsxRuntime.jsx(lucideReact.XCircle,{className:"w-4 h-4 text-red-600 dark:text-red-400"})}),jsxRuntime.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:l.failed})]})}),jsxRuntime.jsxs(O,{children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:T.failedCount}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:l.transactions})]})]}),jsxRuntime.jsxs(D,{children:[jsxRuntime.jsx(L,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"p-2 rounded-md bg-gray-500/10",children:jsxRuntime.jsx(lucideReact.Ban,{className:"w-4 h-4 text-gray-600 dark:text-gray-400"})}),jsxRuntime.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:l.cancelled})]})}),jsxRuntime.jsxs(O,{children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:T.cancelledCount}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:l.transactions})]})]})]})}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-3",children:[jsxRuntime.jsxs("div",{className:"relative flex-1 min-w-[200px]",children:[jsxRuntime.jsx(lucideReact.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground pointer-events-none"}),jsxRuntime.jsx(ft,{type:"text",placeholder:l.search,value:$,onChange:i=>N(i.target.value),className:"pl-9"})]}),jsxRuntime.jsxs(it,{value:re,onValueChange:i=>M(i),children:[jsxRuntime.jsx(Fe,{className:"w-[160px]",children:jsxRuntime.jsx(lt,{placeholder:l.allTypes})}),jsxRuntime.jsxs(He,{children:[jsxRuntime.jsx(A,{value:"all",children:l.allTypes}),jsxRuntime.jsx(A,{value:"deposit",children:l.deposit}),jsxRuntime.jsx(A,{value:"payout",children:l.payout}),jsxRuntime.jsx(A,{value:"refund",children:l.refund})]})]}),jsxRuntime.jsxs(it,{value:j,onValueChange:i=>H(i),children:[jsxRuntime.jsx(Fe,{className:"w-[160px]",children:jsxRuntime.jsx(lt,{placeholder:l.allStatuses})}),jsxRuntime.jsxs(He,{children:[jsxRuntime.jsx(A,{value:"all",children:l.allStatuses}),jsxRuntime.jsx(A,{value:"COMPLETED",children:"COMPLETED"}),jsxRuntime.jsx(A,{value:"PENDING",children:"PENDING"}),jsxRuntime.jsx(A,{value:"PROCESSING",children:"PROCESSING"}),jsxRuntime.jsx(A,{value:"ACCEPTED",children:"ACCEPTED"}),jsxRuntime.jsx(A,{value:"FAILED",children:"FAILED"}),jsxRuntime.jsx(A,{value:"CANCELLED",children:"CANCELLED"}),jsxRuntime.jsx(A,{value:"REJECTED",children:"REJECTED"})]})]})]}),jsxRuntime.jsx(D,{children:E?jsxRuntime.jsx(P,{}):ue.length===0?jsxRuntime.jsx(dt,{icon:lucideReact.Inbox,title:l.noTransactions,description:l.noTransactionsDesc,action:K&&jsxRuntime.jsxs(oe,{onClick:K,children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),l.addTransaction]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(xt,{children:[jsxRuntime.jsx(vt,{children:U.getHeaderGroups().map(i=>jsxRuntime.jsx(We,{children:i.headers.map(y=>jsxRuntime.jsx(ht,{children:y.isPlaceholder?null:reactTable.flexRender(y.column.columnDef.header,y.getContext())},y.id))},i.id))}),jsxRuntime.jsx(yt,{children:U.getRowModel().rows.map(i=>jsxRuntime.jsx(We,{onClick:()=>v?.(i.original),className:v?"cursor-pointer":"",children:i.getVisibleCells().map(y=>jsxRuntime.jsx(Nt,{children:reactTable.flexRender(y.column.columnDef.cell,y.getContext())},y.id))},i.id))})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t",children:[jsxRuntime.jsxs("p",{className:"text-sm text-muted-foreground",children:[ue.length," ",l.transactions]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs(oe,{variant:"outline",size:"sm",onClick:()=>U.previousPage(),disabled:!U.getCanPreviousPage(),children:[jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-4 h-4"}),l.previous]}),jsxRuntime.jsxs("span",{className:"text-sm px-2",children:[l.page," ",U.getState().pagination.pageIndex+1," ",l.of," ",U.getPageCount()]}),jsxRuntime.jsxs(oe,{variant:"outline",size:"sm",onClick:()=>U.nextPage(),disabled:!U.getCanNextPage(),children:[l.next,jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-4 h-4"})]})]})]})]})})]}),jsxRuntime.jsx(Oe,{value:"charts",className:"space-y-6",children:s.length===0?jsxRuntime.jsx(D,{children:jsxRuntime.jsx(dt,{icon:lucideReact.BarChart3,title:l.noDataForCharts,description:l.noTransactionsDesc})}):jsxRuntime.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[jsxRuntime.jsxs(D,{className:"col-span-1 lg:col-span-2",children:[jsxRuntime.jsx(L,{children:jsxRuntime.jsx(Ce,{children:l.volumeOverTime})}),jsxRuntime.jsx(O,{children:jsxRuntime.jsx("div",{className:"h-[300px]",children:jsxRuntime.jsx(recharts.ResponsiveContainer,{width:"100%",height:"100%",children:jsxRuntime.jsxs(recharts.AreaChart,{data:Q.volumeData,children:[jsxRuntime.jsxs("defs",{children:[jsxRuntime.jsxs("linearGradient",{id:"colorDeposits",x1:"0",y1:"0",x2:"0",y2:"1",children:[jsxRuntime.jsx("stop",{offset:"5%",stopColor:R.deposit,stopOpacity:.3}),jsxRuntime.jsx("stop",{offset:"95%",stopColor:R.deposit,stopOpacity:0})]}),jsxRuntime.jsxs("linearGradient",{id:"colorPayouts",x1:"0",y1:"0",x2:"0",y2:"1",children:[jsxRuntime.jsx("stop",{offset:"5%",stopColor:R.payout,stopOpacity:.3}),jsxRuntime.jsx("stop",{offset:"95%",stopColor:R.payout,stopOpacity:0})]})]}),jsxRuntime.jsx(recharts.CartesianGrid,{strokeDasharray:"3 3",className:"stroke-muted"}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"date",className:"text-xs"}),jsxRuntime.jsx(recharts.YAxis,{className:"text-xs"}),jsxRuntime.jsx(recharts.Tooltip,{contentStyle:{backgroundColor:"hsl(var(--popover))",border:"1px solid hsl(var(--border))",borderRadius:"8px"}}),jsxRuntime.jsx(recharts.Legend,{}),jsxRuntime.jsx(recharts.Area,{type:"monotone",dataKey:"deposits",name:l.deposits,stroke:R.deposit,fillOpacity:1,fill:"url(#colorDeposits)"}),jsxRuntime.jsx(recharts.Area,{type:"monotone",dataKey:"payouts",name:l.payouts,stroke:R.payout,fillOpacity:1,fill:"url(#colorPayouts)"})]})})})})]}),jsxRuntime.jsxs(D,{children:[jsxRuntime.jsx(L,{children:jsxRuntime.jsx(Ce,{children:l.transactionsByType})}),jsxRuntime.jsx(O,{children:jsxRuntime.jsx("div",{className:"h-[300px]",children:jsxRuntime.jsx(recharts.ResponsiveContainer,{width:"100%",height:"100%",children:jsxRuntime.jsxs(recharts.BarChart,{data:Q.typeData,children:[jsxRuntime.jsx(recharts.CartesianGrid,{strokeDasharray:"3 3",className:"stroke-muted"}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"name",className:"text-xs"}),jsxRuntime.jsx(recharts.YAxis,{className:"text-xs"}),jsxRuntime.jsx(recharts.Tooltip,{contentStyle:{backgroundColor:"hsl(var(--popover))",border:"1px solid hsl(var(--border))",borderRadius:"8px"},formatter:i=>ce(i,Y)}),jsxRuntime.jsx(recharts.Bar,{dataKey:"value",name:l.amount,radius:[4,4,0,0],children:Q.typeData.map((i,y)=>jsxRuntime.jsx(recharts.Cell,{fill:i.fill},`cell-${y}`))})]})})})})]}),jsxRuntime.jsxs(D,{children:[jsxRuntime.jsx(L,{children:jsxRuntime.jsx(Ce,{children:l.statusDistribution})}),jsxRuntime.jsx(O,{children:jsxRuntime.jsx("div",{className:"h-[300px]",children:jsxRuntime.jsx(recharts.ResponsiveContainer,{width:"100%",height:"100%",children:jsxRuntime.jsxs(recharts.PieChart,{children:[jsxRuntime.jsx(recharts.Pie,{data:Q.statusData,cx:"50%",cy:"50%",innerRadius:60,outerRadius:100,paddingAngle:2,dataKey:"value",label:({name:i,percent:y})=>`${i} ${(y*100).toFixed(0)}%`,labelLine:false,children:Q.statusData.map((i,y)=>jsxRuntime.jsx(recharts.Cell,{fill:i.fill},`cell-${y}`))}),jsxRuntime.jsx(recharts.Tooltip,{contentStyle:{backgroundColor:"hsl(var(--popover))",border:"1px solid hsl(var(--border))",borderRadius:"8px"}}),jsxRuntime.jsx(recharts.Legend,{})]})})})})]})]})})]})]})}var Sa=s=>({depositId:s,status:"ACCEPTED",created:new Date().toISOString(),nextStep:"FINAL_STATUS"}),Pa=s=>({payoutId:s,status:"ACCEPTED",created:new Date().toISOString()}),Da=s=>({depositId:s,status:["COMPLETED","ACCEPTED","PROCESSING","ENQUEUED"][Math.floor(Math.random()*4)],created:new Date(Date.now()-6e4).toISOString(),amount:"5000",currency:"XAF",country:"CMR",payer:{type:"MMO",accountDetails:{phoneNumber:"237670000000",provider:"MTN_MOMO_CMR"}}}),Ma=()=>[{country:"CMR",providers:[{provider:"MTN_MOMO_CMR",operationTypes:[{operationType:"DEPOSIT",status:"OPERATIONAL"},{operationType:"PAYOUT",status:"OPERATIONAL"}]},{provider:"ORANGE_CMR",operationTypes:[{operationType:"DEPOSIT",status:"OPERATIONAL"},{operationType:"PAYOUT",status:"DELAYED"}]}]}],Ia=s=>({country:"CMR",provider:s.startsWith("23767")?"MTN_MOMO_CMR":"ORANGE_CMR",phoneNumber:s.replace(/\D/g,"")}),Ra=()=>({companyName:"Demo Company",signatureConfiguration:{signedRequestsOnly:false,signedCallbacks:true},countries:[{country:"CMR",displayName:{en:"Cameroon",fr:"Cameroun"},prefix:"237",flag:"https://cdn.pawapay.io/flags/cmr.svg",providers:[{provider:"MTN_MOMO_CMR",displayName:"MTN Mobile Money",nameDisplayedToCustomer:"MTN MoMo",currencies:[{currency:"XAF",displayName:"CFA Franc",operationTypes:{DEPOSIT:{minAmount:"100",maxAmount:"1000000",status:"OPERATIONAL"},PAYOUT:{minAmount:"100",maxAmount:"500000",status:"OPERATIONAL"}}}]}]}]}),Aa=()=>({balances:[{country:"CMR",currency:"XAF",balance:"1250000.00"},{country:"COG",currency:"XAF",balance:"450000.00"},{country:"GAB",currency:"XAF",balance:"780000.00"}]}),La=()=>[{id:"key-001",key:"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA..."}],se=(s=800)=>new Promise(n=>setTimeout(n,s+Math.random()*400));async function Ct(s,n){let d=new TextEncoder,x=await crypto.subtle.importKey("raw",d.encode(n),{name:"HMAC",hash:"SHA-256"},false,["sign"]),g=await crypto.subtle.sign("HMAC",x,d.encode(s));return Array.from(new Uint8Array(g)).map(F=>F.toString(16).padStart(2,"0")).join("")}var ke=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,s=>{let n=Math.random()*16|0;return (s==="x"?n:n&3|8).toString(16)}),_e=[{value:"MTN_MOMO_CMR",label:"MTN Mobile Money",country:"Cameroun"},{value:"ORANGE_CMR",label:"Orange Money",country:"Cameroun"},{value:"MTN_MOMO_COG",label:"MTN Mobile Money",country:"Congo"},{value:"AIRTEL_COG",label:"Airtel Money",country:"Congo"},{value:"MTN_MOMO_GAB",label:"MTN Mobile Money",country:"Gabon"},{value:"AIRTEL_GAB",label:"Airtel Money",country:"Gabon"}],kt=[{value:"XAF",label:"XAF (CFA Franc BEAC)"},{value:"XOF",label:"XOF (CFA Franc BCEAO)"},{value:"GHS",label:"GHS (Ghana Cedi)"},{value:"KES",label:"KES (Kenyan Shilling)"},{value:"RWF",label:"RWF (Rwandan Franc)"},{value:"TZS",label:"TZS (Tanzanian Shilling)"},{value:"UGX",label:"UGX (Ugandan Shilling)"},{value:"ZMW",label:"ZMW (Zambian Kwacha)"}];function Oa({apiKey:s="",environment:n="sandbox",className:d="",demoMode:x=false,apiBasePath:g="/api/pawapay",onDepositComplete:F,onPayoutComplete:_,onError:v}){let[m,K]=react.useState(s),[u,E]=react.useState(n),[l,$]=react.useState(!!s||x),[N,re]=react.useState(x),[M,j]=react.useState("deposit"),[H,ie]=react.useState("237670000000"),[X,be]=react.useState("5000"),[Z,fe]=react.useState("XAF"),[ee,T]=react.useState("MTN_MOMO_CMR"),[Q,ue]=react.useState("Test Payment"),[G,Y]=react.useState(""),[me,U]=react.useState([]),[P,C]=react.useState("idle"),[i,y]=react.useState("whsec_test_secret_key"),[J,te]=react.useState([]),[I,ae]=react.useState("deposit.completed"),[xe,we]=react.useState("5000"),[ve,Ee]=react.useState("237670000000"),[ye,b]=react.useState("MTN_MOMO_CMR"),[B,Dt]=react.useState(""),[Ge,Mt]=react.useState(""),[Ue,It]=react.useState(""),[Se,Rt]=react.useState(""),[Be,At]=react.useState(""),[he,Ve]=react.useState(null),[ze,Lt]=react.useState(""),[le,Ke]=react.useState(null),[Je,$e]=react.useState(""),[pe,Ot]=react.useState("all"),p=react.useCallback((a,c,f,q)=>{let De={id:ke(),operation:a,status:c,response:f,error:q,timestamp:new Date().toLocaleTimeString()};U(Kt=>[De,...Kt].slice(0,20));},[]),Ft=react.useCallback(()=>{if(!m.trim()){p("Configuration","error",void 0,"API Key is required");return}$(true),re(false),p("Configuration","success",{environment:u,configured:true,apiBasePath:g});},[m,u,g,p]),Ht=react.useCallback(()=>{re(true),$(true),p("Configuration","success",{mode:"demo",message:"Demo mode activated - responses are simulated"});},[p]),Wt=react.useCallback(async()=>{if(!(!m&&!N)){C("loading");try{let a=ke();Y(a);let c;if(N)await se(),c=Sa(a);else {let f=await fetch(`${g}/deposit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:m,environment:u,amount:parseFloat(X),currency:Z,provider:ee,phoneNumber:H,customerMessage:Q.slice(0,22),transactionId:a})}),q=await f.json();if(!f.ok)throw new Error(q.error||"Deposit failed");c=q;}C("success"),p("Deposit","success",c),F?.(c);}catch(a){C("error");let c=a instanceof Error?a.message:"Deposit failed";p("Deposit","error",void 0,c),v?.(a instanceof Error?a:new Error(c));}}},[m,g,u,N,X,Z,ee,H,Q,p,F,v]),_t=react.useCallback(async()=>{if(!(!m&&!N)){C("loading");try{let a=ke();Y(a);let c;if(N)await se(),c=Pa(a);else {let f=await fetch(`${g}/payout`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:m,environment:u,amount:parseFloat(X),currency:Z,provider:ee,phoneNumber:H,transactionId:a})}),q=await f.json();if(!f.ok)throw new Error(q.error||"Payout failed");c=q;}C("success"),p("Payout","success",c),_?.(c);}catch(a){C("error");let c=a instanceof Error?a.message:"Payout failed";p("Payout","error",void 0,c),v?.(a instanceof Error?a:new Error(c));}}},[m,g,u,N,X,Z,ee,H,p,_,v]),jt=react.useCallback(async()=>{if(!m&&!N||!G){p("Check Status","error",void 0,"No transaction ID");return}C("loading");try{let a;if(N)await se(),a=Da(G);else {let c=await fetch(`${g}/status`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:m,environment:u,transactionId:G})}),f=await c.json();if(!c.ok)throw new Error(f.error||"Status check failed");a=f;}C("success"),p("Check Status","success",a);}catch(a){C("error");let c=a instanceof Error?a.message:"Status check failed";p("Check Status","error",void 0,c),v?.(a instanceof Error?a:new Error(c));}},[m,g,u,N,G,p,v]),Gt=react.useCallback(async()=>{if(!(!m&&!N)){C("loading");try{let a;if(N)await se(),a=Ma();else {let c=await fetch(`${g}/availability`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:m,environment:u})}),f=await c.json();if(!c.ok)throw new Error(f.error||"Availability check failed");a=f;}C("success"),p("Provider Availability","success",a);}catch(a){C("error");let c=a instanceof Error?a.message:"Availability check failed";p("Provider Availability","error",void 0,c),v?.(a instanceof Error?a:new Error(c));}}},[m,g,u,N,p,v]),Ut=react.useCallback(async()=>{if(!(!m&&!N)){C("loading");try{let a;if(N)await se(),a=Ia(H);else {let c=await fetch(`${g}/predict-provider`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:m,environment:u,phoneNumber:H})}),f=await c.json();if(!c.ok)throw new Error(f.error||"Prediction failed");a=f;}C("success"),p("Predict Provider","success",a);}catch(a){C("error");let c=a instanceof Error?a.message:"Prediction failed";p("Predict Provider","error",void 0,c),v?.(a instanceof Error?a:new Error(c));}}},[m,g,u,N,H,p,v]),Bt=react.useCallback(async()=>{if(!(!m&&!N)){C("loading");try{let a;if(N)await se(),a=Ra();else {let c=await fetch(`${g}/active-config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:m,environment:u})}),f=await c.json();if(!c.ok)throw new Error(f.error||"Failed to get config");a=f;}C("success"),p("Active Configuration","success",a);}catch(a){C("error");let c=a instanceof Error?a.message:"Failed to get config";p("Active Configuration","error",void 0,c),v?.(a instanceof Error?a:new Error(c));}}},[m,g,u,N,p,v]),Vt=react.useCallback(async()=>{if(!(!m&&!N)){C("loading");try{let a;if(N)await se(),a=La();else {let c=await fetch(`${g}/public-keys`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:m,environment:u})}),f=await c.json();if(!c.ok)throw new Error(f.error||"Failed to get public keys");a=f;}C("success"),p("Public Keys","success",a);}catch(a){C("error");let c=a instanceof Error?a.message:"Failed to get public keys";p("Public Keys","error",void 0,c),v?.(a instanceof Error?a:new Error(c));}}},[m,g,u,N,p,v]),zt=react.useCallback(async()=>{if(!(!m&&!N)){C("loading");try{let a;if(N)await se(),a=Aa();else {let c=await fetch(`${g}/wallet-balances`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:m,environment:u})}),f=await c.json();if(!c.ok)throw new Error(f.error||"Failed to get balances");a=f;}C("success"),p("Wallet Balances","success",a);}catch(a){C("error");let c=a instanceof Error?a.message:"Failed to get balances";p("Wallet Balances","error",void 0,c),v?.(a instanceof Error?a:new Error(c));}}},[m,g,u,N,p,v]),Pe=react.useCallback(a=>{navigator.clipboard.writeText(a);},[]);return l?jsxRuntime.jsxs("div",{className:`space-y-6 ${d}`,children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Spaark Pay Console"}),N?jsxRuntime.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-amber-100 text-amber-800 dark:bg-amber-900 dark:text-amber-200",children:"DEMO"}):u==="production"?jsxRuntime.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",children:"PRODUCTION"}):jsxRuntime.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",children:"SANDBOX"})]}),jsxRuntime.jsx("p",{className:"text-muted-foreground mt-1",children:N?"Mode d\xE9mo - Les r\xE9ponses sont simul\xE9es":u==="production"?"Mode production - Transactions r\xE9elles":"Mode sandbox - Environnement de test"})]}),jsxRuntime.jsxs("button",{onClick:()=>$(false),className:"h-8 px-3 text-xs font-medium border border-border bg-background hover:bg-muted transition-colors flex items-center gap-2",children:[jsxRuntime.jsx(je,{}),"Reconfigure"]})]}),jsxRuntime.jsxs("div",{className:"grid lg:grid-cols-3 gap-6",children:[jsxRuntime.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-1 bg-muted p-1",children:[jsxRuntime.jsxs("button",{onClick:()=>j("deposit"),className:`flex-1 min-w-[80px] h-8 px-3 text-xs font-medium transition-colors flex items-center justify-center gap-1.5 ${M==="deposit"?"bg-background text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[jsxRuntime.jsx(Tt,{}),"Deposit"]}),jsxRuntime.jsxs("button",{onClick:()=>j("payout"),className:`flex-1 min-w-[80px] h-8 px-3 text-xs font-medium transition-colors flex items-center justify-center gap-1.5 ${M==="payout"?"bg-background text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[jsxRuntime.jsx(Fa,{}),"Payout"]}),jsxRuntime.jsxs("button",{onClick:()=>j("status"),className:`flex-1 min-w-[80px] h-8 px-3 text-xs font-medium transition-colors flex items-center justify-center gap-1.5 ${M==="status"?"bg-background text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[jsxRuntime.jsx(wt,{}),"Status"]}),jsxRuntime.jsxs("button",{onClick:()=>j("toolkit"),className:`flex-1 min-w-[80px] h-8 px-3 text-xs font-medium transition-colors flex items-center justify-center gap-1.5 ${M==="toolkit"?"bg-background text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[jsxRuntime.jsx(Wa,{}),"Toolkit"]}),jsxRuntime.jsxs("button",{onClick:()=>j("finances"),className:`flex-1 min-w-[80px] h-8 px-3 text-xs font-medium transition-colors flex items-center justify-center gap-1.5 ${M==="finances"?"bg-background text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[jsxRuntime.jsx(_a,{}),"Finances"]}),jsxRuntime.jsxs("button",{onClick:()=>j("webhooks"),className:`flex-1 min-w-[80px] h-8 px-3 text-xs font-medium transition-colors flex items-center justify-center gap-1.5 ${M==="webhooks"?"bg-background text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[jsxRuntime.jsx(Ba,{}),"Webhooks"]})]}),M==="deposit"&&jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Initiate Deposit"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Collect payment from a Mobile Money user"})]}),jsxRuntime.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Phone Number"}),jsxRuntime.jsx("input",{placeholder:"237670000000",value:H,onChange:a=>ie(a.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Amount"}),jsxRuntime.jsx("input",{type:"number",placeholder:"5000",value:X,onChange:a=>be(a.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Currency"}),jsxRuntime.jsx("select",{value:Z,onChange:a=>fe(a.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring",children:kt.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Provider"}),jsxRuntime.jsx("select",{value:ee,onChange:a=>T(a.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring",children:_e.map(a=>jsxRuntime.jsxs("option",{value:a.value,children:[a.label," (",a.country,")"]},a.value))})]}),jsxRuntime.jsxs("div",{className:"space-y-2 sm:col-span-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Customer Message (4-22 chars)"}),jsxRuntime.jsx("input",{placeholder:"Payment description",value:Q,onChange:a=>ue(a.target.value),maxLength:22,className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring"})]})]}),jsxRuntime.jsxs("button",{onClick:Wt,disabled:P==="loading",className:"w-full h-8 px-3 text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 transition-colors flex items-center justify-center gap-2",children:[P==="loading"?jsxRuntime.jsx(ge,{}):jsxRuntime.jsx(Te,{}),"Execute Deposit"]})]}),M==="payout"&&jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Initiate Payout"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Send money to a Mobile Money account"})]}),jsxRuntime.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Recipient Phone"}),jsxRuntime.jsx("input",{placeholder:"237670000000",value:H,onChange:a=>ie(a.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Amount"}),jsxRuntime.jsx("input",{type:"number",placeholder:"5000",value:X,onChange:a=>be(a.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Currency"}),jsxRuntime.jsx("select",{value:Z,onChange:a=>fe(a.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring",children:kt.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Provider"}),jsxRuntime.jsx("select",{value:ee,onChange:a=>T(a.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring",children:_e.map(a=>jsxRuntime.jsxs("option",{value:a.value,children:[a.label," (",a.country,")"]},a.value))})]})]}),jsxRuntime.jsxs("button",{onClick:_t,disabled:P==="loading",className:"w-full h-8 px-3 text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 transition-colors flex items-center justify-center gap-2",children:[P==="loading"?jsxRuntime.jsx(ge,{}):jsxRuntime.jsx(Te,{}),"Execute Payout"]})]}),M==="status"&&jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Check Transaction Status"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Query the status of a transaction"})]}),jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Transaction ID"}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsx("input",{placeholder:"Enter transaction ID (UUID)",value:G,onChange:a=>Y(a.target.value),className:"flex-1 h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring font-mono"}),G&&jsxRuntime.jsx("button",{onClick:()=>Pe(G),className:"w-8 h-8 border border-border bg-background hover:bg-muted transition-colors flex items-center justify-center",title:"Copy to clipboard",children:jsxRuntime.jsx(Et,{})})]})]}),jsxRuntime.jsxs("button",{onClick:jt,disabled:P==="loading"||!G,className:"w-full h-8 px-3 text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 transition-colors flex items-center justify-center gap-2",children:[P==="loading"?jsxRuntime.jsx(ge,{}):jsxRuntime.jsx(wt,{}),"Check Status"]})]})]}),M==="toolkit"&&jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Predict Provider"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Predict the provider from a phone number"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Phone Number"}),jsxRuntime.jsx("input",{placeholder:"+237 670 000 000",value:H,onChange:a=>ie(a.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring"})]}),jsxRuntime.jsxs("button",{onClick:Ut,disabled:P==="loading",className:"w-full h-8 px-3 text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 transition-colors flex items-center justify-center gap-2",children:[P==="loading"?jsxRuntime.jsx(ge,{}):jsxRuntime.jsx(ja,{}),"Predict Provider"]})]}),jsxRuntime.jsxs("div",{className:"grid sm:grid-cols-3 gap-3",children:[jsxRuntime.jsxs("button",{onClick:Gt,disabled:P==="loading",className:"h-10 px-3 text-xs font-medium border border-border bg-background hover:bg-muted disabled:opacity-50 transition-colors flex items-center justify-center gap-2",children:[jsxRuntime.jsx(Ga,{}),"Provider Availability"]}),jsxRuntime.jsxs("button",{onClick:Bt,disabled:P==="loading",className:"h-10 px-3 text-xs font-medium border border-border bg-background hover:bg-muted disabled:opacity-50 transition-colors flex items-center justify-center gap-2",children:[jsxRuntime.jsx(je,{}),"Active Config"]}),jsxRuntime.jsxs("button",{onClick:Vt,disabled:P==="loading",className:"h-10 px-3 text-xs font-medium border border-border bg-background hover:bg-muted disabled:opacity-50 transition-colors flex items-center justify-center gap-2",children:[jsxRuntime.jsx(Ua,{}),"Public Keys"]})]})]}),M==="finances"&&jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Wallet Balances"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"View balances for all your wallets"})]}),jsxRuntime.jsxs("button",{onClick:zt,disabled:P==="loading",className:"w-full h-8 px-3 text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 transition-colors flex items-center justify-center gap-2",children:[P==="loading"?jsxRuntime.jsx(ge,{}):jsxRuntime.jsx(Tt,{}),"Get Wallet Balances"]})]}),jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Statements"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Generate financial statements for your wallets"})]}),jsxRuntime.jsxs("div",{className:"p-4 bg-muted/50 text-xs text-muted-foreground",children:["Statement generation requires callback URL configuration. Use the SDK directly:",jsxRuntime.jsx("pre",{className:"mt-2 p-2 bg-background overflow-x-auto",children:`await sdk.finances.generateStatement({
2
2
  wallet: { country: 'CMR', currency: 'XAF' },
3
3
  callbackUrl: 'https://your-site.com/callback',
4
4
  startDate: '2025-01-01T00:00:00Z',
5
5
  endDate: '2025-01-31T23:59:59Z',
6
- });`})]})]})]}),E==="webhooks"&&jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Webhook Secret"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Configure the secret used for signing webhooks"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Secret Key"}),jsxRuntime.jsx("input",{type:"text",placeholder:"whsec_...",value:$,onChange:t=>se(t.target.value),className:"w-full h-8 px-2.5 text-xs font-mono border border-input bg-transparent rounded-none outline-none focus:border-ring"})]})]}),jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Webhook Simulator"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Generate mock webhook events for testing"})]}),jsxRuntime.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Event Type"}),jsxRuntime.jsx("select",{value:ne,onChange:t=>Ce(t.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring",children:Ke.map(t=>jsxRuntime.jsx("option",{value:t,children:t},t))})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Amount"}),jsxRuntime.jsx("input",{type:"number",placeholder:"5000",value:fe,onChange:t=>ke(t.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Phone Number"}),jsxRuntime.jsx("input",{placeholder:"237670000000",value:be,onChange:t=>b(t.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Provider"}),jsxRuntime.jsx("select",{value:B,onChange:t=>yt(t.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring",children:Fe.map(t=>jsxRuntime.jsxs("option",{value:t.value,children:[t.label," (",t.country,")"]},t.value))})]})]}),jsxRuntime.jsxs("button",{onClick:async()=>{let t=Je(ne,{amount:fe,phoneNumber:be,correspondent:B}),d=JSON.stringify(t,null,2),x=await mt(JSON.stringify(t),$);ht(d),Nt(x);let Q={id:he(),eventType:ne,payload:t,signature:x,receivedAt:new Date().toLocaleTimeString(),isVerified:null};X(Se=>[Q,...Se].slice(0,50)),g("Generate Webhook","success",{eventType:ne,eventId:t.eventId});},className:"w-full h-8 px-3 text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 transition-colors flex items-center justify-center gap-2",children:[jsxRuntime.jsx(Ne,{}),"Generate Event"]}),Te&&jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Generated Payload"}),jsxRuntime.jsx("button",{onClick:()=>Ee(Te),className:"text-xs text-muted-foreground hover:text-foreground",children:"Copy"})]}),jsxRuntime.jsx("pre",{className:"text-xs bg-muted p-3 overflow-x-auto max-h-48",children:Te}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Signature:"}),jsxRuntime.jsx("code",{className:"text-xs bg-muted px-2 py-1 font-mono flex-1 overflow-x-auto",children:je}),jsxRuntime.jsx("button",{onClick:()=>Ee(je),className:"w-8 h-8 border border-border bg-background hover:bg-muted transition-colors flex items-center justify-center",children:jsxRuntime.jsx(bt,{})})]})]})]}),jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Signature Verifier"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Test webhook signature verification"})]}),jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Payload (JSON)"}),jsxRuntime.jsx("textarea",{placeholder:'{"eventId": "...", "eventType": "deposit.completed", ...}',value:_e,onChange:t=>Ct(t.target.value),rows:4,className:"w-full px-2.5 py-2 text-xs font-mono border border-input bg-transparent rounded-none outline-none focus:border-ring resize-none"})]}),jsxRuntime.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Signature"}),jsxRuntime.jsx("input",{placeholder:"HMAC-SHA256 signature",value:we,onChange:t=>kt(t.target.value),className:"w-full h-8 px-2.5 text-xs font-mono border border-input bg-transparent rounded-none outline-none focus:border-ring"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Secret"}),jsxRuntime.jsx("input",{type:"password",placeholder:"whsec_...",value:Ge,onChange:t=>Tt(t.target.value),className:"w-full h-8 px-2.5 text-xs font-mono border border-input bg-transparent rounded-none outline-none focus:border-ring"})]})]}),jsxRuntime.jsxs("button",{onClick:async()=>{try{let t=JSON.parse(_e),d=await mt(JSON.stringify(t),Ge),x=d===we;He(x),g("Verify Signature",x?"success":"error",{isValid:x,expected:d,received:we});}catch{He(false),g("Verify Signature","error",void 0,"Invalid JSON payload");}},className:"w-full h-8 px-3 text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 transition-colors flex items-center justify-center gap-2",children:[jsxRuntime.jsx(Aa,{}),"Verify Signature"]}),xe!==null&&jsxRuntime.jsxs("div",{className:`p-3 text-xs flex items-center gap-2 ${xe?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}`,children:[xe?jsxRuntime.jsx(xt,{className:"text-green-600"}):jsxRuntime.jsx(vt,{className:"text-red-600"}),xe?"Signature is valid":"Signature is invalid"]})]})]}),jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Event Parser"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Parse and analyze raw webhook JSON"})]}),jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Raw JSON"}),jsxRuntime.jsx("textarea",{placeholder:"Paste webhook JSON here...",value:Ue,onChange:t=>wt(t.target.value),rows:4,className:"w-full px-2.5 py-2 text-xs font-mono border border-input bg-transparent rounded-none outline-none focus:border-ring resize-none"})]}),jsxRuntime.jsxs("button",{onClick:()=>{try{let t=JSON.parse(Ue);Be(t),ze(""),g("Parse Event","success",{eventType:t.eventType,eventId:t.eventId});}catch(t){Be(null),ze(t instanceof Error?t.message:"Invalid JSON"),g("Parse Event","error",void 0,"Invalid JSON");}},className:"w-full h-8 px-3 text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 transition-colors flex items-center justify-center gap-2",children:[jsxRuntime.jsx(Ra,{}),"Parse Event"]}),Ve&&jsxRuntime.jsx("div",{className:"p-3 text-xs bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",children:Ve}),ie&&jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[jsxRuntime.jsxs("div",{className:"p-2 bg-muted",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Event ID:"}),jsxRuntime.jsx("p",{className:"font-mono truncate",children:String(ie.eventId??"N/A")})]}),jsxRuntime.jsxs("div",{className:"p-2 bg-muted",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Event Type:"}),jsxRuntime.jsx("p",{className:"font-medium",children:String(ie.eventType??"N/A")})]}),jsxRuntime.jsxs("div",{className:"p-2 bg-muted",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Timestamp:"}),jsxRuntime.jsx("p",{className:"font-mono truncate",children:String(ie.timestamp??"N/A")})]}),jsxRuntime.jsxs("div",{className:"p-2 bg-muted",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Status:"}),jsxRuntime.jsx("p",{className:"font-medium",children:String(ie.data?.status??"N/A")})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Full Data"}),jsxRuntime.jsx("pre",{className:"text-xs bg-muted p-3 overflow-x-auto max-h-48",children:JSON.stringify(ie,null,2)})]})]})]})]}),jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Event Log"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"History of generated webhook events"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("select",{value:ue,onChange:t=>Et(t.target.value),className:"h-8 px-2 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring",children:[jsxRuntime.jsx("option",{value:"all",children:"All"}),jsxRuntime.jsx("option",{value:"deposit",children:"Deposits"}),jsxRuntime.jsx("option",{value:"payout",children:"Payouts"}),jsxRuntime.jsx("option",{value:"refund",children:"Refunds"})]}),P.length>0&&jsxRuntime.jsx("button",{onClick:()=>X([]),className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]})]}),jsxRuntime.jsx("div",{className:"divide-y divide-border max-h-64 overflow-y-auto",children:P.filter(t=>ue==="all"||t.eventType.startsWith(ue)).length===0?jsxRuntime.jsx("div",{className:"p-4 text-center text-muted-foreground text-xs",children:"No events yet. Generate a webhook event to see it here."}):P.filter(t=>ue==="all"||t.eventType.startsWith(ue)).map(t=>jsxRuntime.jsxs("div",{className:"py-3 space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:jsxRuntime.jsx("span",{className:`px-1.5 py-0.5 text-xs font-medium ${t.eventType.includes("completed")?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":t.eventType.includes("failed")?"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200":"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200"}`,children:t.eventType})}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:t.receivedAt})]}),jsxRuntime.jsxs("div",{className:"text-xs text-muted-foreground font-mono truncate",children:["sig: ",t.signature.slice(0,32),"..."]})]},t.id))})]})]})]}),jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Results"}),ce.length>0&&jsxRuntime.jsx("button",{onClick:()=>Z([]),className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]}),jsxRuntime.jsx("div",{className:"border border-border bg-background divide-y divide-border max-h-[600px] overflow-y-auto",children:ce.length===0?jsxRuntime.jsx("div",{className:"p-6 text-center text-muted-foreground text-xs",children:"No results yet. Execute an operation to see results here."}):ce.map(t=>jsxRuntime.jsxs("div",{className:"p-4 space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[t.status==="success"?jsxRuntime.jsx(xt,{className:"text-green-600"}):jsxRuntime.jsx(vt,{className:"text-red-600"}),jsxRuntime.jsx("span",{className:"font-medium text-sm",children:t.operation})]}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:t.timestamp})]}),t.error?jsxRuntime.jsx("p",{className:"text-xs text-red-600",children:t.error}):jsxRuntime.jsx("pre",{className:"text-xs bg-muted p-2 overflow-x-auto max-h-48",children:JSON.stringify(t.response,null,2)})]},t.id))})]})]})]}):jsxRuntime.jsxs("div",{className:`space-y-8 ${c}`,children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Spaark Pay Console"}),jsxRuntime.jsx("p",{className:"text-muted-foreground mt-1",children:"Configurez vos identifiants PawaPay pour commencer"})]}),jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 max-w-md space-y-6",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:"w-10 h-10 bg-muted flex items-center justify-center",children:jsxRuntime.jsx(We,{})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"font-semibold",children:"SDK Configuration"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Enter your API credentials"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"API Key"}),jsxRuntime.jsx("input",{type:"password",placeholder:"pk_sandbox_...",value:p,onChange:t=>H(t.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Environnement"}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsxs("button",{onClick:()=>w("sandbox"),className:`h-8 px-3 text-xs font-medium border transition-colors flex items-center gap-1.5 ${u==="sandbox"?"bg-blue-600 text-white border-blue-600":"bg-background border-border hover:bg-muted"}`,children:[jsxRuntime.jsx("span",{className:`w-2 h-2 rounded-full ${u==="sandbox"?"bg-blue-200":"bg-blue-500"}`}),"Sandbox"]}),jsxRuntime.jsxs("button",{onClick:()=>w("production"),className:`h-8 px-3 text-xs font-medium border transition-colors flex items-center gap-1.5 ${u==="production"?"bg-green-600 text-white border-green-600":"bg-background border-border hover:bg-muted"}`,children:[jsxRuntime.jsx("span",{className:`w-2 h-2 rounded-full ${u==="production"?"bg-green-200":"bg-green-500"}`}),"Production"]})]}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:u==="sandbox"?"Utilisez le sandbox pour tester sans frais r\xE9els":"Attention : les transactions en production sont r\xE9elles"})]}),jsxRuntime.jsxs("button",{onClick:St,className:"w-full h-8 px-3 text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 transition-colors flex items-center justify-center gap-2",children:[jsxRuntime.jsx(Ne,{}),"Initialize SDK"]}),jsxRuntime.jsxs("div",{className:"relative flex items-center py-2",children:[jsxRuntime.jsx("div",{className:"flex-grow border-t border-border"}),jsxRuntime.jsx("span",{className:"flex-shrink mx-3 text-xs text-muted-foreground",children:"ou"}),jsxRuntime.jsx("div",{className:"flex-grow border-t border-border"})]}),jsxRuntime.jsxs("button",{onClick:Pt,className:"w-full h-8 px-3 text-xs font-medium border border-border bg-background hover:bg-muted transition-colors flex items-center justify-center gap-2",children:[jsxRuntime.jsx(wa,{}),"Mode D\xE9mo (sans API key)"]})]})]})]})}var We=()=>jsxRuntime.jsxs("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),Ne=()=>jsxRuntime.jsxs("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]}),gt=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"})}),Ta=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"})}),ft=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),me=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})}),bt=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})}),xt=({className:s=""})=>jsxRuntime.jsx("svg",{className:`w-4 h-4 ${s}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),vt=({className:s=""})=>jsxRuntime.jsx("svg",{className:`w-4 h-4 ${s}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})}),wa=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z"})}),Ea=()=>jsxRuntime.jsxs("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),Sa=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})}),Pa=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),Da=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.393c5.857-5.857 15.355-5.857 21.213 0"})}),Ma=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})}),Ia=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),Aa=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})}),Ra=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})}),Ja=ka;exports.SpaarkPaySdkFinanceDashboard=pa;exports.SpaarkPaySdkTestDashboard=ka;exports.default=Ja;//# sourceMappingURL=react.js.map
6
+ });`})]})]})]}),M==="webhooks"&&jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Webhook Secret"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Configure the secret used for signing webhooks"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Secret Key"}),jsxRuntime.jsx("input",{type:"text",placeholder:"whsec_...",value:i,onChange:a=>y(a.target.value),className:"w-full h-8 px-2.5 text-xs font-mono border border-input bg-transparent rounded-none outline-none focus:border-ring"})]})]}),jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Webhook Simulator"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Generate mock webhook events for testing"})]}),jsxRuntime.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Event Type"}),jsxRuntime.jsx("select",{value:I,onChange:a=>ae(a.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring",children:Qe.map(a=>jsxRuntime.jsx("option",{value:a,children:a},a))})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Amount"}),jsxRuntime.jsx("input",{type:"number",placeholder:"5000",value:xe,onChange:a=>we(a.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Phone Number"}),jsxRuntime.jsx("input",{placeholder:"237670000000",value:ve,onChange:a=>Ee(a.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Provider"}),jsxRuntime.jsx("select",{value:ye,onChange:a=>b(a.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring",children:_e.map(a=>jsxRuntime.jsxs("option",{value:a.value,children:[a.label," (",a.country,")"]},a.value))})]})]}),jsxRuntime.jsxs("button",{onClick:async()=>{let a=Xe(I,{amount:xe,phoneNumber:ve,correspondent:ye}),c=JSON.stringify(a,null,2),f=await Ct(JSON.stringify(a),i);Dt(c),Mt(f);let q={id:ke(),eventType:I,payload:a,signature:f,receivedAt:new Date().toLocaleTimeString(),isVerified:null};te(De=>[q,...De].slice(0,50)),p("Generate Webhook","success",{eventType:I,eventId:a.eventId});},className:"w-full h-8 px-3 text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 transition-colors flex items-center justify-center gap-2",children:[jsxRuntime.jsx(Te,{}),"Generate Event"]}),B&&jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Generated Payload"}),jsxRuntime.jsx("button",{onClick:()=>Pe(B),className:"text-xs text-muted-foreground hover:text-foreground",children:"Copy"})]}),jsxRuntime.jsx("pre",{className:"text-xs bg-muted p-3 overflow-x-auto max-h-48",children:B}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Signature:"}),jsxRuntime.jsx("code",{className:"text-xs bg-muted px-2 py-1 font-mono flex-1 overflow-x-auto",children:Ge}),jsxRuntime.jsx("button",{onClick:()=>Pe(Ge),className:"w-8 h-8 border border-border bg-background hover:bg-muted transition-colors flex items-center justify-center",children:jsxRuntime.jsx(Et,{})})]})]})]}),jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Signature Verifier"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Test webhook signature verification"})]}),jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Payload (JSON)"}),jsxRuntime.jsx("textarea",{placeholder:'{"eventId": "...", "eventType": "deposit.completed", ...}',value:Ue,onChange:a=>It(a.target.value),rows:4,className:"w-full px-2.5 py-2 text-xs font-mono border border-input bg-transparent rounded-none outline-none focus:border-ring resize-none"})]}),jsxRuntime.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Signature"}),jsxRuntime.jsx("input",{placeholder:"HMAC-SHA256 signature",value:Se,onChange:a=>Rt(a.target.value),className:"w-full h-8 px-2.5 text-xs font-mono border border-input bg-transparent rounded-none outline-none focus:border-ring"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Secret"}),jsxRuntime.jsx("input",{type:"password",placeholder:"whsec_...",value:Be,onChange:a=>At(a.target.value),className:"w-full h-8 px-2.5 text-xs font-mono border border-input bg-transparent rounded-none outline-none focus:border-ring"})]})]}),jsxRuntime.jsxs("button",{onClick:async()=>{try{let a=JSON.parse(Ue),c=await Ct(JSON.stringify(a),Be),f=c===Se;Ve(f),p("Verify Signature",f?"success":"error",{isValid:f,expected:c,received:Se});}catch{Ve(false),p("Verify Signature","error",void 0,"Invalid JSON payload");}},className:"w-full h-8 px-3 text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 transition-colors flex items-center justify-center gap-2",children:[jsxRuntime.jsx(Va,{}),"Verify Signature"]}),he!==null&&jsxRuntime.jsxs("div",{className:`p-3 text-xs flex items-center gap-2 ${he?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}`,children:[he?jsxRuntime.jsx(St,{className:"text-green-600"}):jsxRuntime.jsx(Pt,{className:"text-red-600"}),he?"Signature is valid":"Signature is invalid"]})]})]}),jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Event Parser"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Parse and analyze raw webhook JSON"})]}),jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Raw JSON"}),jsxRuntime.jsx("textarea",{placeholder:"Paste webhook JSON here...",value:ze,onChange:a=>Lt(a.target.value),rows:4,className:"w-full px-2.5 py-2 text-xs font-mono border border-input bg-transparent rounded-none outline-none focus:border-ring resize-none"})]}),jsxRuntime.jsxs("button",{onClick:()=>{try{let a=JSON.parse(ze);Ke(a),$e(""),p("Parse Event","success",{eventType:a.eventType,eventId:a.eventId});}catch(a){Ke(null),$e(a instanceof Error?a.message:"Invalid JSON"),p("Parse Event","error",void 0,"Invalid JSON");}},className:"w-full h-8 px-3 text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 transition-colors flex items-center justify-center gap-2",children:[jsxRuntime.jsx(za,{}),"Parse Event"]}),Je&&jsxRuntime.jsx("div",{className:"p-3 text-xs bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",children:Je}),le&&jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[jsxRuntime.jsxs("div",{className:"p-2 bg-muted",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Event ID:"}),jsxRuntime.jsx("p",{className:"font-mono truncate",children:String(le.eventId??"N/A")})]}),jsxRuntime.jsxs("div",{className:"p-2 bg-muted",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Event Type:"}),jsxRuntime.jsx("p",{className:"font-medium",children:String(le.eventType??"N/A")})]}),jsxRuntime.jsxs("div",{className:"p-2 bg-muted",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Timestamp:"}),jsxRuntime.jsx("p",{className:"font-mono truncate",children:String(le.timestamp??"N/A")})]}),jsxRuntime.jsxs("div",{className:"p-2 bg-muted",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Status:"}),jsxRuntime.jsx("p",{className:"font-medium",children:String(le.data?.status??"N/A")})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Full Data"}),jsxRuntime.jsx("pre",{className:"text-xs bg-muted p-3 overflow-x-auto max-h-48",children:JSON.stringify(le,null,2)})]})]})]})]}),jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Event Log"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"History of generated webhook events"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("select",{value:pe,onChange:a=>Ot(a.target.value),className:"h-8 px-2 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring",children:[jsxRuntime.jsx("option",{value:"all",children:"All"}),jsxRuntime.jsx("option",{value:"deposit",children:"Deposits"}),jsxRuntime.jsx("option",{value:"payout",children:"Payouts"}),jsxRuntime.jsx("option",{value:"refund",children:"Refunds"})]}),J.length>0&&jsxRuntime.jsx("button",{onClick:()=>te([]),className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]})]}),jsxRuntime.jsx("div",{className:"divide-y divide-border max-h-64 overflow-y-auto",children:J.filter(a=>pe==="all"||a.eventType.startsWith(pe)).length===0?jsxRuntime.jsx("div",{className:"p-4 text-center text-muted-foreground text-xs",children:"No events yet. Generate a webhook event to see it here."}):J.filter(a=>pe==="all"||a.eventType.startsWith(pe)).map(a=>jsxRuntime.jsxs("div",{className:"py-3 space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:jsxRuntime.jsx("span",{className:`px-1.5 py-0.5 text-xs font-medium ${a.eventType.includes("completed")?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":a.eventType.includes("failed")?"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200":"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200"}`,children:a.eventType})}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:a.receivedAt})]}),jsxRuntime.jsxs("div",{className:"text-xs text-muted-foreground font-mono truncate",children:["sig: ",a.signature.slice(0,32),"..."]})]},a.id))})]})]})]}),jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Results"}),me.length>0&&jsxRuntime.jsx("button",{onClick:()=>U([]),className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]}),jsxRuntime.jsx("div",{className:"border border-border bg-background divide-y divide-border max-h-[600px] overflow-y-auto",children:me.length===0?jsxRuntime.jsx("div",{className:"p-6 text-center text-muted-foreground text-xs",children:"No results yet. Execute an operation to see results here."}):me.map(a=>jsxRuntime.jsxs("div",{className:"p-4 space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[a.status==="success"?jsxRuntime.jsx(St,{className:"text-green-600"}):jsxRuntime.jsx(Pt,{className:"text-red-600"}),jsxRuntime.jsx("span",{className:"font-medium text-sm",children:a.operation})]}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:a.timestamp})]}),a.error?jsxRuntime.jsx("p",{className:"text-xs text-red-600",children:a.error}):jsxRuntime.jsx("pre",{className:"text-xs bg-muted p-2 overflow-x-auto max-h-48",children:JSON.stringify(a.response,null,2)})]},a.id))})]})]})]}):jsxRuntime.jsxs("div",{className:`space-y-8 ${d}`,children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Spaark Pay Console"}),jsxRuntime.jsx("p",{className:"text-muted-foreground mt-1",children:"Configurez vos identifiants PawaPay pour commencer"})]}),jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 max-w-md space-y-6",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:"w-10 h-10 bg-muted flex items-center justify-center",children:jsxRuntime.jsx(je,{})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"font-semibold",children:"SDK Configuration"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Enter your API credentials"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"API Key"}),jsxRuntime.jsx("input",{type:"password",placeholder:"pk_sandbox_...",value:m,onChange:a=>K(a.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Environnement"}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsxs("button",{onClick:()=>E("sandbox"),className:`h-8 px-3 text-xs font-medium border transition-colors flex items-center gap-1.5 ${u==="sandbox"?"bg-blue-600 text-white border-blue-600":"bg-background border-border hover:bg-muted"}`,children:[jsxRuntime.jsx("span",{className:`w-2 h-2 rounded-full ${u==="sandbox"?"bg-blue-200":"bg-blue-500"}`}),"Sandbox"]}),jsxRuntime.jsxs("button",{onClick:()=>E("production"),className:`h-8 px-3 text-xs font-medium border transition-colors flex items-center gap-1.5 ${u==="production"?"bg-green-600 text-white border-green-600":"bg-background border-border hover:bg-muted"}`,children:[jsxRuntime.jsx("span",{className:`w-2 h-2 rounded-full ${u==="production"?"bg-green-200":"bg-green-500"}`}),"Production"]})]}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:u==="sandbox"?"Utilisez le sandbox pour tester sans frais r\xE9els":"Attention : les transactions en production sont r\xE9elles"})]}),jsxRuntime.jsxs("button",{onClick:Ft,className:"w-full h-8 px-3 text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 transition-colors flex items-center justify-center gap-2",children:[jsxRuntime.jsx(Te,{}),"Initialize SDK"]}),jsxRuntime.jsxs("div",{className:"relative flex items-center py-2",children:[jsxRuntime.jsx("div",{className:"flex-grow border-t border-border"}),jsxRuntime.jsx("span",{className:"flex-shrink mx-3 text-xs text-muted-foreground",children:"ou"}),jsxRuntime.jsx("div",{className:"flex-grow border-t border-border"})]}),jsxRuntime.jsxs("button",{onClick:Ht,className:"w-full h-8 px-3 text-xs font-medium border border-border bg-background hover:bg-muted transition-colors flex items-center justify-center gap-2",children:[jsxRuntime.jsx(Ha,{}),"Mode D\xE9mo (sans API key)"]})]})]})]})}var je=()=>jsxRuntime.jsxs("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),Te=()=>jsxRuntime.jsxs("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]}),Tt=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"})}),Fa=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"})}),wt=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),ge=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})}),Et=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})}),St=({className:s=""})=>jsxRuntime.jsx("svg",{className:`w-4 h-4 ${s}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),Pt=({className:s=""})=>jsxRuntime.jsx("svg",{className:`w-4 h-4 ${s}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})}),Ha=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z"})}),Wa=()=>jsxRuntime.jsxs("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),_a=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})}),ja=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),Ga=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.393c5.857-5.857 15.355-5.857 21.213 0"})}),Ua=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})}),Ba=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),Va=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})}),za=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})}),ro=Oa;exports.SpaarkPaySdkFinanceDashboard=Ea;exports.SpaarkPaySdkTestDashboard=Oa;exports.default=ro;//# sourceMappingURL=react.js.map
7
7
  //# sourceMappingURL=react.js.map