@atomic-ui/ui 0.2.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +88 -105
- package/custom-elements.json +6370 -15469
- package/dist/base/FieldElement.d.ts +14 -3
- package/dist/base/{ImpktElement.d.ts → ImpaktElement.d.ts} +2 -2
- package/dist/base/scroll-lock.d.ts +2 -0
- package/dist/base/styles.d.ts +31 -5
- package/dist/base/tokens.d.ts +1 -1
- package/dist/base/tone.d.ts +20 -0
- package/dist/chunk-2YRTFWW2.js +26 -0
- package/dist/chunk-2YRTFWW2.js.map +1 -0
- package/dist/{chunk-7BSZPUE3.js → chunk-3EF4T242.js} +7 -7
- package/dist/chunk-3EF4T242.js.map +1 -0
- package/dist/{chunk-KFD4O7VA.js → chunk-5Y3HYRCU.js} +7 -7
- package/dist/chunk-5Y3HYRCU.js.map +1 -0
- package/dist/{chunk-7AJN2TIS.js → chunk-5ZQVL3V2.js} +29 -12
- package/dist/chunk-5ZQVL3V2.js.map +1 -0
- package/dist/{chunk-NCASAXQT.js → chunk-A7YBFS4H.js} +15 -15
- package/dist/chunk-A7YBFS4H.js.map +1 -0
- package/dist/{chunk-E2VBUWJ4.js → chunk-ACQ4KYPR.js} +9 -9
- package/dist/chunk-ACQ4KYPR.js.map +1 -0
- package/dist/{chunk-OMJMUFOW.js → chunk-DE3INTHZ.js} +6 -6
- package/dist/chunk-DE3INTHZ.js.map +1 -0
- package/dist/chunk-EJD6LT7E.js +161 -0
- package/dist/chunk-EJD6LT7E.js.map +1 -0
- package/dist/{chunk-XJXCTGDR.js → chunk-EJSX4WCD.js} +9 -9
- package/dist/chunk-EJSX4WCD.js.map +1 -0
- package/dist/chunk-FMSC7J7J.js +76 -0
- package/dist/chunk-FMSC7J7J.js.map +1 -0
- package/dist/{chunk-R67PDFKE.js → chunk-FWR6SEIA.js} +33 -33
- package/dist/chunk-FWR6SEIA.js.map +1 -0
- package/dist/{chunk-FFCIY7NM.js → chunk-GJPHQLLN.js} +8 -8
- package/dist/chunk-GJPHQLLN.js.map +1 -0
- package/dist/{chunk-OLLZFNO6.js → chunk-HNBG2POR.js} +7 -7
- package/dist/chunk-HNBG2POR.js.map +1 -0
- package/dist/{chunk-E3XJK7MY.js → chunk-HNZQ7LM4.js} +13 -11
- package/dist/chunk-HNZQ7LM4.js.map +1 -0
- package/dist/{chunk-3IQ73WNW.js → chunk-I54DOEZB.js} +9 -7
- package/dist/chunk-I54DOEZB.js.map +1 -0
- package/dist/{chunk-QB2KMV6S.js → chunk-PANH23MF.js} +12 -12
- package/dist/chunk-PANH23MF.js.map +1 -0
- package/dist/{chunk-UCHJCUYI.js → chunk-PYVUQNFQ.js} +39 -13
- package/dist/chunk-PYVUQNFQ.js.map +1 -0
- package/dist/{chunk-GQDUHZE3.js → chunk-Q54FX3SY.js} +8 -8
- package/dist/chunk-Q54FX3SY.js.map +1 -0
- package/dist/{chunk-WFKSOM6O.js → chunk-QBORJTS4.js} +68 -44
- package/dist/chunk-QBORJTS4.js.map +1 -0
- package/dist/{chunk-TGT7J4EG.js → chunk-RXX4CN5J.js} +7 -7
- package/dist/chunk-RXX4CN5J.js.map +1 -0
- package/dist/{chunk-XEJMFFIM.js → chunk-SV77SN6P.js} +8 -8
- package/dist/chunk-SV77SN6P.js.map +1 -0
- package/dist/chunk-TAZZLOUY.js +328 -0
- package/dist/chunk-TAZZLOUY.js.map +1 -0
- package/dist/{chunk-7OXTZJR4.js → chunk-TRZO5CHU.js} +7 -7
- package/dist/chunk-TRZO5CHU.js.map +1 -0
- package/dist/{chunk-EDSZI227.js → chunk-UPOTBKKK.js} +12 -9
- package/dist/chunk-UPOTBKKK.js.map +1 -0
- package/dist/{chunk-26O27BQS.js → chunk-WP5WJ4V5.js} +6 -6
- package/dist/chunk-WP5WJ4V5.js.map +1 -0
- package/dist/{chunk-YD6IZ2C5.js → chunk-WS5AUJ35.js} +7 -7
- package/dist/chunk-WS5AUJ35.js.map +1 -0
- package/dist/{chunk-HYPPG4NF.js → chunk-WWYYNR3Z.js} +93 -53
- package/dist/chunk-WWYYNR3Z.js.map +1 -0
- package/dist/{chunk-NKTMMJYD.js → chunk-XU2XODVH.js} +9 -8
- package/dist/chunk-XU2XODVH.js.map +1 -0
- package/dist/{chunk-D6C7XEY4.js → chunk-YR6T73GY.js} +24 -12
- package/dist/chunk-YR6T73GY.js.map +1 -0
- package/dist/{chunk-OB7WULFK.js → chunk-YYYQPKQ7.js} +24 -24
- package/dist/chunk-YYYQPKQ7.js.map +1 -0
- package/dist/{chunk-FJRHZA3C.js → chunk-Z45LY6BT.js} +9 -9
- package/dist/chunk-Z45LY6BT.js.map +1 -0
- package/dist/{chunk-6YYAOKNI.js → chunk-ZQBEFP2O.js} +7 -7
- package/dist/chunk-ZQBEFP2O.js.map +1 -0
- package/dist/chunk-ZS7RPXCT.js +47 -0
- package/dist/chunk-ZS7RPXCT.js.map +1 -0
- package/dist/components/accordion.d.ts +3 -3
- package/dist/components/accordion.js +4 -4
- package/dist/components/alert.d.ts +3 -3
- package/dist/components/alert.js +4 -4
- package/dist/components/app-ui.d.ts +47 -31
- package/dist/components/app-ui.js +21 -20
- package/dist/components/badge.d.ts +37 -0
- package/dist/components/badge.js +9 -0
- package/dist/components/blocks.d.ts +37 -74
- package/dist/components/blocks.js +10 -13
- package/dist/components/button.d.ts +3 -3
- package/dist/components/button.js +5 -5
- package/dist/components/checkbox-group.d.ts +2 -2
- package/dist/components/checkbox-group.js +5 -5
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/checkbox.js +5 -5
- package/dist/components/chip.d.ts +58 -0
- package/dist/components/chip.js +8 -0
- package/dist/components/date-input.d.ts +2 -2
- package/dist/components/date-input.js +5 -5
- package/dist/components/dialog.d.ts +18 -3
- package/dist/components/dialog.js +5 -4
- package/dist/components/fieldset.d.ts +3 -3
- package/dist/components/fieldset.js +4 -4
- package/dist/components/grid.d.ts +3 -3
- package/dist/components/grid.js +4 -4
- package/dist/components/help.d.ts +3 -3
- package/dist/components/help.js +4 -4
- package/dist/components/icon.d.ts +3 -3
- package/dist/components/icon.js +4 -4
- package/dist/components/journey.d.ts +30 -16
- package/dist/components/journey.js +15 -15
- package/dist/components/layout.d.ts +9 -9
- package/dist/components/layout.js +10 -10
- package/dist/components/link.d.ts +3 -3
- package/dist/components/link.js +5 -5
- package/dist/components/list.d.ts +3 -3
- package/dist/components/list.js +4 -4
- package/dist/components/media.d.ts +8 -8
- package/dist/components/media.js +8 -8
- package/dist/components/navigation.d.ts +5 -5
- package/dist/components/navigation.js +7 -7
- package/dist/components/page.d.ts +5 -5
- package/dist/components/page.js +6 -6
- package/dist/components/price.d.ts +3 -3
- package/dist/components/price.js +4 -4
- package/dist/components/progress.d.ts +3 -3
- package/dist/components/progress.js +4 -4
- package/dist/components/radio-group.d.ts +2 -2
- package/dist/components/radio-group.js +5 -5
- package/dist/components/select.d.ts +2 -2
- package/dist/components/select.js +5 -5
- package/dist/components/summary-list.d.ts +3 -3
- package/dist/components/summary-list.js +4 -4
- package/dist/components/table.d.ts +97 -5
- package/dist/components/table.js +6 -4
- package/dist/components/text-input.d.ts +2 -2
- package/dist/components/text-input.js +5 -5
- package/dist/components/textarea.d.ts +2 -2
- package/dist/components/textarea.js +5 -5
- package/dist/index.d.ts +47 -40
- package/dist/index.js +206 -269
- package/dist/standalone/atomic-ui.js +1928 -0
- package/dist/standalone/atomic-ui.js.map +7 -0
- package/dist/standalone/index.html +173 -0
- package/package.json +19 -7
- package/scripts/copy-to-product.mjs +52 -0
- package/specimen/index.html +173 -0
- package/dist/chunk-26O27BQS.js.map +0 -1
- package/dist/chunk-2CFVV2NZ.js +0 -494
- package/dist/chunk-2CFVV2NZ.js.map +0 -1
- package/dist/chunk-3IQ73WNW.js.map +0 -1
- package/dist/chunk-4X723QBD.js +0 -361
- package/dist/chunk-4X723QBD.js.map +0 -1
- package/dist/chunk-6YYAOKNI.js.map +0 -1
- package/dist/chunk-7AJN2TIS.js.map +0 -1
- package/dist/chunk-7BSZPUE3.js.map +0 -1
- package/dist/chunk-7OXTZJR4.js.map +0 -1
- package/dist/chunk-7XEPNEVQ.js +0 -264
- package/dist/chunk-7XEPNEVQ.js.map +0 -1
- package/dist/chunk-D6C7XEY4.js.map +0 -1
- package/dist/chunk-E2VBUWJ4.js.map +0 -1
- package/dist/chunk-E3XJK7MY.js.map +0 -1
- package/dist/chunk-EDSZI227.js.map +0 -1
- package/dist/chunk-FFCIY7NM.js.map +0 -1
- package/dist/chunk-FJRHZA3C.js.map +0 -1
- package/dist/chunk-GQDUHZE3.js.map +0 -1
- package/dist/chunk-HYPPG4NF.js.map +0 -1
- package/dist/chunk-J4JULXUG.js +0 -249
- package/dist/chunk-J4JULXUG.js.map +0 -1
- package/dist/chunk-KFD4O7VA.js.map +0 -1
- package/dist/chunk-MVEFM5QI.js +0 -195
- package/dist/chunk-MVEFM5QI.js.map +0 -1
- package/dist/chunk-NCASAXQT.js.map +0 -1
- package/dist/chunk-NKTMMJYD.js.map +0 -1
- package/dist/chunk-OB7WULFK.js.map +0 -1
- package/dist/chunk-OHDPGIJ3.js +0 -428
- package/dist/chunk-OHDPGIJ3.js.map +0 -1
- package/dist/chunk-OLLZFNO6.js.map +0 -1
- package/dist/chunk-OMJMUFOW.js.map +0 -1
- package/dist/chunk-QB2KMV6S.js.map +0 -1
- package/dist/chunk-R67PDFKE.js.map +0 -1
- package/dist/chunk-RZSZQMSE.js +0 -236
- package/dist/chunk-RZSZQMSE.js.map +0 -1
- package/dist/chunk-TGT7J4EG.js.map +0 -1
- package/dist/chunk-UCHJCUYI.js.map +0 -1
- package/dist/chunk-UHLRXI6J.js +0 -453
- package/dist/chunk-UHLRXI6J.js.map +0 -1
- package/dist/chunk-UNVL3CNM.js +0 -725
- package/dist/chunk-UNVL3CNM.js.map +0 -1
- package/dist/chunk-WDDWWCHN.js +0 -104
- package/dist/chunk-WDDWWCHN.js.map +0 -1
- package/dist/chunk-WFKSOM6O.js.map +0 -1
- package/dist/chunk-XEJMFFIM.js.map +0 -1
- package/dist/chunk-XJXCTGDR.js.map +0 -1
- package/dist/chunk-YD6IZ2C5.js.map +0 -1
- package/dist/chunk-YK5QI57J.js +0 -396
- package/dist/chunk-YK5QI57J.js.map +0 -1
- package/dist/components/changelog.d.ts +0 -386
- package/dist/components/changelog.js +0 -25
- package/dist/components/estimator.d.ts +0 -246
- package/dist/components/estimator.js +0 -16
- package/dist/components/marketing.d.ts +0 -370
- package/dist/components/marketing.js +0 -21
- package/dist/components/marketing.js.map +0 -1
- package/dist/components/organisms.d.ts +0 -559
- package/dist/components/organisms.js +0 -25
- package/dist/components/organisms.js.map +0 -1
- package/dist/components/property.d.ts +0 -389
- package/dist/components/property.js +0 -20
- package/dist/components/property.js.map +0 -1
- package/dist/components/scene.d.ts +0 -138
- package/dist/components/scene.js +0 -8
- package/dist/components/scene.js.map +0 -1
- package/dist/components/scrubber.d.ts +0 -86
- package/dist/components/scrubber.js +0 -8
- package/dist/components/scrubber.js.map +0 -1
- package/dist/components/selling.d.ts +0 -407
- package/dist/components/selling.js +0 -25
- package/dist/components/selling.js.map +0 -1
- package/dist/components/site.d.ts +0 -283
- package/dist/components/site.js +0 -20
- package/dist/components/site.js.map +0 -1
- /package/dist/components/{changelog.js.map → badge.js.map} +0 -0
- /package/dist/components/{estimator.js.map → chip.js.map} +0 -0
package/dist/chunk-UHLRXI6J.js
DELETED
|
@@ -1,453 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
pageLocale
|
|
3
|
-
} from "./chunk-3IGNZTJU.js";
|
|
4
|
-
import {
|
|
5
|
-
ImpktElement,
|
|
6
|
-
focusRing,
|
|
7
|
-
fontWeight,
|
|
8
|
-
say,
|
|
9
|
-
space,
|
|
10
|
-
spaceAround,
|
|
11
|
-
t,
|
|
12
|
-
targetSize,
|
|
13
|
-
type,
|
|
14
|
-
visuallyHidden
|
|
15
|
-
} from "./chunk-D6C7XEY4.js";
|
|
16
|
-
|
|
17
|
-
// packages/ui/src/components/selling.ts
|
|
18
|
-
import { css, html, nothing } from "lit";
|
|
19
|
-
var card = css`
|
|
20
|
-
.card { background: ${t.surfaceCard}; border-radius: ${t.radiusXl}; box-shadow: ${t.shadowSm}, 0 0 0 1px ${t.hairline}; }
|
|
21
|
-
.h { margin: 0; font-family: ${t.fontHeading}; ${type("2xl")} font-weight: ${fontWeight("bold")}; color: ${t.textHeading}; }
|
|
22
|
-
.btn { display: inline-flex; justify-content: center; align-items: center; min-block-size: 44px; padding: ${space(2.5)} ${space(5)}; font: inherit; font-weight: ${fontWeight("semibold")}; color: ${t.onBrand}; text-decoration: none; background: ${t.brand}; border: 0; border-radius: ${t.radiusLg}; cursor: pointer; }
|
|
23
|
-
.btn:hover { background: ${t.brandHover}; }
|
|
24
|
-
.btn.quiet { color: ${t.link}; background: transparent; box-shadow: inset 0 0 0 ${t.borderThin} ${t.border}; }
|
|
25
|
-
.small { margin: 0; ${type("xs")} color: ${t.textMuted}; }
|
|
26
|
-
.visually-hidden { ${visuallyHidden} }
|
|
27
|
-
`;
|
|
28
|
-
var money = (amount, currency = "GBP", digits = 0) => {
|
|
29
|
-
try {
|
|
30
|
-
return new Intl.NumberFormat(pageLocale(), { style: "currency", currency, maximumFractionDigits: digits, minimumFractionDigits: digits }).format(amount);
|
|
31
|
-
} catch {
|
|
32
|
-
return String(Math.round(amount));
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
var ImpktPlanComparison = class extends ImpktElement {
|
|
36
|
-
static {
|
|
37
|
-
this.properties = {
|
|
38
|
-
heading: { type: String },
|
|
39
|
-
plans: { type: Array },
|
|
40
|
-
rows: { type: Array },
|
|
41
|
-
buttonText: { type: String, attribute: "button-text" },
|
|
42
|
-
headingLevel: { type: Number, attribute: "heading-level" },
|
|
43
|
-
spaceAbove: { type: String, reflect: true, attribute: "space-above" },
|
|
44
|
-
spaceBelow: { type: String, reflect: true, attribute: "space-below" }
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
constructor() {
|
|
48
|
-
super();
|
|
49
|
-
this.heading = "Compare cover";
|
|
50
|
-
this.plans = [];
|
|
51
|
-
this.rows = [];
|
|
52
|
-
this.buttonText = "Choose";
|
|
53
|
-
this.headingLevel = 2;
|
|
54
|
-
this.spaceAbove = "none";
|
|
55
|
-
this.spaceBelow = "none";
|
|
56
|
-
}
|
|
57
|
-
static {
|
|
58
|
-
this.styles = [...ImpktElement.styles, focusRing, targetSize, spaceAround, card, css`
|
|
59
|
-
:host { display: block; container-type: inline-size; }
|
|
60
|
-
.h { margin-block-end: ${space(5)}; }
|
|
61
|
-
.grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: ${space(4)}; }
|
|
62
|
-
.plan { position: relative; display: flex; flex-direction: column; gap: ${space(3)}; padding: ${space(6)}; }
|
|
63
|
-
.plan.top { box-shadow: 0 0 0 2px ${t.brand}, ${t.shadowMd}; }
|
|
64
|
-
.badge { position: absolute; inset-block-start: 0; inset-inline-start: 50%; transform: translate(-50%, -50%); padding: ${space(1)} ${space(3)}; border-radius: 999px; ${type("xs")} font-weight: ${fontWeight("bold")}; color: ${t.onBrand}; background: ${t.brand}; white-space: nowrap; }
|
|
65
|
-
.name { margin: 0; ${type("lg")} font-weight: ${fontWeight("bold")}; color: ${t.text}; }
|
|
66
|
-
.price { margin: 0; font-family: ${t.fontHeading}; ${type("3xl")} font-weight: ${fontWeight("bold")}; color: ${t.text}; }
|
|
67
|
-
.period { ${type("sm")} font-weight: ${fontWeight("regular")}; color: ${t.textMuted}; }
|
|
68
|
-
.note { margin: 0; ${type("sm")} color: ${t.textMuted}; }
|
|
69
|
-
ul { flex: 1; margin: 0; padding: ${space(3)} 0 0; list-style: none; display: grid; gap: ${space(2)}; border-block-start: 1px solid ${t.rule}; align-content: start; }
|
|
70
|
-
li { display: flex; gap: ${space(2)}; ${type("sm")} }
|
|
71
|
-
li[data-has='false'] { color: ${t.textMuted}; }
|
|
72
|
-
.mark { flex-shrink: 0; inline-size: 1.25em; font-weight: ${fontWeight("bold")}; text-align: center; }
|
|
73
|
-
li[data-has='true'] .mark { color: ${t.successText}; }
|
|
74
|
-
@container (max-width: 40rem) { .grid { grid-template-columns: minmax(0, 1fr); gap: ${space(6)}; } }
|
|
75
|
-
`];
|
|
76
|
-
}
|
|
77
|
-
has(plan, row) {
|
|
78
|
-
return plan.includes.split(",").map((s) => s.trim().toLowerCase()).includes(row.label.trim().toLowerCase());
|
|
79
|
-
}
|
|
80
|
-
choose(plan, event) {
|
|
81
|
-
const go = this.dispatchEvent(new CustomEvent("impkt-select", { detail: { plan }, bubbles: true, composed: true, cancelable: true }));
|
|
82
|
-
if (!go) event.preventDefault();
|
|
83
|
-
}
|
|
84
|
-
render() {
|
|
85
|
-
return html`
|
|
86
|
-
${this.heading ? html`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>` : nothing}
|
|
87
|
-
<div class="grid" style=${`--cols: ${Math.max(1, this.plans.length)}`}>
|
|
88
|
-
${this.plans.map((p) => html`<section class="card plan ${p.badge ? "top" : ""}" aria-labelledby=${this.id_(`n-${p.id}`)}>
|
|
89
|
-
${p.badge ? html`<span class="badge">${p.badge}</span>` : nothing}
|
|
90
|
-
<h3 class="name" id=${this.id_(`n-${p.id}`)}>${p.name}</h3>
|
|
91
|
-
<p class="price">${p.price}${p.period ? html` <span class="period">${p.period}</span>` : nothing}</p>
|
|
92
|
-
${p.note ? html`<p class="note">${p.note}</p>` : nothing}
|
|
93
|
-
<ul>${this.rows.map((r) => {
|
|
94
|
-
const has = this.has(p, r);
|
|
95
|
-
return html`<li data-has=${String(has)}><span class="mark" aria-hidden="true">${has ? "\u2713" : "\u2013"}</span><span>${r.label}<span class="visually-hidden">: ${say(has ? "included" : "not included")}</span></span></li>`;
|
|
96
|
-
})}</ul>
|
|
97
|
-
${p.href ? html`<a class="btn ${p.badge ? "" : "quiet"}" href=${p.href} @click=${(e) => this.choose(p, e)}>${this.buttonText}<span class="visually-hidden"> ${p.name}</span></a>` : html`<button class="btn ${p.badge ? "" : "quiet"}" type="button" @click=${(e) => this.choose(p, e)}>${this.buttonText}<span class="visually-hidden"> ${p.name}</span></button>`}
|
|
98
|
-
</section>`)}
|
|
99
|
-
</div>`;
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
function embedOf(src, locale) {
|
|
103
|
-
const yt = /(?:youtube\.com\/(?:watch\?v=|embed\/|shorts\/)|youtu\.be\/)([\w-]{6,})/.exec(src);
|
|
104
|
-
const hl = locale && !/^en\b/i.test(locale) ? `&hl=${encodeURIComponent(locale.split("-")[0])}&cc_lang_pref=${encodeURIComponent(locale.split("-")[0])}` : "";
|
|
105
|
-
if (yt) return `https://www.youtube-nocookie.com/embed/${yt[1]}?autoplay=1&rel=0${hl}`;
|
|
106
|
-
const vimeo = /vimeo\.com\/(?:video\/)?(\d+)/.exec(src);
|
|
107
|
-
if (vimeo) return `https://player.vimeo.com/video/${vimeo[1]}?autoplay=1&dnt=1`;
|
|
108
|
-
return null;
|
|
109
|
-
}
|
|
110
|
-
var ImpktVideo = class extends ImpktElement {
|
|
111
|
-
static {
|
|
112
|
-
this.properties = {
|
|
113
|
-
videoSrc: { type: String, attribute: "video-src" },
|
|
114
|
-
label: { type: String },
|
|
115
|
-
posterSrc: { type: String, attribute: "poster-src" },
|
|
116
|
-
captionsSrc: { type: String, attribute: "captions-src" },
|
|
117
|
-
transcriptHref: { type: String, attribute: "transcript-href" },
|
|
118
|
-
playText: { type: String, attribute: "play-text" },
|
|
119
|
-
ratio: { type: String, reflect: true },
|
|
120
|
-
spaceAbove: { type: String, reflect: true, attribute: "space-above" },
|
|
121
|
-
spaceBelow: { type: String, reflect: true, attribute: "space-below" }
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
constructor() {
|
|
125
|
-
super();
|
|
126
|
-
this.videoSrc = "";
|
|
127
|
-
this.label = "Video";
|
|
128
|
-
this.posterSrc = "";
|
|
129
|
-
this.captionsSrc = "";
|
|
130
|
-
this.transcriptHref = "";
|
|
131
|
-
this.playText = "Play video";
|
|
132
|
-
this.ratio = "16:9";
|
|
133
|
-
this.playing = false;
|
|
134
|
-
this.spaceAbove = "none";
|
|
135
|
-
this.spaceBelow = "none";
|
|
136
|
-
}
|
|
137
|
-
static {
|
|
138
|
-
this.styles = [...ImpktElement.styles, focusRing, spaceAround, card, css`
|
|
139
|
-
:host { display: block; }
|
|
140
|
-
.frame { position: relative; overflow: hidden; aspect-ratio: 16 / 9; border-radius: ${t.radiusXl}; background: #111; }
|
|
141
|
-
:host([ratio='4:3']) .frame { aspect-ratio: 4 / 3; }
|
|
142
|
-
:host([ratio='1:1']) .frame { aspect-ratio: 1; }
|
|
143
|
-
:host([ratio='9:16']) .frame { aspect-ratio: 9 / 16; max-inline-size: 420px; }
|
|
144
|
-
iframe, video, img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; border: 0; object-fit: cover; }
|
|
145
|
-
.play { position: absolute; inset: 0; display: grid; place-items: center; inline-size: 100%; padding: 0; color: #fff; background: linear-gradient(transparent 40%, rgb(0 0 0 / 0.55)); border: 0; cursor: pointer; }
|
|
146
|
-
.disc { display: grid; place-items: center; inline-size: 72px; block-size: 72px; border-radius: 50%; background: ${t.brand}; box-shadow: ${t.shadowLg}; }
|
|
147
|
-
.label { position: absolute; inset-inline-start: ${space(5)}; inset-block-end: ${space(4)}; ${type("lg")} font-weight: ${fontWeight("semibold")}; text-align: start; }
|
|
148
|
-
.foot { margin: ${space(2)} 0 0; ${type("sm")} }
|
|
149
|
-
.foot a { color: ${t.link}; }
|
|
150
|
-
.empty { display: grid; place-items: center; block-size: 100%; color: #ccc; }
|
|
151
|
-
`];
|
|
152
|
-
}
|
|
153
|
-
render() {
|
|
154
|
-
const embed = embedOf(this.videoSrc, pageLocale(this));
|
|
155
|
-
let player;
|
|
156
|
-
if (!this.videoSrc) player = html`<div class="empty">${say("Add a video address")}</div>`;
|
|
157
|
-
else if (embed && this.playing) player = html`<iframe src=${embed} title=${this.label} allow="autoplay; encrypted-media; picture-in-picture; fullscreen" allowfullscreen></iframe>`;
|
|
158
|
-
else if (embed) player = html`${this.posterSrc ? html`<img src=${this.posterSrc} alt="" />` : nothing}
|
|
159
|
-
<button class="play" type="button" @click=${() => {
|
|
160
|
-
this.playing = true;
|
|
161
|
-
}}>
|
|
162
|
-
<span class="disc" aria-hidden="true"><svg width="28" height="28" viewBox="0 0 24 24" fill="currentColor"><path d="M8 5v14l11-7z"/></svg></span>
|
|
163
|
-
<span class="label">${this.playText}<span class="visually-hidden">: ${this.label}</span></span>
|
|
164
|
-
</button>`;
|
|
165
|
-
else player = html`<video controls preload="metadata" poster=${this.posterSrc || nothing} aria-label=${this.label}>
|
|
166
|
-
<source src=${this.videoSrc} />
|
|
167
|
-
${this.captionsSrc ? html`<track kind="captions" src=${this.captionsSrc} srclang="en" label="English" default />` : nothing}
|
|
168
|
-
</video>`;
|
|
169
|
-
return html`<div class="frame" part="frame">${player}</div>
|
|
170
|
-
${this.transcriptHref ? html`<p class="foot"><a href=${this.transcriptHref}>${say("Read the transcript")}<span class="visually-hidden">${say(" of {video}", { video: this.label })}</span></a></p>` : nothing}`;
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
var NOTICE_WORDS = {
|
|
174
|
-
mortgage: { heading: "Your home may be repossessed", text: "Your home may be repossessed if you do not keep up repayments on your mortgage." },
|
|
175
|
-
"secured-loan": { heading: "Think carefully before securing other debts against your home", text: "Your home may be repossessed if you do not keep up repayments on a mortgage or any other debt secured on it." },
|
|
176
|
-
investment: { heading: "Capital at risk", text: "The value of investments can go down as well as up, and you may get back less than you put in." },
|
|
177
|
-
insurance: { heading: "Important information", text: "Read the policy documents to check the cover suits your needs. Limits and exclusions apply." },
|
|
178
|
-
custom: { heading: "", text: "" }
|
|
179
|
-
};
|
|
180
|
-
var ImpktRegulatoryNotice = class extends ImpktElement {
|
|
181
|
-
static {
|
|
182
|
-
this.properties = {
|
|
183
|
-
kind: { type: String, reflect: true },
|
|
184
|
-
heading: { type: String },
|
|
185
|
-
text: { type: String },
|
|
186
|
-
firm: { type: String },
|
|
187
|
-
spaceAbove: { type: String, reflect: true, attribute: "space-above" },
|
|
188
|
-
spaceBelow: { type: String, reflect: true, attribute: "space-below" }
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
constructor() {
|
|
192
|
-
super();
|
|
193
|
-
this.kind = "mortgage";
|
|
194
|
-
this.heading = "";
|
|
195
|
-
this.text = "";
|
|
196
|
-
this.firm = "";
|
|
197
|
-
this.spaceAbove = "none";
|
|
198
|
-
this.spaceBelow = "none";
|
|
199
|
-
}
|
|
200
|
-
static {
|
|
201
|
-
this.styles = [...ImpktElement.styles, spaceAround, css`
|
|
202
|
-
:host { display: block; }
|
|
203
|
-
.box { padding: ${space(5)}; border-inline-start: 6px solid ${t.warning}; border-radius: ${t.radiusLg}; background: ${t.warningSubtle}; }
|
|
204
|
-
:host([kind='insurance']) .box { border-color: ${t.info}; background: ${t.infoSubtle}; }
|
|
205
|
-
strong { display: block; margin-block-end: ${space(1)}; ${type("md")} color: ${t.text}; }
|
|
206
|
-
p { margin: 0; color: ${t.text}; }
|
|
207
|
-
.firm { margin-block-start: ${space(3)}; ${type("sm")} color: ${t.textMuted}; }
|
|
208
|
-
`];
|
|
209
|
-
}
|
|
210
|
-
render() {
|
|
211
|
-
const preset = NOTICE_WORDS[this.kind] ?? NOTICE_WORDS.custom;
|
|
212
|
-
const heading = this.heading || (preset.heading ? say(preset.heading) : "");
|
|
213
|
-
const text = this.text || (preset.text ? say(preset.text) : "");
|
|
214
|
-
return html`<aside class="box" part="box" aria-label=${heading || say("Important information")}>
|
|
215
|
-
${heading ? html`<strong>${heading}</strong>` : nothing}
|
|
216
|
-
${text ? html`<p>${text}</p>` : nothing}
|
|
217
|
-
${this.firm ? html`<p class="firm">${this.firm}</p>` : nothing}
|
|
218
|
-
</aside>`;
|
|
219
|
-
}
|
|
220
|
-
};
|
|
221
|
-
var SDLT = {
|
|
222
|
-
standard: [{ from: 0, rate: 0 }, { from: 125e3, rate: 2 }, { from: 25e4, rate: 5 }, { from: 925e3, rate: 10 }, { from: 15e5, rate: 12 }],
|
|
223
|
-
firstTime: [{ from: 0, rate: 0 }, { from: 3e5, rate: 5 }],
|
|
224
|
-
firstTimeLimit: 5e5,
|
|
225
|
-
additionalSurcharge: 5
|
|
226
|
-
};
|
|
227
|
-
function taxOn(price, bands, extra = 0) {
|
|
228
|
-
let tax = 0;
|
|
229
|
-
bands.forEach((band, i) => {
|
|
230
|
-
const top = bands[i + 1]?.from ?? Infinity;
|
|
231
|
-
if (price > band.from) tax += (Math.min(price, top) - band.from) * (band.rate + extra) / 100;
|
|
232
|
-
});
|
|
233
|
-
return Math.round(tax);
|
|
234
|
-
}
|
|
235
|
-
function stampDuty(price, buyer) {
|
|
236
|
-
if (price <= 0) return 0;
|
|
237
|
-
if (buyer === "first-time" && price <= SDLT.firstTimeLimit) return taxOn(price, SDLT.firstTime);
|
|
238
|
-
if (buyer === "additional") return price < 4e4 ? 0 : taxOn(price, SDLT.standard, SDLT.additionalSurcharge);
|
|
239
|
-
return taxOn(price, SDLT.standard);
|
|
240
|
-
}
|
|
241
|
-
var calcStyles = css`
|
|
242
|
-
:host { display: block; container-type: inline-size; }
|
|
243
|
-
.wrap { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); overflow: hidden; }
|
|
244
|
-
.inputs { display: flex; flex-direction: column; gap: ${space(5)}; padding: ${space(8)}; }
|
|
245
|
-
label, legend { display: block; ${type("sm")} font-weight: ${fontWeight("semibold")}; margin-block-end: ${space(1.5)}; padding: 0; }
|
|
246
|
-
fieldset { margin: 0; padding: 0; border: 0; }
|
|
247
|
-
.choices { display: flex; flex-wrap: wrap; gap: ${space(2)}; }
|
|
248
|
-
.choices label { display: inline-flex; align-items: center; gap: ${space(2)}; margin: 0; padding: ${space(2)} ${space(3)}; font-weight: ${fontWeight("regular")}; border: ${t.borderThin} solid ${t.border}; border-radius: ${t.radiusLg}; cursor: pointer; }
|
|
249
|
-
.choices input { accent-color: ${t.brand}; }
|
|
250
|
-
input[type='number'] { box-sizing: border-box; inline-size: 100%; min-block-size: 44px; padding: ${space(2)} ${space(3)}; font: inherit; color: ${t.text}; background: ${t.surfaceCard}; border: ${t.borderThin} solid ${t.border}; border-radius: ${t.radiusLg}; }
|
|
251
|
-
.result { display: flex; flex-direction: column; justify-content: center; gap: ${space(2)}; padding: ${space(8)}; color: ${t.onBrand}; background: ${t.brand}; }
|
|
252
|
-
.caption { margin: 0; ${type("sm")} opacity: 0.85; }
|
|
253
|
-
output { display: block; font-family: ${t.fontHeading}; ${type("4xl")} font-weight: ${fontWeight("bold")}; }
|
|
254
|
-
.line { margin: 0; ${type("sm")} }
|
|
255
|
-
.foot { grid-column: 1 / -1; padding: ${space(4)} ${space(8)}; background: ${t.surfaceSubtle}; }
|
|
256
|
-
@container (max-width: 44rem) { .wrap { grid-template-columns: minmax(0, 1fr); } .inputs, .result { padding: ${space(5)}; } .foot { padding: ${space(4)} ${space(5)}; } }
|
|
257
|
-
`;
|
|
258
|
-
var ImpktStampDutyCalculator = class extends ImpktElement {
|
|
259
|
-
static {
|
|
260
|
-
this.properties = {
|
|
261
|
-
heading: { type: String },
|
|
262
|
-
price: { type: Number },
|
|
263
|
-
buyer: { type: String },
|
|
264
|
-
smallPrint: { type: String, attribute: "small-print" },
|
|
265
|
-
headingLevel: { type: Number, attribute: "heading-level" },
|
|
266
|
-
spaceAbove: { type: String, reflect: true, attribute: "space-above" },
|
|
267
|
-
spaceBelow: { type: String, reflect: true, attribute: "space-below" }
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
constructor() {
|
|
271
|
-
super();
|
|
272
|
-
this.heading = "How much stamp duty would you pay?";
|
|
273
|
-
this.price = 385e3;
|
|
274
|
-
this.buyer = "first-time";
|
|
275
|
-
this.smallPrint = "Based on Stamp Duty Land Tax rates in England and Northern Ireland from 1 April 2025. Scotland and Wales have their own taxes. Check what you would pay on GOV.UK.";
|
|
276
|
-
this.headingLevel = 2;
|
|
277
|
-
this.spaceAbove = "none";
|
|
278
|
-
this.spaceBelow = "none";
|
|
279
|
-
}
|
|
280
|
-
static {
|
|
281
|
-
this.styles = [...ImpktElement.styles, focusRing, spaceAround, card, calcStyles];
|
|
282
|
-
}
|
|
283
|
-
render() {
|
|
284
|
-
const duty = stampDuty(this.price, this.buyer);
|
|
285
|
-
const rate = this.price > 0 ? duty / this.price * 100 : 0;
|
|
286
|
-
const buyers = [["first-time", say("First home")], ["mover", say("Moving home")], ["additional", say("Second home")]];
|
|
287
|
-
return html`<div class="card wrap" part="wrap">
|
|
288
|
-
<div class="inputs">
|
|
289
|
-
${this.heading ? html`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>` : nothing}
|
|
290
|
-
<div><label for=${this.id_("price")}>${say("Price of the home (\xA3)")}</label>
|
|
291
|
-
<input id=${this.id_("price")} type="number" min="0" step="1000" inputmode="numeric" .value=${String(this.price)} @input=${(e) => {
|
|
292
|
-
this.price = Number(e.target.value) || 0;
|
|
293
|
-
}} /></div>
|
|
294
|
-
<fieldset><legend>${say("Are you buying")}</legend><div class="choices">
|
|
295
|
-
${buyers.map(([value, label]) => html`<label><input type="radio" name=${this.id_("buyer")} .checked=${this.buyer === value} @change=${() => {
|
|
296
|
-
this.buyer = value;
|
|
297
|
-
}} />${label}</label>`)}
|
|
298
|
-
</div></fieldset>
|
|
299
|
-
</div>
|
|
300
|
-
<div class="result" aria-live="polite">
|
|
301
|
-
<p class="caption">${say("Stamp duty to pay")}</p>
|
|
302
|
-
<output for=${this.id_("price")}>${money(duty)}</output>
|
|
303
|
-
<p class="line">${duty ? say("About {rate}% of the price", { rate: rate.toFixed(1) }) : say("Nothing to pay at this price")}</p>
|
|
304
|
-
${this.buyer === "first-time" && this.price > SDLT.firstTimeLimit ? html`<p class="line">${say("First-time buyer relief stops above {limit}, so the usual rates apply.", { limit: money(SDLT.firstTimeLimit) })}</p>` : nothing}
|
|
305
|
-
</div>
|
|
306
|
-
${this.smallPrint ? html`<div class="foot"><p class="small">${this.smallPrint}</p></div>` : nothing}
|
|
307
|
-
</div>`;
|
|
308
|
-
}
|
|
309
|
-
};
|
|
310
|
-
var ImpktAffordabilityCalculator = class extends ImpktElement {
|
|
311
|
-
static {
|
|
312
|
-
this.properties = {
|
|
313
|
-
heading: { type: String },
|
|
314
|
-
income: { type: Number },
|
|
315
|
-
secondIncome: { type: Number, attribute: "second-income" },
|
|
316
|
-
deposit: { type: Number },
|
|
317
|
-
timesIncome: { type: Number, attribute: "times-income" },
|
|
318
|
-
smallPrint: { type: String, attribute: "small-print" },
|
|
319
|
-
headingLevel: { type: Number, attribute: "heading-level" },
|
|
320
|
-
spaceAbove: { type: String, reflect: true, attribute: "space-above" },
|
|
321
|
-
spaceBelow: { type: String, reflect: true, attribute: "space-below" }
|
|
322
|
-
};
|
|
323
|
-
}
|
|
324
|
-
constructor() {
|
|
325
|
-
super();
|
|
326
|
-
this.heading = "How much could you borrow?";
|
|
327
|
-
this.income = 45e3;
|
|
328
|
-
this.secondIncome = 0;
|
|
329
|
-
this.deposit = 3e4;
|
|
330
|
-
this.timesIncome = 4.5;
|
|
331
|
-
this.smallPrint = "This is a guide, not a mortgage offer. What a lender offers depends on your circumstances. Your home may be repossessed if you do not keep up repayments on your mortgage.";
|
|
332
|
-
this.headingLevel = 2;
|
|
333
|
-
this.spaceAbove = "none";
|
|
334
|
-
this.spaceBelow = "none";
|
|
335
|
-
}
|
|
336
|
-
static {
|
|
337
|
-
this.styles = [...ImpktElement.styles, focusRing, spaceAround, card, calcStyles];
|
|
338
|
-
}
|
|
339
|
-
field(key) {
|
|
340
|
-
return (event) => {
|
|
341
|
-
this[key] = Number(event.target.value) || 0;
|
|
342
|
-
};
|
|
343
|
-
}
|
|
344
|
-
render() {
|
|
345
|
-
const borrow = Math.max(0, (this.income + this.secondIncome) * this.timesIncome);
|
|
346
|
-
const input = (key, label) => html`<div><label for=${this.id_(key)}>${label}</label>
|
|
347
|
-
<input id=${this.id_(key)} type="number" min="0" step="1000" inputmode="numeric" .value=${String(this[key])} @input=${this.field(key)} /></div>`;
|
|
348
|
-
return html`<div class="card wrap" part="wrap">
|
|
349
|
-
<div class="inputs">
|
|
350
|
-
${this.heading ? html`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>` : nothing}
|
|
351
|
-
${input("income", say("Your yearly income before tax (\xA3)"))}
|
|
352
|
-
${input("secondIncome", say("A second person\u2019s income, if buying together (\xA3)"))}
|
|
353
|
-
${input("deposit", say("Your deposit (\xA3)"))}
|
|
354
|
-
</div>
|
|
355
|
-
<div class="result" aria-live="polite">
|
|
356
|
-
<p class="caption">${say("You could borrow about")}</p>
|
|
357
|
-
<output>${money(borrow)}</output>
|
|
358
|
-
<p class="line">${say("With your deposit, that\u2019s a home of about {amount}.", { amount: money(borrow + this.deposit) })}</p>
|
|
359
|
-
</div>
|
|
360
|
-
${this.smallPrint ? html`<div class="foot"><p class="small">${this.smallPrint}</p></div>` : nothing}
|
|
361
|
-
</div>`;
|
|
362
|
-
}
|
|
363
|
-
};
|
|
364
|
-
var ImpktContactBlock = class extends ImpktElement {
|
|
365
|
-
static {
|
|
366
|
-
this.properties = {
|
|
367
|
-
heading: { type: String },
|
|
368
|
-
phone: { type: String },
|
|
369
|
-
hours: { type: String },
|
|
370
|
-
email: { type: String },
|
|
371
|
-
callbackHeading: { type: String, attribute: "callback-heading" },
|
|
372
|
-
buttonText: { type: String, attribute: "button-text" },
|
|
373
|
-
doneText: { type: String, attribute: "done-text" },
|
|
374
|
-
headingLevel: { type: Number, attribute: "heading-level" },
|
|
375
|
-
spaceAbove: { type: String, reflect: true, attribute: "space-above" },
|
|
376
|
-
spaceBelow: { type: String, reflect: true, attribute: "space-below" }
|
|
377
|
-
};
|
|
378
|
-
}
|
|
379
|
-
constructor() {
|
|
380
|
-
super();
|
|
381
|
-
this.heading = "Talk to us";
|
|
382
|
-
this.phone = "0800 000 0000";
|
|
383
|
-
this.hours = "Monday to Friday, 9am to 6pm\nSaturday, 10am to 2pm";
|
|
384
|
-
this.email = "";
|
|
385
|
-
this.callbackHeading = "Or we can call you";
|
|
386
|
-
this.buttonText = "Ask for a call back";
|
|
387
|
-
this.doneText = "Thanks. We\u2019ll call you at the time you chose.";
|
|
388
|
-
this.headingLevel = 2;
|
|
389
|
-
this.sent = false;
|
|
390
|
-
this.spaceAbove = "none";
|
|
391
|
-
this.spaceBelow = "none";
|
|
392
|
-
}
|
|
393
|
-
static {
|
|
394
|
-
this.styles = [...ImpktElement.styles, focusRing, spaceAround, card, css`
|
|
395
|
-
:host { display: block; container-type: inline-size; }
|
|
396
|
-
.wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: ${space(6)}; padding: ${space(8)}; }
|
|
397
|
-
.phone { display: inline-block; margin: ${space(3)} 0; font-family: ${t.fontHeading}; ${type("3xl")} font-weight: ${fontWeight("bold")}; color: ${t.link}; text-decoration: none; }
|
|
398
|
-
.hours { margin: 0; white-space: pre-line; color: ${t.textMuted}; }
|
|
399
|
-
.email { display: inline-block; margin-block-start: ${space(3)}; color: ${t.link}; }
|
|
400
|
-
form { display: grid; gap: ${space(3)}; padding: ${space(5)}; border-radius: ${t.radiusLg}; background: ${t.surfaceInset}; }
|
|
401
|
-
.sub { margin: 0; ${type("lg")} font-weight: ${fontWeight("bold")}; color: ${t.text}; }
|
|
402
|
-
label { display: block; ${type("sm")} font-weight: ${fontWeight("semibold")}; margin-block-end: ${space(1)}; }
|
|
403
|
-
input, select { box-sizing: border-box; inline-size: 100%; min-block-size: 44px; padding: ${space(2)} ${space(3)}; font: inherit; color: ${t.text}; background: ${t.surfaceCard}; border: ${t.borderThin} solid ${t.border}; border-radius: ${t.radiusLg}; }
|
|
404
|
-
.done { margin: 0; padding: ${space(5)}; border-radius: ${t.radiusLg}; background: ${t.successSubtle}; color: ${t.successText}; font-weight: ${fontWeight("semibold")}; }
|
|
405
|
-
@container (max-width: 40rem) { .wrap { grid-template-columns: minmax(0, 1fr); padding: ${space(5)}; } }
|
|
406
|
-
`];
|
|
407
|
-
}
|
|
408
|
-
submit(event) {
|
|
409
|
-
event.preventDefault();
|
|
410
|
-
const form = new FormData(event.target);
|
|
411
|
-
const data = { name: String(form.get("name") ?? ""), phone: String(form.get("phone") ?? ""), when: String(form.get("when") ?? "") };
|
|
412
|
-
this.dispatchEvent(new CustomEvent("impkt-submit", { detail: data, bubbles: true, composed: true }));
|
|
413
|
-
this.sent = true;
|
|
414
|
-
}
|
|
415
|
-
render() {
|
|
416
|
-
return html`<div class="card wrap" part="wrap">
|
|
417
|
-
<div>
|
|
418
|
-
${this.heading ? html`<div class="h" role="heading" aria-level=${this.headingLevel}>${this.heading}</div>` : nothing}
|
|
419
|
-
${this.phone ? html`<a class="phone" href=${`tel:${this.phone.replace(/[^\d+]/g, "")}`}>${this.phone}</a>` : nothing}
|
|
420
|
-
${this.hours ? html`<p class="hours">${this.hours}</p>` : nothing}
|
|
421
|
-
${this.email ? html`<a class="email" href=${`mailto:${this.email}`}>${this.email}</a>` : nothing}
|
|
422
|
-
</div>
|
|
423
|
-
${!this.callbackHeading ? nothing : this.sent ? html`<p class="done" role="status">${this.doneText}</p>` : html`<form @submit=${this.submit} aria-labelledby=${this.id_("cb")}>
|
|
424
|
-
<p class="sub" id=${this.id_("cb")}>${this.callbackHeading}</p>
|
|
425
|
-
<div><label for=${this.id_("name")}>${say("Your name")}</label><input id=${this.id_("name")} name="name" autocomplete="name" required /></div>
|
|
426
|
-
<div><label for=${this.id_("tel")}>${say("Phone number")}</label><input id=${this.id_("tel")} name="phone" type="tel" autocomplete="tel" required /></div>
|
|
427
|
-
<div><label for=${this.id_("when")}>${say("Best time to call")}</label><select id=${this.id_("when")} name="when"><option value="Morning">${say("Morning")}</option><option value="Afternoon">${say("Afternoon")}</option><option value="Evening">${say("Evening")}</option></select></div>
|
|
428
|
-
<button class="btn" type="submit">${this.buttonText}</button>
|
|
429
|
-
</form>`}
|
|
430
|
-
</div>`;
|
|
431
|
-
}
|
|
432
|
-
};
|
|
433
|
-
ImpktVideo.createProperty("playing", { state: true });
|
|
434
|
-
ImpktContactBlock.createProperty("sent", { state: true });
|
|
435
|
-
customElements.define("impkt-plan-comparison", ImpktPlanComparison);
|
|
436
|
-
customElements.define("impkt-video", ImpktVideo);
|
|
437
|
-
customElements.define("impkt-regulatory-notice", ImpktRegulatoryNotice);
|
|
438
|
-
customElements.define("impkt-stamp-duty-calculator", ImpktStampDutyCalculator);
|
|
439
|
-
customElements.define("impkt-affordability-calculator", ImpktAffordabilityCalculator);
|
|
440
|
-
customElements.define("impkt-contact-block", ImpktContactBlock);
|
|
441
|
-
|
|
442
|
-
export {
|
|
443
|
-
ImpktPlanComparison,
|
|
444
|
-
embedOf,
|
|
445
|
-
ImpktVideo,
|
|
446
|
-
ImpktRegulatoryNotice,
|
|
447
|
-
SDLT,
|
|
448
|
-
stampDuty,
|
|
449
|
-
ImpktStampDutyCalculator,
|
|
450
|
-
ImpktAffordabilityCalculator,
|
|
451
|
-
ImpktContactBlock
|
|
452
|
-
};
|
|
453
|
-
//# sourceMappingURL=chunk-UHLRXI6J.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/selling.ts"],"sourcesContent":["import { css, html, nothing, type TemplateResult } from 'lit';\nimport { say } from '../base/say';\nimport { pageLocale } from '../base/locale';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { focusRing, targetSize, visuallyHidden } from '../base/styles';\nimport { fontWeight, space, spaceAround, t, type } from '../base/tokens';\n\ntype Space = 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\nconst card = css`\n .card { background: ${t.surfaceCard}; border-radius: ${t.radiusXl}; box-shadow: ${t.shadowSm}, 0 0 0 1px ${t.hairline}; }\n .h { margin: 0; font-family: ${t.fontHeading}; ${type('2xl')} font-weight: ${fontWeight('bold')}; color: ${t.textHeading}; }\n .btn { display: inline-flex; justify-content: center; align-items: center; min-block-size: 44px; padding: ${space(2.5)} ${space(5)}; font: inherit; font-weight: ${fontWeight('semibold')}; color: ${t.onBrand}; text-decoration: none; background: ${t.brand}; border: 0; border-radius: ${t.radiusLg}; cursor: pointer; }\n .btn:hover { background: ${t.brandHover}; }\n .btn.quiet { color: ${t.link}; background: transparent; box-shadow: inset 0 0 0 ${t.borderThin} ${t.border}; }\n .small { margin: 0; ${type('xs')} color: ${t.textMuted}; }\n .visually-hidden { ${visuallyHidden} }\n`;\n\nconst money = (amount: number, currency = 'GBP', digits = 0) => {\n try { return new Intl.NumberFormat(pageLocale(), { style: 'currency', currency, maximumFractionDigits: digits, minimumFractionDigits: digits }).format(amount); } catch { return String(Math.round(amount)); }\n};\n\n/** One plan in a comparison. */\nexport interface PlanItem {\n id: string;\n name: string;\n /** The price as shown, such as £12. */\n price: string;\n /** What the price is for, such as `a month`. */\n period?: string;\n note?: string;\n /** The rows this plan has, by their words, separated by commas. */\n includes: string;\n href?: string;\n /** A label such as `Most popular`, which also makes the plan stand out. */\n badge?: string;\n}\n\n/** One line a comparison checks every plan against. */\nexport interface PlanRow {\n id: string;\n label: string;\n}\n\n/**\n * Cover levels side by side, with a tick or a cross for each thing they\n * include and a button under each.\n *\n * A tick is never colour alone: each one says \"Included\" or \"Not included\" to\n * a screen reader. On a narrow screen the plans stack, each with its own list.\n *\n * @category content\n * @icon table\n */\nexport class ImpktPlanComparison extends ImpktElement {\n static properties = {\n heading: { type: String },\n plans: { type: Array },\n rows: { type: Array },\n buttonText: { type: String, attribute: 'button-text' },\n headingLevel: { type: Number, attribute: 'heading-level' },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare heading: string;\n declare plans: PlanItem[];\n declare rows: PlanRow[];\n declare buttonText: string;\n declare headingLevel: 2 | 3;\n declare spaceAbove: Space;\n declare spaceBelow: Space;\n\n constructor() {\n super();\n this.heading = 'Compare cover';\n this.plans = [];\n this.rows = [];\n this.buttonText = 'Choose';\n this.headingLevel = 2;\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpktElement.styles, focusRing, targetSize, spaceAround, card, css`\n :host { display: block; container-type: inline-size; }\n .h { margin-block-end: ${space(5)}; }\n .grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: ${space(4)}; }\n .plan { position: relative; display: flex; flex-direction: column; gap: ${space(3)}; padding: ${space(6)}; }\n .plan.top { box-shadow: 0 0 0 2px ${t.brand}, ${t.shadowMd}; }\n .badge { position: absolute; inset-block-start: 0; inset-inline-start: 50%; transform: translate(-50%, -50%); padding: ${space(1)} ${space(3)}; border-radius: 999px; ${type('xs')} font-weight: ${fontWeight('bold')}; color: ${t.onBrand}; background: ${t.brand}; white-space: nowrap; }\n .name { margin: 0; ${type('lg')} font-weight: ${fontWeight('bold')}; color: ${t.text}; }\n .price { margin: 0; font-family: ${t.fontHeading}; ${type('3xl')} font-weight: ${fontWeight('bold')}; color: ${t.text}; }\n .period { ${type('sm')} font-weight: ${fontWeight('regular')}; color: ${t.textMuted}; }\n .note { margin: 0; ${type('sm')} color: ${t.textMuted}; }\n ul { flex: 1; margin: 0; padding: ${space(3)} 0 0; list-style: none; display: grid; gap: ${space(2)}; border-block-start: 1px solid ${t.rule}; align-content: start; }\n li { display: flex; gap: ${space(2)}; ${type('sm')} }\n li[data-has='false'] { color: ${t.textMuted}; }\n .mark { flex-shrink: 0; inline-size: 1.25em; font-weight: ${fontWeight('bold')}; text-align: center; }\n li[data-has='true'] .mark { color: ${t.successText}; }\n @container (max-width: 40rem) { .grid { grid-template-columns: minmax(0, 1fr); gap: ${space(6)}; } }\n `];\n\n private has(plan: PlanItem, row: PlanRow): boolean {\n return plan.includes.split(',').map((s) => s.trim().toLowerCase()).includes(row.label.trim().toLowerCase());\n }\n\n private choose(plan: PlanItem, event: Event): void {\n const go = this.dispatchEvent(new CustomEvent('impkt-select', { detail: { plan }, bubbles: true, composed: true, cancelable: true }));\n if (!go) event.preventDefault();\n }\n\n render(): TemplateResult {\n return html`\n ${this.heading ? html`<div class=\"h\" role=\"heading\" aria-level=${this.headingLevel}>${this.heading}</div>` : nothing}\n <div class=\"grid\" style=${`--cols: ${Math.max(1, this.plans.length)}`}>\n ${this.plans.map((p) => html`<section class=\"card plan ${p.badge ? 'top' : ''}\" aria-labelledby=${this.id_(`n-${p.id}`)}>\n ${p.badge ? html`<span class=\"badge\">${p.badge}</span>` : nothing}\n <h3 class=\"name\" id=${this.id_(`n-${p.id}`)}>${p.name}</h3>\n <p class=\"price\">${p.price}${p.period ? html` <span class=\"period\">${p.period}</span>` : nothing}</p>\n ${p.note ? html`<p class=\"note\">${p.note}</p>` : nothing}\n <ul>${this.rows.map((r) => { const has = this.has(p, r); return html`<li data-has=${String(has)}><span class=\"mark\" aria-hidden=\"true\">${has ? '✓' : '–'}</span><span>${r.label}<span class=\"visually-hidden\">: ${say(has ? 'included' : 'not included')}</span></span></li>`; })}</ul>\n ${p.href ? html`<a class=\"btn ${p.badge ? '' : 'quiet'}\" href=${p.href} @click=${(e: Event) => this.choose(p, e)}>${this.buttonText}<span class=\"visually-hidden\"> ${p.name}</span></a>`\n : html`<button class=\"btn ${p.badge ? '' : 'quiet'}\" type=\"button\" @click=${(e: Event) => this.choose(p, e)}>${this.buttonText}<span class=\"visually-hidden\"> ${p.name}</span></button>`}\n </section>`)}\n </div>`;\n }\n}\n\n/** A YouTube or Vimeo address as its privacy-friendly embed, or null for a plain video file. */\nexport function embedOf(src: string, locale?: string): string | null {\n const yt = /(?:youtube\\.com\\/(?:watch\\?v=|embed\\/|shorts\\/)|youtu\\.be\\/)([\\w-]{6,})/.exec(src);\n // The player's own controls and captions in the page's language (ADR 0026).\n const hl = locale && !/^en\\b/i.test(locale) ? `&hl=${encodeURIComponent(locale.split('-')[0]!)}&cc_lang_pref=${encodeURIComponent(locale.split('-')[0]!)}` : '';\n if (yt) return `https://www.youtube-nocookie.com/embed/${yt[1]}?autoplay=1&rel=0${hl}`;\n const vimeo = /vimeo\\.com\\/(?:video\\/)?(\\d+)/.exec(src);\n if (vimeo) return `https://player.vimeo.com/video/${vimeo[1]}?autoplay=1&dnt=1`;\n return null;\n}\n\n/**\n * A video, with its title, captions and a transcript link.\n *\n * A YouTube or Vimeo video shows its poster and a Play button first, and only\n * loads the player when pressed, so the page stays fast and nothing is sent to\n * the video site until someone chooses to watch. A video file plays in the\n * browser's own player, with captions from `captions-src`.\n *\n * @category media\n * @icon play\n */\nexport class ImpktVideo extends ImpktElement {\n static properties = {\n videoSrc: { type: String, attribute: 'video-src' },\n label: { type: String },\n posterSrc: { type: String, attribute: 'poster-src' },\n captionsSrc: { type: String, attribute: 'captions-src' },\n transcriptHref: { type: String, attribute: 'transcript-href' },\n playText: { type: String, attribute: 'play-text' },\n ratio: { type: String, reflect: true },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n /** A YouTube or Vimeo address, or a video file such as an .mp4. */\n declare videoSrc: string;\n /** What the video is, read out before it plays. */\n declare label: string;\n declare posterSrc: string;\n /** A captions file in WebVTT, for a video file. */\n declare captionsSrc: string;\n declare transcriptHref: string;\n declare playText: string;\n declare ratio: '16:9' | '4:3' | '1:1' | '9:16';\n declare playing: boolean;\n declare spaceAbove: Space;\n declare spaceBelow: Space;\n\n constructor() {\n super();\n this.videoSrc = '';\n this.label = 'Video';\n this.posterSrc = '';\n this.captionsSrc = '';\n this.transcriptHref = '';\n this.playText = 'Play video';\n this.ratio = '16:9';\n this.playing = false;\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpktElement.styles, focusRing, spaceAround, card, css`\n :host { display: block; }\n .frame { position: relative; overflow: hidden; aspect-ratio: 16 / 9; border-radius: ${t.radiusXl}; background: #111; }\n :host([ratio='4:3']) .frame { aspect-ratio: 4 / 3; }\n :host([ratio='1:1']) .frame { aspect-ratio: 1; }\n :host([ratio='9:16']) .frame { aspect-ratio: 9 / 16; max-inline-size: 420px; }\n iframe, video, img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; border: 0; object-fit: cover; }\n .play { position: absolute; inset: 0; display: grid; place-items: center; inline-size: 100%; padding: 0; color: #fff; background: linear-gradient(transparent 40%, rgb(0 0 0 / 0.55)); border: 0; cursor: pointer; }\n .disc { display: grid; place-items: center; inline-size: 72px; block-size: 72px; border-radius: 50%; background: ${t.brand}; box-shadow: ${t.shadowLg}; }\n .label { position: absolute; inset-inline-start: ${space(5)}; inset-block-end: ${space(4)}; ${type('lg')} font-weight: ${fontWeight('semibold')}; text-align: start; }\n .foot { margin: ${space(2)} 0 0; ${type('sm')} }\n .foot a { color: ${t.link}; }\n .empty { display: grid; place-items: center; block-size: 100%; color: #ccc; }\n `];\n\n render(): TemplateResult {\n const embed = embedOf(this.videoSrc, pageLocale(this));\n let player: TemplateResult;\n if (!this.videoSrc) player = html`<div class=\"empty\">${say('Add a video address')}</div>`;\n else if (embed && this.playing) player = html`<iframe src=${embed} title=${this.label} allow=\"autoplay; encrypted-media; picture-in-picture; fullscreen\" allowfullscreen></iframe>`;\n else if (embed) player = html`${this.posterSrc ? html`<img src=${this.posterSrc} alt=\"\" />` : nothing}\n <button class=\"play\" type=\"button\" @click=${() => { this.playing = true; }}>\n <span class=\"disc\" aria-hidden=\"true\"><svg width=\"28\" height=\"28\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M8 5v14l11-7z\"/></svg></span>\n <span class=\"label\">${this.playText}<span class=\"visually-hidden\">: ${this.label}</span></span>\n </button>`;\n else player = html`<video controls preload=\"metadata\" poster=${this.posterSrc || nothing} aria-label=${this.label}>\n <source src=${this.videoSrc} />\n ${this.captionsSrc ? html`<track kind=\"captions\" src=${this.captionsSrc} srclang=\"en\" label=\"English\" default />` : nothing}\n </video>`;\n return html`<div class=\"frame\" part=\"frame\">${player}</div>\n ${this.transcriptHref ? html`<p class=\"foot\"><a href=${this.transcriptHref}>${say('Read the transcript')}<span class=\"visually-hidden\">${say(' of {video}', { video: this.label })}</span></a></p>` : nothing}`;\n }\n}\n\nconst NOTICE_WORDS: Record<string, { heading: string; text: string }> = {\n mortgage: { heading: 'Your home may be repossessed', text: 'Your home may be repossessed if you do not keep up repayments on your mortgage.' },\n 'secured-loan': { heading: 'Think carefully before securing other debts against your home', text: 'Your home may be repossessed if you do not keep up repayments on a mortgage or any other debt secured on it.' },\n investment: { heading: 'Capital at risk', text: 'The value of investments can go down as well as up, and you may get back less than you put in.' },\n insurance: { heading: 'Important information', text: 'Read the policy documents to check the cover suits your needs. Limits and exclusions apply.' },\n custom: { heading: '', text: '' },\n};\n\n/**\n * The warning and the regulator wording a financial page must carry, as a\n * block of its own so it is never left off.\n *\n * Pick the kind to start from the usual words, or `custom` to write your own.\n * Whatever it says, check it with whoever signs off your financial promotions.\n *\n * @category feedback\n * @icon shield\n */\nexport class ImpktRegulatoryNotice extends ImpktElement {\n static properties = {\n kind: { type: String, reflect: true },\n heading: { type: String },\n text: { type: String },\n firm: { type: String },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare kind: 'mortgage' | 'secured-loan' | 'investment' | 'insurance' | 'custom';\n /** Leave empty to use the usual heading for the kind. */\n declare heading: string;\n /** Leave empty to use the usual warning for the kind. */\n declare text: string;\n /** Who you are and who regulates you, such as \"Acme Ltd is authorised and regulated by the Financial Conduct Authority (FRN 123456).\" */\n declare firm: string;\n declare spaceAbove: Space;\n declare spaceBelow: Space;\n\n constructor() {\n super();\n this.kind = 'mortgage';\n this.heading = '';\n this.text = '';\n this.firm = '';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpktElement.styles, spaceAround, css`\n :host { display: block; }\n .box { padding: ${space(5)}; border-inline-start: 6px solid ${t.warning}; border-radius: ${t.radiusLg}; background: ${t.warningSubtle}; }\n :host([kind='insurance']) .box { border-color: ${t.info}; background: ${t.infoSubtle}; }\n strong { display: block; margin-block-end: ${space(1)}; ${type('md')} color: ${t.text}; }\n p { margin: 0; color: ${t.text}; }\n .firm { margin-block-start: ${space(3)}; ${type('sm')} color: ${t.textMuted}; }\n `];\n\n render(): TemplateResult {\n const preset = NOTICE_WORDS[this.kind] ?? NOTICE_WORDS.custom!;\n const heading = this.heading || (preset.heading ? say(preset.heading) : '');\n const text = this.text || (preset.text ? say(preset.text) : '');\n return html`<aside class=\"box\" part=\"box\" aria-label=${heading || say('Important information')}>\n ${heading ? html`<strong>${heading}</strong>` : nothing}\n ${text ? html`<p>${text}</p>` : nothing}\n ${this.firm ? html`<p class=\"firm\">${this.firm}</p>` : nothing}\n </aside>`;\n }\n}\n\n/** One band of a tax: everything above `from` and up to the next band's `from` is charged at `rate`. */\ninterface Band { from: number; rate: number }\n\n/**\n * Stamp Duty Land Tax for England and Northern Ireland, from 1 April 2025.\n * Exported so the numbers can be checked, and changed in one place.\n */\nexport const SDLT = {\n standard: [{ from: 0, rate: 0 }, { from: 125000, rate: 2 }, { from: 250000, rate: 5 }, { from: 925000, rate: 10 }, { from: 1500000, rate: 12 }] as Band[],\n firstTime: [{ from: 0, rate: 0 }, { from: 300000, rate: 5 }] as Band[],\n firstTimeLimit: 500000,\n additionalSurcharge: 5,\n};\n\nfunction taxOn(price: number, bands: Band[], extra = 0): number {\n let tax = 0;\n bands.forEach((band, i) => {\n const top = bands[i + 1]?.from ?? Infinity;\n if (price > band.from) tax += ((Math.min(price, top) - band.from) * (band.rate + extra)) / 100;\n });\n return Math.round(tax);\n}\n\n/** The stamp duty on a home, for a mover, a first-time buyer or a second home. */\nexport function stampDuty(price: number, buyer: 'mover' | 'first-time' | 'additional'): number {\n if (price <= 0) return 0;\n if (buyer === 'first-time' && price <= SDLT.firstTimeLimit) return taxOn(price, SDLT.firstTime);\n if (buyer === 'additional') return price < 40000 ? 0 : taxOn(price, SDLT.standard, SDLT.additionalSurcharge);\n return taxOn(price, SDLT.standard);\n}\n\nconst calcStyles = css`\n :host { display: block; container-type: inline-size; }\n .wrap { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); overflow: hidden; }\n .inputs { display: flex; flex-direction: column; gap: ${space(5)}; padding: ${space(8)}; }\n label, legend { display: block; ${type('sm')} font-weight: ${fontWeight('semibold')}; margin-block-end: ${space(1.5)}; padding: 0; }\n fieldset { margin: 0; padding: 0; border: 0; }\n .choices { display: flex; flex-wrap: wrap; gap: ${space(2)}; }\n .choices label { display: inline-flex; align-items: center; gap: ${space(2)}; margin: 0; padding: ${space(2)} ${space(3)}; font-weight: ${fontWeight('regular')}; border: ${t.borderThin} solid ${t.border}; border-radius: ${t.radiusLg}; cursor: pointer; }\n .choices input { accent-color: ${t.brand}; }\n input[type='number'] { box-sizing: border-box; inline-size: 100%; min-block-size: 44px; padding: ${space(2)} ${space(3)}; font: inherit; color: ${t.text}; background: ${t.surfaceCard}; border: ${t.borderThin} solid ${t.border}; border-radius: ${t.radiusLg}; }\n .result { display: flex; flex-direction: column; justify-content: center; gap: ${space(2)}; padding: ${space(8)}; color: ${t.onBrand}; background: ${t.brand}; }\n .caption { margin: 0; ${type('sm')} opacity: 0.85; }\n output { display: block; font-family: ${t.fontHeading}; ${type('4xl')} font-weight: ${fontWeight('bold')}; }\n .line { margin: 0; ${type('sm')} }\n .foot { grid-column: 1 / -1; padding: ${space(4)} ${space(8)}; background: ${t.surfaceSubtle}; }\n @container (max-width: 44rem) { .wrap { grid-template-columns: minmax(0, 1fr); } .inputs, .result { padding: ${space(5)}; } .foot { padding: ${space(4)} ${space(5)}; } }\n`;\n\n/**\n * How much stamp duty a home would cost, for a home mover, a first-time buyer\n * or a second home, worked out as the price is typed.\n *\n * The rates are England and Northern Ireland's from 1 April 2025. Scotland and\n * Wales have their own taxes, and rates change, so the small print says which\n * rates these are and points to GOV.UK.\n *\n * @category form\n * @icon pound\n */\nexport class ImpktStampDutyCalculator extends ImpktElement {\n static properties = {\n heading: { type: String },\n price: { type: Number },\n buyer: { type: String },\n smallPrint: { type: String, attribute: 'small-print' },\n headingLevel: { type: Number, attribute: 'heading-level' },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare heading: string;\n declare price: number;\n declare buyer: 'mover' | 'first-time' | 'additional';\n declare smallPrint: string;\n declare headingLevel: 2 | 3;\n declare spaceAbove: Space;\n declare spaceBelow: Space;\n\n constructor() {\n super();\n this.heading = 'How much stamp duty would you pay?';\n this.price = 385000;\n this.buyer = 'first-time';\n this.smallPrint = 'Based on Stamp Duty Land Tax rates in England and Northern Ireland from 1 April 2025. Scotland and Wales have their own taxes. Check what you would pay on GOV.UK.';\n this.headingLevel = 2;\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpktElement.styles, focusRing, spaceAround, card, calcStyles];\n\n render(): TemplateResult {\n const duty = stampDuty(this.price, this.buyer);\n const rate = this.price > 0 ? (duty / this.price) * 100 : 0;\n const buyers: [typeof this.buyer, string][] = [['first-time', say('First home')], ['mover', say('Moving home')], ['additional', say('Second home')]];\n return html`<div class=\"card wrap\" part=\"wrap\">\n <div class=\"inputs\">\n ${this.heading ? html`<div class=\"h\" role=\"heading\" aria-level=${this.headingLevel}>${this.heading}</div>` : nothing}\n <div><label for=${this.id_('price')}>${say('Price of the home (£)')}</label>\n <input id=${this.id_('price')} type=\"number\" min=\"0\" step=\"1000\" inputmode=\"numeric\" .value=${String(this.price)} @input=${(e: Event) => { this.price = Number((e.target as HTMLInputElement).value) || 0; }} /></div>\n <fieldset><legend>${say('Are you buying')}</legend><div class=\"choices\">\n ${buyers.map(([value, label]) => html`<label><input type=\"radio\" name=${this.id_('buyer')} .checked=${this.buyer === value} @change=${() => { this.buyer = value; }} />${label}</label>`)}\n </div></fieldset>\n </div>\n <div class=\"result\" aria-live=\"polite\">\n <p class=\"caption\">${say('Stamp duty to pay')}</p>\n <output for=${this.id_('price')}>${money(duty)}</output>\n <p class=\"line\">${duty ? say('About {rate}% of the price', { rate: rate.toFixed(1) }) : say('Nothing to pay at this price')}</p>\n ${this.buyer === 'first-time' && this.price > SDLT.firstTimeLimit ? html`<p class=\"line\">${say('First-time buyer relief stops above {limit}, so the usual rates apply.', { limit: money(SDLT.firstTimeLimit) })}</p>` : nothing}\n </div>\n ${this.smallPrint ? html`<div class=\"foot\"><p class=\"small\">${this.smallPrint}</p></div>` : nothing}\n </div>`;\n }\n}\n\n/**\n * Roughly how much someone could borrow, from what they earn, and the price\n * of home that buys with their deposit.\n *\n * Lenders usually lend four to four and a half times income; the multiple is\n * a setting. It is a guide, not an offer, and the small print says so.\n *\n * @category form\n * @icon pound\n */\nexport class ImpktAffordabilityCalculator extends ImpktElement {\n static properties = {\n heading: { type: String },\n income: { type: Number },\n secondIncome: { type: Number, attribute: 'second-income' },\n deposit: { type: Number },\n timesIncome: { type: Number, attribute: 'times-income' },\n smallPrint: { type: String, attribute: 'small-print' },\n headingLevel: { type: Number, attribute: 'heading-level' },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare heading: string;\n declare income: number;\n declare secondIncome: number;\n declare deposit: number;\n /** How many times income a lender would lend, such as 4.5. */\n declare timesIncome: number;\n declare smallPrint: string;\n declare headingLevel: 2 | 3;\n declare spaceAbove: Space;\n declare spaceBelow: Space;\n\n constructor() {\n super();\n this.heading = 'How much could you borrow?';\n this.income = 45000;\n this.secondIncome = 0;\n this.deposit = 30000;\n this.timesIncome = 4.5;\n this.smallPrint = 'This is a guide, not a mortgage offer. What a lender offers depends on your circumstances. Your home may be repossessed if you do not keep up repayments on your mortgage.';\n this.headingLevel = 2;\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpktElement.styles, focusRing, spaceAround, card, calcStyles];\n\n private field(key: 'income' | 'secondIncome' | 'deposit'): (event: Event) => void {\n return (event) => { this[key] = Number((event.target as HTMLInputElement).value) || 0; };\n }\n\n render(): TemplateResult {\n const borrow = Math.max(0, (this.income + this.secondIncome) * this.timesIncome);\n const input = (key: 'income' | 'secondIncome' | 'deposit', label: string) => html`<div><label for=${this.id_(key)}>${label}</label>\n <input id=${this.id_(key)} type=\"number\" min=\"0\" step=\"1000\" inputmode=\"numeric\" .value=${String(this[key])} @input=${this.field(key)} /></div>`;\n return html`<div class=\"card wrap\" part=\"wrap\">\n <div class=\"inputs\">\n ${this.heading ? html`<div class=\"h\" role=\"heading\" aria-level=${this.headingLevel}>${this.heading}</div>` : nothing}\n ${input('income', say('Your yearly income before tax (£)'))}\n ${input('secondIncome', say('A second person’s income, if buying together (£)'))}\n ${input('deposit', say('Your deposit (£)'))}\n </div>\n <div class=\"result\" aria-live=\"polite\">\n <p class=\"caption\">${say('You could borrow about')}</p>\n <output>${money(borrow)}</output>\n <p class=\"line\">${say('With your deposit, that’s a home of about {amount}.', { amount: money(borrow + this.deposit) })}</p>\n </div>\n ${this.smallPrint ? html`<div class=\"foot\"><p class=\"small\">${this.smallPrint}</p></div>` : nothing}\n </div>`;\n }\n}\n\n/**\n * How to get in touch: a phone number, opening hours, an email address, and a\n * short form to ask for a call back.\n *\n * The form fires `impkt-submit` with the name, phone number and best time; the\n * app sends it on. Then the block thanks them in place.\n *\n * @category content\n * @icon phone\n */\nexport class ImpktContactBlock extends ImpktElement {\n static properties = {\n heading: { type: String },\n phone: { type: String },\n hours: { type: String },\n email: { type: String },\n callbackHeading: { type: String, attribute: 'callback-heading' },\n buttonText: { type: String, attribute: 'button-text' },\n doneText: { type: String, attribute: 'done-text' },\n headingLevel: { type: Number, attribute: 'heading-level' },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare heading: string;\n declare phone: string;\n /** One line a day or range, such as \"Monday to Friday, 9am to 6pm\". */\n declare hours: string;\n declare email: string;\n /** Leave empty to show no call back form. */\n declare callbackHeading: string;\n declare buttonText: string;\n declare doneText: string;\n declare headingLevel: 2 | 3;\n declare sent: boolean;\n declare spaceAbove: Space;\n declare spaceBelow: Space;\n\n constructor() {\n super();\n this.heading = 'Talk to us';\n this.phone = '0800 000 0000';\n this.hours = 'Monday to Friday, 9am to 6pm\\nSaturday, 10am to 2pm';\n this.email = '';\n this.callbackHeading = 'Or we can call you';\n this.buttonText = 'Ask for a call back';\n this.doneText = 'Thanks. We’ll call you at the time you chose.';\n this.headingLevel = 2;\n this.sent = false;\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpktElement.styles, focusRing, spaceAround, card, css`\n :host { display: block; container-type: inline-size; }\n .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: ${space(6)}; padding: ${space(8)}; }\n .phone { display: inline-block; margin: ${space(3)} 0; font-family: ${t.fontHeading}; ${type('3xl')} font-weight: ${fontWeight('bold')}; color: ${t.link}; text-decoration: none; }\n .hours { margin: 0; white-space: pre-line; color: ${t.textMuted}; }\n .email { display: inline-block; margin-block-start: ${space(3)}; color: ${t.link}; }\n form { display: grid; gap: ${space(3)}; padding: ${space(5)}; border-radius: ${t.radiusLg}; background: ${t.surfaceInset}; }\n .sub { margin: 0; ${type('lg')} font-weight: ${fontWeight('bold')}; color: ${t.text}; }\n label { display: block; ${type('sm')} font-weight: ${fontWeight('semibold')}; margin-block-end: ${space(1)}; }\n input, select { box-sizing: border-box; inline-size: 100%; min-block-size: 44px; padding: ${space(2)} ${space(3)}; font: inherit; color: ${t.text}; background: ${t.surfaceCard}; border: ${t.borderThin} solid ${t.border}; border-radius: ${t.radiusLg}; }\n .done { margin: 0; padding: ${space(5)}; border-radius: ${t.radiusLg}; background: ${t.successSubtle}; color: ${t.successText}; font-weight: ${fontWeight('semibold')}; }\n @container (max-width: 40rem) { .wrap { grid-template-columns: minmax(0, 1fr); padding: ${space(5)}; } }\n `];\n\n private submit(event: SubmitEvent): void {\n event.preventDefault();\n const form = new FormData(event.target as HTMLFormElement);\n const data = { name: String(form.get('name') ?? ''), phone: String(form.get('phone') ?? ''), when: String(form.get('when') ?? '') };\n this.dispatchEvent(new CustomEvent('impkt-submit', { detail: data, bubbles: true, composed: true }));\n this.sent = true;\n }\n\n render(): TemplateResult {\n return html`<div class=\"card wrap\" part=\"wrap\">\n <div>\n ${this.heading ? html`<div class=\"h\" role=\"heading\" aria-level=${this.headingLevel}>${this.heading}</div>` : nothing}\n ${this.phone ? html`<a class=\"phone\" href=${`tel:${this.phone.replace(/[^\\d+]/g, '')}`}>${this.phone}</a>` : nothing}\n ${this.hours ? html`<p class=\"hours\">${this.hours}</p>` : nothing}\n ${this.email ? html`<a class=\"email\" href=${`mailto:${this.email}`}>${this.email}</a>` : nothing}\n </div>\n ${!this.callbackHeading ? nothing : this.sent ? html`<p class=\"done\" role=\"status\">${this.doneText}</p>` : html`<form @submit=${this.submit} aria-labelledby=${this.id_('cb')}>\n <p class=\"sub\" id=${this.id_('cb')}>${this.callbackHeading}</p>\n <div><label for=${this.id_('name')}>${say('Your name')}</label><input id=${this.id_('name')} name=\"name\" autocomplete=\"name\" required /></div>\n <div><label for=${this.id_('tel')}>${say('Phone number')}</label><input id=${this.id_('tel')} name=\"phone\" type=\"tel\" autocomplete=\"tel\" required /></div>\n <div><label for=${this.id_('when')}>${say('Best time to call')}</label><select id=${this.id_('when')} name=\"when\"><option value=\"Morning\">${say('Morning')}</option><option value=\"Afternoon\">${say('Afternoon')}</option><option value=\"Evening\">${say('Evening')}</option></select></div>\n <button class=\"btn\" type=\"submit\">${this.buttonText}</button>\n </form>`}\n </div>`;\n }\n}\n\n// Working values, not settings: kept out of `properties` so the page designer does not offer them.\nImpktVideo.createProperty('playing', { state: true });\nImpktContactBlock.createProperty('sent', { state: true });\n\ncustomElements.define('impkt-plan-comparison', ImpktPlanComparison);\ncustomElements.define('impkt-video', ImpktVideo);\ncustomElements.define('impkt-regulatory-notice', ImpktRegulatoryNotice);\ncustomElements.define('impkt-stamp-duty-calculator', ImpktStampDutyCalculator);\ncustomElements.define('impkt-affordability-calculator', ImpktAffordabilityCalculator);\ncustomElements.define('impkt-contact-block', ImpktContactBlock);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impkt-plan-comparison': ImpktPlanComparison;\n 'impkt-video': ImpktVideo;\n 'impkt-regulatory-notice': ImpktRegulatoryNotice;\n 'impkt-stamp-duty-calculator': ImpktStampDutyCalculator;\n 'impkt-affordability-calculator': ImpktAffordabilityCalculator;\n 'impkt-contact-block': ImpktContactBlock;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,SAAS,KAAK,MAAM,eAAoC;AASxD,IAAM,OAAO;AAAA,wBACW,EAAE,WAAW,oBAAoB,EAAE,QAAQ,iBAAiB,EAAE,QAAQ,eAAe,EAAE,QAAQ;AAAA,iCACtF,EAAE,WAAW,KAAK,KAAK,KAAK,CAAC,iBAAiB,WAAW,MAAM,CAAC,YAAY,EAAE,WAAW;AAAA,8GACZ,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,CAAC,iCAAiC,WAAW,UAAU,CAAC,YAAY,EAAE,OAAO,wCAAwC,EAAE,KAAK,+BAA+B,EAAE,QAAQ;AAAA,6BAC3Q,EAAE,UAAU;AAAA,wBACjB,EAAE,IAAI,sDAAsD,EAAE,UAAU,IAAI,EAAE,MAAM;AAAA,wBACpF,KAAK,IAAI,CAAC,WAAW,EAAE,SAAS;AAAA,uBACjC,cAAc;AAAA;AAGrC,IAAM,QAAQ,CAAC,QAAgB,WAAW,OAAO,SAAS,MAAM;AAC9D,MAAI;AAAE,WAAO,IAAI,KAAK,aAAa,WAAW,GAAG,EAAE,OAAO,YAAY,UAAU,uBAAuB,QAAQ,uBAAuB,OAAO,CAAC,EAAE,OAAO,MAAM;AAAA,EAAG,QAAQ;AAAE,WAAO,OAAO,KAAK,MAAM,MAAM,CAAC;AAAA,EAAG;AAC/M;AAkCO,IAAM,sBAAN,cAAkC,aAAa;AAAA,EACpD;AAAA,SAAO,aAAa;AAAA,MAClB,SAAS,EAAE,MAAM,OA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