hmrc-frontend 5.62.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/govuk-prototype-kit.config.json +1 -1
- package/hmrc/VERSION.txt +1 -1
- package/hmrc/{accessible-autocomplete-5.62.0.css → accessible-autocomplete-6.0.0.css} +2 -2
- package/hmrc/{accessible-autocomplete-5.62.0.js → accessible-autocomplete-6.0.0.js} +1 -16
- package/hmrc/accessible-autocomplete.js +1 -2
- package/hmrc/accessible-autocomplete.scss +3 -3
- package/hmrc/all-govuk-and-hmrc.js +2 -5
- package/hmrc/all-govuk-and-hmrc.scss +1 -1
- package/hmrc/all.js +81 -546
- package/hmrc/all.scss +0 -1
- package/hmrc/components/accessible-autocomplete/template.njk +3 -3
- package/hmrc/components/account-menu/_account-menu.scss +4 -24
- package/hmrc/components/account-menu/account-menu.js +0 -1
- package/hmrc/components/add-to-a-list/_add-to-a-list.scss +4 -4
- package/hmrc/components/add-to-a-list/template.njk +2 -2
- package/hmrc/components/back-link-helper/_back-link-helper.scss +4 -0
- package/hmrc/components/banner/template.njk +0 -5
- package/hmrc/components/character-count/template.njk +1 -1
- package/hmrc/components/currency-input/_currency-input.scss +4 -4
- package/hmrc/components/currency-input/template.njk +3 -3
- package/hmrc/components/header/template.njk +19 -34
- package/hmrc/components/internal-header/README.md +1 -1
- package/hmrc/components/internal-header/template.njk +14 -18
- package/hmrc/components/list-with-actions/_list-with-actions.scss +3 -3
- package/hmrc/components/timeline/_timeline.scss +1 -1
- package/hmrc/components/timeout-dialog/_timeout-dialog.scss +4 -9
- package/hmrc/components/timeout-dialog/dialog.js +1 -2
- package/hmrc/components/timeout-dialog/timeout-dialog.js +0 -5
- package/hmrc/components/timeout-dialog/utils.js +3 -4
- package/hmrc/components/timeout-dialog/validate-input.js +0 -2
- package/hmrc/components/user-research-banner/_user-research-banner.scss +3 -3
- package/hmrc/govuk/images/favicon.svg +4 -0
- package/hmrc/govuk/images/govuk-icon-180.png +0 -0
- package/hmrc/govuk/images/govuk-icon-192.png +0 -0
- package/hmrc/govuk/images/govuk-icon-512.png +0 -0
- package/hmrc/govuk/images/govuk-icon-mask.svg +3 -0
- package/hmrc/hmrc-frontend-6.0.0.min.css +4 -0
- package/hmrc/hmrc-frontend-6.0.0.min.js +3 -0
- package/hmrc/maps/accessible-autocomplete-6.0.0.css.map +1 -0
- package/hmrc/maps/hmrc-frontend-6.0.0.min.css.map +1 -0
- package/hmrc/maps/hmrc-frontend-6.0.0.min.js.map +1 -0
- package/package.json +2 -2
- package/hmrc/all-govuk-and-hmrc-ie8.scss +0 -3
- package/hmrc/all-ie8.scss +0 -6
- package/hmrc/common.js +0 -17
- package/hmrc/govuk/images/govuk-apple-touch-icon-152x152.png +0 -0
- package/hmrc/govuk/images/govuk-apple-touch-icon-167x167.png +0 -0
- package/hmrc/govuk/images/govuk-apple-touch-icon-180x180.png +0 -0
- package/hmrc/govuk/images/govuk-apple-touch-icon.png +0 -0
- package/hmrc/govuk/images/govuk-logotype-crown.png +0 -0
- package/hmrc/govuk/images/govuk-mask-icon.svg +0 -7
- package/hmrc/hmrc-frontend-5.62.0.min.css +0 -4
- package/hmrc/hmrc-frontend-5.62.0.min.js +0 -3
- package/hmrc/hmrc-frontend-ie8-5.62.0.min.css +0 -2
- package/hmrc/maps/accessible-autocomplete-5.62.0.css.map +0 -1
- package/hmrc/maps/hmrc-frontend-5.62.0.min.css.map +0 -1
- package/hmrc/maps/hmrc-frontend-5.62.0.min.js.map +0 -1
- package/hmrc/maps/hmrc-frontend-ie8-5.62.0.min.css.map +0 -1
package/hmrc/all.js
CHANGED
|
@@ -4,290 +4,6 @@
|
|
|
4
4
|
(global = global || self, global.HMRCFrontend = factory());
|
|
5
5
|
}(this, function () { 'use strict';
|
|
6
6
|
|
|
7
|
-
function ownKeys(object, enumerableOnly) {
|
|
8
|
-
var keys = Object.keys(object);
|
|
9
|
-
if (Object.getOwnPropertySymbols) {
|
|
10
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
11
|
-
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
12
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
13
|
-
})), keys.push.apply(keys, symbols);
|
|
14
|
-
}
|
|
15
|
-
return keys;
|
|
16
|
-
}
|
|
17
|
-
function _objectSpread2(target) {
|
|
18
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
19
|
-
var source = null != arguments[i] ? arguments[i] : {};
|
|
20
|
-
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
21
|
-
_defineProperty(target, key, source[key]);
|
|
22
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
23
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
return target;
|
|
27
|
-
}
|
|
28
|
-
function _typeof(obj) {
|
|
29
|
-
"@babel/helpers - typeof";
|
|
30
|
-
|
|
31
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
32
|
-
return typeof obj;
|
|
33
|
-
} : function (obj) {
|
|
34
|
-
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
35
|
-
}, _typeof(obj);
|
|
36
|
-
}
|
|
37
|
-
function _classCallCheck(instance, Constructor) {
|
|
38
|
-
if (!(instance instanceof Constructor)) {
|
|
39
|
-
throw new TypeError("Cannot call a class as a function");
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
function _defineProperties(target, props) {
|
|
43
|
-
for (var i = 0; i < props.length; i++) {
|
|
44
|
-
var descriptor = props[i];
|
|
45
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
46
|
-
descriptor.configurable = true;
|
|
47
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
48
|
-
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
|
52
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
53
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
54
|
-
Object.defineProperty(Constructor, "prototype", {
|
|
55
|
-
writable: false
|
|
56
|
-
});
|
|
57
|
-
return Constructor;
|
|
58
|
-
}
|
|
59
|
-
function _defineProperty(obj, key, value) {
|
|
60
|
-
key = _toPropertyKey(key);
|
|
61
|
-
if (key in obj) {
|
|
62
|
-
Object.defineProperty(obj, key, {
|
|
63
|
-
value: value,
|
|
64
|
-
enumerable: true,
|
|
65
|
-
configurable: true,
|
|
66
|
-
writable: true
|
|
67
|
-
});
|
|
68
|
-
} else {
|
|
69
|
-
obj[key] = value;
|
|
70
|
-
}
|
|
71
|
-
return obj;
|
|
72
|
-
}
|
|
73
|
-
function _toPrimitive(input, hint) {
|
|
74
|
-
if (typeof input !== "object" || input === null) return input;
|
|
75
|
-
var prim = input[Symbol.toPrimitive];
|
|
76
|
-
if (prim !== undefined) {
|
|
77
|
-
var res = prim.call(input, hint || "default");
|
|
78
|
-
if (typeof res !== "object") return res;
|
|
79
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
80
|
-
}
|
|
81
|
-
return (hint === "string" ? String : Number)(input);
|
|
82
|
-
}
|
|
83
|
-
function _toPropertyKey(arg) {
|
|
84
|
-
var key = _toPrimitive(arg, "string");
|
|
85
|
-
return typeof key === "symbol" ? key : String(key);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
(function (undefined$1) {
|
|
89
|
-
// Detection from https://github.com/Financial-Times/polyfill-library/blob/master/polyfills/Object/getOwnPropertyDescriptor/detect.js
|
|
90
|
-
var detect = 'getOwnPropertyDescriptor' in Object && typeof Object.getOwnPropertyDescriptor === 'function' && function () {
|
|
91
|
-
try {
|
|
92
|
-
var object = {};
|
|
93
|
-
object.test = 0;
|
|
94
|
-
return Object.getOwnPropertyDescriptor(object, "test").value === 0;
|
|
95
|
-
} catch (exception) {
|
|
96
|
-
return false;
|
|
97
|
-
}
|
|
98
|
-
}();
|
|
99
|
-
if (detect) return;
|
|
100
|
-
|
|
101
|
-
// Polyfill from https://cdn.polyfill.io/v2/polyfill.js?features=Object.getOwnPropertyDescriptor&flags=always
|
|
102
|
-
(function () {
|
|
103
|
-
var call = Function.prototype.call;
|
|
104
|
-
var prototypeOfObject = Object.prototype;
|
|
105
|
-
var owns = call.bind(prototypeOfObject.hasOwnProperty);
|
|
106
|
-
var lookupGetter;
|
|
107
|
-
var lookupSetter;
|
|
108
|
-
var supportsAccessors;
|
|
109
|
-
if (supportsAccessors = owns(prototypeOfObject, "__defineGetter__")) {
|
|
110
|
-
lookupGetter = call.bind(prototypeOfObject.__lookupGetter__);
|
|
111
|
-
lookupSetter = call.bind(prototypeOfObject.__lookupSetter__);
|
|
112
|
-
}
|
|
113
|
-
function doesGetOwnPropertyDescriptorWork(object) {
|
|
114
|
-
try {
|
|
115
|
-
object.sentinel = 0;
|
|
116
|
-
return Object.getOwnPropertyDescriptor(object, "sentinel").value === 0;
|
|
117
|
-
} catch (exception) {
|
|
118
|
-
// returns falsy
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
// check whether getOwnPropertyDescriptor works if it's given. Otherwise,
|
|
122
|
-
// shim partially.
|
|
123
|
-
if (Object.defineProperty) {
|
|
124
|
-
var getOwnPropertyDescriptorWorksOnObject = doesGetOwnPropertyDescriptorWork({});
|
|
125
|
-
var getOwnPropertyDescriptorWorksOnDom = typeof document == "undefined" || doesGetOwnPropertyDescriptorWork(document.createElement("div"));
|
|
126
|
-
if (!getOwnPropertyDescriptorWorksOnDom || !getOwnPropertyDescriptorWorksOnObject) {
|
|
127
|
-
var getOwnPropertyDescriptorFallback = Object.getOwnPropertyDescriptor;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
if (!Object.getOwnPropertyDescriptor || getOwnPropertyDescriptorFallback) {
|
|
131
|
-
var ERR_NON_OBJECT = "Object.getOwnPropertyDescriptor called on a non-object: ";
|
|
132
|
-
Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) {
|
|
133
|
-
if (_typeof(object) != "object" && typeof object != "function" || object === null) {
|
|
134
|
-
throw new TypeError(ERR_NON_OBJECT + object);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// make a valiant attempt to use the real getOwnPropertyDescriptor
|
|
138
|
-
// for I8's DOM elements.
|
|
139
|
-
if (getOwnPropertyDescriptorFallback) {
|
|
140
|
-
try {
|
|
141
|
-
return getOwnPropertyDescriptorFallback.call(Object, object, property);
|
|
142
|
-
} catch (exception) {
|
|
143
|
-
// try the shim if the real one doesn't work
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
// If object does not owns property return undefined immediately.
|
|
148
|
-
if (!owns(object, property)) {
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// If object has a property then it's for sure both `enumerable` and
|
|
153
|
-
// `configurable`.
|
|
154
|
-
var descriptor = {
|
|
155
|
-
enumerable: true,
|
|
156
|
-
configurable: true
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
// If JS engine supports accessor properties then property may be a
|
|
160
|
-
// getter or setter.
|
|
161
|
-
if (supportsAccessors) {
|
|
162
|
-
// Unfortunately `__lookupGetter__` will return a getter even
|
|
163
|
-
// if object has own non getter property along with a same named
|
|
164
|
-
// inherited getter. To avoid misbehavior we temporary remove
|
|
165
|
-
// `__proto__` so that `__lookupGetter__` will return getter only
|
|
166
|
-
// if it's owned by an object.
|
|
167
|
-
var prototype = object.__proto__;
|
|
168
|
-
object.__proto__ = prototypeOfObject;
|
|
169
|
-
var getter = lookupGetter(object, property);
|
|
170
|
-
var setter = lookupSetter(object, property);
|
|
171
|
-
|
|
172
|
-
// Once we have getter and setter we can put values back.
|
|
173
|
-
object.__proto__ = prototype;
|
|
174
|
-
if (getter || setter) {
|
|
175
|
-
if (getter) {
|
|
176
|
-
descriptor.get = getter;
|
|
177
|
-
}
|
|
178
|
-
if (setter) {
|
|
179
|
-
descriptor.set = setter;
|
|
180
|
-
}
|
|
181
|
-
// If it was accessor property we're done and return here
|
|
182
|
-
// in order to avoid adding `value` to the descriptor.
|
|
183
|
-
return descriptor;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
// If we got this far we know that object has an own property that is
|
|
188
|
-
// not an accessor so we set it as a value and return descriptor.
|
|
189
|
-
descriptor.value = object[property];
|
|
190
|
-
descriptor.writable = true;
|
|
191
|
-
return descriptor;
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
})();
|
|
195
|
-
}).call('object' === (typeof window === "undefined" ? "undefined" : _typeof(window)) && window || 'object' === (typeof self === "undefined" ? "undefined" : _typeof(self)) && self || 'object' === (typeof global === "undefined" ? "undefined" : _typeof(global)) && global || {});
|
|
196
|
-
|
|
197
|
-
(function (undefined$1) {
|
|
198
|
-
// Detection from https://github.com/Financial-Times/polyfill-library/blob/master/polyfills/document/querySelector/detect.js
|
|
199
|
-
var detect = 'document' in this && 'querySelector' in this.document;
|
|
200
|
-
if (detect) return;
|
|
201
|
-
|
|
202
|
-
// Polyfill from https://cdn.polyfill.io/v2/polyfill.js?features=Event&flags=always
|
|
203
|
-
(function () {
|
|
204
|
-
var head = document.getElementsByTagName('head')[0];
|
|
205
|
-
function getElementsByQuery(node, selector, one) {
|
|
206
|
-
var generator = document.createElement('div'),
|
|
207
|
-
id = 'qsa' + String(Math.random()).slice(3),
|
|
208
|
-
style,
|
|
209
|
-
elements;
|
|
210
|
-
generator.innerHTML = 'x<style>' + selector + '{qsa:' + id + ';}';
|
|
211
|
-
style = head.appendChild(generator.lastChild);
|
|
212
|
-
elements = getElements(node, selector, one, id);
|
|
213
|
-
head.removeChild(style);
|
|
214
|
-
return one ? elements[0] : elements;
|
|
215
|
-
}
|
|
216
|
-
function getElements(node, selector, one, id) {
|
|
217
|
-
var validNode = /1|9/.test(node.nodeType),
|
|
218
|
-
childNodes = node.childNodes,
|
|
219
|
-
elements = [],
|
|
220
|
-
index = -1,
|
|
221
|
-
childNode;
|
|
222
|
-
if (validNode && node.currentStyle && node.currentStyle.qsa === id) {
|
|
223
|
-
if (elements.push(node) && one) {
|
|
224
|
-
return elements;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
while (childNode = childNodes[++index]) {
|
|
228
|
-
elements = elements.concat(getElements(childNode, selector, one, id));
|
|
229
|
-
if (one && elements.length) {
|
|
230
|
-
return elements;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
return elements;
|
|
234
|
-
}
|
|
235
|
-
Document.prototype.querySelector = Element.prototype.querySelector = function querySelectorAll(selector) {
|
|
236
|
-
return getElementsByQuery(this, selector, true);
|
|
237
|
-
};
|
|
238
|
-
Document.prototype.querySelectorAll = Element.prototype.querySelectorAll = function querySelectorAll(selector) {
|
|
239
|
-
return getElementsByQuery(this, selector, false);
|
|
240
|
-
};
|
|
241
|
-
})();
|
|
242
|
-
}).call('object' === (typeof window === "undefined" ? "undefined" : _typeof(window)) && window || 'object' === (typeof self === "undefined" ? "undefined" : _typeof(self)) && self || 'object' === (typeof global === "undefined" ? "undefined" : _typeof(global)) && global || {});
|
|
243
|
-
|
|
244
|
-
(function (undefined$1) {
|
|
245
|
-
// Detection from https://github.com/Financial-Times/polyfill-library/blob/master/polyfills/Element/prototype/dataset/detect.js
|
|
246
|
-
(function () {
|
|
247
|
-
if (!document.documentElement.dataset) {
|
|
248
|
-
return false;
|
|
249
|
-
}
|
|
250
|
-
var el = document.createElement('div');
|
|
251
|
-
el.setAttribute("data-a-b", "c");
|
|
252
|
-
return el.dataset && el.dataset.aB == "c";
|
|
253
|
-
})();
|
|
254
|
-
|
|
255
|
-
// Polyfill from https://cdn.polyfill.io/v2/polyfill.js?features=Element.prototype.dataset&flags=always
|
|
256
|
-
Object.defineProperty(Element.prototype, 'dataset', {
|
|
257
|
-
get: function get() {
|
|
258
|
-
var element = this;
|
|
259
|
-
var attributes = this.attributes;
|
|
260
|
-
var map = {};
|
|
261
|
-
for (var i = 0; i < attributes.length; i++) {
|
|
262
|
-
var attribute = attributes[i];
|
|
263
|
-
if (attribute && attribute.name && /^data-\w[\w\-]*$/.test(attribute.name)) {
|
|
264
|
-
var name = attribute.name;
|
|
265
|
-
var value = attribute.value;
|
|
266
|
-
var propName = name.substr(5).replace(/-./g, function (prop) {
|
|
267
|
-
return prop.charAt(1).toUpperCase();
|
|
268
|
-
});
|
|
269
|
-
Object.defineProperty(map, propName, {
|
|
270
|
-
enumerable: this.enumerable,
|
|
271
|
-
get: function () {
|
|
272
|
-
return this.value;
|
|
273
|
-
}.bind({
|
|
274
|
-
value: value || ''
|
|
275
|
-
}),
|
|
276
|
-
set: function setter(name, value) {
|
|
277
|
-
if (typeof value !== 'undefined') {
|
|
278
|
-
this.setAttribute(name, value);
|
|
279
|
-
} else {
|
|
280
|
-
this.removeAttribute(name);
|
|
281
|
-
}
|
|
282
|
-
}.bind(element, name)
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
return map;
|
|
287
|
-
}
|
|
288
|
-
});
|
|
289
|
-
}).call('object' === (typeof window === "undefined" ? "undefined" : _typeof(window)) && window || 'object' === (typeof self === "undefined" ? "undefined" : _typeof(self)) && self || 'object' === (typeof global === "undefined" ? "undefined" : _typeof(global)) && global || {});
|
|
290
|
-
|
|
291
7
|
// Returns a function, that, as long as it continues to be invoked, will not
|
|
292
8
|
// be triggered. The function will be called after it stops being called for
|
|
293
9
|
// N milliseconds. If `immediate` is passed, trigger the function on the
|
|
@@ -427,266 +143,90 @@
|
|
|
427
143
|
}
|
|
428
144
|
};
|
|
429
145
|
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
}
|
|
454
|
-
};
|
|
455
|
-
})();
|
|
456
|
-
}).call('object' === (typeof window === "undefined" ? "undefined" : _typeof(window)) && window || 'object' === (typeof self === "undefined" ? "undefined" : _typeof(self)) && self || 'object' === (typeof global === "undefined" ? "undefined" : _typeof(global)) && global || {});
|
|
457
|
-
|
|
458
|
-
(function (undefined$1) {
|
|
459
|
-
// Detection from https://github.com/Financial-Times/polyfill-library/blob/987630a085e29226da16b5dc542042c687560191/polyfills/Object/keys/detect.js
|
|
460
|
-
var detect = 'keys' in Object && function () {
|
|
461
|
-
// Safari 5.0 bug where Object.keys doesn't work with arguments
|
|
462
|
-
return Object.keys(arguments).length === 2;
|
|
463
|
-
}(1, 2) && function () {
|
|
464
|
-
try {
|
|
465
|
-
return true;
|
|
466
|
-
} catch (e) {
|
|
467
|
-
return false;
|
|
468
|
-
}
|
|
469
|
-
}();
|
|
470
|
-
if (detect) return;
|
|
471
|
-
|
|
472
|
-
// Polyfill from https://cdn.polyfill.io/v2/polyfill.js?features=Object.assign&flags=always
|
|
473
|
-
Object.keys = function () {
|
|
474
|
-
|
|
475
|
-
// modified from https://github.com/es-shims/object-keys
|
|
476
|
-
var has = Object.prototype.hasOwnProperty;
|
|
477
|
-
var toStr = Object.prototype.toString;
|
|
478
|
-
var isEnumerable = Object.prototype.propertyIsEnumerable;
|
|
479
|
-
var hasDontEnumBug = !isEnumerable.call({
|
|
480
|
-
toString: null
|
|
481
|
-
}, "toString");
|
|
482
|
-
var hasProtoEnumBug = isEnumerable.call(function () {}, "prototype");
|
|
483
|
-
var dontEnums = ["toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor"];
|
|
484
|
-
var equalsConstructorPrototype = function equalsConstructorPrototype(o) {
|
|
485
|
-
var ctor = o.constructor;
|
|
486
|
-
return ctor && ctor.prototype === o;
|
|
487
|
-
};
|
|
488
|
-
var excludedKeys = {
|
|
489
|
-
$console: true,
|
|
490
|
-
$external: true,
|
|
491
|
-
$frame: true,
|
|
492
|
-
$frameElement: true,
|
|
493
|
-
$frames: true,
|
|
494
|
-
$innerHeight: true,
|
|
495
|
-
$innerWidth: true,
|
|
496
|
-
$outerHeight: true,
|
|
497
|
-
$outerWidth: true,
|
|
498
|
-
$pageXOffset: true,
|
|
499
|
-
$pageYOffset: true,
|
|
500
|
-
$parent: true,
|
|
501
|
-
$scrollLeft: true,
|
|
502
|
-
$scrollTop: true,
|
|
503
|
-
$scrollX: true,
|
|
504
|
-
$scrollY: true,
|
|
505
|
-
$self: true,
|
|
506
|
-
$webkitIndexedDB: true,
|
|
507
|
-
$webkitStorageInfo: true,
|
|
508
|
-
$window: true
|
|
509
|
-
};
|
|
510
|
-
var hasAutomationEqualityBug = function () {
|
|
511
|
-
/* global window */
|
|
512
|
-
if (typeof window === "undefined") {
|
|
513
|
-
return false;
|
|
514
|
-
}
|
|
515
|
-
for (var k in window) {
|
|
516
|
-
try {
|
|
517
|
-
if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && _typeof(window[k]) === 'object') {
|
|
518
|
-
try {
|
|
519
|
-
equalsConstructorPrototype(window[k]);
|
|
520
|
-
} catch (e) {
|
|
521
|
-
return true;
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
} catch (e) {
|
|
525
|
-
return true;
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
return false;
|
|
529
|
-
}();
|
|
530
|
-
var equalsConstructorPrototypeIfNotBuggy = function equalsConstructorPrototypeIfNotBuggy(o) {
|
|
531
|
-
/* global window */
|
|
532
|
-
if (typeof window === "undefined" || !hasAutomationEqualityBug) {
|
|
533
|
-
return equalsConstructorPrototype(o);
|
|
534
|
-
}
|
|
535
|
-
try {
|
|
536
|
-
return equalsConstructorPrototype(o);
|
|
537
|
-
} catch (e) {
|
|
538
|
-
return false;
|
|
539
|
-
}
|
|
540
|
-
};
|
|
541
|
-
function isArgumentsObject(value) {
|
|
542
|
-
var str = toStr.call(value);
|
|
543
|
-
var isArgs = str === "[object Arguments]";
|
|
544
|
-
if (!isArgs) {
|
|
545
|
-
isArgs = str !== "[object Array]" && value !== null && _typeof(value) === "object" && typeof value.length === "number" && value.length >= 0 && toStr.call(value.callee) === "[object Function]";
|
|
546
|
-
}
|
|
547
|
-
return isArgs;
|
|
548
|
-
}
|
|
549
|
-
return function keys(object) {
|
|
550
|
-
var isFunction = toStr.call(object) === "[object Function]";
|
|
551
|
-
var isArguments = isArgumentsObject(object);
|
|
552
|
-
var isString = toStr.call(object) === "[object String]";
|
|
553
|
-
var theKeys = [];
|
|
554
|
-
if (object === undefined$1 || object === null) {
|
|
555
|
-
throw new TypeError("Cannot convert undefined or null to object");
|
|
556
|
-
}
|
|
557
|
-
var skipProto = hasProtoEnumBug && isFunction;
|
|
558
|
-
if (isString && object.length > 0 && !has.call(object, 0)) {
|
|
559
|
-
for (var i = 0; i < object.length; ++i) {
|
|
560
|
-
theKeys.push(String(i));
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
if (isArguments && object.length > 0) {
|
|
564
|
-
for (var j = 0; j < object.length; ++j) {
|
|
565
|
-
theKeys.push(String(j));
|
|
566
|
-
}
|
|
567
|
-
} else {
|
|
568
|
-
for (var name in object) {
|
|
569
|
-
if (!(skipProto && name === "prototype") && has.call(object, name)) {
|
|
570
|
-
theKeys.push(String(name));
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
if (hasDontEnumBug) {
|
|
575
|
-
var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
|
|
576
|
-
for (var k = 0; k < dontEnums.length; ++k) {
|
|
577
|
-
if (!(skipConstructor && dontEnums[k] === "constructor") && has.call(object, dontEnums[k])) {
|
|
578
|
-
theKeys.push(dontEnums[k]);
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
return theKeys;
|
|
583
|
-
};
|
|
584
|
-
}();
|
|
585
|
-
}).call("object" === (typeof window === "undefined" ? "undefined" : _typeof(window)) && window || "object" === (typeof self === "undefined" ? "undefined" : _typeof(self)) && self || "object" === (typeof global === "undefined" ? "undefined" : _typeof(global)) && global || {});
|
|
586
|
-
|
|
587
|
-
(function (undefined$1) {
|
|
588
|
-
// Detection from https://github.com/Financial-Times/polyfill-library/blob/987630a085e29226da16b5dc542042c687560191/polyfills/Object/assign/detect.js
|
|
589
|
-
var detect = ('assign' in Object);
|
|
590
|
-
if (detect) return;
|
|
146
|
+
function ownKeys(object, enumerableOnly) {
|
|
147
|
+
var keys = Object.keys(object);
|
|
148
|
+
if (Object.getOwnPropertySymbols) {
|
|
149
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
150
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
151
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
152
|
+
})), keys.push.apply(keys, symbols);
|
|
153
|
+
}
|
|
154
|
+
return keys;
|
|
155
|
+
}
|
|
156
|
+
function _objectSpread2(target) {
|
|
157
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
158
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
159
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
160
|
+
_defineProperty(target, key, source[key]);
|
|
161
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
162
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
return target;
|
|
166
|
+
}
|
|
167
|
+
function _typeof(obj) {
|
|
168
|
+
"@babel/helpers - typeof";
|
|
591
169
|
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
function
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
170
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
171
|
+
return typeof obj;
|
|
172
|
+
} : function (obj) {
|
|
173
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
174
|
+
}, _typeof(obj);
|
|
175
|
+
}
|
|
176
|
+
function _classCallCheck(instance, Constructor) {
|
|
177
|
+
if (!(instance instanceof Constructor)) {
|
|
178
|
+
throw new TypeError("Cannot call a class as a function");
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
function _defineProperties(target, props) {
|
|
182
|
+
for (var i = 0; i < props.length; i++) {
|
|
183
|
+
var descriptor = props[i];
|
|
184
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
185
|
+
descriptor.configurable = true;
|
|
186
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
187
|
+
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
191
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
192
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
193
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
194
|
+
writable: false
|
|
195
|
+
});
|
|
196
|
+
return Constructor;
|
|
197
|
+
}
|
|
198
|
+
function _defineProperty(obj, key, value) {
|
|
199
|
+
key = _toPropertyKey(key);
|
|
200
|
+
if (key in obj) {
|
|
201
|
+
Object.defineProperty(obj, key, {
|
|
202
|
+
value: value,
|
|
203
|
+
enumerable: true,
|
|
603
204
|
configurable: true,
|
|
604
|
-
writable: true
|
|
605
|
-
value: function assign(target, source) {
|
|
606
|
-
// eslint-disable-line no-unused-vars
|
|
607
|
-
|
|
608
|
-
// 1. Let to be ? ToObject(target).
|
|
609
|
-
var to = toObject(target);
|
|
610
|
-
|
|
611
|
-
// 2. If only one argument was passed, return to.
|
|
612
|
-
if (arguments.length === 1) {
|
|
613
|
-
return to;
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
// 3. Let sources be the List of argument values starting with the second argument
|
|
617
|
-
var sources = Array.prototype.slice.call(arguments, 1);
|
|
618
|
-
|
|
619
|
-
// 4. For each element nextSource of sources, in ascending index order, do
|
|
620
|
-
var index1;
|
|
621
|
-
var index2;
|
|
622
|
-
var keys;
|
|
623
|
-
var from;
|
|
624
|
-
for (index1 = 0; index1 < sources.length; index1++) {
|
|
625
|
-
var nextSource = sources[index1];
|
|
626
|
-
// 4a. If nextSource is undefined or null, let keys be a new empty List.
|
|
627
|
-
if (nextSource === undefined$1 || nextSource === null) {
|
|
628
|
-
keys = [];
|
|
629
|
-
// 4b. Else,
|
|
630
|
-
} else {
|
|
631
|
-
// 4bi. Let from be ! ToObject(nextSource).
|
|
632
|
-
from = toObject(nextSource);
|
|
633
|
-
// 4bii. Let keys be ? from.[[OwnPropertyKeys]]().
|
|
634
|
-
/*
|
|
635
|
-
This step in our polyfill is not complying with the specification.
|
|
636
|
-
[[OwnPropertyKeys]] is meant to return ALL keys, including non-enumerable and symbols.
|
|
637
|
-
TODO: When we have Reflect.ownKeys, use that instead as it is the userland equivalent of [[OwnPropertyKeys]].
|
|
638
|
-
*/
|
|
639
|
-
keys = Object.keys(from);
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
// 4c. For each element nextKey of keys in List order, do
|
|
643
|
-
for (index2 = 0; index2 < keys.length; index2++) {
|
|
644
|
-
var nextKey = keys[index2];
|
|
645
|
-
// 4ci. Let desc be ? from.[[GetOwnProperty]](nextKey).
|
|
646
|
-
var desc = Object.getOwnPropertyDescriptor(from, nextKey);
|
|
647
|
-
// 4cii. If desc is not undefined and desc.[[Enumerable]] is true, then
|
|
648
|
-
if (desc !== undefined$1 && desc.enumerable) {
|
|
649
|
-
// 4cii1. Let propValue be ? Get(from, nextKey).
|
|
650
|
-
var propValue = from[nextKey];
|
|
651
|
-
// 4cii2. Perform ? Set(to, nextKey, propValue, true).
|
|
652
|
-
to[nextKey] = propValue;
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
// 5. Return to.
|
|
657
|
-
return to;
|
|
658
|
-
}
|
|
205
|
+
writable: true
|
|
659
206
|
});
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
(function (undefined$1) {
|
|
664
|
-
// Detection from https://github.com/Financial-Times/polyfill-library/blob/987630a085e29226da16b5dc542042c687560191/polyfills/Date/now/detect.js
|
|
665
|
-
var detect = 'Date' in this && 'now' in this.Date && 'getTime' in this.Date.prototype;
|
|
666
|
-
if (detect) return;
|
|
667
|
-
|
|
668
|
-
// Polyfill from https://cdn.polyfill.io/v2/polyfill.js?features=Array.prototype.forEach&flags=always
|
|
669
|
-
Date.now = function now() {
|
|
670
|
-
return new Date().getTime();
|
|
671
|
-
};
|
|
672
|
-
}).call('object' === (typeof window === "undefined" ? "undefined" : _typeof(window)) && window || 'object' === (typeof self === "undefined" ? "undefined" : _typeof(self)) && self || 'object' === (typeof global === "undefined" ? "undefined" : _typeof(global)) && global || {});
|
|
673
|
-
|
|
674
|
-
/**
|
|
675
|
-
* TODO: Ideally this would be a NodeList.prototype.forEach polyfill
|
|
676
|
-
* This seems to fail in IE8, requires more investigation.
|
|
677
|
-
* See: https://github.com/imagitama/nodelist-foreach-polyfill
|
|
678
|
-
*/
|
|
679
|
-
// eslint-disable-next-line consistent-return
|
|
680
|
-
function nodeListForEach(nodes, callback) {
|
|
681
|
-
if (window.NodeList.prototype.forEach) {
|
|
682
|
-
return nodes.forEach(callback);
|
|
207
|
+
} else {
|
|
208
|
+
obj[key] = value;
|
|
683
209
|
}
|
|
684
|
-
|
|
685
|
-
|
|
210
|
+
return obj;
|
|
211
|
+
}
|
|
212
|
+
function _toPrimitive(input, hint) {
|
|
213
|
+
if (typeof input !== "object" || input === null) return input;
|
|
214
|
+
var prim = input[Symbol.toPrimitive];
|
|
215
|
+
if (prim !== undefined) {
|
|
216
|
+
var res = prim.call(input, hint || "default");
|
|
217
|
+
if (typeof res !== "object") return res;
|
|
218
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
686
219
|
}
|
|
220
|
+
return (hint === "string" ? String : Number)(input);
|
|
221
|
+
}
|
|
222
|
+
function _toPropertyKey(arg) {
|
|
223
|
+
var key = _toPrimitive(arg, "string");
|
|
224
|
+
return typeof key === "symbol" ? key : String(key);
|
|
687
225
|
}
|
|
688
226
|
|
|
227
|
+
// TODO remove when decision is made by DIAS about removing the timeout dialog functionality for IE
|
|
689
228
|
/* global ActiveXObject */
|
|
229
|
+
|
|
690
230
|
var _console = console,
|
|
691
231
|
warn = _console.warn;
|
|
692
232
|
var utils = {
|
|
@@ -705,13 +245,13 @@
|
|
|
705
245
|
},
|
|
706
246
|
addClass: function addClass(selector, className) {
|
|
707
247
|
var elements = document.querySelectorAll(selector);
|
|
708
|
-
|
|
248
|
+
elements.forEach(function (i) {
|
|
709
249
|
i.classList.add(className);
|
|
710
250
|
});
|
|
711
251
|
},
|
|
712
252
|
removeClass: function removeClass(selector, className) {
|
|
713
253
|
var elements = document.querySelectorAll(selector);
|
|
714
|
-
|
|
254
|
+
elements.forEach(function (i) {
|
|
715
255
|
i.classList.remove(className);
|
|
716
256
|
});
|
|
717
257
|
},
|
|
@@ -811,7 +351,7 @@
|
|
|
811
351
|
document.removeEventListener('touchmove', handleTouch, true);
|
|
812
352
|
});
|
|
813
353
|
};
|
|
814
|
-
|
|
354
|
+
elements.forEach(function ($elem) {
|
|
815
355
|
var value = $elem.getAttribute('aria-hidden');
|
|
816
356
|
$elem.setAttribute('aria-hidden', 'true');
|
|
817
357
|
resetElementsFunctionList.push(function () {
|
|
@@ -847,11 +387,6 @@
|
|
|
847
387
|
displayDialog: displayDialog
|
|
848
388
|
};
|
|
849
389
|
|
|
850
|
-
// Polyfill from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN
|
|
851
|
-
Number.isNaN = Number.isNaN || function isNaN(input) {
|
|
852
|
-
return typeof input === 'number' && input !== input;
|
|
853
|
-
};
|
|
854
|
-
|
|
855
390
|
function ValidateInput() {}
|
|
856
391
|
ValidateInput["int"] = function (stringToValidate) {
|
|
857
392
|
var parsedInt = parseInt(stringToValidate, 10);
|
|
@@ -1213,7 +748,7 @@
|
|
|
1213
748
|
new AccountMenu($AccountMenuSelector).init();
|
|
1214
749
|
}
|
|
1215
750
|
var $HmrcPrintLinks = document.querySelectorAll('a[data-module="hmrc-print-link"]');
|
|
1216
|
-
|
|
751
|
+
$HmrcPrintLinks.forEach(function ($HmrcPrintLink) {
|
|
1217
752
|
new HmrcPrintLink($HmrcPrintLink, window).init();
|
|
1218
753
|
});
|
|
1219
754
|
var sessionActivityService = new SessionActivityService(window.BroadcastChannel);
|
|
@@ -1227,7 +762,7 @@
|
|
|
1227
762
|
new UserResearchBanner($UserResearchBanner).init();
|
|
1228
763
|
}
|
|
1229
764
|
var $BackLinks = document.querySelectorAll('[data-module="hmrc-back-link"]');
|
|
1230
|
-
|
|
765
|
+
$BackLinks.forEach(function ($BackLink) {
|
|
1231
766
|
new BackLinkHelper($BackLink, window, document).init();
|
|
1232
767
|
});
|
|
1233
768
|
}
|