@arc-ui/community-components 0.1.0

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