Initial commit of BlackDice ROI toolkit

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-10-13 17:04:40 +05:00
co-authored by Claude Sonnet 5
commit a69e127331
51 changed files with 4950 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
# ── CRM provider(s) ─────────────────────────────────────────────
# One or more of: hubspot, salesforce, webhook (comma-separated)
# Leave empty to run without a CRM (submissions are logged to the browser console).
VITE_CRM_PROVIDER=
# Shown in the CRM as the lead source / campaign
VITE_LEAD_SOURCE=Operator ROI Toolkit – Oct 2026 Campaign
# Reject gmail/outlook/etc. on the registration form (true/false)
VITE_BLOCK_FREE_EMAIL=true
# ── HubSpot ─────────────────────────────────────────────────────
VITE_HUBSPOT_PORTAL_ID=
VITE_HUBSPOT_FORM_GUID=
# Optional separate form for ROI figures (defaults to the form above)
VITE_HUBSPOT_ROI_FORM_GUID=
# EU data-centre portals: https://api-eu1.hsforms.com
VITE_HUBSPOT_API_BASE=https://api.hsforms.com
# ── Salesforce Web-to-Lead ──────────────────────────────────────
VITE_SALESFORCE_ORG_ID=
# Web-to-Lead creates a NEW lead per post; only enable if duplicate rules merge them
VITE_SALESFORCE_SEND_ROI=false
# ── Webhook (Zapier / Make / n8n / Power Automate / own API) ───
VITE_CRM_WEBHOOK_URL=
# ── PowerPoint report ───────────────────────────────────────────
# Path of the ROI slide inside the .pptx (change only if the slide order changes)
VITE_ROI_SLIDE_PATH=ppt/slides/slide12.xml
+34
View File
@@ -0,0 +1,34 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Secrets — never commit real credentials, only .env.example
.env
.env.*
!.env.example
server/node_modules
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# Not part of the published app
public/standalone.html
public.zip
+8
View File
@@ -0,0 +1,8 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["react", "oxc"],
"rules": {
"react/rules-of-hooks": "error",
"react/only-export-components": ["warn", { "allowConstantExport": true }]
}
}
+112
View File
@@ -0,0 +1,112 @@
# BlackDice Operator ROI Toolkit — campaign landing page
React (Vite) port of `BlackDice_Campaign_Landing_Page.html`:
1. **Intro + registration form** → lead is sent to your CRM
2. **Strategy deck** viewer (15 slides) + plain PPTX download
3. **ROI calculator** → *Download My ROI Report* generates the deck **in the browser** with the
visitor's figures written into slide 12 ("Total estimate annual savings") and
"Prepared for {Company}" on the subtitle. ROI figures are also sent to the CRM against the lead.
Slide 12 in the published deck carries **example figures** (an indicative operator). Until a
visitor completes the calculator, *Download Deck (PPTX)* gives them that example deck; once they
have entered their own numbers, both download buttons give the personalised version.
The site itself is static — no server needed. (An optional lead database lives in `server/`.)
## Run locally
```bash
npm install
cp .env.example .env # fill in CRM settings
npm run dev # http://localhost:5173
```
## Deploy (own server / any static host)
```bash
npm run build
```
Upload the **contents of `dist/`** to any folder on your web server. Paths are relative, so it
works at `/` or in a sub-folder (e.g. `blackdice.ai/roi-toolkit/`).
`.env` values are baked in at build time — rebuild after changing them.
On Webflow: host `dist/` on a sub-domain (e.g. `toolkit.blackdice.ai`) or embed it via an iframe;
Webflow can't host a multi-file React build directly.
## CRM setup
Set `VITE_CRM_PROVIDER` (you can combine, e.g. `hubspot,webhook`). Field names are mapped in
`src/config/crm.config.js`.
| Provider | What you need | Notes |
|---|---|---|
| **HubSpot** | Portal ID + Form GUID (Marketing → Forms → your form → Embed) | Create the contact properties listed in `crm.config.js` (`operator_region`, `subscriber_base_band`, `roi_total_low`, `roi_bandwidth`, …) and add them (hidden) to the form. ROI submission updates the same contact by email. Add the HubSpot tracking code in `index.html` to link page views. |
| **Salesforce** | Org ID (Setup → Company Information) | Web-to-Lead. Region/subscriber band go into Description unless you add custom field IDs in `crm.config.js`. ROI posts are off by default because each post creates a new lead. |
| **Webhook** | A URL (Zapier "Catch Hook", Make, n8n…) | Receives JSON with `event: "toolkit_registration"` and `event: "roi_report_downloaded"` — route to any CRM, Google Sheet, Slack, etc. The endpoint must allow CORS (Zapier/Make do). |
Also captured automatically: UTM parameters (`utm_source`, `utm_campaign`, …, `gclid`, `li_fat_id`),
page URL, referrer. A hidden honeypot field filters most bots.
CRM failures never block the visitor (max 6 s wait); errors are logged to the console.
## Updating the deck
- Template: `public/deck/BlackDice_Strategy_Deck.pptx` — web-optimised copy of
`2026_2309_BlackDice_LeadGen_Deck_V4.pptx` (large photos downscaled, 20 MB → 4.6 MB; slides unchanged).
- **ROI slide (slide 12):** the six result boxes are found by shape name in PowerPoint's
Selection Pane — `TextBox 4` = total, `TextBox 10`–`TextBox 14` = categories 1–5. Each box
has two lines (label, value); the **value line is overwritten**, so you can put any example
figures there. Keep the box names and the two-line layout. Older decks with `$XX to $XX`
placeholders still work.
- **Subtitle (`TextBox 5`):** a leading "Example" is removed and "Prepared for {Company} ·" added.
- Figures in the deck use the deck's style (`$65k`, `$3.60m`, `$1.20bn`); the web page uses `$65K`, `$3.60M`.
- If you move the ROI slide, update `VITE_ROI_SLIDE_PATH`.
- **Registration form → slide 3:** the optional "The device on your network" dropdown offers
subscriber bands (Under 500k … 50M+) or *Enter exact number…*. The choice is the big number on
slide 3 straight away — a band shows as a range (`10m–50m`, set in 36pt so it fits), an exact
number as `5.5m`. An exact number also pre-fills *Active subscribers* in the calculator; once the
calculator has a count, that figure is used on slide 3 instead. Sent to the CRM as
`subscriber_base_band` (always) and `active_subscribers` (exact number only). The options are
in `DEVICE_OPTIONS` at the top of `src/components/Landing.jsx` (and `DEVICE_DECK_LABELS` in
`standalone.html`).
- **Slide 3 — active subscribers:** the box named `DeviceCount` (the big number above
"The device on your network") shows the operator's active subscribers in the deck's style
(`25m`, `5.5m`, `850k`). The published deck shows the example `25m`, which matches the
example figures on slide 12. If you move that slide, update `VITE_DEVICE_SLIDE_PATH`.
- Slide preview images: `public/img/slides/slide-01.jpg` … `slide-15.jpg` (960×541). Re-export
any slide you change in the deck (PowerPoint: File → Export → JPEG) and resize to 960×541.
## Standalone version
`public/standalone.html` is a no-build, no-React copy of the whole toolkit (needs
`public/jszip.min.js` beside it). It mirrors the deck logic in `src/lib/` — **if you change
`slideXml.js`, `calc.js` or `pptxReport.js`, make the same change there.** It has no CRM wiring.
Everything in `public/` is published by `npm run build`; delete `standalone.html` and
`jszip.min.js` from `public/` if you don't want them on the live site.
## Lead database (optional)
`server/` is a small Express + SQL service that receives the webhook events
(`POST /api/webhook`). Point `VITE_CRM_WEBHOOK_URL` at it and set `VITE_CRM_PROVIDER=webhook`.
## Project map
```
src/
App.jsx registration state (persists in localStorage)
components/Landing.jsx hero, "inside the toolkit", registration form
components/Toolkit.jsx welcome bar + tabs
components/DeckViewer.jsx slide viewer + deck download (example or personalised)
components/Calculator.jsx ROI calculator + personalised report download
lib/calc.js ROI maths (identical to the original page) + deck formatting
lib/crm.js HubSpot / Salesforce / webhook submission
lib/pptxReport.js builds the personalised .pptx (JSZip, lazy-loaded)
lib/slideXml.js writes values into the ROI slide
config/crm.config.js CRM field mapping
public/
deck/ deck template (V4)
img/ logo, backgrounds, slide previews
standalone.html no-build copy of the toolkit
server/ optional lead database
```
+19
View File
@@ -0,0 +1,19 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Turn Network Protection into Competitive Advantage | BlackDice</title>
<meta name="description" content="Free operator toolkit: a 15-slide strategy deck and an interactive ROI calculator to quantify the commercial value of blocking malicious traffic on your network." />
<link rel="icon" type="image/svg+xml" href="./favicon.svg" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link href="https://fonts.googleapis.com/css2?family=Ubuntu:wght@300;400;500;700&display=swap" rel="stylesheet" />
<!-- Optional: HubSpot tracking code (sets the hubspotutk cookie so form submissions link to page views).
<script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/YOUR_PORTAL_ID.js"></script>
-->
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
+1362
View File
File diff suppressed because it is too large Load Diff
+24
View File
@@ -0,0 +1,24 @@
{
"name": "blackdice-roi-toolkit",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "oxlint",
"preview": "vite preview"
},
"dependencies": {
"jszip": "^3.10.2",
"react": "^19.2.8",
"react-dom": "^19.2.8"
},
"devDependencies": {
"@types/react": "^19.2.18",
"@types/react-dom": "^19.2.7",
"@vitejs/plugin-react": "^6.1.1",
"oxlint": "^1.81.0",
"vite": "^8.3.0"
}
}
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><rect width="32" height="32" rx="7" fill="#013B49"/><path d="M16 6l8.7 5v10L16 26l-8.7-5V11z" fill="none" stroke="#35B888" stroke-width="2.4" stroke-linejoin="round"/></svg>

After

Width:  |  Height:  |  Size: 234 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

+13
View File
File diff suppressed because one or more lines are too long
+14
View File
@@ -0,0 +1,14 @@
# DigitalOcean managed MySQL connection
DB_HOST=
DB_PORT=25060
DB_USER=
DB_PASSWORD=
DB_NAME=defaultdb
# Optional: path to the downloaded cluster CA cert for full TLS verification.
# Leave empty to just encrypt the connection (matches sslmode=REQUIRED).
DB_CA_PATH=
# Comma-separated list of origins allowed to call this API (your static site's domain).
ALLOWED_ORIGIN=https://toolkit.blackdice.ai
PORT=8080
+26
View File
@@ -0,0 +1,26 @@
import fs from 'node:fs';
import mysql from 'mysql2/promise';
const { DB_HOST, DB_PORT = '25060', DB_USER, DB_PASSWORD, DB_NAME = 'defaultdb', DB_CA_PATH } = process.env;
if (!DB_HOST || !DB_USER || !DB_PASSWORD) {
throw new Error('Missing DB_HOST / DB_USER / DB_PASSWORD env vars (see .env.example)');
}
// sslmode=REQUIRED on DigitalOcean managed MySQL means "encrypt, don't verify the
// server certificate". Set DB_CA_PATH to the downloaded cluster CA cert to upgrade
// to full verification (sslmode=VERIFY-CA equivalent).
const ssl = DB_CA_PATH ? { ca: fs.readFileSync(DB_CA_PATH) } : { rejectUnauthorized: false };
export const pool = mysql.createPool({
host: DB_HOST,
port: Number(DB_PORT),
user: DB_USER,
password: DB_PASSWORD,
database: DB_NAME,
ssl,
waitForConnections: true,
connectionLimit: 5,
maxIdle: 5,
idleTimeout: 60_000,
});
+96
View File
@@ -0,0 +1,96 @@
import 'dotenv/config';
import cors from 'cors';
import express from 'express';
import { pool } from './db.js';
const app = express();
const allowedOrigins = (process.env.ALLOWED_ORIGIN || '').split(',').map((s) => s.trim()).filter(Boolean);
app.use(cors({ origin: allowedOrigins.length ? allowedOrigins : '*' }));
app.use(express.json({ limit: '256kb' }));
app.get('/api/health', async (_req, res) => {
try {
await pool.query('SELECT 1');
res.json({ ok: true });
} catch (err) {
res.status(500).json({ ok: false, error: err.message });
}
});
// Matches the payload shape already sent by src/lib/crm.js's webhook provider
// (event: 'toolkit_registration' | 'roi_report_downloaded'), so no frontend
// changes are needed beyond pointing VITE_CRM_WEBHOOK_URL at this endpoint.
app.post('/api/webhook', async (req, res) => {
const { event, lead, roi, utm = {}, leadSource, submittedAt, pageUri, referrer } = req.body || {};
if (!lead?.email) return res.status(400).json({ ok: false, error: 'lead.email is required' });
try {
if (event === 'toolkit_registration') {
await upsertLead({ lead, leadSource, utm, pageUri, referrer, submittedAt });
} else if (event === 'roi_report_downloaded') {
await upsertLead({ lead, submittedAt });
await insertRoi({ lead, roi, submittedAt });
} else {
return res.status(400).json({ ok: false, error: `Unknown event: ${event}` });
}
res.json({ ok: true });
} catch (err) {
console.error('[db] write failed:', err);
res.status(500).json({ ok: false, error: 'Internal error' });
}
});
async function upsertLead({ lead, leadSource, utm = {}, pageUri, referrer, submittedAt }) {
await pool.query(
`INSERT INTO leads (email, first_name, last_name, company, title, region, subscriber_band,
lead_source, utm_source, utm_medium, utm_campaign, utm_term, utm_content, gclid, fbclid, li_fat_id,
page_uri, referrer, submitted_at)
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
ON DUPLICATE KEY UPDATE
first_name = COALESCE(VALUES(first_name), first_name),
last_name = COALESCE(VALUES(last_name), last_name),
company = COALESCE(VALUES(company), company),
title = COALESCE(VALUES(title), title),
region = COALESCE(VALUES(region), region),
subscriber_band = COALESCE(VALUES(subscriber_band), subscriber_band),
lead_source = COALESCE(VALUES(lead_source), lead_source),
utm_source = COALESCE(VALUES(utm_source), utm_source),
utm_medium = COALESCE(VALUES(utm_medium), utm_medium),
utm_campaign = COALESCE(VALUES(utm_campaign), utm_campaign),
utm_term = COALESCE(VALUES(utm_term), utm_term),
utm_content = COALESCE(VALUES(utm_content), utm_content),
gclid = COALESCE(VALUES(gclid), gclid),
fbclid = COALESCE(VALUES(fbclid), fbclid),
li_fat_id = COALESCE(VALUES(li_fat_id), li_fat_id),
page_uri = COALESCE(VALUES(page_uri), page_uri),
referrer = COALESCE(VALUES(referrer), referrer),
submitted_at = VALUES(submitted_at)`,
[
lead.email, lead.first ?? null, lead.last ?? null, lead.company ?? null, lead.title ?? null,
lead.region ?? null, lead.subs ?? null, leadSource ?? null, utm.utm_source ?? null,
utm.utm_medium ?? null, utm.utm_campaign ?? null, utm.utm_term ?? null, utm.utm_content ?? null,
utm.gclid ?? null, utm.fbclid ?? null, utm.li_fat_id ?? null, pageUri ?? null, referrer ?? null,
new Date(submittedAt || Date.now()),
]
);
}
async function insertRoi({ lead, roi, submittedAt }) {
const { inputs = {}, formatted = {}, results = {} } = roi || {};
await pool.query(
`INSERT INTO roi_submissions (lead_email, total_low, total_high, bandwidth_savings, support_calls_savings,
churn_savings, equipment_savings, ddos_savings, subscribers, arpu, churn_rate, pricing_region, downloaded_at)
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)`,
[
lead.email, results?.total?.lo ?? null, results?.total?.hi ?? null, formatted.bw ?? null,
formatted.calls ?? null, formatted.churn ?? null, formatted.equip ?? null, formatted.ddos ?? null,
inputs.subs ?? null, inputs.arpu ?? null, inputs.churn ?? null, inputs.regionLabel ?? null,
new Date(submittedAt || Date.now()),
]
);
}
const port = process.env.PORT || 8080;
app.listen(port, () => console.log(`BlackDice ROI toolkit API listening on :${port}`));
+15
View File
@@ -0,0 +1,15 @@
import 'dotenv/config';
import fs from 'node:fs';
import { pool } from './db.js';
const sql = fs.readFileSync(new URL('./schema.sql', import.meta.url), 'utf8');
const statements = sql.split(';').map((s) => s.trim()).filter(Boolean);
for (const statement of statements) {
await pool.query(statement);
console.log('Ran:', statement.split('\n')[0], '...');
}
console.log('Migration complete.');
await pool.end();
+999
View File
@@ -0,0 +1,999 @@
{
"name": "blackdice-roi-toolkit-api",
"version": "0.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "blackdice-roi-toolkit-api",
"version": "0.0.0",
"dependencies": {
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"express": "^4.21.2",
"mysql2": "^3.11.5"
}
},
"node_modules/@types/node": {
"version": "26.6.4",
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.4.tgz",
"integrity": "sha512-ldVPDCzj7fsaGZrLB0NuHuTvJcsNasysBAqMolr/cgxrLd1xbqxIr3XJiPnHHJUCxj5sNF1vnRj9aWnrVh5Jcg==",
"license": "MIT",
"peer": true,
"dependencies": {
"undici-types": "~8.9.0"
}
},
"node_modules/accepts": {
"version": "1.3.8",
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
"integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",
"license": "MIT",
"dependencies": {
"mime-types": "~2.1.34",
"negotiator": "0.6.3"
},
"engines": {
"node": ">= 0.6"
}
},
"node_modules/array-flatten": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
"integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==",
"license": "MIT"
},
"node_modules/aws-ssl-profiles": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/aws-ssl-profiles/-/aws-ssl-profiles-1.1.2.tgz",
"integrity": "sha512-NZKeq9AfyQvEeNlN0zSYAaWrmBffJh3IELMZfRpJVWgrpEbtEpnjvzqBPf+mxoI287JohRDoa+/nsfqqiZmF6g==",
"license": "MIT",
"engines": {
"node": ">= 6.0.0"
}
},
"node_modules/body-parser": {
"version": "1.20.8",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.8.tgz",
"integrity": "sha512-JNcyFQ64OiijEkPzUBTCe+hyPXUD/3LEldGQ6iF5LR1w00mx9o7xtDWHXBY2iItjdCFGoilOLNQbH943ut7pHA==",
"license": "MIT",
"dependencies": {
"bytes": "~3.1.2",
"content-type": "~1.0.5",
"debug": "2.6.9",
"depd": "2.0.0",
"destroy": "~1.2.0",
"http-errors": "~2.0.1",
"iconv-lite": "~0.4.24",
"on-finished": "~2.4.1",
"qs": "~6.16.0",
"raw-body": "~2.5.3",
"type-is": "~1.6.18",
"unpipe": "~1.0.0"
},
"engines": {
"node": ">= 0.8",
"npm": "1.2.8000 || >= 1.4.16"
}
},
"node_modules/bytes": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
"integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
"license": "MIT",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/call-bind-apply-helpers": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
"integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
"license": "MIT",
"dependencies": {
"es-errors": "^1.3.0",
"function-bind": "^1.1.2"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/call-bound": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",
"integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
"license": "MIT",
"dependencies": {
"call-bind-apply-helpers": "^1.0.2",
"get-intrinsic": "^1.3.0"
},
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/content-disposition": {
"version": "0.5.4",
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
"integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==",
"license": "MIT",
"dependencies": {
"safe-buffer": "5.2.1"
},
"engines": {
"node": ">= 0.6"
}
},
"node_modules/content-type": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",
"integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
"license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/cookie": {
"version": "0.7.2",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",
"integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
"license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/cookie-signature": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz",
"integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==",
"license": "MIT"
},
"node_modules/cors": {
"version": "2.8.6",
"resolved": "https://registry.npmjs.org/cors/-/cors-2.8.6.tgz",
"integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==",
"license": "MIT",
"dependencies": {
"object-assign": "^4",
"vary": "^1"
},
"engines": {
"node": ">= 0.10"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/express"
}
},
"node_modules/debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"license": "MIT",
"dependencies": {
"ms": "2.0.0"
}
},
"node_modules/depd": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
"integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
"license": "MIT",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/destroy": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz",
"integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==",
"license": "MIT",
"engines": {
"node": ">= 0.8",
"npm": "1.2.8000 || >= 1.4.16"
}
},
"node_modules/dotenv": {
"version": "16.6.1",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz",
"integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==",
"license": "BSD-2-Clause",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://dotenvx.com"
}
},
"node_modules/dunder-proto": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
"integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
"license": "MIT",
"dependencies": {
"call-bind-apply-helpers": "^1.0.1",
"es-errors": "^1.3.0",
"gopd": "^1.2.0"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/ee-first": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
"license": "MIT"
},
"node_modules/encodeurl": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
"integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
"license": "MIT",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/es-define-property": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
"integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
"license": "MIT",
"engines": {
"node": ">= 0.4"
}
},
"node_modules/es-errors": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
"integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
"license": "MIT",
"engines": {
"node": ">= 0.4"
}
},
"node_modules/es-object-atoms": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz",
"integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==",
"license": "MIT",
"dependencies": {
"es-errors": "^1.3.0"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/escape-html": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
"integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
"license": "MIT"
},
"node_modules/etag": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
"integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
"license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/express": {
"version": "4.22.3",
"resolved": "https://registry.npmjs.org/express/-/express-4.22.3.tgz",
"integrity": "sha512-Bdcs4+3qlpVlx2NRn6fgX2Ue2/gGRaPeawebgclM0ERSCqDpA+owF1fdPwjJUTAJWMTuAaxjDf+hzb0/4eKvvw==",
"license": "MIT",
"dependencies": {
"accepts": "~1.3.8",
"array-flatten": "1.1.1",
"body-parser": "~1.20.5",
"content-disposition": "~0.5.4",
"content-type": "~1.0.4",
"cookie": "~0.7.1",
"cookie-signature": "~1.0.6",
"debug": "2.6.9",
"depd": "2.0.0",
"encodeurl": "~2.0.0",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"finalhandler": "~1.3.1",
"fresh": "~0.5.2",
"http-errors": "~2.0.0",
"merge-descriptors": "1.0.3",
"methods": "~1.1.2",
"on-finished": "~2.4.1",
"parseurl": "~1.3.3",
"path-to-regexp": "~0.1.13",
"proxy-addr": "~2.0.7",
"qs": "~6.16.0",
"range-parser": "~1.2.1",
"safe-buffer": "5.2.1",
"send": "~0.19.0",
"serve-static": "~1.16.2",
"setprototypeof": "1.2.0",
"statuses": "~2.0.1",
"type-is": "~1.6.18",
"utils-merge": "1.0.1",
"vary": "~1.1.2"
},
"engines": {
"node": ">= 0.10.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/express"
}
},
"node_modules/finalhandler": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.2.tgz",
"integrity": "sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==",
"license": "MIT",
"dependencies": {
"debug": "2.6.9",
"encodeurl": "~2.0.0",
"escape-html": "~1.0.3",
"on-finished": "~2.4.1",
"parseurl": "~1.3.3",
"statuses": "~2.0.2",
"unpipe": "~1.0.0"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/forwarded": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
"integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
"license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/fresh": {
"version": "0.5.2",
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
"integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==",
"license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/function-bind": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
"license": "MIT",
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/generate-function": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz",
"integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==",
"license": "MIT",
"dependencies": {
"is-property": "^1.0.2"
}
},
"node_modules/get-intrinsic": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
"integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
"license": "MIT",
"dependencies": {
"call-bind-apply-helpers": "^1.0.2",
"es-define-property": "^1.0.1",
"es-errors": "^1.3.0",
"es-object-atoms": "^1.1.1",
"function-bind": "^1.1.2",
"get-proto": "^1.0.1",
"gopd": "^1.2.0",
"has-symbols": "^1.1.0",
"hasown": "^2.0.2",
"math-intrinsics": "^1.1.0"
},
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/get-proto": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
"integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
"license": "MIT",
"dependencies": {
"dunder-proto": "^1.0.1",
"es-object-atoms": "^1.0.0"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/gopd": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
"integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
"license": "MIT",
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/has-symbols": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
"integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
"license": "MIT",
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/hasown": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz",
"integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==",
"license": "MIT",
"dependencies": {
"function-bind": "^1.1.2"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/http-errors": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz",
"integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==",
"license": "MIT",
"dependencies": {
"depd": "~2.0.0",
"inherits": "~2.0.4",
"setprototypeof": "~1.2.0",
"statuses": "~2.0.2",
"toidentifier": "~1.0.1"
},
"engines": {
"node": ">= 0.8"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/express"
}
},
"node_modules/iconv-lite": {
"version": "0.4.24",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
"license": "MIT",
"dependencies": {
"safer-buffer": ">= 2.1.2 < 3"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
"license": "ISC"
},
"node_modules/ipaddr.js": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
"integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
"license": "MIT",
"engines": {
"node": ">= 0.10"
}
},
"node_modules/is-property": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz",
"integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==",
"license": "MIT"
},
"node_modules/long": {
"version": "5.3.2",
"resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz",
"integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==",
"license": "Apache-2.0"
},
"node_modules/lru.min": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/lru.min/-/lru.min-1.1.5.tgz",
"integrity": "sha512-5J9ysMYUpYIg9RF2vJpy9SinEmSviFSe0GyPpCQ4L5QSkLAgeLXlTAOu2ZwWUU5m+0SBl6gUU1R1ZQB3aKypfA==",
"license": "MIT",
"engines": {
"bun": ">=1.0.0",
"deno": ">=1.30.0",
"node": ">=8.0.0"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/wellwelwel"
}
},
"node_modules/math-intrinsics": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
"integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
"license": "MIT",
"engines": {
"node": ">= 0.4"
}
},
"node_modules/media-typer": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
"integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==",
"license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/merge-descriptors": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz",
"integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==",
"license": "MIT",
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/methods": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
"integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==",
"license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/mime": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
"license": "MIT",
"bin": {
"mime": "cli.js"
},
"engines": {
"node": ">=4"
}
},
"node_modules/mime-db": {
"version": "1.52.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
"license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/mime-types": {
"version": "2.1.35",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
"license": "MIT",
"dependencies": {
"mime-db": "1.52.0"
},
"engines": {
"node": ">= 0.6"
}
},
"node_modules/ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
"license": "MIT"
},
"node_modules/mysql2": {
"version": "3.24.5",
"resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.24.5.tgz",
"integrity": "sha512-X6Ujsr2QSkkLpkQGjxzpKRAPn9nu4axpR63ntBzquFVEvPOArgbUQ1sJjFKI7hnaYtiVZxa17Z7q18KSubW0IQ==",
"license": "MIT",
"dependencies": {
"aws-ssl-profiles": "^1.1.2",
"generate-function": "^2.3.1",
"iconv-lite": "^0.7.3",
"long": "^5.3.2",
"lru.min": "^1.1.4",
"named-placeholders": "^1.1.6",
"sql-escaper": "^1.5.1"
},
"engines": {
"node": ">= 8.0"
},
"peerDependencies": {
"@types/node": ">= 8"
}
},
"node_modules/mysql2/node_modules/iconv-lite": {
"version": "0.7.3",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.3.tgz",
"integrity": "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==",
"license": "MIT",
"dependencies": {
"safer-buffer": ">= 2.1.2 < 3.0.0"
},
"engines": {
"node": ">=0.10.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/express"
}
},
"node_modules/named-placeholders": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.6.tgz",
"integrity": "sha512-Tz09sEL2EEuv5fFowm419c1+a/jSMiBjI9gHxVLrVdbUkkNUUfjsVYs9pVZu5oCon/kmRh9TfLEObFtkVxmY0w==",
"license": "MIT",
"dependencies": {
"lru.min": "^1.1.0"
},
"engines": {
"node": ">=8.0.0"
}
},
"node_modules/negotiator": {
"version": "0.6.3",
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
"integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==",
"license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/object-assign": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/object-inspect": {
"version": "1.13.4",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
"integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
"license": "MIT",
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/on-finished": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
"integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
"license": "MIT",
"dependencies": {
"ee-first": "1.1.1"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/parseurl": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
"integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
"license": "MIT",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/path-to-regexp": {
"version": "0.1.13",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.13.tgz",
"integrity": "sha512-A/AGNMFN3c8bOlvV9RreMdrv7jsmF9XIfDeCd87+I8RNg6s78BhJxMu69NEMHBSJFxKidViTEdruRwEk/WIKqA==",
"license": "MIT"
},
"node_modules/proxy-addr": {
"version": "2.0.8",
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.8.tgz",
"integrity": "sha512-5nnx0yGyVUcY6t9RnWcARWtwT9F1D8O9rt08htPvnd49W1IgZtmLkhu9WfMzQj1cFxjHIO6connUNVW5k7AVyQ==",
"license": "MIT",
"dependencies": {
"forwarded": "0.2.0",
"ipaddr.js": "1.9.1"
},
"engines": {
"node": ">= 0.10"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/express"
}
},
"node_modules/qs": {
"version": "6.16.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.16.0.tgz",
"integrity": "sha512-h6fhOIaRrID2CbEY2fqs+7t+UXZo+MLAnU5gRIq85uFtdiUPCdsApMlHhXogKVM4HM2DVbIjGNTTYH2OcmP1vA==",
"license": "BSD-3-Clause",
"dependencies": {
"es-define-property": "^1.0.1",
"side-channel": "^1.1.1"
},
"engines": {
"node": ">=0.6"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/range-parser": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
"integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
"license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/raw-body": {
"version": "2.5.3",
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.3.tgz",
"integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==",
"license": "MIT",
"dependencies": {
"bytes": "~3.1.2",
"http-errors": "~2.0.1",
"iconv-lite": "~0.4.24",
"unpipe": "~1.0.0"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"license": "MIT"
},
"node_modules/safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
"license": "MIT"
},
"node_modules/send": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/send/-/send-0.19.2.tgz",
"integrity": "sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==",
"license": "MIT",
"dependencies": {
"debug": "2.6.9",
"depd": "2.0.0",
"destroy": "1.2.0",
"encodeurl": "~2.0.0",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"fresh": "~0.5.2",
"http-errors": "~2.0.1",
"mime": "1.6.0",
"ms": "2.1.3",
"on-finished": "~2.4.1",
"range-parser": "~1.2.1",
"statuses": "~2.0.2"
},
"engines": {
"node": ">= 0.8.0"
}
},
"node_modules/send/node_modules/ms": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
"license": "MIT"
},
"node_modules/serve-static": {
"version": "1.16.3",
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.3.tgz",
"integrity": "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==",
"license": "MIT",
"dependencies": {
"encodeurl": "~2.0.0",
"escape-html": "~1.0.3",
"parseurl": "~1.3.3",
"send": "~0.19.1"
},
"engines": {
"node": ">= 0.8.0"
}
},
"node_modules/setprototypeof": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
"integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==",
"license": "ISC"
},
"node_modules/side-channel": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz",
"integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==",
"license": "MIT",
"dependencies": {
"es-errors": "^1.3.0",
"object-inspect": "^1.13.4",
"side-channel-list": "^1.0.1",
"side-channel-map": "^1.0.1",
"side-channel-weakmap": "^1.0.2"
},
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/side-channel-list": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz",
"integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==",
"license": "MIT",
"dependencies": {
"es-errors": "^1.3.0",
"object-inspect": "^1.13.4"
},
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/side-channel-map": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz",
"integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
"license": "MIT",
"dependencies": {
"call-bound": "^1.0.2",
"es-errors": "^1.3.0",
"get-intrinsic": "^1.2.5",
"object-inspect": "^1.13.3"
},
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/side-channel-weakmap": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
"integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
"license": "MIT",
"dependencies": {
"call-bound": "^1.0.2",
"es-errors": "^1.3.0",
"get-intrinsic": "^1.2.5",
"object-inspect": "^1.13.3",
"side-channel-map": "^1.0.1"
},
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/sql-escaper": {
"version": "1.5.2",
"resolved": "https://registry.npmjs.org/sql-escaper/-/sql-escaper-1.5.2.tgz",
"integrity": "sha512-6CKD38c31SENivxOADeMNLdukOnUxUcflKtzVWzace7Riv1v7cAEym5Cx9Q7gYZ3ezIJI7ZpqecQq8cqNeSSFg==",
"license": "MIT",
"engines": {
"bun": ">=1.0.0",
"deno": ">=2.0.0",
"node": ">=12.0.0"
},
"funding": {
"type": "github",
"url": "https://github.com/mysqljs/sql-escaper?sponsor=1"
}
},
"node_modules/statuses": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz",
"integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==",
"license": "MIT",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/toidentifier": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
"integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
"license": "MIT",
"engines": {
"node": ">=0.6"
}
},
"node_modules/type-is": {
"version": "1.6.18",
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
"integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
"license": "MIT",
"dependencies": {
"media-typer": "0.3.0",
"mime-types": "~2.1.24"
},
"engines": {
"node": ">= 0.6"
}
},
"node_modules/undici-types": {
"version": "8.9.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz",
"integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==",
"license": "MIT",
"peer": true
},
"node_modules/unpipe": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
"integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
"license": "MIT",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/utils-merge": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
"integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==",
"license": "MIT",
"engines": {
"node": ">= 0.4.0"
}
},
"node_modules/vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
"integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
"license": "MIT",
"engines": {
"node": ">= 0.8"
}
}
}
}
+16
View File
@@ -0,0 +1,16 @@
{
"name": "blackdice-roi-toolkit-api",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"start": "node index.js",
"migrate": "node migrate.js"
},
"dependencies": {
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"express": "^4.21.2",
"mysql2": "^3.11.5"
}
}
+43
View File
@@ -0,0 +1,43 @@
CREATE TABLE IF NOT EXISTS leads (
id INT AUTO_INCREMENT PRIMARY KEY,
email VARCHAR(255) NOT NULL,
first_name VARCHAR(100),
last_name VARCHAR(100),
company VARCHAR(255),
title VARCHAR(255),
region VARCHAR(100),
subscriber_band VARCHAR(100),
lead_source VARCHAR(255),
utm_source VARCHAR(255),
utm_medium VARCHAR(255),
utm_campaign VARCHAR(255),
utm_term VARCHAR(255),
utm_content VARCHAR(255),
gclid VARCHAR(255),
fbclid VARCHAR(255),
li_fat_id VARCHAR(255),
page_uri TEXT,
referrer TEXT,
submitted_at DATETIME NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
UNIQUE KEY uq_leads_email (email)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS roi_submissions (
id INT AUTO_INCREMENT PRIMARY KEY,
lead_email VARCHAR(255) NOT NULL,
total_low DECIMAL(14,2),
total_high DECIMAL(14,2),
bandwidth_savings VARCHAR(100),
support_calls_savings VARCHAR(100),
churn_savings VARCHAR(100),
equipment_savings VARCHAR(100),
ddos_savings VARCHAR(100),
subscribers INT,
arpu DECIMAL(10,2),
churn_rate DECIMAL(5,2),
pricing_region VARCHAR(100),
downloaded_at DATETIME NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT fk_roi_lead_email FOREIGN KEY (lead_email) REFERENCES leads(email) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+49
View File
@@ -0,0 +1,49 @@
import { useEffect, useState } from 'react';
import Nav from './components/Nav.jsx';
import Footer from './components/Footer.jsx';
import Landing from './components/Landing.jsx';
import Toolkit from './components/Toolkit.jsx';
import { captureUtm, submitLead } from './lib/crm.js';
const REG_KEY = 'bd_toolkit_registrant';
function loadRegistrant() {
try {
return JSON.parse(localStorage.getItem(REG_KEY) || 'null');
} catch {
return null;
}
}
export default function App() {
const [registrant, setRegistrant] = useState(loadRegistrant);
useEffect(() => {
captureUtm(); // store campaign params on first landing
}, []);
async function handleRegister(reg, { skipCrm } = {}) {
if (!skipCrm) await submitLead(reg); // waits max SUBMIT_TIMEOUT_MS, never throws
try { localStorage.setItem(REG_KEY, JSON.stringify(reg)); } catch { /* storage unavailable */ }
setRegistrant(reg);
window.dataLayer?.push({ event: 'toolkit_registration' }); // GTM hook, if present
window.scrollTo({ top: 0, behavior: 'smooth' });
}
function handleReset() {
try {
localStorage.removeItem(REG_KEY);
localStorage.removeItem('bd_toolkit_calc_inputs');
} catch { /* ignore */ }
setRegistrant(null);
window.scrollTo({ top: 0 });
}
return (
<>
<Nav />
{registrant ? <Toolkit registrant={registrant} onReset={handleReset} /> : <Landing onRegister={handleRegister} />}
<Footer />
</>
);
}
+337
View File
@@ -0,0 +1,337 @@
import { useEffect, useMemo, useState } from 'react';
import { asset } from '../lib/asset.js';
import { calculate, ddosCostFromSlider, fmt, fmtRange, formatForDeck, INPUTS_KEY, loadInputs, regionLabel, REGIONS } from '../lib/calc.js';
import { buildPersonalisedDeck, prefetchTemplate, triggerDownload } from '../lib/pptxReport.js';
import { submitRoi } from '../lib/crm.js';
const Icon = {
globe: <svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="10" /><path d="M2 12h20M12 2a15.3 15.3 0 010 20M12 2a15.3 15.3 0 000 20" /></svg>,
phone: <svg viewBox="0 0 24 24"><path d="M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07A19.5 19.5 0 013.09 10.8a19.79 19.79 0 01-3.07-8.63A2 2 0 012 0h3a2 2 0 012 1.72c.127.96.361 1.903.7 2.81a2 2 0 01-.45 2.11L6.09 7.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0122 14.92z" /></svg>,
users: <svg viewBox="0 0 24 24"><path d="M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2" /><circle cx="9" cy="7" r="4" /><path d="M23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75" /></svg>,
server: <svg viewBox="0 0 24 24"><rect x="2" y="2" width="20" height="8" rx="2" ry="2" /><rect x="2" y="14" width="20" height="8" rx="2" ry="2" /><line x1="6" y1="6" x2="6.01" y2="6" /><line x1="6" y1="18" x2="6.01" y2="18" /></svg>,
shield: <svg viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" /></svg>,
download: <svg viewBox="0 0 24 24"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4" /><polyline points="7 10 12 15 17 10" /><line x1="12" y1="15" x2="12" y2="3" /></svg>,
};
function CardHeader({ icon, green, num, title, subtitle }) {
return (
<div className="card-header">
<div className={`card-icon${green ? ' green' : ''}`}>{icon}</div>
<div>
<div className="card-num">{num}</div>
<div className="card-title">{title}</div>
<div className="card-subtitle">{subtitle}</div>
</div>
</div>
);
}
const rangePct = (val, min, max) => `${(((val - min) / (max - min)) * 100).toFixed(1)}%`;
export default function Calculator({ registrant, active }) {
const [i, setI] = useState(() => loadInputs(registrant));
const [showAssump, setShowAssump] = useState(false);
const [report, setReport] = useState({ state: 'idle', msg: '' }); // idle | busy | done | error
const update = (patch) => {
setI((s) => ({ ...s, ...patch, touched: true }));
setReport((s) => (s.state === 'busy' ? s : { state: 'idle', msg: '' })); // clear stale "downloaded" note
};
const set = (k) => (e) => update({ [k]: e.target.value });
const r = useMemo(() => calculate(i), [i]);
// Remember inputs for this visitor (survives refresh)
useEffect(() => {
try { localStorage.setItem(INPUTS_KEY, JSON.stringify(i)); } catch { /* storage unavailable */ }
}, [i]);
// Warm the template cache while the user fills in the calculator
useEffect(() => {
if (active) prefetchTemplate().catch(() => {});
}, [active]);
const rows = [
['bw', 'dot-grey', '① Bandwidth savings', 'Enter subscriber count and region'],
['calls', 'dot-green', '② Support call reduction', 'Enter subscriber count and call volume'],
['churn', 'dot-teal', '③ Churn reduction', 'Enter ARPU and churn rate'],
['equip', 'dot-blue', '④ Network equipment', 'Enter infrastructure OpEx (optional)'],
['ddos', 'dot-orange', '⑤ DDoS avoided costs', 'No incidents entered'],
];
async function downloadReport() {
if (!r.complete || report.state === 'busy') return;
setReport({ state: 'busy', msg: 'Building your personalised deck…' });
const formatted = formatForDeck(i, r, registrant);
const company = registrant?.company || 'Your Company';
// Send ROI figures to CRM in parallel (never blocks the download)
submitRoi(registrant, {
inputs: {
subs: i.subs, arpu: i.arpu, churn: i.churn, netOpex: i.netOpex, ddosIncidents: i.ddos,
callsPer1000: i.callsPer1000, callCost: i.callCost, securityPct: i.securityPct,
bandwidthPricePerGb: i.region === 'custom' ? i.customPrice : i.region,
regionLabel: regionLabel(i.region), scenario: i.scenario,
},
results: r,
formatted,
}).catch(() => {});
try {
const blob = await buildPersonalisedDeck(formatted, { company, date: registrant?.date });
triggerDownload(blob, `BlackDice_ROI_Report_${company.replace(/[^a-z0-9]+/gi, '_')}.pptx`);
setReport({ state: 'done', msg: 'Your personalised report has downloaded. Your figures are on slide 12.' });
} catch (err) {
console.error(err);
setReport({ state: 'error', msg: 'Sorry, we couldn’t build your report. Please try again in a moment.' });
}
}
const reportNote =
report.msg || (r.complete ? 'Your personalised report is ready to download.' : 'Complete the calculator above to unlock your personalised report.');
return (
<div className="calc-tab-wrap">
<div className="calc-tab-header">
<h2>Network Protection ROI Calculator</h2>
<p>Enter your operator data below. Results update in real time. Once complete, download your personalised report.</p>
</div>
<div className="rank-bar">
<div className="rank-bar-inner">
<span className="rank-label">Savings by section</span>
{['Bandwidth', 'Support calls', 'Churn reduction', 'Network equipment', 'DDoS (optional)'].map((t, n) => (
<span key={t} style={{ display: 'contents' }}>
{n > 0 && <span className="rank-sep">›</span>}
<span className="rank-item"><span className="num">{n + 1}</span> {t}</span>
</span>
))}
</div>
</div>
<main className="main">
<div className="input-col">
{/* CARD 1 */}
<div className="card">
<CardHeader icon={Icon.globe} num="Section 1" title="Your network" subtitle="Subscriber base and regional bandwidth pricing" />
<div className="field-row">
<div className="field-group">
<label htmlFor="subs">Active subscribers</label>
<input type="number" id="subs" placeholder="e.g. 5000000" min="0" value={i.subs} onChange={set('subs')} />
<div className="field-hint">Total active mobile and broadband subscribers</div>
</div>
<div className="field-group">
<label htmlFor="region">Country / region</label>
<select id="region" value={i.region} onChange={set('region')}>
{REGIONS.map((g) => (
<optgroup key={g.group} label={g.group}>
{g.options.map((o) => <option key={o.value} value={o.value}>{o.label}</option>)}
</optgroup>
))}
<option value="custom">Other: enter price below</option>
</select>
</div>
</div>
{i.region === 'custom' && (
<div className="field-group">
<label htmlFor="custom-price">Custom bandwidth price ($ per GB)</label>
<div className="input-wrap has-prefix">
<span className="input-prefix">$</span>
<input type="number" id="custom-price" placeholder="0.0050" step="0.0001" min="0" value={i.customPrice} onChange={set('customPrice')} />
</div>
<div className="field-hint">Source: TeleGeography IP transit pricing. Use your actual wholesale price for the most accurate result.</div>
</div>
)}
<div className="field-group">
<label>Bandwidth saving scenario</label>
<div className="scenario-tabs">
{[['cautious', 'Cautious', 15], ['expected', 'Expected', 37], ['optimistic', 'Optimistic', 80]].map(([k, t, kb]) => (
<button key={k} type="button" className={`scenario-tab${i.scenario === k ? ' active' : ''}`} onClick={() => update({ scenario: k })}>
{t}<br /><small style={{ fontWeight: 400, fontSize: 10 }}>{kb} KB / block</small>
</button>
))}
</div>
<div className="field-hint">
Based on BlackDice customer data: 8,000 blocks/subscriber/month across adverts, trackers, malware and phishing. Traffic per block varies by mix. Lead with Expected, show Cautious as the proven floor. Source: BlackDice internal methodology, September 2026.
</div>
</div>
</div>
{/* CARD 2 */}
<div className="card highlight">
<CardHeader icon={Icon.phone} green num="Section 2" title="Support call reduction" subtitle="Infected and advert-hammered devices drive helpdesk volume" />
<div className="field-row">
<div className="field-group">
<label htmlFor="calls-per-1000">Monthly support calls per 1,000 subs</label>
<input type="number" id="calls-per-1000" placeholder="18" min="0" value={i.callsPer1000} onChange={set('callsPer1000')} />
<div className="field-hint">Industry average: 15–25 calls per 1,000 subs/month</div>
</div>
<div className="field-group">
<label htmlFor="call-cost">Average cost per call ($)</label>
<div className="input-wrap has-prefix">
<span className="input-prefix">$</span>
<input type="number" id="call-cost" placeholder="8" min="0" value={i.callCost} onChange={set('callCost')} />
</div>
<div className="field-hint">Telecoms average: $5–$15 per call</div>
</div>
</div>
<div className="field-group">
<label htmlFor="security-pct">% of calls related to security, malware or connectivity issues</label>
<div className="slider-val">{i.securityPct}%</div>
<input type="range" id="security-pct" min="5" max="60" step="5" value={i.securityPct} onChange={set('securityPct')} style={{ '--pct': rangePct(i.securityPct, 5, 60) }} />
<div className="slider-labels"><span>5%</span><span>60%</span></div>
<div className="field-hint">
BlackDice blocks malware, phishing and advert-hammering: the main sources of unexplained slow device complaints and failed connection calls. Adjust to reflect your own support call categorisation.
</div>
</div>
</div>
{/* CARD 3 */}
<div className="card">
<CardHeader icon={Icon.users} num="Section 3" title="Subscriber value and churn" subtitle="Quantify the revenue impact of retaining more customers" />
<div className="field-row">
<div className="field-group">
<label htmlFor="arpu">Monthly ARPU ($)</label>
<div className="input-wrap has-prefix">
<span className="input-prefix">$</span>
<input type="number" id="arpu" placeholder="e.g. 12" min="0" value={i.arpu} onChange={set('arpu')} />
</div>
<div className="field-hint">Average revenue per user per month</div>
</div>
<div className="field-group">
<label htmlFor="churn">Current annual churn rate (%)</label>
<div className="input-wrap has-suffix">
<input type="number" id="churn" placeholder="e.g. 18" min="0" max="100" value={i.churn} onChange={set('churn')} />
<span className="input-suffix">%</span>
</div>
<div className="field-hint">Annual subscriber churn as a percentage</div>
</div>
</div>
<div className="field-hint" style={{ marginTop: -8, padding: '10px 12px', background: '#f0f8f4', borderRadius: 8, border: '1px solid rgba(53,184,136,0.2)' }}>
<strong style={{ color: 'var(--teal)' }}>How this is calculated:</strong> Network protection is associated with a 0.3–0.6% reduction in annual churn (customers are less likely to blame their operator for bad experiences caused by malware, fraud calls and ad-hammered devices). Each retained subscriber is worth ARPU × 12 months.
</div>
</div>
{/* CARD 4 */}
<div className="card">
<CardHeader icon={Icon.server} num="Section 4" title="Network infrastructure" subtitle="Optional: junk traffic elimination reduces equipment load" />
<div className="opt-note">
Malware and tracker traffic consists of millions of tiny connections rather than large downloads. The stateful connection-tracking equipment that handles this is expensive to run and scale. Reducing junk connections typically lowers utilisation by 2–4%, deferring capacity upgrades.
</div>
<div className="field-group">
<label htmlFor="net-opex">Annual network infrastructure / equipment OpEx ($)</label>
<div className="input-wrap has-prefix">
<span className="input-prefix">$</span>
<input type="number" id="net-opex" placeholder="Optional" min="0" value={i.netOpex} onChange={set('netOpex')} />
</div>
<div className="field-hint">Leave blank to exclude this category from your total</div>
</div>
</div>
{/* CARD 5 */}
<div className="card">
<CardHeader icon={Icon.shield} num="Section 5" title="DDoS avoided costs" subtitle="Optional: enter 0 if unknown" />
<div className="field-row">
<div className="field-group">
<label htmlFor="ddos">DDoS incidents per year</label>
<input type="number" id="ddos" placeholder="0" min="0" value={i.ddos} onChange={set('ddos')} />
</div>
<div className="field-group">
<label htmlFor="ddos-slider">Cost assumption</label>
<div className="slider-val">${Math.round(ddosCostFromSlider(i.ddosSlider) / 1000)}K per incident</div>
<input type="range" id="ddos-slider" min="0" max="100" step="1" value={i.ddosSlider} onChange={set('ddosSlider')} style={{ marginTop: 8, '--pct': `${i.ddosSlider}%` }} />
<div className="slider-labels"><span>$408K</span><span>$1.2M</span></div>
</div>
</div>
<div className="field-hint">Industry range $408K–$1.2M per incident (Forrester / Ponemon Institute). Results show the full low–high range regardless of this setting.</div>
</div>
</div>
{/* RESULTS */}
<div className="results-col">
<div className="results-card">
<div className="results-header">
<div className="results-header-hex" style={{ backgroundImage: `url(${asset('img/results-hex.png')})` }} />
<h2>Estimated annual savings</h2>
<p>Updates in real time as you enter your figures</p>
</div>
<div className="results-body">
<div className="total-block">
<div className="total-label">Total potential savings</div>
<div className="total-amount" aria-live="polite">
{r.complete ? (
<>
<span>{fmt(r.total.lo)}</span>
<span className="total-sep"> to </span>
<span>{fmt(r.total.hi)}</span>
</>
) : (
<span>—</span>
)}
</div>
<div className="total-sub">{r.complete ? 'estimated annual savings range' : 'Enter your network details above'}</div>
</div>
<div className="breakdown">
{rows.map(([k, dot, name, empty]) => {
const txt = fmtRange(r[k].lo, r[k].hi);
return (
<div className="brow" key={k}>
<span className={`brow-dot ${dot}`} />
<div className="brow-info">
<div className="brow-name">{name}</div>
<div className="brow-val">{txt ? <span>{txt}</span> : <span className="muted">{empty}</span>}</div>
</div>
</div>
);
})}
</div>
<div className="assump-section">
<button type="button" className={`assump-toggle${showAssump ? ' open' : ''}`} onClick={() => setShowAssump((v) => !v)}>
<svg viewBox="0 0 24 24" strokeWidth="2"><polyline points="6 9 12 15 18 9" /></svg>
View sources and methodology
</button>
<div className={`assump-list${showAssump ? ' vis' : ''}`}>
<strong style={{ color: 'var(--lgrey)' }}>Bandwidth</strong><br />
8,000 blocks/subscriber/month (BlackDice customer data)<br />
Traffic per block: 15 KB (cautious) / 37 KB (expected) / 80 KB (optimistic)<br />
Regional pricing: TeleGeography IP transit pricing, Q2 2026<br />
Busy-hour factor: 2.5× daily average (standard mobile)<br /><br />
<strong style={{ color: 'var(--lgrey)' }}>Support calls</strong><br />
Reduction rate: 60–70% of security-related calls eliminated<br />
Industry call volume: 15–25 calls per 1,000 subs/month<br />
Average call cost: $5–$15 (telecoms industry)<br /><br />
<strong style={{ color: 'var(--lgrey)' }}>Churn</strong><br />
Protection-linked churn reduction: 0.3–0.6% annually<br />
McKinsey B2B Telco Survey 2025; GSMA Intelligence 2024<br /><br />
<strong style={{ color: 'var(--lgrey)' }}>Network equipment</strong><br />
Junk traffic reduction lowers equipment utilisation by 2–4%<br /><br />
<strong style={{ color: 'var(--lgrey)' }}>DDoS</strong><br />
$408K–$1.2M per incident (Forrester / Ponemon Institute)<br /><br />
<em>All figures are indicative. Actual savings will vary by network architecture, traffic mix, and existing controls.</em>
</div>
</div>
</div>
</div>
</div>
</main>
<div className="disclaimer" style={{ marginTop: 24 }}>
<strong>Important:</strong> This calculator provides indicative estimates based on BlackDice internal customer data, TeleGeography IP transit pricing (Q2 2026), the Communications Fraud Control Association, Forrester Research, Ponemon Institute, McKinsey B2B Telco Survey 2025, and GSMA Intelligence. Bandwidth savings represent capacity the operator never has to carry, not a guaranteed reduction in existing contracted wholesale costs. Figures should be used as a starting point for commercial conversations, not as a guarantee of savings. Operator-specific results will depend on network architecture, traffic mix, subscriber behaviour, and existing security controls.
</div>
<div className="lp-report-bar">
<div className="lp-report-bar-text">
<h4>Download your personalised ROI report</h4>
<p>A branded PowerPoint deck with your operator's estimated annual saving across all five categories, ready to share with your finance or commercial team.</p>
<p className={`report-note${report.state === 'error' ? ' report-error' : ''}`} aria-live="polite">{reportNote}</p>
</div>
<button className={`report-dl-btn${report.state === 'busy' ? ' busy' : ''}`} onClick={downloadReport} disabled={!r.complete || report.state === 'busy'}>
{Icon.download}
{report.state === 'busy' ? 'Preparing…' : 'Download My ROI Report'}
</button>
</div>
</div>
);
}
+97
View File
@@ -0,0 +1,97 @@
import { useEffect, useRef, useState } from 'react';
import { asset } from '../lib/asset.js';
import { calculate, formatForDeck, loadInputs } from '../lib/calc.js';
import { buildPersonalisedDeck, getExampleDeck, prefetchTemplate, triggerDownload } from '../lib/pptxReport.js';
const SLIDE_COUNT = 15;
const slides = Array.from({ length: SLIDE_COUNT }, (_, i) => asset(`img/slides/slide-${String(i + 1).padStart(2, '0')}.jpg`));
export default function DeckViewer({ active, registrant }) {
const [cur, setCur] = useState(0);
const [busy, setBusy] = useState(false);
const thumbsRef = useRef(null);
const go = (n) => setCur(Math.max(0, Math.min(SLIDE_COUNT - 1, n)));
async function downloadDeck() {
if (busy) return;
setBusy(true);
try {
const i = loadInputs(registrant);
const r = calculate(i);
const values = formatForDeck(i, r, registrant);
const meta = { company: registrant?.company || 'Your Company', date: registrant?.date };
// Slide 3 shows their device count (from the form) straight away. Slide 12 keeps the
// example figures until they've entered their own numbers in the calculator.
const blob =
i.touched && r.complete
? await buildPersonalisedDeck(values, meta)
: values.subs
? await buildPersonalisedDeck(values, meta, { roi: false })
: await getExampleDeck();
triggerDownload(blob, 'BlackDice_Turn_Network_Protection_Strategy_Deck.pptx');
} catch (err) {
console.error(err);
} finally {
setBusy(false);
}
}
// Warm the template cache while the deck is being viewed
useEffect(() => {
if (active) prefetchTemplate().catch(() => {});
}, [active]);
useEffect(() => {
if (!active) return;
const onKey = (e) => {
if (['INPUT', 'SELECT', 'TEXTAREA'].includes(e.target.tagName)) return;
if (e.key === 'ArrowRight' || e.key === 'ArrowDown') { e.preventDefault(); setCur((c) => Math.min(SLIDE_COUNT - 1, c + 1)); }
if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') { e.preventDefault(); setCur((c) => Math.max(0, c - 1)); }
};
document.addEventListener('keydown', onKey);
return () => document.removeEventListener('keydown', onKey);
}, [active]);
useEffect(() => {
const thumb = thumbsRef.current?.children[cur];
thumb?.scrollIntoView({ block: 'nearest', inline: 'center', behavior: 'smooth' });
}, [cur]);
// Preload the next slide for snappy navigation
useEffect(() => {
if (cur + 1 < SLIDE_COUNT) new Image().src = slides[cur + 1];
}, [cur]);
return (
<div className="deck-viewer-wrap">
<div className="deck-viewer-top">
<div>
<div className="deck-viewer-title">Turn Network Protection into Competitive Advantage</div>
<div className="deck-viewer-sub">15 slides · Use arrow keys or click to navigate · Click thumbnails to jump to any slide</div>
</div>
<button type="button" className="deck-dl-btn" onClick={downloadDeck} disabled={busy}>
<svg viewBox="0 0 24 24"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4" /><polyline points="7 10 12 15 17 10" /><line x1="12" y1="15" x2="12" y2="3" /></svg>
{busy ? 'Preparing…' : 'Download Deck (PPTX)'}
</button>
</div>
<div className="slide-viewer">
<div className="slide-display">
<button className="slide-nav-btn prev" onClick={() => go(cur - 1)} disabled={cur === 0} aria-label="Previous slide">&#8249;</button>
<img src={slides[cur]} alt={`Slide ${cur + 1}`} />
<button className="slide-nav-btn next" onClick={() => go(cur + 1)} disabled={cur === SLIDE_COUNT - 1} aria-label="Next slide">&#8250;</button>
</div>
<div className="slide-controls">
<div className="slide-counter">{cur + 1} / {SLIDE_COUNT}</div>
<div className="slide-thumbs" ref={thumbsRef}>
{slides.map((src, i) => (
<button key={src} className={`slide-thumb-btn${i === cur ? ' active' : ''}`} onClick={() => go(i)} title={`Slide ${i + 1}`}>
<img src={src} alt={`Slide ${i + 1}`} loading="lazy" />
</button>
))}
</div>
</div>
</div>
</div>
);
}
+11
View File
@@ -0,0 +1,11 @@
export default function Footer() {
return (
<footer className="lp-footer">
<p>
&copy; 2026 Cyber Intelligence Group Limited. All rights reserved. &nbsp;|&nbsp;{' '}
<a href="https://www.blackdice.ai/privacy" target="_blank" rel="noreferrer">Privacy Policy</a> &nbsp;|&nbsp;{' '}
<a href="https://www.blackdice.ai" target="_blank" rel="noreferrer">blackdice.ai</a>
</p>
</footer>
);
}
+265
View File
@@ -0,0 +1,265 @@
import { useState } from 'react';
import { asset } from '../lib/asset.js';
import { fmtCount } from '../lib/calc.js';
const REGIONS = ['United Kingdom', 'Western Europe', 'North America', 'Latin America', 'Sub-Saharan Africa', 'Asia Pacific', 'Middle East', 'Other'];
// "The device on your network" dropdown. `deck` is how the choice appears as the big
// number on slide 3; the label is what's sent to the CRM's "subscriber base" field.
const DEVICE_OPTIONS = [
{ value: 'Under 500k', deck: '<500k' },
{ value: '500k to 2M', deck: '500k–2m' },
{ value: '2M to 10M', deck: '2m–10m' },
{ value: '10M to 50M', deck: '10m–50m' },
{ value: '50M+', deck: '50m+' },
];
const EXACT = 'exact';
// Band for an exact count, so the CRM's "subscriber base" field is always filled the same way.
function subscriberBand(n) {
if (!n) return '';
if (n < 500e3) return 'Under 500k';
if (n < 2e6) return '500k to 2M';
if (n < 10e6) return '2M to 10M';
if (n < 50e6) return '10M to 50M';
return '50M+';
}
// Common free-mail domains — the form asks for a *business* email.
// Set VITE_BLOCK_FREE_EMAIL=false in .env to allow them.
const BLOCK_FREE_MAIL = import.meta.env.VITE_BLOCK_FREE_EMAIL !== 'false';
const FREE_MAIL = /@(gmail|googlemail|yahoo|hotmail|outlook|live|aol|icloud|me|proton|protonmail|gmx|mail|yandex)\./i;
function Hero() {
return (
<div className="lp-hero">
<img className="lp-hero-hex" src={asset('img/hero-hex.png')} alt="" />
<div className="lp-hero-inner">
<div className="lp-hero-badge">Operator ROI Toolkit</div>
<h1>
Turn network protection
<br />
<span>into competitive advantage</span>
</h1>
<p className="lp-hero-sub">
Access the complete operator toolkit: a 15-slide strategy deck and interactive ROI calculator to quantify and
communicate the commercial value of blocking malicious traffic on your network.
</p>
<div className="lp-hero-proof">
{[
['$10.5tr', 'Global cybercrime economy'],
['$41B+', 'Annual network fraud'],
['5', 'ROI savings categories'],
].map(([n, l]) => (
<div className="lp-proof-item" key={l}>
<div className="lp-proof-num">{n}</div>
<div className="lp-proof-label">{l}</div>
</div>
))}
</div>
</div>
</div>
);
}
function WhatYouGet() {
return (
<div className="lp-what">
<div className="lp-what-inner">
<div className="lp-section-label">Inside the toolkit</div>
<div className="lp-section-title">Two tools. One clear commercial case.</div>
<p className="lp-section-sub">
Built for operators evaluating network-level malicious traffic blocking, from initial business case to
personalised ROI.
</p>
<div className="lp-assets">
<div className="lp-asset-card">
<div className="lp-asset-preview">
<img className="lp-slide-thumb" src={asset('img/slides/slide-01.jpg')} alt="Strategy Deck" />
</div>
<div className="lp-asset-info">
<div className="lp-asset-tag">Strategy Deck · 15 Slides</div>
<h3>Turn network protection into competitive advantage</h3>
<p>
A concise, evidence-led deck that frames the commercial cost of malicious traffic and makes the case
for operator-level blocking, ready to share internally or use in a board presentation.
</p>
<ul className="lp-asset-bullets">
<li>Global fraud context with GSMA and McKinsey data</li>
<li>Five commercial savings categories explained</li>
<li>Discover three BlackDice protection deployment paths</li>
<li>ROI model and commercial summary</li>
</ul>
</div>
</div>
<div className="lp-asset-card">
<div className="lp-asset-preview-calc">
<div className="calc-mock">
<div className="calc-mock-header">① Your network</div>
<div className="calc-mock-row">
<div className="calc-mock-field">Active subscribers</div>
<div className="calc-mock-field">Region / pricing</div>
</div>
<div className="calc-mock-header" style={{ marginTop: 8 }}>② Support calls</div>
<div className="calc-mock-row">
<div className="calc-mock-field">Calls per 1,000/mo</div>
<div className="calc-mock-field">Cost per call</div>
</div>
<div className="calc-mock-result">
<div className="calc-mock-result-label">Estimated annual saving</div>
<div className="calc-mock-result-val">Calculate your numbers</div>
</div>
</div>
</div>
<div className="lp-asset-info">
<div className="lp-asset-tag">Interactive Calculator</div>
<h3>Network protection ROI calculator</h3>
<p>
Enter your operator data: subscriber base, support call volume, ARPU and churn rate, and get a
personalised annual saving across five categories with a downloadable results report.
</p>
<ul className="lp-asset-bullets">
<li>Bandwidth savings by region (TeleGeography data)</li>
<li>Support call reduction based on your actual call cost</li>
<li>Churn reduction and ARPU protection</li>
<li>DDoS avoided costs and equipment savings</li>
</ul>
</div>
</div>
</div>
</div>
</div>
);
}
const EMPTY = { first: '', last: '', company: '', title: '', email: '', region: '', devices: '', subscribers: '', website: '' };
function RegistrationForm({ onRegister }) {
const [f, setF] = useState(EMPTY);
const [error, setError] = useState('');
const [busy, setBusy] = useState(false);
const set = (k) => (e) => setF((s) => ({ ...s, [k]: e.target.value }));
async function handleSubmit(e) {
e.preventDefault();
const t = Object.fromEntries(Object.entries(f).map(([k, v]) => [k, v.trim()]));
if (!t.first || !t.last || !t.company || !t.title || !t.email) {
return setError('Please complete all required fields before continuing.');
}
if (!/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(t.email)) {
return setError('Please enter a valid business email address.');
}
if (BLOCK_FREE_MAIL && FREE_MAIL.test(t.email)) {
return setError('Please use your business email address rather than a personal one.');
}
// Device count: a band from the dropdown, or an exact number
let exact = 0;
if (t.devices === EXACT) {
exact = Math.round(parseFloat(t.subscribers.replace(/[,\s]/g, '')) || 0);
if (exact <= 0) return setError('Please enter the number of devices on your network, e.g. 5,000,000.');
}
const band = DEVICE_OPTIONS.find((o) => o.value === t.devices);
setError('');
// Honeypot: bots fill the hidden "website" field. Let them "through" without sending to the CRM.
const isBot = !!t.website;
const { website: _hp, devices: _d, ...lead } = t;
setBusy(true);
await onRegister(
{
...lead,
subscribers: exact ? String(exact) : '', // exact count (pre-fills the calculator)
subs: band ? band.value : subscriberBand(exact), // band, for the CRM
deviceLabel: band ? band.deck : fmtCount(exact), // big number on slide 3
date: new Date().toLocaleDateString('en-GB', { day: 'numeric', month: 'long', year: 'numeric' }),
},
{ skipCrm: isBot }
);
setBusy(false);
}
return (
<div className="lp-reg" id="register">
<div className="lp-reg-inner">
<div className="lp-reg-box">
<div className="lp-reg-title">Get free access to the toolkit</div>
<p className="lp-reg-sub">
Complete the form below to view and download the strategy deck and unlock the personalised ROI calculator.
</p>
{error && (
<div id="form-error" role="alert" style={{ display: 'block' }}>
{error}
</div>
)}
<form onSubmit={handleSubmit} noValidate>
<div className="lp-form-grid">
<div className="lp-field">
<label htmlFor="f-first">First name *</label>
<input type="text" id="f-first" autoComplete="given-name" placeholder="Jane" value={f.first} onChange={set('first')} required />
</div>
<div className="lp-field">
<label htmlFor="f-last">Last name *</label>
<input type="text" id="f-last" autoComplete="family-name" placeholder="Smith" value={f.last} onChange={set('last')} required />
</div>
<div className="lp-field">
<label htmlFor="f-company">Company *</label>
<input type="text" id="f-company" autoComplete="organization" placeholder="Your operator name" value={f.company} onChange={set('company')} required />
</div>
<div className="lp-field">
<label htmlFor="f-title">Job title *</label>
<input type="text" id="f-title" autoComplete="organization-title" placeholder="e.g. CTO, Director Network" value={f.title} onChange={set('title')} required />
</div>
<div className="lp-field">
<label htmlFor="f-email">Business email *</label>
<input type="email" id="f-email" autoComplete="email" placeholder="jane@operator.com" value={f.email} onChange={set('email')} required />
</div>
<div className="lp-field">
<label htmlFor="f-region">Region</label>
<select id="f-region" value={f.region} onChange={set('region')}>
<option value="">Select region</option>
{REGIONS.map((r) => <option key={r}>{r}</option>)}
</select>
</div>
<div className="lp-field lp-form-full">
<label htmlFor="f-devices">The devices on your network</label>
<select id="f-devices" value={f.devices} onChange={set('devices')}>
<option value="">Active subscribers (optional)</option>
{DEVICE_OPTIONS.map((o) => <option key={o.value} value={o.value}>{o.value}</option>)}
<option value={EXACT}>Enter exact number…</option>
</select>
{f.devices === EXACT && (
<input type="text" inputMode="numeric" id="f-subscribers" aria-label="Exact number of active subscribers" placeholder="e.g. 5,000,000" value={f.subscribers} onChange={set('subscribers')} autoFocus />
)}
<span className="lp-field-hint">Shown on slide 3 of your strategy deck. An exact number is also pre-filled in the ROI calculator.</span>
</div>
{/* honeypot — hidden from humans */}
<div className="lp-hp" aria-hidden="true">
<label htmlFor="f-website">Website</label>
<input type="text" id="f-website" tabIndex={-1} autoComplete="off" value={f.website} onChange={set('website')} />
</div>
</div>
<button type="submit" className="lp-submit" disabled={busy}>
{busy ? 'Unlocking your toolkit…' : 'Get Access to the Toolkit'}
</button>
<p className="lp-privacy">
By submitting this form you agree to BlackDice's{' '}
<a href="https://www.blackdice.ai/privacy" target="_blank" rel="noreferrer">Privacy Policy</a>. We will
not share your details with third parties.
</p>
</form>
</div>
</div>
</div>
);
}
export default function Landing({ onRegister }) {
return (
<div id="phase-preview">
<Hero />
<WhatYouGet />
<RegistrationForm onRegister={onRegister} />
</div>
);
}
+50
View File
@@ -0,0 +1,50 @@
import { asset } from '../lib/asset.js';
const Caret = () => (
<svg viewBox="0 0 10 6"><path d="M1 1l4 4 4-4" /></svg>
);
const MENUS = [
{ label: 'Products', links: [['Mobile SDK', 'mobile-sdk'], ['DNS Protect', 'dns-protect'], ['Halo CPE', 'halo-cpe']] },
{ label: 'Solutions', links: [['Financial Services', 'financial-services']] },
{
label: 'For Operators',
links: [['Overview', 'for-operators']],
internalLinks: [['ROI Calculator', '#']],
},
{ label: 'Company', links: [['Why BlackDice', 'why-blackdice'], ['News', 'news'], ['Investors', 'investors']] },
];
export default function Nav() {
return (
<nav className="site-nav">
<div className="nav-inner">
<a className="nav-logo" href="https://www.blackdice.ai">
<img src={asset('img/logo.png')} alt="BlackDice" />
</a>
<div className="nav-links">
{MENUS.map((m) => (
<div className="nav-item" key={m.label}>
<button className="nav-link" type="button">
{m.label} <Caret />
</button>
<div className="nav-dropdown">
<div className="nav-dropdown-label">{m.label}</div>
{m.links.map(([t, slug]) => (
<a key={slug} href={`https://www.blackdice.ai/${slug}`}>{t}</a>
))}
{m.internalLinks?.map(([t, href]) => (
<a key={t} href={href}>{t}</a>
))}
</div>
</div>
))}
<a className="nav-link" href="https://www.blackdice.ai/news">Blog</a>
</div>
<div className="nav-right">
<a className="nav-cta" href="https://www.blackdice.ai/contact">Get in touch</a>
</div>
</div>
</nav>
);
}
+47
View File
@@ -0,0 +1,47 @@
import { useState } from 'react';
import DeckViewer from './DeckViewer.jsx';
import Calculator from './Calculator.jsx';
export default function Toolkit({ registrant, onReset }) {
const [tab, setTab] = useState('deck');
return (
<div id="phase-access" style={{ display: 'block' }}>
<div className="access-welcome">
<div className="access-welcome-inner">
<div className="access-welcome-icon">
<svg viewBox="0 0 24 24"><polyline points="20 6 9 17 4 12" /></svg>
</div>
<div className="access-welcome-text">
<h2>Welcome {registrant.first}. You now have full access to the operator ROI toolkit.</h2>
<p>
Use the tabs below to view the strategy deck online or calculate your personalised ROI.
<button type="button" className="welcome-reset" onClick={onReset}>Not {registrant.first}?</button>
</p>
</div>
</div>
</div>
<div style={{ background: '#f4f8fa', borderBottom: '2px solid #dde8eb' }}>
<div className="lp-tabs" role="tablist" style={{ borderBottom: 'none', paddingBottom: 0 }}>
<button role="tab" aria-selected={tab === 'deck'} className={`lp-tab${tab === 'deck' ? ' active' : ''}`} onClick={() => setTab('deck')}>
<svg viewBox="0 0 24 24"><rect x="2" y="3" width="20" height="14" rx="2" /><line x1="8" y1="21" x2="16" y2="21" /><line x1="12" y1="17" x2="12" y2="21" /></svg>
Strategy Deck
</button>
<button role="tab" aria-selected={tab === 'calc'} className={`lp-tab${tab === 'calc' ? ' active' : ''}`} onClick={() => setTab('calc')}>
<svg viewBox="0 0 24 24"><rect x="4" y="2" width="16" height="20" rx="2" /><line x1="8" y1="6" x2="16" y2="6" /><line x1="8" y1="10" x2="16" y2="10" /><line x1="8" y1="14" x2="12" y2="14" /></svg>
ROI Calculator
</button>
</div>
</div>
{/* Both tabs stay mounted so calculator inputs survive tab switches */}
<div className={`lp-tab-content${tab === 'deck' ? ' active' : ''}`} style={{ background: '#f4f8fa' }}>
<DeckViewer active={tab === 'deck'} registrant={registrant} />
</div>
<div className={`lp-tab-content${tab === 'calc' ? ' active' : ''}`} style={{ background: '#f4f8fa' }}>
<Calculator registrant={registrant} active={tab === 'calc'} />
</div>
</div>
);
}
+87
View File
@@ -0,0 +1,87 @@
// ─────────────────────────────────────────────────────────────────────────────
// CRM configuration
//
// Secrets/IDs come from .env (see .env.example). Field names live here so you
// can match them to the property / field names in whichever CRM you pick.
// Nothing in this file is secret: HubSpot portal IDs, form GUIDs and the
// Salesforce Org ID are designed to be public (they're in every embed code).
// ─────────────────────────────────────────────────────────────────────────────
const env = import.meta.env;
/** One or more of: hubspot, salesforce, webhook (comma-separated). Empty = console only. */
export const PROVIDERS = (env.VITE_CRM_PROVIDER || '')
.split(',')
.map((s) => s.trim().toLowerCase())
.filter(Boolean);
export const LEAD_SOURCE = env.VITE_LEAD_SOURCE || 'Operator ROI Toolkit – Oct 2026 Campaign';
// ── HubSpot (Forms Submission API — no private key needed) ──────────────────
export const HUBSPOT = {
portalId: env.VITE_HUBSPOT_PORTAL_ID,
formGuid: env.VITE_HUBSPOT_FORM_GUID,
// Optional second form for ROI figures; falls back to the registration form.
roiFormGuid: env.VITE_HUBSPOT_ROI_FORM_GUID || env.VITE_HUBSPOT_FORM_GUID,
// EU-hosted portals: https://api-eu1.hsforms.com
apiBase: env.VITE_HUBSPOT_API_BASE || 'https://api.hsforms.com',
// Our key → HubSpot internal property name
fields: {
first: 'firstname',
last: 'lastname',
email: 'email',
company: 'company',
title: 'jobtitle',
region: 'operator_region', // custom property — create in HubSpot
subs: 'subscriber_base_band', // custom property (band derived from the count below)
subscribers: 'active_subscribers', // custom property — "The device on your network" count
leadSource: 'lead_source_detail', // custom property (optional)
utm_source: 'utm_source',
utm_medium: 'utm_medium',
utm_campaign: 'utm_campaign',
utm_term: 'utm_term',
utm_content: 'utm_content',
},
roiFields: {
roi_total_low: 'roi_total_low',
roi_total_high: 'roi_total_high',
roi_bandwidth: 'roi_bandwidth',
roi_support_calls: 'roi_support_calls',
roi_churn: 'roi_churn',
roi_equipment: 'roi_equipment',
roi_ddos: 'roi_ddos',
roi_subscribers: 'roi_subscribers',
roi_arpu: 'roi_arpu',
roi_churn_rate: 'roi_churn_rate',
roi_pricing_region: 'roi_pricing_region',
roi_report_downloaded_at: 'roi_report_downloaded_at',
},
};
// ── Salesforce (Web-to-Lead) ────────────────────────────────────────────────
export const SALESFORCE = {
orgId: env.VITE_SALESFORCE_ORG_ID,
endpoint:
env.VITE_SALESFORCE_ENDPOINT ||
'https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8',
// Web-to-Lead always CREATES a lead, so a second (ROI) post makes a 2nd lead
// unless you have duplicate/matching rules. Off by default.
sendRoi: String(env.VITE_SALESFORCE_SEND_ROI || 'false') === 'true',
fields: {
first: 'first_name',
last: 'last_name',
email: 'email',
company: 'company',
title: 'title',
region: '', // e.g. '00N5g00000XXXXX' (custom field ID) — blank = put in description
subs: '', // e.g. '00N5g00000YYYYY'
},
};
// ── Generic webhook (Zapier / Make / n8n / Power Automate / your API) ──────
export const WEBHOOK = {
url: env.VITE_CRM_WEBHOOK_URL,
};
// Max time the user waits on the form before we let them in regardless.
export const SUBMIT_TIMEOUT_MS = 6000;
+2
View File
@@ -0,0 +1,2 @@
// Resolve a file in /public relative to the deployed base path (works in sub-folders too).
export const asset = (p) => `${import.meta.env.BASE_URL}${p.replace(/^\//, '')}`;
+200
View File
@@ -0,0 +1,200 @@
// ROI calculation — ported 1:1 from the original landing page so figures match exactly.
export const BW_KB = { cautious: 15, expected: 37, optimistic: 80 };
export const BLOCKS_PER_SUB_MONTH = 8000;
export const DDOS_LOW = 408000;
export const DDOS_HIGH = 1200000;
export const REGIONS = [
{ group: 'Africa', options: [{ value: '0.0095', label: 'South Africa (Johannesburg): $0.0095/GB' }] },
{
group: 'Asia Pacific',
options: [
{ value: '0.0139', label: 'Philippines (Manila): $0.0139/GB' },
{ value: '0.0093', label: 'Indonesia (Jakarta): $0.0093/GB' },
{ value: '0.0060', label: 'India (Mumbai): $0.0060/GB' },
{ value: '0.0051', label: 'South Korea (Seoul): $0.0051/GB' },
{ value: '0.0026', label: 'Taiwan (Taipei): $0.0026/GB' },
{ value: '0.0016', label: 'Singapore: $0.0016/GB' },
],
},
{
group: 'Europe',
options: [
{ value: '0.0007', label: 'Netherlands (Amsterdam): $0.0007/GB' },
{ value: '0.0010', label: 'Spain (Madrid): $0.0010/GB' },
],
},
{
group: 'Latin America',
options: [
{ value: '0.0031', label: 'Brazil (São Paulo): $0.0031/GB' },
{ value: '0.0024', label: 'Mexico (Mexico City): $0.0024/GB' },
{ value: '0.0035', label: 'Chile (Santiago): $0.0035/GB' },
],
},
];
export function regionLabel(value) {
if (value === 'custom') return 'Custom price';
for (const g of REGIONS) for (const o of g.options) if (o.value === value) return o.label.split(':')[0];
return '';
}
export const DEFAULT_INPUTS = {
subs: '',
region: '0.0093',
customPrice: '',
scenario: 'expected',
callsPer1000: '18',
callCost: '8',
securityPct: 25,
arpu: '',
churn: '',
netOpex: '',
ddos: '0',
ddosSlider: 50,
touched: false,
};
const num = (x) => parseFloat(x) || 0;
export function ddosCostFromSlider(pos) {
return DDOS_LOW + (pos / 100) * (DDOS_HIGH - DDOS_LOW);
}
export function calculate(i) {
const subs = num(i.subs);
const gbPrice = i.region === 'custom' ? num(i.customPrice) : parseFloat(i.region);
const callsPer1k = num(i.callsPer1000) || 18;
const callCost = num(i.callCost) || 8;
const secPct = num(i.securityPct) / 100 || 0.25;
const arpu = num(i.arpu);
const netOpex = num(i.netOpex);
const ddosInc = num(i.ddos);
// Support calls
let callsLo = 0, callsHi = 0;
if (subs > 0) {
const secCalls = (subs / 1000) * callsPer1k * secPct;
callsLo = secCalls * 0.6 * 12 * callCost;
callsHi = secCalls * 0.7 * 12 * callCost;
}
// Churn
let churnLo = 0, churnHi = 0;
if (subs > 0 && arpu > 0) {
churnLo = subs * 0.003 * arpu * 12;
churnHi = subs * 0.006 * arpu * 12;
}
// Network equipment
let equipLo = 0, equipHi = 0;
if (netOpex > 0) {
equipLo = netOpex * 0.02;
equipHi = netOpex * 0.04;
}
// Bandwidth (low = cautious, high = optimistic — same as original page)
let bwLo = 0, bwHi = 0;
if (subs > 0 && gbPrice > 0) {
bwLo = subs * ((BLOCKS_PER_SUB_MONTH * 12 * BW_KB.cautious) / 1e6) * gbPrice;
bwHi = subs * ((BLOCKS_PER_SUB_MONTH * 12 * BW_KB.optimistic) / 1e6) * gbPrice;
}
// DDoS
let ddosLo = 0, ddosHi = 0;
if (ddosInc > 0) {
ddosLo = ddosInc * DDOS_LOW;
ddosHi = ddosInc * DDOS_HIGH;
}
const totalLo = callsLo + churnLo + equipLo + bwLo + ddosLo;
const totalHi = callsHi + churnHi + equipHi + bwHi + ddosHi;
const hasData = subs > 0 || arpu > 0 || netOpex > 0 || ddosInc > 0;
return {
bw: { lo: bwLo, hi: bwHi },
calls: { lo: callsLo, hi: callsHi },
churn: { lo: churnLo, hi: churnHi },
equip: { lo: equipLo, hi: equipHi },
ddos: { lo: ddosLo, hi: ddosHi },
total: { lo: totalLo, hi: totalHi },
complete: hasData && totalLo > 0,
};
}
// ── Formatting (identical to original) ──
export function fmt(n) {
if (n === null || n === undefined || isNaN(n) || n === 0) return null;
if (n >= 1e9) return '$' + (n / 1e9).toFixed(2) + 'B';
if (n >= 1e6) return '$' + (n / 1e6).toFixed(2) + 'M';
if (n >= 1e3) return '$' + Math.round(n / 1e3).toLocaleString('en-US') + 'K';
return '$' + Math.round(n).toLocaleString('en-US');
}
/** "$1.20M – $2.40M" for the web UI */
export function fmtRange(lo, hi, sep = ' – ') {
if (!fmt(lo) && !fmt(hi)) return null;
if (lo === hi || !hi) return fmt(lo);
return fmt(lo) + sep + fmt(hi);
}
// ── Shared with the deck-building code (Calculator + DeckViewer) ──
export const INPUTS_KEY = 'bd_toolkit_calc_inputs';
/**
* Loads this visitor's calculator inputs, however the page was reached.
* If they haven't entered a subscriber count yet, it is pre-filled from the
* "The device on your network" field on the registration form.
* `touched` is true once the visitor has changed anything in the calculator.
*/
export function loadInputs(registrant) {
let i = DEFAULT_INPUTS;
try {
i = { ...DEFAULT_INPUTS, ...JSON.parse(localStorage.getItem(INPUTS_KEY) || '{}') };
} catch { /* storage unavailable */ }
if (!i.subs && registrant?.subscribers) i = { ...i, subs: registrant.subscribers };
return i;
}
/** Value written into the PowerPoint when a category has no data. */
export const NOT_INCLUDED = 'Not included';
/** Deck house style: "$65k", "$3.60m", "$1.20bn" (lower-case, matching the example figures in the deck). */
export function fmtDeck(n) {
const s = fmt(n);
return s && s.replace(/B$/, 'bn').replace(/M$/, 'm').replace(/K$/, 'k');
}
const pptRange = (r) => {
if (!fmt(r.lo) && !fmt(r.hi)) return NOT_INCLUDED;
if (r.lo === r.hi || !r.hi) return fmtDeck(r.lo);
return `${fmtDeck(r.lo)} to ${fmtDeck(r.hi)}`;
};
/** Subscriber count in the deck's big-number style: 25000000 → "25m", 5500000 → "5.5m", 850000 → "850k". */
export function fmtCount(n) {
if (!n || n <= 0) return '';
const short = (v, unit) => (v >= 100 ? Math.round(v) : parseFloat(v.toFixed(1))) + unit;
if (n >= 1e9) return short(n / 1e9, 'bn');
if (n >= 1e6) return short(n / 1e6, 'm');
if (n >= 1e3) return short(n / 1e3, 'k');
return String(Math.round(n));
}
/** Values written into the PowerPoint ROI + device-count slides. */
/**
* @param registrant optional: if the calculator has no subscriber count, slide 3 falls back
* to the "The device on your network" choice from the registration form.
*/
export function formatForDeck(i, r, registrant) {
return {
total: pptRange(r.total),
bw: pptRange(r.bw),
calls: pptRange(r.calls),
churn: pptRange(r.churn),
equip: pptRange(r.equip),
ddos: pptRange(r.ddos),
subs: fmtCount(num(i.subs)) || registrant?.deviceLabel || '',
};
}
+171
View File
@@ -0,0 +1,171 @@
// Pluggable CRM submission layer.
// submitLead(registrant) → called on registration
// submitRoi(registrant, roiData) → called when the personalised report is downloaded
//
// Each provider is enabled via VITE_CRM_PROVIDER (see src/config/crm.config.js).
// Failures never block the visitor — they are logged and reported back to the caller.
import { PROVIDERS, LEAD_SOURCE, HUBSPOT, SALESFORCE, WEBHOOK, SUBMIT_TIMEOUT_MS } from '../config/crm.config.js';
// ── helpers ─────────────────────────────────────────────────────────────────
const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'gclid', 'fbclid', 'li_fat_id'];
const UTM_STORE = 'bd_toolkit_utm';
/** Capture UTM/click IDs on first landing so they survive navigation & refresh. */
export function captureUtm() {
try {
const params = new URLSearchParams(window.location.search);
const found = {};
UTM_KEYS.forEach((k) => params.get(k) && (found[k] = params.get(k)));
if (Object.keys(found).length) localStorage.setItem(UTM_STORE, JSON.stringify(found));
return Object.keys(found).length ? found : JSON.parse(localStorage.getItem(UTM_STORE) || '{}');
} catch {
return {};
}
}
function getCookie(name) {
const m = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
return m ? decodeURIComponent(m[1]) : undefined;
}
function withTimeout(promise, ms) {
return Promise.race([
promise,
new Promise((_, rej) => setTimeout(() => rej(new Error('timeout')), ms)),
]);
}
const pageContext = () => ({
pageUri: window.location.href,
pageName: document.title,
referrer: document.referrer || undefined,
});
// ── HubSpot ─────────────────────────────────────────────────────────────────
async function hubspotSubmit(formGuid, valuesByOurKey, fieldMap) {
if (!HUBSPOT.portalId || !formGuid) throw new Error('HubSpot portal ID / form GUID missing');
const fields = Object.entries(valuesByOurKey)
.filter(([k, v]) => fieldMap[k] && v !== undefined && v !== null && v !== '')
.map(([k, v]) => ({ objectTypeId: '0-1', name: fieldMap[k], value: String(v) }));
const body = {
submittedAt: Date.now(),
fields,
context: { hutk: getCookie('hubspotutk'), pageUri: pageContext().pageUri, pageName: pageContext().pageName },
};
const res = await fetch(
`${HUBSPOT.apiBase}/submissions/v3/integration/submit/${HUBSPOT.portalId}/${formGuid}`,
{ method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body), keepalive: true }
);
if (!res.ok) throw new Error(`HubSpot ${res.status}: ${await res.text()}`);
return true;
}
// ── Salesforce Web-to-Lead ──────────────────────────────────────────────────
async function salesforceSubmit(values) {
if (!SALESFORCE.orgId) throw new Error('Salesforce Org ID missing');
const f = SALESFORCE.fields;
const p = new URLSearchParams();
p.set('oid', SALESFORCE.orgId);
p.set('lead_source', LEAD_SOURCE);
['first', 'last', 'email', 'company', 'title', 'region', 'subs'].forEach((k) => {
if (f[k] && values[k]) p.set(f[k], values[k]);
});
if (values.description) p.set('description', values.description);
// Web-to-Lead doesn't send CORS headers → opaque (fire-and-forget) request.
await fetch(SALESFORCE.endpoint, { method: 'POST', mode: 'no-cors', body: p, keepalive: true });
return true;
}
// ── Webhook ─────────────────────────────────────────────────────────────────
async function webhookSubmit(payload) {
if (!WEBHOOK.url) throw new Error('Webhook URL missing');
const res = await fetch(WEBHOOK.url, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload),
keepalive: true,
});
if (!res.ok) throw new Error(`Webhook ${res.status}`);
return true;
}
async function runAll(tasks) {
if (!tasks.length) return { ok: true, results: [] };
const settled = await Promise.allSettled(tasks.map(([name, fn]) => withTimeout(fn(), SUBMIT_TIMEOUT_MS).then(() => name)));
const results = settled.map((s, i) => ({
provider: tasks[i][0],
ok: s.status === 'fulfilled',
error: s.status === 'rejected' ? String(s.reason?.message || s.reason) : undefined,
}));
results.filter((r) => !r.ok).forEach((r) => console.error(`[CRM] ${r.provider} failed:`, r.error));
return { ok: results.some((r) => r.ok), results };
}
// ── Public API ──────────────────────────────────────────────────────────────
export async function submitLead(reg) {
const utm = captureUtm();
const values = { ...reg, ...utm, leadSource: LEAD_SOURCE };
const tasks = [];
if (PROVIDERS.length === 0) console.info('[CRM] No provider configured — lead captured locally only:', values);
if (PROVIDERS.includes('hubspot')) tasks.push(['hubspot', () => hubspotSubmit(HUBSPOT.formGuid, values, HUBSPOT.fields)]);
if (PROVIDERS.includes('salesforce')) {
const desc = [
`Source: ${LEAD_SOURCE}`,
!SALESFORCE.fields.region && reg.region ? `Region: ${reg.region}` : '',
!SALESFORCE.fields.subs && reg.subs ? `Subscriber base: ${reg.subs}` : '',
reg.subscribers ? `Devices on network (active subscribers): ${Number(reg.subscribers).toLocaleString('en-US')}` : '',
Object.entries(utm).map(([k, v]) => `${k}: ${v}`).join('\n'),
].filter(Boolean).join('\n');
tasks.push(['salesforce', () => salesforceSubmit({ ...values, description: desc })]);
}
if (PROVIDERS.includes('webhook'))
tasks.push(['webhook', () => webhookSubmit({ event: 'toolkit_registration', submittedAt: new Date().toISOString(), lead: reg, utm, leadSource: LEAD_SOURCE, ...pageContext() })]);
return runAll(tasks);
}
/**
* @param reg registrant object (first, last, email, …)
* @param roi { inputs, results, formatted } from the calculator
*/
export async function submitRoi(reg, roi) {
if (!reg?.email) return { ok: false, results: [] };
const { inputs, results, formatted } = roi;
const flat = {
email: reg.email,
roi_total_low: Math.round(results.total.lo),
roi_total_high: Math.round(results.total.hi),
roi_bandwidth: formatted.bw,
roi_support_calls: formatted.calls,
roi_churn: formatted.churn,
roi_equipment: formatted.equip,
roi_ddos: formatted.ddos,
roi_subscribers: inputs.subs,
roi_arpu: inputs.arpu,
roi_churn_rate: inputs.churn,
roi_pricing_region: inputs.regionLabel,
roi_report_downloaded_at: new Date().toISOString(),
};
const tasks = [];
if (PROVIDERS.length === 0) console.info('[CRM] No provider configured — ROI data:', flat);
if (PROVIDERS.includes('hubspot'))
tasks.push(['hubspot', () => hubspotSubmit(HUBSPOT.roiFormGuid, flat, { email: 'email', ...HUBSPOT.roiFields })]);
if (PROVIDERS.includes('salesforce') && SALESFORCE.sendRoi) {
const desc = `ROI report downloaded\nTotal: ${formatted.total}\nBandwidth: ${formatted.bw}\nSupport calls: ${formatted.calls}\nChurn: ${formatted.churn}\nEquipment: ${formatted.equip}\nDDoS: ${formatted.ddos}\nSubscribers: ${inputs.subs} ARPU: ${inputs.arpu} Churn: ${inputs.churn}%`;
tasks.push(['salesforce', () => salesforceSubmit({ ...reg, description: desc })]);
}
if (PROVIDERS.includes('webhook'))
tasks.push(['webhook', () => webhookSubmit({ event: 'roi_report_downloaded', submittedAt: new Date().toISOString(), lead: reg, roi: { inputs, results, formatted }, ...pageContext() })]);
return runAll(tasks);
}
+95
View File
@@ -0,0 +1,95 @@
// Builds the personalised ROI deck entirely in the browser:
// fetch template .pptx → patch the ROI slide XML → zip → download.
//
// The template is the launch deck (V4). Its ROI slide carries EXAMPLE figures,
// so the unmodified file doubles as the "example" deck for visitors who haven't
// used the calculator yet (see getExampleDeck).
// JSZip is loaded on demand so it doesn't weigh down the first page load.
import { personaliseDeviceSlideXml, personaliseSlideXml } from './slideXml.js';
export const DECK_URL = `${import.meta.env.BASE_URL}deck/BlackDice_Strategy_Deck.pptx`;
// The ROI slide ("Total estimate annual savings") — slide 12 in the V4 deck.
const ROI_SLIDE = import.meta.env.VITE_ROI_SLIDE_PATH || 'ppt/slides/slide12.xml';
// The stats slide ("Your customers are in the crosshairs") — slide 3: active subscribers go in the "DeviceCount" box.
const DEVICE_SLIDE = import.meta.env.VITE_DEVICE_SLIDE_PATH || 'ppt/slides/slide3.xml';
const PPTX_MIME = 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
let templatePromise = null;
/** Start downloading the template early (e.g. when the calculator tab opens). */
export function prefetchTemplate() {
if (!templatePromise) {
templatePromise = fetch(DECK_URL).then((r) => {
if (!r.ok) throw new Error(`Could not load deck template (${r.status})`);
return r.arrayBuffer();
});
templatePromise.catch(() => (templatePromise = null)); // allow retry
}
return templatePromise;
}
/**
* @param {object} values { total, bw, calls, churn, equip, ddos, subs } — display strings
* @param {object} meta { company, date }
* @param {object} [opts] { roi: false } → leave slide 12's example figures alone and only
* personalise slide 3 (used before the visitor has run the calculator)
* @returns {Promise<Blob>}
*/
export async function buildPersonalisedDeck(values, meta = {}, { roi = true } = {}) {
const buf = await prefetchTemplate();
const { default: JSZip } = await import('jszip');
const zip = await JSZip.loadAsync(buf);
if (roi) {
const file = zip.file(ROI_SLIDE);
if (!file) throw new Error(`ROI slide not found in template (${ROI_SLIDE})`);
const xml = await file.async('string');
// Keep the subtitle on one line: cap very long company names.
const co = meta.company && meta.company.length > 40 ? meta.company.slice(0, 39).trim() + '…' : meta.company;
const prefix = co ? `Prepared for ${co} · ` : '';
const { xml: patched, replaced } = personaliseSlideXml(xml, values, prefix);
if (replaced === 0) throw new Error('ROI value boxes (TextBox 4, 10–14) not found on the ROI slide');
zip.file(ROI_SLIDE, patched);
}
// Slide 3: the operator's active subscribers above "The device on your network".
const deviceFile = zip.file(DEVICE_SLIDE);
if (deviceFile) {
const dxml = await deviceFile.async('string');
const { xml: dpatched, replaced: dreplaced } = personaliseDeviceSlideXml(dxml, values.subs);
if (dreplaced) zip.file(DEVICE_SLIDE, dpatched);
}
// Stamp document properties so the file is identifiable in the recipient's Files/SharePoint.
const core = zip.file('docProps/core.xml');
if (core && meta.company) {
const esc = (s) => s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
let c = await core.async('string');
const title = esc(`Network Protection ROI – ${meta.company}`);
c = /<dc:title>.*?<\/dc:title>/s.test(c)
? c.replace(/<dc:title>.*?<\/dc:title>/s, `<dc:title>${title}</dc:title>`)
: c.replace('</cp:coreProperties>', `<dc:title>${title}</dc:title></cp:coreProperties>`);
zip.file('docProps/core.xml', c);
}
return zip.generateAsync({ type: 'blob', mimeType: PPTX_MIME, compression: 'DEFLATE' });
}
/** The deck exactly as published, with the example figures on the ROI slide. */
export async function getExampleDeck() {
const buf = await prefetchTemplate();
return new Blob([buf], { type: PPTX_MIME });
}
export function triggerDownload(blob, filename) {
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = filename;
document.body.appendChild(a);
a.click();
a.remove();
setTimeout(() => URL.revokeObjectURL(url), 10000);
}
+129
View File
@@ -0,0 +1,129 @@
// Pure string-level edits to the deck XML (no DOM needed → testable in Node).
//
// ROI slide (slide 12): each result box is a named text box with two lines —
// a label ("1. Bandwidth savings") and a value. The launch deck (V4) ships with
// EXAMPLE values in those boxes (e.g. "$65k to $365k"); older decks used a
// "$XX to $XX" placeholder. Either way we overwrite the value line (the last
// text run in the box), so the plain deck shows the example and the
// personalised deck shows the operator's own figures.
export const PLACEHOLDER = '$XX to $XX';
// Slide 3 ("Your customers are in the crosshairs") — third column. A big-number
// box named "DeviceCount" sits above "The device on your network" and shows the
// operator's active subscribers (example "25m" in the published deck).
export const DEVICE_COUNT_SHAPE = 'DeviceCount';
// Shape name in PowerPoint (Home → Arrange → Selection Pane) → result key
export const SHAPE_MAP = [
['TextBox 4', 'total'],
['TextBox 10', 'bw'],
['TextBox 11', 'calls'],
['TextBox 12', 'churn'],
['TextBox 13', 'equip'],
['TextBox 14', 'ddos'],
];
const SUBTITLE_SHAPE = 'TextBox 5';
export const escapeXml = (s) =>
String(s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&apos;');
const unescapeXml = (s) =>
s.replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&amp;/g, '&');
const PH_TAG = `<a:t>${escapeXml(PLACEHOLDER)}</a:t>`;
const RUN_RE = /<a:t>([^<]*)<\/a:t>/g;
/** Return [start, end) of the <p:sp> element whose cNvPr name matches exactly. */
function findShape(xml, name) {
const marker = `name="${escapeXml(name)}"`;
const at = xml.indexOf(marker);
if (at < 0) return null;
const start = xml.lastIndexOf('<p:sp>', at);
const end = xml.indexOf('</p:sp>', at);
if (start < 0 || end < 0) return null;
return [start, end + '</p:sp>'.length];
}
/** Replace the text of the LAST run in a shape segment (the value line). */
function replaceLastRun(seg, text) {
const runs = [...seg.matchAll(RUN_RE)];
if (runs.length < 2) return null; // need label + value
const last = runs[runs.length - 1];
return seg.slice(0, last.index) + `<a:t>${escapeXml(text)}</a:t>` + seg.slice(last.index + last[0].length);
}
/**
* @param {string} xml slide XML
* @param {object} values { total, bw, calls, churn, equip, ddos } — display strings
* @param {string} [subtitlePrefix] optional text prepended to the slide subtitle
* @returns {{xml: string, replaced: number}}
*/
export function personaliseSlideXml(xml, values, subtitlePrefix) {
let out = xml;
let replaced = 0;
const used = new Set();
// 1) by shape name — overwrite the value line (example figures or placeholder)
for (const [shape, key] of SHAPE_MAP) {
const r = findShape(out, shape);
if (!r) continue;
const next = replaceLastRun(out.slice(r[0], r[1]), values[key]);
if (next === null) continue;
out = out.slice(0, r[0]) + next + out.slice(r[1]);
replaced++;
used.add(key);
}
// 2) fallback for renamed boxes in an older placeholder deck: fill any
// remaining "$XX to $XX" in document order.
if (out.includes(PH_TAG)) {
const order = SHAPE_MAP.map(([, k]) => k).filter((k) => !used.has(k));
let i = 0;
out = out.split(PH_TAG).reduce((acc, part, idx) => {
if (idx === 0) return part;
const key = order[i++];
replaced++;
return acc + `<a:t>${escapeXml(key ? values[key] : '—')}</a:t>` + part;
});
}
// 3) Subtitle: drop the leading "Example" and add "Prepared for …".
// PowerPoint often splits a line into several runs ("E" + "xample e" + …),
// so we rebuild it into the first run and empty the rest.
const r = findShape(out, SUBTITLE_SHAPE);
if (r) {
const seg = out.slice(r[0], r[1]);
const runs = [...seg.matchAll(RUN_RE)];
if (runs.length) {
let text = unescapeXml(runs.map((m) => m[1]).join(''));
text = text.replace(/^\s*example\s+/i, '');
text = text.charAt(0).toUpperCase() + text.slice(1);
text = (subtitlePrefix || '') + text;
let n = 0;
const next = seg.replace(RUN_RE, () => (n++ === 0 ? `<a:t>${escapeXml(text)}</a:t>` : '<a:t></a:t>'));
out = out.slice(0, r[0]) + next + out.slice(r[1]);
}
}
return { xml: out, replaced };
}
/**
* Writes the active-subscriber figure into the "DeviceCount" box on slide 3.
* @param {string} xml slide XML
* @param {string} deviceCount display string, e.g. "5m" ("" leaves the box blank)
* @returns {{xml: string, replaced: number}}
*/
export function personaliseDeviceSlideXml(xml, deviceCount) {
const r = findShape(xml, DEVICE_COUNT_SHAPE);
if (!r) return { xml, replaced: 0 };
const seg = xml.slice(r[0], r[1]);
const runs = [...seg.matchAll(RUN_RE)];
if (!runs.length) return { xml, replaced: 0 };
const last = runs[runs.length - 1];
let next = seg.slice(0, last.index) + `<a:t>${escapeXml(deviceCount)}</a:t>` + seg.slice(last.index + last[0].length);
// Ranges from the form dropdown ("10m–50m") are wider than a single figure: drop from
// 44pt to 36pt so they stay on one line in the column.
if (String(deviceCount).length > 6) next = next.replace(/sz="4400"/, 'sz="3600"');
return { xml: xml.slice(0, r[0]) + next + xml.slice(r[1]), replaced: 1 };
}
+10
View File
@@ -0,0 +1,10 @@
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import './styles.css';
import App from './App.jsx';
createRoot(document.getElementById('root')).render(
<StrictMode>
<App />
</StrictMode>
);
+580
View File
@@ -0,0 +1,580 @@
/* Ported verbatim from BlackDice_Campaign_Landing_Page.html */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
--teal: #013B49;
--teal2: #0E4F63;
--teal3: #1A6070;
--green: #35B888;
--green2: #2A9A70;
--lgrey: #B0C8CE;
--mgrey: #6B9BA8;
--white: #FFFFFF;
--offwhite: #F4F8F9;
--text: #0E2841;
}
body { font-family: 'Ubuntu', sans-serif; background: var(--offwhite); color: var(--text); min-height: 100vh; }
/* ─── NAV ─── */
.site-nav { background: var(--teal); position: relative; z-index: 100; border-bottom: 1px solid rgba(176,200,206,0.12); }
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 0 48px; display: flex; align-items: center; height: 64px; gap: 0; }
.nav-logo { flex-shrink: 0; margin-right: 40px; }
.nav-logo img { height: 35px; width: auto; display: block; }
.nav-links { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav-item { position: relative; }
.nav-link { display: flex; align-items: center; gap: 4px; padding: 8px 14px; font-size: 13px; font-weight: 500; color: var(--lgrey); text-decoration: none; border-radius: 6px; transition: color 0.2s, background 0.2s; white-space: nowrap; font-family: 'Ubuntu', sans-serif; cursor: pointer; background: none; border: none; }
.nav-link:hover, .nav-item:hover > .nav-link { color: var(--white); background: rgba(255,255,255,0.07); }
.nav-link svg { width: 10px; height: 10px; fill: currentColor; transition: transform 0.2s; }
.nav-item:hover > .nav-link svg { transform: rotate(180deg); }
.nav-dropdown { position: absolute; top: calc(100% + 6px); left: 0; background: var(--teal2); border: 1px solid rgba(176,200,206,0.15); border-radius: 10px; padding: 8px; min-width: 200px; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity 0.2s, transform 0.2s, visibility 0.2s; box-shadow: 0 12px 40px rgba(0,0,0,0.3); z-index: 200; }
.nav-item:hover .nav-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-dropdown a { display: block; padding: 9px 14px; font-size: 13px; color: var(--lgrey); text-decoration: none; border-radius: 6px; transition: color 0.2s, background 0.2s; font-family: 'Ubuntu', sans-serif; }
.nav-dropdown a:hover { color: var(--white); background: rgba(255,255,255,0.08); }
.nav-dropdown-label { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mgrey); padding: 4px 14px 6px; }
.nav-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.nav-cta { background: var(--green); color: var(--teal); font-family: 'Ubuntu', sans-serif; font-size: 12px; font-weight: 700; padding: 8px 18px; border-radius: 6px; text-decoration: none; transition: background 0.2s; white-space: nowrap; }
.nav-cta:hover { background: #2eaa7a; }
/* ─── HERO ─── */
.hero { background: linear-gradient(135deg, var(--teal) 0%, var(--teal2) 60%, var(--teal3) 100%); position: relative; overflow: hidden; padding: 0; }
.hero-hex {
position: absolute;
top: 50%;
left: 0;
transform: translateY(-50%);
width: 50%;
height: auto;
opacity: 0.38;
pointer-events: none;
z-index: 0;
}
.hero-inner { max-width: 620px; }
.hero-container { max-width: 1200px; margin: 0 auto; padding: 56px 48px 48px; position: relative; z-index: 1; }
.hero-badge { display: inline-block; background: rgba(53,184,136,0.18); border: 1px solid rgba(53,184,136,0.4); color: var(--green); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 5px 14px; border-radius: 20px; margin-bottom: 18px; }
.hero h1 { font-size: clamp(24px, 3.5vw, 38px); font-weight: 700; color: var(--white); line-height: 1.2; margin-bottom: 14px; }
.hero h1 span { color: var(--green); }
.hero p { font-size: 15px; font-weight: 300; color: var(--lgrey); line-height: 1.7; max-width: 560px; }
/* ─── SAVINGS RANKED NOTE ─── */
.rank-bar { background: var(--teal2); border-top: 1px solid rgba(176,200,206,0.12); }
.rank-bar-inner { max-width: 1200px; margin: 0 auto; padding: 10px 48px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.rank-label { font-size: 11px; font-weight: 600; color: var(--mgrey); text-transform: uppercase; letter-spacing: 0.08em; margin-right: 8px; }
.rank-item { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--lgrey); padding: 3px 10px; border-radius: 20px; background: rgba(255,255,255,0.05); }
.rank-item .num { font-size: 10px; font-weight: 700; background: var(--green); color: var(--teal); width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rank-sep { color: rgba(176,200,206,0.3); font-size: 11px; }
/* ─── MAIN ─── */
.main { max-width: 1200px; margin: 0 auto; padding: 40px 48px 64px; display: grid; grid-template-columns: 1fr 400px; gap: 32px; align-items: start; }
/* ─── CARDS ─── */
.input-col { display: flex; flex-direction: column; gap: 20px; }
.card { background: var(--white); border-radius: 12px; padding: 26px 30px; border: 1px solid #dce8ec; box-shadow: 0 2px 12px rgba(1,59,73,0.06); }
.card.highlight { border-color: rgba(53,184,136,0.4); box-shadow: 0 2px 12px rgba(1,59,73,0.06), 0 0 0 1px rgba(53,184,136,0.15); }
.card-header { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid #eaf0f2; }
.card-icon { width: 38px; height: 38px; border-radius: 9px; background: linear-gradient(135deg, var(--teal), var(--teal3)); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.card-icon.green { background: linear-gradient(135deg, var(--green2), var(--green)); }
.card-icon svg { width: 18px; height: 18px; stroke: var(--white); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.card-num { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--green); margin-bottom: 2px; }
.card-title { font-size: 15px; font-weight: 700; color: var(--teal); }
.card-subtitle { font-size: 12px; color: var(--mgrey); margin-top: 2px; }
.biggest-tag { display: inline-block; font-size: 10px; font-weight: 700; background: rgba(53,184,136,0.12); color: var(--green); padding: 2px 8px; border-radius: 10px; margin-left: 8px; vertical-align: middle; text-transform: uppercase; letter-spacing: 0.06em; }
/* Fields */
.field-group { margin-bottom: 18px; }
.field-group:last-child { margin-bottom: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--teal); margin-bottom: 7px; letter-spacing: 0.02em; }
.field-hint { font-size: 11px; color: var(--mgrey); margin-top: 5px; font-weight: 300; line-height: 1.5; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-prefix { position: absolute; left: 12px; font-size: 13px; font-weight: 500; color: var(--mgrey); pointer-events: none; }
.input-suffix { position: absolute; right: 12px; font-size: 12px; font-weight: 500; color: var(--mgrey); pointer-events: none; }
input[type=number], select { width: 100%; padding: 11px 13px; border: 1.5px solid #c8dde3; border-radius: 8px; font-family: 'Ubuntu', sans-serif; font-size: 14px; color: var(--text); background: #f9fcfd; outline: none; transition: border-color 0.2s, box-shadow 0.2s; -moz-appearance: textfield; appearance: none; }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }
input[type=number]:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(53,184,136,0.15); background: var(--white); }
.has-prefix input { padding-left: 28px; }
.has-suffix input { padding-right: 38px; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B9BA8' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; cursor: pointer; }
/* Slider */
.slider-val { font-size: 13px; font-weight: 700; color: var(--teal); text-align: right; margin-bottom: 7px; }
input[type=range] { -webkit-appearance: none; width: 100%; height: 4px; background: linear-gradient(to right, var(--green) 0%, var(--green) var(--pct,50%), #c8dde3 var(--pct,50%)); border-radius: 4px; outline: none; cursor: pointer; border: none; padding: 0; box-shadow: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 17px; height: 17px; border-radius: 50%; background: var(--teal); border: 3px solid var(--white); box-shadow: 0 1px 5px rgba(1,59,73,0.3); cursor: pointer; }
.slider-labels { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--mgrey); margin-top: 5px; }
/* Optional note */
.opt-note { background: #f0f8f4; border: 1px solid rgba(53,184,136,0.25); border-radius: 8px; padding: 11px 14px; font-size: 11.5px; color: var(--teal2); line-height: 1.6; margin-bottom: 18px; }
.opt-note strong { color: var(--teal); }
/* Scenario tabs */
.scenario-tabs { display: flex; gap: 6px; margin-bottom: 18px; }
.scenario-tab { flex: 1; padding: 8px 4px; text-align: center; font-size: 12px; font-weight: 600; border: 1.5px solid #c8dde3; border-radius: 8px; cursor: pointer; transition: all 0.2s; color: var(--mgrey); background: var(--white); font-family: 'Ubuntu', sans-serif; }
.scenario-tab.active { background: var(--teal); border-color: var(--teal); color: var(--white); }
/* ─── RESULTS ─── */
.results-col { position: sticky; top: 24px; }
.results-card { background: var(--teal); border-radius: 14px; overflow: hidden; box-shadow: 0 8px 40px rgba(1,59,73,0.25); }
.results-header { background: linear-gradient(135deg, var(--teal2), var(--teal3)); padding: 22px 26px 20px; border-bottom: 1px solid rgba(176,200,206,0.12); position: relative; overflow: hidden; }
.results-header-hex { position: absolute; top: -20%; right: -10%; width: 55%; height: 160%; /* background image set inline in Results.jsx */ background-size: 80%; background-repeat: no-repeat; background-position: top right; opacity: 0.25; pointer-events: none; }
.results-header h2 { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--lgrey); margin-bottom: 3px; position: relative; z-index: 1; }
.results-header p { font-size: 11px; color: rgba(176,200,206,0.6); position: relative; z-index: 1; }
.results-body { padding: 20px 26px; }
/* Total */
.total-block { text-align: center; padding: 22px 0 18px; border-bottom: 1px solid rgba(176,200,206,0.12); margin-bottom: 16px; }
.total-label { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--lgrey); margin-bottom: 6px; }
.total-amount { font-size: clamp(20px, 2.8vw, 30px); font-weight: 700; color: var(--green); line-height: 1.1; letter-spacing: -0.5px; }
.total-sep { color: rgba(176,200,206,0.35); margin: 0 8px; }
.total-sub { font-size: 12px; color: var(--mgrey); margin-top: 5px; }
/* Breakdown */
.breakdown { display: flex; flex-direction: column; gap: 8px; }
.brow { background: rgba(255,255,255,0.05); border: 1px solid rgba(176,200,206,0.1); border-radius: 10px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.brow-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-green { background: var(--green); }
.dot-teal { background: #4EA7C4; }
.dot-blue { background: var(--lgrey); }
.dot-grey { background: var(--mgrey); }
.dot-orange { background: #E97132; }
.brow-info { flex: 1; min-width: 0; }
.brow-name { font-size: 11.5px; color: var(--lgrey); margin-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brow-val { font-size: 13.5px; font-weight: 700; color: var(--white); }
.brow-val.muted { color: var(--mgrey); font-size: 11.5px; font-weight: 400; font-style: italic; }
.assump-list.vis { display: block; }
.assump-list a { color: rgba(53,184,136,0.7); }
/* Disclaimer */
.disclaimer { max-width: 1200px; margin: 0 auto; padding: 0 48px 48px; font-size: 11px; color: #8aabb3; line-height: 1.7; }
.disclaimer strong { color: var(--mgrey); }
/* Footer */
.site-footer { background: var(--teal); padding: 22px 48px; text-align: center; font-size: 12px; color: rgba(176,200,206,0.5); }
.site-footer a { color: var(--green); text-decoration: none; }
@media (max-width: 960px) {
.main { grid-template-columns: 1fr; padding: 28px 24px 48px; }
.results-col { position: static; }
.hero, .rank-bar-inner, .disclaimer, .site-footer, .nav-inner { padding-left: 24px; padding-right: 24px; }
.hero-container { padding-left: 24px; padding-right: 24px; padding-top: 40px; padding-bottom: 36px; }
.field-row { grid-template-columns: 1fr; }
}
/* ═══════════════════════════════════════
LANDING PAGE STYLES
═══════════════════════════════════════ */
#phase-preview { display: block; }
#phase-access { display: none; }
/* HERO */
.lp-hero {
background: linear-gradient(135deg, var(--teal) 0%, var(--teal2) 60%, var(--teal3) 100%);
position: relative; overflow: hidden; padding: 0;
}
.lp-hero-hex {
position: absolute; top: 50%; left: 0;
transform: translateY(-50%);
width: 50%; height: auto;
opacity: 0.38; pointer-events: none; z-index: 0;
}
.lp-hero-inner {
max-width: 1200px; margin: 0 auto;
padding: 72px 48px 64px;
position: relative; z-index: 1;
}
.lp-hero-badge {
display: inline-block;
background: rgba(53,184,136,0.18);
border: 1px solid rgba(53,184,136,0.4);
color: var(--green);
font-size: 0.72rem; font-weight: 700;
letter-spacing: 0.1em; text-transform: uppercase;
padding: 5px 12px; border-radius: 4px; margin-bottom: 20px;
}
.lp-hero h1 {
font-size: clamp(1.9rem, 3.2vw, 2.8rem);
font-weight: 700; color: var(--white);
line-height: 1.15; margin-bottom: 20px; max-width: 700px;
}
.lp-hero h1 span { color: var(--green); }
.lp-hero-sub {
font-size: 1rem; color: var(--lgrey);
line-height: 1.65; max-width: 580px; margin-bottom: 36px;
}
.lp-hero-proof { display: flex; gap: 40px; flex-wrap: wrap; }
.lp-proof-item { display: flex; flex-direction: column; gap: 3px; }
.lp-proof-num { font-size: 1.6rem; font-weight: 700; color: var(--green); }
.lp-proof-label { font-size: 0.72rem; color: var(--lgrey); text-transform: uppercase; letter-spacing: 0.05em; }
/* WHAT YOU GET */
.lp-what {
background: #f8fafb;
border-top: 1px solid #e2ecef;
padding: 56px 0;
}
.lp-what-inner { max-width: 1200px; margin: 0 auto; padding: 0 48px; }
.lp-section-label {
text-align: center; font-size: 0.72rem; font-weight: 700;
letter-spacing: 0.12em; text-transform: uppercase;
color: var(--green); margin-bottom: 12px;
}
.lp-section-title {
text-align: center; font-size: 1.7rem; font-weight: 700;
color: var(--teal); margin-bottom: 8px;
}
.lp-section-sub {
text-align: center; font-size: 0.96rem; color: #556; margin-bottom: 48px;
}
.lp-assets { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.lp-asset-card {
background: white; border: 1px solid #dde8eb;
border-radius: 12px; overflow: hidden;
box-shadow: 0 2px 12px rgba(1,59,73,0.06);
}
.lp-asset-preview {
background: var(--teal); padding: 24px 24px 0;
min-height: 210px; overflow: hidden;
}
.lp-asset-preview-calc {
background: #f4f9fb; padding: 20px 20px 0;
min-height: 210px; border-bottom: 1px solid #dde8eb;
}
.lp-slide-thumb {
border-radius: 4px 4px 0 0; width: 100%;
display: block; box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.calc-mock {
background: white; border-radius: 8px 8px 0 0;
padding: 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.calc-mock-header {
background: var(--teal); color: white;
padding: 10px 14px; border-radius: 6px;
font-size: 0.75rem; font-weight: 600; margin-bottom: 10px;
}
.calc-mock-row {
display: grid; grid-template-columns: 1fr 1fr;
gap: 6px; margin-bottom: 6px;
}
.calc-mock-field {
background: #f4f9fb; border: 1px solid #dde;
border-radius: 4px; padding: 7px 10px;
font-size: 0.7rem; color: #667;
}
.calc-mock-result {
background: linear-gradient(135deg,var(--teal),var(--teal2));
border-radius: 6px; padding: 10px 14px; margin-top: 8px;
}
.calc-mock-result-label { font-size: 0.65rem; color: var(--lgrey); margin-bottom: 2px; }
.calc-mock-result-val { font-size: 1.1rem; font-weight: 700; color: var(--green); }
.lp-asset-info { padding: 24px; }
.lp-asset-tag {
display: inline-block; font-size: 0.65rem; font-weight: 700;
text-transform: uppercase; letter-spacing: 0.1em;
color: var(--green); background: rgba(53,184,136,0.1);
border: 1px solid rgba(53,184,136,0.2);
padding: 3px 8px; border-radius: 3px; margin-bottom: 10px;
}
.lp-asset-info h3 {
font-size: 1.05rem; font-weight: 700; color: var(--teal); margin-bottom: 8px;
}
.lp-asset-info p {
font-size: 0.87rem; color: #556; line-height: 1.6; margin-bottom: 16px;
}
.lp-asset-bullets {
list-style: none; margin: 0; padding: 0;
display: flex; flex-direction: column; gap: 6px;
}
.lp-asset-bullets li {
font-size: 0.82rem; color: #445;
display: flex; align-items: flex-start; gap: 8px;
}
.lp-asset-bullets li::before {
content: ''; width: 6px; height: 6px;
background: var(--green); border-radius: 50%;
margin-top: 5px; flex-shrink: 0;
}
/* REGISTRATION */
.lp-reg {
background: white; border-top: 1px solid #e2ecef; padding: 64px 0;
}
.lp-reg-inner { max-width: 760px; margin: 0 auto; padding: 0 48px; }
.lp-reg-box {
background: white; border: 1px solid #dde8eb;
border-radius: 16px; padding: 40px 48px;
box-shadow: 0 4px 24px rgba(1,59,73,0.08);
}
.lp-reg-title {
font-size: 1.5rem; font-weight: 700; color: var(--teal);
margin-bottom: 8px; text-align: center;
}
.lp-reg-sub {
text-align: center; font-size: 0.9rem; color: #667; margin-bottom: 32px;
}
.lp-form-grid {
display: grid; grid-template-columns: 1fr 1fr;
gap: 16px; margin-bottom: 16px;
}
.lp-form-full { grid-column: 1 / -1; }
.lp-field { display: flex; flex-direction: column; gap: 5px; }
.lp-field label {
font-size: 0.78rem; font-weight: 600; color: var(--teal);
text-transform: uppercase; letter-spacing: 0.05em;
}
.lp-field input, .lp-field select {
padding: 11px 14px; border: 1.5px solid #ccd8dc;
border-radius: 7px; font-family: 'Ubuntu', sans-serif;
font-size: 0.9rem; color: #334; background: white; outline: none;
transition: border-color 0.15s;
}
.lp-field input:focus, .lp-field select:focus {
border-color: var(--teal); box-shadow: 0 0 0 3px rgba(1,59,73,0.08);
}
.lp-submit {
width: 100%; padding: 14px;
background: var(--green); color: white;
font-family: 'Ubuntu', sans-serif;
font-size: 1rem; font-weight: 700;
border: none; border-radius: 8px;
cursor: pointer; margin-top: 8px;
transition: background 0.15s, transform 0.1s;
}
.lp-submit:hover { background: var(--green2); transform: translateY(-1px); }
.lp-privacy {
text-align: center; font-size: 0.75rem; color: #889; margin-top: 16px;
}
.lp-privacy a { color: var(--mgrey); }
#form-error {
background: #fff0f0; border: 1px solid #fcc; color: #c00;
padding: 10px 14px; border-radius: 6px; font-size: 0.85rem;
margin-bottom: 12px; display: none;
}
/* POST-REGISTRATION */
.lp-access { background: #f4f8fa; }
.access-welcome {
background: linear-gradient(135deg, var(--teal) 0%, var(--teal2) 100%);
padding: 28px 48px;
display: flex; align-items: center; gap: 20px;
max-width: 100%;
}
.access-welcome-icon {
width: 44px; height: 44px;
background: rgba(53,184,136,0.2); border-radius: 50%;
display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.access-welcome-icon svg { width:22px; height:22px; stroke:var(--green); fill:none; stroke-width:2.5; }
.access-welcome-text h2 { font-size: 1.05rem; font-weight: 700; color: white; margin-bottom: 2px; }
.access-welcome-text p { font-size: 0.85rem; color: var(--lgrey); }
/* Tab navigation */
.lp-tabs {
max-width: 1200px; margin: 0 auto;
padding: 32px 48px 0;
display: flex; gap: 0; border-bottom: 2px solid #dde8eb;
}
.lp-tab {
padding: 12px 28px 14px;
font-family: 'Ubuntu', sans-serif;
font-size: 0.95rem; font-weight: 600;
color: #778; border: none;
background: none; cursor: pointer;
border-bottom: 3px solid transparent;
margin-bottom: -2px;
transition: color 0.15s, border-color 0.15s;
display: flex; align-items: center; gap: 8px;
}
.lp-tab svg { width:16px; height:16px; stroke:currentColor; fill:none; stroke-width:2; }
.lp-tab.active { color: var(--teal); border-bottom-color: var(--green); }
.lp-tab:hover:not(.active) { color: var(--teal); }
.lp-tab-content { display: none; }
.lp-tab-content.active { display: block; }
/* DECK VIEWER */
.deck-viewer-wrap {
max-width: 1200px; margin: 0 auto; padding: 36px 48px 56px;
}
.deck-viewer-top {
display: flex; align-items: center; justify-content: space-between;
margin-bottom: 20px; gap: 16px; flex-wrap: wrap;
}
.deck-viewer-title { font-size: 1.1rem; font-weight: 700; color: var(--teal); }
.deck-viewer-sub { font-size: 0.85rem; color: #667; margin-top: 2px; }
.deck-dl-btn {
display: inline-flex; align-items: center; gap: 8px;
background: var(--teal); color: white; text-decoration: none;
padding: 11px 22px; border-radius: 8px;
font-family: 'Ubuntu', sans-serif;
font-weight: 700; font-size: 0.88rem;
transition: background 0.15s; flex-shrink: 0;
}
.deck-dl-btn:hover { background: var(--teal2); }
.deck-dl-btn svg { width:15px; height:15px; stroke:currentColor; fill:none; stroke-width:2.5; }
/* Slide viewer */
.slide-viewer {
background: #1a1a2e;
border-radius: 12px; overflow: hidden;
box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}
.slide-display {
position: relative;
background: #111;
display: flex; align-items: center; justify-content: center;
min-height: 400px;
}
.slide-display img {
width: 100%; max-height: 600px;
object-fit: contain; display: block;
}
.slide-nav-btn {
position: absolute; top: 50%; transform: translateY(-50%);
width: 44px; height: 44px;
background: rgba(0,0,0,0.55); color: white;
border: 1px solid rgba(255,255,255,0.15); border-radius: 50%;
cursor: pointer; display: flex; align-items: center; justify-content: center;
transition: background 0.15s; z-index: 2;
font-family: 'Ubuntu', sans-serif; font-size: 1.1rem;
}
.slide-nav-btn:hover { background: rgba(0,0,0,0.8); }
.slide-nav-btn.prev { left: 14px; }
.slide-nav-btn.next { right: 14px; }
.slide-nav-btn:disabled { opacity: 0.25; cursor: default; }
.slide-controls {
background: #13131f;
padding: 14px 20px;
display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.slide-counter {
font-size: 0.85rem; font-weight: 600; color: #aaa;
min-width: 60px;
}
.slide-thumbs {
display: flex; gap: 6px; overflow-x: auto;
padding: 4px 0; flex: 1; justify-content: center;
scrollbar-width: thin; scrollbar-color: #444 #13131f;
}
.slide-thumb-btn {
width: 52px; height: 32px; flex-shrink: 0;
border-radius: 3px; overflow: hidden; cursor: pointer;
border: 2px solid transparent; padding: 0;
transition: border-color 0.15s, opacity 0.15s;
opacity: 0.5;
}
.slide-thumb-btn.active { border-color: var(--green); opacity: 1; }
.slide-thumb-btn:hover { opacity: 0.85; }
.slide-thumb-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* CALCULATOR TAB */
.calc-tab-wrap {
max-width: 1200px; margin: 0 auto; padding: 36px 48px 56px;
}
.calc-tab-header {
margin-bottom: 24px; padding-bottom: 16px;
border-bottom: 1px solid #e2ecef;
}
.calc-tab-header h2 {
font-size: 1.2rem; font-weight: 700; color: var(--teal); margin-bottom: 4px;
}
.calc-tab-header p { font-size: 0.88rem; color: #667; }
/* Report download */
.lp-report-bar {
background: linear-gradient(135deg, #f0fdf7, #e8f8f1);
border: 1.5px solid rgba(53,184,136,0.3);
border-radius: 10px; padding: 24px 28px;
display: flex; align-items: center; justify-content: space-between;
gap: 24px; margin-top: 32px; flex-wrap: wrap;
}
.lp-report-bar-text h4 { font-size: 1rem; font-weight: 700; color: var(--teal); margin-bottom: 4px; }
.lp-report-bar-text p { font-size: 0.85rem; color: #556; }
.report-dl-btn {
display: inline-flex; align-items: center; gap: 8px;
background: var(--green); color: white; border: none;
padding: 12px 24px; border-radius: 8px;
font-family: 'Ubuntu', sans-serif; font-weight: 700; font-size: 0.9rem;
cursor: pointer; transition: background 0.15s, opacity 0.15s; white-space: nowrap;
}
.report-dl-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.report-dl-btn:not(:disabled):hover { background: var(--green2); }
.report-dl-btn svg { width:15px; height:15px; stroke:currentColor; fill:none; stroke-width:2.5; }
.report-note { font-size: 0.75rem; color: #889; margin-top: 8px; }
/* FOOTER */
.lp-footer {
background: var(--teal); padding: 28px 48px; text-align: center;
}
.lp-footer p { font-size: 0.8rem; color: var(--lgrey); }
.lp-footer a { color: var(--green); text-decoration: none; }
/* Responsive */
@media (max-width: 900px) {
.lp-hero-inner { padding: 48px 24px 40px; }
.lp-assets { grid-template-columns: 1fr; }
.lp-form-grid { grid-template-columns: 1fr; }
.lp-reg-box { padding: 28px 24px; }
.lp-reg-inner { padding: 0 24px; }
.lp-what-inner { padding: 0 24px; }
.lp-tabs { padding: 24px 24px 0; }
.deck-viewer-wrap, .calc-tab-wrap { padding: 24px 24px 48px; }
.access-welcome { padding: 20px 24px; }
.main { grid-template-columns: 1fr !important; }
.results-col { position: static !important; }
.lp-report-bar { flex-direction: column; align-items: flex-start; }
}
/* Assumptions */
.assump-section { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(176,200,206,0.1); }
.assump-toggle { font-size: 11px; color: var(--mgrey); cursor: pointer; display: flex; align-items: center; gap: 5px; background: none; border: none; padding: 0; font-family: 'Ubuntu', sans-serif; transition: color 0.2s; }
.assump-toggle:hover { color: var(--lgrey); }
.assump-toggle svg { width: 11px; height: 11px; stroke: currentColor; fill: none; transition: transform 0.2s; }
.assump-toggle.open svg { transform: rotate(180deg); }
.assump-list { display: none; margin-top: 10px; font-size: 10.5px; color: rgba(176,200,206,0.55); line-height: 1.9; }
/* ── Welcome bar inner alignment ── */
.access-welcome { padding: 0; }
.access-welcome-inner {
max-width: 1200px; margin: 0 auto;
padding: 22px 48px;
display: flex; align-items: center; gap: 20px; width: 100%;
}
/* ── Calculator tab layout alignment ── */
.calc-tab-wrap .main {
padding-left: 0;
padding-right: 0;
padding-top: 24px;
padding-bottom: 20px;
}
.calc-tab-wrap .rank-bar-inner {
padding-left: 20px;
padding-right: 20px;
max-width: none;
}
/* Disclaimer alignment and spacing */
.calc-tab-wrap .disclaimer {
padding-left: 0;
padding-right: 0;
padding-bottom: 0;
margin-top: 12px;
}
/* Report bar spacing */
.calc-tab-wrap .lp-report-bar {
margin-top: 14px;
}
@media (max-width: 900px) {
.access-welcome-inner { padding: 18px 24px; }
.calc-tab-wrap .rank-bar-inner { padding-left: 0; padding-right: 0; }
}
/* ═══ React port additions ═══ */
.lp-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.lp-submit:disabled { opacity: 0.6; cursor: wait; transform: none; }
.welcome-reset { background: none; border: none; color: var(--green); font-family: 'Ubuntu', sans-serif; font-size: 0.8rem; cursor: pointer; padding: 0; margin-left: 6px; text-decoration: underline; }
.report-error { color: #c00; }
.report-dl-btn.busy { cursor: wait; }
.lp-field-hint { font-size: 0.75rem; color: #889; line-height: 1.5; }
+8
View File
@@ -0,0 +1,8 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
// base: './' → the build works from any folder on any static host (own server, S3, Webflow assets, etc.)
export default defineConfig({
base: './',
plugins: [react()],
});