PluginProbe
HubSpot All-In-One Marketing – Forms, Popups, Live Chat / 11.1.10
HubSpot All-In-One Marketing – Forms, Popups, Live Chat v11.1.10
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.10, at build/leadin.js

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