@arc-ui/community-components 12.0.0-beta.5 → 12.0.0-beta7

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.
Files changed (69) hide show
  1. package/dist/Accordion/Accordion.cjs.js +48 -0
  2. package/dist/Accordion/Accordion.esm.js +40 -0
  3. package/dist/Accordion/package.json +7 -0
  4. package/dist/Accordion/styles.css +1 -0
  5. package/dist/Author/Author.cjs.js +16 -0
  6. package/dist/Author/Author.esm.js +8 -0
  7. package/dist/Author/package.json +7 -0
  8. package/dist/Author/styles.css +1 -0
  9. package/dist/CopyLead/CopyLead.cjs.js +39 -46
  10. package/dist/CopyLead/CopyLead.esm.js +26 -33
  11. package/dist/CopyLead/styles.css +1 -0
  12. package/dist/FeaturePost/FeaturePost.cjs.js +2220 -26
  13. package/dist/FeaturePost/FeaturePost.esm.js +2213 -19
  14. package/dist/FeaturePost/styles.css +1 -0
  15. package/dist/Highlights/Highlights.cjs.js +64 -0
  16. package/dist/Highlights/Highlights.esm.js +56 -0
  17. package/dist/Highlights/package.json +7 -0
  18. package/dist/Highlights/styles.css +1 -0
  19. package/dist/PromoListing/PromoListing.cjs.js +66 -0
  20. package/dist/PromoListing/PromoListing.esm.js +58 -0
  21. package/dist/PromoListing/package.json +7 -0
  22. package/dist/PromoListing/styles.css +1 -0
  23. package/dist/Quote/Quote.cjs.js +33 -0
  24. package/dist/Quote/Quote.esm.js +25 -0
  25. package/dist/Quote/package.json +7 -0
  26. package/dist/Quote/styles.css +1 -0
  27. package/dist/_shared/cjs/Author-cd166353.js +30 -0
  28. package/dist/_shared/cjs/index-9947ac13.js +64 -0
  29. package/dist/_shared/cjs/index.es-875b2756.js +13 -0
  30. package/dist/_shared/cjs/index.es-a9e01247.js +129 -0
  31. package/dist/_shared/cjs/tslib.es6-ec509cfc.js +46 -0
  32. package/dist/_shared/esm/Author-9c7cb4f2.js +24 -0
  33. package/dist/_shared/esm/index-2e73c2e9.js +62 -0
  34. package/dist/_shared/esm/index.es-33860780.js +127 -0
  35. package/dist/_shared/esm/index.es-a1591fd3.js +9 -0
  36. package/dist/_shared/esm/tslib.es6-2bdcff75.js +44 -0
  37. package/dist/index.es.js +2528 -63
  38. package/dist/index.es.js.map +1 -1
  39. package/dist/index.js +2532 -62
  40. package/dist/index.js.map +1 -1
  41. package/dist/styles.css +1 -1
  42. package/dist/types/components/Accordion/Accordion.d.ts +10 -0
  43. package/dist/types/components/Accordion/components/AccordionDisclosureList/AccordionDisclosureList.d.ts +9 -0
  44. package/dist/types/components/Accordion/components/AccordionHeader/AccordionHeader.d.ts +20 -0
  45. package/dist/types/components/Accordion/index.d.ts +1 -0
  46. package/dist/types/components/Author/Author.d.ts +17 -0
  47. package/dist/types/components/Author/index.d.ts +1 -0
  48. package/dist/types/components/CopyLead/CopyLead.d.ts +8 -3
  49. package/dist/types/components/CopyLead/components/MediaContent/MediaContent.d.ts +2 -0
  50. package/dist/types/components/CopyLead/templates/Content/Content.d.ts +3 -1
  51. package/dist/types/components/CopyLead/templates/Media/Media.d.ts +4 -2
  52. package/dist/types/components/FeaturePost/FeaturePost.d.ts +27 -1
  53. package/dist/types/components/FeaturePost/types/feature-post-cta-footer.d.ts +2 -6
  54. package/dist/types/components/Highlights/Highlights.d.ts +30 -0
  55. package/dist/types/components/Highlights/components/HighlightHeader/HighlightHeader.d.ts +21 -0
  56. package/dist/types/components/Highlights/components/HighlightItem/HighlightItem.d.ts +14 -0
  57. package/dist/types/components/Highlights/components/HighlightList/HighlightList.d.ts +9 -0
  58. package/dist/types/components/Highlights/index.d.ts +1 -0
  59. package/dist/types/components/Highlights/types/highlight-list-item.d.ts +10 -0
  60. package/dist/types/components/Highlights/types/index.d.ts +1 -0
  61. package/dist/types/components/PromoListing/PromoListing.d.ts +38 -0
  62. package/dist/types/components/PromoListing/components/PromoListingHeader/PromoListingHeader.d.ts +17 -0
  63. package/dist/types/components/PromoListing/index.d.ts +1 -0
  64. package/dist/types/components/Quote/Quote.d.ts +11 -0
  65. package/dist/types/components/Quote/index.d.ts +1 -0
  66. package/dist/types/components/index.d.ts +5 -0
  67. package/package.json +20 -16
  68. package/dist/_shared/cjs/index-0524fde2.js +0 -119
  69. package/dist/_shared/esm/index-8c73b64b.js +0 -113
package/dist/index.es.js CHANGED
@@ -1,15 +1,22 @@
1
1
  import React, { useState, useEffect, Suspense } from 'react';
2
- import { Columns } from '@arc-ui/components/dist/Columns';
3
- import { useMediaQuery } from '@arc-ui/components/dist/use-media-query';
4
2
  import { Heading } from '@arc-ui/components/dist/Heading';
5
- import { Text } from '@arc-ui/components/dist/Text';
6
3
  import { VerticalSpace } from '@arc-ui/components/dist/VerticalSpace';
4
+ import { Disclosure } from '@arc-ui/components/dist/Disclosure';
5
+ import { Grid } from '@arc-ui/components/dist/Grid';
6
+ import { Avatar } from '@arc-ui/components/dist/Avatar';
7
+ import { Text } from '@arc-ui/components/dist/Text';
8
+ import { Columns } from '@arc-ui/components/dist/Columns';
9
+ import { useMediaQuery } from '@arc-ui/components/dist/use-media-query';
7
10
  import { Image as Image$2 } from '@arc-ui/components/dist/Image';
8
11
  import { Icon } from '@arc-ui/components/dist/Icon';
9
12
  import { ButtonV2 } from '@arc-ui/components/dist/ButtonV2';
10
13
  import { AppButton } from '@arc-ui/components/dist/AppButton';
11
- import { Grid } from '@arc-ui/components/dist/Grid';
12
- import { Avatar } from '@arc-ui/components/dist/Avatar';
14
+ import { Link } from '@arc-ui/components/dist/Link';
15
+ import { Carousel } from '@arc-ui/components/dist/Carousel';
16
+ import { MediaCard } from '@arc-ui/components/dist/MediaCard';
17
+ import { ImpactCard } from '@arc-ui/components/dist/ImpactCard';
18
+ import { InformationCard } from '@arc-ui/components/dist/InformationCard';
19
+ import { TypographyCard } from '@arc-ui/components/dist/TypographyCard';
13
20
 
14
21
  /******************************************************************************
15
22
  Copyright (c) Microsoft Corporation.
@@ -54,36 +61,205 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
54
61
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
55
62
  };
56
63
 
64
+ var dataAttrRe = /^(data-.*)$/;
65
+ var filterDataAttrs = function (props) {
66
+ var filteredProps = {};
67
+ for (var prop in props) {
68
+ if (Object.prototype.hasOwnProperty.call(props, prop) &&
69
+ dataAttrRe.test(prop)) {
70
+ filteredProps[prop] = props[prop];
71
+ }
72
+ }
73
+ return filteredProps;
74
+ };
75
+
76
+ var camelcase = {exports: {}};
77
+
78
+ const UPPERCASE = /[\p{Lu}]/u;
79
+ const LOWERCASE = /[\p{Ll}]/u;
80
+ const LEADING_CAPITAL = /^[\p{Lu}](?![\p{Lu}])/gu;
81
+ const IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u;
82
+ const SEPARATORS = /[_.\- ]+/;
83
+
84
+ const LEADING_SEPARATORS = new RegExp('^' + SEPARATORS.source);
85
+ const SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, 'gu');
86
+ const NUMBERS_AND_IDENTIFIER = new RegExp('\\d+' + IDENTIFIER.source, 'gu');
87
+
88
+ const preserveCamelCase = (string, toLowerCase, toUpperCase) => {
89
+ let isLastCharLower = false;
90
+ let isLastCharUpper = false;
91
+ let isLastLastCharUpper = false;
92
+
93
+ for (let i = 0; i < string.length; i++) {
94
+ const character = string[i];
95
+
96
+ if (isLastCharLower && UPPERCASE.test(character)) {
97
+ string = string.slice(0, i) + '-' + string.slice(i);
98
+ isLastCharLower = false;
99
+ isLastLastCharUpper = isLastCharUpper;
100
+ isLastCharUpper = true;
101
+ i++;
102
+ } else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character)) {
103
+ string = string.slice(0, i - 1) + '-' + string.slice(i - 1);
104
+ isLastLastCharUpper = isLastCharUpper;
105
+ isLastCharUpper = false;
106
+ isLastCharLower = true;
107
+ } else {
108
+ isLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character;
109
+ isLastLastCharUpper = isLastCharUpper;
110
+ isLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character;
111
+ }
112
+ }
113
+
114
+ return string;
115
+ };
116
+
117
+ const preserveConsecutiveUppercase = (input, toLowerCase) => {
118
+ LEADING_CAPITAL.lastIndex = 0;
119
+
120
+ return input.replace(LEADING_CAPITAL, m1 => toLowerCase(m1));
121
+ };
122
+
123
+ const postProcess = (input, toUpperCase) => {
124
+ SEPARATORS_AND_IDENTIFIER.lastIndex = 0;
125
+ NUMBERS_AND_IDENTIFIER.lastIndex = 0;
126
+
127
+ return input.replace(SEPARATORS_AND_IDENTIFIER, (_, identifier) => toUpperCase(identifier))
128
+ .replace(NUMBERS_AND_IDENTIFIER, m => toUpperCase(m));
129
+ };
130
+
131
+ const camelCase = (input, options) => {
132
+ if (!(typeof input === 'string' || Array.isArray(input))) {
133
+ throw new TypeError('Expected the input to be `string | string[]`');
134
+ }
135
+
136
+ options = {
137
+ pascalCase: false,
138
+ preserveConsecutiveUppercase: false,
139
+ ...options
140
+ };
141
+
142
+ if (Array.isArray(input)) {
143
+ input = input.map(x => x.trim())
144
+ .filter(x => x.length)
145
+ .join('-');
146
+ } else {
147
+ input = input.trim();
148
+ }
149
+
150
+ if (input.length === 0) {
151
+ return '';
152
+ }
153
+
154
+ const toLowerCase = options.locale === false ?
155
+ string => string.toLowerCase() :
156
+ string => string.toLocaleLowerCase(options.locale);
157
+ const toUpperCase = options.locale === false ?
158
+ string => string.toUpperCase() :
159
+ string => string.toLocaleUpperCase(options.locale);
160
+
161
+ if (input.length === 1) {
162
+ return options.pascalCase ? toUpperCase(input) : toLowerCase(input);
163
+ }
164
+
165
+ const hasUpperCase = input !== toLowerCase(input);
166
+
167
+ if (hasUpperCase) {
168
+ input = preserveCamelCase(input, toLowerCase, toUpperCase);
169
+ }
170
+
171
+ input = input.replace(LEADING_SEPARATORS, '');
172
+
173
+ if (options.preserveConsecutiveUppercase) {
174
+ input = preserveConsecutiveUppercase(input, toLowerCase);
175
+ } else {
176
+ input = toLowerCase(input);
177
+ }
178
+
179
+ if (options.pascalCase) {
180
+ input = toUpperCase(input.charAt(0)) + input.slice(1);
181
+ }
182
+
183
+ return postProcess(input, toUpperCase);
184
+ };
185
+
186
+ camelcase.exports = camelCase;
187
+ // TODO: Remove this for the next major release
188
+ camelcase.exports.default = camelCase;
189
+
190
+ var styles$6 = {"header":"Accordion-module_header__WaTdJ","headerContent":"Accordion-module_headerContent__pjddt"};
191
+
192
+ /**
193
+ * Use `Accordion` to give supporting information about a page or proposition. It can be used to call out key benefits in bullet points, or link to a supporting explanatory video. An optional CTA can be used to link to further information or trigger a sales or enquiry journey.
194
+ */
195
+ var AccordionHeader = function (_a) {
196
+ var heading = _a.heading, _b = _a.headingLevel, headingLevel = _b === void 0 ? "2" : _b, content = _a.content;
197
+ return (React.createElement("div", { "data-testid": "Accordion-header", className: styles$6.header },
198
+ React.createElement(Heading, { level: headingLevel, size: "xl" }, heading),
199
+ content && (React.createElement(React.Fragment, null,
200
+ React.createElement(VerticalSpace, { size: "24" }),
201
+ React.createElement("p", { className: styles$6.headerContent }, content)))));
202
+ };
203
+
204
+ var AccordionDisclosureList = function (_a) {
205
+ var disclosureList = _a.disclosureList;
206
+ return (React.createElement(React.Fragment, null, disclosureList.map(function (_a, index) {
207
+ var children = _a.children, summary = _a.summary, _b = _a.isOpen, isOpen = _b === void 0 ? false : _b, _c = _a.indentDetails, indentDetails = _c === void 0 ? false : _c, headingLevel = _a.headingLevel;
208
+ return (React.createElement(Disclosure, { key: index, summary: summary, isOpen: isOpen, indentDetails: indentDetails, headingLevel: headingLevel }, children));
209
+ })));
210
+ };
211
+
212
+ /**
213
+ * Use the `Accordion` component to package together a title, content and a number of disclosure components into one section (maximum 10).
214
+ */
215
+ var Accordion = function (_a) {
216
+ var heading = _a.heading, _b = _a.headingLevel, headingLevel = _b === void 0 ? "2" : _b, content = _a.content, disclosureList = _a.disclosureList, props = __rest(_a, ["heading", "headingLevel", "content", "disclosureList"]);
217
+ return (React.createElement("div", __assign({}, filterDataAttrs(props)),
218
+ React.createElement(AccordionHeader, { heading: heading, headingLevel: headingLevel, content: content }),
219
+ React.createElement(AccordionDisclosureList, { disclosureList: disclosureList })));
220
+ };
221
+
222
+ var styles$5 = {"authorContent":"Author-module_authorContent__TBY7b"};
223
+
224
+ var Author = function (_a) {
225
+ var name = _a.name, title = _a.title, avatar = _a.avatar, props = __rest(_a, ["name", "title", "avatar"]);
226
+ return (React.createElement("div", __assign({}, filterDataAttrs(props)),
227
+ React.createElement(Grid, { isFluid: true, isGutterless: true },
228
+ React.createElement(Grid.Row, { align: "center" },
229
+ React.createElement(Grid.Col, { xs: "auto" },
230
+ React.createElement(Avatar, __assign({ size: "m" }, avatar, { "data-testid": "authorAvatar" }))),
231
+ React.createElement(Grid.Col, null,
232
+ React.createElement("div", { className: styles$5.authorContent, "data-testid": "authorContent" },
233
+ React.createElement(Heading, { size: "xs" }, name),
234
+ React.createElement(Text, { size: "s" }, title)))))));
235
+ };
236
+
57
237
  /**
58
238
  * Do not edit directly
59
- * Generated on Thu, 29 Aug 2024 08:40:27 GMT
239
+ * Generated on Fri, 25 Oct 2024 08:31:41 GMT
60
240
  */
61
241
  var SemSizeBreakpointsM = "768px"; // Medium (MD) - 768px to 991px: This is commonly used for larger tablets and smaller desktop screens.
62
242
  var SemSizeBreakpointsL = "1024px"; // Large (LG) - 1024px - 1279px: This breakpoint is often applied to larger desktop screens and some laptops.
63
243
  var SemSizeBreakpointsXl = "1280px"; // Extra Large (XL) - 1280px and above: This breakpoint is used for very large desktop screens.
64
244
 
65
- var styles$7 = {"container":"MediaContent-module_container__zJvhV","content":"MediaContent-module_content__3VTWr"};
245
+ var styles$4 = {"buttonContainer":"CopyLead-module_buttonContainer__3OaRG","col":"CopyLead-module_col__0Da5H","container":"CopyLead-module_container__I91ym","container--content":"CopyLead-module_container--content__e8LxG","container--media":"CopyLead-module_container--media__QcMWi","container--align-center":"CopyLead-module_container--align-center__Fh1Sd","container--align-top":"CopyLead-module_container--align-top__UIXOZ","list":"CopyLead-module_list__arnJd","listItem":"CopyLead-module_listItem__NscHE","listItemCentered":"CopyLead-module_listItemCentered__Kwdab","listItemIconContainer":"CopyLead-module_listItemIconContainer__dgnhJ","listItemTextContainer":"CopyLead-module_listItemTextContainer__Dl9lw","imgWrapper":"CopyLead-module_imgWrapper__HYP3w","mediaContainer":"CopyLead-module_mediaContainer__PxTnm","content":"CopyLead-module_content__Bja1D","container--reverse":"CopyLead-module_container--reverse__Gq9u8"};
66
246
 
67
247
  var MediaContent = function (_a) {
68
- var heading = _a.heading, children = _a.children;
69
- return (React.createElement("div", { className: styles$7.container },
70
- React.createElement(Heading, { level: "2", size: "xl" }, heading),
71
- children && (React.createElement("div", { className: styles$7.content },
248
+ var heading = _a.heading, headingLevel = _a.headingLevel, children = _a.children;
249
+ return (React.createElement("div", { className: styles$4.mediaContainer },
250
+ React.createElement(Heading, { level: headingLevel, size: "xl" }, heading),
251
+ children && (React.createElement("div", { className: styles$4.content },
72
252
  React.createElement(VerticalSpace, { size: "24" }),
73
253
  React.createElement(Text, { size: "l" }, children)))));
74
254
  };
75
255
 
76
- var styles$6 = {"imgWrapper":"Image-module_imgWrapper__8IEXh"};
77
-
78
256
  var Image$1 = function (_a) {
79
257
  var sources = _a.sources, props = __rest(_a, ["sources"]);
80
- return (React.createElement("div", { className: styles$6.imgWrapper },
258
+ return (React.createElement("div", { className: styles$4.imgWrapper },
81
259
  React.createElement(Image$2, __assign({ fadeOnLoad: true }, props), sources &&
82
260
  sources.map(function (source) { return (React.createElement(Image$2.Source, __assign({ key: source.srcSet }, source))); }))));
83
261
  };
84
262
 
85
- var styles$5 = {"list":"IconList-module_list__J9ei6","listItem":"IconList-module_listItem__gNx5-","listItemCentered":"IconList-module_listItemCentered__0HGoP","listItemIconContainer":"IconList-module_listItemIconContainer__4SYoW","listItemTextContainer":"IconList-module_listItemTextContainer__PfFZS"};
86
-
87
263
  var classnames = {exports: {}};
88
264
 
89
265
  /*!
@@ -147,15 +323,15 @@ var classNames = classnames.exports;
147
323
 
148
324
  var IconList = function (_a) {
149
325
  var listItems = _a.listItems, isLgScreen = _a.isLgScreen;
150
- return (React.createElement("ul", { className: styles$5.list }, listItems.map(function (_a) {
326
+ return (React.createElement("ul", { className: styles$4.list }, listItems.map(function (_a) {
151
327
  var _b;
152
328
  var icon = _a.icon, heading = _a.heading, text = _a.text;
153
- return (React.createElement("li", { key: heading, className: classNames(styles$5.listItem, (_b = {},
154
- _b[styles$5.listItemCentered] = !text,
329
+ return (React.createElement("li", { key: heading, className: classNames(styles$4.listItem, (_b = {},
330
+ _b[styles$4.listItemCentered] = !text,
155
331
  _b)) },
156
- React.createElement("div", { className: styles$5.listItemIconContainer },
332
+ React.createElement("div", { className: styles$4.listItemIconContainer },
157
333
  React.createElement(Icon, { color: "brand", icon: icon, size: isLgScreen ? 64 : 48 })),
158
- React.createElement("div", { className: styles$5.listItemTextContainer },
334
+ React.createElement("div", { className: styles$4.listItemTextContainer },
159
335
  React.createElement(Heading, { level: "3", size: "s" }, heading),
160
336
  text && (React.createElement(React.Fragment, null,
161
337
  React.createElement(VerticalSpace, { size: "8", sizeL: "16" }),
@@ -163,26 +339,20 @@ var IconList = function (_a) {
163
339
  })));
164
340
  };
165
341
 
166
- var styles$4 = {"buttonContainer":"Button-module_buttonContainer__o8TSz"};
167
-
168
342
  var Button = function (props) { return (React.createElement("div", { className: styles$4.buttonContainer },
169
343
  React.createElement(ButtonV2, __assign({ isFullWidth: true, buttonStyle: "secondary" }, props)))); };
170
344
 
171
- var styles$3 = {"container":"Container-module_container__JZgGy","container--content":"Container-module_container--content__ScwIb","container--media":"Container-module_container--media__KIzMa","container--reverse":"Container-module_container--reverse__-B82g","container--align-center":"Container-module_container--align-center__qneG2","container--align-top":"Container-module_container--align-top__TE6Ah"};
172
-
173
345
  var Container = function (_a) {
174
346
  var _b;
175
347
  var children = _a.children, isReverseOrder = _a.isReverseOrder, type = _a.type, alignment = _a.alignment;
176
- return (React.createElement("div", { "data-testid": "copy-lead-container", className: classNames(styles$3.container, styles$3["container--".concat(type)], styles$3["container--align-".concat(alignment)], (_b = {},
177
- _b[styles$3["container--reverse"]] = isReverseOrder,
348
+ return (React.createElement("div", { "data-testid": "copy-lead-container", className: classNames(styles$4.container, styles$4["container--".concat(type)], styles$4["container--align-".concat(alignment)], (_b = {},
349
+ _b[styles$4["container--reverse"]] = isReverseOrder,
178
350
  _b)) }, children));
179
351
  };
180
352
 
181
- var styles$2 = {"col":"Column-module_col__9bKZy"};
182
-
183
353
  var Column = function (_a) {
184
354
  var children = _a.children;
185
- return (React.createElement("div", { className: styles$2.col }, children));
355
+ return (React.createElement("div", { className: styles$4.col }, children));
186
356
  };
187
357
 
188
358
  var VideoPlayer = React.lazy(function () {
@@ -194,7 +364,7 @@ var VideoPlayer = React.lazy(function () {
194
364
  });
195
365
  });
196
366
  var MediaTemplate = function (_a) {
197
- var button = _a.button, title = _a.title, listItems = _a.listItems, video = _a.video, image = _a.image, content = _a.content, _b = _a.isReverseOrder, isReverseOrder = _b === void 0 ? false : _b;
367
+ var button = _a.button, heading = _a.heading, headingLevel = _a.headingLevel, listItems = _a.listItems, video = _a.video, image = _a.image, content = _a.content, _b = _a.isReverseOrder, isReverseOrder = _b === void 0 ? false : _b;
198
368
  var _c = useState(false), isClient = _c[0], setIsClient = _c[1];
199
369
  var isMinWidthArcBreakpointL = useMediaQuery("(min-width: ".concat(SemSizeBreakpointsL, ")"));
200
370
  var isMinWidthArcBreakpointXl = useMediaQuery("(min-width: ".concat(SemSizeBreakpointsXl, ")"));
@@ -204,10 +374,10 @@ var MediaTemplate = function (_a) {
204
374
  return (React.createElement("div", null,
205
375
  !isMinWidthArcBreakpointXl && (React.createElement(Columns, null,
206
376
  React.createElement(Columns.Col, { span: 12, spanM: 9 },
207
- React.createElement(MediaContent, { heading: title }, content)))),
377
+ React.createElement(MediaContent, { heading: heading, headingLevel: headingLevel }, content)))),
208
378
  React.createElement(Container, { type: "media", isReverseOrder: isReverseOrder, alignment: !isMinWidthArcBreakpointXl ? "top" : "center" },
209
379
  React.createElement(Column, null,
210
- isMinWidthArcBreakpointXl && (React.createElement(MediaContent, { heading: title }, content)),
380
+ isMinWidthArcBreakpointXl && (React.createElement(MediaContent, { heading: heading }, content)),
211
381
  React.createElement(IconList, { listItems: listItems, isLgScreen: isMinWidthArcBreakpointL }),
212
382
  button && React.createElement(Button, __assign({}, button))),
213
383
  React.createElement(Column, null,
@@ -217,12 +387,12 @@ var MediaTemplate = function (_a) {
217
387
  };
218
388
 
219
389
  var ContentTemplate = function (_a) {
220
- var button = _a.button, title = _a.title, listItems = _a.listItems, content = _a.content;
390
+ var button = _a.button, heading = _a.heading, headingLevel = _a.headingLevel, listItems = _a.listItems, content = _a.content;
221
391
  var isMinWidthArcBreakpointM = useMediaQuery("(min-width: ".concat(SemSizeBreakpointsM, ")"));
222
392
  var isMinWidthArcBreakpointL = useMediaQuery("(min-width: ".concat(SemSizeBreakpointsL, ")"));
223
393
  return (React.createElement(Container, { type: "content", alignment: "top" },
224
394
  React.createElement(Column, null,
225
- React.createElement(Heading, { level: "2", size: "xl" }, title),
395
+ React.createElement(Heading, { level: headingLevel, size: "xl" }, heading),
226
396
  React.createElement(VerticalSpace, { size: "24" }),
227
397
  React.createElement(Text, { size: "l" }, content),
228
398
  button && isMinWidthArcBreakpointM && React.createElement(Button, __assign({}, button))),
@@ -235,45 +405,2242 @@ var ContentTemplate = function (_a) {
235
405
  * Use `CopyLead` to give supporting information about a page or proposition. It can be used to call out key benefits in bullet points, or link to a supporting explanatory video. An optional CTA can be used to link to further information or trigger a sales or enquiry journey.
236
406
  */
237
407
  var CopyLead = function (_a) {
238
- var button = _a.button, title = _a.title, listItems = _a.listItems, video = _a.video, image = _a.image, content = _a.content, _b = _a.isReverseOrder, isReverseOrder = _b === void 0 ? false : _b;
408
+ var button = _a.button, heading = _a.heading, _b = _a.headingLevel, headingLevel = _b === void 0 ? "2" : _b, listItems = _a.listItems, video = _a.video, image = _a.image, content = _a.content, _c = _a.isReverseOrder, isReverseOrder = _c === void 0 ? false : _c, props = __rest(_a, ["button", "heading", "headingLevel", "listItems", "video", "image", "content", "isReverseOrder"]);
239
409
  if (video || image) {
240
- return (React.createElement(MediaTemplate, { content: content, video: video, image: image, listItems: listItems, title: title, button: button, isReverseOrder: isReverseOrder }));
410
+ return (React.createElement(MediaTemplate, __assign({ content: content, video: video, image: image, listItems: listItems, heading: heading, headingLevel: headingLevel, button: button, isReverseOrder: isReverseOrder }, filterDataAttrs(props))));
241
411
  }
242
412
  if (content) {
243
- return (React.createElement(ContentTemplate, { listItems: listItems, title: title, button: button, content: content }));
413
+ return (React.createElement(ContentTemplate, { listItems: listItems, heading: heading, headingLevel: headingLevel, button: button, content: content }));
244
414
  }
245
415
  return null;
246
416
  };
247
417
 
248
- var styles$1 = {"imgWrapper":"Image-module_imgWrapper__flS1n"};
418
+ function _typeof(o) {
419
+ "@babel/helpers - typeof";
420
+
421
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
422
+ return typeof o;
423
+ } : function (o) {
424
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
425
+ }, _typeof(o);
426
+ }
427
+
428
+ function toInteger(dirtyNumber) {
429
+ if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
430
+ return NaN;
431
+ }
432
+ var number = Number(dirtyNumber);
433
+ if (isNaN(number)) {
434
+ return number;
435
+ }
436
+ return number < 0 ? Math.ceil(number) : Math.floor(number);
437
+ }
438
+
439
+ function requiredArgs(required, args) {
440
+ if (args.length < required) {
441
+ throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
442
+ }
443
+ }
444
+
445
+ /**
446
+ * @name toDate
447
+ * @category Common Helpers
448
+ * @summary Convert the given argument to an instance of Date.
449
+ *
450
+ * @description
451
+ * Convert the given argument to an instance of Date.
452
+ *
453
+ * If the argument is an instance of Date, the function returns its clone.
454
+ *
455
+ * If the argument is a number, it is treated as a timestamp.
456
+ *
457
+ * If the argument is none of the above, the function returns Invalid Date.
458
+ *
459
+ * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
460
+ *
461
+ * @param {Date|Number} argument - the value to convert
462
+ * @returns {Date} the parsed date in the local time zone
463
+ * @throws {TypeError} 1 argument required
464
+ *
465
+ * @example
466
+ * // Clone the date:
467
+ * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
468
+ * //=> Tue Feb 11 2014 11:30:30
469
+ *
470
+ * @example
471
+ * // Convert the timestamp to date:
472
+ * const result = toDate(1392098430000)
473
+ * //=> Tue Feb 11 2014 11:30:30
474
+ */
475
+ function toDate(argument) {
476
+ requiredArgs(1, arguments);
477
+ var argStr = Object.prototype.toString.call(argument);
478
+
479
+ // Clone the date
480
+ if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
481
+ // Prevent the date to lose the milliseconds when passed to new Date() in IE10
482
+ return new Date(argument.getTime());
483
+ } else if (typeof argument === 'number' || argStr === '[object Number]') {
484
+ return new Date(argument);
485
+ } else {
486
+ if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
487
+ // eslint-disable-next-line no-console
488
+ console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
489
+ // eslint-disable-next-line no-console
490
+ console.warn(new Error().stack);
491
+ }
492
+ return new Date(NaN);
493
+ }
494
+ }
495
+
496
+ /**
497
+ * @name addMilliseconds
498
+ * @category Millisecond Helpers
499
+ * @summary Add the specified number of milliseconds to the given date.
500
+ *
501
+ * @description
502
+ * Add the specified number of milliseconds to the given date.
503
+ *
504
+ * @param {Date|Number} date - the date to be changed
505
+ * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
506
+ * @returns {Date} the new date with the milliseconds added
507
+ * @throws {TypeError} 2 arguments required
508
+ *
509
+ * @example
510
+ * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
511
+ * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
512
+ * //=> Thu Jul 10 2014 12:45:30.750
513
+ */
514
+ function addMilliseconds(dirtyDate, dirtyAmount) {
515
+ requiredArgs(2, arguments);
516
+ var timestamp = toDate(dirtyDate).getTime();
517
+ var amount = toInteger(dirtyAmount);
518
+ return new Date(timestamp + amount);
519
+ }
520
+
521
+ var defaultOptions = {};
522
+ function getDefaultOptions() {
523
+ return defaultOptions;
524
+ }
525
+
526
+ /**
527
+ * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
528
+ * They usually appear for dates that denote time before the timezones were introduced
529
+ * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
530
+ * and GMT+01:00:00 after that date)
531
+ *
532
+ * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
533
+ * which would lead to incorrect calculations.
534
+ *
535
+ * This function returns the timezone offset in milliseconds that takes seconds in account.
536
+ */
537
+ function getTimezoneOffsetInMilliseconds(date) {
538
+ var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
539
+ utcDate.setUTCFullYear(date.getFullYear());
540
+ return date.getTime() - utcDate.getTime();
541
+ }
542
+
543
+ /**
544
+ * @name isDate
545
+ * @category Common Helpers
546
+ * @summary Is the given value a date?
547
+ *
548
+ * @description
549
+ * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
550
+ *
551
+ * @param {*} value - the value to check
552
+ * @returns {boolean} true if the given value is a date
553
+ * @throws {TypeError} 1 arguments required
554
+ *
555
+ * @example
556
+ * // For a valid date:
557
+ * const result = isDate(new Date())
558
+ * //=> true
559
+ *
560
+ * @example
561
+ * // For an invalid date:
562
+ * const result = isDate(new Date(NaN))
563
+ * //=> true
564
+ *
565
+ * @example
566
+ * // For some value:
567
+ * const result = isDate('2014-02-31')
568
+ * //=> false
569
+ *
570
+ * @example
571
+ * // For an object:
572
+ * const result = isDate({})
573
+ * //=> false
574
+ */
575
+ function isDate(value) {
576
+ requiredArgs(1, arguments);
577
+ return value instanceof Date || _typeof(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]';
578
+ }
579
+
580
+ /**
581
+ * @name isValid
582
+ * @category Common Helpers
583
+ * @summary Is the given date valid?
584
+ *
585
+ * @description
586
+ * Returns false if argument is Invalid Date and true otherwise.
587
+ * Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}
588
+ * Invalid Date is a Date, whose time value is NaN.
589
+ *
590
+ * Time value of Date: http://es5.github.io/#x15.9.1.1
591
+ *
592
+ * @param {*} date - the date to check
593
+ * @returns {Boolean} the date is valid
594
+ * @throws {TypeError} 1 argument required
595
+ *
596
+ * @example
597
+ * // For the valid date:
598
+ * const result = isValid(new Date(2014, 1, 31))
599
+ * //=> true
600
+ *
601
+ * @example
602
+ * // For the value, convertable into a date:
603
+ * const result = isValid(1393804800000)
604
+ * //=> true
605
+ *
606
+ * @example
607
+ * // For the invalid date:
608
+ * const result = isValid(new Date(''))
609
+ * //=> false
610
+ */
611
+ function isValid(dirtyDate) {
612
+ requiredArgs(1, arguments);
613
+ if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
614
+ return false;
615
+ }
616
+ var date = toDate(dirtyDate);
617
+ return !isNaN(Number(date));
618
+ }
619
+
620
+ /**
621
+ * @name subMilliseconds
622
+ * @category Millisecond Helpers
623
+ * @summary Subtract the specified number of milliseconds from the given date.
624
+ *
625
+ * @description
626
+ * Subtract the specified number of milliseconds from the given date.
627
+ *
628
+ * @param {Date|Number} date - the date to be changed
629
+ * @param {Number} amount - the amount of milliseconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
630
+ * @returns {Date} the new date with the milliseconds subtracted
631
+ * @throws {TypeError} 2 arguments required
632
+ *
633
+ * @example
634
+ * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
635
+ * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
636
+ * //=> Thu Jul 10 2014 12:45:29.250
637
+ */
638
+ function subMilliseconds(dirtyDate, dirtyAmount) {
639
+ requiredArgs(2, arguments);
640
+ var amount = toInteger(dirtyAmount);
641
+ return addMilliseconds(dirtyDate, -amount);
642
+ }
643
+
644
+ var MILLISECONDS_IN_DAY = 86400000;
645
+ function getUTCDayOfYear(dirtyDate) {
646
+ requiredArgs(1, arguments);
647
+ var date = toDate(dirtyDate);
648
+ var timestamp = date.getTime();
649
+ date.setUTCMonth(0, 1);
650
+ date.setUTCHours(0, 0, 0, 0);
651
+ var startOfYearTimestamp = date.getTime();
652
+ var difference = timestamp - startOfYearTimestamp;
653
+ return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
654
+ }
655
+
656
+ function startOfUTCISOWeek(dirtyDate) {
657
+ requiredArgs(1, arguments);
658
+ var weekStartsOn = 1;
659
+ var date = toDate(dirtyDate);
660
+ var day = date.getUTCDay();
661
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
662
+ date.setUTCDate(date.getUTCDate() - diff);
663
+ date.setUTCHours(0, 0, 0, 0);
664
+ return date;
665
+ }
666
+
667
+ function getUTCISOWeekYear(dirtyDate) {
668
+ requiredArgs(1, arguments);
669
+ var date = toDate(dirtyDate);
670
+ var year = date.getUTCFullYear();
671
+ var fourthOfJanuaryOfNextYear = new Date(0);
672
+ fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
673
+ fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
674
+ var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
675
+ var fourthOfJanuaryOfThisYear = new Date(0);
676
+ fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
677
+ fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
678
+ var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
679
+ if (date.getTime() >= startOfNextYear.getTime()) {
680
+ return year + 1;
681
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
682
+ return year;
683
+ } else {
684
+ return year - 1;
685
+ }
686
+ }
687
+
688
+ function startOfUTCISOWeekYear(dirtyDate) {
689
+ requiredArgs(1, arguments);
690
+ var year = getUTCISOWeekYear(dirtyDate);
691
+ var fourthOfJanuary = new Date(0);
692
+ fourthOfJanuary.setUTCFullYear(year, 0, 4);
693
+ fourthOfJanuary.setUTCHours(0, 0, 0, 0);
694
+ var date = startOfUTCISOWeek(fourthOfJanuary);
695
+ return date;
696
+ }
697
+
698
+ var MILLISECONDS_IN_WEEK$1 = 604800000;
699
+ function getUTCISOWeek(dirtyDate) {
700
+ requiredArgs(1, arguments);
701
+ var date = toDate(dirtyDate);
702
+ var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime();
703
+
704
+ // Round the number of days to the nearest integer
705
+ // because the number of milliseconds in a week is not constant
706
+ // (e.g. it's different in the week of the daylight saving time clock shift)
707
+ return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
708
+ }
709
+
710
+ function startOfUTCWeek(dirtyDate, options) {
711
+ var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
712
+ requiredArgs(1, arguments);
713
+ var defaultOptions = getDefaultOptions();
714
+ var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);
715
+
716
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
717
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
718
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
719
+ }
720
+ var date = toDate(dirtyDate);
721
+ var day = date.getUTCDay();
722
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
723
+ date.setUTCDate(date.getUTCDate() - diff);
724
+ date.setUTCHours(0, 0, 0, 0);
725
+ return date;
726
+ }
727
+
728
+ function getUTCWeekYear(dirtyDate, options) {
729
+ var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
730
+ requiredArgs(1, arguments);
731
+ var date = toDate(dirtyDate);
732
+ var year = date.getUTCFullYear();
733
+ var defaultOptions = getDefaultOptions();
734
+ var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
735
+
736
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
737
+ if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
738
+ throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
739
+ }
740
+ var firstWeekOfNextYear = new Date(0);
741
+ firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
742
+ firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
743
+ var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, options);
744
+ var firstWeekOfThisYear = new Date(0);
745
+ firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
746
+ firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
747
+ var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options);
748
+ if (date.getTime() >= startOfNextYear.getTime()) {
749
+ return year + 1;
750
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
751
+ return year;
752
+ } else {
753
+ return year - 1;
754
+ }
755
+ }
756
+
757
+ function startOfUTCWeekYear(dirtyDate, options) {
758
+ var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
759
+ requiredArgs(1, arguments);
760
+ var defaultOptions = getDefaultOptions();
761
+ var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
762
+ var year = getUTCWeekYear(dirtyDate, options);
763
+ var firstWeek = new Date(0);
764
+ firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
765
+ firstWeek.setUTCHours(0, 0, 0, 0);
766
+ var date = startOfUTCWeek(firstWeek, options);
767
+ return date;
768
+ }
769
+
770
+ var MILLISECONDS_IN_WEEK = 604800000;
771
+ function getUTCWeek(dirtyDate, options) {
772
+ requiredArgs(1, arguments);
773
+ var date = toDate(dirtyDate);
774
+ var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime();
775
+
776
+ // Round the number of days to the nearest integer
777
+ // because the number of milliseconds in a week is not constant
778
+ // (e.g. it's different in the week of the daylight saving time clock shift)
779
+ return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
780
+ }
781
+
782
+ function addLeadingZeros(number, targetLength) {
783
+ var sign = number < 0 ? '-' : '';
784
+ var output = Math.abs(number).toString();
785
+ while (output.length < targetLength) {
786
+ output = '0' + output;
787
+ }
788
+ return sign + output;
789
+ }
790
+
791
+ /*
792
+ * | | Unit | | Unit |
793
+ * |-----|--------------------------------|-----|--------------------------------|
794
+ * | a | AM, PM | A* | |
795
+ * | d | Day of month | D | |
796
+ * | h | Hour [1-12] | H | Hour [0-23] |
797
+ * | m | Minute | M | Month |
798
+ * | s | Second | S | Fraction of second |
799
+ * | y | Year (abs) | Y | |
800
+ *
801
+ * Letters marked by * are not implemented but reserved by Unicode standard.
802
+ */
803
+ var formatters$2 = {
804
+ // Year
805
+ y: function y(date, token) {
806
+ // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
807
+ // | Year | y | yy | yyy | yyyy | yyyyy |
808
+ // |----------|-------|----|-------|-------|-------|
809
+ // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
810
+ // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
811
+ // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
812
+ // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
813
+ // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
814
+
815
+ var signedYear = date.getUTCFullYear();
816
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
817
+ var year = signedYear > 0 ? signedYear : 1 - signedYear;
818
+ return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
819
+ },
820
+ // Month
821
+ M: function M(date, token) {
822
+ var month = date.getUTCMonth();
823
+ return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
824
+ },
825
+ // Day of the month
826
+ d: function d(date, token) {
827
+ return addLeadingZeros(date.getUTCDate(), token.length);
828
+ },
829
+ // AM or PM
830
+ a: function a(date, token) {
831
+ var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
832
+ switch (token) {
833
+ case 'a':
834
+ case 'aa':
835
+ return dayPeriodEnumValue.toUpperCase();
836
+ case 'aaa':
837
+ return dayPeriodEnumValue;
838
+ case 'aaaaa':
839
+ return dayPeriodEnumValue[0];
840
+ case 'aaaa':
841
+ default:
842
+ return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
843
+ }
844
+ },
845
+ // Hour [1-12]
846
+ h: function h(date, token) {
847
+ return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
848
+ },
849
+ // Hour [0-23]
850
+ H: function H(date, token) {
851
+ return addLeadingZeros(date.getUTCHours(), token.length);
852
+ },
853
+ // Minute
854
+ m: function m(date, token) {
855
+ return addLeadingZeros(date.getUTCMinutes(), token.length);
856
+ },
857
+ // Second
858
+ s: function s(date, token) {
859
+ return addLeadingZeros(date.getUTCSeconds(), token.length);
860
+ },
861
+ // Fraction of second
862
+ S: function S(date, token) {
863
+ var numberOfDigits = token.length;
864
+ var milliseconds = date.getUTCMilliseconds();
865
+ var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
866
+ return addLeadingZeros(fractionalSeconds, token.length);
867
+ }
868
+ };
869
+ var formatters$3 = formatters$2;
870
+
871
+ var dayPeriodEnum = {
872
+ am: 'am',
873
+ pm: 'pm',
874
+ midnight: 'midnight',
875
+ noon: 'noon',
876
+ morning: 'morning',
877
+ afternoon: 'afternoon',
878
+ evening: 'evening',
879
+ night: 'night'
880
+ };
881
+ /*
882
+ * | | Unit | | Unit |
883
+ * |-----|--------------------------------|-----|--------------------------------|
884
+ * | a | AM, PM | A* | Milliseconds in day |
885
+ * | b | AM, PM, noon, midnight | B | Flexible day period |
886
+ * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
887
+ * | d | Day of month | D | Day of year |
888
+ * | e | Local day of week | E | Day of week |
889
+ * | f | | F* | Day of week in month |
890
+ * | g* | Modified Julian day | G | Era |
891
+ * | h | Hour [1-12] | H | Hour [0-23] |
892
+ * | i! | ISO day of week | I! | ISO week of year |
893
+ * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
894
+ * | k | Hour [1-24] | K | Hour [0-11] |
895
+ * | l* | (deprecated) | L | Stand-alone month |
896
+ * | m | Minute | M | Month |
897
+ * | n | | N | |
898
+ * | o! | Ordinal number modifier | O | Timezone (GMT) |
899
+ * | p! | Long localized time | P! | Long localized date |
900
+ * | q | Stand-alone quarter | Q | Quarter |
901
+ * | r* | Related Gregorian year | R! | ISO week-numbering year |
902
+ * | s | Second | S | Fraction of second |
903
+ * | t! | Seconds timestamp | T! | Milliseconds timestamp |
904
+ * | u | Extended year | U* | Cyclic year |
905
+ * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
906
+ * | w | Local week of year | W* | Week of month |
907
+ * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
908
+ * | y | Year (abs) | Y | Local week-numbering year |
909
+ * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
910
+ *
911
+ * Letters marked by * are not implemented but reserved by Unicode standard.
912
+ *
913
+ * Letters marked by ! are non-standard, but implemented by date-fns:
914
+ * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
915
+ * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
916
+ * i.e. 7 for Sunday, 1 for Monday, etc.
917
+ * - `I` is ISO week of year, as opposed to `w` which is local week of year.
918
+ * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
919
+ * `R` is supposed to be used in conjunction with `I` and `i`
920
+ * for universal ISO week-numbering date, whereas
921
+ * `Y` is supposed to be used in conjunction with `w` and `e`
922
+ * for week-numbering date specific to the locale.
923
+ * - `P` is long localized date format
924
+ * - `p` is long localized time format
925
+ */
926
+
927
+ var formatters = {
928
+ // Era
929
+ G: function G(date, token, localize) {
930
+ var era = date.getUTCFullYear() > 0 ? 1 : 0;
931
+ switch (token) {
932
+ // AD, BC
933
+ case 'G':
934
+ case 'GG':
935
+ case 'GGG':
936
+ return localize.era(era, {
937
+ width: 'abbreviated'
938
+ });
939
+ // A, B
940
+ case 'GGGGG':
941
+ return localize.era(era, {
942
+ width: 'narrow'
943
+ });
944
+ // Anno Domini, Before Christ
945
+ case 'GGGG':
946
+ default:
947
+ return localize.era(era, {
948
+ width: 'wide'
949
+ });
950
+ }
951
+ },
952
+ // Year
953
+ y: function y(date, token, localize) {
954
+ // Ordinal number
955
+ if (token === 'yo') {
956
+ var signedYear = date.getUTCFullYear();
957
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
958
+ var year = signedYear > 0 ? signedYear : 1 - signedYear;
959
+ return localize.ordinalNumber(year, {
960
+ unit: 'year'
961
+ });
962
+ }
963
+ return formatters$3.y(date, token);
964
+ },
965
+ // Local week-numbering year
966
+ Y: function Y(date, token, localize, options) {
967
+ var signedWeekYear = getUTCWeekYear(date, options);
968
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
969
+ var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
970
+
971
+ // Two digit year
972
+ if (token === 'YY') {
973
+ var twoDigitYear = weekYear % 100;
974
+ return addLeadingZeros(twoDigitYear, 2);
975
+ }
976
+
977
+ // Ordinal number
978
+ if (token === 'Yo') {
979
+ return localize.ordinalNumber(weekYear, {
980
+ unit: 'year'
981
+ });
982
+ }
983
+
984
+ // Padding
985
+ return addLeadingZeros(weekYear, token.length);
986
+ },
987
+ // ISO week-numbering year
988
+ R: function R(date, token) {
989
+ var isoWeekYear = getUTCISOWeekYear(date);
990
+
991
+ // Padding
992
+ return addLeadingZeros(isoWeekYear, token.length);
993
+ },
994
+ // Extended year. This is a single number designating the year of this calendar system.
995
+ // The main difference between `y` and `u` localizers are B.C. years:
996
+ // | Year | `y` | `u` |
997
+ // |------|-----|-----|
998
+ // | AC 1 | 1 | 1 |
999
+ // | BC 1 | 1 | 0 |
1000
+ // | BC 2 | 2 | -1 |
1001
+ // Also `yy` always returns the last two digits of a year,
1002
+ // while `uu` pads single digit years to 2 characters and returns other years unchanged.
1003
+ u: function u(date, token) {
1004
+ var year = date.getUTCFullYear();
1005
+ return addLeadingZeros(year, token.length);
1006
+ },
1007
+ // Quarter
1008
+ Q: function Q(date, token, localize) {
1009
+ var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
1010
+ switch (token) {
1011
+ // 1, 2, 3, 4
1012
+ case 'Q':
1013
+ return String(quarter);
1014
+ // 01, 02, 03, 04
1015
+ case 'QQ':
1016
+ return addLeadingZeros(quarter, 2);
1017
+ // 1st, 2nd, 3rd, 4th
1018
+ case 'Qo':
1019
+ return localize.ordinalNumber(quarter, {
1020
+ unit: 'quarter'
1021
+ });
1022
+ // Q1, Q2, Q3, Q4
1023
+ case 'QQQ':
1024
+ return localize.quarter(quarter, {
1025
+ width: 'abbreviated',
1026
+ context: 'formatting'
1027
+ });
1028
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
1029
+ case 'QQQQQ':
1030
+ return localize.quarter(quarter, {
1031
+ width: 'narrow',
1032
+ context: 'formatting'
1033
+ });
1034
+ // 1st quarter, 2nd quarter, ...
1035
+ case 'QQQQ':
1036
+ default:
1037
+ return localize.quarter(quarter, {
1038
+ width: 'wide',
1039
+ context: 'formatting'
1040
+ });
1041
+ }
1042
+ },
1043
+ // Stand-alone quarter
1044
+ q: function q(date, token, localize) {
1045
+ var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
1046
+ switch (token) {
1047
+ // 1, 2, 3, 4
1048
+ case 'q':
1049
+ return String(quarter);
1050
+ // 01, 02, 03, 04
1051
+ case 'qq':
1052
+ return addLeadingZeros(quarter, 2);
1053
+ // 1st, 2nd, 3rd, 4th
1054
+ case 'qo':
1055
+ return localize.ordinalNumber(quarter, {
1056
+ unit: 'quarter'
1057
+ });
1058
+ // Q1, Q2, Q3, Q4
1059
+ case 'qqq':
1060
+ return localize.quarter(quarter, {
1061
+ width: 'abbreviated',
1062
+ context: 'standalone'
1063
+ });
1064
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
1065
+ case 'qqqqq':
1066
+ return localize.quarter(quarter, {
1067
+ width: 'narrow',
1068
+ context: 'standalone'
1069
+ });
1070
+ // 1st quarter, 2nd quarter, ...
1071
+ case 'qqqq':
1072
+ default:
1073
+ return localize.quarter(quarter, {
1074
+ width: 'wide',
1075
+ context: 'standalone'
1076
+ });
1077
+ }
1078
+ },
1079
+ // Month
1080
+ M: function M(date, token, localize) {
1081
+ var month = date.getUTCMonth();
1082
+ switch (token) {
1083
+ case 'M':
1084
+ case 'MM':
1085
+ return formatters$3.M(date, token);
1086
+ // 1st, 2nd, ..., 12th
1087
+ case 'Mo':
1088
+ return localize.ordinalNumber(month + 1, {
1089
+ unit: 'month'
1090
+ });
1091
+ // Jan, Feb, ..., Dec
1092
+ case 'MMM':
1093
+ return localize.month(month, {
1094
+ width: 'abbreviated',
1095
+ context: 'formatting'
1096
+ });
1097
+ // J, F, ..., D
1098
+ case 'MMMMM':
1099
+ return localize.month(month, {
1100
+ width: 'narrow',
1101
+ context: 'formatting'
1102
+ });
1103
+ // January, February, ..., December
1104
+ case 'MMMM':
1105
+ default:
1106
+ return localize.month(month, {
1107
+ width: 'wide',
1108
+ context: 'formatting'
1109
+ });
1110
+ }
1111
+ },
1112
+ // Stand-alone month
1113
+ L: function L(date, token, localize) {
1114
+ var month = date.getUTCMonth();
1115
+ switch (token) {
1116
+ // 1, 2, ..., 12
1117
+ case 'L':
1118
+ return String(month + 1);
1119
+ // 01, 02, ..., 12
1120
+ case 'LL':
1121
+ return addLeadingZeros(month + 1, 2);
1122
+ // 1st, 2nd, ..., 12th
1123
+ case 'Lo':
1124
+ return localize.ordinalNumber(month + 1, {
1125
+ unit: 'month'
1126
+ });
1127
+ // Jan, Feb, ..., Dec
1128
+ case 'LLL':
1129
+ return localize.month(month, {
1130
+ width: 'abbreviated',
1131
+ context: 'standalone'
1132
+ });
1133
+ // J, F, ..., D
1134
+ case 'LLLLL':
1135
+ return localize.month(month, {
1136
+ width: 'narrow',
1137
+ context: 'standalone'
1138
+ });
1139
+ // January, February, ..., December
1140
+ case 'LLLL':
1141
+ default:
1142
+ return localize.month(month, {
1143
+ width: 'wide',
1144
+ context: 'standalone'
1145
+ });
1146
+ }
1147
+ },
1148
+ // Local week of year
1149
+ w: function w(date, token, localize, options) {
1150
+ var week = getUTCWeek(date, options);
1151
+ if (token === 'wo') {
1152
+ return localize.ordinalNumber(week, {
1153
+ unit: 'week'
1154
+ });
1155
+ }
1156
+ return addLeadingZeros(week, token.length);
1157
+ },
1158
+ // ISO week of year
1159
+ I: function I(date, token, localize) {
1160
+ var isoWeek = getUTCISOWeek(date);
1161
+ if (token === 'Io') {
1162
+ return localize.ordinalNumber(isoWeek, {
1163
+ unit: 'week'
1164
+ });
1165
+ }
1166
+ return addLeadingZeros(isoWeek, token.length);
1167
+ },
1168
+ // Day of the month
1169
+ d: function d(date, token, localize) {
1170
+ if (token === 'do') {
1171
+ return localize.ordinalNumber(date.getUTCDate(), {
1172
+ unit: 'date'
1173
+ });
1174
+ }
1175
+ return formatters$3.d(date, token);
1176
+ },
1177
+ // Day of year
1178
+ D: function D(date, token, localize) {
1179
+ var dayOfYear = getUTCDayOfYear(date);
1180
+ if (token === 'Do') {
1181
+ return localize.ordinalNumber(dayOfYear, {
1182
+ unit: 'dayOfYear'
1183
+ });
1184
+ }
1185
+ return addLeadingZeros(dayOfYear, token.length);
1186
+ },
1187
+ // Day of week
1188
+ E: function E(date, token, localize) {
1189
+ var dayOfWeek = date.getUTCDay();
1190
+ switch (token) {
1191
+ // Tue
1192
+ case 'E':
1193
+ case 'EE':
1194
+ case 'EEE':
1195
+ return localize.day(dayOfWeek, {
1196
+ width: 'abbreviated',
1197
+ context: 'formatting'
1198
+ });
1199
+ // T
1200
+ case 'EEEEE':
1201
+ return localize.day(dayOfWeek, {
1202
+ width: 'narrow',
1203
+ context: 'formatting'
1204
+ });
1205
+ // Tu
1206
+ case 'EEEEEE':
1207
+ return localize.day(dayOfWeek, {
1208
+ width: 'short',
1209
+ context: 'formatting'
1210
+ });
1211
+ // Tuesday
1212
+ case 'EEEE':
1213
+ default:
1214
+ return localize.day(dayOfWeek, {
1215
+ width: 'wide',
1216
+ context: 'formatting'
1217
+ });
1218
+ }
1219
+ },
1220
+ // Local day of week
1221
+ e: function e(date, token, localize, options) {
1222
+ var dayOfWeek = date.getUTCDay();
1223
+ var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
1224
+ switch (token) {
1225
+ // Numerical value (Nth day of week with current locale or weekStartsOn)
1226
+ case 'e':
1227
+ return String(localDayOfWeek);
1228
+ // Padded numerical value
1229
+ case 'ee':
1230
+ return addLeadingZeros(localDayOfWeek, 2);
1231
+ // 1st, 2nd, ..., 7th
1232
+ case 'eo':
1233
+ return localize.ordinalNumber(localDayOfWeek, {
1234
+ unit: 'day'
1235
+ });
1236
+ case 'eee':
1237
+ return localize.day(dayOfWeek, {
1238
+ width: 'abbreviated',
1239
+ context: 'formatting'
1240
+ });
1241
+ // T
1242
+ case 'eeeee':
1243
+ return localize.day(dayOfWeek, {
1244
+ width: 'narrow',
1245
+ context: 'formatting'
1246
+ });
1247
+ // Tu
1248
+ case 'eeeeee':
1249
+ return localize.day(dayOfWeek, {
1250
+ width: 'short',
1251
+ context: 'formatting'
1252
+ });
1253
+ // Tuesday
1254
+ case 'eeee':
1255
+ default:
1256
+ return localize.day(dayOfWeek, {
1257
+ width: 'wide',
1258
+ context: 'formatting'
1259
+ });
1260
+ }
1261
+ },
1262
+ // Stand-alone local day of week
1263
+ c: function c(date, token, localize, options) {
1264
+ var dayOfWeek = date.getUTCDay();
1265
+ var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
1266
+ switch (token) {
1267
+ // Numerical value (same as in `e`)
1268
+ case 'c':
1269
+ return String(localDayOfWeek);
1270
+ // Padded numerical value
1271
+ case 'cc':
1272
+ return addLeadingZeros(localDayOfWeek, token.length);
1273
+ // 1st, 2nd, ..., 7th
1274
+ case 'co':
1275
+ return localize.ordinalNumber(localDayOfWeek, {
1276
+ unit: 'day'
1277
+ });
1278
+ case 'ccc':
1279
+ return localize.day(dayOfWeek, {
1280
+ width: 'abbreviated',
1281
+ context: 'standalone'
1282
+ });
1283
+ // T
1284
+ case 'ccccc':
1285
+ return localize.day(dayOfWeek, {
1286
+ width: 'narrow',
1287
+ context: 'standalone'
1288
+ });
1289
+ // Tu
1290
+ case 'cccccc':
1291
+ return localize.day(dayOfWeek, {
1292
+ width: 'short',
1293
+ context: 'standalone'
1294
+ });
1295
+ // Tuesday
1296
+ case 'cccc':
1297
+ default:
1298
+ return localize.day(dayOfWeek, {
1299
+ width: 'wide',
1300
+ context: 'standalone'
1301
+ });
1302
+ }
1303
+ },
1304
+ // ISO day of week
1305
+ i: function i(date, token, localize) {
1306
+ var dayOfWeek = date.getUTCDay();
1307
+ var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
1308
+ switch (token) {
1309
+ // 2
1310
+ case 'i':
1311
+ return String(isoDayOfWeek);
1312
+ // 02
1313
+ case 'ii':
1314
+ return addLeadingZeros(isoDayOfWeek, token.length);
1315
+ // 2nd
1316
+ case 'io':
1317
+ return localize.ordinalNumber(isoDayOfWeek, {
1318
+ unit: 'day'
1319
+ });
1320
+ // Tue
1321
+ case 'iii':
1322
+ return localize.day(dayOfWeek, {
1323
+ width: 'abbreviated',
1324
+ context: 'formatting'
1325
+ });
1326
+ // T
1327
+ case 'iiiii':
1328
+ return localize.day(dayOfWeek, {
1329
+ width: 'narrow',
1330
+ context: 'formatting'
1331
+ });
1332
+ // Tu
1333
+ case 'iiiiii':
1334
+ return localize.day(dayOfWeek, {
1335
+ width: 'short',
1336
+ context: 'formatting'
1337
+ });
1338
+ // Tuesday
1339
+ case 'iiii':
1340
+ default:
1341
+ return localize.day(dayOfWeek, {
1342
+ width: 'wide',
1343
+ context: 'formatting'
1344
+ });
1345
+ }
1346
+ },
1347
+ // AM or PM
1348
+ a: function a(date, token, localize) {
1349
+ var hours = date.getUTCHours();
1350
+ var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
1351
+ switch (token) {
1352
+ case 'a':
1353
+ case 'aa':
1354
+ return localize.dayPeriod(dayPeriodEnumValue, {
1355
+ width: 'abbreviated',
1356
+ context: 'formatting'
1357
+ });
1358
+ case 'aaa':
1359
+ return localize.dayPeriod(dayPeriodEnumValue, {
1360
+ width: 'abbreviated',
1361
+ context: 'formatting'
1362
+ }).toLowerCase();
1363
+ case 'aaaaa':
1364
+ return localize.dayPeriod(dayPeriodEnumValue, {
1365
+ width: 'narrow',
1366
+ context: 'formatting'
1367
+ });
1368
+ case 'aaaa':
1369
+ default:
1370
+ return localize.dayPeriod(dayPeriodEnumValue, {
1371
+ width: 'wide',
1372
+ context: 'formatting'
1373
+ });
1374
+ }
1375
+ },
1376
+ // AM, PM, midnight, noon
1377
+ b: function b(date, token, localize) {
1378
+ var hours = date.getUTCHours();
1379
+ var dayPeriodEnumValue;
1380
+ if (hours === 12) {
1381
+ dayPeriodEnumValue = dayPeriodEnum.noon;
1382
+ } else if (hours === 0) {
1383
+ dayPeriodEnumValue = dayPeriodEnum.midnight;
1384
+ } else {
1385
+ dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
1386
+ }
1387
+ switch (token) {
1388
+ case 'b':
1389
+ case 'bb':
1390
+ return localize.dayPeriod(dayPeriodEnumValue, {
1391
+ width: 'abbreviated',
1392
+ context: 'formatting'
1393
+ });
1394
+ case 'bbb':
1395
+ return localize.dayPeriod(dayPeriodEnumValue, {
1396
+ width: 'abbreviated',
1397
+ context: 'formatting'
1398
+ }).toLowerCase();
1399
+ case 'bbbbb':
1400
+ return localize.dayPeriod(dayPeriodEnumValue, {
1401
+ width: 'narrow',
1402
+ context: 'formatting'
1403
+ });
1404
+ case 'bbbb':
1405
+ default:
1406
+ return localize.dayPeriod(dayPeriodEnumValue, {
1407
+ width: 'wide',
1408
+ context: 'formatting'
1409
+ });
1410
+ }
1411
+ },
1412
+ // in the morning, in the afternoon, in the evening, at night
1413
+ B: function B(date, token, localize) {
1414
+ var hours = date.getUTCHours();
1415
+ var dayPeriodEnumValue;
1416
+ if (hours >= 17) {
1417
+ dayPeriodEnumValue = dayPeriodEnum.evening;
1418
+ } else if (hours >= 12) {
1419
+ dayPeriodEnumValue = dayPeriodEnum.afternoon;
1420
+ } else if (hours >= 4) {
1421
+ dayPeriodEnumValue = dayPeriodEnum.morning;
1422
+ } else {
1423
+ dayPeriodEnumValue = dayPeriodEnum.night;
1424
+ }
1425
+ switch (token) {
1426
+ case 'B':
1427
+ case 'BB':
1428
+ case 'BBB':
1429
+ return localize.dayPeriod(dayPeriodEnumValue, {
1430
+ width: 'abbreviated',
1431
+ context: 'formatting'
1432
+ });
1433
+ case 'BBBBB':
1434
+ return localize.dayPeriod(dayPeriodEnumValue, {
1435
+ width: 'narrow',
1436
+ context: 'formatting'
1437
+ });
1438
+ case 'BBBB':
1439
+ default:
1440
+ return localize.dayPeriod(dayPeriodEnumValue, {
1441
+ width: 'wide',
1442
+ context: 'formatting'
1443
+ });
1444
+ }
1445
+ },
1446
+ // Hour [1-12]
1447
+ h: function h(date, token, localize) {
1448
+ if (token === 'ho') {
1449
+ var hours = date.getUTCHours() % 12;
1450
+ if (hours === 0) hours = 12;
1451
+ return localize.ordinalNumber(hours, {
1452
+ unit: 'hour'
1453
+ });
1454
+ }
1455
+ return formatters$3.h(date, token);
1456
+ },
1457
+ // Hour [0-23]
1458
+ H: function H(date, token, localize) {
1459
+ if (token === 'Ho') {
1460
+ return localize.ordinalNumber(date.getUTCHours(), {
1461
+ unit: 'hour'
1462
+ });
1463
+ }
1464
+ return formatters$3.H(date, token);
1465
+ },
1466
+ // Hour [0-11]
1467
+ K: function K(date, token, localize) {
1468
+ var hours = date.getUTCHours() % 12;
1469
+ if (token === 'Ko') {
1470
+ return localize.ordinalNumber(hours, {
1471
+ unit: 'hour'
1472
+ });
1473
+ }
1474
+ return addLeadingZeros(hours, token.length);
1475
+ },
1476
+ // Hour [1-24]
1477
+ k: function k(date, token, localize) {
1478
+ var hours = date.getUTCHours();
1479
+ if (hours === 0) hours = 24;
1480
+ if (token === 'ko') {
1481
+ return localize.ordinalNumber(hours, {
1482
+ unit: 'hour'
1483
+ });
1484
+ }
1485
+ return addLeadingZeros(hours, token.length);
1486
+ },
1487
+ // Minute
1488
+ m: function m(date, token, localize) {
1489
+ if (token === 'mo') {
1490
+ return localize.ordinalNumber(date.getUTCMinutes(), {
1491
+ unit: 'minute'
1492
+ });
1493
+ }
1494
+ return formatters$3.m(date, token);
1495
+ },
1496
+ // Second
1497
+ s: function s(date, token, localize) {
1498
+ if (token === 'so') {
1499
+ return localize.ordinalNumber(date.getUTCSeconds(), {
1500
+ unit: 'second'
1501
+ });
1502
+ }
1503
+ return formatters$3.s(date, token);
1504
+ },
1505
+ // Fraction of second
1506
+ S: function S(date, token) {
1507
+ return formatters$3.S(date, token);
1508
+ },
1509
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1510
+ X: function X(date, token, _localize, options) {
1511
+ var originalDate = options._originalDate || date;
1512
+ var timezoneOffset = originalDate.getTimezoneOffset();
1513
+ if (timezoneOffset === 0) {
1514
+ return 'Z';
1515
+ }
1516
+ switch (token) {
1517
+ // Hours and optional minutes
1518
+ case 'X':
1519
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
1520
+
1521
+ // Hours, minutes and optional seconds without `:` delimiter
1522
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1523
+ // so this token always has the same output as `XX`
1524
+ case 'XXXX':
1525
+ case 'XX':
1526
+ // Hours and minutes without `:` delimiter
1527
+ return formatTimezone(timezoneOffset);
1528
+
1529
+ // Hours, minutes and optional seconds with `:` delimiter
1530
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1531
+ // so this token always has the same output as `XXX`
1532
+ case 'XXXXX':
1533
+ case 'XXX': // Hours and minutes with `:` delimiter
1534
+ default:
1535
+ return formatTimezone(timezoneOffset, ':');
1536
+ }
1537
+ },
1538
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1539
+ x: function x(date, token, _localize, options) {
1540
+ var originalDate = options._originalDate || date;
1541
+ var timezoneOffset = originalDate.getTimezoneOffset();
1542
+ switch (token) {
1543
+ // Hours and optional minutes
1544
+ case 'x':
1545
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
1546
+
1547
+ // Hours, minutes and optional seconds without `:` delimiter
1548
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1549
+ // so this token always has the same output as `xx`
1550
+ case 'xxxx':
1551
+ case 'xx':
1552
+ // Hours and minutes without `:` delimiter
1553
+ return formatTimezone(timezoneOffset);
1554
+
1555
+ // Hours, minutes and optional seconds with `:` delimiter
1556
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1557
+ // so this token always has the same output as `xxx`
1558
+ case 'xxxxx':
1559
+ case 'xxx': // Hours and minutes with `:` delimiter
1560
+ default:
1561
+ return formatTimezone(timezoneOffset, ':');
1562
+ }
1563
+ },
1564
+ // Timezone (GMT)
1565
+ O: function O(date, token, _localize, options) {
1566
+ var originalDate = options._originalDate || date;
1567
+ var timezoneOffset = originalDate.getTimezoneOffset();
1568
+ switch (token) {
1569
+ // Short
1570
+ case 'O':
1571
+ case 'OO':
1572
+ case 'OOO':
1573
+ return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
1574
+ // Long
1575
+ case 'OOOO':
1576
+ default:
1577
+ return 'GMT' + formatTimezone(timezoneOffset, ':');
1578
+ }
1579
+ },
1580
+ // Timezone (specific non-location)
1581
+ z: function z(date, token, _localize, options) {
1582
+ var originalDate = options._originalDate || date;
1583
+ var timezoneOffset = originalDate.getTimezoneOffset();
1584
+ switch (token) {
1585
+ // Short
1586
+ case 'z':
1587
+ case 'zz':
1588
+ case 'zzz':
1589
+ return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
1590
+ // Long
1591
+ case 'zzzz':
1592
+ default:
1593
+ return 'GMT' + formatTimezone(timezoneOffset, ':');
1594
+ }
1595
+ },
1596
+ // Seconds timestamp
1597
+ t: function t(date, token, _localize, options) {
1598
+ var originalDate = options._originalDate || date;
1599
+ var timestamp = Math.floor(originalDate.getTime() / 1000);
1600
+ return addLeadingZeros(timestamp, token.length);
1601
+ },
1602
+ // Milliseconds timestamp
1603
+ T: function T(date, token, _localize, options) {
1604
+ var originalDate = options._originalDate || date;
1605
+ var timestamp = originalDate.getTime();
1606
+ return addLeadingZeros(timestamp, token.length);
1607
+ }
1608
+ };
1609
+ function formatTimezoneShort(offset, dirtyDelimiter) {
1610
+ var sign = offset > 0 ? '-' : '+';
1611
+ var absOffset = Math.abs(offset);
1612
+ var hours = Math.floor(absOffset / 60);
1613
+ var minutes = absOffset % 60;
1614
+ if (minutes === 0) {
1615
+ return sign + String(hours);
1616
+ }
1617
+ var delimiter = dirtyDelimiter || '';
1618
+ return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
1619
+ }
1620
+ function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
1621
+ if (offset % 60 === 0) {
1622
+ var sign = offset > 0 ? '-' : '+';
1623
+ return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
1624
+ }
1625
+ return formatTimezone(offset, dirtyDelimiter);
1626
+ }
1627
+ function formatTimezone(offset, dirtyDelimiter) {
1628
+ var delimiter = dirtyDelimiter || '';
1629
+ var sign = offset > 0 ? '-' : '+';
1630
+ var absOffset = Math.abs(offset);
1631
+ var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
1632
+ var minutes = addLeadingZeros(absOffset % 60, 2);
1633
+ return sign + hours + delimiter + minutes;
1634
+ }
1635
+ var formatters$1 = formatters;
1636
+
1637
+ var dateLongFormatter = function dateLongFormatter(pattern, formatLong) {
1638
+ switch (pattern) {
1639
+ case 'P':
1640
+ return formatLong.date({
1641
+ width: 'short'
1642
+ });
1643
+ case 'PP':
1644
+ return formatLong.date({
1645
+ width: 'medium'
1646
+ });
1647
+ case 'PPP':
1648
+ return formatLong.date({
1649
+ width: 'long'
1650
+ });
1651
+ case 'PPPP':
1652
+ default:
1653
+ return formatLong.date({
1654
+ width: 'full'
1655
+ });
1656
+ }
1657
+ };
1658
+ var timeLongFormatter = function timeLongFormatter(pattern, formatLong) {
1659
+ switch (pattern) {
1660
+ case 'p':
1661
+ return formatLong.time({
1662
+ width: 'short'
1663
+ });
1664
+ case 'pp':
1665
+ return formatLong.time({
1666
+ width: 'medium'
1667
+ });
1668
+ case 'ppp':
1669
+ return formatLong.time({
1670
+ width: 'long'
1671
+ });
1672
+ case 'pppp':
1673
+ default:
1674
+ return formatLong.time({
1675
+ width: 'full'
1676
+ });
1677
+ }
1678
+ };
1679
+ var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong) {
1680
+ var matchResult = pattern.match(/(P+)(p+)?/) || [];
1681
+ var datePattern = matchResult[1];
1682
+ var timePattern = matchResult[2];
1683
+ if (!timePattern) {
1684
+ return dateLongFormatter(pattern, formatLong);
1685
+ }
1686
+ var dateTimeFormat;
1687
+ switch (datePattern) {
1688
+ case 'P':
1689
+ dateTimeFormat = formatLong.dateTime({
1690
+ width: 'short'
1691
+ });
1692
+ break;
1693
+ case 'PP':
1694
+ dateTimeFormat = formatLong.dateTime({
1695
+ width: 'medium'
1696
+ });
1697
+ break;
1698
+ case 'PPP':
1699
+ dateTimeFormat = formatLong.dateTime({
1700
+ width: 'long'
1701
+ });
1702
+ break;
1703
+ case 'PPPP':
1704
+ default:
1705
+ dateTimeFormat = formatLong.dateTime({
1706
+ width: 'full'
1707
+ });
1708
+ break;
1709
+ }
1710
+ return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
1711
+ };
1712
+ var longFormatters = {
1713
+ p: timeLongFormatter,
1714
+ P: dateTimeLongFormatter
1715
+ };
1716
+ var longFormatters$1 = longFormatters;
1717
+
1718
+ var protectedDayOfYearTokens = ['D', 'DD'];
1719
+ var protectedWeekYearTokens = ['YY', 'YYYY'];
1720
+ function isProtectedDayOfYearToken(token) {
1721
+ return protectedDayOfYearTokens.indexOf(token) !== -1;
1722
+ }
1723
+ function isProtectedWeekYearToken(token) {
1724
+ return protectedWeekYearTokens.indexOf(token) !== -1;
1725
+ }
1726
+ function throwProtectedError(token, format, input) {
1727
+ if (token === 'YYYY') {
1728
+ throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
1729
+ } else if (token === 'YY') {
1730
+ throw new RangeError("Use `yy` instead of `YY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
1731
+ } else if (token === 'D') {
1732
+ throw new RangeError("Use `d` instead of `D` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
1733
+ } else if (token === 'DD') {
1734
+ throw new RangeError("Use `dd` instead of `DD` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
1735
+ }
1736
+ }
1737
+
1738
+ var formatDistanceLocale = {
1739
+ lessThanXSeconds: {
1740
+ one: 'less than a second',
1741
+ other: 'less than {{count}} seconds'
1742
+ },
1743
+ xSeconds: {
1744
+ one: '1 second',
1745
+ other: '{{count}} seconds'
1746
+ },
1747
+ halfAMinute: 'half a minute',
1748
+ lessThanXMinutes: {
1749
+ one: 'less than a minute',
1750
+ other: 'less than {{count}} minutes'
1751
+ },
1752
+ xMinutes: {
1753
+ one: '1 minute',
1754
+ other: '{{count}} minutes'
1755
+ },
1756
+ aboutXHours: {
1757
+ one: 'about 1 hour',
1758
+ other: 'about {{count}} hours'
1759
+ },
1760
+ xHours: {
1761
+ one: '1 hour',
1762
+ other: '{{count}} hours'
1763
+ },
1764
+ xDays: {
1765
+ one: '1 day',
1766
+ other: '{{count}} days'
1767
+ },
1768
+ aboutXWeeks: {
1769
+ one: 'about 1 week',
1770
+ other: 'about {{count}} weeks'
1771
+ },
1772
+ xWeeks: {
1773
+ one: '1 week',
1774
+ other: '{{count}} weeks'
1775
+ },
1776
+ aboutXMonths: {
1777
+ one: 'about 1 month',
1778
+ other: 'about {{count}} months'
1779
+ },
1780
+ xMonths: {
1781
+ one: '1 month',
1782
+ other: '{{count}} months'
1783
+ },
1784
+ aboutXYears: {
1785
+ one: 'about 1 year',
1786
+ other: 'about {{count}} years'
1787
+ },
1788
+ xYears: {
1789
+ one: '1 year',
1790
+ other: '{{count}} years'
1791
+ },
1792
+ overXYears: {
1793
+ one: 'over 1 year',
1794
+ other: 'over {{count}} years'
1795
+ },
1796
+ almostXYears: {
1797
+ one: 'almost 1 year',
1798
+ other: 'almost {{count}} years'
1799
+ }
1800
+ };
1801
+ var formatDistance = function formatDistance(token, count, options) {
1802
+ var result;
1803
+ var tokenValue = formatDistanceLocale[token];
1804
+ if (typeof tokenValue === 'string') {
1805
+ result = tokenValue;
1806
+ } else if (count === 1) {
1807
+ result = tokenValue.one;
1808
+ } else {
1809
+ result = tokenValue.other.replace('{{count}}', count.toString());
1810
+ }
1811
+ if (options !== null && options !== void 0 && options.addSuffix) {
1812
+ if (options.comparison && options.comparison > 0) {
1813
+ return 'in ' + result;
1814
+ } else {
1815
+ return result + ' ago';
1816
+ }
1817
+ }
1818
+ return result;
1819
+ };
1820
+ var formatDistance$1 = formatDistance;
1821
+
1822
+ function buildFormatLongFn(args) {
1823
+ return function () {
1824
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1825
+ // TODO: Remove String()
1826
+ var width = options.width ? String(options.width) : args.defaultWidth;
1827
+ var format = args.formats[width] || args.formats[args.defaultWidth];
1828
+ return format;
1829
+ };
1830
+ }
1831
+
1832
+ var dateFormats = {
1833
+ full: 'EEEE, MMMM do, y',
1834
+ long: 'MMMM do, y',
1835
+ medium: 'MMM d, y',
1836
+ short: 'MM/dd/yyyy'
1837
+ };
1838
+ var timeFormats = {
1839
+ full: 'h:mm:ss a zzzz',
1840
+ long: 'h:mm:ss a z',
1841
+ medium: 'h:mm:ss a',
1842
+ short: 'h:mm a'
1843
+ };
1844
+ var dateTimeFormats = {
1845
+ full: "{{date}} 'at' {{time}}",
1846
+ long: "{{date}} 'at' {{time}}",
1847
+ medium: '{{date}}, {{time}}',
1848
+ short: '{{date}}, {{time}}'
1849
+ };
1850
+ var formatLong = {
1851
+ date: buildFormatLongFn({
1852
+ formats: dateFormats,
1853
+ defaultWidth: 'full'
1854
+ }),
1855
+ time: buildFormatLongFn({
1856
+ formats: timeFormats,
1857
+ defaultWidth: 'full'
1858
+ }),
1859
+ dateTime: buildFormatLongFn({
1860
+ formats: dateTimeFormats,
1861
+ defaultWidth: 'full'
1862
+ })
1863
+ };
1864
+ var formatLong$1 = formatLong;
1865
+
1866
+ var formatRelativeLocale = {
1867
+ lastWeek: "'last' eeee 'at' p",
1868
+ yesterday: "'yesterday at' p",
1869
+ today: "'today at' p",
1870
+ tomorrow: "'tomorrow at' p",
1871
+ nextWeek: "eeee 'at' p",
1872
+ other: 'P'
1873
+ };
1874
+ var formatRelative = function formatRelative(token, _date, _baseDate, _options) {
1875
+ return formatRelativeLocale[token];
1876
+ };
1877
+ var formatRelative$1 = formatRelative;
1878
+
1879
+ function buildLocalizeFn(args) {
1880
+ return function (dirtyIndex, options) {
1881
+ var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';
1882
+ var valuesArray;
1883
+ if (context === 'formatting' && args.formattingValues) {
1884
+ var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
1885
+ var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
1886
+ valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
1887
+ } else {
1888
+ var _defaultWidth = args.defaultWidth;
1889
+ var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
1890
+ valuesArray = args.values[_width] || args.values[_defaultWidth];
1891
+ }
1892
+ var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
1893
+ // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
1894
+ return valuesArray[index];
1895
+ };
1896
+ }
1897
+
1898
+ var eraValues = {
1899
+ narrow: ['B', 'A'],
1900
+ abbreviated: ['BC', 'AD'],
1901
+ wide: ['Before Christ', 'Anno Domini']
1902
+ };
1903
+ var quarterValues = {
1904
+ narrow: ['1', '2', '3', '4'],
1905
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
1906
+ wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
1907
+ };
1908
+
1909
+ // Note: in English, the names of days of the week and months are capitalized.
1910
+ // If you are making a new locale based on this one, check if the same is true for the language you're working on.
1911
+ // Generally, formatted dates should look like they are in the middle of a sentence,
1912
+ // e.g. in Spanish language the weekdays and months should be in the lowercase.
1913
+ var monthValues = {
1914
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
1915
+ abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
1916
+ wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
1917
+ };
1918
+ var dayValues = {
1919
+ narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
1920
+ short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
1921
+ abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
1922
+ wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
1923
+ };
1924
+ var dayPeriodValues = {
1925
+ narrow: {
1926
+ am: 'a',
1927
+ pm: 'p',
1928
+ midnight: 'mi',
1929
+ noon: 'n',
1930
+ morning: 'morning',
1931
+ afternoon: 'afternoon',
1932
+ evening: 'evening',
1933
+ night: 'night'
1934
+ },
1935
+ abbreviated: {
1936
+ am: 'AM',
1937
+ pm: 'PM',
1938
+ midnight: 'midnight',
1939
+ noon: 'noon',
1940
+ morning: 'morning',
1941
+ afternoon: 'afternoon',
1942
+ evening: 'evening',
1943
+ night: 'night'
1944
+ },
1945
+ wide: {
1946
+ am: 'a.m.',
1947
+ pm: 'p.m.',
1948
+ midnight: 'midnight',
1949
+ noon: 'noon',
1950
+ morning: 'morning',
1951
+ afternoon: 'afternoon',
1952
+ evening: 'evening',
1953
+ night: 'night'
1954
+ }
1955
+ };
1956
+ var formattingDayPeriodValues = {
1957
+ narrow: {
1958
+ am: 'a',
1959
+ pm: 'p',
1960
+ midnight: 'mi',
1961
+ noon: 'n',
1962
+ morning: 'in the morning',
1963
+ afternoon: 'in the afternoon',
1964
+ evening: 'in the evening',
1965
+ night: 'at night'
1966
+ },
1967
+ abbreviated: {
1968
+ am: 'AM',
1969
+ pm: 'PM',
1970
+ midnight: 'midnight',
1971
+ noon: 'noon',
1972
+ morning: 'in the morning',
1973
+ afternoon: 'in the afternoon',
1974
+ evening: 'in the evening',
1975
+ night: 'at night'
1976
+ },
1977
+ wide: {
1978
+ am: 'a.m.',
1979
+ pm: 'p.m.',
1980
+ midnight: 'midnight',
1981
+ noon: 'noon',
1982
+ morning: 'in the morning',
1983
+ afternoon: 'in the afternoon',
1984
+ evening: 'in the evening',
1985
+ night: 'at night'
1986
+ }
1987
+ };
1988
+ var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
1989
+ var number = Number(dirtyNumber);
1990
+
1991
+ // If ordinal numbers depend on context, for example,
1992
+ // if they are different for different grammatical genders,
1993
+ // use `options.unit`.
1994
+ //
1995
+ // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
1996
+ // 'day', 'hour', 'minute', 'second'.
1997
+
1998
+ var rem100 = number % 100;
1999
+ if (rem100 > 20 || rem100 < 10) {
2000
+ switch (rem100 % 10) {
2001
+ case 1:
2002
+ return number + 'st';
2003
+ case 2:
2004
+ return number + 'nd';
2005
+ case 3:
2006
+ return number + 'rd';
2007
+ }
2008
+ }
2009
+ return number + 'th';
2010
+ };
2011
+ var localize = {
2012
+ ordinalNumber: ordinalNumber,
2013
+ era: buildLocalizeFn({
2014
+ values: eraValues,
2015
+ defaultWidth: 'wide'
2016
+ }),
2017
+ quarter: buildLocalizeFn({
2018
+ values: quarterValues,
2019
+ defaultWidth: 'wide',
2020
+ argumentCallback: function argumentCallback(quarter) {
2021
+ return quarter - 1;
2022
+ }
2023
+ }),
2024
+ month: buildLocalizeFn({
2025
+ values: monthValues,
2026
+ defaultWidth: 'wide'
2027
+ }),
2028
+ day: buildLocalizeFn({
2029
+ values: dayValues,
2030
+ defaultWidth: 'wide'
2031
+ }),
2032
+ dayPeriod: buildLocalizeFn({
2033
+ values: dayPeriodValues,
2034
+ defaultWidth: 'wide',
2035
+ formattingValues: formattingDayPeriodValues,
2036
+ defaultFormattingWidth: 'wide'
2037
+ })
2038
+ };
2039
+ var localize$1 = localize;
2040
+
2041
+ function buildMatchFn(args) {
2042
+ return function (string) {
2043
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2044
+ var width = options.width;
2045
+ var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
2046
+ var matchResult = string.match(matchPattern);
2047
+ if (!matchResult) {
2048
+ return null;
2049
+ }
2050
+ var matchedString = matchResult[0];
2051
+ var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
2052
+ var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
2053
+ return pattern.test(matchedString);
2054
+ }) : findKey(parsePatterns, function (pattern) {
2055
+ return pattern.test(matchedString);
2056
+ });
2057
+ var value;
2058
+ value = args.valueCallback ? args.valueCallback(key) : key;
2059
+ value = options.valueCallback ? options.valueCallback(value) : value;
2060
+ var rest = string.slice(matchedString.length);
2061
+ return {
2062
+ value: value,
2063
+ rest: rest
2064
+ };
2065
+ };
2066
+ }
2067
+ function findKey(object, predicate) {
2068
+ for (var key in object) {
2069
+ if (object.hasOwnProperty(key) && predicate(object[key])) {
2070
+ return key;
2071
+ }
2072
+ }
2073
+ return undefined;
2074
+ }
2075
+ function findIndex(array, predicate) {
2076
+ for (var key = 0; key < array.length; key++) {
2077
+ if (predicate(array[key])) {
2078
+ return key;
2079
+ }
2080
+ }
2081
+ return undefined;
2082
+ }
2083
+
2084
+ function buildMatchPatternFn(args) {
2085
+ return function (string) {
2086
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2087
+ var matchResult = string.match(args.matchPattern);
2088
+ if (!matchResult) return null;
2089
+ var matchedString = matchResult[0];
2090
+ var parseResult = string.match(args.parsePattern);
2091
+ if (!parseResult) return null;
2092
+ var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
2093
+ value = options.valueCallback ? options.valueCallback(value) : value;
2094
+ var rest = string.slice(matchedString.length);
2095
+ return {
2096
+ value: value,
2097
+ rest: rest
2098
+ };
2099
+ };
2100
+ }
2101
+
2102
+ var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
2103
+ var parseOrdinalNumberPattern = /\d+/i;
2104
+ var matchEraPatterns = {
2105
+ narrow: /^(b|a)/i,
2106
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
2107
+ wide: /^(before christ|before common era|anno domini|common era)/i
2108
+ };
2109
+ var parseEraPatterns = {
2110
+ any: [/^b/i, /^(a|c)/i]
2111
+ };
2112
+ var matchQuarterPatterns = {
2113
+ narrow: /^[1234]/i,
2114
+ abbreviated: /^q[1234]/i,
2115
+ wide: /^[1234](th|st|nd|rd)? quarter/i
2116
+ };
2117
+ var parseQuarterPatterns = {
2118
+ any: [/1/i, /2/i, /3/i, /4/i]
2119
+ };
2120
+ var matchMonthPatterns = {
2121
+ narrow: /^[jfmasond]/i,
2122
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
2123
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
2124
+ };
2125
+ var parseMonthPatterns = {
2126
+ narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
2127
+ any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
2128
+ };
2129
+ var matchDayPatterns = {
2130
+ narrow: /^[smtwf]/i,
2131
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
2132
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
2133
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
2134
+ };
2135
+ var parseDayPatterns = {
2136
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
2137
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
2138
+ };
2139
+ var matchDayPeriodPatterns = {
2140
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
2141
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
2142
+ };
2143
+ var parseDayPeriodPatterns = {
2144
+ any: {
2145
+ am: /^a/i,
2146
+ pm: /^p/i,
2147
+ midnight: /^mi/i,
2148
+ noon: /^no/i,
2149
+ morning: /morning/i,
2150
+ afternoon: /afternoon/i,
2151
+ evening: /evening/i,
2152
+ night: /night/i
2153
+ }
2154
+ };
2155
+ var match = {
2156
+ ordinalNumber: buildMatchPatternFn({
2157
+ matchPattern: matchOrdinalNumberPattern,
2158
+ parsePattern: parseOrdinalNumberPattern,
2159
+ valueCallback: function valueCallback(value) {
2160
+ return parseInt(value, 10);
2161
+ }
2162
+ }),
2163
+ era: buildMatchFn({
2164
+ matchPatterns: matchEraPatterns,
2165
+ defaultMatchWidth: 'wide',
2166
+ parsePatterns: parseEraPatterns,
2167
+ defaultParseWidth: 'any'
2168
+ }),
2169
+ quarter: buildMatchFn({
2170
+ matchPatterns: matchQuarterPatterns,
2171
+ defaultMatchWidth: 'wide',
2172
+ parsePatterns: parseQuarterPatterns,
2173
+ defaultParseWidth: 'any',
2174
+ valueCallback: function valueCallback(index) {
2175
+ return index + 1;
2176
+ }
2177
+ }),
2178
+ month: buildMatchFn({
2179
+ matchPatterns: matchMonthPatterns,
2180
+ defaultMatchWidth: 'wide',
2181
+ parsePatterns: parseMonthPatterns,
2182
+ defaultParseWidth: 'any'
2183
+ }),
2184
+ day: buildMatchFn({
2185
+ matchPatterns: matchDayPatterns,
2186
+ defaultMatchWidth: 'wide',
2187
+ parsePatterns: parseDayPatterns,
2188
+ defaultParseWidth: 'any'
2189
+ }),
2190
+ dayPeriod: buildMatchFn({
2191
+ matchPatterns: matchDayPeriodPatterns,
2192
+ defaultMatchWidth: 'any',
2193
+ parsePatterns: parseDayPeriodPatterns,
2194
+ defaultParseWidth: 'any'
2195
+ })
2196
+ };
2197
+ var match$1 = match;
2198
+
2199
+ /**
2200
+ * @type {Locale}
2201
+ * @category Locales
2202
+ * @summary English locale (United States).
2203
+ * @language English
2204
+ * @iso-639-2 eng
2205
+ * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
2206
+ * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
2207
+ */
2208
+ var locale = {
2209
+ code: 'en-US',
2210
+ formatDistance: formatDistance$1,
2211
+ formatLong: formatLong$1,
2212
+ formatRelative: formatRelative$1,
2213
+ localize: localize$1,
2214
+ match: match$1,
2215
+ options: {
2216
+ weekStartsOn: 0 /* Sunday */,
2217
+ firstWeekContainsDate: 1
2218
+ }
2219
+ };
2220
+ var defaultLocale = locale;
2221
+
2222
+ // - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
2223
+ // (one of the certain letters followed by `o`)
2224
+ // - (\w)\1* matches any sequences of the same letter
2225
+ // - '' matches two quote characters in a row
2226
+ // - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
2227
+ // except a single quote symbol, which ends the sequence.
2228
+ // Two quote characters do not end the sequence.
2229
+ // If there is no matching single quote
2230
+ // then the sequence will continue until the end of the string.
2231
+ // - . matches any single character unmatched by previous parts of the RegExps
2232
+ var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
2233
+
2234
+ // This RegExp catches symbols escaped by quotes, and also
2235
+ // sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
2236
+ var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
2237
+ var escapedStringRegExp = /^'([^]*?)'?$/;
2238
+ var doubleQuoteRegExp = /''/g;
2239
+ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
2240
+
2241
+ /**
2242
+ * @name format
2243
+ * @category Common Helpers
2244
+ * @summary Format the date.
2245
+ *
2246
+ * @description
2247
+ * Return the formatted date string in the given format. The result may vary by locale.
2248
+ *
2249
+ * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
2250
+ * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2251
+ *
2252
+ * The characters wrapped between two single quotes characters (') are escaped.
2253
+ * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
2254
+ * (see the last example)
2255
+ *
2256
+ * Format of the string is based on Unicode Technical Standard #35:
2257
+ * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
2258
+ * with a few additions (see note 7 below the table).
2259
+ *
2260
+ * Accepted patterns:
2261
+ * | Unit | Pattern | Result examples | Notes |
2262
+ * |---------------------------------|---------|-----------------------------------|-------|
2263
+ * | Era | G..GGG | AD, BC | |
2264
+ * | | GGGG | Anno Domini, Before Christ | 2 |
2265
+ * | | GGGGG | A, B | |
2266
+ * | Calendar year | y | 44, 1, 1900, 2017 | 5 |
2267
+ * | | yo | 44th, 1st, 0th, 17th | 5,7 |
2268
+ * | | yy | 44, 01, 00, 17 | 5 |
2269
+ * | | yyy | 044, 001, 1900, 2017 | 5 |
2270
+ * | | yyyy | 0044, 0001, 1900, 2017 | 5 |
2271
+ * | | yyyyy | ... | 3,5 |
2272
+ * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
2273
+ * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
2274
+ * | | YY | 44, 01, 00, 17 | 5,8 |
2275
+ * | | YYY | 044, 001, 1900, 2017 | 5 |
2276
+ * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
2277
+ * | | YYYYY | ... | 3,5 |
2278
+ * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
2279
+ * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
2280
+ * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
2281
+ * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
2282
+ * | | RRRRR | ... | 3,5,7 |
2283
+ * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
2284
+ * | | uu | -43, 01, 1900, 2017 | 5 |
2285
+ * | | uuu | -043, 001, 1900, 2017 | 5 |
2286
+ * | | uuuu | -0043, 0001, 1900, 2017 | 5 |
2287
+ * | | uuuuu | ... | 3,5 |
2288
+ * | Quarter (formatting) | Q | 1, 2, 3, 4 | |
2289
+ * | | Qo | 1st, 2nd, 3rd, 4th | 7 |
2290
+ * | | QQ | 01, 02, 03, 04 | |
2291
+ * | | QQQ | Q1, Q2, Q3, Q4 | |
2292
+ * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
2293
+ * | | QQQQQ | 1, 2, 3, 4 | 4 |
2294
+ * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
2295
+ * | | qo | 1st, 2nd, 3rd, 4th | 7 |
2296
+ * | | qq | 01, 02, 03, 04 | |
2297
+ * | | qqq | Q1, Q2, Q3, Q4 | |
2298
+ * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
2299
+ * | | qqqqq | 1, 2, 3, 4 | 4 |
2300
+ * | Month (formatting) | M | 1, 2, ..., 12 | |
2301
+ * | | Mo | 1st, 2nd, ..., 12th | 7 |
2302
+ * | | MM | 01, 02, ..., 12 | |
2303
+ * | | MMM | Jan, Feb, ..., Dec | |
2304
+ * | | MMMM | January, February, ..., December | 2 |
2305
+ * | | MMMMM | J, F, ..., D | |
2306
+ * | Month (stand-alone) | L | 1, 2, ..., 12 | |
2307
+ * | | Lo | 1st, 2nd, ..., 12th | 7 |
2308
+ * | | LL | 01, 02, ..., 12 | |
2309
+ * | | LLL | Jan, Feb, ..., Dec | |
2310
+ * | | LLLL | January, February, ..., December | 2 |
2311
+ * | | LLLLL | J, F, ..., D | |
2312
+ * | Local week of year | w | 1, 2, ..., 53 | |
2313
+ * | | wo | 1st, 2nd, ..., 53th | 7 |
2314
+ * | | ww | 01, 02, ..., 53 | |
2315
+ * | ISO week of year | I | 1, 2, ..., 53 | 7 |
2316
+ * | | Io | 1st, 2nd, ..., 53th | 7 |
2317
+ * | | II | 01, 02, ..., 53 | 7 |
2318
+ * | Day of month | d | 1, 2, ..., 31 | |
2319
+ * | | do | 1st, 2nd, ..., 31st | 7 |
2320
+ * | | dd | 01, 02, ..., 31 | |
2321
+ * | Day of year | D | 1, 2, ..., 365, 366 | 9 |
2322
+ * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
2323
+ * | | DD | 01, 02, ..., 365, 366 | 9 |
2324
+ * | | DDD | 001, 002, ..., 365, 366 | |
2325
+ * | | DDDD | ... | 3 |
2326
+ * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
2327
+ * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
2328
+ * | | EEEEE | M, T, W, T, F, S, S | |
2329
+ * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
2330
+ * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
2331
+ * | | io | 1st, 2nd, ..., 7th | 7 |
2332
+ * | | ii | 01, 02, ..., 07 | 7 |
2333
+ * | | iii | Mon, Tue, Wed, ..., Sun | 7 |
2334
+ * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
2335
+ * | | iiiii | M, T, W, T, F, S, S | 7 |
2336
+ * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
2337
+ * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
2338
+ * | | eo | 2nd, 3rd, ..., 1st | 7 |
2339
+ * | | ee | 02, 03, ..., 01 | |
2340
+ * | | eee | Mon, Tue, Wed, ..., Sun | |
2341
+ * | | eeee | Monday, Tuesday, ..., Sunday | 2 |
2342
+ * | | eeeee | M, T, W, T, F, S, S | |
2343
+ * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
2344
+ * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
2345
+ * | | co | 2nd, 3rd, ..., 1st | 7 |
2346
+ * | | cc | 02, 03, ..., 01 | |
2347
+ * | | ccc | Mon, Tue, Wed, ..., Sun | |
2348
+ * | | cccc | Monday, Tuesday, ..., Sunday | 2 |
2349
+ * | | ccccc | M, T, W, T, F, S, S | |
2350
+ * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
2351
+ * | AM, PM | a..aa | AM, PM | |
2352
+ * | | aaa | am, pm | |
2353
+ * | | aaaa | a.m., p.m. | 2 |
2354
+ * | | aaaaa | a, p | |
2355
+ * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
2356
+ * | | bbb | am, pm, noon, midnight | |
2357
+ * | | bbbb | a.m., p.m., noon, midnight | 2 |
2358
+ * | | bbbbb | a, p, n, mi | |
2359
+ * | Flexible day period | B..BBB | at night, in the morning, ... | |
2360
+ * | | BBBB | at night, in the morning, ... | 2 |
2361
+ * | | BBBBB | at night, in the morning, ... | |
2362
+ * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
2363
+ * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
2364
+ * | | hh | 01, 02, ..., 11, 12 | |
2365
+ * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
2366
+ * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
2367
+ * | | HH | 00, 01, 02, ..., 23 | |
2368
+ * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
2369
+ * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
2370
+ * | | KK | 01, 02, ..., 11, 00 | |
2371
+ * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
2372
+ * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
2373
+ * | | kk | 24, 01, 02, ..., 23 | |
2374
+ * | Minute | m | 0, 1, ..., 59 | |
2375
+ * | | mo | 0th, 1st, ..., 59th | 7 |
2376
+ * | | mm | 00, 01, ..., 59 | |
2377
+ * | Second | s | 0, 1, ..., 59 | |
2378
+ * | | so | 0th, 1st, ..., 59th | 7 |
2379
+ * | | ss | 00, 01, ..., 59 | |
2380
+ * | Fraction of second | S | 0, 1, ..., 9 | |
2381
+ * | | SS | 00, 01, ..., 99 | |
2382
+ * | | SSS | 000, 001, ..., 999 | |
2383
+ * | | SSSS | ... | 3 |
2384
+ * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
2385
+ * | | XX | -0800, +0530, Z | |
2386
+ * | | XXX | -08:00, +05:30, Z | |
2387
+ * | | XXXX | -0800, +0530, Z, +123456 | 2 |
2388
+ * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
2389
+ * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
2390
+ * | | xx | -0800, +0530, +0000 | |
2391
+ * | | xxx | -08:00, +05:30, +00:00 | 2 |
2392
+ * | | xxxx | -0800, +0530, +0000, +123456 | |
2393
+ * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
2394
+ * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
2395
+ * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
2396
+ * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
2397
+ * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
2398
+ * | Seconds timestamp | t | 512969520 | 7 |
2399
+ * | | tt | ... | 3,7 |
2400
+ * | Milliseconds timestamp | T | 512969520900 | 7 |
2401
+ * | | TT | ... | 3,7 |
2402
+ * | Long localized date | P | 04/29/1453 | 7 |
2403
+ * | | PP | Apr 29, 1453 | 7 |
2404
+ * | | PPP | April 29th, 1453 | 7 |
2405
+ * | | PPPP | Friday, April 29th, 1453 | 2,7 |
2406
+ * | Long localized time | p | 12:00 AM | 7 |
2407
+ * | | pp | 12:00:00 AM | 7 |
2408
+ * | | ppp | 12:00:00 AM GMT+2 | 7 |
2409
+ * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
2410
+ * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
2411
+ * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
2412
+ * | | PPPppp | April 29th, 1453 at ... | 7 |
2413
+ * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
2414
+ * Notes:
2415
+ * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
2416
+ * are the same as "stand-alone" units, but are different in some languages.
2417
+ * "Formatting" units are declined according to the rules of the language
2418
+ * in the context of a date. "Stand-alone" units are always nominative singular:
2419
+ *
2420
+ * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
2421
+ *
2422
+ * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
2423
+ *
2424
+ * 2. Any sequence of the identical letters is a pattern, unless it is escaped by
2425
+ * the single quote characters (see below).
2426
+ * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
2427
+ * the output will be the same as default pattern for this unit, usually
2428
+ * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
2429
+ * are marked with "2" in the last column of the table.
2430
+ *
2431
+ * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
2432
+ *
2433
+ * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
2434
+ *
2435
+ * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
2436
+ *
2437
+ * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
2438
+ *
2439
+ * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
2440
+ *
2441
+ * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
2442
+ * The output will be padded with zeros to match the length of the pattern.
2443
+ *
2444
+ * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
2445
+ *
2446
+ * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
2447
+ * These tokens represent the shortest form of the quarter.
2448
+ *
2449
+ * 5. The main difference between `y` and `u` patterns are B.C. years:
2450
+ *
2451
+ * | Year | `y` | `u` |
2452
+ * |------|-----|-----|
2453
+ * | AC 1 | 1 | 1 |
2454
+ * | BC 1 | 1 | 0 |
2455
+ * | BC 2 | 2 | -1 |
2456
+ *
2457
+ * Also `yy` always returns the last two digits of a year,
2458
+ * while `uu` pads single digit years to 2 characters and returns other years unchanged:
2459
+ *
2460
+ * | Year | `yy` | `uu` |
2461
+ * |------|------|------|
2462
+ * | 1 | 01 | 01 |
2463
+ * | 14 | 14 | 14 |
2464
+ * | 376 | 76 | 376 |
2465
+ * | 1453 | 53 | 1453 |
2466
+ *
2467
+ * The same difference is true for local and ISO week-numbering years (`Y` and `R`),
2468
+ * except local week-numbering years are dependent on `options.weekStartsOn`
2469
+ * and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear}
2470
+ * and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}).
2471
+ *
2472
+ * 6. Specific non-location timezones are currently unavailable in `date-fns`,
2473
+ * so right now these tokens fall back to GMT timezones.
2474
+ *
2475
+ * 7. These patterns are not in the Unicode Technical Standard #35:
2476
+ * - `i`: ISO day of week
2477
+ * - `I`: ISO week of year
2478
+ * - `R`: ISO week-numbering year
2479
+ * - `t`: seconds timestamp
2480
+ * - `T`: milliseconds timestamp
2481
+ * - `o`: ordinal number modifier
2482
+ * - `P`: long localized date
2483
+ * - `p`: long localized time
2484
+ *
2485
+ * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
2486
+ * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2487
+ *
2488
+ * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
2489
+ * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2490
+ *
2491
+ * @param {Date|Number} date - the original date
2492
+ * @param {String} format - the string of tokens
2493
+ * @param {Object} [options] - an object with options.
2494
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
2495
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
2496
+ * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is
2497
+ * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
2498
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2499
+ * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
2500
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2501
+ * @returns {String} the formatted date string
2502
+ * @throws {TypeError} 2 arguments required
2503
+ * @throws {RangeError} `date` must not be Invalid Date
2504
+ * @throws {RangeError} `options.locale` must contain `localize` property
2505
+ * @throws {RangeError} `options.locale` must contain `formatLong` property
2506
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
2507
+ * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
2508
+ * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2509
+ * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2510
+ * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2511
+ * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2512
+ * @throws {RangeError} format string contains an unescaped latin alphabet character
2513
+ *
2514
+ * @example
2515
+ * // Represent 11 February 2014 in middle-endian format:
2516
+ * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
2517
+ * //=> '02/11/2014'
2518
+ *
2519
+ * @example
2520
+ * // Represent 2 July 2014 in Esperanto:
2521
+ * import { eoLocale } from 'date-fns/locale/eo'
2522
+ * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
2523
+ * locale: eoLocale
2524
+ * })
2525
+ * //=> '2-a de julio 2014'
2526
+ *
2527
+ * @example
2528
+ * // Escape string by single quote characters:
2529
+ * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
2530
+ * //=> "3 o'clock"
2531
+ */
2532
+
2533
+ function format(dirtyDate, dirtyFormatStr, options) {
2534
+ var _ref, _options$locale, _ref2, _ref3, _ref4, _options$firstWeekCon, _options$locale2, _options$locale2$opti, _defaultOptions$local, _defaultOptions$local2, _ref5, _ref6, _ref7, _options$weekStartsOn, _options$locale3, _options$locale3$opti, _defaultOptions$local3, _defaultOptions$local4;
2535
+ requiredArgs(2, arguments);
2536
+ var formatStr = String(dirtyFormatStr);
2537
+ var defaultOptions = getDefaultOptions();
2538
+ var locale = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions.locale) !== null && _ref !== void 0 ? _ref : defaultLocale;
2539
+ var firstWeekContainsDate = toInteger((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1);
2540
+
2541
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
2542
+ if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
2543
+ throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
2544
+ }
2545
+ var weekStartsOn = toInteger((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0);
2546
+
2547
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
2548
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
2549
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
2550
+ }
2551
+ if (!locale.localize) {
2552
+ throw new RangeError('locale must contain localize property');
2553
+ }
2554
+ if (!locale.formatLong) {
2555
+ throw new RangeError('locale must contain formatLong property');
2556
+ }
2557
+ var originalDate = toDate(dirtyDate);
2558
+ if (!isValid(originalDate)) {
2559
+ throw new RangeError('Invalid time value');
2560
+ }
2561
+
2562
+ // Convert the date in system timezone to the same date in UTC+00:00 timezone.
2563
+ // This ensures that when UTC functions will be implemented, locales will be compatible with them.
2564
+ // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
2565
+ var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
2566
+ var utcDate = subMilliseconds(originalDate, timezoneOffset);
2567
+ var formatterOptions = {
2568
+ firstWeekContainsDate: firstWeekContainsDate,
2569
+ weekStartsOn: weekStartsOn,
2570
+ locale: locale,
2571
+ _originalDate: originalDate
2572
+ };
2573
+ var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {
2574
+ var firstCharacter = substring[0];
2575
+ if (firstCharacter === 'p' || firstCharacter === 'P') {
2576
+ var longFormatter = longFormatters$1[firstCharacter];
2577
+ return longFormatter(substring, locale.formatLong);
2578
+ }
2579
+ return substring;
2580
+ }).join('').match(formattingTokensRegExp).map(function (substring) {
2581
+ // Replace two single quote characters with one single quote character
2582
+ if (substring === "''") {
2583
+ return "'";
2584
+ }
2585
+ var firstCharacter = substring[0];
2586
+ if (firstCharacter === "'") {
2587
+ return cleanEscapedString(substring);
2588
+ }
2589
+ var formatter = formatters$1[firstCharacter];
2590
+ if (formatter) {
2591
+ if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(substring)) {
2592
+ throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
2593
+ }
2594
+ if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(substring)) {
2595
+ throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
2596
+ }
2597
+ return formatter(utcDate, substring, locale.localize, formatterOptions);
2598
+ }
2599
+ if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
2600
+ throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');
2601
+ }
2602
+ return substring;
2603
+ }).join('');
2604
+ return result;
2605
+ }
2606
+ function cleanEscapedString(input) {
2607
+ var matched = input.match(escapedStringRegExp);
2608
+ if (!matched) {
2609
+ return input;
2610
+ }
2611
+ return matched[1].replace(doubleQuoteRegExp, "'");
2612
+ }
2613
+
2614
+ var styles$3 = {"labelDate":"FeaturePost-module_labelDate__NXOgY","authorContent":"FeaturePost-module_authorContent__FEuRO","googlePlayButtonWrapper":"FeaturePost-module_googlePlayButtonWrapper__GI-ag","imgWrapper":"FeaturePost-module_imgWrapper__r6omd","featurePost":"FeaturePost-module_featurePost__9jY21","featurePostReversed":"FeaturePost-module_featurePostReversed__WQRXm","contentContainer":"FeaturePost-module_contentContainer__kdus7","col":"FeaturePost-module_col__eW8gY"};
249
2615
 
250
2616
  var Image = function (_a) {
251
2617
  var sources = _a.sources, props = __rest(_a, ["sources"]);
252
- return (React.createElement("div", { className: styles$1.imgWrapper },
2618
+ return (React.createElement("div", { className: styles$3.imgWrapper },
253
2619
  React.createElement(Image$2, __assign({ fadeOnLoad: true }, props), sources &&
254
2620
  sources.map(function (source) { return (React.createElement(Image$2.Source, __assign({ key: source.srcSet }, source))); }))));
255
2621
  };
256
2622
 
257
- var styles = {"featurePost":"FeaturePost-module_featurePost__PDoVH","featurePostReversed":"FeaturePost-module_featurePostReversed__tQZSX","col":"FeaturePost-module_col__x2s9L","labelDate":"FeaturePost-module_labelDate__eiCmw","contentContainer":"FeaturePost-module_contentContainer__dqJOS","authorContent":"FeaturePost-module_authorContent__QD4Nv","googlePlayButtonWrapper":"FeaturePost-module_googlePlayButtonWrapper__nGdyh"};
258
-
2623
+ /**
2624
+ * Use `FeaturePost` to direct traffic towards an article, case study, or product information page, or to a 3rd part App Store provider. Where the component links to an article page, the author attribution can be given here. The `FeaturePost` must be supported by an image, and in future, the component will support embedded video as well.
2625
+ * */
259
2626
  var FeaturePost = function (_a) {
260
2627
  var _b;
261
- var heading = _a.heading, label = _a.label, image = _a.image, content = _a.content, footer = _a.footer, _c = _a.isReverseOrder, isReverseOrder = _c === void 0 ? false : _c;
2628
+ var heading = _a.heading, _c = _a.headingLevel, headingLevel = _c === void 0 ? "2" : _c, label = _a.label, image = _a.image, content = _a.content, footer = _a.footer, _d = _a.isReverseOrder, isReverseOrder = _d === void 0 ? false : _d, props = __rest(_a, ["heading", "headingLevel", "label", "image", "content", "footer", "isReverseOrder"]);
262
2629
  var isMinWidthArcBreakpointM = useMediaQuery("(min-width: ".concat(SemSizeBreakpointsM, ")"));
263
- return (React.createElement("div", { "data-testid": "feature-post", className: classNames(styles.featurePost, (_b = {},
264
- _b[styles.featurePostReversed] = isReverseOrder,
265
- _b)) },
266
- React.createElement("div", { className: styles.col },
267
- React.createElement("div", { className: styles.contentContainer },
2630
+ return (React.createElement("div", __assign({ "data-testid": "feature-post", className: classNames(styles$3.featurePost, (_b = {},
2631
+ _b[styles$3.featurePostReversed] = isReverseOrder,
2632
+ _b)) }, filterDataAttrs(props)),
2633
+ React.createElement("div", { className: styles$3.col },
2634
+ React.createElement("div", { className: styles$3.contentContainer },
268
2635
  label && (React.createElement(Grid, { isGutterless: true, isFluid: true },
269
2636
  React.createElement(Grid.Row, { align: "baseline" },
270
2637
  React.createElement(Grid.Col, { xs: 12, m: "auto" },
271
2638
  React.createElement(Heading, { size: "xxs" }, label.text.toUpperCase())),
272
2639
  React.createElement(Grid.Col, { xs: 12, m: "auto" },
273
- React.createElement("div", { className: styles.labelDate },
274
- React.createElement(Text, { size: "xs", tone: "muted" }, label.date)))),
2640
+ React.createElement("div", { className: styles$3.labelDate },
2641
+ React.createElement(Text, { size: "xs", tone: "muted" }, isDate(label.date) ? (React.createElement("time", { dateTime: format(label.date, "yyyy-MM-dd") }, format(label.date, "LLLL d, yyyy"))) : (React.createElement("span", null, label.date)))))),
275
2642
  React.createElement(VerticalSpace, { size: "24" }))),
276
- React.createElement(Heading, { level: "2", size: "xl" }, heading),
2643
+ React.createElement(Heading, { level: headingLevel, size: "xl" }, heading),
277
2644
  !isMinWidthArcBreakpointM && (React.createElement("div", { "data-testid": "mobile-img" },
278
2645
  React.createElement(VerticalSpace, { size: "40" }),
279
2646
  React.createElement(Image, __assign({}, image)))),
@@ -282,14 +2649,7 @@ var FeaturePost = function (_a) {
282
2649
  (footer === null || footer === void 0 ? void 0 : footer.type) === "cta" && (React.createElement(React.Fragment, null,
283
2650
  footer.author && (React.createElement(React.Fragment, null,
284
2651
  React.createElement(VerticalSpace, { size: "24" }),
285
- React.createElement(Grid, { isFluid: true, isGutterless: true },
286
- React.createElement(Grid.Row, { align: "center" },
287
- React.createElement(Grid.Col, { xs: "auto" },
288
- React.createElement(Avatar, __assign({ size: "m" }, footer.author.avatar))),
289
- React.createElement(Grid.Col, null,
290
- React.createElement("div", { className: styles.authorContent },
291
- React.createElement(Heading, { size: "xs" }, footer.author.name),
292
- React.createElement(Text, { size: "s" }, footer.author.title))))))),
2652
+ React.createElement(Author, { name: footer.author.name, title: footer.author.title, avatar: footer.author.avatar }))),
293
2653
  React.createElement(VerticalSpace, { size: "40" }),
294
2654
  React.createElement(ButtonV2, __assign({ buttonStyle: "secondary" }, footer.button)))),
295
2655
  (footer === null || footer === void 0 ? void 0 : footer.type) === "appButton" && (React.createElement(React.Fragment, null,
@@ -299,12 +2659,117 @@ var FeaturePost = function (_a) {
299
2659
  footer.appStore && (React.createElement(Grid.Col, { xs: 12, s: "auto" },
300
2660
  React.createElement(AppButton, { type: "apple-app-store", screenReaderText: footer.appStore.screenReaderText, url: footer.appStore.url }))),
301
2661
  footer.googlePlay && (React.createElement(Grid.Col, { xs: 12, s: "auto" },
302
- React.createElement("div", { className: styles.googlePlayButtonWrapper },
2662
+ React.createElement("div", { className: styles$3.googlePlayButtonWrapper },
303
2663
  React.createElement(AppButton, { type: "google-play", screenReaderText: footer.googlePlay.screenReaderText, url: footer.googlePlay.url })))))))))),
304
- isMinWidthArcBreakpointM && (React.createElement("div", { className: styles.col },
305
- React.createElement("div", { "data-testid": "desktop-img", className: styles.imgContainer },
2664
+ isMinWidthArcBreakpointM && (React.createElement("div", { className: styles$3.col },
2665
+ React.createElement("div", { "data-testid": "desktop-img", className: styles$3.imgContainer },
306
2666
  React.createElement(Image, __assign({}, image)))))));
307
2667
  };
308
2668
 
309
- export { CopyLead, FeaturePost };
2669
+ var styles$2 = {"highlights":"Highlights-module_highlights__Hf7Zq","header":"Highlights-module_header__hIdDj","highlightItem":"Highlights-module_highlightItem__-N6le","headerContent":"Highlights-module_headerContent__rt-Oj","highlights2Column":"Highlights-module_highlights2Column__6qIuI","highlights3Column":"Highlights-module_highlights3Column__qsCMP"};
2670
+
2671
+ var HighlightItem = function (_a) {
2672
+ var icon = _a.icon, heading = _a.heading, text = _a.text, link = _a.link, isSmallIcon = _a.isSmallIcon;
2673
+ return (React.createElement("div", { "data-testid": "highlight-item-container", className: styles$2.highlightItem },
2674
+ icon && (React.createElement("div", { className: styles$2.Icon },
2675
+ React.createElement(Icon, { "data-testid": "highlight-icon", color: "brand", icon: icon, size: isSmallIcon ? 64 : 76 }))),
2676
+ React.createElement(VerticalSpace, { size: "16" }),
2677
+ React.createElement(Heading, { level: "3", size: "m" }, heading),
2678
+ React.createElement(VerticalSpace, { size: "16" }),
2679
+ React.createElement(Text, null, text),
2680
+ React.createElement(VerticalSpace, { size: "16" }),
2681
+ link && (React.createElement(Link, { href: link.url, id: link.url, onClick: function noRefCheck() { }, rel: "", size: "m", target: "_self", title: link.textLink }, link.textLink))));
2682
+ };
2683
+
2684
+ var HighlightList = function (_a) {
2685
+ var listItems = _a.listItems, columns = _a.columns, isSmallIcon = _a.isSmallIcon;
2686
+ return (React.createElement("div", { "data-testid": "highlights-list", className: classNames(styles$2.highlights, styles$2["highlights".concat(columns, "Column")]) }, listItems.map(function (_a) {
2687
+ var icon = _a.icon, heading = _a.heading, text = _a.text, link = _a.link;
2688
+ return (React.createElement(HighlightItem, { icon: icon, heading: heading, text: text, link: link, isSmallIcon: isSmallIcon }));
2689
+ })));
2690
+ };
2691
+
2692
+ /**
2693
+ * Use `Highlights` to give supporting information about a page or proposition. It can be used to call out key benefits in bullet points, or link to a supporting explanatory video. An optional CTA can be used to link to further information or trigger a sales or enquiry journey.
2694
+ */
2695
+ var HighlightHeader = function (_a) {
2696
+ var heading = _a.heading, headingLevel = _a.headingLevel, content = _a.content;
2697
+ return (React.createElement("div", { "data-testid": "highlights-header", className: styles$2.header },
2698
+ React.createElement(Heading, { level: headingLevel, size: "xl" }, heading),
2699
+ content && (React.createElement(React.Fragment, null,
2700
+ React.createElement(VerticalSpace, { size: "24" }),
2701
+ React.createElement("p", { className: styles$2.headerContent }, content)))));
2702
+ };
2703
+
2704
+ /**
2705
+ * Use `Highlights` to give supporting information about a page or proposition. It can be used to call out key benefits in bullet points, or link. Both two and three column options are available.
2706
+ */
2707
+ var Highlights = function (_a) {
2708
+ var heading = _a.heading, _b = _a.headingLevel, headingLevel = _b === void 0 ? "2" : _b, content = _a.content, listItems = _a.listItems, _c = _a.columns, columns = _c === void 0 ? "2" : _c;
2709
+ var isMaxWidthArcBreakpointXs = useMediaQuery("(max-width: 767px)");
2710
+ return (React.createElement("div", null,
2711
+ React.createElement(HighlightHeader, { heading: heading, headingLevel: headingLevel, content: content }),
2712
+ React.createElement(HighlightList, { "data-testid": "highlights-list-container", listItems: listItems, columns: columns, isSmallIcon: isMaxWidthArcBreakpointXs })));
2713
+ };
2714
+
2715
+ /**
2716
+ * Do not edit directly
2717
+ * Generated on Fri, 25 Oct 2024 08:31:13 GMT
2718
+ */
2719
+ var ArcSizeBreakpointsL = "1024px";
2720
+
2721
+ var styles$1 = {"PromoListing":"PromoListing-module_PromoListing__6ensv","headerContent":"PromoListing-module_headerContent__rMt1t","header":"PromoListing-module_header__PDGdP","promoListingContainer":"PromoListing-module_promoListingContainer__vwez-","cardGrid":"PromoListing-module_cardGrid__llf73","cardGrid2Columns":"PromoListing-module_cardGrid2Columns__qPLQk","cardGrid3Cards":"PromoListing-module_cardGrid3Cards__VKWMs","cardGrid5Cards":"PromoListing-module_cardGrid5Cards__ywl5k","cardGrid3Columns":"PromoListing-module_cardGrid3Columns__g0Xru","cardGrid4Cards":"PromoListing-module_cardGrid4Cards__5Bv5u","cardGrid2Cards":"PromoListing-module_cardGrid2Cards__wDc4S"};
2722
+
2723
+ var PromoListingHeader = function (_a) {
2724
+ var heading = _a.heading, headingLevel = _a.headingLevel, content = _a.content;
2725
+ return (React.createElement("div", { "data-testid": "PromoListing-header", className: styles$1.header },
2726
+ React.createElement(Heading, { level: headingLevel, size: "xl" }, heading),
2727
+ content && (React.createElement(React.Fragment, null,
2728
+ React.createElement(VerticalSpace, { size: "24" }),
2729
+ React.createElement("p", { className: styles$1.headerContent }, content)))));
2730
+ };
2731
+
2732
+ /**
2733
+ * Use `PromoListing` to give supporting information about a page or proposition in the form of the card components (`ImpactCard`, `InformationCard`, `MediaCard` and `TypographyCard`).
2734
+ */
2735
+ var PromoListing = function (_a) {
2736
+ var heading = _a.heading, content = _a.content, isCarousel = _a.isCarousel, cards = _a.cards, _b = _a.headingLevel, headingLevel = _b === void 0 ? "2" : _b, _c = _a.columns, columns = _c === void 0 ? "2" : _c;
2737
+ var isMinWidthArcBreakpointL = useMediaQuery("(min-width: ".concat(ArcSizeBreakpointsL, ")"));
2738
+ var columnCount = isMinWidthArcBreakpointL ? columns : 2;
2739
+ var getCard = function (card) { return (React.createElement(React.Fragment, null,
2740
+ card.type === "media-card" && React.createElement(MediaCard, __assign({}, card)),
2741
+ card.type === "impact-card" && React.createElement(ImpactCard, __assign({}, card)),
2742
+ card.type === "information-card" && React.createElement(InformationCard, __assign({}, card)),
2743
+ card.type === "typography-card" && React.createElement(TypographyCard, __assign({}, card)))); };
2744
+ return (React.createElement("div", { className: styles$1.PromoListing },
2745
+ React.createElement(PromoListingHeader, { heading: heading, headingLevel: headingLevel, content: content }),
2746
+ isCarousel && !isMinWidthArcBreakpointL ? (React.createElement(Carousel, { itemsPerSlide: 1, responsive: {
2747
+ s: {
2748
+ slideAmount: 1,
2749
+ partialVisible: false,
2750
+ itemsPerSlide: 2
2751
+ },
2752
+ m: {
2753
+ slideAmount: 1,
2754
+ partialVisible: true,
2755
+ itemsPerSlide: 2
2756
+ }
2757
+ } }, cards === null || cards === void 0 ? void 0 : cards.map(function (card) { return getCard(card); }))) : (React.createElement("div", { className: classNames(styles$1.cardGrid, styles$1["cardGrid".concat(columnCount, "Columns")], styles$1["cardGrid".concat(cards.length, "Cards")]) }, cards === null || cards === void 0 ? void 0 : cards.map(function (card, index) { return (React.createElement("div", { "data-testid": "promoList-card".concat(index), className: classNames(styles$1.promoListingContainer), key: index }, getCard(card))); })))));
2758
+ };
2759
+
2760
+ var styles = {"blockQuote":"Quote-module_blockQuote__STj-z","quoteContent":"Quote-module_quoteContent__kWc51","quoteDefault":"Quote-module_quoteDefault__tU5db","quoteSecondary":"Quote-module_quoteSecondary__3Rk3f","quoteIcon":"Quote-module_quoteIcon__HK1TV"};
2761
+
2762
+ /**
2763
+ * Use `Quote` where a quote or testimonial from an existing customer or stakeholder would help build trust and credibility with potential new customers. It's commonly used on product pages where customers would learn about a product or service that we offer.*/
2764
+ var Quote = function (_a) {
2765
+ var author = _a.author, _b = _a.styling, styling = _b === void 0 ? "Default" : _b, content = _a.content, citeUrl = _a.citeUrl, props = __rest(_a, ["author", "styling", "content", "citeUrl"]);
2766
+ return (React.createElement("div", __assign({ className: "community-component--quote", "data-testid": "quote-test" }, filterDataAttrs(props)),
2767
+ React.createElement("blockquote", { "data-testid": "style-test", className: classNames(styles.blockQuote, styles["quote".concat(styling)]), cite: citeUrl },
2768
+ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 100 77", className: styles.quoteIcon, "aria-hidden": "true" },
2769
+ React.createElement("path", { d: "M21.8085 76.4706C15.9574 76.4706 10.8156 74.2732 6.38298 69.8783C2.12766 65.4834 0 58.979 0 50.3651C0 40.5206 3.10284 31.1156 9.30851 22.1501C15.6915 13.1846 25.3546 5.80122 38.2979 0L44.1489 11.3387C37.4113 14.3272 31.7376 18.0189 27.1277 22.4138C22.5177 26.6329 19.6809 31.4672 18.617 36.9168C19.8582 36.741 21.0106 36.6531 22.0745 36.6531C27.7482 36.6531 32.4468 38.499 36.1702 42.1907C40.0709 45.8824 42.0213 50.7167 42.0213 56.6937C42.0213 62.4949 39.9823 67.2414 35.9043 70.9331C32.0035 74.6247 27.305 76.4706 21.8085 76.4706ZM77.6596 76.4706C71.8085 76.4706 66.6667 74.2732 62.234 69.8783C57.9787 65.4834 55.8511 58.979 55.8511 50.3651C55.8511 40.5206 58.9539 31.1156 65.1596 22.1501C71.5425 13.1846 81.2057 5.80122 94.1489 0L100 11.3387C93.2624 14.3272 87.5886 18.0189 82.9787 22.4138C78.3688 26.6329 75.5319 31.4672 74.4681 36.9168C75.7092 36.741 76.8617 36.6531 77.9255 36.6531C83.5993 36.6531 88.2979 38.499 92.0213 42.1907C95.922 45.8824 97.8723 50.7167 97.8723 56.6937C97.8723 62.4949 95.8333 67.2414 91.7553 70.9331C87.8546 74.6247 83.156 76.4706 77.6596 76.4706Z" })),
2770
+ React.createElement("p", { className: styles.quoteContent }, content)),
2771
+ author && (React.createElement(Author, { name: author.name, title: author.title, avatar: author.avatar }))));
2772
+ };
2773
+
2774
+ export { Accordion, Author, CopyLead, FeaturePost, Highlights, PromoListing, Quote };
310
2775
  //# sourceMappingURL=index.es.js.map