{
  "$schema": "https://uipkge.dev/schema/registry-item.json",
  "name": "safe-note-calculator",
  "title": "Safe Note Calculator",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-angular/blocks/safe-note-calculator/safe-note-calculator.component.ts",
      "content": "// Y Combinator Post-Money SAFE note valuation, conversion share price, effective discount,\n// and cap table equity dilution simulator with interactive parameter controls and a Series A\n// financing sensitivity matrix. Port of the React block 1:1.\nimport { ChangeDetectionStrategy, Component, DestroyRef, Input, computed, inject, signal } from '@angular/core'\nimport {\n  BadgePercent,\n  Check,\n  CheckCircle2,\n  Copy,\n  DollarSign,\n  FileSpreadsheet,\n  Layers,\n  LucideAngularModule,\n  Percent,\n  PieChart,\n  Scale,\n  ShieldCheck,\n  TrendingUp,\n} from 'lucide-angular'\nimport { cn } from '@/lib/utils'\nimport { UiBadgeComponent } from '@/ui/badge/badge.component'\nimport { UiButtonComponent } from '@/ui/button/button.component'\nimport {\n  UiCardComponent,\n  UiCardContentComponent,\n  UiCardDescriptionComponent,\n  UiCardFooterComponent,\n  UiCardHeaderComponent,\n  UiCardTitleComponent,\n} from '@/ui/card/card.component'\nimport { UiInputComponent } from '@/ui/input/input.component'\nimport { UiSeparatorComponent } from '@/ui/separator/separator.component'\nimport { UiSliderComponent } from '@/ui/slider/slider.component'\nimport { UiSwitchComponent } from '@/ui/switch/switch.component'\nimport {\n  UiTableBodyComponent,\n  UiTableCellComponent,\n  UiTableComponent,\n  UiTableFooterComponent,\n  UiTableHeadComponent,\n  UiTableHeaderComponent,\n  UiTableRowComponent,\n} from '@/ui/table/table.component'\nimport { UiTabsComponent, UiTabsListComponent, UiTabsTriggerComponent } from '@/ui/tabs/tabs.component'\n\nexport type RoundPreset = 'seed-standard' | 'preseed-safe' | 'uncapped-discount' | 'bridge-round'\n\nexport interface PresetConfig {\n  id: RoundPreset\n  label: string\n  investment: number\n  valuationCap: number\n  hasDiscount: boolean\n  discountRate: number\n  shares: number\n  seriesAPreMoney: number\n  description: string\n}\n\nexport const PRESETS: Record<RoundPreset, PresetConfig> = {\n  'seed-standard': {\n    id: 'seed-standard',\n    label: 'Standard Seed ($1M @ $15M)',\n    investment: 1_000_000,\n    valuationCap: 15_000_000,\n    hasDiscount: true,\n    discountRate: 20,\n    shares: 10_000_000,\n    seriesAPreMoney: 25_000_000,\n    description: 'Standard YC Post-Money SAFE with $15M valuation cap and optional 20% discount clause.',\n  },\n  'preseed-safe': {\n    id: 'preseed-safe',\n    label: 'Pre-Seed ($500K @ $8M)',\n    investment: 500_000,\n    valuationCap: 8_000_000,\n    hasDiscount: true,\n    discountRate: 20,\n    shares: 10_000_000,\n    seriesAPreMoney: 18_000_000,\n    description: 'Early-stage angel or accelerator round with $8M valuation cap.',\n  },\n  'uncapped-discount': {\n    id: 'uncapped-discount',\n    label: 'Uncapped (25% Disc)',\n    investment: 750_000,\n    valuationCap: 60_000_000,\n    hasDiscount: true,\n    discountRate: 25,\n    shares: 10_000_000,\n    seriesAPreMoney: 20_000_000,\n    description: 'High valuation cap structure where the 25% discount governs share conversion price.',\n  },\n  'bridge-round': {\n    id: 'bridge-round',\n    label: 'Growth Bridge ($2M @ $25M)',\n    investment: 2_000_000,\n    valuationCap: 25_000_000,\n    hasDiscount: true,\n    discountRate: 15,\n    shares: 10_000_000,\n    seriesAPreMoney: 45_000_000,\n    description: 'Late seed extension bridging into a larger institutional Series A equity round.',\n  },\n}\n\nconst INVESTMENT_MARKS: Record<number, string> = {\n  100000: '$100K',\n  1000000: '$1M',\n  2500000: '$2.5M',\n  5000000: '$5M',\n}\n\nconst VALUATION_CAP_MARKS: Record<number, string> = {\n  2000000: '$2M',\n  15000000: '$15M',\n  30000000: '$30M',\n  50000000: '$50M',\n}\n\nconst DISCOUNT_RATE_MARKS: Record<number, string> = {\n  10: '10%',\n  15: '15%',\n  20: '20%',\n  25: '25%',\n  30: '30%',\n}\n\nconst SERIES_A_MARKS: Record<number, string> = {\n  5000000: '$5M',\n  25000000: '$25M',\n  50000000: '$50M',\n  80000000: '$80M',\n}\n\nconst SCENARIO_VALUATIONS = [10_000_000, 15_000_000, 20_000_000, 25_000_000, 40_000_000, 60_000_000]\n\n@Component({\n  changeDetection: ChangeDetectionStrategy.Eager,\n  selector: 'ui-safe-note-calculator, [ui-safe-note-calculator]',\n  standalone: true,\n  // React renders the root <div> itself: the host stays out of layout and `class` goes to the root.\n  host: { '[attr.class]': '\"contents\"' },\n  imports: [\n    LucideAngularModule,\n    UiBadgeComponent,\n    UiButtonComponent,\n    UiCardComponent,\n    UiCardContentComponent,\n    UiCardDescriptionComponent,\n    UiCardFooterComponent,\n    UiCardHeaderComponent,\n    UiCardTitleComponent,\n    UiInputComponent,\n    UiSeparatorComponent,\n    UiSliderComponent,\n    UiSwitchComponent,\n    UiTableBodyComponent,\n    UiTableCellComponent,\n    UiTableComponent,\n    UiTableFooterComponent,\n    UiTableHeadComponent,\n    UiTableHeaderComponent,\n    UiTableRowComponent,\n    UiTabsComponent,\n    UiTabsListComponent,\n    UiTabsTriggerComponent,\n  ],\n  template: `\n    <div data-slot=\"safe-note-calculator\" [class]=\"rootClass\">\n      <!-- Header -->\n      <div class=\"flex flex-col items-center gap-4 text-center\">\n        <span ui-badge wrap variant=\"outline\" class=\"gap-1.5 px-3 py-1 text-xs font-medium tracking-wider uppercase\">\n          <lucide-icon [img]=\"Scale\" class=\"text-primary size-3.5\" />\n          YC Post-Money SAFE v1.1 · Valuation Cap + Discount\n        </span>\n        <div class=\"space-y-2\">\n          <h2 class=\"text-foreground text-2xl font-bold tracking-tight sm:text-3xl lg:text-4xl\">\n            Y Combinator Post-Money SAFE Calculator\n          </h2>\n          <p class=\"text-muted-foreground mx-auto max-w-2xl text-sm sm:text-base\">\n            Model founder dilution, investor ownership percentages, and conversion price per share.\n          </p>\n        </div>\n\n        <!-- Preset Tabs -->\n        <div class=\"mt-2 flex w-full justify-center\">\n          <ui-tabs [value]=\"selectedPreset()\" (valueChange)=\"handlePresetChange($event)\" class=\"w-full sm:w-auto\">\n            <ui-tabs-list variant=\"segmented\" class=\"grid w-full grid-cols-2 sm:flex sm:w-auto\">\n              <button ui-tabs-trigger value=\"seed-standard\" class=\"gap-1.5\">\n                <lucide-icon [img]=\"ShieldCheck\" class=\"size-3.5\" />\n                Standard Seed\n              </button>\n              <button ui-tabs-trigger value=\"preseed-safe\" class=\"gap-1.5\">\n                <lucide-icon [img]=\"TrendingUp\" class=\"size-3.5\" />\n                Pre-Seed SAFE\n              </button>\n              <button ui-tabs-trigger value=\"uncapped-discount\" class=\"gap-1.5\">\n                <lucide-icon [img]=\"BadgePercent\" class=\"size-3.5\" />\n                Uncapped Disc\n              </button>\n              <button ui-tabs-trigger value=\"bridge-round\" class=\"gap-1.5\">\n                <lucide-icon [img]=\"Layers\" class=\"size-3.5\" />\n                Growth Bridge\n              </button>\n            </ui-tabs-list>\n          </ui-tabs>\n        </div>\n      </div>\n\n      <!-- 2-Column Calculator Layout -->\n      <div class=\"grid grid-cols-1 gap-8 lg:grid-cols-12 lg:items-start\">\n        <!-- Left Input Card -->\n        <div class=\"space-y-6 lg:col-span-7\">\n          <div ui-card>\n            <div ui-card-header>\n              <h3 ui-card-title class=\"flex items-center gap-2\">\n                <lucide-icon [img]=\"DollarSign\" class=\"text-primary size-5\" />\n                SAFE Terms & Round Inputs\n              </h3>\n              <p ui-card-description>\n                Configure investment size, valuation cap, optional discount rate, capitalization, and Series A targets.\n              </p>\n            </div>\n            <div ui-card-content class=\"space-y-7\">\n              <!-- 1. Investment Amount -->\n              <div class=\"space-y-3.5\">\n                <div class=\"flex items-center justify-between gap-4\">\n                  <div>\n                    <span class=\"text-foreground text-sm font-medium\">Investment Amount</span>\n                    <p class=\"text-muted-foreground text-xs\">Total cash invested into the SAFE.</p>\n                  </div>\n                  <div class=\"w-36 sm:w-44\">\n                    <ui-input\n                      id=\"safe-investment-input\"\n                      type=\"number\"\n                      size=\"small\"\n                      [min]=\"25000\"\n                      [max]=\"10000000\"\n                      [step]=\"25000\"\n                      prefix=\"$\"\n                      [value]=\"investmentAmount()\"\n                      (valueChange)=\"investmentAmount.set(+$event || 0)\"\n                    />\n                  </div>\n                </div>\n                <div class=\"pb-5\">\n                  <ui-slider\n                    [value]=\"[investmentAmount()]\"\n                    (valueChange)=\"investmentAmount.set($event[0] ?? 0)\"\n                    [min]=\"100000\"\n                    [max]=\"5000000\"\n                    [step]=\"25000\"\n                    [marks]=\"investmentMarks\"\n                    [tooltip]=\"investTooltip\"\n                  />\n                </div>\n                <div class=\"flex flex-wrap items-center gap-1.5 pt-1\">\n                  <span class=\"text-muted-foreground text-xs\">Quick select:</span>\n                  @for (amt of quickInvestments; track amt) {\n                    <button\n                      ui-button\n                      variant=\"outline\"\n                      size=\"sm\"\n                      class=\"h-6 px-2 text-xs\"\n                      (click)=\"investmentAmount.set(amt)\"\n                    >\n                      {{ quickInvestLabel(amt) }}\n                    </button>\n                  }\n                </div>\n              </div>\n\n              <ui-separator />\n\n              <!-- 2. Post-Money Valuation Cap -->\n              <div class=\"space-y-3.5\">\n                <div class=\"flex items-center justify-between gap-4\">\n                  <div>\n                    <span class=\"text-foreground text-sm font-medium\">Post-Money Valuation Cap</span>\n                    <p class=\"text-muted-foreground text-xs\">Maximum valuation ceiling for conversion.</p>\n                  </div>\n                  <div class=\"w-36 sm:w-44\">\n                    <ui-input\n                      id=\"safe-cap-input\"\n                      type=\"number\"\n                      size=\"small\"\n                      [min]=\"500000\"\n                      [max]=\"100000000\"\n                      [step]=\"500000\"\n                      prefix=\"$\"\n                      [value]=\"valuationCap()\"\n                      (valueChange)=\"valuationCap.set(+$event || 0)\"\n                    />\n                  </div>\n                </div>\n                <div class=\"pb-5\">\n                  <ui-slider\n                    [value]=\"[valuationCap()]\"\n                    (valueChange)=\"valuationCap.set($event[0] ?? 0)\"\n                    [min]=\"2000000\"\n                    [max]=\"50000000\"\n                    [step]=\"500000\"\n                    [marks]=\"valuationCapMarks\"\n                    [tooltip]=\"currencyTooltip\"\n                  />\n                </div>\n                <div class=\"flex flex-wrap items-center gap-1.5 pt-1\">\n                  <span class=\"text-muted-foreground text-xs\">Cap benchmarks:</span>\n                  @for (cap of capBenchmarks; track cap) {\n                    <button\n                      ui-button\n                      variant=\"outline\"\n                      size=\"sm\"\n                      class=\"h-6 px-2 text-xs\"\n                      (click)=\"valuationCap.set(cap)\"\n                    >\n                      \\${{ cap / 1000000 }}M\n                    </button>\n                  }\n                </div>\n              </div>\n\n              <ui-separator />\n\n              <!-- 3. Discount Rate Input & Toggle -->\n              <div class=\"space-y-3.5\">\n                <div class=\"flex items-center justify-between gap-4\">\n                  <div class=\"space-y-1\">\n                    <div class=\"flex items-center gap-2\">\n                      <span class=\"text-foreground text-sm font-medium\">Discount Rate Clause</span>\n                      @if (hasDiscount()) {\n                        <span\n                          ui-badge\n                          wrap\n                          variant=\"outline\"\n                          class=\"border-success/20 bg-success/10 text-success text-xs font-normal\"\n                        >\n                          Active\n                        </span>\n                      } @else {\n                        <span ui-badge wrap variant=\"outline\" class=\"text-muted-foreground text-xs font-normal\">\n                          Cap Only\n                        </span>\n                      }\n                    </div>\n                    <p class=\"text-muted-foreground text-xs\">\n                      Percentage discount on Series A price if cap is not exceeded.\n                    </p>\n                  </div>\n                  <div class=\"flex flex-wrap items-center gap-3\">\n                    <ui-switch\n                      [checked]=\"hasDiscount()\"\n                      (checkedChange)=\"hasDiscount.set($event)\"\n                      aria-label=\"Toggle discount clause\"\n                    />\n                    @if (hasDiscount()) {\n                      <div class=\"w-24 sm:w-28\">\n                        <ui-input\n                          id=\"safe-discount-input\"\n                          type=\"number\"\n                          size=\"small\"\n                          [min]=\"0\"\n                          [max]=\"50\"\n                          [step]=\"1\"\n                          suffix=\"%\"\n                          [value]=\"discountRate()\"\n                          (valueChange)=\"discountRate.set(+$event || 0)\"\n                        />\n                      </div>\n                    }\n                  </div>\n                </div>\n\n                @if (hasDiscount()) {\n                  <div class=\"space-y-3 pt-1\">\n                    <div class=\"pb-5\">\n                      <ui-slider\n                        [value]=\"[discountRate()]\"\n                        (valueChange)=\"discountRate.set($event[0] ?? 0)\"\n                        [min]=\"5\"\n                        [max]=\"35\"\n                        [step]=\"1\"\n                        [marks]=\"discountRateMarks\"\n                        [tooltip]=\"discountTooltip\"\n                      />\n                    </div>\n                    <div class=\"flex flex-wrap items-center gap-1.5 pt-1\">\n                      <span class=\"text-muted-foreground text-xs\">Standard rates:</span>\n                      @for (r of standardRates; track r) {\n                        <button\n                          ui-button\n                          [variant]=\"discountRate() === r ? 'default' : 'outline'\"\n                          size=\"sm\"\n                          class=\"h-6 px-2 text-xs\"\n                          (click)=\"discountRate.set(r)\"\n                        >\n                          {{ r }}%\n                        </button>\n                      }\n                    </div>\n                  </div>\n                }\n              </div>\n\n              <ui-separator />\n\n              <!-- 4. Company Existing Capitalization -->\n              <div class=\"space-y-3.5\">\n                <div class=\"flex items-center justify-between gap-4\">\n                  <div>\n                    <span class=\"text-foreground text-sm font-medium\">Company Existing Capitalization</span>\n                    <p class=\"text-muted-foreground text-xs\">Total pre-conversion issued shares and option pool.</p>\n                  </div>\n                  <div class=\"w-36 sm:w-44\">\n                    <ui-input\n                      id=\"safe-shares-input\"\n                      type=\"number\"\n                      size=\"small\"\n                      [min]=\"1000000\"\n                      [max]=\"100000000\"\n                      [step]=\"500000\"\n                      suffix=\"Shares\"\n                      [value]=\"companyCapitalization()\"\n                      (valueChange)=\"companyCapitalization.set(+$event || 0)\"\n                    />\n                  </div>\n                </div>\n                <div class=\"flex flex-wrap items-center gap-1.5 pt-1\">\n                  <span class=\"text-muted-foreground text-xs\">Common share counts:</span>\n                  @for (count of shareCounts; track count) {\n                    <button\n                      ui-button\n                      [variant]=\"companyCapitalization() === count ? 'default' : 'outline'\"\n                      size=\"sm\"\n                      class=\"h-6 px-2 text-xs\"\n                      (click)=\"companyCapitalization.set(count)\"\n                    >\n                      {{ count / 1000000 }}M Shares\n                    </button>\n                  }\n                </div>\n              </div>\n\n              <ui-separator />\n\n              <!-- 5. Series A Pre-Money Target -->\n              <div class=\"space-y-3.5\">\n                <div class=\"flex items-center justify-between gap-4\">\n                  <div>\n                    <span class=\"text-foreground text-sm font-medium\">Series A Pre-Money Target</span>\n                    <p class=\"text-muted-foreground text-xs\">Target qualified financing equity valuation.</p>\n                  </div>\n                  <div class=\"w-36 sm:w-44\">\n                    <ui-input\n                      id=\"safe-series-a-input\"\n                      type=\"number\"\n                      size=\"small\"\n                      [min]=\"1000000\"\n                      [max]=\"200000000\"\n                      [step]=\"1000000\"\n                      prefix=\"$\"\n                      [value]=\"seriesAPreMoney()\"\n                      (valueChange)=\"seriesAPreMoney.set(+$event || 0)\"\n                    />\n                  </div>\n                </div>\n                <div class=\"pb-5\">\n                  <ui-slider\n                    [value]=\"[seriesAPreMoney()]\"\n                    (valueChange)=\"seriesAPreMoney.set($event[0] ?? 0)\"\n                    [min]=\"5000000\"\n                    [max]=\"80000000\"\n                    [step]=\"1000000\"\n                    [marks]=\"seriesAMarks\"\n                    [tooltip]=\"currencyTooltip\"\n                  />\n                </div>\n                <div class=\"flex flex-wrap items-center gap-1.5 pt-1\">\n                  <span class=\"text-muted-foreground text-xs\">Series A benchmarks:</span>\n                  @for (target of seriesABenchmarks; track target) {\n                    <button\n                      ui-button\n                      variant=\"outline\"\n                      size=\"sm\"\n                      class=\"h-6 px-2 text-xs\"\n                      (click)=\"seriesAPreMoney.set(target)\"\n                    >\n                      \\${{ target / 1000000 }}M\n                    </button>\n                  }\n                </div>\n              </div>\n            </div>\n          </div>\n        </div>\n\n        <!-- Right Results Card (Sticky on desktop) -->\n        <div class=\"lg:sticky lg:top-8 lg:col-span-5\">\n          <div ui-card class=\"border-border bg-card shadow-xs\">\n            <div ui-card-header class=\"pb-4\">\n              <div class=\"flex items-center justify-between\">\n                <span class=\"text-muted-foreground text-xs font-semibold tracking-wider uppercase\">\n                  Investor Ownership Stake\n                </span>\n                <span ui-badge variant=\"secondary\" [class]=\"governingBadgeClass\">\n                  {{ calculations().governingMechanism === 'cap' ? 'Cap Governs' : 'Discount Governs' }}\n                </span>\n              </div>\n              <div class=\"mt-4\">\n                <div class=\"flex items-baseline gap-2\">\n                  <span class=\"text-foreground text-3xl font-bold tracking-tight tabular-nums sm:text-4xl\">\n                    {{ fmtPercent(calculations().safeOwnershipPct) }}\n                  </span>\n                  <span class=\"text-muted-foreground text-sm font-medium\">Post-SAFE Ownership</span>\n                </div>\n                <p class=\"text-muted-foreground mt-1 text-xs\">\n                  SAFE investor receives\n                  <span class=\"text-foreground font-semibold tabular-nums\">\n                    {{ fmtNumber(calculations().safeShares) }}\n                  </span>\n                  shares at conversion.\n                </p>\n              </div>\n            </div>\n\n            <div ui-card-content class=\"space-y-5\">\n              <ui-separator />\n\n              <!-- Key Economics Metrics Grid -->\n              <div class=\"grid grid-cols-1 gap-3 sm:grid-cols-2\">\n                <div class=\"bg-muted/40 rounded-lg border p-3\">\n                  <span class=\"text-muted-foreground block text-xs\">SAFE Conversion Price</span>\n                  <span class=\"text-foreground text-base font-bold tabular-nums\">\n                    {{ fmtCurrency(calculations().conversionPrice) }}\n                  </span>\n                  <span class=\"text-muted-foreground block text-xs tabular-nums\">\n                    vs Series A {{ fmtCurrency(calculations().seriesAPricePerShare) }}\n                  </span>\n                </div>\n\n                <div class=\"bg-muted/40 rounded-lg border p-3\">\n                  <span class=\"text-muted-foreground block text-xs\">Converted Shares Issued</span>\n                  <span class=\"text-foreground text-base font-bold tabular-nums\">\n                    {{ fmtNumber(calculations().safeShares) }}\n                  </span>\n                  <span class=\"text-muted-foreground block text-xs\">Equity units</span>\n                </div>\n\n                <div class=\"bg-muted/40 rounded-lg border p-3\">\n                  <span class=\"text-muted-foreground block text-xs\">Effective Discount</span>\n                  <span class=\"text-success text-success text-base font-bold tabular-nums\">\n                    {{ fmtPercent(calculations().effectiveDiscountPct) }}\n                  </span>\n                  <span class=\"text-muted-foreground block text-xs\">Savings vs Series A</span>\n                </div>\n\n                <div class=\"bg-muted/40 rounded-lg border p-3\">\n                  <span class=\"text-muted-foreground block text-xs\">Implied Series A Value</span>\n                  <span class=\"text-foreground text-base font-bold tabular-nums\">\n                    {{ fmtCurrencyWhole(calculations().impliedSeriesAValue) }}\n                  </span>\n                  <span class=\"text-success text-success block text-xs tabular-nums\">\n                    +{{ fmtCurrencyWhole(calculations().valueGain) }} ({{\n                      calculations().paperRoiMultiple.toFixed(2)\n                    }}x)\n                  </span>\n                </div>\n              </div>\n\n              <ui-separator />\n\n              <!-- Visual Equity Distribution Bar -->\n              <div class=\"space-y-2.5\">\n                <div class=\"flex items-center justify-between text-xs font-medium\">\n                  <span class=\"text-foreground\">Founders vs. SAFE Investor</span>\n                  <span class=\"text-muted-foreground tabular-nums\">\n                    {{ fmtPercent(calculations().founderOwnershipPct) }} /\n                    {{ fmtPercent(calculations().safeOwnershipPct) }}\n                  </span>\n                </div>\n                <div class=\"bg-muted relative flex h-3 w-full overflow-hidden rounded-full shadow-inner\">\n                  <div class=\"bg-primary h-full transition-[width] duration-300\" [style.width]=\"founderBarWidth\"></div>\n                  <div class=\"bg-success h-full transition-[width] duration-300\" [style.width]=\"safeBarWidth\"></div>\n                </div>\n                <div\n                  class=\"text-muted-foreground flex flex-col gap-1.5 text-xs sm:flex-row sm:items-center sm:justify-between\"\n                >\n                  <div class=\"flex items-center gap-1.5\">\n                    <span class=\"bg-primary size-2 shrink-0 rounded-full\"></span>\n                    <span>\n                      Founders: {{ fmtPercent(calculations().founderOwnershipPct) }} ({{\n                        fmtNumber(calculations().founderShares)\n                      }}\n                      sh)\n                    </span>\n                  </div>\n                  <div class=\"flex items-center gap-1.5\">\n                    <span class=\"bg-success size-2 shrink-0 rounded-full\"></span>\n                    <span>\n                      SAFE: {{ fmtPercent(calculations().safeOwnershipPct) }} ({{\n                        fmtNumber(calculations().safeShares)\n                      }}\n                      sh)\n                    </span>\n                  </div>\n                </div>\n              </div>\n\n              <ui-separator />\n\n              <!-- Post-Conversion Dilution Breakdown Table -->\n              <div class=\"space-y-2\">\n                <span class=\"text-foreground text-xs font-semibold tracking-wider uppercase\">\n                  Post-Conversion Dilution Breakdown\n                </span>\n                <div class=\"overflow-hidden rounded-lg border\">\n                  <div class=\"overflow-x-auto\">\n                    <table ui-table density=\"compact\">\n                      <thead ui-table-header>\n                        <tr ui-table-row>\n                          <th ui-table-head class=\"text-xs\">Stakeholder</th>\n                          <th ui-table-head class=\"text-right text-xs\">Ownership</th>\n                          <th ui-table-head class=\"text-right text-xs\">Shares</th>\n                          <th ui-table-head class=\"text-right text-xs\">Implied Value</th>\n                        </tr>\n                      </thead>\n                      <tbody ui-table-body>\n                        <tr ui-table-row>\n                          <td ui-table-cell class=\"text-xs font-medium\">Founders & Existing</td>\n                          <td ui-table-cell class=\"text-right text-xs font-medium tabular-nums\">\n                            {{ fmtPercent(calculations().founderOwnershipPct) }}\n                          </td>\n                          <td ui-table-cell class=\"text-right text-xs tabular-nums\">\n                            {{ fmtNumber(calculations().founderShares) }}\n                          </td>\n                          <td ui-table-cell class=\"text-right text-xs tabular-nums\">\n                            {{ fmtCurrencyWhole(calculations().founderShares * calculations().seriesAPricePerShare) }}\n                          </td>\n                        </tr>\n                        <tr ui-table-row>\n                          <td ui-table-cell class=\"text-success text-xs font-medium\">SAFE Seed Investors</td>\n                          <td ui-table-cell class=\"text-success text-success text-right text-xs font-bold tabular-nums\">\n                            {{ fmtPercent(calculations().safeOwnershipPct) }}\n                          </td>\n                          <td ui-table-cell class=\"text-right text-xs font-semibold tabular-nums\">\n                            {{ fmtNumber(calculations().safeShares) }}\n                          </td>\n                          <td ui-table-cell class=\"text-right text-xs font-semibold tabular-nums\">\n                            {{ fmtCurrencyWhole(calculations().impliedSeriesAValue) }}\n                          </td>\n                        </tr>\n                      </tbody>\n                      <tfoot ui-table-footer>\n                        <tr ui-table-row>\n                          <td ui-table-cell class=\"text-xs font-bold\">Total Post-SAFE</td>\n                          <td ui-table-cell class=\"text-right text-xs font-bold tabular-nums\">100.00%</td>\n                          <td ui-table-cell class=\"text-right text-xs font-bold tabular-nums\">\n                            {{ fmtNumber(calculations().totalShares) }}\n                          </td>\n                          <td ui-table-cell class=\"text-right text-xs font-bold tabular-nums\">\n                            {{ fmtCurrencyWhole(seriesAPreMoney()) }}\n                          </td>\n                        </tr>\n                      </tfoot>\n                    </table>\n                  </div>\n                </div>\n              </div>\n\n              <ui-separator />\n\n              <!-- Key SAFE Takeaways Checklist -->\n              <ul class=\"text-muted-foreground space-y-2 text-xs\">\n                <li class=\"flex items-center gap-2\">\n                  <lucide-icon [img]=\"CheckCircle2\" class=\"text-primary size-3.5 shrink-0\" />\n                  <span>Post-money cap fixes ownership before Series A round</span>\n                </li>\n                <li class=\"flex items-center gap-2\">\n                  <lucide-icon [img]=\"CheckCircle2\" class=\"text-primary size-3.5 shrink-0\" />\n                  <span>Converts to Preferred Stock with investor liquidation preference</span>\n                </li>\n                <li class=\"flex items-center gap-2\">\n                  <lucide-icon [img]=\"CheckCircle2\" class=\"text-primary size-3.5 shrink-0\" />\n                  <span>No debt maturity dates, no interest accrual compounding</span>\n                </li>\n              </ul>\n            </div>\n\n            <div ui-card-footer class=\"flex flex-col gap-2.5 pt-2\">\n              <button ui-button class=\"w-full gap-2 font-semibold shadow-xs\" size=\"lg\" (click)=\"copySummary()\">\n                @if (copied()) {\n                  <lucide-icon [img]=\"Check\" class=\"text-success size-4\" />\n                } @else {\n                  <lucide-icon [img]=\"Copy\" class=\"size-4\" />\n                }\n                {{ copied() ? 'Copied Summary to Clipboard!' : 'Copy Valuation Breakdown' }}\n              </button>\n              <button ui-button variant=\"outline\" class=\"w-full gap-2\" size=\"default\">\n                <lucide-icon [img]=\"FileSpreadsheet\" class=\"size-4\" />\n                Export Cap Table Summary\n              </button>\n            </div>\n          </div>\n        </div>\n      </div>\n\n      <!-- Bottom Section: Series A Valuation Sensitivity Table -->\n      <div ui-card>\n        <div ui-card-header class=\"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between\">\n          <div>\n            <h3 ui-card-title class=\"flex items-center gap-2\">\n              <lucide-icon [img]=\"TrendingUp\" class=\"text-primary size-5\" />\n              Series A Qualified Financing Sensitivity Matrix\n            </h3>\n            <p ui-card-description>\n              Simulate how SAFE investor ownership percentage, share price, and conversion mechanism respond across\n              different next-round valuations.\n            </p>\n          </div>\n        </div>\n        <div ui-card-content>\n          <div class=\"overflow-x-auto\">\n            <table ui-table density=\"cozy\">\n              <thead ui-table-header>\n                <tr ui-table-row>\n                  <th ui-table-head>Series A Valuation</th>\n                  <th ui-table-head class=\"text-right\">Series A Price</th>\n                  <th ui-table-head class=\"text-right\">SAFE Conversion Price</th>\n                  <th ui-table-head>Governing Term</th>\n                  <th ui-table-head class=\"text-right\">Shares Issued</th>\n                  <th ui-table-head class=\"text-right\">SAFE Ownership</th>\n                  <th ui-table-head class=\"text-right\">Effective Savings</th>\n                  <th ui-table-head class=\"text-right\">Implied Stake Value</th>\n                </tr>\n              </thead>\n              <tbody ui-table-body>\n                @for (row of scenarioResults(); track row.valuation) {\n                  <tr ui-table-row [class]=\"row.isCurrentTarget ? 'bg-primary/5 font-medium' : ''\">\n                    <td ui-table-cell class=\"font-medium\">\n                      <div class=\"flex items-center gap-2\">\n                        <span class=\"tabular-nums\">{{ fmtCurrencyWhole(row.valuation) }}</span>\n                        @if (row.isCurrentTarget) {\n                          <span ui-badge wrap variant=\"default\" class=\"h-5 px-1.5 text-xs\"> Current Target </span>\n                        }\n                      </div>\n                    </td>\n                    <td ui-table-cell class=\"text-right tabular-nums\">{{ fmtCurrency(row.seriesAPrice) }}</td>\n                    <td ui-table-cell class=\"text-foreground text-right font-semibold tabular-nums\">\n                      {{ fmtCurrency(row.convPrice) }}\n                    </td>\n                    <td ui-table-cell>\n                      <span ui-badge variant=\"outline\" [class]=\"scenarioBadgeClass(row.mechanism)\">\n                        {{ row.mechanism }}\n                      </span>\n                    </td>\n                    <td ui-table-cell class=\"text-right tabular-nums\">{{ fmtNumber(row.issuedShares) }}</td>\n                    <td ui-table-cell class=\"text-foreground text-right font-bold tabular-nums\">\n                      {{ fmtPercent(row.ownershipPct) }}\n                    </td>\n                    <td ui-table-cell class=\"text-success text-success text-right font-medium tabular-nums\">\n                      {{ fmtPercent(row.effectiveDiscount) }}\n                    </td>\n                    <td ui-table-cell class=\"text-right font-semibold tabular-nums\">\n                      {{ fmtCurrencyWhole(row.impliedValue) }}\n                    </td>\n                  </tr>\n                }\n              </tbody>\n            </table>\n          </div>\n        </div>\n      </div>\n\n      <!-- Post-Money SAFE Legal & Governance Guide -->\n      <div class=\"grid grid-cols-1 gap-4 sm:grid-cols-3\">\n        <div ui-card class=\"p-4\">\n          <div class=\"flex items-start gap-3\">\n            <div class=\"bg-primary/10 text-primary mt-0.5 rounded-md p-2\">\n              <lucide-icon [img]=\"ShieldCheck\" class=\"size-4\" />\n            </div>\n            <div class=\"space-y-1\">\n              <h4 class=\"text-foreground text-sm font-semibold\">Post-Money Cap Protection</h4>\n              <p class=\"text-muted-foreground text-xs leading-relaxed\">\n                Acts as an ownership percentage guarantee for seed investors prior to the priced round, regardless of\n                subsequent SAFE issuances.\n              </p>\n            </div>\n          </div>\n        </div>\n\n        <div ui-card class=\"p-4\">\n          <div class=\"flex items-start gap-3\">\n            <div class=\"bg-success/10 text-success mt-0.5 rounded-md p-2\">\n              <lucide-icon [img]=\"Percent\" class=\"size-4\" />\n            </div>\n            <div class=\"space-y-1\">\n              <h4 class=\"text-foreground text-sm font-semibold\">Discount Rate Safety Net</h4>\n              <p class=\"text-muted-foreground text-xs leading-relaxed\">\n                Protects investors if Series A prices below the valuation cap, guaranteeing a 15%–25% discount off the\n                institutional share price.\n              </p>\n            </div>\n          </div>\n        </div>\n\n        <div ui-card class=\"p-4\">\n          <div class=\"flex items-start gap-3\">\n            <div class=\"bg-warning/10 text-warning mt-0.5 rounded-md p-2\">\n              <lucide-icon [img]=\"PieChart\" class=\"size-4\" />\n            </div>\n            <div class=\"space-y-1\">\n              <h4 class=\"text-foreground text-sm font-semibold\">Founder Dilution Transparency</h4>\n              <p class=\"text-muted-foreground text-xs leading-relaxed\">\n                YC v1.1 post-money SAFEs dilute only founders and common shareholders, eliminating pre-money SAFE\n                circular dilution surprises.\n              </p>\n            </div>\n          </div>\n        </div>\n      </div>\n    </div>\n  `,\n})\nexport class UiSafeNoteCalculatorComponent {\n  protected readonly BadgePercent = BadgePercent\n  protected readonly Check = Check\n  protected readonly CheckCircle2 = CheckCircle2\n  protected readonly Copy = Copy\n  protected readonly DollarSign = DollarSign\n  protected readonly FileSpreadsheet = FileSpreadsheet\n  protected readonly Layers = Layers\n  protected readonly Percent = Percent\n  protected readonly PieChart = PieChart\n  protected readonly Scale = Scale\n  protected readonly ShieldCheck = ShieldCheck\n  protected readonly TrendingUp = TrendingUp\n\n  protected readonly investmentMarks = INVESTMENT_MARKS\n  protected readonly valuationCapMarks = VALUATION_CAP_MARKS\n  protected readonly discountRateMarks = DISCOUNT_RATE_MARKS\n  protected readonly seriesAMarks = SERIES_A_MARKS\n  protected readonly quickInvestments = [250000, 500000, 1000000, 1500000, 2000000, 3000000]\n  protected readonly capBenchmarks = [5000000, 8000000, 12000000, 15000000, 20000000, 30000000]\n  protected readonly standardRates = [10, 15, 20, 25, 30]\n  protected readonly shareCounts = [5000000, 8000000, 10000000, 12000000, 15000000]\n  protected readonly seriesABenchmarks = [15000000, 20000000, 25000000, 35000000, 50000000, 75000000]\n\n  protected readonly investTooltip = (val: number): string => `$${val.toLocaleString('en-US')}`\n  protected readonly currencyTooltip = (val: number): string => `$${val.toLocaleString('en-US')}`\n  protected readonly discountTooltip = (val: number): string => `${val}% Discount`\n\n  @Input('class') className?: string\n\n  readonly selectedPreset = signal<RoundPreset>('seed-standard')\n  readonly investmentAmount = signal(1_000_000)\n  readonly valuationCap = signal(15_000_000)\n  readonly hasDiscount = signal(true)\n  readonly discountRate = signal(20)\n  readonly companyCapitalization = signal(10_000_000)\n  readonly seriesAPreMoney = signal(25_000_000)\n  readonly copied = signal(false)\n\n  private copyTimer: ReturnType<typeof setTimeout> | undefined\n\n  constructor() {\n    inject(DestroyRef).onDestroy(() => clearTimeout(this.copyTimer))\n  }\n\n  handlePresetChange(value: string): void {\n    const presetId = value as RoundPreset\n    this.selectedPreset.set(presetId)\n    const preset = PRESETS[presetId]\n    if (preset) {\n      this.investmentAmount.set(preset.investment)\n      this.valuationCap.set(preset.valuationCap)\n      this.hasDiscount.set(preset.hasDiscount)\n      this.discountRate.set(preset.discountRate)\n      this.companyCapitalization.set(preset.shares)\n      this.seriesAPreMoney.set(preset.seriesAPreMoney)\n    }\n  }\n\n  // Core SAFE conversion economics\n  readonly calculations = computed(() => {\n    const inv = Math.max(1, this.investmentAmount())\n    const cap = Math.max(1, this.valuationCap())\n    const shares = Math.max(1, this.companyCapitalization())\n    const seriesA = Math.max(1, this.seriesAPreMoney())\n    const disc = this.hasDiscount() ? Math.max(0, Math.min(99, this.discountRate())) : 0\n\n    // Series A unqualified price per share\n    const seriesAPricePerShare = seriesA / shares\n\n    // Cap conversion price per share\n    const capPricePerShare = cap / shares\n\n    // Discount conversion price per share\n    const discountPricePerShare = this.hasDiscount() ? seriesAPricePerShare * (1 - disc / 100) : seriesAPricePerShare\n\n    // In YC Post-Money SAFE, investor converts at the lower of Cap Price or Discount Price\n    let conversionPrice = capPricePerShare\n    let governingMechanism: 'cap' | 'discount' = 'cap'\n\n    if (this.hasDiscount() && discountPricePerShare < capPricePerShare) {\n      conversionPrice = discountPricePerShare\n      governingMechanism = 'discount'\n    } else {\n      conversionPrice = capPricePerShare\n      governingMechanism = 'cap'\n    }\n\n    // Converted shares issued\n    const safeShares = conversionPrice > 0 ? Math.round(inv / conversionPrice) : 0\n\n    // Equity percentage calculation\n    const safeOwnershipPct = Math.min(100, Math.max(0, (safeShares / shares) * 100))\n    const founderShares = Math.max(0, shares - safeShares)\n    const founderOwnershipPct = Math.max(0, 100 - safeOwnershipPct)\n\n    // Effective discount achieved vs Series A price\n    const effectiveDiscountPct =\n      seriesAPricePerShare > 0\n        ? Math.max(0, ((seriesAPricePerShare - conversionPrice) / seriesAPricePerShare) * 100)\n        : 0\n\n    // Implied Value of SAFE stake at Series A price\n    const impliedSeriesAValue = safeShares * seriesAPricePerShare\n    const valueGain = Math.max(0, impliedSeriesAValue - inv)\n    const paperRoiMultiple = inv > 0 ? impliedSeriesAValue / inv : 1\n\n    return {\n      seriesAPricePerShare,\n      capPricePerShare,\n      discountPricePerShare,\n      conversionPrice,\n      governingMechanism,\n      safeShares,\n      founderShares,\n      totalShares: shares,\n      safeOwnershipPct,\n      founderOwnershipPct,\n      effectiveDiscountPct,\n      impliedSeriesAValue,\n      valueGain,\n      paperRoiMultiple,\n    }\n  })\n\n  // Sensitivity scenarios across different Series A pre-money valuations\n  readonly scenarioResults = computed(() => {\n    const inv = Math.max(1, this.investmentAmount())\n    const cap = Math.max(1, this.valuationCap())\n    const shares = Math.max(1, this.companyCapitalization())\n    const disc = this.hasDiscount() ? Math.max(0, Math.min(99, this.discountRate())) : 0\n\n    return SCENARIO_VALUATIONS.map((scenarioValuation) => {\n      const seriesAPrice = scenarioValuation / shares\n      const capPrice = cap / shares\n      const discountPrice = this.hasDiscount() ? seriesAPrice * (1 - disc / 100) : seriesAPrice\n\n      let convPrice = capPrice\n      let mechanism = 'Valuation Cap'\n      if (this.hasDiscount() && discountPrice < capPrice) {\n        convPrice = discountPrice\n        mechanism = `Discount (${disc}%)`\n      }\n\n      const issuedShares = convPrice > 0 ? Math.round(inv / convPrice) : 0\n      const ownershipPct = (issuedShares / shares) * 100\n      const effectiveDiscount = seriesAPrice > 0 ? Math.max(0, ((seriesAPrice - convPrice) / seriesAPrice) * 100) : 0\n      const impliedValue = issuedShares * seriesAPrice\n      const isCurrentTarget = scenarioValuation === this.seriesAPreMoney()\n\n      return {\n        valuation: scenarioValuation,\n        seriesAPrice,\n        convPrice,\n        mechanism,\n        issuedShares,\n        ownershipPct,\n        effectiveDiscount,\n        impliedValue,\n        isCurrentTarget,\n      }\n    })\n  })\n\n  get rootClass(): string {\n    return cn('mx-auto w-full max-w-6xl space-y-8 p-4 sm:p-6 lg:p-8', this.className)\n  }\n\n  get governingBadgeClass(): string {\n    return cn(\n      this.calculations().governingMechanism === 'cap'\n        ? 'bg-primary/10 text-primary border-primary/20 text-xs font-semibold'\n        : 'border-success/20 bg-success/10 text-success text-xs font-semibold',\n    )\n  }\n\n  get founderBarWidth(): string {\n    return `${this.calculations().founderOwnershipPct}%`\n  }\n\n  get safeBarWidth(): string {\n    return `${this.calculations().safeOwnershipPct}%`\n  }\n\n  scenarioBadgeClass(mechanism: string): string {\n    return cn(\n      mechanism === 'Valuation Cap'\n        ? 'border-primary/20 bg-primary/10 text-primary text-xs'\n        : 'border-success/20 bg-success/10 text-success text-xs',\n    )\n  }\n\n  quickInvestLabel(amt: number): string {\n    return amt >= 1000000 ? `$${(amt / 1000000).toFixed(amt % 1000000 === 0 ? 0 : 1)}M` : `$${amt / 1000}K`\n  }\n\n  fmtCurrency(val: number): string {\n    return new Intl.NumberFormat('en-US', {\n      style: 'currency',\n      currency: 'USD',\n      minimumFractionDigits: 2,\n      maximumFractionDigits: 2,\n    }).format(val || 0)\n  }\n\n  fmtCurrencyWhole(val: number): string {\n    return new Intl.NumberFormat('en-US', {\n      style: 'currency',\n      currency: 'USD',\n      minimumFractionDigits: 0,\n      maximumFractionDigits: 0,\n    }).format(val || 0)\n  }\n\n  fmtPercent(val: number, decimals = 2): string {\n    return `${(val || 0).toFixed(decimals)}%`\n  }\n\n  fmtNumber(val: number): string {\n    return new Intl.NumberFormat('en-US', { maximumFractionDigits: 0 }).format(val || 0)\n  }\n\n  copySummary(): void {\n    const c = this.calculations()\n    const text = `YC Post-Money SAFE Conversion Summary:\n- Investment Amount: ${this.fmtCurrency(this.investmentAmount())}\n- Valuation Cap: ${this.fmtCurrency(this.valuationCap())}\n- Series A Target: ${this.fmtCurrency(this.seriesAPreMoney())} Pre-Money\n- Investor Ownership: ${this.fmtPercent(c.safeOwnershipPct)} (${this.fmtNumber(c.safeShares)} shares)\n- Conversion Price: ${this.fmtCurrency(c.conversionPrice)} / share (vs Series A ${this.fmtCurrency(c.seriesAPricePerShare)})\n- Effective Discount: ${this.fmtPercent(c.effectiveDiscountPct)}\n- Governing Term: ${c.governingMechanism === 'cap' ? 'Valuation Cap' : 'Discount Rate'}`\n\n    try {\n      navigator.clipboard?.writeText(text)\n    } catch {\n      // Clipboard unavailable in some contexts; the copied state still confirms the action.\n    }\n    this.copied.set(true)\n    clearTimeout(this.copyTimer)\n    this.copyTimer = setTimeout(() => {\n      this.copied.set(false)\n    }, 2000)\n  }\n}\n",
      "type": "registry:block",
      "target": "~/src/app/components/blocks/safe-note-calculator/safe-note-calculator.component.ts"
    },
    {
      "path": "packages/registry-angular/blocks/safe-note-calculator/index.ts",
      "content": "export {\n  UiSafeNoteCalculatorComponent,\n  PRESETS,\n  type RoundPreset,\n  type PresetConfig,\n} from './safe-note-calculator.component'\n",
      "type": "registry:block",
      "target": "~/src/app/components/blocks/safe-note-calculator/index.ts"
    }
  ],
  "dependencies": [
    "lucide-angular"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://uipkge.dev/r/angular/badge.json",
    "https://uipkge.dev/r/angular/button.json",
    "https://uipkge.dev/r/angular/card.json",
    "https://uipkge.dev/r/angular/input.json",
    "https://uipkge.dev/r/angular/separator.json",
    "https://uipkge.dev/r/angular/slider.json",
    "https://uipkge.dev/r/angular/switch.json",
    "https://uipkge.dev/r/angular/table.json",
    "https://uipkge.dev/r/angular/tabs.json"
  ],
  "description": "Y Combinator Post-Money SAFE note valuation, conversion share price, effective discount, and cap table equity dilution simulator with interactive parameter controls and Series A financing sensitivity matrix.",
  "categories": [
    "finance",
    "legal",
    "billing"
  ]
}