@privacyscrubber/mcp-server 2.3.7 → 2.3.9

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/ps-pii-engine.cjs CHANGED
@@ -253,8 +253,8 @@ let REGEX_RULES = [
253
253
  let PROFILE_RULES = {
254
254
  general: [],
255
255
  legal: [
256
- // Legal Party & Role-Prefixed Names (Claimant, Respondent, Plaintiff, Defendant, Petitioner, Appellant, Principal, Grantor, Attorney-in-Fact, Counsel)
257
- { type: 'NAME', isContextName: true, regex: /(?<=^|[^\p{L}\p{N}_])(?:(?:Senior\s+)?Managing\s+Partner|Lead\s+Counsel|Co-Counsel|Special\s+Counsel|Of\s+Counsel|Counsel(?:\s+for\s+(?:the\s+)?(?:Claimant|Respondent|Plaintiff|Defendant|Petitioner|Appellant|Appellee|Debtor|Creditor|Party))?|Attorney(?:\s+for\s+(?:the\s+)?(?:Claimant|Respondent|Plaintiff|Defendant|Petitioner|Appellant|Appellee|Debtor|Creditor|Party))?|Registered\s+Representative|Claimant|Respondent|Plaintiff|Defendant|Petitioner|Appellant|Appellee|Principal|Grantor|Grantee|Trustee|Trustor|Fiduciary|Attorney-in-Fact|Designated\s+Attorney-in-Fact|Client\s*(?:\/\s*Principal)?|Escrow\s+(?:Trust\s+)?Officer)\s*[:#,]?\s*(?:(?:Dr|Mr|Mrs|Ms|Prof)\.?\s+)?((?:(?:d['’]|l['’]|(?:(?:van|von|de|di|da|do|dos|das|la|le|del|dels|du|der|den|ten|ter|af|av)\s+)+)\s*)?\p{Lu}[\p{L}'’–-]*(?:-[\p{Lu}\p{Ll}'’–-]+)*(?:,\s+(?:(?:d['’]|l['’])?\p{Lu}[\p{L}'’–-]+)(?:\s+\p{Lu}\.?)?(?:,\s*(?:Jr\.?|Sr\.?|III|IV|II))?|\s+(?:(?:van|von|de|di|da|do|dos|das|la|le|del|du|der|d['’]|l['’]|de\s+la|de\s+los|von\s+der)\s+)?(?:(?:\p{Lu}\.?\s+)?(?:d['’]|l['’])?\p{Lu}[\p{L}'’–-]*(?:-[\p{Lu}\p{Ll}'’–-]+)*))(?:\s+(?:y|i)\s+(?:(?:d['’]|l['’])?\p{Lu}[\p{L}'’–-]+))?)/giu },
256
+ // Legal Party & Role-Prefixed Names (Claimant, Respondent, Plaintiff, Defendant, Petitioner, Appellant, Principal, Grantor, Settlor, Trustee, Beneficiary, Attorney-in-Fact, Counsel)
257
+ { type: 'NAME', isContextName: true, regex: /(?<=^|[^\p{L}\p{N}_])(?:(?:Senior\s+)?Managing\s+Partner|Lead\s+Counsel|Co-Counsel|Special\s+Counsel|Of\s+Counsel|Counsel(?:\s+for\s+(?:the\s+)?(?:Claimant|Respondent|Plaintiff|Defendant|Petitioner|Appellant|Appellee|Debtor|Creditor|Party))?|Attorney(?:\s+for\s+(?:the\s+)?(?:Claimant|Respondent|Plaintiff|Defendant|Petitioner|Appellant|Appellee|Debtor|Creditor|Party))?|Registered\s+Representative|Claimant|Respondent|Plaintiff|Defendant|Petitioner|Appellant|Appellee|Principal|Grantor[s]?|Grantee|Trustee[s]?|Co-Trustee[s]?|Successor\s+Trustee[s]?|Alternate\s+Trustee|Independent\s+Trustee|Settlor[s]?|Trustor[s]?|Beneficiar(?:y|ies)|Primary\s+Beneficiary|Contingent\s+Beneficiary|Remainder\s+Beneficiary|Trust\s+Protector|Protector|Fiduciar(?:y|ies)|Attorney-in-Fact|Designated\s+Attorney-in-Fact|Client\s*(?:\/\s*Principal)?|Escrow\s+(?:Trust\s+)?Officer)\s*[:#,]?\s*(?:(?:Dr|Mr|Mrs|Ms|Prof)\.?\s+)?((?:(?:d['’]|l['’]|(?:(?:van|von|de|di|da|do|dos|das|la|le|del|dels|du|der|den|ten|ter|af|av)\s+)+)\s*)?\p{Lu}[\p{L}'’–-]*(?:-[\p{Lu}\p{Ll}'’–-]+)*(?:,\s+(?:(?:d['’]|l['’])?\p{Lu}[\p{L}'’–-]+)(?:\s+\p{Lu}\.?)?(?:,\s*(?:Jr\.?|Sr\.?|III|IV|II))?|\s+(?:(?:van|von|de|di|da|do|dos|das|la|le|del|du|der|d['’]|l['’]|de\s+la|de\s+los|von\s+der)\s+)?(?:(?:\p{Lu}\.?\s+)?(?:d['’]|l['’])?\p{Lu}[\p{L}'’–-]*(?:-[\p{Lu}\p{Ll}'’–-]+)*))(?:\s+(?:y|i)\s+(?:(?:d['’]|l['’])?\p{Lu}[\p{L}'’–-]+))?|[A-Z\p{Lu}]{2,}(?:[\s'-]+[A-Z\p{Lu}]{2,}){1,3})/giu },
258
258
  { type: 'LEGAL', regex: /\bCASE[-_][A-Z0-9_-]{4,}\b/gi },
259
259
  { type: 'LEGAL', regex: /\bMATTER[-_][A-Z0-9_-]{4,}\b/gi },
260
260
  { type: 'LEGAL', regex: /\b[A-Z]{2,4}[- ]?\d{2}[- ]?\d{4,}\b/g },
@@ -316,8 +316,8 @@ let PROFILE_RULES = {
316
316
  { type: 'ID', regex: /\b(?:GRANT|ESOP|RSU|ISO|NSO|SAR|PSU|LTIP)[-_][A-Za-z0-9_-]*\d[A-Za-z0-9_-]*\b/gi },
317
317
  { type: 'ID', regex: /\b(?:CS|OP|CN|CERT)[-_]\d{3,10}\b/gi },
318
318
  { type: 'ID', regex: /\b(?:Equity\s+Grant|Option\s+Grant|RSU\s+Grant|Stock\s+Option|Grant\s+Agreement|Grant\s+Notice|Award\s+ID|Award\s+Agreement|Vesting\s+Schedule|Carta\s+Cert(?:ificate)?|Shareworks|Pulley\s+Cert(?:ificate)?)(?:\s*(?:ID|Number|No\.?|#|Ref))?\s*[:#=-]\s*([A-Za-z0-9_-]{4,25})\b/gi },
319
- { type: 'FINANCIAL', regex: /(?<=\b(?:Number\s+of\s+(?:Options?|Shares?|Units?|RSUs?)|Total\s+(?:Options?|Shares?|Units?)|Option\s+Pool\s+Allocation|Equity\s+Award|Shares?\s+Granted|Options?\s+Granted|Vested\s+(?:Shares?|Units?)|Unvested\s+(?:Shares?|Units?))\s*[:=]\s*)(?:[0-9,]{2,12})\b/gi },
320
- { type: 'FINANCIAL', regex: /(?<=\b(?:Exercise\s+Price|Strike\s+Price|Option\s+Strike|Per-Share\s+Price|Price\s+Per\s+Share|409A\s+(?:Valuation|FMV|Fair\s+Market\s+Value)|Fair\s+Market\s+Value(?:\s+\(FMV\))?|Current\s+FMV|FMV)\s*[:=]\s*)(?:(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB)\s*|[$€£¥₪₽₹]\s*)[0-9,.'’]*\d|\d[0-9,.'’]*\d?\s*(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB)\b|[$€£¥₪₽₹]))/gi },
319
+ { type: 'FINANCIAL', regex: /(?<=\b(?:Number\s+of\s+Options|Shares\s+Granted|Option\s+Count|Shares\s+Allocated|Options\s+Granted|Units\s+Granted)\s*[:=]\s*)[0-9,.'’\u2018\u2019]*\d[KMB]?\b/gi },
320
+ { type: 'FINANCIAL', regex: /(?<=\b(?:Exercise\s+Price|Strike\s+Price|Option\s+Strike|Per-Share\s+Price|Price\s+Per\s+Share|409A\s+(?:Valuation|FMV|Fair\s+Market\s+Value)|Fair\s+Market\s+Value(?:\s+\(FMV\))?|Current\s+FMV|FMV)\s*[:=]\s*)(?:(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB)\s*|[$€£¥₪₽₹]\s*)[0-9,.'’\u2018\u2019]*\d[KMB]?\b|\b\d[0-9,.'’\u2018\u2019]*\d?[KMB]?\s*(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB)\b|[$€£¥₪₽₹]))/gi },
321
321
 
322
322
  // 2. Global Mobility, Visas & Immigration Filings (ETA LCA, PERM, USCIS, CoS, LMIA)
323
323
  { type: 'ID', regex: /\bI-200-\d{5}-\d{6}\b/gi },
@@ -361,8 +361,8 @@ let PROFILE_RULES = {
361
361
  { type: 'ID', regex: /\b(?:LEI|LEGAL[\s-]ENTITY[\s-]IDENTIFIER)[:\s#-]*[0-9A-Z]{20}\b/gi },
362
362
  { type: 'ID', regex: /\bBBG[0-9A-Z]{9}\b/g },
363
363
  { type: 'FINANCIAL', regex: /(?<=\b(?:Settlement(?:\s+Amount)?|Wire(?:\s+(?:Transfer|Amount))?|Direct\s+Wire|Transaction(?:\s+Amount)?|Payment(?:\s+Amount)?)[ \t:]+)(?:(?:[$€£¥₪₽₹]|(?:USD|EUR|GBP|CHF|ILS|RUB)\s?)[0-9,.'’\u2018\u2019]*\d[KMB]?\b|\b\d[0-9,.'’\u2018\u2019]*\d?[KMB]?\s*(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB)\b|[$€£¥₪₽₹]))/gi },
364
- { type: 'FINANCIAL', regex: /(?<=(?:^|[\r\n\t.;])\s*(?<!\b(?:Trade(?:\s+execution)?|Net|Gross|Base|Loan|Transfer)\s+)(?:Wire(?:\s+(?:Transfer|Amount))?|Direct\s+Wire|Balance|Deposit|Withdrawal|Settlement|Principal|Interest|Remittance|Payout|Transaction(?:\s+Amount)?|Payment(?:\s+Amount)?|Total(?:\s+Due)?|Amount(?:\s+Due)?)[:\s]+)(?:(?:\((?:[$€£¥₪₽₹]\s*)?[0-9,.'’\u2018\u2019]+[KMB]?\)|(?:[$€£¥₪₽₹]\s*)\([0-9,.'’\u2018\u2019]+[KMB]?\))|(?:[-−](?:[$€£¥₪₽₹]\s*)?[0-9,.'’\u2018\u2019]*\d[KMB]?\b|(?:[$€£¥₪₽₹]\s*)[-−][0-9,.'’\u2018\u2019]*\d[KMB]?\b)|(?:(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB)\s*|[$€£¥₪₽₹]\s*)[0-9,.'’\u2018\u2019]*\d[KMB]?\b|\b\d[0-9,.'’\u2018\u2019]*\d?[KMB]?\s*(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB)\b|[$€£¥₪₽₹]))|[0-9,.'’]{3,}\b)/gi },
365
- { type: 'FINANCIAL', regex: /(?:(?:\b(?:EUR|GBP|CHF|ILS|RUB)\s*|[€£¥₪₽₹]\s*)[0-9,.'’\u2018\u2019]*\d[KMB]?\b|\b\d[0-9,.'’\u2018\u2019]*\d?[KMB]?\s*(?:\b(?:EUR|GBP|CHF|ILS|RUB)\b|[€£¥₪₽₹]))/gi },
364
+ { type: 'FINANCIAL', regex: /(?<=(?:^|[\r\n\t.;])\s*(?<!\b(?:Trade(?:\s+execution)?|Net|Gross|Base|Loan|Transfer)\s+)(?:Wire(?:\s+(?:Transfer|Amount))?|Direct\s+Wire|Balance|Deposit|Withdrawal|Settlement|Principal|Interest|Remittance|Payout|(?:Capital\s+|Annual\s+)?Distribution(?:s)?|Transaction(?:\s+Amount)?|Payment(?:\s+Amount)?|Total(?:\s+Due)?|Amount(?:\s+Due)?)[:\s]+)(?:(?:\((?:[$€£¥₪₽₹]\s*)?[0-9,.'’\u2018\u2019]+[KMB]?\)|(?:[$€£¥₪₽₹]\s*)\([0-9,.'’\u2018\u2019]+[KMB]?\))|(?:[-−](?:[$€£¥₪₽₹]\s*)?[0-9,.'’\u2018\u2019]*\d[KMB]?\b|(?:[$€£¥₪₽₹]\s*)[-−][0-9,.'’\u2018\u2019]*\d[KMB]?\b)|(?:(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB)\s*|[$€£¥₪₽₹]\s*)[0-9,.'’\u2018\u2019]*\d[KMB]?\b|\b\d[0-9,.'’\u2018\u2019]*\d?[KMB]?\s*(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB)\b|[$€£¥₪₽₹]))|[0-9,.'’]{3,}\b)/gi },
365
+ { type: 'FINANCIAL', regex: /(?:(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB|CAD|AUD|JPY)\s*|[$€£¥₪₽₹]\s*)[0-9,.'’\u2018\u2019]*\d[KMB]?(?:\s*(?:USD|EUR|GBP|CHF|ILS|RUB|CAD|AUD|JPY|[$€£¥₪₽₹]))?\b|\b\d[0-9,.'’\u2018\u2019]*\d?[KMB]?\s*(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB|CAD|AUD|JPY)\b|[$€£¥₪₽₹]))/gi },
366
366
  // Corporate Financial Performance, P&L Statements, Balance Sheets & Earnings
367
367
  { type: 'FINANCIAL', regex: /(?<=\b(?<!\b(?:EV|Debt|Net\s+Debt)\/)(?:Revenue|Total\s+Revenue|Sales\s+Revenue|Cost\s+of\s+Goods(?:\s+Sold)?|COGS|Gross\s+Profit|Operating\s+Expenses?|OpEx|Operating\s+Income(?:\s*\([^)]*\))?|Operating\s+Loss|Net\s+Income(?:\s*[/()]*\s*Loss)?|Net\s+Loss|Foreign\s+Exchange(?:\s+Loss)?|FX\s+Loss|Retained\s+Earnings|Total\s+Equity|Shareholders?'?\s+Equity|Total\s+Assets|Total\s+Liabilities|Accounts\s+Payable|Accounts\s+Receivable|Cash|Cash\s+Flow|Free\s+Cash\s+Flow|Capital\s+Expenditures?|CapEx|Dividends?|EBITDA|EBIT|Balance|Loss|Profit)[:|\s]+)(?:(?:\((?:[$€£¥₪₽₹]\s*)?[0-9,.'’\u2018\u2019]+[KMB]?\)|(?:[$€£¥₪₽₹]\s*)\([0-9,.'’\u2018\u2019]+[KMB]?\))|(?:[-−](?:[$€£¥₪₽₹]\s*)?[0-9,.'’\u2018\u2019]*\d[KMB]?\b|(?:[$€£¥₪₽₹]\s*)[-−][0-9,.'’\u2018\u2019]*\d[KMB]?\b)|(?:(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB)\s*|[$€£¥₪₽₹]\s*)[0-9,.'’\u2018\u2019]*\d[KMB]?\b|\b\d[0-9,.'’\u2018\u2019]*\d?[KMB]?\s*(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB)\b|[$€£¥₪₽₹]))|[0-9,.'’]*\d\b)(?![ \t\xA0]*(?:%|[xX]\b|times\b|bps\b))/gi },
368
368
  // Interbank Wire Transcripts & Payment Messaging
@@ -503,7 +503,7 @@ let PROFILE_RULES = {
503
503
  { type: 'ID', regex: /\b(?:msclkid|ttclid|li_fat_id|dclid|srsltid|wbraid|gbraid)[^\S\r\n]*[:=#-][^\S\r\n]*([A-Za-z0-9_-]{10,})\b/gi },
504
504
 
505
505
  // 6. Ad Spend Budgets, Influencer Sponsorship Deals & Rate Cards
506
- { type: 'FINANCIAL', regex: /(?<=\b(?:LTV|CAC)[\s:]*)(?:[$€£¥₪₽₹]|(?:USD|EUR|GBP|CHF|ILS|RUB)\s?)[0-9,.'’]+\b/gi },
506
+ { type: 'FINANCIAL', regex: /(?<=\b(?:LTV|CAC)[\s:]*)(?:[$€£¥₪₽₹]|(?:USD|EUR|GBP|CHF|ILS|RUB)\s?)[0-9,.'’\u2018\u2019]*\d[KMB]?\b/gi },
507
507
  {
508
508
  type: 'FINANCIAL',
509
509
  regex: /(?<=\b(?:Campaign\s+Budget|Ad\s+Spend|Monthly\s+Ad\s+Spend|Media\s+Budget|Marketing\s+Budget|Daily\s+Budget|Lifetime\s+Budget|Influencer\s+Sponsorship\s+Fee|Influencer\s+Fee|Creator\s+Retainer|Sponsorship\s+Rate|Sponsored\s+Post\s+Fee|Affiliate\s+Commission|Affiliate\s+Payout|Target\s+CPA\s+Cap|Max\s+CPC\s+Bid|Minimum\s+Spend\s+Commitment|Spend\s+Cap)[^\S\r\n]*[:=][^\S\r\n]*)(?:(?:USD|EUR|GBP|CHF|ILS|RUB)\s*|[$€£¥₪₽₹]\s*)?[0-9,.'’]*\d(?:\.\d{2})?(?:[^\S\r\n]*(?:USD|EUR|GBP|CHF|ILS|RUB|[$€£¥₪₽₹]|\/mo\b|\/month\b|\/post\b|\/video\b))?/gi
@@ -556,7 +556,7 @@ let PROFILE_RULES = {
556
556
  // 9. Logistics Financials, Demurrage, Detention & Freight Charges
557
557
  {
558
558
  type: 'FINANCIAL',
559
- regex: /(?<=\b(?:Ocean\s+Freight|Air\s+Freight|Drayage(?:\s+Fee)?|Demurrage|Detention|BAF|CAF|THC|Terminal\s+Handling\s+Charge|Customs\s+Duty|Tariff\s+Amount|Duty\s+Paid|HMF|Harbor\s+Maintenance\s+Fee|MPF|Merchandise\s+Processing\s+Fee|Chassis\s+Fee|Storage\s+Fee|Lumper\s+Fee|Accessorial\s+Charges?|Declared\s+Customs\s+Value|Commercial\s+Invoice\s+Total)(?:\s*\([^)]*\))?\s*[:=-]\s*)(?:[$€£¥₪₽₹]|(?:USD|EUR|GBP|CHF|ILS|RUB)\s?)[\d,.'’]+(?:\s+(?:[kKmMbB]|million|thousand)\b)?/gi
559
+ regex: /(?<=\b(?:Ocean\s+Freight|Air\s+Freight|Drayage(?:\s+Fee)?|Demurrage|Detention|BAF|CAF|THC|Terminal\s+Handling\s+Charge|Customs\s+Duty|Tariff\s+Amount|Duty\s+Paid|HMF|Harbor\s+Maintenance\s+Fee|MPF|Merchandise\s+Processing\s+Fee|Chassis\s+Fee|Storage\s+Fee|Lumper\s+Fee|Accessorial\s+Charges?|Declared\s+Customs\s+Value|Commercial\s+Invoice\s+Total)(?:\s*\([^)]*\))?\s*[:=-]\s*)(?:[$€£¥₪₽₹]|(?:USD|EUR|GBP|CHF|ILS|RUB)\s?)[0-9,.'’\u2018\u2019]*\d(?:\s*(?:[kKmMbB]|million|thousand)\b)?/gi
560
560
  },
561
561
  {
562
562
  type: 'FINANCIAL',
@@ -611,7 +611,7 @@ let PROFILE_RULES = {
611
611
  { type: 'ID', regex: /\b(?:ANID|ARIBA[- ]NETWORK[- ]ID|ARIBA\s+ID)[^\S\r\n]*[:\s#-]+([A-Za-z0-9_-]{8,25})\b/gi },
612
612
  { type: 'ID', regex: /\b(?:REMITTANCE|REMIT)[-_][A-Za-z0-9_-]*\d[A-Za-z0-9_-]*\b/gi },
613
613
  // 7. Deal Financials, Contract Value Caps & Per-Seat Rates
614
- { type: 'FINANCIAL', regex: /(?<=\b(?:ARR|MRR|ACV|TCV|ASP|QUOTA|Quota|Sales\s+Quota|Average\s+Selling\s+Price|CARR|Contracted\s+ARR|Contract\s+Value|Annual\s+Value|Total\s+Contract\s+Value|Annual\s+Contract\s+Value|Platform\s+Fee|Subscription\s+Fee|License\s+Fee|Implementation\s+Fee|Professional\s+Services(?: Fee)?|Discount(?:ed\s+Amount)?|Limitation\s+of\s+Liability|Liability\s+Cap|LoL\s+Cap|Super[- ]?[Cc]ap|Aggregate\s+Liability|Indemnity\s+Cap|Indemnification\s+Cap)(?:\s*\([^)]*\))?\s*[:=-]\s*)(?:[$€£¥₪₽₹]|(?:USD|EUR|GBP|CHF|ILS|RUB)\s?)[\d,.'’]+(?:\s+(?:[kKmMbB]|million|thousand|billion)\b)?/gi },
614
+ { type: 'FINANCIAL', regex: /(?<=\b(?:ARR|MRR|ACV|TCV|ASP|QUOTA|Quota|Sales\s+Quota|Average\s+Selling\s+Price|CARR|Contracted\s+ARR|Contract\s+Value|Annual\s+Value|Total\s+Contract\s+Value|Annual\s+Contract\s+Value|Platform\s+Fee|Subscription\s+Fee|License\s+Fee|Implementation\s+Fee|Professional\s+Services(?: Fee)?|Discount(?:ed\s+Amount)?|Limitation\s+of\s+Liability|Liability\s+Cap|LoL\s+Cap|Super[- ]?[Cc]ap|Aggregate\s+Liability|Indemnity\s+Cap|Indemnification\s+Cap)(?:\s*\([^)]*\))?\s*[:=-]\s*)(?:[$€£¥₪₽₹]|(?:USD|EUR|GBP|CHF|ILS|RUB)\s?)[0-9,.'’\u2018\u2019]*\d(?:\s*(?:[kKmMbB]|million|thousand|billion)\b)?/gi },
615
615
  { type: 'FINANCIAL', regex: /(?<=\b(?:Per[- ](?:Seat|User|License|Unit)(?:\s+(?:Rate|Price|Fee|Cost))?|Seat\s+Price|License\s+Price|Unit\s+Price)(?:\s*\([^)]*\))?\s*[:=-]\s*)(?:[$€£¥₪₽₹]|(?:USD|EUR|GBP|CHF|ILS|RUB)\s?)[\d,.'’]+(?:\s*\/(?:month|year|seat|user|mo|yr)(?:\/(?:month|year|mo|yr))?)?/gi },
616
616
  // 8. Contract Exhibits, Risk Assessments & SOC 2 Bridge Letters
617
617
  { type: 'ID', regex: /\b(?:EXHIBIT|SCHEDULE|ANNEX)[-_ ]+[A-Z0-9_-]{1,8}[-_ ]*(?:SECURITY|DPA|PRIVACY|PRICING|COMPLIANCE)?[-_ ]*(?:ID|REF)?[^\S\r\n]*[:\s#-]+([A-Z0-9_-]*\d[A-Z0-9_-]*)\b/gi },
@@ -1190,9 +1190,9 @@ let PROFILE_RULES = {
1190
1190
  { type: 'FINANCIAL', regex: /\b(?:Account|Acct\.?)[:\s#]*\d{4}[-\s]?\d{4}[-\s]?\d{2,6}\b/gi },
1191
1191
  { type: 'FINANCIAL', regex: /\b(?:Policy|Contract)\s*(?:No\.?|Number|#)[:\s]+[A-Z0-9][A-Z0-9\-]{3,14}\b/gi },
1192
1192
  { type: 'ID', regex: /\bCRD\s*#?\s*\d{4,8}\b/gi },
1193
- { type: 'FINANCIAL', regex: /\b(?:Annual\s+(?:Distribution|Withdrawal)|RMD|Required\s+Minimum\s+Distribution)[:\s]+(?:[$€£¥₪₽₹]|(?:USD|EUR|GBP|CHF|ILS|RUB)\s?)[\d,.'’]+\b/gi },
1193
+ { type: 'FINANCIAL', regex: /(?<=\b(?:(?:Capital\s+|Annual\s+)?(?:Distribution|Withdrawal)s?|RMD|Required\s+Minimum\s+Distribution)[:\s]+)(?:[$€£¥₪₽₹]|(?:USD|EUR|GBP|CHF|ILS|RUB)\s?)[0-9,.'’\u2018\u2019]*\d[KMB]?\b/gi },
1194
1194
  { type: 'FINANCIAL', regex: /(?<=\b(?:Portfolio(?:\s+[Vv]alue)?|Market\s+Value|Net\s+Worth|AUM|Total\s+Assets|Cash\s+Balance|Account\s+Value|Capital\s+Gains?|Unrealized\s+(?:Gain|Loss)|Realized\s+(?:Gain|Loss)|Dividend\s+Income)[:\s]+)(?:(?:\((?:[$€£¥₪₽₹]\s*)?[0-9,.'’\u2018\u2019]+[KMB]?\)|(?:[$€£¥₪₽₹]\s*)\([0-9,.'’\u2018\u2019]+[KMB]?\))|(?:[-−](?:[$€£¥₪₽₹]\s*)?[0-9,.'’\u2018\u2019]*\d[KMB]?\b|(?:[$€£¥₪₽₹]\s*)[-−][0-9,.'’\u2018\u2019]*\d[KMB]?\b)|(?:(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB)\s*|[$€£¥₪₽₹]\s*)[0-9,.'’\u2018\u2019]*\d[KMB]?\b|\b\d[0-9,.'’\u2018\u2019]*\d?[KMB]?\s*(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB)\b|[$€£¥₪₽₹]))|[0-9,.'’]{3,}\b)/gi },
1195
- { type: 'FINANCIAL', regex: /(?:(?:\b(?:EUR|GBP|CHF|ILS|RUB)\s*|[€£¥₪₽₹]\s*)[0-9,.'’\u2018\u2019]*\d[KMB]?\b|\b\d[0-9,.'’\u2018\u2019]*\d?[KMB]?\s*(?:\b(?:EUR|GBP|CHF|ILS|RUB)\b|[€£¥₪₽₹]))/gi },
1195
+ { type: 'FINANCIAL', regex: /(?:(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB|CAD|AUD|JPY)\s*|[$€£¥₪₽₹]\s*)[0-9,.'’\u2018\u2019]*\d[KMB]?(?:\s*(?:USD|EUR|GBP|CHF|ILS|RUB|CAD|AUD|JPY|[$€£¥₪₽₹]))?\b|\b\d[0-9,.'’\u2018\u2019]*\d?[KMB]?\s*(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB|CAD|AUD|JPY)\b|[$€£¥₪₽₹]))/gi },
1196
1196
  { type: 'FINANCIAL', regex: /\b(?:Roth\s+)?(?:IRA|401k|401\(k\)|403b|403\(b\)|SEP|SIMPLE)\s*(?:Account|Acct|Plan)?\s*(?:(?:No\.?|Number|#)[:\s#]*|[:#]\s*)([A-Z0-9-]{4,20})\b/gi },
1197
1197
  { type: 'ID', regex: /\bCUSIP[:\s#]*([0-9A-Z]{9})\b/gi },
1198
1198
  { type: 'ID', regex: /\bISIN[:\s#]*([A-Z]{2}[0-9A-Z]{9}[0-9])\b/gi },
@@ -1205,6 +1205,37 @@ let PROFILE_RULES = {
1205
1205
  { type: 'FINANCIAL', regex: /\b(?:Vanguard)(?:\s+(?:Account|Acct|Brokerage))*\s*(?:Number|Num|No\.?|#)?[:\s#]+(\d{8}[-\s]?\d|\d{8,9})\b/gi },
1206
1206
  { type: 'ID', regex: /\b(?:DTC|DTC\s+Participant|Clearing\s+Participant)\s*(?:Number|Num|No\.?|#|Code)?[:\s#]+(\d{4})\b/gi },
1207
1207
  // Family Office & Trust Governance
1208
+ // 1. Trust & Estate Role-Prefixed Names (Grantor, Settlor, Trustee, Beneficiary, Executor, Fiduciary, etc.)
1209
+ {
1210
+ type: 'NAME',
1211
+ isContextName: true,
1212
+ regex: /(?<=^|[^\p{L}\p{N}_])(?:Grantor[s]?|Trustor[s]?|Settlor[s]?|Trustee[s]?|Co-Trustee[s]?|Successor\s+Trustee[s]?|Alternate\s+Trustee|Independent\s+Trustee|Beneficiar(?:y|ies)|Primary\s+Beneficiary|Contingent\s+Beneficiary|Remainder\s+Beneficiary|Income\s+Beneficiary|Trust\s+Protector|Protector|Fiduciar(?:y|ies)|Custodian[s]?|Executor[s]?|Executrix|Personal\s+Representative|Power\s+of\s+Attorney|Attorney-in-Fact|Health\s+Care\s+(?:Agent|Proxy))\s*[:=#,\/\t-]*\s*(?:(?:Dr|Mr|Mrs|Ms|Prof)\.?\s+)?((?:(?:d['’]|l['’]|(?:(?:van|von|de|di|da|do|dos|das|la|le|del|dels|du|der|den|ten|ter|af|av)\s+)+)\s*)?\p{Lu}[\p{L}'’–-]*(?:-[\p{Lu}\p{Ll}'’–-]+)*(?:,\s+(?:(?:d['’]|l['’])?\p{Lu}[\p{L}'’–-]+)(?:\s+\p{Lu}\.?)?(?:,\s*(?:Jr\.?|Sr\.?|III|IV|II))?|\s+(?:(?:van|von|de|di|da|do|dos|das|la|le|del|du|der|d['’]|l['’]|de\s+la|de\s+los|von\s+der)\s+)?(?:(?:\p{Lu}\.?\s+)?(?:d['’]|l['’])?\p{Lu}[\p{L}'’–-]*(?:-[\p{Lu}\p{Ll}'’–-]+)*))(?:\s+(?:y|i)\s+(?:(?:d['’]|l['’])?\p{Lu}[\p{L}'’–-]+))?|[A-Z\p{Lu}]{2,}(?:[\s'-]+[A-Z\p{Lu}]{2,}){1,3})/giu
1213
+ },
1214
+ // 2. FBO (For Benefit Of) Client Account / Wire / Trust Beneficiary Names
1215
+ {
1216
+ type: 'NAME',
1217
+ isContextName: true,
1218
+ regex: /\b(?:FBO|F\/B\/O|f\/b\/o|For\s+(?:the\s+)?Benefit\s+Of)\s*[:=#]?\s*([A-Z\p{Lu}][A-Za-z'’.-]*(?:[ \t\xA0]+[A-Z\p{Lu}][A-Za-z'’.-]*){1,3}|[A-Z\p{Lu}]{2,}(?:[\s'-]+[A-Z\p{Lu}]{2,}){1,3})/giu
1219
+ },
1220
+ // 3. Declarative Trust Statement Openings ("wherein I, [NAME]...", "I, [NAME], of [CITY], as Settlor...")
1221
+ {
1222
+ type: 'NAME',
1223
+ isContextName: true,
1224
+ regex: /\b(?:wherein\s+I|I|We),\s*([A-Z\p{Lu}][A-Za-z'’.-]*(?:[ \t\xA0]+[A-Z\p{Lu}][A-Za-z'’.-]*){1,3}|[A-Z\p{Lu}]{2,}(?:[\s'.-]+[A-Z\p{Lu}]{2,}){1,3})(?:,\s*(?:Jr\.?|Sr\.?|III|IV|II))?,?\s*(?:of\s+[^,]+,\s*[^,]+,?\s*)?(?:as\s+(?:Grantor|Settlor|Trustor|Trustee|Co-Trustee|Testator)|make\s+this|hereby\s+(?:create|establish|declare)|declare\s+that)\b/giu
1225
+ },
1226
+ // 4. Trust Names, Family Trusts, Living Trusts & Estates (Title Case & ALL-CAPS)
1227
+ {
1228
+ type: 'LEGAL',
1229
+ regex: /\b(?:The[ \t\xA0]+)?(?!\b(?:This|That|These|Those|Such|Said|Each|Every|Any|Some|Our|Your|Their|My|His|Her|A|An|Uniform|Delaware|California|Nevada|Florida|New\s+York)\b)([A-Z\p{Lu}][\p{L}'’–-]*(?:[ \t\xA0]+(?:and|&)[ \t\xA0]+[A-Z\p{Lu}][\p{L}'’–-]*|[ \t\xA0]+[A-Z\p{Lu}][\p{L}'’–-]*){0,4}[ \t\xA0]+(?:Family[ \t\xA0]+)?(?:Revocable|Irrevocable|Living|Dynasty|Asset[ \t\xA0]+Protection|Charitable[ \t\xA0]+(?:Remainder|Lead)|Special[ \t\xA0]+Needs|Generation-Skipping|QTIP|GRAT|GRUT|Testamentary)?[ \t\xA0]*Trust(?![ \t\xA0]+(?:Act|Code|Statute|Law|Indenture|Department|Officer|Company|Corp|Bank|Accounting))\b)/gu
1230
+ },
1231
+ {
1232
+ type: 'LEGAL',
1233
+ regex: /\b(?:THE[ \t\xA0]+)?(?!\b(?:THIS|THAT|THESE|THOSE|SUCH|SAID|EACH|EVERY|ANY|SOME|OUR|YOUR|THEIR|MY|HIS|HER|A|AN|UNIFORM)\b)([A-Z\p{Lu}0-9&'’.,-]{2,}(?:[ \t\xA0]+[A-Z\p{Lu}0-9&'’.,-]{2,}){0,4}[ \t\xA0]+(?:FAMILY[ \t\xA0]+)?(?:REVOCABLE|IRREVOCABLE|LIVING|DYNASTY|ASSET[ \t\xA0]+PROTECTION|CHARITABLE|TESTAMENTARY)?[ \t\xA0]*TRUST(?![ \t\xA0]+(?:ACT|CODE|STATUTE|LAW|INDENTURE|DEPARTMENT|OFFICER|COMPANY|CORP|BANK))\b)/g
1234
+ },
1235
+ {
1236
+ type: 'LEGAL',
1237
+ regex: /\b(?:Trust[ \t\xA0]+(?:Name|Title)|Title[ \t\xA0]+of[ \t\xA0]+Trust)[ \t\xA0]*[:#=]+[ \t\xA0]*([A-Za-z0-9&'’., \t\xA0-]+?[ \t\xA0]+(?:Family[ \t\xA0]+)?(?:Revocable|Irrevocable|Living|Dynasty|Asset[ \t\xA0]+Protection|Charitable|Special[ \t\xA0]+Needs|Testamentary)?[ \t\xA0]*Trust)(?![ \t\xA0]+(?:Act|Code|Statute|Law|Indenture))\b/gi
1238
+ },
1208
1239
  { type: 'ID', regex: /\b(?:Grantor|Trustor|Trustee|Beneficiary|Primary\s+Beneficiary|Contingent\s+Beneficiary)\s*(?:ID|Code|No\.?|Number|#)[:\s#-]+([A-Za-z0-9-]{3,20})\b/gi },
1209
1240
  { type: 'ID', regex: /\b(?:Trust\s+(?:EIN|TIN|Tax\s+ID)|Estate\s+EIN)[:\s#]*(\d{2}-\d{7})\b/gi }
1210
1241
  ],
@@ -1248,10 +1279,11 @@ let PROFILE_RULES = {
1248
1279
  regex: /\b(?:Incurred\s+Loss(?:es)?|Paid\s+Loss(?:es)?|Case\s+Reserve|Outstanding\s+Reserve|IBNR(?:\s+Reserve)?|Loss\s+Reserve|Self-Insured\s+Retention|SIR\s+(?:Amount|Limit)|Policy\s+Limit|Per\s+Occurrence\s+Limit|Aggregate\s+Limit|Excess\s+Limit|Underlying\s+Limit|Attachment\s+Point|Treaty\s+Limit|Cession\s+Amount)\s*[:=]\s*((?:(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB)\s*|[$€£¥₪₽₹]\s*)[0-9,.'’]*\d[KMB]?\b|\b\d[0-9,.'’]*\d?[KMB]?\s*(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB)\b|[$€£¥₪₽₹])))/gi
1249
1280
  },
1250
1281
  // Existing core insurance patterns
1251
- { type: 'FINANCIAL', regex: /\b(?:Loss|Claim\s+Amount|Claim\s+Settlement|Settlement|(?<!\b(?:Case|Outstanding|IBNR|Loss)\s+)Reserve|Indemnity)[:\s]+(?:[$€£¥₪₽₹]|(?:USD|EUR|GBP|CHF|ILS|RUB)\s?)[\d,.'’]+\b/gi },
1282
+ { type: 'FINANCIAL', regex: /(?<=\b(?:Loss|Claim\s+Amount|Claim\s+Settlement|Settlement|(?<!\b(?:Case|Outstanding|IBNR|Loss)\s+)Reserve|Indemnity)[:\s]+)(?:[$€£¥₪₽₹]|(?:USD|EUR|GBP|CHF|ILS|RUB)\s?)[0-9,.'’\u2018\u2019]*\d[KMB]?\b/gi },
1283
+ { type: 'FINANCIAL', regex: /(?:(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB|CAD|AUD|JPY)\s*|[$€£¥₪₽₹]\s*)[0-9,.'’\u2018\u2019]*\d[KMB]?(?:\s*(?:USD|EUR|GBP|CHF|ILS|RUB|CAD|AUD|JPY|[$€£¥₪₽₹]))?\b|\b\d[0-9,.'’\u2018\u2019]*\d?[KMB]?\s*(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB|CAD|AUD|JPY)\b|[$€£¥₪₽₹]))/gi },
1252
1284
  { type: 'ID', regex: /\b(?:(?:Assigned\s+)?Adjuster\s+(?:ID|No)|Claim\s+Rep(?:\.|resentative)?)[:\s#]*[-A-Z0-9]{4,15}\b/gi },
1253
1285
  { type: 'ID', regex: /\bNAIC(?:\s+(?:Company\s+)?(?:Code|CoCode|No\.?|Number|#))?[:\s#]*(\d{5})\b/gi },
1254
- { type: 'FINANCIAL', regex: /\b(?:Deductible|Premium|Coverage\s+Amount)[:\s]+(?:[$€£¥₪₽₹]|(?:USD|EUR|GBP|CHF|ILS|RUB)\s?)[\d,.'’\u2018\u2019]+\b/gi },
1286
+ { type: 'FINANCIAL', regex: /(?<=\b(?:Deductible|Premium|Coverage\s+Amount)[:\s]+)(?:[$€£¥₪₽₹]|(?:USD|EUR|GBP|CHF|ILS|RUB)\s?)[0-9,.'’\u2018\u2019]*\d[KMB]?\b/gi },
1255
1287
  { type: 'ID', regex: /\b[A-HJ-NPR-Z0-9]{17}\b/g },
1256
1288
  { type: 'ID', regex: /\b(?<!\bAdditional\s+)(?:Insured|Named\s+Insured)[:\s]+[A-Z][a-z]+(?:[ \t\xA0]+[A-Z][a-z]+)+/g },
1257
1289
  { type: 'ID', regex: /\b(?:Agent|Producer)\s*(?:Code|No|ID)[:\s#]*[-A-Z0-9]{4,15}\b/gi },
@@ -1269,20 +1301,20 @@ let PROFILE_RULES = {
1269
1301
  { type: 'NAME', isContextName: true, isCorporateName: true, regex: /(?:Firm(?:'s)?\s*name|Preparer\s*Firm|Accounting\s*Firm|CPA\s*Firm)[\s:#]+([A-Za-z0-9&., \t\xA0'-]{2,45}?)(?=\r?\n|$|\s{3,}|\t|EIN|FEIN|Address|PTIN|Phone)/gi },
1270
1302
  { type: 'NAME', isContextName: true, regex: /(?:(?:Paid\s+)?Preparer(?:'s)?\s*(?:name)?|Tax\s+Preparer)[\s:#]+([A-Za-z0-9., \t\xA0'-]{2,35}?)(?=\r?\n|$|\s{3,}|\t|PTIN|Phone|SSN|EIN|Firm|Date)/gi },
1271
1303
  { type: 'ID', regex: /\b(?:Account\s+number\s*(?:\(see\s+instructions\))?|(?:(?:[A-Za-z]+[ \t\xA0]+)?(?:Operating|Payroll|Checking|Savings|Business|Depository)\s+Account))\s*(?:#|No\.?|Number)?[:\s#]*([A-Za-z0-9_-]{4,25})\b/gi },
1272
- { type: 'FINANCIAL', regex: /\b(?:AGI|Adjusted\s+Gross\s+Income|Taxable\s+Income|Total\s+Income)[:\s]+(?:[$€£¥₪₽₹]|(?:USD|EUR|GBP|CHF|ILS|RUB)\s?)[\d,.'’]+\b/gi },
1304
+ { type: 'FINANCIAL', regex: /(?<=\b(?:AGI|Adjusted\s+Gross\s+Income|Taxable\s+Income|Total\s+Income)\s*[:\s]\s*)(?:[$€£¥₪₽₹]|(?:USD|EUR|GBP|CHF|ILS|RUB)\s?)[0-9,.'’\u2018\u2019]*\d[KMB]?\b/gi },
1273
1305
  { type: 'FINANCIAL', regex: /\b(?:Form\s+|Withheld\s+)?Box\s+\d{1,2}[a-z]?(?:\s*(?:Code\s+[A-Z]{1,2}(?:\s*\([^)]*\))?|Wages[^\n\r:]{0,35}|Federal[^\n\r:]{0,35}|Medicare[^\n\r:]{0,35}|Social\s+Security[^\n\r:]{0,35}|Nonemployee[^\n\r:]{0,35}|Rents|Royalties|[A-Za-z0-9,/\s'’–-]{0,25})?(?:\s*:\s*[A-Z])?)?\s*[:\s]+(?:[$€£¥₪₽₹]|(?:USD|EUR|GBP|CHF|ILS|RUB)\s?)[\d,.'’\u2018\u2019]+\b/gi },
1274
1306
  { type: 'ID', regex: /\b(?:Form|Schedule)\s+(?:1040|1040-SR|W-2|W-4|1099-[A-Z]{1,4}|K-1|941|990|4562)\b/gi },
1275
- { type: 'FINANCIAL', regex: /\b(?:Federal|State|Assessed)?\s*(?:Tax\s+Due|Balance\s+Due|Overpayment|Refund)[:\s]+(?:[$€£¥₪₽₹]|(?:USD|EUR|GBP|CHF|ILS|RUB)\s?)[\d,.'’\u2018\u2019]+\b/gi },
1307
+ { type: 'FINANCIAL', regex: /(?<=\b(?:Federal|State|Assessed)?\s*(?:Tax\s+Due|Balance\s+Due|Overpayment|Refund)\s*[:\s]\s*)(?:[$€£¥₪₽₹]|(?:USD|EUR|GBP|CHF|ILS|RUB)\s?)[0-9,.'’\u2018\u2019]*\d[KMB]?\b/gi },
1276
1308
  { type: 'ID', regex: /\b(?:State\s+Tax\s+ID|SUI|UI\s+Account\s+No)[:\s#]*[A-Z]{0,3}[-]?\d{4,15}\b/gi },
1277
- { type: 'FINANCIAL', regex: /\b(?:Gross|Net|Medicare|Social\s+Security)\s+(?:Pay|Wages|Tips|Withholding)[:\s]+(?:[$€£¥₪₽₹]|(?:USD|EUR|GBP|CHF|ILS|RUB)\s?)[\d,.'’\u2018\u2019]+\b/gi },
1309
+ { type: 'FINANCIAL', regex: /(?<=\b(?:Gross|Net|Medicare|Social\s+Security)\s+(?:Pay|Wages|Tips|Withholding)\s*[:\s]\s*)(?:[$€£¥₪₽₹]|(?:USD|EUR|GBP|CHF|ILS|RUB)\s?)[0-9,.'’\u2018\u2019]*\d[KMB]?\b/gi },
1278
1310
  { type: 'ID', regex: /\b(?:CAF(?:\s+ID)?|(?:Practitioner|Tax\s+Preparer)\s+(?:PIN|ID)|PTIN)[:\s#]*[A-Z0-9-]{6,12}\b/gi },
1279
1311
  { type: 'ID', regex: /\bEFIN[:\s#]*\d{6}\b/gi },
1280
1312
  { type: 'ID', regex: /\bGL[-_\s]*(?:Account|Acct|Code)?[:\s#]*\d{3,10}(?:[-_]\d{2,6})+\b|\bGL[-_\s]*(?:Account|Acct|Code)?[:\s#]*\d{4,10}\b/gi },
1281
1313
  { type: 'ID', regex: /\b(?:Cost\s+Center|CC)[-_\s]*(?:ID|Code|#)?[:\s#]*[A-Z0-9_-]*\d[A-Z0-9_-]*\b/gi },
1282
1314
  { type: 'ID', regex: /\b(?:Invoice|Inv|Purchase\s+Order|PO|Bill|Check|Voucher|Remittance)\s*(?:Number|Num|No\.?|#)?[:\s#]+([A-Za-z0-9_-]{4,25})\b/gi },
1283
- { type: 'FINANCIAL', regex: /(?<=\b(?<!\b(?:EV|Debt|Net\s+Debt)\/)(?:Invoice(?:\s+Total)?|Amount\s+Due|Total\s+Due|Payment(?:\s+Amount)?|Ledger\s+Balance|Credit|Debit|Net\s+Amount|Total\s+Paid|Billed|Remittance|Total\s+Revenue|Revenue|Cost\s+of\s+Goods(?:\s+Sold)?|COGS|Gross\s+Profit|Operating\s+Expenses?|OpEx|Operating\s+Income(?:\s*\([^)]*\))?|Operating\s+Loss|Net\s+Income(?:\s*[/()]*\s*Loss)?|Net\s+Loss|Foreign\s+Exchange(?:\s+Loss)?|FX\s+Loss|Retained\s+Earnings|Total\s+Equity|Shareholders?'?\s+Equity|Total\s+Assets|Total\s+Liabilities|Accounts\s+Payable|Accounts\s+Receivable|Cash|Cash\s+Flow|Free\s+Cash\s+Flow|Capital\s+Expenditures?|CapEx|Dividends?|Sales\s+Revenue|EBITDA|EBIT|Balance|Loss|Profit)[:|\s]+)(?:(?:\((?:[$€£¥₪₽₹]\s*)?[0-9,.'’\u2018\u2019]+[KMB]?\)|(?:[$€£¥₪₽₹]\s*)\([0-9,.'’\u2018\u2019]+[KMB]?\))|(?:[-−](?:[$€£¥₪₽₹]\s*)?[0-9,.'’\u2018\u2019]*\d[KMB]?\b|(?:[$€£¥₪₽₹]\s*)[-−][0-9,.'’\u2018\u2019]*\d[KMB]?\b)|(?:(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB)\s*|[$€£¥₪₽₹]\s*)[0-9,.'’\u2018\u2019]*\d[KMB]?\b|\b\d[0-9,.'’\u2018\u2019]*\d?[KMB]?\s*(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB)\b|[$€£¥₪₽₹]))|[0-9,.'’]*\d\b)(?![ \t\xA0]*(?:%|[xX]\b|times\b|bps\b))/gi },
1315
+ { type: 'FINANCIAL', regex: /(?<=\b(?<!\b(?:EV|Debt|Net\s+Debt)\/)(?:Invoice(?:\s+Total)?|Amount\s+Due|Total(?:\s+Due)?|Payment(?:\s+Amount)?|Ledger\s+Balance|Credit|Debit|Net\s+Amount|Total\s+Paid|Billed|Remittance|Total\s+Revenue|Revenue|Cost\s+of\s+Goods(?:\s+Sold)?|COGS|Gross\s+Profit|Operating\s+Expenses?|OpEx|Operating\s+Income(?:\s*\([^)]*\))?|Operating\s+Loss|Net\s+Income(?:\s*[/()]*\s*Loss)?|Net\s+Loss|Foreign\s+Exchange(?:\s+Loss)?|FX\s+Loss|Retained\s+Earnings|Total\s+Equity|Shareholders?'?\s+Equity|Total\s+Assets|Total\s+Liabilities|Accounts\s+Payable|Accounts\s+Receivable|Cash|Cash\s+Flow|Free\s+Cash\s+Flow|Capital\s+Expenditures?|CapEx|Dividends?|(?:Capital\s+|Annual\s+)?Distribution(?:s)?|Withdrawal(?:s)?|Settlement(?:s)?|Sales\s+Revenue|EBITDA|EBIT|Balance|Loss|Profit)[:|\s]+)(?:(?:\((?:[$€£¥₪₽₹]\s*)?[0-9,.'’\u2018\u2019]+[KMB]?\)|(?:[$€£¥₪₽₹]\s*)\([0-9,.'’\u2018\u2019]+[KMB]?\))|(?:[-−](?:[$€£¥₪₽₹]\s*)?[0-9,.'’\u2018\u2019]*\d[KMB]?\b|(?:[$€£¥₪₽₹]\s*)[-−][0-9,.'’\u2018\u2019]*\d[KMB]?\b)|(?:(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB)\s*|[$€£¥₪₽₹]\s*)[0-9,.'’\u2018\u2019]*\d[KMB]?\b|\b\d[0-9,.'’\u2018\u2019]*\d?[KMB]?\s*(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB)\b|[$€£¥₪₽₹]))|[0-9,.'’]*\d\b)(?![ \t\xA0]*(?:%|[xX]\b|times\b|bps\b))/gi },
1284
1316
  { type: 'FINANCIAL', regex: /(?<=\|\s*)(?:(?:\((?:[$€£¥₪₽₹]\s*)?[0-9,.'’\u2018\u2019]+[KMB]?\)|(?:[$€£¥₪₽₹]\s*)\([0-9,.'’\u2018\u2019]+[KMB]?\))|(?:[-−](?:[$€£¥₪₽₹]\s*)?[0-9,.'’\u2018\u2019]*\d[KMB]?\b|(?:[$€£¥₪₽₹]\s*)[-−][0-9,.'’\u2018\u2019]*\d[KMB]?\b)|(?:(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB)\s*|[$€£¥₪₽₹]\s*)[0-9,.'’\u2018\u2019]*\d[KMB]?\b|\b\d[0-9,.'’\u2018\u2019]*\d?[KMB]?\s*(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB)\b|[$€£¥₪₽₹])))(?=\s*\|)/gi },
1285
- { type: 'FINANCIAL', regex: /(?:(?:\b(?:EUR|GBP|CHF|ILS|RUB)\s*|[€£¥₪₽₹]\s*)[0-9,.'’\u2018\u2019]*\d[KMB]?\b|\b\d[0-9,.'’\u2018\u2019]*\d?[KMB]?\s*(?:\b(?:EUR|GBP|CHF|ILS|RUB)\b|[€£¥₪₽₹]))/gi }
1317
+ { type: 'FINANCIAL', regex: /(?:(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB|CAD|AUD|JPY)\s*|[$€£¥₪₽₹]\s*)[0-9,.'’\u2018\u2019]*\d[KMB]?(?:\s*(?:USD|EUR|GBP|CHF|ILS|RUB|CAD|AUD|JPY|[$€£¥₪₽₹]))?\b|\b\d[0-9,.'’\u2018\u2019]*\d?[KMB]?\s*(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB|CAD|AUD|JPY)\b|[$€£¥₪₽₹]))/gi }
1286
1318
  ],
1287
1319
  pharma: [
1288
1320
  // Contextual Clinical, Regulatory & Pharmacovigilance Personnel
@@ -1547,7 +1579,7 @@ let PROFILE_RULES = {
1547
1579
  { type: 'FINANCIAL', regex: /\b(?:SAFE(?:\s+Agreement|\s+Note)?|Convertible\s+Note|CN)\s*(?:ID|Ref|No\.?|Number|#)?[:\s#-]+(?!Agreement\b)([A-Za-z0-9-]{3,25})\b/gi },
1548
1580
  { type: 'ID', regex: /\b(?:Share\s+Certificate|Stock\s+Certificate|Cert(?:ificate)?)\s*(?:No\.?|Number|#)?[:\s#-]+((?:CERT|CS|PS|PF|COM|PREF)[-_][A-Za-z0-9-]{2,15}|[A-Z]{1,4}-\d{3,8})\b/gi },
1549
1581
  { type: 'ID', regex: /\b(?:Stock\s+Option|Option\s+Grant|ISO|NSO|RSU)\s*(?:Agreement|Grant)?\s*(?:(?:ID|No\.?|Number|#)[:\s#-]*|[:#-])\s*([A-Za-z0-9-]*\d[A-Za-z0-9-]*)\b/gi },
1550
- { type: 'FINANCIAL', regex: /\b(?:Strike|Exercise)\s+Price[:\s]+((?:[$€£¥₪₽₹]|(?:USD|EUR|GBP|CHF|ILS|RUB)\s?)[\d,.'’\u2018\u2019]+)\b/gi },
1582
+ { type: 'FINANCIAL', regex: /\b(?:Strike|Exercise)\s+Price[:\s]+((?:[$€£¥₪₽₹]|(?:USD|EUR|GBP|CHF|ILS|RUB)\s?)[0-9,.'’\u2018\u2019]*\d[KMB]?)\b/gi },
1551
1583
  { type: 'FINANCIAL', regex: /\b(?:Valuation\s+Cap|Post-Money\s+Cap|Pre-Money\s+Valuation)[:\s]+((?:[$€£¥₪₽₹]|(?:USD|EUR|GBP|CHF|ILS|RUB)\s?)[\d,.'’\u2018\u2019]+[KMB]?)\b/gi },
1552
1584
  { type: 'FINANCIAL', regex: /\b(?:Common\s+Shares|Preferred\s+Shares|Number\s+of\s+Shares|Share\s+Count|Shares)[:\s]+([0-9,.'’\u2018\u2019]{3,})\b/gi },
1553
1585
  { type: 'FINANCIAL', regex: /\b(?:Fully\s+Diluted\s+)?Ownership(?:\s+Percentage)?[:\s]+(\d+(?:\.\d+)?\s*%)/gi },
@@ -1566,7 +1598,7 @@ let PROFILE_RULES = {
1566
1598
  { type: 'ID', regex: /\b(?:Ineligible\s+AR|Eligible\s+AR|Collateral\s+Account)(?:\s+(?:Account|Acct|ID|Ref|No\.?|Number|#))*\s*[:#-]\s*([A-Za-z0-9-]{4,20})\b/gi },
1567
1599
  { type: 'ID', regex: /\b(?:Merchant\s+Cash\s+Advance|MCA)[ \t\xA0]*(?:Agreement|Contract)?[ \t\xA0]*(?:ID|Ref|No\.?|Number|#)?[ \t\xA0]*[:#-][ \t\xA0]*(?!Agreement\b)([A-Za-z0-9-]{4,25})\b/gi },
1568
1600
  { type: 'FINANCIAL', regex: /(?<=(?:^|[\r\n\t.;])[ \t\xA0]*(?:Daily|Weekly)(?:[ \t\xA0]+(?:ACH|Remittance|Debit|Payment|Transfer|Split(?:[ \t\xA0]+Funding)?|Holdback))+[ \t\xA0]*[:=][ \t\xA0]*)((?:[$€£¥₪₽₹]|(?:USD|EUR|GBP|CHF|ILS|RUB)\s?)[\d,.'’]+)/gi },
1569
- { type: 'FINANCIAL', regex: /(?:(?:\b(?:EUR|GBP|CHF|ILS|RUB)\s*|[€£¥₪₽₹]\s*)[0-9,.'’\u2018\u2019]*\d[KMB]?\b|\b\d[0-9,.'’\u2018\u2019]*\d?[KMB]?\s*(?:\b(?:EUR|GBP|CHF|ILS|RUB)\b|[€£¥₪₽₹]))/gi },
1601
+ { type: 'FINANCIAL', regex: /(?:(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB|CAD|AUD|JPY)\s*|[$€£¥₪₽₹]\s*)[0-9,.'’\u2018\u2019]*\d[KMB]?(?:\s*(?:USD|EUR|GBP|CHF|ILS|RUB|CAD|AUD|JPY|[$€£¥₪₽₹]))?\b|\b\d[0-9,.'’\u2018\u2019]*\d?[KMB]?\s*(?:\b(?:USD|EUR|GBP|CHF|ILS|RUB|CAD|AUD|JPY)\b|[$€£¥₪₽₹]))/gi },
1570
1602
  { type: 'NAME', isContextName: true, isCorporateName: true, regex: /(?:MCA\s+Funder|Funder|ISO\s+Broker|Funding\s+Partner)[ \t\xA0]*[:#][ \t\xA0]*([A-Za-z0-9&.,\s'-]{2,40}?)(?=\r?\n|$|\s{3,}|\t|Rate|Factor|Advance|Amount|Terms)/gi }
1571
1603
  ]
1572
1604
  };
@@ -1846,7 +1878,7 @@ let NOT_NAME_WORDS = new Set([
1846
1878
  // Common Resume / Business Phrases
1847
1879
  'results-driven', 'data-driven', 'customer-centric', 'detail-oriented', 'cross-functional', 'self-motivated', 'time-management', 'problem-solving', 'fast-paced', 'year-over-year',
1848
1880
  // Legal & Trust terms
1849
- 'trust', 'trustee', 'co-trustee', 'settlor', 'grantor', 'beneficiary', 'agreement', 'will', 'estate', 'witness', 'declaration', 'signatory', 'testator', 'notary', 'commission', 'county', 'state', 'court', 'article', 'section', 'paragraph', 'schedule', 'exhibit', 'amendment', 'addendum', 'power', 'attorney', 'guardian', 'executor', 'administrator', 'survivor', 'predecessor', 'successor', 'whereof', 'hereby', 'thereby', 'herein', 'therein', 'witnesseth', 'whereas', 'therefore', 'now', 'dated', 'effective', 'matter', 'case', 'cases', 'docket', 'dockets', 'number', 'numbers', 'firm', 'firms', 'lawyer', 'lawyers', 'counsel', 'counsels', 'counselstack', 'tier', 'tiers', 'finding', 'findings', 'connector', 'connectors', 'platform', 'platforms',
1881
+ 'trust', 'trustee', 'trustees', 'co-trustee', 'co-trustees', 'settlor', 'settlors', 'grantor', 'grantors', 'trustor', 'trustors', 'beneficiary', 'beneficiaries', 'revocable', 'irrevocable', 'dynasty', 'testamentary', 'fbo', 'agreement', 'will', 'estate', 'witness', 'declaration', 'signatory', 'testator', 'notary', 'commission', 'county', 'state', 'court', 'article', 'section', 'paragraph', 'schedule', 'exhibit', 'amendment', 'addendum', 'power', 'attorney', 'guardian', 'executor', 'administrator', 'survivor', 'predecessor', 'successor', 'whereof', 'hereby', 'thereby', 'herein', 'therein', 'witnesseth', 'whereas', 'therefore', 'now', 'dated', 'effective', 'matter', 'case', 'cases', 'docket', 'dockets', 'number', 'numbers', 'firm', 'firms', 'lawyer', 'lawyers', 'counsel', 'counsels', 'counselstack', 'tier', 'tiers', 'finding', 'findings', 'connector', 'connectors', 'platform', 'platforms',
1850
1882
  // Medical & Clinical terms
1851
1883
  'clinical', 'note', 'notes', 'dx', 'rx', 'tx', 'hx', 'px', 'sx', 'type', 'diabetes', 'referred', 'referral', 'diagnosed', 'diagnosis', 'patient', 'insurance', 'bcbs', 'mrn', 'dob',
1852
1884
  // Tax & Payroll terms
@@ -1866,7 +1898,9 @@ let NOT_NAME_WORDS = new Set([
1866
1898
  'accord', 'contrat', 'contrato', 'acuerdo', 'avenant', 'convention', 'protocole', 'prestation', 'confidentialite', 'confidentialité',
1867
1899
  'f.3d', 'f.supp', 'u.s.c.', 'v.', 'plaintiff', 'defendant', 'v', 'u.s.', 'court', 'app.', 'reporter', 'cir.',
1868
1900
  'civ', 'crim', 'evid', 'bankr', 'proc',
1869
- 'marine', 'inland', 'ocean', 'comp', 'workers', 'actuarial', 'actuary', 'underwriting', 'syndicate', 'lloyd', 'lloyds', 'pcs']);
1901
+ 'marine', 'inland', 'ocean', 'comp', 'workers', 'actuarial', 'actuary', 'underwriting', 'syndicate', 'lloyd', 'lloyds', 'pcs',
1902
+ // Dutch role / job-title nouns (prevent sentence-initial role words from being absorbed into NAME tokens)
1903
+ 'medewerker', 'medewerkers', 'medewerkster', 'collega', 'collegas', 'werknemer', 'werknemers', 'klant', 'klanten', 'cliënt', 'client', 'cliënten', 'patiënt', 'patiënten', 'directeur', 'aanvrager', 'contactpersoon', 'huisarts', 'adviseur', 'consulent', 'beheerder', 'sollicitant', 'kandidaat', 'verzekerde', 'dossierhouder', 'behandelaar', 'zaakbehandelaar', 'burgerservicenummer', 'sofinummer']);
1870
1904
 
1871
1905
  // Nobiliary particles and conjunctions that should never trigger name disqualification
1872
1906
  const NOBILIARY_PARTICLES = new Set([
@@ -3033,6 +3067,25 @@ const PROFILE_JARGON = {
3033
3067
  restoredCount++;
3034
3068
  return lookup.get(upper);
3035
3069
  }
3070
+ // Normalized lookup: strip outer brackets/delimiters, normalize whitespace, collapse leading zeros
3071
+ const inner = match.replace(/^(\[|<|\{\{|__)\s*|\s*(\]|>|\}\}|__)$/g, '').trim();
3072
+ const normMatch = inner.match(/^([A-Za-z_А-Яа-яЁё0-9]+?)[-_\s]+0*(\d+)$/);
3073
+ if (normMatch) {
3074
+ const normLabel = normMatch[1].replace(/[\s_-]+/g, '_').toUpperCase();
3075
+ const normIdx = parseInt(normMatch[2], 10);
3076
+ const candidates = [
3077
+ normLabel + '_' + normIdx,
3078
+ '[' + normLabel + '_' + normIdx + ']',
3079
+ normLabel + ' ' + normIdx,
3080
+ normLabel + '-' + normIdx
3081
+ ];
3082
+ for (let c = 0; c < candidates.length; c++) {
3083
+ if (lookup.has(candidates[c])) {
3084
+ restoredCount++;
3085
+ return lookup.get(candidates[c]);
3086
+ }
3087
+ }
3088
+ }
3036
3089
  const possMatch = match.match(/^([\s\S]+?)('s|’s|s|[а-яёА-ЯЁ]{1,3})$/);
3037
3090
  if (possMatch) {
3038
3091
  const base = possMatch[1];
@@ -3078,12 +3131,32 @@ const PROFILE_JARGON = {
3078
3131
  } else if (lookup.has(match.toUpperCase())) {
3079
3132
  rawVal = lookup.get(match.toUpperCase());
3080
3133
  } else {
3081
- const possMatch = match.match(/^([\s\S]+?)('s|’s|s|[а-яёА-ЯЁ]{1,3})$/);
3082
- if (possMatch) {
3083
- const base = possMatch[1];
3084
- suffix = possMatch[2];
3085
- if (lookup.has(base)) rawVal = lookup.get(base);
3086
- else if (lookup.has(base.toUpperCase())) rawVal = lookup.get(base.toUpperCase());
3134
+ const inner = match.replace(/^(\[|<|\{\{|__)\s*|\s*(\]|>|\}\}|__)$/g, '').trim();
3135
+ const normMatch = inner.match(/^([A-Za-z_А-Яа-яЁё0-9]+?)[-_\s]+0*(\d+)$/);
3136
+ if (normMatch) {
3137
+ const normLabel = normMatch[1].replace(/[\s_-]+/g, '_').toUpperCase();
3138
+ const normIdx = parseInt(normMatch[2], 10);
3139
+ const candidates = [
3140
+ normLabel + '_' + normIdx,
3141
+ '[' + normLabel + '_' + normIdx + ']',
3142
+ normLabel + ' ' + normIdx,
3143
+ normLabel + '-' + normIdx
3144
+ ];
3145
+ for (let c = 0; c < candidates.length; c++) {
3146
+ if (lookup.has(candidates[c])) {
3147
+ rawVal = lookup.get(candidates[c]);
3148
+ break;
3149
+ }
3150
+ }
3151
+ }
3152
+ if (rawVal === null) {
3153
+ const possMatch = match.match(/^([\s\S]+?)('s|’s|s|[а-яёА-ЯЁ]{1,3})$/);
3154
+ if (possMatch) {
3155
+ const base = possMatch[1];
3156
+ suffix = possMatch[2];
3157
+ if (lookup.has(base)) rawVal = lookup.get(base);
3158
+ else if (lookup.has(base.toUpperCase())) rawVal = lookup.get(base.toUpperCase());
3159
+ }
3087
3160
  }
3088
3161
  }
3089
3162
  if (rawVal !== null) {