Compare commits

...
6 Commits
Author SHA1 Message Date
Paul Jenkins 96772b1480 update sitemap (last mod date)
CI / build (push) Canceled after 0s
2026-10-28 10:31:35 +00:00
Paul Jenkins 0a83577312 updated sitemap
CI / build (push) Canceled after 0s
2026-10-28 09:05:41 +00:00
MehboobKandClaude Sonnet 5 6d89264265 Fix Mobile SDK hero layout: restore demo into hero, lay out as a row
CI / build (push) Canceled after 0s
The hero's live phone demo had been split into a separate section below
the hero in an earlier commit, leaving the heading stranded in an
oversized, mostly-empty hero and the demo adrift further down the page.
Moves the demo mount back inside .bd-hero-top as originally intended,
lays the heading and demo out side by side in a row (falling back to a
stacked column below 1480px where the demo's fixed-width block would
otherwise clip), compacts the tile grid to two columns, and widens the
text column so copy wraps more naturally.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-27 19:03:46 +05:00
MehboobKandClaude Sonnet 5 ca838ba287 Gate the ROI calculator behind a registration form, add strategy deck
CI / build (push) Canceled after 0s
Replaces the open calculator with the intended flow: visitors register
(name, company, title, business email, region, device count) to unlock
a 15-slide Strategy Deck viewer and the ROI Calculator. Both the deck
and a personalised ROI report now download as real PowerPoint files,
built client-side with JSZip by patching the deck template's XML.
Registration and report downloads are captured as enquiries via the
existing /api/leads endpoint. Drops the old PNG results-slide export
(html2canvas) in favour of the PPTX report.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-26 14:34:13 +05:00
MehboobKandClaude Sonnet 5 5232e6bd64 Add download button to the ROI slide card
CI / build (push) Canceled after 0s
Lazy-loads html2canvas (separate chunk, only fetched on click) to export
the card as a PNG. The button floats on the card's top-right corner,
outside the captured element, so it never ends up in the exported image.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-19 17:32:18 +05:00
MehboobKandClaude Sonnet 5 6d1ad44e6d Restore hero image for the South-east Asia blog post
The wp-content URL 404s on the current server, but the Wayback Machine
had a genuine image/png capture from 2026-09-02 (a later crawl only
caught the SPA fallback page, which is why the dead link looked "alive").
Recovered it, re-encoded as JPEG to match the other migrated posts, and
wired it back into the post's hero field.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-19 17:25:43 +05:00
36 changed files with 1958 additions and 1157 deletions
+100
View File
@@ -9,6 +9,7 @@
"version": "1.0.0", "version": "1.0.0",
"dependencies": { "dependencies": {
"framer-motion": "^11.18.2", "framer-motion": "^11.18.2",
"jszip": "^3.10.2",
"react": "^18.3.1", "react": "^18.3.1",
"react-dom": "^18.3.1", "react-dom": "^18.3.1",
"react-router-dom": "^6.26.2", "react-router-dom": "^6.26.2",
@@ -1326,6 +1327,12 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/core-util-is": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
"license": "MIT"
},
"node_modules/csstype": { "node_modules/csstype": {
"version": "3.2.3", "version": "3.2.3",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",
@@ -1587,6 +1594,18 @@
"node": ">=20.19.0" "node": ">=20.19.0"
} }
}, },
"node_modules/immediate": {
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
"integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==",
"license": "MIT"
},
"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/is-plain-object": { "node_modules/is-plain-object": {
"version": "5.0.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
@@ -1596,6 +1615,12 @@
"node": ">=0.10.0" "node": ">=0.10.0"
} }
}, },
"node_modules/isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==",
"license": "MIT"
},
"node_modules/js-tokens": { "node_modules/js-tokens": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
@@ -1628,6 +1653,18 @@
"node": ">=6" "node": ">=6"
} }
}, },
"node_modules/jszip": {
"version": "3.10.2",
"resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.2.tgz",
"integrity": "sha512-3l+rb15IOWtUhU0H5MFqES/T6Kh7abYwjosBey/vD6hDt8zoEffkSC5Ws5SGtgVw3gBx2NEbhTeSW1+kWkpyTQ==",
"license": "(MIT OR GPL-3.0-or-later)",
"dependencies": {
"lie": "~3.3.0",
"pako": "~1.0.2",
"readable-stream": "~2.3.6",
"setimmediate": "^1.0.5"
}
},
"node_modules/launder": { "node_modules/launder": {
"version": "1.7.1", "version": "1.7.1",
"resolved": "https://registry.npmjs.org/launder/-/launder-1.7.1.tgz", "resolved": "https://registry.npmjs.org/launder/-/launder-1.7.1.tgz",
@@ -1637,6 +1674,15 @@
"dayjs": "^1.11.7" "dayjs": "^1.11.7"
} }
}, },
"node_modules/lie": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz",
"integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==",
"license": "MIT",
"dependencies": {
"immediate": "~3.0.5"
}
},
"node_modules/loose-envify": { "node_modules/loose-envify": {
"version": "1.4.0", "version": "1.4.0",
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
@@ -1709,6 +1755,12 @@
"node": ">=18" "node": ">=18"
} }
}, },
"node_modules/pako": {
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
"integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==",
"license": "(MIT AND Zlib)"
},
"node_modules/parse-srcset": { "node_modules/parse-srcset": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/parse-srcset/-/parse-srcset-1.0.2.tgz", "resolved": "https://registry.npmjs.org/parse-srcset/-/parse-srcset-1.0.2.tgz",
@@ -1749,6 +1801,12 @@
"node": "^10 || ^12 || >=14" "node": "^10 || ^12 || >=14"
} }
}, },
"node_modules/process-nextick-args": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
"license": "MIT"
},
"node_modules/react": { "node_modules/react": {
"version": "18.3.1", "version": "18.3.1",
"resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz",
@@ -1816,6 +1874,21 @@
"react-dom": ">=16.8" "react-dom": ">=16.8"
} }
}, },
"node_modules/readable-stream": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
"integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
"license": "MIT",
"dependencies": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
"isarray": "~1.0.0",
"process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
"util-deprecate": "~1.0.1"
}
},
"node_modules/rollup": { "node_modules/rollup": {
"version": "4.62.2", "version": "4.62.2",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.62.2.tgz", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.62.2.tgz",
@@ -1861,6 +1934,12 @@
"fsevents": "~2.3.2" "fsevents": "~2.3.2"
} }
}, },
"node_modules/safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
"license": "MIT"
},
"node_modules/sanitize-html": { "node_modules/sanitize-html": {
"version": "2.17.7", "version": "2.17.7",
"resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-2.17.7.tgz", "resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-2.17.7.tgz",
@@ -1898,6 +1977,12 @@
"semver": "bin/semver.js" "semver": "bin/semver.js"
} }
}, },
"node_modules/setimmediate": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
"integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==",
"license": "MIT"
},
"node_modules/source-map-js": { "node_modules/source-map-js": {
"version": "1.2.1", "version": "1.2.1",
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
@@ -1907,6 +1992,15 @@
"node": ">=0.10.0" "node": ">=0.10.0"
} }
}, },
"node_modules/string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"license": "MIT",
"dependencies": {
"safe-buffer": "~5.1.0"
}
},
"node_modules/tslib": { "node_modules/tslib": {
"version": "2.8.1", "version": "2.8.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
@@ -1958,6 +2052,12 @@
"browserslist": ">= 4.21.0" "browserslist": ">= 4.21.0"
} }
}, },
"node_modules/util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
"license": "MIT"
},
"node_modules/vite": { "node_modules/vite": {
"version": "5.4.21", "version": "5.4.21",
"resolved": "https://registry.npmjs.org/vite/-/vite-5.4.21.tgz", "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.21.tgz",
+1
View File
@@ -15,6 +15,7 @@
}, },
"dependencies": { "dependencies": {
"framer-motion": "^11.18.2", "framer-motion": "^11.18.2",
"jszip": "^3.10.2",
"react": "^18.3.1", "react": "^18.3.1",
"react-dom": "^18.3.1", "react-dom": "^18.3.1",
"react-router-dom": "^6.26.2", "react-router-dom": "^6.26.2",
Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.
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

+15 -10
View File
@@ -2,52 +2,57 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url> <url>
<loc>https://www.blackdice.ai/</loc> <loc>https://www.blackdice.ai/</loc>
<lastmod>2026-08-14</lastmod> <lastmod>2026-10-28</lastmod>
<priority>1.0</priority> <priority>1.0</priority>
</url> </url>
<url> <url>
<loc>https://www.blackdice.ai/mobile-sdk</loc> <loc>https://www.blackdice.ai/mobile-sdk</loc>
<lastmod>2026-08-14</lastmod> <lastmod>2026-10-28</lastmod>
<priority>0.9</priority> <priority>0.9</priority>
</url> </url>
<url> <url>
<loc>https://www.blackdice.ai/dns-protect</loc> <loc>https://www.blackdice.ai/dns-protect</loc>
<lastmod>2026-08-14</lastmod> <lastmod>2026-10-28</lastmod>
<priority>0.9</priority> <priority>0.9</priority>
</url> </url>
<url> <url>
<loc>https://www.blackdice.ai/halo-cpe</loc> <loc>https://www.blackdice.ai/halo-cpe</loc>
<lastmod>2026-08-14</lastmod> <lastmod>2026-10-28</lastmod>
<priority>0.9</priority> <priority>0.9</priority>
</url> </url>
<url> <url>
<loc>https://www.blackdice.ai/for-operators</loc> <loc>https://www.blackdice.ai/for-operators</loc>
<lastmod>2026-08-14</lastmod> <lastmod>2026-10-28</lastmod>
<priority>0.8</priority> <priority>0.8</priority>
</url> </url>
<url>
<loc>https://www.blackdice.ai/roi-calculator</loc>
<lastmod>2026-10-28</lastmod>
<priority>0.7</priority>
</url>
<url> <url>
<loc>https://www.blackdice.ai/financial-services</loc> <loc>https://www.blackdice.ai/financial-services</loc>
<lastmod>2026-08-14</lastmod> <lastmod>2026-10-28</lastmod>
<priority>0.8</priority> <priority>0.8</priority>
</url> </url>
<url> <url>
<loc>https://www.blackdice.ai/why-blackdice</loc> <loc>https://www.blackdice.ai/why-blackdice</loc>
<lastmod>2026-08-14</lastmod> <lastmod>2026-10-28</lastmod>
<priority>0.7</priority> <priority>0.7</priority>
</url> </url>
<url> <url>
<loc>https://www.blackdice.ai/news</loc> <loc>https://www.blackdice.ai/news</loc>
<lastmod>2026-08-14</lastmod> <lastmod>2026-10-28</lastmod>
<priority>0.8</priority> <priority>0.8</priority>
</url> </url>
<url> <url>
<loc>https://www.blackdice.ai/investors</loc> <loc>https://www.blackdice.ai/investors</loc>
<lastmod>2026-08-14</lastmod> <lastmod>2026-10-28</lastmod>
<priority>0.6</priority> <priority>0.6</priority>
</url> </url>
<url> <url>
<loc>https://www.blackdice.ai/contact</loc> <loc>https://www.blackdice.ai/contact</loc>
<lastmod>2026-08-14</lastmod> <lastmod>2026-10-28</lastmod>
<priority>0.7</priority> <priority>0.7</priority>
</url> </url>
<url> <url>
File diff suppressed because one or more lines are too long
+1 -2
View File
@@ -19,7 +19,6 @@
grid-template-columns: 268px minmax(0, 420px); grid-template-columns: 268px minmax(0, 420px);
column-gap: 32px; column-gap: 32px;
align-items: center; align-items: center;
justify-content: space-between;
} }
/* ============================================================ /* ============================================================
@@ -29,7 +28,7 @@
grid-column: 1; grid-column: 1;
grid-row: 1; grid-row: 1;
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(2, 1fr);
gap: 8px; gap: 8px;
align-content: start; align-content: start;
} }
+41 -505
View File
@@ -1,521 +1,57 @@
import { useEffect, useMemo, useState } from 'react' import { useState } from 'react'
import './roiCalculator.css' import './roiCalculator.css'
import { import { INPUTS_KEY } from './calc.js'
calculate, import RoiLanding, { type Registrant } from './RoiLanding'
ddosCostFromSlider, import RoiToolkit from './RoiToolkit'
fmt,
fmtRange,
formatForDeck,
INPUTS_KEY,
loadInputs,
REGIONS,
regionLabel,
} from './calc.js'
import RoiSlide from './RoiSlide'
import { submitLead } from '../../cms/api' import { submitLead } from '../../cms/api'
const Icon = { const REG_KEY = 'bd_roi_registrant'
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>
),
slide: (
<svg viewBox="0 0 24 24">
<rect x="2" y="4" width="20" height="14" rx="2" />
<path d="M8 21h8M12 18v3" />
</svg>
),
}
function CardHeader({ function loadRegistrant(): Registrant | null {
icon, try {
green, return JSON.parse(localStorage.getItem(REG_KEY) || 'null')
num, } catch {
title, return null
subtitle, }
}: {
icon: React.ReactNode
green?: boolean
num: string
title: string
subtitle: string
}) {
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: number, min: number, max: number) => `${(((val - min) / (max - min)) * 100).toFixed(1)}%`
/** Plain-text summary of a visitor's inputs and results, stored as the enquiry's message. */
function buildRoiSummary(i: Record<string, any>, r: ReturnType<typeof calculate>) {
return [
`Active subscribers: ${i.subs ? Number(i.subs).toLocaleString('en-US') : '—'}`,
`Region: ${i.region === 'custom' ? `Custom ($${i.customPrice || 0}/GB)` : regionLabel(i.region)}`,
`Bandwidth scenario: ${i.scenario}`,
`Support calls per 1,000 subs/month: ${i.callsPer1000}`,
`Average cost per call: $${i.callCost}`,
`Security-related calls: ${i.securityPct}%`,
`Monthly ARPU: ${i.arpu ? `$${i.arpu}` : '—'}`,
`Annual churn rate: ${i.churn ? `${i.churn}%` : '—'}`,
`Annual network infrastructure OpEx: ${i.netOpex ? `$${Number(i.netOpex).toLocaleString('en-US')}` : '—'}`,
`DDoS incidents per year: ${i.ddos || 0}`,
'',
`Total estimated annual savings: ${fmtRange(r.total.lo, r.total.hi) || '—'}`,
` Bandwidth savings: ${fmtRange(r.bw.lo, r.bw.hi) || '—'}`,
` Support call reduction: ${fmtRange(r.calls.lo, r.calls.hi) || '—'}`,
` Churn reduction: ${fmtRange(r.churn.lo, r.churn.hi) || '—'}`,
` Network equipment: ${fmtRange(r.equip.lo, r.equip.hi) || '—'}`,
` DDoS avoided costs: ${fmtRange(r.ddos.lo, r.ddos.hi) || '—'}`,
].join('\n')
} }
export default function RoiCalculator() { export default function RoiCalculator() {
const [i, setI] = useState(loadInputs) const [registrant, setRegistrant] = useState<Registrant | null>(loadRegistrant)
const [showAssump, setShowAssump] = useState(false)
const [showSlide, setShowSlide] = useState(false)
const [lead, setLead] = useState({ name: '', email: '', company: '' })
const [leadState, setLeadState] = useState<'idle' | 'sending' | 'sent' | 'error'>('idle')
const update = (patch: Record<string, unknown>) => { async function handleRegister(reg: Registrant) {
setI((s: typeof i) => ({ ...s, ...patch })) submitLead({
setShowSlide(false) form: 'roi-toolkit-registration',
} name: `${reg.first} ${reg.last}`.trim(),
const set = (k: string) => (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement>) => update({ [k]: e.target.value }) email: reg.email,
company: reg.company,
const r = useMemo(() => calculate(i), [i])
const submitRoiLead = async (e: React.FormEvent) => {
e.preventDefault()
if (!lead.email.trim() || leadState === 'sending') return
setLeadState('sending')
try {
await submitLead({
form: 'roi-calculator',
name: lead.name.trim(),
email: lead.email.trim(),
company: lead.company.trim(),
page: '/roi-calculator', page: '/roi-calculator',
message: buildRoiSummary(i, r), message: [
}) `Job title: ${reg.title}`,
setLeadState('sent') reg.region && `Region: ${reg.region}`,
} catch { reg.subscribers && `Active subscribers: ${Number(reg.subscribers).toLocaleString('en-US')}`,
setLeadState('error') ]
} .filter(Boolean)
} .join('\n'),
}).catch(() => {})
// Remember inputs for this visitor (survives refresh)
useEffect(() => {
try { try {
localStorage.setItem(INPUTS_KEY, JSON.stringify(i)) localStorage.setItem(REG_KEY, JSON.stringify(reg))
} catch { } catch {
/* storage unavailable */ /* storage unavailable */
} }
}, [i]) setRegistrant(reg)
window.scrollTo({ top: 0, behavior: 'smooth' })
}
const rows: [string, string, string, string][] = [ function handleReset() {
['bw', 'dot-grey', '① Bandwidth savings', 'Enter subscriber count and region'], try {
['calls', 'dot-green', '② Support call reduction', 'Enter subscriber count and call volume'], localStorage.removeItem(REG_KEY)
['churn', 'dot-teal', '③ Churn reduction', 'Enter ARPU and churn rate'], localStorage.removeItem(INPUTS_KEY)
['equip', 'dot-blue', '④ Network equipment', 'Enter infrastructure OpEx (optional)'], } catch {
['ddos', 'dot-orange', '⑤ DDoS avoided costs', 'No incidents entered'], /* ignore */
] }
setRegistrant(null)
window.scrollTo({ top: 0 })
}
return ( return <div className="roi-calc">{registrant ? <RoiToolkit registrant={registrant} onReset={handleReset} /> : <RoiLanding onRegister={handleRegister} />}</div>
<div className="roi-calc">
<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, view your personalised results slide.</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: any) => (
<optgroup key={g.group} label={g.group}>
{g.options.map((o: any) => (
<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],
] as const
).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' as any]: 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(--roi-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' as any]: `${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(/roi/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 as any)[k].lo, (r as any)[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(--roi-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(--roi-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(--roi-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(--roi-lgrey)' }}>Network equipment</strong>
<br />
Junk traffic reduction lowers equipment utilisation by 2–4%
<br />
<br />
<strong style={{ color: 'var(--roi-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>
{r.complete && (
<div className="lp-report-bar" style={{ marginTop: 24 }}>
<div className="lp-report-bar-text">
<h4>Send these results to your team</h4>
{leadState === 'sent' ? (
<p>Thanks — your results have been recorded. We'll follow up shortly.</p>
) : (
<form className="roi-lead-form" onSubmit={submitRoiLead}>
<input
type="text"
placeholder="Name"
value={lead.name}
onChange={(e) => setLead((s) => ({ ...s, name: e.target.value }))}
/>
<input
type="email"
placeholder="Work email"
required
value={lead.email}
onChange={(e) => setLead((s) => ({ ...s, email: e.target.value }))}
/>
<input
type="text"
placeholder="Company (optional)"
value={lead.company}
onChange={(e) => setLead((s) => ({ ...s, company: e.target.value }))}
/>
<button className="report-dl-btn" type="submit" disabled={leadState === 'sending'}>
{leadState === 'sending' ? 'Sending…' : 'Submit my results'}
</button>
</form>
)}
{leadState === 'error' && <p className="report-note" style={{ color: '#c0392b' }}>Something went wrong — please try again.</p>}
</div>
</div>
)}
<div className="lp-report-bar">
<div className="lp-report-bar-text">
<h4>Your personalised ROI slide</h4>
<p>A clean, presentation-style summary of your operator's estimated annual saving across all five categories, ready to screenshot or share.</p>
<p className="report-note" aria-live="polite">
{r.complete ? 'Your personalised slide is ready to view.' : 'Complete the calculator above to unlock your personalised slide.'}
</p>
</div>
<button className="report-dl-btn" onClick={() => setShowSlide((v) => !v)} disabled={!r.complete}>
{Icon.slide}
{showSlide ? 'Hide My ROI Slide' : 'Show My ROI Slide'}
</button>
</div>
{showSlide && r.complete && <RoiSlide values={formatForDeck(i, r)} results={r} />}
</div>
</div>
)
} }
+493
View File
@@ -0,0 +1,493 @@
import { useEffect, useMemo, useState } from 'react'
import {
calculate,
ddosCostFromSlider,
fmt,
fmtRange,
formatForDeck,
INPUTS_KEY,
loadInputs,
REGIONS,
regionLabel,
} from './calc.js'
import { buildPersonalisedDeck, prefetchTemplate, triggerDownload } from './pptxReport.js'
import { submitLead } from '../../cms/api'
import type { Registrant } from './RoiLanding'
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,
}: {
icon: React.ReactNode
green?: boolean
num: string
title: string
subtitle: string
}) {
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: number, min: number, max: number) => `${(((val - min) / (max - min)) * 100).toFixed(1)}%`
/** Plain-text summary of a visitor's inputs and results, stored as the enquiry's message. */
function buildRoiSummary(i: Record<string, any>, r: ReturnType<typeof calculate>) {
return [
`Active subscribers: ${i.subs ? Number(i.subs).toLocaleString('en-US') : '—'}`,
`Region: ${i.region === 'custom' ? `Custom ($${i.customPrice || 0}/GB)` : regionLabel(i.region)}`,
`Bandwidth scenario: ${i.scenario}`,
`Support calls per 1,000 subs/month: ${i.callsPer1000}`,
`Average cost per call: $${i.callCost}`,
`Security-related calls: ${i.securityPct}%`,
`Monthly ARPU: ${i.arpu ? `$${i.arpu}` : '—'}`,
`Annual churn rate: ${i.churn ? `${i.churn}%` : '—'}`,
`Annual network infrastructure OpEx: ${i.netOpex ? `$${Number(i.netOpex).toLocaleString('en-US')}` : '—'}`,
`DDoS incidents per year: ${i.ddos || 0}`,
'',
`Total estimated annual savings: ${fmtRange(r.total.lo, r.total.hi) || '—'}`,
` Bandwidth savings: ${fmtRange(r.bw.lo, r.bw.hi) || '—'}`,
` Support call reduction: ${fmtRange(r.calls.lo, r.calls.hi) || '—'}`,
` Churn reduction: ${fmtRange(r.churn.lo, r.churn.hi) || '—'}`,
` Network equipment: ${fmtRange(r.equip.lo, r.equip.hi) || '—'}`,
` DDoS avoided costs: ${fmtRange(r.ddos.lo, r.ddos.hi) || '—'}`,
].join('\n')
}
export default function RoiCalculatorTab({ registrant, active }: { registrant: Registrant; active: boolean }) {
const [i, setI] = useState<any>(() => loadInputs(registrant))
const [showAssump, setShowAssump] = useState(false)
const [report, setReport] = useState<{ state: 'idle' | 'busy' | 'done' | 'error'; msg: string }>({ state: 'idle', msg: '' })
const update = (patch: Record<string, unknown>) => {
setI((s: typeof i) => ({ ...s, ...patch, touched: true }))
setReport((s) => (s.state === 'busy' ? s : { state: 'idle', msg: '' }))
}
const set = (k: string) => (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement>) => 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: [string, string, string, string][] = [
['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'
submitLead({
form: 'roi-toolkit-report',
name: `${registrant.first} ${registrant.last}`.trim(),
email: registrant.email,
company,
page: '/roi-calculator',
message: buildRoiSummary(i, r),
}).catch(() => {})
try {
const blob = await buildPersonalisedDeck(formatted, { company })
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: any) => (
<optgroup key={g.group} label={g.group}>
{g.options.map((o: any) => (
<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],
] as const
).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' as any]: 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(--roi-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' as any]: `${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(/roi/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 as any)[k].lo, (r as any)[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(--roi-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(--roi-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(--roi-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(--roi-lgrey)' }}>Network equipment</strong>
<br />
Junk traffic reduction lowers equipment utilisation by 2–4%
<br />
<br />
<strong style={{ color: 'var(--roi-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>
)
}
+109
View File
@@ -0,0 +1,109 @@
import { useEffect, useRef, useState } from 'react'
import { calculate, formatForDeck, loadInputs } from './calc.js'
import { buildPersonalisedDeck, getExampleDeck, prefetchTemplate, triggerDownload } from './pptxReport.js'
import type { Registrant } from './RoiLanding'
const SLIDE_COUNT = 15
const slides = Array.from({ length: SLIDE_COUNT }, (_, i) => `/roi/slides/slide-${String(i + 1).padStart(2, '0')}.jpg`)
export default function RoiDeckViewer({ active, registrant }: { active: boolean; registrant: Registrant }) {
const [cur, setCur] = useState(0)
const [busy, setBusy] = useState(false)
const thumbsRef = useRef<HTMLDivElement>(null)
const go = (n: number) => setCur(Math.max(0, Math.min(SLIDE_COUNT - 1, n)))
async function downloadDeck() {
if (busy) return
setBusy(true)
try {
const i: any = loadInputs(registrant)
const r = calculate(i)
const values = formatForDeck(i, r, registrant)
const meta = { company: registrant?.company || 'Your Company' }
// 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: KeyboardEvent) => {
const tag = (e.target as HTMLElement)?.tagName
if (['INPUT', 'SELECT', 'TEXTAREA'].includes(tag)) 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] as HTMLElement | undefined
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>
)
}
+258
View File
@@ -0,0 +1,258 @@
import { useState } from 'react'
import { fmtCount } from './calc.js'
const REGIONS = ['United Kingdom', 'Western Europe', 'North America', 'Latin America', 'Sub-Saharan Africa', 'Asia Pacific', 'Middle East', 'Other']
// "The devices on your network" dropdown. `deck` is how the choice appears as the big
// number on slide 3; the label is what's recorded as the operator's subscriber base.
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'
// Common free-mail domains — the form asks for a *business* email.
const BLOCK_FREE_MAIL = true
const FREE_MAIL = /@(gmail|googlemail|yahoo|hotmail|outlook|live|aol|icloud|me|proton|protonmail|gmx|mail|yandex)\./i
export type Registrant = {
first: string
last: string
company: string
title: string
email: string
region: string
subscribers: string
deviceLabel: string
}
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="/roi/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 }: { onRegister: (reg: Registrant) => void | Promise<void> }) {
const [f, setF] = useState(EMPTY)
const [error, setError] = useState('')
const [busy, setBusy] = useState(false)
const set = (k: keyof typeof EMPTY) => (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement>) => setF((s) => ({ ...s, [k]: e.target.value }))
async function handleSubmit(e: React.FormEvent) {
e.preventDefault()
const t = Object.fromEntries(Object.entries(f).map(([k, v]) => [k, v.trim()])) as typeof EMPTY
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. Silently drop the submission.
if (t.website) return
const { website: _hp, devices: _d, ...lead } = t
setBusy(true)
await onRegister({
...lead,
subscribers: exact ? String(exact) : '', // exact count (pre-fills the calculator)
deviceLabel: band ? band.deck : fmtCount(exact), // big number on slide 3
})
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="/privacy-policy" target="_blank" rel="noreferrer">
Privacy Policy
</a>
. We will not share your details with third parties.
</p>
</form>
</div>
</div>
</div>
)
}
export default function RoiLanding({ onRegister }: { onRegister: (reg: Registrant) => void | Promise<void> }) {
return (
<div>
<WhatYouGet />
<RegistrationForm onRegister={onRegister} />
</div>
)
}
-84
View File
@@ -1,84 +0,0 @@
import './roiSlide.css'
import hexMotif from './hexMotif.svg?raw'
type DeckValues = {
total: string
bw: string
calls: string
churn: string
equip: string
ddos: string
subs: string
}
type Range = { lo: number; hi: number }
type Results = {
bw: Range
calls: Range
churn: Range
equip: Range
ddos: Range
}
// Fixed categorical order — validated (CVD + contrast) against this card's dark
// teal surface via the data-viz skill's validator. Never reorder or cycle in a 6th.
const CATS: { key: keyof DeckValues & keyof Results; label: string; color: string }[] = [
{ key: 'bw', label: 'Bandwidth savings', color: '#3987e5' },
{ key: 'calls', label: 'Support call reduction', color: '#d95926' },
{ key: 'churn', label: 'Churn reduction', color: '#199e70' },
{ key: 'equip', label: 'Network equipment', color: '#c98500' },
{ key: 'ddos', label: 'DDoS avoided costs', color: '#d55181' },
]
export default function RoiSlide({ values, results }: { values: DeckValues; results: Results }) {
const today = new Date().toLocaleDateString('en-GB', { day: 'numeric', month: 'long', year: 'numeric' })
const mids = CATS.map((c) => Math.max(0, (results[c.key].lo + results[c.key].hi) / 2))
const totalMid = mids.reduce((a, b) => a + b, 0)
return (
<div className="roi-slide">
<div className="roi-slide-card">
<div className="roi-slide-hex" dangerouslySetInnerHTML={{ __html: hexMotif }} />
<div className="roi-slide-top">
<img src="/logo.svg" alt="BlackDice" className="roi-slide-logo" />
<span className="roi-slide-date">{today}</span>
</div>
<div className="roi-slide-eyebrow">Network protection ROI</div>
<h3 className="roi-slide-title">Total estimated annual savings</h3>
<div className="roi-slide-total">{values.total}</div>
{totalMid > 0 && (
<div className="roi-slide-bar" role="img" aria-label="Savings breakdown by category">
{CATS.map((c, idx) =>
mids[idx] > 0 ? (
<div
key={c.key}
className="roi-slide-seg"
style={{ width: `${(mids[idx] / totalMid) * 100}%`, background: c.color }}
title={`${c.label}: ${values[c.key]}`}
/>
) : null,
)}
</div>
)}
<div className="roi-slide-grid">
{CATS.map((c) => (
<div className="roi-slide-cell" key={c.key}>
<div className="roi-slide-cell-val">
<span className="roi-slide-dot" style={{ background: c.color }} />
{values[c.key]}
</div>
<div className="roi-slide-cell-label">{c.label}</div>
</div>
))}
</div>
<div className="roi-slide-foot">
<span>{values.subs !== '—' ? `${values.subs} subscribers` : 'Operator estimate'}</span>
<span>BlackDice Cyber · Network Protection ROI Calculator</span>
</div>
</div>
</div>
)
}
+61
View File
@@ -0,0 +1,61 @@
import { useState } from 'react'
import RoiDeckViewer from './RoiDeckViewer'
import RoiCalculatorTab from './RoiCalculatorTab'
import type { Registrant } from './RoiLanding'
export default function RoiToolkit({ registrant, onReset }: { registrant: Registrant; onReset: () => void }) {
const [tab, setTab] = useState<'deck' | 'calc'>('deck')
return (
<div>
<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 className="roi-tabs-bg">
<div className="lp-tabs" role="tablist">
<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 roi-tabs-bg${tab === 'deck' ? ' active' : ''}`}>
<RoiDeckViewer active={tab === 'deck'} registrant={registrant} />
</div>
<div className={`lp-tab-content roi-tabs-bg${tab === 'calc' ? ' active' : ''}`}>
<RoiCalculatorTab registrant={registrant} active={tab === 'calc'} />
</div>
</div>
)
}
+47 -13
View File
@@ -54,6 +54,7 @@ export const DEFAULT_INPUTS = {
netOpex: '', netOpex: '',
ddos: '0', ddos: '0',
ddosSlider: 50, ddosSlider: 50,
touched: false,
}; };
const num = (x) => parseFloat(x) || 0; const num = (x) => parseFloat(x) || 0;
@@ -142,28 +143,61 @@ export function fmtRange(lo, hi, sep = ' – ') {
// ── Shared with the deck-building code ── // ── Shared with the deck-building code ──
export const INPUTS_KEY = 'bd_roi_calc_inputs'; export const INPUTS_KEY = 'bd_roi_calc_inputs';
/** Loads this visitor's calculator inputs, however the page was reached. */ /**
export function loadInputs() { * 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
* "devices 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 { try {
return { ...DEFAULT_INPUTS, ...JSON.parse(localStorage.getItem(INPUTS_KEY) || '{}') }; i = { ...DEFAULT_INPUTS, ...JSON.parse(localStorage.getItem(INPUTS_KEY) || '{}') };
} catch { } catch {
return DEFAULT_INPUTS; /* 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. */ /** Value written into the PowerPoint when a category has no data. */
export const NOT_INCLUDED = 'Not included'; export const NOT_INCLUDED = 'Not included';
const pptRange = (r) => fmtRange(r.lo, r.hi, ' to ') || NOT_INCLUDED; const pptRange = (r) => fmtRange(r.lo, r.hi, ' to ') || NOT_INCLUDED;
/** Values written into the PowerPoint ROI + device-count slides. */ /** Deck house style: "$65k", "$3.60m", "$1.20bn" (lower-case, matching the example figures in the deck). */
export function formatForDeck(i, r) { export function fmtDeck(n) {
const s = fmt(n);
return s && s.replace(/B$/, 'bn').replace(/M$/, 'm').replace(/K$/, 'k');
}
const pptDeckRange = (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 "devices on your network" choice from the registration form.
*/
export function formatForDeck(i, r, registrant) {
return { return {
total: pptRange(r.total), total: pptDeckRange(r.total),
bw: pptRange(r.bw), bw: pptDeckRange(r.bw),
calls: pptRange(r.calls), calls: pptDeckRange(r.calls),
churn: pptRange(r.churn), churn: pptDeckRange(r.churn),
equip: pptRange(r.equip), equip: pptDeckRange(r.equip),
ddos: pptRange(r.ddos), ddos: pptDeckRange(r.ddos),
subs: i.subs ? Number(i.subs).toLocaleString('en-US') : '—', subs: fmtCount(num(i.subs)) || registrant?.deviceLabel || '',
}; };
} }
-164
View File
@@ -1,164 +0,0 @@
<svg width="100%" height="100%" viewBox="0 0 633 1373"
preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" style="position:absolute;inset:0;">
<g opacity="1">
<path d="M310.0 36.0 L330.8 48.0 L330.8 72.0 L310.0 84.0 L289.2 72.0 L289.2 48.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M310.0 36.0 L310.0 60.0 M330.8 72.0 L310.0 60.0 M289.2 72.0 L310.0 60.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.9">
<path d="M351.6 36.0 L372.4 48.0 L372.4 72.0 L351.6 84.0 L330.8 72.0 L330.8 48.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M351.6 36.0 L351.6 60.0 M372.4 72.0 L351.6 60.0 M330.8 72.0 L351.6 60.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.7">
<path d="M330.8 72.0 L351.6 84.0 L351.6 108.0 L330.8 120.0 L310.0 108.0 L310.0 84.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M330.8 72.0 L330.8 96.0 M351.6 108.0 L330.8 96.0 M310.0 108.0 L330.8 96.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.8">
<path d="M372.4 72.0 L393.1 84.0 L393.1 108.0 L372.4 120.0 L351.6 108.0 L351.6 84.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M372.4 72.0 L372.4 96.0 M393.1 108.0 L372.4 96.0 M351.6 108.0 L372.4 96.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.5">
<path d="M289.2 72.0 L310.0 84.0 L310.0 108.0 L289.2 120.0 L268.4 108.0 L268.4 84.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M289.2 72.0 L289.2 96.0 M310.0 108.0 L289.2 96.0 M268.4 108.0 L289.2 96.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.35">
<path d="M310.0 108.0 L330.8 120.0 L330.8 144.0 L310.0 156.0 L289.2 144.0 L289.2 120.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M310.0 108.0 L310.0 132.0 M330.8 144.0 L310.0 132.0 M289.2 144.0 L310.0 132.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.4">
<path d="M351.6 108.0 L372.4 120.0 L372.4 144.0 L351.6 156.0 L330.8 144.0 L330.8 120.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M351.6 108.0 L351.6 132.0 M372.4 144.0 L351.6 132.0 M330.8 144.0 L351.6 132.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.55">
<path d="M413.9 72.0 L434.7 84.0 L434.7 108.0 L413.9 120.0 L393.1 108.0 L393.1 84.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M413.9 72.0 L413.9 96.0 M434.7 108.0 L413.9 96.0 M393.1 108.0 L413.9 96.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.55">
<path d="M80.0 346.0 L100.8 358.0 L100.8 382.0 L80.0 394.0 L59.2 382.0 L59.2 358.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M80.0 346.0 L80.0 370.0 M100.8 382.0 L80.0 370.0 M59.2 382.0 L80.0 370.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.35">
<path d="M121.6 346.0 L142.4 358.0 L142.4 382.0 L121.6 394.0 L100.8 382.0 L100.8 358.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M121.6 346.0 L121.6 370.0 M142.4 382.0 L121.6 370.0 M100.8 382.0 L121.6 370.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.45">
<path d="M100.8 382.0 L121.6 394.0 L121.6 418.0 L100.8 430.0 L80.0 418.0 L80.0 394.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M100.8 382.0 L100.8 406.0 M121.6 418.0 L100.8 406.0 M80.0 418.0 L100.8 406.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.35">
<path d="M142.4 382.0 L163.1 394.0 L163.1 418.0 L142.4 430.0 L121.6 418.0 L121.6 394.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M142.4 382.0 L142.4 406.0 M163.1 418.0 L142.4 406.0 M121.6 418.0 L142.4 406.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.25">
<path d="M59.2 382.0 L80.0 394.0 L80.0 418.0 L59.2 430.0 L38.4 418.0 L38.4 394.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M59.2 382.0 L59.2 406.0 M80.0 418.0 L59.2 406.0 M38.4 418.0 L59.2 406.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.3">
<path d="M163.1 346.0 L183.9 358.0 L183.9 382.0 L163.1 394.0 L142.4 382.0 L142.4 358.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M163.1 346.0 L163.1 370.0 M183.9 382.0 L163.1 370.0 M142.4 382.0 L163.1 370.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.85">
<path d="M80.0 626.0 L100.8 638.0 L100.8 662.0 L80.0 674.0 L59.2 662.0 L59.2 638.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M80.0 626.0 L80.0 650.0 M100.8 662.0 L80.0 650.0 M59.2 662.0 L80.0 650.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.7">
<path d="M121.6 626.0 L142.4 638.0 L142.4 662.0 L121.6 674.0 L100.8 662.0 L100.8 638.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M121.6 626.0 L121.6 650.0 M142.4 662.0 L121.6 650.0 M100.8 662.0 L121.6 650.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.55">
<path d="M100.8 662.0 L121.6 674.0 L121.6 698.0 L100.8 710.0 L80.0 698.0 L80.0 674.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M100.8 662.0 L100.8 686.0 M121.6 698.0 L100.8 686.0 M80.0 698.0 L100.8 686.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.65">
<path d="M142.4 662.0 L163.1 674.0 L163.1 698.0 L142.4 710.0 L121.6 698.0 L121.6 674.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M142.4 662.0 L142.4 686.0 M163.1 698.0 L142.4 686.0 M121.6 698.0 L142.4 686.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.6">
<path d="M163.1 626.0 L183.9 638.0 L183.9 662.0 L163.1 674.0 L142.4 662.0 L142.4 638.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M163.1 626.0 L163.1 650.0 M183.9 662.0 L163.1 650.0 M142.4 662.0 L163.1 650.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.4">
<path d="M59.2 662.0 L80.0 674.0 L80.0 698.0 L59.2 710.0 L38.4 698.0 L38.4 674.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M59.2 662.0 L59.2 686.0 M80.0 698.0 L59.2 686.0 M38.4 698.0 L59.2 686.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.5">
<path d="M80.0 698.0 L100.8 710.0 L100.8 734.0 L80.0 746.0 L59.2 734.0 L59.2 710.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M80.0 698.0 L80.0 722.0 M100.8 734.0 L80.0 722.0 M59.2 734.0 L80.0 722.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.4">
<path d="M121.6 698.0 L142.4 710.0 L142.4 734.0 L121.6 746.0 L100.8 734.0 L100.8 710.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M121.6 698.0 L121.6 722.0 M142.4 734.0 L121.6 722.0 M100.8 734.0 L121.6 722.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.5">
<path d="M183.9 662.0 L204.7 674.0 L204.7 698.0 L183.9 710.0 L163.1 698.0 L163.1 674.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M183.9 662.0 L183.9 686.0 M204.7 698.0 L183.9 686.0 M163.1 698.0 L183.9 686.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.35">
<path d="M163.1 698.0 L183.9 710.0 L183.9 734.0 L163.1 746.0 L142.4 734.0 L142.4 710.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M163.1 698.0 L163.1 722.0 M183.9 734.0 L163.1 722.0 M142.4 734.0 L163.1 722.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<circle cx="310.0" cy="36.0" r="2.6" fill="var(--hex-dot)" opacity="1" />
<circle cx="351.6" cy="36.0" r="2.6" fill="var(--hex-dot)" opacity="0.9" />
<circle cx="372.4" cy="72.0" r="2.6" fill="var(--hex-dot)" opacity="0.8" />
<circle cx="413.9" cy="72.0" r="2.6" fill="var(--hex-dot)" opacity="0.55" />
<circle cx="80.0" cy="346.0" r="2.6" fill="var(--hex-dot)" opacity="0.55" />
<circle cx="142.4" cy="382.0" r="2.6" fill="var(--hex-dot)" opacity="0.35" />
<circle cx="80.0" cy="626.0" r="2.6" fill="var(--hex-dot)" opacity="0.85" />
<circle cx="121.6" cy="626.0" r="2.6" fill="var(--hex-dot)" opacity="0.7" />
<circle cx="142.4" cy="662.0" r="2.6" fill="var(--hex-dot)" opacity="0.65" />
<circle cx="163.1" cy="626.0" r="2.6" fill="var(--hex-dot)" opacity="0.6" />
<circle cx="121.6" cy="698.0" r="2.6" fill="var(--hex-dot)" opacity="0.4" />
<circle cx="330.8" cy="48.0" r="2.2" fill="var(--hex-dot)" opacity="0.70" />
<circle cx="372.4" cy="48.0" r="2.2" fill="var(--hex-dot)" opacity="0.63" />
<circle cx="393.1" cy="84.0" r="2.2" fill="var(--hex-dot)" opacity="0.56" />
<circle cx="434.7" cy="84.0" r="2.2" fill="var(--hex-dot)" opacity="0.39" />
<circle cx="100.8" cy="358.0" r="2.2" fill="var(--hex-dot)" opacity="0.39" />
<circle cx="163.1" cy="394.0" r="2.2" fill="var(--hex-dot)" opacity="0.24" />
</svg>

Before

Width:  |  Height:  |  Size: 12 KiB

+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 strategy deck. 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 = '/roi/deck/BlackDice_Strategy_Deck.pptx'
// The ROI slide ("Total estimate annual savings") — slide 12 in the deck.
const ROI_SLIDE = '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 = '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 deck/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)
}
+577 -26
View File
@@ -574,32 +574,6 @@
margin-top: 8px; margin-top: 8px;
} }
/* Lead capture form */
.roi-calc .roi-lead-form {
display: flex;
gap: 10px;
flex-wrap: wrap;
margin-top: 12px;
}
.roi-calc .roi-lead-form input {
flex: 1 1 160px;
padding: 10px 13px;
border: 1.5px solid #c8dde3;
border-radius: 8px;
font-family: 'Ubuntu', sans-serif;
font-size: 13px;
color: var(--roi-text);
background: var(--roi-white);
outline: none;
transition: border-color 0.2s, box-shadow 0.2s;
}
.roi-calc .roi-lead-form input:focus {
border-color: var(--roi-green);
box-shadow: 0 0 0 3px rgba(53, 184, 136, 0.15);
}
.roi-calc .roi-lead-form .report-dl-btn {
flex: 0 0 auto;
}
@media (max-width: 960px) { @media (max-width: 960px) {
.roi-calc .main { .roi-calc .main {
grid-template-columns: 1fr; grid-template-columns: 1fr;
@@ -615,3 +589,580 @@
align-items: flex-start; align-items: flex-start;
} }
} }
/* ═══════════════════════════════════════
GATED TOOLKIT — registration landing, tabs, deck viewer
Ported from the BlackDice Operator ROI Toolkit.
═══════════════════════════════════════ */
/* "Inside the toolkit" explainer */
.roi-calc .lp-what {
background: #f8fafb;
border: 1px solid #e2ecef;
border-radius: 14px;
padding: 48px 0;
margin-bottom: 32px;
}
.roi-calc .lp-what-inner {
max-width: 1000px;
margin: 0 auto;
padding: 0 32px;
}
.roi-calc .lp-section-label {
text-align: center;
font-size: 0.72rem;
font-weight: 700;
letter-spacing: 0.12em;
text-transform: uppercase;
color: var(--roi-green);
margin-bottom: 12px;
}
.roi-calc .lp-section-title {
text-align: center;
font-size: 1.5rem;
font-weight: 700;
color: var(--roi-teal);
margin-bottom: 8px;
}
.roi-calc .lp-section-sub {
text-align: center;
font-size: 0.92rem;
color: #556;
margin-bottom: 40px;
}
.roi-calc .lp-assets {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 24px;
}
.roi-calc .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);
}
.roi-calc .lp-asset-preview {
background: var(--roi-teal);
padding: 24px 24px 0;
min-height: 210px;
overflow: hidden;
}
.roi-calc .lp-asset-preview-calc {
background: #f4f9fb;
padding: 20px 20px 0;
min-height: 210px;
border-bottom: 1px solid #dde8eb;
}
.roi-calc .lp-slide-thumb {
border-radius: 4px 4px 0 0;
width: 100%;
display: block;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.roi-calc .calc-mock {
background: white;
border-radius: 8px 8px 0 0;
padding: 16px;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}
.roi-calc .calc-mock-header {
background: var(--roi-teal);
color: white;
padding: 10px 14px;
border-radius: 6px;
font-size: 0.75rem;
font-weight: 600;
margin-bottom: 10px;
}
.roi-calc .calc-mock-row {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 6px;
margin-bottom: 6px;
}
.roi-calc .calc-mock-field {
background: #f4f9fb;
border: 1px solid #dde;
border-radius: 4px;
padding: 7px 10px;
font-size: 0.7rem;
color: #667;
}
.roi-calc .calc-mock-result {
background: linear-gradient(135deg, var(--roi-teal), var(--roi-teal2));
border-radius: 6px;
padding: 10px 14px;
margin-top: 8px;
}
.roi-calc .calc-mock-result-label {
font-size: 0.65rem;
color: var(--roi-lgrey);
margin-bottom: 2px;
}
.roi-calc .calc-mock-result-val {
font-size: 1.1rem;
font-weight: 700;
color: var(--roi-green);
}
.roi-calc .lp-asset-info {
padding: 24px;
}
.roi-calc .lp-asset-tag {
display: inline-block;
font-size: 0.65rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.1em;
color: var(--roi-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;
}
.roi-calc .lp-asset-info h3 {
font-size: 1.05rem;
font-weight: 700;
color: var(--roi-teal);
margin-bottom: 8px;
}
.roi-calc .lp-asset-info p {
font-size: 0.87rem;
color: #556;
line-height: 1.6;
margin-bottom: 16px;
}
.roi-calc .lp-asset-bullets {
list-style: none;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
gap: 6px;
}
.roi-calc .lp-asset-bullets li {
font-size: 0.82rem;
color: #445;
display: flex;
align-items: flex-start;
gap: 8px;
}
.roi-calc .lp-asset-bullets li::before {
content: '';
width: 6px;
height: 6px;
background: var(--roi-green);
border-radius: 50%;
margin-top: 5px;
flex-shrink: 0;
}
/* Registration form */
.roi-calc .lp-reg {
background: white;
border: 1px solid #dde8eb;
border-radius: 16px;
}
.roi-calc .lp-reg-inner {
max-width: 760px;
margin: 0 auto;
}
.roi-calc .lp-reg-box {
padding: 40px 48px;
}
.roi-calc .lp-reg-title {
font-size: 1.4rem;
font-weight: 700;
color: var(--roi-teal);
margin-bottom: 8px;
text-align: center;
}
.roi-calc .lp-reg-sub {
text-align: center;
font-size: 0.9rem;
color: #667;
margin-bottom: 32px;
}
.roi-calc .lp-form-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16px;
margin-bottom: 16px;
}
.roi-calc .lp-form-full {
grid-column: 1 / -1;
}
.roi-calc .lp-field {
display: flex;
flex-direction: column;
gap: 5px;
}
.roi-calc .lp-field label {
font-size: 0.78rem;
font-weight: 600;
color: var(--roi-teal);
text-transform: uppercase;
letter-spacing: 0.05em;
}
.roi-calc .lp-field input,
.roi-calc .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;
}
.roi-calc .lp-field input:focus,
.roi-calc .lp-field select:focus {
border-color: var(--roi-teal);
box-shadow: 0 0 0 3px rgba(1, 59, 73, 0.08);
}
.roi-calc .lp-field-hint {
font-size: 0.75rem;
color: #889;
line-height: 1.5;
}
.roi-calc .lp-submit {
width: 100%;
padding: 14px;
background: var(--roi-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;
}
.roi-calc .lp-submit:hover {
background: var(--roi-green2);
transform: translateY(-1px);
}
.roi-calc .lp-submit:disabled {
opacity: 0.6;
cursor: wait;
transform: none;
}
.roi-calc .lp-privacy {
text-align: center;
font-size: 0.75rem;
color: #889;
margin-top: 16px;
}
.roi-calc .lp-privacy a {
color: var(--roi-mgrey);
}
.roi-calc #form-error {
background: #fff0f0;
border: 1px solid #fcc;
color: #c00;
padding: 10px 14px;
border-radius: 6px;
font-size: 0.85rem;
margin-bottom: 12px;
}
.roi-calc .lp-hp {
position: absolute !important;
left: -9999px !important;
width: 1px;
height: 1px;
overflow: hidden;
}
/* Post-registration welcome bar */
.roi-calc .access-welcome {
background: linear-gradient(135deg, var(--roi-teal) 0%, var(--roi-teal2) 100%);
border-radius: 14px 14px 0 0;
}
.roi-calc .access-welcome-inner {
padding: 22px 32px;
display: flex;
align-items: center;
gap: 20px;
width: 100%;
}
.roi-calc .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;
}
.roi-calc .access-welcome-icon svg {
width: 22px;
height: 22px;
stroke: var(--roi-green);
fill: none;
stroke-width: 2.5;
}
.roi-calc .access-welcome-text h2 {
font-size: 1.05rem;
font-weight: 700;
color: white;
margin-bottom: 2px;
}
.roi-calc .access-welcome-text p {
font-size: 0.85rem;
color: var(--roi-lgrey);
}
.roi-calc .welcome-reset {
background: none;
border: none;
color: var(--roi-green);
font-family: 'Ubuntu', sans-serif;
font-size: 0.8rem;
cursor: pointer;
padding: 0;
margin-left: 6px;
text-decoration: underline;
}
/* Tab navigation */
.roi-calc .roi-tabs-bg {
background: #f4f8fa;
}
.roi-calc .lp-tabs {
padding: 0 32px;
display: flex;
gap: 0;
border-bottom: 2px solid #dde8eb;
}
.roi-calc .lp-tab {
padding: 14px 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;
}
.roi-calc .lp-tab svg {
width: 16px;
height: 16px;
stroke: currentColor;
fill: none;
stroke-width: 2;
}
.roi-calc .lp-tab.active {
color: var(--roi-teal);
border-bottom-color: var(--roi-green);
}
.roi-calc .lp-tab:hover:not(.active) {
color: var(--roi-teal);
}
.roi-calc .lp-tab-content {
display: none;
}
.roi-calc .lp-tab-content.active {
display: block;
}
/* Deck viewer */
.roi-calc .deck-viewer-wrap {
padding: 32px;
}
.roi-calc .deck-viewer-top {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20px;
gap: 16px;
flex-wrap: wrap;
}
.roi-calc .deck-viewer-title {
font-size: 1.1rem;
font-weight: 700;
color: var(--roi-teal);
}
.roi-calc .deck-viewer-sub {
font-size: 0.85rem;
color: #667;
margin-top: 2px;
}
.roi-calc .deck-dl-btn {
display: inline-flex;
align-items: center;
gap: 8px;
background: var(--roi-teal);
color: white;
text-decoration: none;
border: none;
padding: 11px 22px;
border-radius: 8px;
font-family: 'Ubuntu', sans-serif;
font-weight: 700;
font-size: 0.88rem;
cursor: pointer;
transition: background 0.15s;
flex-shrink: 0;
}
.roi-calc .deck-dl-btn:hover:not(:disabled) {
background: var(--roi-teal2);
}
.roi-calc .deck-dl-btn:disabled {
opacity: 0.6;
cursor: wait;
}
.roi-calc .deck-dl-btn svg {
width: 15px;
height: 15px;
stroke: currentColor;
fill: none;
stroke-width: 2.5;
}
.roi-calc .slide-viewer {
background: #1a1a2e;
border-radius: 12px;
overflow: hidden;
box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}
.roi-calc .slide-display {
position: relative;
background: #111;
display: flex;
align-items: center;
justify-content: center;
min-height: 400px;
}
.roi-calc .slide-display img {
width: 100%;
max-height: 600px;
object-fit: contain;
display: block;
}
.roi-calc .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;
}
.roi-calc .slide-nav-btn:hover {
background: rgba(0, 0, 0, 0.8);
}
.roi-calc .slide-nav-btn.prev {
left: 14px;
}
.roi-calc .slide-nav-btn.next {
right: 14px;
}
.roi-calc .slide-nav-btn:disabled {
opacity: 0.25;
cursor: default;
}
.roi-calc .slide-controls {
background: #13131f;
padding: 14px 20px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
}
.roi-calc .slide-counter {
font-size: 0.85rem;
font-weight: 600;
color: #aaa;
min-width: 60px;
}
.roi-calc .slide-thumbs {
display: flex;
gap: 6px;
overflow-x: auto;
padding: 4px 0;
flex: 1;
justify-content: center;
scrollbar-width: thin;
scrollbar-color: #444 #13131f;
}
.roi-calc .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;
}
.roi-calc .slide-thumb-btn.active {
border-color: var(--roi-green);
opacity: 1;
}
.roi-calc .slide-thumb-btn:hover {
opacity: 0.85;
}
.roi-calc .slide-thumb-btn img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
/* Calculator tab, inside the gated toolkit, needs its own padding (no longer the
outermost element — rank-bar/disclaimer no longer need the alignment overrides
the ungated page used). */
.roi-calc .calc-tab-wrap {
padding: 32px;
}
.roi-calc .report-error {
color: #c00;
}
.roi-calc .report-dl-btn.busy {
cursor: wait;
}
@media (max-width: 900px) {
.roi-calc .lp-what-inner {
padding: 0 20px;
}
.roi-calc .lp-assets {
grid-template-columns: 1fr;
}
.roi-calc .lp-form-grid {
grid-template-columns: 1fr;
}
.roi-calc .lp-reg-box {
padding: 28px 24px;
}
.roi-calc .lp-tabs {
padding: 0 20px;
}
.roi-calc .deck-viewer-wrap,
.roi-calc .calc-tab-wrap {
padding: 20px;
}
.roi-calc .access-welcome-inner {
padding: 18px 20px;
}
}
-177
View File
@@ -1,177 +0,0 @@
/* ROI slide — a presentation-style summary card shown instead of a PPTX download.
Scoped under .roi-slide so it shares nothing with the rest of the site's CSS. */
.roi-slide {
--rs-teal: #013b49;
--rs-teal2: #0e4f63;
--rs-teal3: #1a6070;
--rs-green: #35b888;
--rs-lgrey: #b0c8ce;
--rs-mgrey: #6b9ba8;
margin-top: 20px;
display: flex;
justify-content: center;
}
.roi-slide-card {
width: 100%;
max-width: 860px;
aspect-ratio: 16 / 9;
background: linear-gradient(135deg, var(--rs-teal) 0%, var(--rs-teal2) 60%, var(--rs-teal3) 100%);
border-radius: 16px;
box-shadow: 0 20px 60px rgba(1, 59, 73, 0.35);
padding: 32px 40px;
display: flex;
flex-direction: column;
font-family: 'Ubuntu', sans-serif;
color: #fff;
position: relative;
overflow: hidden;
}
.roi-slide-hex {
position: absolute;
top: 50%;
left: 50%;
width: 900px;
height: 900px;
transform: translate(-50%, -50%);
opacity: 0.5;
pointer-events: none;
z-index: 0;
}
.roi-slide-card::after {
content: '';
position: absolute;
top: -30%;
right: -10%;
width: 55%;
height: 160%;
background: radial-gradient(circle, rgba(53, 184, 136, 0.18) 0%, transparent 70%);
pointer-events: none;
}
.roi-slide-top {
display: flex;
align-items: center;
justify-content: space-between;
position: relative;
z-index: 1;
}
.roi-slide-logo {
height: 20px;
width: auto;
filter: brightness(0) invert(1);
opacity: 0.9;
}
.roi-slide-date {
font-size: 12px;
color: var(--rs-lgrey);
}
.roi-slide-eyebrow {
margin-top: 20px;
font-size: 11px;
font-weight: 700;
letter-spacing: 0.14em;
text-transform: uppercase;
color: var(--rs-green);
position: relative;
z-index: 1;
}
.roi-slide-title {
margin-top: 4px;
font-size: clamp(18px, 2.4vw, 26px);
font-weight: 700;
color: #fff;
position: relative;
z-index: 1;
}
.roi-slide-total {
margin-top: 10px;
font-size: clamp(32px, 5vw, 52px);
font-weight: 700;
color: var(--rs-green);
letter-spacing: -0.5px;
line-height: 1.1;
position: relative;
z-index: 1;
}
.roi-slide-bar {
margin-top: 16px;
display: flex;
gap: 2px;
height: 14px;
border-radius: 7px;
overflow: hidden;
position: relative;
z-index: 1;
}
.roi-slide-seg {
height: 100%;
}
.roi-slide-grid {
margin-top: auto;
padding-top: 16px;
display: grid;
grid-template-columns: repeat(5, 1fr);
gap: 10px;
position: relative;
z-index: 1;
}
.roi-slide-cell {
background: rgba(255, 255, 255, 0.06);
border: 1px solid rgba(176, 200, 206, 0.15);
border-radius: 10px;
padding: 10px 8px;
text-align: center;
}
.roi-slide-cell-val {
display: flex;
align-items: center;
justify-content: center;
gap: 5px;
font-size: 13px;
font-weight: 700;
color: #fff;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.roi-slide-dot {
width: 7px;
height: 7px;
border-radius: 50%;
flex-shrink: 0;
}
.roi-slide-cell-label {
margin-top: 3px;
font-size: 9.5px;
color: var(--rs-lgrey);
line-height: 1.3;
}
.roi-slide-foot {
margin-top: 16px;
display: flex;
justify-content: space-between;
font-size: 11px;
color: var(--rs-mgrey);
position: relative;
z-index: 1;
}
@media (max-width: 640px) {
.roi-slide-card {
aspect-ratio: auto;
padding: 24px;
}
.roi-slide-grid {
grid-template-columns: repeat(2, 1fr);
}
.roi-slide-foot {
flex-direction: column;
gap: 4px;
}
}
+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 };
}
+1 -169
View File
@@ -657,178 +657,10 @@
investment and no subscriber friction.</p> investment and no subscriber friction.</p>
<div class="btn-row"><button data-cms="c0141" class="btn-p" data-action="show-demo">Request a demonstration</button></div> <div class="btn-row"><button data-cms="c0141" class="btn-p" data-action="show-demo">Request a demonstration</button></div>
</div> </div>
</div>
</div>
</section>
<div class="bd-sect t" style="background:var(--bg);position:relative;overflow:hidden;">
<div class="bd-hex-motif" style="left:65%;right:auto;width:1000px;transform:translateX(-50%);"><svg width="100%" height="100%" viewBox="0 0 633 1373"
preserveAspectRatio="xMidYMid slice" xmlns="http://www.w3.org/2000/svg" style="position:absolute;inset:0;">
<g opacity="1">
<path d="M310.0 36.0 L330.8 48.0 L330.8 72.0 L310.0 84.0 L289.2 72.0 L289.2 48.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M310.0 36.0 L310.0 60.0 M330.8 72.0 L310.0 60.0 M289.2 72.0 L310.0 60.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.9">
<path d="M351.6 36.0 L372.4 48.0 L372.4 72.0 L351.6 84.0 L330.8 72.0 L330.8 48.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M351.6 36.0 L351.6 60.0 M372.4 72.0 L351.6 60.0 M330.8 72.0 L351.6 60.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.7">
<path d="M330.8 72.0 L351.6 84.0 L351.6 108.0 L330.8 120.0 L310.0 108.0 L310.0 84.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M330.8 72.0 L330.8 96.0 M351.6 108.0 L330.8 96.0 M310.0 108.0 L330.8 96.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.8">
<path d="M372.4 72.0 L393.1 84.0 L393.1 108.0 L372.4 120.0 L351.6 108.0 L351.6 84.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M372.4 72.0 L372.4 96.0 M393.1 108.0 L372.4 96.0 M351.6 108.0 L372.4 96.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.5">
<path d="M289.2 72.0 L310.0 84.0 L310.0 108.0 L289.2 120.0 L268.4 108.0 L268.4 84.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M289.2 72.0 L289.2 96.0 M310.0 108.0 L289.2 96.0 M268.4 108.0 L289.2 96.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.35">
<path d="M310.0 108.0 L330.8 120.0 L330.8 144.0 L310.0 156.0 L289.2 144.0 L289.2 120.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M310.0 108.0 L310.0 132.0 M330.8 144.0 L310.0 132.0 M289.2 144.0 L310.0 132.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.4">
<path d="M351.6 108.0 L372.4 120.0 L372.4 144.0 L351.6 156.0 L330.8 144.0 L330.8 120.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M351.6 108.0 L351.6 132.0 M372.4 144.0 L351.6 132.0 M330.8 144.0 L351.6 132.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.55">
<path d="M413.9 72.0 L434.7 84.0 L434.7 108.0 L413.9 120.0 L393.1 108.0 L393.1 84.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M413.9 72.0 L413.9 96.0 M434.7 108.0 L413.9 96.0 M393.1 108.0 L413.9 96.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.55">
<path d="M80.0 346.0 L100.8 358.0 L100.8 382.0 L80.0 394.0 L59.2 382.0 L59.2 358.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M80.0 346.0 L80.0 370.0 M100.8 382.0 L80.0 370.0 M59.2 382.0 L80.0 370.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.35">
<path d="M121.6 346.0 L142.4 358.0 L142.4 382.0 L121.6 394.0 L100.8 382.0 L100.8 358.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M121.6 346.0 L121.6 370.0 M142.4 382.0 L121.6 370.0 M100.8 382.0 L121.6 370.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.45">
<path d="M100.8 382.0 L121.6 394.0 L121.6 418.0 L100.8 430.0 L80.0 418.0 L80.0 394.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M100.8 382.0 L100.8 406.0 M121.6 418.0 L100.8 406.0 M80.0 418.0 L100.8 406.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.35">
<path d="M142.4 382.0 L163.1 394.0 L163.1 418.0 L142.4 430.0 L121.6 418.0 L121.6 394.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M142.4 382.0 L142.4 406.0 M163.1 418.0 L142.4 406.0 M121.6 418.0 L142.4 406.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.25">
<path d="M59.2 382.0 L80.0 394.0 L80.0 418.0 L59.2 430.0 L38.4 418.0 L38.4 394.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M59.2 382.0 L59.2 406.0 M80.0 418.0 L59.2 406.0 M38.4 418.0 L59.2 406.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.3">
<path d="M163.1 346.0 L183.9 358.0 L183.9 382.0 L163.1 394.0 L142.4 382.0 L142.4 358.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M163.1 346.0 L163.1 370.0 M183.9 382.0 L163.1 370.0 M142.4 382.0 L163.1 370.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.85">
<path d="M80.0 626.0 L100.8 638.0 L100.8 662.0 L80.0 674.0 L59.2 662.0 L59.2 638.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M80.0 626.0 L80.0 650.0 M100.8 662.0 L80.0 650.0 M59.2 662.0 L80.0 650.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.7">
<path d="M121.6 626.0 L142.4 638.0 L142.4 662.0 L121.6 674.0 L100.8 662.0 L100.8 638.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M121.6 626.0 L121.6 650.0 M142.4 662.0 L121.6 650.0 M100.8 662.0 L121.6 650.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.55">
<path d="M100.8 662.0 L121.6 674.0 L121.6 698.0 L100.8 710.0 L80.0 698.0 L80.0 674.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M100.8 662.0 L100.8 686.0 M121.6 698.0 L100.8 686.0 M80.0 698.0 L100.8 686.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.65">
<path d="M142.4 662.0 L163.1 674.0 L163.1 698.0 L142.4 710.0 L121.6 698.0 L121.6 674.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M142.4 662.0 L142.4 686.0 M163.1 698.0 L142.4 686.0 M121.6 698.0 L142.4 686.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.6">
<path d="M163.1 626.0 L183.9 638.0 L183.9 662.0 L163.1 674.0 L142.4 662.0 L142.4 638.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M163.1 626.0 L163.1 650.0 M183.9 662.0 L163.1 650.0 M142.4 662.0 L163.1 650.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.4">
<path d="M59.2 662.0 L80.0 674.0 L80.0 698.0 L59.2 710.0 L38.4 698.0 L38.4 674.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M59.2 662.0 L59.2 686.0 M80.0 698.0 L59.2 686.0 M38.4 698.0 L59.2 686.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.5">
<path d="M80.0 698.0 L100.8 710.0 L100.8 734.0 L80.0 746.0 L59.2 734.0 L59.2 710.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M80.0 698.0 L80.0 722.0 M100.8 734.0 L80.0 722.0 M59.2 734.0 L80.0 722.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.4">
<path d="M121.6 698.0 L142.4 710.0 L142.4 734.0 L121.6 746.0 L100.8 734.0 L100.8 710.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M121.6 698.0 L121.6 722.0 M142.4 734.0 L121.6 722.0 M100.8 734.0 L121.6 722.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.5">
<path d="M183.9 662.0 L204.7 674.0 L204.7 698.0 L183.9 710.0 L163.1 698.0 L163.1 674.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M183.9 662.0 L183.9 686.0 M204.7 698.0 L183.9 686.0 M163.1 698.0 L183.9 686.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<g opacity="0.35">
<path d="M163.1 698.0 L183.9 710.0 L183.9 734.0 L163.1 746.0 L142.4 734.0 L142.4 710.0 Z" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
<path d="M163.1 698.0 L163.1 722.0 M183.9 734.0 L163.1 722.0 M142.4 734.0 L163.1 722.0" fill="none"
stroke="var(--hex-stroke)" stroke-width="1" stroke-linejoin="round" />
</g>
<circle cx="310.0" cy="36.0" r="2.6" fill="var(--hex-dot)" opacity="1" />
<circle cx="351.6" cy="36.0" r="2.6" fill="var(--hex-dot)" opacity="0.9" />
<circle cx="372.4" cy="72.0" r="2.6" fill="var(--hex-dot)" opacity="0.8" />
<circle cx="413.9" cy="72.0" r="2.6" fill="var(--hex-dot)" opacity="0.55" />
<circle cx="80.0" cy="346.0" r="2.6" fill="var(--hex-dot)" opacity="0.55" />
<circle cx="142.4" cy="382.0" r="2.6" fill="var(--hex-dot)" opacity="0.35" />
<circle cx="80.0" cy="626.0" r="2.6" fill="var(--hex-dot)" opacity="0.85" />
<circle cx="121.6" cy="626.0" r="2.6" fill="var(--hex-dot)" opacity="0.7" />
<circle cx="142.4" cy="662.0" r="2.6" fill="var(--hex-dot)" opacity="0.65" />
<circle cx="163.1" cy="626.0" r="2.6" fill="var(--hex-dot)" opacity="0.6" />
<circle cx="121.6" cy="698.0" r="2.6" fill="var(--hex-dot)" opacity="0.4" />
<circle cx="330.8" cy="48.0" r="2.2" fill="var(--hex-dot)" opacity="0.70" />
<circle cx="372.4" cy="48.0" r="2.2" fill="var(--hex-dot)" opacity="0.63" />
<circle cx="393.1" cy="84.0" r="2.2" fill="var(--hex-dot)" opacity="0.56" />
<circle cx="434.7" cy="84.0" r="2.2" fill="var(--hex-dot)" opacity="0.39" />
<circle cx="100.8" cy="358.0" r="2.2" fill="var(--hex-dot)" opacity="0.39" />
<circle cx="163.1" cy="394.0" r="2.2" fill="var(--hex-dot)" opacity="0.24" />
</svg></div>
<div class="bd-si" style="position:relative;z-index:1;">
<div class="bd-mobile-demo-mount" id="mobile-sdk-demo-mount"></div> <div class="bd-mobile-demo-mount" id="mobile-sdk-demo-mount"></div>
</div> </div>
</div> </div>
</section>
<div class="aud-strip"><span data-cms="c0142" class="aud-lbl">BUILT FOR</span> <div class="aud-strip"><span data-cms="c0142" class="aud-lbl">BUILT FOR</span>
<div data-cms="c0143" class="aud-tags"><span class="aud-tag">Retail banks</span><span class="aud-tag">Digital-first banks &amp; <div data-cms="c0143" class="aud-tags"><span class="aud-tag">Retail banks</span><span class="aud-tag">Digital-first banks &amp;
fintech</span><span class="aud-tag">Mobile operators with FS exposure</span><span class="aud-tag">Insurance fintech</span><span class="aud-tag">Mobile operators with FS exposure</span><span class="aud-tag">Insurance
+28 -5
View File
@@ -553,16 +553,25 @@ textarea {
#pg-p2 .bd-hero-sh .bd-hero-in { #pg-p2 .bd-hero-sh .bd-hero-in {
display: block; display: block;
height: auto; height: auto;
padding: 90px; padding: 25px;
} }
#pg-p2 .bd-hero-top { #pg-p2 .bd-hero-top {
display: flex; display: flex;
flex-direction: column; flex-direction: row;
align-items: stretch; align-items: center;
gap: 20px; justify-content: flex-start;
gap: 44px;
} }
#pg-p2 .bd-hero-top > div:first-child { #pg-p2 .bd-hero-top > div:first-child {
max-width: 720px; width: 500px;
max-width: 500px;
flex: 0 0 auto;
}
#pg-p2 .bd-mobile-demo-mount {
flex: 0 0 auto;
}
#pg-p2 .bd-mobile-demo-mount .bd-mse {
justify-content: flex-start;
} }
#pg-p2 .bd-hero-top .h1 { #pg-p2 .bd-hero-top .h1 {
font-size: clamp(32px, 3.4vw, 44px); font-size: clamp(32px, 3.4vw, 44px);
@@ -570,6 +579,20 @@ textarea {
#pg-p2 .bd-hero-top .hero-sub { #pg-p2 .bd-hero-top .hero-sub {
margin: 12px 0 18px; margin: 12px 0 18px;
} }
/* The demo's module grid + phone stage is a fixed ~720px wide block that
doesn't shrink, so below this the row layout clips/overflows — fall
back to the stacked column before that happens. */
@media (max-width: 1480px) {
#pg-p2 .bd-hero-top {
flex-direction: column;
align-items: stretch;
gap: 24px;
}
#pg-p2 .bd-hero-top > div:first-child {
width: auto;
max-width: 100%;
}
}
/* The hero now fits one screen, so the global "scroll down" hint collides /* The hero now fits one screen, so the global "scroll down" hint collides
with the demo's caption text instead of pointing at hidden content. */ with the demo's caption text instead of pointing at hidden content. */
body[data-active-page="p2"] .scroll-hint { body[data-active-page="p2"] .scroll-hint {