@ably/ui 8.7.0-dev.b3aa10e → 8.7.0-dev.bd84e91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -5
- package/core/.DS_Store +0 -0
- package/core/Code/component.css +3 -3
- package/core/Code/component.js +1 -1
- package/core/Code.jsx +353 -7273
- package/core/CompanyAutocomplete/component.js +1 -1
- package/core/ConnectStateWrapper.jsx +13 -4
- package/core/ContactFooter.jsx +13 -119
- package/core/CookieMessage.jsx +21 -293
- package/core/CustomerLogos.jsx +11 -115
- package/core/DropdownMenu/component.js +1 -0
- package/core/DropdownMenu.jsx +313 -0
- package/core/DropdownMenuPreview/component.js +6 -0
- package/core/DropdownMenuPreview.jsx +6 -0
- package/core/FeaturedLink.jsx +10 -116
- package/core/Flash.jsx +149 -1531
- package/core/Footer/component.css +21 -1
- package/core/Footer.jsx +155 -170
- package/core/Icon.jsx +9 -114
- package/core/Loader.jsx +9 -114
- package/core/Logo.jsx +36 -226
- package/core/Meganav/component.js +1 -2
- package/core/Meganav/component.json +1 -1
- package/core/Meganav.jsx +2202 -9546
- package/core/MeganavBlogPostsList/component.js +1 -1
- package/core/MeganavBlogPostsList.jsx +11 -118
- package/core/MeganavContentCompany.jsx +31 -124
- package/core/MeganavContentDevelopers.jsx +31 -125
- package/core/MeganavContentPlatform.jsx +11 -118
- package/core/MeganavContentUseCases.jsx +11 -117
- package/core/MeganavControl.jsx +10 -116
- package/core/MeganavControlMobileDropdown/component.js +1 -1
- package/core/MeganavControlMobileDropdown.jsx +10 -116
- package/core/MeganavControlMobilePanelClose.jsx +10 -116
- package/core/MeganavControlMobilePanelOpen.jsx +10 -116
- package/core/MeganavItemsDesktop.jsx +13 -121
- package/core/MeganavItemsMobile.jsx +18 -132
- package/core/MeganavItemsSignedIn.jsx +16 -129
- package/core/MeganavSearch.jsx +13 -123
- package/core/MeganavSearchAutocomplete/component.js +1 -2
- package/core/MeganavSearchPanel.jsx +12 -121
- package/core/MeganavSearchSuggestions.jsx +11 -118
- package/core/Notice/component.js +1 -2
- package/core/Notice.jsx +183 -2185
- package/core/SignOutLink.jsx +9 -114
- package/core/Slider/component.js +1 -1
- package/core/Slider.jsx +25 -582
- package/core/Uptime.jsx +15 -118
- package/core/images/ably-logo.png +0 -0
- package/core/images/high-performer-2022.png +0 -0
- package/core/images/highest-user-adoption-2022.png +0 -0
- package/core/images/users-love-us-2022.png +0 -0
- package/core/scripts.js +1 -1
- package/core/sprites.svg +42 -1
- package/core/styles.css +2 -0
- package/package.json +4 -4
- package/src/.DS_Store +0 -0
- package/src/core/.DS_Store +0 -0
- package/src/core/Code/component.css +1 -67
- package/src/core/Code/component.js +11 -46
- package/src/core/Code/component.jsx +7 -3
- package/src/core/CustomerLogos/component.jsx +1 -1
- package/src/core/DropdownMenu/component.js +0 -0
- package/src/core/DropdownMenu/component.jsx +112 -0
- package/src/core/FeatureFooter/component.html.erb +1 -1
- package/src/core/Flash/component.jsx +40 -14
- package/src/core/Footer/component.css +21 -1
- package/src/core/Footer/component.html.erb +118 -56
- package/src/core/Footer/component.jsx +125 -50
- package/src/core/Logo/component.html.erb +2 -27
- package/src/core/Logo/component.jsx +7 -40
- package/src/core/Logo/component.rb +15 -6
- package/src/core/Meganav/component.html.erb +1 -1
- package/src/core/Meganav/component.json +1 -1
- package/src/core/Meganav/component.jsx +1 -1
- package/src/core/Meganav/component.rb +3 -2
- package/src/core/MeganavContentDevelopers/component.html.erb +17 -8
- package/src/core/MeganavContentDevelopers/component.jsx +17 -8
- package/src/core/MeganavContentUseCases/component.html.erb +1 -1
- package/src/core/MeganavContentUseCases/component.jsx +1 -1
- package/src/core/MeganavSearchSuggestions/component.html.erb +1 -1
- package/src/core/core.rb +12 -4
- package/src/core/icons/github.svg +1 -1
- package/src/core/icons/google.svg +3 -0
- package/src/core/icons/icon-display-chat-col.svg +4 -0
- package/src/core/icons/icon-display-integrations-col.svg +8 -0
- package/src/core/icons/icon-gui-check-circled-fill-black.svg +4 -0
- package/src/core/icons/icon-gui-filter-flow-step-1.svg +5 -0
- package/src/core/icons/icon-gui-filter-flow-step-2.svg +5 -0
- package/src/core/icons/icon-gui-filter-flow-step-3.svg +5 -0
- package/src/core/icons/icon-gui-resources.svg +3 -0
- package/src/core/icons/stackoverflow.svg +3 -0
- package/src/core/icons/youtube.svg +11 -0
- package/src/core/images/ably-logo.png +0 -0
- package/src/core/images/high-performer-2022.png +0 -0
- package/src/core/images/highest-user-adoption-2022.png +0 -0
- package/src/core/images/users-love-us-2022.png +0 -0
- package/src/core/styles/properties.css +2 -0
- package/src/core/utils/syntax-highlighter-registry.js +61 -0
- package/src/core/utils/syntax-highlighter.css +69 -0
- package/src/core/utils/syntax-highlighter.js +98 -0
- package/tailwind.config.js +1 -0
package/core/Notice.jsx
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
2
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
-
module.exports = factory(require("react"));
|
|
3
|
+
module.exports = factory(require("react"), require("prop-types"), require("js-cookie"), require("lodash.throttle"), require("dompurify"), require("redux"));
|
|
4
4
|
else if(typeof define === 'function' && define.amd)
|
|
5
|
-
define([], factory);
|
|
5
|
+
define([, , , , , ], factory);
|
|
6
6
|
else {
|
|
7
|
-
var a = typeof exports === 'object' ? factory(require("react")) : factory(root[undefined]);
|
|
7
|
+
var a = typeof exports === 'object' ? factory(require("react"), require("prop-types"), require("js-cookie"), require("lodash.throttle"), require("dompurify"), require("redux")) : factory(root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined]);
|
|
8
8
|
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
|
9
9
|
}
|
|
10
|
-
})(this, function(__WEBPACK_EXTERNAL_MODULE__9281__) {
|
|
10
|
+
})(this, function(__WEBPACK_EXTERNAL_MODULE__9281__, __WEBPACK_EXTERNAL_MODULE__3474__, __WEBPACK_EXTERNAL_MODULE__9349__, __WEBPACK_EXTERNAL_MODULE__2040__, __WEBPACK_EXTERNAL_MODULE__6357__, __WEBPACK_EXTERNAL_MODULE__5044__) {
|
|
11
11
|
return /******/ (() => { // webpackBootstrap
|
|
12
|
+
/******/ "use strict";
|
|
12
13
|
/******/ var __webpack_modules__ = ({
|
|
13
14
|
|
|
14
15
|
/***/ 9787:
|
|
15
16
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
16
17
|
|
|
17
|
-
"use strict";
|
|
18
18
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
19
19
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
20
20
|
/* harmony export */ });
|
|
@@ -92,23 +92,55 @@ var ConnectStateWrapper = function ConnectStateWrapper(Component, selectors) {
|
|
|
92
92
|
|
|
93
93
|
/***/ }),
|
|
94
94
|
|
|
95
|
-
/***/
|
|
95
|
+
/***/ 8696:
|
|
96
96
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
/*
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
98
|
+
|
|
99
|
+
// EXPORTS
|
|
100
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
101
|
+
"FLASH_DATA_ID": () => (/* binding */ FLASH_DATA_ID)
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
// UNUSED EXPORTS: Flashes, default, reducerFlashes
|
|
105
|
+
|
|
106
|
+
// EXTERNAL MODULE: external {"commonjs":"react","commonjs2":"react"}
|
|
107
|
+
var external_commonjs_react_commonjs2_react_ = __webpack_require__(9281);
|
|
108
|
+
var external_commonjs_react_commonjs2_react_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_react_commonjs2_react_);
|
|
109
|
+
// EXTERNAL MODULE: external {"commonjs":"dompurify","commonjs2":"dompurify"}
|
|
110
|
+
var external_commonjs_dompurify_commonjs2_dompurify_ = __webpack_require__(6357);
|
|
111
|
+
var external_commonjs_dompurify_commonjs2_dompurify_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_dompurify_commonjs2_dompurify_);
|
|
112
|
+
// EXTERNAL MODULE: external {"commonjs":"prop-types","commonjs2":"prop-types"}
|
|
113
|
+
var external_commonjs_prop_types_commonjs2_prop_types_ = __webpack_require__(3474);
|
|
114
|
+
var external_commonjs_prop_types_commonjs2_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_prop_types_commonjs2_prop_types_);
|
|
115
|
+
;// CONCATENATED MODULE: ./node_modules/nanoid/non-secure/index.js
|
|
116
|
+
let urlAlphabet =
|
|
117
|
+
'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'
|
|
118
|
+
let customAlphabet = (alphabet, defaultSize = 21) => {
|
|
119
|
+
return (size = defaultSize) => {
|
|
120
|
+
let id = ''
|
|
121
|
+
let i = size
|
|
122
|
+
while (i--) {
|
|
123
|
+
id += alphabet[(Math.random() * alphabet.length) | 0]
|
|
124
|
+
}
|
|
125
|
+
return id
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
let nanoid = (size = 21) => {
|
|
129
|
+
let id = ''
|
|
130
|
+
let i = size
|
|
131
|
+
while (i--) {
|
|
132
|
+
id += urlAlphabet[(Math.random() * 64) | 0]
|
|
133
|
+
}
|
|
134
|
+
return id
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// EXTERNAL MODULE: ./src/core/remote-data-store.js
|
|
138
|
+
var remote_data_store = __webpack_require__(3511);
|
|
139
|
+
// EXTERNAL MODULE: ./src/core/ConnectStateWrapper/component.jsx
|
|
140
|
+
var component = __webpack_require__(9787);
|
|
141
|
+
// EXTERNAL MODULE: ./src/core/Icon/component.jsx
|
|
142
|
+
var Icon_component = __webpack_require__(9008);
|
|
143
|
+
;// CONCATENATED MODULE: ./src/core/Flash/component.jsx
|
|
112
144
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
113
145
|
|
|
114
146
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -143,6 +175,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
143
175
|
|
|
144
176
|
|
|
145
177
|
|
|
178
|
+
|
|
146
179
|
var REDUCER_KEY = "flashes";
|
|
147
180
|
var FLASH_DATA_ID = "ui-flashes";
|
|
148
181
|
var initialState = {
|
|
@@ -172,8 +205,8 @@ var selectFlashes = function selectFlashes(store) {
|
|
|
172
205
|
};
|
|
173
206
|
|
|
174
207
|
var FlashT = {
|
|
175
|
-
type:
|
|
176
|
-
content: (
|
|
208
|
+
type: external_commonjs_prop_types_commonjs2_prop_types_default().oneOf(["error", "success", "notice", "info", "alert"]),
|
|
209
|
+
content: (external_commonjs_prop_types_commonjs2_prop_types_default()).string
|
|
177
210
|
};
|
|
178
211
|
var FLASH_BG_COLOR = {
|
|
179
212
|
error: "bg-gui-error",
|
|
@@ -192,48 +225,60 @@ var FLASH_TEXT_COLOR = {
|
|
|
192
225
|
var AUTO_HIDE = ["success", "info", "notice"];
|
|
193
226
|
var AUTO_HIDE_TIME = 8000;
|
|
194
227
|
|
|
228
|
+
var useAutoHide = function useAutoHide(type, closeFlash) {
|
|
229
|
+
var timeoutId = (0,external_commonjs_react_commonjs2_react_.useRef)(null);
|
|
230
|
+
(0,external_commonjs_react_commonjs2_react_.useEffect)(function () {
|
|
231
|
+
if (AUTO_HIDE.includes(type)) {
|
|
232
|
+
timeoutId.current = setTimeout(function () {
|
|
233
|
+
closeFlash();
|
|
234
|
+
}, AUTO_HIDE_TIME);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
return function () {
|
|
238
|
+
if (timeoutId.current) {
|
|
239
|
+
clearTimeout(timeoutId.current);
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
}, []);
|
|
243
|
+
};
|
|
244
|
+
|
|
195
245
|
var Flash = function Flash(_ref) {
|
|
196
|
-
var
|
|
197
|
-
|
|
198
|
-
|
|
246
|
+
var id = _ref.id,
|
|
247
|
+
type = _ref.type,
|
|
248
|
+
content = _ref.content,
|
|
249
|
+
removeFlash = _ref.removeFlash;
|
|
250
|
+
var ref = (0,external_commonjs_react_commonjs2_react_.useRef)(null);
|
|
199
251
|
|
|
200
|
-
var _useState = (0,
|
|
252
|
+
var _useState = (0,external_commonjs_react_commonjs2_react_.useState)(false),
|
|
201
253
|
_useState2 = _slicedToArray(_useState, 2),
|
|
202
254
|
closed = _useState2[0],
|
|
203
255
|
setClosed = _useState2[1];
|
|
204
256
|
|
|
205
|
-
var _useState3 = (0,
|
|
257
|
+
var _useState3 = (0,external_commonjs_react_commonjs2_react_.useState)(0),
|
|
206
258
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
207
259
|
flashHeight = _useState4[0],
|
|
208
260
|
setFlashHeight = _useState4[1];
|
|
209
261
|
|
|
210
|
-
var _useState5 = (0,
|
|
262
|
+
var _useState5 = (0,external_commonjs_react_commonjs2_react_.useState)(false),
|
|
211
263
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
212
264
|
triggerEntryAnimation = _useState6[0],
|
|
213
265
|
setTriggerEntryAnimation = _useState6[1];
|
|
214
266
|
|
|
215
|
-
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
216
|
-
return setTriggerEntryAnimation(true);
|
|
217
|
-
}, []);
|
|
218
|
-
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
219
|
-
if (AUTO_HIDE.includes(type)) {
|
|
220
|
-
setTimeout(function () {
|
|
221
|
-
// closeFlash is idempotent, we can call it even if the flash has been already closed
|
|
222
|
-
closeFlash();
|
|
223
|
-
}, AUTO_HIDE_TIME);
|
|
224
|
-
}
|
|
225
|
-
}, [closed]);
|
|
226
|
-
|
|
227
267
|
var closeFlash = function closeFlash() {
|
|
228
268
|
if (ref.current) {
|
|
229
269
|
setFlashHeight(ref.current.getBoundingClientRect().height);
|
|
230
270
|
}
|
|
231
271
|
|
|
272
|
+
setClosed(true);
|
|
232
273
|
setTimeout(function () {
|
|
233
|
-
|
|
234
|
-
},
|
|
274
|
+
removeFlash(id);
|
|
275
|
+
}, 100);
|
|
235
276
|
};
|
|
236
277
|
|
|
278
|
+
(0,external_commonjs_react_commonjs2_react_.useEffect)(function () {
|
|
279
|
+
return setTriggerEntryAnimation(true);
|
|
280
|
+
}, []);
|
|
281
|
+
useAutoHide(type, closeFlash);
|
|
237
282
|
var animateEntry = triggerEntryAnimation && !closed;
|
|
238
283
|
var style;
|
|
239
284
|
|
|
@@ -251,7 +296,7 @@ var Flash = function Flash(_ref) {
|
|
|
251
296
|
style = {};
|
|
252
297
|
}
|
|
253
298
|
|
|
254
|
-
var safeContent =
|
|
299
|
+
var safeContent = external_commonjs_dompurify_commonjs2_dompurify_default().sanitize(content, {
|
|
255
300
|
ALLOWED_TAGS: ["a"],
|
|
256
301
|
ALLOWED_ATTR: ["href", "data-method", "rel"]
|
|
257
302
|
});
|
|
@@ -267,28 +312,28 @@ var Flash = function Flash(_ref) {
|
|
|
267
312
|
error: "text-white",
|
|
268
313
|
alert: "text-white"
|
|
269
314
|
};
|
|
270
|
-
return /*#__PURE__*/
|
|
315
|
+
return /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("div", {
|
|
271
316
|
className: "ui-flash-message ui-grid-px ".concat(animateEntry ? "ui-flash-message-enter" : ""),
|
|
272
317
|
style: style,
|
|
273
318
|
ref: ref,
|
|
274
319
|
"data-id": "ui-flash"
|
|
275
|
-
}, /*#__PURE__*/
|
|
320
|
+
}, /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("div", {
|
|
276
321
|
className: "".concat(FLASH_BG_COLOR[type], " p-32 flex align-center rounded shadow-container-subtle")
|
|
277
|
-
}, withIcons[type] && /*#__PURE__*/
|
|
322
|
+
}, withIcons[type] && /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement(Icon_component.default, {
|
|
278
323
|
name: withIcons[type],
|
|
279
324
|
color: iconColor[type],
|
|
280
325
|
size: "1.5rem",
|
|
281
326
|
additionalCSS: "mr-16 self-baseline"
|
|
282
|
-
}), /*#__PURE__*/
|
|
327
|
+
}), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("p", {
|
|
283
328
|
className: "ui-flash-text ".concat(FLASH_TEXT_COLOR[type]),
|
|
284
329
|
dangerouslySetInnerHTML: {
|
|
285
330
|
__html: safeContent
|
|
286
331
|
}
|
|
287
|
-
}), /*#__PURE__*/
|
|
332
|
+
}), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("button", {
|
|
288
333
|
type: "button",
|
|
289
334
|
className: "p-0 ml-auto self-start focus:outline-none",
|
|
290
335
|
onClick: closeFlash
|
|
291
|
-
}, /*#__PURE__*/
|
|
336
|
+
}, /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement(Icon_component.default, {
|
|
292
337
|
name: "icon-gui-close",
|
|
293
338
|
color: iconColor[type],
|
|
294
339
|
size: "1.5rem",
|
|
@@ -300,26 +345,52 @@ Flash.propTypes = _objectSpread({}, FlashT);
|
|
|
300
345
|
|
|
301
346
|
var Flashes = function Flashes(_ref2) {
|
|
302
347
|
var flashes = _ref2.flashes;
|
|
303
|
-
|
|
304
|
-
|
|
348
|
+
|
|
349
|
+
var _useState7 = (0,external_commonjs_react_commonjs2_react_.useState)([]),
|
|
350
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
351
|
+
flashesWithIds = _useState8[0],
|
|
352
|
+
setFlashesWithIds = _useState8[1];
|
|
353
|
+
|
|
354
|
+
var removeFlash = function removeFlash(flashId) {
|
|
355
|
+
return setFlashesWithIds(function (items) {
|
|
356
|
+
return items.filter(function (item) {
|
|
357
|
+
return item.id !== flashId;
|
|
358
|
+
});
|
|
359
|
+
});
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
(0,external_commonjs_react_commonjs2_react_.useEffect)(function () {
|
|
363
|
+
setFlashesWithIds(function (state) {
|
|
364
|
+
return [].concat(_toConsumableArray(state), _toConsumableArray(((flashes === null || flashes === void 0 ? void 0 : flashes.items) || []).map(function (flash) {
|
|
365
|
+
return _objectSpread(_objectSpread({}, flash), {}, {
|
|
366
|
+
id: nanoid(),
|
|
367
|
+
removed: false
|
|
368
|
+
});
|
|
369
|
+
})));
|
|
370
|
+
});
|
|
371
|
+
}, [flashes]);
|
|
372
|
+
return /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("div", {
|
|
305
373
|
className: "ui-flash",
|
|
306
374
|
"data-id": FLASH_DATA_ID
|
|
307
|
-
},
|
|
308
|
-
return
|
|
309
|
-
|
|
375
|
+
}, flashesWithIds.filter(function (item) {
|
|
376
|
+
return !item.removed;
|
|
377
|
+
}).map(function (flash) {
|
|
378
|
+
return /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement(Flash, _extends({
|
|
379
|
+
removeFlash: removeFlash,
|
|
380
|
+
key: flash.id
|
|
310
381
|
}, flash));
|
|
311
382
|
}));
|
|
312
383
|
};
|
|
313
384
|
|
|
314
385
|
Flashes.propTypes = {
|
|
315
|
-
flashes:
|
|
316
|
-
items:
|
|
386
|
+
flashes: external_commonjs_prop_types_commonjs2_prop_types_default().shape({
|
|
387
|
+
items: external_commonjs_prop_types_commonjs2_prop_types_default().arrayOf(external_commonjs_prop_types_commonjs2_prop_types_default().shape(FlashT))
|
|
317
388
|
})
|
|
318
389
|
};
|
|
319
390
|
|
|
320
391
|
var BackendFlashes = function BackendFlashes(_ref3) {
|
|
321
392
|
var flashes = _ref3.flashes;
|
|
322
|
-
(0,
|
|
393
|
+
(0,external_commonjs_react_commonjs2_react_.useEffect)(function () {
|
|
323
394
|
var transformedFlashes = flashes.map(function (flash) {
|
|
324
395
|
var _flash = _slicedToArray(flash, 2),
|
|
325
396
|
type = _flash[0],
|
|
@@ -332,37 +403,36 @@ var BackendFlashes = function BackendFlashes(_ref3) {
|
|
|
332
403
|
}) || [];
|
|
333
404
|
|
|
334
405
|
if (transformedFlashes.length > 0) {
|
|
335
|
-
var store = (0,
|
|
406
|
+
var store = (0,remote_data_store/* getRemoteDataStore */.cO)();
|
|
336
407
|
store.dispatch({
|
|
337
408
|
type: "flash/push",
|
|
338
409
|
payload: transformedFlashes
|
|
339
410
|
});
|
|
340
411
|
}
|
|
341
412
|
}, []);
|
|
342
|
-
var WrappedFlashes = (0,
|
|
413
|
+
var WrappedFlashes = (0,component.default)(Flashes, {
|
|
343
414
|
flashes: selectFlashes
|
|
344
415
|
});
|
|
345
|
-
return /*#__PURE__*/
|
|
416
|
+
return /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement(WrappedFlashes, null);
|
|
346
417
|
};
|
|
347
418
|
|
|
348
419
|
BackendFlashes.propTypes = {
|
|
349
|
-
flashes:
|
|
420
|
+
flashes: external_commonjs_prop_types_commonjs2_prop_types_default().arrayOf(external_commonjs_prop_types_commonjs2_prop_types_default().arrayOf((external_commonjs_prop_types_commonjs2_prop_types_default()).string))
|
|
350
421
|
};
|
|
351
422
|
|
|
352
|
-
/*
|
|
423
|
+
/* harmony default export */ const Flash_component = ((/* unused pure expression or super */ null && (BackendFlashes)));
|
|
353
424
|
|
|
354
425
|
/***/ }),
|
|
355
426
|
|
|
356
427
|
/***/ 9008:
|
|
357
428
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
358
429
|
|
|
359
|
-
"use strict";
|
|
360
430
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
361
431
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
362
432
|
/* harmony export */ });
|
|
363
433
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9281);
|
|
364
434
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
365
|
-
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
435
|
+
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3474);
|
|
366
436
|
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
|
|
367
437
|
var _excluded = ["name", "size", "color", "additionalCSS"];
|
|
368
438
|
|
|
@@ -409,7 +479,6 @@ Icon.propTypes = {
|
|
|
409
479
|
/***/ 9581:
|
|
410
480
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
411
481
|
|
|
412
|
-
"use strict";
|
|
413
482
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
414
483
|
/* harmony export */ "A": () => (/* binding */ queryId)
|
|
415
484
|
/* harmony export */ });
|
|
@@ -428,12 +497,13 @@ var queryIdAll = function queryIdAll(val) {
|
|
|
428
497
|
/***/ 3511:
|
|
429
498
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
430
499
|
|
|
431
|
-
"use strict";
|
|
432
500
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
433
501
|
/* harmony export */ "cO": () => (/* binding */ getRemoteDataStore),
|
|
434
502
|
/* harmony export */ "kZ": () => (/* binding */ connectState)
|
|
435
503
|
/* harmony export */ });
|
|
436
504
|
/* unused harmony exports attachStoreToWindow, createRemoteDataStore */
|
|
505
|
+
/* harmony import */ var redux__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5044);
|
|
506
|
+
/* harmony import */ var redux__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(redux__WEBPACK_IMPORTED_MODULE_0__);
|
|
437
507
|
|
|
438
508
|
var attachStoreToWindow = function attachStoreToWindow(store) {
|
|
439
509
|
window.AblyUi = window.AblyUi || {};
|
|
@@ -466,2104 +536,45 @@ var createRemoteDataStore = function createRemoteDataStore(reducers) {
|
|
|
466
536
|
|
|
467
537
|
/***/ }),
|
|
468
538
|
|
|
469
|
-
/***/
|
|
470
|
-
/***/ (
|
|
471
|
-
|
|
472
|
-
/*! @license DOMPurify | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.2.2/LICENSE */
|
|
473
|
-
|
|
474
|
-
(function (global, factory) {
|
|
475
|
-
true ? module.exports = factory() :
|
|
476
|
-
0;
|
|
477
|
-
}(this, function () { 'use strict';
|
|
478
|
-
|
|
479
|
-
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
|
480
|
-
|
|
481
|
-
var hasOwnProperty = Object.hasOwnProperty,
|
|
482
|
-
setPrototypeOf = Object.setPrototypeOf,
|
|
483
|
-
isFrozen = Object.isFrozen,
|
|
484
|
-
getPrototypeOf = Object.getPrototypeOf,
|
|
485
|
-
getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
486
|
-
var freeze = Object.freeze,
|
|
487
|
-
seal = Object.seal,
|
|
488
|
-
create = Object.create; // eslint-disable-line import/no-mutable-exports
|
|
489
|
-
|
|
490
|
-
var _ref = typeof Reflect !== 'undefined' && Reflect,
|
|
491
|
-
apply = _ref.apply,
|
|
492
|
-
construct = _ref.construct;
|
|
493
|
-
|
|
494
|
-
if (!apply) {
|
|
495
|
-
apply = function apply(fun, thisValue, args) {
|
|
496
|
-
return fun.apply(thisValue, args);
|
|
497
|
-
};
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
if (!freeze) {
|
|
501
|
-
freeze = function freeze(x) {
|
|
502
|
-
return x;
|
|
503
|
-
};
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
if (!seal) {
|
|
507
|
-
seal = function seal(x) {
|
|
508
|
-
return x;
|
|
509
|
-
};
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
if (!construct) {
|
|
513
|
-
construct = function construct(Func, args) {
|
|
514
|
-
return new (Function.prototype.bind.apply(Func, [null].concat(_toConsumableArray(args))))();
|
|
515
|
-
};
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
var arrayForEach = unapply(Array.prototype.forEach);
|
|
519
|
-
var arrayPop = unapply(Array.prototype.pop);
|
|
520
|
-
var arrayPush = unapply(Array.prototype.push);
|
|
521
|
-
|
|
522
|
-
var stringToLowerCase = unapply(String.prototype.toLowerCase);
|
|
523
|
-
var stringMatch = unapply(String.prototype.match);
|
|
524
|
-
var stringReplace = unapply(String.prototype.replace);
|
|
525
|
-
var stringIndexOf = unapply(String.prototype.indexOf);
|
|
526
|
-
var stringTrim = unapply(String.prototype.trim);
|
|
527
|
-
|
|
528
|
-
var regExpTest = unapply(RegExp.prototype.test);
|
|
529
|
-
|
|
530
|
-
var typeErrorCreate = unconstruct(TypeError);
|
|
531
|
-
|
|
532
|
-
function unapply(func) {
|
|
533
|
-
return function (thisArg) {
|
|
534
|
-
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
535
|
-
args[_key - 1] = arguments[_key];
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
return apply(func, thisArg, args);
|
|
539
|
-
};
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
function unconstruct(func) {
|
|
543
|
-
return function () {
|
|
544
|
-
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
545
|
-
args[_key2] = arguments[_key2];
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
return construct(func, args);
|
|
549
|
-
};
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
/* Add properties to a lookup table */
|
|
553
|
-
function addToSet(set, array) {
|
|
554
|
-
if (setPrototypeOf) {
|
|
555
|
-
// Make 'in' and truthy checks like Boolean(set.constructor)
|
|
556
|
-
// independent of any properties defined on Object.prototype.
|
|
557
|
-
// Prevent prototype setters from intercepting set as a this value.
|
|
558
|
-
setPrototypeOf(set, null);
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
var l = array.length;
|
|
562
|
-
while (l--) {
|
|
563
|
-
var element = array[l];
|
|
564
|
-
if (typeof element === 'string') {
|
|
565
|
-
var lcElement = stringToLowerCase(element);
|
|
566
|
-
if (lcElement !== element) {
|
|
567
|
-
// Config presets (e.g. tags.js, attrs.js) are immutable.
|
|
568
|
-
if (!isFrozen(array)) {
|
|
569
|
-
array[l] = lcElement;
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
element = lcElement;
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
set[element] = true;
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
return set;
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
/* Shallow clone an object */
|
|
583
|
-
function clone(object) {
|
|
584
|
-
var newObject = create(null);
|
|
585
|
-
|
|
586
|
-
var property = void 0;
|
|
587
|
-
for (property in object) {
|
|
588
|
-
if (apply(hasOwnProperty, object, [property])) {
|
|
589
|
-
newObject[property] = object[property];
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
return newObject;
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
/* IE10 doesn't support __lookupGetter__ so lets'
|
|
597
|
-
* simulate it. It also automatically checks
|
|
598
|
-
* if the prop is function or getter and behaves
|
|
599
|
-
* accordingly. */
|
|
600
|
-
function lookupGetter(object, prop) {
|
|
601
|
-
while (object !== null) {
|
|
602
|
-
var desc = getOwnPropertyDescriptor(object, prop);
|
|
603
|
-
if (desc) {
|
|
604
|
-
if (desc.get) {
|
|
605
|
-
return unapply(desc.get);
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
if (typeof desc.value === 'function') {
|
|
609
|
-
return unapply(desc.value);
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
object = getPrototypeOf(object);
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
function fallbackValue(element) {
|
|
617
|
-
console.warn('fallback value for', element);
|
|
618
|
-
return null;
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
return fallbackValue;
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
var html = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);
|
|
625
|
-
|
|
626
|
-
// SVG
|
|
627
|
-
var svg = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
|
|
628
|
-
|
|
629
|
-
var svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);
|
|
630
|
-
|
|
631
|
-
// List of SVG elements that are disallowed by default.
|
|
632
|
-
// We still need to know them so that we can do namespace
|
|
633
|
-
// checks properly in case one wants to add them to
|
|
634
|
-
// allow-list.
|
|
635
|
-
var svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'fedropshadow', 'feimage', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);
|
|
636
|
-
|
|
637
|
-
var mathMl = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover']);
|
|
638
|
-
|
|
639
|
-
// Similarly to SVG, we want to know all MathML elements,
|
|
640
|
-
// even those that we disallow by default.
|
|
641
|
-
var mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
|
|
642
|
-
|
|
643
|
-
var text = freeze(['#text']);
|
|
644
|
-
|
|
645
|
-
var html$1 = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'xmlns', 'slot']);
|
|
646
|
-
|
|
647
|
-
var svg$1 = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'targetx', 'targety', 'transform', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
|
|
648
|
-
|
|
649
|
-
var mathMl$1 = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);
|
|
650
|
-
|
|
651
|
-
var xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
|
|
652
|
-
|
|
653
|
-
// eslint-disable-next-line unicorn/better-regex
|
|
654
|
-
var MUSTACHE_EXPR = seal(/\{\{[\s\S]*|[\s\S]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
|
|
655
|
-
var ERB_EXPR = seal(/<%[\s\S]*|[\s\S]*%>/gm);
|
|
656
|
-
var DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/); // eslint-disable-line no-useless-escape
|
|
657
|
-
var ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
|
|
658
|
-
var IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
|
|
659
|
-
);
|
|
660
|
-
var IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
|
|
661
|
-
var ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex
|
|
662
|
-
);
|
|
663
|
-
|
|
664
|
-
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
665
|
-
|
|
666
|
-
function _toConsumableArray$1(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
|
667
|
-
|
|
668
|
-
var getGlobal = function getGlobal() {
|
|
669
|
-
return typeof window === 'undefined' ? null : window;
|
|
670
|
-
};
|
|
671
|
-
|
|
672
|
-
/**
|
|
673
|
-
* Creates a no-op policy for internal use only.
|
|
674
|
-
* Don't export this function outside this module!
|
|
675
|
-
* @param {?TrustedTypePolicyFactory} trustedTypes The policy factory.
|
|
676
|
-
* @param {Document} document The document object (to determine policy name suffix)
|
|
677
|
-
* @return {?TrustedTypePolicy} The policy created (or null, if Trusted Types
|
|
678
|
-
* are not supported).
|
|
679
|
-
*/
|
|
680
|
-
var _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, document) {
|
|
681
|
-
if ((typeof trustedTypes === 'undefined' ? 'undefined' : _typeof(trustedTypes)) !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
|
|
682
|
-
return null;
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
// Allow the callers to control the unique policy name
|
|
686
|
-
// by adding a data-tt-policy-suffix to the script element with the DOMPurify.
|
|
687
|
-
// Policy creation with duplicate names throws in Trusted Types.
|
|
688
|
-
var suffix = null;
|
|
689
|
-
var ATTR_NAME = 'data-tt-policy-suffix';
|
|
690
|
-
if (document.currentScript && document.currentScript.hasAttribute(ATTR_NAME)) {
|
|
691
|
-
suffix = document.currentScript.getAttribute(ATTR_NAME);
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
var policyName = 'dompurify' + (suffix ? '#' + suffix : '');
|
|
695
|
-
|
|
696
|
-
try {
|
|
697
|
-
return trustedTypes.createPolicy(policyName, {
|
|
698
|
-
createHTML: function createHTML(html$$1) {
|
|
699
|
-
return html$$1;
|
|
700
|
-
}
|
|
701
|
-
});
|
|
702
|
-
} catch (_) {
|
|
703
|
-
// Policy creation failed (most likely another DOMPurify script has
|
|
704
|
-
// already run). Skip creating the policy, as this will only cause errors
|
|
705
|
-
// if TT are enforced.
|
|
706
|
-
console.warn('TrustedTypes policy ' + policyName + ' could not be created.');
|
|
707
|
-
return null;
|
|
708
|
-
}
|
|
709
|
-
};
|
|
710
|
-
|
|
711
|
-
function createDOMPurify() {
|
|
712
|
-
var window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
|
|
713
|
-
|
|
714
|
-
var DOMPurify = function DOMPurify(root) {
|
|
715
|
-
return createDOMPurify(root);
|
|
716
|
-
};
|
|
717
|
-
|
|
718
|
-
/**
|
|
719
|
-
* Version label, exposed for easier checks
|
|
720
|
-
* if DOMPurify is up to date or not
|
|
721
|
-
*/
|
|
722
|
-
DOMPurify.version = '2.2.9';
|
|
723
|
-
|
|
724
|
-
/**
|
|
725
|
-
* Array of elements that DOMPurify removed during sanitation.
|
|
726
|
-
* Empty if nothing was removed.
|
|
727
|
-
*/
|
|
728
|
-
DOMPurify.removed = [];
|
|
729
|
-
|
|
730
|
-
if (!window || !window.document || window.document.nodeType !== 9) {
|
|
731
|
-
// Not running in a browser, provide a factory function
|
|
732
|
-
// so that you can pass your own Window
|
|
733
|
-
DOMPurify.isSupported = false;
|
|
734
|
-
|
|
735
|
-
return DOMPurify;
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
var originalDocument = window.document;
|
|
739
|
-
|
|
740
|
-
var document = window.document;
|
|
741
|
-
var DocumentFragment = window.DocumentFragment,
|
|
742
|
-
HTMLTemplateElement = window.HTMLTemplateElement,
|
|
743
|
-
Node = window.Node,
|
|
744
|
-
Element = window.Element,
|
|
745
|
-
NodeFilter = window.NodeFilter,
|
|
746
|
-
_window$NamedNodeMap = window.NamedNodeMap,
|
|
747
|
-
NamedNodeMap = _window$NamedNodeMap === undefined ? window.NamedNodeMap || window.MozNamedAttrMap : _window$NamedNodeMap,
|
|
748
|
-
Text = window.Text,
|
|
749
|
-
Comment = window.Comment,
|
|
750
|
-
DOMParser = window.DOMParser,
|
|
751
|
-
trustedTypes = window.trustedTypes;
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
var ElementPrototype = Element.prototype;
|
|
755
|
-
|
|
756
|
-
var cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
|
|
757
|
-
var getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
|
|
758
|
-
var getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
|
|
759
|
-
var getParentNode = lookupGetter(ElementPrototype, 'parentNode');
|
|
760
|
-
|
|
761
|
-
// As per issue #47, the web-components registry is inherited by a
|
|
762
|
-
// new document created via createHTMLDocument. As per the spec
|
|
763
|
-
// (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
|
|
764
|
-
// a new empty registry is used when creating a template contents owner
|
|
765
|
-
// document, so we use that as our parent document to ensure nothing
|
|
766
|
-
// is inherited.
|
|
767
|
-
if (typeof HTMLTemplateElement === 'function') {
|
|
768
|
-
var template = document.createElement('template');
|
|
769
|
-
if (template.content && template.content.ownerDocument) {
|
|
770
|
-
document = template.content.ownerDocument;
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
var trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, originalDocument);
|
|
775
|
-
var emptyHTML = trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML('') : '';
|
|
776
|
-
|
|
777
|
-
var _document = document,
|
|
778
|
-
implementation = _document.implementation,
|
|
779
|
-
createNodeIterator = _document.createNodeIterator,
|
|
780
|
-
createDocumentFragment = _document.createDocumentFragment;
|
|
781
|
-
var importNode = originalDocument.importNode;
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
var documentMode = {};
|
|
785
|
-
try {
|
|
786
|
-
documentMode = clone(document).documentMode ? document.documentMode : {};
|
|
787
|
-
} catch (_) {}
|
|
788
|
-
|
|
789
|
-
var hooks = {};
|
|
790
|
-
|
|
791
|
-
/**
|
|
792
|
-
* Expose whether this browser supports running the full DOMPurify.
|
|
793
|
-
*/
|
|
794
|
-
DOMPurify.isSupported = typeof getParentNode === 'function' && implementation && typeof implementation.createHTMLDocument !== 'undefined' && documentMode !== 9;
|
|
795
|
-
|
|
796
|
-
var MUSTACHE_EXPR$$1 = MUSTACHE_EXPR,
|
|
797
|
-
ERB_EXPR$$1 = ERB_EXPR,
|
|
798
|
-
DATA_ATTR$$1 = DATA_ATTR,
|
|
799
|
-
ARIA_ATTR$$1 = ARIA_ATTR,
|
|
800
|
-
IS_SCRIPT_OR_DATA$$1 = IS_SCRIPT_OR_DATA,
|
|
801
|
-
ATTR_WHITESPACE$$1 = ATTR_WHITESPACE;
|
|
802
|
-
var IS_ALLOWED_URI$$1 = IS_ALLOWED_URI;
|
|
803
|
-
|
|
804
|
-
/**
|
|
805
|
-
* We consider the elements and attributes below to be safe. Ideally
|
|
806
|
-
* don't add any new ones but feel free to remove unwanted ones.
|
|
807
|
-
*/
|
|
808
|
-
|
|
809
|
-
/* allowed element names */
|
|
810
|
-
|
|
811
|
-
var ALLOWED_TAGS = null;
|
|
812
|
-
var DEFAULT_ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray$1(html), _toConsumableArray$1(svg), _toConsumableArray$1(svgFilters), _toConsumableArray$1(mathMl), _toConsumableArray$1(text)));
|
|
813
|
-
|
|
814
|
-
/* Allowed attribute names */
|
|
815
|
-
var ALLOWED_ATTR = null;
|
|
816
|
-
var DEFAULT_ALLOWED_ATTR = addToSet({}, [].concat(_toConsumableArray$1(html$1), _toConsumableArray$1(svg$1), _toConsumableArray$1(mathMl$1), _toConsumableArray$1(xml)));
|
|
817
|
-
|
|
818
|
-
/* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */
|
|
819
|
-
var FORBID_TAGS = null;
|
|
820
|
-
|
|
821
|
-
/* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
|
|
822
|
-
var FORBID_ATTR = null;
|
|
823
|
-
|
|
824
|
-
/* Decide if ARIA attributes are okay */
|
|
825
|
-
var ALLOW_ARIA_ATTR = true;
|
|
826
|
-
|
|
827
|
-
/* Decide if custom data attributes are okay */
|
|
828
|
-
var ALLOW_DATA_ATTR = true;
|
|
829
|
-
|
|
830
|
-
/* Decide if unknown protocols are okay */
|
|
831
|
-
var ALLOW_UNKNOWN_PROTOCOLS = false;
|
|
832
|
-
|
|
833
|
-
/* Output should be safe for common template engines.
|
|
834
|
-
* This means, DOMPurify removes data attributes, mustaches and ERB
|
|
835
|
-
*/
|
|
836
|
-
var SAFE_FOR_TEMPLATES = false;
|
|
837
|
-
|
|
838
|
-
/* Decide if document with <html>... should be returned */
|
|
839
|
-
var WHOLE_DOCUMENT = false;
|
|
840
|
-
|
|
841
|
-
/* Track whether config is already set on this instance of DOMPurify. */
|
|
842
|
-
var SET_CONFIG = false;
|
|
843
|
-
|
|
844
|
-
/* Decide if all elements (e.g. style, script) must be children of
|
|
845
|
-
* document.body. By default, browsers might move them to document.head */
|
|
846
|
-
var FORCE_BODY = false;
|
|
847
|
-
|
|
848
|
-
/* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html
|
|
849
|
-
* string (or a TrustedHTML object if Trusted Types are supported).
|
|
850
|
-
* If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead
|
|
851
|
-
*/
|
|
852
|
-
var RETURN_DOM = false;
|
|
853
|
-
|
|
854
|
-
/* Decide if a DOM `DocumentFragment` should be returned, instead of a html
|
|
855
|
-
* string (or a TrustedHTML object if Trusted Types are supported) */
|
|
856
|
-
var RETURN_DOM_FRAGMENT = false;
|
|
857
|
-
|
|
858
|
-
/* If `RETURN_DOM` or `RETURN_DOM_FRAGMENT` is enabled, decide if the returned DOM
|
|
859
|
-
* `Node` is imported into the current `Document`. If this flag is not enabled the
|
|
860
|
-
* `Node` will belong (its ownerDocument) to a fresh `HTMLDocument`, created by
|
|
861
|
-
* DOMPurify.
|
|
862
|
-
*
|
|
863
|
-
* This defaults to `true` starting DOMPurify 2.2.0. Note that setting it to `false`
|
|
864
|
-
* might cause XSS from attacks hidden in closed shadowroots in case the browser
|
|
865
|
-
* supports Declarative Shadow: DOM https://web.dev/declarative-shadow-dom/
|
|
866
|
-
*/
|
|
867
|
-
var RETURN_DOM_IMPORT = true;
|
|
868
|
-
|
|
869
|
-
/* Try to return a Trusted Type object instead of a string, return a string in
|
|
870
|
-
* case Trusted Types are not supported */
|
|
871
|
-
var RETURN_TRUSTED_TYPE = false;
|
|
872
|
-
|
|
873
|
-
/* Output should be free from DOM clobbering attacks? */
|
|
874
|
-
var SANITIZE_DOM = true;
|
|
875
|
-
|
|
876
|
-
/* Keep element content when removing element? */
|
|
877
|
-
var KEEP_CONTENT = true;
|
|
878
|
-
|
|
879
|
-
/* If a `Node` is passed to sanitize(), then performs sanitization in-place instead
|
|
880
|
-
* of importing it into a new Document and returning a sanitized copy */
|
|
881
|
-
var IN_PLACE = false;
|
|
882
|
-
|
|
883
|
-
/* Allow usage of profiles like html, svg and mathMl */
|
|
884
|
-
var USE_PROFILES = {};
|
|
885
|
-
|
|
886
|
-
/* Tags to ignore content of when KEEP_CONTENT is true */
|
|
887
|
-
var FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);
|
|
888
|
-
|
|
889
|
-
/* Tags that are safe for data: URIs */
|
|
890
|
-
var DATA_URI_TAGS = null;
|
|
891
|
-
var DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
|
|
892
|
-
|
|
893
|
-
/* Attributes safe for values like "javascript:" */
|
|
894
|
-
var URI_SAFE_ATTRIBUTES = null;
|
|
895
|
-
var DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'summary', 'title', 'value', 'style', 'xmlns']);
|
|
896
|
-
|
|
897
|
-
var MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
|
|
898
|
-
var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
|
|
899
|
-
var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
|
|
900
|
-
/* Document namespace */
|
|
901
|
-
var NAMESPACE = HTML_NAMESPACE;
|
|
902
|
-
var IS_EMPTY_INPUT = false;
|
|
903
|
-
|
|
904
|
-
/* Keep a reference to config to pass to hooks */
|
|
905
|
-
var CONFIG = null;
|
|
906
|
-
|
|
907
|
-
/* Ideally, do not touch anything below this line */
|
|
908
|
-
/* ______________________________________________ */
|
|
909
|
-
|
|
910
|
-
var formElement = document.createElement('form');
|
|
911
|
-
|
|
912
|
-
/**
|
|
913
|
-
* _parseConfig
|
|
914
|
-
*
|
|
915
|
-
* @param {Object} cfg optional config literal
|
|
916
|
-
*/
|
|
917
|
-
// eslint-disable-next-line complexity
|
|
918
|
-
var _parseConfig = function _parseConfig(cfg) {
|
|
919
|
-
if (CONFIG && CONFIG === cfg) {
|
|
920
|
-
return;
|
|
921
|
-
}
|
|
922
|
-
|
|
923
|
-
/* Shield configuration object from tampering */
|
|
924
|
-
if (!cfg || (typeof cfg === 'undefined' ? 'undefined' : _typeof(cfg)) !== 'object') {
|
|
925
|
-
cfg = {};
|
|
926
|
-
}
|
|
927
|
-
|
|
928
|
-
/* Shield configuration object from prototype pollution */
|
|
929
|
-
cfg = clone(cfg);
|
|
930
|
-
|
|
931
|
-
/* Set configuration parameters */
|
|
932
|
-
ALLOWED_TAGS = 'ALLOWED_TAGS' in cfg ? addToSet({}, cfg.ALLOWED_TAGS) : DEFAULT_ALLOWED_TAGS;
|
|
933
|
-
ALLOWED_ATTR = 'ALLOWED_ATTR' in cfg ? addToSet({}, cfg.ALLOWED_ATTR) : DEFAULT_ALLOWED_ATTR;
|
|
934
|
-
URI_SAFE_ATTRIBUTES = 'ADD_URI_SAFE_ATTR' in cfg ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR) : DEFAULT_URI_SAFE_ATTRIBUTES;
|
|
935
|
-
DATA_URI_TAGS = 'ADD_DATA_URI_TAGS' in cfg ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS) : DEFAULT_DATA_URI_TAGS;
|
|
936
|
-
FORBID_TAGS = 'FORBID_TAGS' in cfg ? addToSet({}, cfg.FORBID_TAGS) : {};
|
|
937
|
-
FORBID_ATTR = 'FORBID_ATTR' in cfg ? addToSet({}, cfg.FORBID_ATTR) : {};
|
|
938
|
-
USE_PROFILES = 'USE_PROFILES' in cfg ? cfg.USE_PROFILES : false;
|
|
939
|
-
ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
|
|
940
|
-
ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
|
|
941
|
-
ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false
|
|
942
|
-
SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false
|
|
943
|
-
WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false
|
|
944
|
-
RETURN_DOM = cfg.RETURN_DOM || false; // Default false
|
|
945
|
-
RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false
|
|
946
|
-
RETURN_DOM_IMPORT = cfg.RETURN_DOM_IMPORT !== false; // Default true
|
|
947
|
-
RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false
|
|
948
|
-
FORCE_BODY = cfg.FORCE_BODY || false; // Default false
|
|
949
|
-
SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true
|
|
950
|
-
KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true
|
|
951
|
-
IN_PLACE = cfg.IN_PLACE || false; // Default false
|
|
952
|
-
IS_ALLOWED_URI$$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI$$1;
|
|
953
|
-
NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
|
|
954
|
-
if (SAFE_FOR_TEMPLATES) {
|
|
955
|
-
ALLOW_DATA_ATTR = false;
|
|
956
|
-
}
|
|
957
|
-
|
|
958
|
-
if (RETURN_DOM_FRAGMENT) {
|
|
959
|
-
RETURN_DOM = true;
|
|
960
|
-
}
|
|
961
|
-
|
|
962
|
-
/* Parse profile info */
|
|
963
|
-
if (USE_PROFILES) {
|
|
964
|
-
ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray$1(text)));
|
|
965
|
-
ALLOWED_ATTR = [];
|
|
966
|
-
if (USE_PROFILES.html === true) {
|
|
967
|
-
addToSet(ALLOWED_TAGS, html);
|
|
968
|
-
addToSet(ALLOWED_ATTR, html$1);
|
|
969
|
-
}
|
|
970
|
-
|
|
971
|
-
if (USE_PROFILES.svg === true) {
|
|
972
|
-
addToSet(ALLOWED_TAGS, svg);
|
|
973
|
-
addToSet(ALLOWED_ATTR, svg$1);
|
|
974
|
-
addToSet(ALLOWED_ATTR, xml);
|
|
975
|
-
}
|
|
976
|
-
|
|
977
|
-
if (USE_PROFILES.svgFilters === true) {
|
|
978
|
-
addToSet(ALLOWED_TAGS, svgFilters);
|
|
979
|
-
addToSet(ALLOWED_ATTR, svg$1);
|
|
980
|
-
addToSet(ALLOWED_ATTR, xml);
|
|
981
|
-
}
|
|
982
|
-
|
|
983
|
-
if (USE_PROFILES.mathMl === true) {
|
|
984
|
-
addToSet(ALLOWED_TAGS, mathMl);
|
|
985
|
-
addToSet(ALLOWED_ATTR, mathMl$1);
|
|
986
|
-
addToSet(ALLOWED_ATTR, xml);
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
/* Merge configuration parameters */
|
|
991
|
-
if (cfg.ADD_TAGS) {
|
|
992
|
-
if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
|
|
993
|
-
ALLOWED_TAGS = clone(ALLOWED_TAGS);
|
|
994
|
-
}
|
|
995
|
-
|
|
996
|
-
addToSet(ALLOWED_TAGS, cfg.ADD_TAGS);
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
if (cfg.ADD_ATTR) {
|
|
1000
|
-
if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
|
|
1001
|
-
ALLOWED_ATTR = clone(ALLOWED_ATTR);
|
|
1002
|
-
}
|
|
1003
|
-
|
|
1004
|
-
addToSet(ALLOWED_ATTR, cfg.ADD_ATTR);
|
|
1005
|
-
}
|
|
1006
|
-
|
|
1007
|
-
if (cfg.ADD_URI_SAFE_ATTR) {
|
|
1008
|
-
addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR);
|
|
1009
|
-
}
|
|
1010
|
-
|
|
1011
|
-
/* Add #text in case KEEP_CONTENT is set to true */
|
|
1012
|
-
if (KEEP_CONTENT) {
|
|
1013
|
-
ALLOWED_TAGS['#text'] = true;
|
|
1014
|
-
}
|
|
1015
|
-
|
|
1016
|
-
/* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */
|
|
1017
|
-
if (WHOLE_DOCUMENT) {
|
|
1018
|
-
addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);
|
|
1019
|
-
}
|
|
1020
|
-
|
|
1021
|
-
/* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */
|
|
1022
|
-
if (ALLOWED_TAGS.table) {
|
|
1023
|
-
addToSet(ALLOWED_TAGS, ['tbody']);
|
|
1024
|
-
delete FORBID_TAGS.tbody;
|
|
1025
|
-
}
|
|
1026
|
-
|
|
1027
|
-
// Prevent further manipulation of configuration.
|
|
1028
|
-
// Not available in IE8, Safari 5, etc.
|
|
1029
|
-
if (freeze) {
|
|
1030
|
-
freeze(cfg);
|
|
1031
|
-
}
|
|
1032
|
-
|
|
1033
|
-
CONFIG = cfg;
|
|
1034
|
-
};
|
|
1035
|
-
|
|
1036
|
-
var MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
|
|
1037
|
-
|
|
1038
|
-
var HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'desc', 'title', 'annotation-xml']);
|
|
1039
|
-
|
|
1040
|
-
/* Keep track of all possible SVG and MathML tags
|
|
1041
|
-
* so that we can perform the namespace checks
|
|
1042
|
-
* correctly. */
|
|
1043
|
-
var ALL_SVG_TAGS = addToSet({}, svg);
|
|
1044
|
-
addToSet(ALL_SVG_TAGS, svgFilters);
|
|
1045
|
-
addToSet(ALL_SVG_TAGS, svgDisallowed);
|
|
1046
|
-
|
|
1047
|
-
var ALL_MATHML_TAGS = addToSet({}, mathMl);
|
|
1048
|
-
addToSet(ALL_MATHML_TAGS, mathMlDisallowed);
|
|
1049
|
-
|
|
1050
|
-
/**
|
|
1051
|
-
*
|
|
1052
|
-
*
|
|
1053
|
-
* @param {Element} element a DOM element whose namespace is being checked
|
|
1054
|
-
* @returns {boolean} Return false if the element has a
|
|
1055
|
-
* namespace that a spec-compliant parser would never
|
|
1056
|
-
* return. Return true otherwise.
|
|
1057
|
-
*/
|
|
1058
|
-
var _checkValidNamespace = function _checkValidNamespace(element) {
|
|
1059
|
-
var parent = getParentNode(element);
|
|
1060
|
-
|
|
1061
|
-
// In JSDOM, if we're inside shadow DOM, then parentNode
|
|
1062
|
-
// can be null. We just simulate parent in this case.
|
|
1063
|
-
if (!parent || !parent.tagName) {
|
|
1064
|
-
parent = {
|
|
1065
|
-
namespaceURI: HTML_NAMESPACE,
|
|
1066
|
-
tagName: 'template'
|
|
1067
|
-
};
|
|
1068
|
-
}
|
|
1069
|
-
|
|
1070
|
-
var tagName = stringToLowerCase(element.tagName);
|
|
1071
|
-
var parentTagName = stringToLowerCase(parent.tagName);
|
|
1072
|
-
|
|
1073
|
-
if (element.namespaceURI === SVG_NAMESPACE) {
|
|
1074
|
-
// The only way to switch from HTML namespace to SVG
|
|
1075
|
-
// is via <svg>. If it happens via any other tag, then
|
|
1076
|
-
// it should be killed.
|
|
1077
|
-
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
1078
|
-
return tagName === 'svg';
|
|
1079
|
-
}
|
|
1080
|
-
|
|
1081
|
-
// The only way to switch from MathML to SVG is via
|
|
1082
|
-
// svg if parent is either <annotation-xml> or MathML
|
|
1083
|
-
// text integration points.
|
|
1084
|
-
if (parent.namespaceURI === MATHML_NAMESPACE) {
|
|
1085
|
-
return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
|
|
1086
|
-
}
|
|
1087
|
-
|
|
1088
|
-
// We only allow elements that are defined in SVG
|
|
1089
|
-
// spec. All others are disallowed in SVG namespace.
|
|
1090
|
-
return Boolean(ALL_SVG_TAGS[tagName]);
|
|
1091
|
-
}
|
|
1092
|
-
|
|
1093
|
-
if (element.namespaceURI === MATHML_NAMESPACE) {
|
|
1094
|
-
// The only way to switch from HTML namespace to MathML
|
|
1095
|
-
// is via <math>. If it happens via any other tag, then
|
|
1096
|
-
// it should be killed.
|
|
1097
|
-
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
1098
|
-
return tagName === 'math';
|
|
1099
|
-
}
|
|
1100
|
-
|
|
1101
|
-
// The only way to switch from SVG to MathML is via
|
|
1102
|
-
// <math> and HTML integration points
|
|
1103
|
-
if (parent.namespaceURI === SVG_NAMESPACE) {
|
|
1104
|
-
return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
|
|
1105
|
-
}
|
|
1106
|
-
|
|
1107
|
-
// We only allow elements that are defined in MathML
|
|
1108
|
-
// spec. All others are disallowed in MathML namespace.
|
|
1109
|
-
return Boolean(ALL_MATHML_TAGS[tagName]);
|
|
1110
|
-
}
|
|
1111
|
-
|
|
1112
|
-
if (element.namespaceURI === HTML_NAMESPACE) {
|
|
1113
|
-
// The only way to switch from SVG to HTML is via
|
|
1114
|
-
// HTML integration points, and from MathML to HTML
|
|
1115
|
-
// is via MathML text integration points
|
|
1116
|
-
if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
|
|
1117
|
-
return false;
|
|
1118
|
-
}
|
|
1119
|
-
|
|
1120
|
-
if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
|
|
1121
|
-
return false;
|
|
1122
|
-
}
|
|
1123
|
-
|
|
1124
|
-
// Certain elements are allowed in both SVG and HTML
|
|
1125
|
-
// namespace. We need to specify them explicitly
|
|
1126
|
-
// so that they don't get erronously deleted from
|
|
1127
|
-
// HTML namespace.
|
|
1128
|
-
var commonSvgAndHTMLElements = addToSet({}, ['title', 'style', 'font', 'a', 'script']);
|
|
1129
|
-
|
|
1130
|
-
// We disallow tags that are specific for MathML
|
|
1131
|
-
// or SVG and should never appear in HTML namespace
|
|
1132
|
-
return !ALL_MATHML_TAGS[tagName] && (commonSvgAndHTMLElements[tagName] || !ALL_SVG_TAGS[tagName]);
|
|
1133
|
-
}
|
|
1134
|
-
|
|
1135
|
-
// The code should never reach this place (this means
|
|
1136
|
-
// that the element somehow got namespace that is not
|
|
1137
|
-
// HTML, SVG or MathML). Return false just in case.
|
|
1138
|
-
return false;
|
|
1139
|
-
};
|
|
1140
|
-
|
|
1141
|
-
/**
|
|
1142
|
-
* _forceRemove
|
|
1143
|
-
*
|
|
1144
|
-
* @param {Node} node a DOM node
|
|
1145
|
-
*/
|
|
1146
|
-
var _forceRemove = function _forceRemove(node) {
|
|
1147
|
-
arrayPush(DOMPurify.removed, { element: node });
|
|
1148
|
-
try {
|
|
1149
|
-
// eslint-disable-next-line unicorn/prefer-dom-node-remove
|
|
1150
|
-
node.parentNode.removeChild(node);
|
|
1151
|
-
} catch (_) {
|
|
1152
|
-
try {
|
|
1153
|
-
node.outerHTML = emptyHTML;
|
|
1154
|
-
} catch (_) {
|
|
1155
|
-
node.remove();
|
|
1156
|
-
}
|
|
1157
|
-
}
|
|
1158
|
-
};
|
|
1159
|
-
|
|
1160
|
-
/**
|
|
1161
|
-
* _removeAttribute
|
|
1162
|
-
*
|
|
1163
|
-
* @param {String} name an Attribute name
|
|
1164
|
-
* @param {Node} node a DOM node
|
|
1165
|
-
*/
|
|
1166
|
-
var _removeAttribute = function _removeAttribute(name, node) {
|
|
1167
|
-
try {
|
|
1168
|
-
arrayPush(DOMPurify.removed, {
|
|
1169
|
-
attribute: node.getAttributeNode(name),
|
|
1170
|
-
from: node
|
|
1171
|
-
});
|
|
1172
|
-
} catch (_) {
|
|
1173
|
-
arrayPush(DOMPurify.removed, {
|
|
1174
|
-
attribute: null,
|
|
1175
|
-
from: node
|
|
1176
|
-
});
|
|
1177
|
-
}
|
|
1178
|
-
|
|
1179
|
-
node.removeAttribute(name);
|
|
1180
|
-
|
|
1181
|
-
// We void attribute values for unremovable "is"" attributes
|
|
1182
|
-
if (name === 'is' && !ALLOWED_ATTR[name]) {
|
|
1183
|
-
if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
|
|
1184
|
-
try {
|
|
1185
|
-
_forceRemove(node);
|
|
1186
|
-
} catch (_) {}
|
|
1187
|
-
} else {
|
|
1188
|
-
try {
|
|
1189
|
-
node.setAttribute(name, '');
|
|
1190
|
-
} catch (_) {}
|
|
1191
|
-
}
|
|
1192
|
-
}
|
|
1193
|
-
};
|
|
1194
|
-
|
|
1195
|
-
/**
|
|
1196
|
-
* _initDocument
|
|
1197
|
-
*
|
|
1198
|
-
* @param {String} dirty a string of dirty markup
|
|
1199
|
-
* @return {Document} a DOM, filled with the dirty markup
|
|
1200
|
-
*/
|
|
1201
|
-
var _initDocument = function _initDocument(dirty) {
|
|
1202
|
-
/* Create a HTML document */
|
|
1203
|
-
var doc = void 0;
|
|
1204
|
-
var leadingWhitespace = void 0;
|
|
1205
|
-
|
|
1206
|
-
if (FORCE_BODY) {
|
|
1207
|
-
dirty = '<remove></remove>' + dirty;
|
|
1208
|
-
} else {
|
|
1209
|
-
/* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */
|
|
1210
|
-
var matches = stringMatch(dirty, /^[\r\n\t ]+/);
|
|
1211
|
-
leadingWhitespace = matches && matches[0];
|
|
1212
|
-
}
|
|
1213
|
-
|
|
1214
|
-
var dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
|
|
1215
|
-
/*
|
|
1216
|
-
* Use the DOMParser API by default, fallback later if needs be
|
|
1217
|
-
* DOMParser not work for svg when has multiple root element.
|
|
1218
|
-
*/
|
|
1219
|
-
if (NAMESPACE === HTML_NAMESPACE) {
|
|
1220
|
-
try {
|
|
1221
|
-
doc = new DOMParser().parseFromString(dirtyPayload, 'text/html');
|
|
1222
|
-
} catch (_) {}
|
|
1223
|
-
}
|
|
1224
|
-
|
|
1225
|
-
/* Use createHTMLDocument in case DOMParser is not available */
|
|
1226
|
-
if (!doc || !doc.documentElement) {
|
|
1227
|
-
doc = implementation.createDocument(NAMESPACE, 'template', null);
|
|
1228
|
-
try {
|
|
1229
|
-
doc.documentElement.innerHTML = IS_EMPTY_INPUT ? '' : dirtyPayload;
|
|
1230
|
-
} catch (_) {
|
|
1231
|
-
// Syntax error if dirtyPayload is invalid xml
|
|
1232
|
-
}
|
|
1233
|
-
}
|
|
1234
|
-
|
|
1235
|
-
var body = doc.body || doc.documentElement;
|
|
1236
|
-
|
|
1237
|
-
if (dirty && leadingWhitespace) {
|
|
1238
|
-
body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
|
|
1239
|
-
}
|
|
1240
|
-
|
|
1241
|
-
/* Work on whole document or just its body */
|
|
1242
|
-
return WHOLE_DOCUMENT ? doc.documentElement : body;
|
|
1243
|
-
};
|
|
1244
|
-
|
|
1245
|
-
/**
|
|
1246
|
-
* _createIterator
|
|
1247
|
-
*
|
|
1248
|
-
* @param {Document} root document/fragment to create iterator for
|
|
1249
|
-
* @return {Iterator} iterator instance
|
|
1250
|
-
*/
|
|
1251
|
-
var _createIterator = function _createIterator(root) {
|
|
1252
|
-
return createNodeIterator.call(root.ownerDocument || root, root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, null, false);
|
|
1253
|
-
};
|
|
1254
|
-
|
|
1255
|
-
/**
|
|
1256
|
-
* _isClobbered
|
|
1257
|
-
*
|
|
1258
|
-
* @param {Node} elm element to check for clobbering attacks
|
|
1259
|
-
* @return {Boolean} true if clobbered, false if safe
|
|
1260
|
-
*/
|
|
1261
|
-
var _isClobbered = function _isClobbered(elm) {
|
|
1262
|
-
if (elm instanceof Text || elm instanceof Comment) {
|
|
1263
|
-
return false;
|
|
1264
|
-
}
|
|
1265
|
-
|
|
1266
|
-
if (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function') {
|
|
1267
|
-
return true;
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
|
-
return false;
|
|
1271
|
-
};
|
|
1272
|
-
|
|
1273
|
-
/**
|
|
1274
|
-
* _isNode
|
|
1275
|
-
*
|
|
1276
|
-
* @param {Node} obj object to check whether it's a DOM node
|
|
1277
|
-
* @return {Boolean} true is object is a DOM node
|
|
1278
|
-
*/
|
|
1279
|
-
var _isNode = function _isNode(object) {
|
|
1280
|
-
return (typeof Node === 'undefined' ? 'undefined' : _typeof(Node)) === 'object' ? object instanceof Node : object && (typeof object === 'undefined' ? 'undefined' : _typeof(object)) === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string';
|
|
1281
|
-
};
|
|
1282
|
-
|
|
1283
|
-
/**
|
|
1284
|
-
* _executeHook
|
|
1285
|
-
* Execute user configurable hooks
|
|
1286
|
-
*
|
|
1287
|
-
* @param {String} entryPoint Name of the hook's entry point
|
|
1288
|
-
* @param {Node} currentNode node to work on with the hook
|
|
1289
|
-
* @param {Object} data additional hook parameters
|
|
1290
|
-
*/
|
|
1291
|
-
var _executeHook = function _executeHook(entryPoint, currentNode, data) {
|
|
1292
|
-
if (!hooks[entryPoint]) {
|
|
1293
|
-
return;
|
|
1294
|
-
}
|
|
1295
|
-
|
|
1296
|
-
arrayForEach(hooks[entryPoint], function (hook) {
|
|
1297
|
-
hook.call(DOMPurify, currentNode, data, CONFIG);
|
|
1298
|
-
});
|
|
1299
|
-
};
|
|
1300
|
-
|
|
1301
|
-
/**
|
|
1302
|
-
* _sanitizeElements
|
|
1303
|
-
*
|
|
1304
|
-
* @protect nodeName
|
|
1305
|
-
* @protect textContent
|
|
1306
|
-
* @protect removeChild
|
|
1307
|
-
*
|
|
1308
|
-
* @param {Node} currentNode to check for permission to exist
|
|
1309
|
-
* @return {Boolean} true if node was killed, false if left alive
|
|
1310
|
-
*/
|
|
1311
|
-
var _sanitizeElements = function _sanitizeElements(currentNode) {
|
|
1312
|
-
var content = void 0;
|
|
1313
|
-
|
|
1314
|
-
/* Execute a hook if present */
|
|
1315
|
-
_executeHook('beforeSanitizeElements', currentNode, null);
|
|
1316
|
-
|
|
1317
|
-
/* Check if element is clobbered or can clobber */
|
|
1318
|
-
if (_isClobbered(currentNode)) {
|
|
1319
|
-
_forceRemove(currentNode);
|
|
1320
|
-
return true;
|
|
1321
|
-
}
|
|
1322
|
-
|
|
1323
|
-
/* Check if tagname contains Unicode */
|
|
1324
|
-
if (stringMatch(currentNode.nodeName, /[\u0080-\uFFFF]/)) {
|
|
1325
|
-
_forceRemove(currentNode);
|
|
1326
|
-
return true;
|
|
1327
|
-
}
|
|
1328
|
-
|
|
1329
|
-
/* Now let's check the element's type and name */
|
|
1330
|
-
var tagName = stringToLowerCase(currentNode.nodeName);
|
|
1331
|
-
|
|
1332
|
-
/* Execute a hook if present */
|
|
1333
|
-
_executeHook('uponSanitizeElement', currentNode, {
|
|
1334
|
-
tagName: tagName,
|
|
1335
|
-
allowedTags: ALLOWED_TAGS
|
|
1336
|
-
});
|
|
1337
|
-
|
|
1338
|
-
/* Detect mXSS attempts abusing namespace confusion */
|
|
1339
|
-
if (!_isNode(currentNode.firstElementChild) && (!_isNode(currentNode.content) || !_isNode(currentNode.content.firstElementChild)) && regExpTest(/<[/\w]/g, currentNode.innerHTML) && regExpTest(/<[/\w]/g, currentNode.textContent)) {
|
|
1340
|
-
_forceRemove(currentNode);
|
|
1341
|
-
return true;
|
|
1342
|
-
}
|
|
1343
|
-
|
|
1344
|
-
/* Remove element if anything forbids its presence */
|
|
1345
|
-
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
|
1346
|
-
/* Keep content except for bad-listed elements */
|
|
1347
|
-
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
|
|
1348
|
-
var parentNode = getParentNode(currentNode) || currentNode.parentNode;
|
|
1349
|
-
var childNodes = getChildNodes(currentNode) || currentNode.childNodes;
|
|
1350
|
-
|
|
1351
|
-
if (childNodes && parentNode) {
|
|
1352
|
-
var childCount = childNodes.length;
|
|
1353
|
-
|
|
1354
|
-
for (var i = childCount - 1; i >= 0; --i) {
|
|
1355
|
-
parentNode.insertBefore(cloneNode(childNodes[i], true), getNextSibling(currentNode));
|
|
1356
|
-
}
|
|
1357
|
-
}
|
|
1358
|
-
}
|
|
1359
|
-
|
|
1360
|
-
_forceRemove(currentNode);
|
|
1361
|
-
return true;
|
|
1362
|
-
}
|
|
1363
|
-
|
|
1364
|
-
/* Check whether element has a valid namespace */
|
|
1365
|
-
if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
|
|
1366
|
-
_forceRemove(currentNode);
|
|
1367
|
-
return true;
|
|
1368
|
-
}
|
|
1369
|
-
|
|
1370
|
-
if ((tagName === 'noscript' || tagName === 'noembed') && regExpTest(/<\/no(script|embed)/i, currentNode.innerHTML)) {
|
|
1371
|
-
_forceRemove(currentNode);
|
|
1372
|
-
return true;
|
|
1373
|
-
}
|
|
1374
|
-
|
|
1375
|
-
/* Sanitize element content to be template-safe */
|
|
1376
|
-
if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {
|
|
1377
|
-
/* Get the element's text content */
|
|
1378
|
-
content = currentNode.textContent;
|
|
1379
|
-
content = stringReplace(content, MUSTACHE_EXPR$$1, ' ');
|
|
1380
|
-
content = stringReplace(content, ERB_EXPR$$1, ' ');
|
|
1381
|
-
if (currentNode.textContent !== content) {
|
|
1382
|
-
arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });
|
|
1383
|
-
currentNode.textContent = content;
|
|
1384
|
-
}
|
|
1385
|
-
}
|
|
1386
|
-
|
|
1387
|
-
/* Execute a hook if present */
|
|
1388
|
-
_executeHook('afterSanitizeElements', currentNode, null);
|
|
1389
|
-
|
|
1390
|
-
return false;
|
|
1391
|
-
};
|
|
1392
|
-
|
|
1393
|
-
/**
|
|
1394
|
-
* _isValidAttribute
|
|
1395
|
-
*
|
|
1396
|
-
* @param {string} lcTag Lowercase tag name of containing element.
|
|
1397
|
-
* @param {string} lcName Lowercase attribute name.
|
|
1398
|
-
* @param {string} value Attribute value.
|
|
1399
|
-
* @return {Boolean} Returns true if `value` is valid, otherwise false.
|
|
1400
|
-
*/
|
|
1401
|
-
// eslint-disable-next-line complexity
|
|
1402
|
-
var _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
|
|
1403
|
-
/* Make sure attribute cannot clobber */
|
|
1404
|
-
if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
|
|
1405
|
-
return false;
|
|
1406
|
-
}
|
|
1407
|
-
|
|
1408
|
-
/* Allow valid data-* attributes: At least one character after "-"
|
|
1409
|
-
(https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
|
|
1410
|
-
XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
|
|
1411
|
-
We don't need to check the value; it's always URI safe. */
|
|
1412
|
-
if (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$$1, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$$1, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
|
|
1413
|
-
return false;
|
|
1414
|
-
|
|
1415
|
-
/* Check value is safe. First, is attr inert? If so, is safe */
|
|
1416
|
-
} else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$$1, stringReplace(value, ATTR_WHITESPACE$$1, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$$1, stringReplace(value, ATTR_WHITESPACE$$1, ''))) ; else if (!value) ; else {
|
|
1417
|
-
return false;
|
|
1418
|
-
}
|
|
1419
|
-
|
|
1420
|
-
return true;
|
|
1421
|
-
};
|
|
1422
|
-
|
|
1423
|
-
/**
|
|
1424
|
-
* _sanitizeAttributes
|
|
1425
|
-
*
|
|
1426
|
-
* @protect attributes
|
|
1427
|
-
* @protect nodeName
|
|
1428
|
-
* @protect removeAttribute
|
|
1429
|
-
* @protect setAttribute
|
|
1430
|
-
*
|
|
1431
|
-
* @param {Node} currentNode to sanitize
|
|
1432
|
-
*/
|
|
1433
|
-
var _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
|
|
1434
|
-
var attr = void 0;
|
|
1435
|
-
var value = void 0;
|
|
1436
|
-
var lcName = void 0;
|
|
1437
|
-
var l = void 0;
|
|
1438
|
-
/* Execute a hook if present */
|
|
1439
|
-
_executeHook('beforeSanitizeAttributes', currentNode, null);
|
|
1440
|
-
|
|
1441
|
-
var attributes = currentNode.attributes;
|
|
1442
|
-
|
|
1443
|
-
/* Check if we have attributes; if not we might have a text node */
|
|
1444
|
-
|
|
1445
|
-
if (!attributes) {
|
|
1446
|
-
return;
|
|
1447
|
-
}
|
|
1448
|
-
|
|
1449
|
-
var hookEvent = {
|
|
1450
|
-
attrName: '',
|
|
1451
|
-
attrValue: '',
|
|
1452
|
-
keepAttr: true,
|
|
1453
|
-
allowedAttributes: ALLOWED_ATTR
|
|
1454
|
-
};
|
|
1455
|
-
l = attributes.length;
|
|
1456
|
-
|
|
1457
|
-
/* Go backwards over all attributes; safely remove bad ones */
|
|
1458
|
-
while (l--) {
|
|
1459
|
-
attr = attributes[l];
|
|
1460
|
-
var _attr = attr,
|
|
1461
|
-
name = _attr.name,
|
|
1462
|
-
namespaceURI = _attr.namespaceURI;
|
|
1463
|
-
|
|
1464
|
-
value = stringTrim(attr.value);
|
|
1465
|
-
lcName = stringToLowerCase(name);
|
|
1466
|
-
|
|
1467
|
-
/* Execute a hook if present */
|
|
1468
|
-
hookEvent.attrName = lcName;
|
|
1469
|
-
hookEvent.attrValue = value;
|
|
1470
|
-
hookEvent.keepAttr = true;
|
|
1471
|
-
hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set
|
|
1472
|
-
_executeHook('uponSanitizeAttribute', currentNode, hookEvent);
|
|
1473
|
-
value = hookEvent.attrValue;
|
|
1474
|
-
/* Did the hooks approve of the attribute? */
|
|
1475
|
-
if (hookEvent.forceKeepAttr) {
|
|
1476
|
-
continue;
|
|
1477
|
-
}
|
|
1478
|
-
|
|
1479
|
-
/* Remove attribute */
|
|
1480
|
-
_removeAttribute(name, currentNode);
|
|
1481
|
-
|
|
1482
|
-
/* Did the hooks approve of the attribute? */
|
|
1483
|
-
if (!hookEvent.keepAttr) {
|
|
1484
|
-
continue;
|
|
1485
|
-
}
|
|
1486
|
-
|
|
1487
|
-
/* Work around a security issue in jQuery 3.0 */
|
|
1488
|
-
if (regExpTest(/\/>/i, value)) {
|
|
1489
|
-
_removeAttribute(name, currentNode);
|
|
1490
|
-
continue;
|
|
1491
|
-
}
|
|
1492
|
-
|
|
1493
|
-
/* Sanitize attribute content to be template-safe */
|
|
1494
|
-
if (SAFE_FOR_TEMPLATES) {
|
|
1495
|
-
value = stringReplace(value, MUSTACHE_EXPR$$1, ' ');
|
|
1496
|
-
value = stringReplace(value, ERB_EXPR$$1, ' ');
|
|
1497
|
-
}
|
|
1498
|
-
|
|
1499
|
-
/* Is `value` valid for this attribute? */
|
|
1500
|
-
var lcTag = currentNode.nodeName.toLowerCase();
|
|
1501
|
-
if (!_isValidAttribute(lcTag, lcName, value)) {
|
|
1502
|
-
continue;
|
|
1503
|
-
}
|
|
1504
|
-
|
|
1505
|
-
/* Handle invalid data-* attribute set by try-catching it */
|
|
1506
|
-
try {
|
|
1507
|
-
if (namespaceURI) {
|
|
1508
|
-
currentNode.setAttributeNS(namespaceURI, name, value);
|
|
1509
|
-
} else {
|
|
1510
|
-
/* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
|
|
1511
|
-
currentNode.setAttribute(name, value);
|
|
1512
|
-
}
|
|
1513
|
-
|
|
1514
|
-
arrayPop(DOMPurify.removed);
|
|
1515
|
-
} catch (_) {}
|
|
1516
|
-
}
|
|
1517
|
-
|
|
1518
|
-
/* Execute a hook if present */
|
|
1519
|
-
_executeHook('afterSanitizeAttributes', currentNode, null);
|
|
1520
|
-
};
|
|
1521
|
-
|
|
1522
|
-
/**
|
|
1523
|
-
* _sanitizeShadowDOM
|
|
1524
|
-
*
|
|
1525
|
-
* @param {DocumentFragment} fragment to iterate over recursively
|
|
1526
|
-
*/
|
|
1527
|
-
var _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {
|
|
1528
|
-
var shadowNode = void 0;
|
|
1529
|
-
var shadowIterator = _createIterator(fragment);
|
|
1530
|
-
|
|
1531
|
-
/* Execute a hook if present */
|
|
1532
|
-
_executeHook('beforeSanitizeShadowDOM', fragment, null);
|
|
1533
|
-
|
|
1534
|
-
while (shadowNode = shadowIterator.nextNode()) {
|
|
1535
|
-
/* Execute a hook if present */
|
|
1536
|
-
_executeHook('uponSanitizeShadowNode', shadowNode, null);
|
|
1537
|
-
|
|
1538
|
-
/* Sanitize tags and elements */
|
|
1539
|
-
if (_sanitizeElements(shadowNode)) {
|
|
1540
|
-
continue;
|
|
1541
|
-
}
|
|
1542
|
-
|
|
1543
|
-
/* Deep shadow DOM detected */
|
|
1544
|
-
if (shadowNode.content instanceof DocumentFragment) {
|
|
1545
|
-
_sanitizeShadowDOM(shadowNode.content);
|
|
1546
|
-
}
|
|
1547
|
-
|
|
1548
|
-
/* Check attributes, sanitize if necessary */
|
|
1549
|
-
_sanitizeAttributes(shadowNode);
|
|
1550
|
-
}
|
|
1551
|
-
|
|
1552
|
-
/* Execute a hook if present */
|
|
1553
|
-
_executeHook('afterSanitizeShadowDOM', fragment, null);
|
|
1554
|
-
};
|
|
1555
|
-
|
|
1556
|
-
/**
|
|
1557
|
-
* Sanitize
|
|
1558
|
-
* Public method providing core sanitation functionality
|
|
1559
|
-
*
|
|
1560
|
-
* @param {String|Node} dirty string or DOM node
|
|
1561
|
-
* @param {Object} configuration object
|
|
1562
|
-
*/
|
|
1563
|
-
// eslint-disable-next-line complexity
|
|
1564
|
-
DOMPurify.sanitize = function (dirty, cfg) {
|
|
1565
|
-
var body = void 0;
|
|
1566
|
-
var importedNode = void 0;
|
|
1567
|
-
var currentNode = void 0;
|
|
1568
|
-
var oldNode = void 0;
|
|
1569
|
-
var returnNode = void 0;
|
|
1570
|
-
/* Make sure we have a string to sanitize.
|
|
1571
|
-
DO NOT return early, as this will return the wrong type if
|
|
1572
|
-
the user has requested a DOM object rather than a string */
|
|
1573
|
-
IS_EMPTY_INPUT = !dirty;
|
|
1574
|
-
if (IS_EMPTY_INPUT) {
|
|
1575
|
-
dirty = '<!-->';
|
|
1576
|
-
}
|
|
1577
|
-
|
|
1578
|
-
/* Stringify, in case dirty is an object */
|
|
1579
|
-
if (typeof dirty !== 'string' && !_isNode(dirty)) {
|
|
1580
|
-
// eslint-disable-next-line no-negated-condition
|
|
1581
|
-
if (typeof dirty.toString !== 'function') {
|
|
1582
|
-
throw typeErrorCreate('toString is not a function');
|
|
1583
|
-
} else {
|
|
1584
|
-
dirty = dirty.toString();
|
|
1585
|
-
if (typeof dirty !== 'string') {
|
|
1586
|
-
throw typeErrorCreate('dirty is not a string, aborting');
|
|
1587
|
-
}
|
|
1588
|
-
}
|
|
1589
|
-
}
|
|
1590
|
-
|
|
1591
|
-
/* Check we can run. Otherwise fall back or ignore */
|
|
1592
|
-
if (!DOMPurify.isSupported) {
|
|
1593
|
-
if (_typeof(window.toStaticHTML) === 'object' || typeof window.toStaticHTML === 'function') {
|
|
1594
|
-
if (typeof dirty === 'string') {
|
|
1595
|
-
return window.toStaticHTML(dirty);
|
|
1596
|
-
}
|
|
1597
|
-
|
|
1598
|
-
if (_isNode(dirty)) {
|
|
1599
|
-
return window.toStaticHTML(dirty.outerHTML);
|
|
1600
|
-
}
|
|
1601
|
-
}
|
|
1602
|
-
|
|
1603
|
-
return dirty;
|
|
1604
|
-
}
|
|
1605
|
-
|
|
1606
|
-
/* Assign config vars */
|
|
1607
|
-
if (!SET_CONFIG) {
|
|
1608
|
-
_parseConfig(cfg);
|
|
1609
|
-
}
|
|
1610
|
-
|
|
1611
|
-
/* Clean up removed elements */
|
|
1612
|
-
DOMPurify.removed = [];
|
|
1613
|
-
|
|
1614
|
-
/* Check if dirty is correctly typed for IN_PLACE */
|
|
1615
|
-
if (typeof dirty === 'string') {
|
|
1616
|
-
IN_PLACE = false;
|
|
1617
|
-
}
|
|
1618
|
-
|
|
1619
|
-
if (IN_PLACE) ; else if (dirty instanceof Node) {
|
|
1620
|
-
/* If dirty is a DOM element, append to an empty document to avoid
|
|
1621
|
-
elements being stripped by the parser */
|
|
1622
|
-
body = _initDocument('<!---->');
|
|
1623
|
-
importedNode = body.ownerDocument.importNode(dirty, true);
|
|
1624
|
-
if (importedNode.nodeType === 1 && importedNode.nodeName === 'BODY') {
|
|
1625
|
-
/* Node is already a body, use as is */
|
|
1626
|
-
body = importedNode;
|
|
1627
|
-
} else if (importedNode.nodeName === 'HTML') {
|
|
1628
|
-
body = importedNode;
|
|
1629
|
-
} else {
|
|
1630
|
-
// eslint-disable-next-line unicorn/prefer-dom-node-append
|
|
1631
|
-
body.appendChild(importedNode);
|
|
1632
|
-
}
|
|
1633
|
-
} else {
|
|
1634
|
-
/* Exit directly if we have nothing to do */
|
|
1635
|
-
if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&
|
|
1636
|
-
// eslint-disable-next-line unicorn/prefer-includes
|
|
1637
|
-
dirty.indexOf('<') === -1) {
|
|
1638
|
-
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
|
|
1639
|
-
}
|
|
1640
|
-
|
|
1641
|
-
/* Initialize the document to work on */
|
|
1642
|
-
body = _initDocument(dirty);
|
|
1643
|
-
|
|
1644
|
-
/* Check we have a DOM node from the data */
|
|
1645
|
-
if (!body) {
|
|
1646
|
-
return RETURN_DOM ? null : emptyHTML;
|
|
1647
|
-
}
|
|
1648
|
-
}
|
|
1649
|
-
|
|
1650
|
-
/* Remove first element node (ours) if FORCE_BODY is set */
|
|
1651
|
-
if (body && FORCE_BODY) {
|
|
1652
|
-
_forceRemove(body.firstChild);
|
|
1653
|
-
}
|
|
1654
|
-
|
|
1655
|
-
/* Get node iterator */
|
|
1656
|
-
var nodeIterator = _createIterator(IN_PLACE ? dirty : body);
|
|
1657
|
-
|
|
1658
|
-
/* Now start iterating over the created document */
|
|
1659
|
-
while (currentNode = nodeIterator.nextNode()) {
|
|
1660
|
-
/* Fix IE's strange behavior with manipulated textNodes #89 */
|
|
1661
|
-
if (currentNode.nodeType === 3 && currentNode === oldNode) {
|
|
1662
|
-
continue;
|
|
1663
|
-
}
|
|
1664
|
-
|
|
1665
|
-
/* Sanitize tags and elements */
|
|
1666
|
-
if (_sanitizeElements(currentNode)) {
|
|
1667
|
-
continue;
|
|
1668
|
-
}
|
|
1669
|
-
|
|
1670
|
-
/* Shadow DOM detected, sanitize it */
|
|
1671
|
-
if (currentNode.content instanceof DocumentFragment) {
|
|
1672
|
-
_sanitizeShadowDOM(currentNode.content);
|
|
1673
|
-
}
|
|
1674
|
-
|
|
1675
|
-
/* Check attributes, sanitize if necessary */
|
|
1676
|
-
_sanitizeAttributes(currentNode);
|
|
1677
|
-
|
|
1678
|
-
oldNode = currentNode;
|
|
1679
|
-
}
|
|
1680
|
-
|
|
1681
|
-
oldNode = null;
|
|
1682
|
-
|
|
1683
|
-
/* If we sanitized `dirty` in-place, return it. */
|
|
1684
|
-
if (IN_PLACE) {
|
|
1685
|
-
return dirty;
|
|
1686
|
-
}
|
|
1687
|
-
|
|
1688
|
-
/* Return sanitized string or DOM */
|
|
1689
|
-
if (RETURN_DOM) {
|
|
1690
|
-
if (RETURN_DOM_FRAGMENT) {
|
|
1691
|
-
returnNode = createDocumentFragment.call(body.ownerDocument);
|
|
1692
|
-
|
|
1693
|
-
while (body.firstChild) {
|
|
1694
|
-
// eslint-disable-next-line unicorn/prefer-dom-node-append
|
|
1695
|
-
returnNode.appendChild(body.firstChild);
|
|
1696
|
-
}
|
|
1697
|
-
} else {
|
|
1698
|
-
returnNode = body;
|
|
1699
|
-
}
|
|
1700
|
-
|
|
1701
|
-
if (RETURN_DOM_IMPORT) {
|
|
1702
|
-
/*
|
|
1703
|
-
AdoptNode() is not used because internal state is not reset
|
|
1704
|
-
(e.g. the past names map of a HTMLFormElement), this is safe
|
|
1705
|
-
in theory but we would rather not risk another attack vector.
|
|
1706
|
-
The state that is cloned by importNode() is explicitly defined
|
|
1707
|
-
by the specs.
|
|
1708
|
-
*/
|
|
1709
|
-
returnNode = importNode.call(originalDocument, returnNode, true);
|
|
1710
|
-
}
|
|
1711
|
-
|
|
1712
|
-
return returnNode;
|
|
1713
|
-
}
|
|
1714
|
-
|
|
1715
|
-
var serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
|
|
1716
|
-
|
|
1717
|
-
/* Sanitize final string template-safe */
|
|
1718
|
-
if (SAFE_FOR_TEMPLATES) {
|
|
1719
|
-
serializedHTML = stringReplace(serializedHTML, MUSTACHE_EXPR$$1, ' ');
|
|
1720
|
-
serializedHTML = stringReplace(serializedHTML, ERB_EXPR$$1, ' ');
|
|
1721
|
-
}
|
|
1722
|
-
|
|
1723
|
-
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
|
|
1724
|
-
};
|
|
1725
|
-
|
|
1726
|
-
/**
|
|
1727
|
-
* Public method to set the configuration once
|
|
1728
|
-
* setConfig
|
|
1729
|
-
*
|
|
1730
|
-
* @param {Object} cfg configuration object
|
|
1731
|
-
*/
|
|
1732
|
-
DOMPurify.setConfig = function (cfg) {
|
|
1733
|
-
_parseConfig(cfg);
|
|
1734
|
-
SET_CONFIG = true;
|
|
1735
|
-
};
|
|
1736
|
-
|
|
1737
|
-
/**
|
|
1738
|
-
* Public method to remove the configuration
|
|
1739
|
-
* clearConfig
|
|
1740
|
-
*
|
|
1741
|
-
*/
|
|
1742
|
-
DOMPurify.clearConfig = function () {
|
|
1743
|
-
CONFIG = null;
|
|
1744
|
-
SET_CONFIG = false;
|
|
1745
|
-
};
|
|
1746
|
-
|
|
1747
|
-
/**
|
|
1748
|
-
* Public method to check if an attribute value is valid.
|
|
1749
|
-
* Uses last set config, if any. Otherwise, uses config defaults.
|
|
1750
|
-
* isValidAttribute
|
|
1751
|
-
*
|
|
1752
|
-
* @param {string} tag Tag name of containing element.
|
|
1753
|
-
* @param {string} attr Attribute name.
|
|
1754
|
-
* @param {string} value Attribute value.
|
|
1755
|
-
* @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.
|
|
1756
|
-
*/
|
|
1757
|
-
DOMPurify.isValidAttribute = function (tag, attr, value) {
|
|
1758
|
-
/* Initialize shared config vars if necessary. */
|
|
1759
|
-
if (!CONFIG) {
|
|
1760
|
-
_parseConfig({});
|
|
1761
|
-
}
|
|
1762
|
-
|
|
1763
|
-
var lcTag = stringToLowerCase(tag);
|
|
1764
|
-
var lcName = stringToLowerCase(attr);
|
|
1765
|
-
return _isValidAttribute(lcTag, lcName, value);
|
|
1766
|
-
};
|
|
1767
|
-
|
|
1768
|
-
/**
|
|
1769
|
-
* AddHook
|
|
1770
|
-
* Public method to add DOMPurify hooks
|
|
1771
|
-
*
|
|
1772
|
-
* @param {String} entryPoint entry point for the hook to add
|
|
1773
|
-
* @param {Function} hookFunction function to execute
|
|
1774
|
-
*/
|
|
1775
|
-
DOMPurify.addHook = function (entryPoint, hookFunction) {
|
|
1776
|
-
if (typeof hookFunction !== 'function') {
|
|
1777
|
-
return;
|
|
1778
|
-
}
|
|
1779
|
-
|
|
1780
|
-
hooks[entryPoint] = hooks[entryPoint] || [];
|
|
1781
|
-
arrayPush(hooks[entryPoint], hookFunction);
|
|
1782
|
-
};
|
|
1783
|
-
|
|
1784
|
-
/**
|
|
1785
|
-
* RemoveHook
|
|
1786
|
-
* Public method to remove a DOMPurify hook at a given entryPoint
|
|
1787
|
-
* (pops it from the stack of hooks if more are present)
|
|
1788
|
-
*
|
|
1789
|
-
* @param {String} entryPoint entry point for the hook to remove
|
|
1790
|
-
*/
|
|
1791
|
-
DOMPurify.removeHook = function (entryPoint) {
|
|
1792
|
-
if (hooks[entryPoint]) {
|
|
1793
|
-
arrayPop(hooks[entryPoint]);
|
|
1794
|
-
}
|
|
1795
|
-
};
|
|
1796
|
-
|
|
1797
|
-
/**
|
|
1798
|
-
* RemoveHooks
|
|
1799
|
-
* Public method to remove all DOMPurify hooks at a given entryPoint
|
|
1800
|
-
*
|
|
1801
|
-
* @param {String} entryPoint entry point for the hooks to remove
|
|
1802
|
-
*/
|
|
1803
|
-
DOMPurify.removeHooks = function (entryPoint) {
|
|
1804
|
-
if (hooks[entryPoint]) {
|
|
1805
|
-
hooks[entryPoint] = [];
|
|
1806
|
-
}
|
|
1807
|
-
};
|
|
1808
|
-
|
|
1809
|
-
/**
|
|
1810
|
-
* RemoveAllHooks
|
|
1811
|
-
* Public method to remove all DOMPurify hooks
|
|
1812
|
-
*
|
|
1813
|
-
*/
|
|
1814
|
-
DOMPurify.removeAllHooks = function () {
|
|
1815
|
-
hooks = {};
|
|
1816
|
-
};
|
|
1817
|
-
|
|
1818
|
-
return DOMPurify;
|
|
1819
|
-
}
|
|
1820
|
-
|
|
1821
|
-
var purify = createDOMPurify();
|
|
1822
|
-
|
|
1823
|
-
return purify;
|
|
1824
|
-
|
|
1825
|
-
}));
|
|
1826
|
-
//# sourceMappingURL=purify.js.map
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
/***/ }),
|
|
1830
|
-
|
|
1831
|
-
/***/ 6808:
|
|
1832
|
-
/***/ ((module, exports, __webpack_require__) => {
|
|
1833
|
-
|
|
1834
|
-
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
|
|
1835
|
-
* JavaScript Cookie v2.2.1
|
|
1836
|
-
* https://github.com/js-cookie/js-cookie
|
|
1837
|
-
*
|
|
1838
|
-
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
|
|
1839
|
-
* Released under the MIT license
|
|
1840
|
-
*/
|
|
1841
|
-
;(function (factory) {
|
|
1842
|
-
var registeredInModuleLoader;
|
|
1843
|
-
if (true) {
|
|
1844
|
-
!(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
|
1845
|
-
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
|
1846
|
-
(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
|
|
1847
|
-
__WEBPACK_AMD_DEFINE_FACTORY__),
|
|
1848
|
-
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
1849
|
-
registeredInModuleLoader = true;
|
|
1850
|
-
}
|
|
1851
|
-
if (true) {
|
|
1852
|
-
module.exports = factory();
|
|
1853
|
-
registeredInModuleLoader = true;
|
|
1854
|
-
}
|
|
1855
|
-
if (!registeredInModuleLoader) {
|
|
1856
|
-
var OldCookies = window.Cookies;
|
|
1857
|
-
var api = window.Cookies = factory();
|
|
1858
|
-
api.noConflict = function () {
|
|
1859
|
-
window.Cookies = OldCookies;
|
|
1860
|
-
return api;
|
|
1861
|
-
};
|
|
1862
|
-
}
|
|
1863
|
-
}(function () {
|
|
1864
|
-
function extend () {
|
|
1865
|
-
var i = 0;
|
|
1866
|
-
var result = {};
|
|
1867
|
-
for (; i < arguments.length; i++) {
|
|
1868
|
-
var attributes = arguments[ i ];
|
|
1869
|
-
for (var key in attributes) {
|
|
1870
|
-
result[key] = attributes[key];
|
|
1871
|
-
}
|
|
1872
|
-
}
|
|
1873
|
-
return result;
|
|
1874
|
-
}
|
|
1875
|
-
|
|
1876
|
-
function decode (s) {
|
|
1877
|
-
return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
|
|
1878
|
-
}
|
|
1879
|
-
|
|
1880
|
-
function init (converter) {
|
|
1881
|
-
function api() {}
|
|
1882
|
-
|
|
1883
|
-
function set (key, value, attributes) {
|
|
1884
|
-
if (typeof document === 'undefined') {
|
|
1885
|
-
return;
|
|
1886
|
-
}
|
|
1887
|
-
|
|
1888
|
-
attributes = extend({
|
|
1889
|
-
path: '/'
|
|
1890
|
-
}, api.defaults, attributes);
|
|
1891
|
-
|
|
1892
|
-
if (typeof attributes.expires === 'number') {
|
|
1893
|
-
attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);
|
|
1894
|
-
}
|
|
1895
|
-
|
|
1896
|
-
// We're using "expires" because "max-age" is not supported by IE
|
|
1897
|
-
attributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';
|
|
1898
|
-
|
|
1899
|
-
try {
|
|
1900
|
-
var result = JSON.stringify(value);
|
|
1901
|
-
if (/^[\{\[]/.test(result)) {
|
|
1902
|
-
value = result;
|
|
1903
|
-
}
|
|
1904
|
-
} catch (e) {}
|
|
1905
|
-
|
|
1906
|
-
value = converter.write ?
|
|
1907
|
-
converter.write(value, key) :
|
|
1908
|
-
encodeURIComponent(String(value))
|
|
1909
|
-
.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
|
|
1910
|
-
|
|
1911
|
-
key = encodeURIComponent(String(key))
|
|
1912
|
-
.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)
|
|
1913
|
-
.replace(/[\(\)]/g, escape);
|
|
1914
|
-
|
|
1915
|
-
var stringifiedAttributes = '';
|
|
1916
|
-
for (var attributeName in attributes) {
|
|
1917
|
-
if (!attributes[attributeName]) {
|
|
1918
|
-
continue;
|
|
1919
|
-
}
|
|
1920
|
-
stringifiedAttributes += '; ' + attributeName;
|
|
1921
|
-
if (attributes[attributeName] === true) {
|
|
1922
|
-
continue;
|
|
1923
|
-
}
|
|
1924
|
-
|
|
1925
|
-
// Considers RFC 6265 section 5.2:
|
|
1926
|
-
// ...
|
|
1927
|
-
// 3. If the remaining unparsed-attributes contains a %x3B (";")
|
|
1928
|
-
// character:
|
|
1929
|
-
// Consume the characters of the unparsed-attributes up to,
|
|
1930
|
-
// not including, the first %x3B (";") character.
|
|
1931
|
-
// ...
|
|
1932
|
-
stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];
|
|
1933
|
-
}
|
|
1934
|
-
|
|
1935
|
-
return (document.cookie = key + '=' + value + stringifiedAttributes);
|
|
1936
|
-
}
|
|
1937
|
-
|
|
1938
|
-
function get (key, json) {
|
|
1939
|
-
if (typeof document === 'undefined') {
|
|
1940
|
-
return;
|
|
1941
|
-
}
|
|
1942
|
-
|
|
1943
|
-
var jar = {};
|
|
1944
|
-
// To prevent the for loop in the first place assign an empty array
|
|
1945
|
-
// in case there are no cookies at all.
|
|
1946
|
-
var cookies = document.cookie ? document.cookie.split('; ') : [];
|
|
1947
|
-
var i = 0;
|
|
1948
|
-
|
|
1949
|
-
for (; i < cookies.length; i++) {
|
|
1950
|
-
var parts = cookies[i].split('=');
|
|
1951
|
-
var cookie = parts.slice(1).join('=');
|
|
1952
|
-
|
|
1953
|
-
if (!json && cookie.charAt(0) === '"') {
|
|
1954
|
-
cookie = cookie.slice(1, -1);
|
|
1955
|
-
}
|
|
1956
|
-
|
|
1957
|
-
try {
|
|
1958
|
-
var name = decode(parts[0]);
|
|
1959
|
-
cookie = (converter.read || converter)(cookie, name) ||
|
|
1960
|
-
decode(cookie);
|
|
1961
|
-
|
|
1962
|
-
if (json) {
|
|
1963
|
-
try {
|
|
1964
|
-
cookie = JSON.parse(cookie);
|
|
1965
|
-
} catch (e) {}
|
|
1966
|
-
}
|
|
1967
|
-
|
|
1968
|
-
jar[name] = cookie;
|
|
1969
|
-
|
|
1970
|
-
if (key === name) {
|
|
1971
|
-
break;
|
|
1972
|
-
}
|
|
1973
|
-
} catch (e) {}
|
|
1974
|
-
}
|
|
1975
|
-
|
|
1976
|
-
return key ? jar[key] : jar;
|
|
1977
|
-
}
|
|
1978
|
-
|
|
1979
|
-
api.set = set;
|
|
1980
|
-
api.get = function (key) {
|
|
1981
|
-
return get(key, false /* read as raw */);
|
|
1982
|
-
};
|
|
1983
|
-
api.getJSON = function (key) {
|
|
1984
|
-
return get(key, true /* read as json */);
|
|
1985
|
-
};
|
|
1986
|
-
api.remove = function (key, attributes) {
|
|
1987
|
-
set(key, '', extend(attributes, {
|
|
1988
|
-
expires: -1
|
|
1989
|
-
}));
|
|
1990
|
-
};
|
|
1991
|
-
|
|
1992
|
-
api.defaults = {};
|
|
1993
|
-
|
|
1994
|
-
api.withConverter = init;
|
|
1995
|
-
|
|
1996
|
-
return api;
|
|
1997
|
-
}
|
|
1998
|
-
|
|
1999
|
-
return init(function () {});
|
|
2000
|
-
}));
|
|
539
|
+
/***/ 6357:
|
|
540
|
+
/***/ ((module) => {
|
|
2001
541
|
|
|
542
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__6357__;
|
|
2002
543
|
|
|
2003
544
|
/***/ }),
|
|
2004
545
|
|
|
2005
|
-
/***/
|
|
2006
|
-
/***/ ((module
|
|
2007
|
-
|
|
2008
|
-
/**
|
|
2009
|
-
* lodash (Custom Build) <https://lodash.com/>
|
|
2010
|
-
* Build: `lodash modularize exports="npm" -o ./`
|
|
2011
|
-
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
|
2012
|
-
* Released under MIT license <https://lodash.com/license>
|
|
2013
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
2014
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
2015
|
-
*/
|
|
2016
|
-
|
|
2017
|
-
/** Used as the `TypeError` message for "Functions" methods. */
|
|
2018
|
-
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
2019
|
-
|
|
2020
|
-
/** Used as references for various `Number` constants. */
|
|
2021
|
-
var NAN = 0 / 0;
|
|
2022
|
-
|
|
2023
|
-
/** `Object#toString` result references. */
|
|
2024
|
-
var symbolTag = '[object Symbol]';
|
|
2025
|
-
|
|
2026
|
-
/** Used to match leading and trailing whitespace. */
|
|
2027
|
-
var reTrim = /^\s+|\s+$/g;
|
|
2028
|
-
|
|
2029
|
-
/** Used to detect bad signed hexadecimal string values. */
|
|
2030
|
-
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
2031
|
-
|
|
2032
|
-
/** Used to detect binary string values. */
|
|
2033
|
-
var reIsBinary = /^0b[01]+$/i;
|
|
2034
|
-
|
|
2035
|
-
/** Used to detect octal string values. */
|
|
2036
|
-
var reIsOctal = /^0o[0-7]+$/i;
|
|
2037
|
-
|
|
2038
|
-
/** Built-in method references without a dependency on `root`. */
|
|
2039
|
-
var freeParseInt = parseInt;
|
|
2040
|
-
|
|
2041
|
-
/** Detect free variable `global` from Node.js. */
|
|
2042
|
-
var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
|
|
2043
|
-
|
|
2044
|
-
/** Detect free variable `self`. */
|
|
2045
|
-
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
2046
|
-
|
|
2047
|
-
/** Used as a reference to the global object. */
|
|
2048
|
-
var root = freeGlobal || freeSelf || Function('return this')();
|
|
2049
|
-
|
|
2050
|
-
/** Used for built-in method references. */
|
|
2051
|
-
var objectProto = Object.prototype;
|
|
2052
|
-
|
|
2053
|
-
/**
|
|
2054
|
-
* Used to resolve the
|
|
2055
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
2056
|
-
* of values.
|
|
2057
|
-
*/
|
|
2058
|
-
var objectToString = objectProto.toString;
|
|
2059
|
-
|
|
2060
|
-
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
2061
|
-
var nativeMax = Math.max,
|
|
2062
|
-
nativeMin = Math.min;
|
|
2063
|
-
|
|
2064
|
-
/**
|
|
2065
|
-
* Gets the timestamp of the number of milliseconds that have elapsed since
|
|
2066
|
-
* the Unix epoch (1 January 1970 00:00:00 UTC).
|
|
2067
|
-
*
|
|
2068
|
-
* @static
|
|
2069
|
-
* @memberOf _
|
|
2070
|
-
* @since 2.4.0
|
|
2071
|
-
* @category Date
|
|
2072
|
-
* @returns {number} Returns the timestamp.
|
|
2073
|
-
* @example
|
|
2074
|
-
*
|
|
2075
|
-
* _.defer(function(stamp) {
|
|
2076
|
-
* console.log(_.now() - stamp);
|
|
2077
|
-
* }, _.now());
|
|
2078
|
-
* // => Logs the number of milliseconds it took for the deferred invocation.
|
|
2079
|
-
*/
|
|
2080
|
-
var now = function() {
|
|
2081
|
-
return root.Date.now();
|
|
2082
|
-
};
|
|
2083
|
-
|
|
2084
|
-
/**
|
|
2085
|
-
* Creates a debounced function that delays invoking `func` until after `wait`
|
|
2086
|
-
* milliseconds have elapsed since the last time the debounced function was
|
|
2087
|
-
* invoked. The debounced function comes with a `cancel` method to cancel
|
|
2088
|
-
* delayed `func` invocations and a `flush` method to immediately invoke them.
|
|
2089
|
-
* Provide `options` to indicate whether `func` should be invoked on the
|
|
2090
|
-
* leading and/or trailing edge of the `wait` timeout. The `func` is invoked
|
|
2091
|
-
* with the last arguments provided to the debounced function. Subsequent
|
|
2092
|
-
* calls to the debounced function return the result of the last `func`
|
|
2093
|
-
* invocation.
|
|
2094
|
-
*
|
|
2095
|
-
* **Note:** If `leading` and `trailing` options are `true`, `func` is
|
|
2096
|
-
* invoked on the trailing edge of the timeout only if the debounced function
|
|
2097
|
-
* is invoked more than once during the `wait` timeout.
|
|
2098
|
-
*
|
|
2099
|
-
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
|
2100
|
-
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
|
2101
|
-
*
|
|
2102
|
-
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
|
2103
|
-
* for details over the differences between `_.debounce` and `_.throttle`.
|
|
2104
|
-
*
|
|
2105
|
-
* @static
|
|
2106
|
-
* @memberOf _
|
|
2107
|
-
* @since 0.1.0
|
|
2108
|
-
* @category Function
|
|
2109
|
-
* @param {Function} func The function to debounce.
|
|
2110
|
-
* @param {number} [wait=0] The number of milliseconds to delay.
|
|
2111
|
-
* @param {Object} [options={}] The options object.
|
|
2112
|
-
* @param {boolean} [options.leading=false]
|
|
2113
|
-
* Specify invoking on the leading edge of the timeout.
|
|
2114
|
-
* @param {number} [options.maxWait]
|
|
2115
|
-
* The maximum time `func` is allowed to be delayed before it's invoked.
|
|
2116
|
-
* @param {boolean} [options.trailing=true]
|
|
2117
|
-
* Specify invoking on the trailing edge of the timeout.
|
|
2118
|
-
* @returns {Function} Returns the new debounced function.
|
|
2119
|
-
* @example
|
|
2120
|
-
*
|
|
2121
|
-
* // Avoid costly calculations while the window size is in flux.
|
|
2122
|
-
* jQuery(window).on('resize', _.debounce(calculateLayout, 150));
|
|
2123
|
-
*
|
|
2124
|
-
* // Invoke `sendMail` when clicked, debouncing subsequent calls.
|
|
2125
|
-
* jQuery(element).on('click', _.debounce(sendMail, 300, {
|
|
2126
|
-
* 'leading': true,
|
|
2127
|
-
* 'trailing': false
|
|
2128
|
-
* }));
|
|
2129
|
-
*
|
|
2130
|
-
* // Ensure `batchLog` is invoked once after 1 second of debounced calls.
|
|
2131
|
-
* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
|
|
2132
|
-
* var source = new EventSource('/stream');
|
|
2133
|
-
* jQuery(source).on('message', debounced);
|
|
2134
|
-
*
|
|
2135
|
-
* // Cancel the trailing debounced invocation.
|
|
2136
|
-
* jQuery(window).on('popstate', debounced.cancel);
|
|
2137
|
-
*/
|
|
2138
|
-
function debounce(func, wait, options) {
|
|
2139
|
-
var lastArgs,
|
|
2140
|
-
lastThis,
|
|
2141
|
-
maxWait,
|
|
2142
|
-
result,
|
|
2143
|
-
timerId,
|
|
2144
|
-
lastCallTime,
|
|
2145
|
-
lastInvokeTime = 0,
|
|
2146
|
-
leading = false,
|
|
2147
|
-
maxing = false,
|
|
2148
|
-
trailing = true;
|
|
2149
|
-
|
|
2150
|
-
if (typeof func != 'function') {
|
|
2151
|
-
throw new TypeError(FUNC_ERROR_TEXT);
|
|
2152
|
-
}
|
|
2153
|
-
wait = toNumber(wait) || 0;
|
|
2154
|
-
if (isObject(options)) {
|
|
2155
|
-
leading = !!options.leading;
|
|
2156
|
-
maxing = 'maxWait' in options;
|
|
2157
|
-
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
|
2158
|
-
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
|
2159
|
-
}
|
|
2160
|
-
|
|
2161
|
-
function invokeFunc(time) {
|
|
2162
|
-
var args = lastArgs,
|
|
2163
|
-
thisArg = lastThis;
|
|
2164
|
-
|
|
2165
|
-
lastArgs = lastThis = undefined;
|
|
2166
|
-
lastInvokeTime = time;
|
|
2167
|
-
result = func.apply(thisArg, args);
|
|
2168
|
-
return result;
|
|
2169
|
-
}
|
|
2170
|
-
|
|
2171
|
-
function leadingEdge(time) {
|
|
2172
|
-
// Reset any `maxWait` timer.
|
|
2173
|
-
lastInvokeTime = time;
|
|
2174
|
-
// Start the timer for the trailing edge.
|
|
2175
|
-
timerId = setTimeout(timerExpired, wait);
|
|
2176
|
-
// Invoke the leading edge.
|
|
2177
|
-
return leading ? invokeFunc(time) : result;
|
|
2178
|
-
}
|
|
2179
|
-
|
|
2180
|
-
function remainingWait(time) {
|
|
2181
|
-
var timeSinceLastCall = time - lastCallTime,
|
|
2182
|
-
timeSinceLastInvoke = time - lastInvokeTime,
|
|
2183
|
-
result = wait - timeSinceLastCall;
|
|
2184
|
-
|
|
2185
|
-
return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
|
|
2186
|
-
}
|
|
2187
|
-
|
|
2188
|
-
function shouldInvoke(time) {
|
|
2189
|
-
var timeSinceLastCall = time - lastCallTime,
|
|
2190
|
-
timeSinceLastInvoke = time - lastInvokeTime;
|
|
2191
|
-
|
|
2192
|
-
// Either this is the first call, activity has stopped and we're at the
|
|
2193
|
-
// trailing edge, the system time has gone backwards and we're treating
|
|
2194
|
-
// it as the trailing edge, or we've hit the `maxWait` limit.
|
|
2195
|
-
return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
|
|
2196
|
-
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
|
|
2197
|
-
}
|
|
2198
|
-
|
|
2199
|
-
function timerExpired() {
|
|
2200
|
-
var time = now();
|
|
2201
|
-
if (shouldInvoke(time)) {
|
|
2202
|
-
return trailingEdge(time);
|
|
2203
|
-
}
|
|
2204
|
-
// Restart the timer.
|
|
2205
|
-
timerId = setTimeout(timerExpired, remainingWait(time));
|
|
2206
|
-
}
|
|
2207
|
-
|
|
2208
|
-
function trailingEdge(time) {
|
|
2209
|
-
timerId = undefined;
|
|
2210
|
-
|
|
2211
|
-
// Only invoke if we have `lastArgs` which means `func` has been
|
|
2212
|
-
// debounced at least once.
|
|
2213
|
-
if (trailing && lastArgs) {
|
|
2214
|
-
return invokeFunc(time);
|
|
2215
|
-
}
|
|
2216
|
-
lastArgs = lastThis = undefined;
|
|
2217
|
-
return result;
|
|
2218
|
-
}
|
|
2219
|
-
|
|
2220
|
-
function cancel() {
|
|
2221
|
-
if (timerId !== undefined) {
|
|
2222
|
-
clearTimeout(timerId);
|
|
2223
|
-
}
|
|
2224
|
-
lastInvokeTime = 0;
|
|
2225
|
-
lastArgs = lastCallTime = lastThis = timerId = undefined;
|
|
2226
|
-
}
|
|
2227
|
-
|
|
2228
|
-
function flush() {
|
|
2229
|
-
return timerId === undefined ? result : trailingEdge(now());
|
|
2230
|
-
}
|
|
2231
|
-
|
|
2232
|
-
function debounced() {
|
|
2233
|
-
var time = now(),
|
|
2234
|
-
isInvoking = shouldInvoke(time);
|
|
2235
|
-
|
|
2236
|
-
lastArgs = arguments;
|
|
2237
|
-
lastThis = this;
|
|
2238
|
-
lastCallTime = time;
|
|
2239
|
-
|
|
2240
|
-
if (isInvoking) {
|
|
2241
|
-
if (timerId === undefined) {
|
|
2242
|
-
return leadingEdge(lastCallTime);
|
|
2243
|
-
}
|
|
2244
|
-
if (maxing) {
|
|
2245
|
-
// Handle invocations in a tight loop.
|
|
2246
|
-
timerId = setTimeout(timerExpired, wait);
|
|
2247
|
-
return invokeFunc(lastCallTime);
|
|
2248
|
-
}
|
|
2249
|
-
}
|
|
2250
|
-
if (timerId === undefined) {
|
|
2251
|
-
timerId = setTimeout(timerExpired, wait);
|
|
2252
|
-
}
|
|
2253
|
-
return result;
|
|
2254
|
-
}
|
|
2255
|
-
debounced.cancel = cancel;
|
|
2256
|
-
debounced.flush = flush;
|
|
2257
|
-
return debounced;
|
|
2258
|
-
}
|
|
2259
|
-
|
|
2260
|
-
/**
|
|
2261
|
-
* Creates a throttled function that only invokes `func` at most once per
|
|
2262
|
-
* every `wait` milliseconds. The throttled function comes with a `cancel`
|
|
2263
|
-
* method to cancel delayed `func` invocations and a `flush` method to
|
|
2264
|
-
* immediately invoke them. Provide `options` to indicate whether `func`
|
|
2265
|
-
* should be invoked on the leading and/or trailing edge of the `wait`
|
|
2266
|
-
* timeout. The `func` is invoked with the last arguments provided to the
|
|
2267
|
-
* throttled function. Subsequent calls to the throttled function return the
|
|
2268
|
-
* result of the last `func` invocation.
|
|
2269
|
-
*
|
|
2270
|
-
* **Note:** If `leading` and `trailing` options are `true`, `func` is
|
|
2271
|
-
* invoked on the trailing edge of the timeout only if the throttled function
|
|
2272
|
-
* is invoked more than once during the `wait` timeout.
|
|
2273
|
-
*
|
|
2274
|
-
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
|
2275
|
-
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
|
2276
|
-
*
|
|
2277
|
-
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
|
2278
|
-
* for details over the differences between `_.throttle` and `_.debounce`.
|
|
2279
|
-
*
|
|
2280
|
-
* @static
|
|
2281
|
-
* @memberOf _
|
|
2282
|
-
* @since 0.1.0
|
|
2283
|
-
* @category Function
|
|
2284
|
-
* @param {Function} func The function to throttle.
|
|
2285
|
-
* @param {number} [wait=0] The number of milliseconds to throttle invocations to.
|
|
2286
|
-
* @param {Object} [options={}] The options object.
|
|
2287
|
-
* @param {boolean} [options.leading=true]
|
|
2288
|
-
* Specify invoking on the leading edge of the timeout.
|
|
2289
|
-
* @param {boolean} [options.trailing=true]
|
|
2290
|
-
* Specify invoking on the trailing edge of the timeout.
|
|
2291
|
-
* @returns {Function} Returns the new throttled function.
|
|
2292
|
-
* @example
|
|
2293
|
-
*
|
|
2294
|
-
* // Avoid excessively updating the position while scrolling.
|
|
2295
|
-
* jQuery(window).on('scroll', _.throttle(updatePosition, 100));
|
|
2296
|
-
*
|
|
2297
|
-
* // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
|
|
2298
|
-
* var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
|
|
2299
|
-
* jQuery(element).on('click', throttled);
|
|
2300
|
-
*
|
|
2301
|
-
* // Cancel the trailing throttled invocation.
|
|
2302
|
-
* jQuery(window).on('popstate', throttled.cancel);
|
|
2303
|
-
*/
|
|
2304
|
-
function throttle(func, wait, options) {
|
|
2305
|
-
var leading = true,
|
|
2306
|
-
trailing = true;
|
|
2307
|
-
|
|
2308
|
-
if (typeof func != 'function') {
|
|
2309
|
-
throw new TypeError(FUNC_ERROR_TEXT);
|
|
2310
|
-
}
|
|
2311
|
-
if (isObject(options)) {
|
|
2312
|
-
leading = 'leading' in options ? !!options.leading : leading;
|
|
2313
|
-
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
|
2314
|
-
}
|
|
2315
|
-
return debounce(func, wait, {
|
|
2316
|
-
'leading': leading,
|
|
2317
|
-
'maxWait': wait,
|
|
2318
|
-
'trailing': trailing
|
|
2319
|
-
});
|
|
2320
|
-
}
|
|
2321
|
-
|
|
2322
|
-
/**
|
|
2323
|
-
* Checks if `value` is the
|
|
2324
|
-
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
2325
|
-
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
2326
|
-
*
|
|
2327
|
-
* @static
|
|
2328
|
-
* @memberOf _
|
|
2329
|
-
* @since 0.1.0
|
|
2330
|
-
* @category Lang
|
|
2331
|
-
* @param {*} value The value to check.
|
|
2332
|
-
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
2333
|
-
* @example
|
|
2334
|
-
*
|
|
2335
|
-
* _.isObject({});
|
|
2336
|
-
* // => true
|
|
2337
|
-
*
|
|
2338
|
-
* _.isObject([1, 2, 3]);
|
|
2339
|
-
* // => true
|
|
2340
|
-
*
|
|
2341
|
-
* _.isObject(_.noop);
|
|
2342
|
-
* // => true
|
|
2343
|
-
*
|
|
2344
|
-
* _.isObject(null);
|
|
2345
|
-
* // => false
|
|
2346
|
-
*/
|
|
2347
|
-
function isObject(value) {
|
|
2348
|
-
var type = typeof value;
|
|
2349
|
-
return !!value && (type == 'object' || type == 'function');
|
|
2350
|
-
}
|
|
2351
|
-
|
|
2352
|
-
/**
|
|
2353
|
-
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
2354
|
-
* and has a `typeof` result of "object".
|
|
2355
|
-
*
|
|
2356
|
-
* @static
|
|
2357
|
-
* @memberOf _
|
|
2358
|
-
* @since 4.0.0
|
|
2359
|
-
* @category Lang
|
|
2360
|
-
* @param {*} value The value to check.
|
|
2361
|
-
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
2362
|
-
* @example
|
|
2363
|
-
*
|
|
2364
|
-
* _.isObjectLike({});
|
|
2365
|
-
* // => true
|
|
2366
|
-
*
|
|
2367
|
-
* _.isObjectLike([1, 2, 3]);
|
|
2368
|
-
* // => true
|
|
2369
|
-
*
|
|
2370
|
-
* _.isObjectLike(_.noop);
|
|
2371
|
-
* // => false
|
|
2372
|
-
*
|
|
2373
|
-
* _.isObjectLike(null);
|
|
2374
|
-
* // => false
|
|
2375
|
-
*/
|
|
2376
|
-
function isObjectLike(value) {
|
|
2377
|
-
return !!value && typeof value == 'object';
|
|
2378
|
-
}
|
|
2379
|
-
|
|
2380
|
-
/**
|
|
2381
|
-
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
2382
|
-
*
|
|
2383
|
-
* @static
|
|
2384
|
-
* @memberOf _
|
|
2385
|
-
* @since 4.0.0
|
|
2386
|
-
* @category Lang
|
|
2387
|
-
* @param {*} value The value to check.
|
|
2388
|
-
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
|
2389
|
-
* @example
|
|
2390
|
-
*
|
|
2391
|
-
* _.isSymbol(Symbol.iterator);
|
|
2392
|
-
* // => true
|
|
2393
|
-
*
|
|
2394
|
-
* _.isSymbol('abc');
|
|
2395
|
-
* // => false
|
|
2396
|
-
*/
|
|
2397
|
-
function isSymbol(value) {
|
|
2398
|
-
return typeof value == 'symbol' ||
|
|
2399
|
-
(isObjectLike(value) && objectToString.call(value) == symbolTag);
|
|
2400
|
-
}
|
|
2401
|
-
|
|
2402
|
-
/**
|
|
2403
|
-
* Converts `value` to a number.
|
|
2404
|
-
*
|
|
2405
|
-
* @static
|
|
2406
|
-
* @memberOf _
|
|
2407
|
-
* @since 4.0.0
|
|
2408
|
-
* @category Lang
|
|
2409
|
-
* @param {*} value The value to process.
|
|
2410
|
-
* @returns {number} Returns the number.
|
|
2411
|
-
* @example
|
|
2412
|
-
*
|
|
2413
|
-
* _.toNumber(3.2);
|
|
2414
|
-
* // => 3.2
|
|
2415
|
-
*
|
|
2416
|
-
* _.toNumber(Number.MIN_VALUE);
|
|
2417
|
-
* // => 5e-324
|
|
2418
|
-
*
|
|
2419
|
-
* _.toNumber(Infinity);
|
|
2420
|
-
* // => Infinity
|
|
2421
|
-
*
|
|
2422
|
-
* _.toNumber('3.2');
|
|
2423
|
-
* // => 3.2
|
|
2424
|
-
*/
|
|
2425
|
-
function toNumber(value) {
|
|
2426
|
-
if (typeof value == 'number') {
|
|
2427
|
-
return value;
|
|
2428
|
-
}
|
|
2429
|
-
if (isSymbol(value)) {
|
|
2430
|
-
return NAN;
|
|
2431
|
-
}
|
|
2432
|
-
if (isObject(value)) {
|
|
2433
|
-
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
|
|
2434
|
-
value = isObject(other) ? (other + '') : other;
|
|
2435
|
-
}
|
|
2436
|
-
if (typeof value != 'string') {
|
|
2437
|
-
return value === 0 ? value : +value;
|
|
2438
|
-
}
|
|
2439
|
-
value = value.replace(reTrim, '');
|
|
2440
|
-
var isBinary = reIsBinary.test(value);
|
|
2441
|
-
return (isBinary || reIsOctal.test(value))
|
|
2442
|
-
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
|
|
2443
|
-
: (reIsBadHex.test(value) ? NAN : +value);
|
|
2444
|
-
}
|
|
2445
|
-
|
|
2446
|
-
module.exports = throttle;
|
|
546
|
+
/***/ 9349:
|
|
547
|
+
/***/ ((module) => {
|
|
2447
548
|
|
|
549
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__9349__;
|
|
2448
550
|
|
|
2449
551
|
/***/ }),
|
|
2450
552
|
|
|
2451
|
-
/***/
|
|
2452
|
-
/***/ ((module
|
|
2453
|
-
|
|
2454
|
-
"use strict";
|
|
2455
|
-
/**
|
|
2456
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
2457
|
-
*
|
|
2458
|
-
* This source code is licensed under the MIT license found in the
|
|
2459
|
-
* LICENSE file in the root directory of this source tree.
|
|
2460
|
-
*/
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
var ReactPropTypesSecret = __webpack_require__(414);
|
|
2465
|
-
|
|
2466
|
-
function emptyFunction() {}
|
|
2467
|
-
function emptyFunctionWithReset() {}
|
|
2468
|
-
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
2469
|
-
|
|
2470
|
-
module.exports = function() {
|
|
2471
|
-
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
2472
|
-
if (secret === ReactPropTypesSecret) {
|
|
2473
|
-
// It is still safe when called from React.
|
|
2474
|
-
return;
|
|
2475
|
-
}
|
|
2476
|
-
var err = new Error(
|
|
2477
|
-
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
2478
|
-
'Use PropTypes.checkPropTypes() to call them. ' +
|
|
2479
|
-
'Read more at http://fb.me/use-check-prop-types'
|
|
2480
|
-
);
|
|
2481
|
-
err.name = 'Invariant Violation';
|
|
2482
|
-
throw err;
|
|
2483
|
-
};
|
|
2484
|
-
shim.isRequired = shim;
|
|
2485
|
-
function getShim() {
|
|
2486
|
-
return shim;
|
|
2487
|
-
};
|
|
2488
|
-
// Important!
|
|
2489
|
-
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
2490
|
-
var ReactPropTypes = {
|
|
2491
|
-
array: shim,
|
|
2492
|
-
bool: shim,
|
|
2493
|
-
func: shim,
|
|
2494
|
-
number: shim,
|
|
2495
|
-
object: shim,
|
|
2496
|
-
string: shim,
|
|
2497
|
-
symbol: shim,
|
|
2498
|
-
|
|
2499
|
-
any: shim,
|
|
2500
|
-
arrayOf: getShim,
|
|
2501
|
-
element: shim,
|
|
2502
|
-
elementType: shim,
|
|
2503
|
-
instanceOf: getShim,
|
|
2504
|
-
node: shim,
|
|
2505
|
-
objectOf: getShim,
|
|
2506
|
-
oneOf: getShim,
|
|
2507
|
-
oneOfType: getShim,
|
|
2508
|
-
shape: getShim,
|
|
2509
|
-
exact: getShim,
|
|
2510
|
-
|
|
2511
|
-
checkPropTypes: emptyFunctionWithReset,
|
|
2512
|
-
resetWarningCache: emptyFunction
|
|
2513
|
-
};
|
|
2514
|
-
|
|
2515
|
-
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
2516
|
-
|
|
2517
|
-
return ReactPropTypes;
|
|
2518
|
-
};
|
|
553
|
+
/***/ 2040:
|
|
554
|
+
/***/ ((module) => {
|
|
2519
555
|
|
|
556
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__2040__;
|
|
2520
557
|
|
|
2521
558
|
/***/ }),
|
|
2522
559
|
|
|
2523
|
-
/***/
|
|
2524
|
-
/***/ ((module
|
|
2525
|
-
|
|
2526
|
-
/**
|
|
2527
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
2528
|
-
*
|
|
2529
|
-
* This source code is licensed under the MIT license found in the
|
|
2530
|
-
* LICENSE file in the root directory of this source tree.
|
|
2531
|
-
*/
|
|
2532
|
-
|
|
2533
|
-
if (false) { var throwOnDirectAccess, ReactIs; } else {
|
|
2534
|
-
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
2535
|
-
// http://fb.me/prop-types-in-prod
|
|
2536
|
-
module.exports = __webpack_require__(2703)();
|
|
2537
|
-
}
|
|
560
|
+
/***/ 3474:
|
|
561
|
+
/***/ ((module) => {
|
|
2538
562
|
|
|
563
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__3474__;
|
|
2539
564
|
|
|
2540
565
|
/***/ }),
|
|
2541
566
|
|
|
2542
|
-
/***/
|
|
567
|
+
/***/ 9281:
|
|
2543
568
|
/***/ ((module) => {
|
|
2544
569
|
|
|
2545
|
-
|
|
2546
|
-
/**
|
|
2547
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
2548
|
-
*
|
|
2549
|
-
* This source code is licensed under the MIT license found in the
|
|
2550
|
-
* LICENSE file in the root directory of this source tree.
|
|
2551
|
-
*/
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
2556
|
-
|
|
2557
|
-
module.exports = ReactPropTypesSecret;
|
|
2558
|
-
|
|
570
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__9281__;
|
|
2559
571
|
|
|
2560
572
|
/***/ }),
|
|
2561
573
|
|
|
2562
|
-
/***/
|
|
574
|
+
/***/ 5044:
|
|
2563
575
|
/***/ ((module) => {
|
|
2564
576
|
|
|
2565
|
-
|
|
2566
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__9281__;
|
|
577
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__5044__;
|
|
2567
578
|
|
|
2568
579
|
/***/ })
|
|
2569
580
|
|
|
@@ -2587,7 +598,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__9281__;
|
|
|
2587
598
|
/******/ };
|
|
2588
599
|
/******/
|
|
2589
600
|
/******/ // Execute the module function
|
|
2590
|
-
/******/ __webpack_modules__[moduleId]
|
|
601
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
2591
602
|
/******/
|
|
2592
603
|
/******/ // Return the exports of the module
|
|
2593
604
|
/******/ return module.exports;
|
|
@@ -2618,18 +629,6 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__9281__;
|
|
|
2618
629
|
/******/ };
|
|
2619
630
|
/******/ })();
|
|
2620
631
|
/******/
|
|
2621
|
-
/******/ /* webpack/runtime/global */
|
|
2622
|
-
/******/ (() => {
|
|
2623
|
-
/******/ __webpack_require__.g = (function() {
|
|
2624
|
-
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
2625
|
-
/******/ try {
|
|
2626
|
-
/******/ return this || new Function('return this')();
|
|
2627
|
-
/******/ } catch (e) {
|
|
2628
|
-
/******/ if (typeof window === 'object') return window;
|
|
2629
|
-
/******/ }
|
|
2630
|
-
/******/ })();
|
|
2631
|
-
/******/ })();
|
|
2632
|
-
/******/
|
|
2633
632
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
2634
633
|
/******/ (() => {
|
|
2635
634
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
@@ -2648,9 +647,8 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__9281__;
|
|
|
2648
647
|
/******/
|
|
2649
648
|
/************************************************************************/
|
|
2650
649
|
var __webpack_exports__ = {};
|
|
2651
|
-
// This entry need to be wrapped in an IIFE because it need to be in
|
|
650
|
+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
|
2652
651
|
(() => {
|
|
2653
|
-
"use strict";
|
|
2654
652
|
// ESM COMPAT FLAG
|
|
2655
653
|
__webpack_require__.r(__webpack_exports__);
|
|
2656
654
|
|
|
@@ -2662,19 +660,19 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
2662
660
|
// EXTERNAL MODULE: external {"commonjs":"react","commonjs2":"react"}
|
|
2663
661
|
var external_commonjs_react_commonjs2_react_ = __webpack_require__(9281);
|
|
2664
662
|
var external_commonjs_react_commonjs2_react_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_react_commonjs2_react_);
|
|
2665
|
-
// EXTERNAL MODULE:
|
|
2666
|
-
var
|
|
2667
|
-
var
|
|
2668
|
-
// EXTERNAL MODULE:
|
|
2669
|
-
var
|
|
2670
|
-
var
|
|
2671
|
-
// EXTERNAL MODULE:
|
|
2672
|
-
var
|
|
2673
|
-
var
|
|
663
|
+
// EXTERNAL MODULE: external {"commonjs":"prop-types","commonjs2":"prop-types"}
|
|
664
|
+
var external_commonjs_prop_types_commonjs2_prop_types_ = __webpack_require__(3474);
|
|
665
|
+
var external_commonjs_prop_types_commonjs2_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_prop_types_commonjs2_prop_types_);
|
|
666
|
+
// EXTERNAL MODULE: external {"commonjs":"js-cookie","commonjs2":"js-cookie"}
|
|
667
|
+
var external_commonjs_js_cookie_commonjs2_js_cookie_ = __webpack_require__(9349);
|
|
668
|
+
var external_commonjs_js_cookie_commonjs2_js_cookie_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_js_cookie_commonjs2_js_cookie_);
|
|
669
|
+
// EXTERNAL MODULE: external {"commonjs":"lodash.throttle","commonjs2":"lodash.throttle"}
|
|
670
|
+
var external_commonjs_lodash_throttle_commonjs2_lodash_throttle_ = __webpack_require__(2040);
|
|
671
|
+
var external_commonjs_lodash_throttle_commonjs2_lodash_throttle_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_lodash_throttle_commonjs2_lodash_throttle_);
|
|
2674
672
|
// EXTERNAL MODULE: ./src/core/dom-query.js
|
|
2675
673
|
var dom_query = __webpack_require__(9581);
|
|
2676
|
-
// EXTERNAL MODULE: ./src/core/Flash/component.jsx
|
|
2677
|
-
var component = __webpack_require__(
|
|
674
|
+
// EXTERNAL MODULE: ./src/core/Flash/component.jsx + 1 modules
|
|
675
|
+
var component = __webpack_require__(8696);
|
|
2678
676
|
;// CONCATENATED MODULE: ./src/core/Notice/component.js
|
|
2679
677
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
2680
678
|
|
|
@@ -2730,14 +728,14 @@ var showNotice = function showNotice(bannerContainer) {
|
|
|
2730
728
|
};
|
|
2731
729
|
|
|
2732
730
|
var setupRememberClosed = function setupRememberClosed(cookieId, noticeId) {
|
|
2733
|
-
var cookie =
|
|
2734
|
-
|
|
731
|
+
var cookie = external_commonjs_js_cookie_commonjs2_js_cookie_default().get(cookieId) || "";
|
|
732
|
+
external_commonjs_js_cookie_commonjs2_js_cookie_default().set(cookieId, "".concat(cookie.replace("".concat(noticeId, ","), "") + noticeId, ","), {
|
|
2735
733
|
expires: COOKIE_EXPIRY
|
|
2736
734
|
});
|
|
2737
735
|
};
|
|
2738
736
|
|
|
2739
737
|
var hasBeenClosedBefore = function hasBeenClosedBefore(cookieId, noticeId) {
|
|
2740
|
-
return (
|
|
738
|
+
return (external_commonjs_js_cookie_commonjs2_js_cookie_default().get(cookieId) || "").includes(noticeId);
|
|
2741
739
|
};
|
|
2742
740
|
|
|
2743
741
|
var setupNoticeCollapse = function setupNoticeCollapse(bannerContainer) {
|
|
@@ -2747,7 +745,7 @@ var setupNoticeCollapse = function setupNoticeCollapse(bannerContainer) {
|
|
|
2747
745
|
hideNotice(bannerContainer);
|
|
2748
746
|
}
|
|
2749
747
|
|
|
2750
|
-
var listener =
|
|
748
|
+
var listener = external_commonjs_lodash_throttle_commonjs2_lodash_throttle_default()(function () {
|
|
2751
749
|
var scrollTop = window.scrollY;
|
|
2752
750
|
|
|
2753
751
|
if (scrollTop > COLLAPSE_TRIGGER_DISTANCE) {
|
|
@@ -2779,7 +777,7 @@ var setupCloseBtn = function setupCloseBtn(bannerContainer, cookieId, noticeId,
|
|
|
2779
777
|
};
|
|
2780
778
|
|
|
2781
779
|
var resizeHandler = function resizeHandler(bannerContainer) {
|
|
2782
|
-
var handler =
|
|
780
|
+
var handler = external_commonjs_lodash_throttle_commonjs2_lodash_throttle_default()(function () {
|
|
2783
781
|
hideOnMobile(bannerContainer);
|
|
2784
782
|
}, RESIZE_LISTENER_THROTTLE);
|
|
2785
783
|
window.addEventListener("resize", handler);
|
|
@@ -2840,8 +838,8 @@ var ContentWrapper = function ContentWrapper(_ref) {
|
|
|
2840
838
|
};
|
|
2841
839
|
|
|
2842
840
|
ContentWrapper.propTypes = {
|
|
2843
|
-
buttonLink: (
|
|
2844
|
-
children: (
|
|
841
|
+
buttonLink: (external_commonjs_prop_types_commonjs2_prop_types_default()).string,
|
|
842
|
+
children: (external_commonjs_prop_types_commonjs2_prop_types_default()).node
|
|
2845
843
|
};
|
|
2846
844
|
|
|
2847
845
|
var component_Notice = function Notice(_ref2) {
|
|
@@ -2894,18 +892,18 @@ var component_Notice = function Notice(_ref2) {
|
|
|
2894
892
|
};
|
|
2895
893
|
|
|
2896
894
|
component_Notice.propTypes = {
|
|
2897
|
-
buttonLink: (
|
|
2898
|
-
buttonLabel: (
|
|
2899
|
-
bodyText: (
|
|
2900
|
-
title: (
|
|
2901
|
-
closeBtn: (
|
|
2902
|
-
config:
|
|
2903
|
-
collapse: (
|
|
2904
|
-
noticeId: (
|
|
2905
|
-
cookieId: (
|
|
895
|
+
buttonLink: (external_commonjs_prop_types_commonjs2_prop_types_default()).string,
|
|
896
|
+
buttonLabel: (external_commonjs_prop_types_commonjs2_prop_types_default()).string,
|
|
897
|
+
bodyText: (external_commonjs_prop_types_commonjs2_prop_types_default()).string,
|
|
898
|
+
title: (external_commonjs_prop_types_commonjs2_prop_types_default()).string,
|
|
899
|
+
closeBtn: (external_commonjs_prop_types_commonjs2_prop_types_default()).bool,
|
|
900
|
+
config: external_commonjs_prop_types_commonjs2_prop_types_default().shape({
|
|
901
|
+
collapse: (external_commonjs_prop_types_commonjs2_prop_types_default()).bool,
|
|
902
|
+
noticeId: (external_commonjs_prop_types_commonjs2_prop_types_default()).string,
|
|
903
|
+
cookieId: (external_commonjs_prop_types_commonjs2_prop_types_default()).string
|
|
2906
904
|
}),
|
|
2907
|
-
bgColor: (
|
|
2908
|
-
textColor: (
|
|
905
|
+
bgColor: (external_commonjs_prop_types_commonjs2_prop_types_default()).string,
|
|
906
|
+
textColor: (external_commonjs_prop_types_commonjs2_prop_types_default()).string
|
|
2909
907
|
};
|
|
2910
908
|
/* harmony default export */ const core_Notice_component = (component_Notice);
|
|
2911
909
|
})();
|