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

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