braid-ui 1.0.37 → 1.0.39

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/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import * as React15 from 'react';
2
- import React15__default, { useState, useEffect, useCallback, useMemo } from 'react';
2
+ import { useState, useEffect, useCallback, useMemo } from 'react';
3
3
  import { cva } from 'class-variance-authority';
4
4
  import { clsx } from 'clsx';
5
5
  import { twMerge } from 'tailwind-merge';
6
6
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
- import { ChevronDown, ChevronUp, Check, X, PanelLeft, Edit, Home, Globe, CreditCard, Building, MoreVertical, Minus, TrendingDown, TrendingUp, Wallet, ChevronRight, Eye, Trash2, Plus, MessageSquare, Upload, FileText, Download, Copy, LayoutDashboard, Bell, Briefcase, FileCheck, Receipt, ArrowLeftRight, Users, Building2, Shield, AlertCircle, RefreshCw, Landmark, Search, Repeat, Zap, Box, Settings, BarChart3, Key, ChevronLeft, AlertTriangle, XCircle, CheckCircle, Clock, Ban, Circle, Filter, User, Loader2, ArrowDownRight, ArrowUpRight, CheckCircle2, StickyNote, FileUp, RotateCcw, Send, PlayCircle, UserPlus, ChevronsUpDown, UserCheck, CalendarIcon, Package, FileJson, DollarSign } from 'lucide-react';
7
+ import { ChevronDown, ChevronUp, Check, X, PanelLeft, Edit, Home, Globe, CreditCard, Building, MoreVertical, Minus, TrendingDown, TrendingUp, ChevronRight, Eye, Trash2, Plus, MessageSquare, Upload, FileText, Download, Copy, LayoutDashboard, Bell, Briefcase, FileCheck, Receipt, ArrowLeftRight, Users, Building2, Shield, AlertCircle, RefreshCw, Landmark, Search, Repeat, Zap, Box, Settings, BarChart3, Key, ChevronLeft, AlertTriangle, XCircle, CheckCircle, Clock, Ban, Circle, Wallet, Filter, User, Loader2, ArrowDownRight, ArrowUpRight, CheckCircle2, StickyNote, FileUp, RotateCcw, Send, PlayCircle, UserPlus, ChevronsUpDown, UserCheck, CalendarIcon, Package, FileJson, DollarSign } from 'lucide-react';
8
8
  import { createPortal } from 'react-dom';
9
9
  import { Slot } from '@radix-ui/react-slot';
10
10
  import * as SelectPrimitive from '@radix-ui/react-select';
@@ -18,14 +18,14 @@ import { z } from 'zod';
18
18
  import { Collapsible, CollapsibleTrigger, CollapsibleContent } from '@radix-ui/react-collapsible';
19
19
  import * as SeparatorPrimitive from '@radix-ui/react-separator';
20
20
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
21
- import { format } from 'date-fns';
21
+ import { parseISO, isBefore, startOfDay, isAfter, endOfDay, format } from 'date-fns';
22
22
  import { DayPicker } from 'react-day-picker';
23
23
  import * as PopoverPrimitive from '@radix-ui/react-popover';
24
+ import { Toaster as Toaster$1, toast as toast$1 } from 'sonner';
24
25
  import * as LabelPrimitive from '@radix-ui/react-label';
25
26
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
26
27
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
27
28
  import { useTheme } from 'next-themes';
28
- import { Toaster as Toaster$1, toast as toast$1 } from 'sonner';
29
29
  import * as TabsPrimitive from '@radix-ui/react-tabs';
30
30
  import * as ToastPrimitives from '@radix-ui/react-toast';
31
31
 
@@ -524,8 +524,8 @@ var reducer = (state, action) => {
524
524
  if (toastId) {
525
525
  addToRemoveQueue(toastId);
526
526
  } else {
527
- state.toasts.forEach((toast4) => {
528
- addToRemoveQueue(toast4.id);
527
+ state.toasts.forEach((toast5) => {
528
+ addToRemoveQueue(toast5.id);
529
529
  });
530
530
  }
531
531
  return {
@@ -3556,24 +3556,26 @@ var BusinessProfileCard = ({
3556
3556
  }
3557
3557
  )
3558
3558
  ] }),
3559
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: /* @__PURE__ */ jsx(
3560
- FormInput,
3561
- {
3562
- name: "achCompanyId",
3563
- label: "ACH Company ID",
3564
- placeholder: "10-digit company ID"
3565
- }
3566
- ) }),
3567
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: /* @__PURE__ */ jsx(
3568
- FormInput,
3569
- {
3570
- name: "productId",
3571
- label: "Product ID",
3572
- type: "number",
3573
- placeholder: "Product ID",
3574
- disabled: true
3575
- }
3576
- ) }),
3559
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
3560
+ /* @__PURE__ */ jsx(
3561
+ FormInput,
3562
+ {
3563
+ name: "achCompanyId",
3564
+ label: "ACH Company ID",
3565
+ placeholder: "10-digit company ID"
3566
+ }
3567
+ ),
3568
+ /* @__PURE__ */ jsx(
3569
+ FormInput,
3570
+ {
3571
+ name: "productId",
3572
+ label: "Product ID",
3573
+ type: "number",
3574
+ placeholder: "Product ID",
3575
+ disabled: true
3576
+ }
3577
+ )
3578
+ ] }),
3577
3579
  /* @__PURE__ */ jsx("h4", { className: "text-sm font-medium text-muted-foreground mt-6", children: "Contact Person" }),
3578
3580
  /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
3579
3581
  /* @__PURE__ */ jsx(
@@ -3632,6 +3634,34 @@ var BusinessProfileCard = ({
3632
3634
  /* @__PURE__ */ jsx(InfoField, { label: "Website", value: formValues?.website || "-", layout: "horizontal" })
3633
3635
  ] }),
3634
3636
  /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-4", children: /* @__PURE__ */ jsx(InfoField, { label: "Business Phone", value: formValues?.mobilePhone || "-", layout: "horizontal" }) }),
3637
+ /* @__PURE__ */ jsx(
3638
+ InfoField,
3639
+ {
3640
+ label: "Address",
3641
+ value: formValues?.address ? (() => {
3642
+ const parts = [];
3643
+ if (formValues.address.line1) parts.push(formValues.address.line1);
3644
+ if (formValues.address.line2) parts.push(formValues.address.line2);
3645
+ const cityStateZip = [
3646
+ formValues.address.city,
3647
+ formValues.address.state,
3648
+ formValues.address.postalCode
3649
+ ].filter(Boolean).join(" ");
3650
+ if (cityStateZip) parts.push(cityStateZip);
3651
+ if (formValues.address.countryCode) parts.push(formValues.address.countryCode);
3652
+ return parts.length > 0 ? parts.join(", ") : "-";
3653
+ })() : "-",
3654
+ layout: "horizontal"
3655
+ }
3656
+ ),
3657
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
3658
+ /* @__PURE__ */ jsx(InfoField, { label: "MCC", value: formValues?.mcc || "-", layout: "horizontal" }),
3659
+ /* @__PURE__ */ jsx(InfoField, { label: "NAICS", value: formValues?.naics || "-", layout: "horizontal" })
3660
+ ] }),
3661
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
3662
+ /* @__PURE__ */ jsx(InfoField, { label: "ACH Company ID", value: formValues?.achCompanyId || "-", layout: "horizontal" }),
3663
+ /* @__PURE__ */ jsx(InfoField, { label: "Product ID", value: formValues?.productId?.toString() || "-", layout: "horizontal" })
3664
+ ] }),
3635
3665
  /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
3636
3666
  /* @__PURE__ */ jsx(
3637
3667
  InfoField,
@@ -3657,32 +3687,6 @@ var BusinessProfileCard = ({
3657
3687
  }
3658
3688
  )
3659
3689
  ] }),
3660
- /* @__PURE__ */ jsx(
3661
- InfoField,
3662
- {
3663
- label: "Address",
3664
- value: formValues?.address ? (() => {
3665
- const parts = [];
3666
- if (formValues.address.line1) parts.push(formValues.address.line1);
3667
- if (formValues.address.line2) parts.push(formValues.address.line2);
3668
- const cityStateZip = [
3669
- formValues.address.city,
3670
- formValues.address.state,
3671
- formValues.address.postalCode
3672
- ].filter(Boolean).join(" ");
3673
- if (cityStateZip) parts.push(cityStateZip);
3674
- if (formValues.address.countryCode) parts.push(formValues.address.countryCode);
3675
- return parts.length > 0 ? parts.join(", ") : "-";
3676
- })() : "-",
3677
- layout: "horizontal"
3678
- }
3679
- ),
3680
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
3681
- /* @__PURE__ */ jsx(InfoField, { label: "MCC", value: formValues?.mcc || "-", layout: "horizontal" }),
3682
- /* @__PURE__ */ jsx(InfoField, { label: "NAICS", value: formValues?.naics || "-", layout: "horizontal" })
3683
- ] }),
3684
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-4", children: /* @__PURE__ */ jsx(InfoField, { label: "ACH Company ID", value: formValues?.achCompanyId || "-", layout: "horizontal" }) }),
3685
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-4", children: /* @__PURE__ */ jsx(InfoField, { label: "Product ID", value: formValues?.productId?.toString() || "-", layout: "horizontal" }) }),
3686
3690
  /* @__PURE__ */ jsx("h4", { className: "text-sm font-medium text-muted-foreground mt-6", children: "Contact Person" }),
3687
3691
  /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
3688
3692
  /* @__PURE__ */ jsx(InfoField, { label: "First Name", value: formValues?.contactPersonFirstName || "-", layout: "horizontal" }),
@@ -4256,93 +4260,575 @@ var PageLayout = React15.forwardRef(
4256
4260
  }
4257
4261
  );
4258
4262
  PageLayout.displayName = "PageLayout";
4259
- var UBOCard = ({ ubos, onUBOClick }) => {
4260
- const columns3 = [
4261
- {
4262
- key: "name",
4263
- title: "Name",
4264
- sortable: true,
4265
- width: "40%",
4266
- render: (value, row) => /* @__PURE__ */ jsx(
4267
- "button",
4268
- {
4269
- onClick: () => onUBOClick(row.customerId),
4270
- className: "text-primary hover:underline font-medium text-left",
4271
- children: value
4272
- }
4273
- )
4274
- },
4275
- {
4276
- key: "title",
4277
- title: "Title",
4278
- sortable: true,
4279
- width: "40%"
4280
- },
4281
- {
4282
- key: "ownershipPercentage",
4283
- title: "Ownership %",
4284
- sortable: true,
4285
- width: "20%",
4286
- align: "right",
4287
- render: (value) => `${value}%`
4288
- }
4289
- ];
4290
- return /* @__PURE__ */ jsxs(Card, { children: [
4291
- /* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
4292
- /* @__PURE__ */ jsx(CardTitle, { children: "Ultimate Beneficial Owners (UBO)" }),
4293
- /* @__PURE__ */ jsxs(Button, { size: "sm", variant: "ghost", children: [
4294
- /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4 mr-1" }),
4295
- "Add UBO"
4296
- ] })
4297
- ] }),
4298
- /* @__PURE__ */ jsx(CardContent, { children: ubos.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
4299
- /* @__PURE__ */ jsx(Users, { className: "h-5 w-5 opacity-50" }),
4300
- /* @__PURE__ */ jsx("p", { children: "No UBOs recorded" })
4301
- ] }) : /* @__PURE__ */ jsx(
4302
- DataTable,
4263
+ var FormField = React15.forwardRef(
4264
+ ({ label, description, error, required, children, className, layout = "vertical" }, ref) => {
4265
+ const isHorizontal = layout === "horizontal";
4266
+ return /* @__PURE__ */ jsxs(
4267
+ "div",
4303
4268
  {
4304
- columns: columns3,
4305
- data: ubos
4269
+ ref,
4270
+ className: cn(
4271
+ "space-y-2",
4272
+ isHorizontal && "grid grid-cols-1 md:grid-cols-3 gap-4 items-start space-y-0",
4273
+ className
4274
+ ),
4275
+ children: [
4276
+ label && /* @__PURE__ */ jsxs("div", { className: cn("space-y-1", isHorizontal && "pt-2"), children: [
4277
+ /* @__PURE__ */ jsxs("label", { className: "text-sm font-medium text-foreground", children: [
4278
+ label,
4279
+ required && /* @__PURE__ */ jsx("span", { className: "text-destructive ml-1", children: "*" })
4280
+ ] }),
4281
+ description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: description })
4282
+ ] }),
4283
+ /* @__PURE__ */ jsxs("div", { className: cn(isHorizontal && "md:col-span-2"), children: [
4284
+ children,
4285
+ error && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive mt-1", children: error })
4286
+ ] })
4287
+ ]
4306
4288
  }
4307
- ) })
4308
- ] });
4289
+ );
4290
+ }
4291
+ );
4292
+ FormField.displayName = "FormField";
4293
+ var spacingClasses = {
4294
+ sm: "space-y-3",
4295
+ md: "space-y-4",
4296
+ lg: "space-y-6"
4309
4297
  };
4310
- var BusinessDocuments = ({ businessId, documents, onDocumentUpload }) => {
4311
- const [isUploading, setIsUploading] = useState(false);
4312
- const [showUploadDialog, setShowUploadDialog] = useState(false);
4313
- const [selectedFile, setSelectedFile] = useState(null);
4314
- const [documentName, setDocumentName] = useState("");
4315
- const [description, setDescription] = useState("");
4316
- const [documentType, setDocumentType] = useState("");
4317
- const handleFileSelect = (e) => {
4318
- const file = e.target.files?.[0];
4319
- if (!file) return;
4320
- setSelectedFile(file);
4321
- setDocumentName(file.name);
4322
- };
4323
- const handleUploadSubmit = async () => {
4324
- if (!selectedFile || !documentName || !documentType) {
4325
- toast({
4326
- title: "Missing Information",
4327
- description: "Please fill in all required fields",
4328
- variant: "destructive"
4329
- });
4330
- return;
4298
+ var gridClasses = {
4299
+ 1: "grid-cols-1",
4300
+ 2: "grid-cols-1 md:grid-cols-2",
4301
+ 3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3",
4302
+ 4: "grid-cols-1 md:grid-cols-2 lg:grid-cols-4"
4303
+ };
4304
+ var FormSection = React15.forwardRef(
4305
+ ({
4306
+ title,
4307
+ description,
4308
+ children,
4309
+ className,
4310
+ spacing: spacing2 = "md",
4311
+ layout = "vertical",
4312
+ columns: columns3 = 2
4313
+ }, ref) => {
4314
+ return /* @__PURE__ */ jsxs("div", { ref, className: cn("space-y-4", className), children: [
4315
+ (title || description) && /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
4316
+ title && /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold text-foreground", children: title }),
4317
+ description && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: description })
4318
+ ] }),
4319
+ /* @__PURE__ */ jsx("div", { className: cn(
4320
+ layout === "grid" ? `grid gap-4 ${gridClasses[columns3]}` : spacingClasses[spacing2]
4321
+ ), children })
4322
+ ] });
4323
+ }
4324
+ );
4325
+ FormSection.displayName = "FormSection";
4326
+ function Calendar({
4327
+ className,
4328
+ classNames,
4329
+ showOutsideDays = true,
4330
+ ...props
4331
+ }) {
4332
+ return /* @__PURE__ */ jsx(
4333
+ DayPicker,
4334
+ {
4335
+ showOutsideDays,
4336
+ className: cn("p-3 pointer-events-auto", className),
4337
+ classNames: {
4338
+ months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
4339
+ month: "space-y-4",
4340
+ caption: "flex justify-center pt-1 relative items-center",
4341
+ caption_label: "text-sm font-medium",
4342
+ nav: "space-x-1 flex items-center",
4343
+ button_previous: "absolute left-1 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",
4344
+ button_next: "absolute right-1 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",
4345
+ month_grid: "w-full border-collapse space-y-1",
4346
+ weekdays: "flex",
4347
+ weekday: "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
4348
+ week: "flex w-full mt-2",
4349
+ day: "h-9 w-9 text-center text-sm p-0 relative hover:bg-accent hover:text-accent-foreground rounded-md",
4350
+ day_button: cn(
4351
+ buttonVariants({ variant: "ghost" }),
4352
+ "h-9 w-9 p-0 font-normal"
4353
+ ),
4354
+ selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground",
4355
+ today: "bg-accent text-accent-foreground",
4356
+ outside: "text-muted-foreground opacity-50",
4357
+ disabled: "text-muted-foreground opacity-50",
4358
+ hidden: "invisible",
4359
+ ...classNames
4360
+ },
4361
+ ...props
4331
4362
  }
4332
- setIsUploading(true);
4333
- try {
4334
- await onDocumentUpload(selectedFile, {
4335
- name: documentName,
4336
- description,
4337
- type: documentType
4338
- });
4339
- toast({
4340
- title: "Upload Successful",
4341
- description: `${documentName} uploaded successfully`
4342
- });
4343
- setShowUploadDialog(false);
4344
- resetForm();
4345
- } catch (error) {
4363
+ );
4364
+ }
4365
+ Calendar.displayName = "Calendar";
4366
+ var Popover = PopoverPrimitive.Root;
4367
+ var PopoverTrigger = PopoverPrimitive.Trigger;
4368
+ var PopoverContent = React15.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
4369
+ PopoverPrimitive.Content,
4370
+ {
4371
+ ref,
4372
+ align,
4373
+ sideOffset,
4374
+ className: cn(
4375
+ "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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",
4376
+ className
4377
+ ),
4378
+ ...props
4379
+ }
4380
+ ) }));
4381
+ PopoverContent.displayName = PopoverPrimitive.Content.displayName;
4382
+ function DatePicker({
4383
+ date,
4384
+ onDateChange,
4385
+ placeholder = "Pick a date",
4386
+ disabled = false,
4387
+ className,
4388
+ buttonClassName,
4389
+ calendarClassName,
4390
+ align = "start",
4391
+ disabledDates,
4392
+ label,
4393
+ wrapperClassName
4394
+ }) {
4395
+ const [open, setOpen] = React15.useState(false);
4396
+ const handleSelect = (selectedDate) => {
4397
+ onDateChange?.(selectedDate);
4398
+ setOpen(false);
4399
+ };
4400
+ const picker = /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
4401
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
4402
+ Button,
4403
+ {
4404
+ variant: "outline",
4405
+ disabled,
4406
+ className: cn(
4407
+ "justify-start text-left font-normal",
4408
+ !date && "text-muted-foreground",
4409
+ buttonClassName
4410
+ ),
4411
+ children: [
4412
+ /* @__PURE__ */ jsx(CalendarIcon, { className: "mr-2 h-4 w-4" }),
4413
+ date ? format(date, "MM/dd/yyyy") : placeholder
4414
+ ]
4415
+ }
4416
+ ) }),
4417
+ /* @__PURE__ */ jsx(PopoverContent, { className: cn("w-auto p-0", className), align, children: /* @__PURE__ */ jsx(
4418
+ Calendar,
4419
+ {
4420
+ mode: "single",
4421
+ selected: date,
4422
+ onSelect: handleSelect,
4423
+ disabled: disabledDates,
4424
+ initialFocus: true,
4425
+ className: cn("pointer-events-auto", calendarClassName)
4426
+ }
4427
+ ) })
4428
+ ] });
4429
+ if (label) {
4430
+ return /* @__PURE__ */ jsxs("div", { className: cn("space-y-2", wrapperClassName), children: [
4431
+ /* @__PURE__ */ jsx("label", { className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: label }),
4432
+ picker
4433
+ ] });
4434
+ }
4435
+ return picker;
4436
+ }
4437
+ var uboSchema = z.object({
4438
+ legalFirstName: z.string().min(1, "Legal first name is required"),
4439
+ legalLastName: z.string().min(1, "Legal last name is required"),
4440
+ email: z.string().email("Invalid email address"),
4441
+ title: z.string().min(1, "Title is required"),
4442
+ ownershipPercentage: z.number().min(0).max(100, "Must be between 0 and 100"),
4443
+ idNumber: z.string().min(1, "ID number is required"),
4444
+ ssn: z.string().min(1, "SSN is required"),
4445
+ dateOfBirth: z.date({
4446
+ message: "Date of birth is required"
4447
+ }),
4448
+ street: z.string().min(1, "Street is required"),
4449
+ apartment: z.string().optional(),
4450
+ city: z.string().min(1, "City is required"),
4451
+ state: z.string().min(1, "State is required"),
4452
+ country: z.string().min(1, "Country is required")
4453
+ });
4454
+ var titleOptions = [
4455
+ { value: "CEO", label: "CEO" },
4456
+ { value: "CFO", label: "CFO" },
4457
+ { value: "CTO", label: "CTO" },
4458
+ { value: "COO", label: "COO" },
4459
+ { value: "President", label: "President" },
4460
+ { value: "Vice President", label: "Vice President" },
4461
+ { value: "Director", label: "Director" },
4462
+ { value: "Manager", label: "Manager" },
4463
+ { value: "Board Member", label: "Board Member" },
4464
+ { value: "Partner", label: "Partner" },
4465
+ { value: "Other", label: "Other" }
4466
+ ];
4467
+ var AddUBODialog = ({ open, onOpenChange, onSubmit }) => {
4468
+ const [isSubmitting, setIsSubmitting] = useState(false);
4469
+ const form = useForm({
4470
+ resolver: zodResolver(uboSchema),
4471
+ defaultValues: {
4472
+ legalFirstName: "",
4473
+ legalLastName: "",
4474
+ email: "",
4475
+ title: "",
4476
+ ownershipPercentage: 0,
4477
+ idNumber: "",
4478
+ ssn: "",
4479
+ street: "",
4480
+ apartment: "",
4481
+ city: "",
4482
+ state: "",
4483
+ country: "US"
4484
+ }
4485
+ });
4486
+ const handleSubmit = async (data) => {
4487
+ setIsSubmitting(true);
4488
+ try {
4489
+ await onSubmit(data);
4490
+ form.reset();
4491
+ onOpenChange(false);
4492
+ } catch (error) {
4493
+ console.error("Error adding UBO:", error);
4494
+ } finally {
4495
+ setIsSubmitting(false);
4496
+ }
4497
+ };
4498
+ const handleCancel = () => {
4499
+ form.reset();
4500
+ onOpenChange(false);
4501
+ };
4502
+ return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs(DialogContent, { className: "max-w-3xl max-h-[90vh] overflow-y-auto", children: [
4503
+ /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: "Add Ultimate Beneficial Owner" }) }),
4504
+ /* @__PURE__ */ jsx(FormProvider$1, { ...form, children: /* @__PURE__ */ jsxs("form", { onSubmit: form.handleSubmit(handleSubmit), className: "space-y-6", children: [
4505
+ /* @__PURE__ */ jsxs(FormSection, { layout: "grid", columns: 2, spacing: "md", children: [
4506
+ /* @__PURE__ */ jsx(
4507
+ FormInput,
4508
+ {
4509
+ name: "legalFirstName",
4510
+ label: "Legal first name",
4511
+ placeholder: "Enter first name"
4512
+ }
4513
+ ),
4514
+ /* @__PURE__ */ jsx(
4515
+ FormInput,
4516
+ {
4517
+ name: "legalLastName",
4518
+ label: "Legal last name",
4519
+ placeholder: "Enter last name"
4520
+ }
4521
+ )
4522
+ ] }),
4523
+ /* @__PURE__ */ jsx(FormSection, { layout: "vertical", spacing: "md", children: /* @__PURE__ */ jsx(
4524
+ FormInput,
4525
+ {
4526
+ name: "email",
4527
+ label: "Email",
4528
+ type: "email",
4529
+ placeholder: "Enter email address"
4530
+ }
4531
+ ) }),
4532
+ /* @__PURE__ */ jsxs(FormSection, { layout: "grid", columns: 2, spacing: "md", children: [
4533
+ /* @__PURE__ */ jsx(
4534
+ FormSelect,
4535
+ {
4536
+ name: "title",
4537
+ label: "Title",
4538
+ placeholder: "Select title",
4539
+ options: titleOptions
4540
+ }
4541
+ ),
4542
+ /* @__PURE__ */ jsx(
4543
+ FormInput,
4544
+ {
4545
+ name: "ownershipPercentage",
4546
+ label: "Ownership %",
4547
+ type: "number",
4548
+ placeholder: "Enter ownership percentage"
4549
+ }
4550
+ )
4551
+ ] }),
4552
+ /* @__PURE__ */ jsxs(FormSection, { layout: "grid", columns: 2, spacing: "md", children: [
4553
+ /* @__PURE__ */ jsx(
4554
+ FormInput,
4555
+ {
4556
+ name: "idNumber",
4557
+ label: "ID Number",
4558
+ placeholder: "Enter ID number"
4559
+ }
4560
+ ),
4561
+ /* @__PURE__ */ jsx(
4562
+ FormInput,
4563
+ {
4564
+ name: "ssn",
4565
+ label: "SSN",
4566
+ placeholder: "Enter SSN"
4567
+ }
4568
+ )
4569
+ ] }),
4570
+ /* @__PURE__ */ jsx(FormSection, { layout: "vertical", spacing: "md", children: /* @__PURE__ */ jsx(FormField, { label: "Date of birth", children: /* @__PURE__ */ jsx(
4571
+ Controller,
4572
+ {
4573
+ name: "dateOfBirth",
4574
+ control: form.control,
4575
+ render: ({ field }) => /* @__PURE__ */ jsx(
4576
+ DatePicker,
4577
+ {
4578
+ date: field.value,
4579
+ onDateChange: field.onChange,
4580
+ placeholder: "MM/DD/YYYY"
4581
+ }
4582
+ )
4583
+ }
4584
+ ) }) }),
4585
+ /* @__PURE__ */ jsxs(FormSection, { title: "Address Details", layout: "vertical", spacing: "md", children: [
4586
+ /* @__PURE__ */ jsx(
4587
+ FormInput,
4588
+ {
4589
+ name: "street",
4590
+ label: "Street",
4591
+ placeholder: "Enter street address"
4592
+ }
4593
+ ),
4594
+ /* @__PURE__ */ jsx(
4595
+ FormInput,
4596
+ {
4597
+ name: "apartment",
4598
+ label: "Apartment, suite, or floor",
4599
+ placeholder: "Enter apartment, suite, or floor (optional)"
4600
+ }
4601
+ ),
4602
+ /* @__PURE__ */ jsxs(FormSection, { layout: "grid", columns: 2, spacing: "md", children: [
4603
+ /* @__PURE__ */ jsx(
4604
+ FormInput,
4605
+ {
4606
+ name: "city",
4607
+ label: "City",
4608
+ placeholder: "Enter city"
4609
+ }
4610
+ ),
4611
+ /* @__PURE__ */ jsx(
4612
+ FormInput,
4613
+ {
4614
+ name: "state",
4615
+ label: "State",
4616
+ placeholder: "Enter state"
4617
+ }
4618
+ )
4619
+ ] }),
4620
+ /* @__PURE__ */ jsx(
4621
+ FormInput,
4622
+ {
4623
+ name: "country",
4624
+ label: "Country",
4625
+ placeholder: "Enter country"
4626
+ }
4627
+ )
4628
+ ] }),
4629
+ /* @__PURE__ */ jsxs(DialogFooter, { children: [
4630
+ /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: handleCancel, children: "Cancel" }),
4631
+ /* @__PURE__ */ jsx(Button, { type: "submit", disabled: isSubmitting, children: isSubmitting ? "Adding..." : "Add UBO" })
4632
+ ] })
4633
+ ] }) })
4634
+ ] }) });
4635
+ };
4636
+ var UBOCard = ({ ubos, onUBOClick }) => {
4637
+ const [isDialogOpen, setIsDialogOpen] = useState(false);
4638
+ const handleAddUBO = (data) => {
4639
+ console.log("New UBO data:", data);
4640
+ toast$1.success("UBO added successfully");
4641
+ };
4642
+ const columns3 = [
4643
+ {
4644
+ key: "name",
4645
+ title: "Name",
4646
+ sortable: true,
4647
+ width: "40%",
4648
+ render: (value, row) => /* @__PURE__ */ jsx(
4649
+ "button",
4650
+ {
4651
+ onClick: () => onUBOClick(row.customerId),
4652
+ className: "text-primary hover:underline font-medium text-left",
4653
+ children: value
4654
+ }
4655
+ )
4656
+ },
4657
+ {
4658
+ key: "title",
4659
+ title: "Title",
4660
+ sortable: true,
4661
+ width: "40%"
4662
+ },
4663
+ {
4664
+ key: "ownershipPercentage",
4665
+ title: "Ownership %",
4666
+ sortable: true,
4667
+ width: "20%",
4668
+ align: "right",
4669
+ render: (value) => `${value}%`
4670
+ }
4671
+ ];
4672
+ return /* @__PURE__ */ jsxs(Card, { children: [
4673
+ /* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
4674
+ /* @__PURE__ */ jsx(CardTitle, { children: "Ultimate Beneficial Owners (UBO)" }),
4675
+ /* @__PURE__ */ jsxs(Button, { size: "sm", variant: "ghost", onClick: () => setIsDialogOpen(true), children: [
4676
+ /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4 mr-1" }),
4677
+ "Add UBO"
4678
+ ] })
4679
+ ] }),
4680
+ /* @__PURE__ */ jsx(CardContent, { children: ubos.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
4681
+ /* @__PURE__ */ jsx(Users, { className: "h-5 w-5 opacity-50" }),
4682
+ /* @__PURE__ */ jsx("p", { children: "No UBOs recorded" })
4683
+ ] }) : /* @__PURE__ */ jsx(
4684
+ DataTable,
4685
+ {
4686
+ columns: columns3,
4687
+ data: ubos
4688
+ }
4689
+ ) }),
4690
+ /* @__PURE__ */ jsx(
4691
+ AddUBODialog,
4692
+ {
4693
+ open: isDialogOpen,
4694
+ onOpenChange: setIsDialogOpen,
4695
+ onSubmit: handleAddUBO
4696
+ }
4697
+ )
4698
+ ] });
4699
+ };
4700
+ var accountSchema = z.object({
4701
+ accountName: z.string().min(1, "Account name is required"),
4702
+ accountType: z.string().min(1, "Account type is required"),
4703
+ fundingFromAccount: z.string().optional(),
4704
+ sweepToAccount: z.string().optional()
4705
+ });
4706
+ var AddAccountDialog = ({
4707
+ open,
4708
+ onOpenChange,
4709
+ onSubmit,
4710
+ existingAccounts = []
4711
+ }) => {
4712
+ const [isLoading, setIsLoading] = useState(false);
4713
+ const form = useForm({
4714
+ resolver: zodResolver(accountSchema),
4715
+ defaultValues: {
4716
+ accountName: "",
4717
+ accountType: void 0,
4718
+ fundingFromAccount: "",
4719
+ sweepToAccount: ""
4720
+ }
4721
+ });
4722
+ const handleSubmit = async (data) => {
4723
+ setIsLoading(true);
4724
+ try {
4725
+ await onSubmit?.(data);
4726
+ form.reset();
4727
+ onOpenChange(false);
4728
+ } catch (error) {
4729
+ console.error("Error creating account:", error);
4730
+ } finally {
4731
+ setIsLoading(false);
4732
+ }
4733
+ };
4734
+ existingAccounts.map((acc) => ({
4735
+ value: acc.id,
4736
+ label: `${acc.number}${acc.type ? ` (${acc.type})` : ""}`
4737
+ }));
4738
+ return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-[600px] max-h-[90vh] overflow-y-auto", children: [
4739
+ /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: "Add Account" }) }),
4740
+ /* @__PURE__ */ jsx(FormProvider, { form, children: /* @__PURE__ */ jsxs("form", { onSubmit: form.handleSubmit(handleSubmit), className: "space-y-4", children: [
4741
+ /* @__PURE__ */ jsxs(FormSection, { spacing: "md", children: [
4742
+ /* @__PURE__ */ jsx(
4743
+ FormInput,
4744
+ {
4745
+ name: "accountName",
4746
+ label: "Account Name",
4747
+ placeholder: "Enter account name",
4748
+ required: true
4749
+ }
4750
+ ),
4751
+ /* @__PURE__ */ jsx(
4752
+ FormSelect,
4753
+ {
4754
+ name: "accountType",
4755
+ label: "Account Type",
4756
+ placeholder: "Select account type",
4757
+ options: [
4758
+ { value: "CHECKING", label: "Checking" },
4759
+ { value: "SAVINGS", label: "Savings" }
4760
+ ]
4761
+ }
4762
+ ),
4763
+ /* @__PURE__ */ jsx(
4764
+ FormInput,
4765
+ {
4766
+ name: "fundingFromAccount",
4767
+ label: "Funding from Account",
4768
+ placeholder: "Enter funding account"
4769
+ }
4770
+ ),
4771
+ /* @__PURE__ */ jsx(
4772
+ FormInput,
4773
+ {
4774
+ name: "sweepToAccount",
4775
+ label: "Sweep to Account",
4776
+ placeholder: "Enter sweep account"
4777
+ }
4778
+ )
4779
+ ] }),
4780
+ /* @__PURE__ */ jsxs(DialogFooter, { children: [
4781
+ /* @__PURE__ */ jsx(
4782
+ Button,
4783
+ {
4784
+ type: "button",
4785
+ variant: "outline",
4786
+ onClick: () => onOpenChange(false),
4787
+ disabled: isLoading,
4788
+ children: "Cancel"
4789
+ }
4790
+ ),
4791
+ /* @__PURE__ */ jsx(Button, { type: "submit", disabled: isLoading, children: isLoading ? "Creating..." : "Create Account" })
4792
+ ] })
4793
+ ] }) })
4794
+ ] }) });
4795
+ };
4796
+ var BusinessDocuments = ({ businessId, documents, onDocumentUpload }) => {
4797
+ const [isUploading, setIsUploading] = useState(false);
4798
+ const [showUploadDialog, setShowUploadDialog] = useState(false);
4799
+ const [selectedFile, setSelectedFile] = useState(null);
4800
+ const [documentName, setDocumentName] = useState("");
4801
+ const [description, setDescription] = useState("");
4802
+ const [documentType, setDocumentType] = useState("");
4803
+ const handleFileSelect = (e) => {
4804
+ const file = e.target.files?.[0];
4805
+ if (!file) return;
4806
+ setSelectedFile(file);
4807
+ setDocumentName(file.name);
4808
+ };
4809
+ const handleUploadSubmit = async () => {
4810
+ if (!selectedFile || !documentName || !documentType) {
4811
+ toast({
4812
+ title: "Missing Information",
4813
+ description: "Please fill in all required fields",
4814
+ variant: "destructive"
4815
+ });
4816
+ return;
4817
+ }
4818
+ setIsUploading(true);
4819
+ try {
4820
+ await onDocumentUpload(selectedFile, {
4821
+ name: documentName,
4822
+ description,
4823
+ type: documentType
4824
+ });
4825
+ toast({
4826
+ title: "Upload Successful",
4827
+ description: `${documentName} uploaded successfully`
4828
+ });
4829
+ setShowUploadDialog(false);
4830
+ resetForm();
4831
+ } catch (error) {
4346
4832
  toast({
4347
4833
  title: "Upload Failed",
4348
4834
  description: "Failed to upload document. Please try again.",
@@ -4644,7 +5130,11 @@ var BusinessDetailView = ({
4644
5130
  onUBOClick,
4645
5131
  onDocumentUpload
4646
5132
  }) => {
4647
- return /* @__PURE__ */ jsx(
5133
+ const [showAddAccountDialog, setShowAddAccountDialog] = useState(false);
5134
+ const handleAddAccount = (data) => {
5135
+ console.log("New account data:", data);
5136
+ };
5137
+ return /* @__PURE__ */ jsxs(
4648
5138
  PageLayout,
4649
5139
  {
4650
5140
  title: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
@@ -4683,164 +5173,64 @@ var BusinessDetailView = ({
4683
5173
  }
4684
5174
  ],
4685
5175
  maxWidth: "full",
4686
- children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col lg:flex-row items-start gap-4", children: [
4687
- /* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-4", children: [
4688
- /* @__PURE__ */ jsx(
4689
- BusinessProfileCard,
4690
- {
4691
- data: businessProfile,
4692
- identityVerification,
4693
- isEditing: isEditingProfile,
4694
- onToggleEdit: onToggleProfileEdit,
4695
- onDataChange: onProfileDataChange
4696
- }
4697
- ),
4698
- /* @__PURE__ */ jsx(UBOCard, { ubos: businessUBOs, onUBOClick }),
4699
- /* @__PURE__ */ jsxs(Card, { children: [
4700
- /* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
4701
- /* @__PURE__ */ jsx(CardTitle, { children: "External Accounts" }),
4702
- /* @__PURE__ */ jsxs(Button, { size: "sm", variant: "ghost", onClick: onAddAccount, children: [
4703
- /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4 mr-1" }),
4704
- "Account"
4705
- ] })
5176
+ children: [
5177
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col lg:flex-row items-start gap-4", children: [
5178
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-4", children: [
5179
+ /* @__PURE__ */ jsx(
5180
+ BusinessProfileCard,
5181
+ {
5182
+ data: businessProfile,
5183
+ identityVerification,
5184
+ isEditing: isEditingProfile,
5185
+ onToggleEdit: onToggleProfileEdit,
5186
+ onDataChange: onProfileDataChange
5187
+ }
5188
+ ),
5189
+ /* @__PURE__ */ jsx(UBOCard, { ubos: businessUBOs, onUBOClick }),
5190
+ /* @__PURE__ */ jsxs(Card, { children: [
5191
+ /* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
5192
+ /* @__PURE__ */ jsx(CardTitle, { children: "External Accounts" }),
5193
+ /* @__PURE__ */ jsxs(Button, { size: "sm", variant: "ghost", onClick: () => setShowAddAccountDialog(true), children: [
5194
+ /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4 mr-1" }),
5195
+ "Account"
5196
+ ] })
5197
+ ] }),
5198
+ /* @__PURE__ */ jsx(CardContent, { children: businessAccounts.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
5199
+ /* @__PURE__ */ jsx(Wallet, { className: "h-5 w-5 opacity-50" }),
5200
+ /* @__PURE__ */ jsx("p", { children: "No external accounts found" })
5201
+ ] }) : /* @__PURE__ */ jsx(
5202
+ DataTable,
5203
+ {
5204
+ columns: accountColumns,
5205
+ data: businessAccounts
5206
+ }
5207
+ ) })
4706
5208
  ] }),
4707
- /* @__PURE__ */ jsx(CardContent, { children: businessAccounts.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
4708
- /* @__PURE__ */ jsx(Wallet, { className: "h-5 w-5 opacity-50" }),
4709
- /* @__PURE__ */ jsx("p", { children: "No external accounts found" })
4710
- ] }) : /* @__PURE__ */ jsx(
4711
- DataTable,
5209
+ /* @__PURE__ */ jsx(
5210
+ BusinessDocuments,
4712
5211
  {
4713
- columns: accountColumns,
4714
- data: businessAccounts
5212
+ businessId: business.id,
5213
+ documents: businessDocuments,
5214
+ onDocumentUpload
4715
5215
  }
4716
- ) })
5216
+ )
4717
5217
  ] }),
4718
- /* @__PURE__ */ jsx(
4719
- BusinessDocuments,
4720
- {
4721
- businessId: business.id,
4722
- documents: businessDocuments,
4723
- onDocumentUpload
4724
- }
4725
- )
5218
+ /* @__PURE__ */ jsx("div", { className: "lg:w-64", children: /* @__PURE__ */ jsx(BusinessStatusCard, { isEditing: false, onToggleEdit: () => {
5219
+ } }) })
4726
5220
  ] }),
4727
- /* @__PURE__ */ jsx("div", { className: "lg:w-64", children: /* @__PURE__ */ jsx(BusinessStatusCard, { isEditing: false, onToggleEdit: () => {
4728
- } }) })
4729
- ] })
5221
+ /* @__PURE__ */ jsx(
5222
+ AddAccountDialog,
5223
+ {
5224
+ open: showAddAccountDialog,
5225
+ onOpenChange: setShowAddAccountDialog,
5226
+ onSubmit: handleAddAccount,
5227
+ existingAccounts: businessAccounts
5228
+ }
5229
+ )
5230
+ ]
4730
5231
  }
4731
5232
  );
4732
5233
  };
4733
- function Calendar({
4734
- className,
4735
- classNames,
4736
- showOutsideDays = true,
4737
- ...props
4738
- }) {
4739
- return /* @__PURE__ */ jsx(
4740
- DayPicker,
4741
- {
4742
- showOutsideDays,
4743
- className: cn("p-3 pointer-events-auto", className),
4744
- classNames: {
4745
- months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
4746
- month: "space-y-4",
4747
- caption: "flex justify-center pt-1 relative items-center",
4748
- caption_label: "text-sm font-medium",
4749
- nav: "space-x-1 flex items-center",
4750
- button_previous: "absolute left-1 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",
4751
- button_next: "absolute right-1 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",
4752
- month_grid: "w-full border-collapse space-y-1",
4753
- weekdays: "flex",
4754
- weekday: "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
4755
- week: "flex w-full mt-2",
4756
- day: "h-9 w-9 text-center text-sm p-0 relative hover:bg-accent hover:text-accent-foreground rounded-md",
4757
- day_button: cn(
4758
- buttonVariants({ variant: "ghost" }),
4759
- "h-9 w-9 p-0 font-normal"
4760
- ),
4761
- selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground",
4762
- today: "bg-accent text-accent-foreground",
4763
- outside: "text-muted-foreground opacity-50",
4764
- disabled: "text-muted-foreground opacity-50",
4765
- hidden: "invisible",
4766
- ...classNames
4767
- },
4768
- ...props
4769
- }
4770
- );
4771
- }
4772
- Calendar.displayName = "Calendar";
4773
- var Popover = PopoverPrimitive.Root;
4774
- var PopoverTrigger = PopoverPrimitive.Trigger;
4775
- var PopoverContent = React15.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
4776
- PopoverPrimitive.Content,
4777
- {
4778
- ref,
4779
- align,
4780
- sideOffset,
4781
- className: cn(
4782
- "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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",
4783
- className
4784
- ),
4785
- ...props
4786
- }
4787
- ) }));
4788
- PopoverContent.displayName = PopoverPrimitive.Content.displayName;
4789
- function DatePicker({
4790
- date,
4791
- onDateChange,
4792
- placeholder = "Pick a date",
4793
- disabled = false,
4794
- className,
4795
- buttonClassName,
4796
- calendarClassName,
4797
- align = "start",
4798
- disabledDates,
4799
- label,
4800
- wrapperClassName
4801
- }) {
4802
- const [open, setOpen] = React15.useState(false);
4803
- const handleSelect = (selectedDate) => {
4804
- onDateChange?.(selectedDate);
4805
- setOpen(false);
4806
- };
4807
- const picker = /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
4808
- /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
4809
- Button,
4810
- {
4811
- variant: "outline",
4812
- disabled,
4813
- className: cn(
4814
- "justify-start text-left font-normal",
4815
- !date && "text-muted-foreground",
4816
- buttonClassName
4817
- ),
4818
- children: [
4819
- /* @__PURE__ */ jsx(CalendarIcon, { className: "mr-2 h-4 w-4" }),
4820
- date ? format(date, "MM/dd/yyyy") : placeholder
4821
- ]
4822
- }
4823
- ) }),
4824
- /* @__PURE__ */ jsx(PopoverContent, { className: cn("w-auto p-0", className), align, children: /* @__PURE__ */ jsx(
4825
- Calendar,
4826
- {
4827
- mode: "single",
4828
- selected: date,
4829
- onSelect: handleSelect,
4830
- disabled: disabledDates,
4831
- initialFocus: true,
4832
- className: cn("pointer-events-auto", calendarClassName)
4833
- }
4834
- ) })
4835
- ] });
4836
- if (label) {
4837
- return /* @__PURE__ */ jsxs("div", { className: cn("space-y-2", wrapperClassName), children: [
4838
- /* @__PURE__ */ jsx("label", { className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: label }),
4839
- picker
4840
- ] });
4841
- }
4842
- return picker;
4843
- }
4844
5234
  var BusinessFiltersSheet = ({
4845
5235
  filters,
4846
5236
  onFilterChange,
@@ -5223,98 +5613,137 @@ var CreateBusinessView = ({
5223
5613
  }
5224
5614
  );
5225
5615
  };
5616
+ var CounterpartyFiltersSheet = ({
5617
+ filters,
5618
+ onFilterChange,
5619
+ onResetFilters
5620
+ }) => {
5621
+ const [localFilters, setLocalFilters] = useState(filters);
5622
+ const [open, setOpen] = useState(false);
5623
+ useEffect(() => {
5624
+ setLocalFilters(filters);
5625
+ }, [filters]);
5626
+ const handleLocalFilterChange = (field, value) => {
5627
+ setLocalFilters((prev) => ({ ...prev, [field]: value }));
5628
+ };
5629
+ const handleApplyFilters = () => {
5630
+ Object.entries(localFilters).forEach(([key, value]) => {
5631
+ onFilterChange(key, value);
5632
+ });
5633
+ setOpen(false);
5634
+ };
5635
+ const handleResetFilters = () => {
5636
+ const resetFilters = {
5637
+ name: "",
5638
+ type: "",
5639
+ status: "",
5640
+ createdDateStart: void 0,
5641
+ createdDateEnd: void 0
5642
+ };
5643
+ setLocalFilters(resetFilters);
5644
+ onResetFilters();
5645
+ setOpen(false);
5646
+ };
5647
+ return /* @__PURE__ */ jsxs(Sheet, { open, onOpenChange: setOpen, children: [
5648
+ /* @__PURE__ */ jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "outline", className: "gap-2", children: [
5649
+ /* @__PURE__ */ jsx(Filter, { className: "h-4 w-4" }),
5650
+ "Filters"
5651
+ ] }) }),
5652
+ /* @__PURE__ */ jsxs(SheetContent, { side: "right", className: "w-full sm:max-w-xl overflow-y-auto", children: [
5653
+ /* @__PURE__ */ jsx(SheetHeader, { children: /* @__PURE__ */ jsx(SheetTitle, { children: "Counterparty Filters" }) }),
5654
+ /* @__PURE__ */ jsxs("div", { className: "space-y-6 py-6", children: [
5655
+ /* @__PURE__ */ jsx(
5656
+ EnhancedInput,
5657
+ {
5658
+ label: "Name",
5659
+ value: localFilters.name,
5660
+ onChange: (e) => handleLocalFilterChange("name", e.target.value),
5661
+ placeholder: "Enter counterparty name"
5662
+ }
5663
+ ),
5664
+ /* @__PURE__ */ jsx(
5665
+ EnhancedSelect,
5666
+ {
5667
+ label: "Type",
5668
+ value: localFilters.type,
5669
+ onValueChange: (value) => handleLocalFilterChange("type", value),
5670
+ placeholder: "Select type",
5671
+ options: [
5672
+ { value: "BUSINESS", label: "Business" },
5673
+ { value: "INDIVIDUAL", label: "Individual" }
5674
+ ]
5675
+ }
5676
+ ),
5677
+ /* @__PURE__ */ jsx(
5678
+ EnhancedSelect,
5679
+ {
5680
+ label: "Status",
5681
+ value: localFilters.status,
5682
+ onValueChange: (value) => handleLocalFilterChange("status", value),
5683
+ placeholder: "Select status",
5684
+ options: [
5685
+ { value: "ACTIVE", label: "Active" },
5686
+ { value: "INACTIVE", label: "Inactive" },
5687
+ { value: "PENDING", label: "Pending" },
5688
+ { value: "SUSPENDED", label: "Suspended" }
5689
+ ]
5690
+ }
5691
+ ),
5692
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
5693
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
5694
+ /* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Created Date Start" }),
5695
+ /* @__PURE__ */ jsx(
5696
+ DatePicker,
5697
+ {
5698
+ date: localFilters.createdDateStart,
5699
+ onDateChange: (date) => handleLocalFilterChange("createdDateStart", date),
5700
+ placeholder: "MM/DD/YYYY",
5701
+ buttonClassName: "w-full",
5702
+ className: "bg-background z-50"
5703
+ }
5704
+ )
5705
+ ] }),
5706
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
5707
+ /* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Created Date End" }),
5708
+ /* @__PURE__ */ jsx(
5709
+ DatePicker,
5710
+ {
5711
+ date: localFilters.createdDateEnd,
5712
+ onDateChange: (date) => handleLocalFilterChange("createdDateEnd", date),
5713
+ placeholder: "MM/DD/YYYY",
5714
+ buttonClassName: "w-full",
5715
+ className: "bg-background z-50"
5716
+ }
5717
+ )
5718
+ ] })
5719
+ ] })
5720
+ ] }),
5721
+ /* @__PURE__ */ jsxs(SheetFooter, { className: "flex gap-2", children: [
5722
+ /* @__PURE__ */ jsx(Button, { variant: "outline", onClick: handleResetFilters, className: "flex-1", children: "Reset Filters" }),
5723
+ /* @__PURE__ */ jsx(Button, { onClick: handleApplyFilters, className: "flex-1", children: "Apply Filters" })
5724
+ ] })
5725
+ ] })
5726
+ ] });
5727
+ };
5226
5728
  var CounterpartiesView = ({
5227
5729
  table,
5228
5730
  filters,
5229
5731
  onFilterChange,
5230
5732
  onResetFilters,
5231
- onApplyFilters,
5232
5733
  onCreateCounterparty
5233
5734
  }) => {
5234
5735
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col h-screen bg-gradient-subtle", children: [
5235
5736
  /* @__PURE__ */ jsx("div", { className: "flex-none border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60", children: /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4 py-6 max-w-none", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
5236
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("h1", { className: "text-3xl font-bold text-foreground mb-2", children: "Counterparties" }) }),
5737
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("h1", { className: "text-3xl font-bold text-foreground", children: "Counterparties" }) }),
5237
5738
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
5238
- /* @__PURE__ */ jsxs(Sheet, { children: [
5239
- /* @__PURE__ */ jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "outline", className: "gap-2", children: [
5240
- /* @__PURE__ */ jsx(Filter, { className: "h-4 w-4" }),
5241
- "Filters"
5242
- ] }) }),
5243
- /* @__PURE__ */ jsxs(SheetContent, { side: "right", className: "w-full sm:max-w-xl overflow-y-auto", children: [
5244
- /* @__PURE__ */ jsx(SheetHeader, { children: /* @__PURE__ */ jsx(SheetTitle, { children: "Counterparty Filters" }) }),
5245
- /* @__PURE__ */ jsxs("div", { className: "space-y-6 py-6", children: [
5246
- /* @__PURE__ */ jsx(
5247
- EnhancedInput,
5248
- {
5249
- label: "Name",
5250
- value: filters.name,
5251
- onChange: (e) => onFilterChange("name", e.target.value),
5252
- placeholder: "Enter counterparty name"
5253
- }
5254
- ),
5255
- /* @__PURE__ */ jsx(
5256
- EnhancedSelect,
5257
- {
5258
- label: "Type",
5259
- value: filters.type,
5260
- onValueChange: (value) => onFilterChange("type", value),
5261
- placeholder: "Select type",
5262
- options: [
5263
- { value: "BUSINESS", label: "Business" },
5264
- { value: "INDIVIDUAL", label: "Individual" }
5265
- ]
5266
- }
5267
- ),
5268
- /* @__PURE__ */ jsx(
5269
- EnhancedSelect,
5270
- {
5271
- label: "Status",
5272
- value: filters.status,
5273
- onValueChange: (value) => onFilterChange("status", value),
5274
- placeholder: "Select status",
5275
- options: [
5276
- { value: "ACTIVE", label: "Active" },
5277
- { value: "INACTIVE", label: "Inactive" },
5278
- { value: "PENDING", label: "Pending" },
5279
- { value: "SUSPENDED", label: "Suspended" }
5280
- ]
5281
- }
5282
- ),
5283
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
5284
- /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
5285
- /* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Created Date Start" }),
5286
- /* @__PURE__ */ jsx(
5287
- DatePicker,
5288
- {
5289
- date: filters.createdDateStart,
5290
- onDateChange: (date) => onFilterChange("createdDateStart", date),
5291
- placeholder: "MM/DD/YYYY",
5292
- buttonClassName: "w-full",
5293
- className: "bg-background z-50"
5294
- }
5295
- )
5296
- ] }),
5297
- /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
5298
- /* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Created Date End" }),
5299
- /* @__PURE__ */ jsx(
5300
- DatePicker,
5301
- {
5302
- date: filters.createdDateEnd,
5303
- onDateChange: (date) => onFilterChange("createdDateEnd", date),
5304
- placeholder: "MM/DD/YYYY",
5305
- buttonClassName: "w-full",
5306
- className: "bg-background z-50"
5307
- }
5308
- )
5309
- ] })
5310
- ] })
5311
- ] }),
5312
- /* @__PURE__ */ jsxs(SheetFooter, { className: "gap-2", children: [
5313
- /* @__PURE__ */ jsx(Button, { variant: "outline", onClick: onResetFilters, children: "Reset Filters" }),
5314
- /* @__PURE__ */ jsx(Button, { onClick: onApplyFilters, children: "Apply Filters" })
5315
- ] })
5316
- ] })
5317
- ] }),
5739
+ /* @__PURE__ */ jsx(
5740
+ CounterpartyFiltersSheet,
5741
+ {
5742
+ filters,
5743
+ onFilterChange,
5744
+ onResetFilters
5745
+ }
5746
+ ),
5318
5747
  /* @__PURE__ */ jsx(Button, { onClick: onCreateCounterparty, children: "Create Counterparty" })
5319
5748
  ] })
5320
5749
  ] }) }) }),
@@ -6418,39 +6847,6 @@ var CounterpartyBasicInfo = ({ onDataChange }) => {
6418
6847
  ] })
6419
6848
  ] });
6420
6849
  };
6421
- var spacingClasses = {
6422
- sm: "space-y-3",
6423
- md: "space-y-4",
6424
- lg: "space-y-6"
6425
- };
6426
- var gridClasses = {
6427
- 1: "grid-cols-1",
6428
- 2: "grid-cols-1 md:grid-cols-2",
6429
- 3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3",
6430
- 4: "grid-cols-1 md:grid-cols-2 lg:grid-cols-4"
6431
- };
6432
- var FormSection = React15.forwardRef(
6433
- ({
6434
- title,
6435
- description,
6436
- children,
6437
- className,
6438
- spacing: spacing2 = "md",
6439
- layout = "vertical",
6440
- columns: columns3 = 2
6441
- }, ref) => {
6442
- return /* @__PURE__ */ jsxs("div", { ref, className: cn("space-y-4", className), children: [
6443
- (title || description) && /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
6444
- title && /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold text-foreground", children: title }),
6445
- description && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: description })
6446
- ] }),
6447
- /* @__PURE__ */ jsx("div", { className: cn(
6448
- layout === "grid" ? `grid gap-4 ${gridClasses[columns3]}` : spacingClasses[spacing2]
6449
- ), children })
6450
- ] });
6451
- }
6452
- );
6453
- FormSection.displayName = "FormSection";
6454
6850
  var IntermediaryFI = () => {
6455
6851
  return /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
6456
6852
  /* @__PURE__ */ jsxs("div", { className: "border-b border-border pb-4", children: [
@@ -7917,36 +8313,6 @@ var EntityCard = React15.forwardRef(
7917
8313
  }
7918
8314
  );
7919
8315
  EntityCard.displayName = "EntityCard";
7920
- var FormField = React15.forwardRef(
7921
- ({ label, description, error, required, children, className, layout = "vertical" }, ref) => {
7922
- const isHorizontal = layout === "horizontal";
7923
- return /* @__PURE__ */ jsxs(
7924
- "div",
7925
- {
7926
- ref,
7927
- className: cn(
7928
- "space-y-2",
7929
- isHorizontal && "grid grid-cols-1 md:grid-cols-3 gap-4 items-start space-y-0",
7930
- className
7931
- ),
7932
- children: [
7933
- label && /* @__PURE__ */ jsxs("div", { className: cn("space-y-1", isHorizontal && "pt-2"), children: [
7934
- /* @__PURE__ */ jsxs("label", { className: "text-sm font-medium text-foreground", children: [
7935
- label,
7936
- required && /* @__PURE__ */ jsx("span", { className: "text-destructive ml-1", children: "*" })
7937
- ] }),
7938
- description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: description })
7939
- ] }),
7940
- /* @__PURE__ */ jsxs("div", { className: cn(isHorizontal && "md:col-span-2"), children: [
7941
- children,
7942
- error && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive mt-1", children: error })
7943
- ] })
7944
- ]
7945
- }
7946
- );
7947
- }
7948
- );
7949
- FormField.displayName = "FormField";
7950
8316
  var variantStyles = {
7951
8317
  default: "",
7952
8318
  success: "border-success/20 bg-success/5",
@@ -9325,39 +9691,6 @@ var AccountStatusCard = ({ isEditing, onToggleEdit, className }) => {
9325
9691
  }
9326
9692
  );
9327
9693
  };
9328
- var AccountBalanceCard = React15__default.forwardRef(
9329
- ({ balance, availableBalance, accountNumber, accountType, className }, ref) => {
9330
- return /* @__PURE__ */ jsx(
9331
- Card,
9332
- {
9333
- ref,
9334
- className: cn(
9335
- "border-primary/20 bg-gradient-to-br from-primary/5 via-primary/3 to-background",
9336
- className
9337
- ),
9338
- children: /* @__PURE__ */ jsx(CardContent, { className: "p-6", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
9339
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
9340
- /* @__PURE__ */ jsx(Wallet, { className: "h-4 w-4 text-primary" }),
9341
- /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: accountNumber }),
9342
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "\u2022" }),
9343
- /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground capitalize", children: accountType })
9344
- ] }),
9345
- /* @__PURE__ */ jsxs("div", { className: "flex items-end gap-8", children: [
9346
- /* @__PURE__ */ jsxs("div", { children: [
9347
- /* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-muted-foreground mb-1", children: "Account Balance" }),
9348
- /* @__PURE__ */ jsx("p", { className: "text-3xl font-bold text-foreground tracking-tight", children: balance })
9349
- ] }),
9350
- availableBalance && /* @__PURE__ */ jsxs("div", { children: [
9351
- /* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-muted-foreground mb-1", children: "Available Balance" }),
9352
- /* @__PURE__ */ jsx("p", { className: "text-3xl font-bold text-foreground tracking-tight", children: availableBalance })
9353
- ] })
9354
- ] })
9355
- ] }) })
9356
- }
9357
- );
9358
- }
9359
- );
9360
- AccountBalanceCard.displayName = "AccountBalanceCard";
9361
9694
  var accountInfoSchema = z.object({
9362
9695
  accountName: z.string().trim().min(1, "Account name is required").max(100, "Account name must be less than 100 characters"),
9363
9696
  canAcceptSweep: z.enum(["Yes", "No"]),
@@ -9387,7 +9720,7 @@ var AccountDetail = () => {
9387
9720
  }
9388
9721
  const formValues = form.watch();
9389
9722
  const customerPath = account.customerType === "business" ? `/business/${account.customerId}` : `/individual/${account.customerId}`;
9390
- return /* @__PURE__ */ jsxs(
9723
+ return /* @__PURE__ */ jsx(
9391
9724
  PageLayout,
9392
9725
  {
9393
9726
  title: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
@@ -9430,29 +9763,37 @@ var AccountDetail = () => {
9430
9763
  }
9431
9764
  ],
9432
9765
  maxWidth: "full",
9433
- children: [
9434
- /* @__PURE__ */ jsx(
9435
- AccountBalanceCard,
9436
- {
9437
- balance: account.balance,
9438
- availableBalance: account.balance,
9439
- accountNumber: account.number,
9440
- accountType: account.type,
9441
- className: "mb-4"
9442
- }
9443
- ),
9444
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col lg:flex-row items-start gap-4", children: [
9445
- /* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-4", children: [
9446
- /* @__PURE__ */ jsx(
9447
- EditableFormCard,
9448
- {
9449
- title: "Account Information",
9450
- variant: "subtle",
9451
- isEditing: form.isEditing,
9452
- onToggleEdit: form.handleToggleEdit,
9453
- onSave: form.handleSave,
9454
- onCancel: form.handleCancel,
9455
- viewContent: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
9766
+ children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col lg:flex-row items-start gap-4", children: [
9767
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-4", children: [
9768
+ /* @__PURE__ */ jsx(
9769
+ EditableFormCard,
9770
+ {
9771
+ title: "Account Information",
9772
+ variant: "subtle",
9773
+ isEditing: form.isEditing,
9774
+ onToggleEdit: form.handleToggleEdit,
9775
+ onSave: form.handleSave,
9776
+ onCancel: form.handleCancel,
9777
+ viewContent: /* @__PURE__ */ jsxs(Fragment, { children: [
9778
+ /* @__PURE__ */ jsxs("div", { className: "mb-6 p-6 rounded-lg bg-gradient-to-br from-primary/10 via-primary/5 to-background border border-primary/20", children: [
9779
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-4", children: [
9780
+ /* @__PURE__ */ jsx(Wallet, { className: "h-4 w-4 text-primary" }),
9781
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: account.number }),
9782
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "\u2022" }),
9783
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground capitalize", children: account.type })
9784
+ ] }),
9785
+ /* @__PURE__ */ jsxs("div", { className: "flex items-end gap-8", children: [
9786
+ /* @__PURE__ */ jsxs("div", { children: [
9787
+ /* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-muted-foreground mb-1", children: "Account Balance" }),
9788
+ /* @__PURE__ */ jsx("p", { className: "text-3xl font-bold text-foreground tracking-tight", children: account.balance })
9789
+ ] }),
9790
+ /* @__PURE__ */ jsxs("div", { children: [
9791
+ /* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-muted-foreground mb-1", children: "Available Balance" }),
9792
+ /* @__PURE__ */ jsx("p", { className: "text-3xl font-bold text-foreground tracking-tight", children: account.balance })
9793
+ ] })
9794
+ ] })
9795
+ ] }),
9796
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
9456
9797
  /* @__PURE__ */ jsx(
9457
9798
  InfoField,
9458
9799
  {
@@ -9516,8 +9857,28 @@ var AccountDetail = () => {
9516
9857
  value: formValues.sweepAccountNumber || "-"
9517
9858
  }
9518
9859
  )
9860
+ ] })
9861
+ ] }),
9862
+ editContent: /* @__PURE__ */ jsx(FormProvider, { form, children: /* @__PURE__ */ jsxs(Fragment, { children: [
9863
+ /* @__PURE__ */ jsxs("div", { className: "mb-6 p-6 rounded-lg bg-gradient-to-br from-primary/10 via-primary/5 to-background border border-primary/20", children: [
9864
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-4", children: [
9865
+ /* @__PURE__ */ jsx(Wallet, { className: "h-4 w-4 text-primary" }),
9866
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: account.number }),
9867
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "\u2022" }),
9868
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground capitalize", children: account.type })
9869
+ ] }),
9870
+ /* @__PURE__ */ jsxs("div", { className: "flex items-end gap-8", children: [
9871
+ /* @__PURE__ */ jsxs("div", { children: [
9872
+ /* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-muted-foreground mb-1", children: "Account Balance" }),
9873
+ /* @__PURE__ */ jsx("p", { className: "text-3xl font-bold text-foreground tracking-tight", children: account.balance })
9874
+ ] }),
9875
+ /* @__PURE__ */ jsxs("div", { children: [
9876
+ /* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-muted-foreground mb-1", children: "Available Balance" }),
9877
+ /* @__PURE__ */ jsx("p", { className: "text-3xl font-bold text-foreground tracking-tight", children: account.balance })
9878
+ ] })
9879
+ ] })
9519
9880
  ] }),
9520
- editContent: /* @__PURE__ */ jsx(FormProvider, { form, children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
9881
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
9521
9882
  /* @__PURE__ */ jsx(
9522
9883
  InfoField,
9523
9884
  {
@@ -9589,18 +9950,18 @@ var AccountDetail = () => {
9589
9950
  placeholder: "Enter sweep account number"
9590
9951
  }
9591
9952
  )
9592
- ] }) })
9593
- }
9594
- ),
9595
- /* @__PURE__ */ jsxs(Card, { children: [
9596
- /* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { children: "Fees" }) }),
9597
- /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx("div", { className: "text-center py-8 text-muted-foreground", children: /* @__PURE__ */ jsx("p", { children: "Fees information coming soon" }) }) })
9598
- ] })
9599
- ] }),
9600
- /* @__PURE__ */ jsx("div", { className: "lg:w-64", children: /* @__PURE__ */ jsx(AccountStatusCard, { isEditing: false, onToggleEdit: () => {
9601
- } }) })
9602
- ] })
9603
- ]
9953
+ ] })
9954
+ ] }) })
9955
+ }
9956
+ ),
9957
+ /* @__PURE__ */ jsxs(Card, { children: [
9958
+ /* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { children: "Fees" }) }),
9959
+ /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx("div", { className: "text-center py-8 text-muted-foreground", children: /* @__PURE__ */ jsx("p", { children: "Fees information coming soon" }) }) })
9960
+ ] })
9961
+ ] }),
9962
+ /* @__PURE__ */ jsx("div", { className: "lg:w-64", children: /* @__PURE__ */ jsx(AccountStatusCard, { isEditing: false, onToggleEdit: () => {
9963
+ } }) })
9964
+ ] })
9604
9965
  }
9605
9966
  );
9606
9967
  };
@@ -10835,8 +11196,6 @@ var Counterparties = () => {
10835
11196
  createdDateEnd: void 0
10836
11197
  });
10837
11198
  }, []);
10838
- const handleApplyFilters = useCallback(() => {
10839
- }, []);
10840
11199
  const handleSort = useCallback((key) => {
10841
11200
  if (sortBy === key) {
10842
11201
  setSortDirection((prev) => prev === "asc" ? "desc" : "asc");
@@ -10921,7 +11280,6 @@ var Counterparties = () => {
10921
11280
  filters,
10922
11281
  onFilterChange: handleFilterChange,
10923
11282
  onResetFilters: handleResetFilters,
10924
- onApplyFilters: handleApplyFilters,
10925
11283
  onCreateCounterparty: handleCreateCounterparty
10926
11284
  }
10927
11285
  );
@@ -11048,8 +11406,83 @@ var PaymentMethodCard = ({
11048
11406
  intermediaryBankId && /* @__PURE__ */ jsx(InfoField, { label: "Intermediary Bank ID", value: intermediaryBankId })
11049
11407
  ] })
11050
11408
  ] })
11051
- ] })
11052
- ] });
11409
+ ] })
11410
+ ] });
11411
+ };
11412
+ var CounterpartyDetailView = ({
11413
+ counterpartyName,
11414
+ counterpartyType,
11415
+ currentStatus,
11416
+ isEditingProfile,
11417
+ mockPaymentMethods: mockPaymentMethods2,
11418
+ documentsTable,
11419
+ onStatusChange,
11420
+ onToggleProfileEdit,
11421
+ onAddPaymentMethod,
11422
+ onAddDocument
11423
+ }) => {
11424
+ return /* @__PURE__ */ jsx(
11425
+ PageLayout,
11426
+ {
11427
+ title: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
11428
+ /* @__PURE__ */ jsx("span", { children: counterpartyName }),
11429
+ /* @__PURE__ */ jsx(
11430
+ EditableInfoField,
11431
+ {
11432
+ label: "",
11433
+ value: currentStatus,
11434
+ options: [
11435
+ { value: "ACTIVE", label: "Active" },
11436
+ { value: "INACTIVE", label: "Inactive" },
11437
+ { value: "PENDING", label: "Pending" },
11438
+ { value: "SUSPENDED", label: "Suspended" }
11439
+ ],
11440
+ onChange: onStatusChange,
11441
+ renderValue: (value) => /* @__PURE__ */ jsx(StatusBadge, { status: value }),
11442
+ className: "inline-block"
11443
+ }
11444
+ ),
11445
+ /* @__PURE__ */ jsx(CounterpartyTypeBadge, { type: counterpartyType })
11446
+ ] }),
11447
+ maxWidth: "full",
11448
+ children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col lg:flex-row items-start gap-4", children: [
11449
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-4", children: [
11450
+ /* @__PURE__ */ jsx(
11451
+ CounterpartyProfileCard,
11452
+ {
11453
+ isEditing: isEditingProfile,
11454
+ onToggleEdit: onToggleProfileEdit
11455
+ }
11456
+ ),
11457
+ /* @__PURE__ */ jsxs(Card, { children: [
11458
+ /* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
11459
+ /* @__PURE__ */ jsx(CardTitle, { children: "Payment Methods" }),
11460
+ /* @__PURE__ */ jsxs(Button, { size: "sm", variant: "ghost", onClick: onAddPaymentMethod, children: [
11461
+ /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4 mr-1" }),
11462
+ "Method"
11463
+ ] })
11464
+ ] }),
11465
+ /* @__PURE__ */ jsx(CardContent, { children: mockPaymentMethods2.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
11466
+ /* @__PURE__ */ jsx(Wallet, { className: "h-5 w-5 opacity-50" }),
11467
+ /* @__PURE__ */ jsx("p", { children: "No payment methods configured" })
11468
+ ] }) : /* @__PURE__ */ jsx(ResponsiveGrid, { type: "forms", gap: "md", children: mockPaymentMethods2.map((method, index) => /* @__PURE__ */ jsx(PaymentMethodCard, { ...method }, index)) }) })
11469
+ ] }),
11470
+ /* @__PURE__ */ jsxs(Card, { children: [
11471
+ /* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
11472
+ /* @__PURE__ */ jsx(CardTitle, { children: "Documents" }),
11473
+ /* @__PURE__ */ jsxs(Button, { size: "sm", variant: "ghost", onClick: onAddDocument, children: [
11474
+ /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4 mr-1" }),
11475
+ "Document"
11476
+ ] })
11477
+ ] }),
11478
+ /* @__PURE__ */ jsx(CardContent, { children: documentsTable })
11479
+ ] })
11480
+ ] }),
11481
+ /* @__PURE__ */ jsx("div", { className: "lg:w-64", children: /* @__PURE__ */ jsx(CounterpartyStatusCard, { isEditing: false, onToggleEdit: () => {
11482
+ } }) })
11483
+ ] })
11484
+ }
11485
+ );
11053
11486
  };
11054
11487
  var mockPaymentMethods = [
11055
11488
  {
@@ -11109,6 +11542,33 @@ var CounterpartyDetail = () => {
11109
11542
  render: (value) => /* @__PURE__ */ jsx("span", { className: "capitalize", children: value })
11110
11543
  }
11111
11544
  ];
11545
+ const handleStatusChange = (newStatus) => {
11546
+ setCurrentStatus(newStatus);
11547
+ };
11548
+ const handleToggleProfileEdit = () => {
11549
+ setIsEditingProfile(!isEditingProfile);
11550
+ };
11551
+ const handleAddPaymentMethod = () => {
11552
+ console.log("Add payment method");
11553
+ };
11554
+ const handleAddDocument = () => {
11555
+ console.log("Add document");
11556
+ };
11557
+ const documentsTable = useMemo(() => {
11558
+ if (counterpartyDocuments.length === 0) {
11559
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
11560
+ /* @__PURE__ */ jsx(FileText, { className: "h-5 w-5 opacity-50" }),
11561
+ /* @__PURE__ */ jsx("p", { children: "No documents found" })
11562
+ ] });
11563
+ }
11564
+ return /* @__PURE__ */ jsx(
11565
+ DataTable,
11566
+ {
11567
+ columns: documentColumns,
11568
+ data: counterpartyDocuments
11569
+ }
11570
+ );
11571
+ }, [counterpartyDocuments, documentColumns]);
11112
11572
  if (!counterparty) {
11113
11573
  return /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4 py-8", children: /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
11114
11574
  /* @__PURE__ */ jsx("h1", { className: "text-2xl font-bold mb-2", children: "Counterparty Not Found" }),
@@ -11116,74 +11576,18 @@ var CounterpartyDetail = () => {
11116
11576
  ] }) });
11117
11577
  }
11118
11578
  return /* @__PURE__ */ jsx(
11119
- PageLayout,
11579
+ CounterpartyDetailView,
11120
11580
  {
11121
- title: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
11122
- /* @__PURE__ */ jsx("span", { children: counterparty.name }),
11123
- /* @__PURE__ */ jsx(
11124
- EditableInfoField,
11125
- {
11126
- label: "",
11127
- value: currentStatus,
11128
- options: [
11129
- { value: "ACTIVE", label: "Active" },
11130
- { value: "INACTIVE", label: "Inactive" },
11131
- { value: "PENDING", label: "Pending" },
11132
- { value: "SUSPENDED", label: "Suspended" }
11133
- ],
11134
- onChange: (newStatus) => setCurrentStatus(newStatus),
11135
- renderValue: (value) => /* @__PURE__ */ jsx(StatusBadge, { status: value }),
11136
- className: "inline-block"
11137
- }
11138
- ),
11139
- /* @__PURE__ */ jsx(CounterpartyTypeBadge, { type: counterparty.type })
11140
- ] }),
11141
- maxWidth: "full",
11142
- children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col lg:flex-row items-start gap-4", children: [
11143
- /* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-4", children: [
11144
- /* @__PURE__ */ jsx(
11145
- CounterpartyProfileCard,
11146
- {
11147
- isEditing: isEditingProfile,
11148
- onToggleEdit: () => setIsEditingProfile(!isEditingProfile)
11149
- }
11150
- ),
11151
- /* @__PURE__ */ jsxs(Card, { children: [
11152
- /* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
11153
- /* @__PURE__ */ jsx(CardTitle, { children: "Payment Methods" }),
11154
- /* @__PURE__ */ jsxs(Button, { size: "sm", variant: "ghost", children: [
11155
- /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4 mr-1" }),
11156
- "Method"
11157
- ] })
11158
- ] }),
11159
- /* @__PURE__ */ jsx(CardContent, { children: mockPaymentMethods.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
11160
- /* @__PURE__ */ jsx(Wallet, { className: "h-5 w-5 opacity-50" }),
11161
- /* @__PURE__ */ jsx("p", { children: "No payment methods configured" })
11162
- ] }) : /* @__PURE__ */ jsx(ResponsiveGrid, { type: "forms", gap: "md", children: mockPaymentMethods.map((method, index) => /* @__PURE__ */ jsx(PaymentMethodCard, { ...method }, index)) }) })
11163
- ] }),
11164
- /* @__PURE__ */ jsxs(Card, { children: [
11165
- /* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
11166
- /* @__PURE__ */ jsx(CardTitle, { children: "Documents" }),
11167
- /* @__PURE__ */ jsxs(Button, { size: "sm", variant: "ghost", children: [
11168
- /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4 mr-1" }),
11169
- "Document"
11170
- ] })
11171
- ] }),
11172
- /* @__PURE__ */ jsx(CardContent, { children: counterpartyDocuments.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
11173
- /* @__PURE__ */ jsx(FileText, { className: "h-5 w-5 opacity-50" }),
11174
- /* @__PURE__ */ jsx("p", { children: "No documents found" })
11175
- ] }) : /* @__PURE__ */ jsx(
11176
- DataTable,
11177
- {
11178
- columns: documentColumns,
11179
- data: counterpartyDocuments
11180
- }
11181
- ) })
11182
- ] })
11183
- ] }),
11184
- /* @__PURE__ */ jsx("div", { className: "lg:w-64", children: /* @__PURE__ */ jsx(CounterpartyStatusCard, { isEditing: false, onToggleEdit: () => {
11185
- } }) })
11186
- ] })
11581
+ counterpartyName: counterparty.name,
11582
+ counterpartyType: counterparty.type,
11583
+ currentStatus,
11584
+ isEditingProfile,
11585
+ mockPaymentMethods,
11586
+ documentsTable,
11587
+ onStatusChange: handleStatusChange,
11588
+ onToggleProfileEdit: handleToggleProfileEdit,
11589
+ onAddPaymentMethod: handleAddPaymentMethod,
11590
+ onAddDocument: handleAddDocument
11187
11591
  }
11188
11592
  );
11189
11593
  };
@@ -13821,7 +14225,7 @@ var TransactionDetail = () => {
13821
14225
  /* @__PURE__ */ jsx(Button, { onClick: () => navigate("/transactions/history"), children: "Back to Transaction History" })
13822
14226
  ] }) });
13823
14227
  }
13824
- const getStatusVariant = (status) => {
14228
+ const getStatusVariant2 = (status) => {
13825
14229
  switch (status) {
13826
14230
  case "POSTED":
13827
14231
  return "success";
@@ -13877,7 +14281,7 @@ var TransactionDetail = () => {
13877
14281
  isInbound: transaction.isInbound
13878
14282
  }
13879
14283
  ),
13880
- /* @__PURE__ */ jsx(Badge, { variant: getStatusVariant(transaction.status), children: transaction.status }),
14284
+ /* @__PURE__ */ jsx(Badge, { variant: getStatusVariant2(transaction.status), children: transaction.status }),
13881
14285
  /* @__PURE__ */ jsx(Badge, { variant: getProcessingStatusVariant(transaction.processingStatus), children: transaction.processingStatus })
13882
14286
  ] }),
13883
14287
  maxWidth: "full",
@@ -13976,7 +14380,342 @@ function UIKit() {
13976
14380
  ] })
13977
14381
  ] }) }) });
13978
14382
  }
14383
+ function OFACFiltersSheet({
14384
+ filters,
14385
+ onFilterChange,
14386
+ onResetFilters
14387
+ }) {
14388
+ const hasActiveFilters = filters.status !== "" || filters.entityType !== "" || filters.startDate !== void 0 || filters.endDate !== void 0;
14389
+ return /* @__PURE__ */ jsxs(Sheet, { children: [
14390
+ /* @__PURE__ */ jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "outline", children: [
14391
+ /* @__PURE__ */ jsx(Filter, { className: "mr-2 h-4 w-4" }),
14392
+ "Filters",
14393
+ hasActiveFilters && /* @__PURE__ */ jsx("span", { className: "ml-2 flex h-5 w-5 items-center justify-center rounded-full bg-primary text-xs text-primary-foreground", children: [filters.status, filters.entityType, filters.startDate, filters.endDate].filter(Boolean).length })
14394
+ ] }) }),
14395
+ /* @__PURE__ */ jsxs(SheetContent, { className: "w-full sm:max-w-md overflow-y-auto", children: [
14396
+ /* @__PURE__ */ jsxs(SheetHeader, { children: [
14397
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
14398
+ /* @__PURE__ */ jsx(SheetTitle, { children: "Filter OFAC Checks" }),
14399
+ hasActiveFilters && /* @__PURE__ */ jsxs(
14400
+ Button,
14401
+ {
14402
+ variant: "ghost",
14403
+ size: "sm",
14404
+ onClick: onResetFilters,
14405
+ className: "h-8 px-2",
14406
+ children: [
14407
+ /* @__PURE__ */ jsx(X, { className: "mr-1 h-4 w-4" }),
14408
+ "Clear all"
14409
+ ]
14410
+ }
14411
+ )
14412
+ ] }),
14413
+ /* @__PURE__ */ jsx(SheetDescription, { children: "Filter OFAC screening results by status, entity type, and date range" })
14414
+ ] }),
14415
+ /* @__PURE__ */ jsxs("div", { className: "space-y-6 mt-6", children: [
14416
+ /* @__PURE__ */ jsx(
14417
+ EnhancedSelect,
14418
+ {
14419
+ label: "Status",
14420
+ placeholder: "All statuses",
14421
+ options: [
14422
+ { value: "all", label: "All statuses" },
14423
+ { value: "NO MATCH", label: "No Match" },
14424
+ { value: "REVIEW", label: "Review" },
14425
+ { value: "CLEARED", label: "Cleared" },
14426
+ { value: "CONFIRMED", label: "Confirmed" }
14427
+ ],
14428
+ value: filters.status || "all",
14429
+ onValueChange: (value) => onFilterChange("status", value === "all" ? "" : value)
14430
+ }
14431
+ ),
14432
+ /* @__PURE__ */ jsx(
14433
+ EnhancedSelect,
14434
+ {
14435
+ label: "Entity Type",
14436
+ placeholder: "All entity types",
14437
+ options: [
14438
+ { value: "all", label: "All entity types" },
14439
+ { value: "Business", label: "Business" },
14440
+ { value: "Individual", label: "Individual" },
14441
+ { value: "Counterparty", label: "Counterparty" }
14442
+ ],
14443
+ value: filters.entityType || "all",
14444
+ onValueChange: (value) => onFilterChange("entityType", value === "all" ? "" : value)
14445
+ }
14446
+ ),
14447
+ /* @__PURE__ */ jsx(
14448
+ DatePicker,
14449
+ {
14450
+ date: filters.startDate,
14451
+ onDateChange: (date) => onFilterChange("startDate", date),
14452
+ label: "Start Date",
14453
+ placeholder: "MM/DD/YYYY"
14454
+ }
14455
+ ),
14456
+ /* @__PURE__ */ jsx(
14457
+ DatePicker,
14458
+ {
14459
+ date: filters.endDate,
14460
+ onDateChange: (date) => onFilterChange("endDate", date),
14461
+ label: "End Date",
14462
+ placeholder: "MM/DD/YYYY",
14463
+ disabledDates: (date) => filters.startDate ? date < filters.startDate : false
14464
+ }
14465
+ )
14466
+ ] })
14467
+ ] })
14468
+ ] });
14469
+ }
14470
+
14471
+ // src/lib/mock-data/ofac-data.ts
14472
+ var mockOFACChecks = [
14473
+ {
14474
+ id: "ofac-001",
14475
+ created: "2024-01-15T10:30:00Z",
14476
+ entityId: "8112488",
14477
+ entityName: "Acme Corporation",
14478
+ entityType: "Business",
14479
+ alertId: "ALT-001",
14480
+ status: "CLEARED"
14481
+ },
14482
+ {
14483
+ id: "ofac-002",
14484
+ created: "2024-01-14T14:22:00Z",
14485
+ entityId: "8111609",
14486
+ entityName: "Global Tech Industries",
14487
+ entityType: "Business",
14488
+ alertId: "ALT-002",
14489
+ status: "REVIEW"
14490
+ },
14491
+ {
14492
+ id: "ofac-003",
14493
+ created: "2024-01-14T09:15:00Z",
14494
+ entityId: "IND-001",
14495
+ entityName: "John Smith",
14496
+ entityType: "Individual",
14497
+ alertId: null,
14498
+ status: "NO MATCH"
14499
+ },
14500
+ {
14501
+ id: "ofac-004",
14502
+ created: "2024-01-13T16:45:00Z",
14503
+ entityId: "8111026",
14504
+ entityName: "Innovation Partners LLC",
14505
+ entityType: "Business",
14506
+ alertId: "ALT-003",
14507
+ status: "CONFIRMED"
14508
+ },
14509
+ {
14510
+ id: "ofac-005",
14511
+ created: "2024-01-13T11:20:00Z",
14512
+ entityId: "IND-002",
14513
+ entityName: "Jane Doe",
14514
+ entityType: "Individual",
14515
+ alertId: null,
14516
+ status: "NO MATCH"
14517
+ },
14518
+ {
14519
+ id: "ofac-006",
14520
+ created: "2024-01-12T13:30:00Z",
14521
+ entityId: "CP-001",
14522
+ entityName: "International Suppliers Inc",
14523
+ entityType: "Counterparty",
14524
+ alertId: "ALT-004",
14525
+ status: "REVIEW"
14526
+ },
14527
+ {
14528
+ id: "ofac-007",
14529
+ created: "2024-01-12T08:00:00Z",
14530
+ entityId: "8110892",
14531
+ entityName: "NextGen Solutions",
14532
+ entityType: "Business",
14533
+ alertId: null,
14534
+ status: "NO MATCH"
14535
+ },
14536
+ {
14537
+ id: "ofac-008",
14538
+ created: "2024-01-11T15:10:00Z",
14539
+ entityId: "IND-003",
14540
+ entityName: "Robert Johnson",
14541
+ entityType: "Individual",
14542
+ alertId: "ALT-005",
14543
+ status: "CLEARED"
14544
+ },
14545
+ {
14546
+ id: "ofac-009",
14547
+ created: "2024-01-11T10:45:00Z",
14548
+ entityId: "CP-002",
14549
+ entityName: "Overseas Trading Company",
14550
+ entityType: "Counterparty",
14551
+ alertId: "ALT-006",
14552
+ status: "REVIEW"
14553
+ },
14554
+ {
14555
+ id: "ofac-010",
14556
+ created: "2024-01-10T14:25:00Z",
14557
+ entityId: "8110654",
14558
+ entityName: "Digital Ventures Group",
14559
+ entityType: "Business",
14560
+ alertId: null,
14561
+ status: "NO MATCH"
14562
+ }
14563
+ ];
14564
+ var getStatusVariant = (status) => {
14565
+ switch (status) {
14566
+ case "NO MATCH":
14567
+ return "success";
14568
+ case "REVIEW":
14569
+ return "warning";
14570
+ case "CLEARED":
14571
+ return "active";
14572
+ case "CONFIRMED":
14573
+ return "destructive";
14574
+ default:
14575
+ return "secondary";
14576
+ }
14577
+ };
14578
+ var getEntityUrl = (entityType, entityId) => {
14579
+ switch (entityType) {
14580
+ case "Business":
14581
+ return `/business/${entityId}`;
14582
+ case "Individual":
14583
+ return `/individual/${entityId}`;
14584
+ case "Counterparty":
14585
+ return `/counterparty/${entityId}`;
14586
+ default:
14587
+ return "#";
14588
+ }
14589
+ };
14590
+ function OFAC() {
14591
+ const navigate = useNavigate();
14592
+ const [sortField, setSortField] = useState("created");
14593
+ const [sortDirection, setSortDirection] = useState("desc");
14594
+ const [filters, setFilters] = useState({
14595
+ status: "",
14596
+ entityType: "",
14597
+ startDate: void 0,
14598
+ endDate: void 0
14599
+ });
14600
+ const handleFilterChange = (field, value) => {
14601
+ setFilters((prev) => ({ ...prev, [field]: value }));
14602
+ };
14603
+ const handleResetFilters = () => {
14604
+ setFilters({
14605
+ status: "",
14606
+ entityType: "",
14607
+ startDate: void 0,
14608
+ endDate: void 0
14609
+ });
14610
+ };
14611
+ const handleSort = (field) => {
14612
+ if (sortField === field) {
14613
+ setSortDirection(sortDirection === "asc" ? "desc" : "asc");
14614
+ } else {
14615
+ setSortField(field);
14616
+ setSortDirection("desc");
14617
+ }
14618
+ };
14619
+ const filteredChecks = useMemo(() => {
14620
+ return mockOFACChecks.filter((check) => {
14621
+ if (filters.status && check.status !== filters.status) {
14622
+ return false;
14623
+ }
14624
+ if (filters.entityType && check.entityType !== filters.entityType) {
14625
+ return false;
14626
+ }
14627
+ if (filters.startDate || filters.endDate) {
14628
+ const checkDate = parseISO(check.created);
14629
+ if (filters.startDate && isBefore(checkDate, startOfDay(filters.startDate))) {
14630
+ return false;
14631
+ }
14632
+ if (filters.endDate && isAfter(checkDate, endOfDay(filters.endDate))) {
14633
+ return false;
14634
+ }
14635
+ }
14636
+ return true;
14637
+ });
14638
+ }, [filters]);
14639
+ const sortedChecks = [...filteredChecks].sort((a, b) => {
14640
+ const aValue = a[sortField];
14641
+ const bValue = b[sortField];
14642
+ if (aValue == null) return 1;
14643
+ if (bValue == null) return -1;
14644
+ if (sortDirection === "asc") {
14645
+ return aValue > bValue ? 1 : -1;
14646
+ } else {
14647
+ return aValue < bValue ? 1 : -1;
14648
+ }
14649
+ });
14650
+ const columns3 = [
14651
+ {
14652
+ key: "created",
14653
+ title: "Created",
14654
+ sortable: true,
14655
+ render: (value) => /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: format(parseISO(value), "MMM d, yyyy h:mm a") })
14656
+ },
14657
+ {
14658
+ key: "entityName",
14659
+ title: "Entity",
14660
+ render: (value, row) => /* @__PURE__ */ jsx(
14661
+ "button",
14662
+ {
14663
+ onClick: () => navigate(getEntityUrl(row.entityType, row.entityId)),
14664
+ className: "text-sm text-primary hover:underline font-medium",
14665
+ children: value
14666
+ }
14667
+ )
14668
+ },
14669
+ {
14670
+ key: "entityType",
14671
+ title: "Entity Type",
14672
+ sortable: true,
14673
+ render: (value) => /* @__PURE__ */ jsx("span", { className: "text-sm", children: value })
14674
+ },
14675
+ {
14676
+ key: "alertId",
14677
+ title: "Alert ID",
14678
+ render: (value) => value ? /* @__PURE__ */ jsx(
14679
+ "button",
14680
+ {
14681
+ onClick: () => navigate(`/alerts/${value}`),
14682
+ className: "text-sm text-primary hover:underline font-medium",
14683
+ children: value
14684
+ }
14685
+ ) : /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: "\u2014" })
14686
+ },
14687
+ {
14688
+ key: "status",
14689
+ title: "Status",
14690
+ sortable: true,
14691
+ render: (value) => /* @__PURE__ */ jsx(Badge, { variant: getStatusVariant(value), children: value })
14692
+ }
14693
+ ];
14694
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col h-screen bg-gradient-subtle", children: [
14695
+ /* @__PURE__ */ jsx("div", { className: "flex-none border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60", children: /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4 py-6 max-w-none", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
14696
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("h1", { className: "text-3xl font-bold text-foreground", children: "OFAC Checks" }) }),
14697
+ /* @__PURE__ */ jsx(
14698
+ OFACFiltersSheet,
14699
+ {
14700
+ filters,
14701
+ onFilterChange: handleFilterChange,
14702
+ onResetFilters: handleResetFilters
14703
+ }
14704
+ )
14705
+ ] }) }) }),
14706
+ /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4 h-full max-w-none flex flex-col", children: /* @__PURE__ */ jsx("div", { className: "flex-1 mt-4 overflow-auto", children: /* @__PURE__ */ jsx(
14707
+ DataTable,
14708
+ {
14709
+ columns: columns3,
14710
+ data: sortedChecks,
14711
+ sortBy: sortField,
14712
+ sortDirection,
14713
+ onSort: handleSort
14714
+ }
14715
+ ) }) }) })
14716
+ ] });
14717
+ }
13979
14718
 
13980
- export { ACHBankCard, ACHBasicInfoCard, ACHDetailsSection, ACHTransferSection, AccountCard, AccountDetail_default as AccountDetail, Accounts_default as Accounts, AddressForm, AlertDetail_default as AlertDetail, AlertDetailRouter, AlertDocuments, AlertHeaderControls, AlertNotes, AlertTimeline, Alerts_default as Alerts, AppSidebar, Badge, BankAddressCard, BankingDetailsCard, BasicInfoCard, BasicInfoSection, BeneficiaryAddress, BeneficiaryCard, BeneficiaryDomesticWire, Breadcrumb, BusinessDetail_default as BusinessDetail, BusinessDetailView, BusinessFiltersSheet, BusinessProfileCard, BusinessStatusCard, BusinessTypeBadge, Businesses_default as Businesses, Button, CIPStatusBadge, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Cases_default as Cases, Checkbox, ContactInfoCard, Container, ContextSection, Counterparties_default as Counterparties, CounterpartiesView, CounterpartyBasicInfo, CounterpartyDetail_default as CounterpartyDetail, CounterpartyProfileCard, CounterpartyRecordsCard, CounterpartyTypeBadge, Create_default as CreateBusiness, CreateBusinessView, Create_default2 as CreateCounterparty, Create_default3 as CreateIndividual, Dashboard_default as Dashboard, DashboardDemo, DataGrid, DataTable, DetailPageLayout, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, EditableFormCard, EditableInfoField, EnhancedInput, EnhancedSelect, EnhancedTextarea, EntityCard, FormCard, FormField, FormInput, FormProvider, FormSection, FormSelect, IndividualDetail_default as IndividualDetail, Individuals_default as Individuals, InfoField, IntermediaryCard, IntermediaryFI, IntermediaryFIAddress, JsonViewer, Label, ListPage, MainLayout, MetricCard, NewTransaction, NotFound_default as NotFound, OFACAlertView, OriginatorCard, OriginatorFI, OriginatorFIAddress, PageLayout, PatternLibrary, PaymentInformationSection, Popover, PopoverContent, PopoverTrigger, ReceiverCard, ResolveAlertDialog, ResponsiveGrid, ScrollArea, ScrollBar, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Stack, Statement, StatementHeader, StatementView, StatusBadge, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransactionDetail_default as TransactionDetail, TransactionHistory_default as TransactionHistory, TransactionTypeBadge, UIKit, UIKitShowcase, WireDetailsSection, WireTransferSection, badgeVariants, buttonVariants, cardVariants, downloadCSV, generateStatementCSV, inputVariants, reducer, textareaVariants, toast, useAlertDetail, useCounterpartyEntity, useEditState, useFormWithEditState, useIsMobile, useSidebar, useToast };
14719
+ export { ACHBankCard, ACHBasicInfoCard, ACHDetailsSection, ACHTransferSection, AccountCard, AccountDetail_default as AccountDetail, Accounts_default as Accounts, AddressForm, AlertDetail_default as AlertDetail, AlertDetailRouter, AlertDocuments, AlertHeaderControls, AlertNotes, AlertTimeline, Alerts_default as Alerts, AppSidebar, Badge, BankAddressCard, BankingDetailsCard, BasicInfoCard, BasicInfoSection, BeneficiaryAddress, BeneficiaryCard, BeneficiaryDomesticWire, Breadcrumb, BusinessDetail_default as BusinessDetail, BusinessDetailView, BusinessFiltersSheet, BusinessProfileCard, BusinessStatusCard, BusinessTypeBadge, Businesses_default as Businesses, Button, CIPStatusBadge, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Cases_default as Cases, Checkbox, ContactInfoCard, Container, ContextSection, Counterparties_default as Counterparties, CounterpartiesView, CounterpartyBasicInfo, CounterpartyDetail_default as CounterpartyDetail, CounterpartyProfileCard, CounterpartyRecordsCard, CounterpartyTypeBadge, Create_default as CreateBusiness, CreateBusinessView, Create_default2 as CreateCounterparty, Create_default3 as CreateIndividual, Dashboard_default as Dashboard, DashboardDemo, DataGrid, DataTable, DetailPageLayout, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, EditableFormCard, EditableInfoField, EnhancedInput, EnhancedSelect, EnhancedTextarea, EntityCard, FormCard, FormField, FormInput, FormProvider, FormSection, FormSelect, IndividualDetail_default as IndividualDetail, Individuals_default as Individuals, InfoField, IntermediaryCard, IntermediaryFI, IntermediaryFIAddress, JsonViewer, Label, ListPage, MainLayout, MetricCard, NewTransaction, NotFound_default as NotFound, OFAC, OFACAlertView, OriginatorCard, OriginatorFI, OriginatorFIAddress, PageLayout, PatternLibrary, PaymentInformationSection, Popover, PopoverContent, PopoverTrigger, ReceiverCard, ResolveAlertDialog, ResponsiveGrid, ScrollArea, ScrollBar, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Stack, Statement, StatementHeader, StatementView, StatusBadge, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransactionDetail_default as TransactionDetail, TransactionHistory_default as TransactionHistory, TransactionTypeBadge, UIKit, UIKitShowcase, WireDetailsSection, WireTransferSection, badgeVariants, buttonVariants, cardVariants, downloadCSV, generateStatementCSV, inputVariants, reducer, textareaVariants, toast, useAlertDetail, useCounterpartyEntity, useEditState, useFormWithEditState, useIsMobile, useSidebar, useToast };
13981
14720
  //# sourceMappingURL=index.js.map
13982
14721
  //# sourceMappingURL=index.js.map