PluginProbe
Elementor Website Builder – more than just a page builder / 3.35.0-dev2
Elementor Website Builder – more than just a page builder v3.35.0-dev2
4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 All 452 releases
elementor / assets / js / editor-v4-opt-in.js

editor-v4-opt-in.js in Elementor Website Builder – more than just a page builder 3.35.0-dev2, at assets/js/editor-v4-opt-in.js

4,114 lines 167.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /******/ (() => { // webpackBootstrap
2 /******/ var __webpack_modules__ = ({
3
4 /***/ "../assets/dev/js/utils/react.js":
5 /*!***************************************!*\
6 !*** ../assets/dev/js/utils/react.js ***!
7 \***************************************/
8 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9
10 "use strict";
11
12
13 var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
14 Object.defineProperty(exports, "__esModule", ({
15 value: true
16 }));
17 exports["default"] = void 0;
18 var React = _interopRequireWildcard(__webpack_require__(/*! react */ "react"));
19 var ReactDOM = _interopRequireWildcard(__webpack_require__(/*! react-dom */ "react-dom"));
20 var _client = __webpack_require__(/*! react-dom/client */ "../node_modules/react-dom/client.js");
21 function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
22 /**
23 * Support conditional rendering of a React App to the DOM, based on the React version.
24 * We use `createRoot` when available, but fallback to `ReactDOM.render` for older versions.
25 *
26 * @param { React.ReactElement } app The app to render.
27 * @param { HTMLElement } domElement The DOM element to render the app into.
28 *
29 * @return {{ unmount: () => void }} The unmount function.
30 */
31 function render(app, domElement) {
32 var unmountFunction;
33 try {
34 var root = (0, _client.createRoot)(domElement);
35 root.render(app);
36 unmountFunction = function unmountFunction() {
37 root.unmount();
38 };
39 } catch (e) {
40 // eslint-disable-next-line react/no-deprecated
41 ReactDOM.render(app, domElement);
42 unmountFunction = function unmountFunction() {
43 // eslint-disable-next-line react/no-deprecated
44 ReactDOM.unmountComponentAtNode(domElement);
45 };
46 }
47 return {
48 unmount: unmountFunction
49 };
50 }
51 var _default = exports["default"] = {
52 render: render
53 };
54
55 /***/ }),
56
57 /***/ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-api.js":
58 /*!********************************************************************!*\
59 !*** ../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-api.js ***!
60 \********************************************************************/
61 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
62
63 "use strict";
64
65
66 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
67 Object.defineProperty(exports, "__esModule", ({
68 value: true
69 }));
70 exports.triggerOptOut = exports.triggerOptIn = void 0;
71 var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
72 var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
73 var triggerOptIn = exports.triggerOptIn = /*#__PURE__*/function () {
74 var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
75 return _regenerator.default.wrap(function (_context) {
76 while (1) switch (_context.prev = _context.next) {
77 case 0:
78 return _context.abrupt("return", elementorCommon.ajax.addRequest('editor_v4_opt_in'));
79 case 1:
80 case "end":
81 return _context.stop();
82 }
83 }, _callee);
84 }));
85 return function triggerOptIn() {
86 return _ref.apply(this, arguments);
87 };
88 }();
89 var triggerOptOut = exports.triggerOptOut = /*#__PURE__*/function () {
90 var _ref2 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
91 return _regenerator.default.wrap(function (_context2) {
92 while (1) switch (_context2.prev = _context2.next) {
93 case 0:
94 return _context2.abrupt("return", elementorCommon.ajax.addRequest('editor_v4_opt_out'));
95 case 1:
96 case "end":
97 return _context2.stop();
98 }
99 }, _callee2);
100 }));
101 return function triggerOptOut() {
102 return _ref2.apply(this, arguments);
103 };
104 }();
105
106 /***/ }),
107
108 /***/ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-content.js":
109 /*!************************************************************************!*\
110 !*** ../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-content.js ***!
111 \************************************************************************/
112 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
113
114 "use strict";
115 /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
116
117
118 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
119 Object.defineProperty(exports, "__esModule", ({
120 value: true
121 }));
122 exports.TextNode = exports.ContentListItem = exports.ContentList = exports.AdvantagesListItem = exports.AdvantagesList = void 0;
123 var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
124 var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js"));
125 var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "../node_modules/@babel/runtime/helpers/objectWithoutProperties.js"));
126 var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
127 var _icons = __webpack_require__(/*! @elementor/icons */ "@elementor/icons");
128 var _excluded = ["children"],
129 _excluded2 = ["children"],
130 _excluded3 = ["children"],
131 _excluded4 = ["children"],
132 _excluded5 = ["children"];
133 var TextNode = exports.TextNode = function TextNode(_ref) {
134 var children = _ref.children,
135 props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
136 return /*#__PURE__*/_react.default.createElement(_ui.Typography, (0, _extends2.default)({
137 color: "text.primary"
138 }, props), children);
139 };
140 TextNode.propTypes = {
141 children: PropTypes.node
142 };
143 var ContentList = exports.ContentList = function ContentList(_ref2) {
144 var children = _ref2.children,
145 props = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
146 return /*#__PURE__*/_react.default.createElement(_ui.Box, (0, _extends2.default)({
147 component: "ul",
148 sx: {
149 my: 0
150 }
151 }, props), children);
152 };
153 ContentList.propTypes = {
154 children: PropTypes.node
155 };
156 var ContentListItem = exports.ContentListItem = function ContentListItem(_ref3) {
157 var children = _ref3.children,
158 props = (0, _objectWithoutProperties2.default)(_ref3, _excluded3);
159 return /*#__PURE__*/_react.default.createElement(TextNode, (0, _extends2.default)({
160 component: "li",
161 sx: {
162 listStyle: 'disc',
163 marginInlineStart: 3
164 }
165 }, props), children);
166 };
167 ContentListItem.propTypes = {
168 children: PropTypes.node
169 };
170 var AdvantagesList = exports.AdvantagesList = function AdvantagesList(_ref4) {
171 var children = _ref4.children,
172 props = (0, _objectWithoutProperties2.default)(_ref4, _excluded4);
173 return /*#__PURE__*/_react.default.createElement(_ui.Box, (0, _extends2.default)({
174 component: "ul",
175 sx: {
176 display: 'flex',
177 flexDirection: 'column',
178 gap: 0.5,
179 my: 0
180 }
181 }, props), children);
182 };
183 AdvantagesList.propTypes = {
184 children: PropTypes.node
185 };
186 var AdvantagesListItem = exports.AdvantagesListItem = function AdvantagesListItem(_ref5) {
187 var children = _ref5.children,
188 props = (0, _objectWithoutProperties2.default)(_ref5, _excluded5);
189 return /*#__PURE__*/_react.default.createElement(TextNode, (0, _extends2.default)({
190 component: "li",
191 sx: {
192 listStyle: 'none',
193 marginInlineStart: 0,
194 lineHeight: '150%',
195 display: 'flex',
196 alignItems: 'flex-start',
197 gap: 0.5
198 }
199 }, props), /*#__PURE__*/_react.default.createElement(_icons.CheckIcon, {
200 fontSize: "small"
201 }), children);
202 };
203 AdvantagesListItem.propTypes = {
204 children: PropTypes.node
205 };
206
207 /***/ }),
208
209 /***/ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-img-placeholders.js":
210 /*!*********************************************************************************!*\
211 !*** ../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-img-placeholders.js ***!
212 \*********************************************************************************/
213 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
214
215 "use strict";
216
217
218 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
219 Object.defineProperty(exports, "__esModule", ({
220 value: true
221 }));
222 exports.ImageSquarePlaceholder = exports.ImageLandscapePlaceholder = void 0;
223 var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
224 var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js"));
225 var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
226 var ImageLandscapePlaceholder = exports.ImageLandscapePlaceholder = function ImageLandscapePlaceholder(props) {
227 return /*#__PURE__*/_react.default.createElement(_ui.SvgIcon, (0, _extends2.default)({
228 viewBox: "0 0 600 260"
229 }, props), /*#__PURE__*/_react.default.createElement("rect", {
230 x: "0",
231 y: "0",
232 width: "600",
233 height: "260",
234 fill: "#d9d9d9"
235 }));
236 };
237 var ImageSquarePlaceholder = exports.ImageSquarePlaceholder = function ImageSquarePlaceholder(props) {
238 return /*#__PURE__*/_react.default.createElement(_ui.SvgIcon, (0, _extends2.default)({
239 viewBox: "0 0 500 500"
240 }, props), /*#__PURE__*/_react.default.createElement("rect", {
241 x: "0",
242 y: "0",
243 width: "500",
244 height: "500",
245 fill: "#d9d9d9"
246 }));
247 };
248
249 /***/ }),
250
251 /***/ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-message.js":
252 /*!************************************************************************!*\
253 !*** ../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-message.js ***!
254 \************************************************************************/
255 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
256
257 "use strict";
258 /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
259
260
261 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
262 Object.defineProperty(exports, "__esModule", ({
263 value: true
264 }));
265 exports.Message = void 0;
266 var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
267 var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
268 var _icons = __webpack_require__(/*! @elementor/icons */ "@elementor/icons");
269 var Message = exports.Message = function Message(_ref) {
270 var action = _ref.action,
271 children = _ref.children,
272 _ref$severity = _ref.severity,
273 severity = _ref$severity === void 0 ? 'message' : _ref$severity,
274 onClose = _ref.onClose;
275 return /*#__PURE__*/_react.default.createElement(_ui.Snackbar, {
276 open: true,
277 autoHideDuration: 4000,
278 anchorOrigin: {
279 vertical: 'bottom',
280 horizontal: 'right'
281 },
282 onClose: onClose
283 }, 'message' !== severity ? /*#__PURE__*/_react.default.createElement(_ui.Alert, {
284 variant: "filled",
285 severity: severity,
286 onClose: onClose
287 }, children) : /*#__PURE__*/_react.default.createElement(_ui.SnackbarContent, {
288 message: /*#__PURE__*/_react.default.createElement(_ui.Stack, {
289 direction: "row",
290 gap: 1.5,
291 alignItems: "center"
292 }, /*#__PURE__*/_react.default.createElement(_icons.CircleCheckFilledIcon, null), children),
293 action: /*#__PURE__*/_react.default.createElement(_ui.Stack, {
294 direction: "row",
295 spacing: 1,
296 alignItems: "center"
297 }, action, /*#__PURE__*/_react.default.createElement(_ui.IconButton, {
298 color: "inherit",
299 size: "small",
300 onClick: onClose
301 }, /*#__PURE__*/_react.default.createElement(_icons.XIcon, {
302 fontSize: "small"
303 })))
304 }));
305 };
306 Message.propTypes = {
307 action: PropTypes.node,
308 children: PropTypes.node,
309 severity: PropTypes.oneOf(['message', 'success', 'warning', 'error']),
310 onClose: PropTypes.func
311 };
312
313 /***/ }),
314
315 /***/ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-terms.js":
316 /*!**********************************************************************!*\
317 !*** ../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-terms.js ***!
318 \**********************************************************************/
319 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
320
321 "use strict";
322 /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
323
324
325 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
326 var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
327 Object.defineProperty(exports, "__esModule", ({
328 value: true
329 }));
330 exports.Terms = void 0;
331 var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js"));
332 var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
333 var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "../node_modules/@babel/runtime/helpers/objectWithoutProperties.js"));
334 var _i18n = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
335 var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
336 var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react"));
337 var _optInContent = __webpack_require__(/*! ./opt-in-content */ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-content.js");
338 var _DialogHeaderGroup = _interopRequireDefault(__webpack_require__(/*! @elementor/ui/DialogHeaderGroup */ "@elementor/ui/DialogHeaderGroup"));
339 var _DialogHeader = _interopRequireDefault(__webpack_require__(/*! @elementor/ui/DialogHeader */ "@elementor/ui/DialogHeader"));
340 var _excluded = ["onClose", "onSubmit", "isEnrolled"];
341 function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
342 var i18n = {
343 header: (0, _i18n.__)('Version 4', 'elementor'),
344 chip: (0, _i18n.__)('Beta', 'elementor'),
345 checkboxText: (0, _i18n.__)('I’ve read and understood.', 'elementor'),
346 optIn: {
347 titleText: (0, _i18n.__)('You are about to enable version 4 features!', 'elementor'),
348 introText: (0, _i18n.__)('By activating, you’ll get early access to the next generation of Elementor’s Editor. This is your chance to explore new capabilities and help shape the future of Elementor! ', 'elementor'),
349 notesHeader: (0, _i18n.__)(' Important notes:', 'elementor'),
350 notes: {
351 details: [(0, _i18n.__)('Features are still in development, but the beta is safe to use in production.', 'elementor'), (0, _i18n.__)('When you activate, you’ll also be activating Containers and Nested Elements. You can turn them back off by going to: WP Admin > Elementor > Settings > Features.', 'elementor')]
352 },
353 activateButton: (0, _i18n.__)('Activate', 'elementor'),
354 cancelButton: (0, _i18n.__)('Cancel', 'elementor')
355 },
356 optOut: {
357 titleText: (0, _i18n.__)('You\'re about to lose all content created with version 4', 'elementor'),
358 notes: {
359 details: [(0, _i18n.__)('By deactivating, you’ll lose all Atomic Elements, Classes and Variables. Any content you created with these features will no longer be available or appear on your site.', 'elementor'), (0, _i18n.__)('Containers and Nested Elements will stay in their current status.', 'elementor')]
360 },
361 activateButton: (0, _i18n.__)('Deactivate', 'elementor'),
362 cancelButton: (0, _i18n.__)('Cancel', 'elementor')
363 }
364 };
365 var Terms = exports.Terms = function Terms(_ref) {
366 var onClose = _ref.onClose,
367 onSubmit = _ref.onSubmit,
368 isEnrolled = _ref.isEnrolled,
369 props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
370 var _useState = (0, _react.useState)(false),
371 _useState2 = (0, _slicedToArray2.default)(_useState, 2),
372 checked = _useState2[0],
373 setChecked = _useState2[1];
374 var handleCheckboxChange = function handleCheckboxChange() {
375 setChecked(function (prev) {
376 return !prev;
377 });
378 };
379 var handleSubmit = function handleSubmit() {
380 if (checked) {
381 onSubmit();
382 }
383 };
384 var currentState = isEnrolled ? 'optOut' : 'optIn';
385 return /*#__PURE__*/_react.default.createElement(_ui.Dialog, (0, _extends2.default)({}, props, {
386 open: true,
387 onClose: onClose
388 }), /*#__PURE__*/_react.default.createElement(_DialogHeader.default, null, /*#__PURE__*/_react.default.createElement(_DialogHeaderGroup.default, null, /*#__PURE__*/_react.default.createElement(_ui.DialogTitle, null, i18n.header), /*#__PURE__*/_react.default.createElement(_ui.Chip, {
389 label: i18n.chip,
390 color: "secondary",
391 variant: "filled",
392 size: "small"
393 }))), /*#__PURE__*/_react.default.createElement(_ui.DialogContent, {
394 dividers: true
395 }, /*#__PURE__*/_react.default.createElement(_ui.Stack, {
396 gap: 2.5
397 }, /*#__PURE__*/_react.default.createElement(_ui.Stack, {
398 gap: 1
399 }, /*#__PURE__*/_react.default.createElement(_optInContent.TextNode, {
400 align: "center",
401 variant: "h6"
402 }, i18n[currentState].titleText), /*#__PURE__*/_react.default.createElement(_optInContent.TextNode, {
403 align: "center",
404 variant: "body2"
405 }, i18n[currentState].introText)), /*#__PURE__*/_react.default.createElement(_ui.Stack, {
406 gap: 1
407 }, /*#__PURE__*/_react.default.createElement(_optInContent.TextNode, {
408 variant: "body2"
409 }, i18n[currentState].notesHeader), /*#__PURE__*/_react.default.createElement(_optInContent.ContentList, null, /*#__PURE__*/_react.default.createElement(_optInContent.ContentListItem, {
410 variant: "body2"
411 }, i18n[currentState].notes.details[0]), i18n[currentState].notes.details.slice(1).map(function (entry, index) {
412 return /*#__PURE__*/_react.default.createElement(_optInContent.ContentListItem, {
413 key: index,
414 variant: "body2"
415 }, entry);
416 }))), /*#__PURE__*/_react.default.createElement(_ui.FormControlLabel, {
417 control: /*#__PURE__*/_react.default.createElement(_ui.Checkbox, {
418 checked: !!checked,
419 onChange: handleCheckboxChange,
420 color: "secondary",
421 size: "small"
422 }),
423 label: /*#__PURE__*/_react.default.createElement(_optInContent.TextNode, {
424 variant: "body2"
425 }, i18n.checkboxText)
426 }))), /*#__PURE__*/_react.default.createElement(_ui.DialogActions, null, /*#__PURE__*/_react.default.createElement(_ui.Button, {
427 variant: "text",
428 color: "secondary",
429 onClick: onClose
430 }, i18n[currentState].cancelButton), /*#__PURE__*/_react.default.createElement(_ui.Button, {
431 disabled: !checked,
432 variant: "contained",
433 onClick: handleSubmit
434 }, i18n[currentState].activateButton)));
435 };
436 Terms.propTypes = {
437 onClose: PropTypes.func,
438 onSubmit: PropTypes.func,
439 isEnrolled: PropTypes.bool
440 };
441
442 /***/ }),
443
444 /***/ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in.js":
445 /*!****************************************************************!*\
446 !*** ../modules/atomic-opt-in/assets/js/opt-in-page/opt-in.js ***!
447 \****************************************************************/
448 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
449
450 "use strict";
451 /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
452
453
454 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
455 var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
456 Object.defineProperty(exports, "__esModule", ({
457 value: true
458 }));
459 exports.OptIn = void 0;
460 var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react"));
461 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
462 var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
463 var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
464 var _i18n = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
465 var _optInContent = __webpack_require__(/*! ./opt-in-content */ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-content.js");
466 var _optInImgPlaceholders = __webpack_require__(/*! ./opt-in-img-placeholders */ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-img-placeholders.js");
467 var _optInMessage = __webpack_require__(/*! ./opt-in-message */ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-message.js");
468 var _optInApi = __webpack_require__(/*! ./opt-in-api */ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-api.js");
469 var _dompurify = _interopRequireDefault(__webpack_require__(/*! dompurify */ "../node_modules/dompurify/dist/purify.cjs.js"));
470 var _optInTerms = __webpack_require__(/*! ./opt-in-terms */ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in-terms.js");
471 var _elementorSettingsEdi;
472 function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
473 function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
474 function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
475 var decodeHtmlUrl = function decodeHtmlUrl(html) {
476 var textarea = document.createElement('textarea');
477 textarea.innerHTML = html;
478 return textarea.value;
479 };
480 var OPT_IN_MSG = 'e-editor-v4-opt-in-message';
481 var OPT_OUT_MSG = 'e-editor-v4-opt-out-message';
482 var i18n = {
483 title: (0, _i18n.__)('The next generation of web creation', 'elementor'),
484 chip: (0, _i18n.__)('Beta', 'elementor'),
485 welcomeText: (0, _i18n.__)('Welcome to version 4 of Elementor\'s Editor. It’s faster, more flexible, and built on a fully atomic approach to structure & styling.', 'elementor'),
486 advantagesHeader: (0, _i18n.__)('Here’s what’s inside the beta version:', 'elementor'),
487 advantages: [(0, _i18n.__)('Unparalleled performance - Cleaner code & a lighter CSS footprint with single-div wrappers.', 'elementor'), (0, _i18n.__)('Professional tools at your fingertips - Variables, Classes and States.', 'elementor'), (0, _i18n.__)('Consistent styling experience - A unified Style tab for all atomic elements.', 'elementor'), (0, _i18n.__)('Fully responsive design - Customize any style property per screen.', 'elementor')],
488 andMore: (0, _i18n.__)('And much more!', 'elementor'),
489 readMore: (0, _i18n.__)('Learn more', 'elementor'),
490 feedback: (0, _i18n.__)('We’d love your feedback!', 'elementor'),
491 overToGithub: (0, _i18n.__)('Head over to Github', 'elementor'),
492 tellUsWhy: (0, _i18n.__)('Tell us why', 'elementor'),
493 image: (0, _i18n.__)('Editor V4', 'elementor'),
494 buttons: {
495 tryOut: (0, _i18n.__)('Try out the new experience', 'elementor'),
496 optIn: (0, _i18n.__)('Activate the new experience', 'elementor'),
497 optOut: (0, _i18n.__)('Deactivate V4', 'elementor')
498 },
499 messages: {
500 optInSuccess: (0, _i18n.__)('Welcome! You’ve got the newest version of the editor.', 'elementor'),
501 optOut: (0, _i18n.__)('You’ve deactivated the new Editor. Have feedback?', 'elementor'),
502 error: (0, _i18n.__)('Ouch, there was a glitch. Try activating V4 again soon.', 'elementor')
503 }
504 };
505 var optInLinks = {
506 feedbackUrl: 'https://go.elementor.com/wp-dash-opt-in-v4-feedback/',
507 readMoreUrl: 'https://go.elementor.com/wp-dash-opt-in-v4-help-center/',
508 tryOutUrl: _dompurify.default.sanitize(decodeHtmlUrl((_elementorSettingsEdi = elementorSettingsEditor4OptIn) === null || _elementorSettingsEdi === void 0 || (_elementorSettingsEdi = _elementorSettingsEdi.urls) === null || _elementorSettingsEdi === void 0 ? void 0 : _elementorSettingsEdi.start_building)) || '#'
509 };
510 var optInImages = {
511 square: {
512 src: 'https://assets.elementor.com/v4-promotion/v1/images/v4_opt_in_500.png',
513 sx: {
514 width: '100%',
515 maxHeight: '507px',
516 maxWidth: 'sm',
517 height: 'auto',
518 mx: 'auto',
519 borderRadius: 2
520 }
521 },
522 landscape: {
523 src: 'https://assets.elementor.com/v4-promotion/v1/images/v4_opt_in_260.png',
524 sx: {
525 width: '100%',
526 height: 'auto',
527 maxHeight: '260px',
528 mx: 'auto',
529 maxWidth: 'sm',
530 borderRadius: 2
531 }
532 }
533 };
534 var OptIn = exports.OptIn = function OptIn(_ref) {
535 var _state$features;
536 var state = _ref.state;
537 var _useState = (0, _react.useState)(false),
538 _useState2 = (0, _slicedToArray2.default)(_useState, 2),
539 showTerms = _useState2[0],
540 setShowTerms = _useState2[1];
541 var _useState3 = (0, _react.useState)(''),
542 _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
543 optInMessage = _useState4[0],
544 setOptInMessage = _useState4[1];
545 var _useState5 = (0, _react.useState)(''),
546 _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
547 optOutMessage = _useState6[0],
548 setOptOutMessage = _useState6[1];
549 var _useState7 = (0, _react.useState)(''),
550 _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
551 errorMessage = _useState8[0],
552 setErrorMessage = _useState8[1];
553 (0, _react.useEffect)(function () {
554 var optInMsg = sessionStorage.getItem(OPT_IN_MSG);
555 var optOutMsg = sessionStorage.getItem(OPT_OUT_MSG);
556 if (optInMsg) {
557 setTimeout(function () {
558 setOptInMessage(optInMsg);
559 }, 100);
560 sessionStorage.removeItem(OPT_IN_MSG);
561 }
562 if (optOutMsg) {
563 setTimeout(function () {
564 setOptOutMessage(optOutMsg);
565 }, 100);
566 sessionStorage.removeItem(OPT_OUT_MSG);
567 }
568 }, []);
569 var maybeOptIn = function maybeOptIn() {
570 (0, _optInApi.triggerOptIn)().then(function () {
571 sessionStorage.setItem(OPT_IN_MSG, i18n.messages.optInSuccess);
572 window.location.reload();
573 }).catch(function () {
574 setErrorMessage(i18n.messages.error);
575 });
576 };
577 var maybeOptOut = function maybeOptOut() {
578 (0, _optInApi.triggerOptOut)().then(function () {
579 sessionStorage.setItem(OPT_OUT_MSG, i18n.messages.optOut);
580 window.location.reload();
581 }).catch(function () {
582 setErrorMessage(i18n.messages.error);
583 });
584 };
585 var handlePopoverClose = function handlePopoverClose() {
586 setShowTerms(false);
587 };
588 var isEnrolled = !!(state !== null && state !== void 0 && (_state$features = state.features) !== null && _state$features !== void 0 && _state$features.editor_v4);
589 return /*#__PURE__*/_react.default.createElement(_ui.Container, {
590 maxWidth: "xl",
591 sx: {
592 marginBlockStart: 2.5,
593 display: 'flex',
594 flexBasis: '100%',
595 gap: 3,
596 flexDirection: {
597 xs: 'column-reverse',
598 md: 'row'
599 }
600 }
601 }, /*#__PURE__*/_react.default.createElement(_ui.Stack, {
602 sx: {
603 flex: 1,
604 maxWidth: {
605 md: '580px',
606 sm: '600px'
607 },
608 gap: 2.5,
609 mx: 'auto'
610 }
611 }, /*#__PURE__*/_react.default.createElement(_optInContent.TextNode, {
612 variant: "h4",
613 width: "fit-content"
614 }, /*#__PURE__*/_react.default.createElement("span", null, i18n.title), /*#__PURE__*/_react.default.createElement(_ui.Chip, {
615 size: "small",
616 color: "secondary",
617 variant: "filled",
618 label: i18n.chip,
619 sx: {
620 verticalAlign: 'baseline',
621 transform: 'translateY(-4px)',
622 ml: 1
623 }
624 })), /*#__PURE__*/_react.default.createElement(_ui.Stack, {
625 direction: "column",
626 gap: 3
627 }, /*#__PURE__*/_react.default.createElement(_ui.Box, null, /*#__PURE__*/_react.default.createElement(_optInContent.TextNode, null, i18n.welcomeText)), /*#__PURE__*/_react.default.createElement(_ui.Box, null, /*#__PURE__*/_react.default.createElement(_optInContent.TextNode, {
628 variant: "subtitle1",
629 sx: {
630 mb: 1.5
631 }
632 }, i18n.advantagesHeader), /*#__PURE__*/_react.default.createElement(_optInContent.AdvantagesList, null, i18n.advantages.map(function (entry, i) {
633 return /*#__PURE__*/_react.default.createElement(_optInContent.AdvantagesListItem, {
634 key: i
635 }, entry);
636 }), /*#__PURE__*/_react.default.createElement(_optInContent.AdvantagesListItem, {
637 key: i18n.advantages.length
638 }, i18n.andMore, " ", /*#__PURE__*/_react.default.createElement(_ui.Link, {
639 color: "text.primary",
640 href: optInLinks.readMoreUrl,
641 target: "_blank"
642 }, i18n.readMore))))), /*#__PURE__*/_react.default.createElement(_ui.Stack, {
643 direction: "column",
644 width: "clamp(240px, max(340px, 75%), 340px)",
645 maxWidth: "100%",
646 gap: 2
647 }, !isEnrolled ? /*#__PURE__*/_react.default.createElement(_ui.Button, {
648 onClick: function onClick() {
649 setShowTerms(true);
650 },
651 size: "large",
652 color: "primary",
653 variant: "contained",
654 sx: {
655 flexGrow: 1
656 }
657 }, i18n.buttons.optIn) : /*#__PURE__*/_react.default.createElement(_ui.Button, {
658 onClick: function onClick() {
659 return window.location.href = optInLinks.tryOutUrl;
660 },
661 size: "large",
662 color: "primary",
663 variant: "contained",
664 sx: {
665 flexGrow: 1
666 }
667 }, i18n.buttons.tryOut), /*#__PURE__*/_react.default.createElement(_ui.Button, {
668 onClick: function onClick() {
669 setShowTerms(true);
670 },
671 size: "large",
672 color: "secondary",
673 variant: "outlined",
674 sx: {
675 flexGrow: 1,
676 visibility: isEnrolled ? 'visible' : 'hidden'
677 }
678 }, i18n.buttons.optOut)), /*#__PURE__*/_react.default.createElement(_optInContent.TextNode, null, i18n.feedback, " ", /*#__PURE__*/_react.default.createElement(_ui.Link, {
679 underline: "hover",
680 href: optInLinks.feedbackUrl,
681 target: "_blank"
682 }, i18n.overToGithub))), /*#__PURE__*/_react.default.createElement(_ui.Stack, {
683 sx: {
684 flex: 1,
685 px: 0,
686 maxWidth: {
687 md: '507px',
688 sm: '600px'
689 },
690 mx: 'auto'
691 }
692 }, optInImages.square.src ? /*#__PURE__*/_react.default.createElement(_ui.Image, {
693 src: optInImages.square.src,
694 alt: i18n.image,
695 sx: _objectSpread(_objectSpread({}, optInImages.square.sx), {}, {
696 display: {
697 xs: 'none',
698 md: 'block'
699 }
700 })
701 }) : /*#__PURE__*/_react.default.createElement(_optInImgPlaceholders.ImageSquarePlaceholder, {
702 sx: _objectSpread(_objectSpread({}, optInImages.square.sx), {}, {
703 display: {
704 xs: 'none',
705 md: 'block'
706 }
707 })
708 }), optInImages.landscape.src ? /*#__PURE__*/_react.default.createElement(_ui.Image, {
709 src: optInImages.landscape.src,
710 alt: i18n.image,
711 sx: _objectSpread(_objectSpread({}, optInImages.landscape.sx), {}, {
712 display: {
713 xs: 'block',
714 md: 'none'
715 }
716 })
717 }) : /*#__PURE__*/_react.default.createElement(_optInImgPlaceholders.ImageLandscapePlaceholder, {
718 sx: _objectSpread(_objectSpread({}, optInImages.landscape.sx), {}, {
719 display: {
720 xs: 'block',
721 md: 'none'
722 }
723 })
724 })), showTerms && /*#__PURE__*/_react.default.createElement(_optInTerms.Terms, {
725 onClose: handlePopoverClose,
726 onSubmit: isEnrolled ? maybeOptOut : maybeOptIn,
727 isEnrolled: isEnrolled
728 }), optInMessage && /*#__PURE__*/_react.default.createElement(_optInMessage.Message, {
729 onClose: function onClose() {
730 return setOptInMessage('');
731 }
732 }, optInMessage), optOutMessage && /*#__PURE__*/_react.default.createElement(_optInMessage.Message, {
733 onClose: function onClose() {
734 return setOptOutMessage('');
735 },
736 action: /*#__PURE__*/_react.default.createElement(_ui.Link, {
737 href: optInLinks.feedbackUrl,
738 target: "_blank",
739 color: "inherit",
740 sx: {
741 cursor: 'pointer',
742 textDecoration: 'none',
743 pl: 3
744 }
745 }, i18n.tellUsWhy)
746 }, optOutMessage), errorMessage && /*#__PURE__*/_react.default.createElement(_optInMessage.Message, {
747 severity: "error",
748 onClose: function onClose() {
749 return setErrorMessage('');
750 }
751 }, errorMessage));
752 };
753 OptIn.propTypes = {
754 state: PropTypes.shape({
755 features: PropTypes.shape({
756 editor_v4: PropTypes.bool
757 })
758 }).isRequired
759 };
760
761 /***/ }),
762
763 /***/ "../node_modules/@babel/runtime/helpers/OverloadYield.js":
764 /*!***************************************************************!*\
765 !*** ../node_modules/@babel/runtime/helpers/OverloadYield.js ***!
766 \***************************************************************/
767 /***/ ((module) => {
768
769 function _OverloadYield(e, d) {
770 this.v = e, this.k = d;
771 }
772 module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports;
773
774 /***/ }),
775
776 /***/ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js":
777 /*!******************************************************************!*\
778 !*** ../node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
779 \******************************************************************/
780 /***/ ((module) => {
781
782 function _arrayLikeToArray(r, a) {
783 (null == a || a > r.length) && (a = r.length);
784 for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
785 return n;
786 }
787 module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
788
789 /***/ }),
790
791 /***/ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js":
792 /*!****************************************************************!*\
793 !*** ../node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
794 \****************************************************************/
795 /***/ ((module) => {
796
797 function _arrayWithHoles(r) {
798 if (Array.isArray(r)) return r;
799 }
800 module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
801
802 /***/ }),
803
804 /***/ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js":
805 /*!******************************************************************!*\
806 !*** ../node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
807 \******************************************************************/
808 /***/ ((module) => {
809
810 function asyncGeneratorStep(n, t, e, r, o, a, c) {
811 try {
812 var i = n[a](c),
813 u = i.value;
814 } catch (n) {
815 return void e(n);
816 }
817 i.done ? t(u) : Promise.resolve(u).then(r, o);
818 }
819 function _asyncToGenerator(n) {
820 return function () {
821 var t = this,
822 e = arguments;
823 return new Promise(function (r, o) {
824 var a = n.apply(t, e);
825 function _next(n) {
826 asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
827 }
828 function _throw(n) {
829 asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
830 }
831 _next(void 0);
832 });
833 };
834 }
835 module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
836
837 /***/ }),
838
839 /***/ "../node_modules/@babel/runtime/helpers/defineProperty.js":
840 /*!****************************************************************!*\
841 !*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***!
842 \****************************************************************/
843 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
844
845 var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js");
846 function _defineProperty(e, r, t) {
847 return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
848 value: t,
849 enumerable: !0,
850 configurable: !0,
851 writable: !0
852 }) : e[r] = t, e;
853 }
854 module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
855
856 /***/ }),
857
858 /***/ "../node_modules/@babel/runtime/helpers/extends.js":
859 /*!*********************************************************!*\
860 !*** ../node_modules/@babel/runtime/helpers/extends.js ***!
861 \*********************************************************/
862 /***/ ((module) => {
863
864 function _extends() {
865 return module.exports = _extends = Object.assign ? Object.assign.bind() : function (n) {
866 for (var e = 1; e < arguments.length; e++) {
867 var t = arguments[e];
868 for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
869 }
870 return n;
871 }, module.exports.__esModule = true, module.exports["default"] = module.exports, _extends.apply(null, arguments);
872 }
873 module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
874
875 /***/ }),
876
877 /***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js":
878 /*!***********************************************************************!*\
879 !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
880 \***********************************************************************/
881 /***/ ((module) => {
882
883 function _interopRequireDefault(e) {
884 return e && e.__esModule ? e : {
885 "default": e
886 };
887 }
888 module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
889
890 /***/ }),
891
892 /***/ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js":
893 /*!**********************************************************************!*\
894 !*** ../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
895 \**********************************************************************/
896 /***/ ((module) => {
897
898 function _iterableToArrayLimit(r, l) {
899 var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
900 if (null != t) {
901 var e,
902 n,
903 i,
904 u,
905 a = [],
906 f = !0,
907 o = !1;
908 try {
909 if (i = (t = t.call(r)).next, 0 === l) {
910 if (Object(t) !== t) return;
911 f = !1;
912 } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
913 } catch (r) {
914 o = !0, n = r;
915 } finally {
916 try {
917 if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
918 } finally {
919 if (o) throw n;
920 }
921 }
922 return a;
923 }
924 }
925 module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
926
927 /***/ }),
928
929 /***/ "../node_modules/@babel/runtime/helpers/nonIterableRest.js":
930 /*!*****************************************************************!*\
931 !*** ../node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
932 \*****************************************************************/
933 /***/ ((module) => {
934
935 function _nonIterableRest() {
936 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
937 }
938 module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
939
940 /***/ }),
941
942 /***/ "../node_modules/@babel/runtime/helpers/objectWithoutProperties.js":
943 /*!*************************************************************************!*\
944 !*** ../node_modules/@babel/runtime/helpers/objectWithoutProperties.js ***!
945 \*************************************************************************/
946 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
947
948 var objectWithoutPropertiesLoose = __webpack_require__(/*! ./objectWithoutPropertiesLoose.js */ "../node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js");
949 function _objectWithoutProperties(e, t) {
950 if (null == e) return {};
951 var o,
952 r,
953 i = objectWithoutPropertiesLoose(e, t);
954 if (Object.getOwnPropertySymbols) {
955 var n = Object.getOwnPropertySymbols(e);
956 for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
957 }
958 return i;
959 }
960 module.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports["default"] = module.exports;
961
962 /***/ }),
963
964 /***/ "../node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js":
965 /*!******************************************************************************!*\
966 !*** ../node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js ***!
967 \******************************************************************************/
968 /***/ ((module) => {
969
970 function _objectWithoutPropertiesLoose(r, e) {
971 if (null == r) return {};
972 var t = {};
973 for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
974 if (-1 !== e.indexOf(n)) continue;
975 t[n] = r[n];
976 }
977 return t;
978 }
979 module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
980
981 /***/ }),
982
983 /***/ "../node_modules/@babel/runtime/helpers/regenerator.js":
984 /*!*************************************************************!*\
985 !*** ../node_modules/@babel/runtime/helpers/regenerator.js ***!
986 \*************************************************************/
987 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
988
989 var regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js");
990 function _regenerator() {
991 /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
992 var e,
993 t,
994 r = "function" == typeof Symbol ? Symbol : {},
995 n = r.iterator || "@@iterator",
996 o = r.toStringTag || "@@toStringTag";
997 function i(r, n, o, i) {
998 var c = n && n.prototype instanceof Generator ? n : Generator,
999 u = Object.create(c.prototype);
1000 return regeneratorDefine(u, "_invoke", function (r, n, o) {
1001 var i,
1002 c,
1003 u,
1004 f = 0,
1005 p = o || [],
1006 y = !1,
1007 G = {
1008 p: 0,
1009 n: 0,
1010 v: e,
1011 a: d,
1012 f: d.bind(e, 4),
1013 d: function d(t, r) {
1014 return i = t, c = 0, u = e, G.n = r, a;
1015 }
1016 };
1017 function d(r, n) {
1018 for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
1019 var o,
1020 i = p[t],
1021 d = G.p,
1022 l = i[2];
1023 r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
1024 }
1025 if (o || r > 1) return a;
1026 throw y = !0, n;
1027 }
1028 return function (o, p, l) {
1029 if (f > 1) throw TypeError("Generator is already running");
1030 for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
1031 i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
1032 try {
1033 if (f = 2, i) {
1034 if (c || (o = "next"), t = i[o]) {
1035 if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
1036 if (!t.done) return t;
1037 u = t.value, c < 2 && (c = 0);
1038 } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
1039 i = e;
1040 } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
1041 } catch (t) {
1042 i = e, c = 1, u = t;
1043 } finally {
1044 f = 1;
1045 }
1046 }
1047 return {
1048 value: t,
1049 done: y
1050 };
1051 };
1052 }(r, o, i), !0), u;
1053 }
1054 var a = {};
1055 function Generator() {}
1056 function GeneratorFunction() {}
1057 function GeneratorFunctionPrototype() {}
1058 t = Object.getPrototypeOf;
1059 var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function () {
1060 return this;
1061 }), t),
1062 u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
1063 function f(e) {
1064 return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
1065 }
1066 return GeneratorFunction.prototype = GeneratorFunctionPrototype, regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), regeneratorDefine(u), regeneratorDefine(u, o, "Generator"), regeneratorDefine(u, n, function () {
1067 return this;
1068 }), regeneratorDefine(u, "toString", function () {
1069 return "[object Generator]";
1070 }), (module.exports = _regenerator = function _regenerator() {
1071 return {
1072 w: i,
1073 m: f
1074 };
1075 }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
1076 }
1077 module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
1078
1079 /***/ }),
1080
1081 /***/ "../node_modules/@babel/runtime/helpers/regeneratorAsync.js":
1082 /*!******************************************************************!*\
1083 !*** ../node_modules/@babel/runtime/helpers/regeneratorAsync.js ***!
1084 \******************************************************************/
1085 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1086
1087 var regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js");
1088 function _regeneratorAsync(n, e, r, t, o) {
1089 var a = regeneratorAsyncGen(n, e, r, t, o);
1090 return a.next().then(function (n) {
1091 return n.done ? n.value : a.next();
1092 });
1093 }
1094 module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports;
1095
1096 /***/ }),
1097
1098 /***/ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js":
1099 /*!*********************************************************************!*\
1100 !*** ../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js ***!
1101 \*********************************************************************/
1102 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1103
1104 var regenerator = __webpack_require__(/*! ./regenerator.js */ "../node_modules/@babel/runtime/helpers/regenerator.js");
1105 var regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js");
1106 function _regeneratorAsyncGen(r, e, t, o, n) {
1107 return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise);
1108 }
1109 module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports;
1110
1111 /***/ }),
1112
1113 /***/ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js":
1114 /*!**************************************************************************!*\
1115 !*** ../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js ***!
1116 \**************************************************************************/
1117 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1118
1119 var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ "../node_modules/@babel/runtime/helpers/OverloadYield.js");
1120 var regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js");
1121 function AsyncIterator(t, e) {
1122 function n(r, o, i, f) {
1123 try {
1124 var c = t[r](o),
1125 u = c.value;
1126 return u instanceof OverloadYield ? e.resolve(u.v).then(function (t) {
1127 n("next", t, i, f);
1128 }, function (t) {
1129 n("throw", t, i, f);
1130 }) : e.resolve(u).then(function (t) {
1131 c.value = t, i(c);
1132 }, function (t) {
1133 return n("throw", t, i, f);
1134 });
1135 } catch (t) {
1136 f(t);
1137 }
1138 }
1139 var r;
1140 this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () {
1141 return this;
1142 })), regeneratorDefine(this, "_invoke", function (t, o, i) {
1143 function f() {
1144 return new e(function (e, r) {
1145 n(t, i, e, r);
1146 });
1147 }
1148 return r = r ? r.then(f, f) : f();
1149 }, !0);
1150 }
1151 module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports;
1152
1153 /***/ }),
1154
1155 /***/ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js":
1156 /*!*******************************************************************!*\
1157 !*** ../node_modules/@babel/runtime/helpers/regeneratorDefine.js ***!
1158 \*******************************************************************/
1159 /***/ ((module) => {
1160
1161 function _regeneratorDefine(e, r, n, t) {
1162 var i = Object.defineProperty;
1163 try {
1164 i({}, "", {});
1165 } catch (e) {
1166 i = 0;
1167 }
1168 module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) {
1169 function o(r, n) {
1170 _regeneratorDefine(e, r, function (e) {
1171 return this._invoke(r, n, e);
1172 });
1173 }
1174 r ? i ? i(e, r, {
1175 value: n,
1176 enumerable: !t,
1177 configurable: !t,
1178 writable: !t
1179 }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
1180 }, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t);
1181 }
1182 module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports;
1183
1184 /***/ }),
1185
1186 /***/ "../node_modules/@babel/runtime/helpers/regeneratorKeys.js":
1187 /*!*****************************************************************!*\
1188 !*** ../node_modules/@babel/runtime/helpers/regeneratorKeys.js ***!
1189 \*****************************************************************/
1190 /***/ ((module) => {
1191
1192 function _regeneratorKeys(e) {
1193 var n = Object(e),
1194 r = [];
1195 for (var t in n) r.unshift(t);
1196 return function e() {
1197 for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e;
1198 return e.done = !0, e;
1199 };
1200 }
1201 module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports;
1202
1203 /***/ }),
1204
1205 /***/ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js":
1206 /*!********************************************************************!*\
1207 !*** ../node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
1208 \********************************************************************/
1209 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1210
1211 var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ "../node_modules/@babel/runtime/helpers/OverloadYield.js");
1212 var regenerator = __webpack_require__(/*! ./regenerator.js */ "../node_modules/@babel/runtime/helpers/regenerator.js");
1213 var regeneratorAsync = __webpack_require__(/*! ./regeneratorAsync.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsync.js");
1214 var regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js");
1215 var regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js");
1216 var regeneratorKeys = __webpack_require__(/*! ./regeneratorKeys.js */ "../node_modules/@babel/runtime/helpers/regeneratorKeys.js");
1217 var regeneratorValues = __webpack_require__(/*! ./regeneratorValues.js */ "../node_modules/@babel/runtime/helpers/regeneratorValues.js");
1218 function _regeneratorRuntime() {
1219 "use strict";
1220
1221 var r = regenerator(),
1222 e = r.m(_regeneratorRuntime),
1223 t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
1224 function n(r) {
1225 var e = "function" == typeof r && r.constructor;
1226 return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
1227 }
1228 var o = {
1229 "throw": 1,
1230 "return": 2,
1231 "break": 3,
1232 "continue": 3
1233 };
1234 function a(r) {
1235 var e, t;
1236 return function (n) {
1237 e || (e = {
1238 stop: function stop() {
1239 return t(n.a, 2);
1240 },
1241 "catch": function _catch() {
1242 return n.v;
1243 },
1244 abrupt: function abrupt(r, e) {
1245 return t(n.a, o[r], e);
1246 },
1247 delegateYield: function delegateYield(r, o, a) {
1248 return e.resultName = o, t(n.d, regeneratorValues(r), a);
1249 },
1250 finish: function finish(r) {
1251 return t(n.f, r);
1252 }
1253 }, t = function t(r, _t, o) {
1254 n.p = e.prev, n.n = e.next;
1255 try {
1256 return r(_t, o);
1257 } finally {
1258 e.next = n.n;
1259 }
1260 }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
1261 try {
1262 return r.call(this, e);
1263 } finally {
1264 n.p = e.prev, n.n = e.next;
1265 }
1266 };
1267 }
1268 return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
1269 return {
1270 wrap: function wrap(e, t, n, o) {
1271 return r.w(a(e), t, n, o && o.reverse());
1272 },
1273 isGeneratorFunction: n,
1274 mark: r.m,
1275 awrap: function awrap(r, e) {
1276 return new OverloadYield(r, e);
1277 },
1278 AsyncIterator: regeneratorAsyncIterator,
1279 async: function async(r, e, t, o, u) {
1280 return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u);
1281 },
1282 keys: regeneratorKeys,
1283 values: regeneratorValues
1284 };
1285 }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
1286 }
1287 module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
1288
1289 /***/ }),
1290
1291 /***/ "../node_modules/@babel/runtime/helpers/regeneratorValues.js":
1292 /*!*******************************************************************!*\
1293 !*** ../node_modules/@babel/runtime/helpers/regeneratorValues.js ***!
1294 \*******************************************************************/
1295 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1296
1297 var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
1298 function _regeneratorValues(e) {
1299 if (null != e) {
1300 var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],
1301 r = 0;
1302 if (t) return t.call(e);
1303 if ("function" == typeof e.next) return e;
1304 if (!isNaN(e.length)) return {
1305 next: function next() {
1306 return e && r >= e.length && (e = void 0), {
1307 value: e && e[r++],
1308 done: !e
1309 };
1310 }
1311 };
1312 }
1313 throw new TypeError(_typeof(e) + " is not iterable");
1314 }
1315 module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports;
1316
1317 /***/ }),
1318
1319 /***/ "../node_modules/@babel/runtime/helpers/slicedToArray.js":
1320 /*!***************************************************************!*\
1321 !*** ../node_modules/@babel/runtime/helpers/slicedToArray.js ***!
1322 \***************************************************************/
1323 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1324
1325 var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js");
1326 var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js");
1327 var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js");
1328 var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ "../node_modules/@babel/runtime/helpers/nonIterableRest.js");
1329 function _slicedToArray(r, e) {
1330 return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest();
1331 }
1332 module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
1333
1334 /***/ }),
1335
1336 /***/ "../node_modules/@babel/runtime/helpers/toPrimitive.js":
1337 /*!*************************************************************!*\
1338 !*** ../node_modules/@babel/runtime/helpers/toPrimitive.js ***!
1339 \*************************************************************/
1340 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1341
1342 var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
1343 function toPrimitive(t, r) {
1344 if ("object" != _typeof(t) || !t) return t;
1345 var e = t[Symbol.toPrimitive];
1346 if (void 0 !== e) {
1347 var i = e.call(t, r || "default");
1348 if ("object" != _typeof(i)) return i;
1349 throw new TypeError("@@toPrimitive must return a primitive value.");
1350 }
1351 return ("string" === r ? String : Number)(t);
1352 }
1353 module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
1354
1355 /***/ }),
1356
1357 /***/ "../node_modules/@babel/runtime/helpers/toPropertyKey.js":
1358 /*!***************************************************************!*\
1359 !*** ../node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
1360 \***************************************************************/
1361 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1362
1363 var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
1364 var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/toPrimitive.js");
1365 function toPropertyKey(t) {
1366 var i = toPrimitive(t, "string");
1367 return "symbol" == _typeof(i) ? i : i + "";
1368 }
1369 module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
1370
1371 /***/ }),
1372
1373 /***/ "../node_modules/@babel/runtime/helpers/typeof.js":
1374 /*!********************************************************!*\
1375 !*** ../node_modules/@babel/runtime/helpers/typeof.js ***!
1376 \********************************************************/
1377 /***/ ((module) => {
1378
1379 function _typeof(o) {
1380 "@babel/helpers - typeof";
1381
1382 return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
1383 return typeof o;
1384 } : function (o) {
1385 return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
1386 }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
1387 }
1388 module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
1389
1390 /***/ }),
1391
1392 /***/ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js":
1393 /*!****************************************************************************!*\
1394 !*** ../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
1395 \****************************************************************************/
1396 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1397
1398 var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js");
1399 function _unsupportedIterableToArray(r, a) {
1400 if (r) {
1401 if ("string" == typeof r) return arrayLikeToArray(r, a);
1402 var t = {}.toString.call(r).slice(8, -1);
1403 return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0;
1404 }
1405 }
1406 module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
1407
1408 /***/ }),
1409
1410 /***/ "../node_modules/@babel/runtime/regenerator/index.js":
1411 /*!***********************************************************!*\
1412 !*** ../node_modules/@babel/runtime/regenerator/index.js ***!
1413 \***********************************************************/
1414 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1415
1416 // TODO(Babel 8): Remove this file.
1417
1418 var runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js")();
1419 module.exports = runtime;
1420
1421 // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
1422 try {
1423 regeneratorRuntime = runtime;
1424 } catch (accidentalStrictMode) {
1425 if (typeof globalThis === "object") {
1426 globalThis.regeneratorRuntime = runtime;
1427 } else {
1428 Function("r", "regeneratorRuntime = r")(runtime);
1429 }
1430 }
1431
1432
1433 /***/ }),
1434
1435 /***/ "../node_modules/dompurify/dist/purify.cjs.js":
1436 /*!****************************************************!*\
1437 !*** ../node_modules/dompurify/dist/purify.cjs.js ***!
1438 \****************************************************/
1439 /***/ ((module) => {
1440
1441 "use strict";
1442 /*! @license DOMPurify 3.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.0/LICENSE */
1443
1444
1445
1446 const {
1447 entries,
1448 setPrototypeOf,
1449 isFrozen,
1450 getPrototypeOf,
1451 getOwnPropertyDescriptor
1452 } = Object;
1453 let {
1454 freeze,
1455 seal,
1456 create
1457 } = Object; // eslint-disable-line import/no-mutable-exports
1458 let {
1459 apply,
1460 construct
1461 } = typeof Reflect !== 'undefined' && Reflect;
1462 if (!freeze) {
1463 freeze = function freeze(x) {
1464 return x;
1465 };
1466 }
1467 if (!seal) {
1468 seal = function seal(x) {
1469 return x;
1470 };
1471 }
1472 if (!apply) {
1473 apply = function apply(func, thisArg) {
1474 for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
1475 args[_key - 2] = arguments[_key];
1476 }
1477 return func.apply(thisArg, args);
1478 };
1479 }
1480 if (!construct) {
1481 construct = function construct(Func) {
1482 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
1483 args[_key2 - 1] = arguments[_key2];
1484 }
1485 return new Func(...args);
1486 };
1487 }
1488 const arrayForEach = unapply(Array.prototype.forEach);
1489 const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
1490 const arrayPop = unapply(Array.prototype.pop);
1491 const arrayPush = unapply(Array.prototype.push);
1492 const arraySplice = unapply(Array.prototype.splice);
1493 const stringToLowerCase = unapply(String.prototype.toLowerCase);
1494 const stringToString = unapply(String.prototype.toString);
1495 const stringMatch = unapply(String.prototype.match);
1496 const stringReplace = unapply(String.prototype.replace);
1497 const stringIndexOf = unapply(String.prototype.indexOf);
1498 const stringTrim = unapply(String.prototype.trim);
1499 const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
1500 const regExpTest = unapply(RegExp.prototype.test);
1501 const typeErrorCreate = unconstruct(TypeError);
1502 /**
1503 * Creates a new function that calls the given function with a specified thisArg and arguments.
1504 *
1505 * @param func - The function to be wrapped and called.
1506 * @returns A new function that calls the given function with a specified thisArg and arguments.
1507 */
1508 function unapply(func) {
1509 return function (thisArg) {
1510 if (thisArg instanceof RegExp) {
1511 thisArg.lastIndex = 0;
1512 }
1513 for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
1514 args[_key3 - 1] = arguments[_key3];
1515 }
1516 return apply(func, thisArg, args);
1517 };
1518 }
1519 /**
1520 * Creates a new function that constructs an instance of the given constructor function with the provided arguments.
1521 *
1522 * @param func - The constructor function to be wrapped and called.
1523 * @returns A new function that constructs an instance of the given constructor function with the provided arguments.
1524 */
1525 function unconstruct(Func) {
1526 return function () {
1527 for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
1528 args[_key4] = arguments[_key4];
1529 }
1530 return construct(Func, args);
1531 };
1532 }
1533 /**
1534 * Add properties to a lookup table
1535 *
1536 * @param set - The set to which elements will be added.
1537 * @param array - The array containing elements to be added to the set.
1538 * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.
1539 * @returns The modified set with added elements.
1540 */
1541 function addToSet(set, array) {
1542 let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;
1543 if (setPrototypeOf) {
1544 // Make 'in' and truthy checks like Boolean(set.constructor)
1545 // independent of any properties defined on Object.prototype.
1546 // Prevent prototype setters from intercepting set as a this value.
1547 setPrototypeOf(set, null);
1548 }
1549 let l = array.length;
1550 while (l--) {
1551 let element = array[l];
1552 if (typeof element === 'string') {
1553 const lcElement = transformCaseFunc(element);
1554 if (lcElement !== element) {
1555 // Config presets (e.g. tags.js, attrs.js) are immutable.
1556 if (!isFrozen(array)) {
1557 array[l] = lcElement;
1558 }
1559 element = lcElement;
1560 }
1561 }
1562 set[element] = true;
1563 }
1564 return set;
1565 }
1566 /**
1567 * Clean up an array to harden against CSPP
1568 *
1569 * @param array - The array to be cleaned.
1570 * @returns The cleaned version of the array
1571 */
1572 function cleanArray(array) {
1573 for (let index = 0; index < array.length; index++) {
1574 const isPropertyExist = objectHasOwnProperty(array, index);
1575 if (!isPropertyExist) {
1576 array[index] = null;
1577 }
1578 }
1579 return array;
1580 }
1581 /**
1582 * Shallow clone an object
1583 *
1584 * @param object - The object to be cloned.
1585 * @returns A new object that copies the original.
1586 */
1587 function clone(object) {
1588 const newObject = create(null);
1589 for (const [property, value] of entries(object)) {
1590 const isPropertyExist = objectHasOwnProperty(object, property);
1591 if (isPropertyExist) {
1592 if (Array.isArray(value)) {
1593 newObject[property] = cleanArray(value);
1594 } else if (value && typeof value === 'object' && value.constructor === Object) {
1595 newObject[property] = clone(value);
1596 } else {
1597 newObject[property] = value;
1598 }
1599 }
1600 }
1601 return newObject;
1602 }
1603 /**
1604 * This method automatically checks if the prop is function or getter and behaves accordingly.
1605 *
1606 * @param object - The object to look up the getter function in its prototype chain.
1607 * @param prop - The property name for which to find the getter function.
1608 * @returns The getter function found in the prototype chain or a fallback function.
1609 */
1610 function lookupGetter(object, prop) {
1611 while (object !== null) {
1612 const desc = getOwnPropertyDescriptor(object, prop);
1613 if (desc) {
1614 if (desc.get) {
1615 return unapply(desc.get);
1616 }
1617 if (typeof desc.value === 'function') {
1618 return unapply(desc.value);
1619 }
1620 }
1621 object = getPrototypeOf(object);
1622 }
1623 function fallbackValue() {
1624 return null;
1625 }
1626 return fallbackValue;
1627 }
1628
1629 const html$1 = 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', 'search', 'section', 'select', 'shadow', 'slot', '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']);
1630 const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'enterkeyhint', 'exportparts', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'inputmode', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'part', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
1631 const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);
1632 // List of SVG elements that are disallowed by default.
1633 // We still need to know them so that we can do namespace
1634 // checks properly in case one wants to add them to
1635 // allow-list.
1636 const svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', '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']);
1637 const mathMl$1 = 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', 'mprescripts']);
1638 // Similarly to SVG, we want to know all MathML elements,
1639 // even those that we disallow by default.
1640 const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
1641 const text = freeze(['#text']);
1642
1643 const html = 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', 'exportparts', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inert', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'part', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'slot', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);
1644 const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', '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', 'exponent', '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', 'intercept', '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', 'mask-type', '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', 'slope', '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', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', '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']);
1645 const mathMl = 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']);
1646 const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
1647
1648 // eslint-disable-next-line unicorn/better-regex
1649 const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
1650 const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
1651 const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); // eslint-disable-line unicorn/better-regex
1652 const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape
1653 const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
1654 const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
1655 );
1656 const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
1657 const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex
1658 );
1659 const DOCTYPE_NAME = seal(/^html$/i);
1660 const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
1661
1662 var EXPRESSIONS = /*#__PURE__*/Object.freeze({
1663 __proto__: null,
1664 ARIA_ATTR: ARIA_ATTR,
1665 ATTR_WHITESPACE: ATTR_WHITESPACE,
1666 CUSTOM_ELEMENT: CUSTOM_ELEMENT,
1667 DATA_ATTR: DATA_ATTR,
1668 DOCTYPE_NAME: DOCTYPE_NAME,
1669 ERB_EXPR: ERB_EXPR,
1670 IS_ALLOWED_URI: IS_ALLOWED_URI,
1671 IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,
1672 MUSTACHE_EXPR: MUSTACHE_EXPR,
1673 TMPLIT_EXPR: TMPLIT_EXPR
1674 });
1675
1676 /* eslint-disable @typescript-eslint/indent */
1677 // https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
1678 const NODE_TYPE = {
1679 element: 1,
1680 attribute: 2,
1681 text: 3,
1682 cdataSection: 4,
1683 entityReference: 5,
1684 // Deprecated
1685 entityNode: 6,
1686 // Deprecated
1687 progressingInstruction: 7,
1688 comment: 8,
1689 document: 9,
1690 documentType: 10,
1691 documentFragment: 11,
1692 notation: 12 // Deprecated
1693 };
1694 const getGlobal = function getGlobal() {
1695 return typeof window === 'undefined' ? null : window;
1696 };
1697 /**
1698 * Creates a no-op policy for internal use only.
1699 * Don't export this function outside this module!
1700 * @param trustedTypes The policy factory.
1701 * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).
1702 * @return The policy created (or null, if Trusted Types
1703 * are not supported or creating the policy failed).
1704 */
1705 const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {
1706 if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
1707 return null;
1708 }
1709 // Allow the callers to control the unique policy name
1710 // by adding a data-tt-policy-suffix to the script element with the DOMPurify.
1711 // Policy creation with duplicate names throws in Trusted Types.
1712 let suffix = null;
1713 const ATTR_NAME = 'data-tt-policy-suffix';
1714 if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {
1715 suffix = purifyHostElement.getAttribute(ATTR_NAME);
1716 }
1717 const policyName = 'dompurify' + (suffix ? '#' + suffix : '');
1718 try {
1719 return trustedTypes.createPolicy(policyName, {
1720 createHTML(html) {
1721 return html;
1722 },
1723 createScriptURL(scriptUrl) {
1724 return scriptUrl;
1725 }
1726 });
1727 } catch (_) {
1728 // Policy creation failed (most likely another DOMPurify script has
1729 // already run). Skip creating the policy, as this will only cause errors
1730 // if TT are enforced.
1731 console.warn('TrustedTypes policy ' + policyName + ' could not be created.');
1732 return null;
1733 }
1734 };
1735 const _createHooksMap = function _createHooksMap() {
1736 return {
1737 afterSanitizeAttributes: [],
1738 afterSanitizeElements: [],
1739 afterSanitizeShadowDOM: [],
1740 beforeSanitizeAttributes: [],
1741 beforeSanitizeElements: [],
1742 beforeSanitizeShadowDOM: [],
1743 uponSanitizeAttribute: [],
1744 uponSanitizeElement: [],
1745 uponSanitizeShadowNode: []
1746 };
1747 };
1748 function createDOMPurify() {
1749 let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
1750 const DOMPurify = root => createDOMPurify(root);
1751 DOMPurify.version = '3.3.0';
1752 DOMPurify.removed = [];
1753 if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
1754 // Not running in a browser, provide a factory function
1755 // so that you can pass your own Window
1756 DOMPurify.isSupported = false;
1757 return DOMPurify;
1758 }
1759 let {
1760 document
1761 } = window;
1762 const originalDocument = document;
1763 const currentScript = originalDocument.currentScript;
1764 const {
1765 DocumentFragment,
1766 HTMLTemplateElement,
1767 Node,
1768 Element,
1769 NodeFilter,
1770 NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,
1771 HTMLFormElement,
1772 DOMParser,
1773 trustedTypes
1774 } = window;
1775 const ElementPrototype = Element.prototype;
1776 const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
1777 const remove = lookupGetter(ElementPrototype, 'remove');
1778 const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
1779 const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
1780 const getParentNode = lookupGetter(ElementPrototype, 'parentNode');
1781 // As per issue #47, the web-components registry is inherited by a
1782 // new document created via createHTMLDocument. As per the spec
1783 // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
1784 // a new empty registry is used when creating a template contents owner
1785 // document, so we use that as our parent document to ensure nothing
1786 // is inherited.
1787 if (typeof HTMLTemplateElement === 'function') {
1788 const template = document.createElement('template');
1789 if (template.content && template.content.ownerDocument) {
1790 document = template.content.ownerDocument;
1791 }
1792 }
1793 let trustedTypesPolicy;
1794 let emptyHTML = '';
1795 const {
1796 implementation,
1797 createNodeIterator,
1798 createDocumentFragment,
1799 getElementsByTagName
1800 } = document;
1801 const {
1802 importNode
1803 } = originalDocument;
1804 let hooks = _createHooksMap();
1805 /**
1806 * Expose whether this browser supports running the full DOMPurify.
1807 */
1808 DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;
1809 const {
1810 MUSTACHE_EXPR,
1811 ERB_EXPR,
1812 TMPLIT_EXPR,
1813 DATA_ATTR,
1814 ARIA_ATTR,
1815 IS_SCRIPT_OR_DATA,
1816 ATTR_WHITESPACE,
1817 CUSTOM_ELEMENT
1818 } = EXPRESSIONS;
1819 let {
1820 IS_ALLOWED_URI: IS_ALLOWED_URI$1
1821 } = EXPRESSIONS;
1822 /**
1823 * We consider the elements and attributes below to be safe. Ideally
1824 * don't add any new ones but feel free to remove unwanted ones.
1825 */
1826 /* allowed element names */
1827 let ALLOWED_TAGS = null;
1828 const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);
1829 /* Allowed attribute names */
1830 let ALLOWED_ATTR = null;
1831 const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
1832 /*
1833 * Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements.
1834 * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)
1835 * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)
1836 * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.
1837 */
1838 let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
1839 tagNameCheck: {
1840 writable: true,
1841 configurable: false,
1842 enumerable: true,
1843 value: null
1844 },
1845 attributeNameCheck: {
1846 writable: true,
1847 configurable: false,
1848 enumerable: true,
1849 value: null
1850 },
1851 allowCustomizedBuiltInElements: {
1852 writable: true,
1853 configurable: false,
1854 enumerable: true,
1855 value: false
1856 }
1857 }));
1858 /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */
1859 let FORBID_TAGS = null;
1860 /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
1861 let FORBID_ATTR = null;
1862 /* Config object to store ADD_TAGS/ADD_ATTR functions (when used as functions) */
1863 const EXTRA_ELEMENT_HANDLING = Object.seal(create(null, {
1864 tagCheck: {
1865 writable: true,
1866 configurable: false,
1867 enumerable: true,
1868 value: null
1869 },
1870 attributeCheck: {
1871 writable: true,
1872 configurable: false,
1873 enumerable: true,
1874 value: null
1875 }
1876 }));
1877 /* Decide if ARIA attributes are okay */
1878 let ALLOW_ARIA_ATTR = true;
1879 /* Decide if custom data attributes are okay */
1880 let ALLOW_DATA_ATTR = true;
1881 /* Decide if unknown protocols are okay */
1882 let ALLOW_UNKNOWN_PROTOCOLS = false;
1883 /* Decide if self-closing tags in attributes are allowed.
1884 * Usually removed due to a mXSS issue in jQuery 3.0 */
1885 let ALLOW_SELF_CLOSE_IN_ATTR = true;
1886 /* Output should be safe for common template engines.
1887 * This means, DOMPurify removes data attributes, mustaches and ERB
1888 */
1889 let SAFE_FOR_TEMPLATES = false;
1890 /* Output should be safe even for XML used within HTML and alike.
1891 * This means, DOMPurify removes comments when containing risky content.
1892 */
1893 let SAFE_FOR_XML = true;
1894 /* Decide if document with <html>... should be returned */
1895 let WHOLE_DOCUMENT = false;
1896 /* Track whether config is already set on this instance of DOMPurify. */
1897 let SET_CONFIG = false;
1898 /* Decide if all elements (e.g. style, script) must be children of
1899 * document.body. By default, browsers might move them to document.head */
1900 let FORCE_BODY = false;
1901 /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html
1902 * string (or a TrustedHTML object if Trusted Types are supported).
1903 * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead
1904 */
1905 let RETURN_DOM = false;
1906 /* Decide if a DOM `DocumentFragment` should be returned, instead of a html
1907 * string (or a TrustedHTML object if Trusted Types are supported) */
1908 let RETURN_DOM_FRAGMENT = false;
1909 /* Try to return a Trusted Type object instead of a string, return a string in
1910 * case Trusted Types are not supported */
1911 let RETURN_TRUSTED_TYPE = false;
1912 /* Output should be free from DOM clobbering attacks?
1913 * This sanitizes markups named with colliding, clobberable built-in DOM APIs.
1914 */
1915 let SANITIZE_DOM = true;
1916 /* Achieve full DOM Clobbering protection by isolating the namespace of named
1917 * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.
1918 *
1919 * HTML/DOM spec rules that enable DOM Clobbering:
1920 * - Named Access on Window (§7.3.3)
1921 * - DOM Tree Accessors (§3.1.5)
1922 * - Form Element Parent-Child Relations (§4.10.3)
1923 * - Iframe srcdoc / Nested WindowProxies (§4.8.5)
1924 * - HTMLCollection (§4.2.10.2)
1925 *
1926 * Namespace isolation is implemented by prefixing `id` and `name` attributes
1927 * with a constant string, i.e., `user-content-`
1928 */
1929 let SANITIZE_NAMED_PROPS = false;
1930 const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';
1931 /* Keep element content when removing element? */
1932 let KEEP_CONTENT = true;
1933 /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead
1934 * of importing it into a new Document and returning a sanitized copy */
1935 let IN_PLACE = false;
1936 /* Allow usage of profiles like html, svg and mathMl */
1937 let USE_PROFILES = {};
1938 /* Tags to ignore content of when KEEP_CONTENT is true */
1939 let FORBID_CONTENTS = null;
1940 const DEFAULT_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']);
1941 /* Tags that are safe for data: URIs */
1942 let DATA_URI_TAGS = null;
1943 const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
1944 /* Attributes safe for values like "javascript:" */
1945 let URI_SAFE_ATTRIBUTES = null;
1946 const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);
1947 const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
1948 const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
1949 const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
1950 /* Document namespace */
1951 let NAMESPACE = HTML_NAMESPACE;
1952 let IS_EMPTY_INPUT = false;
1953 /* Allowed XHTML+XML namespaces */
1954 let ALLOWED_NAMESPACES = null;
1955 const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
1956 let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
1957 let HTML_INTEGRATION_POINTS = addToSet({}, ['annotation-xml']);
1958 // Certain elements are allowed in both SVG and HTML
1959 // namespace. We need to specify them explicitly
1960 // so that they don't get erroneously deleted from
1961 // HTML namespace.
1962 const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);
1963 /* Parsing of strict XHTML documents */
1964 let PARSER_MEDIA_TYPE = null;
1965 const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];
1966 const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';
1967 let transformCaseFunc = null;
1968 /* Keep a reference to config to pass to hooks */
1969 let CONFIG = null;
1970 /* Ideally, do not touch anything below this line */
1971 /* ______________________________________________ */
1972 const formElement = document.createElement('form');
1973 const isRegexOrFunction = function isRegexOrFunction(testValue) {
1974 return testValue instanceof RegExp || testValue instanceof Function;
1975 };
1976 /**
1977 * _parseConfig
1978 *
1979 * @param cfg optional config literal
1980 */
1981 // eslint-disable-next-line complexity
1982 const _parseConfig = function _parseConfig() {
1983 let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1984 if (CONFIG && CONFIG === cfg) {
1985 return;
1986 }
1987 /* Shield configuration object from tampering */
1988 if (!cfg || typeof cfg !== 'object') {
1989 cfg = {};
1990 }
1991 /* Shield configuration object from prototype pollution */
1992 cfg = clone(cfg);
1993 PARSER_MEDIA_TYPE =
1994 // eslint-disable-next-line unicorn/prefer-includes
1995 SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
1996 // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.
1997 transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;
1998 /* Set configuration parameters */
1999 ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
2000 ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
2001 ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
2002 URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;
2003 DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;
2004 FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
2005 FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : clone({});
2006 FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({});
2007 USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;
2008 ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
2009 ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
2010 ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false
2011 ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true
2012 SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false
2013 SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true
2014 WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false
2015 RETURN_DOM = cfg.RETURN_DOM || false; // Default false
2016 RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false
2017 RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false
2018 FORCE_BODY = cfg.FORCE_BODY || false; // Default false
2019 SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true
2020 SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false
2021 KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true
2022 IN_PLACE = cfg.IN_PLACE || false; // Default false
2023 IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
2024 NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
2025 MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;
2026 HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;
2027 CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
2028 if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
2029 CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
2030 }
2031 if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {
2032 CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;
2033 }
2034 if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {
2035 CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;
2036 }
2037 if (SAFE_FOR_TEMPLATES) {
2038 ALLOW_DATA_ATTR = false;
2039 }
2040 if (RETURN_DOM_FRAGMENT) {
2041 RETURN_DOM = true;
2042 }
2043 /* Parse profile info */
2044 if (USE_PROFILES) {
2045 ALLOWED_TAGS = addToSet({}, text);
2046 ALLOWED_ATTR = [];
2047 if (USE_PROFILES.html === true) {
2048 addToSet(ALLOWED_TAGS, html$1);
2049 addToSet(ALLOWED_ATTR, html);
2050 }
2051 if (USE_PROFILES.svg === true) {
2052 addToSet(ALLOWED_TAGS, svg$1);
2053 addToSet(ALLOWED_ATTR, svg);
2054 addToSet(ALLOWED_ATTR, xml);
2055 }
2056 if (USE_PROFILES.svgFilters === true) {
2057 addToSet(ALLOWED_TAGS, svgFilters);
2058 addToSet(ALLOWED_ATTR, svg);
2059 addToSet(ALLOWED_ATTR, xml);
2060 }
2061 if (USE_PROFILES.mathMl === true) {
2062 addToSet(ALLOWED_TAGS, mathMl$1);
2063 addToSet(ALLOWED_ATTR, mathMl);
2064 addToSet(ALLOWED_ATTR, xml);
2065 }
2066 }
2067 /* Merge configuration parameters */
2068 if (cfg.ADD_TAGS) {
2069 if (typeof cfg.ADD_TAGS === 'function') {
2070 EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;
2071 } else {
2072 if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
2073 ALLOWED_TAGS = clone(ALLOWED_TAGS);
2074 }
2075 addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
2076 }
2077 }
2078 if (cfg.ADD_ATTR) {
2079 if (typeof cfg.ADD_ATTR === 'function') {
2080 EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;
2081 } else {
2082 if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
2083 ALLOWED_ATTR = clone(ALLOWED_ATTR);
2084 }
2085 addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
2086 }
2087 }
2088 if (cfg.ADD_URI_SAFE_ATTR) {
2089 addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
2090 }
2091 if (cfg.FORBID_CONTENTS) {
2092 if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
2093 FORBID_CONTENTS = clone(FORBID_CONTENTS);
2094 }
2095 addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
2096 }
2097 /* Add #text in case KEEP_CONTENT is set to true */
2098 if (KEEP_CONTENT) {
2099 ALLOWED_TAGS['#text'] = true;
2100 }
2101 /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */
2102 if (WHOLE_DOCUMENT) {
2103 addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);
2104 }
2105 /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */
2106 if (ALLOWED_TAGS.table) {
2107 addToSet(ALLOWED_TAGS, ['tbody']);
2108 delete FORBID_TAGS.tbody;
2109 }
2110 if (cfg.TRUSTED_TYPES_POLICY) {
2111 if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {
2112 throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
2113 }
2114 if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {
2115 throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
2116 }
2117 // Overwrite existing TrustedTypes policy.
2118 trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
2119 // Sign local variables required by `sanitize`.
2120 emptyHTML = trustedTypesPolicy.createHTML('');
2121 } else {
2122 // Uninitialized policy, attempt to initialize the internal dompurify policy.
2123 if (trustedTypesPolicy === undefined) {
2124 trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
2125 }
2126 // If creating the internal policy succeeded sign internal variables.
2127 if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {
2128 emptyHTML = trustedTypesPolicy.createHTML('');
2129 }
2130 }
2131 // Prevent further manipulation of configuration.
2132 // Not available in IE8, Safari 5, etc.
2133 if (freeze) {
2134 freeze(cfg);
2135 }
2136 CONFIG = cfg;
2137 };
2138 /* Keep track of all possible SVG and MathML tags
2139 * so that we can perform the namespace checks
2140 * correctly. */
2141 const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
2142 const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
2143 /**
2144 * @param element a DOM element whose namespace is being checked
2145 * @returns Return false if the element has a
2146 * namespace that a spec-compliant parser would never
2147 * return. Return true otherwise.
2148 */
2149 const _checkValidNamespace = function _checkValidNamespace(element) {
2150 let parent = getParentNode(element);
2151 // In JSDOM, if we're inside shadow DOM, then parentNode
2152 // can be null. We just simulate parent in this case.
2153 if (!parent || !parent.tagName) {
2154 parent = {
2155 namespaceURI: NAMESPACE,
2156 tagName: 'template'
2157 };
2158 }
2159 const tagName = stringToLowerCase(element.tagName);
2160 const parentTagName = stringToLowerCase(parent.tagName);
2161 if (!ALLOWED_NAMESPACES[element.namespaceURI]) {
2162 return false;
2163 }
2164 if (element.namespaceURI === SVG_NAMESPACE) {
2165 // The only way to switch from HTML namespace to SVG
2166 // is via <svg>. If it happens via any other tag, then
2167 // it should be killed.
2168 if (parent.namespaceURI === HTML_NAMESPACE) {
2169 return tagName === 'svg';
2170 }
2171 // The only way to switch from MathML to SVG is via`
2172 // svg if parent is either <annotation-xml> or MathML
2173 // text integration points.
2174 if (parent.namespaceURI === MATHML_NAMESPACE) {
2175 return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
2176 }
2177 // We only allow elements that are defined in SVG
2178 // spec. All others are disallowed in SVG namespace.
2179 return Boolean(ALL_SVG_TAGS[tagName]);
2180 }
2181 if (element.namespaceURI === MATHML_NAMESPACE) {
2182 // The only way to switch from HTML namespace to MathML
2183 // is via <math>. If it happens via any other tag, then
2184 // it should be killed.
2185 if (parent.namespaceURI === HTML_NAMESPACE) {
2186 return tagName === 'math';
2187 }
2188 // The only way to switch from SVG to MathML is via
2189 // <math> and HTML integration points
2190 if (parent.namespaceURI === SVG_NAMESPACE) {
2191 return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
2192 }
2193 // We only allow elements that are defined in MathML
2194 // spec. All others are disallowed in MathML namespace.
2195 return Boolean(ALL_MATHML_TAGS[tagName]);
2196 }
2197 if (element.namespaceURI === HTML_NAMESPACE) {
2198 // The only way to switch from SVG to HTML is via
2199 // HTML integration points, and from MathML to HTML
2200 // is via MathML text integration points
2201 if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
2202 return false;
2203 }
2204 if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
2205 return false;
2206 }
2207 // We disallow tags that are specific for MathML
2208 // or SVG and should never appear in HTML namespace
2209 return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
2210 }
2211 // For XHTML and XML documents that support custom namespaces
2212 if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {
2213 return true;
2214 }
2215 // The code should never reach this place (this means
2216 // that the element somehow got namespace that is not
2217 // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).
2218 // Return false just in case.
2219 return false;
2220 };
2221 /**
2222 * _forceRemove
2223 *
2224 * @param node a DOM node
2225 */
2226 const _forceRemove = function _forceRemove(node) {
2227 arrayPush(DOMPurify.removed, {
2228 element: node
2229 });
2230 try {
2231 // eslint-disable-next-line unicorn/prefer-dom-node-remove
2232 getParentNode(node).removeChild(node);
2233 } catch (_) {
2234 remove(node);
2235 }
2236 };
2237 /**
2238 * _removeAttribute
2239 *
2240 * @param name an Attribute name
2241 * @param element a DOM node
2242 */
2243 const _removeAttribute = function _removeAttribute(name, element) {
2244 try {
2245 arrayPush(DOMPurify.removed, {
2246 attribute: element.getAttributeNode(name),
2247 from: element
2248 });
2249 } catch (_) {
2250 arrayPush(DOMPurify.removed, {
2251 attribute: null,
2252 from: element
2253 });
2254 }
2255 element.removeAttribute(name);
2256 // We void attribute values for unremovable "is" attributes
2257 if (name === 'is') {
2258 if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
2259 try {
2260 _forceRemove(element);
2261 } catch (_) {}
2262 } else {
2263 try {
2264 element.setAttribute(name, '');
2265 } catch (_) {}
2266 }
2267 }
2268 };
2269 /**
2270 * _initDocument
2271 *
2272 * @param dirty - a string of dirty markup
2273 * @return a DOM, filled with the dirty markup
2274 */
2275 const _initDocument = function _initDocument(dirty) {
2276 /* Create a HTML document */
2277 let doc = null;
2278 let leadingWhitespace = null;
2279 if (FORCE_BODY) {
2280 dirty = '<remove></remove>' + dirty;
2281 } else {
2282 /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */
2283 const matches = stringMatch(dirty, /^[\r\n\t ]+/);
2284 leadingWhitespace = matches && matches[0];
2285 }
2286 if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {
2287 // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)
2288 dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + '</body></html>';
2289 }
2290 const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
2291 /*
2292 * Use the DOMParser API by default, fallback later if needs be
2293 * DOMParser not work for svg when has multiple root element.
2294 */
2295 if (NAMESPACE === HTML_NAMESPACE) {
2296 try {
2297 doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
2298 } catch (_) {}
2299 }
2300 /* Use createHTMLDocument in case DOMParser is not available */
2301 if (!doc || !doc.documentElement) {
2302 doc = implementation.createDocument(NAMESPACE, 'template', null);
2303 try {
2304 doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
2305 } catch (_) {
2306 // Syntax error if dirtyPayload is invalid xml
2307 }
2308 }
2309 const body = doc.body || doc.documentElement;
2310 if (dirty && leadingWhitespace) {
2311 body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
2312 }
2313 /* Work on whole document or just its body */
2314 if (NAMESPACE === HTML_NAMESPACE) {
2315 return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];
2316 }
2317 return WHOLE_DOCUMENT ? doc.documentElement : body;
2318 };
2319 /**
2320 * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
2321 *
2322 * @param root The root element or node to start traversing on.
2323 * @return The created NodeIterator
2324 */
2325 const _createNodeIterator = function _createNodeIterator(root) {
2326 return createNodeIterator.call(root.ownerDocument || root, root,
2327 // eslint-disable-next-line no-bitwise
2328 NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
2329 };
2330 /**
2331 * _isClobbered
2332 *
2333 * @param element element to check for clobbering attacks
2334 * @return true if clobbered, false if safe
2335 */
2336 const _isClobbered = function _isClobbered(element) {
2337 return element instanceof HTMLFormElement && (typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function');
2338 };
2339 /**
2340 * Checks whether the given object is a DOM node.
2341 *
2342 * @param value object to check whether it's a DOM node
2343 * @return true is object is a DOM node
2344 */
2345 const _isNode = function _isNode(value) {
2346 return typeof Node === 'function' && value instanceof Node;
2347 };
2348 function _executeHooks(hooks, currentNode, data) {
2349 arrayForEach(hooks, hook => {
2350 hook.call(DOMPurify, currentNode, data, CONFIG);
2351 });
2352 }
2353 /**
2354 * _sanitizeElements
2355 *
2356 * @protect nodeName
2357 * @protect textContent
2358 * @protect removeChild
2359 * @param currentNode to check for permission to exist
2360 * @return true if node was killed, false if left alive
2361 */
2362 const _sanitizeElements = function _sanitizeElements(currentNode) {
2363 let content = null;
2364 /* Execute a hook if present */
2365 _executeHooks(hooks.beforeSanitizeElements, currentNode, null);
2366 /* Check if element is clobbered or can clobber */
2367 if (_isClobbered(currentNode)) {
2368 _forceRemove(currentNode);
2369 return true;
2370 }
2371 /* Now let's check the element's type and name */
2372 const tagName = transformCaseFunc(currentNode.nodeName);
2373 /* Execute a hook if present */
2374 _executeHooks(hooks.uponSanitizeElement, currentNode, {
2375 tagName,
2376 allowedTags: ALLOWED_TAGS
2377 });
2378 /* Detect mXSS attempts abusing namespace confusion */
2379 if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) {
2380 _forceRemove(currentNode);
2381 return true;
2382 }
2383 /* Remove any occurrence of processing instructions */
2384 if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
2385 _forceRemove(currentNode);
2386 return true;
2387 }
2388 /* Remove any kind of possibly harmful comments */
2389 if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
2390 _forceRemove(currentNode);
2391 return true;
2392 }
2393 /* Remove element if anything forbids its presence */
2394 if (!(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName])) {
2395 /* Check if we have a custom element to handle */
2396 if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
2397 if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
2398 return false;
2399 }
2400 if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {
2401 return false;
2402 }
2403 }
2404 /* Keep content except for bad-listed elements */
2405 if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
2406 const parentNode = getParentNode(currentNode) || currentNode.parentNode;
2407 const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
2408 if (childNodes && parentNode) {
2409 const childCount = childNodes.length;
2410 for (let i = childCount - 1; i >= 0; --i) {
2411 const childClone = cloneNode(childNodes[i], true);
2412 childClone.__removalCount = (currentNode.__removalCount || 0) + 1;
2413 parentNode.insertBefore(childClone, getNextSibling(currentNode));
2414 }
2415 }
2416 }
2417 _forceRemove(currentNode);
2418 return true;
2419 }
2420 /* Check whether element has a valid namespace */
2421 if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
2422 _forceRemove(currentNode);
2423 return true;
2424 }
2425 /* Make sure that older browsers don't get fallback-tag mXSS */
2426 if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) {
2427 _forceRemove(currentNode);
2428 return true;
2429 }
2430 /* Sanitize element content to be template-safe */
2431 if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
2432 /* Get the element's text content */
2433 content = currentNode.textContent;
2434 arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
2435 content = stringReplace(content, expr, ' ');
2436 });
2437 if (currentNode.textContent !== content) {
2438 arrayPush(DOMPurify.removed, {
2439 element: currentNode.cloneNode()
2440 });
2441 currentNode.textContent = content;
2442 }
2443 }
2444 /* Execute a hook if present */
2445 _executeHooks(hooks.afterSanitizeElements, currentNode, null);
2446 return false;
2447 };
2448 /**
2449 * _isValidAttribute
2450 *
2451 * @param lcTag Lowercase tag name of containing element.
2452 * @param lcName Lowercase attribute name.
2453 * @param value Attribute value.
2454 * @return Returns true if `value` is valid, otherwise false.
2455 */
2456 // eslint-disable-next-line complexity
2457 const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
2458 /* Make sure attribute cannot clobber */
2459 if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
2460 return false;
2461 }
2462 /* Allow valid data-* attributes: At least one character after "-"
2463 (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
2464 XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
2465 We don't need to check the value; it's always URI safe. */
2466 if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
2467 if (
2468 // First condition does a very basic check if a) it's basically a valid custom element tagname AND
2469 // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
2470 // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
2471 _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName, lcTag)) ||
2472 // Alternative, second condition checks if it's an `is`-attribute, AND
2473 // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
2474 lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {
2475 return false;
2476 }
2477 /* Check value is safe. First, is attr inert? If so, is safe */
2478 } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; 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, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {
2479 return false;
2480 } else ;
2481 return true;
2482 };
2483 /**
2484 * _isBasicCustomElement
2485 * checks if at least one dash is included in tagName, and it's not the first char
2486 * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name
2487 *
2488 * @param tagName name of the tag of the node to sanitize
2489 * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
2490 */
2491 const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
2492 return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);
2493 };
2494 /**
2495 * _sanitizeAttributes
2496 *
2497 * @protect attributes
2498 * @protect nodeName
2499 * @protect removeAttribute
2500 * @protect setAttribute
2501 *
2502 * @param currentNode to sanitize
2503 */
2504 const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
2505 /* Execute a hook if present */
2506 _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
2507 const {
2508 attributes
2509 } = currentNode;
2510 /* Check if we have attributes; if not we might have a text node */
2511 if (!attributes || _isClobbered(currentNode)) {
2512 return;
2513 }
2514 const hookEvent = {
2515 attrName: '',
2516 attrValue: '',
2517 keepAttr: true,
2518 allowedAttributes: ALLOWED_ATTR,
2519 forceKeepAttr: undefined
2520 };
2521 let l = attributes.length;
2522 /* Go backwards over all attributes; safely remove bad ones */
2523 while (l--) {
2524 const attr = attributes[l];
2525 const {
2526 name,
2527 namespaceURI,
2528 value: attrValue
2529 } = attr;
2530 const lcName = transformCaseFunc(name);
2531 const initValue = attrValue;
2532 let value = name === 'value' ? initValue : stringTrim(initValue);
2533 /* Execute a hook if present */
2534 hookEvent.attrName = lcName;
2535 hookEvent.attrValue = value;
2536 hookEvent.keepAttr = true;
2537 hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set
2538 _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
2539 value = hookEvent.attrValue;
2540 /* Full DOM Clobbering protection via namespace isolation,
2541 * Prefix id and name attributes with `user-content-`
2542 */
2543 if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {
2544 // Remove the attribute with this value
2545 _removeAttribute(name, currentNode);
2546 // Prefix the value and later re-create the attribute with the sanitized value
2547 value = SANITIZE_NAMED_PROPS_PREFIX + value;
2548 }
2549 /* Work around a security issue with comments inside attributes */
2550 if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title|textarea)/i, value)) {
2551 _removeAttribute(name, currentNode);
2552 continue;
2553 }
2554 /* Make sure we cannot easily use animated hrefs, even if animations are allowed */
2555 if (lcName === 'attributename' && stringMatch(value, 'href')) {
2556 _removeAttribute(name, currentNode);
2557 continue;
2558 }
2559 /* Did the hooks approve of the attribute? */
2560 if (hookEvent.forceKeepAttr) {
2561 continue;
2562 }
2563 /* Did the hooks approve of the attribute? */
2564 if (!hookEvent.keepAttr) {
2565 _removeAttribute(name, currentNode);
2566 continue;
2567 }
2568 /* Work around a security issue in jQuery 3.0 */
2569 if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
2570 _removeAttribute(name, currentNode);
2571 continue;
2572 }
2573 /* Sanitize attribute content to be template-safe */
2574 if (SAFE_FOR_TEMPLATES) {
2575 arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
2576 value = stringReplace(value, expr, ' ');
2577 });
2578 }
2579 /* Is `value` valid for this attribute? */
2580 const lcTag = transformCaseFunc(currentNode.nodeName);
2581 if (!_isValidAttribute(lcTag, lcName, value)) {
2582 _removeAttribute(name, currentNode);
2583 continue;
2584 }
2585 /* Handle attributes that require Trusted Types */
2586 if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {
2587 if (namespaceURI) ; else {
2588 switch (trustedTypes.getAttributeType(lcTag, lcName)) {
2589 case 'TrustedHTML':
2590 {
2591 value = trustedTypesPolicy.createHTML(value);
2592 break;
2593 }
2594 case 'TrustedScriptURL':
2595 {
2596 value = trustedTypesPolicy.createScriptURL(value);
2597 break;
2598 }
2599 }
2600 }
2601 }
2602 /* Handle invalid data-* attribute set by try-catching it */
2603 if (value !== initValue) {
2604 try {
2605 if (namespaceURI) {
2606 currentNode.setAttributeNS(namespaceURI, name, value);
2607 } else {
2608 /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
2609 currentNode.setAttribute(name, value);
2610 }
2611 if (_isClobbered(currentNode)) {
2612 _forceRemove(currentNode);
2613 } else {
2614 arrayPop(DOMPurify.removed);
2615 }
2616 } catch (_) {
2617 _removeAttribute(name, currentNode);
2618 }
2619 }
2620 }
2621 /* Execute a hook if present */
2622 _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
2623 };
2624 /**
2625 * _sanitizeShadowDOM
2626 *
2627 * @param fragment to iterate over recursively
2628 */
2629 const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {
2630 let shadowNode = null;
2631 const shadowIterator = _createNodeIterator(fragment);
2632 /* Execute a hook if present */
2633 _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
2634 while (shadowNode = shadowIterator.nextNode()) {
2635 /* Execute a hook if present */
2636 _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
2637 /* Sanitize tags and elements */
2638 _sanitizeElements(shadowNode);
2639 /* Check attributes next */
2640 _sanitizeAttributes(shadowNode);
2641 /* Deep shadow DOM detected */
2642 if (shadowNode.content instanceof DocumentFragment) {
2643 _sanitizeShadowDOM(shadowNode.content);
2644 }
2645 }
2646 /* Execute a hook if present */
2647 _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
2648 };
2649 // eslint-disable-next-line complexity
2650 DOMPurify.sanitize = function (dirty) {
2651 let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2652 let body = null;
2653 let importedNode = null;
2654 let currentNode = null;
2655 let returnNode = null;
2656 /* Make sure we have a string to sanitize.
2657 DO NOT return early, as this will return the wrong type if
2658 the user has requested a DOM object rather than a string */
2659 IS_EMPTY_INPUT = !dirty;
2660 if (IS_EMPTY_INPUT) {
2661 dirty = '<!-->';
2662 }
2663 /* Stringify, in case dirty is an object */
2664 if (typeof dirty !== 'string' && !_isNode(dirty)) {
2665 if (typeof dirty.toString === 'function') {
2666 dirty = dirty.toString();
2667 if (typeof dirty !== 'string') {
2668 throw typeErrorCreate('dirty is not a string, aborting');
2669 }
2670 } else {
2671 throw typeErrorCreate('toString is not a function');
2672 }
2673 }
2674 /* Return dirty HTML if DOMPurify cannot run */
2675 if (!DOMPurify.isSupported) {
2676 return dirty;
2677 }
2678 /* Assign config vars */
2679 if (!SET_CONFIG) {
2680 _parseConfig(cfg);
2681 }
2682 /* Clean up removed elements */
2683 DOMPurify.removed = [];
2684 /* Check if dirty is correctly typed for IN_PLACE */
2685 if (typeof dirty === 'string') {
2686 IN_PLACE = false;
2687 }
2688 if (IN_PLACE) {
2689 /* Do some early pre-sanitization to avoid unsafe root nodes */
2690 if (dirty.nodeName) {
2691 const tagName = transformCaseFunc(dirty.nodeName);
2692 if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
2693 throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');
2694 }
2695 }
2696 } else if (dirty instanceof Node) {
2697 /* If dirty is a DOM element, append to an empty document to avoid
2698 elements being stripped by the parser */
2699 body = _initDocument('<!---->');
2700 importedNode = body.ownerDocument.importNode(dirty, true);
2701 if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') {
2702 /* Node is already a body, use as is */
2703 body = importedNode;
2704 } else if (importedNode.nodeName === 'HTML') {
2705 body = importedNode;
2706 } else {
2707 // eslint-disable-next-line unicorn/prefer-dom-node-append
2708 body.appendChild(importedNode);
2709 }
2710 } else {
2711 /* Exit directly if we have nothing to do */
2712 if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&
2713 // eslint-disable-next-line unicorn/prefer-includes
2714 dirty.indexOf('<') === -1) {
2715 return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
2716 }
2717 /* Initialize the document to work on */
2718 body = _initDocument(dirty);
2719 /* Check we have a DOM node from the data */
2720 if (!body) {
2721 return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';
2722 }
2723 }
2724 /* Remove first element node (ours) if FORCE_BODY is set */
2725 if (body && FORCE_BODY) {
2726 _forceRemove(body.firstChild);
2727 }
2728 /* Get node iterator */
2729 const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);
2730 /* Now start iterating over the created document */
2731 while (currentNode = nodeIterator.nextNode()) {
2732 /* Sanitize tags and elements */
2733 _sanitizeElements(currentNode);
2734 /* Check attributes next */
2735 _sanitizeAttributes(currentNode);
2736 /* Shadow DOM detected, sanitize it */
2737 if (currentNode.content instanceof DocumentFragment) {
2738 _sanitizeShadowDOM(currentNode.content);
2739 }
2740 }
2741 /* If we sanitized `dirty` in-place, return it. */
2742 if (IN_PLACE) {
2743 return dirty;
2744 }
2745 /* Return sanitized string or DOM */
2746 if (RETURN_DOM) {
2747 if (RETURN_DOM_FRAGMENT) {
2748 returnNode = createDocumentFragment.call(body.ownerDocument);
2749 while (body.firstChild) {
2750 // eslint-disable-next-line unicorn/prefer-dom-node-append
2751 returnNode.appendChild(body.firstChild);
2752 }
2753 } else {
2754 returnNode = body;
2755 }
2756 if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {
2757 /*
2758 AdoptNode() is not used because internal state is not reset
2759 (e.g. the past names map of a HTMLFormElement), this is safe
2760 in theory but we would rather not risk another attack vector.
2761 The state that is cloned by importNode() is explicitly defined
2762 by the specs.
2763 */
2764 returnNode = importNode.call(originalDocument, returnNode, true);
2765 }
2766 return returnNode;
2767 }
2768 let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
2769 /* Serialize doctype if allowed */
2770 if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
2771 serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\n' + serializedHTML;
2772 }
2773 /* Sanitize final string template-safe */
2774 if (SAFE_FOR_TEMPLATES) {
2775 arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
2776 serializedHTML = stringReplace(serializedHTML, expr, ' ');
2777 });
2778 }
2779 return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
2780 };
2781 DOMPurify.setConfig = function () {
2782 let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2783 _parseConfig(cfg);
2784 SET_CONFIG = true;
2785 };
2786 DOMPurify.clearConfig = function () {
2787 CONFIG = null;
2788 SET_CONFIG = false;
2789 };
2790 DOMPurify.isValidAttribute = function (tag, attr, value) {
2791 /* Initialize shared config vars if necessary. */
2792 if (!CONFIG) {
2793 _parseConfig({});
2794 }
2795 const lcTag = transformCaseFunc(tag);
2796 const lcName = transformCaseFunc(attr);
2797 return _isValidAttribute(lcTag, lcName, value);
2798 };
2799 DOMPurify.addHook = function (entryPoint, hookFunction) {
2800 if (typeof hookFunction !== 'function') {
2801 return;
2802 }
2803 arrayPush(hooks[entryPoint], hookFunction);
2804 };
2805 DOMPurify.removeHook = function (entryPoint, hookFunction) {
2806 if (hookFunction !== undefined) {
2807 const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
2808 return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];
2809 }
2810 return arrayPop(hooks[entryPoint]);
2811 };
2812 DOMPurify.removeHooks = function (entryPoint) {
2813 hooks[entryPoint] = [];
2814 };
2815 DOMPurify.removeAllHooks = function () {
2816 hooks = _createHooksMap();
2817 };
2818 return DOMPurify;
2819 }
2820 var purify = createDOMPurify();
2821
2822 module.exports = purify;
2823 //# sourceMappingURL=purify.cjs.js.map
2824
2825
2826 /***/ }),
2827
2828 /***/ "../node_modules/object-assign/index.js":
2829 /*!**********************************************!*\
2830 !*** ../node_modules/object-assign/index.js ***!
2831 \**********************************************/
2832 /***/ ((module) => {
2833
2834 "use strict";
2835 /*
2836 object-assign
2837 (c) Sindre Sorhus
2838 @license MIT
2839 */
2840
2841
2842 /* eslint-disable no-unused-vars */
2843 var getOwnPropertySymbols = Object.getOwnPropertySymbols;
2844 var hasOwnProperty = Object.prototype.hasOwnProperty;
2845 var propIsEnumerable = Object.prototype.propertyIsEnumerable;
2846
2847 function toObject(val) {
2848 if (val === null || val === undefined) {
2849 throw new TypeError('Object.assign cannot be called with null or undefined');
2850 }
2851
2852 return Object(val);
2853 }
2854
2855 function shouldUseNative() {
2856 try {
2857 if (!Object.assign) {
2858 return false;
2859 }
2860
2861 // Detect buggy property enumeration order in older V8 versions.
2862
2863 // https://bugs.chromium.org/p/v8/issues/detail?id=4118
2864 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
2865 test1[5] = 'de';
2866 if (Object.getOwnPropertyNames(test1)[0] === '5') {
2867 return false;
2868 }
2869
2870 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
2871 var test2 = {};
2872 for (var i = 0; i < 10; i++) {
2873 test2['_' + String.fromCharCode(i)] = i;
2874 }
2875 var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
2876 return test2[n];
2877 });
2878 if (order2.join('') !== '0123456789') {
2879 return false;
2880 }
2881
2882 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
2883 var test3 = {};
2884 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
2885 test3[letter] = letter;
2886 });
2887 if (Object.keys(Object.assign({}, test3)).join('') !==
2888 'abcdefghijklmnopqrst') {
2889 return false;
2890 }
2891
2892 return true;
2893 } catch (err) {
2894 // We don't expect any of the above to throw, but better to be safe.
2895 return false;
2896 }
2897 }
2898
2899 module.exports = shouldUseNative() ? Object.assign : function (target, source) {
2900 var from;
2901 var to = toObject(target);
2902 var symbols;
2903
2904 for (var s = 1; s < arguments.length; s++) {
2905 from = Object(arguments[s]);
2906
2907 for (var key in from) {
2908 if (hasOwnProperty.call(from, key)) {
2909 to[key] = from[key];
2910 }
2911 }
2912
2913 if (getOwnPropertySymbols) {
2914 symbols = getOwnPropertySymbols(from);
2915 for (var i = 0; i < symbols.length; i++) {
2916 if (propIsEnumerable.call(from, symbols[i])) {
2917 to[symbols[i]] = from[symbols[i]];
2918 }
2919 }
2920 }
2921 }
2922
2923 return to;
2924 };
2925
2926
2927 /***/ }),
2928
2929 /***/ "../node_modules/prop-types/checkPropTypes.js":
2930 /*!****************************************************!*\
2931 !*** ../node_modules/prop-types/checkPropTypes.js ***!
2932 \****************************************************/
2933 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2934
2935 "use strict";
2936 /**
2937 * Copyright (c) 2013-present, Facebook, Inc.
2938 *
2939 * This source code is licensed under the MIT license found in the
2940 * LICENSE file in the root directory of this source tree.
2941 */
2942
2943
2944
2945 var printWarning = function() {};
2946
2947 if (true) {
2948 var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "../node_modules/prop-types/lib/ReactPropTypesSecret.js");
2949 var loggedTypeFailures = {};
2950 var has = __webpack_require__(/*! ./lib/has */ "../node_modules/prop-types/lib/has.js");
2951
2952 printWarning = function(text) {
2953 var message = 'Warning: ' + text;
2954 if (typeof console !== 'undefined') {
2955 console.error(message);
2956 }
2957 try {
2958 // --- Welcome to debugging React ---
2959 // This error was thrown as a convenience so that you can use this stack
2960 // to find the callsite that caused this warning to fire.
2961 throw new Error(message);
2962 } catch (x) { /**/ }
2963 };
2964 }
2965
2966 /**
2967 * Assert that the values match with the type specs.
2968 * Error messages are memorized and will only be shown once.
2969 *
2970 * @param {object} typeSpecs Map of name to a ReactPropType
2971 * @param {object} values Runtime values that need to be type-checked
2972 * @param {string} location e.g. "prop", "context", "child context"
2973 * @param {string} componentName Name of the component for error messages.
2974 * @param {?Function} getStack Returns the component stack.
2975 * @private
2976 */
2977 function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
2978 if (true) {
2979 for (var typeSpecName in typeSpecs) {
2980 if (has(typeSpecs, typeSpecName)) {
2981 var error;
2982 // Prop type validation may throw. In case they do, we don't want to
2983 // fail the render phase where it didn't fail before. So we log it.
2984 // After these have been cleaned up, we'll let them throw.
2985 try {
2986 // This is intentionally an invariant that gets caught. It's the same
2987 // behavior as without this statement except with a better message.
2988 if (typeof typeSpecs[typeSpecName] !== 'function') {
2989 var err = Error(
2990 (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
2991 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
2992 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
2993 );
2994 err.name = 'Invariant Violation';
2995 throw err;
2996 }
2997 error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
2998 } catch (ex) {
2999 error = ex;
3000 }
3001 if (error && !(error instanceof Error)) {
3002 printWarning(
3003 (componentName || 'React class') + ': type specification of ' +
3004 location + ' `' + typeSpecName + '` is invalid; the type checker ' +
3005 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
3006 'You may have forgotten to pass an argument to the type checker ' +
3007 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
3008 'shape all require an argument).'
3009 );
3010 }
3011 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
3012 // Only monitor this failure once because there tends to be a lot of the
3013 // same error.
3014 loggedTypeFailures[error.message] = true;
3015
3016 var stack = getStack ? getStack() : '';
3017
3018 printWarning(
3019 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
3020 );
3021 }
3022 }
3023 }
3024 }
3025 }
3026
3027 /**
3028 * Resets warning cache when testing.
3029 *
3030 * @private
3031 */
3032 checkPropTypes.resetWarningCache = function() {
3033 if (true) {
3034 loggedTypeFailures = {};
3035 }
3036 }
3037
3038 module.exports = checkPropTypes;
3039
3040
3041 /***/ }),
3042
3043 /***/ "../node_modules/prop-types/factoryWithTypeCheckers.js":
3044 /*!*************************************************************!*\
3045 !*** ../node_modules/prop-types/factoryWithTypeCheckers.js ***!
3046 \*************************************************************/
3047 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3048
3049 "use strict";
3050 /**
3051 * Copyright (c) 2013-present, Facebook, Inc.
3052 *
3053 * This source code is licensed under the MIT license found in the
3054 * LICENSE file in the root directory of this source tree.
3055 */
3056
3057
3058
3059 var ReactIs = __webpack_require__(/*! react-is */ "../node_modules/prop-types/node_modules/react-is/index.js");
3060 var assign = __webpack_require__(/*! object-assign */ "../node_modules/object-assign/index.js");
3061
3062 var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "../node_modules/prop-types/lib/ReactPropTypesSecret.js");
3063 var has = __webpack_require__(/*! ./lib/has */ "../node_modules/prop-types/lib/has.js");
3064 var checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ "../node_modules/prop-types/checkPropTypes.js");
3065
3066 var printWarning = function() {};
3067
3068 if (true) {
3069 printWarning = function(text) {
3070 var message = 'Warning: ' + text;
3071 if (typeof console !== 'undefined') {
3072 console.error(message);
3073 }
3074 try {
3075 // --- Welcome to debugging React ---
3076 // This error was thrown as a convenience so that you can use this stack
3077 // to find the callsite that caused this warning to fire.
3078 throw new Error(message);
3079 } catch (x) {}
3080 };
3081 }
3082
3083 function emptyFunctionThatReturnsNull() {
3084 return null;
3085 }
3086
3087 module.exports = function(isValidElement, throwOnDirectAccess) {
3088 /* global Symbol */
3089 var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
3090 var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
3091
3092 /**
3093 * Returns the iterator method function contained on the iterable object.
3094 *
3095 * Be sure to invoke the function with the iterable as context:
3096 *
3097 * var iteratorFn = getIteratorFn(myIterable);
3098 * if (iteratorFn) {
3099 * var iterator = iteratorFn.call(myIterable);
3100 * ...
3101 * }
3102 *
3103 * @param {?object} maybeIterable
3104 * @return {?function}
3105 */
3106 function getIteratorFn(maybeIterable) {
3107 var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
3108 if (typeof iteratorFn === 'function') {
3109 return iteratorFn;
3110 }
3111 }
3112
3113 /**
3114 * Collection of methods that allow declaration and validation of props that are
3115 * supplied to React components. Example usage:
3116 *
3117 * var Props = require('ReactPropTypes');
3118 * var MyArticle = React.createClass({
3119 * propTypes: {
3120 * // An optional string prop named "description".
3121 * description: Props.string,
3122 *
3123 * // A required enum prop named "category".
3124 * category: Props.oneOf(['News','Photos']).isRequired,
3125 *
3126 * // A prop named "dialog" that requires an instance of Dialog.
3127 * dialog: Props.instanceOf(Dialog).isRequired
3128 * },
3129 * render: function() { ... }
3130 * });
3131 *
3132 * A more formal specification of how these methods are used:
3133 *
3134 * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
3135 * decl := ReactPropTypes.{type}(.isRequired)?
3136 *
3137 * Each and every declaration produces a function with the same signature. This
3138 * allows the creation of custom validation functions. For example:
3139 *
3140 * var MyLink = React.createClass({
3141 * propTypes: {
3142 * // An optional string or URI prop named "href".
3143 * href: function(props, propName, componentName) {
3144 * var propValue = props[propName];
3145 * if (propValue != null && typeof propValue !== 'string' &&
3146 * !(propValue instanceof URI)) {
3147 * return new Error(
3148 * 'Expected a string or an URI for ' + propName + ' in ' +
3149 * componentName
3150 * );
3151 * }
3152 * }
3153 * },
3154 * render: function() {...}
3155 * });
3156 *
3157 * @internal
3158 */
3159
3160 var ANONYMOUS = '<<anonymous>>';
3161
3162 // Important!
3163 // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
3164 var ReactPropTypes = {
3165 array: createPrimitiveTypeChecker('array'),
3166 bigint: createPrimitiveTypeChecker('bigint'),
3167 bool: createPrimitiveTypeChecker('boolean'),
3168 func: createPrimitiveTypeChecker('function'),
3169 number: createPrimitiveTypeChecker('number'),
3170 object: createPrimitiveTypeChecker('object'),
3171 string: createPrimitiveTypeChecker('string'),
3172 symbol: createPrimitiveTypeChecker('symbol'),
3173
3174 any: createAnyTypeChecker(),
3175 arrayOf: createArrayOfTypeChecker,
3176 element: createElementTypeChecker(),
3177 elementType: createElementTypeTypeChecker(),
3178 instanceOf: createInstanceTypeChecker,
3179 node: createNodeChecker(),
3180 objectOf: createObjectOfTypeChecker,
3181 oneOf: createEnumTypeChecker,
3182 oneOfType: createUnionTypeChecker,
3183 shape: createShapeTypeChecker,
3184 exact: createStrictShapeTypeChecker,
3185 };
3186
3187 /**
3188 * inlined Object.is polyfill to avoid requiring consumers ship their own
3189 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
3190 */
3191 /*eslint-disable no-self-compare*/
3192 function is(x, y) {
3193 // SameValue algorithm
3194 if (x === y) {
3195 // Steps 1-5, 7-10
3196 // Steps 6.b-6.e: +0 != -0
3197 return x !== 0 || 1 / x === 1 / y;
3198 } else {
3199 // Step 6.a: NaN == NaN
3200 return x !== x && y !== y;
3201 }
3202 }
3203 /*eslint-enable no-self-compare*/
3204
3205 /**
3206 * We use an Error-like object for backward compatibility as people may call
3207 * PropTypes directly and inspect their output. However, we don't use real
3208 * Errors anymore. We don't inspect their stack anyway, and creating them
3209 * is prohibitively expensive if they are created too often, such as what
3210 * happens in oneOfType() for any type before the one that matched.
3211 */
3212 function PropTypeError(message, data) {
3213 this.message = message;
3214 this.data = data && typeof data === 'object' ? data: {};
3215 this.stack = '';
3216 }
3217 // Make `instanceof Error` still work for returned errors.
3218 PropTypeError.prototype = Error.prototype;
3219
3220 function createChainableTypeChecker(validate) {
3221 if (true) {
3222 var manualPropTypeCallCache = {};
3223 var manualPropTypeWarningCount = 0;
3224 }
3225 function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
3226 componentName = componentName || ANONYMOUS;
3227 propFullName = propFullName || propName;
3228
3229 if (secret !== ReactPropTypesSecret) {
3230 if (throwOnDirectAccess) {
3231 // New behavior only for users of `prop-types` package
3232 var err = new Error(
3233 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
3234 'Use `PropTypes.checkPropTypes()` to call them. ' +
3235 'Read more at http://fb.me/use-check-prop-types'
3236 );
3237 err.name = 'Invariant Violation';
3238 throw err;
3239 } else if ( true && typeof console !== 'undefined') {
3240 // Old behavior for people using React.PropTypes
3241 var cacheKey = componentName + ':' + propName;
3242 if (
3243 !manualPropTypeCallCache[cacheKey] &&
3244 // Avoid spamming the console because they are often not actionable except for lib authors
3245 manualPropTypeWarningCount < 3
3246 ) {
3247 printWarning(
3248 'You are manually calling a React.PropTypes validation ' +
3249 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
3250 'and will throw in the standalone `prop-types` package. ' +
3251 'You may be seeing this warning due to a third-party PropTypes ' +
3252 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
3253 );
3254 manualPropTypeCallCache[cacheKey] = true;
3255 manualPropTypeWarningCount++;
3256 }
3257 }
3258 }
3259 if (props[propName] == null) {
3260 if (isRequired) {
3261 if (props[propName] === null) {
3262 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
3263 }
3264 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
3265 }
3266 return null;
3267 } else {
3268 return validate(props, propName, componentName, location, propFullName);
3269 }
3270 }
3271
3272 var chainedCheckType = checkType.bind(null, false);
3273 chainedCheckType.isRequired = checkType.bind(null, true);
3274
3275 return chainedCheckType;
3276 }
3277
3278 function createPrimitiveTypeChecker(expectedType) {
3279 function validate(props, propName, componentName, location, propFullName, secret) {
3280 var propValue = props[propName];
3281 var propType = getPropType(propValue);
3282 if (propType !== expectedType) {
3283 // `propValue` being instance of, say, date/regexp, pass the 'object'
3284 // check, but we can offer a more precise error message here rather than
3285 // 'of type `object`'.
3286 var preciseType = getPreciseType(propValue);
3287
3288 return new PropTypeError(
3289 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
3290 {expectedType: expectedType}
3291 );
3292 }
3293 return null;
3294 }
3295 return createChainableTypeChecker(validate);
3296 }
3297
3298 function createAnyTypeChecker() {
3299 return createChainableTypeChecker(emptyFunctionThatReturnsNull);
3300 }
3301
3302 function createArrayOfTypeChecker(typeChecker) {
3303 function validate(props, propName, componentName, location, propFullName) {
3304 if (typeof typeChecker !== 'function') {
3305 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
3306 }
3307 var propValue = props[propName];
3308 if (!Array.isArray(propValue)) {
3309 var propType = getPropType(propValue);
3310 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
3311 }
3312 for (var i = 0; i < propValue.length; i++) {
3313 var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
3314 if (error instanceof Error) {
3315 return error;
3316 }
3317 }
3318 return null;
3319 }
3320 return createChainableTypeChecker(validate);
3321 }
3322
3323 function createElementTypeChecker() {
3324 function validate(props, propName, componentName, location, propFullName) {
3325 var propValue = props[propName];
3326 if (!isValidElement(propValue)) {
3327 var propType = getPropType(propValue);
3328 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
3329 }
3330 return null;
3331 }
3332 return createChainableTypeChecker(validate);
3333 }
3334
3335 function createElementTypeTypeChecker() {
3336 function validate(props, propName, componentName, location, propFullName) {
3337 var propValue = props[propName];
3338 if (!ReactIs.isValidElementType(propValue)) {
3339 var propType = getPropType(propValue);
3340 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
3341 }
3342 return null;
3343 }
3344 return createChainableTypeChecker(validate);
3345 }
3346
3347 function createInstanceTypeChecker(expectedClass) {
3348 function validate(props, propName, componentName, location, propFullName) {
3349 if (!(props[propName] instanceof expectedClass)) {
3350 var expectedClassName = expectedClass.name || ANONYMOUS;
3351 var actualClassName = getClassName(props[propName]);
3352 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
3353 }
3354 return null;
3355 }
3356 return createChainableTypeChecker(validate);
3357 }
3358
3359 function createEnumTypeChecker(expectedValues) {
3360 if (!Array.isArray(expectedValues)) {
3361 if (true) {
3362 if (arguments.length > 1) {
3363 printWarning(
3364 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
3365 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
3366 );
3367 } else {
3368 printWarning('Invalid argument supplied to oneOf, expected an array.');
3369 }
3370 }
3371 return emptyFunctionThatReturnsNull;
3372 }
3373
3374 function validate(props, propName, componentName, location, propFullName) {
3375 var propValue = props[propName];
3376 for (var i = 0; i < expectedValues.length; i++) {
3377 if (is(propValue, expectedValues[i])) {
3378 return null;
3379 }
3380 }
3381
3382 var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
3383 var type = getPreciseType(value);
3384 if (type === 'symbol') {
3385 return String(value);
3386 }
3387 return value;
3388 });
3389 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
3390 }
3391 return createChainableTypeChecker(validate);
3392 }
3393
3394 function createObjectOfTypeChecker(typeChecker) {
3395 function validate(props, propName, componentName, location, propFullName) {
3396 if (typeof typeChecker !== 'function') {
3397 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
3398 }
3399 var propValue = props[propName];
3400 var propType = getPropType(propValue);
3401 if (propType !== 'object') {
3402 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
3403 }
3404 for (var key in propValue) {
3405 if (has(propValue, key)) {
3406 var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
3407 if (error instanceof Error) {
3408 return error;
3409 }
3410 }
3411 }
3412 return null;
3413 }
3414 return createChainableTypeChecker(validate);
3415 }
3416
3417 function createUnionTypeChecker(arrayOfTypeCheckers) {
3418 if (!Array.isArray(arrayOfTypeCheckers)) {
3419 true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : 0;
3420 return emptyFunctionThatReturnsNull;
3421 }
3422
3423 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
3424 var checker = arrayOfTypeCheckers[i];
3425 if (typeof checker !== 'function') {
3426 printWarning(
3427 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
3428 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
3429 );
3430 return emptyFunctionThatReturnsNull;
3431 }
3432 }
3433
3434 function validate(props, propName, componentName, location, propFullName) {
3435 var expectedTypes = [];
3436 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
3437 var checker = arrayOfTypeCheckers[i];
3438 var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
3439 if (checkerResult == null) {
3440 return null;
3441 }
3442 if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
3443 expectedTypes.push(checkerResult.data.expectedType);
3444 }
3445 }
3446 var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
3447 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
3448 }
3449 return createChainableTypeChecker(validate);
3450 }
3451
3452 function createNodeChecker() {
3453 function validate(props, propName, componentName, location, propFullName) {
3454 if (!isNode(props[propName])) {
3455 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
3456 }
3457 return null;
3458 }
3459 return createChainableTypeChecker(validate);
3460 }
3461
3462 function invalidValidatorError(componentName, location, propFullName, key, type) {
3463 return new PropTypeError(
3464 (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
3465 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
3466 );
3467 }
3468
3469 function createShapeTypeChecker(shapeTypes) {
3470 function validate(props, propName, componentName, location, propFullName) {
3471 var propValue = props[propName];
3472 var propType = getPropType(propValue);
3473 if (propType !== 'object') {
3474 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
3475 }
3476 for (var key in shapeTypes) {
3477 var checker = shapeTypes[key];
3478 if (typeof checker !== 'function') {
3479 return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
3480 }
3481 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
3482 if (error) {
3483 return error;
3484 }
3485 }
3486 return null;
3487 }
3488 return createChainableTypeChecker(validate);
3489 }
3490
3491 function createStrictShapeTypeChecker(shapeTypes) {
3492 function validate(props, propName, componentName, location, propFullName) {
3493 var propValue = props[propName];
3494 var propType = getPropType(propValue);
3495 if (propType !== 'object') {
3496 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
3497 }
3498 // We need to check all keys in case some are required but missing from props.
3499 var allKeys = assign({}, props[propName], shapeTypes);
3500 for (var key in allKeys) {
3501 var checker = shapeTypes[key];
3502 if (has(shapeTypes, key) && typeof checker !== 'function') {
3503 return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
3504 }
3505 if (!checker) {
3506 return new PropTypeError(
3507 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
3508 '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
3509 '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
3510 );
3511 }
3512 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
3513 if (error) {
3514 return error;
3515 }
3516 }
3517 return null;
3518 }
3519
3520 return createChainableTypeChecker(validate);
3521 }
3522
3523 function isNode(propValue) {
3524 switch (typeof propValue) {
3525 case 'number':
3526 case 'string':
3527 case 'undefined':
3528 return true;
3529 case 'boolean':
3530 return !propValue;
3531 case 'object':
3532 if (Array.isArray(propValue)) {
3533 return propValue.every(isNode);
3534 }
3535 if (propValue === null || isValidElement(propValue)) {
3536 return true;
3537 }
3538
3539 var iteratorFn = getIteratorFn(propValue);
3540 if (iteratorFn) {
3541 var iterator = iteratorFn.call(propValue);
3542 var step;
3543 if (iteratorFn !== propValue.entries) {
3544 while (!(step = iterator.next()).done) {
3545 if (!isNode(step.value)) {
3546 return false;
3547 }
3548 }
3549 } else {
3550 // Iterator will provide entry [k,v] tuples rather than values.
3551 while (!(step = iterator.next()).done) {
3552 var entry = step.value;
3553 if (entry) {
3554 if (!isNode(entry[1])) {
3555 return false;
3556 }
3557 }
3558 }
3559 }
3560 } else {
3561 return false;
3562 }
3563
3564 return true;
3565 default:
3566 return false;
3567 }
3568 }
3569
3570 function isSymbol(propType, propValue) {
3571 // Native Symbol.
3572 if (propType === 'symbol') {
3573 return true;
3574 }
3575
3576 // falsy value can't be a Symbol
3577 if (!propValue) {
3578 return false;
3579 }
3580
3581 // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
3582 if (propValue['@@toStringTag'] === 'Symbol') {
3583 return true;
3584 }
3585
3586 // Fallback for non-spec compliant Symbols which are polyfilled.
3587 if (typeof Symbol === 'function' && propValue instanceof Symbol) {
3588 return true;
3589 }
3590
3591 return false;
3592 }
3593
3594 // Equivalent of `typeof` but with special handling for array and regexp.
3595 function getPropType(propValue) {
3596 var propType = typeof propValue;
3597 if (Array.isArray(propValue)) {
3598 return 'array';
3599 }
3600 if (propValue instanceof RegExp) {
3601 // Old webkits (at least until Android 4.0) return 'function' rather than
3602 // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
3603 // passes PropTypes.object.
3604 return 'object';
3605 }
3606 if (isSymbol(propType, propValue)) {
3607 return 'symbol';
3608 }
3609 return propType;
3610 }
3611
3612 // This handles more types than `getPropType`. Only used for error messages.
3613 // See `createPrimitiveTypeChecker`.
3614 function getPreciseType(propValue) {
3615 if (typeof propValue === 'undefined' || propValue === null) {
3616 return '' + propValue;
3617 }
3618 var propType = getPropType(propValue);
3619 if (propType === 'object') {
3620 if (propValue instanceof Date) {
3621 return 'date';
3622 } else if (propValue instanceof RegExp) {
3623 return 'regexp';
3624 }
3625 }
3626 return propType;
3627 }
3628
3629 // Returns a string that is postfixed to a warning about an invalid type.
3630 // For example, "undefined" or "of type array"
3631 function getPostfixForTypeWarning(value) {
3632 var type = getPreciseType(value);
3633 switch (type) {
3634 case 'array':
3635 case 'object':
3636 return 'an ' + type;
3637 case 'boolean':
3638 case 'date':
3639 case 'regexp':
3640 return 'a ' + type;
3641 default:
3642 return type;
3643 }
3644 }
3645
3646 // Returns class name of the object, if any.
3647 function getClassName(propValue) {
3648 if (!propValue.constructor || !propValue.constructor.name) {
3649 return ANONYMOUS;
3650 }
3651 return propValue.constructor.name;
3652 }
3653
3654 ReactPropTypes.checkPropTypes = checkPropTypes;
3655 ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
3656 ReactPropTypes.PropTypes = ReactPropTypes;
3657
3658 return ReactPropTypes;
3659 };
3660
3661
3662 /***/ }),
3663
3664 /***/ "../node_modules/prop-types/index.js":
3665 /*!*******************************************!*\
3666 !*** ../node_modules/prop-types/index.js ***!
3667 \*******************************************/
3668 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3669
3670 /**
3671 * Copyright (c) 2013-present, Facebook, Inc.
3672 *
3673 * This source code is licensed under the MIT license found in the
3674 * LICENSE file in the root directory of this source tree.
3675 */
3676
3677 if (true) {
3678 var ReactIs = __webpack_require__(/*! react-is */ "../node_modules/prop-types/node_modules/react-is/index.js");
3679
3680 // By explicitly using `prop-types` you are opting into new development behavior.
3681 // http://fb.me/prop-types-in-prod
3682 var throwOnDirectAccess = true;
3683 module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ "../node_modules/prop-types/factoryWithTypeCheckers.js")(ReactIs.isElement, throwOnDirectAccess);
3684 } else // removed by dead control flow
3685 {}
3686
3687
3688 /***/ }),
3689
3690 /***/ "../node_modules/prop-types/lib/ReactPropTypesSecret.js":
3691 /*!**************************************************************!*\
3692 !*** ../node_modules/prop-types/lib/ReactPropTypesSecret.js ***!
3693 \**************************************************************/
3694 /***/ ((module) => {
3695
3696 "use strict";
3697 /**
3698 * Copyright (c) 2013-present, Facebook, Inc.
3699 *
3700 * This source code is licensed under the MIT license found in the
3701 * LICENSE file in the root directory of this source tree.
3702 */
3703
3704
3705
3706 var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
3707
3708 module.exports = ReactPropTypesSecret;
3709
3710
3711 /***/ }),
3712
3713 /***/ "../node_modules/prop-types/lib/has.js":
3714 /*!*********************************************!*\
3715 !*** ../node_modules/prop-types/lib/has.js ***!
3716 \*********************************************/
3717 /***/ ((module) => {
3718
3719 module.exports = Function.call.bind(Object.prototype.hasOwnProperty);
3720
3721
3722 /***/ }),
3723
3724 /***/ "../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js":
3725 /*!************************************************************************************!*\
3726 !*** ../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js ***!
3727 \************************************************************************************/
3728 /***/ ((__unused_webpack_module, exports) => {
3729
3730 "use strict";
3731 /** @license React v16.13.1
3732 * react-is.development.js
3733 *
3734 * Copyright (c) Facebook, Inc. and its affiliates.
3735 *
3736 * This source code is licensed under the MIT license found in the
3737 * LICENSE file in the root directory of this source tree.
3738 */
3739
3740
3741
3742
3743
3744 if (true) {
3745 (function() {
3746 'use strict';
3747
3748 // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
3749 // nor polyfill, then a plain number is used for performance.
3750 var hasSymbol = typeof Symbol === 'function' && Symbol.for;
3751 var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
3752 var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
3753 var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
3754 var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
3755 var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
3756 var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
3757 var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
3758 // (unstable) APIs that have been removed. Can we remove the symbols?
3759
3760 var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
3761 var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
3762 var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
3763 var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
3764 var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
3765 var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
3766 var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
3767 var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
3768 var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
3769 var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
3770 var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
3771
3772 function isValidElementType(type) {
3773 return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
3774 type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
3775 }
3776
3777 function typeOf(object) {
3778 if (typeof object === 'object' && object !== null) {
3779 var $$typeof = object.$$typeof;
3780
3781 switch ($$typeof) {
3782 case REACT_ELEMENT_TYPE:
3783 var type = object.type;
3784
3785 switch (type) {
3786 case REACT_ASYNC_MODE_TYPE:
3787 case REACT_CONCURRENT_MODE_TYPE:
3788 case REACT_FRAGMENT_TYPE:
3789 case REACT_PROFILER_TYPE:
3790 case REACT_STRICT_MODE_TYPE:
3791 case REACT_SUSPENSE_TYPE:
3792 return type;
3793
3794 default:
3795 var $$typeofType = type && type.$$typeof;
3796
3797 switch ($$typeofType) {
3798 case REACT_CONTEXT_TYPE:
3799 case REACT_FORWARD_REF_TYPE:
3800 case REACT_LAZY_TYPE:
3801 case REACT_MEMO_TYPE:
3802 case REACT_PROVIDER_TYPE:
3803 return $$typeofType;
3804
3805 default:
3806 return $$typeof;
3807 }
3808
3809 }
3810
3811 case REACT_PORTAL_TYPE:
3812 return $$typeof;
3813 }
3814 }
3815
3816 return undefined;
3817 } // AsyncMode is deprecated along with isAsyncMode
3818
3819 var AsyncMode = REACT_ASYNC_MODE_TYPE;
3820 var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
3821 var ContextConsumer = REACT_CONTEXT_TYPE;
3822 var ContextProvider = REACT_PROVIDER_TYPE;
3823 var Element = REACT_ELEMENT_TYPE;
3824 var ForwardRef = REACT_FORWARD_REF_TYPE;
3825 var Fragment = REACT_FRAGMENT_TYPE;
3826 var Lazy = REACT_LAZY_TYPE;
3827 var Memo = REACT_MEMO_TYPE;
3828 var Portal = REACT_PORTAL_TYPE;
3829 var Profiler = REACT_PROFILER_TYPE;
3830 var StrictMode = REACT_STRICT_MODE_TYPE;
3831 var Suspense = REACT_SUSPENSE_TYPE;
3832 var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
3833
3834 function isAsyncMode(object) {
3835 {
3836 if (!hasWarnedAboutDeprecatedIsAsyncMode) {
3837 hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
3838
3839 console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
3840 }
3841 }
3842
3843 return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
3844 }
3845 function isConcurrentMode(object) {
3846 return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
3847 }
3848 function isContextConsumer(object) {
3849 return typeOf(object) === REACT_CONTEXT_TYPE;
3850 }
3851 function isContextProvider(object) {
3852 return typeOf(object) === REACT_PROVIDER_TYPE;
3853 }
3854 function isElement(object) {
3855 return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
3856 }
3857 function isForwardRef(object) {
3858 return typeOf(object) === REACT_FORWARD_REF_TYPE;
3859 }
3860 function isFragment(object) {
3861 return typeOf(object) === REACT_FRAGMENT_TYPE;
3862 }
3863 function isLazy(object) {
3864 return typeOf(object) === REACT_LAZY_TYPE;
3865 }
3866 function isMemo(object) {
3867 return typeOf(object) === REACT_MEMO_TYPE;
3868 }
3869 function isPortal(object) {
3870 return typeOf(object) === REACT_PORTAL_TYPE;
3871 }
3872 function isProfiler(object) {
3873 return typeOf(object) === REACT_PROFILER_TYPE;
3874 }
3875 function isStrictMode(object) {
3876 return typeOf(object) === REACT_STRICT_MODE_TYPE;
3877 }
3878 function isSuspense(object) {
3879 return typeOf(object) === REACT_SUSPENSE_TYPE;
3880 }
3881
3882 exports.AsyncMode = AsyncMode;
3883 exports.ConcurrentMode = ConcurrentMode;
3884 exports.ContextConsumer = ContextConsumer;
3885 exports.ContextProvider = ContextProvider;
3886 exports.Element = Element;
3887 exports.ForwardRef = ForwardRef;
3888 exports.Fragment = Fragment;
3889 exports.Lazy = Lazy;
3890 exports.Memo = Memo;
3891 exports.Portal = Portal;
3892 exports.Profiler = Profiler;
3893 exports.StrictMode = StrictMode;
3894 exports.Suspense = Suspense;
3895 exports.isAsyncMode = isAsyncMode;
3896 exports.isConcurrentMode = isConcurrentMode;
3897 exports.isContextConsumer = isContextConsumer;
3898 exports.isContextProvider = isContextProvider;
3899 exports.isElement = isElement;
3900 exports.isForwardRef = isForwardRef;
3901 exports.isFragment = isFragment;
3902 exports.isLazy = isLazy;
3903 exports.isMemo = isMemo;
3904 exports.isPortal = isPortal;
3905 exports.isProfiler = isProfiler;
3906 exports.isStrictMode = isStrictMode;
3907 exports.isSuspense = isSuspense;
3908 exports.isValidElementType = isValidElementType;
3909 exports.typeOf = typeOf;
3910 })();
3911 }
3912
3913
3914 /***/ }),
3915
3916 /***/ "../node_modules/prop-types/node_modules/react-is/index.js":
3917 /*!*****************************************************************!*\
3918 !*** ../node_modules/prop-types/node_modules/react-is/index.js ***!
3919 \*****************************************************************/
3920 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3921
3922 "use strict";
3923
3924
3925 if (false) // removed by dead control flow
3926 {} else {
3927 module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js");
3928 }
3929
3930
3931 /***/ }),
3932
3933 /***/ "../node_modules/react-dom/client.js":
3934 /*!*******************************************!*\
3935 !*** ../node_modules/react-dom/client.js ***!
3936 \*******************************************/
3937 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3938
3939 "use strict";
3940
3941
3942 var m = __webpack_require__(/*! react-dom */ "react-dom");
3943 if (false) // removed by dead control flow
3944 {} else {
3945 var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
3946 exports.createRoot = function(c, o) {
3947 i.usingClientEntryPoint = true;
3948 try {
3949 return m.createRoot(c, o);
3950 } finally {
3951 i.usingClientEntryPoint = false;
3952 }
3953 };
3954 exports.hydrateRoot = function(c, h, o) {
3955 i.usingClientEntryPoint = true;
3956 try {
3957 return m.hydrateRoot(c, h, o);
3958 } finally {
3959 i.usingClientEntryPoint = false;
3960 }
3961 };
3962 }
3963
3964
3965 /***/ }),
3966
3967 /***/ "@elementor/icons":
3968 /*!************************************!*\
3969 !*** external "elementorV2.icons" ***!
3970 \************************************/
3971 /***/ ((module) => {
3972
3973 "use strict";
3974 module.exports = elementorV2.icons;
3975
3976 /***/ }),
3977
3978 /***/ "@elementor/ui":
3979 /*!*********************************!*\
3980 !*** external "elementorV2.ui" ***!
3981 \*********************************/
3982 /***/ ((module) => {
3983
3984 "use strict";
3985 module.exports = elementorV2.ui;
3986
3987 /***/ }),
3988
3989 /***/ "@elementor/ui/DialogHeader":
3990 /*!*************************************************!*\
3991 !*** external "elementorV2.ui['DialogHeader']" ***!
3992 \*************************************************/
3993 /***/ ((module) => {
3994
3995 "use strict";
3996 module.exports = elementorV2.ui['DialogHeader'];
3997
3998 /***/ }),
3999
4000 /***/ "@elementor/ui/DialogHeaderGroup":
4001 /*!******************************************************!*\
4002 !*** external "elementorV2.ui['DialogHeaderGroup']" ***!
4003 \******************************************************/
4004 /***/ ((module) => {
4005
4006 "use strict";
4007 module.exports = elementorV2.ui['DialogHeaderGroup'];
4008
4009 /***/ }),
4010
4011 /***/ "@wordpress/i18n":
4012 /*!**************************!*\
4013 !*** external "wp.i18n" ***!
4014 \**************************/
4015 /***/ ((module) => {
4016
4017 "use strict";
4018 module.exports = wp.i18n;
4019
4020 /***/ }),
4021
4022 /***/ "react":
4023 /*!************************!*\
4024 !*** external "React" ***!
4025 \************************/
4026 /***/ ((module) => {
4027
4028 "use strict";
4029 module.exports = React;
4030
4031 /***/ }),
4032
4033 /***/ "react-dom":
4034 /*!***************************!*\
4035 !*** external "ReactDOM" ***!
4036 \***************************/
4037 /***/ ((module) => {
4038
4039 "use strict";
4040 module.exports = ReactDOM;
4041
4042 /***/ })
4043
4044 /******/ });
4045 /************************************************************************/
4046 /******/ // The module cache
4047 /******/ var __webpack_module_cache__ = {};
4048 /******/
4049 /******/ // The require function
4050 /******/ function __webpack_require__(moduleId) {
4051 /******/ // Check if module is in cache
4052 /******/ var cachedModule = __webpack_module_cache__[moduleId];
4053 /******/ if (cachedModule !== undefined) {
4054 /******/ return cachedModule.exports;
4055 /******/ }
4056 /******/ // Create a new module (and put it into the cache)
4057 /******/ var module = __webpack_module_cache__[moduleId] = {
4058 /******/ // no module.id needed
4059 /******/ // no module.loaded needed
4060 /******/ exports: {}
4061 /******/ };
4062 /******/
4063 /******/ // Execute the module function
4064 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
4065 /******/
4066 /******/ // Return the exports of the module
4067 /******/ return module.exports;
4068 /******/ }
4069 /******/
4070 /************************************************************************/
4071 var __webpack_exports__ = {};
4072 // This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
4073 (() => {
4074 "use strict";
4075 /*!*************************************************************!*\
4076 !*** ../modules/atomic-opt-in/assets/js/opt-in-page/app.js ***!
4077 \*************************************************************/
4078 /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
4079
4080
4081 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4082 var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
4083 var _react2 = _interopRequireDefault(__webpack_require__(/*! elementor-utils/react */ "../assets/dev/js/utils/react.js"));
4084 var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
4085 var _optIn = __webpack_require__(/*! ./opt-in */ "../modules/atomic-opt-in/assets/js/opt-in-page/opt-in.js");
4086 var App = function App(props) {
4087 return /*#__PURE__*/_react.default.createElement(_ui.DirectionProvider, {
4088 rtl: props.isRTL
4089 }, /*#__PURE__*/_react.default.createElement(_ui.LocalizationProvider, null, /*#__PURE__*/_react.default.createElement(_ui.ThemeProvider, {
4090 colorScheme: 'light'
4091 }, /*#__PURE__*/_react.default.createElement(_optIn.OptIn, {
4092 state: props === null || props === void 0 ? void 0 : props.state
4093 }))));
4094 };
4095 App.propTypes = {
4096 isRTL: PropTypes.bool,
4097 state: PropTypes.object
4098 };
4099 var init = function init() {
4100 var rootElement = document.querySelector('#page-editor-v4-opt-in');
4101 if (!rootElement) {
4102 return;
4103 }
4104 _react2.default.render(/*#__PURE__*/_react.default.createElement(App, {
4105 isRTL: !!elementorCommon.config.isRTL,
4106 state: elementorSettingsEditor4OptIn
4107 }), rootElement);
4108 };
4109 init();
4110 })();
4111
4112 /******/ })()
4113 ;
4114 //# sourceMappingURL=editor-v4-opt-in.js.map