PluginProbe
HubSpot All-In-One Marketing – Forms, Popups, Live Chat / 11.1.15
HubSpot All-In-One Marketing – Forms, Popups, Live Chat v11.1.15
11.3.75 11.3.73 11.3.71 11.3.70 11.3.69 11.3.64 11.3.65 11.3.62 11.3.61 11.3.56 11.3.58 11.0.31 11.0.52 11.0.54 11.0.56 11.0.58 11.0.7 11.1.10 11.1.11 11.1.13 11.1.14 11.1.15 11.1.2 11.1.20 11.1.21 All 73 releases
leadin / build / leadin.js

leadin.js in HubSpot All-In-One Marketing – Forms, Popups, Live Chat 11.1.15, at build/leadin.js

5,903 lines 201.3 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 /***/ "./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js":
5 /*!*******************************************************************!*\
6 !*** ./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js ***!
7 \*******************************************************************/
8 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9
10 "use strict";
11 __webpack_require__.r(__webpack_exports__);
12 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
14 /* harmony export */ });
15 function memoize(fn) {
16 var cache = Object.create(null);
17 return function (arg) {
18 if (cache[arg] === undefined) cache[arg] = fn(arg);
19 return cache[arg];
20 };
21 }
22
23 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (memoize);
24
25
26 /***/ }),
27
28 /***/ "./node_modules/@linaria/react/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js":
29 /*!***********************************************************************************************************!*\
30 !*** ./node_modules/@linaria/react/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js ***!
31 \***********************************************************************************************************/
32 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
33
34 "use strict";
35 __webpack_require__.r(__webpack_exports__);
36 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
37 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
38 /* harmony export */ });
39 /* harmony import */ var _emotion_memoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @emotion/memoize */ "./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js");
40
41
42 var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
43
44 var isPropValid = /* #__PURE__ */(0,_emotion_memoize__WEBPACK_IMPORTED_MODULE_0__["default"])(function (prop) {
45 return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
46 /* o */
47 && prop.charCodeAt(1) === 110
48 /* n */
49 && prop.charCodeAt(2) < 91;
50 }
51 /* Z+1 */
52 );
53
54 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isPropValid);
55
56
57 /***/ }),
58
59 /***/ "./scripts/api/wordpressApiClient.ts":
60 /*!*******************************************!*\
61 !*** ./scripts/api/wordpressApiClient.ts ***!
62 \*******************************************/
63 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
64
65 "use strict";
66 __webpack_require__.r(__webpack_exports__);
67 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
68 /* harmony export */ "disableInternalTracking": () => (/* binding */ disableInternalTracking),
69 /* harmony export */ "fetchDisableInternalTracking": () => (/* binding */ fetchDisableInternalTracking),
70 /* harmony export */ "getBusinessUnitId": () => (/* binding */ getBusinessUnitId),
71 /* harmony export */ "healthcheckRestApi": () => (/* binding */ healthcheckRestApi),
72 /* harmony export */ "setBusinessUnitId": () => (/* binding */ setBusinessUnitId),
73 /* harmony export */ "skipReview": () => (/* binding */ skipReview),
74 /* harmony export */ "trackConsent": () => (/* binding */ trackConsent),
75 /* harmony export */ "updateHublet": () => (/* binding */ updateHublet)
76 /* harmony export */ });
77 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
78 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
79 /* harmony import */ var _lib_Raven__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/Raven */ "./scripts/lib/Raven.ts");
80 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
81 /* harmony import */ var _utils_queryParams__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/queryParams */ "./scripts/utils/queryParams.ts");
82
83
84
85
86
87 function makeRequest(method, path) {
88 var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
89 var queryParams = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
90 // eslint-disable-next-line compat/compat
91 var restApiUrl = new URL("".concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.restUrl, "leadin/v1").concat(path));
92 (0,_utils_queryParams__WEBPACK_IMPORTED_MODULE_3__.addQueryObjectToUrl)(restApiUrl, queryParams);
93 return new Promise(function (resolve, reject) {
94 var payload = {
95 url: restApiUrl.toString(),
96 method: method,
97 contentType: 'application/json',
98 beforeSend: function beforeSend(xhr) {
99 return xhr.setRequestHeader('X-WP-Nonce', _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.restNonce);
100 },
101 success: resolve,
102 error: function error(response) {
103 _lib_Raven__WEBPACK_IMPORTED_MODULE_1__["default"].captureMessage("HTTP Request to ".concat(restApiUrl, " failed with error ").concat(response.status, ": ").concat(response.responseText), {
104 fingerprint: ['{{ default }}', path, response.status, response.responseText]
105 });
106 reject(response);
107 }
108 };
109
110 if (method !== 'get') {
111 payload.data = JSON.stringify(data);
112 }
113
114 jquery__WEBPACK_IMPORTED_MODULE_0___default().ajax(payload);
115 });
116 }
117
118 function healthcheckRestApi() {
119 return makeRequest('get', '/healthcheck');
120 }
121 function disableInternalTracking(value) {
122 return makeRequest('put', '/internal-tracking', value ? '1' : '0');
123 }
124 function fetchDisableInternalTracking() {
125 return makeRequest('get', '/internal-tracking').then(function (message) {
126 return {
127 message: message
128 };
129 });
130 }
131 function updateHublet(hublet) {
132 return makeRequest('put', '/hublet', {
133 hublet: hublet
134 });
135 }
136 function skipReview() {
137 return makeRequest('post', '/skip-review');
138 }
139 function trackConsent(canTrack) {
140 return makeRequest('post', '/track-consent', {
141 canTrack: canTrack
142 }).then(function (message) {
143 return {
144 message: message
145 };
146 });
147 }
148 function setBusinessUnitId(businessUnitId) {
149 return makeRequest('put', '/business-unit', {
150 businessUnitId: businessUnitId
151 });
152 }
153 function getBusinessUnitId() {
154 return makeRequest('get', '/business-unit');
155 }
156
157 /***/ }),
158
159 /***/ "./scripts/constants/leadinConfig.ts":
160 /*!*******************************************!*\
161 !*** ./scripts/constants/leadinConfig.ts ***!
162 \*******************************************/
163 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
164
165 "use strict";
166 __webpack_require__.r(__webpack_exports__);
167 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
168 /* harmony export */ "accountName": () => (/* binding */ accountName),
169 /* harmony export */ "activationTime": () => (/* binding */ activationTime),
170 /* harmony export */ "adminUrl": () => (/* binding */ adminUrl),
171 /* harmony export */ "connectionStatus": () => (/* binding */ connectionStatus),
172 /* harmony export */ "contentEmbed": () => (/* binding */ contentEmbed),
173 /* harmony export */ "deviceId": () => (/* binding */ deviceId),
174 /* harmony export */ "didDisconnect": () => (/* binding */ didDisconnect),
175 /* harmony export */ "env": () => (/* binding */ env),
176 /* harmony export */ "formsScript": () => (/* binding */ formsScript),
177 /* harmony export */ "formsScriptPayload": () => (/* binding */ formsScriptPayload),
178 /* harmony export */ "hublet": () => (/* binding */ hublet),
179 /* harmony export */ "hubspotBaseUrl": () => (/* binding */ hubspotBaseUrl),
180 /* harmony export */ "hubspotNonce": () => (/* binding */ hubspotNonce),
181 /* harmony export */ "iframeUrl": () => (/* binding */ iframeUrl),
182 /* harmony export */ "impactLink": () => (/* binding */ impactLink),
183 /* harmony export */ "lastAuthorizeTime": () => (/* binding */ lastAuthorizeTime),
184 /* harmony export */ "lastDeauthorizeTime": () => (/* binding */ lastDeauthorizeTime),
185 /* harmony export */ "lastDisconnectTime": () => (/* binding */ lastDisconnectTime),
186 /* harmony export */ "leadinPluginVersion": () => (/* binding */ leadinPluginVersion),
187 /* harmony export */ "leadinQueryParams": () => (/* binding */ leadinQueryParams),
188 /* harmony export */ "locale": () => (/* binding */ locale),
189 /* harmony export */ "loginUrl": () => (/* binding */ loginUrl),
190 /* harmony export */ "meetingsScript": () => (/* binding */ meetingsScript),
191 /* harmony export */ "phpVersion": () => (/* binding */ phpVersion),
192 /* harmony export */ "pluginPath": () => (/* binding */ pluginPath),
193 /* harmony export */ "plugins": () => (/* binding */ plugins),
194 /* harmony export */ "portalDomain": () => (/* binding */ portalDomain),
195 /* harmony export */ "portalEmail": () => (/* binding */ portalEmail),
196 /* harmony export */ "portalId": () => (/* binding */ portalId),
197 /* harmony export */ "redirectNonce": () => (/* binding */ redirectNonce),
198 /* harmony export */ "refreshToken": () => (/* binding */ refreshToken),
199 /* harmony export */ "refreshTokenError": () => (/* binding */ refreshTokenError),
200 /* harmony export */ "requiresContentEmbedScope": () => (/* binding */ requiresContentEmbedScope),
201 /* harmony export */ "restNonce": () => (/* binding */ restNonce),
202 /* harmony export */ "restUrl": () => (/* binding */ restUrl),
203 /* harmony export */ "reviewSkippedDate": () => (/* binding */ reviewSkippedDate),
204 /* harmony export */ "theme": () => (/* binding */ theme),
205 /* harmony export */ "trackConsent": () => (/* binding */ trackConsent),
206 /* harmony export */ "wpVersion": () => (/* binding */ wpVersion)
207 /* harmony export */ });
208 var _window$leadinConfig = window.leadinConfig,
209 accountName = _window$leadinConfig.accountName,
210 adminUrl = _window$leadinConfig.adminUrl,
211 activationTime = _window$leadinConfig.activationTime,
212 connectionStatus = _window$leadinConfig.connectionStatus,
213 deviceId = _window$leadinConfig.deviceId,
214 didDisconnect = _window$leadinConfig.didDisconnect,
215 env = _window$leadinConfig.env,
216 formsScript = _window$leadinConfig.formsScript,
217 meetingsScript = _window$leadinConfig.meetingsScript,
218 formsScriptPayload = _window$leadinConfig.formsScriptPayload,
219 hublet = _window$leadinConfig.hublet,
220 hubspotBaseUrl = _window$leadinConfig.hubspotBaseUrl,
221 hubspotNonce = _window$leadinConfig.hubspotNonce,
222 iframeUrl = _window$leadinConfig.iframeUrl,
223 impactLink = _window$leadinConfig.impactLink,
224 lastAuthorizeTime = _window$leadinConfig.lastAuthorizeTime,
225 lastDeauthorizeTime = _window$leadinConfig.lastDeauthorizeTime,
226 lastDisconnectTime = _window$leadinConfig.lastDisconnectTime,
227 leadinPluginVersion = _window$leadinConfig.leadinPluginVersion,
228 leadinQueryParams = _window$leadinConfig.leadinQueryParams,
229 locale = _window$leadinConfig.locale,
230 loginUrl = _window$leadinConfig.loginUrl,
231 phpVersion = _window$leadinConfig.phpVersion,
232 pluginPath = _window$leadinConfig.pluginPath,
233 plugins = _window$leadinConfig.plugins,
234 portalDomain = _window$leadinConfig.portalDomain,
235 portalEmail = _window$leadinConfig.portalEmail,
236 portalId = _window$leadinConfig.portalId,
237 redirectNonce = _window$leadinConfig.redirectNonce,
238 restNonce = _window$leadinConfig.restNonce,
239 restUrl = _window$leadinConfig.restUrl,
240 refreshToken = _window$leadinConfig.refreshToken,
241 reviewSkippedDate = _window$leadinConfig.reviewSkippedDate,
242 theme = _window$leadinConfig.theme,
243 trackConsent = _window$leadinConfig.trackConsent,
244 wpVersion = _window$leadinConfig.wpVersion,
245 contentEmbed = _window$leadinConfig.contentEmbed,
246 requiresContentEmbedScope = _window$leadinConfig.requiresContentEmbedScope,
247 refreshTokenError = _window$leadinConfig.refreshTokenError;
248
249
250 /***/ }),
251
252 /***/ "./scripts/constants/selectors.ts":
253 /*!****************************************!*\
254 !*** ./scripts/constants/selectors.ts ***!
255 \****************************************/
256 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
257
258 "use strict";
259 __webpack_require__.r(__webpack_exports__);
260 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
261 /* harmony export */ "domElements": () => (/* binding */ domElements)
262 /* harmony export */ });
263 var domElements = {
264 iframe: '#leadin-iframe',
265 subMenu: '.toplevel_page_leadin > ul',
266 subMenuLinks: '.toplevel_page_leadin > ul a',
267 subMenuButtons: '.toplevel_page_leadin > ul > li',
268 deactivatePluginButton: '[data-slug="leadin"] .deactivate a',
269 deactivateFeedbackForm: 'form.leadin-deactivate-form',
270 deactivateFeedbackSubmit: 'button#leadin-feedback-submit',
271 deactivateFeedbackSkip: 'button#leadin-feedback-skip',
272 thickboxModalClose: '.leadin-modal-close',
273 thickboxModalWindow: 'div#TB_window.thickbox-loading',
274 thickboxModalContent: 'div#TB_ajaxContent.TB_modal',
275 reviewBannerContainer: '#leadin-review-banner',
276 reviewBannerLeaveReviewLink: 'a#leave-review-button',
277 reviewBannerDismissButton: 'a#dismiss-review-banner-button',
278 leadinIframeContainer: 'leadin-iframe-container',
279 leadinIframe: 'leadin-iframe',
280 leadinIframeFallbackContainer: 'leadin-iframe-fallback-container'
281 };
282
283 /***/ }),
284
285 /***/ "./scripts/iframe/IframeErrorPage.tsx":
286 /*!********************************************!*\
287 !*** ./scripts/iframe/IframeErrorPage.tsx ***!
288 \********************************************/
289 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
290
291 "use strict";
292 __webpack_require__.r(__webpack_exports__);
293 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
294 /* harmony export */ "IframeErrorPage": () => (/* binding */ IframeErrorPage)
295 /* harmony export */ });
296 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
297 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
298 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
299 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
300
301
302
303 var IframeErrorContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('div')({
304 name: "IframeErrorContainer",
305 "class": "i1jit3y0",
306 propsAsIs: false
307 });
308 var ErrorHeader = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('h1')({
309 name: "ErrorHeader",
310 "class": "e12lu7tb",
311 propsAsIs: false
312 });
313 var IframeErrorPage = function IframeErrorPage() {
314 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(IframeErrorContainer, {
315 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", {
316 alt: "Cannot find page",
317 width: "175",
318 src: "//static.hsappstatic.net/ui-images/static-1.14/optimized/errors/map.svg"
319 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ErrorHeader, {
320 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('The HubSpot for WordPress plugin is not able to load pages', 'leadin')
321 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", {
322 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Try disabling your browser extensions and ad blockers, then refresh the page', 'leadin')
323 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", {
324 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Or open the HubSpot for WordPress plugin in a different browser', 'leadin')
325 })]
326 });
327 };
328
329 __webpack_require__(/*! ./IframeErrorPage.linaria.css!=!../../node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./IframeErrorPage.tsx */ "./scripts/iframe/IframeErrorPage.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/iframe/IframeErrorPage.tsx");
330
331 /***/ }),
332
333 /***/ "./scripts/iframe/constants.ts":
334 /*!*************************************!*\
335 !*** ./scripts/iframe/constants.ts ***!
336 \*************************************/
337 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
338
339 "use strict";
340 __webpack_require__.r(__webpack_exports__);
341 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
342 /* harmony export */ "App": () => (/* binding */ App),
343 /* harmony export */ "AppIframe": () => (/* binding */ AppIframe)
344 /* harmony export */ });
345 var _AppIframe;
346
347 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
348
349 var App;
350
351 (function (App) {
352 App[App["Forms"] = 0] = "Forms";
353 App[App["LiveChat"] = 1] = "LiveChat";
354 App[App["Plugin"] = 2] = "Plugin";
355 App[App["PluginSettings"] = 3] = "PluginSettings";
356 App[App["Background"] = 4] = "Background";
357 })(App || (App = {}));
358
359 var AppIframe = (_AppIframe = {}, _defineProperty(_AppIframe, App.Forms, 'integrated-form-app'), _defineProperty(_AppIframe, App.LiveChat, 'integrated-livechat-app'), _defineProperty(_AppIframe, App.Plugin, 'integrated-plugin-app'), _defineProperty(_AppIframe, App.PluginSettings, 'integrated-plugin-app'), _defineProperty(_AppIframe, App.Background, 'integrated-plugin-proxy'), _AppIframe);
360
361 /***/ }),
362
363 /***/ "./scripts/iframe/integratedMessages/core/CoreMessages.ts":
364 /*!****************************************************************!*\
365 !*** ./scripts/iframe/integratedMessages/core/CoreMessages.ts ***!
366 \****************************************************************/
367 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
368
369 "use strict";
370 __webpack_require__.r(__webpack_exports__);
371 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
372 /* harmony export */ "CoreMessages": () => (/* binding */ CoreMessages)
373 /* harmony export */ });
374 var CoreMessages = {
375 HandshakeReceive: 'INTEGRATED_APP_EMBEDDER_HANDSHAKE_RECEIVED',
376 SendRefreshToken: 'INTEGRATED_APP_EMBEDDER_SEND_REFRESH_TOKEN',
377 ReloadParentFrame: 'INTEGRATED_APP_EMBEDDER_RELOAD_PARENT_FRAME',
378 RedirectParentFrame: 'INTEGRATED_APP_EMBEDDER_REDIRECT_PARENT_FRAME',
379 SendLocale: 'INTEGRATED_APP_EMBEDDER_SEND_LOCALE',
380 SendDeviceId: 'INTEGRATED_APP_EMBEDDER_SEND_DEVICE_ID'
381 };
382
383 /***/ }),
384
385 /***/ "./scripts/iframe/integratedMessages/forms/FormsMessages.ts":
386 /*!******************************************************************!*\
387 !*** ./scripts/iframe/integratedMessages/forms/FormsMessages.ts ***!
388 \******************************************************************/
389 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
390
391 "use strict";
392 __webpack_require__.r(__webpack_exports__);
393 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
394 /* harmony export */ "FormMessages": () => (/* binding */ FormMessages)
395 /* harmony export */ });
396 var FormMessages = {
397 CreateFormAppNavigation: 'CREATE_FORM_APP_NAVIGATION'
398 };
399
400 /***/ }),
401
402 /***/ "./scripts/iframe/integratedMessages/index.ts":
403 /*!****************************************************!*\
404 !*** ./scripts/iframe/integratedMessages/index.ts ***!
405 \****************************************************/
406 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
407
408 "use strict";
409 __webpack_require__.r(__webpack_exports__);
410 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
411 /* harmony export */ "CoreMessages": () => (/* reexport safe */ _core_CoreMessages__WEBPACK_IMPORTED_MODULE_0__.CoreMessages),
412 /* harmony export */ "FormMessages": () => (/* reexport safe */ _forms_FormsMessages__WEBPACK_IMPORTED_MODULE_1__.FormMessages),
413 /* harmony export */ "LiveChatMessages": () => (/* reexport safe */ _livechat_LiveChatMessages__WEBPACK_IMPORTED_MODULE_2__.LiveChatMessages),
414 /* harmony export */ "PluginMessages": () => (/* reexport safe */ _plugin_PluginMessages__WEBPACK_IMPORTED_MODULE_3__.PluginMessages),
415 /* harmony export */ "ProxyMessages": () => (/* reexport safe */ _proxy_ProxyMessages__WEBPACK_IMPORTED_MODULE_4__.ProxyMessages)
416 /* harmony export */ });
417 /* harmony import */ var _core_CoreMessages__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core/CoreMessages */ "./scripts/iframe/integratedMessages/core/CoreMessages.ts");
418 /* harmony import */ var _forms_FormsMessages__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./forms/FormsMessages */ "./scripts/iframe/integratedMessages/forms/FormsMessages.ts");
419 /* harmony import */ var _livechat_LiveChatMessages__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./livechat/LiveChatMessages */ "./scripts/iframe/integratedMessages/livechat/LiveChatMessages.ts");
420 /* harmony import */ var _plugin_PluginMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./plugin/PluginMessages */ "./scripts/iframe/integratedMessages/plugin/PluginMessages.ts");
421 /* harmony import */ var _proxy_ProxyMessages__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./proxy/ProxyMessages */ "./scripts/iframe/integratedMessages/proxy/ProxyMessages.ts");
422
423
424
425
426
427
428 /***/ }),
429
430 /***/ "./scripts/iframe/integratedMessages/livechat/LiveChatMessages.ts":
431 /*!************************************************************************!*\
432 !*** ./scripts/iframe/integratedMessages/livechat/LiveChatMessages.ts ***!
433 \************************************************************************/
434 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
435
436 "use strict";
437 __webpack_require__.r(__webpack_exports__);
438 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
439 /* harmony export */ "LiveChatMessages": () => (/* binding */ LiveChatMessages)
440 /* harmony export */ });
441 var LiveChatMessages = {
442 CreateLiveChatAppNavigation: 'CREATE_LIVE_CHAT_APP_NAVIGATION'
443 };
444
445 /***/ }),
446
447 /***/ "./scripts/iframe/integratedMessages/plugin/PluginMessages.ts":
448 /*!********************************************************************!*\
449 !*** ./scripts/iframe/integratedMessages/plugin/PluginMessages.ts ***!
450 \********************************************************************/
451 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
452
453 "use strict";
454 __webpack_require__.r(__webpack_exports__);
455 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
456 /* harmony export */ "PluginMessages": () => (/* binding */ PluginMessages)
457 /* harmony export */ });
458 var PluginMessages = {
459 PluginSettingsNavigation: 'PLUGIN_SETTINGS_NAVIGATION',
460 PluginLeadinConfig: 'PLUGIN_LEADIN_CONFIG',
461 TrackConsent: 'INTEGRATED_APP_EMBEDDER_TRACK_CONSENT',
462 InternalTrackingFetchRequest: 'INTEGRATED_TRACKING_FETCH_REQUEST',
463 InternalTrackingFetchResponse: 'INTEGRATED_TRACKING_FETCH_RESPONSE',
464 InternalTrackingFetchError: 'INTEGRATED_TRACKING_FETCH_ERROR',
465 InternalTrackingChangeRequest: 'INTEGRATED_TRACKING_CHANGE_REQUEST',
466 InternalTrackingChangeError: 'INTEGRATED_TRACKING_CHANGE_ERROR',
467 BusinessUnitFetchRequest: 'BUSINESS_UNIT_FETCH_REQUEST',
468 BusinessUnitFetchResponse: 'BUSINESS_UNIT_FETCH_FETCH_RESPONSE',
469 BusinessUnitFetchError: 'BUSINESS_UNIT_FETCH_FETCH_ERROR',
470 BusinessUnitChangeRequest: 'BUSINESS_UNIT_CHANGE_REQUEST',
471 BusinessUnitChangeError: 'BUSINESS_UNIT_CHANGE_ERROR',
472 SkipReviewRequest: 'SKIP_REVIEW_REQUEST',
473 SkipReviewResponse: 'SKIP_REVIEW_RESPONSE',
474 SkipReviewError: 'SKIP_REVIEW_ERROR',
475 RemoveParentQueryParam: 'REMOVE_PARENT_QUERY_PARAM',
476 ContentEmbedInstallRequest: 'CONTENT_EMBED_INSTALL_REQUEST',
477 ContentEmbedInstallResponse: 'CONTENT_EMBED_INSTALL_RESPONSE',
478 ContentEmbedInstallError: 'CONTENT_EMBED_INSTALL_ERROR',
479 ContentEmbedActivationRequest: 'CONTENT_EMBED_ACTIVATION_REQUEST',
480 ContentEmbedActivationResponse: 'CONTENT_EMBED_ACTIVATION_RESPONSE',
481 ContentEmbedActivationError: 'CONTENT_EMBED_ACTIVATION_ERROR'
482 };
483
484 /***/ }),
485
486 /***/ "./scripts/iframe/integratedMessages/proxy/ProxyMessages.ts":
487 /*!******************************************************************!*\
488 !*** ./scripts/iframe/integratedMessages/proxy/ProxyMessages.ts ***!
489 \******************************************************************/
490 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
491
492 "use strict";
493 __webpack_require__.r(__webpack_exports__);
494 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
495 /* harmony export */ "ProxyMessages": () => (/* binding */ ProxyMessages)
496 /* harmony export */ });
497 var ProxyMessages = {
498 FetchForms: 'FETCH_FORMS',
499 FetchForm: 'FETCH_FORM',
500 CreateFormFromTemplate: 'CREATE_FORM_FROM_TEMPLATE',
501 FetchAuth: 'FETCH_AUTH',
502 FetchMeetingsAndUsers: 'FETCH_MEETINGS_AND_USERS',
503 FetchContactsCreateSinceActivation: 'FETCH_CONTACTS_CREATED_SINCE_ACTIVATION',
504 FetchOrCreateMeetingUser: 'FETCH_OR_CREATE_MEETING_USER',
505 ConnectMeetingsCalendar: 'CONNECT_MEETINGS_CALENDAR',
506 TrackFormPreviewRender: 'TRACK_FORM_PREVIEW_RENDER',
507 TrackFormCreatedFromTemplate: 'TRACK_FORM_CREATED_FROM_TEMPLATE',
508 TrackFormCreationFailed: 'TRACK_FORM_CREATION_FAILED',
509 TrackMeetingPreviewRender: 'TRACK_MEETING_PREVIEW_RENDER',
510 TrackSidebarMetaChange: 'TRACK_SIDEBAR_META_CHANGE',
511 TrackReviewBannerRender: 'TRACK_REVIEW_BANNER_RENDER',
512 TrackReviewBannerInteraction: 'TRACK_REVIEW_BANNER_INTERACTION',
513 TrackReviewBannerDismissed: 'TRACK_REVIEW_BANNER_DISMISSED',
514 TrackPluginDeactivation: 'TRACK_PLUGIN_DEACTIVATION'
515 };
516
517 /***/ }),
518
519 /***/ "./scripts/iframe/messageMiddleware.ts":
520 /*!*********************************************!*\
521 !*** ./scripts/iframe/messageMiddleware.ts ***!
522 \*********************************************/
523 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
524
525 "use strict";
526 __webpack_require__.r(__webpack_exports__);
527 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
528 /* harmony export */ "messageMiddleware": () => (/* binding */ messageMiddleware)
529 /* harmony export */ });
530 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
531 /* harmony import */ var _api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../api/wordpressApiClient */ "./scripts/api/wordpressApiClient.ts");
532 /* harmony import */ var _utils_queryParams__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/queryParams */ "./scripts/utils/queryParams.ts");
533 /* harmony import */ var _utils_contentEmbedInstaller__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/contentEmbedInstaller */ "./scripts/utils/contentEmbedInstaller.ts");
534
535
536
537
538 var messageMapper = new Map([[_iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.TrackConsent, function (message) {
539 (0,_api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_1__.trackConsent)(message.payload);
540 }], [_iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.InternalTrackingChangeRequest, function (message, embedder) {
541 (0,_api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_1__.disableInternalTracking)(message.payload).then(function () {
542 embedder.postMessage({
543 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.InternalTrackingFetchResponse,
544 payload: message.payload
545 });
546 })["catch"](function (payload) {
547 embedder.postMessage({
548 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.InternalTrackingChangeError,
549 payload: payload
550 });
551 });
552 }], [_iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.InternalTrackingFetchRequest, function (__message, embedder) {
553 (0,_api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_1__.fetchDisableInternalTracking)().then(function (_ref) {
554 var payload = _ref.message;
555 embedder.postMessage({
556 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.InternalTrackingFetchResponse,
557 payload: payload
558 });
559 })["catch"](function (payload) {
560 embedder.postMessage({
561 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.InternalTrackingFetchError,
562 payload: payload
563 });
564 });
565 }], [_iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.BusinessUnitFetchRequest, function (__message, embedder) {
566 (0,_api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_1__.getBusinessUnitId)().then(function (payload) {
567 embedder.postMessage({
568 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.BusinessUnitFetchResponse,
569 payload: payload
570 });
571 })["catch"](function (payload) {
572 embedder.postMessage({
573 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.BusinessUnitFetchError,
574 payload: payload
575 });
576 });
577 }], [_iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.BusinessUnitChangeRequest, function (message, embedder) {
578 (0,_api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_1__.setBusinessUnitId)(message.payload).then(function (payload) {
579 embedder.postMessage({
580 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.BusinessUnitFetchResponse,
581 payload: payload
582 });
583 })["catch"](function (payload) {
584 embedder.postMessage({
585 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.BusinessUnitChangeError,
586 payload: payload
587 });
588 });
589 }], [_iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.SkipReviewRequest, function (__message, embedder) {
590 (0,_api_wordpressApiClient__WEBPACK_IMPORTED_MODULE_1__.skipReview)().then(function (payload) {
591 embedder.postMessage({
592 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.SkipReviewResponse,
593 payload: payload
594 });
595 })["catch"](function (payload) {
596 embedder.postMessage({
597 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.SkipReviewError,
598 payload: payload
599 });
600 });
601 }], [_iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.RemoveParentQueryParam, function (message) {
602 (0,_utils_queryParams__WEBPACK_IMPORTED_MODULE_2__.removeQueryParamFromLocation)(message.payload);
603 }], [_iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.ContentEmbedInstallRequest, function (message, embedder) {
604 (0,_utils_contentEmbedInstaller__WEBPACK_IMPORTED_MODULE_3__.startInstall)(message.payload.nonce).then(function (payload) {
605 embedder.postMessage({
606 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.ContentEmbedInstallResponse,
607 payload: payload
608 });
609 })["catch"](function (payload) {
610 embedder.postMessage({
611 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.ContentEmbedInstallError,
612 payload: payload
613 });
614 });
615 }], [_iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.ContentEmbedActivationRequest, function (message, embedder) {
616 (0,_utils_contentEmbedInstaller__WEBPACK_IMPORTED_MODULE_3__.startActivation)(message.payload.activateAjaxUrl).then(function (payload) {
617 embedder.postMessage({
618 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.ContentEmbedActivationResponse,
619 payload: payload
620 });
621 })["catch"](function (payload) {
622 embedder.postMessage({
623 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_0__.PluginMessages.ContentEmbedActivationError,
624 payload: payload
625 });
626 });
627 }]]);
628 var messageMiddleware = function messageMiddleware(embedder) {
629 return function (message) {
630 var next = messageMapper.get(message.key);
631
632 if (next) {
633 next(message, embedder);
634 }
635 };
636 };
637
638 /***/ }),
639
640 /***/ "./scripts/iframe/renderIframeApp.tsx":
641 /*!********************************************!*\
642 !*** ./scripts/iframe/renderIframeApp.tsx ***!
643 \********************************************/
644 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
645
646 "use strict";
647 __webpack_require__.r(__webpack_exports__);
648 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
649 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
650 /* harmony export */ });
651 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
652 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
653 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
654 /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom */ "react-dom");
655 /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_2__);
656 /* harmony import */ var _constants_selectors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../constants/selectors */ "./scripts/constants/selectors.ts");
657 /* harmony import */ var _useAppEmbedder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./useAppEmbedder */ "./scripts/iframe/useAppEmbedder.ts");
658 /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./constants */ "./scripts/iframe/constants.ts");
659 /* harmony import */ var _IframeErrorPage__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./IframeErrorPage */ "./scripts/iframe/IframeErrorPage.tsx");
660
661
662
663
664
665
666
667
668 var IntegratedIframePortal = function IntegratedIframePortal(props) {
669 var container = document.getElementById(_constants_selectors__WEBPACK_IMPORTED_MODULE_3__.domElements.leadinIframeContainer);
670 var iframeNotRendered = (0,_useAppEmbedder__WEBPACK_IMPORTED_MODULE_4__["default"])(props.app, props.createRoute, container);
671
672 if (container && !iframeNotRendered) {
673 return /*#__PURE__*/react_dom__WEBPACK_IMPORTED_MODULE_2___default().createPortal(props.children, container);
674 }
675
676 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
677 children: (!container || iframeNotRendered) && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_IframeErrorPage__WEBPACK_IMPORTED_MODULE_6__.IframeErrorPage, {})
678 });
679 };
680
681 var renderIframeApp = function renderIframeApp() {
682 var iframeFallbackContainer = document.getElementById(_constants_selectors__WEBPACK_IMPORTED_MODULE_3__.domElements.leadinIframeContainer);
683 var app;
684 var queryParams = new URLSearchParams(location.search);
685 var page = queryParams.get('page');
686 var createRoute = queryParams.get('leadin_route[0]') === 'create';
687
688 switch (page) {
689 case 'leadin_forms':
690 app = _constants__WEBPACK_IMPORTED_MODULE_5__.App.Forms;
691 break;
692
693 case 'leadin_chatflows':
694 app = _constants__WEBPACK_IMPORTED_MODULE_5__.App.LiveChat;
695 break;
696
697 case 'leadin_settings':
698 app = _constants__WEBPACK_IMPORTED_MODULE_5__.App.PluginSettings;
699 break;
700
701 case 'leadin_user_guide':
702 default:
703 app = _constants__WEBPACK_IMPORTED_MODULE_5__.App.Plugin;
704 break;
705 }
706
707 react_dom__WEBPACK_IMPORTED_MODULE_2___default().render((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(IntegratedIframePortal, {
708 app: app,
709 createRoute: createRoute
710 }), iframeFallbackContainer);
711 };
712
713 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (renderIframeApp);
714
715 /***/ }),
716
717 /***/ "./scripts/iframe/useAppEmbedder.ts":
718 /*!******************************************!*\
719 !*** ./scripts/iframe/useAppEmbedder.ts ***!
720 \******************************************/
721 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
722
723 "use strict";
724 __webpack_require__.r(__webpack_exports__);
725 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
726 /* harmony export */ "default": () => (/* binding */ useAppEmbedder)
727 /* harmony export */ });
728 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
729 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
730 /* harmony import */ var _lib_Raven__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/Raven */ "./scripts/lib/Raven.ts");
731 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
732 /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ "./scripts/iframe/constants.ts");
733 /* harmony import */ var _messageMiddleware__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./messageMiddleware */ "./scripts/iframe/messageMiddleware.ts");
734 /* harmony import */ var _utils_iframe__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/iframe */ "./scripts/utils/iframe.ts");
735 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
736
737 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
738
739 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
740
741
742
743
744
745
746
747
748 var getLeadinConfig = function getLeadinConfig() {
749 var utm_query_params = Object.keys(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams).filter(function (x) {
750 return /^utm/.test(x);
751 }).reduce(function (p, c) {
752 return _objectSpread(_defineProperty({}, c, _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams[c]), p);
753 }, {});
754 return _objectSpread({
755 accountName: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.accountName,
756 admin: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.admin,
757 adminUrl: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.adminUrl,
758 company: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.company,
759 connectionStatus: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.connectionStatus,
760 deviceId: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.deviceId,
761 email: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.email,
762 firstName: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.firstName,
763 irclickid: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.irclickid,
764 justConnected: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.justConnected,
765 lastName: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.lastName,
766 lastAuthorizeTime: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.lastAuthorizeTime,
767 lastDeauthorizeTime: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.lastDeauthorizeTime,
768 lastDisconnectTime: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.lastDisconnectTime,
769 leadinPluginVersion: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinPluginVersion,
770 mpid: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.mpid,
771 nonce: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.nonce,
772 phpVersion: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.phpVersion,
773 plugins: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.plugins,
774 portalDomain: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalDomain,
775 portalEmail: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalEmail,
776 portalId: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId,
777 reviewSkippedDate: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.reviewSkippedDate,
778 theme: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.theme,
779 trackConsent: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.trackConsent,
780 websiteName: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.leadinQueryParams.websiteName,
781 wpVersion: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.wpVersion,
782 contentEmbed: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.contentEmbed,
783 requiresContentEmbedScope: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.requiresContentEmbedScope,
784 refreshTokenError: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.refreshTokenError
785 }, utm_query_params);
786 };
787
788 var getAppOptions = function getAppOptions(app) {
789 var createRoute = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
790 var _window = window,
791 IntegratedAppOptions = _window.IntegratedAppOptions,
792 FormsAppOptions = _window.FormsAppOptions,
793 LiveChatAppOptions = _window.LiveChatAppOptions,
794 PluginAppOptions = _window.PluginAppOptions;
795 var options;
796
797 switch (app) {
798 case _constants__WEBPACK_IMPORTED_MODULE_3__.App.Plugin:
799 options = new PluginAppOptions().setLeadinConfig(getLeadinConfig());
800 break;
801
802 case _constants__WEBPACK_IMPORTED_MODULE_3__.App.PluginSettings:
803 options = new PluginAppOptions().setLeadinConfig(getLeadinConfig()).setPluginSettingsInit();
804 break;
805
806 case _constants__WEBPACK_IMPORTED_MODULE_3__.App.Forms:
807 options = new FormsAppOptions();
808
809 if (createRoute) {
810 options = options.setCreateFormAppInit();
811 }
812
813 break;
814
815 case _constants__WEBPACK_IMPORTED_MODULE_3__.App.LiveChat:
816 options = new LiveChatAppOptions();
817
818 if (createRoute) {
819 options = options.setCreateLiveChatAppInit();
820 }
821
822 break;
823
824 default:
825 options = new IntegratedAppOptions();
826 }
827
828 return options;
829 };
830
831 function useAppEmbedder(app, createRoute, container) {
832 console.info('HubSpot plugin - starting app embedder for:', _constants__WEBPACK_IMPORTED_MODULE_3__.AppIframe[app], container);
833 var iframeNotRendered = (0,_utils_iframe__WEBPACK_IMPORTED_MODULE_5__.useIframeNotRendered)(_constants__WEBPACK_IMPORTED_MODULE_3__.AppIframe[app]);
834 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
835 var _window2 = window,
836 IntegratedAppEmbedder = _window2.IntegratedAppEmbedder;
837
838 if (IntegratedAppEmbedder) {
839 var options = getAppOptions(app, createRoute).setLocale(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.locale).setDeviceId(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.deviceId).setRefreshToken(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.refreshToken);
840 var embedder = new IntegratedAppEmbedder(_constants__WEBPACK_IMPORTED_MODULE_3__.AppIframe[app], _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId, _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.hubspotBaseUrl, _utils_iframe__WEBPACK_IMPORTED_MODULE_5__.resizeWindow, _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.refreshToken ? '' : _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.impactLink).setOptions(options);
841 embedder.subscribe((0,_messageMiddleware__WEBPACK_IMPORTED_MODULE_4__.messageMiddleware)(embedder));
842 embedder.attachTo(container, true);
843 embedder.postStartAppMessage(); // lets the app know all all data has been passed to it
844
845 window.embedder = embedder;
846 }
847 }, []);
848
849 if (iframeNotRendered) {
850 console.error('HubSpot plugin Iframe not rendered', {
851 portalId: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId,
852 container: container,
853 appName: _constants__WEBPACK_IMPORTED_MODULE_3__.AppIframe[app],
854 hasIntegratedAppEmbedder: !!window.IntegratedAppEmbedder
855 });
856 _lib_Raven__WEBPACK_IMPORTED_MODULE_1__["default"].captureException(new Error('Leadin Iframe not rendered'), {
857 fingerprint: ['USE_APP_EMBEDDER', 'IFRAME_SETUP_ERROR'],
858 extra: {
859 portalId: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId,
860 container: container,
861 app: app,
862 hubspotBaseUrl: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.hubspotBaseUrl,
863 impactLink: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.impactLink,
864 appName: _constants__WEBPACK_IMPORTED_MODULE_3__.AppIframe[app],
865 hasRefreshToken: !!_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.refreshToken
866 }
867 });
868 }
869
870 return iframeNotRendered;
871 }
872
873 /***/ }),
874
875 /***/ "./scripts/lib/Raven.ts":
876 /*!******************************!*\
877 !*** ./scripts/lib/Raven.ts ***!
878 \******************************/
879 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
880
881 "use strict";
882 __webpack_require__.r(__webpack_exports__);
883 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
884 /* harmony export */ "configureRaven": () => (/* binding */ configureRaven),
885 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
886 /* harmony export */ });
887 /* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! raven-js */ "./node_modules/raven-js/src/singleton.js");
888 /* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(raven_js__WEBPACK_IMPORTED_MODULE_0__);
889 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
890
891
892 function configureRaven() {
893 if (_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.hubspotBaseUrl.indexOf('app.hubspot.com') === -1) {
894 return;
895 }
896
897 raven_js__WEBPACK_IMPORTED_MODULE_0___default().config('https://e9b8f382cdd130c0d415cd977d2be56f@exceptions.hubspot.com/1', {
898 instrument: {
899 tryCatch: false
900 },
901 release: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.leadinPluginVersion
902 }).install();
903 raven_js__WEBPACK_IMPORTED_MODULE_0___default().setTagsContext({
904 v: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.leadinPluginVersion,
905 php: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.phpVersion,
906 wordpress: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.wpVersion
907 });
908 raven_js__WEBPACK_IMPORTED_MODULE_0___default().setExtraContext({
909 hub: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.portalId,
910 plugins: Object.keys(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.plugins).map(function (name) {
911 return "".concat(name, "#").concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.plugins[name]);
912 }).join(',')
913 });
914 }
915 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((raven_js__WEBPACK_IMPORTED_MODULE_0___default()));
916
917 /***/ }),
918
919 /***/ "./scripts/utils/appUtils.ts":
920 /*!***********************************!*\
921 !*** ./scripts/utils/appUtils.ts ***!
922 \***********************************/
923 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
924
925 "use strict";
926 __webpack_require__.r(__webpack_exports__);
927 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
928 /* harmony export */ "initApp": () => (/* binding */ initApp),
929 /* harmony export */ "initAppOnReady": () => (/* binding */ initAppOnReady)
930 /* harmony export */ });
931 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
932 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
933 /* harmony import */ var _lib_Raven__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/Raven */ "./scripts/lib/Raven.ts");
934
935
936 function initApp(initFn) {
937 (0,_lib_Raven__WEBPACK_IMPORTED_MODULE_1__.configureRaven)();
938 _lib_Raven__WEBPACK_IMPORTED_MODULE_1__["default"].context(initFn);
939 }
940 function initAppOnReady(initFn) {
941 function main() {
942 jquery__WEBPACK_IMPORTED_MODULE_0___default()(initFn);
943 }
944
945 initApp(main);
946 }
947
948 /***/ }),
949
950 /***/ "./scripts/utils/contentEmbedInstaller.ts":
951 /*!************************************************!*\
952 !*** ./scripts/utils/contentEmbedInstaller.ts ***!
953 \************************************************/
954 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
955
956 "use strict";
957 __webpack_require__.r(__webpack_exports__);
958 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
959 /* harmony export */ "startActivation": () => (/* binding */ startActivation),
960 /* harmony export */ "startInstall": () => (/* binding */ startInstall)
961 /* harmony export */ });
962 function startInstall(nonce) {
963 var formData = new FormData();
964 var ajaxUrl = window.ajaxurl;
965 formData.append('_wpnonce', nonce);
966 formData.append('action', 'content_embed_install');
967 return fetch(ajaxUrl, {
968 method: 'POST',
969 body: formData,
970 keepalive: true
971 }).then(function (res) {
972 return res.json();
973 });
974 }
975 function startActivation(requestUrl) {
976 return fetch(requestUrl, {
977 method: 'POST',
978 keepalive: true
979 }).then(function (res) {
980 return res.json();
981 });
982 }
983
984 /***/ }),
985
986 /***/ "./scripts/utils/iframe.ts":
987 /*!*********************************!*\
988 !*** ./scripts/utils/iframe.ts ***!
989 \*********************************/
990 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
991
992 "use strict";
993 __webpack_require__.r(__webpack_exports__);
994 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
995 /* harmony export */ "resizeWindow": () => (/* binding */ resizeWindow),
996 /* harmony export */ "useIframeNotRendered": () => (/* binding */ useIframeNotRendered)
997 /* harmony export */ });
998 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
999 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1000 function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
1001
1002 function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
1003
1004 function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
1005
1006 function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
1007
1008 function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
1009
1010 function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1011
1012
1013 var IFRAME_DISPLAY_TIMEOUT = 5000;
1014 function useIframeNotRendered(app) {
1015 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
1016 _useState2 = _slicedToArray(_useState, 2),
1017 iframeNotRendered = _useState2[0],
1018 setIframeNotRendered = _useState2[1];
1019
1020 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
1021 var timer = setTimeout(function () {
1022 var iframe = document.getElementById(app);
1023
1024 if (!iframe) {
1025 setIframeNotRendered(true);
1026 }
1027 }, IFRAME_DISPLAY_TIMEOUT);
1028 return function () {
1029 if (timer) {
1030 clearTimeout(timer);
1031 }
1032 };
1033 }, []);
1034 return iframeNotRendered;
1035 }
1036 var resizeWindow = function resizeWindow() {
1037 var adminMenuWrap = document.getElementById('adminmenuwrap');
1038 var sideMenuHeight = adminMenuWrap ? adminMenuWrap.offsetHeight : 0;
1039 var adminBar = document.getElementById('wpadminbar');
1040 var adminBarHeight = adminBar && adminBar.offsetHeight || 0;
1041 var offset = 4;
1042
1043 if (window.innerHeight < sideMenuHeight) {
1044 return sideMenuHeight - offset;
1045 } else {
1046 return window.innerHeight - adminBarHeight - offset;
1047 }
1048 };
1049
1050 /***/ }),
1051
1052 /***/ "./scripts/utils/queryParams.ts":
1053 /*!**************************************!*\
1054 !*** ./scripts/utils/queryParams.ts ***!
1055 \**************************************/
1056 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1057
1058 "use strict";
1059 __webpack_require__.r(__webpack_exports__);
1060 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1061 /* harmony export */ "addQueryObjectToUrl": () => (/* binding */ addQueryObjectToUrl),
1062 /* harmony export */ "removeQueryParamFromLocation": () => (/* binding */ removeQueryParamFromLocation)
1063 /* harmony export */ });
1064 function addQueryObjectToUrl(urlObject, queryParams) {
1065 Object.keys(queryParams).forEach(function (key) {
1066 urlObject.searchParams.append(key, queryParams[key]);
1067 });
1068 }
1069 function removeQueryParamFromLocation(key) {
1070 var location = new URL(window.location.href);
1071 location.searchParams["delete"](key);
1072 window.history.replaceState(null, '', location.href);
1073 }
1074
1075 /***/ }),
1076
1077 /***/ "./scripts/iframe/IframeErrorPage.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/iframe/IframeErrorPage.tsx":
1078 /*!*************************************************************************************************************************************************************************!*\
1079 !*** ./scripts/iframe/IframeErrorPage.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/iframe/IframeErrorPage.tsx ***!
1080 \*************************************************************************************************************************************************************************/
1081 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1082
1083 "use strict";
1084 __webpack_require__.r(__webpack_exports__);
1085 // extracted by mini-css-extract-plugin
1086
1087
1088 /***/ }),
1089
1090 /***/ "./node_modules/object-assign/index.js":
1091 /*!*********************************************!*\
1092 !*** ./node_modules/object-assign/index.js ***!
1093 \*********************************************/
1094 /***/ ((module) => {
1095
1096 "use strict";
1097 /*
1098 object-assign
1099 (c) Sindre Sorhus
1100 @license MIT
1101 */
1102
1103
1104 /* eslint-disable no-unused-vars */
1105 var getOwnPropertySymbols = Object.getOwnPropertySymbols;
1106 var hasOwnProperty = Object.prototype.hasOwnProperty;
1107 var propIsEnumerable = Object.prototype.propertyIsEnumerable;
1108
1109 function toObject(val) {
1110 if (val === null || val === undefined) {
1111 throw new TypeError('Object.assign cannot be called with null or undefined');
1112 }
1113
1114 return Object(val);
1115 }
1116
1117 function shouldUseNative() {
1118 try {
1119 if (!Object.assign) {
1120 return false;
1121 }
1122
1123 // Detect buggy property enumeration order in older V8 versions.
1124
1125 // https://bugs.chromium.org/p/v8/issues/detail?id=4118
1126 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
1127 test1[5] = 'de';
1128 if (Object.getOwnPropertyNames(test1)[0] === '5') {
1129 return false;
1130 }
1131
1132 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
1133 var test2 = {};
1134 for (var i = 0; i < 10; i++) {
1135 test2['_' + String.fromCharCode(i)] = i;
1136 }
1137 var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
1138 return test2[n];
1139 });
1140 if (order2.join('') !== '0123456789') {
1141 return false;
1142 }
1143
1144 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
1145 var test3 = {};
1146 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
1147 test3[letter] = letter;
1148 });
1149 if (Object.keys(Object.assign({}, test3)).join('') !==
1150 'abcdefghijklmnopqrst') {
1151 return false;
1152 }
1153
1154 return true;
1155 } catch (err) {
1156 // We don't expect any of the above to throw, but better to be safe.
1157 return false;
1158 }
1159 }
1160
1161 module.exports = shouldUseNative() ? Object.assign : function (target, source) {
1162 var from;
1163 var to = toObject(target);
1164 var symbols;
1165
1166 for (var s = 1; s < arguments.length; s++) {
1167 from = Object(arguments[s]);
1168
1169 for (var key in from) {
1170 if (hasOwnProperty.call(from, key)) {
1171 to[key] = from[key];
1172 }
1173 }
1174
1175 if (getOwnPropertySymbols) {
1176 symbols = getOwnPropertySymbols(from);
1177 for (var i = 0; i < symbols.length; i++) {
1178 if (propIsEnumerable.call(from, symbols[i])) {
1179 to[symbols[i]] = from[symbols[i]];
1180 }
1181 }
1182 }
1183 }
1184
1185 return to;
1186 };
1187
1188
1189 /***/ }),
1190
1191 /***/ "./node_modules/raven-js/src/configError.js":
1192 /*!**************************************************!*\
1193 !*** ./node_modules/raven-js/src/configError.js ***!
1194 \**************************************************/
1195 /***/ ((module) => {
1196
1197 function RavenConfigError(message) {
1198 this.name = 'RavenConfigError';
1199 this.message = message;
1200 }
1201 RavenConfigError.prototype = new Error();
1202 RavenConfigError.prototype.constructor = RavenConfigError;
1203
1204 module.exports = RavenConfigError;
1205
1206
1207 /***/ }),
1208
1209 /***/ "./node_modules/raven-js/src/console.js":
1210 /*!**********************************************!*\
1211 !*** ./node_modules/raven-js/src/console.js ***!
1212 \**********************************************/
1213 /***/ ((module) => {
1214
1215 var wrapMethod = function(console, level, callback) {
1216 var originalConsoleLevel = console[level];
1217 var originalConsole = console;
1218
1219 if (!(level in console)) {
1220 return;
1221 }
1222
1223 var sentryLevel = level === 'warn' ? 'warning' : level;
1224
1225 console[level] = function() {
1226 var args = [].slice.call(arguments);
1227
1228 var msg = '' + args.join(' ');
1229 var data = {level: sentryLevel, logger: 'console', extra: {arguments: args}};
1230
1231 if (level === 'assert') {
1232 if (args[0] === false) {
1233 // Default browsers message
1234 msg = 'Assertion failed: ' + (args.slice(1).join(' ') || 'console.assert');
1235 data.extra.arguments = args.slice(1);
1236 callback && callback(msg, data);
1237 }
1238 } else {
1239 callback && callback(msg, data);
1240 }
1241
1242 // this fails for some browsers. :(
1243 if (originalConsoleLevel) {
1244 // IE9 doesn't allow calling apply on console functions directly
1245 // See: https://stackoverflow.com/questions/5472938/does-ie9-support-console-log-and-is-it-a-real-function#answer-5473193
1246 Function.prototype.apply.call(originalConsoleLevel, originalConsole, args);
1247 }
1248 };
1249 };
1250
1251 module.exports = {
1252 wrapMethod: wrapMethod
1253 };
1254
1255
1256 /***/ }),
1257
1258 /***/ "./node_modules/raven-js/src/raven.js":
1259 /*!********************************************!*\
1260 !*** ./node_modules/raven-js/src/raven.js ***!
1261 \********************************************/
1262 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1263
1264 /*global XDomainRequest:false */
1265
1266 var TraceKit = __webpack_require__(/*! ../vendor/TraceKit/tracekit */ "./node_modules/raven-js/vendor/TraceKit/tracekit.js");
1267 var stringify = __webpack_require__(/*! ../vendor/json-stringify-safe/stringify */ "./node_modules/raven-js/vendor/json-stringify-safe/stringify.js");
1268 var RavenConfigError = __webpack_require__(/*! ./configError */ "./node_modules/raven-js/src/configError.js");
1269
1270 var utils = __webpack_require__(/*! ./utils */ "./node_modules/raven-js/src/utils.js");
1271 var isError = utils.isError;
1272 var isObject = utils.isObject;
1273 var isObject = utils.isObject;
1274 var isErrorEvent = utils.isErrorEvent;
1275 var isUndefined = utils.isUndefined;
1276 var isFunction = utils.isFunction;
1277 var isString = utils.isString;
1278 var isEmptyObject = utils.isEmptyObject;
1279 var each = utils.each;
1280 var objectMerge = utils.objectMerge;
1281 var truncate = utils.truncate;
1282 var objectFrozen = utils.objectFrozen;
1283 var hasKey = utils.hasKey;
1284 var joinRegExp = utils.joinRegExp;
1285 var urlencode = utils.urlencode;
1286 var uuid4 = utils.uuid4;
1287 var htmlTreeAsString = utils.htmlTreeAsString;
1288 var isSameException = utils.isSameException;
1289 var isSameStacktrace = utils.isSameStacktrace;
1290 var parseUrl = utils.parseUrl;
1291 var fill = utils.fill;
1292
1293 var wrapConsoleMethod = (__webpack_require__(/*! ./console */ "./node_modules/raven-js/src/console.js").wrapMethod);
1294
1295 var dsnKeys = 'source protocol user pass host port path'.split(' '),
1296 dsnPattern = /^(?:(\w+):)?\/\/(?:(\w+)(:\w+)?@)?([\w\.-]+)(?::(\d+))?(\/.*)/;
1297
1298 function now() {
1299 return +new Date();
1300 }
1301
1302 // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785)
1303 var _window =
1304 typeof window !== 'undefined'
1305 ? window
1306 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
1307 var _document = _window.document;
1308 var _navigator = _window.navigator;
1309
1310 function keepOriginalCallback(original, callback) {
1311 return isFunction(callback)
1312 ? function(data) {
1313 return callback(data, original);
1314 }
1315 : callback;
1316 }
1317
1318 // First, check for JSON support
1319 // If there is no JSON, we no-op the core features of Raven
1320 // since JSON is required to encode the payload
1321 function Raven() {
1322 this._hasJSON = !!(typeof JSON === 'object' && JSON.stringify);
1323 // Raven can run in contexts where there's no document (react-native)
1324 this._hasDocument = !isUndefined(_document);
1325 this._hasNavigator = !isUndefined(_navigator);
1326 this._lastCapturedException = null;
1327 this._lastData = null;
1328 this._lastEventId = null;
1329 this._globalServer = null;
1330 this._globalKey = null;
1331 this._globalProject = null;
1332 this._globalContext = {};
1333 this._globalOptions = {
1334 logger: 'javascript',
1335 ignoreErrors: [],
1336 ignoreUrls: [],
1337 whitelistUrls: [],
1338 includePaths: [],
1339 collectWindowErrors: true,
1340 maxMessageLength: 0,
1341
1342 // By default, truncates URL values to 250 chars
1343 maxUrlLength: 250,
1344 stackTraceLimit: 50,
1345 autoBreadcrumbs: true,
1346 instrument: true,
1347 sampleRate: 1
1348 };
1349 this._ignoreOnError = 0;
1350 this._isRavenInstalled = false;
1351 this._originalErrorStackTraceLimit = Error.stackTraceLimit;
1352 // capture references to window.console *and* all its methods first
1353 // before the console plugin has a chance to monkey patch
1354 this._originalConsole = _window.console || {};
1355 this._originalConsoleMethods = {};
1356 this._plugins = [];
1357 this._startTime = now();
1358 this._wrappedBuiltIns = [];
1359 this._breadcrumbs = [];
1360 this._lastCapturedEvent = null;
1361 this._keypressTimeout;
1362 this._location = _window.location;
1363 this._lastHref = this._location && this._location.href;
1364 this._resetBackoff();
1365
1366 // eslint-disable-next-line guard-for-in
1367 for (var method in this._originalConsole) {
1368 this._originalConsoleMethods[method] = this._originalConsole[method];
1369 }
1370 }
1371
1372 /*
1373 * The core Raven singleton
1374 *
1375 * @this {Raven}
1376 */
1377
1378 Raven.prototype = {
1379 // Hardcode version string so that raven source can be loaded directly via
1380 // webpack (using a build step causes webpack #1617). Grunt verifies that
1381 // this value matches package.json during build.
1382 // See: https://github.com/getsentry/raven-js/issues/465
1383 VERSION: '3.19.1',
1384
1385 debug: false,
1386
1387 TraceKit: TraceKit, // alias to TraceKit
1388
1389 /*
1390 * Configure Raven with a DSN and extra options
1391 *
1392 * @param {string} dsn The public Sentry DSN
1393 * @param {object} options Set of global options [optional]
1394 * @return {Raven}
1395 */
1396 config: function(dsn, options) {
1397 var self = this;
1398
1399 if (self._globalServer) {
1400 this._logDebug('error', 'Error: Raven has already been configured');
1401 return self;
1402 }
1403 if (!dsn) return self;
1404
1405 var globalOptions = self._globalOptions;
1406
1407 // merge in options
1408 if (options) {
1409 each(options, function(key, value) {
1410 // tags and extra are special and need to be put into context
1411 if (key === 'tags' || key === 'extra' || key === 'user') {
1412 self._globalContext[key] = value;
1413 } else {
1414 globalOptions[key] = value;
1415 }
1416 });
1417 }
1418
1419 self.setDSN(dsn);
1420
1421 // "Script error." is hard coded into browsers for errors that it can't read.
1422 // this is the result of a script being pulled in from an external domain and CORS.
1423 globalOptions.ignoreErrors.push(/^Script error\.?$/);
1424 globalOptions.ignoreErrors.push(/^Javascript error: Script error\.? on line 0$/);
1425
1426 // join regexp rules into one big rule
1427 globalOptions.ignoreErrors = joinRegExp(globalOptions.ignoreErrors);
1428 globalOptions.ignoreUrls = globalOptions.ignoreUrls.length
1429 ? joinRegExp(globalOptions.ignoreUrls)
1430 : false;
1431 globalOptions.whitelistUrls = globalOptions.whitelistUrls.length
1432 ? joinRegExp(globalOptions.whitelistUrls)
1433 : false;
1434 globalOptions.includePaths = joinRegExp(globalOptions.includePaths);
1435 globalOptions.maxBreadcrumbs = Math.max(
1436 0,
1437 Math.min(globalOptions.maxBreadcrumbs || 100, 100)
1438 ); // default and hard limit is 100
1439
1440 var autoBreadcrumbDefaults = {
1441 xhr: true,
1442 console: true,
1443 dom: true,
1444 location: true
1445 };
1446
1447 var autoBreadcrumbs = globalOptions.autoBreadcrumbs;
1448 if ({}.toString.call(autoBreadcrumbs) === '[object Object]') {
1449 autoBreadcrumbs = objectMerge(autoBreadcrumbDefaults, autoBreadcrumbs);
1450 } else if (autoBreadcrumbs !== false) {
1451 autoBreadcrumbs = autoBreadcrumbDefaults;
1452 }
1453 globalOptions.autoBreadcrumbs = autoBreadcrumbs;
1454
1455 var instrumentDefaults = {
1456 tryCatch: true
1457 };
1458
1459 var instrument = globalOptions.instrument;
1460 if ({}.toString.call(instrument) === '[object Object]') {
1461 instrument = objectMerge(instrumentDefaults, instrument);
1462 } else if (instrument !== false) {
1463 instrument = instrumentDefaults;
1464 }
1465 globalOptions.instrument = instrument;
1466
1467 TraceKit.collectWindowErrors = !!globalOptions.collectWindowErrors;
1468
1469 // return for chaining
1470 return self;
1471 },
1472
1473 /*
1474 * Installs a global window.onerror error handler
1475 * to capture and report uncaught exceptions.
1476 * At this point, install() is required to be called due
1477 * to the way TraceKit is set up.
1478 *
1479 * @return {Raven}
1480 */
1481 install: function() {
1482 var self = this;
1483 if (self.isSetup() && !self._isRavenInstalled) {
1484 TraceKit.report.subscribe(function() {
1485 self._handleOnErrorStackInfo.apply(self, arguments);
1486 });
1487 if (self._globalOptions.instrument && self._globalOptions.instrument.tryCatch) {
1488 self._instrumentTryCatch();
1489 }
1490
1491 if (self._globalOptions.autoBreadcrumbs) self._instrumentBreadcrumbs();
1492
1493 // Install all of the plugins
1494 self._drainPlugins();
1495
1496 self._isRavenInstalled = true;
1497 }
1498
1499 Error.stackTraceLimit = self._globalOptions.stackTraceLimit;
1500 return this;
1501 },
1502
1503 /*
1504 * Set the DSN (can be called multiple time unlike config)
1505 *
1506 * @param {string} dsn The public Sentry DSN
1507 */
1508 setDSN: function(dsn) {
1509 var self = this,
1510 uri = self._parseDSN(dsn),
1511 lastSlash = uri.path.lastIndexOf('/'),
1512 path = uri.path.substr(1, lastSlash);
1513
1514 self._dsn = dsn;
1515 self._globalKey = uri.user;
1516 self._globalSecret = uri.pass && uri.pass.substr(1);
1517 self._globalProject = uri.path.substr(lastSlash + 1);
1518
1519 self._globalServer = self._getGlobalServer(uri);
1520
1521 self._globalEndpoint =
1522 self._globalServer + '/' + path + 'api/' + self._globalProject + '/store/';
1523
1524 // Reset backoff state since we may be pointing at a
1525 // new project/server
1526 this._resetBackoff();
1527 },
1528
1529 /*
1530 * Wrap code within a context so Raven can capture errors
1531 * reliably across domains that is executed immediately.
1532 *
1533 * @param {object} options A specific set of options for this context [optional]
1534 * @param {function} func The callback to be immediately executed within the context
1535 * @param {array} args An array of arguments to be called with the callback [optional]
1536 */
1537 context: function(options, func, args) {
1538 if (isFunction(options)) {
1539 args = func || [];
1540 func = options;
1541 options = undefined;
1542 }
1543
1544 return this.wrap(options, func).apply(this, args);
1545 },
1546
1547 /*
1548 * Wrap code within a context and returns back a new function to be executed
1549 *
1550 * @param {object} options A specific set of options for this context [optional]
1551 * @param {function} func The function to be wrapped in a new context
1552 * @param {function} func A function to call before the try/catch wrapper [optional, private]
1553 * @return {function} The newly wrapped functions with a context
1554 */
1555 wrap: function(options, func, _before) {
1556 var self = this;
1557 // 1 argument has been passed, and it's not a function
1558 // so just return it
1559 if (isUndefined(func) && !isFunction(options)) {
1560 return options;
1561 }
1562
1563 // options is optional
1564 if (isFunction(options)) {
1565 func = options;
1566 options = undefined;
1567 }
1568
1569 // At this point, we've passed along 2 arguments, and the second one
1570 // is not a function either, so we'll just return the second argument.
1571 if (!isFunction(func)) {
1572 return func;
1573 }
1574
1575 // We don't wanna wrap it twice!
1576 try {
1577 if (func.__raven__) {
1578 return func;
1579 }
1580
1581 // If this has already been wrapped in the past, return that
1582 if (func.__raven_wrapper__) {
1583 return func.__raven_wrapper__;
1584 }
1585 } catch (e) {
1586 // Just accessing custom props in some Selenium environments
1587 // can cause a "Permission denied" exception (see raven-js#495).
1588 // Bail on wrapping and return the function as-is (defers to window.onerror).
1589 return func;
1590 }
1591
1592 function wrapped() {
1593 var args = [],
1594 i = arguments.length,
1595 deep = !options || (options && options.deep !== false);
1596
1597 if (_before && isFunction(_before)) {
1598 _before.apply(this, arguments);
1599 }
1600
1601 // Recursively wrap all of a function's arguments that are
1602 // functions themselves.
1603 while (i--) args[i] = deep ? self.wrap(options, arguments[i]) : arguments[i];
1604
1605 try {
1606 // Attempt to invoke user-land function
1607 // NOTE: If you are a Sentry user, and you are seeing this stack frame, it
1608 // means Raven caught an error invoking your application code. This is
1609 // expected behavior and NOT indicative of a bug with Raven.js.
1610 return func.apply(this, args);
1611 } catch (e) {
1612 self._ignoreNextOnError();
1613 self.captureException(e, options);
1614 throw e;
1615 }
1616 }
1617
1618 // copy over properties of the old function
1619 for (var property in func) {
1620 if (hasKey(func, property)) {
1621 wrapped[property] = func[property];
1622 }
1623 }
1624 wrapped.prototype = func.prototype;
1625
1626 func.__raven_wrapper__ = wrapped;
1627 // Signal that this function has been wrapped already
1628 // for both debugging and to prevent it to being wrapped twice
1629 wrapped.__raven__ = true;
1630 wrapped.__inner__ = func;
1631
1632 return wrapped;
1633 },
1634
1635 /*
1636 * Uninstalls the global error handler.
1637 *
1638 * @return {Raven}
1639 */
1640 uninstall: function() {
1641 TraceKit.report.uninstall();
1642
1643 this._restoreBuiltIns();
1644
1645 Error.stackTraceLimit = this._originalErrorStackTraceLimit;
1646 this._isRavenInstalled = false;
1647
1648 return this;
1649 },
1650
1651 /*
1652 * Manually capture an exception and send it over to Sentry
1653 *
1654 * @param {error} ex An exception to be logged
1655 * @param {object} options A specific set of options for this error [optional]
1656 * @return {Raven}
1657 */
1658 captureException: function(ex, options) {
1659 // Cases for sending ex as a message, rather than an exception
1660 var isNotError = !isError(ex);
1661 var isNotErrorEvent = !isErrorEvent(ex);
1662 var isErrorEventWithoutError = isErrorEvent(ex) && !ex.error;
1663
1664 if ((isNotError && isNotErrorEvent) || isErrorEventWithoutError) {
1665 return this.captureMessage(
1666 ex,
1667 objectMerge(
1668 {
1669 trimHeadFrames: 1,
1670 stacktrace: true // if we fall back to captureMessage, default to attempting a new trace
1671 },
1672 options
1673 )
1674 );
1675 }
1676
1677 // Get actual Error from ErrorEvent
1678 if (isErrorEvent(ex)) ex = ex.error;
1679
1680 // Store the raw exception object for potential debugging and introspection
1681 this._lastCapturedException = ex;
1682
1683 // TraceKit.report will re-raise any exception passed to it,
1684 // which means you have to wrap it in try/catch. Instead, we
1685 // can wrap it here and only re-raise if TraceKit.report
1686 // raises an exception different from the one we asked to
1687 // report on.
1688 try {
1689 var stack = TraceKit.computeStackTrace(ex);
1690 this._handleStackInfo(stack, options);
1691 } catch (ex1) {
1692 if (ex !== ex1) {
1693 throw ex1;
1694 }
1695 }
1696
1697 return this;
1698 },
1699
1700 /*
1701 * Manually send a message to Sentry
1702 *
1703 * @param {string} msg A plain message to be captured in Sentry
1704 * @param {object} options A specific set of options for this message [optional]
1705 * @return {Raven}
1706 */
1707 captureMessage: function(msg, options) {
1708 // config() automagically converts ignoreErrors from a list to a RegExp so we need to test for an
1709 // early call; we'll error on the side of logging anything called before configuration since it's
1710 // probably something you should see:
1711 if (
1712 !!this._globalOptions.ignoreErrors.test &&
1713 this._globalOptions.ignoreErrors.test(msg)
1714 ) {
1715 return;
1716 }
1717
1718 options = options || {};
1719
1720 var data = objectMerge(
1721 {
1722 message: msg + '' // Make sure it's actually a string
1723 },
1724 options
1725 );
1726
1727 var ex;
1728 // Generate a "synthetic" stack trace from this point.
1729 // NOTE: If you are a Sentry user, and you are seeing this stack frame, it is NOT indicative
1730 // of a bug with Raven.js. Sentry generates synthetic traces either by configuration,
1731 // or if it catches a thrown object without a "stack" property.
1732 try {
1733 throw new Error(msg);
1734 } catch (ex1) {
1735 ex = ex1;
1736 }
1737
1738 // null exception name so `Error` isn't prefixed to msg
1739 ex.name = null;
1740 var stack = TraceKit.computeStackTrace(ex);
1741
1742 // stack[0] is `throw new Error(msg)` call itself, we are interested in the frame that was just before that, stack[1]
1743 var initialCall = stack.stack[1];
1744
1745 var fileurl = (initialCall && initialCall.url) || '';
1746
1747 if (
1748 !!this._globalOptions.ignoreUrls.test &&
1749 this._globalOptions.ignoreUrls.test(fileurl)
1750 ) {
1751 return;
1752 }
1753
1754 if (
1755 !!this._globalOptions.whitelistUrls.test &&
1756 !this._globalOptions.whitelistUrls.test(fileurl)
1757 ) {
1758 return;
1759 }
1760
1761 if (this._globalOptions.stacktrace || (options && options.stacktrace)) {
1762 options = objectMerge(
1763 {
1764 // fingerprint on msg, not stack trace (legacy behavior, could be
1765 // revisited)
1766 fingerprint: msg,
1767 // since we know this is a synthetic trace, the top N-most frames
1768 // MUST be from Raven.js, so mark them as in_app later by setting
1769 // trimHeadFrames
1770 trimHeadFrames: (options.trimHeadFrames || 0) + 1
1771 },
1772 options
1773 );
1774
1775 var frames = this._prepareFrames(stack, options);
1776 data.stacktrace = {
1777 // Sentry expects frames oldest to newest
1778 frames: frames.reverse()
1779 };
1780 }
1781
1782 // Fire away!
1783 this._send(data);
1784
1785 return this;
1786 },
1787
1788 captureBreadcrumb: function(obj) {
1789 var crumb = objectMerge(
1790 {
1791 timestamp: now() / 1000
1792 },
1793 obj
1794 );
1795
1796 if (isFunction(this._globalOptions.breadcrumbCallback)) {
1797 var result = this._globalOptions.breadcrumbCallback(crumb);
1798
1799 if (isObject(result) && !isEmptyObject(result)) {
1800 crumb = result;
1801 } else if (result === false) {
1802 return this;
1803 }
1804 }
1805
1806 this._breadcrumbs.push(crumb);
1807 if (this._breadcrumbs.length > this._globalOptions.maxBreadcrumbs) {
1808 this._breadcrumbs.shift();
1809 }
1810 return this;
1811 },
1812
1813 addPlugin: function(plugin /*arg1, arg2, ... argN*/) {
1814 var pluginArgs = [].slice.call(arguments, 1);
1815
1816 this._plugins.push([plugin, pluginArgs]);
1817 if (this._isRavenInstalled) {
1818 this._drainPlugins();
1819 }
1820
1821 return this;
1822 },
1823
1824 /*
1825 * Set/clear a user to be sent along with the payload.
1826 *
1827 * @param {object} user An object representing user data [optional]
1828 * @return {Raven}
1829 */
1830 setUserContext: function(user) {
1831 // Intentionally do not merge here since that's an unexpected behavior.
1832 this._globalContext.user = user;
1833
1834 return this;
1835 },
1836
1837 /*
1838 * Merge extra attributes to be sent along with the payload.
1839 *
1840 * @param {object} extra An object representing extra data [optional]
1841 * @return {Raven}
1842 */
1843 setExtraContext: function(extra) {
1844 this._mergeContext('extra', extra);
1845
1846 return this;
1847 },
1848
1849 /*
1850 * Merge tags to be sent along with the payload.
1851 *
1852 * @param {object} tags An object representing tags [optional]
1853 * @return {Raven}
1854 */
1855 setTagsContext: function(tags) {
1856 this._mergeContext('tags', tags);
1857
1858 return this;
1859 },
1860
1861 /*
1862 * Clear all of the context.
1863 *
1864 * @return {Raven}
1865 */
1866 clearContext: function() {
1867 this._globalContext = {};
1868
1869 return this;
1870 },
1871
1872 /*
1873 * Get a copy of the current context. This cannot be mutated.
1874 *
1875 * @return {object} copy of context
1876 */
1877 getContext: function() {
1878 // lol javascript
1879 return JSON.parse(stringify(this._globalContext));
1880 },
1881
1882 /*
1883 * Set environment of application
1884 *
1885 * @param {string} environment Typically something like 'production'.
1886 * @return {Raven}
1887 */
1888 setEnvironment: function(environment) {
1889 this._globalOptions.environment = environment;
1890
1891 return this;
1892 },
1893
1894 /*
1895 * Set release version of application
1896 *
1897 * @param {string} release Typically something like a git SHA to identify version
1898 * @return {Raven}
1899 */
1900 setRelease: function(release) {
1901 this._globalOptions.release = release;
1902
1903 return this;
1904 },
1905
1906 /*
1907 * Set the dataCallback option
1908 *
1909 * @param {function} callback The callback to run which allows the
1910 * data blob to be mutated before sending
1911 * @return {Raven}
1912 */
1913 setDataCallback: function(callback) {
1914 var original = this._globalOptions.dataCallback;
1915 this._globalOptions.dataCallback = keepOriginalCallback(original, callback);
1916 return this;
1917 },
1918
1919 /*
1920 * Set the breadcrumbCallback option
1921 *
1922 * @param {function} callback The callback to run which allows filtering
1923 * or mutating breadcrumbs
1924 * @return {Raven}
1925 */
1926 setBreadcrumbCallback: function(callback) {
1927 var original = this._globalOptions.breadcrumbCallback;
1928 this._globalOptions.breadcrumbCallback = keepOriginalCallback(original, callback);
1929 return this;
1930 },
1931
1932 /*
1933 * Set the shouldSendCallback option
1934 *
1935 * @param {function} callback The callback to run which allows
1936 * introspecting the blob before sending
1937 * @return {Raven}
1938 */
1939 setShouldSendCallback: function(callback) {
1940 var original = this._globalOptions.shouldSendCallback;
1941 this._globalOptions.shouldSendCallback = keepOriginalCallback(original, callback);
1942 return this;
1943 },
1944
1945 /**
1946 * Override the default HTTP transport mechanism that transmits data
1947 * to the Sentry server.
1948 *
1949 * @param {function} transport Function invoked instead of the default
1950 * `makeRequest` handler.
1951 *
1952 * @return {Raven}
1953 */
1954 setTransport: function(transport) {
1955 this._globalOptions.transport = transport;
1956
1957 return this;
1958 },
1959
1960 /*
1961 * Get the latest raw exception that was captured by Raven.
1962 *
1963 * @return {error}
1964 */
1965 lastException: function() {
1966 return this._lastCapturedException;
1967 },
1968
1969 /*
1970 * Get the last event id
1971 *
1972 * @return {string}
1973 */
1974 lastEventId: function() {
1975 return this._lastEventId;
1976 },
1977
1978 /*
1979 * Determine if Raven is setup and ready to go.
1980 *
1981 * @return {boolean}
1982 */
1983 isSetup: function() {
1984 if (!this._hasJSON) return false; // needs JSON support
1985 if (!this._globalServer) {
1986 if (!this.ravenNotConfiguredError) {
1987 this.ravenNotConfiguredError = true;
1988 this._logDebug('error', 'Error: Raven has not been configured.');
1989 }
1990 return false;
1991 }
1992 return true;
1993 },
1994
1995 afterLoad: function() {
1996 // TODO: remove window dependence?
1997
1998 // Attempt to initialize Raven on load
1999 var RavenConfig = _window.RavenConfig;
2000 if (RavenConfig) {
2001 this.config(RavenConfig.dsn, RavenConfig.config).install();
2002 }
2003 },
2004
2005 showReportDialog: function(options) {
2006 if (
2007 !_document // doesn't work without a document (React native)
2008 )
2009 return;
2010
2011 options = options || {};
2012
2013 var lastEventId = options.eventId || this.lastEventId();
2014 if (!lastEventId) {
2015 throw new RavenConfigError('Missing eventId');
2016 }
2017
2018 var dsn = options.dsn || this._dsn;
2019 if (!dsn) {
2020 throw new RavenConfigError('Missing DSN');
2021 }
2022
2023 var encode = encodeURIComponent;
2024 var qs = '';
2025 qs += '?eventId=' + encode(lastEventId);
2026 qs += '&dsn=' + encode(dsn);
2027
2028 var user = options.user || this._globalContext.user;
2029 if (user) {
2030 if (user.name) qs += '&name=' + encode(user.name);
2031 if (user.email) qs += '&email=' + encode(user.email);
2032 }
2033
2034 var globalServer = this._getGlobalServer(this._parseDSN(dsn));
2035
2036 var script = _document.createElement('script');
2037 script.async = true;
2038 script.src = globalServer + '/api/embed/error-page/' + qs;
2039 (_document.head || _document.body).appendChild(script);
2040 },
2041
2042 /**** Private functions ****/
2043 _ignoreNextOnError: function() {
2044 var self = this;
2045 this._ignoreOnError += 1;
2046 setTimeout(function() {
2047 // onerror should trigger before setTimeout
2048 self._ignoreOnError -= 1;
2049 });
2050 },
2051
2052 _triggerEvent: function(eventType, options) {
2053 // NOTE: `event` is a native browser thing, so let's avoid conflicting wiht it
2054 var evt, key;
2055
2056 if (!this._hasDocument) return;
2057
2058 options = options || {};
2059
2060 eventType = 'raven' + eventType.substr(0, 1).toUpperCase() + eventType.substr(1);
2061
2062 if (_document.createEvent) {
2063 evt = _document.createEvent('HTMLEvents');
2064 evt.initEvent(eventType, true, true);
2065 } else {
2066 evt = _document.createEventObject();
2067 evt.eventType = eventType;
2068 }
2069
2070 for (key in options)
2071 if (hasKey(options, key)) {
2072 evt[key] = options[key];
2073 }
2074
2075 if (_document.createEvent) {
2076 // IE9 if standards
2077 _document.dispatchEvent(evt);
2078 } else {
2079 // IE8 regardless of Quirks or Standards
2080 // IE9 if quirks
2081 try {
2082 _document.fireEvent('on' + evt.eventType.toLowerCase(), evt);
2083 } catch (e) {
2084 // Do nothing
2085 }
2086 }
2087 },
2088
2089 /**
2090 * Wraps addEventListener to capture UI breadcrumbs
2091 * @param evtName the event name (e.g. "click")
2092 * @returns {Function}
2093 * @private
2094 */
2095 _breadcrumbEventHandler: function(evtName) {
2096 var self = this;
2097 return function(evt) {
2098 // reset keypress timeout; e.g. triggering a 'click' after
2099 // a 'keypress' will reset the keypress debounce so that a new
2100 // set of keypresses can be recorded
2101 self._keypressTimeout = null;
2102
2103 // It's possible this handler might trigger multiple times for the same
2104 // event (e.g. event propagation through node ancestors). Ignore if we've
2105 // already captured the event.
2106 if (self._lastCapturedEvent === evt) return;
2107
2108 self._lastCapturedEvent = evt;
2109
2110 // try/catch both:
2111 // - accessing evt.target (see getsentry/raven-js#838, #768)
2112 // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly
2113 // can throw an exception in some circumstances.
2114 var target;
2115 try {
2116 target = htmlTreeAsString(evt.target);
2117 } catch (e) {
2118 target = '<unknown>';
2119 }
2120
2121 self.captureBreadcrumb({
2122 category: 'ui.' + evtName, // e.g. ui.click, ui.input
2123 message: target
2124 });
2125 };
2126 },
2127
2128 /**
2129 * Wraps addEventListener to capture keypress UI events
2130 * @returns {Function}
2131 * @private
2132 */
2133 _keypressEventHandler: function() {
2134 var self = this,
2135 debounceDuration = 1000; // milliseconds
2136
2137 // TODO: if somehow user switches keypress target before
2138 // debounce timeout is triggered, we will only capture
2139 // a single breadcrumb from the FIRST target (acceptable?)
2140 return function(evt) {
2141 var target;
2142 try {
2143 target = evt.target;
2144 } catch (e) {
2145 // just accessing event properties can throw an exception in some rare circumstances
2146 // see: https://github.com/getsentry/raven-js/issues/838
2147 return;
2148 }
2149 var tagName = target && target.tagName;
2150
2151 // only consider keypress events on actual input elements
2152 // this will disregard keypresses targeting body (e.g. tabbing
2153 // through elements, hotkeys, etc)
2154 if (
2155 !tagName ||
2156 (tagName !== 'INPUT' && tagName !== 'TEXTAREA' && !target.isContentEditable)
2157 )
2158 return;
2159
2160 // record first keypress in a series, but ignore subsequent
2161 // keypresses until debounce clears
2162 var timeout = self._keypressTimeout;
2163 if (!timeout) {
2164 self._breadcrumbEventHandler('input')(evt);
2165 }
2166 clearTimeout(timeout);
2167 self._keypressTimeout = setTimeout(function() {
2168 self._keypressTimeout = null;
2169 }, debounceDuration);
2170 };
2171 },
2172
2173 /**
2174 * Captures a breadcrumb of type "navigation", normalizing input URLs
2175 * @param to the originating URL
2176 * @param from the target URL
2177 * @private
2178 */
2179 _captureUrlChange: function(from, to) {
2180 var parsedLoc = parseUrl(this._location.href);
2181 var parsedTo = parseUrl(to);
2182 var parsedFrom = parseUrl(from);
2183
2184 // because onpopstate only tells you the "new" (to) value of location.href, and
2185 // not the previous (from) value, we need to track the value of the current URL
2186 // state ourselves
2187 this._lastHref = to;
2188
2189 // Use only the path component of the URL if the URL matches the current
2190 // document (almost all the time when using pushState)
2191 if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host)
2192 to = parsedTo.relative;
2193 if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host)
2194 from = parsedFrom.relative;
2195
2196 this.captureBreadcrumb({
2197 category: 'navigation',
2198 data: {
2199 to: to,
2200 from: from
2201 }
2202 });
2203 },
2204
2205 /**
2206 * Wrap timer functions and event targets to catch errors and provide
2207 * better metadata.
2208 */
2209 _instrumentTryCatch: function() {
2210 var self = this;
2211
2212 var wrappedBuiltIns = self._wrappedBuiltIns;
2213
2214 function wrapTimeFn(orig) {
2215 return function(fn, t) {
2216 // preserve arity
2217 // Make a copy of the arguments to prevent deoptimization
2218 // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
2219 var args = new Array(arguments.length);
2220 for (var i = 0; i < args.length; ++i) {
2221 args[i] = arguments[i];
2222 }
2223 var originalCallback = args[0];
2224 if (isFunction(originalCallback)) {
2225 args[0] = self.wrap(originalCallback);
2226 }
2227
2228 // IE < 9 doesn't support .call/.apply on setInterval/setTimeout, but it
2229 // also supports only two arguments and doesn't care what this is, so we
2230 // can just call the original function directly.
2231 if (orig.apply) {
2232 return orig.apply(this, args);
2233 } else {
2234 return orig(args[0], args[1]);
2235 }
2236 };
2237 }
2238
2239 var autoBreadcrumbs = this._globalOptions.autoBreadcrumbs;
2240
2241 function wrapEventTarget(global) {
2242 var proto = _window[global] && _window[global].prototype;
2243 if (proto && proto.hasOwnProperty && proto.hasOwnProperty('addEventListener')) {
2244 fill(
2245 proto,
2246 'addEventListener',
2247 function(orig) {
2248 return function(evtName, fn, capture, secure) {
2249 // preserve arity
2250 try {
2251 if (fn && fn.handleEvent) {
2252 fn.handleEvent = self.wrap(fn.handleEvent);
2253 }
2254 } catch (err) {
2255 // can sometimes get 'Permission denied to access property "handle Event'
2256 }
2257
2258 // More breadcrumb DOM capture ... done here and not in `_instrumentBreadcrumbs`
2259 // so that we don't have more than one wrapper function
2260 var before, clickHandler, keypressHandler;
2261
2262 if (
2263 autoBreadcrumbs &&
2264 autoBreadcrumbs.dom &&
2265 (global === 'EventTarget' || global === 'Node')
2266 ) {
2267 // NOTE: generating multiple handlers per addEventListener invocation, should
2268 // revisit and verify we can just use one (almost certainly)
2269 clickHandler = self._breadcrumbEventHandler('click');
2270 keypressHandler = self._keypressEventHandler();
2271 before = function(evt) {
2272 // need to intercept every DOM event in `before` argument, in case that
2273 // same wrapped method is re-used for different events (e.g. mousemove THEN click)
2274 // see #724
2275 if (!evt) return;
2276
2277 var eventType;
2278 try {
2279 eventType = evt.type;
2280 } catch (e) {
2281 // just accessing event properties can throw an exception in some rare circumstances
2282 // see: https://github.com/getsentry/raven-js/issues/838
2283 return;
2284 }
2285 if (eventType === 'click') return clickHandler(evt);
2286 else if (eventType === 'keypress') return keypressHandler(evt);
2287 };
2288 }
2289 return orig.call(
2290 this,
2291 evtName,
2292 self.wrap(fn, undefined, before),
2293 capture,
2294 secure
2295 );
2296 };
2297 },
2298 wrappedBuiltIns
2299 );
2300 fill(
2301 proto,
2302 'removeEventListener',
2303 function(orig) {
2304 return function(evt, fn, capture, secure) {
2305 try {
2306 fn = fn && (fn.__raven_wrapper__ ? fn.__raven_wrapper__ : fn);
2307 } catch (e) {
2308 // ignore, accessing __raven_wrapper__ will throw in some Selenium environments
2309 }
2310 return orig.call(this, evt, fn, capture, secure);
2311 };
2312 },
2313 wrappedBuiltIns
2314 );
2315 }
2316 }
2317
2318 fill(_window, 'setTimeout', wrapTimeFn, wrappedBuiltIns);
2319 fill(_window, 'setInterval', wrapTimeFn, wrappedBuiltIns);
2320 if (_window.requestAnimationFrame) {
2321 fill(
2322 _window,
2323 'requestAnimationFrame',
2324 function(orig) {
2325 return function(cb) {
2326 return orig(self.wrap(cb));
2327 };
2328 },
2329 wrappedBuiltIns
2330 );
2331 }
2332
2333 // event targets borrowed from bugsnag-js:
2334 // https://github.com/bugsnag/bugsnag-js/blob/master/src/bugsnag.js#L666
2335 var eventTargets = [
2336 'EventTarget',
2337 'Window',
2338 'Node',
2339 'ApplicationCache',
2340 'AudioTrackList',
2341 'ChannelMergerNode',
2342 'CryptoOperation',
2343 'EventSource',
2344 'FileReader',
2345 'HTMLUnknownElement',
2346 'IDBDatabase',
2347 'IDBRequest',
2348 'IDBTransaction',
2349 'KeyOperation',
2350 'MediaController',
2351 'MessagePort',
2352 'ModalWindow',
2353 'Notification',
2354 'SVGElementInstance',
2355 'Screen',
2356 'TextTrack',
2357 'TextTrackCue',
2358 'TextTrackList',
2359 'WebSocket',
2360 'WebSocketWorker',
2361 'Worker',
2362 'XMLHttpRequest',
2363 'XMLHttpRequestEventTarget',
2364 'XMLHttpRequestUpload'
2365 ];
2366 for (var i = 0; i < eventTargets.length; i++) {
2367 wrapEventTarget(eventTargets[i]);
2368 }
2369 },
2370
2371 /**
2372 * Instrument browser built-ins w/ breadcrumb capturing
2373 * - XMLHttpRequests
2374 * - DOM interactions (click/typing)
2375 * - window.location changes
2376 * - console
2377 *
2378 * Can be disabled or individually configured via the `autoBreadcrumbs` config option
2379 */
2380 _instrumentBreadcrumbs: function() {
2381 var self = this;
2382 var autoBreadcrumbs = this._globalOptions.autoBreadcrumbs;
2383
2384 var wrappedBuiltIns = self._wrappedBuiltIns;
2385
2386 function wrapProp(prop, xhr) {
2387 if (prop in xhr && isFunction(xhr[prop])) {
2388 fill(xhr, prop, function(orig) {
2389 return self.wrap(orig);
2390 }); // intentionally don't track filled methods on XHR instances
2391 }
2392 }
2393
2394 if (autoBreadcrumbs.xhr && 'XMLHttpRequest' in _window) {
2395 var xhrproto = XMLHttpRequest.prototype;
2396 fill(
2397 xhrproto,
2398 'open',
2399 function(origOpen) {
2400 return function(method, url) {
2401 // preserve arity
2402
2403 // if Sentry key appears in URL, don't capture
2404 if (isString(url) && url.indexOf(self._globalKey) === -1) {
2405 this.__raven_xhr = {
2406 method: method,
2407 url: url,
2408 status_code: null
2409 };
2410 }
2411
2412 return origOpen.apply(this, arguments);
2413 };
2414 },
2415 wrappedBuiltIns
2416 );
2417
2418 fill(
2419 xhrproto,
2420 'send',
2421 function(origSend) {
2422 return function(data) {
2423 // preserve arity
2424 var xhr = this;
2425
2426 function onreadystatechangeHandler() {
2427 if (xhr.__raven_xhr && xhr.readyState === 4) {
2428 try {
2429 // touching statusCode in some platforms throws
2430 // an exception
2431 xhr.__raven_xhr.status_code = xhr.status;
2432 } catch (e) {
2433 /* do nothing */
2434 }
2435
2436 self.captureBreadcrumb({
2437 type: 'http',
2438 category: 'xhr',
2439 data: xhr.__raven_xhr
2440 });
2441 }
2442 }
2443
2444 var props = ['onload', 'onerror', 'onprogress'];
2445 for (var j = 0; j < props.length; j++) {
2446 wrapProp(props[j], xhr);
2447 }
2448
2449 if ('onreadystatechange' in xhr && isFunction(xhr.onreadystatechange)) {
2450 fill(
2451 xhr,
2452 'onreadystatechange',
2453 function(orig) {
2454 return self.wrap(orig, undefined, onreadystatechangeHandler);
2455 } /* intentionally don't track this instrumentation */
2456 );
2457 } else {
2458 // if onreadystatechange wasn't actually set by the page on this xhr, we
2459 // are free to set our own and capture the breadcrumb
2460 xhr.onreadystatechange = onreadystatechangeHandler;
2461 }
2462
2463 return origSend.apply(this, arguments);
2464 };
2465 },
2466 wrappedBuiltIns
2467 );
2468 }
2469
2470 if (autoBreadcrumbs.xhr && 'fetch' in _window) {
2471 fill(
2472 _window,
2473 'fetch',
2474 function(origFetch) {
2475 return function(fn, t) {
2476 // preserve arity
2477 // Make a copy of the arguments to prevent deoptimization
2478 // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
2479 var args = new Array(arguments.length);
2480 for (var i = 0; i < args.length; ++i) {
2481 args[i] = arguments[i];
2482 }
2483
2484 var fetchInput = args[0];
2485 var method = 'GET';
2486 var url;
2487
2488 if (typeof fetchInput === 'string') {
2489 url = fetchInput;
2490 } else if ('Request' in _window && fetchInput instanceof _window.Request) {
2491 url = fetchInput.url;
2492 if (fetchInput.method) {
2493 method = fetchInput.method;
2494 }
2495 } else {
2496 url = '' + fetchInput;
2497 }
2498
2499 if (args[1] && args[1].method) {
2500 method = args[1].method;
2501 }
2502
2503 var fetchData = {
2504 method: method,
2505 url: url,
2506 status_code: null
2507 };
2508
2509 self.captureBreadcrumb({
2510 type: 'http',
2511 category: 'fetch',
2512 data: fetchData
2513 });
2514
2515 return origFetch.apply(this, args).then(function(response) {
2516 fetchData.status_code = response.status;
2517
2518 return response;
2519 });
2520 };
2521 },
2522 wrappedBuiltIns
2523 );
2524 }
2525
2526 // Capture breadcrumbs from any click that is unhandled / bubbled up all the way
2527 // to the document. Do this before we instrument addEventListener.
2528 if (autoBreadcrumbs.dom && this._hasDocument) {
2529 if (_document.addEventListener) {
2530 _document.addEventListener('click', self._breadcrumbEventHandler('click'), false);
2531 _document.addEventListener('keypress', self._keypressEventHandler(), false);
2532 } else {
2533 // IE8 Compatibility
2534 _document.attachEvent('onclick', self._breadcrumbEventHandler('click'));
2535 _document.attachEvent('onkeypress', self._keypressEventHandler());
2536 }
2537 }
2538
2539 // record navigation (URL) changes
2540 // NOTE: in Chrome App environment, touching history.pushState, *even inside
2541 // a try/catch block*, will cause Chrome to output an error to console.error
2542 // borrowed from: https://github.com/angular/angular.js/pull/13945/files
2543 var chrome = _window.chrome;
2544 var isChromePackagedApp = chrome && chrome.app && chrome.app.runtime;
2545 var hasPushAndReplaceState =
2546 !isChromePackagedApp &&
2547 _window.history &&
2548 history.pushState &&
2549 history.replaceState;
2550 if (autoBreadcrumbs.location && hasPushAndReplaceState) {
2551 // TODO: remove onpopstate handler on uninstall()
2552 var oldOnPopState = _window.onpopstate;
2553 _window.onpopstate = function() {
2554 var currentHref = self._location.href;
2555 self._captureUrlChange(self._lastHref, currentHref);
2556
2557 if (oldOnPopState) {
2558 return oldOnPopState.apply(this, arguments);
2559 }
2560 };
2561
2562 var historyReplacementFunction = function(origHistFunction) {
2563 // note history.pushState.length is 0; intentionally not declaring
2564 // params to preserve 0 arity
2565 return function(/* state, title, url */) {
2566 var url = arguments.length > 2 ? arguments[2] : undefined;
2567
2568 // url argument is optional
2569 if (url) {
2570 // coerce to string (this is what pushState does)
2571 self._captureUrlChange(self._lastHref, url + '');
2572 }
2573
2574 return origHistFunction.apply(this, arguments);
2575 };
2576 };
2577
2578 fill(history, 'pushState', historyReplacementFunction, wrappedBuiltIns);
2579 fill(history, 'replaceState', historyReplacementFunction, wrappedBuiltIns);
2580 }
2581
2582 if (autoBreadcrumbs.console && 'console' in _window && console.log) {
2583 // console
2584 var consoleMethodCallback = function(msg, data) {
2585 self.captureBreadcrumb({
2586 message: msg,
2587 level: data.level,
2588 category: 'console'
2589 });
2590 };
2591
2592 each(['debug', 'info', 'warn', 'error', 'log'], function(_, level) {
2593 wrapConsoleMethod(console, level, consoleMethodCallback);
2594 });
2595 }
2596 },
2597
2598 _restoreBuiltIns: function() {
2599 // restore any wrapped builtins
2600 var builtin;
2601 while (this._wrappedBuiltIns.length) {
2602 builtin = this._wrappedBuiltIns.shift();
2603
2604 var obj = builtin[0],
2605 name = builtin[1],
2606 orig = builtin[2];
2607
2608 obj[name] = orig;
2609 }
2610 },
2611
2612 _drainPlugins: function() {
2613 var self = this;
2614
2615 // FIX ME TODO
2616 each(this._plugins, function(_, plugin) {
2617 var installer = plugin[0];
2618 var args = plugin[1];
2619 installer.apply(self, [self].concat(args));
2620 });
2621 },
2622
2623 _parseDSN: function(str) {
2624 var m = dsnPattern.exec(str),
2625 dsn = {},
2626 i = 7;
2627
2628 try {
2629 while (i--) dsn[dsnKeys[i]] = m[i] || '';
2630 } catch (e) {
2631 throw new RavenConfigError('Invalid DSN: ' + str);
2632 }
2633
2634 if (dsn.pass && !this._globalOptions.allowSecretKey) {
2635 throw new RavenConfigError(
2636 'Do not specify your secret key in the DSN. See: http://bit.ly/raven-secret-key'
2637 );
2638 }
2639
2640 return dsn;
2641 },
2642
2643 _getGlobalServer: function(uri) {
2644 // assemble the endpoint from the uri pieces
2645 var globalServer = '//' + uri.host + (uri.port ? ':' + uri.port : '');
2646
2647 if (uri.protocol) {
2648 globalServer = uri.protocol + ':' + globalServer;
2649 }
2650 return globalServer;
2651 },
2652
2653 _handleOnErrorStackInfo: function() {
2654 // if we are intentionally ignoring errors via onerror, bail out
2655 if (!this._ignoreOnError) {
2656 this._handleStackInfo.apply(this, arguments);
2657 }
2658 },
2659
2660 _handleStackInfo: function(stackInfo, options) {
2661 var frames = this._prepareFrames(stackInfo, options);
2662
2663 this._triggerEvent('handle', {
2664 stackInfo: stackInfo,
2665 options: options
2666 });
2667
2668 this._processException(
2669 stackInfo.name,
2670 stackInfo.message,
2671 stackInfo.url,
2672 stackInfo.lineno,
2673 frames,
2674 options
2675 );
2676 },
2677
2678 _prepareFrames: function(stackInfo, options) {
2679 var self = this;
2680 var frames = [];
2681 if (stackInfo.stack && stackInfo.stack.length) {
2682 each(stackInfo.stack, function(i, stack) {
2683 var frame = self._normalizeFrame(stack, stackInfo.url);
2684 if (frame) {
2685 frames.push(frame);
2686 }
2687 });
2688
2689 // e.g. frames captured via captureMessage throw
2690 if (options && options.trimHeadFrames) {
2691 for (var j = 0; j < options.trimHeadFrames && j < frames.length; j++) {
2692 frames[j].in_app = false;
2693 }
2694 }
2695 }
2696 frames = frames.slice(0, this._globalOptions.stackTraceLimit);
2697 return frames;
2698 },
2699
2700 _normalizeFrame: function(frame, stackInfoUrl) {
2701 // normalize the frames data
2702 var normalized = {
2703 filename: frame.url,
2704 lineno: frame.line,
2705 colno: frame.column,
2706 function: frame.func || '?'
2707 };
2708
2709 // Case when we don't have any information about the error
2710 // E.g. throwing a string or raw object, instead of an `Error` in Firefox
2711 // Generating synthetic error doesn't add any value here
2712 //
2713 // We should probably somehow let a user know that they should fix their code
2714 if (!frame.url) {
2715 normalized.filename = stackInfoUrl; // fallback to whole stacks url from onerror handler
2716 }
2717
2718 normalized.in_app = !// determine if an exception came from outside of our app
2719 // first we check the global includePaths list.
2720 (
2721 (!!this._globalOptions.includePaths.test &&
2722 !this._globalOptions.includePaths.test(normalized.filename)) ||
2723 // Now we check for fun, if the function name is Raven or TraceKit
2724 /(Raven|TraceKit)\./.test(normalized['function']) ||
2725 // finally, we do a last ditch effort and check for raven.min.js
2726 /raven\.(min\.)?js$/.test(normalized.filename)
2727 );
2728
2729 return normalized;
2730 },
2731
2732 _processException: function(type, message, fileurl, lineno, frames, options) {
2733 var prefixedMessage = (type ? type + ': ' : '') + (message || '');
2734 if (
2735 !!this._globalOptions.ignoreErrors.test &&
2736 (this._globalOptions.ignoreErrors.test(message) ||
2737 this._globalOptions.ignoreErrors.test(prefixedMessage))
2738 ) {
2739 return;
2740 }
2741
2742 var stacktrace;
2743
2744 if (frames && frames.length) {
2745 fileurl = frames[0].filename || fileurl;
2746 // Sentry expects frames oldest to newest
2747 // and JS sends them as newest to oldest
2748 frames.reverse();
2749 stacktrace = {frames: frames};
2750 } else if (fileurl) {
2751 stacktrace = {
2752 frames: [
2753 {
2754 filename: fileurl,
2755 lineno: lineno,
2756 in_app: true
2757 }
2758 ]
2759 };
2760 }
2761
2762 if (
2763 !!this._globalOptions.ignoreUrls.test &&
2764 this._globalOptions.ignoreUrls.test(fileurl)
2765 ) {
2766 return;
2767 }
2768
2769 if (
2770 !!this._globalOptions.whitelistUrls.test &&
2771 !this._globalOptions.whitelistUrls.test(fileurl)
2772 ) {
2773 return;
2774 }
2775
2776 var data = objectMerge(
2777 {
2778 // sentry.interfaces.Exception
2779 exception: {
2780 values: [
2781 {
2782 type: type,
2783 value: message,
2784 stacktrace: stacktrace
2785 }
2786 ]
2787 },
2788 culprit: fileurl
2789 },
2790 options
2791 );
2792
2793 // Fire away!
2794 this._send(data);
2795 },
2796
2797 _trimPacket: function(data) {
2798 // For now, we only want to truncate the two different messages
2799 // but this could/should be expanded to just trim everything
2800 var max = this._globalOptions.maxMessageLength;
2801 if (data.message) {
2802 data.message = truncate(data.message, max);
2803 }
2804 if (data.exception) {
2805 var exception = data.exception.values[0];
2806 exception.value = truncate(exception.value, max);
2807 }
2808
2809 var request = data.request;
2810 if (request) {
2811 if (request.url) {
2812 request.url = truncate(request.url, this._globalOptions.maxUrlLength);
2813 }
2814 if (request.Referer) {
2815 request.Referer = truncate(request.Referer, this._globalOptions.maxUrlLength);
2816 }
2817 }
2818
2819 if (data.breadcrumbs && data.breadcrumbs.values)
2820 this._trimBreadcrumbs(data.breadcrumbs);
2821
2822 return data;
2823 },
2824
2825 /**
2826 * Truncate breadcrumb values (right now just URLs)
2827 */
2828 _trimBreadcrumbs: function(breadcrumbs) {
2829 // known breadcrumb properties with urls
2830 // TODO: also consider arbitrary prop values that start with (https?)?://
2831 var urlProps = ['to', 'from', 'url'],
2832 urlProp,
2833 crumb,
2834 data;
2835
2836 for (var i = 0; i < breadcrumbs.values.length; ++i) {
2837 crumb = breadcrumbs.values[i];
2838 if (
2839 !crumb.hasOwnProperty('data') ||
2840 !isObject(crumb.data) ||
2841 objectFrozen(crumb.data)
2842 )
2843 continue;
2844
2845 data = objectMerge({}, crumb.data);
2846 for (var j = 0; j < urlProps.length; ++j) {
2847 urlProp = urlProps[j];
2848 if (data.hasOwnProperty(urlProp) && data[urlProp]) {
2849 data[urlProp] = truncate(data[urlProp], this._globalOptions.maxUrlLength);
2850 }
2851 }
2852 breadcrumbs.values[i].data = data;
2853 }
2854 },
2855
2856 _getHttpData: function() {
2857 if (!this._hasNavigator && !this._hasDocument) return;
2858 var httpData = {};
2859
2860 if (this._hasNavigator && _navigator.userAgent) {
2861 httpData.headers = {
2862 'User-Agent': navigator.userAgent
2863 };
2864 }
2865
2866 if (this._hasDocument) {
2867 if (_document.location && _document.location.href) {
2868 httpData.url = _document.location.href;
2869 }
2870 if (_document.referrer) {
2871 if (!httpData.headers) httpData.headers = {};
2872 httpData.headers.Referer = _document.referrer;
2873 }
2874 }
2875
2876 return httpData;
2877 },
2878
2879 _resetBackoff: function() {
2880 this._backoffDuration = 0;
2881 this._backoffStart = null;
2882 },
2883
2884 _shouldBackoff: function() {
2885 return this._backoffDuration && now() - this._backoffStart < this._backoffDuration;
2886 },
2887
2888 /**
2889 * Returns true if the in-process data payload matches the signature
2890 * of the previously-sent data
2891 *
2892 * NOTE: This has to be done at this level because TraceKit can generate
2893 * data from window.onerror WITHOUT an exception object (IE8, IE9,
2894 * other old browsers). This can take the form of an "exception"
2895 * data object with a single frame (derived from the onerror args).
2896 */
2897 _isRepeatData: function(current) {
2898 var last = this._lastData;
2899
2900 if (
2901 !last ||
2902 current.message !== last.message || // defined for captureMessage
2903 current.culprit !== last.culprit // defined for captureException/onerror
2904 )
2905 return false;
2906
2907 // Stacktrace interface (i.e. from captureMessage)
2908 if (current.stacktrace || last.stacktrace) {
2909 return isSameStacktrace(current.stacktrace, last.stacktrace);
2910 } else if (current.exception || last.exception) {
2911 // Exception interface (i.e. from captureException/onerror)
2912 return isSameException(current.exception, last.exception);
2913 }
2914
2915 return true;
2916 },
2917
2918 _setBackoffState: function(request) {
2919 // If we are already in a backoff state, don't change anything
2920 if (this._shouldBackoff()) {
2921 return;
2922 }
2923
2924 var status = request.status;
2925
2926 // 400 - project_id doesn't exist or some other fatal
2927 // 401 - invalid/revoked dsn
2928 // 429 - too many requests
2929 if (!(status === 400 || status === 401 || status === 429)) return;
2930
2931 var retry;
2932 try {
2933 // If Retry-After is not in Access-Control-Expose-Headers, most
2934 // browsers will throw an exception trying to access it
2935 retry = request.getResponseHeader('Retry-After');
2936 retry = parseInt(retry, 10) * 1000; // Retry-After is returned in seconds
2937 } catch (e) {
2938 /* eslint no-empty:0 */
2939 }
2940
2941 this._backoffDuration = retry
2942 ? // If Sentry server returned a Retry-After value, use it
2943 retry
2944 : // Otherwise, double the last backoff duration (starts at 1 sec)
2945 this._backoffDuration * 2 || 1000;
2946
2947 this._backoffStart = now();
2948 },
2949
2950 _send: function(data) {
2951 var globalOptions = this._globalOptions;
2952
2953 var baseData = {
2954 project: this._globalProject,
2955 logger: globalOptions.logger,
2956 platform: 'javascript'
2957 },
2958 httpData = this._getHttpData();
2959
2960 if (httpData) {
2961 baseData.request = httpData;
2962 }
2963
2964 // HACK: delete `trimHeadFrames` to prevent from appearing in outbound payload
2965 if (data.trimHeadFrames) delete data.trimHeadFrames;
2966
2967 data = objectMerge(baseData, data);
2968
2969 // Merge in the tags and extra separately since objectMerge doesn't handle a deep merge
2970 data.tags = objectMerge(objectMerge({}, this._globalContext.tags), data.tags);
2971 data.extra = objectMerge(objectMerge({}, this._globalContext.extra), data.extra);
2972
2973 // Send along our own collected metadata with extra
2974 data.extra['session:duration'] = now() - this._startTime;
2975
2976 if (this._breadcrumbs && this._breadcrumbs.length > 0) {
2977 // intentionally make shallow copy so that additions
2978 // to breadcrumbs aren't accidentally sent in this request
2979 data.breadcrumbs = {
2980 values: [].slice.call(this._breadcrumbs, 0)
2981 };
2982 }
2983
2984 // If there are no tags/extra, strip the key from the payload alltogther.
2985 if (isEmptyObject(data.tags)) delete data.tags;
2986
2987 if (this._globalContext.user) {
2988 // sentry.interfaces.User
2989 data.user = this._globalContext.user;
2990 }
2991
2992 // Include the environment if it's defined in globalOptions
2993 if (globalOptions.environment) data.environment = globalOptions.environment;
2994
2995 // Include the release if it's defined in globalOptions
2996 if (globalOptions.release) data.release = globalOptions.release;
2997
2998 // Include server_name if it's defined in globalOptions
2999 if (globalOptions.serverName) data.server_name = globalOptions.serverName;
3000
3001 if (isFunction(globalOptions.dataCallback)) {
3002 data = globalOptions.dataCallback(data) || data;
3003 }
3004
3005 // Why??????????
3006 if (!data || isEmptyObject(data)) {
3007 return;
3008 }
3009
3010 // Check if the request should be filtered or not
3011 if (
3012 isFunction(globalOptions.shouldSendCallback) &&
3013 !globalOptions.shouldSendCallback(data)
3014 ) {
3015 return;
3016 }
3017
3018 // Backoff state: Sentry server previously responded w/ an error (e.g. 429 - too many requests),
3019 // so drop requests until "cool-off" period has elapsed.
3020 if (this._shouldBackoff()) {
3021 this._logDebug('warn', 'Raven dropped error due to backoff: ', data);
3022 return;
3023 }
3024
3025 if (typeof globalOptions.sampleRate === 'number') {
3026 if (Math.random() < globalOptions.sampleRate) {
3027 this._sendProcessedPayload(data);
3028 }
3029 } else {
3030 this._sendProcessedPayload(data);
3031 }
3032 },
3033
3034 _getUuid: function() {
3035 return uuid4();
3036 },
3037
3038 _sendProcessedPayload: function(data, callback) {
3039 var self = this;
3040 var globalOptions = this._globalOptions;
3041
3042 if (!this.isSetup()) return;
3043
3044 // Try and clean up the packet before sending by truncating long values
3045 data = this._trimPacket(data);
3046
3047 // ideally duplicate error testing should occur *before* dataCallback/shouldSendCallback,
3048 // but this would require copying an un-truncated copy of the data packet, which can be
3049 // arbitrarily deep (extra_data) -- could be worthwhile? will revisit
3050 if (!this._globalOptions.allowDuplicates && this._isRepeatData(data)) {
3051 this._logDebug('warn', 'Raven dropped repeat event: ', data);
3052 return;
3053 }
3054
3055 // Send along an event_id if not explicitly passed.
3056 // This event_id can be used to reference the error within Sentry itself.
3057 // Set lastEventId after we know the error should actually be sent
3058 this._lastEventId = data.event_id || (data.event_id = this._getUuid());
3059
3060 // Store outbound payload after trim
3061 this._lastData = data;
3062
3063 this._logDebug('debug', 'Raven about to send:', data);
3064
3065 var auth = {
3066 sentry_version: '7',
3067 sentry_client: 'raven-js/' + this.VERSION,
3068 sentry_key: this._globalKey
3069 };
3070
3071 if (this._globalSecret) {
3072 auth.sentry_secret = this._globalSecret;
3073 }
3074
3075 var exception = data.exception && data.exception.values[0];
3076 this.captureBreadcrumb({
3077 category: 'sentry',
3078 message: exception
3079 ? (exception.type ? exception.type + ': ' : '') + exception.value
3080 : data.message,
3081 event_id: data.event_id,
3082 level: data.level || 'error' // presume error unless specified
3083 });
3084
3085 var url = this._globalEndpoint;
3086 (globalOptions.transport || this._makeRequest).call(this, {
3087 url: url,
3088 auth: auth,
3089 data: data,
3090 options: globalOptions,
3091 onSuccess: function success() {
3092 self._resetBackoff();
3093
3094 self._triggerEvent('success', {
3095 data: data,
3096 src: url
3097 });
3098 callback && callback();
3099 },
3100 onError: function failure(error) {
3101 self._logDebug('error', 'Raven transport failed to send: ', error);
3102
3103 if (error.request) {
3104 self._setBackoffState(error.request);
3105 }
3106
3107 self._triggerEvent('failure', {
3108 data: data,
3109 src: url
3110 });
3111 error = error || new Error('Raven send failed (no additional details provided)');
3112 callback && callback(error);
3113 }
3114 });
3115 },
3116
3117 _makeRequest: function(opts) {
3118 var request = _window.XMLHttpRequest && new _window.XMLHttpRequest();
3119 if (!request) return;
3120
3121 // if browser doesn't support CORS (e.g. IE7), we are out of luck
3122 var hasCORS = 'withCredentials' in request || typeof XDomainRequest !== 'undefined';
3123
3124 if (!hasCORS) return;
3125
3126 var url = opts.url;
3127
3128 if ('withCredentials' in request) {
3129 request.onreadystatechange = function() {
3130 if (request.readyState !== 4) {
3131 return;
3132 } else if (request.status === 200) {
3133 opts.onSuccess && opts.onSuccess();
3134 } else if (opts.onError) {
3135 var err = new Error('Sentry error code: ' + request.status);
3136 err.request = request;
3137 opts.onError(err);
3138 }
3139 };
3140 } else {
3141 request = new XDomainRequest();
3142 // xdomainrequest cannot go http -> https (or vice versa),
3143 // so always use protocol relative
3144 url = url.replace(/^https?:/, '');
3145
3146 // onreadystatechange not supported by XDomainRequest
3147 if (opts.onSuccess) {
3148 request.onload = opts.onSuccess;
3149 }
3150 if (opts.onError) {
3151 request.onerror = function() {
3152 var err = new Error('Sentry error code: XDomainRequest');
3153 err.request = request;
3154 opts.onError(err);
3155 };
3156 }
3157 }
3158
3159 // NOTE: auth is intentionally sent as part of query string (NOT as custom
3160 // HTTP header) so as to avoid preflight CORS requests
3161 request.open('POST', url + '?' + urlencode(opts.auth));
3162 request.send(stringify(opts.data));
3163 },
3164
3165 _logDebug: function(level) {
3166 if (this._originalConsoleMethods[level] && this.debug) {
3167 // In IE<10 console methods do not have their own 'apply' method
3168 Function.prototype.apply.call(
3169 this._originalConsoleMethods[level],
3170 this._originalConsole,
3171 [].slice.call(arguments, 1)
3172 );
3173 }
3174 },
3175
3176 _mergeContext: function(key, context) {
3177 if (isUndefined(context)) {
3178 delete this._globalContext[key];
3179 } else {
3180 this._globalContext[key] = objectMerge(this._globalContext[key] || {}, context);
3181 }
3182 }
3183 };
3184
3185 // Deprecations
3186 Raven.prototype.setUser = Raven.prototype.setUserContext;
3187 Raven.prototype.setReleaseContext = Raven.prototype.setRelease;
3188
3189 module.exports = Raven;
3190
3191
3192 /***/ }),
3193
3194 /***/ "./node_modules/raven-js/src/singleton.js":
3195 /*!************************************************!*\
3196 !*** ./node_modules/raven-js/src/singleton.js ***!
3197 \************************************************/
3198 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3199
3200 /**
3201 * Enforces a single instance of the Raven client, and the
3202 * main entry point for Raven. If you are a consumer of the
3203 * Raven library, you SHOULD load this file (vs raven.js).
3204 **/
3205
3206 var RavenConstructor = __webpack_require__(/*! ./raven */ "./node_modules/raven-js/src/raven.js");
3207
3208 // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785)
3209 var _window =
3210 typeof window !== 'undefined'
3211 ? window
3212 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
3213 var _Raven = _window.Raven;
3214
3215 var Raven = new RavenConstructor();
3216
3217 /*
3218 * Allow multiple versions of Raven to be installed.
3219 * Strip Raven from the global context and returns the instance.
3220 *
3221 * @return {Raven}
3222 */
3223 Raven.noConflict = function() {
3224 _window.Raven = _Raven;
3225 return Raven;
3226 };
3227
3228 Raven.afterLoad();
3229
3230 module.exports = Raven;
3231
3232
3233 /***/ }),
3234
3235 /***/ "./node_modules/raven-js/src/utils.js":
3236 /*!********************************************!*\
3237 !*** ./node_modules/raven-js/src/utils.js ***!
3238 \********************************************/
3239 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3240
3241 var _window =
3242 typeof window !== 'undefined'
3243 ? window
3244 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
3245
3246 function isObject(what) {
3247 return typeof what === 'object' && what !== null;
3248 }
3249
3250 // Yanked from https://git.io/vS8DV re-used under CC0
3251 // with some tiny modifications
3252 function isError(value) {
3253 switch ({}.toString.call(value)) {
3254 case '[object Error]':
3255 return true;
3256 case '[object Exception]':
3257 return true;
3258 case '[object DOMException]':
3259 return true;
3260 default:
3261 return value instanceof Error;
3262 }
3263 }
3264
3265 function isErrorEvent(value) {
3266 return supportsErrorEvent() && {}.toString.call(value) === '[object ErrorEvent]';
3267 }
3268
3269 function isUndefined(what) {
3270 return what === void 0;
3271 }
3272
3273 function isFunction(what) {
3274 return typeof what === 'function';
3275 }
3276
3277 function isString(what) {
3278 return Object.prototype.toString.call(what) === '[object String]';
3279 }
3280
3281 function isEmptyObject(what) {
3282 for (var _ in what) return false; // eslint-disable-line guard-for-in, no-unused-vars
3283 return true;
3284 }
3285
3286 function supportsErrorEvent() {
3287 try {
3288 new ErrorEvent(''); // eslint-disable-line no-new
3289 return true;
3290 } catch (e) {
3291 return false;
3292 }
3293 }
3294
3295 function wrappedCallback(callback) {
3296 function dataCallback(data, original) {
3297 var normalizedData = callback(data) || data;
3298 if (original) {
3299 return original(normalizedData) || normalizedData;
3300 }
3301 return normalizedData;
3302 }
3303
3304 return dataCallback;
3305 }
3306
3307 function each(obj, callback) {
3308 var i, j;
3309
3310 if (isUndefined(obj.length)) {
3311 for (i in obj) {
3312 if (hasKey(obj, i)) {
3313 callback.call(null, i, obj[i]);
3314 }
3315 }
3316 } else {
3317 j = obj.length;
3318 if (j) {
3319 for (i = 0; i < j; i++) {
3320 callback.call(null, i, obj[i]);
3321 }
3322 }
3323 }
3324 }
3325
3326 function objectMerge(obj1, obj2) {
3327 if (!obj2) {
3328 return obj1;
3329 }
3330 each(obj2, function(key, value) {
3331 obj1[key] = value;
3332 });
3333 return obj1;
3334 }
3335
3336 /**
3337 * This function is only used for react-native.
3338 * react-native freezes object that have already been sent over the
3339 * js bridge. We need this function in order to check if the object is frozen.
3340 * So it's ok that objectFrozen returns false if Object.isFrozen is not
3341 * supported because it's not relevant for other "platforms". See related issue:
3342 * https://github.com/getsentry/react-native-sentry/issues/57
3343 */
3344 function objectFrozen(obj) {
3345 if (!Object.isFrozen) {
3346 return false;
3347 }
3348 return Object.isFrozen(obj);
3349 }
3350
3351 function truncate(str, max) {
3352 return !max || str.length <= max ? str : str.substr(0, max) + '\u2026';
3353 }
3354
3355 /**
3356 * hasKey, a better form of hasOwnProperty
3357 * Example: hasKey(MainHostObject, property) === true/false
3358 *
3359 * @param {Object} host object to check property
3360 * @param {string} key to check
3361 */
3362 function hasKey(object, key) {
3363 return Object.prototype.hasOwnProperty.call(object, key);
3364 }
3365
3366 function joinRegExp(patterns) {
3367 // Combine an array of regular expressions and strings into one large regexp
3368 // Be mad.
3369 var sources = [],
3370 i = 0,
3371 len = patterns.length,
3372 pattern;
3373
3374 for (; i < len; i++) {
3375 pattern = patterns[i];
3376 if (isString(pattern)) {
3377 // If it's a string, we need to escape it
3378 // Taken from: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
3379 sources.push(pattern.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, '\\$1'));
3380 } else if (pattern && pattern.source) {
3381 // If it's a regexp already, we want to extract the source
3382 sources.push(pattern.source);
3383 }
3384 // Intentionally skip other cases
3385 }
3386 return new RegExp(sources.join('|'), 'i');
3387 }
3388
3389 function urlencode(o) {
3390 var pairs = [];
3391 each(o, function(key, value) {
3392 pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));
3393 });
3394 return pairs.join('&');
3395 }
3396
3397 // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B
3398 // intentionally using regex and not <a/> href parsing trick because React Native and other
3399 // environments where DOM might not be available
3400 function parseUrl(url) {
3401 var match = url.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);
3402 if (!match) return {};
3403
3404 // coerce to undefined values to empty string so we don't get 'undefined'
3405 var query = match[6] || '';
3406 var fragment = match[8] || '';
3407 return {
3408 protocol: match[2],
3409 host: match[4],
3410 path: match[5],
3411 relative: match[5] + query + fragment // everything minus origin
3412 };
3413 }
3414 function uuid4() {
3415 var crypto = _window.crypto || _window.msCrypto;
3416
3417 if (!isUndefined(crypto) && crypto.getRandomValues) {
3418 // Use window.crypto API if available
3419 // eslint-disable-next-line no-undef
3420 var arr = new Uint16Array(8);
3421 crypto.getRandomValues(arr);
3422
3423 // set 4 in byte 7
3424 arr[3] = (arr[3] & 0xfff) | 0x4000;
3425 // set 2 most significant bits of byte 9 to '10'
3426 arr[4] = (arr[4] & 0x3fff) | 0x8000;
3427
3428 var pad = function(num) {
3429 var v = num.toString(16);
3430 while (v.length < 4) {
3431 v = '0' + v;
3432 }
3433 return v;
3434 };
3435
3436 return (
3437 pad(arr[0]) +
3438 pad(arr[1]) +
3439 pad(arr[2]) +
3440 pad(arr[3]) +
3441 pad(arr[4]) +
3442 pad(arr[5]) +
3443 pad(arr[6]) +
3444 pad(arr[7])
3445 );
3446 } else {
3447 // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523
3448 return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
3449 var r = (Math.random() * 16) | 0,
3450 v = c === 'x' ? r : (r & 0x3) | 0x8;
3451 return v.toString(16);
3452 });
3453 }
3454 }
3455
3456 /**
3457 * Given a child DOM element, returns a query-selector statement describing that
3458 * and its ancestors
3459 * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]
3460 * @param elem
3461 * @returns {string}
3462 */
3463 function htmlTreeAsString(elem) {
3464 /* eslint no-extra-parens:0*/
3465 var MAX_TRAVERSE_HEIGHT = 5,
3466 MAX_OUTPUT_LEN = 80,
3467 out = [],
3468 height = 0,
3469 len = 0,
3470 separator = ' > ',
3471 sepLength = separator.length,
3472 nextStr;
3473
3474 while (elem && height++ < MAX_TRAVERSE_HEIGHT) {
3475 nextStr = htmlElementAsString(elem);
3476 // bail out if
3477 // - nextStr is the 'html' element
3478 // - the length of the string that would be created exceeds MAX_OUTPUT_LEN
3479 // (ignore this limit if we are on the first iteration)
3480 if (
3481 nextStr === 'html' ||
3482 (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)
3483 ) {
3484 break;
3485 }
3486
3487 out.push(nextStr);
3488
3489 len += nextStr.length;
3490 elem = elem.parentNode;
3491 }
3492
3493 return out.reverse().join(separator);
3494 }
3495
3496 /**
3497 * Returns a simple, query-selector representation of a DOM element
3498 * e.g. [HTMLElement] => input#foo.btn[name=baz]
3499 * @param HTMLElement
3500 * @returns {string}
3501 */
3502 function htmlElementAsString(elem) {
3503 var out = [],
3504 className,
3505 classes,
3506 key,
3507 attr,
3508 i;
3509
3510 if (!elem || !elem.tagName) {
3511 return '';
3512 }
3513
3514 out.push(elem.tagName.toLowerCase());
3515 if (elem.id) {
3516 out.push('#' + elem.id);
3517 }
3518
3519 className = elem.className;
3520 if (className && isString(className)) {
3521 classes = className.split(/\s+/);
3522 for (i = 0; i < classes.length; i++) {
3523 out.push('.' + classes[i]);
3524 }
3525 }
3526 var attrWhitelist = ['type', 'name', 'title', 'alt'];
3527 for (i = 0; i < attrWhitelist.length; i++) {
3528 key = attrWhitelist[i];
3529 attr = elem.getAttribute(key);
3530 if (attr) {
3531 out.push('[' + key + '="' + attr + '"]');
3532 }
3533 }
3534 return out.join('');
3535 }
3536
3537 /**
3538 * Returns true if either a OR b is truthy, but not both
3539 */
3540 function isOnlyOneTruthy(a, b) {
3541 return !!(!!a ^ !!b);
3542 }
3543
3544 /**
3545 * Returns true if the two input exception interfaces have the same content
3546 */
3547 function isSameException(ex1, ex2) {
3548 if (isOnlyOneTruthy(ex1, ex2)) return false;
3549
3550 ex1 = ex1.values[0];
3551 ex2 = ex2.values[0];
3552
3553 if (ex1.type !== ex2.type || ex1.value !== ex2.value) return false;
3554
3555 return isSameStacktrace(ex1.stacktrace, ex2.stacktrace);
3556 }
3557
3558 /**
3559 * Returns true if the two input stack trace interfaces have the same content
3560 */
3561 function isSameStacktrace(stack1, stack2) {
3562 if (isOnlyOneTruthy(stack1, stack2)) return false;
3563
3564 var frames1 = stack1.frames;
3565 var frames2 = stack2.frames;
3566
3567 // Exit early if frame count differs
3568 if (frames1.length !== frames2.length) return false;
3569
3570 // Iterate through every frame; bail out if anything differs
3571 var a, b;
3572 for (var i = 0; i < frames1.length; i++) {
3573 a = frames1[i];
3574 b = frames2[i];
3575 if (
3576 a.filename !== b.filename ||
3577 a.lineno !== b.lineno ||
3578 a.colno !== b.colno ||
3579 a['function'] !== b['function']
3580 )
3581 return false;
3582 }
3583 return true;
3584 }
3585
3586 /**
3587 * Polyfill a method
3588 * @param obj object e.g. `document`
3589 * @param name method name present on object e.g. `addEventListener`
3590 * @param replacement replacement function
3591 * @param track {optional} record instrumentation to an array
3592 */
3593 function fill(obj, name, replacement, track) {
3594 var orig = obj[name];
3595 obj[name] = replacement(orig);
3596 if (track) {
3597 track.push([obj, name, orig]);
3598 }
3599 }
3600
3601 module.exports = {
3602 isObject: isObject,
3603 isError: isError,
3604 isErrorEvent: isErrorEvent,
3605 isUndefined: isUndefined,
3606 isFunction: isFunction,
3607 isString: isString,
3608 isEmptyObject: isEmptyObject,
3609 supportsErrorEvent: supportsErrorEvent,
3610 wrappedCallback: wrappedCallback,
3611 each: each,
3612 objectMerge: objectMerge,
3613 truncate: truncate,
3614 objectFrozen: objectFrozen,
3615 hasKey: hasKey,
3616 joinRegExp: joinRegExp,
3617 urlencode: urlencode,
3618 uuid4: uuid4,
3619 htmlTreeAsString: htmlTreeAsString,
3620 htmlElementAsString: htmlElementAsString,
3621 isSameException: isSameException,
3622 isSameStacktrace: isSameStacktrace,
3623 parseUrl: parseUrl,
3624 fill: fill
3625 };
3626
3627
3628 /***/ }),
3629
3630 /***/ "./node_modules/raven-js/vendor/TraceKit/tracekit.js":
3631 /*!***********************************************************!*\
3632 !*** ./node_modules/raven-js/vendor/TraceKit/tracekit.js ***!
3633 \***********************************************************/
3634 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3635
3636 var utils = __webpack_require__(/*! ../../src/utils */ "./node_modules/raven-js/src/utils.js");
3637
3638 /*
3639 TraceKit - Cross brower stack traces
3640
3641 This was originally forked from github.com/occ/TraceKit, but has since been
3642 largely re-written and is now maintained as part of raven-js. Tests for
3643 this are in test/vendor.
3644
3645 MIT license
3646 */
3647
3648 var TraceKit = {
3649 collectWindowErrors: true,
3650 debug: false
3651 };
3652
3653 // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785)
3654 var _window =
3655 typeof window !== 'undefined'
3656 ? window
3657 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
3658
3659 // global reference to slice
3660 var _slice = [].slice;
3661 var UNKNOWN_FUNCTION = '?';
3662
3663 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Error_types
3664 var ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;
3665
3666 function getLocationHref() {
3667 if (typeof document === 'undefined' || document.location == null) return '';
3668
3669 return document.location.href;
3670 }
3671
3672 /**
3673 * TraceKit.report: cross-browser processing of unhandled exceptions
3674 *
3675 * Syntax:
3676 * TraceKit.report.subscribe(function(stackInfo) { ... })
3677 * TraceKit.report.unsubscribe(function(stackInfo) { ... })
3678 * TraceKit.report(exception)
3679 * try { ...code... } catch(ex) { TraceKit.report(ex); }
3680 *
3681 * Supports:
3682 * - Firefox: full stack trace with line numbers, plus column number
3683 * on top frame; column number is not guaranteed
3684 * - Opera: full stack trace with line and column numbers
3685 * - Chrome: full stack trace with line and column numbers
3686 * - Safari: line and column number for the top frame only; some frames
3687 * may be missing, and column number is not guaranteed
3688 * - IE: line and column number for the top frame only; some frames
3689 * may be missing, and column number is not guaranteed
3690 *
3691 * In theory, TraceKit should work on all of the following versions:
3692 * - IE5.5+ (only 8.0 tested)
3693 * - Firefox 0.9+ (only 3.5+ tested)
3694 * - Opera 7+ (only 10.50 tested; versions 9 and earlier may require
3695 * Exceptions Have Stacktrace to be enabled in opera:config)
3696 * - Safari 3+ (only 4+ tested)
3697 * - Chrome 1+ (only 5+ tested)
3698 * - Konqueror 3.5+ (untested)
3699 *
3700 * Requires TraceKit.computeStackTrace.
3701 *
3702 * Tries to catch all unhandled exceptions and report them to the
3703 * subscribed handlers. Please note that TraceKit.report will rethrow the
3704 * exception. This is REQUIRED in order to get a useful stack trace in IE.
3705 * If the exception does not reach the top of the browser, you will only
3706 * get a stack trace from the point where TraceKit.report was called.
3707 *
3708 * Handlers receive a stackInfo object as described in the
3709 * TraceKit.computeStackTrace docs.
3710 */
3711 TraceKit.report = (function reportModuleWrapper() {
3712 var handlers = [],
3713 lastArgs = null,
3714 lastException = null,
3715 lastExceptionStack = null;
3716
3717 /**
3718 * Add a crash handler.
3719 * @param {Function} handler
3720 */
3721 function subscribe(handler) {
3722 installGlobalHandler();
3723 handlers.push(handler);
3724 }
3725
3726 /**
3727 * Remove a crash handler.
3728 * @param {Function} handler
3729 */
3730 function unsubscribe(handler) {
3731 for (var i = handlers.length - 1; i >= 0; --i) {
3732 if (handlers[i] === handler) {
3733 handlers.splice(i, 1);
3734 }
3735 }
3736 }
3737
3738 /**
3739 * Remove all crash handlers.
3740 */
3741 function unsubscribeAll() {
3742 uninstallGlobalHandler();
3743 handlers = [];
3744 }
3745
3746 /**
3747 * Dispatch stack information to all handlers.
3748 * @param {Object.<string, *>} stack
3749 */
3750 function notifyHandlers(stack, isWindowError) {
3751 var exception = null;
3752 if (isWindowError && !TraceKit.collectWindowErrors) {
3753 return;
3754 }
3755 for (var i in handlers) {
3756 if (handlers.hasOwnProperty(i)) {
3757 try {
3758 handlers[i].apply(null, [stack].concat(_slice.call(arguments, 2)));
3759 } catch (inner) {
3760 exception = inner;
3761 }
3762 }
3763 }
3764
3765 if (exception) {
3766 throw exception;
3767 }
3768 }
3769
3770 var _oldOnerrorHandler, _onErrorHandlerInstalled;
3771
3772 /**
3773 * Ensures all global unhandled exceptions are recorded.
3774 * Supported by Gecko and IE.
3775 * @param {string} message Error message.
3776 * @param {string} url URL of script that generated the exception.
3777 * @param {(number|string)} lineNo The line number at which the error
3778 * occurred.
3779 * @param {?(number|string)} colNo The column number at which the error
3780 * occurred.
3781 * @param {?Error} ex The actual Error object.
3782 */
3783 function traceKitWindowOnError(message, url, lineNo, colNo, ex) {
3784 var stack = null;
3785
3786 if (lastExceptionStack) {
3787 TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(
3788 lastExceptionStack,
3789 url,
3790 lineNo,
3791 message
3792 );
3793 processLastException();
3794 } else if (ex && utils.isError(ex)) {
3795 // non-string `ex` arg; attempt to extract stack trace
3796
3797 // New chrome and blink send along a real error object
3798 // Let's just report that like a normal error.
3799 // See: https://mikewest.org/2013/08/debugging-runtime-errors-with-window-onerror
3800 stack = TraceKit.computeStackTrace(ex);
3801 notifyHandlers(stack, true);
3802 } else {
3803 var location = {
3804 url: url,
3805 line: lineNo,
3806 column: colNo
3807 };
3808
3809 var name = undefined;
3810 var msg = message; // must be new var or will modify original `arguments`
3811 var groups;
3812 if ({}.toString.call(message) === '[object String]') {
3813 var groups = message.match(ERROR_TYPES_RE);
3814 if (groups) {
3815 name = groups[1];
3816 msg = groups[2];
3817 }
3818 }
3819
3820 location.func = UNKNOWN_FUNCTION;
3821
3822 stack = {
3823 name: name,
3824 message: msg,
3825 url: getLocationHref(),
3826 stack: [location]
3827 };
3828 notifyHandlers(stack, true);
3829 }
3830
3831 if (_oldOnerrorHandler) {
3832 return _oldOnerrorHandler.apply(this, arguments);
3833 }
3834
3835 return false;
3836 }
3837
3838 function installGlobalHandler() {
3839 if (_onErrorHandlerInstalled) {
3840 return;
3841 }
3842 _oldOnerrorHandler = _window.onerror;
3843 _window.onerror = traceKitWindowOnError;
3844 _onErrorHandlerInstalled = true;
3845 }
3846
3847 function uninstallGlobalHandler() {
3848 if (!_onErrorHandlerInstalled) {
3849 return;
3850 }
3851 _window.onerror = _oldOnerrorHandler;
3852 _onErrorHandlerInstalled = false;
3853 _oldOnerrorHandler = undefined;
3854 }
3855
3856 function processLastException() {
3857 var _lastExceptionStack = lastExceptionStack,
3858 _lastArgs = lastArgs;
3859 lastArgs = null;
3860 lastExceptionStack = null;
3861 lastException = null;
3862 notifyHandlers.apply(null, [_lastExceptionStack, false].concat(_lastArgs));
3863 }
3864
3865 /**
3866 * Reports an unhandled Error to TraceKit.
3867 * @param {Error} ex
3868 * @param {?boolean} rethrow If false, do not re-throw the exception.
3869 * Only used for window.onerror to not cause an infinite loop of
3870 * rethrowing.
3871 */
3872 function report(ex, rethrow) {
3873 var args = _slice.call(arguments, 1);
3874 if (lastExceptionStack) {
3875 if (lastException === ex) {
3876 return; // already caught by an inner catch block, ignore
3877 } else {
3878 processLastException();
3879 }
3880 }
3881
3882 var stack = TraceKit.computeStackTrace(ex);
3883 lastExceptionStack = stack;
3884 lastException = ex;
3885 lastArgs = args;
3886
3887 // If the stack trace is incomplete, wait for 2 seconds for
3888 // slow slow IE to see if onerror occurs or not before reporting
3889 // this exception; otherwise, we will end up with an incomplete
3890 // stack trace
3891 setTimeout(function() {
3892 if (lastException === ex) {
3893 processLastException();
3894 }
3895 }, stack.incomplete ? 2000 : 0);
3896
3897 if (rethrow !== false) {
3898 throw ex; // re-throw to propagate to the top level (and cause window.onerror)
3899 }
3900 }
3901
3902 report.subscribe = subscribe;
3903 report.unsubscribe = unsubscribe;
3904 report.uninstall = unsubscribeAll;
3905 return report;
3906 })();
3907
3908 /**
3909 * TraceKit.computeStackTrace: cross-browser stack traces in JavaScript
3910 *
3911 * Syntax:
3912 * s = TraceKit.computeStackTrace(exception) // consider using TraceKit.report instead (see below)
3913 * Returns:
3914 * s.name - exception name
3915 * s.message - exception message
3916 * s.stack[i].url - JavaScript or HTML file URL
3917 * s.stack[i].func - function name, or empty for anonymous functions (if guessing did not work)
3918 * s.stack[i].args - arguments passed to the function, if known
3919 * s.stack[i].line - line number, if known
3920 * s.stack[i].column - column number, if known
3921 *
3922 * Supports:
3923 * - Firefox: full stack trace with line numbers and unreliable column
3924 * number on top frame
3925 * - Opera 10: full stack trace with line and column numbers
3926 * - Opera 9-: full stack trace with line numbers
3927 * - Chrome: full stack trace with line and column numbers
3928 * - Safari: line and column number for the topmost stacktrace element
3929 * only
3930 * - IE: no line numbers whatsoever
3931 *
3932 * Tries to guess names of anonymous functions by looking for assignments
3933 * in the source code. In IE and Safari, we have to guess source file names
3934 * by searching for function bodies inside all page scripts. This will not
3935 * work for scripts that are loaded cross-domain.
3936 * Here be dragons: some function names may be guessed incorrectly, and
3937 * duplicate functions may be mismatched.
3938 *
3939 * TraceKit.computeStackTrace should only be used for tracing purposes.
3940 * Logging of unhandled exceptions should be done with TraceKit.report,
3941 * which builds on top of TraceKit.computeStackTrace and provides better
3942 * IE support by utilizing the window.onerror event to retrieve information
3943 * about the top of the stack.
3944 *
3945 * Note: In IE and Safari, no stack trace is recorded on the Error object,
3946 * so computeStackTrace instead walks its *own* chain of callers.
3947 * This means that:
3948 * * in Safari, some methods may be missing from the stack trace;
3949 * * in IE, the topmost function in the stack trace will always be the
3950 * caller of computeStackTrace.
3951 *
3952 * This is okay for tracing (because you are likely to be calling
3953 * computeStackTrace from the function you want to be the topmost element
3954 * of the stack trace anyway), but not okay for logging unhandled
3955 * exceptions (because your catch block will likely be far away from the
3956 * inner function that actually caused the exception).
3957 *
3958 */
3959 TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
3960 // Contents of Exception in various browsers.
3961 //
3962 // SAFARI:
3963 // ex.message = Can't find variable: qq
3964 // ex.line = 59
3965 // ex.sourceId = 580238192
3966 // ex.sourceURL = http://...
3967 // ex.expressionBeginOffset = 96
3968 // ex.expressionCaretOffset = 98
3969 // ex.expressionEndOffset = 98
3970 // ex.name = ReferenceError
3971 //
3972 // FIREFOX:
3973 // ex.message = qq is not defined
3974 // ex.fileName = http://...
3975 // ex.lineNumber = 59
3976 // ex.columnNumber = 69
3977 // ex.stack = ...stack trace... (see the example below)
3978 // ex.name = ReferenceError
3979 //
3980 // CHROME:
3981 // ex.message = qq is not defined
3982 // ex.name = ReferenceError
3983 // ex.type = not_defined
3984 // ex.arguments = ['aa']
3985 // ex.stack = ...stack trace...
3986 //
3987 // INTERNET EXPLORER:
3988 // ex.message = ...
3989 // ex.name = ReferenceError
3990 //
3991 // OPERA:
3992 // ex.message = ...message... (see the example below)
3993 // ex.name = ReferenceError
3994 // ex.opera#sourceloc = 11 (pretty much useless, duplicates the info in ex.message)
3995 // ex.stacktrace = n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace'
3996
3997 /**
3998 * Computes stack trace information from the stack property.
3999 * Chrome and Gecko use this property.
4000 * @param {Error} ex
4001 * @return {?Object.<string, *>} Stack trace information.
4002 */
4003 function computeStackTraceFromStackProp(ex) {
4004 if (typeof ex.stack === 'undefined' || !ex.stack) return;
4005
4006 var chrome = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|[a-z]:|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,
4007 gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,
4008 winjs = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,
4009 // Used to additionally parse URL/line/column from eval frames
4010 geckoEval = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i,
4011 chromeEval = /\((\S*)(?::(\d+))(?::(\d+))\)/,
4012 lines = ex.stack.split('\n'),
4013 stack = [],
4014 submatch,
4015 parts,
4016 element,
4017 reference = /^(.*) is undefined$/.exec(ex.message);
4018
4019 for (var i = 0, j = lines.length; i < j; ++i) {
4020 if ((parts = chrome.exec(lines[i]))) {
4021 var isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line
4022 var isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line
4023 if (isEval && (submatch = chromeEval.exec(parts[2]))) {
4024 // throw out eval line/column and use top-most line/column number
4025 parts[2] = submatch[1]; // url
4026 parts[3] = submatch[2]; // line
4027 parts[4] = submatch[3]; // column
4028 }
4029 element = {
4030 url: !isNative ? parts[2] : null,
4031 func: parts[1] || UNKNOWN_FUNCTION,
4032 args: isNative ? [parts[2]] : [],
4033 line: parts[3] ? +parts[3] : null,
4034 column: parts[4] ? +parts[4] : null
4035 };
4036 } else if ((parts = winjs.exec(lines[i]))) {
4037 element = {
4038 url: parts[2],
4039 func: parts[1] || UNKNOWN_FUNCTION,
4040 args: [],
4041 line: +parts[3],
4042 column: parts[4] ? +parts[4] : null
4043 };
4044 } else if ((parts = gecko.exec(lines[i]))) {
4045 var isEval = parts[3] && parts[3].indexOf(' > eval') > -1;
4046 if (isEval && (submatch = geckoEval.exec(parts[3]))) {
4047 // throw out eval line/column and use top-most line number
4048 parts[3] = submatch[1];
4049 parts[4] = submatch[2];
4050 parts[5] = null; // no column when eval
4051 } else if (i === 0 && !parts[5] && typeof ex.columnNumber !== 'undefined') {
4052 // FireFox uses this awesome columnNumber property for its top frame
4053 // Also note, Firefox's column number is 0-based and everything else expects 1-based,
4054 // so adding 1
4055 // NOTE: this hack doesn't work if top-most frame is eval
4056 stack[0].column = ex.columnNumber + 1;
4057 }
4058 element = {
4059 url: parts[3],
4060 func: parts[1] || UNKNOWN_FUNCTION,
4061 args: parts[2] ? parts[2].split(',') : [],
4062 line: parts[4] ? +parts[4] : null,
4063 column: parts[5] ? +parts[5] : null
4064 };
4065 } else {
4066 continue;
4067 }
4068
4069 if (!element.func && element.line) {
4070 element.func = UNKNOWN_FUNCTION;
4071 }
4072
4073 stack.push(element);
4074 }
4075
4076 if (!stack.length) {
4077 return null;
4078 }
4079
4080 return {
4081 name: ex.name,
4082 message: ex.message,
4083 url: getLocationHref(),
4084 stack: stack
4085 };
4086 }
4087
4088 /**
4089 * Adds information about the first frame to incomplete stack traces.
4090 * Safari and IE require this to get complete data on the first frame.
4091 * @param {Object.<string, *>} stackInfo Stack trace information from
4092 * one of the compute* methods.
4093 * @param {string} url The URL of the script that caused an error.
4094 * @param {(number|string)} lineNo The line number of the script that
4095 * caused an error.
4096 * @param {string=} message The error generated by the browser, which
4097 * hopefully contains the name of the object that caused the error.
4098 * @return {boolean} Whether or not the stack information was
4099 * augmented.
4100 */
4101 function augmentStackTraceWithInitialElement(stackInfo, url, lineNo, message) {
4102 var initial = {
4103 url: url,
4104 line: lineNo
4105 };
4106
4107 if (initial.url && initial.line) {
4108 stackInfo.incomplete = false;
4109
4110 if (!initial.func) {
4111 initial.func = UNKNOWN_FUNCTION;
4112 }
4113
4114 if (stackInfo.stack.length > 0) {
4115 if (stackInfo.stack[0].url === initial.url) {
4116 if (stackInfo.stack[0].line === initial.line) {
4117 return false; // already in stack trace
4118 } else if (
4119 !stackInfo.stack[0].line &&
4120 stackInfo.stack[0].func === initial.func
4121 ) {
4122 stackInfo.stack[0].line = initial.line;
4123 return false;
4124 }
4125 }
4126 }
4127
4128 stackInfo.stack.unshift(initial);
4129 stackInfo.partial = true;
4130 return true;
4131 } else {
4132 stackInfo.incomplete = true;
4133 }
4134
4135 return false;
4136 }
4137
4138 /**
4139 * Computes stack trace information by walking the arguments.caller
4140 * chain at the time the exception occurred. This will cause earlier
4141 * frames to be missed but is the only way to get any stack trace in
4142 * Safari and IE. The top frame is restored by
4143 * {@link augmentStackTraceWithInitialElement}.
4144 * @param {Error} ex
4145 * @return {?Object.<string, *>} Stack trace information.
4146 */
4147 function computeStackTraceByWalkingCallerChain(ex, depth) {
4148 var functionName = /function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,
4149 stack = [],
4150 funcs = {},
4151 recursion = false,
4152 parts,
4153 item,
4154 source;
4155
4156 for (
4157 var curr = computeStackTraceByWalkingCallerChain.caller;
4158 curr && !recursion;
4159 curr = curr.caller
4160 ) {
4161 if (curr === computeStackTrace || curr === TraceKit.report) {
4162 // console.log('skipping internal function');
4163 continue;
4164 }
4165
4166 item = {
4167 url: null,
4168 func: UNKNOWN_FUNCTION,
4169 line: null,
4170 column: null
4171 };
4172
4173 if (curr.name) {
4174 item.func = curr.name;
4175 } else if ((parts = functionName.exec(curr.toString()))) {
4176 item.func = parts[1];
4177 }
4178
4179 if (typeof item.func === 'undefined') {
4180 try {
4181 item.func = parts.input.substring(0, parts.input.indexOf('{'));
4182 } catch (e) {}
4183 }
4184
4185 if (funcs['' + curr]) {
4186 recursion = true;
4187 } else {
4188 funcs['' + curr] = true;
4189 }
4190
4191 stack.push(item);
4192 }
4193
4194 if (depth) {
4195 // console.log('depth is ' + depth);
4196 // console.log('stack is ' + stack.length);
4197 stack.splice(0, depth);
4198 }
4199
4200 var result = {
4201 name: ex.name,
4202 message: ex.message,
4203 url: getLocationHref(),
4204 stack: stack
4205 };
4206 augmentStackTraceWithInitialElement(
4207 result,
4208 ex.sourceURL || ex.fileName,
4209 ex.line || ex.lineNumber,
4210 ex.message || ex.description
4211 );
4212 return result;
4213 }
4214
4215 /**
4216 * Computes a stack trace for an exception.
4217 * @param {Error} ex
4218 * @param {(string|number)=} depth
4219 */
4220 function computeStackTrace(ex, depth) {
4221 var stack = null;
4222 depth = depth == null ? 0 : +depth;
4223
4224 try {
4225 stack = computeStackTraceFromStackProp(ex);
4226 if (stack) {
4227 return stack;
4228 }
4229 } catch (e) {
4230 if (TraceKit.debug) {
4231 throw e;
4232 }
4233 }
4234
4235 try {
4236 stack = computeStackTraceByWalkingCallerChain(ex, depth + 1);
4237 if (stack) {
4238 return stack;
4239 }
4240 } catch (e) {
4241 if (TraceKit.debug) {
4242 throw e;
4243 }
4244 }
4245 return {
4246 name: ex.name,
4247 message: ex.message,
4248 url: getLocationHref()
4249 };
4250 }
4251
4252 computeStackTrace.augmentStackTraceWithInitialElement = augmentStackTraceWithInitialElement;
4253 computeStackTrace.computeStackTraceFromStackProp = computeStackTraceFromStackProp;
4254
4255 return computeStackTrace;
4256 })();
4257
4258 module.exports = TraceKit;
4259
4260
4261 /***/ }),
4262
4263 /***/ "./node_modules/raven-js/vendor/json-stringify-safe/stringify.js":
4264 /*!***********************************************************************!*\
4265 !*** ./node_modules/raven-js/vendor/json-stringify-safe/stringify.js ***!
4266 \***********************************************************************/
4267 /***/ ((module, exports) => {
4268
4269 /*
4270 json-stringify-safe
4271 Like JSON.stringify, but doesn't throw on circular references.
4272
4273 Originally forked from https://github.com/isaacs/json-stringify-safe
4274 version 5.0.1 on 3/8/2017 and modified to handle Errors serialization
4275 and IE8 compatibility. Tests for this are in test/vendor.
4276
4277 ISC license: https://github.com/isaacs/json-stringify-safe/blob/master/LICENSE
4278 */
4279
4280 exports = module.exports = stringify;
4281 exports.getSerialize = serializer;
4282
4283 function indexOf(haystack, needle) {
4284 for (var i = 0; i < haystack.length; ++i) {
4285 if (haystack[i] === needle) return i;
4286 }
4287 return -1;
4288 }
4289
4290 function stringify(obj, replacer, spaces, cycleReplacer) {
4291 return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces);
4292 }
4293
4294 // https://github.com/ftlabs/js-abbreviate/blob/fa709e5f139e7770a71827b1893f22418097fbda/index.js#L95-L106
4295 function stringifyError(value) {
4296 var err = {
4297 // These properties are implemented as magical getters and don't show up in for in
4298 stack: value.stack,
4299 message: value.message,
4300 name: value.name
4301 };
4302
4303 for (var i in value) {
4304 if (Object.prototype.hasOwnProperty.call(value, i)) {
4305 err[i] = value[i];
4306 }
4307 }
4308
4309 return err;
4310 }
4311
4312 function serializer(replacer, cycleReplacer) {
4313 var stack = [];
4314 var keys = [];
4315
4316 if (cycleReplacer == null) {
4317 cycleReplacer = function(key, value) {
4318 if (stack[0] === value) {
4319 return '[Circular ~]';
4320 }
4321 return '[Circular ~.' + keys.slice(0, indexOf(stack, value)).join('.') + ']';
4322 };
4323 }
4324
4325 return function(key, value) {
4326 if (stack.length > 0) {
4327 var thisPos = indexOf(stack, this);
4328 ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);
4329 ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);
4330
4331 if (~indexOf(stack, value)) {
4332 value = cycleReplacer.call(this, key, value);
4333 }
4334 } else {
4335 stack.push(value);
4336 }
4337
4338 return replacer == null
4339 ? value instanceof Error ? stringifyError(value) : value
4340 : replacer.call(this, key, value);
4341 };
4342 }
4343
4344
4345 /***/ }),
4346
4347 /***/ "./node_modules/react/cjs/react-jsx-runtime.development.js":
4348 /*!*****************************************************************!*\
4349 !*** ./node_modules/react/cjs/react-jsx-runtime.development.js ***!
4350 \*****************************************************************/
4351 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4352
4353 "use strict";
4354 /** @license React v17.0.2
4355 * react-jsx-runtime.development.js
4356 *
4357 * Copyright (c) Facebook, Inc. and its affiliates.
4358 *
4359 * This source code is licensed under the MIT license found in the
4360 * LICENSE file in the root directory of this source tree.
4361 */
4362
4363
4364
4365 if (true) {
4366 (function() {
4367 'use strict';
4368
4369 var React = __webpack_require__(/*! react */ "react");
4370 var _assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js");
4371
4372 // ATTENTION
4373 // When adding new symbols to this file,
4374 // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
4375 // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
4376 // nor polyfill, then a plain number is used for performance.
4377 var REACT_ELEMENT_TYPE = 0xeac7;
4378 var REACT_PORTAL_TYPE = 0xeaca;
4379 exports.Fragment = 0xeacb;
4380 var REACT_STRICT_MODE_TYPE = 0xeacc;
4381 var REACT_PROFILER_TYPE = 0xead2;
4382 var REACT_PROVIDER_TYPE = 0xeacd;
4383 var REACT_CONTEXT_TYPE = 0xeace;
4384 var REACT_FORWARD_REF_TYPE = 0xead0;
4385 var REACT_SUSPENSE_TYPE = 0xead1;
4386 var REACT_SUSPENSE_LIST_TYPE = 0xead8;
4387 var REACT_MEMO_TYPE = 0xead3;
4388 var REACT_LAZY_TYPE = 0xead4;
4389 var REACT_BLOCK_TYPE = 0xead9;
4390 var REACT_SERVER_BLOCK_TYPE = 0xeada;
4391 var REACT_FUNDAMENTAL_TYPE = 0xead5;
4392 var REACT_SCOPE_TYPE = 0xead7;
4393 var REACT_OPAQUE_ID_TYPE = 0xeae0;
4394 var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
4395 var REACT_OFFSCREEN_TYPE = 0xeae2;
4396 var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
4397
4398 if (typeof Symbol === 'function' && Symbol.for) {
4399 var symbolFor = Symbol.for;
4400 REACT_ELEMENT_TYPE = symbolFor('react.element');
4401 REACT_PORTAL_TYPE = symbolFor('react.portal');
4402 exports.Fragment = symbolFor('react.fragment');
4403 REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');
4404 REACT_PROFILER_TYPE = symbolFor('react.profiler');
4405 REACT_PROVIDER_TYPE = symbolFor('react.provider');
4406 REACT_CONTEXT_TYPE = symbolFor('react.context');
4407 REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
4408 REACT_SUSPENSE_TYPE = symbolFor('react.suspense');
4409 REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
4410 REACT_MEMO_TYPE = symbolFor('react.memo');
4411 REACT_LAZY_TYPE = symbolFor('react.lazy');
4412 REACT_BLOCK_TYPE = symbolFor('react.block');
4413 REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
4414 REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
4415 REACT_SCOPE_TYPE = symbolFor('react.scope');
4416 REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');
4417 REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
4418 REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');
4419 REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
4420 }
4421
4422 var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
4423 var FAUX_ITERATOR_SYMBOL = '@@iterator';
4424 function getIteratorFn(maybeIterable) {
4425 if (maybeIterable === null || typeof maybeIterable !== 'object') {
4426 return null;
4427 }
4428
4429 var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
4430
4431 if (typeof maybeIterator === 'function') {
4432 return maybeIterator;
4433 }
4434
4435 return null;
4436 }
4437
4438 var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
4439
4440 function error(format) {
4441 {
4442 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
4443 args[_key2 - 1] = arguments[_key2];
4444 }
4445
4446 printWarning('error', format, args);
4447 }
4448 }
4449
4450 function printWarning(level, format, args) {
4451 // When changing this logic, you might want to also
4452 // update consoleWithStackDev.www.js as well.
4453 {
4454 var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
4455 var stack = ReactDebugCurrentFrame.getStackAddendum();
4456
4457 if (stack !== '') {
4458 format += '%s';
4459 args = args.concat([stack]);
4460 }
4461
4462 var argsWithFormat = args.map(function (item) {
4463 return '' + item;
4464 }); // Careful: RN currently depends on this prefix
4465
4466 argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
4467 // breaks IE9: https://github.com/facebook/react/issues/13610
4468 // eslint-disable-next-line react-internal/no-production-logging
4469
4470 Function.prototype.apply.call(console[level], console, argsWithFormat);
4471 }
4472 }
4473
4474 // Filter certain DOM attributes (e.g. src, href) if their values are empty strings.
4475
4476 var enableScopeAPI = false; // Experimental Create Event Handle API.
4477
4478 function isValidElementType(type) {
4479 if (typeof type === 'string' || typeof type === 'function') {
4480 return true;
4481 } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
4482
4483
4484 if (type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) {
4485 return true;
4486 }
4487
4488 if (typeof type === 'object' && type !== null) {
4489 if (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_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
4490 return true;
4491 }
4492 }
4493
4494 return false;
4495 }
4496
4497 function getWrappedName(outerType, innerType, wrapperName) {
4498 var functionName = innerType.displayName || innerType.name || '';
4499 return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
4500 }
4501
4502 function getContextName(type) {
4503 return type.displayName || 'Context';
4504 }
4505
4506 function getComponentName(type) {
4507 if (type == null) {
4508 // Host root, text node or just invalid type.
4509 return null;
4510 }
4511
4512 {
4513 if (typeof type.tag === 'number') {
4514 error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
4515 }
4516 }
4517
4518 if (typeof type === 'function') {
4519 return type.displayName || type.name || null;
4520 }
4521
4522 if (typeof type === 'string') {
4523 return type;
4524 }
4525
4526 switch (type) {
4527 case exports.Fragment:
4528 return 'Fragment';
4529
4530 case REACT_PORTAL_TYPE:
4531 return 'Portal';
4532
4533 case REACT_PROFILER_TYPE:
4534 return 'Profiler';
4535
4536 case REACT_STRICT_MODE_TYPE:
4537 return 'StrictMode';
4538
4539 case REACT_SUSPENSE_TYPE:
4540 return 'Suspense';
4541
4542 case REACT_SUSPENSE_LIST_TYPE:
4543 return 'SuspenseList';
4544 }
4545
4546 if (typeof type === 'object') {
4547 switch (type.$$typeof) {
4548 case REACT_CONTEXT_TYPE:
4549 var context = type;
4550 return getContextName(context) + '.Consumer';
4551
4552 case REACT_PROVIDER_TYPE:
4553 var provider = type;
4554 return getContextName(provider._context) + '.Provider';
4555
4556 case REACT_FORWARD_REF_TYPE:
4557 return getWrappedName(type, type.render, 'ForwardRef');
4558
4559 case REACT_MEMO_TYPE:
4560 return getComponentName(type.type);
4561
4562 case REACT_BLOCK_TYPE:
4563 return getComponentName(type._render);
4564
4565 case REACT_LAZY_TYPE:
4566 {
4567 var lazyComponent = type;
4568 var payload = lazyComponent._payload;
4569 var init = lazyComponent._init;
4570
4571 try {
4572 return getComponentName(init(payload));
4573 } catch (x) {
4574 return null;
4575 }
4576 }
4577 }
4578 }
4579
4580 return null;
4581 }
4582
4583 // Helpers to patch console.logs to avoid logging during side-effect free
4584 // replaying on render function. This currently only patches the object
4585 // lazily which won't cover if the log function was extracted eagerly.
4586 // We could also eagerly patch the method.
4587 var disabledDepth = 0;
4588 var prevLog;
4589 var prevInfo;
4590 var prevWarn;
4591 var prevError;
4592 var prevGroup;
4593 var prevGroupCollapsed;
4594 var prevGroupEnd;
4595
4596 function disabledLog() {}
4597
4598 disabledLog.__reactDisabledLog = true;
4599 function disableLogs() {
4600 {
4601 if (disabledDepth === 0) {
4602 /* eslint-disable react-internal/no-production-logging */
4603 prevLog = console.log;
4604 prevInfo = console.info;
4605 prevWarn = console.warn;
4606 prevError = console.error;
4607 prevGroup = console.group;
4608 prevGroupCollapsed = console.groupCollapsed;
4609 prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
4610
4611 var props = {
4612 configurable: true,
4613 enumerable: true,
4614 value: disabledLog,
4615 writable: true
4616 }; // $FlowFixMe Flow thinks console is immutable.
4617
4618 Object.defineProperties(console, {
4619 info: props,
4620 log: props,
4621 warn: props,
4622 error: props,
4623 group: props,
4624 groupCollapsed: props,
4625 groupEnd: props
4626 });
4627 /* eslint-enable react-internal/no-production-logging */
4628 }
4629
4630 disabledDepth++;
4631 }
4632 }
4633 function reenableLogs() {
4634 {
4635 disabledDepth--;
4636
4637 if (disabledDepth === 0) {
4638 /* eslint-disable react-internal/no-production-logging */
4639 var props = {
4640 configurable: true,
4641 enumerable: true,
4642 writable: true
4643 }; // $FlowFixMe Flow thinks console is immutable.
4644
4645 Object.defineProperties(console, {
4646 log: _assign({}, props, {
4647 value: prevLog
4648 }),
4649 info: _assign({}, props, {
4650 value: prevInfo
4651 }),
4652 warn: _assign({}, props, {
4653 value: prevWarn
4654 }),
4655 error: _assign({}, props, {
4656 value: prevError
4657 }),
4658 group: _assign({}, props, {
4659 value: prevGroup
4660 }),
4661 groupCollapsed: _assign({}, props, {
4662 value: prevGroupCollapsed
4663 }),
4664 groupEnd: _assign({}, props, {
4665 value: prevGroupEnd
4666 })
4667 });
4668 /* eslint-enable react-internal/no-production-logging */
4669 }
4670
4671 if (disabledDepth < 0) {
4672 error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
4673 }
4674 }
4675 }
4676
4677 var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
4678 var prefix;
4679 function describeBuiltInComponentFrame(name, source, ownerFn) {
4680 {
4681 if (prefix === undefined) {
4682 // Extract the VM specific prefix used by each line.
4683 try {
4684 throw Error();
4685 } catch (x) {
4686 var match = x.stack.trim().match(/\n( *(at )?)/);
4687 prefix = match && match[1] || '';
4688 }
4689 } // We use the prefix to ensure our stacks line up with native stack frames.
4690
4691
4692 return '\n' + prefix + name;
4693 }
4694 }
4695 var reentry = false;
4696 var componentFrameCache;
4697
4698 {
4699 var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
4700 componentFrameCache = new PossiblyWeakMap();
4701 }
4702
4703 function describeNativeComponentFrame(fn, construct) {
4704 // If something asked for a stack inside a fake render, it should get ignored.
4705 if (!fn || reentry) {
4706 return '';
4707 }
4708
4709 {
4710 var frame = componentFrameCache.get(fn);
4711
4712 if (frame !== undefined) {
4713 return frame;
4714 }
4715 }
4716
4717 var control;
4718 reentry = true;
4719 var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
4720
4721 Error.prepareStackTrace = undefined;
4722 var previousDispatcher;
4723
4724 {
4725 previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
4726 // for warnings.
4727
4728 ReactCurrentDispatcher.current = null;
4729 disableLogs();
4730 }
4731
4732 try {
4733 // This should throw.
4734 if (construct) {
4735 // Something should be setting the props in the constructor.
4736 var Fake = function () {
4737 throw Error();
4738 }; // $FlowFixMe
4739
4740
4741 Object.defineProperty(Fake.prototype, 'props', {
4742 set: function () {
4743 // We use a throwing setter instead of frozen or non-writable props
4744 // because that won't throw in a non-strict mode function.
4745 throw Error();
4746 }
4747 });
4748
4749 if (typeof Reflect === 'object' && Reflect.construct) {
4750 // We construct a different control for this case to include any extra
4751 // frames added by the construct call.
4752 try {
4753 Reflect.construct(Fake, []);
4754 } catch (x) {
4755 control = x;
4756 }
4757
4758 Reflect.construct(fn, [], Fake);
4759 } else {
4760 try {
4761 Fake.call();
4762 } catch (x) {
4763 control = x;
4764 }
4765
4766 fn.call(Fake.prototype);
4767 }
4768 } else {
4769 try {
4770 throw Error();
4771 } catch (x) {
4772 control = x;
4773 }
4774
4775 fn();
4776 }
4777 } catch (sample) {
4778 // This is inlined manually because closure doesn't do it for us.
4779 if (sample && control && typeof sample.stack === 'string') {
4780 // This extracts the first frame from the sample that isn't also in the control.
4781 // Skipping one frame that we assume is the frame that calls the two.
4782 var sampleLines = sample.stack.split('\n');
4783 var controlLines = control.stack.split('\n');
4784 var s = sampleLines.length - 1;
4785 var c = controlLines.length - 1;
4786
4787 while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
4788 // We expect at least one stack frame to be shared.
4789 // Typically this will be the root most one. However, stack frames may be
4790 // cut off due to maximum stack limits. In this case, one maybe cut off
4791 // earlier than the other. We assume that the sample is longer or the same
4792 // and there for cut off earlier. So we should find the root most frame in
4793 // the sample somewhere in the control.
4794 c--;
4795 }
4796
4797 for (; s >= 1 && c >= 0; s--, c--) {
4798 // Next we find the first one that isn't the same which should be the
4799 // frame that called our sample function and the control.
4800 if (sampleLines[s] !== controlLines[c]) {
4801 // In V8, the first line is describing the message but other VMs don't.
4802 // If we're about to return the first line, and the control is also on the same
4803 // line, that's a pretty good indicator that our sample threw at same line as
4804 // the control. I.e. before we entered the sample frame. So we ignore this result.
4805 // This can happen if you passed a class to function component, or non-function.
4806 if (s !== 1 || c !== 1) {
4807 do {
4808 s--;
4809 c--; // We may still have similar intermediate frames from the construct call.
4810 // The next one that isn't the same should be our match though.
4811
4812 if (c < 0 || sampleLines[s] !== controlLines[c]) {
4813 // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
4814 var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');
4815
4816 {
4817 if (typeof fn === 'function') {
4818 componentFrameCache.set(fn, _frame);
4819 }
4820 } // Return the line we found.
4821
4822
4823 return _frame;
4824 }
4825 } while (s >= 1 && c >= 0);
4826 }
4827
4828 break;
4829 }
4830 }
4831 }
4832 } finally {
4833 reentry = false;
4834
4835 {
4836 ReactCurrentDispatcher.current = previousDispatcher;
4837 reenableLogs();
4838 }
4839
4840 Error.prepareStackTrace = previousPrepareStackTrace;
4841 } // Fallback to just using the name if we couldn't make it throw.
4842
4843
4844 var name = fn ? fn.displayName || fn.name : '';
4845 var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
4846
4847 {
4848 if (typeof fn === 'function') {
4849 componentFrameCache.set(fn, syntheticFrame);
4850 }
4851 }
4852
4853 return syntheticFrame;
4854 }
4855 function describeFunctionComponentFrame(fn, source, ownerFn) {
4856 {
4857 return describeNativeComponentFrame(fn, false);
4858 }
4859 }
4860
4861 function shouldConstruct(Component) {
4862 var prototype = Component.prototype;
4863 return !!(prototype && prototype.isReactComponent);
4864 }
4865
4866 function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
4867
4868 if (type == null) {
4869 return '';
4870 }
4871
4872 if (typeof type === 'function') {
4873 {
4874 return describeNativeComponentFrame(type, shouldConstruct(type));
4875 }
4876 }
4877
4878 if (typeof type === 'string') {
4879 return describeBuiltInComponentFrame(type);
4880 }
4881
4882 switch (type) {
4883 case REACT_SUSPENSE_TYPE:
4884 return describeBuiltInComponentFrame('Suspense');
4885
4886 case REACT_SUSPENSE_LIST_TYPE:
4887 return describeBuiltInComponentFrame('SuspenseList');
4888 }
4889
4890 if (typeof type === 'object') {
4891 switch (type.$$typeof) {
4892 case REACT_FORWARD_REF_TYPE:
4893 return describeFunctionComponentFrame(type.render);
4894
4895 case REACT_MEMO_TYPE:
4896 // Memo may contain any component type so we recursively resolve it.
4897 return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
4898
4899 case REACT_BLOCK_TYPE:
4900 return describeFunctionComponentFrame(type._render);
4901
4902 case REACT_LAZY_TYPE:
4903 {
4904 var lazyComponent = type;
4905 var payload = lazyComponent._payload;
4906 var init = lazyComponent._init;
4907
4908 try {
4909 // Lazy may contain any component type so we recursively resolve it.
4910 return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
4911 } catch (x) {}
4912 }
4913 }
4914 }
4915
4916 return '';
4917 }
4918
4919 var loggedTypeFailures = {};
4920 var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
4921
4922 function setCurrentlyValidatingElement(element) {
4923 {
4924 if (element) {
4925 var owner = element._owner;
4926 var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
4927 ReactDebugCurrentFrame.setExtraStackFrame(stack);
4928 } else {
4929 ReactDebugCurrentFrame.setExtraStackFrame(null);
4930 }
4931 }
4932 }
4933
4934 function checkPropTypes(typeSpecs, values, location, componentName, element) {
4935 {
4936 // $FlowFixMe This is okay but Flow doesn't know it.
4937 var has = Function.call.bind(Object.prototype.hasOwnProperty);
4938
4939 for (var typeSpecName in typeSpecs) {
4940 if (has(typeSpecs, typeSpecName)) {
4941 var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
4942 // fail the render phase where it didn't fail before. So we log it.
4943 // After these have been cleaned up, we'll let them throw.
4944
4945 try {
4946 // This is intentionally an invariant that gets caught. It's the same
4947 // behavior as without this statement except with a better message.
4948 if (typeof typeSpecs[typeSpecName] !== 'function') {
4949 var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
4950 err.name = 'Invariant Violation';
4951 throw err;
4952 }
4953
4954 error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
4955 } catch (ex) {
4956 error$1 = ex;
4957 }
4958
4959 if (error$1 && !(error$1 instanceof Error)) {
4960 setCurrentlyValidatingElement(element);
4961
4962 error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);
4963
4964 setCurrentlyValidatingElement(null);
4965 }
4966
4967 if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
4968 // Only monitor this failure once because there tends to be a lot of the
4969 // same error.
4970 loggedTypeFailures[error$1.message] = true;
4971 setCurrentlyValidatingElement(element);
4972
4973 error('Failed %s type: %s', location, error$1.message);
4974
4975 setCurrentlyValidatingElement(null);
4976 }
4977 }
4978 }
4979 }
4980 }
4981
4982 var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
4983 var hasOwnProperty = Object.prototype.hasOwnProperty;
4984 var RESERVED_PROPS = {
4985 key: true,
4986 ref: true,
4987 __self: true,
4988 __source: true
4989 };
4990 var specialPropKeyWarningShown;
4991 var specialPropRefWarningShown;
4992 var didWarnAboutStringRefs;
4993
4994 {
4995 didWarnAboutStringRefs = {};
4996 }
4997
4998 function hasValidRef(config) {
4999 {
5000 if (hasOwnProperty.call(config, 'ref')) {
5001 var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
5002
5003 if (getter && getter.isReactWarning) {
5004 return false;
5005 }
5006 }
5007 }
5008
5009 return config.ref !== undefined;
5010 }
5011
5012 function hasValidKey(config) {
5013 {
5014 if (hasOwnProperty.call(config, 'key')) {
5015 var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
5016
5017 if (getter && getter.isReactWarning) {
5018 return false;
5019 }
5020 }
5021 }
5022
5023 return config.key !== undefined;
5024 }
5025
5026 function warnIfStringRefCannotBeAutoConverted(config, self) {
5027 {
5028 if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
5029 var componentName = getComponentName(ReactCurrentOwner.current.type);
5030
5031 if (!didWarnAboutStringRefs[componentName]) {
5032 error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref);
5033
5034 didWarnAboutStringRefs[componentName] = true;
5035 }
5036 }
5037 }
5038 }
5039
5040 function defineKeyPropWarningGetter(props, displayName) {
5041 {
5042 var warnAboutAccessingKey = function () {
5043 if (!specialPropKeyWarningShown) {
5044 specialPropKeyWarningShown = true;
5045
5046 error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
5047 }
5048 };
5049
5050 warnAboutAccessingKey.isReactWarning = true;
5051 Object.defineProperty(props, 'key', {
5052 get: warnAboutAccessingKey,
5053 configurable: true
5054 });
5055 }
5056 }
5057
5058 function defineRefPropWarningGetter(props, displayName) {
5059 {
5060 var warnAboutAccessingRef = function () {
5061 if (!specialPropRefWarningShown) {
5062 specialPropRefWarningShown = true;
5063
5064 error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
5065 }
5066 };
5067
5068 warnAboutAccessingRef.isReactWarning = true;
5069 Object.defineProperty(props, 'ref', {
5070 get: warnAboutAccessingRef,
5071 configurable: true
5072 });
5073 }
5074 }
5075 /**
5076 * Factory method to create a new React element. This no longer adheres to
5077 * the class pattern, so do not use new to call it. Also, instanceof check
5078 * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
5079 * if something is a React Element.
5080 *
5081 * @param {*} type
5082 * @param {*} props
5083 * @param {*} key
5084 * @param {string|object} ref
5085 * @param {*} owner
5086 * @param {*} self A *temporary* helper to detect places where `this` is
5087 * different from the `owner` when React.createElement is called, so that we
5088 * can warn. We want to get rid of owner and replace string `ref`s with arrow
5089 * functions, and as long as `this` and owner are the same, there will be no
5090 * change in behavior.
5091 * @param {*} source An annotation object (added by a transpiler or otherwise)
5092 * indicating filename, line number, and/or other information.
5093 * @internal
5094 */
5095
5096
5097 var ReactElement = function (type, key, ref, self, source, owner, props) {
5098 var element = {
5099 // This tag allows us to uniquely identify this as a React Element
5100 $$typeof: REACT_ELEMENT_TYPE,
5101 // Built-in properties that belong on the element
5102 type: type,
5103 key: key,
5104 ref: ref,
5105 props: props,
5106 // Record the component responsible for creating this element.
5107 _owner: owner
5108 };
5109
5110 {
5111 // The validation flag is currently mutative. We put it on
5112 // an external backing store so that we can freeze the whole object.
5113 // This can be replaced with a WeakMap once they are implemented in
5114 // commonly used development environments.
5115 element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
5116 // the validation flag non-enumerable (where possible, which should
5117 // include every environment we run tests in), so the test framework
5118 // ignores it.
5119
5120 Object.defineProperty(element._store, 'validated', {
5121 configurable: false,
5122 enumerable: false,
5123 writable: true,
5124 value: false
5125 }); // self and source are DEV only properties.
5126
5127 Object.defineProperty(element, '_self', {
5128 configurable: false,
5129 enumerable: false,
5130 writable: false,
5131 value: self
5132 }); // Two elements created in two different places should be considered
5133 // equal for testing purposes and therefore we hide it from enumeration.
5134
5135 Object.defineProperty(element, '_source', {
5136 configurable: false,
5137 enumerable: false,
5138 writable: false,
5139 value: source
5140 });
5141
5142 if (Object.freeze) {
5143 Object.freeze(element.props);
5144 Object.freeze(element);
5145 }
5146 }
5147
5148 return element;
5149 };
5150 /**
5151 * https://github.com/reactjs/rfcs/pull/107
5152 * @param {*} type
5153 * @param {object} props
5154 * @param {string} key
5155 */
5156
5157 function jsxDEV(type, config, maybeKey, source, self) {
5158 {
5159 var propName; // Reserved names are extracted
5160
5161 var props = {};
5162 var key = null;
5163 var ref = null; // Currently, key can be spread in as a prop. This causes a potential
5164 // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
5165 // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
5166 // but as an intermediary step, we will use jsxDEV for everything except
5167 // <div {...props} key="Hi" />, because we aren't currently able to tell if
5168 // key is explicitly declared to be undefined or not.
5169
5170 if (maybeKey !== undefined) {
5171 key = '' + maybeKey;
5172 }
5173
5174 if (hasValidKey(config)) {
5175 key = '' + config.key;
5176 }
5177
5178 if (hasValidRef(config)) {
5179 ref = config.ref;
5180 warnIfStringRefCannotBeAutoConverted(config, self);
5181 } // Remaining properties are added to a new props object
5182
5183
5184 for (propName in config) {
5185 if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
5186 props[propName] = config[propName];
5187 }
5188 } // Resolve default props
5189
5190
5191 if (type && type.defaultProps) {
5192 var defaultProps = type.defaultProps;
5193
5194 for (propName in defaultProps) {
5195 if (props[propName] === undefined) {
5196 props[propName] = defaultProps[propName];
5197 }
5198 }
5199 }
5200
5201 if (key || ref) {
5202 var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
5203
5204 if (key) {
5205 defineKeyPropWarningGetter(props, displayName);
5206 }
5207
5208 if (ref) {
5209 defineRefPropWarningGetter(props, displayName);
5210 }
5211 }
5212
5213 return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
5214 }
5215 }
5216
5217 var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
5218 var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
5219
5220 function setCurrentlyValidatingElement$1(element) {
5221 {
5222 if (element) {
5223 var owner = element._owner;
5224 var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
5225 ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
5226 } else {
5227 ReactDebugCurrentFrame$1.setExtraStackFrame(null);
5228 }
5229 }
5230 }
5231
5232 var propTypesMisspellWarningShown;
5233
5234 {
5235 propTypesMisspellWarningShown = false;
5236 }
5237 /**
5238 * Verifies the object is a ReactElement.
5239 * See https://reactjs.org/docs/react-api.html#isvalidelement
5240 * @param {?object} object
5241 * @return {boolean} True if `object` is a ReactElement.
5242 * @final
5243 */
5244
5245 function isValidElement(object) {
5246 {
5247 return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
5248 }
5249 }
5250
5251 function getDeclarationErrorAddendum() {
5252 {
5253 if (ReactCurrentOwner$1.current) {
5254 var name = getComponentName(ReactCurrentOwner$1.current.type);
5255
5256 if (name) {
5257 return '\n\nCheck the render method of `' + name + '`.';
5258 }
5259 }
5260
5261 return '';
5262 }
5263 }
5264
5265 function getSourceInfoErrorAddendum(source) {
5266 {
5267 if (source !== undefined) {
5268 var fileName = source.fileName.replace(/^.*[\\\/]/, '');
5269 var lineNumber = source.lineNumber;
5270 return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
5271 }
5272
5273 return '';
5274 }
5275 }
5276 /**
5277 * Warn if there's no key explicitly set on dynamic arrays of children or
5278 * object keys are not valid. This allows us to keep track of children between
5279 * updates.
5280 */
5281
5282
5283 var ownerHasKeyUseWarning = {};
5284
5285 function getCurrentComponentErrorInfo(parentType) {
5286 {
5287 var info = getDeclarationErrorAddendum();
5288
5289 if (!info) {
5290 var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
5291
5292 if (parentName) {
5293 info = "\n\nCheck the top-level render call using <" + parentName + ">.";
5294 }
5295 }
5296
5297 return info;
5298 }
5299 }
5300 /**
5301 * Warn if the element doesn't have an explicit key assigned to it.
5302 * This element is in an array. The array could grow and shrink or be
5303 * reordered. All children that haven't already been validated are required to
5304 * have a "key" property assigned to it. Error statuses are cached so a warning
5305 * will only be shown once.
5306 *
5307 * @internal
5308 * @param {ReactElement} element Element that requires a key.
5309 * @param {*} parentType element's parent's type.
5310 */
5311
5312
5313 function validateExplicitKey(element, parentType) {
5314 {
5315 if (!element._store || element._store.validated || element.key != null) {
5316 return;
5317 }
5318
5319 element._store.validated = true;
5320 var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
5321
5322 if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
5323 return;
5324 }
5325
5326 ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
5327 // property, it may be the creator of the child that's responsible for
5328 // assigning it a key.
5329
5330 var childOwner = '';
5331
5332 if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
5333 // Give the component that originally created this child.
5334 childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
5335 }
5336
5337 setCurrentlyValidatingElement$1(element);
5338
5339 error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
5340
5341 setCurrentlyValidatingElement$1(null);
5342 }
5343 }
5344 /**
5345 * Ensure that every element either is passed in a static location, in an
5346 * array with an explicit keys property defined, or in an object literal
5347 * with valid key property.
5348 *
5349 * @internal
5350 * @param {ReactNode} node Statically passed child of any type.
5351 * @param {*} parentType node's parent's type.
5352 */
5353
5354
5355 function validateChildKeys(node, parentType) {
5356 {
5357 if (typeof node !== 'object') {
5358 return;
5359 }
5360
5361 if (Array.isArray(node)) {
5362 for (var i = 0; i < node.length; i++) {
5363 var child = node[i];
5364
5365 if (isValidElement(child)) {
5366 validateExplicitKey(child, parentType);
5367 }
5368 }
5369 } else if (isValidElement(node)) {
5370 // This element was passed in a valid location.
5371 if (node._store) {
5372 node._store.validated = true;
5373 }
5374 } else if (node) {
5375 var iteratorFn = getIteratorFn(node);
5376
5377 if (typeof iteratorFn === 'function') {
5378 // Entry iterators used to provide implicit keys,
5379 // but now we print a separate warning for them later.
5380 if (iteratorFn !== node.entries) {
5381 var iterator = iteratorFn.call(node);
5382 var step;
5383
5384 while (!(step = iterator.next()).done) {
5385 if (isValidElement(step.value)) {
5386 validateExplicitKey(step.value, parentType);
5387 }
5388 }
5389 }
5390 }
5391 }
5392 }
5393 }
5394 /**
5395 * Given an element, validate that its props follow the propTypes definition,
5396 * provided by the type.
5397 *
5398 * @param {ReactElement} element
5399 */
5400
5401
5402 function validatePropTypes(element) {
5403 {
5404 var type = element.type;
5405
5406 if (type === null || type === undefined || typeof type === 'string') {
5407 return;
5408 }
5409
5410 var propTypes;
5411
5412 if (typeof type === 'function') {
5413 propTypes = type.propTypes;
5414 } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
5415 // Inner props are checked in the reconciler.
5416 type.$$typeof === REACT_MEMO_TYPE)) {
5417 propTypes = type.propTypes;
5418 } else {
5419 return;
5420 }
5421
5422 if (propTypes) {
5423 // Intentionally inside to avoid triggering lazy initializers:
5424 var name = getComponentName(type);
5425 checkPropTypes(propTypes, element.props, 'prop', name, element);
5426 } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
5427 propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
5428
5429 var _name = getComponentName(type);
5430
5431 error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
5432 }
5433
5434 if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
5435 error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
5436 }
5437 }
5438 }
5439 /**
5440 * Given a fragment, validate that it can only be provided with fragment props
5441 * @param {ReactElement} fragment
5442 */
5443
5444
5445 function validateFragmentProps(fragment) {
5446 {
5447 var keys = Object.keys(fragment.props);
5448
5449 for (var i = 0; i < keys.length; i++) {
5450 var key = keys[i];
5451
5452 if (key !== 'children' && key !== 'key') {
5453 setCurrentlyValidatingElement$1(fragment);
5454
5455 error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
5456
5457 setCurrentlyValidatingElement$1(null);
5458 break;
5459 }
5460 }
5461
5462 if (fragment.ref !== null) {
5463 setCurrentlyValidatingElement$1(fragment);
5464
5465 error('Invalid attribute `ref` supplied to `React.Fragment`.');
5466
5467 setCurrentlyValidatingElement$1(null);
5468 }
5469 }
5470 }
5471
5472 function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
5473 {
5474 var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
5475 // succeed and there will likely be errors in render.
5476
5477 if (!validType) {
5478 var info = '';
5479
5480 if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
5481 info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
5482 }
5483
5484 var sourceInfo = getSourceInfoErrorAddendum(source);
5485
5486 if (sourceInfo) {
5487 info += sourceInfo;
5488 } else {
5489 info += getDeclarationErrorAddendum();
5490 }
5491
5492 var typeString;
5493
5494 if (type === null) {
5495 typeString = 'null';
5496 } else if (Array.isArray(type)) {
5497 typeString = 'array';
5498 } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
5499 typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
5500 info = ' Did you accidentally export a JSX literal instead of a component?';
5501 } else {
5502 typeString = typeof type;
5503 }
5504
5505 error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
5506 }
5507
5508 var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
5509 // TODO: Drop this when these are no longer allowed as the type argument.
5510
5511 if (element == null) {
5512 return element;
5513 } // Skip key warning if the type isn't valid since our key validation logic
5514 // doesn't expect a non-string/function type and can throw confusing errors.
5515 // We don't want exception behavior to differ between dev and prod.
5516 // (Rendering will throw with a helpful message and as soon as the type is
5517 // fixed, the key warnings will appear.)
5518
5519
5520 if (validType) {
5521 var children = props.children;
5522
5523 if (children !== undefined) {
5524 if (isStaticChildren) {
5525 if (Array.isArray(children)) {
5526 for (var i = 0; i < children.length; i++) {
5527 validateChildKeys(children[i], type);
5528 }
5529
5530 if (Object.freeze) {
5531 Object.freeze(children);
5532 }
5533 } else {
5534 error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
5535 }
5536 } else {
5537 validateChildKeys(children, type);
5538 }
5539 }
5540 }
5541
5542 if (type === exports.Fragment) {
5543 validateFragmentProps(element);
5544 } else {
5545 validatePropTypes(element);
5546 }
5547
5548 return element;
5549 }
5550 } // These two functions exist to still get child warnings in dev
5551 // even with the prod transform. This means that jsxDEV is purely
5552 // opt-in behavior for better messages but that we won't stop
5553 // giving you warnings if you use production apis.
5554
5555 function jsxWithValidationStatic(type, props, key) {
5556 {
5557 return jsxWithValidation(type, props, key, true);
5558 }
5559 }
5560 function jsxWithValidationDynamic(type, props, key) {
5561 {
5562 return jsxWithValidation(type, props, key, false);
5563 }
5564 }
5565
5566 var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.
5567 // for now we can ship identical prod functions
5568
5569 var jsxs = jsxWithValidationStatic ;
5570
5571 exports.jsx = jsx;
5572 exports.jsxs = jsxs;
5573 })();
5574 }
5575
5576
5577 /***/ }),
5578
5579 /***/ "./node_modules/react/jsx-runtime.js":
5580 /*!*******************************************!*\
5581 !*** ./node_modules/react/jsx-runtime.js ***!
5582 \*******************************************/
5583 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
5584
5585 "use strict";
5586
5587
5588 if (false) {} else {
5589 module.exports = __webpack_require__(/*! ./cjs/react-jsx-runtime.development.js */ "./node_modules/react/cjs/react-jsx-runtime.development.js");
5590 }
5591
5592
5593 /***/ }),
5594
5595 /***/ "react":
5596 /*!************************!*\
5597 !*** external "React" ***!
5598 \************************/
5599 /***/ ((module) => {
5600
5601 "use strict";
5602 module.exports = window["React"];
5603
5604 /***/ }),
5605
5606 /***/ "react-dom":
5607 /*!***************************!*\
5608 !*** external "ReactDOM" ***!
5609 \***************************/
5610 /***/ ((module) => {
5611
5612 "use strict";
5613 module.exports = window["ReactDOM"];
5614
5615 /***/ }),
5616
5617 /***/ "jquery":
5618 /*!*************************!*\
5619 !*** external "jQuery" ***!
5620 \*************************/
5621 /***/ ((module) => {
5622
5623 "use strict";
5624 module.exports = window["jQuery"];
5625
5626 /***/ }),
5627
5628 /***/ "@wordpress/i18n":
5629 /*!******************************!*\
5630 !*** external ["wp","i18n"] ***!
5631 \******************************/
5632 /***/ ((module) => {
5633
5634 "use strict";
5635 module.exports = window["wp"]["i18n"];
5636
5637 /***/ }),
5638
5639 /***/ "./node_modules/@linaria/react/dist/index.mjs":
5640 /*!****************************************************!*\
5641 !*** ./node_modules/@linaria/react/dist/index.mjs ***!
5642 \****************************************************/
5643 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
5644
5645 "use strict";
5646 __webpack_require__.r(__webpack_exports__);
5647 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5648 /* harmony export */ "styled": () => (/* binding */ styled_default)
5649 /* harmony export */ });
5650 /* harmony import */ var _emotion_is_prop_valid__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @emotion/is-prop-valid */ "./node_modules/@linaria/react/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js");
5651 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
5652 /* harmony import */ var _linaria_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @linaria/core */ "./node_modules/@linaria/react/node_modules/@linaria/core/dist/index.mjs");
5653 // src/styled.ts
5654
5655
5656
5657 var isCapital = (ch) => ch.toUpperCase() === ch;
5658 var filterKey = (keys) => (key) => keys.indexOf(key) === -1;
5659 var omit = (obj, keys) => {
5660 const res = {};
5661 Object.keys(obj).filter(filterKey(keys)).forEach((key) => {
5662 res[key] = obj[key];
5663 });
5664 return res;
5665 };
5666 function filterProps(asIs, props, omitKeys) {
5667 const filteredProps = omit(props, omitKeys);
5668 if (!asIs) {
5669 const interopValidAttr = typeof _emotion_is_prop_valid__WEBPACK_IMPORTED_MODULE_0__["default"] === "function" ? { default: _emotion_is_prop_valid__WEBPACK_IMPORTED_MODULE_0__["default"] } : _emotion_is_prop_valid__WEBPACK_IMPORTED_MODULE_0__["default"];
5670 Object.keys(filteredProps).forEach((key) => {
5671 if (!interopValidAttr.default(key)) {
5672 delete filteredProps[key];
5673 }
5674 });
5675 }
5676 return filteredProps;
5677 }
5678 var warnIfInvalid = (value, componentName) => {
5679 if (true) {
5680 if (typeof value === "string" || typeof value === "number" && isFinite(value)) {
5681 return;
5682 }
5683 const stringified = typeof value === "object" ? JSON.stringify(value) : String(value);
5684 console.warn(
5685 `An interpolation evaluated to '${stringified}' in the component '${componentName}', which is probably a mistake. You should explicitly cast or transform the value to a string.`
5686 );
5687 }
5688 };
5689 function styled(tag) {
5690 return (options) => {
5691 if (true) {
5692 if (Array.isArray(options)) {
5693 throw new Error(
5694 'Using the "styled" tag in runtime is not supported. Make sure you have set up the Babel plugin correctly. See https://github.com/callstack/linaria#setup'
5695 );
5696 }
5697 }
5698 const render = (props, ref) => {
5699 const { as: component = tag, class: className } = props;
5700 const shouldKeepProps = options.propsAsIs === void 0 ? !(typeof component === "string" && component.indexOf("-") === -1 && !isCapital(component[0])) : options.propsAsIs;
5701 const filteredProps = filterProps(shouldKeepProps, props, [
5702 "as",
5703 "class"
5704 ]);
5705 filteredProps.ref = ref;
5706 filteredProps.className = options.atomic ? (0,_linaria_core__WEBPACK_IMPORTED_MODULE_2__.cx)(options.class, filteredProps.className || className) : (0,_linaria_core__WEBPACK_IMPORTED_MODULE_2__.cx)(filteredProps.className || className, options.class);
5707 const { vars } = options;
5708 if (vars) {
5709 const style = {};
5710 for (const name in vars) {
5711 const variable = vars[name];
5712 const result = variable[0];
5713 const unit = variable[1] || "";
5714 const value = typeof result === "function" ? result(props) : result;
5715 warnIfInvalid(value, options.name);
5716 style[`--${name}`] = `${value}${unit}`;
5717 }
5718 const ownStyle = filteredProps.style || {};
5719 const keys = Object.keys(ownStyle);
5720 if (keys.length > 0) {
5721 keys.forEach((key) => {
5722 style[key] = ownStyle[key];
5723 });
5724 }
5725 filteredProps.style = style;
5726 }
5727 if (tag.__linaria && tag !== component) {
5728 filteredProps.as = component;
5729 return react__WEBPACK_IMPORTED_MODULE_1__.createElement(tag, filteredProps);
5730 }
5731 return react__WEBPACK_IMPORTED_MODULE_1__.createElement(component, filteredProps);
5732 };
5733 const Result = react__WEBPACK_IMPORTED_MODULE_1__.forwardRef ? react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(render) : (props) => {
5734 const rest = omit(props, ["innerRef"]);
5735 return render(rest, props.innerRef);
5736 };
5737 Result.displayName = options.name;
5738 Result.__linaria = {
5739 className: options.class,
5740 extends: tag
5741 };
5742 return Result;
5743 };
5744 }
5745 var styled_default = true ? new Proxy(styled, {
5746 get(o, prop) {
5747 return o(prop);
5748 }
5749 }) : 0;
5750
5751 //# sourceMappingURL=index.mjs.map
5752
5753 /***/ }),
5754
5755 /***/ "./node_modules/@linaria/react/node_modules/@linaria/core/dist/index.mjs":
5756 /*!*******************************************************************************!*\
5757 !*** ./node_modules/@linaria/react/node_modules/@linaria/core/dist/index.mjs ***!
5758 \*******************************************************************************/
5759 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
5760
5761 "use strict";
5762 __webpack_require__.r(__webpack_exports__);
5763 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5764 /* harmony export */ "css": () => (/* binding */ css_default),
5765 /* harmony export */ "cx": () => (/* binding */ cx_default)
5766 /* harmony export */ });
5767 // src/css.ts
5768 var css = () => {
5769 throw new Error(
5770 'Using the "css" tag in runtime is not supported. Make sure you have set up the Babel plugin correctly.'
5771 );
5772 };
5773 var css_default = css;
5774
5775 // src/cx.ts
5776 var cx = function cx2() {
5777 const presentClassNames = Array.prototype.slice.call(arguments).filter(Boolean);
5778 const atomicClasses = {};
5779 const nonAtomicClasses = [];
5780 presentClassNames.forEach((arg) => {
5781 const individualClassNames = arg ? arg.split(" ") : [];
5782 individualClassNames.forEach((className) => {
5783 if (className.startsWith("atm_")) {
5784 const [, keyHash] = className.split("_");
5785 atomicClasses[keyHash] = className;
5786 } else {
5787 nonAtomicClasses.push(className);
5788 }
5789 });
5790 });
5791 const result = [];
5792 for (const keyHash in atomicClasses) {
5793 if (Object.prototype.hasOwnProperty.call(atomicClasses, keyHash)) {
5794 result.push(atomicClasses[keyHash]);
5795 }
5796 }
5797 result.push(...nonAtomicClasses);
5798 return result.join(" ");
5799 };
5800 var cx_default = cx;
5801
5802 //# sourceMappingURL=index.mjs.map
5803
5804 /***/ })
5805
5806 /******/ });
5807 /************************************************************************/
5808 /******/ // The module cache
5809 /******/ var __webpack_module_cache__ = {};
5810 /******/
5811 /******/ // The require function
5812 /******/ function __webpack_require__(moduleId) {
5813 /******/ // Check if module is in cache
5814 /******/ var cachedModule = __webpack_module_cache__[moduleId];
5815 /******/ if (cachedModule !== undefined) {
5816 /******/ return cachedModule.exports;
5817 /******/ }
5818 /******/ // Create a new module (and put it into the cache)
5819 /******/ var module = __webpack_module_cache__[moduleId] = {
5820 /******/ // no module.id needed
5821 /******/ // no module.loaded needed
5822 /******/ exports: {}
5823 /******/ };
5824 /******/
5825 /******/ // Execute the module function
5826 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
5827 /******/
5828 /******/ // Return the exports of the module
5829 /******/ return module.exports;
5830 /******/ }
5831 /******/
5832 /************************************************************************/
5833 /******/ /* webpack/runtime/compat get default export */
5834 /******/ (() => {
5835 /******/ // getDefaultExport function for compatibility with non-harmony modules
5836 /******/ __webpack_require__.n = (module) => {
5837 /******/ var getter = module && module.__esModule ?
5838 /******/ () => (module['default']) :
5839 /******/ () => (module);
5840 /******/ __webpack_require__.d(getter, { a: getter });
5841 /******/ return getter;
5842 /******/ };
5843 /******/ })();
5844 /******/
5845 /******/ /* webpack/runtime/define property getters */
5846 /******/ (() => {
5847 /******/ // define getter functions for harmony exports
5848 /******/ __webpack_require__.d = (exports, definition) => {
5849 /******/ for(var key in definition) {
5850 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
5851 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
5852 /******/ }
5853 /******/ }
5854 /******/ };
5855 /******/ })();
5856 /******/
5857 /******/ /* webpack/runtime/global */
5858 /******/ (() => {
5859 /******/ __webpack_require__.g = (function() {
5860 /******/ if (typeof globalThis === 'object') return globalThis;
5861 /******/ try {
5862 /******/ return this || new Function('return this')();
5863 /******/ } catch (e) {
5864 /******/ if (typeof window === 'object') return window;
5865 /******/ }
5866 /******/ })();
5867 /******/ })();
5868 /******/
5869 /******/ /* webpack/runtime/hasOwnProperty shorthand */
5870 /******/ (() => {
5871 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
5872 /******/ })();
5873 /******/
5874 /******/ /* webpack/runtime/make namespace object */
5875 /******/ (() => {
5876 /******/ // define __esModule on exports
5877 /******/ __webpack_require__.r = (exports) => {
5878 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
5879 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5880 /******/ }
5881 /******/ Object.defineProperty(exports, '__esModule', { value: true });
5882 /******/ };
5883 /******/ })();
5884 /******/
5885 /************************************************************************/
5886 var __webpack_exports__ = {};
5887 // This entry need to be wrapped in an IIFE because it need to be in strict mode.
5888 (() => {
5889 "use strict";
5890 /*!********************************!*\
5891 !*** ./scripts/entries/app.ts ***!
5892 \********************************/
5893 __webpack_require__.r(__webpack_exports__);
5894 /* harmony import */ var _utils_appUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/appUtils */ "./scripts/utils/appUtils.ts");
5895 /* harmony import */ var _iframe_renderIframeApp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../iframe/renderIframeApp */ "./scripts/iframe/renderIframeApp.tsx");
5896
5897
5898 (0,_utils_appUtils__WEBPACK_IMPORTED_MODULE_0__.initAppOnReady)(_iframe_renderIframeApp__WEBPACK_IMPORTED_MODULE_1__["default"]);
5899 })();
5900
5901 /******/ })()
5902 ;
5903 //# sourceMappingURL=leadin.js.map