{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "bill-of-lading-viewer",
  "title": "Bill Of Lading Viewer",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-react/blocks/bill-of-lading-viewer/BillOfLadingViewer.tsx",
      "content": "'use client'\n\nimport * as React from 'react'\nimport { useState } from 'react'\nimport {\n  AlertCircle,\n  Anchor,\n  Building2,\n  Check,\n  CheckCircle2,\n  Copy,\n  Download,\n  FileText,\n  Mail,\n  MapPin,\n  Phone,\n  Printer,\n  ShieldCheck,\n  Ship,\n} from 'lucide-react'\nimport { cn } from '@/lib/utils'\nimport { Badge } from '@/components/ui/badge'\nimport { Button } from '@/components/ui/button'\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'\nimport { Separator } from '@/components/ui/separator'\nimport { Table, TableBody, TableCell, TableFooter, TableHead, TableHeader, TableRow } from '@/components/ui/table'\n\nexport interface ContainerCargoItem {\n  id: string\n  containerNo: string\n  sealNo: string\n  containerType: string\n  packagesCount: number\n  packagesKind: string\n  description: string\n  hsCode: string\n  grossWeightKg: number\n  grossWeightLbs: number\n  volumeCbm: number\n  hazardClass?: string\n  temperature?: string\n}\n\nexport interface ComplianceGate {\n  id: string\n  name: string\n  status: 'passed' | 'warning' | 'pending'\n  authority: string\n  reference: string\n  details: string\n}\n\nexport interface BillOfLadingViewerProps {\n  className?: string\n  documentTitle?: string\n  bolNumber?: string\n  carrierName?: string\n  scacCode?: string\n  bookingReference?: string\n  exportReference?: string\n  issueDate?: string\n  placeOfIssue?: string\n  shipperName?: string\n  shipperAddress?: string\n  shipperContact?: string\n  shipperEmail?: string\n  shipperEori?: string\n  consigneeName?: string\n  consigneeAddress?: string\n  consigneeContact?: string\n  consigneeEmail?: string\n  consigneeEori?: string\n  notifyPartyName?: string\n  notifyPartyAddress?: string\n  notifyPartyContact?: string\n  notifyPartyEmail?: string\n  notifyPartyAttention?: string\n  preCarriageBy?: string\n  placeOfReceipt?: string\n  vesselVoyage?: string\n  vesselImo?: string\n  vesselFlag?: string\n  portOfLoading?: string\n  portOfDischarge?: string\n  placeOfDelivery?: string\n  finalDestination?: string\n  freightTerms?: string\n  freightPayableAt?: string\n  declaredValue?: string\n  insuranceCert?: string\n  incoterms?: string\n  letterOfCredit?: string\n  blockchainTxHash?: string\n  blockchainBlock?: string\n  blockchainNetwork?: string\n  onDownloadPdf?: () => void\n  onVerifyBlockchain?: () => void\n  onPrint?: () => void\n}\n\nconst CARGO_ITEMS: ContainerCargoItem[] = [\n  {\n    id: 'cargo-1',\n    containerNo: 'MSKU-948201-4',\n    sealNo: 'SL-94021',\n    containerType: \"40' High Cube (40' HC)\",\n    packagesCount: 24,\n    packagesKind: 'Pallets / 480 Cartons',\n    description: 'Consumer Electronics: Pro Audio Studio Headphones, Dynamic Transducers & Wireless DAC Amplifiers',\n    hsCode: '8518.30.00',\n    grossWeightKg: 4850.0,\n    grossWeightLbs: 10692.42,\n    volumeCbm: 32.4,\n    hazardClass: 'UN3481 Class 9 (Lithium Ion Batteries contained in equipment)',\n    temperature: 'Ambient (Dry Van)',\n  },\n  {\n    id: 'cargo-2',\n    containerNo: 'MSKU-819034-2',\n    sealNo: 'SL-94022',\n    containerType: \"40' High Cube (40' HC)\",\n    packagesCount: 16,\n    packagesKind: 'Pallets / 320 Cartons',\n    description: 'Audio Accessories: Braided MMCX Oxygen-Free Cables, Velour Replacement Earpads & Hard Travel Cases',\n    hsCode: '8518.90.80',\n    grossWeightKg: 2320.0,\n    grossWeightLbs: 5114.72,\n    volumeCbm: 18.6,\n    hazardClass: 'Non-Hazardous / Standard Cargo',\n    temperature: 'Ambient (Dry Van)',\n  },\n]\n\nconst COMPLIANCE_GATES: ComplianceGate[] = [\n  {\n    id: 'gate-1',\n    name: 'EU EORI & VAT Identity Verification',\n    status: 'passed',\n    authority: 'European Customs Agency (VIES / EOS)',\n    reference: 'NL864219034',\n    details: 'Consignee EORI validated against EU Economic Operators Registry with valid Dutch VAT matching.',\n  },\n  {\n    id: 'gate-2',\n    name: 'ICS2 Entry Summary Declaration (ENS)',\n    status: 'passed',\n    authority: 'EU Customs Import Control System 2',\n    reference: 'MRN: 26NL948201083921A',\n    details: 'Pre-arrival cargo security manifest filed 24 hours prior to loading in Shanghai (Approved).',\n  },\n  {\n    id: 'gate-3',\n    name: 'HS Tariff Classification & Duty Schedule',\n    status: 'passed',\n    authority: 'TARIC European Customs Database',\n    reference: 'HS 8518.30.00 / 8518.90.80',\n    details: 'Eligible for 0.0% EU base tariff rate + standard 21.0% Netherlands Import VAT under Article 23.',\n  },\n  {\n    id: 'gate-4',\n    name: 'ISO 17712 High-Security Container Seals',\n    status: 'passed',\n    authority: 'International Maritime Organization (IMO)',\n    reference: 'SL-94021 / SL-94022',\n    details: 'High-security mechanical bolt seals verified intact at origin terminal container gate-in.',\n  },\n  {\n    id: 'gate-5',\n    name: 'IMDG Dangerous Goods UN3481 Compliance',\n    status: 'passed',\n    authority: 'International Maritime Dangerous Goods (IMDG)',\n    reference: 'UN3481 PI966 Sec. II',\n    details: 'Lithium-ion cells packed with equipment certified under special provision 188 for under-deck stowage.',\n  },\n  {\n    id: 'gate-6',\n    name: 'Global Sanctions & Denied Party Screening',\n    status: 'passed',\n    authority: 'UN, OFAC & EU Consolidated Sanction Lists',\n    reference: 'SCR-2026-99104',\n    details: '0 matches identified across all parties (Shipper, Consignee, Notify Party, Carrier vessel).',\n  },\n]\n\nexport function BillOfLadingViewer({\n  className,\n  documentTitle = 'Straight Bill of Lading (Original)',\n  bolNumber = '#BOL-2026-894210',\n  carrierName = 'Maersk Line A/S',\n  scacCode = 'MAEU',\n  bookingReference = 'BKG-771920-EU',\n  exportReference = 'EXP-2026-0812',\n  issueDate = 'August 21, 2026',\n  placeOfIssue = 'Shanghai, China',\n  shipperName = 'Shenzhen AudioTech Precision Ltd.',\n  shipperAddress = 'Building 4, High-Tech Industrial Park, Nanshan District, Shenzhen, Guangdong 518057, China',\n  shipperContact = '+86 755 8892 1044',\n  shipperEmail = 'export@audiotech-cn.com',\n  shipperEori = 'CN-91440300MA5EXP01',\n  consigneeName = 'SonicAura Europe B.V.',\n  consigneeAddress = 'Keizersgracht 421, 1016 EK Amsterdam, Netherlands',\n  consigneeContact = '+31 20 894 3300',\n  consigneeEmail = 'import@sonicaura.eu',\n  consigneeEori = 'NL864219034 / VAT: NL864219034B01',\n  notifyPartyName = 'Rotterdam Intermodal Logistics GmbH',\n  notifyPartyAddress = 'Willemskade 18, 3016 DK Rotterdam, Netherlands',\n  notifyPartyContact = '+31 10 400 9820',\n  notifyPartyEmail = 'clearance@rotterdam-intermodal.com',\n  notifyPartyAttention = 'Customs Brokerage Dept. / Desk 4B',\n  preCarriageBy = 'Feeder Barge \"Yangtze River 12\"',\n  placeOfReceipt = 'Shenzhen Inland Depot, China (CNSZX)',\n  vesselVoyage = 'Ever Given / V.042W',\n  vesselImo = 'IMO 9811000',\n  vesselFlag = 'Panama (PA)',\n  portOfLoading = 'Shanghai Port, China (CNSHA)',\n  portOfDischarge = 'Rotterdam Port, Netherlands (NLRTM)',\n  placeOfDelivery = 'Duisburg Intermodal Terminal, Germany (DEDUI)',\n  finalDestination = 'Duisburg Central DC #4 (DEDUI)',\n  freightTerms = 'Prepaid',\n  freightPayableAt = 'Shanghai, China',\n  declaredValue = '$142,500.00 USD',\n  insuranceCert = '#INS-9421-MAR',\n  incoterms = 'CIF Rotterdam Port (Incoterms 2020)',\n  letterOfCredit = 'LC-BNP-2026-99410-EU (BNP Paribas)',\n  blockchainTxHash = '0x71e4d3a8904f84c8a5142d131fba827b5e4c91a2',\n  blockchainBlock = '59,182,904',\n  blockchainNetwork = 'Polygon Mainnet (Decentralized Cargo Registry)',\n  onDownloadPdf,\n  onVerifyBlockchain,\n  onPrint,\n}: BillOfLadingViewerProps) {\n  const [activeTab, setActiveTab] = useState<'document' | 'compliance' | 'edi'>('document')\n  const [copiedBol, setCopiedBol] = useState(false)\n  const [copiedEdi, setCopiedEdi] = useState(false)\n  const [showVerifyDetails, setShowVerifyDetails] = useState(false)\n\n  const totalPackagesCount = CARGO_ITEMS.reduce((acc, item) => acc + item.packagesCount, 0)\n  const totalGrossWeightKg = CARGO_ITEMS.reduce((acc, item) => acc + item.grossWeightKg, 0)\n  const totalGrossWeightLbs = CARGO_ITEMS.reduce((acc, item) => acc + item.grossWeightLbs, 0)\n  const totalVolumeCbm = CARGO_ITEMS.reduce((acc, item) => acc + item.volumeCbm, 0)\n\n  const generateEdiText = () => {\n    return `UNB+UNOA:2+${scacCode}:ZZ+SONICAURA:ZZ+260821:1400+0000001'\nUNH+1+IFTMIN:D:01B:UN:EAN004'\nBGM+705+${bolNumber.replace('#', '')}+9'\nDTM+137:20260821:102'\nNAD+CZ+${shipperEori}::9++${shipperName}+${shipperAddress}+SHENZHEN++518057+CN'\nNAD+CN+NL864219034::9++${consigneeName}+${consigneeAddress}+AMSTERDAM++1016EK+NL'\nNAD+NI+++${notifyPartyName}+${notifyPartyAddress}+ROTTERDAM++3016DK+NL'\nTDT+20+V.042W+1+13+MAEU:172:20+++${vesselImo}::11:${vesselVoyage}'\nLOC+9+CNSHA:139:6+SHANGHAI PORT'\nLOC+11+NLRTM:139:6+ROTTERDAM PORT'\nLOC+7+DEDUI:139:6+DUISBURG TERMINAL'\nEQD+CN+MSKU9482014+45G1:102:5++2+5'\nSEL+SL94021+SH'\nGID+1+24:BX+PRO AUDIO HEADPHONES:85183000'\nMEA+WT+G+KGM:4850.00'\nMEA+VOL+AAW+MTQ:32.40'\nMOA+39:142500:USD'\nUNT+18+1'\nUNZ+1+0000001'`\n  }\n\n  const handleCopyBol = () => {\n    if (typeof navigator !== 'undefined' && navigator.clipboard) {\n      navigator.clipboard.writeText(bolNumber)\n      setCopiedBol(true)\n      setTimeout(() => setCopiedBol(false), 2000)\n    }\n  }\n\n  const handleCopyEdi = () => {\n    const ediContent = generateEdiText()\n    if (typeof navigator !== 'undefined' && navigator.clipboard) {\n      navigator.clipboard.writeText(ediContent)\n      setCopiedEdi(true)\n      setTimeout(() => setCopiedEdi(false), 2000)\n    }\n  }\n\n  const handlePrint = () => {\n    onPrint?.()\n    if (typeof window !== 'undefined') {\n      window.print()\n    }\n  }\n\n  const handleDownloadPdf = () => {\n    onDownloadPdf?.()\n    handlePrint()\n  }\n\n  const toggleBlockchainDetails = () => {\n    setShowVerifyDetails((prev) => !prev)\n    onVerifyBlockchain?.()\n  }\n\n  return (\n    <div data-slot=\"bill-of-lading-viewer\" className={cn('text-foreground w-full space-y-6', className)}>\n      {/* Top Action Bar / Document Control Header */}\n      <div className=\"border-border bg-card flex flex-col gap-4 rounded-xl border p-4 shadow-xs sm:flex-row sm:items-center sm:justify-between\">\n        <div className=\"space-y-1\">\n          <div className=\"flex flex-wrap items-center gap-2\">\n            <Badge wrap variant=\"outline\" className=\"font-mono text-xs tracking-wider uppercase\">\n              {scacCode} &bull; Maritime Ocean BOL\n            </Badge>\n            <button\n              type=\"button\"\n              className=\"group focus-visible:ring-ring border-success/30 bg-success/10 text-success hover:bg-success/20 text-success inline-flex min-h-6 items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium transition-colors focus-visible:ring-2 focus-visible:outline-none\"\n              onClick={toggleBlockchainDetails}\n            >\n              <ShieldCheck className=\"size-3.5\" aria-hidden=\"true\" />\n              <span>Verify Blockchain Authenticity</span>\n              <span className=\"bg-success size-1.5 animate-pulse rounded-full\" aria-hidden=\"true\" />\n            </button>\n          </div>\n          <div className=\"flex flex-wrap items-center gap-2 pt-1\">\n            <h1 className=\"text-xl font-bold tracking-tight sm:text-2xl\">{documentTitle}</h1>\n            <span className=\"text-muted-foreground font-mono text-base font-semibold tabular-nums\">{bolNumber}</span>\n            <Button\n              variant=\"ghost\"\n              size=\"icon\"\n              className=\"text-muted-foreground hover:text-foreground size-7\"\n              title=\"Copy BOL number\"\n              onClick={handleCopyBol}\n            >\n              {copiedBol ? <Check className=\"text-success size-3.5\" /> : <Copy className=\"size-3.5\" />}\n              <span className=\"sr-only\">Copy BOL number</span>\n            </Button>\n          </div>\n          <p className=\"text-muted-foreground text-xs\">\n            Carrier: <strong className=\"text-foreground font-medium\">{carrierName}</strong> &bull; Issued: {issueDate}{' '}\n            in {placeOfIssue}\n          </p>\n        </div>\n\n        {/* Action Buttons & Tab Switcher */}\n        <div className=\"flex flex-wrap items-center gap-2 sm:self-center\">\n          <div className=\"border-border bg-muted/40 flex items-center rounded-lg border p-1\">\n            <button\n              type=\"button\"\n              className={cn(\n                'focus-visible:ring-ring rounded-md px-3 py-1.5 text-xs font-medium transition-colors focus-visible:ring-2 focus-visible:outline-none',\n                activeTab === 'document'\n                  ? 'bg-background text-foreground shadow-xs'\n                  : 'text-muted-foreground hover:text-foreground',\n              )}\n              onClick={() => setActiveTab('document')}\n            >\n              Document View\n            </button>\n            <button\n              type=\"button\"\n              className={cn(\n                'focus-visible:ring-ring flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors focus-visible:ring-2 focus-visible:outline-none',\n                activeTab === 'compliance'\n                  ? 'bg-background text-foreground shadow-xs'\n                  : 'text-muted-foreground hover:text-foreground',\n              )}\n              onClick={() => setActiveTab('compliance')}\n            >\n              <span>Customs &amp; Compliance</span>\n              <Badge\n                wrap\n                variant=\"success\"\n                className=\"size-4 justify-center p-0 text-center font-mono text-xs leading-4\"\n              >\n                6\n              </Badge>\n            </button>\n            <button\n              type=\"button\"\n              className={cn(\n                'focus-visible:ring-ring rounded-md px-3 py-1.5 text-xs font-medium transition-colors focus-visible:ring-2 focus-visible:outline-none',\n                activeTab === 'edi'\n                  ? 'bg-background text-foreground shadow-xs'\n                  : 'text-muted-foreground hover:text-foreground',\n              )}\n              onClick={() => setActiveTab('edi')}\n            >\n              Raw EDI / JSON\n            </button>\n          </div>\n\n          <Button variant=\"outline\" size=\"sm\" className=\"gap-1.5 text-xs\" onClick={handlePrint}>\n            <Printer className=\"size-3.5\" aria-hidden=\"true\" />\n            <span>Print</span>\n          </Button>\n\n          <Button aria-label=\"Download attachment\" size=\"sm\" className=\"gap-1.5 text-xs\" onClick={handleDownloadPdf}>\n            <Download className=\"size-3.5\" aria-hidden=\"true\" />\n            <span>Download Printable BOL</span>\n          </Button>\n        </div>\n      </div>\n\n      {/* Blockchain Cryptographic Proof Drawer / Card */}\n      {showVerifyDetails && (\n        <div className=\"animate-in fade-in slide-in-from-top-2 border-success/30 bg-success/5 rounded-xl border p-4 text-xs transition-colors\">\n          <div className=\"flex flex-col gap-3 md:flex-row md:items-center md:justify-between\">\n            <div className=\"flex items-start gap-3\">\n              <div className=\"bg-success/10 text-success rounded-lg p-2\">\n                <ShieldCheck className=\"size-5 shrink-0\" aria-hidden=\"true\" />\n              </div>\n              <div className=\"space-y-1\">\n                <div className=\"flex items-center gap-2\">\n                  <span className=\"text-foreground font-semibold\">\n                    Cryptographic Bill of Lading Authenticity Verified\n                  </span>\n                  <Badge wrap variant=\"success\" className=\"text-xs\">\n                    Immutable Ledger Record\n                  </Badge>\n                </div>\n                <p className=\"text-muted-foreground\">\n                  Document state verified on {blockchainNetwork}. Digital hash matches original carrier signature at\n                  origin.\n                </p>\n              </div>\n            </div>\n\n            <div className=\"flex flex-wrap items-center gap-2 font-mono text-xs\">\n              <span className=\"bg-background/80 border-border text-foreground rounded border px-2 py-1\">\n                Block #{blockchainBlock}\n              </span>\n              <span\n                className=\"bg-background/80 border-border text-foreground max-w-xs truncate rounded border px-2 py-1\"\n                title={blockchainTxHash}\n              >\n                Tx: {blockchainTxHash}\n              </span>\n            </div>\n          </div>\n        </div>\n      )}\n\n      {/* TAB 1: OFFICIAL BILL OF LADING PAPER DOCUMENT */}\n      {activeTab === 'document' && (\n        <div className=\"border-border bg-card overflow-hidden rounded-xl border shadow-xs print:border-none print:shadow-none\">\n          {/* Formal Document Header */}\n          <div className=\"border-border bg-muted/20 border-b p-6 sm:p-8\">\n            <div className=\"flex flex-col gap-6 lg:flex-row lg:items-start lg:justify-between\">\n              {/* Carrier Branding & Document Classification */}\n              <div className=\"space-y-3\">\n                <div className=\"flex items-center gap-3\">\n                  <div className=\"bg-primary text-primary-foreground flex size-10 items-center justify-center rounded-lg shadow-xs\">\n                    <Anchor className=\"size-5\" aria-hidden=\"true\" />\n                  </div>\n                  <div>\n                    <h2 className=\"text-lg font-semibold tracking-tight sm:text-xl\">{carrierName}</h2>\n                    <p className=\"text-muted-foreground font-mono text-xs\">\n                      SCAC: {scacCode} &bull; Standard Ocean Carrier Bill of Lading\n                    </p>\n                  </div>\n                </div>\n                <p className=\"text-muted-foreground max-w-xl text-xs leading-relaxed\">\n                  Issued in accordance with the International Convention for the Unification of Certain Rules of Law\n                  relating to Bills of Lading (Hague-Visby Rules) and UN Multimodal Transport Guidelines.\n                </p>\n              </div>\n\n              {/* Document References & Status Stamp */}\n              <div className=\"border-border bg-background/80 flex flex-col gap-2 rounded-lg border p-4 sm:min-w-[280px]\">\n                <div className=\"flex items-center justify-between gap-4\">\n                  <span className=\"text-muted-foreground text-xs font-medium\">Bill of Lading No.</span>\n                  <span className=\"text-primary font-mono text-sm font-semibold tabular-nums\">{bolNumber}</span>\n                </div>\n                <div className=\"flex items-center justify-between gap-4\">\n                  <span className=\"text-muted-foreground text-xs\">Booking Reference:</span>\n                  <span className=\"font-mono text-xs font-semibold tabular-nums\">{bookingReference}</span>\n                </div>\n                <div className=\"flex items-center justify-between gap-4\">\n                  <span className=\"text-muted-foreground text-xs\">Export Reference:</span>\n                  <span className=\"font-mono text-xs tabular-nums\">{exportReference}</span>\n                </div>\n                <Separator className=\"my-1\" />\n                <div className=\"flex items-center justify-between gap-4\">\n                  <span className=\"text-muted-foreground text-xs\">Document Status:</span>\n                  <Badge wrap variant=\"default\" className=\"text-xs font-medium\">\n                    Negotiable / Original\n                  </Badge>\n                </div>\n              </div>\n            </div>\n          </div>\n\n          {/* Section 1: Parties Grid (Shipper, Consignee, Notify Party) */}\n          <div className=\"divide-border border-border grid grid-cols-1 divide-y border-b md:grid-cols-3 md:divide-x md:divide-y-0\">\n            {/* Shipper / Exporter */}\n            <div className=\"bg-card space-y-3 p-5 sm:p-6\">\n              <div className=\"flex items-center justify-between\">\n                <span className=\"text-primary font-mono text-xs font-semibold\">1. Shipper / Exporter</span>\n                <Building2 className=\"text-muted-foreground size-4\" aria-hidden=\"true\" />\n              </div>\n              <div className=\"space-y-1.5 text-xs\">\n                <p className=\"text-foreground text-sm font-semibold\">{shipperName}</p>\n                <p className=\"text-muted-foreground leading-relaxed\">{shipperAddress}</p>\n                <div className=\"text-muted-foreground space-y-1 pt-2\">\n                  <p className=\"flex items-center gap-1.5\">\n                    <Phone className=\"text-muted-foreground size-3 shrink-0\" />\n                    <span className=\"tabular-nums\">{shipperContact}</span>\n                  </p>\n                  <p className=\"flex items-center gap-1.5\">\n                    <Mail className=\"text-muted-foreground size-3 shrink-0\" />\n                    <span>{shipperEmail}</span>\n                  </p>\n                  <p className=\"text-foreground pt-1 font-mono\">\n                    <span className=\"text-muted-foreground\">EORI / Tax ID:</span> {shipperEori}\n                  </p>\n                </div>\n              </div>\n            </div>\n\n            {/* Consignee / Importer */}\n            <div className=\"bg-card space-y-3 p-5 sm:p-6\">\n              <div className=\"flex items-center justify-between\">\n                <span className=\"text-primary font-mono text-xs font-semibold\">2. Consignee / Importer</span>\n                <MapPin className=\"text-muted-foreground size-4\" aria-hidden=\"true\" />\n              </div>\n              <div className=\"space-y-1.5 text-xs\">\n                <p className=\"text-foreground text-sm font-semibold\">{consigneeName}</p>\n                <p className=\"text-muted-foreground leading-relaxed\">{consigneeAddress}</p>\n                <div className=\"text-muted-foreground space-y-1 pt-2\">\n                  <p className=\"flex items-center gap-1.5\">\n                    <Phone className=\"text-muted-foreground size-3 shrink-0\" />\n                    <span className=\"tabular-nums\">{consigneeContact}</span>\n                  </p>\n                  <p className=\"flex items-center gap-1.5\">\n                    <Mail className=\"text-muted-foreground size-3 shrink-0\" />\n                    <span>{consigneeEmail}</span>\n                  </p>\n                  <p className=\"text-foreground pt-1 font-mono\">\n                    <span className=\"text-muted-foreground\">EORI / VAT:</span> {consigneeEori}\n                  </p>\n                </div>\n              </div>\n            </div>\n\n            {/* Notify Party */}\n            <div className=\"bg-card space-y-3 p-5 sm:p-6\">\n              <div className=\"flex items-center justify-between\">\n                <span className=\"text-primary font-mono text-xs font-semibold\">3. Notify Party</span>\n                <FileText className=\"text-muted-foreground size-4\" aria-hidden=\"true\" />\n              </div>\n              <div className=\"space-y-1.5 text-xs\">\n                <p className=\"text-foreground text-sm font-semibold\">{notifyPartyName}</p>\n                <p className=\"text-muted-foreground leading-relaxed\">{notifyPartyAddress}</p>\n                <div className=\"text-muted-foreground space-y-1 pt-2\">\n                  <p className=\"flex items-center gap-1.5\">\n                    <Phone className=\"text-muted-foreground size-3 shrink-0\" />\n                    <span className=\"tabular-nums\">{notifyPartyContact}</span>\n                  </p>\n                  <p className=\"flex items-center gap-1.5\">\n                    <Mail className=\"text-muted-foreground size-3 shrink-0\" />\n                    <span>{notifyPartyEmail}</span>\n                  </p>\n                  <p className=\"text-foreground pt-1 font-medium\">\n                    <span className=\"text-muted-foreground\">Attention:</span> {notifyPartyAttention}\n                  </p>\n                </div>\n              </div>\n            </div>\n          </div>\n\n          {/* Section 2: Transport & Routing Details Grid */}\n          <div className=\"border-border bg-muted/10 border-b p-5 sm:p-6\">\n            <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4\">\n              <div className=\"border-border bg-card space-y-1 rounded-lg border p-3 shadow-xs\">\n                <span className=\"text-muted-foreground text-xs font-medium\">Pre-Carriage By</span>\n                <p className=\"text-foreground text-xs font-semibold\">{preCarriageBy}</p>\n                <span className=\"text-muted-foreground text-xs\">Receipt: {placeOfReceipt}</span>\n              </div>\n\n              <div className=\"border-border bg-card space-y-1 rounded-lg border p-3 shadow-xs\">\n                <span className=\"text-muted-foreground text-xs font-medium\">Ocean Vessel &amp; Voyage</span>\n                <p className=\"text-foreground flex items-center gap-1.5 text-xs font-semibold\">\n                  <Ship className=\"text-primary size-3.5 shrink-0\" />\n                  <span>{vesselVoyage}</span>\n                </p>\n                <span className=\"text-muted-foreground font-mono text-xs\">\n                  {vesselImo} &bull; {vesselFlag}\n                </span>\n              </div>\n\n              <div className=\"border-border bg-card space-y-1 rounded-lg border p-3 shadow-xs\">\n                <span className=\"text-muted-foreground text-xs font-medium\">Port of Loading (POL)</span>\n                <p className=\"text-foreground text-xs font-semibold\">{portOfLoading}</p>\n                <span className=\"text-muted-foreground text-xs\">Departure: Aug 23, 2026</span>\n              </div>\n\n              <div className=\"border-border bg-card space-y-1 rounded-lg border p-3 shadow-xs\">\n                <span className=\"text-muted-foreground text-xs font-medium\">Port of Discharge (POD)</span>\n                <p className=\"text-foreground text-xs font-semibold\">{portOfDischarge}</p>\n                <span className=\"text-muted-foreground text-xs\">Delivery: {placeOfDelivery}</span>\n              </div>\n            </div>\n          </div>\n\n          {/* Section 3: Container & Cargo Manifest Table */}\n          <div className=\"space-y-4 p-5 sm:p-6\">\n            <div className=\"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between\">\n              <div>\n                <h3 className=\"text-foreground text-sm font-semibold\">Container &amp; Cargo Description</h3>\n                <p className=\"text-muted-foreground text-xs\">\n                  Itemized manifest of goods, seal identification, Harmonized Tariff codes, and gross weight\n                </p>\n              </div>\n              <Badge wrap variant=\"outline\" className=\"w-fit font-mono text-xs\">\n                FCL / FCL &bull; CY-CY Movement\n              </Badge>\n            </div>\n\n            <div className=\"border-border overflow-hidden rounded-lg border\">\n              <div className=\"overflow-x-auto\">\n                <Table density=\"cozy\">\n                  <TableHeader>\n                    <TableRow>\n                      <TableHead className=\"text-xs\">Container No. &amp; Seal No.</TableHead>\n                      <TableHead className=\"text-xs\">Packages &amp; Kind</TableHead>\n                      <TableHead className=\"text-xs\">Description of Goods</TableHead>\n                      <TableHead className=\"text-xs\">HS Tariff Code</TableHead>\n                      <TableHead className=\"text-right text-xs\">Gross Wt (kg)</TableHead>\n                      <TableHead className=\"text-right text-xs\">Volume (CBM)</TableHead>\n                    </TableRow>\n                  </TableHeader>\n                  <TableBody>\n                    {CARGO_ITEMS.map((item) => (\n                      <TableRow key={item.id}>\n                        <TableCell className=\"align-top\">\n                          <div className=\"text-foreground font-mono text-xs font-semibold\">{item.containerNo}</div>\n                          <div className=\"text-muted-foreground font-mono text-xs\">Seal: {item.sealNo}</div>\n                          <Badge wrap variant=\"secondary\" className=\"mt-1 text-xs font-normal\">\n                            {item.containerType}\n                          </Badge>\n                        </TableCell>\n                        <TableCell className=\"align-top\">\n                          <div className=\"text-foreground text-xs font-medium tabular-nums\">\n                            {item.packagesCount} Pallets\n                          </div>\n                          <div className=\"text-muted-foreground text-xs\">{item.packagesKind}</div>\n                        </TableCell>\n                        <TableCell className=\"max-w-md align-top\">\n                          <div className=\"text-foreground text-xs leading-relaxed font-medium\">{item.description}</div>\n                          {item.hazardClass && (\n                            <div className=\"text-warning mt-1 flex items-center gap-1 text-xs\">\n                              <AlertCircle className=\"size-3 shrink-0\" />\n                              <span>{item.hazardClass}</span>\n                            </div>\n                          )}\n                        </TableCell>\n                        <TableCell className=\"text-foreground align-top font-mono text-xs tabular-nums\">\n                          {item.hsCode}\n                        </TableCell>\n                        <TableCell className=\"text-foreground text-right align-top font-mono text-xs font-semibold tabular-nums\">\n                          {item.grossWeightKg.toLocaleString('en-US', { minimumFractionDigits: 2 })} kg\n                          <div className=\"text-muted-foreground font-normal\">\n                            {item.grossWeightLbs.toLocaleString('en-US', { minimumFractionDigits: 1 })} lbs\n                          </div>\n                        </TableCell>\n                        <TableCell className=\"text-foreground text-right align-top font-mono text-xs tabular-nums\">\n                          {item.volumeCbm.toFixed(2)} m³\n                        </TableCell>\n                      </TableRow>\n                    ))}\n                  </TableBody>\n                  <TableFooter>\n                    <TableRow>\n                      <TableCell colSpan={2} className=\"text-xs font-semibold\">\n                        Totals: {CARGO_ITEMS.length} Containers &bull; {totalPackagesCount} Pallets\n                      </TableCell>\n                      <TableCell colSpan={2} className=\"text-muted-foreground text-xs\">\n                        Dangerous Goods Stowage Declared &bull; Certified Dry Van\n                      </TableCell>\n                      <TableCell className=\"text-foreground text-right font-mono text-xs font-semibold tabular-nums\">\n                        {totalGrossWeightKg.toLocaleString('en-US', { minimumFractionDigits: 2 })} kg\n                      </TableCell>\n                      <TableCell className=\"text-foreground text-right font-mono text-xs font-semibold tabular-nums\">\n                        {totalVolumeCbm.toFixed(2)} m³\n                      </TableCell>\n                    </TableRow>\n                  </TableFooter>\n                </Table>\n              </div>\n            </div>\n          </div>\n\n          {/* Section 4: Freight Charges & Commercial Terms */}\n          <div className=\"divide-border border-border grid grid-cols-1 divide-y border-t sm:grid-cols-2 sm:divide-x sm:divide-y-0 lg:grid-cols-4\">\n            <div className=\"bg-muted/10 space-y-1.5 p-5\">\n              <span className=\"text-muted-foreground text-xs font-medium\">Freight &amp; Charges</span>\n              <div className=\"flex items-center gap-2\">\n                <Badge wrap variant=\"default\" className=\"text-xs font-medium tracking-wide uppercase\">\n                  {freightTerms}\n                </Badge>\n              </div>\n              <p className=\"text-muted-foreground pt-1 text-xs\">\n                Payable at: <strong className=\"text-foreground\">{freightPayableAt}</strong>\n              </p>\n            </div>\n\n            <div className=\"bg-muted/10 space-y-1.5 p-5\">\n              <span className=\"text-muted-foreground text-xs font-medium\">Declared Value (Customs)</span>\n              <p className=\"text-foreground font-mono text-sm font-semibold tabular-nums\">{declaredValue}</p>\n              <p className=\"text-muted-foreground text-xs\">Commercial Invoice #INV-2026-8942</p>\n            </div>\n\n            <div className=\"bg-muted/10 space-y-1.5 p-5\">\n              <span className=\"text-muted-foreground text-xs font-medium\">Marine Cargo Insurance</span>\n              <p className=\"text-foreground font-mono text-xs font-semibold\">{insuranceCert}</p>\n              <p className=\"text-muted-foreground text-xs\">Institute Cargo Clauses (A) All Risks</p>\n            </div>\n\n            <div className=\"bg-muted/10 space-y-1.5 p-5\">\n              <span className=\"text-muted-foreground text-xs font-medium\">Incoterms &amp; Letter of Credit</span>\n              <p className=\"text-foreground text-xs font-semibold\">{incoterms}</p>\n              <p className=\"text-muted-foreground truncate font-mono text-xs\" title={letterOfCredit}>\n                {letterOfCredit}\n              </p>\n            </div>\n          </div>\n\n          {/* Section 5: Carrier Signature & Authorization Stamp */}\n          <div className=\"border-border bg-card border-t p-6 sm:p-8\">\n            <div className=\"grid grid-cols-1 gap-6 md:grid-cols-12 md:items-center\">\n              {/* Left: Carrier Certification Notice */}\n              <div className=\"space-y-2 md:col-span-6\">\n                <span className=\"text-primary text-xs font-semibold\">Carrier Authorization &amp; Endorsement</span>\n                <p className=\"text-muted-foreground text-xs leading-relaxed\">\n                  IN WITNESS whereof the carrier, through its authorized master or port agent, has signed three (3)\n                  original Bills of Lading, one of which being accomplished, the others to stand void.\n                </p>\n                <div className=\"text-muted-foreground flex flex-col gap-1 pt-2 font-mono text-xs\">\n                  <p>\n                    <span className=\"text-foreground font-semibold\">Authorized Agent:</span> Capt. H. van der Meer\n                    (Master / Port Agent)\n                  </p>\n                  <p>\n                    <span className=\"text-foreground font-semibold\">Digital Signature SHA-256:</span>{' '}\n                    9b2d8fe14157a3e8...c72194b0\n                  </p>\n                  <p>\n                    <span className=\"text-foreground font-semibold\">Issued:</span> {issueDate} at Port of Shanghai,\n                    China\n                  </p>\n                </div>\n              </div>\n\n              {/* Center: Official Maritime Carrier Stamp */}\n              <div className=\"flex justify-center md:col-span-3\">\n                <div className=\"border-primary/40 bg-primary/5 text-primary rotate-[-2deg] rounded-lg border-2 border-dashed p-4 text-center font-mono text-xs tracking-widest uppercase shadow-xs\">\n                  <div className=\"mb-1 flex justify-center\">\n                    <Ship className=\"text-primary size-6\" />\n                  </div>\n                  <div className=\"text-sm font-semibold tracking-tight\">MAERSK LINE A/S</div>\n                  <div className=\"text-muted-foreground text-xs font-semibold\">PORT OF SHANGHAI AGENCY</div>\n                  <div className=\"border-primary/30 text-success mt-1 border-t pt-1 text-xs font-semibold\">\n                    OFFICIALLY ENDORSED\n                  </div>\n                </div>\n              </div>\n\n              {/* Right: Interactive QR Code Verification */}\n              <div className=\"border-border bg-muted/20 flex flex-col items-center justify-center rounded-lg border p-4 text-center md:col-span-3\">\n                <svg\n                  viewBox=\"0 0 100 100\"\n                  className=\"text-foreground size-20 shrink-0\"\n                  fill=\"currentColor\"\n                  aria-label=\"QR Code\"\n                >\n                  {/* Top-left finder pattern */}\n                  <rect x=\"2\" y=\"2\" width=\"28\" height=\"28\" rx=\"3\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"4\" />\n                  <rect x=\"10\" y=\"10\" width=\"12\" height=\"12\" rx=\"1.5\" />\n                  {/* Top-right finder pattern */}\n                  <rect x=\"70\" y=\"2\" width=\"28\" height=\"28\" rx=\"3\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"4\" />\n                  <rect x=\"78\" y=\"10\" width=\"12\" height=\"12\" rx=\"1.5\" />\n                  {/* Bottom-left finder pattern */}\n                  <rect x=\"2\" y=\"70\" width=\"28\" height=\"28\" rx=\"3\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"4\" />\n                  <rect x=\"10\" y=\"78\" width=\"12\" height=\"12\" rx=\"1.5\" />\n                  {/* QR data matrix dots */}\n                  <rect x=\"36\" y=\"6\" width=\"6\" height=\"6\" rx=\"1\" />\n                  <rect x=\"48\" y=\"6\" width=\"6\" height=\"6\" rx=\"1\" />\n                  <rect x=\"58\" y=\"6\" width=\"6\" height=\"6\" rx=\"1\" />\n                  <rect x=\"6\" y=\"36\" width=\"6\" height=\"6\" rx=\"1\" />\n                  <rect x=\"18\" y=\"36\" width=\"6\" height=\"6\" rx=\"1\" />\n                  <rect x=\"36\" y=\"36\" width=\"6\" height=\"6\" rx=\"1\" />\n                  <rect x=\"48\" y=\"36\" width=\"6\" height=\"6\" rx=\"1\" />\n                  <rect x=\"58\" y=\"36\" width=\"6\" height=\"6\" rx=\"1\" />\n                  <rect x=\"74\" y=\"36\" width=\"6\" height=\"6\" rx=\"1\" />\n                  <rect x=\"86\" y=\"36\" width=\"6\" height=\"6\" rx=\"1\" />\n                  <rect x=\"36\" y=\"48\" width=\"6\" height=\"6\" rx=\"1\" />\n                  <rect x=\"48\" y=\"48\" width=\"6\" height=\"6\" rx=\"1\" />\n                  <rect x=\"58\" y=\"48\" width=\"6\" height=\"6\" rx=\"1\" />\n                  <rect x=\"36\" y=\"60\" width=\"6\" height=\"6\" rx=\"1\" />\n                  <rect x=\"48\" y=\"60\" width=\"6\" height=\"6\" rx=\"1\" />\n                  <rect x=\"58\" y=\"60\" width=\"6\" height=\"6\" rx=\"1\" />\n                  <rect x=\"36\" y=\"76\" width=\"6\" height=\"6\" rx=\"1\" />\n                  <rect x=\"48\" y=\"76\" width=\"6\" height=\"6\" rx=\"1\" />\n                  <rect x=\"58\" y=\"76\" width=\"6\" height=\"6\" rx=\"1\" />\n                  <rect x=\"74\" y=\"76\" width=\"6\" height=\"6\" rx=\"1\" />\n                  <rect x=\"86\" y=\"76\" width=\"6\" height=\"6\" rx=\"1\" />\n                  <rect x=\"74\" y=\"86\" width=\"6\" height=\"6\" rx=\"1\" />\n                  <rect x=\"86\" y=\"86\" width=\"6\" height=\"6\" rx=\"1\" />\n                </svg>\n                <span className=\"text-foreground mt-2 font-mono text-xs font-medium\">\n                  Scan for Port Customs e-Verification\n                </span>\n                <span className=\"text-muted-foreground text-xs\">UIPKGE Trust Protocol</span>\n              </div>\n            </div>\n          </div>\n        </div>\n      )}\n\n      {/* TAB 2: CUSTOMS & COMPLIANCE INSPECTOR */}\n      {activeTab === 'compliance' && (\n        <div className=\"space-y-6\">\n          {/* Compliance Health Score Banner */}\n          <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-3\">\n            <Card className=\"border-border bg-card\">\n              <CardHeader className=\"p-4 pb-2\">\n                <CardDescription className=\"text-xs\">Customs Risk Assessment</CardDescription>\n                <div className=\"flex items-baseline gap-2\">\n                  <CardTitle className=\"text-success text-2xl font-bold\">99 / 100</CardTitle>\n                  <Badge wrap variant=\"success\" className=\"text-xs\">\n                    Low Risk\n                  </Badge>\n                </div>\n              </CardHeader>\n              <CardContent className=\"text-muted-foreground p-4 pt-1 text-xs\">\n                Green channel clearance granted for Rotterdam entry. Pre-arrival ICS2 security declaration verified.\n              </CardContent>\n            </Card>\n\n            <Card className=\"border-border bg-card\">\n              <CardHeader className=\"p-4 pb-2\">\n                <CardDescription className=\"text-xs\">Import Duties &amp; VAT Estimation</CardDescription>\n                <div className=\"flex items-baseline gap-2\">\n                  <CardTitle className=\"text-foreground font-mono text-2xl font-bold\">$29,925.00</CardTitle>\n                  <Badge wrap variant=\"outline\" className=\"font-mono text-xs\">\n                    EUR 27,665\n                  </Badge>\n                </div>\n              </CardHeader>\n              <CardContent className=\"text-muted-foreground p-4 pt-1 text-xs\">\n                0% Base Duty (TARIC 8518.30.00) + 21.0% Netherlands Import VAT under Article 23 reverse-charge\n                mechanism.\n              </CardContent>\n            </Card>\n\n            <Card className=\"border-border bg-card\">\n              <CardHeader className=\"p-4 pb-2\">\n                <CardDescription className=\"text-xs\">Container Seal Audit</CardDescription>\n                <div className=\"flex items-baseline gap-2\">\n                  <CardTitle className=\"text-foreground text-2xl font-bold\">2 / 2 Valid</CardTitle>\n                  <Badge wrap variant=\"success\" className=\"text-xs\">\n                    ISO 17712 Compliant\n                  </Badge>\n                </div>\n              </CardHeader>\n              <CardContent className=\"text-muted-foreground p-4 pt-1 text-xs\">\n                Bolt seals SL-94021 &amp; SL-94022 confirmed tamper-free at origin gate inspection.\n              </CardContent>\n            </Card>\n          </div>\n\n          {/* Compliance Verification Checklist Grid */}\n          <Card className=\"border-border bg-card\">\n            <CardHeader className=\"p-5 pb-3\">\n              <div className=\"flex items-center justify-between\">\n                <div>\n                  <CardTitle className=\"text-base font-semibold\">\n                    Customs Compliance &amp; Regulatory Audit Checklist\n                  </CardTitle>\n                  <CardDescription className=\"text-xs\">\n                    International trade compliance checks required for European Union port entry and inland transit\n                  </CardDescription>\n                </div>\n                <Badge wrap variant=\"success\" className=\"gap-1 text-xs\">\n                  <CheckCircle2 className=\"size-3.5\" />\n                  <span>All 6 Gates Passed</span>\n                </Badge>\n              </div>\n            </CardHeader>\n            <CardContent className=\"space-y-3 p-5 pt-0\">\n              <div className=\"grid grid-cols-1 gap-3 md:grid-cols-2\">\n                {COMPLIANCE_GATES.map((gate) => (\n                  <div\n                    key={gate.id}\n                    className=\"border-border bg-muted/20 flex items-start gap-3 rounded-lg border p-3.5 shadow-xs\"\n                  >\n                    <div className=\"bg-success/10 text-success mt-0.5 shrink-0 rounded-full p-1\">\n                      <CheckCircle2 className=\"size-4\" aria-hidden=\"true\" />\n                    </div>\n                    <div className=\"space-y-1 text-xs\">\n                      <div className=\"flex items-center justify-between gap-2\">\n                        <span className=\"text-foreground font-semibold\">{gate.name}</span>\n                        <span className=\"text-muted-foreground font-mono text-xs font-medium\">{gate.reference}</span>\n                      </div>\n                      <p className=\"text-muted-foreground leading-relaxed\">{gate.details}</p>\n                      <span className=\"text-primary block text-xs font-medium\">Authority: {gate.authority}</span>\n                    </div>\n                  </div>\n                ))}\n              </div>\n            </CardContent>\n          </Card>\n        </div>\n      )}\n\n      {/* TAB 3: ELECTRONIC DATA INTERCHANGE (EDI) / JSON MANIFEST */}\n      {activeTab === 'edi' && (\n        <div className=\"space-y-4\">\n          <Card className=\"border-border bg-card\">\n            <CardHeader className=\"p-5 pb-3\">\n              <div className=\"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between\">\n                <div>\n                  <CardTitle className=\"text-base font-semibold\">\n                    Electronic Data Interchange (UN/EDIFACT IFTMIN)\n                  </CardTitle>\n                  <CardDescription className=\"text-xs\">\n                    Standardized electronic consignment instructions formatted per UN/EDIFACT D.01B maritime transport\n                    standards\n                  </CardDescription>\n                </div>\n                <Button\n                  variant=\"outline\"\n                  size=\"sm\"\n                  className=\"gap-1.5 self-start text-xs sm:self-auto\"\n                  onClick={handleCopyEdi}\n                >\n                  {copiedEdi ? <Check className=\"text-success size-3.5\" /> : <Copy className=\"size-3.5\" />}\n                  <span>{copiedEdi ? 'Copied EDI Payload' : 'Copy EDI Payload'}</span>\n                </Button>\n              </div>\n            </CardHeader>\n            <CardContent className=\"p-5 pt-0\">\n              <pre className=\"border-border bg-muted/40 text-foreground overflow-x-auto rounded-lg border p-4 font-mono text-xs leading-relaxed select-all\">\n                {generateEdiText()}\n              </pre>\n            </CardContent>\n          </Card>\n        </div>\n      )}\n    </div>\n  )\n}\n",
      "type": "registry:block",
      "target": "~/components/blocks/BillOfLadingViewer.tsx"
    }
  ],
  "dependencies": [
    "lucide-react"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://uipkge.dev/r/react/badge.json",
    "https://uipkge.dev/r/react/button.json",
    "https://uipkge.dev/r/react/card.json",
    "https://uipkge.dev/r/react/separator.json",
    "https://uipkge.dev/r/react/table.json"
  ],
  "description": "Maritime & Air Bill of Lading (BOL) shipping document viewer and customs compliance inspector with multi-party entity grid, transport routing, container & cargo manifest, freight terms, carrier stamp, and blockchain verification.",
  "categories": [
    "logistics",
    "app",
    "documents"
  ]
}