PluginProbe
HubSpot All-In-One Marketing – Forms, Popups, Live Chat / 11.0.52
HubSpot All-In-One Marketing – Forms, Popups, Live Chat v11.0.52
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 / gutenberg.js

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

13,105 lines 498.5 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/is-prop-valid/dist/is-prop-valid.browser.esm.js":
5 /*!*******************************************************************************!*\
6 !*** ./node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js ***!
7 \*******************************************************************************/
8 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9
10 "use strict";
11 __webpack_require__.r(__webpack_exports__);
12 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
14 /* harmony export */ });
15 /* harmony import */ var _emotion_memoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @emotion/memoize */ "./node_modules/@emotion/is-prop-valid/node_modules/@emotion/memoize/dist/memoize.browser.esm.js");
16
17
18 var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|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|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|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
19
20 var index = (0,_emotion_memoize__WEBPACK_IMPORTED_MODULE_0__["default"])(function (prop) {
21 return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
22 /* o */
23 && prop.charCodeAt(1) === 110
24 /* n */
25 && prop.charCodeAt(2) < 91;
26 }
27 /* Z+1 */
28 );
29
30 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (index);
31
32
33 /***/ }),
34
35 /***/ "./node_modules/@emotion/is-prop-valid/node_modules/@emotion/memoize/dist/memoize.browser.esm.js":
36 /*!*******************************************************************************************************!*\
37 !*** ./node_modules/@emotion/is-prop-valid/node_modules/@emotion/memoize/dist/memoize.browser.esm.js ***!
38 \*******************************************************************************************************/
39 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
40
41 "use strict";
42 __webpack_require__.r(__webpack_exports__);
43 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
44 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
45 /* harmony export */ });
46 function memoize(fn) {
47 var cache = {};
48 return function (arg) {
49 if (cache[arg] === undefined) cache[arg] = fn(arg);
50 return cache[arg];
51 };
52 }
53
54 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (memoize);
55
56
57 /***/ }),
58
59 /***/ "./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js":
60 /*!*******************************************************************!*\
61 !*** ./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js ***!
62 \*******************************************************************/
63 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
64
65 "use strict";
66 __webpack_require__.r(__webpack_exports__);
67 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
68 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
69 /* harmony export */ });
70 function memoize(fn) {
71 var cache = Object.create(null);
72 return function (arg) {
73 if (cache[arg] === undefined) cache[arg] = fn(arg);
74 return cache[arg];
75 };
76 }
77
78 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (memoize);
79
80
81 /***/ }),
82
83 /***/ "./node_modules/@emotion/unitless/dist/unitless.browser.esm.js":
84 /*!*********************************************************************!*\
85 !*** ./node_modules/@emotion/unitless/dist/unitless.browser.esm.js ***!
86 \*********************************************************************/
87 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
88
89 "use strict";
90 __webpack_require__.r(__webpack_exports__);
91 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
92 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
93 /* harmony export */ });
94 var unitlessKeys = {
95 animationIterationCount: 1,
96 borderImageOutset: 1,
97 borderImageSlice: 1,
98 borderImageWidth: 1,
99 boxFlex: 1,
100 boxFlexGroup: 1,
101 boxOrdinalGroup: 1,
102 columnCount: 1,
103 columns: 1,
104 flex: 1,
105 flexGrow: 1,
106 flexPositive: 1,
107 flexShrink: 1,
108 flexNegative: 1,
109 flexOrder: 1,
110 gridRow: 1,
111 gridRowEnd: 1,
112 gridRowSpan: 1,
113 gridRowStart: 1,
114 gridColumn: 1,
115 gridColumnEnd: 1,
116 gridColumnSpan: 1,
117 gridColumnStart: 1,
118 msGridRow: 1,
119 msGridRowSpan: 1,
120 msGridColumn: 1,
121 msGridColumnSpan: 1,
122 fontWeight: 1,
123 lineHeight: 1,
124 opacity: 1,
125 order: 1,
126 orphans: 1,
127 tabSize: 1,
128 widows: 1,
129 zIndex: 1,
130 zoom: 1,
131 WebkitLineClamp: 1,
132 // SVG-related properties
133 fillOpacity: 1,
134 floodOpacity: 1,
135 stopOpacity: 1,
136 strokeDasharray: 1,
137 strokeDashoffset: 1,
138 strokeMiterlimit: 1,
139 strokeOpacity: 1,
140 strokeWidth: 1
141 };
142
143 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (unitlessKeys);
144
145
146 /***/ }),
147
148 /***/ "./node_modules/@linaria/react/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js":
149 /*!***********************************************************************************************************!*\
150 !*** ./node_modules/@linaria/react/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js ***!
151 \***********************************************************************************************************/
152 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
153
154 "use strict";
155 __webpack_require__.r(__webpack_exports__);
156 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
157 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
158 /* harmony export */ });
159 /* harmony import */ var _emotion_memoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @emotion/memoize */ "./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js");
160
161
162 var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
163
164 var isPropValid = /* #__PURE__ */(0,_emotion_memoize__WEBPACK_IMPORTED_MODULE_0__["default"])(function (prop) {
165 return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
166 /* o */
167 && prop.charCodeAt(1) === 110
168 /* n */
169 && prop.charCodeAt(2) < 91;
170 }
171 /* Z+1 */
172 );
173
174 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isPropValid);
175
176
177 /***/ }),
178
179 /***/ "./scripts/constants/defaultFormOptions.ts":
180 /*!*************************************************!*\
181 !*** ./scripts/constants/defaultFormOptions.ts ***!
182 \*************************************************/
183 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
184
185 "use strict";
186 __webpack_require__.r(__webpack_exports__);
187 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
188 /* harmony export */ "DEFAULT_OPTIONS": () => (/* binding */ DEFAULT_OPTIONS),
189 /* harmony export */ "isDefaultForm": () => (/* binding */ isDefaultForm)
190 /* harmony export */ });
191 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
192 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
193
194 var REGISTRATION_FORM = 'REGISTRATION_FORM';
195 var CONTACT_US_FORM = 'CONTACT_US_FORM';
196 var NEWSLETTER_FORM = 'NEWSLETTER_FORM';
197 var SUPPORT_FORM = 'SUPPORT_FORM';
198 var EVENT_FORM = 'EVENT_FORM';
199 var DEFAULT_OPTIONS = {
200 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Templates', 'leadin'),
201 options: [{
202 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Registration Form', 'leadin'),
203 value: REGISTRATION_FORM
204 }, {
205 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Contact us Form', 'leadin'),
206 value: CONTACT_US_FORM
207 }, {
208 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Newsletter sign-up Form', 'leadin'),
209 value: NEWSLETTER_FORM
210 }, {
211 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Support Form', 'leadin'),
212 value: SUPPORT_FORM
213 }, {
214 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Event Registration Form', 'leadin'),
215 value: EVENT_FORM
216 }]
217 };
218 function isDefaultForm(value) {
219 return value === REGISTRATION_FORM || value === CONTACT_US_FORM || value === NEWSLETTER_FORM || value === SUPPORT_FORM || value === EVENT_FORM;
220 }
221
222 /***/ }),
223
224 /***/ "./scripts/constants/leadinConfig.ts":
225 /*!*******************************************!*\
226 !*** ./scripts/constants/leadinConfig.ts ***!
227 \*******************************************/
228 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
229
230 "use strict";
231 __webpack_require__.r(__webpack_exports__);
232 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
233 /* harmony export */ "accountName": () => (/* binding */ accountName),
234 /* harmony export */ "activationTime": () => (/* binding */ activationTime),
235 /* harmony export */ "adminUrl": () => (/* binding */ adminUrl),
236 /* harmony export */ "connectionStatus": () => (/* binding */ connectionStatus),
237 /* harmony export */ "contentEmbed": () => (/* binding */ contentEmbed),
238 /* harmony export */ "deviceId": () => (/* binding */ deviceId),
239 /* harmony export */ "didDisconnect": () => (/* binding */ didDisconnect),
240 /* harmony export */ "env": () => (/* binding */ env),
241 /* harmony export */ "formsScript": () => (/* binding */ formsScript),
242 /* harmony export */ "formsScriptPayload": () => (/* binding */ formsScriptPayload),
243 /* harmony export */ "hublet": () => (/* binding */ hublet),
244 /* harmony export */ "hubspotBaseUrl": () => (/* binding */ hubspotBaseUrl),
245 /* harmony export */ "hubspotNonce": () => (/* binding */ hubspotNonce),
246 /* harmony export */ "iframeUrl": () => (/* binding */ iframeUrl),
247 /* harmony export */ "impactLink": () => (/* binding */ impactLink),
248 /* harmony export */ "leadinPluginVersion": () => (/* binding */ leadinPluginVersion),
249 /* harmony export */ "leadinQueryParams": () => (/* binding */ leadinQueryParams),
250 /* harmony export */ "locale": () => (/* binding */ locale),
251 /* harmony export */ "loginUrl": () => (/* binding */ loginUrl),
252 /* harmony export */ "meetingsScript": () => (/* binding */ meetingsScript),
253 /* harmony export */ "phpVersion": () => (/* binding */ phpVersion),
254 /* harmony export */ "pluginPath": () => (/* binding */ pluginPath),
255 /* harmony export */ "plugins": () => (/* binding */ plugins),
256 /* harmony export */ "portalDomain": () => (/* binding */ portalDomain),
257 /* harmony export */ "portalEmail": () => (/* binding */ portalEmail),
258 /* harmony export */ "portalId": () => (/* binding */ portalId),
259 /* harmony export */ "redirectNonce": () => (/* binding */ redirectNonce),
260 /* harmony export */ "refreshToken": () => (/* binding */ refreshToken),
261 /* harmony export */ "requiresContentEmbedScope": () => (/* binding */ requiresContentEmbedScope),
262 /* harmony export */ "restNonce": () => (/* binding */ restNonce),
263 /* harmony export */ "restUrl": () => (/* binding */ restUrl),
264 /* harmony export */ "reviewSkippedDate": () => (/* binding */ reviewSkippedDate),
265 /* harmony export */ "theme": () => (/* binding */ theme),
266 /* harmony export */ "trackConsent": () => (/* binding */ trackConsent),
267 /* harmony export */ "wpVersion": () => (/* binding */ wpVersion)
268 /* harmony export */ });
269 var _window$leadinConfig = window.leadinConfig,
270 accountName = _window$leadinConfig.accountName,
271 adminUrl = _window$leadinConfig.adminUrl,
272 activationTime = _window$leadinConfig.activationTime,
273 connectionStatus = _window$leadinConfig.connectionStatus,
274 deviceId = _window$leadinConfig.deviceId,
275 didDisconnect = _window$leadinConfig.didDisconnect,
276 env = _window$leadinConfig.env,
277 formsScript = _window$leadinConfig.formsScript,
278 meetingsScript = _window$leadinConfig.meetingsScript,
279 formsScriptPayload = _window$leadinConfig.formsScriptPayload,
280 hublet = _window$leadinConfig.hublet,
281 hubspotBaseUrl = _window$leadinConfig.hubspotBaseUrl,
282 hubspotNonce = _window$leadinConfig.hubspotNonce,
283 iframeUrl = _window$leadinConfig.iframeUrl,
284 impactLink = _window$leadinConfig.impactLink,
285 leadinPluginVersion = _window$leadinConfig.leadinPluginVersion,
286 leadinQueryParams = _window$leadinConfig.leadinQueryParams,
287 locale = _window$leadinConfig.locale,
288 loginUrl = _window$leadinConfig.loginUrl,
289 phpVersion = _window$leadinConfig.phpVersion,
290 pluginPath = _window$leadinConfig.pluginPath,
291 plugins = _window$leadinConfig.plugins,
292 portalDomain = _window$leadinConfig.portalDomain,
293 portalEmail = _window$leadinConfig.portalEmail,
294 portalId = _window$leadinConfig.portalId,
295 redirectNonce = _window$leadinConfig.redirectNonce,
296 restNonce = _window$leadinConfig.restNonce,
297 restUrl = _window$leadinConfig.restUrl,
298 refreshToken = _window$leadinConfig.refreshToken,
299 reviewSkippedDate = _window$leadinConfig.reviewSkippedDate,
300 theme = _window$leadinConfig.theme,
301 trackConsent = _window$leadinConfig.trackConsent,
302 wpVersion = _window$leadinConfig.wpVersion,
303 contentEmbed = _window$leadinConfig.contentEmbed,
304 requiresContentEmbedScope = _window$leadinConfig.requiresContentEmbedScope;
305
306
307 /***/ }),
308
309 /***/ "./scripts/gutenberg/Common/CalendarIcon.tsx":
310 /*!***************************************************!*\
311 !*** ./scripts/gutenberg/Common/CalendarIcon.tsx ***!
312 \***************************************************/
313 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
314
315 "use strict";
316 __webpack_require__.r(__webpack_exports__);
317 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
318 /* harmony export */ "default": () => (/* binding */ CalendarIcon)
319 /* harmony export */ });
320 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
321
322 function CalendarIcon() {
323 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", {
324 width: "18",
325 height: "18",
326 viewBox: "0 0 18 18",
327 fill: "none",
328 xmlns: "http://www.w3.org/2000/svg",
329 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("g", {
330 clipPath: "url(#clip0_903_1965)",
331 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", {
332 fillRule: "evenodd",
333 clipRule: "evenodd",
334 d: "M13.519 2.48009H15.069H15.0697C16.2619 2.48719 17.2262 3.45597 17.2262 4.65016V12.7434C17.223 12.9953 17.1203 13.2226 16.9549 13.3886L12.6148 17.7287C12.4488 17.8941 12.2214 17.9968 11.9689 18H3.29508C2.09637 18 1.125 17.0286 1.125 15.8299V4.65016C1.125 3.45404 2.09314 2.48396 3.28862 2.48009H4.83867V0.930032C4.83867 0.416577 5.25525 0 5.7687 0C6.28216 0 6.69874 0.416577 6.69874 0.930032V2.48009H11.6589V0.930032C11.6589 0.416577 12.0755 0 12.5889 0C13.1024 0 13.519 0.416577 13.519 0.930032V2.48009ZM2.98506 15.8312C2.99863 15.9882 3.12909 16.1115 3.28862 16.1141H11.5814L11.6589 16.0366V13.634C11.6589 12.9494 12.2143 12.394 12.899 12.394H15.2951L15.3726 12.3165V7.4338H2.98506V15.8312ZM4.83868 8.68029H6.07873H6.07937C6.42684 8.68029 6.71037 8.95478 6.72458 9.30032V14.2863C6.72458 14.6428 6.43524 14.9322 6.07873 14.9322H4.83868C4.48217 14.9322 4.19283 14.6428 4.19283 14.2863V9.32615C4.19283 8.96964 4.48217 8.68029 4.83868 8.68029ZM8.53298 8.68029H9.82469H9.82534C10.1728 8.68029 10.4563 8.95478 10.4705 9.30032V14.2863C10.4705 14.6428 10.1812 14.9322 9.82469 14.9322H8.53298C8.17647 14.9322 7.88712 14.6428 7.88712 14.2863V9.32615C7.88712 8.96964 8.17647 8.68029 8.53298 8.68029ZM13.519 8.68029H12.2789C11.9366 8.68029 11.6589 8.95801 11.6589 9.30032V10.5404C11.6589 10.8827 11.9366 11.1604 12.2789 11.1604H13.519C13.8613 11.1604 14.139 10.8827 14.139 10.5404V9.30032C14.139 8.95801 13.8613 8.68029 13.519 8.68029Z",
335 fill: "#FF7A59"
336 })
337 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("defs", {
338 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("clipPath", {
339 id: "clip0_903_1965",
340 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", {
341 width: "18",
342 height: "18",
343 fill: "white"
344 })
345 })
346 })]
347 });
348 }
349
350 /***/ }),
351
352 /***/ "./scripts/gutenberg/Common/SidebarSprocketIcon.tsx":
353 /*!**********************************************************!*\
354 !*** ./scripts/gutenberg/Common/SidebarSprocketIcon.tsx ***!
355 \**********************************************************/
356 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
357
358 "use strict";
359 __webpack_require__.r(__webpack_exports__);
360 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
361 /* harmony export */ "default": () => (/* binding */ SidebarSprocketIcon)
362 /* harmony export */ });
363 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
364
365 function SidebarSprocketIcon() {
366 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", {
367 width: "20px",
368 height: "20px",
369 version: "1.1",
370 viewBox: "0 0 40 42",
371 xmlns: "http://www.w3.org/2000/svg",
372 xmlnsXlink: "http://www.w3.org/1999/xlink",
373 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", {
374 d: "M28.8989809,30.0402293 C25.817707,30.0402293 23.319363,27.5423949 23.319363,24.461121 C23.319363,21.3798471 25.817707,18.881758 28.8989809,18.881758 C31.98,18.881758 34.4780892,21.3798471 34.4780892,24.461121 C34.4780892,27.5423949 31.98,30.0402293 28.8989809,30.0402293 M30.5692994,13.7199745 L30.5692994,8.75717196 C31.864586,8.14519744 32.7723567,6.8346242 32.7723567,5.31360508 L32.7723567,5.1989554 C32.7723567,3.10010191 31.0546497,1.38264968 28.956051,1.38264968 L28.8414013,1.38264968 C26.7425478,1.38264968 25.0248408,3.10010191 25.0248408,5.1989554 L25.0248408,5.31360508 C25.0248408,6.8346242 25.9328662,8.14519744 27.2281529,8.75717196 L27.2281529,13.7202293 C25.2994904,14.0180637 23.5371974,14.8137325 22.0829299,15.9844331 L8.45643312,5.38417836 C8.54611464,5.0392102 8.6090446,4.6835414 8.60955416,4.310293 C8.61261148,1.93271338 6.68777072,0.00303184713 4.31019108,-2.5477707e-05 C1.93286624,-0.00308280255 0.0029299363,1.92175796 0.000127388535,4.29933756 C-0.0029299363,6.67666244 1.92191083,8.60634396 4.29949044,8.60940128 C5.07426752,8.6104204 5.7912102,8.390293 6.42,8.03284076 L19.8243312,18.4603567 C18.6842038,20.181121 18.0166879,22.2422675 18.0166879,24.461121 C18.0166879,26.7841784 18.7504458,28.9327134 19.9907006,30.7001019 L15.9142675,34.776535 C15.5919745,34.6799745 15.2574522,34.6122038 14.9033121,34.6122038 C12.9499363,34.6122038 11.3659873,36.1961529 11.3659873,38.1497834 C11.3659873,40.103414 12.9499363,41.6871084 14.9033121,41.6871084 C16.8571974,41.6871084 18.4408917,40.103414 18.4408917,38.1497834 C18.4408917,37.7958981 18.3733758,37.461121 18.2765605,37.1390828 L22.3089172,33.1067261 C24.1392357,34.5041784 26.4184713,35.3431592 28.8989809,35.3431592 C34.9089172,35.3431592 39.7810191,30.4710573 39.7810191,24.461121 C39.7810191,19.0203567 35.7840764,14.5255796 30.5692994,13.7199745",
375 id: "Fill-1",
376 fillRule: "evenodd"
377 })
378 });
379 }
380
381 /***/ }),
382
383 /***/ "./scripts/gutenberg/Common/SprocketIcon.tsx":
384 /*!***************************************************!*\
385 !*** ./scripts/gutenberg/Common/SprocketIcon.tsx ***!
386 \***************************************************/
387 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
388
389 "use strict";
390 __webpack_require__.r(__webpack_exports__);
391 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
392 /* harmony export */ "default": () => (/* binding */ SprocketIcon)
393 /* harmony export */ });
394 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
395
396 function SprocketIcon() {
397 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", {
398 width: "40px",
399 height: "42px",
400 viewBox: "0 0 40 42",
401 version: "1.1",
402 xmlns: "http://www.w3.org/2000/svg",
403 xmlnsXlink: "http://www.w3.org/1999/xlink",
404 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("defs", {
405 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polygon", {
406 id: "path-1",
407 points: "0.000123751494 0 39.7808917 0 39.7808917 41.6871084 0.000123751494 41.6871084"
408 })
409 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("g", {
410 id: "Page-1",
411 stroke: "none",
412 strokeWidth: "1",
413 fill: "none",
414 fillRule: "evenodd",
415 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("g", {
416 id: "HubSpot-Sprocket---Full-Color",
417 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("mask", {
418 id: "mask-2",
419 fill: "white",
420 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("use", {
421 xlinkHref: "#path-1"
422 })
423 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("g", {
424 id: "path-1"
425 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", {
426 d: "M28.8989809,30.0402293 C25.817707,30.0402293 23.319363,27.5423949 23.319363,24.461121 C23.319363,21.3798471 25.817707,18.881758 28.8989809,18.881758 C31.98,18.881758 34.4780892,21.3798471 34.4780892,24.461121 C34.4780892,27.5423949 31.98,30.0402293 28.8989809,30.0402293 M30.5692994,13.7199745 L30.5692994,8.75717196 C31.864586,8.14519744 32.7723567,6.8346242 32.7723567,5.31360508 L32.7723567,5.1989554 C32.7723567,3.10010191 31.0546497,1.38264968 28.956051,1.38264968 L28.8414013,1.38264968 C26.7425478,1.38264968 25.0248408,3.10010191 25.0248408,5.1989554 L25.0248408,5.31360508 C25.0248408,6.8346242 25.9328662,8.14519744 27.2281529,8.75717196 L27.2281529,13.7202293 C25.2994904,14.0180637 23.5371974,14.8137325 22.0829299,15.9844331 L8.45643312,5.38417836 C8.54611464,5.0392102 8.6090446,4.6835414 8.60955416,4.310293 C8.61261148,1.93271338 6.68777072,0.00303184713 4.31019108,-2.5477707e-05 C1.93286624,-0.00308280255 0.0029299363,1.92175796 0.000127388535,4.29933756 C-0.0029299363,6.67666244 1.92191083,8.60634396 4.29949044,8.60940128 C5.07426752,8.6104204 5.7912102,8.390293 6.42,8.03284076 L19.8243312,18.4603567 C18.6842038,20.181121 18.0166879,22.2422675 18.0166879,24.461121 C18.0166879,26.7841784 18.7504458,28.9327134 19.9907006,30.7001019 L15.9142675,34.776535 C15.5919745,34.6799745 15.2574522,34.6122038 14.9033121,34.6122038 C12.9499363,34.6122038 11.3659873,36.1961529 11.3659873,38.1497834 C11.3659873,40.103414 12.9499363,41.6871084 14.9033121,41.6871084 C16.8571974,41.6871084 18.4408917,40.103414 18.4408917,38.1497834 C18.4408917,37.7958981 18.3733758,37.461121 18.2765605,37.1390828 L22.3089172,33.1067261 C24.1392357,34.5041784 26.4184713,35.3431592 28.8989809,35.3431592 C34.9089172,35.3431592 39.7810191,30.4710573 39.7810191,24.461121 C39.7810191,19.0203567 35.7840764,14.5255796 30.5692994,13.7199745",
427 id: "Fill-1",
428 fill: "#F3785B",
429 fillRule: "nonzero",
430 mask: "url(#mask-2)"
431 })]
432 })
433 })]
434 });
435 }
436
437 /***/ }),
438
439 /***/ "./scripts/gutenberg/FormBlock/FormBlockSave.tsx":
440 /*!*******************************************************!*\
441 !*** ./scripts/gutenberg/FormBlock/FormBlockSave.tsx ***!
442 \*******************************************************/
443 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
444
445 "use strict";
446 __webpack_require__.r(__webpack_exports__);
447 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
448 /* harmony export */ "default": () => (/* binding */ FormSaveBlock)
449 /* harmony export */ });
450 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
451 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
452 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
453
454
455 function FormSaveBlock(_ref) {
456 var attributes = _ref.attributes;
457 var portalId = attributes.portalId,
458 formId = attributes.formId;
459
460 if (portalId && formId) {
461 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.RawHTML, {
462 className: "wp-block-leadin-hubspot-form-block",
463 children: "[hubspot portal=\"".concat(portalId, "\" id=\"").concat(formId, "\" type=\"form\"]")
464 });
465 }
466
467 return null;
468 }
469
470 /***/ }),
471
472 /***/ "./scripts/gutenberg/FormBlock/FormGutenbergPreview.tsx":
473 /*!**************************************************************!*\
474 !*** ./scripts/gutenberg/FormBlock/FormGutenbergPreview.tsx ***!
475 \**************************************************************/
476 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
477
478 "use strict";
479 __webpack_require__.r(__webpack_exports__);
480 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
481 /* harmony export */ "default": () => (/* binding */ FormGutenbergPreview)
482 /* harmony export */ });
483 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
484 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
485 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
486 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
487 /* harmony import */ var _UIComponents_UIImage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../UIComponents/UIImage */ "./scripts/gutenberg/UIComponents/UIImage.ts");
488
489
490
491
492 function FormGutenbergPreview() {
493 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
494 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIImage__WEBPACK_IMPORTED_MODULE_3__["default"], {
495 alt: "Create a new Hubspot Form",
496 src: "".concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.pluginPath, "/public/assets/images/hubspot-form.png")
497 })
498 });
499 }
500
501 /***/ }),
502
503 /***/ "./scripts/gutenberg/FormBlock/registerFormBlock.tsx":
504 /*!***********************************************************!*\
505 !*** ./scripts/gutenberg/FormBlock/registerFormBlock.tsx ***!
506 \***********************************************************/
507 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
508
509 "use strict";
510 __webpack_require__.r(__webpack_exports__);
511 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
512 /* harmony export */ "default": () => (/* binding */ registerFormBlock)
513 /* harmony export */ });
514 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
515 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
516 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
517 /* harmony import */ var _Common_SprocketIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/SprocketIcon */ "./scripts/gutenberg/Common/SprocketIcon.tsx");
518 /* harmony import */ var _FormBlockSave__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./FormBlockSave */ "./scripts/gutenberg/FormBlock/FormBlockSave.tsx");
519 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
520 /* harmony import */ var _FormGutenbergPreview__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./FormGutenbergPreview */ "./scripts/gutenberg/FormBlock/FormGutenbergPreview.tsx");
521 /* harmony import */ var _shared_Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../shared/Common/ErrorHandler */ "./scripts/shared/Common/ErrorHandler.tsx");
522 /* harmony import */ var _shared_Form_FormEdit__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../shared/Form/FormEdit */ "./scripts/shared/Form/FormEdit.tsx");
523 /* harmony import */ var _shared_enums_connectionStatus__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../shared/enums/connectionStatus */ "./scripts/shared/enums/connectionStatus.ts");
524 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
525 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__);
526 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
527
528 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
529
530 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
531
532
533
534
535
536
537
538
539
540
541
542 function registerFormBlock() {
543 var editComponent = function editComponent(props) {
544 if (props.attributes.preview) {
545 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_FormGutenbergPreview__WEBPACK_IMPORTED_MODULE_5__["default"], {});
546 } else if (_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_4__.connectionStatus === _shared_enums_connectionStatus__WEBPACK_IMPORTED_MODULE_8__["default"].Connected) {
547 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_shared_Form_FormEdit__WEBPACK_IMPORTED_MODULE_7__["default"], _objectSpread(_objectSpread({}, props), {}, {
548 origin: "gutenberg",
549 preview: true
550 }));
551 } else {
552 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_shared_Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_6__["default"], {
553 status: 401
554 });
555 }
556 };
557
558 if (!_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__) {
559 return null;
560 }
561
562 _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType('leadin/hubspot-form-block', {
563 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)('HubSpot Form', 'leadin'),
564 description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)('Select and embed a HubSpot form', 'leadin'),
565 icon: _Common_SprocketIcon__WEBPACK_IMPORTED_MODULE_2__["default"],
566 category: 'leadin-blocks',
567 attributes: {
568 portalId: {
569 type: 'string',
570 "default": ''
571 },
572 formId: {
573 type: 'string'
574 },
575 formName: {
576 type: 'string'
577 },
578 preview: {
579 type: 'boolean',
580 "default": false
581 }
582 },
583 example: {
584 attributes: {
585 preview: true
586 }
587 },
588 edit: editComponent,
589 save: function save(props) {
590 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_FormBlockSave__WEBPACK_IMPORTED_MODULE_3__["default"], _objectSpread({}, props));
591 }
592 });
593 }
594
595 /***/ }),
596
597 /***/ "./scripts/gutenberg/MeetingsBlock/MeetingGutenbergPreview.tsx":
598 /*!*********************************************************************!*\
599 !*** ./scripts/gutenberg/MeetingsBlock/MeetingGutenbergPreview.tsx ***!
600 \*********************************************************************/
601 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
602
603 "use strict";
604 __webpack_require__.r(__webpack_exports__);
605 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
606 /* harmony export */ "default": () => (/* binding */ MeetingGutenbergPreview)
607 /* harmony export */ });
608 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
609 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
610 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
611 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
612 /* harmony import */ var _UIComponents_UIImage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../UIComponents/UIImage */ "./scripts/gutenberg/UIComponents/UIImage.ts");
613
614
615
616
617 function MeetingGutenbergPreview() {
618 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
619 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIImage__WEBPACK_IMPORTED_MODULE_3__["default"], {
620 alt: "Create a new Hubspot Meeting",
621 width: "100%",
622 src: "".concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.pluginPath, "/public/assets/images/hubspot-meetings.png")
623 })
624 });
625 }
626
627 /***/ }),
628
629 /***/ "./scripts/gutenberg/MeetingsBlock/MeetingSaveBlock.tsx":
630 /*!**************************************************************!*\
631 !*** ./scripts/gutenberg/MeetingsBlock/MeetingSaveBlock.tsx ***!
632 \**************************************************************/
633 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
634
635 "use strict";
636 __webpack_require__.r(__webpack_exports__);
637 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
638 /* harmony export */ "default": () => (/* binding */ MeetingSaveBlock)
639 /* harmony export */ });
640 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
641 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
642 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
643
644
645 function MeetingSaveBlock(_ref) {
646 var attributes = _ref.attributes;
647 var url = attributes.url;
648
649 if (url) {
650 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.RawHTML, {
651 className: "wp-block-leadin-hubspot-meeting-block",
652 children: "[hubspot url=\"".concat(url, "\" type=\"meeting\"]")
653 });
654 }
655
656 return null;
657 }
658
659 /***/ }),
660
661 /***/ "./scripts/gutenberg/MeetingsBlock/registerMeetingBlock.tsx":
662 /*!******************************************************************!*\
663 !*** ./scripts/gutenberg/MeetingsBlock/registerMeetingBlock.tsx ***!
664 \******************************************************************/
665 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
666
667 "use strict";
668 __webpack_require__.r(__webpack_exports__);
669 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
670 /* harmony export */ "default": () => (/* binding */ registerMeetingBlock)
671 /* harmony export */ });
672 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
673 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
674 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
675 /* harmony import */ var _Common_CalendarIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/CalendarIcon */ "./scripts/gutenberg/Common/CalendarIcon.tsx");
676 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
677 /* harmony import */ var _MeetingGutenbergPreview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./MeetingGutenbergPreview */ "./scripts/gutenberg/MeetingsBlock/MeetingGutenbergPreview.tsx");
678 /* harmony import */ var _MeetingSaveBlock__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./MeetingSaveBlock */ "./scripts/gutenberg/MeetingsBlock/MeetingSaveBlock.tsx");
679 /* harmony import */ var _shared_Meeting_MeetingEdit__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../shared/Meeting/MeetingEdit */ "./scripts/shared/Meeting/MeetingEdit.tsx");
680 /* harmony import */ var _shared_Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../shared/Common/ErrorHandler */ "./scripts/shared/Common/ErrorHandler.tsx");
681 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
682 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__);
683 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
684
685 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
686
687 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
688
689
690
691
692
693
694
695
696
697
698 var ConnectionStatus = {
699 Connected: 'Connected',
700 NotConnected: 'NotConnected'
701 };
702 function registerMeetingBlock() {
703 var editComponent = function editComponent(props) {
704 if (props.attributes.preview) {
705 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_MeetingGutenbergPreview__WEBPACK_IMPORTED_MODULE_4__["default"], {});
706 } else if (_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__.connectionStatus === ConnectionStatus.Connected) {
707 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_shared_Meeting_MeetingEdit__WEBPACK_IMPORTED_MODULE_6__["default"], _objectSpread(_objectSpread({}, props), {}, {
708 preview: true,
709 origin: "gutenberg"
710 }));
711 } else {
712 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_shared_Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_7__["default"], {
713 status: 401
714 });
715 }
716 };
717
718 if (!_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__) {
719 return null;
720 }
721
722 _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType('leadin/hubspot-meeting-block', {
723 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__.__)('Hubspot Meetings Scheduler', 'leadin'),
724 description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__.__)('Schedule meetings faster and forget the back-and-forth emails Your calendar stays full, and you stay productive', 'leadin'),
725 icon: _Common_CalendarIcon__WEBPACK_IMPORTED_MODULE_2__["default"],
726 category: 'leadin-blocks',
727 attributes: {
728 url: {
729 type: 'string',
730 "default": ''
731 },
732 preview: {
733 type: 'boolean',
734 "default": false
735 }
736 },
737 example: {
738 attributes: {
739 preview: true
740 }
741 },
742 edit: editComponent,
743 save: function save(props) {
744 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_MeetingSaveBlock__WEBPACK_IMPORTED_MODULE_5__["default"], _objectSpread({}, props));
745 }
746 });
747 }
748
749 /***/ }),
750
751 /***/ "./scripts/gutenberg/Sidebar/contentType.tsx":
752 /*!***************************************************!*\
753 !*** ./scripts/gutenberg/Sidebar/contentType.tsx ***!
754 \***************************************************/
755 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
756
757 "use strict";
758 __webpack_require__.r(__webpack_exports__);
759 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
760 /* harmony export */ "registerHubspotSidebar": () => (/* binding */ registerHubspotSidebar)
761 /* harmony export */ });
762 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
763 /* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/plugins */ "@wordpress/plugins");
764 /* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_plugins__WEBPACK_IMPORTED_MODULE_1__);
765 /* harmony import */ var _wordpress_edit_post__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/edit-post */ "@wordpress/edit-post");
766 /* harmony import */ var _wordpress_edit_post__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_edit_post__WEBPACK_IMPORTED_MODULE_2__);
767 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
768 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__);
769 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
770 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__);
771 /* harmony import */ var _UIComponents_UISidebarSelectControl__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../UIComponents/UISidebarSelectControl */ "./scripts/gutenberg/UIComponents/UISidebarSelectControl.tsx");
772 /* harmony import */ var _Common_SidebarSprocketIcon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Common/SidebarSprocketIcon */ "./scripts/gutenberg/Common/SidebarSprocketIcon.tsx");
773 /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! styled-components */ "./node_modules/styled-components/dist/styled-components.browser.esm.js");
774 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
775 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__);
776 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
777 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
778 /* harmony import */ var _utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../utils/backgroundAppUtils */ "./scripts/utils/backgroundAppUtils.ts");
779 var _templateObject;
780
781 function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
782
783
784
785
786
787
788
789
790
791
792
793
794
795 function registerHubspotSidebar() {
796 var ContentTypeLabelStyle = styled_components__WEBPACK_IMPORTED_MODULE_11__["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n white-space: normal;\n text-transform: none;\n "])));
797
798 var ContentTypeLabel = (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ContentTypeLabelStyle, {
799 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Select the content type HubSpot Analytics uses to track this page', 'leadin')
800 });
801
802 var LeadinPluginSidebar = function LeadinPluginSidebar(_ref) {
803 var postType = _ref.postType;
804 return postType ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_wordpress_edit_post__WEBPACK_IMPORTED_MODULE_2__.PluginSidebar, {
805 name: "leadin",
806 title: "HubSpot",
807 icon: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.Icon, {
808 className: "hs-plugin-sidebar-sprocket",
809 icon: (0,_Common_SidebarSprocketIcon__WEBPACK_IMPORTED_MODULE_6__["default"])()
810 }),
811 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.PanelBody, {
812 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('HubSpot Analytics', 'leadin'),
813 initialOpen: true,
814 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_8__.BackgroudAppContext.Provider, {
815 value: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_9__.refreshToken && (0,_utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_10__.getOrCreateBackgroundApp)(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_9__.refreshToken),
816 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UISidebarSelectControl__WEBPACK_IMPORTED_MODULE_5__["default"], {
817 metaKey: "content-type",
818 className: "select-content-type",
819 label: ContentTypeLabel,
820 options: [{
821 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Detect Automatically', 'leadin'),
822 value: ''
823 }, {
824 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Blog Post', 'leadin'),
825 value: 'blog-post'
826 }, {
827 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Knowledge Article', 'leadin'),
828 value: 'knowledge-article'
829 }, {
830 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Landing Page', 'leadin'),
831 value: 'landing-page'
832 }, {
833 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Listing Page', 'leadin'),
834 value: 'listing-page'
835 }, {
836 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Standard Page', 'leadin'),
837 value: 'standard-page'
838 }]
839 })
840 })
841 })
842 }) : null;
843 };
844
845 var LeadinPluginSidebarWrapper = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.withSelect)(function (select) {
846 var data = select('core/editor');
847 return {
848 postType: data && data.getCurrentPostType() && data.getEditedPostAttribute('meta')
849 };
850 })(LeadinPluginSidebar);
851
852 if (_wordpress_plugins__WEBPACK_IMPORTED_MODULE_1__) {
853 _wordpress_plugins__WEBPACK_IMPORTED_MODULE_1__.registerPlugin('leadin', {
854 render: LeadinPluginSidebarWrapper,
855 icon: _Common_SidebarSprocketIcon__WEBPACK_IMPORTED_MODULE_6__["default"]
856 });
857 }
858 }
859
860 /***/ }),
861
862 /***/ "./scripts/gutenberg/UIComponents/UIImage.ts":
863 /*!***************************************************!*\
864 !*** ./scripts/gutenberg/UIComponents/UIImage.ts ***!
865 \***************************************************/
866 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
867
868 "use strict";
869 __webpack_require__.r(__webpack_exports__);
870 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
871 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
872 /* harmony export */ });
873 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
874
875
876 var _exp = /*#__PURE__*/function _exp() {
877 return function (props) {
878 return props.height ? props.height : 'auto';
879 };
880 };
881
882 var _exp2 = /*#__PURE__*/function _exp2() {
883 return function (props) {
884 return props.width ? props.width : 'auto';
885 };
886 };
887
888 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_0__.styled)('img')({
889 name: "UIImage0",
890 "class": "ump7xqy",
891 propsAsIs: false,
892 vars: {
893 "ump7xqy-0": [_exp()],
894 "ump7xqy-1": [_exp2()]
895 }
896 }));
897
898 __webpack_require__(/*! ./UIImage.linaria.css!=!../../../node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./UIImage.ts */ "./scripts/gutenberg/UIComponents/UIImage.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/gutenberg/UIComponents/UIImage.ts");
899
900 /***/ }),
901
902 /***/ "./scripts/gutenberg/UIComponents/UISidebarSelectControl.tsx":
903 /*!*******************************************************************!*\
904 !*** ./scripts/gutenberg/UIComponents/UISidebarSelectControl.tsx ***!
905 \*******************************************************************/
906 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
907
908 "use strict";
909 __webpack_require__.r(__webpack_exports__);
910 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
911 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
912 /* harmony export */ });
913 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
914 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
915 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
916 /* harmony import */ var _utils_withMetaData__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils/withMetaData */ "./scripts/utils/withMetaData.ts");
917 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
918 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
919 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
920
921 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
922
923 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
924
925
926
927
928
929
930
931 var UISidebarSelectControl = function UISidebarSelectControl(props) {
932 var isBackgroundAppReady = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_3__.useBackgroundAppContext)();
933 var monitorSidebarMetaChange = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_3__.usePostBackgroundMessage)();
934 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.SelectControl, _objectSpread({
935 value: props.metaValue,
936 onChange: function onChange(content) {
937 if (props.setMetaValue) {
938 props.setMetaValue(content);
939 }
940
941 isBackgroundAppReady && monitorSidebarMetaChange({
942 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_4__.ProxyMessages.TrackSidebarMetaChange,
943 payload: {
944 metaKey: props.metaKey
945 }
946 });
947 }
948 }, props));
949 };
950
951 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_utils_withMetaData__WEBPACK_IMPORTED_MODULE_2__["default"])(UISidebarSelectControl));
952
953 /***/ }),
954
955 /***/ "./scripts/iframe/integratedMessages/core/CoreMessages.ts":
956 /*!****************************************************************!*\
957 !*** ./scripts/iframe/integratedMessages/core/CoreMessages.ts ***!
958 \****************************************************************/
959 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
960
961 "use strict";
962 __webpack_require__.r(__webpack_exports__);
963 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
964 /* harmony export */ "CoreMessages": () => (/* binding */ CoreMessages)
965 /* harmony export */ });
966 var CoreMessages = {
967 HandshakeReceive: 'INTEGRATED_APP_EMBEDDER_HANDSHAKE_RECEIVED',
968 SendRefreshToken: 'INTEGRATED_APP_EMBEDDER_SEND_REFRESH_TOKEN',
969 ReloadParentFrame: 'INTEGRATED_APP_EMBEDDER_RELOAD_PARENT_FRAME',
970 RedirectParentFrame: 'INTEGRATED_APP_EMBEDDER_REDIRECT_PARENT_FRAME',
971 SendLocale: 'INTEGRATED_APP_EMBEDDER_SEND_LOCALE',
972 SendDeviceId: 'INTEGRATED_APP_EMBEDDER_SEND_DEVICE_ID'
973 };
974
975 /***/ }),
976
977 /***/ "./scripts/iframe/integratedMessages/forms/FormsMessages.ts":
978 /*!******************************************************************!*\
979 !*** ./scripts/iframe/integratedMessages/forms/FormsMessages.ts ***!
980 \******************************************************************/
981 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
982
983 "use strict";
984 __webpack_require__.r(__webpack_exports__);
985 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
986 /* harmony export */ "FormMessages": () => (/* binding */ FormMessages)
987 /* harmony export */ });
988 var FormMessages = {
989 CreateFormAppNavigation: 'CREATE_FORM_APP_NAVIGATION'
990 };
991
992 /***/ }),
993
994 /***/ "./scripts/iframe/integratedMessages/index.ts":
995 /*!****************************************************!*\
996 !*** ./scripts/iframe/integratedMessages/index.ts ***!
997 \****************************************************/
998 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
999
1000 "use strict";
1001 __webpack_require__.r(__webpack_exports__);
1002 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1003 /* harmony export */ "CoreMessages": () => (/* reexport safe */ _core_CoreMessages__WEBPACK_IMPORTED_MODULE_0__.CoreMessages),
1004 /* harmony export */ "FormMessages": () => (/* reexport safe */ _forms_FormsMessages__WEBPACK_IMPORTED_MODULE_1__.FormMessages),
1005 /* harmony export */ "LiveChatMessages": () => (/* reexport safe */ _livechat_LiveChatMessages__WEBPACK_IMPORTED_MODULE_2__.LiveChatMessages),
1006 /* harmony export */ "PluginMessages": () => (/* reexport safe */ _plugin_PluginMessages__WEBPACK_IMPORTED_MODULE_3__.PluginMessages),
1007 /* harmony export */ "ProxyMessages": () => (/* reexport safe */ _proxy_ProxyMessages__WEBPACK_IMPORTED_MODULE_4__.ProxyMessages)
1008 /* harmony export */ });
1009 /* harmony import */ var _core_CoreMessages__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core/CoreMessages */ "./scripts/iframe/integratedMessages/core/CoreMessages.ts");
1010 /* harmony import */ var _forms_FormsMessages__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./forms/FormsMessages */ "./scripts/iframe/integratedMessages/forms/FormsMessages.ts");
1011 /* harmony import */ var _livechat_LiveChatMessages__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./livechat/LiveChatMessages */ "./scripts/iframe/integratedMessages/livechat/LiveChatMessages.ts");
1012 /* harmony import */ var _plugin_PluginMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./plugin/PluginMessages */ "./scripts/iframe/integratedMessages/plugin/PluginMessages.ts");
1013 /* harmony import */ var _proxy_ProxyMessages__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./proxy/ProxyMessages */ "./scripts/iframe/integratedMessages/proxy/ProxyMessages.ts");
1014
1015
1016
1017
1018
1019
1020 /***/ }),
1021
1022 /***/ "./scripts/iframe/integratedMessages/livechat/LiveChatMessages.ts":
1023 /*!************************************************************************!*\
1024 !*** ./scripts/iframe/integratedMessages/livechat/LiveChatMessages.ts ***!
1025 \************************************************************************/
1026 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1027
1028 "use strict";
1029 __webpack_require__.r(__webpack_exports__);
1030 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1031 /* harmony export */ "LiveChatMessages": () => (/* binding */ LiveChatMessages)
1032 /* harmony export */ });
1033 var LiveChatMessages = {
1034 CreateLiveChatAppNavigation: 'CREATE_LIVE_CHAT_APP_NAVIGATION'
1035 };
1036
1037 /***/ }),
1038
1039 /***/ "./scripts/iframe/integratedMessages/plugin/PluginMessages.ts":
1040 /*!********************************************************************!*\
1041 !*** ./scripts/iframe/integratedMessages/plugin/PluginMessages.ts ***!
1042 \********************************************************************/
1043 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1044
1045 "use strict";
1046 __webpack_require__.r(__webpack_exports__);
1047 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1048 /* harmony export */ "PluginMessages": () => (/* binding */ PluginMessages)
1049 /* harmony export */ });
1050 var PluginMessages = {
1051 PluginSettingsNavigation: 'PLUGIN_SETTINGS_NAVIGATION',
1052 PluginLeadinConfig: 'PLUGIN_LEADIN_CONFIG',
1053 TrackConsent: 'INTEGRATED_APP_EMBEDDER_TRACK_CONSENT',
1054 InternalTrackingFetchRequest: 'INTEGRATED_TRACKING_FETCH_REQUEST',
1055 InternalTrackingFetchResponse: 'INTEGRATED_TRACKING_FETCH_RESPONSE',
1056 InternalTrackingFetchError: 'INTEGRATED_TRACKING_FETCH_ERROR',
1057 InternalTrackingChangeRequest: 'INTEGRATED_TRACKING_CHANGE_REQUEST',
1058 InternalTrackingChangeError: 'INTEGRATED_TRACKING_CHANGE_ERROR',
1059 BusinessUnitFetchRequest: 'BUSINESS_UNIT_FETCH_REQUEST',
1060 BusinessUnitFetchResponse: 'BUSINESS_UNIT_FETCH_FETCH_RESPONSE',
1061 BusinessUnitFetchError: 'BUSINESS_UNIT_FETCH_FETCH_ERROR',
1062 BusinessUnitChangeRequest: 'BUSINESS_UNIT_CHANGE_REQUEST',
1063 BusinessUnitChangeError: 'BUSINESS_UNIT_CHANGE_ERROR',
1064 SkipReviewRequest: 'SKIP_REVIEW_REQUEST',
1065 SkipReviewResponse: 'SKIP_REVIEW_RESPONSE',
1066 SkipReviewError: 'SKIP_REVIEW_ERROR',
1067 RemoveParentQueryParam: 'REMOVE_PARENT_QUERY_PARAM',
1068 ContentEmbedInstallRequest: 'CONTENT_EMBED_INSTALL_REQUEST',
1069 ContentEmbedInstallResponse: 'CONTENT_EMBED_INSTALL_RESPONSE',
1070 ContentEmbedInstallError: 'CONTENT_EMBED_INSTALL_ERROR',
1071 ContentEmbedActivationRequest: 'CONTENT_EMBED_ACTIVATION_REQUEST',
1072 ContentEmbedActivationResponse: 'CONTENT_EMBED_ACTIVATION_RESPONSE',
1073 ContentEmbedActivationError: 'CONTENT_EMBED_ACTIVATION_ERROR'
1074 };
1075
1076 /***/ }),
1077
1078 /***/ "./scripts/iframe/integratedMessages/proxy/ProxyMessages.ts":
1079 /*!******************************************************************!*\
1080 !*** ./scripts/iframe/integratedMessages/proxy/ProxyMessages.ts ***!
1081 \******************************************************************/
1082 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1083
1084 "use strict";
1085 __webpack_require__.r(__webpack_exports__);
1086 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1087 /* harmony export */ "ProxyMessages": () => (/* binding */ ProxyMessages)
1088 /* harmony export */ });
1089 var ProxyMessages = {
1090 FetchForms: 'FETCH_FORMS',
1091 FetchForm: 'FETCH_FORM',
1092 CreateFormFromTemplate: 'CREATE_FORM_FROM_TEMPLATE',
1093 FetchAuth: 'FETCH_AUTH',
1094 FetchMeetingsAndUsers: 'FETCH_MEETINGS_AND_USERS',
1095 FetchContactsCreateSinceActivation: 'FETCH_CONTACTS_CREATED_SINCE_ACTIVATION',
1096 FetchOrCreateMeetingUser: 'FETCH_OR_CREATE_MEETING_USER',
1097 ConnectMeetingsCalendar: 'CONNECT_MEETINGS_CALENDAR',
1098 TrackFormPreviewRender: 'TRACK_FORM_PREVIEW_RENDER',
1099 TrackFormCreatedFromTemplate: 'TRACK_FORM_CREATED_FROM_TEMPLATE',
1100 TrackFormCreationFailed: 'TRACK_FORM_CREATION_FAILED',
1101 TrackMeetingPreviewRender: 'TRACK_MEETING_PREVIEW_RENDER',
1102 TrackSidebarMetaChange: 'TRACK_SIDEBAR_META_CHANGE',
1103 TrackReviewBannerRender: 'TRACK_REVIEW_BANNER_RENDER',
1104 TrackReviewBannerInteraction: 'TRACK_REVIEW_BANNER_INTERACTION',
1105 TrackReviewBannerDismissed: 'TRACK_REVIEW_BANNER_DISMISSED',
1106 TrackPluginDeactivation: 'TRACK_PLUGIN_DEACTIVATION'
1107 };
1108
1109 /***/ }),
1110
1111 /***/ "./scripts/iframe/useBackgroundApp.ts":
1112 /*!********************************************!*\
1113 !*** ./scripts/iframe/useBackgroundApp.ts ***!
1114 \********************************************/
1115 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1116
1117 "use strict";
1118 __webpack_require__.r(__webpack_exports__);
1119 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1120 /* harmony export */ "BackgroudAppContext": () => (/* binding */ BackgroudAppContext),
1121 /* harmony export */ "useBackgroundAppContext": () => (/* binding */ useBackgroundAppContext),
1122 /* harmony export */ "usePostAsyncBackgroundMessage": () => (/* binding */ usePostAsyncBackgroundMessage),
1123 /* harmony export */ "usePostBackgroundMessage": () => (/* binding */ usePostBackgroundMessage)
1124 /* harmony export */ });
1125 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1126 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1127
1128 var BackgroudAppContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);
1129 function useBackgroundAppContext() {
1130 return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(BackgroudAppContext);
1131 }
1132 function usePostBackgroundMessage() {
1133 var app = useBackgroundAppContext();
1134 return function (message) {
1135 app.postMessage(message);
1136 };
1137 }
1138 function usePostAsyncBackgroundMessage() {
1139 var app = useBackgroundAppContext();
1140 return function (message) {
1141 return app.postAsyncMessage(message);
1142 };
1143 }
1144
1145 /***/ }),
1146
1147 /***/ "./scripts/lib/Raven.ts":
1148 /*!******************************!*\
1149 !*** ./scripts/lib/Raven.ts ***!
1150 \******************************/
1151 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1152
1153 "use strict";
1154 __webpack_require__.r(__webpack_exports__);
1155 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1156 /* harmony export */ "configureRaven": () => (/* binding */ configureRaven),
1157 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1158 /* harmony export */ });
1159 /* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! raven-js */ "./node_modules/raven-js/src/singleton.js");
1160 /* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(raven_js__WEBPACK_IMPORTED_MODULE_0__);
1161 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
1162
1163
1164 function configureRaven() {
1165 if (_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.hubspotBaseUrl.indexOf('app.hubspot.com') === -1) {
1166 return;
1167 }
1168
1169 raven_js__WEBPACK_IMPORTED_MODULE_0___default().config('https://e9b8f382cdd130c0d415cd977d2be56f@exceptions.hubspot.com/1', {
1170 instrument: {
1171 tryCatch: false
1172 },
1173 release: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.leadinPluginVersion
1174 }).install();
1175 raven_js__WEBPACK_IMPORTED_MODULE_0___default().setTagsContext({
1176 v: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.leadinPluginVersion,
1177 php: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.phpVersion,
1178 wordpress: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.wpVersion
1179 });
1180 raven_js__WEBPACK_IMPORTED_MODULE_0___default().setExtraContext({
1181 hub: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.portalId,
1182 plugins: Object.keys(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.plugins).map(function (name) {
1183 return "".concat(name, "#").concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.plugins[name]);
1184 }).join(',')
1185 });
1186 }
1187 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((raven_js__WEBPACK_IMPORTED_MODULE_0___default()));
1188
1189 /***/ }),
1190
1191 /***/ "./scripts/shared/Common/AsyncSelect.tsx":
1192 /*!***********************************************!*\
1193 !*** ./scripts/shared/Common/AsyncSelect.tsx ***!
1194 \***********************************************/
1195 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1196
1197 "use strict";
1198 __webpack_require__.r(__webpack_exports__);
1199 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1200 /* harmony export */ "default": () => (/* binding */ AsyncSelect)
1201 /* harmony export */ });
1202 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1203 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
1204 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
1205 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
1206 /* harmony import */ var _UIComponents_colors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/colors */ "./scripts/shared/UIComponents/colors.ts");
1207 /* harmony import */ var _UIComponents_UISpinner__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../UIComponents/UISpinner */ "./scripts/shared/UIComponents/UISpinner.tsx");
1208 /* harmony import */ var _enums_loadState__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../enums/loadState */ "./scripts/shared/enums/loadState.ts");
1209 function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
1210
1211 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."); }
1212
1213 function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
1214
1215 function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
1216
1217 function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
1218
1219 function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1220
1221
1222
1223
1224
1225
1226
1227 var Container = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1228 name: "Container",
1229 "class": "c1wxx7eu",
1230 propsAsIs: false
1231 });
1232
1233 var _exp2 = /*#__PURE__*/function _exp2() {
1234 return function (props) {
1235 return props.focused ? '0' : '1px';
1236 };
1237 };
1238
1239 var _exp3 = /*#__PURE__*/function _exp3() {
1240 return function (props) {
1241 return props.focused ? "0 0 0 2px ".concat(_UIComponents_colors__WEBPACK_IMPORTED_MODULE_2__.CALYPSO_MEDIUM) : 'none';
1242 };
1243 };
1244
1245 var ControlContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1246 name: "ControlContainer",
1247 "class": "c1rgwbep",
1248 propsAsIs: false,
1249 vars: {
1250 "c1rgwbep-0": [_exp2()],
1251 "c1rgwbep-1": [_exp3()]
1252 }
1253 });
1254 var ValueContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1255 name: "ValueContainer",
1256 "class": "v1mdmbaj",
1257 propsAsIs: false
1258 });
1259 var Placeholder = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1260 name: "Placeholder",
1261 "class": "p1gwkvxy",
1262 propsAsIs: false
1263 });
1264 var SingleValue = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1265 name: "SingleValue",
1266 "class": "s1bwlafs",
1267 propsAsIs: false
1268 });
1269 var IndicatorContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1270 name: "IndicatorContainer",
1271 "class": "i196z9y5",
1272 propsAsIs: false
1273 });
1274 var DropdownIndicator = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1275 name: "DropdownIndicator",
1276 "class": "d1dfo5ow",
1277 propsAsIs: false
1278 });
1279 var InputContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1280 name: "InputContainer",
1281 "class": "if3lze",
1282 propsAsIs: false
1283 });
1284 var Input = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('input')({
1285 name: "Input",
1286 "class": "i9kxf50",
1287 propsAsIs: false
1288 });
1289 var InputShadow = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1290 name: "InputShadow",
1291 "class": "igjr3uc",
1292 propsAsIs: false
1293 });
1294 var MenuContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1295 name: "MenuContainer",
1296 "class": "mhb9if7",
1297 propsAsIs: false
1298 });
1299 var MenuList = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1300 name: "MenuList",
1301 "class": "mxaof7s",
1302 propsAsIs: false
1303 });
1304 var MenuGroup = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1305 name: "MenuGroup",
1306 "class": "mw50s5v",
1307 propsAsIs: false
1308 });
1309 var MenuGroupHeader = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1310 name: "MenuGroupHeader",
1311 "class": "m11rzvjw",
1312 propsAsIs: false
1313 });
1314
1315 var _exp5 = /*#__PURE__*/function _exp5() {
1316 return function (props) {
1317 return props.selected ? _UIComponents_colors__WEBPACK_IMPORTED_MODULE_2__.CALYPSO_MEDIUM : 'transparent';
1318 };
1319 };
1320
1321 var _exp6 = /*#__PURE__*/function _exp6() {
1322 return function (props) {
1323 return props.selected ? '#fff' : 'inherit';
1324 };
1325 };
1326
1327 var _exp7 = /*#__PURE__*/function _exp7() {
1328 return function (props) {
1329 return props.selected ? _UIComponents_colors__WEBPACK_IMPORTED_MODULE_2__.CALYPSO_MEDIUM : _UIComponents_colors__WEBPACK_IMPORTED_MODULE_2__.CALYPSO_LIGHT;
1330 };
1331 };
1332
1333 var MenuItem = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({
1334 name: "MenuItem",
1335 "class": "m1jcdsjv",
1336 propsAsIs: false,
1337 vars: {
1338 "m1jcdsjv-0": [_exp5()],
1339 "m1jcdsjv-1": [_exp6()],
1340 "m1jcdsjv-2": [_exp7()]
1341 }
1342 });
1343 function AsyncSelect(_ref) {
1344 var placeholder = _ref.placeholder,
1345 value = _ref.value,
1346 loadOptions = _ref.loadOptions,
1347 onChange = _ref.onChange,
1348 defaultOptions = _ref.defaultOptions;
1349 var inputEl = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
1350 var inputShadowEl = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
1351
1352 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false),
1353 _useState2 = _slicedToArray(_useState, 2),
1354 isFocused = _useState2[0],
1355 setFocus = _useState2[1];
1356
1357 var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(_enums_loadState__WEBPACK_IMPORTED_MODULE_4__["default"].NotLoaded),
1358 _useState4 = _slicedToArray(_useState3, 2),
1359 loadState = _useState4[0],
1360 setLoadState = _useState4[1];
1361
1362 var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''),
1363 _useState6 = _slicedToArray(_useState5, 2),
1364 localValue = _useState6[0],
1365 setLocalValue = _useState6[1];
1366
1367 var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(defaultOptions),
1368 _useState8 = _slicedToArray(_useState7, 2),
1369 options = _useState8[0],
1370 setOptions = _useState8[1];
1371
1372 var inputSize = "".concat(inputShadowEl.current ? inputShadowEl.current.clientWidth + 10 : 2, "px");
1373 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
1374 if (loadOptions && loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_4__["default"].NotLoaded) {
1375 loadOptions('', function (result) {
1376 setOptions(result);
1377 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_4__["default"].Idle);
1378 });
1379 }
1380 }, [loadOptions, loadState]);
1381
1382 var renderItems = function renderItems() {
1383 var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1384 var parentKey = arguments.length > 1 ? arguments[1] : undefined;
1385 return items.map(function (item, index) {
1386 if (item.options) {
1387 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(MenuGroup, {
1388 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MenuGroupHeader, {
1389 id: "".concat(index, "-heading"),
1390 children: item.label
1391 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
1392 children: renderItems(item.options, index)
1393 })]
1394 }, "async-select-item-".concat(index));
1395 } else {
1396 var key = "async-select-item-".concat(parentKey !== undefined ? "".concat(parentKey, "-").concat(index) : index);
1397 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MenuItem, {
1398 id: key,
1399 selected: value && item.value === value.value,
1400 onClick: function onClick() {
1401 onChange(item);
1402 setFocus(false);
1403 },
1404 children: item.label
1405 }, key);
1406 }
1407 });
1408 };
1409
1410 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Container, {
1411 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(ControlContainer, {
1412 id: "leadin-async-selector",
1413 focused: isFocused,
1414 onClick: function onClick() {
1415 if (isFocused) {
1416 if (inputEl.current) {
1417 inputEl.current.blur();
1418 }
1419
1420 setFocus(false);
1421 setLocalValue('');
1422 } else {
1423 if (inputEl.current) {
1424 inputEl.current.focus();
1425 }
1426
1427 setFocus(true);
1428 }
1429 },
1430 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(ValueContainer, {
1431 children: [localValue === '' && (!value ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Placeholder, {
1432 children: placeholder
1433 }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SingleValue, {
1434 children: value.label
1435 })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(InputContainer, {
1436 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Input, {
1437 ref: inputEl,
1438 onFocus: function onFocus() {
1439 setFocus(true);
1440 },
1441 onChange: function onChange(e) {
1442 setLocalValue(e.target.value);
1443 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_4__["default"].Loading);
1444 loadOptions && loadOptions(e.target.value, function (result) {
1445 setOptions(result);
1446 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_4__["default"].Idle);
1447 });
1448 },
1449 value: localValue,
1450 width: inputSize,
1451 id: "asycn-select-input"
1452 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputShadow, {
1453 ref: inputShadowEl,
1454 children: localValue
1455 })]
1456 })]
1457 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(IndicatorContainer, {
1458 children: [loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_4__["default"].Loading && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UISpinner__WEBPACK_IMPORTED_MODULE_3__["default"], {}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(DropdownIndicator, {})]
1459 })]
1460 }), isFocused && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MenuContainer, {
1461 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MenuList, {
1462 children: renderItems(options)
1463 })
1464 })]
1465 });
1466 }
1467
1468 __webpack_require__(/*! ./AsyncSelect.linaria.css!=!../../../node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./AsyncSelect.tsx */ "./scripts/shared/Common/AsyncSelect.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/Common/AsyncSelect.tsx");
1469
1470 /***/ }),
1471
1472 /***/ "./scripts/shared/Common/ErrorHandler.tsx":
1473 /*!************************************************!*\
1474 !*** ./scripts/shared/Common/ErrorHandler.tsx ***!
1475 \************************************************/
1476 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1477
1478 "use strict";
1479 __webpack_require__.r(__webpack_exports__);
1480 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1481 /* harmony export */ "default": () => (/* binding */ ErrorHandler)
1482 /* harmony export */ });
1483 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1484 /* harmony import */ var _UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../UIComponents/UIButton */ "./scripts/shared/UIComponents/UIButton.ts");
1485 /* harmony import */ var _UIComponents_UIContainer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UIContainer */ "./scripts/shared/UIComponents/UIContainer.ts");
1486 /* harmony import */ var _HubspotWrapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./HubspotWrapper */ "./scripts/shared/Common/HubspotWrapper.ts");
1487 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
1488 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
1489 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__);
1490
1491
1492
1493
1494
1495
1496
1497
1498 function redirectToPlugin() {
1499 window.location.href = "".concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_4__.adminUrl, "admin.php?page=leadin&leadin_expired=").concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_4__.redirectNonce);
1500 }
1501
1502 function ErrorHandler(_ref) {
1503 var status = _ref.status,
1504 resetErrorState = _ref.resetErrorState,
1505 _ref$errorInfo = _ref.errorInfo,
1506 errorInfo = _ref$errorInfo === void 0 ? {
1507 header: '',
1508 message: '',
1509 action: ''
1510 } : _ref$errorInfo;
1511 var isUnauthorized = status === 401 || status === 403;
1512 var errorHeader = isUnauthorized ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)("Your plugin isn't authorized", 'leadin') : errorInfo.header;
1513 var errorMessage = isUnauthorized ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Reauthorize your plugin to access your free HubSpot tools', 'leadin') : errorInfo.message;
1514 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_HubspotWrapper__WEBPACK_IMPORTED_MODULE_3__["default"], {
1515 pluginPath: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_4__.pluginPath,
1516 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_UIComponents_UIContainer__WEBPACK_IMPORTED_MODULE_2__["default"], {
1517 textAlign: "center",
1518 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h4", {
1519 children: errorHeader
1520 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", {
1521 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("b", {
1522 children: errorMessage
1523 })
1524 }), isUnauthorized ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_1__["default"], {
1525 "data-test-id": "authorize-button",
1526 onClick: redirectToPlugin,
1527 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Go to plugin', 'leadin')
1528 }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_1__["default"], {
1529 "data-test-id": "retry-button",
1530 onClick: resetErrorState,
1531 children: errorInfo.action
1532 })]
1533 })
1534 });
1535 }
1536
1537 /***/ }),
1538
1539 /***/ "./scripts/shared/Common/HubspotWrapper.ts":
1540 /*!*************************************************!*\
1541 !*** ./scripts/shared/Common/HubspotWrapper.ts ***!
1542 \*************************************************/
1543 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1544
1545 "use strict";
1546 __webpack_require__.r(__webpack_exports__);
1547 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1548 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1549 /* harmony export */ });
1550 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
1551
1552
1553 var _exp = /*#__PURE__*/function _exp() {
1554 return function (props) {
1555 return "url(".concat(props.pluginPath, "/public/assets/images/hubspot.svg)");
1556 };
1557 };
1558
1559 var _exp2 = /*#__PURE__*/function _exp2() {
1560 return function (props) {
1561 return props.padding || '90px 20% 25px';
1562 };
1563 };
1564
1565 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_0__.styled)('div')({
1566 name: "HubspotWrapper0",
1567 "class": "h1q5v5ee",
1568 propsAsIs: false,
1569 vars: {
1570 "h1q5v5ee-0": [_exp()],
1571 "h1q5v5ee-1": [_exp2()]
1572 }
1573 }));
1574
1575 __webpack_require__(/*! ./HubspotWrapper.linaria.css!=!../../../node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./HubspotWrapper.ts */ "./scripts/shared/Common/HubspotWrapper.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/Common/HubspotWrapper.ts");
1576
1577 /***/ }),
1578
1579 /***/ "./scripts/shared/Common/LoadingBlock.tsx":
1580 /*!************************************************!*\
1581 !*** ./scripts/shared/Common/LoadingBlock.tsx ***!
1582 \************************************************/
1583 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1584
1585 "use strict";
1586 __webpack_require__.r(__webpack_exports__);
1587 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1588 /* harmony export */ "default": () => (/* binding */ LoadingBlock)
1589 /* harmony export */ });
1590 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1591 /* harmony import */ var _HubspotWrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./HubspotWrapper */ "./scripts/shared/Common/HubspotWrapper.ts");
1592 /* harmony import */ var _UIComponents_UISpinner__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UISpinner */ "./scripts/shared/UIComponents/UISpinner.tsx");
1593 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
1594
1595
1596
1597
1598 function LoadingBlock() {
1599 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_HubspotWrapper__WEBPACK_IMPORTED_MODULE_1__["default"], {
1600 pluginPath: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__.pluginPath,
1601 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UISpinner__WEBPACK_IMPORTED_MODULE_2__["default"], {
1602 size: 50
1603 })
1604 });
1605 }
1606
1607 /***/ }),
1608
1609 /***/ "./scripts/shared/Form/FormEdit.tsx":
1610 /*!******************************************!*\
1611 !*** ./scripts/shared/Form/FormEdit.tsx ***!
1612 \******************************************/
1613 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1614
1615 "use strict";
1616 __webpack_require__.r(__webpack_exports__);
1617 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1618 /* harmony export */ "default": () => (/* binding */ FormEditContainer)
1619 /* harmony export */ });
1620 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1621 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
1622 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
1623 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
1624 /* harmony import */ var _UIComponents_UISpacer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../UIComponents/UISpacer */ "./scripts/shared/UIComponents/UISpacer.ts");
1625 /* harmony import */ var _PreviewForm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./PreviewForm */ "./scripts/shared/Form/PreviewForm.tsx");
1626 /* harmony import */ var _FormSelect__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./FormSelect */ "./scripts/shared/Form/FormSelect.tsx");
1627 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
1628 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
1629 /* harmony import */ var _Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../Common/LoadingBlock */ "./scripts/shared/Common/LoadingBlock.tsx");
1630 /* harmony import */ var _utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../utils/backgroundAppUtils */ "./scripts/utils/backgroundAppUtils.ts");
1631 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1632
1633 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1634
1635 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648 function FormEdit(_ref) {
1649 var attributes = _ref.attributes,
1650 isSelected = _ref.isSelected,
1651 setAttributes = _ref.setAttributes,
1652 _ref$preview = _ref.preview,
1653 preview = _ref$preview === void 0 ? true : _ref$preview,
1654 _ref$origin = _ref.origin,
1655 origin = _ref$origin === void 0 ? 'gutenberg' : _ref$origin;
1656 var formId = attributes.formId,
1657 formName = attributes.formName;
1658 var formSelected = _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId && formId;
1659 var isBackgroundAppReady = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__.useBackgroundAppContext)();
1660 var monitorFormPreviewRender = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__.usePostBackgroundMessage)();
1661
1662 var handleChange = function handleChange(selectedForm) {
1663 setAttributes({
1664 portalId: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId,
1665 formId: selectedForm.value,
1666 formName: selectedForm.label
1667 });
1668 };
1669
1670 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
1671 monitorFormPreviewRender({
1672 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_7__.ProxyMessages.TrackFormPreviewRender,
1673 payload: {
1674 origin: origin
1675 }
1676 });
1677 }, [origin]);
1678 return !isBackgroundAppReady ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_8__["default"], {}) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
1679 children: [(isSelected || !formSelected) && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_FormSelect__WEBPACK_IMPORTED_MODULE_5__["default"], {
1680 formId: formId,
1681 formName: formName,
1682 handleChange: handleChange,
1683 origin: origin
1684 }), formSelected && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
1685 children: [isSelected && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UISpacer__WEBPACK_IMPORTED_MODULE_3__["default"], {}), preview && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_PreviewForm__WEBPACK_IMPORTED_MODULE_4__["default"], {
1686 portalId: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId,
1687 formId: formId
1688 })]
1689 })]
1690 });
1691 }
1692
1693 function FormEditContainer(props) {
1694 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__.BackgroudAppContext.Provider, {
1695 value: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.refreshToken && (0,_utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_9__.getOrCreateBackgroundApp)(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.refreshToken),
1696 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(FormEdit, _objectSpread({}, props))
1697 });
1698 }
1699
1700 /***/ }),
1701
1702 /***/ "./scripts/shared/Form/FormSelect.tsx":
1703 /*!********************************************!*\
1704 !*** ./scripts/shared/Form/FormSelect.tsx ***!
1705 \********************************************/
1706 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1707
1708 "use strict";
1709 __webpack_require__.r(__webpack_exports__);
1710 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1711 /* harmony export */ "default": () => (/* binding */ FormSelect)
1712 /* harmony export */ });
1713 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1714 /* harmony import */ var _FormSelector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./FormSelector */ "./scripts/shared/Form/FormSelector.tsx");
1715 /* harmony import */ var _Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/LoadingBlock */ "./scripts/shared/Common/LoadingBlock.tsx");
1716 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
1717 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
1718 /* harmony import */ var _hooks_useForms__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./hooks/useForms */ "./scripts/shared/Form/hooks/useForms.ts");
1719 /* harmony import */ var _hooks_useCreateFormFromTemplate__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./hooks/useCreateFormFromTemplate */ "./scripts/shared/Form/hooks/useCreateFormFromTemplate.ts");
1720 /* harmony import */ var _constants_defaultFormOptions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../constants/defaultFormOptions */ "./scripts/constants/defaultFormOptions.ts");
1721 /* harmony import */ var _Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Common/ErrorHandler */ "./scripts/shared/Common/ErrorHandler.tsx");
1722
1723
1724
1725
1726
1727
1728
1729
1730 function FormSelect(_ref) {
1731 var formId = _ref.formId,
1732 formName = _ref.formName,
1733 handleChange = _ref.handleChange,
1734 _ref$origin = _ref.origin,
1735 origin = _ref$origin === void 0 ? 'gutenberg' : _ref$origin;
1736
1737 var _useForms = (0,_hooks_useForms__WEBPACK_IMPORTED_MODULE_4__["default"])(),
1738 search = _useForms.search,
1739 formApiError = _useForms.formApiError,
1740 reset = _useForms.reset;
1741
1742 var _useCreateFormFromTem = (0,_hooks_useCreateFormFromTemplate__WEBPACK_IMPORTED_MODULE_5__["default"])(origin),
1743 createFormByTemplate = _useCreateFormFromTem.createFormByTemplate,
1744 createReset = _useCreateFormFromTem.reset,
1745 isCreating = _useCreateFormFromTem.isCreating,
1746 hasError = _useCreateFormFromTem.hasError,
1747 createApiError = _useCreateFormFromTem.formApiError;
1748
1749 var value = formId && formName ? {
1750 label: formName,
1751 value: formId
1752 } : null;
1753
1754 var handleLocalChange = function handleLocalChange(option) {
1755 if ((0,_constants_defaultFormOptions__WEBPACK_IMPORTED_MODULE_6__.isDefaultForm)(option.value)) {
1756 createFormByTemplate(option.value).then(function (_ref2) {
1757 var guid = _ref2.guid,
1758 name = _ref2.name;
1759 handleChange({
1760 value: guid,
1761 label: name
1762 });
1763 });
1764 } else {
1765 handleChange(option);
1766 }
1767 };
1768
1769 return isCreating ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_2__["default"], {}) : formApiError || createApiError ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_7__["default"], {
1770 status: formApiError ? formApiError.status : createApiError.status,
1771 resetErrorState: function resetErrorState() {
1772 if (hasError) {
1773 createReset();
1774 } else {
1775 reset();
1776 }
1777 },
1778 errorInfo: {
1779 header: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('There was a problem retrieving your forms', 'leadin'),
1780 message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Please refresh your forms or try again in a few minutes', 'leadin'),
1781 action: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Refresh forms', 'leadin')
1782 }
1783 }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_FormSelector__WEBPACK_IMPORTED_MODULE_1__["default"], {
1784 loadOptions: search,
1785 onChange: function onChange(option) {
1786 return handleLocalChange(option);
1787 },
1788 value: value
1789 });
1790 }
1791
1792 /***/ }),
1793
1794 /***/ "./scripts/shared/Form/FormSelector.tsx":
1795 /*!**********************************************!*\
1796 !*** ./scripts/shared/Form/FormSelector.tsx ***!
1797 \**********************************************/
1798 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1799
1800 "use strict";
1801 __webpack_require__.r(__webpack_exports__);
1802 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1803 /* harmony export */ "default": () => (/* binding */ FormSelector)
1804 /* harmony export */ });
1805 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1806 /* harmony import */ var _Common_HubspotWrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Common/HubspotWrapper */ "./scripts/shared/Common/HubspotWrapper.ts");
1807 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
1808 /* harmony import */ var _Common_AsyncSelect__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Common/AsyncSelect */ "./scripts/shared/Common/AsyncSelect.tsx");
1809 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
1810 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
1811
1812
1813
1814
1815
1816 function FormSelector(_ref) {
1817 var loadOptions = _ref.loadOptions,
1818 onChange = _ref.onChange,
1819 value = _ref.value;
1820 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_Common_HubspotWrapper__WEBPACK_IMPORTED_MODULE_1__["default"], {
1821 pluginPath: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.pluginPath,
1822 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", {
1823 "data-test-id": "leadin-form-select",
1824 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("b", {
1825 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Select an existing form or create a new one from a template', 'leadin')
1826 })
1827 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_AsyncSelect__WEBPACK_IMPORTED_MODULE_3__["default"], {
1828 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Search for a form', 'leadin'),
1829 value: value,
1830 loadOptions: loadOptions,
1831 onChange: onChange
1832 })]
1833 });
1834 }
1835
1836 /***/ }),
1837
1838 /***/ "./scripts/shared/Form/PreviewForm.tsx":
1839 /*!*********************************************!*\
1840 !*** ./scripts/shared/Form/PreviewForm.tsx ***!
1841 \*********************************************/
1842 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1843
1844 "use strict";
1845 __webpack_require__.r(__webpack_exports__);
1846 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1847 /* harmony export */ "default": () => (/* binding */ PreviewForm)
1848 /* harmony export */ });
1849 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
1850 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
1851 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
1852 /* harmony import */ var _UIComponents_UIOverlay__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UIOverlay */ "./scripts/shared/UIComponents/UIOverlay.ts");
1853 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
1854 /* harmony import */ var _hooks_useFormsScript__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./hooks/useFormsScript */ "./scripts/shared/Form/hooks/useFormsScript.ts");
1855
1856
1857
1858
1859
1860 function PreviewForm(_ref) {
1861 var portalId = _ref.portalId,
1862 formId = _ref.formId;
1863 var inputEl = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
1864 var ready = (0,_hooks_useFormsScript__WEBPACK_IMPORTED_MODULE_4__["default"])();
1865 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
1866 if (!ready) {
1867 return;
1868 }
1869
1870 if (inputEl.current) {
1871 inputEl.current.innerHTML = '';
1872 var embedScript = document.createElement('script');
1873 embedScript.innerHTML = "hbspt.forms.create({ portalId: '".concat(portalId, "', formId: '").concat(formId, "', region: '").concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__.hublet, "', ").concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__.formsScriptPayload, " });");
1874 inputEl.current.appendChild(embedScript);
1875 }
1876 }, [formId, portalId, ready, inputEl]);
1877 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIOverlay__WEBPACK_IMPORTED_MODULE_2__["default"], {
1878 ref: inputEl
1879 });
1880 }
1881
1882 /***/ }),
1883
1884 /***/ "./scripts/shared/Form/hooks/useCreateFormFromTemplate.ts":
1885 /*!****************************************************************!*\
1886 !*** ./scripts/shared/Form/hooks/useCreateFormFromTemplate.ts ***!
1887 \****************************************************************/
1888 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1889
1890 "use strict";
1891 __webpack_require__.r(__webpack_exports__);
1892 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1893 /* harmony export */ "default": () => (/* binding */ useCreateFormFromTemplate)
1894 /* harmony export */ });
1895 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1896 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1897 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
1898 /* harmony import */ var _enums_loadState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums/loadState */ "./scripts/shared/enums/loadState.ts");
1899 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
1900 function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
1901
1902 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."); }
1903
1904 function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
1905
1906 function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
1907
1908 function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
1909
1910 function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1911
1912
1913
1914
1915
1916 function useCreateFormFromTemplate() {
1917 var origin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'gutenberg';
1918 var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__.usePostAsyncBackgroundMessage)();
1919 var track = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__.usePostBackgroundMessage)();
1920
1921 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Idle),
1922 _useState2 = _slicedToArray(_useState, 2),
1923 loadState = _useState2[0],
1924 setLoadState = _useState2[1];
1925
1926 var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
1927 _useState4 = _slicedToArray(_useState3, 2),
1928 formApiError = _useState4[0],
1929 setFormApiError = _useState4[1];
1930
1931 var createFormByTemplate = function createFormByTemplate(type) {
1932 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loading);
1933 track({
1934 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.TrackFormCreatedFromTemplate,
1935 payload: {
1936 type: type,
1937 origin: origin
1938 }
1939 });
1940 return proxy({
1941 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.CreateFormFromTemplate,
1942 payload: type
1943 }).then(function (form) {
1944 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Idle);
1945 return form;
1946 })["catch"](function (err) {
1947 setFormApiError(err);
1948 track({
1949 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.TrackFormCreationFailed,
1950 payload: {
1951 origin: origin
1952 }
1953 });
1954 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Failed);
1955 });
1956 };
1957
1958 return {
1959 isCreating: loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loading,
1960 hasError: loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Failed,
1961 formApiError: formApiError,
1962 createFormByTemplate: createFormByTemplate,
1963 reset: function reset() {
1964 return setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Idle);
1965 }
1966 };
1967 }
1968
1969 /***/ }),
1970
1971 /***/ "./scripts/shared/Form/hooks/useForms.ts":
1972 /*!***********************************************!*\
1973 !*** ./scripts/shared/Form/hooks/useForms.ts ***!
1974 \***********************************************/
1975 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1976
1977 "use strict";
1978 __webpack_require__.r(__webpack_exports__);
1979 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1980 /* harmony export */ "default": () => (/* binding */ useForms)
1981 /* harmony export */ });
1982 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1983 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1984 /* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/debounce */ "./node_modules/lodash/debounce.js");
1985 /* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_1__);
1986 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
1987 /* harmony import */ var _constants_defaultFormOptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../constants/defaultFormOptions */ "./scripts/constants/defaultFormOptions.ts");
1988 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
1989 function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
1990
1991 function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
1992
1993 function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
1994
1995 function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
1996
1997 function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
1998
1999 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."); }
2000
2001 function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
2002
2003 function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
2004
2005 function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
2006
2007 function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
2008
2009
2010
2011
2012
2013
2014 function useForms() {
2015 var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_2__.usePostAsyncBackgroundMessage)();
2016
2017 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
2018 _useState2 = _slicedToArray(_useState, 2),
2019 formApiError = _useState2[0],
2020 setFormApiError = _useState2[1];
2021
2022 var search = lodash_debounce__WEBPACK_IMPORTED_MODULE_1___default()(function (search, callback) {
2023 return proxy({
2024 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_4__.ProxyMessages.FetchForms,
2025 payload: {
2026 search: search
2027 }
2028 }).then(function (forms) {
2029 callback([].concat(_toConsumableArray(forms.map(function (form) {
2030 return {
2031 label: form.name,
2032 value: form.guid
2033 };
2034 })), [_constants_defaultFormOptions__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_OPTIONS]));
2035 })["catch"](function (error) {
2036 setFormApiError(error);
2037 });
2038 }, 300, {
2039 trailing: true
2040 });
2041 return {
2042 search: search,
2043 formApiError: formApiError,
2044 reset: function reset() {
2045 return setFormApiError(null);
2046 }
2047 };
2048 }
2049
2050 /***/ }),
2051
2052 /***/ "./scripts/shared/Form/hooks/useFormsScript.ts":
2053 /*!*****************************************************!*\
2054 !*** ./scripts/shared/Form/hooks/useFormsScript.ts ***!
2055 \*****************************************************/
2056 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2057
2058 "use strict";
2059 __webpack_require__.r(__webpack_exports__);
2060 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2061 /* harmony export */ "default": () => (/* binding */ useFormScript)
2062 /* harmony export */ });
2063 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
2064 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
2065 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
2066 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
2067 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
2068 /* harmony import */ var _lib_Raven__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../lib/Raven */ "./scripts/lib/Raven.ts");
2069 function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2070
2071 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."); }
2072
2073 function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
2074
2075 function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
2076
2077 function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
2078
2079 function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
2080
2081
2082
2083
2084
2085 var promise;
2086
2087 function loadFormsScript() {
2088 if (!promise) {
2089 promise = new Promise(function (resolve, reject) {
2090 return jquery__WEBPACK_IMPORTED_MODULE_0___default().getScript(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.formsScript).done(resolve).fail(reject);
2091 });
2092 }
2093
2094 return promise;
2095 }
2096
2097 function useFormScript() {
2098 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false),
2099 _useState2 = _slicedToArray(_useState, 2),
2100 ready = _useState2[0],
2101 setReady = _useState2[1];
2102
2103 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
2104 loadFormsScript().then(function () {
2105 return setReady(true);
2106 })["catch"](function (error) {
2107 return _lib_Raven__WEBPACK_IMPORTED_MODULE_3__["default"].captureException(error);
2108 });
2109 }, []);
2110 return ready;
2111 }
2112
2113 /***/ }),
2114
2115 /***/ "./scripts/shared/Meeting/MeetingController.tsx":
2116 /*!******************************************************!*\
2117 !*** ./scripts/shared/Meeting/MeetingController.tsx ***!
2118 \******************************************************/
2119 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2120
2121 "use strict";
2122 __webpack_require__.r(__webpack_exports__);
2123 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2124 /* harmony export */ "default": () => (/* binding */ MeetingController)
2125 /* harmony export */ });
2126 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2127 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
2128 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
2129 /* harmony import */ var _Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/LoadingBlock */ "./scripts/shared/Common/LoadingBlock.tsx");
2130 /* harmony import */ var _MeetingSelector__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./MeetingSelector */ "./scripts/shared/Meeting/MeetingSelector.tsx");
2131 /* harmony import */ var _MeetingWarning__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./MeetingWarning */ "./scripts/shared/Meeting/MeetingWarning.tsx");
2132 /* harmony import */ var _hooks_useMeetings__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./hooks/useMeetings */ "./scripts/shared/Meeting/hooks/useMeetings.ts");
2133 /* harmony import */ var _Common_HubspotWrapper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Common/HubspotWrapper */ "./scripts/shared/Common/HubspotWrapper.ts");
2134 /* harmony import */ var _Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Common/ErrorHandler */ "./scripts/shared/Common/ErrorHandler.tsx");
2135 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
2136 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2137 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__);
2138 /* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! raven-js */ "./node_modules/raven-js/src/singleton.js");
2139 /* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(raven_js__WEBPACK_IMPORTED_MODULE_10__);
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151 function MeetingController(_ref) {
2152 var handleChange = _ref.handleChange,
2153 url = _ref.url;
2154
2155 var _useMeetings = (0,_hooks_useMeetings__WEBPACK_IMPORTED_MODULE_5__["default"])(),
2156 meetings = _useMeetings.mappedMeetings,
2157 loading = _useMeetings.loading,
2158 error = _useMeetings.error,
2159 reload = _useMeetings.reload,
2160 connectCalendar = _useMeetings.connectCalendar;
2161
2162 var selectedMeetingOption = (0,_hooks_useMeetings__WEBPACK_IMPORTED_MODULE_5__.useSelectedMeeting)(url);
2163 var selectedMeetingCalendar = (0,_hooks_useMeetings__WEBPACK_IMPORTED_MODULE_5__.useSelectedMeetingCalendar)(url);
2164 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
2165 if (!url && meetings.length > 0) {
2166 handleChange(meetings[0].value);
2167 }
2168 }, [meetings, url, handleChange]);
2169
2170 var handleLocalChange = function handleLocalChange(option) {
2171 handleChange(option.value);
2172 };
2173
2174 var handleConnectCalendar = function handleConnectCalendar() {
2175 return connectCalendar().then(function () {
2176 reload();
2177 })["catch"](function (error) {
2178 raven_js__WEBPACK_IMPORTED_MODULE_10___default().captureMessage('Unable to connect calendar', {
2179 extra: {
2180 error: error
2181 }
2182 });
2183 });
2184 };
2185
2186 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
2187 children: loading ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_2__["default"], {}) : error ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_7__["default"], {
2188 status: error && error.status || error,
2189 resetErrorState: function resetErrorState() {
2190 return reload();
2191 },
2192 errorInfo: {
2193 header: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)('There was a problem retrieving your meetings', 'leadin'),
2194 message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)('Please refresh your meetings or try again in a few minutes', 'leadin'),
2195 action: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)('Refresh meetings', 'leadin')
2196 }
2197 }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_Common_HubspotWrapper__WEBPACK_IMPORTED_MODULE_6__["default"], {
2198 padding: "90px 32px 24px",
2199 pluginPath: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_8__.pluginPath,
2200 children: [selectedMeetingCalendar && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_MeetingWarning__WEBPACK_IMPORTED_MODULE_4__["default"], {
2201 status: selectedMeetingCalendar,
2202 onConnectCalendar: handleConnectCalendar
2203 }), meetings.length > 1 && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_MeetingSelector__WEBPACK_IMPORTED_MODULE_3__["default"], {
2204 onChange: handleLocalChange,
2205 options: meetings,
2206 value: selectedMeetingOption
2207 })]
2208 })
2209 });
2210 }
2211
2212 /***/ }),
2213
2214 /***/ "./scripts/shared/Meeting/MeetingEdit.tsx":
2215 /*!************************************************!*\
2216 !*** ./scripts/shared/Meeting/MeetingEdit.tsx ***!
2217 \************************************************/
2218 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2219
2220 "use strict";
2221 __webpack_require__.r(__webpack_exports__);
2222 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2223 /* harmony export */ "default": () => (/* binding */ MeetingsEditContainer)
2224 /* harmony export */ });
2225 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2226 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
2227 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
2228 /* harmony import */ var _MeetingController__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./MeetingController */ "./scripts/shared/Meeting/MeetingController.tsx");
2229 /* harmony import */ var _PreviewMeeting__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PreviewMeeting */ "./scripts/shared/Meeting/PreviewMeeting.tsx");
2230 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
2231 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
2232 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
2233 /* harmony import */ var _Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Common/LoadingBlock */ "./scripts/shared/Common/LoadingBlock.tsx");
2234 /* harmony import */ var _utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils/backgroundAppUtils */ "./scripts/utils/backgroundAppUtils.ts");
2235 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2236
2237 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2238
2239 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251 function MeetingEdit(_ref) {
2252 var url = _ref.attributes.url,
2253 isSelected = _ref.isSelected,
2254 setAttributes = _ref.setAttributes,
2255 _ref$preview = _ref.preview,
2256 preview = _ref$preview === void 0 ? true : _ref$preview,
2257 _ref$origin = _ref.origin,
2258 origin = _ref$origin === void 0 ? 'gutenberg' : _ref$origin;
2259 var isBackgroundAppReady = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_4__.useBackgroundAppContext)();
2260 var monitorFormPreviewRender = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_4__.usePostBackgroundMessage)();
2261
2262 var handleChange = function handleChange(newUrl) {
2263 setAttributes({
2264 url: newUrl
2265 });
2266 };
2267
2268 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
2269 monitorFormPreviewRender({
2270 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_6__.ProxyMessages.TrackMeetingPreviewRender,
2271 payload: {
2272 origin: origin
2273 }
2274 });
2275 }, [origin]);
2276 return !isBackgroundAppReady ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_7__["default"], {}) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
2277 children: [(isSelected || !url) && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_MeetingController__WEBPACK_IMPORTED_MODULE_2__["default"], {
2278 url: url,
2279 handleChange: handleChange
2280 }), preview && url && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_PreviewMeeting__WEBPACK_IMPORTED_MODULE_3__["default"], {
2281 url: url
2282 })]
2283 });
2284 }
2285
2286 function MeetingsEditContainer(props) {
2287 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_4__.BackgroudAppContext.Provider, {
2288 value: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_5__.refreshToken && (0,_utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_8__.getOrCreateBackgroundApp)(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_5__.refreshToken),
2289 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MeetingEdit, _objectSpread({}, props))
2290 });
2291 }
2292
2293 /***/ }),
2294
2295 /***/ "./scripts/shared/Meeting/MeetingSelector.tsx":
2296 /*!****************************************************!*\
2297 !*** ./scripts/shared/Meeting/MeetingSelector.tsx ***!
2298 \****************************************************/
2299 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2300
2301 "use strict";
2302 __webpack_require__.r(__webpack_exports__);
2303 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2304 /* harmony export */ "default": () => (/* binding */ MeetingSelector)
2305 /* harmony export */ });
2306 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2307 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
2308 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
2309 /* harmony import */ var _Common_AsyncSelect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/AsyncSelect */ "./scripts/shared/Common/AsyncSelect.tsx");
2310 /* harmony import */ var _UIComponents_UISpacer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../UIComponents/UISpacer */ "./scripts/shared/UIComponents/UISpacer.ts");
2311 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2312 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
2313
2314
2315
2316
2317
2318 function MeetingSelector(_ref) {
2319 var options = _ref.options,
2320 onChange = _ref.onChange,
2321 value = _ref.value;
2322 var optionsWrapper = [{
2323 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Meeting name', 'leadin'),
2324 options: options
2325 }];
2326 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
2327 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UISpacer__WEBPACK_IMPORTED_MODULE_3__["default"], {}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", {
2328 "data-test-id": "leadin-meeting-select",
2329 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("b", {
2330 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Select a meeting scheduling page', 'leadin')
2331 })
2332 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_AsyncSelect__WEBPACK_IMPORTED_MODULE_2__["default"], {
2333 defaultOptions: optionsWrapper,
2334 onChange: onChange,
2335 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Select a meeting', 'leadin'),
2336 value: value
2337 })]
2338 });
2339 }
2340
2341 /***/ }),
2342
2343 /***/ "./scripts/shared/Meeting/MeetingWarning.tsx":
2344 /*!***************************************************!*\
2345 !*** ./scripts/shared/Meeting/MeetingWarning.tsx ***!
2346 \***************************************************/
2347 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2348
2349 "use strict";
2350 __webpack_require__.r(__webpack_exports__);
2351 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2352 /* harmony export */ "default": () => (/* binding */ MeetingWarning)
2353 /* harmony export */ });
2354 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2355 /* harmony import */ var _UIComponents_UIAlert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../UIComponents/UIAlert */ "./scripts/shared/UIComponents/UIAlert.tsx");
2356 /* harmony import */ var _UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UIButton */ "./scripts/shared/UIComponents/UIButton.ts");
2357 /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ "./scripts/shared/Meeting/constants.ts");
2358 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2359 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
2360
2361
2362
2363
2364
2365 function MeetingWarning(_ref) {
2366 var status = _ref.status,
2367 onConnectCalendar = _ref.onConnectCalendar;
2368 var isMeetingOwner = status === _constants__WEBPACK_IMPORTED_MODULE_3__.CURRENT_USER_CALENDAR_MISSING;
2369 var titleText = isMeetingOwner ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Your calendar is not connected', 'leadin') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Calendar is not connected', 'leadin');
2370 var titleMessage = isMeetingOwner ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Please connect your calendar to activate your scheduling pages', 'leadin') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Make sure that everybody in this meeting has connected their calendar from the Meetings page in HubSpot', 'leadin');
2371 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIAlert__WEBPACK_IMPORTED_MODULE_1__["default"], {
2372 titleText: titleText,
2373 titleMessage: titleMessage,
2374 children: isMeetingOwner && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_2__["default"], {
2375 use: "tertiary",
2376 id: "meetings-connect-calendar",
2377 onClick: onConnectCalendar,
2378 children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Connect calendar', 'leadin')
2379 })
2380 });
2381 }
2382
2383 /***/ }),
2384
2385 /***/ "./scripts/shared/Meeting/PreviewMeeting.tsx":
2386 /*!***************************************************!*\
2387 !*** ./scripts/shared/Meeting/PreviewMeeting.tsx ***!
2388 \***************************************************/
2389 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2390
2391 "use strict";
2392 __webpack_require__.r(__webpack_exports__);
2393 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2394 /* harmony export */ "default": () => (/* binding */ PreviewForm)
2395 /* harmony export */ });
2396 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2397 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
2398 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
2399 /* harmony import */ var _UIComponents_UIOverlay__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UIOverlay */ "./scripts/shared/UIComponents/UIOverlay.ts");
2400 /* harmony import */ var _hooks_useMeetingsScript__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./hooks/useMeetingsScript */ "./scripts/shared/Meeting/hooks/useMeetingsScript.ts");
2401
2402
2403
2404
2405 function PreviewForm(_ref) {
2406 var url = _ref.url;
2407 var ready = (0,_hooks_useMeetingsScript__WEBPACK_IMPORTED_MODULE_3__["default"])();
2408 var inputEl = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
2409 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
2410 if (!ready) {
2411 return;
2412 }
2413
2414 if (inputEl.current) {
2415 inputEl.current.innerHTML = '';
2416 var container = document.createElement('div');
2417 container.dataset.src = "".concat(url, "?embed=true");
2418 container.classList.add('meetings-iframe-container');
2419 inputEl.current.appendChild(container);
2420 var embedScript = document.createElement('script');
2421 embedScript.innerHTML = 'hbspt.meetings.create(".meetings-iframe-container");';
2422 inputEl.current.appendChild(embedScript);
2423 }
2424 }, [url, ready, inputEl]);
2425 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
2426 children: url && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIOverlay__WEBPACK_IMPORTED_MODULE_2__["default"], {
2427 ref: inputEl
2428 })
2429 });
2430 }
2431
2432 /***/ }),
2433
2434 /***/ "./scripts/shared/Meeting/constants.ts":
2435 /*!*********************************************!*\
2436 !*** ./scripts/shared/Meeting/constants.ts ***!
2437 \*********************************************/
2438 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2439
2440 "use strict";
2441 __webpack_require__.r(__webpack_exports__);
2442 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2443 /* harmony export */ "CURRENT_USER_CALENDAR_MISSING": () => (/* binding */ CURRENT_USER_CALENDAR_MISSING),
2444 /* harmony export */ "OTHER_USER_CALENDAR_MISSING": () => (/* binding */ OTHER_USER_CALENDAR_MISSING)
2445 /* harmony export */ });
2446 var OTHER_USER_CALENDAR_MISSING = 'OTHER_USER_CALENDAR_MISSING';
2447 var CURRENT_USER_CALENDAR_MISSING = 'CURRENT_USER_CALENDAR_MISSING';
2448
2449 /***/ }),
2450
2451 /***/ "./scripts/shared/Meeting/hooks/useCurrentUserFetch.ts":
2452 /*!*************************************************************!*\
2453 !*** ./scripts/shared/Meeting/hooks/useCurrentUserFetch.ts ***!
2454 \*************************************************************/
2455 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2456
2457 "use strict";
2458 __webpack_require__.r(__webpack_exports__);
2459 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2460 /* harmony export */ "default": () => (/* binding */ useCurrentUserFetch)
2461 /* harmony export */ });
2462 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2463 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2464 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
2465 /* harmony import */ var _enums_loadState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums/loadState */ "./scripts/shared/enums/loadState.ts");
2466 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
2467 function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2468
2469 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."); }
2470
2471 function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
2472
2473 function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
2474
2475 function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
2476
2477 function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
2478
2479
2480
2481
2482
2483 var user = null;
2484 function useCurrentUserFetch() {
2485 var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__.usePostAsyncBackgroundMessage)();
2486
2487 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded),
2488 _useState2 = _slicedToArray(_useState, 2),
2489 loadState = _useState2[0],
2490 setLoadState = _useState2[1];
2491
2492 var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
2493 _useState4 = _slicedToArray(_useState3, 2),
2494 error = _useState4[0],
2495 setError = _useState4[1];
2496
2497 var createUser = function createUser() {
2498 if (!user) {
2499 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded);
2500 }
2501 };
2502
2503 var reload = function reload() {
2504 user = null;
2505 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded);
2506 setError(null);
2507 };
2508
2509 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
2510 if (loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded && !user) {
2511 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loading);
2512 proxy({
2513 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.FetchOrCreateMeetingUser
2514 }).then(function (data) {
2515 user = data;
2516 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Idle);
2517 })["catch"](function (err) {
2518 setError(err);
2519 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Failed);
2520 });
2521 }
2522 }, [loadState]);
2523 return {
2524 user: user,
2525 loadUserState: loadState,
2526 error: error,
2527 createUser: createUser,
2528 reload: reload
2529 };
2530 }
2531
2532 /***/ }),
2533
2534 /***/ "./scripts/shared/Meeting/hooks/useMeetings.ts":
2535 /*!*****************************************************!*\
2536 !*** ./scripts/shared/Meeting/hooks/useMeetings.ts ***!
2537 \*****************************************************/
2538 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2539
2540 "use strict";
2541 __webpack_require__.r(__webpack_exports__);
2542 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2543 /* harmony export */ "default": () => (/* binding */ useMeetings),
2544 /* harmony export */ "useSelectedMeeting": () => (/* binding */ useSelectedMeeting),
2545 /* harmony export */ "useSelectedMeetingCalendar": () => (/* binding */ useSelectedMeetingCalendar)
2546 /* harmony export */ });
2547 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2548 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2549 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2550 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
2551 /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants */ "./scripts/shared/Meeting/constants.ts");
2552 /* harmony import */ var _useMeetingsFetch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./useMeetingsFetch */ "./scripts/shared/Meeting/hooks/useMeetingsFetch.ts");
2553 /* harmony import */ var _useCurrentUserFetch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./useCurrentUserFetch */ "./scripts/shared/Meeting/hooks/useCurrentUserFetch.ts");
2554 /* harmony import */ var _enums_loadState__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../enums/loadState */ "./scripts/shared/enums/loadState.ts");
2555 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
2556 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
2557 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2558
2559 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2560
2561 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2562
2563 function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2564
2565 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."); }
2566
2567 function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
2568
2569 function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
2570
2571 function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
2572
2573 function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584 function getDefaultMeetingName(meeting, currentUser, meetingUsers) {
2585 var _meeting$meetingsUser = _slicedToArray(meeting.meetingsUserIds, 1),
2586 meetingOwnerId = _meeting$meetingsUser[0];
2587
2588 var result = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Default', 'leadin');
2589
2590 if (currentUser && meetingOwnerId !== currentUser.id && meetingUsers[meetingOwnerId]) {
2591 var user = meetingUsers[meetingOwnerId];
2592 result += " (".concat(user.userProfile.fullName, ")");
2593 }
2594
2595 return result;
2596 }
2597
2598 function hasCalendarObject(user) {
2599 return user && user.meetingsUserBlob && user.meetingsUserBlob.calendarSettings && user.meetingsUserBlob.calendarSettings.email;
2600 }
2601
2602 function useMeetings() {
2603 var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__.usePostAsyncBackgroundMessage)();
2604
2605 var _useMeetingsFetch = (0,_useMeetingsFetch__WEBPACK_IMPORTED_MODULE_3__["default"])(),
2606 meetings = _useMeetingsFetch.meetings,
2607 meetingUsers = _useMeetingsFetch.meetingUsers,
2608 meetingsError = _useMeetingsFetch.error,
2609 loadMeetingsState = _useMeetingsFetch.loadMeetingsState,
2610 reloadMeetings = _useMeetingsFetch.reload;
2611
2612 var _useCurrentUserFetch = (0,_useCurrentUserFetch__WEBPACK_IMPORTED_MODULE_4__["default"])(),
2613 currentUser = _useCurrentUserFetch.user,
2614 userError = _useCurrentUserFetch.error,
2615 loadUserState = _useCurrentUserFetch.loadUserState,
2616 reloadUser = _useCurrentUserFetch.reload;
2617
2618 var reload = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
2619 reloadUser();
2620 reloadMeetings();
2621 }, [reloadUser, reloadMeetings]);
2622
2623 var connectCalendar = function connectCalendar() {
2624 return proxy({
2625 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_7__.ProxyMessages.ConnectMeetingsCalendar
2626 });
2627 };
2628
2629 return {
2630 mappedMeetings: meetings.map(function (meet) {
2631 return {
2632 label: meet.name || getDefaultMeetingName(meet, currentUser, meetingUsers),
2633 value: meet.link
2634 };
2635 }),
2636 meetings: meetings,
2637 meetingUsers: meetingUsers,
2638 currentUser: currentUser,
2639 error: meetingsError || userError,
2640 loading: loadMeetingsState == _enums_loadState__WEBPACK_IMPORTED_MODULE_5__["default"].Loading || loadUserState === _enums_loadState__WEBPACK_IMPORTED_MODULE_5__["default"].Loading,
2641 reload: reload,
2642 connectCalendar: connectCalendar
2643 };
2644 }
2645 function useSelectedMeeting(url) {
2646 var _useMeetings = useMeetings(),
2647 meetings = _useMeetings.mappedMeetings;
2648
2649 var option = meetings.find(function (_ref) {
2650 var value = _ref.value;
2651 return value === url;
2652 });
2653 return option;
2654 }
2655 function useSelectedMeetingCalendar(url) {
2656 var _useMeetings2 = useMeetings(),
2657 meetings = _useMeetings2.meetings,
2658 meetingUsers = _useMeetings2.meetingUsers,
2659 currentUser = _useMeetings2.currentUser;
2660
2661 var meeting = meetings.find(function (meet) {
2662 return meet.link === url;
2663 });
2664 var mappedMeetingUsersId = meetingUsers.reduce(function (p, c) {
2665 return _objectSpread(_objectSpread({}, p), {}, _defineProperty({}, c.id, c));
2666 }, {});
2667
2668 if (!meeting) {
2669 return null;
2670 } else {
2671 var meetingsUserIds = meeting.meetingsUserIds;
2672
2673 if (currentUser && meetingsUserIds.includes(currentUser.id) && !hasCalendarObject(currentUser)) {
2674 return _constants__WEBPACK_IMPORTED_MODULE_2__.CURRENT_USER_CALENDAR_MISSING;
2675 } else if (meetingsUserIds.map(function (id) {
2676 return mappedMeetingUsersId[id];
2677 }).some(function (user) {
2678 return !hasCalendarObject(user);
2679 })) {
2680 return _constants__WEBPACK_IMPORTED_MODULE_2__.OTHER_USER_CALENDAR_MISSING;
2681 } else {
2682 return null;
2683 }
2684 }
2685 }
2686
2687 /***/ }),
2688
2689 /***/ "./scripts/shared/Meeting/hooks/useMeetingsFetch.ts":
2690 /*!**********************************************************!*\
2691 !*** ./scripts/shared/Meeting/hooks/useMeetingsFetch.ts ***!
2692 \**********************************************************/
2693 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2694
2695 "use strict";
2696 __webpack_require__.r(__webpack_exports__);
2697 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2698 /* harmony export */ "default": () => (/* binding */ useMeetingsFetch)
2699 /* harmony export */ });
2700 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2701 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2702 /* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts");
2703 /* harmony import */ var _enums_loadState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums/loadState */ "./scripts/shared/enums/loadState.ts");
2704 /* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts");
2705 function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2706
2707 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."); }
2708
2709 function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
2710
2711 function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
2712
2713 function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
2714
2715 function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
2716
2717
2718
2719
2720
2721 var meetings = [];
2722 var meetingUsers = [];
2723 function useMeetingsFetch() {
2724 var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__.usePostAsyncBackgroundMessage)();
2725
2726 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded),
2727 _useState2 = _slicedToArray(_useState, 2),
2728 loadState = _useState2[0],
2729 setLoadState = _useState2[1];
2730
2731 var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
2732 _useState4 = _slicedToArray(_useState3, 2),
2733 error = _useState4[0],
2734 setError = _useState4[1];
2735
2736 var reload = function reload() {
2737 meetings = [];
2738 setError(null);
2739 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded);
2740 };
2741
2742 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
2743 if (loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded && meetings.length === 0) {
2744 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loading);
2745 proxy({
2746 key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.FetchMeetingsAndUsers
2747 }).then(function (data) {
2748 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loaded);
2749 meetings = data && data.meetingLinks;
2750 meetingUsers = data && data.meetingUsers;
2751 })["catch"](function (e) {
2752 setError(e);
2753 setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Failed);
2754 });
2755 }
2756 }, [loadState]);
2757 return {
2758 meetings: meetings,
2759 meetingUsers: meetingUsers,
2760 loadMeetingsState: loadState,
2761 error: error,
2762 reload: reload
2763 };
2764 }
2765
2766 /***/ }),
2767
2768 /***/ "./scripts/shared/Meeting/hooks/useMeetingsScript.ts":
2769 /*!***********************************************************!*\
2770 !*** ./scripts/shared/Meeting/hooks/useMeetingsScript.ts ***!
2771 \***********************************************************/
2772 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2773
2774 "use strict";
2775 __webpack_require__.r(__webpack_exports__);
2776 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2777 /* harmony export */ "default": () => (/* binding */ useMeetingsScript)
2778 /* harmony export */ });
2779 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
2780 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
2781 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
2782 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
2783 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
2784 /* harmony import */ var _lib_Raven__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../lib/Raven */ "./scripts/lib/Raven.ts");
2785 function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2786
2787 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."); }
2788
2789 function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
2790
2791 function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
2792
2793 function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
2794
2795 function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
2796
2797
2798
2799
2800
2801 var promise;
2802
2803 function loadMeetingsScript() {
2804 if (!promise) {
2805 promise = new Promise(function (resolve, reject) {
2806 return jquery__WEBPACK_IMPORTED_MODULE_0___default().getScript(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.meetingsScript).done(resolve).fail(reject);
2807 });
2808 }
2809
2810 return promise;
2811 }
2812
2813 function useMeetingsScript() {
2814 var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false),
2815 _useState2 = _slicedToArray(_useState, 2),
2816 ready = _useState2[0],
2817 setReady = _useState2[1];
2818
2819 (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
2820 loadMeetingsScript().then(function () {
2821 return setReady(true);
2822 })["catch"](function (error) {
2823 return _lib_Raven__WEBPACK_IMPORTED_MODULE_3__["default"].captureException(error);
2824 });
2825 }, []);
2826 return ready;
2827 }
2828
2829 /***/ }),
2830
2831 /***/ "./scripts/shared/UIComponents/UIAlert.tsx":
2832 /*!*************************************************!*\
2833 !*** ./scripts/shared/UIComponents/UIAlert.tsx ***!
2834 \*************************************************/
2835 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2836
2837 "use strict";
2838 __webpack_require__.r(__webpack_exports__);
2839 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2840 /* harmony export */ "default": () => (/* binding */ UIAlert)
2841 /* harmony export */ });
2842 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
2843 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
2844
2845
2846 var AlertContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('div')({
2847 name: "AlertContainer",
2848 "class": "a1h8m4fo",
2849 propsAsIs: false
2850 });
2851 var Title = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('p')({
2852 name: "Title",
2853 "class": "tyndzxk",
2854 propsAsIs: false
2855 });
2856 var Message = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('p')({
2857 name: "Message",
2858 "class": "m1m9sbk4",
2859 propsAsIs: false
2860 });
2861 var MessageContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('div')({
2862 name: "MessageContainer",
2863 "class": "mg5o421",
2864 propsAsIs: false
2865 });
2866 function UIAlert(_ref) {
2867 var titleText = _ref.titleText,
2868 titleMessage = _ref.titleMessage,
2869 children = _ref.children;
2870 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(AlertContainer, {
2871 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(MessageContainer, {
2872 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Title, {
2873 children: titleText
2874 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Message, {
2875 children: titleMessage
2876 })]
2877 }), children]
2878 });
2879 }
2880
2881 __webpack_require__(/*! ./UIAlert.linaria.css!=!../../../node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./UIAlert.tsx */ "./scripts/shared/UIComponents/UIAlert.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIAlert.tsx");
2882
2883 /***/ }),
2884
2885 /***/ "./scripts/shared/UIComponents/UIButton.ts":
2886 /*!*************************************************!*\
2887 !*** ./scripts/shared/UIComponents/UIButton.ts ***!
2888 \*************************************************/
2889 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2890
2891 "use strict";
2892 __webpack_require__.r(__webpack_exports__);
2893 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2894 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
2895 /* harmony export */ });
2896 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
2897 /* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./colors */ "./scripts/shared/UIComponents/colors.ts");
2898
2899
2900
2901 var _exp2 = /*#__PURE__*/function _exp2() {
2902 return function (props) {
2903 return props.use === 'tertiary' ? _colors__WEBPACK_IMPORTED_MODULE_0__.HEFFALUMP : _colors__WEBPACK_IMPORTED_MODULE_0__.LORAX;
2904 };
2905 };
2906
2907 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('button')({
2908 name: "UIButton0",
2909 "class": "ug152ch",
2910 propsAsIs: false,
2911 vars: {
2912 "ug152ch-0": [_exp2()]
2913 }
2914 }));
2915
2916 __webpack_require__(/*! ./UIButton.linaria.css!=!../../../node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./UIButton.ts */ "./scripts/shared/UIComponents/UIButton.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIButton.ts");
2917
2918 /***/ }),
2919
2920 /***/ "./scripts/shared/UIComponents/UIContainer.ts":
2921 /*!****************************************************!*\
2922 !*** ./scripts/shared/UIComponents/UIContainer.ts ***!
2923 \****************************************************/
2924 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2925
2926 "use strict";
2927 __webpack_require__.r(__webpack_exports__);
2928 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2929 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
2930 /* harmony export */ });
2931 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
2932
2933
2934 var _exp = /*#__PURE__*/function _exp() {
2935 return function (props) {
2936 return props.textAlign ? props.textAlign : 'inherit';
2937 };
2938 };
2939
2940 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_0__.styled)('div')({
2941 name: "UIContainer0",
2942 "class": "ua13n1c",
2943 propsAsIs: false,
2944 vars: {
2945 "ua13n1c-0": [_exp()]
2946 }
2947 }));
2948
2949 __webpack_require__(/*! ./UIContainer.linaria.css!=!../../../node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./UIContainer.ts */ "./scripts/shared/UIComponents/UIContainer.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIContainer.ts");
2950
2951 /***/ }),
2952
2953 /***/ "./scripts/shared/UIComponents/UIOverlay.ts":
2954 /*!**************************************************!*\
2955 !*** ./scripts/shared/UIComponents/UIOverlay.ts ***!
2956 \**************************************************/
2957 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2958
2959 "use strict";
2960 __webpack_require__.r(__webpack_exports__);
2961 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2962 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
2963 /* harmony export */ });
2964 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
2965
2966 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_0__.styled)('div')({
2967 name: "UIOverlay0",
2968 "class": "u1q7a48k",
2969 propsAsIs: false
2970 }));
2971
2972 __webpack_require__(/*! ./UIOverlay.linaria.css!=!../../../node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./UIOverlay.ts */ "./scripts/shared/UIComponents/UIOverlay.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIOverlay.ts");
2973
2974 /***/ }),
2975
2976 /***/ "./scripts/shared/UIComponents/UISpacer.ts":
2977 /*!*************************************************!*\
2978 !*** ./scripts/shared/UIComponents/UISpacer.ts ***!
2979 \*************************************************/
2980 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2981
2982 "use strict";
2983 __webpack_require__.r(__webpack_exports__);
2984 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2985 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
2986 /* harmony export */ });
2987 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
2988
2989 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_0__.styled)('div')({
2990 name: "UISpacer0",
2991 "class": "u3qxofx",
2992 propsAsIs: false
2993 }));
2994
2995 __webpack_require__(/*! ./UISpacer.linaria.css!=!../../../node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./UISpacer.ts */ "./scripts/shared/UIComponents/UISpacer.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UISpacer.ts");
2996
2997 /***/ }),
2998
2999 /***/ "./scripts/shared/UIComponents/UISpinner.tsx":
3000 /*!***************************************************!*\
3001 !*** ./scripts/shared/UIComponents/UISpinner.tsx ***!
3002 \***************************************************/
3003 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3004
3005 "use strict";
3006 __webpack_require__.r(__webpack_exports__);
3007 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3008 /* harmony export */ "default": () => (/* binding */ UISpinner)
3009 /* harmony export */ });
3010 /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
3011 /* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs");
3012 /* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./colors */ "./scripts/shared/UIComponents/colors.ts");
3013
3014
3015
3016 var SpinnerOuter = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('div')({
3017 name: "SpinnerOuter",
3018 "class": "sxa9zrc",
3019 propsAsIs: false
3020 });
3021 var SpinnerInner = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('div')({
3022 name: "SpinnerInner",
3023 "class": "s14430wa",
3024 propsAsIs: false
3025 });
3026
3027 var _exp = /*#__PURE__*/function _exp() {
3028 return function (props) {
3029 return props.color;
3030 };
3031 };
3032
3033 var Circle = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('circle')({
3034 name: "Circle",
3035 "class": "ct87ghk",
3036 propsAsIs: true,
3037 vars: {
3038 "ct87ghk-0": [_exp()]
3039 }
3040 });
3041
3042 var _exp2 = /*#__PURE__*/function _exp2() {
3043 return function (props) {
3044 return props.color;
3045 };
3046 };
3047
3048 var AnimatedCircle = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('circle')({
3049 name: "AnimatedCircle",
3050 "class": "avili0h",
3051 propsAsIs: true,
3052 vars: {
3053 "avili0h-0": [_exp2()]
3054 }
3055 });
3056 function UISpinner(_ref) {
3057 var _ref$size = _ref.size,
3058 size = _ref$size === void 0 ? 20 : _ref$size;
3059 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SpinnerOuter, {
3060 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SpinnerInner, {
3061 children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", {
3062 height: size,
3063 width: size,
3064 viewBox: "0 0 50 50",
3065 children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Circle, {
3066 color: _colors__WEBPACK_IMPORTED_MODULE_1__.CALYPSO_MEDIUM,
3067 cx: "25",
3068 cy: "25",
3069 r: "22.5"
3070 }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AnimatedCircle, {
3071 color: _colors__WEBPACK_IMPORTED_MODULE_1__.CALYPSO,
3072 cx: "25",
3073 cy: "25",
3074 r: "22.5"
3075 })]
3076 })
3077 })
3078 });
3079 }
3080
3081 __webpack_require__(/*! ./UISpinner.linaria.css!=!../../../node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./UISpinner.tsx */ "./scripts/shared/UIComponents/UISpinner.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UISpinner.tsx");
3082
3083 /***/ }),
3084
3085 /***/ "./scripts/shared/UIComponents/colors.ts":
3086 /*!***********************************************!*\
3087 !*** ./scripts/shared/UIComponents/colors.ts ***!
3088 \***********************************************/
3089 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3090
3091 "use strict";
3092 __webpack_require__.r(__webpack_exports__);
3093 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3094 /* harmony export */ "CALYPSO": () => (/* binding */ CALYPSO),
3095 /* harmony export */ "CALYPSO_LIGHT": () => (/* binding */ CALYPSO_LIGHT),
3096 /* harmony export */ "CALYPSO_MEDIUM": () => (/* binding */ CALYPSO_MEDIUM),
3097 /* harmony export */ "HEFFALUMP": () => (/* binding */ HEFFALUMP),
3098 /* harmony export */ "LORAX": () => (/* binding */ LORAX),
3099 /* harmony export */ "MARIGOLD_LIGHT": () => (/* binding */ MARIGOLD_LIGHT),
3100 /* harmony export */ "MARIGOLD_MEDIUM": () => (/* binding */ MARIGOLD_MEDIUM),
3101 /* harmony export */ "OBSIDIAN": () => (/* binding */ OBSIDIAN),
3102 /* harmony export */ "OLAF": () => (/* binding */ OLAF)
3103 /* harmony export */ });
3104 var CALYPSO = '#00a4bd';
3105 var CALYPSO_MEDIUM = '#7fd1de';
3106 var CALYPSO_LIGHT = '#e5f5f8';
3107 var LORAX = '#ff7a59';
3108 var OLAF = '#ffffff';
3109 var HEFFALUMP = '#425b76';
3110 var MARIGOLD_LIGHT = '#fef8f0';
3111 var MARIGOLD_MEDIUM = '#fae0b5';
3112 var OBSIDIAN = '#33475b';
3113
3114 /***/ }),
3115
3116 /***/ "./scripts/shared/enums/connectionStatus.ts":
3117 /*!**************************************************!*\
3118 !*** ./scripts/shared/enums/connectionStatus.ts ***!
3119 \**************************************************/
3120 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3121
3122 "use strict";
3123 __webpack_require__.r(__webpack_exports__);
3124 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3125 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
3126 /* harmony export */ });
3127 var ConnectionStatus = {
3128 Connected: 'Connected',
3129 NotConnected: 'NotConnected'
3130 };
3131 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ConnectionStatus);
3132
3133 /***/ }),
3134
3135 /***/ "./scripts/shared/enums/loadState.ts":
3136 /*!*******************************************!*\
3137 !*** ./scripts/shared/enums/loadState.ts ***!
3138 \*******************************************/
3139 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3140
3141 "use strict";
3142 __webpack_require__.r(__webpack_exports__);
3143 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3144 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
3145 /* harmony export */ });
3146 var LoadState = {
3147 NotLoaded: 'NotLoaded',
3148 Loading: 'Loading',
3149 Loaded: 'Loaded',
3150 Idle: 'Idle',
3151 Failed: 'Failed'
3152 };
3153 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LoadState);
3154
3155 /***/ }),
3156
3157 /***/ "./scripts/utils/appUtils.ts":
3158 /*!***********************************!*\
3159 !*** ./scripts/utils/appUtils.ts ***!
3160 \***********************************/
3161 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3162
3163 "use strict";
3164 __webpack_require__.r(__webpack_exports__);
3165 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3166 /* harmony export */ "initApp": () => (/* binding */ initApp),
3167 /* harmony export */ "initAppOnReady": () => (/* binding */ initAppOnReady)
3168 /* harmony export */ });
3169 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
3170 /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
3171 /* harmony import */ var _lib_Raven__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/Raven */ "./scripts/lib/Raven.ts");
3172
3173
3174 function initApp(initFn) {
3175 (0,_lib_Raven__WEBPACK_IMPORTED_MODULE_1__.configureRaven)();
3176 _lib_Raven__WEBPACK_IMPORTED_MODULE_1__["default"].context(initFn);
3177 }
3178 function initAppOnReady(initFn) {
3179 function main() {
3180 jquery__WEBPACK_IMPORTED_MODULE_0___default()(initFn);
3181 }
3182
3183 initApp(main);
3184 }
3185
3186 /***/ }),
3187
3188 /***/ "./scripts/utils/backgroundAppUtils.ts":
3189 /*!*********************************************!*\
3190 !*** ./scripts/utils/backgroundAppUtils.ts ***!
3191 \*********************************************/
3192 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3193
3194 "use strict";
3195 __webpack_require__.r(__webpack_exports__);
3196 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3197 /* harmony export */ "getOrCreateBackgroundApp": () => (/* binding */ getOrCreateBackgroundApp),
3198 /* harmony export */ "initBackgroundApp": () => (/* binding */ initBackgroundApp)
3199 /* harmony export */ });
3200 /* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts");
3201 /* harmony import */ var _appUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./appUtils */ "./scripts/utils/appUtils.ts");
3202
3203
3204 function initBackgroundApp(initFn) {
3205 function main() {
3206 if (Array.isArray(initFn)) {
3207 initFn.forEach(function (callback) {
3208 return callback();
3209 });
3210 } else {
3211 initFn();
3212 }
3213 }
3214
3215 (0,_appUtils__WEBPACK_IMPORTED_MODULE_1__.initApp)(main);
3216 }
3217 var getOrCreateBackgroundApp = function getOrCreateBackgroundApp(refreshToken) {
3218 if (window.LeadinBackgroundApp) {
3219 return window.LeadinBackgroundApp;
3220 }
3221
3222 var _window = window,
3223 IntegratedAppEmbedder = _window.IntegratedAppEmbedder,
3224 IntegratedAppOptions = _window.IntegratedAppOptions;
3225 var options = new IntegratedAppOptions().setLocale(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__.locale).setDeviceId(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__.deviceId).setRefreshToken(refreshToken);
3226 var embedder = new IntegratedAppEmbedder('integrated-plugin-proxy', _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__.portalId, _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__.hubspotBaseUrl, function () {}).setOptions(options);
3227 embedder.attachTo(document.body, false);
3228 embedder.postStartAppMessage(); // lets the app know all all data has been passed to it
3229
3230 window.LeadinBackgroundApp = embedder;
3231 return window.LeadinBackgroundApp;
3232 };
3233
3234 /***/ }),
3235
3236 /***/ "./scripts/utils/withMetaData.ts":
3237 /*!***************************************!*\
3238 !*** ./scripts/utils/withMetaData.ts ***!
3239 \***************************************/
3240 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3241
3242 "use strict";
3243 __webpack_require__.r(__webpack_exports__);
3244 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3245 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
3246 /* harmony export */ });
3247 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
3248 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
3249 function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3250
3251
3252 var applyWithSelect = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.withSelect)(function (select, props) {
3253 return {
3254 metaValue: select('core/editor').getEditedPostAttribute('meta')[props.metaKey]
3255 };
3256 });
3257 var applyWithDispatch = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.withDispatch)(function (dispatch, props) {
3258 return {
3259 setMetaValue: function setMetaValue(value) {
3260 dispatch('core/editor').editPost({
3261 meta: _defineProperty({}, props.metaKey, value)
3262 });
3263 }
3264 };
3265 });
3266
3267 function apply(el) {
3268 return applyWithSelect(applyWithDispatch(el));
3269 }
3270
3271 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (apply);
3272
3273 /***/ }),
3274
3275 /***/ "./node_modules/is-what/dist/index.esm.js":
3276 /*!************************************************!*\
3277 !*** ./node_modules/is-what/dist/index.esm.js ***!
3278 \************************************************/
3279 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3280
3281 "use strict";
3282 __webpack_require__.r(__webpack_exports__);
3283 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3284 /* harmony export */ "getType": () => (/* binding */ getType),
3285 /* harmony export */ "isAnyObject": () => (/* binding */ isAnyObject),
3286 /* harmony export */ "isArray": () => (/* binding */ isArray),
3287 /* harmony export */ "isBlob": () => (/* binding */ isBlob),
3288 /* harmony export */ "isBoolean": () => (/* binding */ isBoolean),
3289 /* harmony export */ "isDate": () => (/* binding */ isDate),
3290 /* harmony export */ "isEmptyArray": () => (/* binding */ isEmptyArray),
3291 /* harmony export */ "isEmptyObject": () => (/* binding */ isEmptyObject),
3292 /* harmony export */ "isEmptyString": () => (/* binding */ isEmptyString),
3293 /* harmony export */ "isError": () => (/* binding */ isError),
3294 /* harmony export */ "isFile": () => (/* binding */ isFile),
3295 /* harmony export */ "isFullArray": () => (/* binding */ isFullArray),
3296 /* harmony export */ "isFullObject": () => (/* binding */ isFullObject),
3297 /* harmony export */ "isFullString": () => (/* binding */ isFullString),
3298 /* harmony export */ "isFunction": () => (/* binding */ isFunction),
3299 /* harmony export */ "isMap": () => (/* binding */ isMap),
3300 /* harmony export */ "isNaNValue": () => (/* binding */ isNaNValue),
3301 /* harmony export */ "isNull": () => (/* binding */ isNull),
3302 /* harmony export */ "isNullOrUndefined": () => (/* binding */ isNullOrUndefined),
3303 /* harmony export */ "isNumber": () => (/* binding */ isNumber),
3304 /* harmony export */ "isObject": () => (/* binding */ isObject),
3305 /* harmony export */ "isObjectLike": () => (/* binding */ isObjectLike),
3306 /* harmony export */ "isOneOf": () => (/* binding */ isOneOf),
3307 /* harmony export */ "isPlainObject": () => (/* binding */ isPlainObject),
3308 /* harmony export */ "isPrimitive": () => (/* binding */ isPrimitive),
3309 /* harmony export */ "isPromise": () => (/* binding */ isPromise),
3310 /* harmony export */ "isRegExp": () => (/* binding */ isRegExp),
3311 /* harmony export */ "isSet": () => (/* binding */ isSet),
3312 /* harmony export */ "isString": () => (/* binding */ isString),
3313 /* harmony export */ "isSymbol": () => (/* binding */ isSymbol),
3314 /* harmony export */ "isType": () => (/* binding */ isType),
3315 /* harmony export */ "isUndefined": () => (/* binding */ isUndefined),
3316 /* harmony export */ "isWeakMap": () => (/* binding */ isWeakMap),
3317 /* harmony export */ "isWeakSet": () => (/* binding */ isWeakSet)
3318 /* harmony export */ });
3319 /**
3320 * Returns the object type of the given payload
3321 *
3322 * @param {*} payload
3323 * @returns {string}
3324 */
3325 function getType(payload) {
3326 return Object.prototype.toString.call(payload).slice(8, -1);
3327 }
3328 /**
3329 * Returns whether the payload is undefined
3330 *
3331 * @param {*} payload
3332 * @returns {payload is undefined}
3333 */
3334 function isUndefined(payload) {
3335 return getType(payload) === 'Undefined';
3336 }
3337 /**
3338 * Returns whether the payload is null
3339 *
3340 * @param {*} payload
3341 * @returns {payload is null}
3342 */
3343 function isNull(payload) {
3344 return getType(payload) === 'Null';
3345 }
3346 /**
3347 * Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)
3348 *
3349 * @param {*} payload
3350 * @returns {payload is PlainObject}
3351 */
3352 function isPlainObject(payload) {
3353 if (getType(payload) !== 'Object')
3354 return false;
3355 return payload.constructor === Object && Object.getPrototypeOf(payload) === Object.prototype;
3356 }
3357 /**
3358 * Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)
3359 *
3360 * @param {*} payload
3361 * @returns {payload is PlainObject}
3362 */
3363 function isObject(payload) {
3364 return isPlainObject(payload);
3365 }
3366 /**
3367 * Returns whether the payload is a an empty object (excluding special classes or objects with other prototypes)
3368 *
3369 * @param {*} payload
3370 * @returns {payload is { [K in any]: never }}
3371 */
3372 function isEmptyObject(payload) {
3373 return isPlainObject(payload) && Object.keys(payload).length === 0;
3374 }
3375 /**
3376 * Returns whether the payload is a an empty object (excluding special classes or objects with other prototypes)
3377 *
3378 * @param {*} payload
3379 * @returns {payload is PlainObject}
3380 */
3381 function isFullObject(payload) {
3382 return isPlainObject(payload) && Object.keys(payload).length > 0;
3383 }
3384 /**
3385 * Returns whether the payload is an any kind of object (including special classes or objects with different prototypes)
3386 *
3387 * @param {*} payload
3388 * @returns {payload is PlainObject}
3389 */
3390 function isAnyObject(payload) {
3391 return getType(payload) === 'Object';
3392 }
3393 /**
3394 * Returns whether the payload is an object like a type passed in < >
3395 *
3396 * Usage: isObjectLike<{id: any}>(payload) // will make sure it's an object and has an `id` prop.
3397 *
3398 * @template T this must be passed in < >
3399 * @param {*} payload
3400 * @returns {payload is T}
3401 */
3402 function isObjectLike(payload) {
3403 return isAnyObject(payload);
3404 }
3405 /**
3406 * Returns whether the payload is a function (regular or async)
3407 *
3408 * @param {*} payload
3409 * @returns {payload is AnyFunction}
3410 */
3411 function isFunction(payload) {
3412 return typeof payload === 'function';
3413 }
3414 /**
3415 * Returns whether the payload is an array
3416 *
3417 * @param {any} payload
3418 * @returns {payload is any[]}
3419 */
3420 function isArray(payload) {
3421 return getType(payload) === 'Array';
3422 }
3423 /**
3424 * Returns whether the payload is a an array with at least 1 item
3425 *
3426 * @param {*} payload
3427 * @returns {payload is any[]}
3428 */
3429 function isFullArray(payload) {
3430 return isArray(payload) && payload.length > 0;
3431 }
3432 /**
3433 * Returns whether the payload is a an empty array
3434 *
3435 * @param {*} payload
3436 * @returns {payload is []}
3437 */
3438 function isEmptyArray(payload) {
3439 return isArray(payload) && payload.length === 0;
3440 }
3441 /**
3442 * Returns whether the payload is a string
3443 *
3444 * @param {*} payload
3445 * @returns {payload is string}
3446 */
3447 function isString(payload) {
3448 return getType(payload) === 'String';
3449 }
3450 /**
3451 * Returns whether the payload is a string, BUT returns false for ''
3452 *
3453 * @param {*} payload
3454 * @returns {payload is string}
3455 */
3456 function isFullString(payload) {
3457 return isString(payload) && payload !== '';
3458 }
3459 /**
3460 * Returns whether the payload is ''
3461 *
3462 * @param {*} payload
3463 * @returns {payload is string}
3464 */
3465 function isEmptyString(payload) {
3466 return payload === '';
3467 }
3468 /**
3469 * Returns whether the payload is a number (but not NaN)
3470 *
3471 * This will return `false` for `NaN`!!
3472 *
3473 * @param {*} payload
3474 * @returns {payload is number}
3475 */
3476 function isNumber(payload) {
3477 return getType(payload) === 'Number' && !isNaN(payload);
3478 }
3479 /**
3480 * Returns whether the payload is a boolean
3481 *
3482 * @param {*} payload
3483 * @returns {payload is boolean}
3484 */
3485 function isBoolean(payload) {
3486 return getType(payload) === 'Boolean';
3487 }
3488 /**
3489 * Returns whether the payload is a regular expression (RegExp)
3490 *
3491 * @param {*} payload
3492 * @returns {payload is RegExp}
3493 */
3494 function isRegExp(payload) {
3495 return getType(payload) === 'RegExp';
3496 }
3497 /**
3498 * Returns whether the payload is a Map
3499 *
3500 * @param {*} payload
3501 * @returns {payload is Map<any, any>}
3502 */
3503 function isMap(payload) {
3504 return getType(payload) === 'Map';
3505 }
3506 /**
3507 * Returns whether the payload is a WeakMap
3508 *
3509 * @param {*} payload
3510 * @returns {payload is WeakMap<any, any>}
3511 */
3512 function isWeakMap(payload) {
3513 return getType(payload) === 'WeakMap';
3514 }
3515 /**
3516 * Returns whether the payload is a Set
3517 *
3518 * @param {*} payload
3519 * @returns {payload is Set<any>}
3520 */
3521 function isSet(payload) {
3522 return getType(payload) === 'Set';
3523 }
3524 /**
3525 * Returns whether the payload is a WeakSet
3526 *
3527 * @param {*} payload
3528 * @returns {payload is WeakSet<any>}
3529 */
3530 function isWeakSet(payload) {
3531 return getType(payload) === 'WeakSet';
3532 }
3533 /**
3534 * Returns whether the payload is a Symbol
3535 *
3536 * @param {*} payload
3537 * @returns {payload is symbol}
3538 */
3539 function isSymbol(payload) {
3540 return getType(payload) === 'Symbol';
3541 }
3542 /**
3543 * Returns whether the payload is a Date, and that the date is valid
3544 *
3545 * @param {*} payload
3546 * @returns {payload is Date}
3547 */
3548 function isDate(payload) {
3549 return getType(payload) === 'Date' && !isNaN(payload);
3550 }
3551 /**
3552 * Returns whether the payload is a Blob
3553 *
3554 * @param {*} payload
3555 * @returns {payload is Blob}
3556 */
3557 function isBlob(payload) {
3558 return getType(payload) === 'Blob';
3559 }
3560 /**
3561 * Returns whether the payload is a File
3562 *
3563 * @param {*} payload
3564 * @returns {payload is File}
3565 */
3566 function isFile(payload) {
3567 return getType(payload) === 'File';
3568 }
3569 /**
3570 * Returns whether the payload is a Promise
3571 *
3572 * @param {*} payload
3573 * @returns {payload is Promise<any>}
3574 */
3575 function isPromise(payload) {
3576 return getType(payload) === 'Promise';
3577 }
3578 /**
3579 * Returns whether the payload is an Error
3580 *
3581 * @param {*} payload
3582 * @returns {payload is Error}
3583 */
3584 function isError(payload) {
3585 return getType(payload) === 'Error';
3586 }
3587 /**
3588 * Returns whether the payload is literally the value `NaN` (it's `NaN` and also a `number`)
3589 *
3590 * @param {*} payload
3591 * @returns {payload is typeof NaN}
3592 */
3593 function isNaNValue(payload) {
3594 return getType(payload) === 'Number' && isNaN(payload);
3595 }
3596 /**
3597 * Returns whether the payload is a primitive type (eg. Boolean | Null | Undefined | Number | String | Symbol)
3598 *
3599 * @param {*} payload
3600 * @returns {(payload is boolean | null | undefined | number | string | symbol)}
3601 */
3602 function isPrimitive(payload) {
3603 return (isBoolean(payload) ||
3604 isNull(payload) ||
3605 isUndefined(payload) ||
3606 isNumber(payload) ||
3607 isString(payload) ||
3608 isSymbol(payload));
3609 }
3610 /**
3611 * Returns true whether the payload is null or undefined
3612 *
3613 * @param {*} payload
3614 * @returns {(payload is null | undefined)}
3615 */
3616 var isNullOrUndefined = isOneOf(isNull, isUndefined);
3617 function isOneOf(a, b, c, d, e) {
3618 return function (value) {
3619 return a(value) || b(value) || (!!c && c(value)) || (!!d && d(value)) || (!!e && e(value));
3620 };
3621 }
3622 /**
3623 * Does a generic check to check that the given payload is of a given type.
3624 * In cases like Number, it will return true for NaN as NaN is a Number (thanks javascript!);
3625 * It will, however, differentiate between object and null
3626 *
3627 * @template T
3628 * @param {*} payload
3629 * @param {T} type
3630 * @throws {TypeError} Will throw type error if type is an invalid type
3631 * @returns {payload is T}
3632 */
3633 function isType(payload, type) {
3634 if (!(type instanceof Function)) {
3635 throw new TypeError('Type must be a function');
3636 }
3637 if (!Object.prototype.hasOwnProperty.call(type, 'prototype')) {
3638 throw new TypeError('Type is not a class');
3639 }
3640 // Classes usually have names (as functions usually have names)
3641 var name = type.name;
3642 return getType(payload) === name || Boolean(payload && payload.constructor === type);
3643 }
3644
3645
3646
3647
3648 /***/ }),
3649
3650 /***/ "./node_modules/lodash/_Symbol.js":
3651 /*!****************************************!*\
3652 !*** ./node_modules/lodash/_Symbol.js ***!
3653 \****************************************/
3654 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3655
3656 var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");
3657
3658 /** Built-in value references. */
3659 var Symbol = root.Symbol;
3660
3661 module.exports = Symbol;
3662
3663
3664 /***/ }),
3665
3666 /***/ "./node_modules/lodash/_baseGetTag.js":
3667 /*!********************************************!*\
3668 !*** ./node_modules/lodash/_baseGetTag.js ***!
3669 \********************************************/
3670 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3671
3672 var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"),
3673 getRawTag = __webpack_require__(/*! ./_getRawTag */ "./node_modules/lodash/_getRawTag.js"),
3674 objectToString = __webpack_require__(/*! ./_objectToString */ "./node_modules/lodash/_objectToString.js");
3675
3676 /** `Object#toString` result references. */
3677 var nullTag = '[object Null]',
3678 undefinedTag = '[object Undefined]';
3679
3680 /** Built-in value references. */
3681 var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
3682
3683 /**
3684 * The base implementation of `getTag` without fallbacks for buggy environments.
3685 *
3686 * @private
3687 * @param {*} value The value to query.
3688 * @returns {string} Returns the `toStringTag`.
3689 */
3690 function baseGetTag(value) {
3691 if (value == null) {
3692 return value === undefined ? undefinedTag : nullTag;
3693 }
3694 return (symToStringTag && symToStringTag in Object(value))
3695 ? getRawTag(value)
3696 : objectToString(value);
3697 }
3698
3699 module.exports = baseGetTag;
3700
3701
3702 /***/ }),
3703
3704 /***/ "./node_modules/lodash/_baseTrim.js":
3705 /*!******************************************!*\
3706 !*** ./node_modules/lodash/_baseTrim.js ***!
3707 \******************************************/
3708 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3709
3710 var trimmedEndIndex = __webpack_require__(/*! ./_trimmedEndIndex */ "./node_modules/lodash/_trimmedEndIndex.js");
3711
3712 /** Used to match leading whitespace. */
3713 var reTrimStart = /^\s+/;
3714
3715 /**
3716 * The base implementation of `_.trim`.
3717 *
3718 * @private
3719 * @param {string} string The string to trim.
3720 * @returns {string} Returns the trimmed string.
3721 */
3722 function baseTrim(string) {
3723 return string
3724 ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
3725 : string;
3726 }
3727
3728 module.exports = baseTrim;
3729
3730
3731 /***/ }),
3732
3733 /***/ "./node_modules/lodash/_freeGlobal.js":
3734 /*!********************************************!*\
3735 !*** ./node_modules/lodash/_freeGlobal.js ***!
3736 \********************************************/
3737 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3738
3739 /** Detect free variable `global` from Node.js. */
3740 var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
3741
3742 module.exports = freeGlobal;
3743
3744
3745 /***/ }),
3746
3747 /***/ "./node_modules/lodash/_getRawTag.js":
3748 /*!*******************************************!*\
3749 !*** ./node_modules/lodash/_getRawTag.js ***!
3750 \*******************************************/
3751 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3752
3753 var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js");
3754
3755 /** Used for built-in method references. */
3756 var objectProto = Object.prototype;
3757
3758 /** Used to check objects for own properties. */
3759 var hasOwnProperty = objectProto.hasOwnProperty;
3760
3761 /**
3762 * Used to resolve the
3763 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
3764 * of values.
3765 */
3766 var nativeObjectToString = objectProto.toString;
3767
3768 /** Built-in value references. */
3769 var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
3770
3771 /**
3772 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
3773 *
3774 * @private
3775 * @param {*} value The value to query.
3776 * @returns {string} Returns the raw `toStringTag`.
3777 */
3778 function getRawTag(value) {
3779 var isOwn = hasOwnProperty.call(value, symToStringTag),
3780 tag = value[symToStringTag];
3781
3782 try {
3783 value[symToStringTag] = undefined;
3784 var unmasked = true;
3785 } catch (e) {}
3786
3787 var result = nativeObjectToString.call(value);
3788 if (unmasked) {
3789 if (isOwn) {
3790 value[symToStringTag] = tag;
3791 } else {
3792 delete value[symToStringTag];
3793 }
3794 }
3795 return result;
3796 }
3797
3798 module.exports = getRawTag;
3799
3800
3801 /***/ }),
3802
3803 /***/ "./node_modules/lodash/_objectToString.js":
3804 /*!************************************************!*\
3805 !*** ./node_modules/lodash/_objectToString.js ***!
3806 \************************************************/
3807 /***/ ((module) => {
3808
3809 /** Used for built-in method references. */
3810 var objectProto = Object.prototype;
3811
3812 /**
3813 * Used to resolve the
3814 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
3815 * of values.
3816 */
3817 var nativeObjectToString = objectProto.toString;
3818
3819 /**
3820 * Converts `value` to a string using `Object.prototype.toString`.
3821 *
3822 * @private
3823 * @param {*} value The value to convert.
3824 * @returns {string} Returns the converted string.
3825 */
3826 function objectToString(value) {
3827 return nativeObjectToString.call(value);
3828 }
3829
3830 module.exports = objectToString;
3831
3832
3833 /***/ }),
3834
3835 /***/ "./node_modules/lodash/_root.js":
3836 /*!**************************************!*\
3837 !*** ./node_modules/lodash/_root.js ***!
3838 \**************************************/
3839 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3840
3841 var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "./node_modules/lodash/_freeGlobal.js");
3842
3843 /** Detect free variable `self`. */
3844 var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
3845
3846 /** Used as a reference to the global object. */
3847 var root = freeGlobal || freeSelf || Function('return this')();
3848
3849 module.exports = root;
3850
3851
3852 /***/ }),
3853
3854 /***/ "./node_modules/lodash/_trimmedEndIndex.js":
3855 /*!*************************************************!*\
3856 !*** ./node_modules/lodash/_trimmedEndIndex.js ***!
3857 \*************************************************/
3858 /***/ ((module) => {
3859
3860 /** Used to match a single whitespace character. */
3861 var reWhitespace = /\s/;
3862
3863 /**
3864 * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
3865 * character of `string`.
3866 *
3867 * @private
3868 * @param {string} string The string to inspect.
3869 * @returns {number} Returns the index of the last non-whitespace character.
3870 */
3871 function trimmedEndIndex(string) {
3872 var index = string.length;
3873
3874 while (index-- && reWhitespace.test(string.charAt(index))) {}
3875 return index;
3876 }
3877
3878 module.exports = trimmedEndIndex;
3879
3880
3881 /***/ }),
3882
3883 /***/ "./node_modules/lodash/debounce.js":
3884 /*!*****************************************!*\
3885 !*** ./node_modules/lodash/debounce.js ***!
3886 \*****************************************/
3887 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3888
3889 var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"),
3890 now = __webpack_require__(/*! ./now */ "./node_modules/lodash/now.js"),
3891 toNumber = __webpack_require__(/*! ./toNumber */ "./node_modules/lodash/toNumber.js");
3892
3893 /** Error message constants. */
3894 var FUNC_ERROR_TEXT = 'Expected a function';
3895
3896 /* Built-in method references for those with the same name as other `lodash` methods. */
3897 var nativeMax = Math.max,
3898 nativeMin = Math.min;
3899
3900 /**
3901 * Creates a debounced function that delays invoking `func` until after `wait`
3902 * milliseconds have elapsed since the last time the debounced function was
3903 * invoked. The debounced function comes with a `cancel` method to cancel
3904 * delayed `func` invocations and a `flush` method to immediately invoke them.
3905 * Provide `options` to indicate whether `func` should be invoked on the
3906 * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
3907 * with the last arguments provided to the debounced function. Subsequent
3908 * calls to the debounced function return the result of the last `func`
3909 * invocation.
3910 *
3911 * **Note:** If `leading` and `trailing` options are `true`, `func` is
3912 * invoked on the trailing edge of the timeout only if the debounced function
3913 * is invoked more than once during the `wait` timeout.
3914 *
3915 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
3916 * until to the next tick, similar to `setTimeout` with a timeout of `0`.
3917 *
3918 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
3919 * for details over the differences between `_.debounce` and `_.throttle`.
3920 *
3921 * @static
3922 * @memberOf _
3923 * @since 0.1.0
3924 * @category Function
3925 * @param {Function} func The function to debounce.
3926 * @param {number} [wait=0] The number of milliseconds to delay.
3927 * @param {Object} [options={}] The options object.
3928 * @param {boolean} [options.leading=false]
3929 * Specify invoking on the leading edge of the timeout.
3930 * @param {number} [options.maxWait]
3931 * The maximum time `func` is allowed to be delayed before it's invoked.
3932 * @param {boolean} [options.trailing=true]
3933 * Specify invoking on the trailing edge of the timeout.
3934 * @returns {Function} Returns the new debounced function.
3935 * @example
3936 *
3937 * // Avoid costly calculations while the window size is in flux.
3938 * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
3939 *
3940 * // Invoke `sendMail` when clicked, debouncing subsequent calls.
3941 * jQuery(element).on('click', _.debounce(sendMail, 300, {
3942 * 'leading': true,
3943 * 'trailing': false
3944 * }));
3945 *
3946 * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
3947 * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
3948 * var source = new EventSource('/stream');
3949 * jQuery(source).on('message', debounced);
3950 *
3951 * // Cancel the trailing debounced invocation.
3952 * jQuery(window).on('popstate', debounced.cancel);
3953 */
3954 function debounce(func, wait, options) {
3955 var lastArgs,
3956 lastThis,
3957 maxWait,
3958 result,
3959 timerId,
3960 lastCallTime,
3961 lastInvokeTime = 0,
3962 leading = false,
3963 maxing = false,
3964 trailing = true;
3965
3966 if (typeof func != 'function') {
3967 throw new TypeError(FUNC_ERROR_TEXT);
3968 }
3969 wait = toNumber(wait) || 0;
3970 if (isObject(options)) {
3971 leading = !!options.leading;
3972 maxing = 'maxWait' in options;
3973 maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
3974 trailing = 'trailing' in options ? !!options.trailing : trailing;
3975 }
3976
3977 function invokeFunc(time) {
3978 var args = lastArgs,
3979 thisArg = lastThis;
3980
3981 lastArgs = lastThis = undefined;
3982 lastInvokeTime = time;
3983 result = func.apply(thisArg, args);
3984 return result;
3985 }
3986
3987 function leadingEdge(time) {
3988 // Reset any `maxWait` timer.
3989 lastInvokeTime = time;
3990 // Start the timer for the trailing edge.
3991 timerId = setTimeout(timerExpired, wait);
3992 // Invoke the leading edge.
3993 return leading ? invokeFunc(time) : result;
3994 }
3995
3996 function remainingWait(time) {
3997 var timeSinceLastCall = time - lastCallTime,
3998 timeSinceLastInvoke = time - lastInvokeTime,
3999 timeWaiting = wait - timeSinceLastCall;
4000
4001 return maxing
4002 ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
4003 : timeWaiting;
4004 }
4005
4006 function shouldInvoke(time) {
4007 var timeSinceLastCall = time - lastCallTime,
4008 timeSinceLastInvoke = time - lastInvokeTime;
4009
4010 // Either this is the first call, activity has stopped and we're at the
4011 // trailing edge, the system time has gone backwards and we're treating
4012 // it as the trailing edge, or we've hit the `maxWait` limit.
4013 return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
4014 (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
4015 }
4016
4017 function timerExpired() {
4018 var time = now();
4019 if (shouldInvoke(time)) {
4020 return trailingEdge(time);
4021 }
4022 // Restart the timer.
4023 timerId = setTimeout(timerExpired, remainingWait(time));
4024 }
4025
4026 function trailingEdge(time) {
4027 timerId = undefined;
4028
4029 // Only invoke if we have `lastArgs` which means `func` has been
4030 // debounced at least once.
4031 if (trailing && lastArgs) {
4032 return invokeFunc(time);
4033 }
4034 lastArgs = lastThis = undefined;
4035 return result;
4036 }
4037
4038 function cancel() {
4039 if (timerId !== undefined) {
4040 clearTimeout(timerId);
4041 }
4042 lastInvokeTime = 0;
4043 lastArgs = lastCallTime = lastThis = timerId = undefined;
4044 }
4045
4046 function flush() {
4047 return timerId === undefined ? result : trailingEdge(now());
4048 }
4049
4050 function debounced() {
4051 var time = now(),
4052 isInvoking = shouldInvoke(time);
4053
4054 lastArgs = arguments;
4055 lastThis = this;
4056 lastCallTime = time;
4057
4058 if (isInvoking) {
4059 if (timerId === undefined) {
4060 return leadingEdge(lastCallTime);
4061 }
4062 if (maxing) {
4063 // Handle invocations in a tight loop.
4064 clearTimeout(timerId);
4065 timerId = setTimeout(timerExpired, wait);
4066 return invokeFunc(lastCallTime);
4067 }
4068 }
4069 if (timerId === undefined) {
4070 timerId = setTimeout(timerExpired, wait);
4071 }
4072 return result;
4073 }
4074 debounced.cancel = cancel;
4075 debounced.flush = flush;
4076 return debounced;
4077 }
4078
4079 module.exports = debounce;
4080
4081
4082 /***/ }),
4083
4084 /***/ "./node_modules/lodash/isObject.js":
4085 /*!*****************************************!*\
4086 !*** ./node_modules/lodash/isObject.js ***!
4087 \*****************************************/
4088 /***/ ((module) => {
4089
4090 /**
4091 * Checks if `value` is the
4092 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
4093 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
4094 *
4095 * @static
4096 * @memberOf _
4097 * @since 0.1.0
4098 * @category Lang
4099 * @param {*} value The value to check.
4100 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
4101 * @example
4102 *
4103 * _.isObject({});
4104 * // => true
4105 *
4106 * _.isObject([1, 2, 3]);
4107 * // => true
4108 *
4109 * _.isObject(_.noop);
4110 * // => true
4111 *
4112 * _.isObject(null);
4113 * // => false
4114 */
4115 function isObject(value) {
4116 var type = typeof value;
4117 return value != null && (type == 'object' || type == 'function');
4118 }
4119
4120 module.exports = isObject;
4121
4122
4123 /***/ }),
4124
4125 /***/ "./node_modules/lodash/isObjectLike.js":
4126 /*!*********************************************!*\
4127 !*** ./node_modules/lodash/isObjectLike.js ***!
4128 \*********************************************/
4129 /***/ ((module) => {
4130
4131 /**
4132 * Checks if `value` is object-like. A value is object-like if it's not `null`
4133 * and has a `typeof` result of "object".
4134 *
4135 * @static
4136 * @memberOf _
4137 * @since 4.0.0
4138 * @category Lang
4139 * @param {*} value The value to check.
4140 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
4141 * @example
4142 *
4143 * _.isObjectLike({});
4144 * // => true
4145 *
4146 * _.isObjectLike([1, 2, 3]);
4147 * // => true
4148 *
4149 * _.isObjectLike(_.noop);
4150 * // => false
4151 *
4152 * _.isObjectLike(null);
4153 * // => false
4154 */
4155 function isObjectLike(value) {
4156 return value != null && typeof value == 'object';
4157 }
4158
4159 module.exports = isObjectLike;
4160
4161
4162 /***/ }),
4163
4164 /***/ "./node_modules/lodash/isSymbol.js":
4165 /*!*****************************************!*\
4166 !*** ./node_modules/lodash/isSymbol.js ***!
4167 \*****************************************/
4168 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4169
4170 var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"),
4171 isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js");
4172
4173 /** `Object#toString` result references. */
4174 var symbolTag = '[object Symbol]';
4175
4176 /**
4177 * Checks if `value` is classified as a `Symbol` primitive or object.
4178 *
4179 * @static
4180 * @memberOf _
4181 * @since 4.0.0
4182 * @category Lang
4183 * @param {*} value The value to check.
4184 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
4185 * @example
4186 *
4187 * _.isSymbol(Symbol.iterator);
4188 * // => true
4189 *
4190 * _.isSymbol('abc');
4191 * // => false
4192 */
4193 function isSymbol(value) {
4194 return typeof value == 'symbol' ||
4195 (isObjectLike(value) && baseGetTag(value) == symbolTag);
4196 }
4197
4198 module.exports = isSymbol;
4199
4200
4201 /***/ }),
4202
4203 /***/ "./node_modules/lodash/now.js":
4204 /*!************************************!*\
4205 !*** ./node_modules/lodash/now.js ***!
4206 \************************************/
4207 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4208
4209 var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");
4210
4211 /**
4212 * Gets the timestamp of the number of milliseconds that have elapsed since
4213 * the Unix epoch (1 January 1970 00:00:00 UTC).
4214 *
4215 * @static
4216 * @memberOf _
4217 * @since 2.4.0
4218 * @category Date
4219 * @returns {number} Returns the timestamp.
4220 * @example
4221 *
4222 * _.defer(function(stamp) {
4223 * console.log(_.now() - stamp);
4224 * }, _.now());
4225 * // => Logs the number of milliseconds it took for the deferred invocation.
4226 */
4227 var now = function() {
4228 return root.Date.now();
4229 };
4230
4231 module.exports = now;
4232
4233
4234 /***/ }),
4235
4236 /***/ "./node_modules/lodash/toNumber.js":
4237 /*!*****************************************!*\
4238 !*** ./node_modules/lodash/toNumber.js ***!
4239 \*****************************************/
4240 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4241
4242 var baseTrim = __webpack_require__(/*! ./_baseTrim */ "./node_modules/lodash/_baseTrim.js"),
4243 isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"),
4244 isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js");
4245
4246 /** Used as references for various `Number` constants. */
4247 var NAN = 0 / 0;
4248
4249 /** Used to detect bad signed hexadecimal string values. */
4250 var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
4251
4252 /** Used to detect binary string values. */
4253 var reIsBinary = /^0b[01]+$/i;
4254
4255 /** Used to detect octal string values. */
4256 var reIsOctal = /^0o[0-7]+$/i;
4257
4258 /** Built-in method references without a dependency on `root`. */
4259 var freeParseInt = parseInt;
4260
4261 /**
4262 * Converts `value` to a number.
4263 *
4264 * @static
4265 * @memberOf _
4266 * @since 4.0.0
4267 * @category Lang
4268 * @param {*} value The value to process.
4269 * @returns {number} Returns the number.
4270 * @example
4271 *
4272 * _.toNumber(3.2);
4273 * // => 3.2
4274 *
4275 * _.toNumber(Number.MIN_VALUE);
4276 * // => 5e-324
4277 *
4278 * _.toNumber(Infinity);
4279 * // => Infinity
4280 *
4281 * _.toNumber('3.2');
4282 * // => 3.2
4283 */
4284 function toNumber(value) {
4285 if (typeof value == 'number') {
4286 return value;
4287 }
4288 if (isSymbol(value)) {
4289 return NAN;
4290 }
4291 if (isObject(value)) {
4292 var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
4293 value = isObject(other) ? (other + '') : other;
4294 }
4295 if (typeof value != 'string') {
4296 return value === 0 ? value : +value;
4297 }
4298 value = baseTrim(value);
4299 var isBinary = reIsBinary.test(value);
4300 return (isBinary || reIsOctal.test(value))
4301 ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
4302 : (reIsBadHex.test(value) ? NAN : +value);
4303 }
4304
4305 module.exports = toNumber;
4306
4307
4308 /***/ }),
4309
4310 /***/ "./node_modules/memoize-one/dist/memoize-one.esm.js":
4311 /*!**********************************************************!*\
4312 !*** ./node_modules/memoize-one/dist/memoize-one.esm.js ***!
4313 \**********************************************************/
4314 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4315
4316 "use strict";
4317 __webpack_require__.r(__webpack_exports__);
4318 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4319 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
4320 /* harmony export */ });
4321 var safeIsNaN = Number.isNaN ||
4322 function ponyfill(value) {
4323 return typeof value === 'number' && value !== value;
4324 };
4325 function isEqual(first, second) {
4326 if (first === second) {
4327 return true;
4328 }
4329 if (safeIsNaN(first) && safeIsNaN(second)) {
4330 return true;
4331 }
4332 return false;
4333 }
4334 function areInputsEqual(newInputs, lastInputs) {
4335 if (newInputs.length !== lastInputs.length) {
4336 return false;
4337 }
4338 for (var i = 0; i < newInputs.length; i++) {
4339 if (!isEqual(newInputs[i], lastInputs[i])) {
4340 return false;
4341 }
4342 }
4343 return true;
4344 }
4345
4346 function memoizeOne(resultFn, isEqual) {
4347 if (isEqual === void 0) { isEqual = areInputsEqual; }
4348 var lastThis;
4349 var lastArgs = [];
4350 var lastResult;
4351 var calledOnce = false;
4352 function memoized() {
4353 var newArgs = [];
4354 for (var _i = 0; _i < arguments.length; _i++) {
4355 newArgs[_i] = arguments[_i];
4356 }
4357 if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) {
4358 return lastResult;
4359 }
4360 lastResult = resultFn.apply(this, newArgs);
4361 calledOnce = true;
4362 lastThis = this;
4363 lastArgs = newArgs;
4364 return lastResult;
4365 }
4366 return memoized;
4367 }
4368
4369 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (memoizeOne);
4370
4371
4372 /***/ }),
4373
4374 /***/ "./node_modules/merge-anything/dist/index.esm.js":
4375 /*!*******************************************************!*\
4376 !*** ./node_modules/merge-anything/dist/index.esm.js ***!
4377 \*******************************************************/
4378 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4379
4380 "use strict";
4381 __webpack_require__.r(__webpack_exports__);
4382 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4383 /* harmony export */ "concatArrays": () => (/* binding */ concatArrays),
4384 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
4385 /* harmony export */ "merge": () => (/* binding */ merge)
4386 /* harmony export */ });
4387 /* harmony import */ var is_what__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! is-what */ "./node_modules/is-what/dist/index.esm.js");
4388
4389
4390 /*! *****************************************************************************
4391 Copyright (c) Microsoft Corporation. All rights reserved.
4392 Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4393 this file except in compliance with the License. You may obtain a copy of the
4394 License at http://www.apache.org/licenses/LICENSE-2.0
4395
4396 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
4397 KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
4398 WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
4399 MERCHANTABLITY OR NON-INFRINGEMENT.
4400
4401 See the Apache Version 2.0 License for specific language governing permissions
4402 and limitations under the License.
4403 ***************************************************************************** */
4404
4405 function __spreadArrays() {
4406 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
4407 for (var r = Array(s), k = 0, i = 0; i < il; i++)
4408 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
4409 r[k] = a[j];
4410 return r;
4411 }
4412
4413 function assignProp(carry, key, newVal, originalObject) {
4414 var propType = originalObject.propertyIsEnumerable(key)
4415 ? 'enumerable'
4416 : 'nonenumerable';
4417 if (propType === 'enumerable')
4418 carry[key] = newVal;
4419 if (propType === 'nonenumerable') {
4420 Object.defineProperty(carry, key, {
4421 value: newVal,
4422 enumerable: false,
4423 writable: true,
4424 configurable: true
4425 });
4426 }
4427 }
4428 function mergeRecursively(origin, newComer, extensions) {
4429 // work directly on newComer if its not an object
4430 if (!(0,is_what__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(newComer)) {
4431 // extend merge rules
4432 if (extensions && (0,is_what__WEBPACK_IMPORTED_MODULE_0__.isArray)(extensions)) {
4433 extensions.forEach(function (extend) {
4434 newComer = extend(origin, newComer);
4435 });
4436 }
4437 return newComer;
4438 }
4439 // define newObject to merge all values upon
4440 var newObject = {};
4441 if ((0,is_what__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(origin)) {
4442 var props_1 = Object.getOwnPropertyNames(origin);
4443 var symbols_1 = Object.getOwnPropertySymbols(origin);
4444 newObject = __spreadArrays(props_1, symbols_1).reduce(function (carry, key) {
4445 // @ts-ignore
4446 var targetVal = origin[key];
4447 if ((!(0,is_what__WEBPACK_IMPORTED_MODULE_0__.isSymbol)(key) && !Object.getOwnPropertyNames(newComer).includes(key)) ||
4448 ((0,is_what__WEBPACK_IMPORTED_MODULE_0__.isSymbol)(key) && !Object.getOwnPropertySymbols(newComer).includes(key))) {
4449 assignProp(carry, key, targetVal, origin);
4450 }
4451 return carry;
4452 }, {});
4453 }
4454 var props = Object.getOwnPropertyNames(newComer);
4455 var symbols = Object.getOwnPropertySymbols(newComer);
4456 var result = __spreadArrays(props, symbols).reduce(function (carry, key) {
4457 // re-define the origin and newComer as targetVal and newVal
4458 var newVal = newComer[key];
4459 var targetVal = ((0,is_what__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(origin))
4460 // @ts-ignore
4461 ? origin[key]
4462 : undefined;
4463 // extend merge rules
4464 if (extensions && (0,is_what__WEBPACK_IMPORTED_MODULE_0__.isArray)(extensions)) {
4465 extensions.forEach(function (extend) {
4466 newVal = extend(targetVal, newVal);
4467 });
4468 }
4469 // When newVal is an object do the merge recursively
4470 if (targetVal !== undefined && (0,is_what__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(newVal)) {
4471 newVal = mergeRecursively(targetVal, newVal, extensions);
4472 }
4473 assignProp(carry, key, newVal, newComer);
4474 return carry;
4475 }, newObject);
4476 return result;
4477 }
4478 /**
4479 * Merge anything recursively.
4480 * Objects get merged, special objects (classes etc.) are re-assigned "as is".
4481 * Basic types overwrite objects or other basic types.
4482 *
4483 * @param {(IConfig | any)} origin
4484 * @param {...any[]} newComers
4485 * @returns the result
4486 */
4487 function merge(origin) {
4488 var newComers = [];
4489 for (var _i = 1; _i < arguments.length; _i++) {
4490 newComers[_i - 1] = arguments[_i];
4491 }
4492 var extensions = null;
4493 var base = origin;
4494 if ((0,is_what__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(origin) && origin.extensions && Object.keys(origin).length === 1) {
4495 base = {};
4496 extensions = origin.extensions;
4497 }
4498 return newComers.reduce(function (result, newComer) {
4499 return mergeRecursively(result, newComer, extensions);
4500 }, base);
4501 }
4502
4503 function concatArrays(originVal, newVal) {
4504 if ((0,is_what__WEBPACK_IMPORTED_MODULE_0__.isArray)(originVal) && (0,is_what__WEBPACK_IMPORTED_MODULE_0__.isArray)(newVal)) {
4505 // concat logic
4506 return originVal.concat(newVal);
4507 }
4508 return newVal; // always return newVal as fallback!!
4509 }
4510
4511 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (merge);
4512
4513
4514
4515 /***/ }),
4516
4517 /***/ "./scripts/gutenberg/UIComponents/UIImage.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/gutenberg/UIComponents/UIImage.ts":
4518 /*!****************************************************************************************************************************************************************************************!*\
4519 !*** ./scripts/gutenberg/UIComponents/UIImage.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/gutenberg/UIComponents/UIImage.ts ***!
4520 \****************************************************************************************************************************************************************************************/
4521 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4522
4523 "use strict";
4524 __webpack_require__.r(__webpack_exports__);
4525 // extracted by mini-css-extract-plugin
4526
4527
4528 /***/ }),
4529
4530 /***/ "./scripts/shared/Common/AsyncSelect.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/Common/AsyncSelect.tsx":
4531 /*!*******************************************************************************************************************************************************************************!*\
4532 !*** ./scripts/shared/Common/AsyncSelect.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/Common/AsyncSelect.tsx ***!
4533 \*******************************************************************************************************************************************************************************/
4534 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4535
4536 "use strict";
4537 __webpack_require__.r(__webpack_exports__);
4538 // extracted by mini-css-extract-plugin
4539
4540
4541 /***/ }),
4542
4543 /***/ "./scripts/shared/Common/HubspotWrapper.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/Common/HubspotWrapper.ts":
4544 /*!************************************************************************************************************************************************************************************!*\
4545 !*** ./scripts/shared/Common/HubspotWrapper.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/Common/HubspotWrapper.ts ***!
4546 \************************************************************************************************************************************************************************************/
4547 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4548
4549 "use strict";
4550 __webpack_require__.r(__webpack_exports__);
4551 // extracted by mini-css-extract-plugin
4552
4553
4554 /***/ }),
4555
4556 /***/ "./scripts/shared/UIComponents/UIAlert.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIAlert.tsx":
4557 /*!***********************************************************************************************************************************************************************************!*\
4558 !*** ./scripts/shared/UIComponents/UIAlert.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIAlert.tsx ***!
4559 \***********************************************************************************************************************************************************************************/
4560 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4561
4562 "use strict";
4563 __webpack_require__.r(__webpack_exports__);
4564 // extracted by mini-css-extract-plugin
4565
4566
4567 /***/ }),
4568
4569 /***/ "./scripts/shared/UIComponents/UIButton.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIButton.ts":
4570 /*!************************************************************************************************************************************************************************************!*\
4571 !*** ./scripts/shared/UIComponents/UIButton.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIButton.ts ***!
4572 \************************************************************************************************************************************************************************************/
4573 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4574
4575 "use strict";
4576 __webpack_require__.r(__webpack_exports__);
4577 // extracted by mini-css-extract-plugin
4578
4579
4580 /***/ }),
4581
4582 /***/ "./scripts/shared/UIComponents/UIContainer.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIContainer.ts":
4583 /*!******************************************************************************************************************************************************************************************!*\
4584 !*** ./scripts/shared/UIComponents/UIContainer.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIContainer.ts ***!
4585 \******************************************************************************************************************************************************************************************/
4586 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4587
4588 "use strict";
4589 __webpack_require__.r(__webpack_exports__);
4590 // extracted by mini-css-extract-plugin
4591
4592
4593 /***/ }),
4594
4595 /***/ "./scripts/shared/UIComponents/UIOverlay.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIOverlay.ts":
4596 /*!**************************************************************************************************************************************************************************************!*\
4597 !*** ./scripts/shared/UIComponents/UIOverlay.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIOverlay.ts ***!
4598 \**************************************************************************************************************************************************************************************/
4599 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4600
4601 "use strict";
4602 __webpack_require__.r(__webpack_exports__);
4603 // extracted by mini-css-extract-plugin
4604
4605
4606 /***/ }),
4607
4608 /***/ "./scripts/shared/UIComponents/UISpacer.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UISpacer.ts":
4609 /*!************************************************************************************************************************************************************************************!*\
4610 !*** ./scripts/shared/UIComponents/UISpacer.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UISpacer.ts ***!
4611 \************************************************************************************************************************************************************************************/
4612 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4613
4614 "use strict";
4615 __webpack_require__.r(__webpack_exports__);
4616 // extracted by mini-css-extract-plugin
4617
4618
4619 /***/ }),
4620
4621 /***/ "./scripts/shared/UIComponents/UISpinner.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UISpinner.tsx":
4622 /*!***************************************************************************************************************************************************************************************!*\
4623 !*** ./scripts/shared/UIComponents/UISpinner.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UISpinner.tsx ***!
4624 \***************************************************************************************************************************************************************************************/
4625 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4626
4627 "use strict";
4628 __webpack_require__.r(__webpack_exports__);
4629 // extracted by mini-css-extract-plugin
4630
4631
4632 /***/ }),
4633
4634 /***/ "./node_modules/object-assign/index.js":
4635 /*!*********************************************!*\
4636 !*** ./node_modules/object-assign/index.js ***!
4637 \*********************************************/
4638 /***/ ((module) => {
4639
4640 "use strict";
4641 /*
4642 object-assign
4643 (c) Sindre Sorhus
4644 @license MIT
4645 */
4646
4647
4648 /* eslint-disable no-unused-vars */
4649 var getOwnPropertySymbols = Object.getOwnPropertySymbols;
4650 var hasOwnProperty = Object.prototype.hasOwnProperty;
4651 var propIsEnumerable = Object.prototype.propertyIsEnumerable;
4652
4653 function toObject(val) {
4654 if (val === null || val === undefined) {
4655 throw new TypeError('Object.assign cannot be called with null or undefined');
4656 }
4657
4658 return Object(val);
4659 }
4660
4661 function shouldUseNative() {
4662 try {
4663 if (!Object.assign) {
4664 return false;
4665 }
4666
4667 // Detect buggy property enumeration order in older V8 versions.
4668
4669 // https://bugs.chromium.org/p/v8/issues/detail?id=4118
4670 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
4671 test1[5] = 'de';
4672 if (Object.getOwnPropertyNames(test1)[0] === '5') {
4673 return false;
4674 }
4675
4676 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
4677 var test2 = {};
4678 for (var i = 0; i < 10; i++) {
4679 test2['_' + String.fromCharCode(i)] = i;
4680 }
4681 var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
4682 return test2[n];
4683 });
4684 if (order2.join('') !== '0123456789') {
4685 return false;
4686 }
4687
4688 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
4689 var test3 = {};
4690 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
4691 test3[letter] = letter;
4692 });
4693 if (Object.keys(Object.assign({}, test3)).join('') !==
4694 'abcdefghijklmnopqrst') {
4695 return false;
4696 }
4697
4698 return true;
4699 } catch (err) {
4700 // We don't expect any of the above to throw, but better to be safe.
4701 return false;
4702 }
4703 }
4704
4705 module.exports = shouldUseNative() ? Object.assign : function (target, source) {
4706 var from;
4707 var to = toObject(target);
4708 var symbols;
4709
4710 for (var s = 1; s < arguments.length; s++) {
4711 from = Object(arguments[s]);
4712
4713 for (var key in from) {
4714 if (hasOwnProperty.call(from, key)) {
4715 to[key] = from[key];
4716 }
4717 }
4718
4719 if (getOwnPropertySymbols) {
4720 symbols = getOwnPropertySymbols(from);
4721 for (var i = 0; i < symbols.length; i++) {
4722 if (propIsEnumerable.call(from, symbols[i])) {
4723 to[symbols[i]] = from[symbols[i]];
4724 }
4725 }
4726 }
4727 }
4728
4729 return to;
4730 };
4731
4732
4733 /***/ }),
4734
4735 /***/ "./node_modules/prop-types/checkPropTypes.js":
4736 /*!***************************************************!*\
4737 !*** ./node_modules/prop-types/checkPropTypes.js ***!
4738 \***************************************************/
4739 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4740
4741 "use strict";
4742 /**
4743 * Copyright (c) 2013-present, Facebook, Inc.
4744 *
4745 * This source code is licensed under the MIT license found in the
4746 * LICENSE file in the root directory of this source tree.
4747 */
4748
4749
4750
4751 var printWarning = function() {};
4752
4753 if (true) {
4754 var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js");
4755 var loggedTypeFailures = {};
4756 var has = __webpack_require__(/*! ./lib/has */ "./node_modules/prop-types/lib/has.js");
4757
4758 printWarning = function(text) {
4759 var message = 'Warning: ' + text;
4760 if (typeof console !== 'undefined') {
4761 console.error(message);
4762 }
4763 try {
4764 // --- Welcome to debugging React ---
4765 // This error was thrown as a convenience so that you can use this stack
4766 // to find the callsite that caused this warning to fire.
4767 throw new Error(message);
4768 } catch (x) { /**/ }
4769 };
4770 }
4771
4772 /**
4773 * Assert that the values match with the type specs.
4774 * Error messages are memorized and will only be shown once.
4775 *
4776 * @param {object} typeSpecs Map of name to a ReactPropType
4777 * @param {object} values Runtime values that need to be type-checked
4778 * @param {string} location e.g. "prop", "context", "child context"
4779 * @param {string} componentName Name of the component for error messages.
4780 * @param {?Function} getStack Returns the component stack.
4781 * @private
4782 */
4783 function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
4784 if (true) {
4785 for (var typeSpecName in typeSpecs) {
4786 if (has(typeSpecs, typeSpecName)) {
4787 var error;
4788 // Prop type validation may throw. In case they do, we don't want to
4789 // fail the render phase where it didn't fail before. So we log it.
4790 // After these have been cleaned up, we'll let them throw.
4791 try {
4792 // This is intentionally an invariant that gets caught. It's the same
4793 // behavior as without this statement except with a better message.
4794 if (typeof typeSpecs[typeSpecName] !== 'function') {
4795 var err = Error(
4796 (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
4797 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
4798 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
4799 );
4800 err.name = 'Invariant Violation';
4801 throw err;
4802 }
4803 error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
4804 } catch (ex) {
4805 error = ex;
4806 }
4807 if (error && !(error instanceof Error)) {
4808 printWarning(
4809 (componentName || 'React class') + ': type specification of ' +
4810 location + ' `' + typeSpecName + '` is invalid; the type checker ' +
4811 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
4812 'You may have forgotten to pass an argument to the type checker ' +
4813 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
4814 'shape all require an argument).'
4815 );
4816 }
4817 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
4818 // Only monitor this failure once because there tends to be a lot of the
4819 // same error.
4820 loggedTypeFailures[error.message] = true;
4821
4822 var stack = getStack ? getStack() : '';
4823
4824 printWarning(
4825 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
4826 );
4827 }
4828 }
4829 }
4830 }
4831 }
4832
4833 /**
4834 * Resets warning cache when testing.
4835 *
4836 * @private
4837 */
4838 checkPropTypes.resetWarningCache = function() {
4839 if (true) {
4840 loggedTypeFailures = {};
4841 }
4842 }
4843
4844 module.exports = checkPropTypes;
4845
4846
4847 /***/ }),
4848
4849 /***/ "./node_modules/prop-types/factoryWithTypeCheckers.js":
4850 /*!************************************************************!*\
4851 !*** ./node_modules/prop-types/factoryWithTypeCheckers.js ***!
4852 \************************************************************/
4853 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4854
4855 "use strict";
4856 /**
4857 * Copyright (c) 2013-present, Facebook, Inc.
4858 *
4859 * This source code is licensed under the MIT license found in the
4860 * LICENSE file in the root directory of this source tree.
4861 */
4862
4863
4864
4865 var ReactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js");
4866 var assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js");
4867
4868 var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js");
4869 var has = __webpack_require__(/*! ./lib/has */ "./node_modules/prop-types/lib/has.js");
4870 var checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ "./node_modules/prop-types/checkPropTypes.js");
4871
4872 var printWarning = function() {};
4873
4874 if (true) {
4875 printWarning = function(text) {
4876 var message = 'Warning: ' + text;
4877 if (typeof console !== 'undefined') {
4878 console.error(message);
4879 }
4880 try {
4881 // --- Welcome to debugging React ---
4882 // This error was thrown as a convenience so that you can use this stack
4883 // to find the callsite that caused this warning to fire.
4884 throw new Error(message);
4885 } catch (x) {}
4886 };
4887 }
4888
4889 function emptyFunctionThatReturnsNull() {
4890 return null;
4891 }
4892
4893 module.exports = function(isValidElement, throwOnDirectAccess) {
4894 /* global Symbol */
4895 var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
4896 var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
4897
4898 /**
4899 * Returns the iterator method function contained on the iterable object.
4900 *
4901 * Be sure to invoke the function with the iterable as context:
4902 *
4903 * var iteratorFn = getIteratorFn(myIterable);
4904 * if (iteratorFn) {
4905 * var iterator = iteratorFn.call(myIterable);
4906 * ...
4907 * }
4908 *
4909 * @param {?object} maybeIterable
4910 * @return {?function}
4911 */
4912 function getIteratorFn(maybeIterable) {
4913 var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
4914 if (typeof iteratorFn === 'function') {
4915 return iteratorFn;
4916 }
4917 }
4918
4919 /**
4920 * Collection of methods that allow declaration and validation of props that are
4921 * supplied to React components. Example usage:
4922 *
4923 * var Props = require('ReactPropTypes');
4924 * var MyArticle = React.createClass({
4925 * propTypes: {
4926 * // An optional string prop named "description".
4927 * description: Props.string,
4928 *
4929 * // A required enum prop named "category".
4930 * category: Props.oneOf(['News','Photos']).isRequired,
4931 *
4932 * // A prop named "dialog" that requires an instance of Dialog.
4933 * dialog: Props.instanceOf(Dialog).isRequired
4934 * },
4935 * render: function() { ... }
4936 * });
4937 *
4938 * A more formal specification of how these methods are used:
4939 *
4940 * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
4941 * decl := ReactPropTypes.{type}(.isRequired)?
4942 *
4943 * Each and every declaration produces a function with the same signature. This
4944 * allows the creation of custom validation functions. For example:
4945 *
4946 * var MyLink = React.createClass({
4947 * propTypes: {
4948 * // An optional string or URI prop named "href".
4949 * href: function(props, propName, componentName) {
4950 * var propValue = props[propName];
4951 * if (propValue != null && typeof propValue !== 'string' &&
4952 * !(propValue instanceof URI)) {
4953 * return new Error(
4954 * 'Expected a string or an URI for ' + propName + ' in ' +
4955 * componentName
4956 * );
4957 * }
4958 * }
4959 * },
4960 * render: function() {...}
4961 * });
4962 *
4963 * @internal
4964 */
4965
4966 var ANONYMOUS = '<<anonymous>>';
4967
4968 // Important!
4969 // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
4970 var ReactPropTypes = {
4971 array: createPrimitiveTypeChecker('array'),
4972 bigint: createPrimitiveTypeChecker('bigint'),
4973 bool: createPrimitiveTypeChecker('boolean'),
4974 func: createPrimitiveTypeChecker('function'),
4975 number: createPrimitiveTypeChecker('number'),
4976 object: createPrimitiveTypeChecker('object'),
4977 string: createPrimitiveTypeChecker('string'),
4978 symbol: createPrimitiveTypeChecker('symbol'),
4979
4980 any: createAnyTypeChecker(),
4981 arrayOf: createArrayOfTypeChecker,
4982 element: createElementTypeChecker(),
4983 elementType: createElementTypeTypeChecker(),
4984 instanceOf: createInstanceTypeChecker,
4985 node: createNodeChecker(),
4986 objectOf: createObjectOfTypeChecker,
4987 oneOf: createEnumTypeChecker,
4988 oneOfType: createUnionTypeChecker,
4989 shape: createShapeTypeChecker,
4990 exact: createStrictShapeTypeChecker,
4991 };
4992
4993 /**
4994 * inlined Object.is polyfill to avoid requiring consumers ship their own
4995 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
4996 */
4997 /*eslint-disable no-self-compare*/
4998 function is(x, y) {
4999 // SameValue algorithm
5000 if (x === y) {
5001 // Steps 1-5, 7-10
5002 // Steps 6.b-6.e: +0 != -0
5003 return x !== 0 || 1 / x === 1 / y;
5004 } else {
5005 // Step 6.a: NaN == NaN
5006 return x !== x && y !== y;
5007 }
5008 }
5009 /*eslint-enable no-self-compare*/
5010
5011 /**
5012 * We use an Error-like object for backward compatibility as people may call
5013 * PropTypes directly and inspect their output. However, we don't use real
5014 * Errors anymore. We don't inspect their stack anyway, and creating them
5015 * is prohibitively expensive if they are created too often, such as what
5016 * happens in oneOfType() for any type before the one that matched.
5017 */
5018 function PropTypeError(message, data) {
5019 this.message = message;
5020 this.data = data && typeof data === 'object' ? data: {};
5021 this.stack = '';
5022 }
5023 // Make `instanceof Error` still work for returned errors.
5024 PropTypeError.prototype = Error.prototype;
5025
5026 function createChainableTypeChecker(validate) {
5027 if (true) {
5028 var manualPropTypeCallCache = {};
5029 var manualPropTypeWarningCount = 0;
5030 }
5031 function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
5032 componentName = componentName || ANONYMOUS;
5033 propFullName = propFullName || propName;
5034
5035 if (secret !== ReactPropTypesSecret) {
5036 if (throwOnDirectAccess) {
5037 // New behavior only for users of `prop-types` package
5038 var err = new Error(
5039 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
5040 'Use `PropTypes.checkPropTypes()` to call them. ' +
5041 'Read more at http://fb.me/use-check-prop-types'
5042 );
5043 err.name = 'Invariant Violation';
5044 throw err;
5045 } else if ( true && typeof console !== 'undefined') {
5046 // Old behavior for people using React.PropTypes
5047 var cacheKey = componentName + ':' + propName;
5048 if (
5049 !manualPropTypeCallCache[cacheKey] &&
5050 // Avoid spamming the console because they are often not actionable except for lib authors
5051 manualPropTypeWarningCount < 3
5052 ) {
5053 printWarning(
5054 'You are manually calling a React.PropTypes validation ' +
5055 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
5056 'and will throw in the standalone `prop-types` package. ' +
5057 'You may be seeing this warning due to a third-party PropTypes ' +
5058 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
5059 );
5060 manualPropTypeCallCache[cacheKey] = true;
5061 manualPropTypeWarningCount++;
5062 }
5063 }
5064 }
5065 if (props[propName] == null) {
5066 if (isRequired) {
5067 if (props[propName] === null) {
5068 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
5069 }
5070 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
5071 }
5072 return null;
5073 } else {
5074 return validate(props, propName, componentName, location, propFullName);
5075 }
5076 }
5077
5078 var chainedCheckType = checkType.bind(null, false);
5079 chainedCheckType.isRequired = checkType.bind(null, true);
5080
5081 return chainedCheckType;
5082 }
5083
5084 function createPrimitiveTypeChecker(expectedType) {
5085 function validate(props, propName, componentName, location, propFullName, secret) {
5086 var propValue = props[propName];
5087 var propType = getPropType(propValue);
5088 if (propType !== expectedType) {
5089 // `propValue` being instance of, say, date/regexp, pass the 'object'
5090 // check, but we can offer a more precise error message here rather than
5091 // 'of type `object`'.
5092 var preciseType = getPreciseType(propValue);
5093
5094 return new PropTypeError(
5095 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
5096 {expectedType: expectedType}
5097 );
5098 }
5099 return null;
5100 }
5101 return createChainableTypeChecker(validate);
5102 }
5103
5104 function createAnyTypeChecker() {
5105 return createChainableTypeChecker(emptyFunctionThatReturnsNull);
5106 }
5107
5108 function createArrayOfTypeChecker(typeChecker) {
5109 function validate(props, propName, componentName, location, propFullName) {
5110 if (typeof typeChecker !== 'function') {
5111 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
5112 }
5113 var propValue = props[propName];
5114 if (!Array.isArray(propValue)) {
5115 var propType = getPropType(propValue);
5116 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
5117 }
5118 for (var i = 0; i < propValue.length; i++) {
5119 var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
5120 if (error instanceof Error) {
5121 return error;
5122 }
5123 }
5124 return null;
5125 }
5126 return createChainableTypeChecker(validate);
5127 }
5128
5129 function createElementTypeChecker() {
5130 function validate(props, propName, componentName, location, propFullName) {
5131 var propValue = props[propName];
5132 if (!isValidElement(propValue)) {
5133 var propType = getPropType(propValue);
5134 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
5135 }
5136 return null;
5137 }
5138 return createChainableTypeChecker(validate);
5139 }
5140
5141 function createElementTypeTypeChecker() {
5142 function validate(props, propName, componentName, location, propFullName) {
5143 var propValue = props[propName];
5144 if (!ReactIs.isValidElementType(propValue)) {
5145 var propType = getPropType(propValue);
5146 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
5147 }
5148 return null;
5149 }
5150 return createChainableTypeChecker(validate);
5151 }
5152
5153 function createInstanceTypeChecker(expectedClass) {
5154 function validate(props, propName, componentName, location, propFullName) {
5155 if (!(props[propName] instanceof expectedClass)) {
5156 var expectedClassName = expectedClass.name || ANONYMOUS;
5157 var actualClassName = getClassName(props[propName]);
5158 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
5159 }
5160 return null;
5161 }
5162 return createChainableTypeChecker(validate);
5163 }
5164
5165 function createEnumTypeChecker(expectedValues) {
5166 if (!Array.isArray(expectedValues)) {
5167 if (true) {
5168 if (arguments.length > 1) {
5169 printWarning(
5170 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
5171 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
5172 );
5173 } else {
5174 printWarning('Invalid argument supplied to oneOf, expected an array.');
5175 }
5176 }
5177 return emptyFunctionThatReturnsNull;
5178 }
5179
5180 function validate(props, propName, componentName, location, propFullName) {
5181 var propValue = props[propName];
5182 for (var i = 0; i < expectedValues.length; i++) {
5183 if (is(propValue, expectedValues[i])) {
5184 return null;
5185 }
5186 }
5187
5188 var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
5189 var type = getPreciseType(value);
5190 if (type === 'symbol') {
5191 return String(value);
5192 }
5193 return value;
5194 });
5195 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
5196 }
5197 return createChainableTypeChecker(validate);
5198 }
5199
5200 function createObjectOfTypeChecker(typeChecker) {
5201 function validate(props, propName, componentName, location, propFullName) {
5202 if (typeof typeChecker !== 'function') {
5203 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
5204 }
5205 var propValue = props[propName];
5206 var propType = getPropType(propValue);
5207 if (propType !== 'object') {
5208 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
5209 }
5210 for (var key in propValue) {
5211 if (has(propValue, key)) {
5212 var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
5213 if (error instanceof Error) {
5214 return error;
5215 }
5216 }
5217 }
5218 return null;
5219 }
5220 return createChainableTypeChecker(validate);
5221 }
5222
5223 function createUnionTypeChecker(arrayOfTypeCheckers) {
5224 if (!Array.isArray(arrayOfTypeCheckers)) {
5225 true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : 0;
5226 return emptyFunctionThatReturnsNull;
5227 }
5228
5229 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
5230 var checker = arrayOfTypeCheckers[i];
5231 if (typeof checker !== 'function') {
5232 printWarning(
5233 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
5234 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
5235 );
5236 return emptyFunctionThatReturnsNull;
5237 }
5238 }
5239
5240 function validate(props, propName, componentName, location, propFullName) {
5241 var expectedTypes = [];
5242 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
5243 var checker = arrayOfTypeCheckers[i];
5244 var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
5245 if (checkerResult == null) {
5246 return null;
5247 }
5248 if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
5249 expectedTypes.push(checkerResult.data.expectedType);
5250 }
5251 }
5252 var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
5253 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
5254 }
5255 return createChainableTypeChecker(validate);
5256 }
5257
5258 function createNodeChecker() {
5259 function validate(props, propName, componentName, location, propFullName) {
5260 if (!isNode(props[propName])) {
5261 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
5262 }
5263 return null;
5264 }
5265 return createChainableTypeChecker(validate);
5266 }
5267
5268 function invalidValidatorError(componentName, location, propFullName, key, type) {
5269 return new PropTypeError(
5270 (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
5271 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
5272 );
5273 }
5274
5275 function createShapeTypeChecker(shapeTypes) {
5276 function validate(props, propName, componentName, location, propFullName) {
5277 var propValue = props[propName];
5278 var propType = getPropType(propValue);
5279 if (propType !== 'object') {
5280 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
5281 }
5282 for (var key in shapeTypes) {
5283 var checker = shapeTypes[key];
5284 if (typeof checker !== 'function') {
5285 return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
5286 }
5287 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
5288 if (error) {
5289 return error;
5290 }
5291 }
5292 return null;
5293 }
5294 return createChainableTypeChecker(validate);
5295 }
5296
5297 function createStrictShapeTypeChecker(shapeTypes) {
5298 function validate(props, propName, componentName, location, propFullName) {
5299 var propValue = props[propName];
5300 var propType = getPropType(propValue);
5301 if (propType !== 'object') {
5302 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
5303 }
5304 // We need to check all keys in case some are required but missing from props.
5305 var allKeys = assign({}, props[propName], shapeTypes);
5306 for (var key in allKeys) {
5307 var checker = shapeTypes[key];
5308 if (has(shapeTypes, key) && typeof checker !== 'function') {
5309 return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
5310 }
5311 if (!checker) {
5312 return new PropTypeError(
5313 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
5314 '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
5315 '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
5316 );
5317 }
5318 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
5319 if (error) {
5320 return error;
5321 }
5322 }
5323 return null;
5324 }
5325
5326 return createChainableTypeChecker(validate);
5327 }
5328
5329 function isNode(propValue) {
5330 switch (typeof propValue) {
5331 case 'number':
5332 case 'string':
5333 case 'undefined':
5334 return true;
5335 case 'boolean':
5336 return !propValue;
5337 case 'object':
5338 if (Array.isArray(propValue)) {
5339 return propValue.every(isNode);
5340 }
5341 if (propValue === null || isValidElement(propValue)) {
5342 return true;
5343 }
5344
5345 var iteratorFn = getIteratorFn(propValue);
5346 if (iteratorFn) {
5347 var iterator = iteratorFn.call(propValue);
5348 var step;
5349 if (iteratorFn !== propValue.entries) {
5350 while (!(step = iterator.next()).done) {
5351 if (!isNode(step.value)) {
5352 return false;
5353 }
5354 }
5355 } else {
5356 // Iterator will provide entry [k,v] tuples rather than values.
5357 while (!(step = iterator.next()).done) {
5358 var entry = step.value;
5359 if (entry) {
5360 if (!isNode(entry[1])) {
5361 return false;
5362 }
5363 }
5364 }
5365 }
5366 } else {
5367 return false;
5368 }
5369
5370 return true;
5371 default:
5372 return false;
5373 }
5374 }
5375
5376 function isSymbol(propType, propValue) {
5377 // Native Symbol.
5378 if (propType === 'symbol') {
5379 return true;
5380 }
5381
5382 // falsy value can't be a Symbol
5383 if (!propValue) {
5384 return false;
5385 }
5386
5387 // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
5388 if (propValue['@@toStringTag'] === 'Symbol') {
5389 return true;
5390 }
5391
5392 // Fallback for non-spec compliant Symbols which are polyfilled.
5393 if (typeof Symbol === 'function' && propValue instanceof Symbol) {
5394 return true;
5395 }
5396
5397 return false;
5398 }
5399
5400 // Equivalent of `typeof` but with special handling for array and regexp.
5401 function getPropType(propValue) {
5402 var propType = typeof propValue;
5403 if (Array.isArray(propValue)) {
5404 return 'array';
5405 }
5406 if (propValue instanceof RegExp) {
5407 // Old webkits (at least until Android 4.0) return 'function' rather than
5408 // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
5409 // passes PropTypes.object.
5410 return 'object';
5411 }
5412 if (isSymbol(propType, propValue)) {
5413 return 'symbol';
5414 }
5415 return propType;
5416 }
5417
5418 // This handles more types than `getPropType`. Only used for error messages.
5419 // See `createPrimitiveTypeChecker`.
5420 function getPreciseType(propValue) {
5421 if (typeof propValue === 'undefined' || propValue === null) {
5422 return '' + propValue;
5423 }
5424 var propType = getPropType(propValue);
5425 if (propType === 'object') {
5426 if (propValue instanceof Date) {
5427 return 'date';
5428 } else if (propValue instanceof RegExp) {
5429 return 'regexp';
5430 }
5431 }
5432 return propType;
5433 }
5434
5435 // Returns a string that is postfixed to a warning about an invalid type.
5436 // For example, "undefined" or "of type array"
5437 function getPostfixForTypeWarning(value) {
5438 var type = getPreciseType(value);
5439 switch (type) {
5440 case 'array':
5441 case 'object':
5442 return 'an ' + type;
5443 case 'boolean':
5444 case 'date':
5445 case 'regexp':
5446 return 'a ' + type;
5447 default:
5448 return type;
5449 }
5450 }
5451
5452 // Returns class name of the object, if any.
5453 function getClassName(propValue) {
5454 if (!propValue.constructor || !propValue.constructor.name) {
5455 return ANONYMOUS;
5456 }
5457 return propValue.constructor.name;
5458 }
5459
5460 ReactPropTypes.checkPropTypes = checkPropTypes;
5461 ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
5462 ReactPropTypes.PropTypes = ReactPropTypes;
5463
5464 return ReactPropTypes;
5465 };
5466
5467
5468 /***/ }),
5469
5470 /***/ "./node_modules/prop-types/index.js":
5471 /*!******************************************!*\
5472 !*** ./node_modules/prop-types/index.js ***!
5473 \******************************************/
5474 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
5475
5476 /**
5477 * Copyright (c) 2013-present, Facebook, Inc.
5478 *
5479 * This source code is licensed under the MIT license found in the
5480 * LICENSE file in the root directory of this source tree.
5481 */
5482
5483 if (true) {
5484 var ReactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js");
5485
5486 // By explicitly using `prop-types` you are opting into new development behavior.
5487 // http://fb.me/prop-types-in-prod
5488 var throwOnDirectAccess = true;
5489 module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ "./node_modules/prop-types/factoryWithTypeCheckers.js")(ReactIs.isElement, throwOnDirectAccess);
5490 } else {}
5491
5492
5493 /***/ }),
5494
5495 /***/ "./node_modules/prop-types/lib/ReactPropTypesSecret.js":
5496 /*!*************************************************************!*\
5497 !*** ./node_modules/prop-types/lib/ReactPropTypesSecret.js ***!
5498 \*************************************************************/
5499 /***/ ((module) => {
5500
5501 "use strict";
5502 /**
5503 * Copyright (c) 2013-present, Facebook, Inc.
5504 *
5505 * This source code is licensed under the MIT license found in the
5506 * LICENSE file in the root directory of this source tree.
5507 */
5508
5509
5510
5511 var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
5512
5513 module.exports = ReactPropTypesSecret;
5514
5515
5516 /***/ }),
5517
5518 /***/ "./node_modules/prop-types/lib/has.js":
5519 /*!********************************************!*\
5520 !*** ./node_modules/prop-types/lib/has.js ***!
5521 \********************************************/
5522 /***/ ((module) => {
5523
5524 module.exports = Function.call.bind(Object.prototype.hasOwnProperty);
5525
5526
5527 /***/ }),
5528
5529 /***/ "./node_modules/raven-js/src/configError.js":
5530 /*!**************************************************!*\
5531 !*** ./node_modules/raven-js/src/configError.js ***!
5532 \**************************************************/
5533 /***/ ((module) => {
5534
5535 function RavenConfigError(message) {
5536 this.name = 'RavenConfigError';
5537 this.message = message;
5538 }
5539 RavenConfigError.prototype = new Error();
5540 RavenConfigError.prototype.constructor = RavenConfigError;
5541
5542 module.exports = RavenConfigError;
5543
5544
5545 /***/ }),
5546
5547 /***/ "./node_modules/raven-js/src/console.js":
5548 /*!**********************************************!*\
5549 !*** ./node_modules/raven-js/src/console.js ***!
5550 \**********************************************/
5551 /***/ ((module) => {
5552
5553 var wrapMethod = function(console, level, callback) {
5554 var originalConsoleLevel = console[level];
5555 var originalConsole = console;
5556
5557 if (!(level in console)) {
5558 return;
5559 }
5560
5561 var sentryLevel = level === 'warn' ? 'warning' : level;
5562
5563 console[level] = function() {
5564 var args = [].slice.call(arguments);
5565
5566 var msg = '' + args.join(' ');
5567 var data = {level: sentryLevel, logger: 'console', extra: {arguments: args}};
5568
5569 if (level === 'assert') {
5570 if (args[0] === false) {
5571 // Default browsers message
5572 msg = 'Assertion failed: ' + (args.slice(1).join(' ') || 'console.assert');
5573 data.extra.arguments = args.slice(1);
5574 callback && callback(msg, data);
5575 }
5576 } else {
5577 callback && callback(msg, data);
5578 }
5579
5580 // this fails for some browsers. :(
5581 if (originalConsoleLevel) {
5582 // IE9 doesn't allow calling apply on console functions directly
5583 // See: https://stackoverflow.com/questions/5472938/does-ie9-support-console-log-and-is-it-a-real-function#answer-5473193
5584 Function.prototype.apply.call(originalConsoleLevel, originalConsole, args);
5585 }
5586 };
5587 };
5588
5589 module.exports = {
5590 wrapMethod: wrapMethod
5591 };
5592
5593
5594 /***/ }),
5595
5596 /***/ "./node_modules/raven-js/src/raven.js":
5597 /*!********************************************!*\
5598 !*** ./node_modules/raven-js/src/raven.js ***!
5599 \********************************************/
5600 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
5601
5602 /*global XDomainRequest:false */
5603
5604 var TraceKit = __webpack_require__(/*! ../vendor/TraceKit/tracekit */ "./node_modules/raven-js/vendor/TraceKit/tracekit.js");
5605 var stringify = __webpack_require__(/*! ../vendor/json-stringify-safe/stringify */ "./node_modules/raven-js/vendor/json-stringify-safe/stringify.js");
5606 var RavenConfigError = __webpack_require__(/*! ./configError */ "./node_modules/raven-js/src/configError.js");
5607
5608 var utils = __webpack_require__(/*! ./utils */ "./node_modules/raven-js/src/utils.js");
5609 var isError = utils.isError;
5610 var isObject = utils.isObject;
5611 var isObject = utils.isObject;
5612 var isErrorEvent = utils.isErrorEvent;
5613 var isUndefined = utils.isUndefined;
5614 var isFunction = utils.isFunction;
5615 var isString = utils.isString;
5616 var isEmptyObject = utils.isEmptyObject;
5617 var each = utils.each;
5618 var objectMerge = utils.objectMerge;
5619 var truncate = utils.truncate;
5620 var objectFrozen = utils.objectFrozen;
5621 var hasKey = utils.hasKey;
5622 var joinRegExp = utils.joinRegExp;
5623 var urlencode = utils.urlencode;
5624 var uuid4 = utils.uuid4;
5625 var htmlTreeAsString = utils.htmlTreeAsString;
5626 var isSameException = utils.isSameException;
5627 var isSameStacktrace = utils.isSameStacktrace;
5628 var parseUrl = utils.parseUrl;
5629 var fill = utils.fill;
5630
5631 var wrapConsoleMethod = (__webpack_require__(/*! ./console */ "./node_modules/raven-js/src/console.js").wrapMethod);
5632
5633 var dsnKeys = 'source protocol user pass host port path'.split(' '),
5634 dsnPattern = /^(?:(\w+):)?\/\/(?:(\w+)(:\w+)?@)?([\w\.-]+)(?::(\d+))?(\/.*)/;
5635
5636 function now() {
5637 return +new Date();
5638 }
5639
5640 // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785)
5641 var _window =
5642 typeof window !== 'undefined'
5643 ? window
5644 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
5645 var _document = _window.document;
5646 var _navigator = _window.navigator;
5647
5648 function keepOriginalCallback(original, callback) {
5649 return isFunction(callback)
5650 ? function(data) {
5651 return callback(data, original);
5652 }
5653 : callback;
5654 }
5655
5656 // First, check for JSON support
5657 // If there is no JSON, we no-op the core features of Raven
5658 // since JSON is required to encode the payload
5659 function Raven() {
5660 this._hasJSON = !!(typeof JSON === 'object' && JSON.stringify);
5661 // Raven can run in contexts where there's no document (react-native)
5662 this._hasDocument = !isUndefined(_document);
5663 this._hasNavigator = !isUndefined(_navigator);
5664 this._lastCapturedException = null;
5665 this._lastData = null;
5666 this._lastEventId = null;
5667 this._globalServer = null;
5668 this._globalKey = null;
5669 this._globalProject = null;
5670 this._globalContext = {};
5671 this._globalOptions = {
5672 logger: 'javascript',
5673 ignoreErrors: [],
5674 ignoreUrls: [],
5675 whitelistUrls: [],
5676 includePaths: [],
5677 collectWindowErrors: true,
5678 maxMessageLength: 0,
5679
5680 // By default, truncates URL values to 250 chars
5681 maxUrlLength: 250,
5682 stackTraceLimit: 50,
5683 autoBreadcrumbs: true,
5684 instrument: true,
5685 sampleRate: 1
5686 };
5687 this._ignoreOnError = 0;
5688 this._isRavenInstalled = false;
5689 this._originalErrorStackTraceLimit = Error.stackTraceLimit;
5690 // capture references to window.console *and* all its methods first
5691 // before the console plugin has a chance to monkey patch
5692 this._originalConsole = _window.console || {};
5693 this._originalConsoleMethods = {};
5694 this._plugins = [];
5695 this._startTime = now();
5696 this._wrappedBuiltIns = [];
5697 this._breadcrumbs = [];
5698 this._lastCapturedEvent = null;
5699 this._keypressTimeout;
5700 this._location = _window.location;
5701 this._lastHref = this._location && this._location.href;
5702 this._resetBackoff();
5703
5704 // eslint-disable-next-line guard-for-in
5705 for (var method in this._originalConsole) {
5706 this._originalConsoleMethods[method] = this._originalConsole[method];
5707 }
5708 }
5709
5710 /*
5711 * The core Raven singleton
5712 *
5713 * @this {Raven}
5714 */
5715
5716 Raven.prototype = {
5717 // Hardcode version string so that raven source can be loaded directly via
5718 // webpack (using a build step causes webpack #1617). Grunt verifies that
5719 // this value matches package.json during build.
5720 // See: https://github.com/getsentry/raven-js/issues/465
5721 VERSION: '3.19.1',
5722
5723 debug: false,
5724
5725 TraceKit: TraceKit, // alias to TraceKit
5726
5727 /*
5728 * Configure Raven with a DSN and extra options
5729 *
5730 * @param {string} dsn The public Sentry DSN
5731 * @param {object} options Set of global options [optional]
5732 * @return {Raven}
5733 */
5734 config: function(dsn, options) {
5735 var self = this;
5736
5737 if (self._globalServer) {
5738 this._logDebug('error', 'Error: Raven has already been configured');
5739 return self;
5740 }
5741 if (!dsn) return self;
5742
5743 var globalOptions = self._globalOptions;
5744
5745 // merge in options
5746 if (options) {
5747 each(options, function(key, value) {
5748 // tags and extra are special and need to be put into context
5749 if (key === 'tags' || key === 'extra' || key === 'user') {
5750 self._globalContext[key] = value;
5751 } else {
5752 globalOptions[key] = value;
5753 }
5754 });
5755 }
5756
5757 self.setDSN(dsn);
5758
5759 // "Script error." is hard coded into browsers for errors that it can't read.
5760 // this is the result of a script being pulled in from an external domain and CORS.
5761 globalOptions.ignoreErrors.push(/^Script error\.?$/);
5762 globalOptions.ignoreErrors.push(/^Javascript error: Script error\.? on line 0$/);
5763
5764 // join regexp rules into one big rule
5765 globalOptions.ignoreErrors = joinRegExp(globalOptions.ignoreErrors);
5766 globalOptions.ignoreUrls = globalOptions.ignoreUrls.length
5767 ? joinRegExp(globalOptions.ignoreUrls)
5768 : false;
5769 globalOptions.whitelistUrls = globalOptions.whitelistUrls.length
5770 ? joinRegExp(globalOptions.whitelistUrls)
5771 : false;
5772 globalOptions.includePaths = joinRegExp(globalOptions.includePaths);
5773 globalOptions.maxBreadcrumbs = Math.max(
5774 0,
5775 Math.min(globalOptions.maxBreadcrumbs || 100, 100)
5776 ); // default and hard limit is 100
5777
5778 var autoBreadcrumbDefaults = {
5779 xhr: true,
5780 console: true,
5781 dom: true,
5782 location: true
5783 };
5784
5785 var autoBreadcrumbs = globalOptions.autoBreadcrumbs;
5786 if ({}.toString.call(autoBreadcrumbs) === '[object Object]') {
5787 autoBreadcrumbs = objectMerge(autoBreadcrumbDefaults, autoBreadcrumbs);
5788 } else if (autoBreadcrumbs !== false) {
5789 autoBreadcrumbs = autoBreadcrumbDefaults;
5790 }
5791 globalOptions.autoBreadcrumbs = autoBreadcrumbs;
5792
5793 var instrumentDefaults = {
5794 tryCatch: true
5795 };
5796
5797 var instrument = globalOptions.instrument;
5798 if ({}.toString.call(instrument) === '[object Object]') {
5799 instrument = objectMerge(instrumentDefaults, instrument);
5800 } else if (instrument !== false) {
5801 instrument = instrumentDefaults;
5802 }
5803 globalOptions.instrument = instrument;
5804
5805 TraceKit.collectWindowErrors = !!globalOptions.collectWindowErrors;
5806
5807 // return for chaining
5808 return self;
5809 },
5810
5811 /*
5812 * Installs a global window.onerror error handler
5813 * to capture and report uncaught exceptions.
5814 * At this point, install() is required to be called due
5815 * to the way TraceKit is set up.
5816 *
5817 * @return {Raven}
5818 */
5819 install: function() {
5820 var self = this;
5821 if (self.isSetup() && !self._isRavenInstalled) {
5822 TraceKit.report.subscribe(function() {
5823 self._handleOnErrorStackInfo.apply(self, arguments);
5824 });
5825 if (self._globalOptions.instrument && self._globalOptions.instrument.tryCatch) {
5826 self._instrumentTryCatch();
5827 }
5828
5829 if (self._globalOptions.autoBreadcrumbs) self._instrumentBreadcrumbs();
5830
5831 // Install all of the plugins
5832 self._drainPlugins();
5833
5834 self._isRavenInstalled = true;
5835 }
5836
5837 Error.stackTraceLimit = self._globalOptions.stackTraceLimit;
5838 return this;
5839 },
5840
5841 /*
5842 * Set the DSN (can be called multiple time unlike config)
5843 *
5844 * @param {string} dsn The public Sentry DSN
5845 */
5846 setDSN: function(dsn) {
5847 var self = this,
5848 uri = self._parseDSN(dsn),
5849 lastSlash = uri.path.lastIndexOf('/'),
5850 path = uri.path.substr(1, lastSlash);
5851
5852 self._dsn = dsn;
5853 self._globalKey = uri.user;
5854 self._globalSecret = uri.pass && uri.pass.substr(1);
5855 self._globalProject = uri.path.substr(lastSlash + 1);
5856
5857 self._globalServer = self._getGlobalServer(uri);
5858
5859 self._globalEndpoint =
5860 self._globalServer + '/' + path + 'api/' + self._globalProject + '/store/';
5861
5862 // Reset backoff state since we may be pointing at a
5863 // new project/server
5864 this._resetBackoff();
5865 },
5866
5867 /*
5868 * Wrap code within a context so Raven can capture errors
5869 * reliably across domains that is executed immediately.
5870 *
5871 * @param {object} options A specific set of options for this context [optional]
5872 * @param {function} func The callback to be immediately executed within the context
5873 * @param {array} args An array of arguments to be called with the callback [optional]
5874 */
5875 context: function(options, func, args) {
5876 if (isFunction(options)) {
5877 args = func || [];
5878 func = options;
5879 options = undefined;
5880 }
5881
5882 return this.wrap(options, func).apply(this, args);
5883 },
5884
5885 /*
5886 * Wrap code within a context and returns back a new function to be executed
5887 *
5888 * @param {object} options A specific set of options for this context [optional]
5889 * @param {function} func The function to be wrapped in a new context
5890 * @param {function} func A function to call before the try/catch wrapper [optional, private]
5891 * @return {function} The newly wrapped functions with a context
5892 */
5893 wrap: function(options, func, _before) {
5894 var self = this;
5895 // 1 argument has been passed, and it's not a function
5896 // so just return it
5897 if (isUndefined(func) && !isFunction(options)) {
5898 return options;
5899 }
5900
5901 // options is optional
5902 if (isFunction(options)) {
5903 func = options;
5904 options = undefined;
5905 }
5906
5907 // At this point, we've passed along 2 arguments, and the second one
5908 // is not a function either, so we'll just return the second argument.
5909 if (!isFunction(func)) {
5910 return func;
5911 }
5912
5913 // We don't wanna wrap it twice!
5914 try {
5915 if (func.__raven__) {
5916 return func;
5917 }
5918
5919 // If this has already been wrapped in the past, return that
5920 if (func.__raven_wrapper__) {
5921 return func.__raven_wrapper__;
5922 }
5923 } catch (e) {
5924 // Just accessing custom props in some Selenium environments
5925 // can cause a "Permission denied" exception (see raven-js#495).
5926 // Bail on wrapping and return the function as-is (defers to window.onerror).
5927 return func;
5928 }
5929
5930 function wrapped() {
5931 var args = [],
5932 i = arguments.length,
5933 deep = !options || (options && options.deep !== false);
5934
5935 if (_before && isFunction(_before)) {
5936 _before.apply(this, arguments);
5937 }
5938
5939 // Recursively wrap all of a function's arguments that are
5940 // functions themselves.
5941 while (i--) args[i] = deep ? self.wrap(options, arguments[i]) : arguments[i];
5942
5943 try {
5944 // Attempt to invoke user-land function
5945 // NOTE: If you are a Sentry user, and you are seeing this stack frame, it
5946 // means Raven caught an error invoking your application code. This is
5947 // expected behavior and NOT indicative of a bug with Raven.js.
5948 return func.apply(this, args);
5949 } catch (e) {
5950 self._ignoreNextOnError();
5951 self.captureException(e, options);
5952 throw e;
5953 }
5954 }
5955
5956 // copy over properties of the old function
5957 for (var property in func) {
5958 if (hasKey(func, property)) {
5959 wrapped[property] = func[property];
5960 }
5961 }
5962 wrapped.prototype = func.prototype;
5963
5964 func.__raven_wrapper__ = wrapped;
5965 // Signal that this function has been wrapped already
5966 // for both debugging and to prevent it to being wrapped twice
5967 wrapped.__raven__ = true;
5968 wrapped.__inner__ = func;
5969
5970 return wrapped;
5971 },
5972
5973 /*
5974 * Uninstalls the global error handler.
5975 *
5976 * @return {Raven}
5977 */
5978 uninstall: function() {
5979 TraceKit.report.uninstall();
5980
5981 this._restoreBuiltIns();
5982
5983 Error.stackTraceLimit = this._originalErrorStackTraceLimit;
5984 this._isRavenInstalled = false;
5985
5986 return this;
5987 },
5988
5989 /*
5990 * Manually capture an exception and send it over to Sentry
5991 *
5992 * @param {error} ex An exception to be logged
5993 * @param {object} options A specific set of options for this error [optional]
5994 * @return {Raven}
5995 */
5996 captureException: function(ex, options) {
5997 // Cases for sending ex as a message, rather than an exception
5998 var isNotError = !isError(ex);
5999 var isNotErrorEvent = !isErrorEvent(ex);
6000 var isErrorEventWithoutError = isErrorEvent(ex) && !ex.error;
6001
6002 if ((isNotError && isNotErrorEvent) || isErrorEventWithoutError) {
6003 return this.captureMessage(
6004 ex,
6005 objectMerge(
6006 {
6007 trimHeadFrames: 1,
6008 stacktrace: true // if we fall back to captureMessage, default to attempting a new trace
6009 },
6010 options
6011 )
6012 );
6013 }
6014
6015 // Get actual Error from ErrorEvent
6016 if (isErrorEvent(ex)) ex = ex.error;
6017
6018 // Store the raw exception object for potential debugging and introspection
6019 this._lastCapturedException = ex;
6020
6021 // TraceKit.report will re-raise any exception passed to it,
6022 // which means you have to wrap it in try/catch. Instead, we
6023 // can wrap it here and only re-raise if TraceKit.report
6024 // raises an exception different from the one we asked to
6025 // report on.
6026 try {
6027 var stack = TraceKit.computeStackTrace(ex);
6028 this._handleStackInfo(stack, options);
6029 } catch (ex1) {
6030 if (ex !== ex1) {
6031 throw ex1;
6032 }
6033 }
6034
6035 return this;
6036 },
6037
6038 /*
6039 * Manually send a message to Sentry
6040 *
6041 * @param {string} msg A plain message to be captured in Sentry
6042 * @param {object} options A specific set of options for this message [optional]
6043 * @return {Raven}
6044 */
6045 captureMessage: function(msg, options) {
6046 // config() automagically converts ignoreErrors from a list to a RegExp so we need to test for an
6047 // early call; we'll error on the side of logging anything called before configuration since it's
6048 // probably something you should see:
6049 if (
6050 !!this._globalOptions.ignoreErrors.test &&
6051 this._globalOptions.ignoreErrors.test(msg)
6052 ) {
6053 return;
6054 }
6055
6056 options = options || {};
6057
6058 var data = objectMerge(
6059 {
6060 message: msg + '' // Make sure it's actually a string
6061 },
6062 options
6063 );
6064
6065 var ex;
6066 // Generate a "synthetic" stack trace from this point.
6067 // NOTE: If you are a Sentry user, and you are seeing this stack frame, it is NOT indicative
6068 // of a bug with Raven.js. Sentry generates synthetic traces either by configuration,
6069 // or if it catches a thrown object without a "stack" property.
6070 try {
6071 throw new Error(msg);
6072 } catch (ex1) {
6073 ex = ex1;
6074 }
6075
6076 // null exception name so `Error` isn't prefixed to msg
6077 ex.name = null;
6078 var stack = TraceKit.computeStackTrace(ex);
6079
6080 // stack[0] is `throw new Error(msg)` call itself, we are interested in the frame that was just before that, stack[1]
6081 var initialCall = stack.stack[1];
6082
6083 var fileurl = (initialCall && initialCall.url) || '';
6084
6085 if (
6086 !!this._globalOptions.ignoreUrls.test &&
6087 this._globalOptions.ignoreUrls.test(fileurl)
6088 ) {
6089 return;
6090 }
6091
6092 if (
6093 !!this._globalOptions.whitelistUrls.test &&
6094 !this._globalOptions.whitelistUrls.test(fileurl)
6095 ) {
6096 return;
6097 }
6098
6099 if (this._globalOptions.stacktrace || (options && options.stacktrace)) {
6100 options = objectMerge(
6101 {
6102 // fingerprint on msg, not stack trace (legacy behavior, could be
6103 // revisited)
6104 fingerprint: msg,
6105 // since we know this is a synthetic trace, the top N-most frames
6106 // MUST be from Raven.js, so mark them as in_app later by setting
6107 // trimHeadFrames
6108 trimHeadFrames: (options.trimHeadFrames || 0) + 1
6109 },
6110 options
6111 );
6112
6113 var frames = this._prepareFrames(stack, options);
6114 data.stacktrace = {
6115 // Sentry expects frames oldest to newest
6116 frames: frames.reverse()
6117 };
6118 }
6119
6120 // Fire away!
6121 this._send(data);
6122
6123 return this;
6124 },
6125
6126 captureBreadcrumb: function(obj) {
6127 var crumb = objectMerge(
6128 {
6129 timestamp: now() / 1000
6130 },
6131 obj
6132 );
6133
6134 if (isFunction(this._globalOptions.breadcrumbCallback)) {
6135 var result = this._globalOptions.breadcrumbCallback(crumb);
6136
6137 if (isObject(result) && !isEmptyObject(result)) {
6138 crumb = result;
6139 } else if (result === false) {
6140 return this;
6141 }
6142 }
6143
6144 this._breadcrumbs.push(crumb);
6145 if (this._breadcrumbs.length > this._globalOptions.maxBreadcrumbs) {
6146 this._breadcrumbs.shift();
6147 }
6148 return this;
6149 },
6150
6151 addPlugin: function(plugin /*arg1, arg2, ... argN*/) {
6152 var pluginArgs = [].slice.call(arguments, 1);
6153
6154 this._plugins.push([plugin, pluginArgs]);
6155 if (this._isRavenInstalled) {
6156 this._drainPlugins();
6157 }
6158
6159 return this;
6160 },
6161
6162 /*
6163 * Set/clear a user to be sent along with the payload.
6164 *
6165 * @param {object} user An object representing user data [optional]
6166 * @return {Raven}
6167 */
6168 setUserContext: function(user) {
6169 // Intentionally do not merge here since that's an unexpected behavior.
6170 this._globalContext.user = user;
6171
6172 return this;
6173 },
6174
6175 /*
6176 * Merge extra attributes to be sent along with the payload.
6177 *
6178 * @param {object} extra An object representing extra data [optional]
6179 * @return {Raven}
6180 */
6181 setExtraContext: function(extra) {
6182 this._mergeContext('extra', extra);
6183
6184 return this;
6185 },
6186
6187 /*
6188 * Merge tags to be sent along with the payload.
6189 *
6190 * @param {object} tags An object representing tags [optional]
6191 * @return {Raven}
6192 */
6193 setTagsContext: function(tags) {
6194 this._mergeContext('tags', tags);
6195
6196 return this;
6197 },
6198
6199 /*
6200 * Clear all of the context.
6201 *
6202 * @return {Raven}
6203 */
6204 clearContext: function() {
6205 this._globalContext = {};
6206
6207 return this;
6208 },
6209
6210 /*
6211 * Get a copy of the current context. This cannot be mutated.
6212 *
6213 * @return {object} copy of context
6214 */
6215 getContext: function() {
6216 // lol javascript
6217 return JSON.parse(stringify(this._globalContext));
6218 },
6219
6220 /*
6221 * Set environment of application
6222 *
6223 * @param {string} environment Typically something like 'production'.
6224 * @return {Raven}
6225 */
6226 setEnvironment: function(environment) {
6227 this._globalOptions.environment = environment;
6228
6229 return this;
6230 },
6231
6232 /*
6233 * Set release version of application
6234 *
6235 * @param {string} release Typically something like a git SHA to identify version
6236 * @return {Raven}
6237 */
6238 setRelease: function(release) {
6239 this._globalOptions.release = release;
6240
6241 return this;
6242 },
6243
6244 /*
6245 * Set the dataCallback option
6246 *
6247 * @param {function} callback The callback to run which allows the
6248 * data blob to be mutated before sending
6249 * @return {Raven}
6250 */
6251 setDataCallback: function(callback) {
6252 var original = this._globalOptions.dataCallback;
6253 this._globalOptions.dataCallback = keepOriginalCallback(original, callback);
6254 return this;
6255 },
6256
6257 /*
6258 * Set the breadcrumbCallback option
6259 *
6260 * @param {function} callback The callback to run which allows filtering
6261 * or mutating breadcrumbs
6262 * @return {Raven}
6263 */
6264 setBreadcrumbCallback: function(callback) {
6265 var original = this._globalOptions.breadcrumbCallback;
6266 this._globalOptions.breadcrumbCallback = keepOriginalCallback(original, callback);
6267 return this;
6268 },
6269
6270 /*
6271 * Set the shouldSendCallback option
6272 *
6273 * @param {function} callback The callback to run which allows
6274 * introspecting the blob before sending
6275 * @return {Raven}
6276 */
6277 setShouldSendCallback: function(callback) {
6278 var original = this._globalOptions.shouldSendCallback;
6279 this._globalOptions.shouldSendCallback = keepOriginalCallback(original, callback);
6280 return this;
6281 },
6282
6283 /**
6284 * Override the default HTTP transport mechanism that transmits data
6285 * to the Sentry server.
6286 *
6287 * @param {function} transport Function invoked instead of the default
6288 * `makeRequest` handler.
6289 *
6290 * @return {Raven}
6291 */
6292 setTransport: function(transport) {
6293 this._globalOptions.transport = transport;
6294
6295 return this;
6296 },
6297
6298 /*
6299 * Get the latest raw exception that was captured by Raven.
6300 *
6301 * @return {error}
6302 */
6303 lastException: function() {
6304 return this._lastCapturedException;
6305 },
6306
6307 /*
6308 * Get the last event id
6309 *
6310 * @return {string}
6311 */
6312 lastEventId: function() {
6313 return this._lastEventId;
6314 },
6315
6316 /*
6317 * Determine if Raven is setup and ready to go.
6318 *
6319 * @return {boolean}
6320 */
6321 isSetup: function() {
6322 if (!this._hasJSON) return false; // needs JSON support
6323 if (!this._globalServer) {
6324 if (!this.ravenNotConfiguredError) {
6325 this.ravenNotConfiguredError = true;
6326 this._logDebug('error', 'Error: Raven has not been configured.');
6327 }
6328 return false;
6329 }
6330 return true;
6331 },
6332
6333 afterLoad: function() {
6334 // TODO: remove window dependence?
6335
6336 // Attempt to initialize Raven on load
6337 var RavenConfig = _window.RavenConfig;
6338 if (RavenConfig) {
6339 this.config(RavenConfig.dsn, RavenConfig.config).install();
6340 }
6341 },
6342
6343 showReportDialog: function(options) {
6344 if (
6345 !_document // doesn't work without a document (React native)
6346 )
6347 return;
6348
6349 options = options || {};
6350
6351 var lastEventId = options.eventId || this.lastEventId();
6352 if (!lastEventId) {
6353 throw new RavenConfigError('Missing eventId');
6354 }
6355
6356 var dsn = options.dsn || this._dsn;
6357 if (!dsn) {
6358 throw new RavenConfigError('Missing DSN');
6359 }
6360
6361 var encode = encodeURIComponent;
6362 var qs = '';
6363 qs += '?eventId=' + encode(lastEventId);
6364 qs += '&dsn=' + encode(dsn);
6365
6366 var user = options.user || this._globalContext.user;
6367 if (user) {
6368 if (user.name) qs += '&name=' + encode(user.name);
6369 if (user.email) qs += '&email=' + encode(user.email);
6370 }
6371
6372 var globalServer = this._getGlobalServer(this._parseDSN(dsn));
6373
6374 var script = _document.createElement('script');
6375 script.async = true;
6376 script.src = globalServer + '/api/embed/error-page/' + qs;
6377 (_document.head || _document.body).appendChild(script);
6378 },
6379
6380 /**** Private functions ****/
6381 _ignoreNextOnError: function() {
6382 var self = this;
6383 this._ignoreOnError += 1;
6384 setTimeout(function() {
6385 // onerror should trigger before setTimeout
6386 self._ignoreOnError -= 1;
6387 });
6388 },
6389
6390 _triggerEvent: function(eventType, options) {
6391 // NOTE: `event` is a native browser thing, so let's avoid conflicting wiht it
6392 var evt, key;
6393
6394 if (!this._hasDocument) return;
6395
6396 options = options || {};
6397
6398 eventType = 'raven' + eventType.substr(0, 1).toUpperCase() + eventType.substr(1);
6399
6400 if (_document.createEvent) {
6401 evt = _document.createEvent('HTMLEvents');
6402 evt.initEvent(eventType, true, true);
6403 } else {
6404 evt = _document.createEventObject();
6405 evt.eventType = eventType;
6406 }
6407
6408 for (key in options)
6409 if (hasKey(options, key)) {
6410 evt[key] = options[key];
6411 }
6412
6413 if (_document.createEvent) {
6414 // IE9 if standards
6415 _document.dispatchEvent(evt);
6416 } else {
6417 // IE8 regardless of Quirks or Standards
6418 // IE9 if quirks
6419 try {
6420 _document.fireEvent('on' + evt.eventType.toLowerCase(), evt);
6421 } catch (e) {
6422 // Do nothing
6423 }
6424 }
6425 },
6426
6427 /**
6428 * Wraps addEventListener to capture UI breadcrumbs
6429 * @param evtName the event name (e.g. "click")
6430 * @returns {Function}
6431 * @private
6432 */
6433 _breadcrumbEventHandler: function(evtName) {
6434 var self = this;
6435 return function(evt) {
6436 // reset keypress timeout; e.g. triggering a 'click' after
6437 // a 'keypress' will reset the keypress debounce so that a new
6438 // set of keypresses can be recorded
6439 self._keypressTimeout = null;
6440
6441 // It's possible this handler might trigger multiple times for the same
6442 // event (e.g. event propagation through node ancestors). Ignore if we've
6443 // already captured the event.
6444 if (self._lastCapturedEvent === evt) return;
6445
6446 self._lastCapturedEvent = evt;
6447
6448 // try/catch both:
6449 // - accessing evt.target (see getsentry/raven-js#838, #768)
6450 // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly
6451 // can throw an exception in some circumstances.
6452 var target;
6453 try {
6454 target = htmlTreeAsString(evt.target);
6455 } catch (e) {
6456 target = '<unknown>';
6457 }
6458
6459 self.captureBreadcrumb({
6460 category: 'ui.' + evtName, // e.g. ui.click, ui.input
6461 message: target
6462 });
6463 };
6464 },
6465
6466 /**
6467 * Wraps addEventListener to capture keypress UI events
6468 * @returns {Function}
6469 * @private
6470 */
6471 _keypressEventHandler: function() {
6472 var self = this,
6473 debounceDuration = 1000; // milliseconds
6474
6475 // TODO: if somehow user switches keypress target before
6476 // debounce timeout is triggered, we will only capture
6477 // a single breadcrumb from the FIRST target (acceptable?)
6478 return function(evt) {
6479 var target;
6480 try {
6481 target = evt.target;
6482 } catch (e) {
6483 // just accessing event properties can throw an exception in some rare circumstances
6484 // see: https://github.com/getsentry/raven-js/issues/838
6485 return;
6486 }
6487 var tagName = target && target.tagName;
6488
6489 // only consider keypress events on actual input elements
6490 // this will disregard keypresses targeting body (e.g. tabbing
6491 // through elements, hotkeys, etc)
6492 if (
6493 !tagName ||
6494 (tagName !== 'INPUT' && tagName !== 'TEXTAREA' && !target.isContentEditable)
6495 )
6496 return;
6497
6498 // record first keypress in a series, but ignore subsequent
6499 // keypresses until debounce clears
6500 var timeout = self._keypressTimeout;
6501 if (!timeout) {
6502 self._breadcrumbEventHandler('input')(evt);
6503 }
6504 clearTimeout(timeout);
6505 self._keypressTimeout = setTimeout(function() {
6506 self._keypressTimeout = null;
6507 }, debounceDuration);
6508 };
6509 },
6510
6511 /**
6512 * Captures a breadcrumb of type "navigation", normalizing input URLs
6513 * @param to the originating URL
6514 * @param from the target URL
6515 * @private
6516 */
6517 _captureUrlChange: function(from, to) {
6518 var parsedLoc = parseUrl(this._location.href);
6519 var parsedTo = parseUrl(to);
6520 var parsedFrom = parseUrl(from);
6521
6522 // because onpopstate only tells you the "new" (to) value of location.href, and
6523 // not the previous (from) value, we need to track the value of the current URL
6524 // state ourselves
6525 this._lastHref = to;
6526
6527 // Use only the path component of the URL if the URL matches the current
6528 // document (almost all the time when using pushState)
6529 if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host)
6530 to = parsedTo.relative;
6531 if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host)
6532 from = parsedFrom.relative;
6533
6534 this.captureBreadcrumb({
6535 category: 'navigation',
6536 data: {
6537 to: to,
6538 from: from
6539 }
6540 });
6541 },
6542
6543 /**
6544 * Wrap timer functions and event targets to catch errors and provide
6545 * better metadata.
6546 */
6547 _instrumentTryCatch: function() {
6548 var self = this;
6549
6550 var wrappedBuiltIns = self._wrappedBuiltIns;
6551
6552 function wrapTimeFn(orig) {
6553 return function(fn, t) {
6554 // preserve arity
6555 // Make a copy of the arguments to prevent deoptimization
6556 // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
6557 var args = new Array(arguments.length);
6558 for (var i = 0; i < args.length; ++i) {
6559 args[i] = arguments[i];
6560 }
6561 var originalCallback = args[0];
6562 if (isFunction(originalCallback)) {
6563 args[0] = self.wrap(originalCallback);
6564 }
6565
6566 // IE < 9 doesn't support .call/.apply on setInterval/setTimeout, but it
6567 // also supports only two arguments and doesn't care what this is, so we
6568 // can just call the original function directly.
6569 if (orig.apply) {
6570 return orig.apply(this, args);
6571 } else {
6572 return orig(args[0], args[1]);
6573 }
6574 };
6575 }
6576
6577 var autoBreadcrumbs = this._globalOptions.autoBreadcrumbs;
6578
6579 function wrapEventTarget(global) {
6580 var proto = _window[global] && _window[global].prototype;
6581 if (proto && proto.hasOwnProperty && proto.hasOwnProperty('addEventListener')) {
6582 fill(
6583 proto,
6584 'addEventListener',
6585 function(orig) {
6586 return function(evtName, fn, capture, secure) {
6587 // preserve arity
6588 try {
6589 if (fn && fn.handleEvent) {
6590 fn.handleEvent = self.wrap(fn.handleEvent);
6591 }
6592 } catch (err) {
6593 // can sometimes get 'Permission denied to access property "handle Event'
6594 }
6595
6596 // More breadcrumb DOM capture ... done here and not in `_instrumentBreadcrumbs`
6597 // so that we don't have more than one wrapper function
6598 var before, clickHandler, keypressHandler;
6599
6600 if (
6601 autoBreadcrumbs &&
6602 autoBreadcrumbs.dom &&
6603 (global === 'EventTarget' || global === 'Node')
6604 ) {
6605 // NOTE: generating multiple handlers per addEventListener invocation, should
6606 // revisit and verify we can just use one (almost certainly)
6607 clickHandler = self._breadcrumbEventHandler('click');
6608 keypressHandler = self._keypressEventHandler();
6609 before = function(evt) {
6610 // need to intercept every DOM event in `before` argument, in case that
6611 // same wrapped method is re-used for different events (e.g. mousemove THEN click)
6612 // see #724
6613 if (!evt) return;
6614
6615 var eventType;
6616 try {
6617 eventType = evt.type;
6618 } catch (e) {
6619 // just accessing event properties can throw an exception in some rare circumstances
6620 // see: https://github.com/getsentry/raven-js/issues/838
6621 return;
6622 }
6623 if (eventType === 'click') return clickHandler(evt);
6624 else if (eventType === 'keypress') return keypressHandler(evt);
6625 };
6626 }
6627 return orig.call(
6628 this,
6629 evtName,
6630 self.wrap(fn, undefined, before),
6631 capture,
6632 secure
6633 );
6634 };
6635 },
6636 wrappedBuiltIns
6637 );
6638 fill(
6639 proto,
6640 'removeEventListener',
6641 function(orig) {
6642 return function(evt, fn, capture, secure) {
6643 try {
6644 fn = fn && (fn.__raven_wrapper__ ? fn.__raven_wrapper__ : fn);
6645 } catch (e) {
6646 // ignore, accessing __raven_wrapper__ will throw in some Selenium environments
6647 }
6648 return orig.call(this, evt, fn, capture, secure);
6649 };
6650 },
6651 wrappedBuiltIns
6652 );
6653 }
6654 }
6655
6656 fill(_window, 'setTimeout', wrapTimeFn, wrappedBuiltIns);
6657 fill(_window, 'setInterval', wrapTimeFn, wrappedBuiltIns);
6658 if (_window.requestAnimationFrame) {
6659 fill(
6660 _window,
6661 'requestAnimationFrame',
6662 function(orig) {
6663 return function(cb) {
6664 return orig(self.wrap(cb));
6665 };
6666 },
6667 wrappedBuiltIns
6668 );
6669 }
6670
6671 // event targets borrowed from bugsnag-js:
6672 // https://github.com/bugsnag/bugsnag-js/blob/master/src/bugsnag.js#L666
6673 var eventTargets = [
6674 'EventTarget',
6675 'Window',
6676 'Node',
6677 'ApplicationCache',
6678 'AudioTrackList',
6679 'ChannelMergerNode',
6680 'CryptoOperation',
6681 'EventSource',
6682 'FileReader',
6683 'HTMLUnknownElement',
6684 'IDBDatabase',
6685 'IDBRequest',
6686 'IDBTransaction',
6687 'KeyOperation',
6688 'MediaController',
6689 'MessagePort',
6690 'ModalWindow',
6691 'Notification',
6692 'SVGElementInstance',
6693 'Screen',
6694 'TextTrack',
6695 'TextTrackCue',
6696 'TextTrackList',
6697 'WebSocket',
6698 'WebSocketWorker',
6699 'Worker',
6700 'XMLHttpRequest',
6701 'XMLHttpRequestEventTarget',
6702 'XMLHttpRequestUpload'
6703 ];
6704 for (var i = 0; i < eventTargets.length; i++) {
6705 wrapEventTarget(eventTargets[i]);
6706 }
6707 },
6708
6709 /**
6710 * Instrument browser built-ins w/ breadcrumb capturing
6711 * - XMLHttpRequests
6712 * - DOM interactions (click/typing)
6713 * - window.location changes
6714 * - console
6715 *
6716 * Can be disabled or individually configured via the `autoBreadcrumbs` config option
6717 */
6718 _instrumentBreadcrumbs: function() {
6719 var self = this;
6720 var autoBreadcrumbs = this._globalOptions.autoBreadcrumbs;
6721
6722 var wrappedBuiltIns = self._wrappedBuiltIns;
6723
6724 function wrapProp(prop, xhr) {
6725 if (prop in xhr && isFunction(xhr[prop])) {
6726 fill(xhr, prop, function(orig) {
6727 return self.wrap(orig);
6728 }); // intentionally don't track filled methods on XHR instances
6729 }
6730 }
6731
6732 if (autoBreadcrumbs.xhr && 'XMLHttpRequest' in _window) {
6733 var xhrproto = XMLHttpRequest.prototype;
6734 fill(
6735 xhrproto,
6736 'open',
6737 function(origOpen) {
6738 return function(method, url) {
6739 // preserve arity
6740
6741 // if Sentry key appears in URL, don't capture
6742 if (isString(url) && url.indexOf(self._globalKey) === -1) {
6743 this.__raven_xhr = {
6744 method: method,
6745 url: url,
6746 status_code: null
6747 };
6748 }
6749
6750 return origOpen.apply(this, arguments);
6751 };
6752 },
6753 wrappedBuiltIns
6754 );
6755
6756 fill(
6757 xhrproto,
6758 'send',
6759 function(origSend) {
6760 return function(data) {
6761 // preserve arity
6762 var xhr = this;
6763
6764 function onreadystatechangeHandler() {
6765 if (xhr.__raven_xhr && xhr.readyState === 4) {
6766 try {
6767 // touching statusCode in some platforms throws
6768 // an exception
6769 xhr.__raven_xhr.status_code = xhr.status;
6770 } catch (e) {
6771 /* do nothing */
6772 }
6773
6774 self.captureBreadcrumb({
6775 type: 'http',
6776 category: 'xhr',
6777 data: xhr.__raven_xhr
6778 });
6779 }
6780 }
6781
6782 var props = ['onload', 'onerror', 'onprogress'];
6783 for (var j = 0; j < props.length; j++) {
6784 wrapProp(props[j], xhr);
6785 }
6786
6787 if ('onreadystatechange' in xhr && isFunction(xhr.onreadystatechange)) {
6788 fill(
6789 xhr,
6790 'onreadystatechange',
6791 function(orig) {
6792 return self.wrap(orig, undefined, onreadystatechangeHandler);
6793 } /* intentionally don't track this instrumentation */
6794 );
6795 } else {
6796 // if onreadystatechange wasn't actually set by the page on this xhr, we
6797 // are free to set our own and capture the breadcrumb
6798 xhr.onreadystatechange = onreadystatechangeHandler;
6799 }
6800
6801 return origSend.apply(this, arguments);
6802 };
6803 },
6804 wrappedBuiltIns
6805 );
6806 }
6807
6808 if (autoBreadcrumbs.xhr && 'fetch' in _window) {
6809 fill(
6810 _window,
6811 'fetch',
6812 function(origFetch) {
6813 return function(fn, t) {
6814 // preserve arity
6815 // Make a copy of the arguments to prevent deoptimization
6816 // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
6817 var args = new Array(arguments.length);
6818 for (var i = 0; i < args.length; ++i) {
6819 args[i] = arguments[i];
6820 }
6821
6822 var fetchInput = args[0];
6823 var method = 'GET';
6824 var url;
6825
6826 if (typeof fetchInput === 'string') {
6827 url = fetchInput;
6828 } else if ('Request' in _window && fetchInput instanceof _window.Request) {
6829 url = fetchInput.url;
6830 if (fetchInput.method) {
6831 method = fetchInput.method;
6832 }
6833 } else {
6834 url = '' + fetchInput;
6835 }
6836
6837 if (args[1] && args[1].method) {
6838 method = args[1].method;
6839 }
6840
6841 var fetchData = {
6842 method: method,
6843 url: url,
6844 status_code: null
6845 };
6846
6847 self.captureBreadcrumb({
6848 type: 'http',
6849 category: 'fetch',
6850 data: fetchData
6851 });
6852
6853 return origFetch.apply(this, args).then(function(response) {
6854 fetchData.status_code = response.status;
6855
6856 return response;
6857 });
6858 };
6859 },
6860 wrappedBuiltIns
6861 );
6862 }
6863
6864 // Capture breadcrumbs from any click that is unhandled / bubbled up all the way
6865 // to the document. Do this before we instrument addEventListener.
6866 if (autoBreadcrumbs.dom && this._hasDocument) {
6867 if (_document.addEventListener) {
6868 _document.addEventListener('click', self._breadcrumbEventHandler('click'), false);
6869 _document.addEventListener('keypress', self._keypressEventHandler(), false);
6870 } else {
6871 // IE8 Compatibility
6872 _document.attachEvent('onclick', self._breadcrumbEventHandler('click'));
6873 _document.attachEvent('onkeypress', self._keypressEventHandler());
6874 }
6875 }
6876
6877 // record navigation (URL) changes
6878 // NOTE: in Chrome App environment, touching history.pushState, *even inside
6879 // a try/catch block*, will cause Chrome to output an error to console.error
6880 // borrowed from: https://github.com/angular/angular.js/pull/13945/files
6881 var chrome = _window.chrome;
6882 var isChromePackagedApp = chrome && chrome.app && chrome.app.runtime;
6883 var hasPushAndReplaceState =
6884 !isChromePackagedApp &&
6885 _window.history &&
6886 history.pushState &&
6887 history.replaceState;
6888 if (autoBreadcrumbs.location && hasPushAndReplaceState) {
6889 // TODO: remove onpopstate handler on uninstall()
6890 var oldOnPopState = _window.onpopstate;
6891 _window.onpopstate = function() {
6892 var currentHref = self._location.href;
6893 self._captureUrlChange(self._lastHref, currentHref);
6894
6895 if (oldOnPopState) {
6896 return oldOnPopState.apply(this, arguments);
6897 }
6898 };
6899
6900 var historyReplacementFunction = function(origHistFunction) {
6901 // note history.pushState.length is 0; intentionally not declaring
6902 // params to preserve 0 arity
6903 return function(/* state, title, url */) {
6904 var url = arguments.length > 2 ? arguments[2] : undefined;
6905
6906 // url argument is optional
6907 if (url) {
6908 // coerce to string (this is what pushState does)
6909 self._captureUrlChange(self._lastHref, url + '');
6910 }
6911
6912 return origHistFunction.apply(this, arguments);
6913 };
6914 };
6915
6916 fill(history, 'pushState', historyReplacementFunction, wrappedBuiltIns);
6917 fill(history, 'replaceState', historyReplacementFunction, wrappedBuiltIns);
6918 }
6919
6920 if (autoBreadcrumbs.console && 'console' in _window && console.log) {
6921 // console
6922 var consoleMethodCallback = function(msg, data) {
6923 self.captureBreadcrumb({
6924 message: msg,
6925 level: data.level,
6926 category: 'console'
6927 });
6928 };
6929
6930 each(['debug', 'info', 'warn', 'error', 'log'], function(_, level) {
6931 wrapConsoleMethod(console, level, consoleMethodCallback);
6932 });
6933 }
6934 },
6935
6936 _restoreBuiltIns: function() {
6937 // restore any wrapped builtins
6938 var builtin;
6939 while (this._wrappedBuiltIns.length) {
6940 builtin = this._wrappedBuiltIns.shift();
6941
6942 var obj = builtin[0],
6943 name = builtin[1],
6944 orig = builtin[2];
6945
6946 obj[name] = orig;
6947 }
6948 },
6949
6950 _drainPlugins: function() {
6951 var self = this;
6952
6953 // FIX ME TODO
6954 each(this._plugins, function(_, plugin) {
6955 var installer = plugin[0];
6956 var args = plugin[1];
6957 installer.apply(self, [self].concat(args));
6958 });
6959 },
6960
6961 _parseDSN: function(str) {
6962 var m = dsnPattern.exec(str),
6963 dsn = {},
6964 i = 7;
6965
6966 try {
6967 while (i--) dsn[dsnKeys[i]] = m[i] || '';
6968 } catch (e) {
6969 throw new RavenConfigError('Invalid DSN: ' + str);
6970 }
6971
6972 if (dsn.pass && !this._globalOptions.allowSecretKey) {
6973 throw new RavenConfigError(
6974 'Do not specify your secret key in the DSN. See: http://bit.ly/raven-secret-key'
6975 );
6976 }
6977
6978 return dsn;
6979 },
6980
6981 _getGlobalServer: function(uri) {
6982 // assemble the endpoint from the uri pieces
6983 var globalServer = '//' + uri.host + (uri.port ? ':' + uri.port : '');
6984
6985 if (uri.protocol) {
6986 globalServer = uri.protocol + ':' + globalServer;
6987 }
6988 return globalServer;
6989 },
6990
6991 _handleOnErrorStackInfo: function() {
6992 // if we are intentionally ignoring errors via onerror, bail out
6993 if (!this._ignoreOnError) {
6994 this._handleStackInfo.apply(this, arguments);
6995 }
6996 },
6997
6998 _handleStackInfo: function(stackInfo, options) {
6999 var frames = this._prepareFrames(stackInfo, options);
7000
7001 this._triggerEvent('handle', {
7002 stackInfo: stackInfo,
7003 options: options
7004 });
7005
7006 this._processException(
7007 stackInfo.name,
7008 stackInfo.message,
7009 stackInfo.url,
7010 stackInfo.lineno,
7011 frames,
7012 options
7013 );
7014 },
7015
7016 _prepareFrames: function(stackInfo, options) {
7017 var self = this;
7018 var frames = [];
7019 if (stackInfo.stack && stackInfo.stack.length) {
7020 each(stackInfo.stack, function(i, stack) {
7021 var frame = self._normalizeFrame(stack, stackInfo.url);
7022 if (frame) {
7023 frames.push(frame);
7024 }
7025 });
7026
7027 // e.g. frames captured via captureMessage throw
7028 if (options && options.trimHeadFrames) {
7029 for (var j = 0; j < options.trimHeadFrames && j < frames.length; j++) {
7030 frames[j].in_app = false;
7031 }
7032 }
7033 }
7034 frames = frames.slice(0, this._globalOptions.stackTraceLimit);
7035 return frames;
7036 },
7037
7038 _normalizeFrame: function(frame, stackInfoUrl) {
7039 // normalize the frames data
7040 var normalized = {
7041 filename: frame.url,
7042 lineno: frame.line,
7043 colno: frame.column,
7044 function: frame.func || '?'
7045 };
7046
7047 // Case when we don't have any information about the error
7048 // E.g. throwing a string or raw object, instead of an `Error` in Firefox
7049 // Generating synthetic error doesn't add any value here
7050 //
7051 // We should probably somehow let a user know that they should fix their code
7052 if (!frame.url) {
7053 normalized.filename = stackInfoUrl; // fallback to whole stacks url from onerror handler
7054 }
7055
7056 normalized.in_app = !// determine if an exception came from outside of our app
7057 // first we check the global includePaths list.
7058 (
7059 (!!this._globalOptions.includePaths.test &&
7060 !this._globalOptions.includePaths.test(normalized.filename)) ||
7061 // Now we check for fun, if the function name is Raven or TraceKit
7062 /(Raven|TraceKit)\./.test(normalized['function']) ||
7063 // finally, we do a last ditch effort and check for raven.min.js
7064 /raven\.(min\.)?js$/.test(normalized.filename)
7065 );
7066
7067 return normalized;
7068 },
7069
7070 _processException: function(type, message, fileurl, lineno, frames, options) {
7071 var prefixedMessage = (type ? type + ': ' : '') + (message || '');
7072 if (
7073 !!this._globalOptions.ignoreErrors.test &&
7074 (this._globalOptions.ignoreErrors.test(message) ||
7075 this._globalOptions.ignoreErrors.test(prefixedMessage))
7076 ) {
7077 return;
7078 }
7079
7080 var stacktrace;
7081
7082 if (frames && frames.length) {
7083 fileurl = frames[0].filename || fileurl;
7084 // Sentry expects frames oldest to newest
7085 // and JS sends them as newest to oldest
7086 frames.reverse();
7087 stacktrace = {frames: frames};
7088 } else if (fileurl) {
7089 stacktrace = {
7090 frames: [
7091 {
7092 filename: fileurl,
7093 lineno: lineno,
7094 in_app: true
7095 }
7096 ]
7097 };
7098 }
7099
7100 if (
7101 !!this._globalOptions.ignoreUrls.test &&
7102 this._globalOptions.ignoreUrls.test(fileurl)
7103 ) {
7104 return;
7105 }
7106
7107 if (
7108 !!this._globalOptions.whitelistUrls.test &&
7109 !this._globalOptions.whitelistUrls.test(fileurl)
7110 ) {
7111 return;
7112 }
7113
7114 var data = objectMerge(
7115 {
7116 // sentry.interfaces.Exception
7117 exception: {
7118 values: [
7119 {
7120 type: type,
7121 value: message,
7122 stacktrace: stacktrace
7123 }
7124 ]
7125 },
7126 culprit: fileurl
7127 },
7128 options
7129 );
7130
7131 // Fire away!
7132 this._send(data);
7133 },
7134
7135 _trimPacket: function(data) {
7136 // For now, we only want to truncate the two different messages
7137 // but this could/should be expanded to just trim everything
7138 var max = this._globalOptions.maxMessageLength;
7139 if (data.message) {
7140 data.message = truncate(data.message, max);
7141 }
7142 if (data.exception) {
7143 var exception = data.exception.values[0];
7144 exception.value = truncate(exception.value, max);
7145 }
7146
7147 var request = data.request;
7148 if (request) {
7149 if (request.url) {
7150 request.url = truncate(request.url, this._globalOptions.maxUrlLength);
7151 }
7152 if (request.Referer) {
7153 request.Referer = truncate(request.Referer, this._globalOptions.maxUrlLength);
7154 }
7155 }
7156
7157 if (data.breadcrumbs && data.breadcrumbs.values)
7158 this._trimBreadcrumbs(data.breadcrumbs);
7159
7160 return data;
7161 },
7162
7163 /**
7164 * Truncate breadcrumb values (right now just URLs)
7165 */
7166 _trimBreadcrumbs: function(breadcrumbs) {
7167 // known breadcrumb properties with urls
7168 // TODO: also consider arbitrary prop values that start with (https?)?://
7169 var urlProps = ['to', 'from', 'url'],
7170 urlProp,
7171 crumb,
7172 data;
7173
7174 for (var i = 0; i < breadcrumbs.values.length; ++i) {
7175 crumb = breadcrumbs.values[i];
7176 if (
7177 !crumb.hasOwnProperty('data') ||
7178 !isObject(crumb.data) ||
7179 objectFrozen(crumb.data)
7180 )
7181 continue;
7182
7183 data = objectMerge({}, crumb.data);
7184 for (var j = 0; j < urlProps.length; ++j) {
7185 urlProp = urlProps[j];
7186 if (data.hasOwnProperty(urlProp) && data[urlProp]) {
7187 data[urlProp] = truncate(data[urlProp], this._globalOptions.maxUrlLength);
7188 }
7189 }
7190 breadcrumbs.values[i].data = data;
7191 }
7192 },
7193
7194 _getHttpData: function() {
7195 if (!this._hasNavigator && !this._hasDocument) return;
7196 var httpData = {};
7197
7198 if (this._hasNavigator && _navigator.userAgent) {
7199 httpData.headers = {
7200 'User-Agent': navigator.userAgent
7201 };
7202 }
7203
7204 if (this._hasDocument) {
7205 if (_document.location && _document.location.href) {
7206 httpData.url = _document.location.href;
7207 }
7208 if (_document.referrer) {
7209 if (!httpData.headers) httpData.headers = {};
7210 httpData.headers.Referer = _document.referrer;
7211 }
7212 }
7213
7214 return httpData;
7215 },
7216
7217 _resetBackoff: function() {
7218 this._backoffDuration = 0;
7219 this._backoffStart = null;
7220 },
7221
7222 _shouldBackoff: function() {
7223 return this._backoffDuration && now() - this._backoffStart < this._backoffDuration;
7224 },
7225
7226 /**
7227 * Returns true if the in-process data payload matches the signature
7228 * of the previously-sent data
7229 *
7230 * NOTE: This has to be done at this level because TraceKit can generate
7231 * data from window.onerror WITHOUT an exception object (IE8, IE9,
7232 * other old browsers). This can take the form of an "exception"
7233 * data object with a single frame (derived from the onerror args).
7234 */
7235 _isRepeatData: function(current) {
7236 var last = this._lastData;
7237
7238 if (
7239 !last ||
7240 current.message !== last.message || // defined for captureMessage
7241 current.culprit !== last.culprit // defined for captureException/onerror
7242 )
7243 return false;
7244
7245 // Stacktrace interface (i.e. from captureMessage)
7246 if (current.stacktrace || last.stacktrace) {
7247 return isSameStacktrace(current.stacktrace, last.stacktrace);
7248 } else if (current.exception || last.exception) {
7249 // Exception interface (i.e. from captureException/onerror)
7250 return isSameException(current.exception, last.exception);
7251 }
7252
7253 return true;
7254 },
7255
7256 _setBackoffState: function(request) {
7257 // If we are already in a backoff state, don't change anything
7258 if (this._shouldBackoff()) {
7259 return;
7260 }
7261
7262 var status = request.status;
7263
7264 // 400 - project_id doesn't exist or some other fatal
7265 // 401 - invalid/revoked dsn
7266 // 429 - too many requests
7267 if (!(status === 400 || status === 401 || status === 429)) return;
7268
7269 var retry;
7270 try {
7271 // If Retry-After is not in Access-Control-Expose-Headers, most
7272 // browsers will throw an exception trying to access it
7273 retry = request.getResponseHeader('Retry-After');
7274 retry = parseInt(retry, 10) * 1000; // Retry-After is returned in seconds
7275 } catch (e) {
7276 /* eslint no-empty:0 */
7277 }
7278
7279 this._backoffDuration = retry
7280 ? // If Sentry server returned a Retry-After value, use it
7281 retry
7282 : // Otherwise, double the last backoff duration (starts at 1 sec)
7283 this._backoffDuration * 2 || 1000;
7284
7285 this._backoffStart = now();
7286 },
7287
7288 _send: function(data) {
7289 var globalOptions = this._globalOptions;
7290
7291 var baseData = {
7292 project: this._globalProject,
7293 logger: globalOptions.logger,
7294 platform: 'javascript'
7295 },
7296 httpData = this._getHttpData();
7297
7298 if (httpData) {
7299 baseData.request = httpData;
7300 }
7301
7302 // HACK: delete `trimHeadFrames` to prevent from appearing in outbound payload
7303 if (data.trimHeadFrames) delete data.trimHeadFrames;
7304
7305 data = objectMerge(baseData, data);
7306
7307 // Merge in the tags and extra separately since objectMerge doesn't handle a deep merge
7308 data.tags = objectMerge(objectMerge({}, this._globalContext.tags), data.tags);
7309 data.extra = objectMerge(objectMerge({}, this._globalContext.extra), data.extra);
7310
7311 // Send along our own collected metadata with extra
7312 data.extra['session:duration'] = now() - this._startTime;
7313
7314 if (this._breadcrumbs && this._breadcrumbs.length > 0) {
7315 // intentionally make shallow copy so that additions
7316 // to breadcrumbs aren't accidentally sent in this request
7317 data.breadcrumbs = {
7318 values: [].slice.call(this._breadcrumbs, 0)
7319 };
7320 }
7321
7322 // If there are no tags/extra, strip the key from the payload alltogther.
7323 if (isEmptyObject(data.tags)) delete data.tags;
7324
7325 if (this._globalContext.user) {
7326 // sentry.interfaces.User
7327 data.user = this._globalContext.user;
7328 }
7329
7330 // Include the environment if it's defined in globalOptions
7331 if (globalOptions.environment) data.environment = globalOptions.environment;
7332
7333 // Include the release if it's defined in globalOptions
7334 if (globalOptions.release) data.release = globalOptions.release;
7335
7336 // Include server_name if it's defined in globalOptions
7337 if (globalOptions.serverName) data.server_name = globalOptions.serverName;
7338
7339 if (isFunction(globalOptions.dataCallback)) {
7340 data = globalOptions.dataCallback(data) || data;
7341 }
7342
7343 // Why??????????
7344 if (!data || isEmptyObject(data)) {
7345 return;
7346 }
7347
7348 // Check if the request should be filtered or not
7349 if (
7350 isFunction(globalOptions.shouldSendCallback) &&
7351 !globalOptions.shouldSendCallback(data)
7352 ) {
7353 return;
7354 }
7355
7356 // Backoff state: Sentry server previously responded w/ an error (e.g. 429 - too many requests),
7357 // so drop requests until "cool-off" period has elapsed.
7358 if (this._shouldBackoff()) {
7359 this._logDebug('warn', 'Raven dropped error due to backoff: ', data);
7360 return;
7361 }
7362
7363 if (typeof globalOptions.sampleRate === 'number') {
7364 if (Math.random() < globalOptions.sampleRate) {
7365 this._sendProcessedPayload(data);
7366 }
7367 } else {
7368 this._sendProcessedPayload(data);
7369 }
7370 },
7371
7372 _getUuid: function() {
7373 return uuid4();
7374 },
7375
7376 _sendProcessedPayload: function(data, callback) {
7377 var self = this;
7378 var globalOptions = this._globalOptions;
7379
7380 if (!this.isSetup()) return;
7381
7382 // Try and clean up the packet before sending by truncating long values
7383 data = this._trimPacket(data);
7384
7385 // ideally duplicate error testing should occur *before* dataCallback/shouldSendCallback,
7386 // but this would require copying an un-truncated copy of the data packet, which can be
7387 // arbitrarily deep (extra_data) -- could be worthwhile? will revisit
7388 if (!this._globalOptions.allowDuplicates && this._isRepeatData(data)) {
7389 this._logDebug('warn', 'Raven dropped repeat event: ', data);
7390 return;
7391 }
7392
7393 // Send along an event_id if not explicitly passed.
7394 // This event_id can be used to reference the error within Sentry itself.
7395 // Set lastEventId after we know the error should actually be sent
7396 this._lastEventId = data.event_id || (data.event_id = this._getUuid());
7397
7398 // Store outbound payload after trim
7399 this._lastData = data;
7400
7401 this._logDebug('debug', 'Raven about to send:', data);
7402
7403 var auth = {
7404 sentry_version: '7',
7405 sentry_client: 'raven-js/' + this.VERSION,
7406 sentry_key: this._globalKey
7407 };
7408
7409 if (this._globalSecret) {
7410 auth.sentry_secret = this._globalSecret;
7411 }
7412
7413 var exception = data.exception && data.exception.values[0];
7414 this.captureBreadcrumb({
7415 category: 'sentry',
7416 message: exception
7417 ? (exception.type ? exception.type + ': ' : '') + exception.value
7418 : data.message,
7419 event_id: data.event_id,
7420 level: data.level || 'error' // presume error unless specified
7421 });
7422
7423 var url = this._globalEndpoint;
7424 (globalOptions.transport || this._makeRequest).call(this, {
7425 url: url,
7426 auth: auth,
7427 data: data,
7428 options: globalOptions,
7429 onSuccess: function success() {
7430 self._resetBackoff();
7431
7432 self._triggerEvent('success', {
7433 data: data,
7434 src: url
7435 });
7436 callback && callback();
7437 },
7438 onError: function failure(error) {
7439 self._logDebug('error', 'Raven transport failed to send: ', error);
7440
7441 if (error.request) {
7442 self._setBackoffState(error.request);
7443 }
7444
7445 self._triggerEvent('failure', {
7446 data: data,
7447 src: url
7448 });
7449 error = error || new Error('Raven send failed (no additional details provided)');
7450 callback && callback(error);
7451 }
7452 });
7453 },
7454
7455 _makeRequest: function(opts) {
7456 var request = _window.XMLHttpRequest && new _window.XMLHttpRequest();
7457 if (!request) return;
7458
7459 // if browser doesn't support CORS (e.g. IE7), we are out of luck
7460 var hasCORS = 'withCredentials' in request || typeof XDomainRequest !== 'undefined';
7461
7462 if (!hasCORS) return;
7463
7464 var url = opts.url;
7465
7466 if ('withCredentials' in request) {
7467 request.onreadystatechange = function() {
7468 if (request.readyState !== 4) {
7469 return;
7470 } else if (request.status === 200) {
7471 opts.onSuccess && opts.onSuccess();
7472 } else if (opts.onError) {
7473 var err = new Error('Sentry error code: ' + request.status);
7474 err.request = request;
7475 opts.onError(err);
7476 }
7477 };
7478 } else {
7479 request = new XDomainRequest();
7480 // xdomainrequest cannot go http -> https (or vice versa),
7481 // so always use protocol relative
7482 url = url.replace(/^https?:/, '');
7483
7484 // onreadystatechange not supported by XDomainRequest
7485 if (opts.onSuccess) {
7486 request.onload = opts.onSuccess;
7487 }
7488 if (opts.onError) {
7489 request.onerror = function() {
7490 var err = new Error('Sentry error code: XDomainRequest');
7491 err.request = request;
7492 opts.onError(err);
7493 };
7494 }
7495 }
7496
7497 // NOTE: auth is intentionally sent as part of query string (NOT as custom
7498 // HTTP header) so as to avoid preflight CORS requests
7499 request.open('POST', url + '?' + urlencode(opts.auth));
7500 request.send(stringify(opts.data));
7501 },
7502
7503 _logDebug: function(level) {
7504 if (this._originalConsoleMethods[level] && this.debug) {
7505 // In IE<10 console methods do not have their own 'apply' method
7506 Function.prototype.apply.call(
7507 this._originalConsoleMethods[level],
7508 this._originalConsole,
7509 [].slice.call(arguments, 1)
7510 );
7511 }
7512 },
7513
7514 _mergeContext: function(key, context) {
7515 if (isUndefined(context)) {
7516 delete this._globalContext[key];
7517 } else {
7518 this._globalContext[key] = objectMerge(this._globalContext[key] || {}, context);
7519 }
7520 }
7521 };
7522
7523 // Deprecations
7524 Raven.prototype.setUser = Raven.prototype.setUserContext;
7525 Raven.prototype.setReleaseContext = Raven.prototype.setRelease;
7526
7527 module.exports = Raven;
7528
7529
7530 /***/ }),
7531
7532 /***/ "./node_modules/raven-js/src/singleton.js":
7533 /*!************************************************!*\
7534 !*** ./node_modules/raven-js/src/singleton.js ***!
7535 \************************************************/
7536 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7537
7538 /**
7539 * Enforces a single instance of the Raven client, and the
7540 * main entry point for Raven. If you are a consumer of the
7541 * Raven library, you SHOULD load this file (vs raven.js).
7542 **/
7543
7544 var RavenConstructor = __webpack_require__(/*! ./raven */ "./node_modules/raven-js/src/raven.js");
7545
7546 // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785)
7547 var _window =
7548 typeof window !== 'undefined'
7549 ? window
7550 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
7551 var _Raven = _window.Raven;
7552
7553 var Raven = new RavenConstructor();
7554
7555 /*
7556 * Allow multiple versions of Raven to be installed.
7557 * Strip Raven from the global context and returns the instance.
7558 *
7559 * @return {Raven}
7560 */
7561 Raven.noConflict = function() {
7562 _window.Raven = _Raven;
7563 return Raven;
7564 };
7565
7566 Raven.afterLoad();
7567
7568 module.exports = Raven;
7569
7570
7571 /***/ }),
7572
7573 /***/ "./node_modules/raven-js/src/utils.js":
7574 /*!********************************************!*\
7575 !*** ./node_modules/raven-js/src/utils.js ***!
7576 \********************************************/
7577 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7578
7579 var _window =
7580 typeof window !== 'undefined'
7581 ? window
7582 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
7583
7584 function isObject(what) {
7585 return typeof what === 'object' && what !== null;
7586 }
7587
7588 // Yanked from https://git.io/vS8DV re-used under CC0
7589 // with some tiny modifications
7590 function isError(value) {
7591 switch ({}.toString.call(value)) {
7592 case '[object Error]':
7593 return true;
7594 case '[object Exception]':
7595 return true;
7596 case '[object DOMException]':
7597 return true;
7598 default:
7599 return value instanceof Error;
7600 }
7601 }
7602
7603 function isErrorEvent(value) {
7604 return supportsErrorEvent() && {}.toString.call(value) === '[object ErrorEvent]';
7605 }
7606
7607 function isUndefined(what) {
7608 return what === void 0;
7609 }
7610
7611 function isFunction(what) {
7612 return typeof what === 'function';
7613 }
7614
7615 function isString(what) {
7616 return Object.prototype.toString.call(what) === '[object String]';
7617 }
7618
7619 function isEmptyObject(what) {
7620 for (var _ in what) return false; // eslint-disable-line guard-for-in, no-unused-vars
7621 return true;
7622 }
7623
7624 function supportsErrorEvent() {
7625 try {
7626 new ErrorEvent(''); // eslint-disable-line no-new
7627 return true;
7628 } catch (e) {
7629 return false;
7630 }
7631 }
7632
7633 function wrappedCallback(callback) {
7634 function dataCallback(data, original) {
7635 var normalizedData = callback(data) || data;
7636 if (original) {
7637 return original(normalizedData) || normalizedData;
7638 }
7639 return normalizedData;
7640 }
7641
7642 return dataCallback;
7643 }
7644
7645 function each(obj, callback) {
7646 var i, j;
7647
7648 if (isUndefined(obj.length)) {
7649 for (i in obj) {
7650 if (hasKey(obj, i)) {
7651 callback.call(null, i, obj[i]);
7652 }
7653 }
7654 } else {
7655 j = obj.length;
7656 if (j) {
7657 for (i = 0; i < j; i++) {
7658 callback.call(null, i, obj[i]);
7659 }
7660 }
7661 }
7662 }
7663
7664 function objectMerge(obj1, obj2) {
7665 if (!obj2) {
7666 return obj1;
7667 }
7668 each(obj2, function(key, value) {
7669 obj1[key] = value;
7670 });
7671 return obj1;
7672 }
7673
7674 /**
7675 * This function is only used for react-native.
7676 * react-native freezes object that have already been sent over the
7677 * js bridge. We need this function in order to check if the object is frozen.
7678 * So it's ok that objectFrozen returns false if Object.isFrozen is not
7679 * supported because it's not relevant for other "platforms". See related issue:
7680 * https://github.com/getsentry/react-native-sentry/issues/57
7681 */
7682 function objectFrozen(obj) {
7683 if (!Object.isFrozen) {
7684 return false;
7685 }
7686 return Object.isFrozen(obj);
7687 }
7688
7689 function truncate(str, max) {
7690 return !max || str.length <= max ? str : str.substr(0, max) + '\u2026';
7691 }
7692
7693 /**
7694 * hasKey, a better form of hasOwnProperty
7695 * Example: hasKey(MainHostObject, property) === true/false
7696 *
7697 * @param {Object} host object to check property
7698 * @param {string} key to check
7699 */
7700 function hasKey(object, key) {
7701 return Object.prototype.hasOwnProperty.call(object, key);
7702 }
7703
7704 function joinRegExp(patterns) {
7705 // Combine an array of regular expressions and strings into one large regexp
7706 // Be mad.
7707 var sources = [],
7708 i = 0,
7709 len = patterns.length,
7710 pattern;
7711
7712 for (; i < len; i++) {
7713 pattern = patterns[i];
7714 if (isString(pattern)) {
7715 // If it's a string, we need to escape it
7716 // Taken from: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
7717 sources.push(pattern.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, '\\$1'));
7718 } else if (pattern && pattern.source) {
7719 // If it's a regexp already, we want to extract the source
7720 sources.push(pattern.source);
7721 }
7722 // Intentionally skip other cases
7723 }
7724 return new RegExp(sources.join('|'), 'i');
7725 }
7726
7727 function urlencode(o) {
7728 var pairs = [];
7729 each(o, function(key, value) {
7730 pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));
7731 });
7732 return pairs.join('&');
7733 }
7734
7735 // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B
7736 // intentionally using regex and not <a/> href parsing trick because React Native and other
7737 // environments where DOM might not be available
7738 function parseUrl(url) {
7739 var match = url.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);
7740 if (!match) return {};
7741
7742 // coerce to undefined values to empty string so we don't get 'undefined'
7743 var query = match[6] || '';
7744 var fragment = match[8] || '';
7745 return {
7746 protocol: match[2],
7747 host: match[4],
7748 path: match[5],
7749 relative: match[5] + query + fragment // everything minus origin
7750 };
7751 }
7752 function uuid4() {
7753 var crypto = _window.crypto || _window.msCrypto;
7754
7755 if (!isUndefined(crypto) && crypto.getRandomValues) {
7756 // Use window.crypto API if available
7757 // eslint-disable-next-line no-undef
7758 var arr = new Uint16Array(8);
7759 crypto.getRandomValues(arr);
7760
7761 // set 4 in byte 7
7762 arr[3] = (arr[3] & 0xfff) | 0x4000;
7763 // set 2 most significant bits of byte 9 to '10'
7764 arr[4] = (arr[4] & 0x3fff) | 0x8000;
7765
7766 var pad = function(num) {
7767 var v = num.toString(16);
7768 while (v.length < 4) {
7769 v = '0' + v;
7770 }
7771 return v;
7772 };
7773
7774 return (
7775 pad(arr[0]) +
7776 pad(arr[1]) +
7777 pad(arr[2]) +
7778 pad(arr[3]) +
7779 pad(arr[4]) +
7780 pad(arr[5]) +
7781 pad(arr[6]) +
7782 pad(arr[7])
7783 );
7784 } else {
7785 // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523
7786 return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
7787 var r = (Math.random() * 16) | 0,
7788 v = c === 'x' ? r : (r & 0x3) | 0x8;
7789 return v.toString(16);
7790 });
7791 }
7792 }
7793
7794 /**
7795 * Given a child DOM element, returns a query-selector statement describing that
7796 * and its ancestors
7797 * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]
7798 * @param elem
7799 * @returns {string}
7800 */
7801 function htmlTreeAsString(elem) {
7802 /* eslint no-extra-parens:0*/
7803 var MAX_TRAVERSE_HEIGHT = 5,
7804 MAX_OUTPUT_LEN = 80,
7805 out = [],
7806 height = 0,
7807 len = 0,
7808 separator = ' > ',
7809 sepLength = separator.length,
7810 nextStr;
7811
7812 while (elem && height++ < MAX_TRAVERSE_HEIGHT) {
7813 nextStr = htmlElementAsString(elem);
7814 // bail out if
7815 // - nextStr is the 'html' element
7816 // - the length of the string that would be created exceeds MAX_OUTPUT_LEN
7817 // (ignore this limit if we are on the first iteration)
7818 if (
7819 nextStr === 'html' ||
7820 (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)
7821 ) {
7822 break;
7823 }
7824
7825 out.push(nextStr);
7826
7827 len += nextStr.length;
7828 elem = elem.parentNode;
7829 }
7830
7831 return out.reverse().join(separator);
7832 }
7833
7834 /**
7835 * Returns a simple, query-selector representation of a DOM element
7836 * e.g. [HTMLElement] => input#foo.btn[name=baz]
7837 * @param HTMLElement
7838 * @returns {string}
7839 */
7840 function htmlElementAsString(elem) {
7841 var out = [],
7842 className,
7843 classes,
7844 key,
7845 attr,
7846 i;
7847
7848 if (!elem || !elem.tagName) {
7849 return '';
7850 }
7851
7852 out.push(elem.tagName.toLowerCase());
7853 if (elem.id) {
7854 out.push('#' + elem.id);
7855 }
7856
7857 className = elem.className;
7858 if (className && isString(className)) {
7859 classes = className.split(/\s+/);
7860 for (i = 0; i < classes.length; i++) {
7861 out.push('.' + classes[i]);
7862 }
7863 }
7864 var attrWhitelist = ['type', 'name', 'title', 'alt'];
7865 for (i = 0; i < attrWhitelist.length; i++) {
7866 key = attrWhitelist[i];
7867 attr = elem.getAttribute(key);
7868 if (attr) {
7869 out.push('[' + key + '="' + attr + '"]');
7870 }
7871 }
7872 return out.join('');
7873 }
7874
7875 /**
7876 * Returns true if either a OR b is truthy, but not both
7877 */
7878 function isOnlyOneTruthy(a, b) {
7879 return !!(!!a ^ !!b);
7880 }
7881
7882 /**
7883 * Returns true if the two input exception interfaces have the same content
7884 */
7885 function isSameException(ex1, ex2) {
7886 if (isOnlyOneTruthy(ex1, ex2)) return false;
7887
7888 ex1 = ex1.values[0];
7889 ex2 = ex2.values[0];
7890
7891 if (ex1.type !== ex2.type || ex1.value !== ex2.value) return false;
7892
7893 return isSameStacktrace(ex1.stacktrace, ex2.stacktrace);
7894 }
7895
7896 /**
7897 * Returns true if the two input stack trace interfaces have the same content
7898 */
7899 function isSameStacktrace(stack1, stack2) {
7900 if (isOnlyOneTruthy(stack1, stack2)) return false;
7901
7902 var frames1 = stack1.frames;
7903 var frames2 = stack2.frames;
7904
7905 // Exit early if frame count differs
7906 if (frames1.length !== frames2.length) return false;
7907
7908 // Iterate through every frame; bail out if anything differs
7909 var a, b;
7910 for (var i = 0; i < frames1.length; i++) {
7911 a = frames1[i];
7912 b = frames2[i];
7913 if (
7914 a.filename !== b.filename ||
7915 a.lineno !== b.lineno ||
7916 a.colno !== b.colno ||
7917 a['function'] !== b['function']
7918 )
7919 return false;
7920 }
7921 return true;
7922 }
7923
7924 /**
7925 * Polyfill a method
7926 * @param obj object e.g. `document`
7927 * @param name method name present on object e.g. `addEventListener`
7928 * @param replacement replacement function
7929 * @param track {optional} record instrumentation to an array
7930 */
7931 function fill(obj, name, replacement, track) {
7932 var orig = obj[name];
7933 obj[name] = replacement(orig);
7934 if (track) {
7935 track.push([obj, name, orig]);
7936 }
7937 }
7938
7939 module.exports = {
7940 isObject: isObject,
7941 isError: isError,
7942 isErrorEvent: isErrorEvent,
7943 isUndefined: isUndefined,
7944 isFunction: isFunction,
7945 isString: isString,
7946 isEmptyObject: isEmptyObject,
7947 supportsErrorEvent: supportsErrorEvent,
7948 wrappedCallback: wrappedCallback,
7949 each: each,
7950 objectMerge: objectMerge,
7951 truncate: truncate,
7952 objectFrozen: objectFrozen,
7953 hasKey: hasKey,
7954 joinRegExp: joinRegExp,
7955 urlencode: urlencode,
7956 uuid4: uuid4,
7957 htmlTreeAsString: htmlTreeAsString,
7958 htmlElementAsString: htmlElementAsString,
7959 isSameException: isSameException,
7960 isSameStacktrace: isSameStacktrace,
7961 parseUrl: parseUrl,
7962 fill: fill
7963 };
7964
7965
7966 /***/ }),
7967
7968 /***/ "./node_modules/raven-js/vendor/TraceKit/tracekit.js":
7969 /*!***********************************************************!*\
7970 !*** ./node_modules/raven-js/vendor/TraceKit/tracekit.js ***!
7971 \***********************************************************/
7972 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7973
7974 var utils = __webpack_require__(/*! ../../src/utils */ "./node_modules/raven-js/src/utils.js");
7975
7976 /*
7977 TraceKit - Cross brower stack traces
7978
7979 This was originally forked from github.com/occ/TraceKit, but has since been
7980 largely re-written and is now maintained as part of raven-js. Tests for
7981 this are in test/vendor.
7982
7983 MIT license
7984 */
7985
7986 var TraceKit = {
7987 collectWindowErrors: true,
7988 debug: false
7989 };
7990
7991 // This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785)
7992 var _window =
7993 typeof window !== 'undefined'
7994 ? window
7995 : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
7996
7997 // global reference to slice
7998 var _slice = [].slice;
7999 var UNKNOWN_FUNCTION = '?';
8000
8001 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Error_types
8002 var ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;
8003
8004 function getLocationHref() {
8005 if (typeof document === 'undefined' || document.location == null) return '';
8006
8007 return document.location.href;
8008 }
8009
8010 /**
8011 * TraceKit.report: cross-browser processing of unhandled exceptions
8012 *
8013 * Syntax:
8014 * TraceKit.report.subscribe(function(stackInfo) { ... })
8015 * TraceKit.report.unsubscribe(function(stackInfo) { ... })
8016 * TraceKit.report(exception)
8017 * try { ...code... } catch(ex) { TraceKit.report(ex); }
8018 *
8019 * Supports:
8020 * - Firefox: full stack trace with line numbers, plus column number
8021 * on top frame; column number is not guaranteed
8022 * - Opera: full stack trace with line and column numbers
8023 * - Chrome: full stack trace with line and column numbers
8024 * - Safari: line and column number for the top frame only; some frames
8025 * may be missing, and column number is not guaranteed
8026 * - IE: line and column number for the top frame only; some frames
8027 * may be missing, and column number is not guaranteed
8028 *
8029 * In theory, TraceKit should work on all of the following versions:
8030 * - IE5.5+ (only 8.0 tested)
8031 * - Firefox 0.9+ (only 3.5+ tested)
8032 * - Opera 7+ (only 10.50 tested; versions 9 and earlier may require
8033 * Exceptions Have Stacktrace to be enabled in opera:config)
8034 * - Safari 3+ (only 4+ tested)
8035 * - Chrome 1+ (only 5+ tested)
8036 * - Konqueror 3.5+ (untested)
8037 *
8038 * Requires TraceKit.computeStackTrace.
8039 *
8040 * Tries to catch all unhandled exceptions and report them to the
8041 * subscribed handlers. Please note that TraceKit.report will rethrow the
8042 * exception. This is REQUIRED in order to get a useful stack trace in IE.
8043 * If the exception does not reach the top of the browser, you will only
8044 * get a stack trace from the point where TraceKit.report was called.
8045 *
8046 * Handlers receive a stackInfo object as described in the
8047 * TraceKit.computeStackTrace docs.
8048 */
8049 TraceKit.report = (function reportModuleWrapper() {
8050 var handlers = [],
8051 lastArgs = null,
8052 lastException = null,
8053 lastExceptionStack = null;
8054
8055 /**
8056 * Add a crash handler.
8057 * @param {Function} handler
8058 */
8059 function subscribe(handler) {
8060 installGlobalHandler();
8061 handlers.push(handler);
8062 }
8063
8064 /**
8065 * Remove a crash handler.
8066 * @param {Function} handler
8067 */
8068 function unsubscribe(handler) {
8069 for (var i = handlers.length - 1; i >= 0; --i) {
8070 if (handlers[i] === handler) {
8071 handlers.splice(i, 1);
8072 }
8073 }
8074 }
8075
8076 /**
8077 * Remove all crash handlers.
8078 */
8079 function unsubscribeAll() {
8080 uninstallGlobalHandler();
8081 handlers = [];
8082 }
8083
8084 /**
8085 * Dispatch stack information to all handlers.
8086 * @param {Object.<string, *>} stack
8087 */
8088 function notifyHandlers(stack, isWindowError) {
8089 var exception = null;
8090 if (isWindowError && !TraceKit.collectWindowErrors) {
8091 return;
8092 }
8093 for (var i in handlers) {
8094 if (handlers.hasOwnProperty(i)) {
8095 try {
8096 handlers[i].apply(null, [stack].concat(_slice.call(arguments, 2)));
8097 } catch (inner) {
8098 exception = inner;
8099 }
8100 }
8101 }
8102
8103 if (exception) {
8104 throw exception;
8105 }
8106 }
8107
8108 var _oldOnerrorHandler, _onErrorHandlerInstalled;
8109
8110 /**
8111 * Ensures all global unhandled exceptions are recorded.
8112 * Supported by Gecko and IE.
8113 * @param {string} message Error message.
8114 * @param {string} url URL of script that generated the exception.
8115 * @param {(number|string)} lineNo The line number at which the error
8116 * occurred.
8117 * @param {?(number|string)} colNo The column number at which the error
8118 * occurred.
8119 * @param {?Error} ex The actual Error object.
8120 */
8121 function traceKitWindowOnError(message, url, lineNo, colNo, ex) {
8122 var stack = null;
8123
8124 if (lastExceptionStack) {
8125 TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(
8126 lastExceptionStack,
8127 url,
8128 lineNo,
8129 message
8130 );
8131 processLastException();
8132 } else if (ex && utils.isError(ex)) {
8133 // non-string `ex` arg; attempt to extract stack trace
8134
8135 // New chrome and blink send along a real error object
8136 // Let's just report that like a normal error.
8137 // See: https://mikewest.org/2013/08/debugging-runtime-errors-with-window-onerror
8138 stack = TraceKit.computeStackTrace(ex);
8139 notifyHandlers(stack, true);
8140 } else {
8141 var location = {
8142 url: url,
8143 line: lineNo,
8144 column: colNo
8145 };
8146
8147 var name = undefined;
8148 var msg = message; // must be new var or will modify original `arguments`
8149 var groups;
8150 if ({}.toString.call(message) === '[object String]') {
8151 var groups = message.match(ERROR_TYPES_RE);
8152 if (groups) {
8153 name = groups[1];
8154 msg = groups[2];
8155 }
8156 }
8157
8158 location.func = UNKNOWN_FUNCTION;
8159
8160 stack = {
8161 name: name,
8162 message: msg,
8163 url: getLocationHref(),
8164 stack: [location]
8165 };
8166 notifyHandlers(stack, true);
8167 }
8168
8169 if (_oldOnerrorHandler) {
8170 return _oldOnerrorHandler.apply(this, arguments);
8171 }
8172
8173 return false;
8174 }
8175
8176 function installGlobalHandler() {
8177 if (_onErrorHandlerInstalled) {
8178 return;
8179 }
8180 _oldOnerrorHandler = _window.onerror;
8181 _window.onerror = traceKitWindowOnError;
8182 _onErrorHandlerInstalled = true;
8183 }
8184
8185 function uninstallGlobalHandler() {
8186 if (!_onErrorHandlerInstalled) {
8187 return;
8188 }
8189 _window.onerror = _oldOnerrorHandler;
8190 _onErrorHandlerInstalled = false;
8191 _oldOnerrorHandler = undefined;
8192 }
8193
8194 function processLastException() {
8195 var _lastExceptionStack = lastExceptionStack,
8196 _lastArgs = lastArgs;
8197 lastArgs = null;
8198 lastExceptionStack = null;
8199 lastException = null;
8200 notifyHandlers.apply(null, [_lastExceptionStack, false].concat(_lastArgs));
8201 }
8202
8203 /**
8204 * Reports an unhandled Error to TraceKit.
8205 * @param {Error} ex
8206 * @param {?boolean} rethrow If false, do not re-throw the exception.
8207 * Only used for window.onerror to not cause an infinite loop of
8208 * rethrowing.
8209 */
8210 function report(ex, rethrow) {
8211 var args = _slice.call(arguments, 1);
8212 if (lastExceptionStack) {
8213 if (lastException === ex) {
8214 return; // already caught by an inner catch block, ignore
8215 } else {
8216 processLastException();
8217 }
8218 }
8219
8220 var stack = TraceKit.computeStackTrace(ex);
8221 lastExceptionStack = stack;
8222 lastException = ex;
8223 lastArgs = args;
8224
8225 // If the stack trace is incomplete, wait for 2 seconds for
8226 // slow slow IE to see if onerror occurs or not before reporting
8227 // this exception; otherwise, we will end up with an incomplete
8228 // stack trace
8229 setTimeout(function() {
8230 if (lastException === ex) {
8231 processLastException();
8232 }
8233 }, stack.incomplete ? 2000 : 0);
8234
8235 if (rethrow !== false) {
8236 throw ex; // re-throw to propagate to the top level (and cause window.onerror)
8237 }
8238 }
8239
8240 report.subscribe = subscribe;
8241 report.unsubscribe = unsubscribe;
8242 report.uninstall = unsubscribeAll;
8243 return report;
8244 })();
8245
8246 /**
8247 * TraceKit.computeStackTrace: cross-browser stack traces in JavaScript
8248 *
8249 * Syntax:
8250 * s = TraceKit.computeStackTrace(exception) // consider using TraceKit.report instead (see below)
8251 * Returns:
8252 * s.name - exception name
8253 * s.message - exception message
8254 * s.stack[i].url - JavaScript or HTML file URL
8255 * s.stack[i].func - function name, or empty for anonymous functions (if guessing did not work)
8256 * s.stack[i].args - arguments passed to the function, if known
8257 * s.stack[i].line - line number, if known
8258 * s.stack[i].column - column number, if known
8259 *
8260 * Supports:
8261 * - Firefox: full stack trace with line numbers and unreliable column
8262 * number on top frame
8263 * - Opera 10: full stack trace with line and column numbers
8264 * - Opera 9-: full stack trace with line numbers
8265 * - Chrome: full stack trace with line and column numbers
8266 * - Safari: line and column number for the topmost stacktrace element
8267 * only
8268 * - IE: no line numbers whatsoever
8269 *
8270 * Tries to guess names of anonymous functions by looking for assignments
8271 * in the source code. In IE and Safari, we have to guess source file names
8272 * by searching for function bodies inside all page scripts. This will not
8273 * work for scripts that are loaded cross-domain.
8274 * Here be dragons: some function names may be guessed incorrectly, and
8275 * duplicate functions may be mismatched.
8276 *
8277 * TraceKit.computeStackTrace should only be used for tracing purposes.
8278 * Logging of unhandled exceptions should be done with TraceKit.report,
8279 * which builds on top of TraceKit.computeStackTrace and provides better
8280 * IE support by utilizing the window.onerror event to retrieve information
8281 * about the top of the stack.
8282 *
8283 * Note: In IE and Safari, no stack trace is recorded on the Error object,
8284 * so computeStackTrace instead walks its *own* chain of callers.
8285 * This means that:
8286 * * in Safari, some methods may be missing from the stack trace;
8287 * * in IE, the topmost function in the stack trace will always be the
8288 * caller of computeStackTrace.
8289 *
8290 * This is okay for tracing (because you are likely to be calling
8291 * computeStackTrace from the function you want to be the topmost element
8292 * of the stack trace anyway), but not okay for logging unhandled
8293 * exceptions (because your catch block will likely be far away from the
8294 * inner function that actually caused the exception).
8295 *
8296 */
8297 TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
8298 // Contents of Exception in various browsers.
8299 //
8300 // SAFARI:
8301 // ex.message = Can't find variable: qq
8302 // ex.line = 59
8303 // ex.sourceId = 580238192
8304 // ex.sourceURL = http://...
8305 // ex.expressionBeginOffset = 96
8306 // ex.expressionCaretOffset = 98
8307 // ex.expressionEndOffset = 98
8308 // ex.name = ReferenceError
8309 //
8310 // FIREFOX:
8311 // ex.message = qq is not defined
8312 // ex.fileName = http://...
8313 // ex.lineNumber = 59
8314 // ex.columnNumber = 69
8315 // ex.stack = ...stack trace... (see the example below)
8316 // ex.name = ReferenceError
8317 //
8318 // CHROME:
8319 // ex.message = qq is not defined
8320 // ex.name = ReferenceError
8321 // ex.type = not_defined
8322 // ex.arguments = ['aa']
8323 // ex.stack = ...stack trace...
8324 //
8325 // INTERNET EXPLORER:
8326 // ex.message = ...
8327 // ex.name = ReferenceError
8328 //
8329 // OPERA:
8330 // ex.message = ...message... (see the example below)
8331 // ex.name = ReferenceError
8332 // ex.opera#sourceloc = 11 (pretty much useless, duplicates the info in ex.message)
8333 // ex.stacktrace = n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace'
8334
8335 /**
8336 * Computes stack trace information from the stack property.
8337 * Chrome and Gecko use this property.
8338 * @param {Error} ex
8339 * @return {?Object.<string, *>} Stack trace information.
8340 */
8341 function computeStackTraceFromStackProp(ex) {
8342 if (typeof ex.stack === 'undefined' || !ex.stack) return;
8343
8344 var chrome = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|[a-z]:|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,
8345 gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,
8346 winjs = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,
8347 // Used to additionally parse URL/line/column from eval frames
8348 geckoEval = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i,
8349 chromeEval = /\((\S*)(?::(\d+))(?::(\d+))\)/,
8350 lines = ex.stack.split('\n'),
8351 stack = [],
8352 submatch,
8353 parts,
8354 element,
8355 reference = /^(.*) is undefined$/.exec(ex.message);
8356
8357 for (var i = 0, j = lines.length; i < j; ++i) {
8358 if ((parts = chrome.exec(lines[i]))) {
8359 var isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line
8360 var isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line
8361 if (isEval && (submatch = chromeEval.exec(parts[2]))) {
8362 // throw out eval line/column and use top-most line/column number
8363 parts[2] = submatch[1]; // url
8364 parts[3] = submatch[2]; // line
8365 parts[4] = submatch[3]; // column
8366 }
8367 element = {
8368 url: !isNative ? parts[2] : null,
8369 func: parts[1] || UNKNOWN_FUNCTION,
8370 args: isNative ? [parts[2]] : [],
8371 line: parts[3] ? +parts[3] : null,
8372 column: parts[4] ? +parts[4] : null
8373 };
8374 } else if ((parts = winjs.exec(lines[i]))) {
8375 element = {
8376 url: parts[2],
8377 func: parts[1] || UNKNOWN_FUNCTION,
8378 args: [],
8379 line: +parts[3],
8380 column: parts[4] ? +parts[4] : null
8381 };
8382 } else if ((parts = gecko.exec(lines[i]))) {
8383 var isEval = parts[3] && parts[3].indexOf(' > eval') > -1;
8384 if (isEval && (submatch = geckoEval.exec(parts[3]))) {
8385 // throw out eval line/column and use top-most line number
8386 parts[3] = submatch[1];
8387 parts[4] = submatch[2];
8388 parts[5] = null; // no column when eval
8389 } else if (i === 0 && !parts[5] && typeof ex.columnNumber !== 'undefined') {
8390 // FireFox uses this awesome columnNumber property for its top frame
8391 // Also note, Firefox's column number is 0-based and everything else expects 1-based,
8392 // so adding 1
8393 // NOTE: this hack doesn't work if top-most frame is eval
8394 stack[0].column = ex.columnNumber + 1;
8395 }
8396 element = {
8397 url: parts[3],
8398 func: parts[1] || UNKNOWN_FUNCTION,
8399 args: parts[2] ? parts[2].split(',') : [],
8400 line: parts[4] ? +parts[4] : null,
8401 column: parts[5] ? +parts[5] : null
8402 };
8403 } else {
8404 continue;
8405 }
8406
8407 if (!element.func && element.line) {
8408 element.func = UNKNOWN_FUNCTION;
8409 }
8410
8411 stack.push(element);
8412 }
8413
8414 if (!stack.length) {
8415 return null;
8416 }
8417
8418 return {
8419 name: ex.name,
8420 message: ex.message,
8421 url: getLocationHref(),
8422 stack: stack
8423 };
8424 }
8425
8426 /**
8427 * Adds information about the first frame to incomplete stack traces.
8428 * Safari and IE require this to get complete data on the first frame.
8429 * @param {Object.<string, *>} stackInfo Stack trace information from
8430 * one of the compute* methods.
8431 * @param {string} url The URL of the script that caused an error.
8432 * @param {(number|string)} lineNo The line number of the script that
8433 * caused an error.
8434 * @param {string=} message The error generated by the browser, which
8435 * hopefully contains the name of the object that caused the error.
8436 * @return {boolean} Whether or not the stack information was
8437 * augmented.
8438 */
8439 function augmentStackTraceWithInitialElement(stackInfo, url, lineNo, message) {
8440 var initial = {
8441 url: url,
8442 line: lineNo
8443 };
8444
8445 if (initial.url && initial.line) {
8446 stackInfo.incomplete = false;
8447
8448 if (!initial.func) {
8449 initial.func = UNKNOWN_FUNCTION;
8450 }
8451
8452 if (stackInfo.stack.length > 0) {
8453 if (stackInfo.stack[0].url === initial.url) {
8454 if (stackInfo.stack[0].line === initial.line) {
8455 return false; // already in stack trace
8456 } else if (
8457 !stackInfo.stack[0].line &&
8458 stackInfo.stack[0].func === initial.func
8459 ) {
8460 stackInfo.stack[0].line = initial.line;
8461 return false;
8462 }
8463 }
8464 }
8465
8466 stackInfo.stack.unshift(initial);
8467 stackInfo.partial = true;
8468 return true;
8469 } else {
8470 stackInfo.incomplete = true;
8471 }
8472
8473 return false;
8474 }
8475
8476 /**
8477 * Computes stack trace information by walking the arguments.caller
8478 * chain at the time the exception occurred. This will cause earlier
8479 * frames to be missed but is the only way to get any stack trace in
8480 * Safari and IE. The top frame is restored by
8481 * {@link augmentStackTraceWithInitialElement}.
8482 * @param {Error} ex
8483 * @return {?Object.<string, *>} Stack trace information.
8484 */
8485 function computeStackTraceByWalkingCallerChain(ex, depth) {
8486 var functionName = /function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,
8487 stack = [],
8488 funcs = {},
8489 recursion = false,
8490 parts,
8491 item,
8492 source;
8493
8494 for (
8495 var curr = computeStackTraceByWalkingCallerChain.caller;
8496 curr && !recursion;
8497 curr = curr.caller
8498 ) {
8499 if (curr === computeStackTrace || curr === TraceKit.report) {
8500 // console.log('skipping internal function');
8501 continue;
8502 }
8503
8504 item = {
8505 url: null,
8506 func: UNKNOWN_FUNCTION,
8507 line: null,
8508 column: null
8509 };
8510
8511 if (curr.name) {
8512 item.func = curr.name;
8513 } else if ((parts = functionName.exec(curr.toString()))) {
8514 item.func = parts[1];
8515 }
8516
8517 if (typeof item.func === 'undefined') {
8518 try {
8519 item.func = parts.input.substring(0, parts.input.indexOf('{'));
8520 } catch (e) {}
8521 }
8522
8523 if (funcs['' + curr]) {
8524 recursion = true;
8525 } else {
8526 funcs['' + curr] = true;
8527 }
8528
8529 stack.push(item);
8530 }
8531
8532 if (depth) {
8533 // console.log('depth is ' + depth);
8534 // console.log('stack is ' + stack.length);
8535 stack.splice(0, depth);
8536 }
8537
8538 var result = {
8539 name: ex.name,
8540 message: ex.message,
8541 url: getLocationHref(),
8542 stack: stack
8543 };
8544 augmentStackTraceWithInitialElement(
8545 result,
8546 ex.sourceURL || ex.fileName,
8547 ex.line || ex.lineNumber,
8548 ex.message || ex.description
8549 );
8550 return result;
8551 }
8552
8553 /**
8554 * Computes a stack trace for an exception.
8555 * @param {Error} ex
8556 * @param {(string|number)=} depth
8557 */
8558 function computeStackTrace(ex, depth) {
8559 var stack = null;
8560 depth = depth == null ? 0 : +depth;
8561
8562 try {
8563 stack = computeStackTraceFromStackProp(ex);
8564 if (stack) {
8565 return stack;
8566 }
8567 } catch (e) {
8568 if (TraceKit.debug) {
8569 throw e;
8570 }
8571 }
8572
8573 try {
8574 stack = computeStackTraceByWalkingCallerChain(ex, depth + 1);
8575 if (stack) {
8576 return stack;
8577 }
8578 } catch (e) {
8579 if (TraceKit.debug) {
8580 throw e;
8581 }
8582 }
8583 return {
8584 name: ex.name,
8585 message: ex.message,
8586 url: getLocationHref()
8587 };
8588 }
8589
8590 computeStackTrace.augmentStackTraceWithInitialElement = augmentStackTraceWithInitialElement;
8591 computeStackTrace.computeStackTraceFromStackProp = computeStackTraceFromStackProp;
8592
8593 return computeStackTrace;
8594 })();
8595
8596 module.exports = TraceKit;
8597
8598
8599 /***/ }),
8600
8601 /***/ "./node_modules/raven-js/vendor/json-stringify-safe/stringify.js":
8602 /*!***********************************************************************!*\
8603 !*** ./node_modules/raven-js/vendor/json-stringify-safe/stringify.js ***!
8604 \***********************************************************************/
8605 /***/ ((module, exports) => {
8606
8607 /*
8608 json-stringify-safe
8609 Like JSON.stringify, but doesn't throw on circular references.
8610
8611 Originally forked from https://github.com/isaacs/json-stringify-safe
8612 version 5.0.1 on 3/8/2017 and modified to handle Errors serialization
8613 and IE8 compatibility. Tests for this are in test/vendor.
8614
8615 ISC license: https://github.com/isaacs/json-stringify-safe/blob/master/LICENSE
8616 */
8617
8618 exports = module.exports = stringify;
8619 exports.getSerialize = serializer;
8620
8621 function indexOf(haystack, needle) {
8622 for (var i = 0; i < haystack.length; ++i) {
8623 if (haystack[i] === needle) return i;
8624 }
8625 return -1;
8626 }
8627
8628 function stringify(obj, replacer, spaces, cycleReplacer) {
8629 return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces);
8630 }
8631
8632 // https://github.com/ftlabs/js-abbreviate/blob/fa709e5f139e7770a71827b1893f22418097fbda/index.js#L95-L106
8633 function stringifyError(value) {
8634 var err = {
8635 // These properties are implemented as magical getters and don't show up in for in
8636 stack: value.stack,
8637 message: value.message,
8638 name: value.name
8639 };
8640
8641 for (var i in value) {
8642 if (Object.prototype.hasOwnProperty.call(value, i)) {
8643 err[i] = value[i];
8644 }
8645 }
8646
8647 return err;
8648 }
8649
8650 function serializer(replacer, cycleReplacer) {
8651 var stack = [];
8652 var keys = [];
8653
8654 if (cycleReplacer == null) {
8655 cycleReplacer = function(key, value) {
8656 if (stack[0] === value) {
8657 return '[Circular ~]';
8658 }
8659 return '[Circular ~.' + keys.slice(0, indexOf(stack, value)).join('.') + ']';
8660 };
8661 }
8662
8663 return function(key, value) {
8664 if (stack.length > 0) {
8665 var thisPos = indexOf(stack, this);
8666 ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);
8667 ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);
8668
8669 if (~indexOf(stack, value)) {
8670 value = cycleReplacer.call(this, key, value);
8671 }
8672 } else {
8673 stack.push(value);
8674 }
8675
8676 return replacer == null
8677 ? value instanceof Error ? stringifyError(value) : value
8678 : replacer.call(this, key, value);
8679 };
8680 }
8681
8682
8683 /***/ }),
8684
8685 /***/ "./node_modules/react-is/cjs/react-is.development.js":
8686 /*!***********************************************************!*\
8687 !*** ./node_modules/react-is/cjs/react-is.development.js ***!
8688 \***********************************************************/
8689 /***/ ((__unused_webpack_module, exports) => {
8690
8691 "use strict";
8692 /** @license React v16.13.1
8693 * react-is.development.js
8694 *
8695 * Copyright (c) Facebook, Inc. and its affiliates.
8696 *
8697 * This source code is licensed under the MIT license found in the
8698 * LICENSE file in the root directory of this source tree.
8699 */
8700
8701
8702
8703
8704
8705 if (true) {
8706 (function() {
8707 'use strict';
8708
8709 // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
8710 // nor polyfill, then a plain number is used for performance.
8711 var hasSymbol = typeof Symbol === 'function' && Symbol.for;
8712 var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
8713 var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
8714 var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
8715 var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
8716 var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
8717 var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
8718 var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
8719 // (unstable) APIs that have been removed. Can we remove the symbols?
8720
8721 var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
8722 var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
8723 var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
8724 var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
8725 var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
8726 var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
8727 var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
8728 var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
8729 var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
8730 var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
8731 var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
8732
8733 function isValidElementType(type) {
8734 return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
8735 type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
8736 }
8737
8738 function typeOf(object) {
8739 if (typeof object === 'object' && object !== null) {
8740 var $$typeof = object.$$typeof;
8741
8742 switch ($$typeof) {
8743 case REACT_ELEMENT_TYPE:
8744 var type = object.type;
8745
8746 switch (type) {
8747 case REACT_ASYNC_MODE_TYPE:
8748 case REACT_CONCURRENT_MODE_TYPE:
8749 case REACT_FRAGMENT_TYPE:
8750 case REACT_PROFILER_TYPE:
8751 case REACT_STRICT_MODE_TYPE:
8752 case REACT_SUSPENSE_TYPE:
8753 return type;
8754
8755 default:
8756 var $$typeofType = type && type.$$typeof;
8757
8758 switch ($$typeofType) {
8759 case REACT_CONTEXT_TYPE:
8760 case REACT_FORWARD_REF_TYPE:
8761 case REACT_LAZY_TYPE:
8762 case REACT_MEMO_TYPE:
8763 case REACT_PROVIDER_TYPE:
8764 return $$typeofType;
8765
8766 default:
8767 return $$typeof;
8768 }
8769
8770 }
8771
8772 case REACT_PORTAL_TYPE:
8773 return $$typeof;
8774 }
8775 }
8776
8777 return undefined;
8778 } // AsyncMode is deprecated along with isAsyncMode
8779
8780 var AsyncMode = REACT_ASYNC_MODE_TYPE;
8781 var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
8782 var ContextConsumer = REACT_CONTEXT_TYPE;
8783 var ContextProvider = REACT_PROVIDER_TYPE;
8784 var Element = REACT_ELEMENT_TYPE;
8785 var ForwardRef = REACT_FORWARD_REF_TYPE;
8786 var Fragment = REACT_FRAGMENT_TYPE;
8787 var Lazy = REACT_LAZY_TYPE;
8788 var Memo = REACT_MEMO_TYPE;
8789 var Portal = REACT_PORTAL_TYPE;
8790 var Profiler = REACT_PROFILER_TYPE;
8791 var StrictMode = REACT_STRICT_MODE_TYPE;
8792 var Suspense = REACT_SUSPENSE_TYPE;
8793 var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
8794
8795 function isAsyncMode(object) {
8796 {
8797 if (!hasWarnedAboutDeprecatedIsAsyncMode) {
8798 hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
8799
8800 console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
8801 }
8802 }
8803
8804 return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
8805 }
8806 function isConcurrentMode(object) {
8807 return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
8808 }
8809 function isContextConsumer(object) {
8810 return typeOf(object) === REACT_CONTEXT_TYPE;
8811 }
8812 function isContextProvider(object) {
8813 return typeOf(object) === REACT_PROVIDER_TYPE;
8814 }
8815 function isElement(object) {
8816 return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
8817 }
8818 function isForwardRef(object) {
8819 return typeOf(object) === REACT_FORWARD_REF_TYPE;
8820 }
8821 function isFragment(object) {
8822 return typeOf(object) === REACT_FRAGMENT_TYPE;
8823 }
8824 function isLazy(object) {
8825 return typeOf(object) === REACT_LAZY_TYPE;
8826 }
8827 function isMemo(object) {
8828 return typeOf(object) === REACT_MEMO_TYPE;
8829 }
8830 function isPortal(object) {
8831 return typeOf(object) === REACT_PORTAL_TYPE;
8832 }
8833 function isProfiler(object) {
8834 return typeOf(object) === REACT_PROFILER_TYPE;
8835 }
8836 function isStrictMode(object) {
8837 return typeOf(object) === REACT_STRICT_MODE_TYPE;
8838 }
8839 function isSuspense(object) {
8840 return typeOf(object) === REACT_SUSPENSE_TYPE;
8841 }
8842
8843 exports.AsyncMode = AsyncMode;
8844 exports.ConcurrentMode = ConcurrentMode;
8845 exports.ContextConsumer = ContextConsumer;
8846 exports.ContextProvider = ContextProvider;
8847 exports.Element = Element;
8848 exports.ForwardRef = ForwardRef;
8849 exports.Fragment = Fragment;
8850 exports.Lazy = Lazy;
8851 exports.Memo = Memo;
8852 exports.Portal = Portal;
8853 exports.Profiler = Profiler;
8854 exports.StrictMode = StrictMode;
8855 exports.Suspense = Suspense;
8856 exports.isAsyncMode = isAsyncMode;
8857 exports.isConcurrentMode = isConcurrentMode;
8858 exports.isContextConsumer = isContextConsumer;
8859 exports.isContextProvider = isContextProvider;
8860 exports.isElement = isElement;
8861 exports.isForwardRef = isForwardRef;
8862 exports.isFragment = isFragment;
8863 exports.isLazy = isLazy;
8864 exports.isMemo = isMemo;
8865 exports.isPortal = isPortal;
8866 exports.isProfiler = isProfiler;
8867 exports.isStrictMode = isStrictMode;
8868 exports.isSuspense = isSuspense;
8869 exports.isValidElementType = isValidElementType;
8870 exports.typeOf = typeOf;
8871 })();
8872 }
8873
8874
8875 /***/ }),
8876
8877 /***/ "./node_modules/react-is/index.js":
8878 /*!****************************************!*\
8879 !*** ./node_modules/react-is/index.js ***!
8880 \****************************************/
8881 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8882
8883 "use strict";
8884
8885
8886 if (false) {} else {
8887 module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "./node_modules/react-is/cjs/react-is.development.js");
8888 }
8889
8890
8891 /***/ }),
8892
8893 /***/ "./node_modules/react/cjs/react-jsx-runtime.development.js":
8894 /*!*****************************************************************!*\
8895 !*** ./node_modules/react/cjs/react-jsx-runtime.development.js ***!
8896 \*****************************************************************/
8897 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8898
8899 "use strict";
8900 /** @license React v17.0.2
8901 * react-jsx-runtime.development.js
8902 *
8903 * Copyright (c) Facebook, Inc. and its affiliates.
8904 *
8905 * This source code is licensed under the MIT license found in the
8906 * LICENSE file in the root directory of this source tree.
8907 */
8908
8909
8910
8911 if (true) {
8912 (function() {
8913 'use strict';
8914
8915 var React = __webpack_require__(/*! react */ "react");
8916 var _assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js");
8917
8918 // ATTENTION
8919 // When adding new symbols to this file,
8920 // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
8921 // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
8922 // nor polyfill, then a plain number is used for performance.
8923 var REACT_ELEMENT_TYPE = 0xeac7;
8924 var REACT_PORTAL_TYPE = 0xeaca;
8925 exports.Fragment = 0xeacb;
8926 var REACT_STRICT_MODE_TYPE = 0xeacc;
8927 var REACT_PROFILER_TYPE = 0xead2;
8928 var REACT_PROVIDER_TYPE = 0xeacd;
8929 var REACT_CONTEXT_TYPE = 0xeace;
8930 var REACT_FORWARD_REF_TYPE = 0xead0;
8931 var REACT_SUSPENSE_TYPE = 0xead1;
8932 var REACT_SUSPENSE_LIST_TYPE = 0xead8;
8933 var REACT_MEMO_TYPE = 0xead3;
8934 var REACT_LAZY_TYPE = 0xead4;
8935 var REACT_BLOCK_TYPE = 0xead9;
8936 var REACT_SERVER_BLOCK_TYPE = 0xeada;
8937 var REACT_FUNDAMENTAL_TYPE = 0xead5;
8938 var REACT_SCOPE_TYPE = 0xead7;
8939 var REACT_OPAQUE_ID_TYPE = 0xeae0;
8940 var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
8941 var REACT_OFFSCREEN_TYPE = 0xeae2;
8942 var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
8943
8944 if (typeof Symbol === 'function' && Symbol.for) {
8945 var symbolFor = Symbol.for;
8946 REACT_ELEMENT_TYPE = symbolFor('react.element');
8947 REACT_PORTAL_TYPE = symbolFor('react.portal');
8948 exports.Fragment = symbolFor('react.fragment');
8949 REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');
8950 REACT_PROFILER_TYPE = symbolFor('react.profiler');
8951 REACT_PROVIDER_TYPE = symbolFor('react.provider');
8952 REACT_CONTEXT_TYPE = symbolFor('react.context');
8953 REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
8954 REACT_SUSPENSE_TYPE = symbolFor('react.suspense');
8955 REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
8956 REACT_MEMO_TYPE = symbolFor('react.memo');
8957 REACT_LAZY_TYPE = symbolFor('react.lazy');
8958 REACT_BLOCK_TYPE = symbolFor('react.block');
8959 REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
8960 REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
8961 REACT_SCOPE_TYPE = symbolFor('react.scope');
8962 REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');
8963 REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
8964 REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');
8965 REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
8966 }
8967
8968 var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
8969 var FAUX_ITERATOR_SYMBOL = '@@iterator';
8970 function getIteratorFn(maybeIterable) {
8971 if (maybeIterable === null || typeof maybeIterable !== 'object') {
8972 return null;
8973 }
8974
8975 var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
8976
8977 if (typeof maybeIterator === 'function') {
8978 return maybeIterator;
8979 }
8980
8981 return null;
8982 }
8983
8984 var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
8985
8986 function error(format) {
8987 {
8988 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
8989 args[_key2 - 1] = arguments[_key2];
8990 }
8991
8992 printWarning('error', format, args);
8993 }
8994 }
8995
8996 function printWarning(level, format, args) {
8997 // When changing this logic, you might want to also
8998 // update consoleWithStackDev.www.js as well.
8999 {
9000 var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
9001 var stack = ReactDebugCurrentFrame.getStackAddendum();
9002
9003 if (stack !== '') {
9004 format += '%s';
9005 args = args.concat([stack]);
9006 }
9007
9008 var argsWithFormat = args.map(function (item) {
9009 return '' + item;
9010 }); // Careful: RN currently depends on this prefix
9011
9012 argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
9013 // breaks IE9: https://github.com/facebook/react/issues/13610
9014 // eslint-disable-next-line react-internal/no-production-logging
9015
9016 Function.prototype.apply.call(console[level], console, argsWithFormat);
9017 }
9018 }
9019
9020 // Filter certain DOM attributes (e.g. src, href) if their values are empty strings.
9021
9022 var enableScopeAPI = false; // Experimental Create Event Handle API.
9023
9024 function isValidElementType(type) {
9025 if (typeof type === 'string' || typeof type === 'function') {
9026 return true;
9027 } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
9028
9029
9030 if (type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) {
9031 return true;
9032 }
9033
9034 if (typeof type === 'object' && type !== null) {
9035 if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
9036 return true;
9037 }
9038 }
9039
9040 return false;
9041 }
9042
9043 function getWrappedName(outerType, innerType, wrapperName) {
9044 var functionName = innerType.displayName || innerType.name || '';
9045 return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
9046 }
9047
9048 function getContextName(type) {
9049 return type.displayName || 'Context';
9050 }
9051
9052 function getComponentName(type) {
9053 if (type == null) {
9054 // Host root, text node or just invalid type.
9055 return null;
9056 }
9057
9058 {
9059 if (typeof type.tag === 'number') {
9060 error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
9061 }
9062 }
9063
9064 if (typeof type === 'function') {
9065 return type.displayName || type.name || null;
9066 }
9067
9068 if (typeof type === 'string') {
9069 return type;
9070 }
9071
9072 switch (type) {
9073 case exports.Fragment:
9074 return 'Fragment';
9075
9076 case REACT_PORTAL_TYPE:
9077 return 'Portal';
9078
9079 case REACT_PROFILER_TYPE:
9080 return 'Profiler';
9081
9082 case REACT_STRICT_MODE_TYPE:
9083 return 'StrictMode';
9084
9085 case REACT_SUSPENSE_TYPE:
9086 return 'Suspense';
9087
9088 case REACT_SUSPENSE_LIST_TYPE:
9089 return 'SuspenseList';
9090 }
9091
9092 if (typeof type === 'object') {
9093 switch (type.$$typeof) {
9094 case REACT_CONTEXT_TYPE:
9095 var context = type;
9096 return getContextName(context) + '.Consumer';
9097
9098 case REACT_PROVIDER_TYPE:
9099 var provider = type;
9100 return getContextName(provider._context) + '.Provider';
9101
9102 case REACT_FORWARD_REF_TYPE:
9103 return getWrappedName(type, type.render, 'ForwardRef');
9104
9105 case REACT_MEMO_TYPE:
9106 return getComponentName(type.type);
9107
9108 case REACT_BLOCK_TYPE:
9109 return getComponentName(type._render);
9110
9111 case REACT_LAZY_TYPE:
9112 {
9113 var lazyComponent = type;
9114 var payload = lazyComponent._payload;
9115 var init = lazyComponent._init;
9116
9117 try {
9118 return getComponentName(init(payload));
9119 } catch (x) {
9120 return null;
9121 }
9122 }
9123 }
9124 }
9125
9126 return null;
9127 }
9128
9129 // Helpers to patch console.logs to avoid logging during side-effect free
9130 // replaying on render function. This currently only patches the object
9131 // lazily which won't cover if the log function was extracted eagerly.
9132 // We could also eagerly patch the method.
9133 var disabledDepth = 0;
9134 var prevLog;
9135 var prevInfo;
9136 var prevWarn;
9137 var prevError;
9138 var prevGroup;
9139 var prevGroupCollapsed;
9140 var prevGroupEnd;
9141
9142 function disabledLog() {}
9143
9144 disabledLog.__reactDisabledLog = true;
9145 function disableLogs() {
9146 {
9147 if (disabledDepth === 0) {
9148 /* eslint-disable react-internal/no-production-logging */
9149 prevLog = console.log;
9150 prevInfo = console.info;
9151 prevWarn = console.warn;
9152 prevError = console.error;
9153 prevGroup = console.group;
9154 prevGroupCollapsed = console.groupCollapsed;
9155 prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
9156
9157 var props = {
9158 configurable: true,
9159 enumerable: true,
9160 value: disabledLog,
9161 writable: true
9162 }; // $FlowFixMe Flow thinks console is immutable.
9163
9164 Object.defineProperties(console, {
9165 info: props,
9166 log: props,
9167 warn: props,
9168 error: props,
9169 group: props,
9170 groupCollapsed: props,
9171 groupEnd: props
9172 });
9173 /* eslint-enable react-internal/no-production-logging */
9174 }
9175
9176 disabledDepth++;
9177 }
9178 }
9179 function reenableLogs() {
9180 {
9181 disabledDepth--;
9182
9183 if (disabledDepth === 0) {
9184 /* eslint-disable react-internal/no-production-logging */
9185 var props = {
9186 configurable: true,
9187 enumerable: true,
9188 writable: true
9189 }; // $FlowFixMe Flow thinks console is immutable.
9190
9191 Object.defineProperties(console, {
9192 log: _assign({}, props, {
9193 value: prevLog
9194 }),
9195 info: _assign({}, props, {
9196 value: prevInfo
9197 }),
9198 warn: _assign({}, props, {
9199 value: prevWarn
9200 }),
9201 error: _assign({}, props, {
9202 value: prevError
9203 }),
9204 group: _assign({}, props, {
9205 value: prevGroup
9206 }),
9207 groupCollapsed: _assign({}, props, {
9208 value: prevGroupCollapsed
9209 }),
9210 groupEnd: _assign({}, props, {
9211 value: prevGroupEnd
9212 })
9213 });
9214 /* eslint-enable react-internal/no-production-logging */
9215 }
9216
9217 if (disabledDepth < 0) {
9218 error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
9219 }
9220 }
9221 }
9222
9223 var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
9224 var prefix;
9225 function describeBuiltInComponentFrame(name, source, ownerFn) {
9226 {
9227 if (prefix === undefined) {
9228 // Extract the VM specific prefix used by each line.
9229 try {
9230 throw Error();
9231 } catch (x) {
9232 var match = x.stack.trim().match(/\n( *(at )?)/);
9233 prefix = match && match[1] || '';
9234 }
9235 } // We use the prefix to ensure our stacks line up with native stack frames.
9236
9237
9238 return '\n' + prefix + name;
9239 }
9240 }
9241 var reentry = false;
9242 var componentFrameCache;
9243
9244 {
9245 var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
9246 componentFrameCache = new PossiblyWeakMap();
9247 }
9248
9249 function describeNativeComponentFrame(fn, construct) {
9250 // If something asked for a stack inside a fake render, it should get ignored.
9251 if (!fn || reentry) {
9252 return '';
9253 }
9254
9255 {
9256 var frame = componentFrameCache.get(fn);
9257
9258 if (frame !== undefined) {
9259 return frame;
9260 }
9261 }
9262
9263 var control;
9264 reentry = true;
9265 var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
9266
9267 Error.prepareStackTrace = undefined;
9268 var previousDispatcher;
9269
9270 {
9271 previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
9272 // for warnings.
9273
9274 ReactCurrentDispatcher.current = null;
9275 disableLogs();
9276 }
9277
9278 try {
9279 // This should throw.
9280 if (construct) {
9281 // Something should be setting the props in the constructor.
9282 var Fake = function () {
9283 throw Error();
9284 }; // $FlowFixMe
9285
9286
9287 Object.defineProperty(Fake.prototype, 'props', {
9288 set: function () {
9289 // We use a throwing setter instead of frozen or non-writable props
9290 // because that won't throw in a non-strict mode function.
9291 throw Error();
9292 }
9293 });
9294
9295 if (typeof Reflect === 'object' && Reflect.construct) {
9296 // We construct a different control for this case to include any extra
9297 // frames added by the construct call.
9298 try {
9299 Reflect.construct(Fake, []);
9300 } catch (x) {
9301 control = x;
9302 }
9303
9304 Reflect.construct(fn, [], Fake);
9305 } else {
9306 try {
9307 Fake.call();
9308 } catch (x) {
9309 control = x;
9310 }
9311
9312 fn.call(Fake.prototype);
9313 }
9314 } else {
9315 try {
9316 throw Error();
9317 } catch (x) {
9318 control = x;
9319 }
9320
9321 fn();
9322 }
9323 } catch (sample) {
9324 // This is inlined manually because closure doesn't do it for us.
9325 if (sample && control && typeof sample.stack === 'string') {
9326 // This extracts the first frame from the sample that isn't also in the control.
9327 // Skipping one frame that we assume is the frame that calls the two.
9328 var sampleLines = sample.stack.split('\n');
9329 var controlLines = control.stack.split('\n');
9330 var s = sampleLines.length - 1;
9331 var c = controlLines.length - 1;
9332
9333 while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
9334 // We expect at least one stack frame to be shared.
9335 // Typically this will be the root most one. However, stack frames may be
9336 // cut off due to maximum stack limits. In this case, one maybe cut off
9337 // earlier than the other. We assume that the sample is longer or the same
9338 // and there for cut off earlier. So we should find the root most frame in
9339 // the sample somewhere in the control.
9340 c--;
9341 }
9342
9343 for (; s >= 1 && c >= 0; s--, c--) {
9344 // Next we find the first one that isn't the same which should be the
9345 // frame that called our sample function and the control.
9346 if (sampleLines[s] !== controlLines[c]) {
9347 // In V8, the first line is describing the message but other VMs don't.
9348 // If we're about to return the first line, and the control is also on the same
9349 // line, that's a pretty good indicator that our sample threw at same line as
9350 // the control. I.e. before we entered the sample frame. So we ignore this result.
9351 // This can happen if you passed a class to function component, or non-function.
9352 if (s !== 1 || c !== 1) {
9353 do {
9354 s--;
9355 c--; // We may still have similar intermediate frames from the construct call.
9356 // The next one that isn't the same should be our match though.
9357
9358 if (c < 0 || sampleLines[s] !== controlLines[c]) {
9359 // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
9360 var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');
9361
9362 {
9363 if (typeof fn === 'function') {
9364 componentFrameCache.set(fn, _frame);
9365 }
9366 } // Return the line we found.
9367
9368
9369 return _frame;
9370 }
9371 } while (s >= 1 && c >= 0);
9372 }
9373
9374 break;
9375 }
9376 }
9377 }
9378 } finally {
9379 reentry = false;
9380
9381 {
9382 ReactCurrentDispatcher.current = previousDispatcher;
9383 reenableLogs();
9384 }
9385
9386 Error.prepareStackTrace = previousPrepareStackTrace;
9387 } // Fallback to just using the name if we couldn't make it throw.
9388
9389
9390 var name = fn ? fn.displayName || fn.name : '';
9391 var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
9392
9393 {
9394 if (typeof fn === 'function') {
9395 componentFrameCache.set(fn, syntheticFrame);
9396 }
9397 }
9398
9399 return syntheticFrame;
9400 }
9401 function describeFunctionComponentFrame(fn, source, ownerFn) {
9402 {
9403 return describeNativeComponentFrame(fn, false);
9404 }
9405 }
9406
9407 function shouldConstruct(Component) {
9408 var prototype = Component.prototype;
9409 return !!(prototype && prototype.isReactComponent);
9410 }
9411
9412 function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
9413
9414 if (type == null) {
9415 return '';
9416 }
9417
9418 if (typeof type === 'function') {
9419 {
9420 return describeNativeComponentFrame(type, shouldConstruct(type));
9421 }
9422 }
9423
9424 if (typeof type === 'string') {
9425 return describeBuiltInComponentFrame(type);
9426 }
9427
9428 switch (type) {
9429 case REACT_SUSPENSE_TYPE:
9430 return describeBuiltInComponentFrame('Suspense');
9431
9432 case REACT_SUSPENSE_LIST_TYPE:
9433 return describeBuiltInComponentFrame('SuspenseList');
9434 }
9435
9436 if (typeof type === 'object') {
9437 switch (type.$$typeof) {
9438 case REACT_FORWARD_REF_TYPE:
9439 return describeFunctionComponentFrame(type.render);
9440
9441 case REACT_MEMO_TYPE:
9442 // Memo may contain any component type so we recursively resolve it.
9443 return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
9444
9445 case REACT_BLOCK_TYPE:
9446 return describeFunctionComponentFrame(type._render);
9447
9448 case REACT_LAZY_TYPE:
9449 {
9450 var lazyComponent = type;
9451 var payload = lazyComponent._payload;
9452 var init = lazyComponent._init;
9453
9454 try {
9455 // Lazy may contain any component type so we recursively resolve it.
9456 return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
9457 } catch (x) {}
9458 }
9459 }
9460 }
9461
9462 return '';
9463 }
9464
9465 var loggedTypeFailures = {};
9466 var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
9467
9468 function setCurrentlyValidatingElement(element) {
9469 {
9470 if (element) {
9471 var owner = element._owner;
9472 var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
9473 ReactDebugCurrentFrame.setExtraStackFrame(stack);
9474 } else {
9475 ReactDebugCurrentFrame.setExtraStackFrame(null);
9476 }
9477 }
9478 }
9479
9480 function checkPropTypes(typeSpecs, values, location, componentName, element) {
9481 {
9482 // $FlowFixMe This is okay but Flow doesn't know it.
9483 var has = Function.call.bind(Object.prototype.hasOwnProperty);
9484
9485 for (var typeSpecName in typeSpecs) {
9486 if (has(typeSpecs, typeSpecName)) {
9487 var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
9488 // fail the render phase where it didn't fail before. So we log it.
9489 // After these have been cleaned up, we'll let them throw.
9490
9491 try {
9492 // This is intentionally an invariant that gets caught. It's the same
9493 // behavior as without this statement except with a better message.
9494 if (typeof typeSpecs[typeSpecName] !== 'function') {
9495 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`.');
9496 err.name = 'Invariant Violation';
9497 throw err;
9498 }
9499
9500 error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
9501 } catch (ex) {
9502 error$1 = ex;
9503 }
9504
9505 if (error$1 && !(error$1 instanceof Error)) {
9506 setCurrentlyValidatingElement(element);
9507
9508 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);
9509
9510 setCurrentlyValidatingElement(null);
9511 }
9512
9513 if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
9514 // Only monitor this failure once because there tends to be a lot of the
9515 // same error.
9516 loggedTypeFailures[error$1.message] = true;
9517 setCurrentlyValidatingElement(element);
9518
9519 error('Failed %s type: %s', location, error$1.message);
9520
9521 setCurrentlyValidatingElement(null);
9522 }
9523 }
9524 }
9525 }
9526 }
9527
9528 var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
9529 var hasOwnProperty = Object.prototype.hasOwnProperty;
9530 var RESERVED_PROPS = {
9531 key: true,
9532 ref: true,
9533 __self: true,
9534 __source: true
9535 };
9536 var specialPropKeyWarningShown;
9537 var specialPropRefWarningShown;
9538 var didWarnAboutStringRefs;
9539
9540 {
9541 didWarnAboutStringRefs = {};
9542 }
9543
9544 function hasValidRef(config) {
9545 {
9546 if (hasOwnProperty.call(config, 'ref')) {
9547 var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
9548
9549 if (getter && getter.isReactWarning) {
9550 return false;
9551 }
9552 }
9553 }
9554
9555 return config.ref !== undefined;
9556 }
9557
9558 function hasValidKey(config) {
9559 {
9560 if (hasOwnProperty.call(config, 'key')) {
9561 var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
9562
9563 if (getter && getter.isReactWarning) {
9564 return false;
9565 }
9566 }
9567 }
9568
9569 return config.key !== undefined;
9570 }
9571
9572 function warnIfStringRefCannotBeAutoConverted(config, self) {
9573 {
9574 if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
9575 var componentName = getComponentName(ReactCurrentOwner.current.type);
9576
9577 if (!didWarnAboutStringRefs[componentName]) {
9578 error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref);
9579
9580 didWarnAboutStringRefs[componentName] = true;
9581 }
9582 }
9583 }
9584 }
9585
9586 function defineKeyPropWarningGetter(props, displayName) {
9587 {
9588 var warnAboutAccessingKey = function () {
9589 if (!specialPropKeyWarningShown) {
9590 specialPropKeyWarningShown = true;
9591
9592 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);
9593 }
9594 };
9595
9596 warnAboutAccessingKey.isReactWarning = true;
9597 Object.defineProperty(props, 'key', {
9598 get: warnAboutAccessingKey,
9599 configurable: true
9600 });
9601 }
9602 }
9603
9604 function defineRefPropWarningGetter(props, displayName) {
9605 {
9606 var warnAboutAccessingRef = function () {
9607 if (!specialPropRefWarningShown) {
9608 specialPropRefWarningShown = true;
9609
9610 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);
9611 }
9612 };
9613
9614 warnAboutAccessingRef.isReactWarning = true;
9615 Object.defineProperty(props, 'ref', {
9616 get: warnAboutAccessingRef,
9617 configurable: true
9618 });
9619 }
9620 }
9621 /**
9622 * Factory method to create a new React element. This no longer adheres to
9623 * the class pattern, so do not use new to call it. Also, instanceof check
9624 * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
9625 * if something is a React Element.
9626 *
9627 * @param {*} type
9628 * @param {*} props
9629 * @param {*} key
9630 * @param {string|object} ref
9631 * @param {*} owner
9632 * @param {*} self A *temporary* helper to detect places where `this` is
9633 * different from the `owner` when React.createElement is called, so that we
9634 * can warn. We want to get rid of owner and replace string `ref`s with arrow
9635 * functions, and as long as `this` and owner are the same, there will be no
9636 * change in behavior.
9637 * @param {*} source An annotation object (added by a transpiler or otherwise)
9638 * indicating filename, line number, and/or other information.
9639 * @internal
9640 */
9641
9642
9643 var ReactElement = function (type, key, ref, self, source, owner, props) {
9644 var element = {
9645 // This tag allows us to uniquely identify this as a React Element
9646 $$typeof: REACT_ELEMENT_TYPE,
9647 // Built-in properties that belong on the element
9648 type: type,
9649 key: key,
9650 ref: ref,
9651 props: props,
9652 // Record the component responsible for creating this element.
9653 _owner: owner
9654 };
9655
9656 {
9657 // The validation flag is currently mutative. We put it on
9658 // an external backing store so that we can freeze the whole object.
9659 // This can be replaced with a WeakMap once they are implemented in
9660 // commonly used development environments.
9661 element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
9662 // the validation flag non-enumerable (where possible, which should
9663 // include every environment we run tests in), so the test framework
9664 // ignores it.
9665
9666 Object.defineProperty(element._store, 'validated', {
9667 configurable: false,
9668 enumerable: false,
9669 writable: true,
9670 value: false
9671 }); // self and source are DEV only properties.
9672
9673 Object.defineProperty(element, '_self', {
9674 configurable: false,
9675 enumerable: false,
9676 writable: false,
9677 value: self
9678 }); // Two elements created in two different places should be considered
9679 // equal for testing purposes and therefore we hide it from enumeration.
9680
9681 Object.defineProperty(element, '_source', {
9682 configurable: false,
9683 enumerable: false,
9684 writable: false,
9685 value: source
9686 });
9687
9688 if (Object.freeze) {
9689 Object.freeze(element.props);
9690 Object.freeze(element);
9691 }
9692 }
9693
9694 return element;
9695 };
9696 /**
9697 * https://github.com/reactjs/rfcs/pull/107
9698 * @param {*} type
9699 * @param {object} props
9700 * @param {string} key
9701 */
9702
9703 function jsxDEV(type, config, maybeKey, source, self) {
9704 {
9705 var propName; // Reserved names are extracted
9706
9707 var props = {};
9708 var key = null;
9709 var ref = null; // Currently, key can be spread in as a prop. This causes a potential
9710 // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
9711 // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
9712 // but as an intermediary step, we will use jsxDEV for everything except
9713 // <div {...props} key="Hi" />, because we aren't currently able to tell if
9714 // key is explicitly declared to be undefined or not.
9715
9716 if (maybeKey !== undefined) {
9717 key = '' + maybeKey;
9718 }
9719
9720 if (hasValidKey(config)) {
9721 key = '' + config.key;
9722 }
9723
9724 if (hasValidRef(config)) {
9725 ref = config.ref;
9726 warnIfStringRefCannotBeAutoConverted(config, self);
9727 } // Remaining properties are added to a new props object
9728
9729
9730 for (propName in config) {
9731 if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
9732 props[propName] = config[propName];
9733 }
9734 } // Resolve default props
9735
9736
9737 if (type && type.defaultProps) {
9738 var defaultProps = type.defaultProps;
9739
9740 for (propName in defaultProps) {
9741 if (props[propName] === undefined) {
9742 props[propName] = defaultProps[propName];
9743 }
9744 }
9745 }
9746
9747 if (key || ref) {
9748 var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
9749
9750 if (key) {
9751 defineKeyPropWarningGetter(props, displayName);
9752 }
9753
9754 if (ref) {
9755 defineRefPropWarningGetter(props, displayName);
9756 }
9757 }
9758
9759 return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
9760 }
9761 }
9762
9763 var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
9764 var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
9765
9766 function setCurrentlyValidatingElement$1(element) {
9767 {
9768 if (element) {
9769 var owner = element._owner;
9770 var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
9771 ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
9772 } else {
9773 ReactDebugCurrentFrame$1.setExtraStackFrame(null);
9774 }
9775 }
9776 }
9777
9778 var propTypesMisspellWarningShown;
9779
9780 {
9781 propTypesMisspellWarningShown = false;
9782 }
9783 /**
9784 * Verifies the object is a ReactElement.
9785 * See https://reactjs.org/docs/react-api.html#isvalidelement
9786 * @param {?object} object
9787 * @return {boolean} True if `object` is a ReactElement.
9788 * @final
9789 */
9790
9791 function isValidElement(object) {
9792 {
9793 return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
9794 }
9795 }
9796
9797 function getDeclarationErrorAddendum() {
9798 {
9799 if (ReactCurrentOwner$1.current) {
9800 var name = getComponentName(ReactCurrentOwner$1.current.type);
9801
9802 if (name) {
9803 return '\n\nCheck the render method of `' + name + '`.';
9804 }
9805 }
9806
9807 return '';
9808 }
9809 }
9810
9811 function getSourceInfoErrorAddendum(source) {
9812 {
9813 if (source !== undefined) {
9814 var fileName = source.fileName.replace(/^.*[\\\/]/, '');
9815 var lineNumber = source.lineNumber;
9816 return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
9817 }
9818
9819 return '';
9820 }
9821 }
9822 /**
9823 * Warn if there's no key explicitly set on dynamic arrays of children or
9824 * object keys are not valid. This allows us to keep track of children between
9825 * updates.
9826 */
9827
9828
9829 var ownerHasKeyUseWarning = {};
9830
9831 function getCurrentComponentErrorInfo(parentType) {
9832 {
9833 var info = getDeclarationErrorAddendum();
9834
9835 if (!info) {
9836 var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
9837
9838 if (parentName) {
9839 info = "\n\nCheck the top-level render call using <" + parentName + ">.";
9840 }
9841 }
9842
9843 return info;
9844 }
9845 }
9846 /**
9847 * Warn if the element doesn't have an explicit key assigned to it.
9848 * This element is in an array. The array could grow and shrink or be
9849 * reordered. All children that haven't already been validated are required to
9850 * have a "key" property assigned to it. Error statuses are cached so a warning
9851 * will only be shown once.
9852 *
9853 * @internal
9854 * @param {ReactElement} element Element that requires a key.
9855 * @param {*} parentType element's parent's type.
9856 */
9857
9858
9859 function validateExplicitKey(element, parentType) {
9860 {
9861 if (!element._store || element._store.validated || element.key != null) {
9862 return;
9863 }
9864
9865 element._store.validated = true;
9866 var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
9867
9868 if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
9869 return;
9870 }
9871
9872 ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
9873 // property, it may be the creator of the child that's responsible for
9874 // assigning it a key.
9875
9876 var childOwner = '';
9877
9878 if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
9879 // Give the component that originally created this child.
9880 childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
9881 }
9882
9883 setCurrentlyValidatingElement$1(element);
9884
9885 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);
9886
9887 setCurrentlyValidatingElement$1(null);
9888 }
9889 }
9890 /**
9891 * Ensure that every element either is passed in a static location, in an
9892 * array with an explicit keys property defined, or in an object literal
9893 * with valid key property.
9894 *
9895 * @internal
9896 * @param {ReactNode} node Statically passed child of any type.
9897 * @param {*} parentType node's parent's type.
9898 */
9899
9900
9901 function validateChildKeys(node, parentType) {
9902 {
9903 if (typeof node !== 'object') {
9904 return;
9905 }
9906
9907 if (Array.isArray(node)) {
9908 for (var i = 0; i < node.length; i++) {
9909 var child = node[i];
9910
9911 if (isValidElement(child)) {
9912 validateExplicitKey(child, parentType);
9913 }
9914 }
9915 } else if (isValidElement(node)) {
9916 // This element was passed in a valid location.
9917 if (node._store) {
9918 node._store.validated = true;
9919 }
9920 } else if (node) {
9921 var iteratorFn = getIteratorFn(node);
9922
9923 if (typeof iteratorFn === 'function') {
9924 // Entry iterators used to provide implicit keys,
9925 // but now we print a separate warning for them later.
9926 if (iteratorFn !== node.entries) {
9927 var iterator = iteratorFn.call(node);
9928 var step;
9929
9930 while (!(step = iterator.next()).done) {
9931 if (isValidElement(step.value)) {
9932 validateExplicitKey(step.value, parentType);
9933 }
9934 }
9935 }
9936 }
9937 }
9938 }
9939 }
9940 /**
9941 * Given an element, validate that its props follow the propTypes definition,
9942 * provided by the type.
9943 *
9944 * @param {ReactElement} element
9945 */
9946
9947
9948 function validatePropTypes(element) {
9949 {
9950 var type = element.type;
9951
9952 if (type === null || type === undefined || typeof type === 'string') {
9953 return;
9954 }
9955
9956 var propTypes;
9957
9958 if (typeof type === 'function') {
9959 propTypes = type.propTypes;
9960 } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
9961 // Inner props are checked in the reconciler.
9962 type.$$typeof === REACT_MEMO_TYPE)) {
9963 propTypes = type.propTypes;
9964 } else {
9965 return;
9966 }
9967
9968 if (propTypes) {
9969 // Intentionally inside to avoid triggering lazy initializers:
9970 var name = getComponentName(type);
9971 checkPropTypes(propTypes, element.props, 'prop', name, element);
9972 } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
9973 propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
9974
9975 var _name = getComponentName(type);
9976
9977 error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
9978 }
9979
9980 if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
9981 error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
9982 }
9983 }
9984 }
9985 /**
9986 * Given a fragment, validate that it can only be provided with fragment props
9987 * @param {ReactElement} fragment
9988 */
9989
9990
9991 function validateFragmentProps(fragment) {
9992 {
9993 var keys = Object.keys(fragment.props);
9994
9995 for (var i = 0; i < keys.length; i++) {
9996 var key = keys[i];
9997
9998 if (key !== 'children' && key !== 'key') {
9999 setCurrentlyValidatingElement$1(fragment);
10000
10001 error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
10002
10003 setCurrentlyValidatingElement$1(null);
10004 break;
10005 }
10006 }
10007
10008 if (fragment.ref !== null) {
10009 setCurrentlyValidatingElement$1(fragment);
10010
10011 error('Invalid attribute `ref` supplied to `React.Fragment`.');
10012
10013 setCurrentlyValidatingElement$1(null);
10014 }
10015 }
10016 }
10017
10018 function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
10019 {
10020 var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
10021 // succeed and there will likely be errors in render.
10022
10023 if (!validType) {
10024 var info = '';
10025
10026 if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
10027 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.";
10028 }
10029
10030 var sourceInfo = getSourceInfoErrorAddendum(source);
10031
10032 if (sourceInfo) {
10033 info += sourceInfo;
10034 } else {
10035 info += getDeclarationErrorAddendum();
10036 }
10037
10038 var typeString;
10039
10040 if (type === null) {
10041 typeString = 'null';
10042 } else if (Array.isArray(type)) {
10043 typeString = 'array';
10044 } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
10045 typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
10046 info = ' Did you accidentally export a JSX literal instead of a component?';
10047 } else {
10048 typeString = typeof type;
10049 }
10050
10051 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);
10052 }
10053
10054 var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
10055 // TODO: Drop this when these are no longer allowed as the type argument.
10056
10057 if (element == null) {
10058 return element;
10059 } // Skip key warning if the type isn't valid since our key validation logic
10060 // doesn't expect a non-string/function type and can throw confusing errors.
10061 // We don't want exception behavior to differ between dev and prod.
10062 // (Rendering will throw with a helpful message and as soon as the type is
10063 // fixed, the key warnings will appear.)
10064
10065
10066 if (validType) {
10067 var children = props.children;
10068
10069 if (children !== undefined) {
10070 if (isStaticChildren) {
10071 if (Array.isArray(children)) {
10072 for (var i = 0; i < children.length; i++) {
10073 validateChildKeys(children[i], type);
10074 }
10075
10076 if (Object.freeze) {
10077 Object.freeze(children);
10078 }
10079 } else {
10080 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.');
10081 }
10082 } else {
10083 validateChildKeys(children, type);
10084 }
10085 }
10086 }
10087
10088 if (type === exports.Fragment) {
10089 validateFragmentProps(element);
10090 } else {
10091 validatePropTypes(element);
10092 }
10093
10094 return element;
10095 }
10096 } // These two functions exist to still get child warnings in dev
10097 // even with the prod transform. This means that jsxDEV is purely
10098 // opt-in behavior for better messages but that we won't stop
10099 // giving you warnings if you use production apis.
10100
10101 function jsxWithValidationStatic(type, props, key) {
10102 {
10103 return jsxWithValidation(type, props, key, true);
10104 }
10105 }
10106 function jsxWithValidationDynamic(type, props, key) {
10107 {
10108 return jsxWithValidation(type, props, key, false);
10109 }
10110 }
10111
10112 var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.
10113 // for now we can ship identical prod functions
10114
10115 var jsxs = jsxWithValidationStatic ;
10116
10117 exports.jsx = jsx;
10118 exports.jsxs = jsxs;
10119 })();
10120 }
10121
10122
10123 /***/ }),
10124
10125 /***/ "./node_modules/react/jsx-runtime.js":
10126 /*!*******************************************!*\
10127 !*** ./node_modules/react/jsx-runtime.js ***!
10128 \*******************************************/
10129 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
10130
10131 "use strict";
10132
10133
10134 if (false) {} else {
10135 module.exports = __webpack_require__(/*! ./cjs/react-jsx-runtime.development.js */ "./node_modules/react/cjs/react-jsx-runtime.development.js");
10136 }
10137
10138
10139 /***/ }),
10140
10141 /***/ "./node_modules/styled-components/dist/styled-components.browser.esm.js":
10142 /*!******************************************************************************!*\
10143 !*** ./node_modules/styled-components/dist/styled-components.browser.esm.js ***!
10144 \******************************************************************************/
10145 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
10146
10147 "use strict";
10148 __webpack_require__.r(__webpack_exports__);
10149 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10150 /* harmony export */ "ServerStyleSheet": () => (/* binding */ ServerStyleSheet),
10151 /* harmony export */ "StyleSheetConsumer": () => (/* binding */ StyleSheetConsumer),
10152 /* harmony export */ "StyleSheetContext": () => (/* binding */ StyleSheetContext),
10153 /* harmony export */ "StyleSheetManager": () => (/* binding */ StyleSheetManager),
10154 /* harmony export */ "ThemeConsumer": () => (/* binding */ ThemeConsumer),
10155 /* harmony export */ "ThemeContext": () => (/* binding */ ThemeContext),
10156 /* harmony export */ "ThemeProvider": () => (/* binding */ ThemeProvider),
10157 /* harmony export */ "__DO_NOT_USE_OR_YOU_WILL_BE_HAUNTED_BY_SPOOKY_GHOSTS": () => (/* binding */ __DO_NOT_USE_OR_YOU_WILL_BE_HAUNTED_BY_SPOOKY_GHOSTS),
10158 /* harmony export */ "createGlobalStyle": () => (/* binding */ createGlobalStyle),
10159 /* harmony export */ "css": () => (/* binding */ css),
10160 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
10161 /* harmony export */ "isStyledComponent": () => (/* binding */ isStyledComponent),
10162 /* harmony export */ "keyframes": () => (/* binding */ keyframes),
10163 /* harmony export */ "withTheme": () => (/* binding */ withTheme)
10164 /* harmony export */ });
10165 /* harmony import */ var stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! stylis/stylis.min */ "./node_modules/stylis/stylis.min.js");
10166 /* harmony import */ var stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0__);
10167 /* harmony import */ var stylis_rule_sheet__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! stylis-rule-sheet */ "./node_modules/stylis-rule-sheet/index.js");
10168 /* harmony import */ var stylis_rule_sheet__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(stylis_rule_sheet__WEBPACK_IMPORTED_MODULE_1__);
10169 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
10170 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
10171 /* harmony import */ var _emotion_unitless__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @emotion/unitless */ "./node_modules/@emotion/unitless/dist/unitless.browser.esm.js");
10172 /* harmony import */ var react_is__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js");
10173 /* harmony import */ var memoize_one__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! memoize-one */ "./node_modules/memoize-one/dist/memoize-one.esm.js");
10174 /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
10175 /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_8__);
10176 /* harmony import */ var _emotion_is_prop_valid__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @emotion/is-prop-valid */ "./node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js");
10177 /* harmony import */ var merge_anything__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! merge-anything */ "./node_modules/merge-anything/dist/index.esm.js");
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188 //
10189
10190 var interleave = (function (strings, interpolations) {
10191 var result = [strings[0]];
10192
10193 for (var i = 0, len = interpolations.length; i < len; i += 1) {
10194 result.push(interpolations[i], strings[i + 1]);
10195 }
10196
10197 return result;
10198 });
10199
10200 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
10201 return typeof obj;
10202 } : function (obj) {
10203 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
10204 };
10205
10206 var classCallCheck = function (instance, Constructor) {
10207 if (!(instance instanceof Constructor)) {
10208 throw new TypeError("Cannot call a class as a function");
10209 }
10210 };
10211
10212 var createClass = function () {
10213 function defineProperties(target, props) {
10214 for (var i = 0; i < props.length; i++) {
10215 var descriptor = props[i];
10216 descriptor.enumerable = descriptor.enumerable || false;
10217 descriptor.configurable = true;
10218 if ("value" in descriptor) descriptor.writable = true;
10219 Object.defineProperty(target, descriptor.key, descriptor);
10220 }
10221 }
10222
10223 return function (Constructor, protoProps, staticProps) {
10224 if (protoProps) defineProperties(Constructor.prototype, protoProps);
10225 if (staticProps) defineProperties(Constructor, staticProps);
10226 return Constructor;
10227 };
10228 }();
10229
10230 var _extends = Object.assign || function (target) {
10231 for (var i = 1; i < arguments.length; i++) {
10232 var source = arguments[i];
10233
10234 for (var key in source) {
10235 if (Object.prototype.hasOwnProperty.call(source, key)) {
10236 target[key] = source[key];
10237 }
10238 }
10239 }
10240
10241 return target;
10242 };
10243
10244 var inherits = function (subClass, superClass) {
10245 if (typeof superClass !== "function" && superClass !== null) {
10246 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
10247 }
10248
10249 subClass.prototype = Object.create(superClass && superClass.prototype, {
10250 constructor: {
10251 value: subClass,
10252 enumerable: false,
10253 writable: true,
10254 configurable: true
10255 }
10256 });
10257 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
10258 };
10259
10260 var objectWithoutProperties = function (obj, keys) {
10261 var target = {};
10262
10263 for (var i in obj) {
10264 if (keys.indexOf(i) >= 0) continue;
10265 if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
10266 target[i] = obj[i];
10267 }
10268
10269 return target;
10270 };
10271
10272 var possibleConstructorReturn = function (self, call) {
10273 if (!self) {
10274 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
10275 }
10276
10277 return call && (typeof call === "object" || typeof call === "function") ? call : self;
10278 };
10279
10280 //
10281 var isPlainObject = (function (x) {
10282 return (typeof x === 'undefined' ? 'undefined' : _typeof(x)) === 'object' && x.constructor === Object;
10283 });
10284
10285 //
10286 var EMPTY_ARRAY = Object.freeze([]);
10287 var EMPTY_OBJECT = Object.freeze({});
10288
10289 //
10290 function isFunction(test) {
10291 return typeof test === 'function';
10292 }
10293
10294 //
10295
10296 function getComponentName(target) {
10297 return ( true ? typeof target === 'string' && target : 0) || target.displayName || target.name || 'Component';
10298 }
10299
10300 //
10301 function isStatelessFunction(test) {
10302 return typeof test === 'function' && !(test.prototype && test.prototype.isReactComponent);
10303 }
10304
10305 //
10306 function isStyledComponent(target) {
10307 return target && typeof target.styledComponentId === 'string';
10308 }
10309
10310 //
10311
10312 var SC_ATTR = typeof process !== 'undefined' && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR) || 'data-styled';
10313
10314 var SC_VERSION_ATTR = 'data-styled-version';
10315
10316 var SC_STREAM_ATTR = 'data-styled-streamed';
10317
10318 var IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window;
10319
10320 var DISABLE_SPEEDY = typeof SC_DISABLE_SPEEDY === 'boolean' && SC_DISABLE_SPEEDY || typeof process !== 'undefined' && (process.env.REACT_APP_SC_DISABLE_SPEEDY || process.env.SC_DISABLE_SPEEDY) || "development" !== 'production';
10321
10322 // Shared empty execution context when generating static styles
10323 var STATIC_EXECUTION_CONTEXT = {};
10324
10325 //
10326
10327
10328 /**
10329 * Parse errors.md and turn it into a simple hash of code: message
10330 */
10331 var ERRORS = true ? {
10332 "1": "Cannot create styled-component for component: %s.\n\n",
10333 "2": "Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",
10334 "3": "Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",
10335 "4": "The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",
10336 "5": "The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",
10337 "6": "Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",
10338 "7": "ThemeProvider: Please return an object from your \"theme\" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n",
10339 "8": "ThemeProvider: Please make your \"theme\" prop an object.\n\n",
10340 "9": "Missing document `<head>`\n\n",
10341 "10": "Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",
10342 "11": "_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",
10343 "12": "It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",
10344 "13": "%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n"
10345 } : 0;
10346
10347 /**
10348 * super basic version of sprintf
10349 */
10350 function format() {
10351 var a = arguments.length <= 0 ? undefined : arguments[0];
10352 var b = [];
10353
10354 for (var c = 1, len = arguments.length; c < len; c += 1) {
10355 b.push(arguments.length <= c ? undefined : arguments[c]);
10356 }
10357
10358 b.forEach(function (d) {
10359 a = a.replace(/%[a-z]/, d);
10360 });
10361
10362 return a;
10363 }
10364
10365 /**
10366 * Create an error file out of errors.md for development and a simple web link to the full errors
10367 * in production mode.
10368 */
10369
10370 var StyledComponentsError = function (_Error) {
10371 inherits(StyledComponentsError, _Error);
10372
10373 function StyledComponentsError(code) {
10374 classCallCheck(this, StyledComponentsError);
10375
10376 for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
10377 interpolations[_key - 1] = arguments[_key];
10378 }
10379
10380 if (false) { var _this; } else {
10381 var _this = possibleConstructorReturn(this, _Error.call(this, format.apply(undefined, [ERRORS[code]].concat(interpolations)).trim()));
10382 }
10383 return possibleConstructorReturn(_this);
10384 }
10385
10386 return StyledComponentsError;
10387 }(Error);
10388
10389 //
10390 var SC_COMPONENT_ID = /^[^\S\n]*?\/\* sc-component-id:\s*(\S+)\s+\*\//gm;
10391
10392 var extractComps = (function (maybeCSS) {
10393 var css = '' + (maybeCSS || ''); // Definitely a string, and a clone
10394 var existingComponents = [];
10395 css.replace(SC_COMPONENT_ID, function (match, componentId, matchIndex) {
10396 existingComponents.push({ componentId: componentId, matchIndex: matchIndex });
10397 return match;
10398 });
10399 return existingComponents.map(function (_ref, i) {
10400 var componentId = _ref.componentId,
10401 matchIndex = _ref.matchIndex;
10402
10403 var nextComp = existingComponents[i + 1];
10404 var cssFromDOM = nextComp ? css.slice(matchIndex, nextComp.matchIndex) : css.slice(matchIndex);
10405 return { componentId: componentId, cssFromDOM: cssFromDOM };
10406 });
10407 });
10408
10409 //
10410
10411 var COMMENT_REGEX = /^\s*\/\/.*$/gm;
10412
10413 // NOTE: This stylis instance is only used to split rules from SSR'd style tags
10414 var stylisSplitter = new (stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0___default())({
10415 global: false,
10416 cascade: true,
10417 keyframe: false,
10418 prefix: false,
10419 compress: false,
10420 semicolon: true
10421 });
10422
10423 var stylis = new (stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0___default())({
10424 global: false,
10425 cascade: true,
10426 keyframe: false,
10427 prefix: true,
10428 compress: false,
10429 semicolon: false // NOTE: This means "autocomplete missing semicolons"
10430 });
10431
10432 // Wrap `insertRulePlugin to build a list of rules,
10433 // and then make our own plugin to return the rules. This
10434 // makes it easier to hook into the existing SSR architecture
10435
10436 var parsingRules = [];
10437
10438 // eslint-disable-next-line consistent-return
10439 var returnRulesPlugin = function returnRulesPlugin(context) {
10440 if (context === -2) {
10441 var parsedRules = parsingRules;
10442 parsingRules = [];
10443 return parsedRules;
10444 }
10445 };
10446
10447 var parseRulesPlugin = stylis_rule_sheet__WEBPACK_IMPORTED_MODULE_1___default()(function (rule) {
10448 parsingRules.push(rule);
10449 });
10450
10451 var _componentId = void 0;
10452 var _selector = void 0;
10453 var _selectorRegexp = void 0;
10454
10455 var selfReferenceReplacer = function selfReferenceReplacer(match, offset, string) {
10456 if (
10457 // the first self-ref is always untouched
10458 offset > 0 &&
10459 // there should be at least two self-refs to do a replacement (.b > .b)
10460 string.slice(0, offset).indexOf(_selector) !== -1 &&
10461 // no consecutive self refs (.b.b); that is a precedence boost and treated differently
10462 string.slice(offset - _selector.length, offset) !== _selector) {
10463 return '.' + _componentId;
10464 }
10465
10466 return match;
10467 };
10468
10469 /**
10470 * When writing a style like
10471 *
10472 * & + & {
10473 * color: red;
10474 * }
10475 *
10476 * The second ampersand should be a reference to the static component class. stylis
10477 * has no knowledge of static class so we have to intelligently replace the base selector.
10478 */
10479 var selfReferenceReplacementPlugin = function selfReferenceReplacementPlugin(context, _, selectors) {
10480 if (context === 2 && selectors.length && selectors[0].lastIndexOf(_selector) > 0) {
10481 // eslint-disable-next-line no-param-reassign
10482 selectors[0] = selectors[0].replace(_selectorRegexp, selfReferenceReplacer);
10483 }
10484 };
10485
10486 stylis.use([selfReferenceReplacementPlugin, parseRulesPlugin, returnRulesPlugin]);
10487 stylisSplitter.use([parseRulesPlugin, returnRulesPlugin]);
10488
10489 var splitByRules = function splitByRules(css) {
10490 return stylisSplitter('', css);
10491 };
10492
10493 function stringifyRules(rules, selector, prefix) {
10494 var componentId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '&';
10495
10496 var flatCSS = rules.join('').replace(COMMENT_REGEX, ''); // replace JS comments
10497
10498 var cssStr = selector && prefix ? prefix + ' ' + selector + ' { ' + flatCSS + ' }' : flatCSS;
10499
10500 // stylis has no concept of state to be passed to plugins
10501 // but since JS is single=threaded, we can rely on that to ensure
10502 // these properties stay in sync with the current stylis run
10503 _componentId = componentId;
10504 _selector = selector;
10505 _selectorRegexp = new RegExp('\\' + _selector + '\\b', 'g');
10506
10507 return stylis(prefix || !selector ? '' : selector, cssStr);
10508 }
10509
10510 //
10511 /* eslint-disable camelcase, no-undef */
10512
10513 var getNonce = (function () {
10514 return true ? __webpack_require__.nc : 0;
10515 });
10516
10517 //
10518 /* These are helpers for the StyleTags to keep track of the injected
10519 * rule names for each (component) ID that they're keeping track of.
10520 * They're crucial for detecting whether a name has already been
10521 * injected.
10522 * (This excludes rehydrated names) */
10523
10524 /* adds a new ID:name pairing to a names dictionary */
10525 var addNameForId = function addNameForId(names, id, name) {
10526 if (name) {
10527 // eslint-disable-next-line no-param-reassign
10528 var namesForId = names[id] || (names[id] = Object.create(null));
10529 namesForId[name] = true;
10530 }
10531 };
10532
10533 /* resets an ID entirely by overwriting it in the dictionary */
10534 var resetIdNames = function resetIdNames(names, id) {
10535 // eslint-disable-next-line no-param-reassign
10536 names[id] = Object.create(null);
10537 };
10538
10539 /* factory for a names dictionary checking the existance of an ID:name pairing */
10540 var hasNameForId = function hasNameForId(names) {
10541 return function (id, name) {
10542 return names[id] !== undefined && names[id][name];
10543 };
10544 };
10545
10546 /* stringifies names for the html/element output */
10547 var stringifyNames = function stringifyNames(names) {
10548 var str = '';
10549 // eslint-disable-next-line guard-for-in
10550 for (var id in names) {
10551 str += Object.keys(names[id]).join(' ') + ' ';
10552 }
10553 return str.trim();
10554 };
10555
10556 /* clones the nested names dictionary */
10557 var cloneNames = function cloneNames(names) {
10558 var clone = Object.create(null);
10559 // eslint-disable-next-line guard-for-in
10560 for (var id in names) {
10561 clone[id] = _extends({}, names[id]);
10562 }
10563 return clone;
10564 };
10565
10566 //
10567
10568 /* These are helpers that deal with the insertRule (aka speedy) API
10569 * They are used in the StyleTags and specifically the speedy tag
10570 */
10571
10572 /* retrieve a sheet for a given style tag */
10573 var sheetForTag = function sheetForTag(tag) {
10574 // $FlowFixMe
10575 if (tag.sheet) return tag.sheet;
10576
10577 /* Firefox quirk requires us to step through all stylesheets to find one owned by the given tag */
10578 var size = tag.ownerDocument.styleSheets.length;
10579 for (var i = 0; i < size; i += 1) {
10580 var sheet = tag.ownerDocument.styleSheets[i];
10581 // $FlowFixMe
10582 if (sheet.ownerNode === tag) return sheet;
10583 }
10584
10585 /* we should always be able to find a tag */
10586 throw new StyledComponentsError(10);
10587 };
10588
10589 /* insert a rule safely and return whether it was actually injected */
10590 var safeInsertRule = function safeInsertRule(sheet, cssRule, index) {
10591 /* abort early if cssRule string is falsy */
10592 if (!cssRule) return false;
10593
10594 var maxIndex = sheet.cssRules.length;
10595
10596 try {
10597 /* use insertRule and cap passed index with maxIndex (no of cssRules) */
10598 sheet.insertRule(cssRule, index <= maxIndex ? index : maxIndex);
10599 } catch (err) {
10600 /* any error indicates an invalid rule */
10601 return false;
10602 }
10603
10604 return true;
10605 };
10606
10607 /* deletes `size` rules starting from `removalIndex` */
10608 var deleteRules = function deleteRules(sheet, removalIndex, size) {
10609 var lowerBound = removalIndex - size;
10610 for (var i = removalIndex; i > lowerBound; i -= 1) {
10611 sheet.deleteRule(i);
10612 }
10613 };
10614
10615 //
10616
10617 /* this marker separates component styles and is important for rehydration */
10618 var makeTextMarker = function makeTextMarker(id) {
10619 return '\n/* sc-component-id: ' + id + ' */\n';
10620 };
10621
10622 /* add up all numbers in array up until and including the index */
10623 var addUpUntilIndex = function addUpUntilIndex(sizes, index) {
10624 var totalUpToIndex = 0;
10625 for (var i = 0; i <= index; i += 1) {
10626 totalUpToIndex += sizes[i];
10627 }
10628
10629 return totalUpToIndex;
10630 };
10631
10632 /* create a new style tag after lastEl */
10633 var makeStyleTag = function makeStyleTag(target, tagEl, insertBefore) {
10634 var targetDocument = document;
10635 if (target) targetDocument = target.ownerDocument;else if (tagEl) targetDocument = tagEl.ownerDocument;
10636
10637 var el = targetDocument.createElement('style');
10638 el.setAttribute(SC_ATTR, '');
10639 el.setAttribute(SC_VERSION_ATTR, "4.4.1");
10640
10641 var nonce = getNonce();
10642 if (nonce) {
10643 el.setAttribute('nonce', nonce);
10644 }
10645
10646 /* Work around insertRule quirk in EdgeHTML */
10647 el.appendChild(targetDocument.createTextNode(''));
10648
10649 if (target && !tagEl) {
10650 /* Append to target when no previous element was passed */
10651 target.appendChild(el);
10652 } else {
10653 if (!tagEl || !target || !tagEl.parentNode) {
10654 throw new StyledComponentsError(6);
10655 }
10656
10657 /* Insert new style tag after the previous one */
10658 tagEl.parentNode.insertBefore(el, insertBefore ? tagEl : tagEl.nextSibling);
10659 }
10660
10661 return el;
10662 };
10663
10664 /* takes a css factory function and outputs an html styled tag factory */
10665 var wrapAsHtmlTag = function wrapAsHtmlTag(css, names) {
10666 return function (additionalAttrs) {
10667 var nonce = getNonce();
10668 var attrs = [nonce && 'nonce="' + nonce + '"', SC_ATTR + '="' + stringifyNames(names) + '"', SC_VERSION_ATTR + '="' + "4.4.1" + '"', additionalAttrs];
10669
10670 var htmlAttr = attrs.filter(Boolean).join(' ');
10671 return '<style ' + htmlAttr + '>' + css() + '</style>';
10672 };
10673 };
10674
10675 /* takes a css factory function and outputs an element factory */
10676 var wrapAsElement = function wrapAsElement(css, names) {
10677 return function () {
10678 var _props;
10679
10680 var props = (_props = {}, _props[SC_ATTR] = stringifyNames(names), _props[SC_VERSION_ATTR] = "4.4.1", _props);
10681
10682 var nonce = getNonce();
10683 if (nonce) {
10684 // $FlowFixMe
10685 props.nonce = nonce;
10686 }
10687
10688 // eslint-disable-next-line react/no-danger
10689 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement('style', _extends({}, props, { dangerouslySetInnerHTML: { __html: css() } }));
10690 };
10691 };
10692
10693 var getIdsFromMarkersFactory = function getIdsFromMarkersFactory(markers) {
10694 return function () {
10695 return Object.keys(markers);
10696 };
10697 };
10698
10699 /* speedy tags utilise insertRule */
10700 var makeSpeedyTag = function makeSpeedyTag(el, getImportRuleTag) {
10701 var names = Object.create(null);
10702 var markers = Object.create(null);
10703 var sizes = [];
10704
10705 var extractImport = getImportRuleTag !== undefined;
10706 /* indicates whether getImportRuleTag was called */
10707 var usedImportRuleTag = false;
10708
10709 var insertMarker = function insertMarker(id) {
10710 var prev = markers[id];
10711 if (prev !== undefined) {
10712 return prev;
10713 }
10714
10715 markers[id] = sizes.length;
10716 sizes.push(0);
10717 resetIdNames(names, id);
10718
10719 return markers[id];
10720 };
10721
10722 var insertRules = function insertRules(id, cssRules, name) {
10723 var marker = insertMarker(id);
10724 var sheet = sheetForTag(el);
10725 var insertIndex = addUpUntilIndex(sizes, marker);
10726
10727 var injectedRules = 0;
10728 var importRules = [];
10729 var cssRulesSize = cssRules.length;
10730
10731 for (var i = 0; i < cssRulesSize; i += 1) {
10732 var cssRule = cssRules[i];
10733 var mayHaveImport = extractImport; /* @import rules are reordered to appear first */
10734 if (mayHaveImport && cssRule.indexOf('@import') !== -1) {
10735 importRules.push(cssRule);
10736 } else if (safeInsertRule(sheet, cssRule, insertIndex + injectedRules)) {
10737 mayHaveImport = false;
10738 injectedRules += 1;
10739 }
10740 }
10741
10742 if (extractImport && importRules.length > 0) {
10743 usedImportRuleTag = true;
10744 // $FlowFixMe
10745 getImportRuleTag().insertRules(id + '-import', importRules);
10746 }
10747
10748 sizes[marker] += injectedRules; /* add up no of injected rules */
10749 addNameForId(names, id, name);
10750 };
10751
10752 var removeRules = function removeRules(id) {
10753 var marker = markers[id];
10754 if (marker === undefined) return;
10755 // $FlowFixMe
10756 if (el.isConnected === false) return;
10757
10758 var size = sizes[marker];
10759 var sheet = sheetForTag(el);
10760 var removalIndex = addUpUntilIndex(sizes, marker) - 1;
10761 deleteRules(sheet, removalIndex, size);
10762 sizes[marker] = 0;
10763 resetIdNames(names, id);
10764
10765 if (extractImport && usedImportRuleTag) {
10766 // $FlowFixMe
10767 getImportRuleTag().removeRules(id + '-import');
10768 }
10769 };
10770
10771 var css = function css() {
10772 var _sheetForTag = sheetForTag(el),
10773 cssRules = _sheetForTag.cssRules;
10774
10775 var str = '';
10776
10777 // eslint-disable-next-line guard-for-in
10778 for (var id in markers) {
10779 str += makeTextMarker(id);
10780 var marker = markers[id];
10781 var end = addUpUntilIndex(sizes, marker);
10782 var size = sizes[marker];
10783 for (var i = end - size; i < end; i += 1) {
10784 var rule = cssRules[i];
10785 if (rule !== undefined) {
10786 str += rule.cssText;
10787 }
10788 }
10789 }
10790
10791 return str;
10792 };
10793
10794 return {
10795 clone: function clone() {
10796 throw new StyledComponentsError(5);
10797 },
10798
10799 css: css,
10800 getIds: getIdsFromMarkersFactory(markers),
10801 hasNameForId: hasNameForId(names),
10802 insertMarker: insertMarker,
10803 insertRules: insertRules,
10804 removeRules: removeRules,
10805 sealed: false,
10806 styleTag: el,
10807 toElement: wrapAsElement(css, names),
10808 toHTML: wrapAsHtmlTag(css, names)
10809 };
10810 };
10811
10812 var makeTextNode = function makeTextNode(targetDocument, id) {
10813 return targetDocument.createTextNode(makeTextMarker(id));
10814 };
10815
10816 var makeBrowserTag = function makeBrowserTag(el, getImportRuleTag) {
10817 var names = Object.create(null);
10818 var markers = Object.create(null);
10819
10820 var extractImport = getImportRuleTag !== undefined;
10821
10822 /* indicates whether getImportRuleTag was called */
10823 var usedImportRuleTag = false;
10824
10825 var insertMarker = function insertMarker(id) {
10826 var prev = markers[id];
10827 if (prev !== undefined) {
10828 return prev;
10829 }
10830
10831 markers[id] = makeTextNode(el.ownerDocument, id);
10832 el.appendChild(markers[id]);
10833 names[id] = Object.create(null);
10834
10835 return markers[id];
10836 };
10837
10838 var insertRules = function insertRules(id, cssRules, name) {
10839 var marker = insertMarker(id);
10840 var importRules = [];
10841 var cssRulesSize = cssRules.length;
10842
10843 for (var i = 0; i < cssRulesSize; i += 1) {
10844 var rule = cssRules[i];
10845 var mayHaveImport = extractImport;
10846 if (mayHaveImport && rule.indexOf('@import') !== -1) {
10847 importRules.push(rule);
10848 } else {
10849 mayHaveImport = false;
10850 var separator = i === cssRulesSize - 1 ? '' : ' ';
10851 marker.appendData('' + rule + separator);
10852 }
10853 }
10854
10855 addNameForId(names, id, name);
10856
10857 if (extractImport && importRules.length > 0) {
10858 usedImportRuleTag = true;
10859 // $FlowFixMe
10860 getImportRuleTag().insertRules(id + '-import', importRules);
10861 }
10862 };
10863
10864 var removeRules = function removeRules(id) {
10865 var marker = markers[id];
10866 if (marker === undefined) return;
10867
10868 /* create new empty text node and replace the current one */
10869 var newMarker = makeTextNode(el.ownerDocument, id);
10870 el.replaceChild(newMarker, marker);
10871 markers[id] = newMarker;
10872 resetIdNames(names, id);
10873
10874 if (extractImport && usedImportRuleTag) {
10875 // $FlowFixMe
10876 getImportRuleTag().removeRules(id + '-import');
10877 }
10878 };
10879
10880 var css = function css() {
10881 var str = '';
10882
10883 // eslint-disable-next-line guard-for-in
10884 for (var id in markers) {
10885 str += markers[id].data;
10886 }
10887
10888 return str;
10889 };
10890
10891 return {
10892 clone: function clone() {
10893 throw new StyledComponentsError(5);
10894 },
10895
10896 css: css,
10897 getIds: getIdsFromMarkersFactory(markers),
10898 hasNameForId: hasNameForId(names),
10899 insertMarker: insertMarker,
10900 insertRules: insertRules,
10901 removeRules: removeRules,
10902 sealed: false,
10903 styleTag: el,
10904 toElement: wrapAsElement(css, names),
10905 toHTML: wrapAsHtmlTag(css, names)
10906 };
10907 };
10908
10909 var makeServerTag = function makeServerTag(namesArg, markersArg) {
10910 var names = namesArg === undefined ? Object.create(null) : namesArg;
10911 var markers = markersArg === undefined ? Object.create(null) : markersArg;
10912
10913 var insertMarker = function insertMarker(id) {
10914 var prev = markers[id];
10915 if (prev !== undefined) {
10916 return prev;
10917 }
10918
10919 return markers[id] = [''];
10920 };
10921
10922 var insertRules = function insertRules(id, cssRules, name) {
10923 var marker = insertMarker(id);
10924 marker[0] += cssRules.join(' ');
10925 addNameForId(names, id, name);
10926 };
10927
10928 var removeRules = function removeRules(id) {
10929 var marker = markers[id];
10930 if (marker === undefined) return;
10931 marker[0] = '';
10932 resetIdNames(names, id);
10933 };
10934
10935 var css = function css() {
10936 var str = '';
10937 // eslint-disable-next-line guard-for-in
10938 for (var id in markers) {
10939 var cssForId = markers[id][0];
10940 if (cssForId) {
10941 str += makeTextMarker(id) + cssForId;
10942 }
10943 }
10944 return str;
10945 };
10946
10947 var clone = function clone() {
10948 var namesClone = cloneNames(names);
10949 var markersClone = Object.create(null);
10950
10951 // eslint-disable-next-line guard-for-in
10952 for (var id in markers) {
10953 markersClone[id] = [markers[id][0]];
10954 }
10955
10956 return makeServerTag(namesClone, markersClone);
10957 };
10958
10959 var tag = {
10960 clone: clone,
10961 css: css,
10962 getIds: getIdsFromMarkersFactory(markers),
10963 hasNameForId: hasNameForId(names),
10964 insertMarker: insertMarker,
10965 insertRules: insertRules,
10966 removeRules: removeRules,
10967 sealed: false,
10968 styleTag: null,
10969 toElement: wrapAsElement(css, names),
10970 toHTML: wrapAsHtmlTag(css, names)
10971 };
10972
10973 return tag;
10974 };
10975
10976 var makeTag = function makeTag(target, tagEl, forceServer, insertBefore, getImportRuleTag) {
10977 if (IS_BROWSER && !forceServer) {
10978 var el = makeStyleTag(target, tagEl, insertBefore);
10979
10980 if (DISABLE_SPEEDY) {
10981 return makeBrowserTag(el, getImportRuleTag);
10982 } else {
10983 return makeSpeedyTag(el, getImportRuleTag);
10984 }
10985 }
10986
10987 return makeServerTag();
10988 };
10989
10990 var rehydrate = function rehydrate(tag, els, extracted) {
10991 /* add all extracted components to the new tag */
10992 for (var i = 0, len = extracted.length; i < len; i += 1) {
10993 var _extracted$i = extracted[i],
10994 componentId = _extracted$i.componentId,
10995 cssFromDOM = _extracted$i.cssFromDOM;
10996
10997 var cssRules = splitByRules(cssFromDOM);
10998 tag.insertRules(componentId, cssRules);
10999 }
11000
11001 /* remove old HTMLStyleElements, since they have been rehydrated */
11002 for (var _i = 0, _len = els.length; _i < _len; _i += 1) {
11003 var el = els[_i];
11004 if (el.parentNode) {
11005 el.parentNode.removeChild(el);
11006 }
11007 }
11008 };
11009
11010 //
11011
11012 var SPLIT_REGEX = /\s+/;
11013
11014 /* determine the maximum number of components before tags are sharded */
11015 var MAX_SIZE = void 0;
11016 if (IS_BROWSER) {
11017 /* in speedy mode we can keep a lot more rules in a sheet before a slowdown can be expected */
11018 MAX_SIZE = DISABLE_SPEEDY ? 40 : 1000;
11019 } else {
11020 /* for servers we do not need to shard at all */
11021 MAX_SIZE = -1;
11022 }
11023
11024 var sheetRunningId = 0;
11025 var master = void 0;
11026
11027 var StyleSheet = function () {
11028
11029 /* a map from ids to tags */
11030
11031 /* deferred rules for a given id */
11032
11033 /* this is used for not reinjecting rules via hasNameForId() */
11034
11035 /* when rules for an id are removed using remove() we have to ignore rehydratedNames for it */
11036
11037 /* a list of tags belonging to this StyleSheet */
11038
11039 /* a tag for import rules */
11040
11041 /* current capacity until a new tag must be created */
11042
11043 /* children (aka clones) of this StyleSheet inheriting all and future injections */
11044
11045 function StyleSheet() {
11046 var _this = this;
11047
11048 var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : IS_BROWSER ? document.head : null;
11049 var forceServer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
11050 classCallCheck(this, StyleSheet);
11051
11052 this.getImportRuleTag = function () {
11053 var importRuleTag = _this.importRuleTag;
11054
11055 if (importRuleTag !== undefined) {
11056 return importRuleTag;
11057 }
11058
11059 var firstTag = _this.tags[0];
11060 var insertBefore = true;
11061
11062 return _this.importRuleTag = makeTag(_this.target, firstTag ? firstTag.styleTag : null, _this.forceServer, insertBefore);
11063 };
11064
11065 sheetRunningId += 1;
11066 this.id = sheetRunningId;
11067 this.forceServer = forceServer;
11068 this.target = forceServer ? null : target;
11069 this.tagMap = {};
11070 this.deferred = {};
11071 this.rehydratedNames = {};
11072 this.ignoreRehydratedNames = {};
11073 this.tags = [];
11074 this.capacity = 1;
11075 this.clones = [];
11076 }
11077
11078 /* rehydrate all SSR'd style tags */
11079
11080
11081 StyleSheet.prototype.rehydrate = function rehydrate$$1() {
11082 if (!IS_BROWSER || this.forceServer) return this;
11083
11084 var els = [];
11085 var extracted = [];
11086 var isStreamed = false;
11087
11088 /* retrieve all of our SSR style elements from the DOM */
11089 var nodes = document.querySelectorAll('style[' + SC_ATTR + '][' + SC_VERSION_ATTR + '="' + "4.4.1" + '"]');
11090
11091 var nodesSize = nodes.length;
11092
11093 /* abort rehydration if no previous style tags were found */
11094 if (!nodesSize) return this;
11095
11096 for (var i = 0; i < nodesSize; i += 1) {
11097 var el = nodes[i];
11098
11099 /* check if style tag is a streamed tag */
11100 if (!isStreamed) isStreamed = !!el.getAttribute(SC_STREAM_ATTR);
11101
11102 /* retrieve all component names */
11103 var elNames = (el.getAttribute(SC_ATTR) || '').trim().split(SPLIT_REGEX);
11104 var elNamesSize = elNames.length;
11105 for (var j = 0, name; j < elNamesSize; j += 1) {
11106 name = elNames[j];
11107 /* add rehydrated name to sheet to avoid re-adding styles */
11108 this.rehydratedNames[name] = true;
11109 }
11110
11111 /* extract all components and their CSS */
11112 extracted.push.apply(extracted, extractComps(el.textContent));
11113
11114 /* store original HTMLStyleElement */
11115 els.push(el);
11116 }
11117
11118 /* abort rehydration if nothing was extracted */
11119 var extractedSize = extracted.length;
11120 if (!extractedSize) return this;
11121
11122 /* create a tag to be used for rehydration */
11123 var tag = this.makeTag(null);
11124
11125 rehydrate(tag, els, extracted);
11126
11127 /* reset capacity and adjust MAX_SIZE by the initial size of the rehydration */
11128 this.capacity = Math.max(1, MAX_SIZE - extractedSize);
11129 this.tags.push(tag);
11130
11131 /* retrieve all component ids */
11132 for (var _j = 0; _j < extractedSize; _j += 1) {
11133 this.tagMap[extracted[_j].componentId] = tag;
11134 }
11135
11136 return this;
11137 };
11138
11139 /* retrieve a "master" instance of StyleSheet which is typically used when no other is available
11140 * The master StyleSheet is targeted by createGlobalStyle, keyframes, and components outside of any
11141 * StyleSheetManager's context */
11142
11143
11144 /* reset the internal "master" instance */
11145 StyleSheet.reset = function reset() {
11146 var forceServer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
11147
11148 master = new StyleSheet(undefined, forceServer).rehydrate();
11149 };
11150
11151 /* adds "children" to the StyleSheet that inherit all of the parents' rules
11152 * while their own rules do not affect the parent */
11153
11154
11155 StyleSheet.prototype.clone = function clone() {
11156 var sheet = new StyleSheet(this.target, this.forceServer);
11157
11158 /* add to clone array */
11159 this.clones.push(sheet);
11160
11161 /* clone all tags */
11162 sheet.tags = this.tags.map(function (tag) {
11163 var ids = tag.getIds();
11164 var newTag = tag.clone();
11165
11166 /* reconstruct tagMap */
11167 for (var i = 0; i < ids.length; i += 1) {
11168 sheet.tagMap[ids[i]] = newTag;
11169 }
11170
11171 return newTag;
11172 });
11173
11174 /* clone other maps */
11175 sheet.rehydratedNames = _extends({}, this.rehydratedNames);
11176 sheet.deferred = _extends({}, this.deferred);
11177
11178 return sheet;
11179 };
11180
11181 /* force StyleSheet to create a new tag on the next injection */
11182
11183
11184 StyleSheet.prototype.sealAllTags = function sealAllTags() {
11185 this.capacity = 1;
11186
11187 this.tags.forEach(function (tag) {
11188 // eslint-disable-next-line no-param-reassign
11189 tag.sealed = true;
11190 });
11191 };
11192
11193 StyleSheet.prototype.makeTag = function makeTag$$1(tag) {
11194 var lastEl = tag ? tag.styleTag : null;
11195 var insertBefore = false;
11196
11197 return makeTag(this.target, lastEl, this.forceServer, insertBefore, this.getImportRuleTag);
11198 };
11199
11200 /* get a tag for a given componentId, assign the componentId to one, or shard */
11201 StyleSheet.prototype.getTagForId = function getTagForId(id) {
11202 /* simply return a tag, when the componentId was already assigned one */
11203 var prev = this.tagMap[id];
11204 if (prev !== undefined && !prev.sealed) {
11205 return prev;
11206 }
11207
11208 var tag = this.tags[this.tags.length - 1];
11209
11210 /* shard (create a new tag) if the tag is exhausted (See MAX_SIZE) */
11211 this.capacity -= 1;
11212
11213 if (this.capacity === 0) {
11214 this.capacity = MAX_SIZE;
11215 tag = this.makeTag(tag);
11216 this.tags.push(tag);
11217 }
11218
11219 return this.tagMap[id] = tag;
11220 };
11221
11222 /* mainly for createGlobalStyle to check for its id */
11223
11224
11225 StyleSheet.prototype.hasId = function hasId(id) {
11226 return this.tagMap[id] !== undefined;
11227 };
11228
11229 /* caching layer checking id+name to already have a corresponding tag and injected rules */
11230
11231
11232 StyleSheet.prototype.hasNameForId = function hasNameForId(id, name) {
11233 /* exception for rehydrated names which are checked separately */
11234 if (this.ignoreRehydratedNames[id] === undefined && this.rehydratedNames[name]) {
11235 return true;
11236 }
11237
11238 var tag = this.tagMap[id];
11239 return tag !== undefined && tag.hasNameForId(id, name);
11240 };
11241
11242 /* registers a componentId and registers it on its tag */
11243
11244
11245 StyleSheet.prototype.deferredInject = function deferredInject(id, cssRules) {
11246 /* don't inject when the id is already registered */
11247 if (this.tagMap[id] !== undefined) return;
11248
11249 var clones = this.clones;
11250
11251 for (var i = 0; i < clones.length; i += 1) {
11252 clones[i].deferredInject(id, cssRules);
11253 }
11254
11255 this.getTagForId(id).insertMarker(id);
11256 this.deferred[id] = cssRules;
11257 };
11258
11259 /* injects rules for a given id with a name that will need to be cached */
11260
11261
11262 StyleSheet.prototype.inject = function inject(id, cssRules, name) {
11263 var clones = this.clones;
11264
11265
11266 for (var i = 0; i < clones.length; i += 1) {
11267 clones[i].inject(id, cssRules, name);
11268 }
11269
11270 var tag = this.getTagForId(id);
11271
11272 /* add deferred rules for component */
11273 if (this.deferred[id] !== undefined) {
11274 // Combine passed cssRules with previously deferred CSS rules
11275 // NOTE: We cannot mutate the deferred array itself as all clones
11276 // do the same (see clones[i].inject)
11277 var rules = this.deferred[id].concat(cssRules);
11278 tag.insertRules(id, rules, name);
11279
11280 this.deferred[id] = undefined;
11281 } else {
11282 tag.insertRules(id, cssRules, name);
11283 }
11284 };
11285
11286 /* removes all rules for a given id, which doesn't remove its marker but resets it */
11287
11288
11289 StyleSheet.prototype.remove = function remove(id) {
11290 var tag = this.tagMap[id];
11291 if (tag === undefined) return;
11292
11293 var clones = this.clones;
11294
11295 for (var i = 0; i < clones.length; i += 1) {
11296 clones[i].remove(id);
11297 }
11298
11299 /* remove all rules from the tag */
11300 tag.removeRules(id);
11301
11302 /* ignore possible rehydrated names */
11303 this.ignoreRehydratedNames[id] = true;
11304
11305 /* delete possible deferred rules */
11306 this.deferred[id] = undefined;
11307 };
11308
11309 StyleSheet.prototype.toHTML = function toHTML() {
11310 return this.tags.map(function (tag) {
11311 return tag.toHTML();
11312 }).join('');
11313 };
11314
11315 StyleSheet.prototype.toReactElements = function toReactElements() {
11316 var id = this.id;
11317
11318
11319 return this.tags.map(function (tag, i) {
11320 var key = 'sc-' + id + '-' + i;
11321 return (0,react__WEBPACK_IMPORTED_MODULE_2__.cloneElement)(tag.toElement(), { key: key });
11322 });
11323 };
11324
11325 createClass(StyleSheet, null, [{
11326 key: 'master',
11327 get: function get$$1() {
11328 return master || (master = new StyleSheet().rehydrate());
11329 }
11330
11331 /* NOTE: This is just for backwards-compatibility with jest-styled-components */
11332
11333 }, {
11334 key: 'instance',
11335 get: function get$$1() {
11336 return StyleSheet.master;
11337 }
11338 }]);
11339 return StyleSheet;
11340 }();
11341
11342 //
11343
11344 var Keyframes = function () {
11345 function Keyframes(name, rules) {
11346 var _this = this;
11347
11348 classCallCheck(this, Keyframes);
11349
11350 this.inject = function (styleSheet) {
11351 if (!styleSheet.hasNameForId(_this.id, _this.name)) {
11352 styleSheet.inject(_this.id, _this.rules, _this.name);
11353 }
11354 };
11355
11356 this.toString = function () {
11357 throw new StyledComponentsError(12, String(_this.name));
11358 };
11359
11360 this.name = name;
11361 this.rules = rules;
11362
11363 this.id = 'sc-keyframes-' + name;
11364 }
11365
11366 Keyframes.prototype.getName = function getName() {
11367 return this.name;
11368 };
11369
11370 return Keyframes;
11371 }();
11372
11373 //
11374
11375 /**
11376 * inlined version of
11377 * https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/core/hyphenateStyleName.js
11378 */
11379
11380 var uppercasePattern = /([A-Z])/g;
11381 var msPattern = /^ms-/;
11382
11383 /**
11384 * Hyphenates a camelcased CSS property name, for example:
11385 *
11386 * > hyphenateStyleName('backgroundColor')
11387 * < "background-color"
11388 * > hyphenateStyleName('MozTransition')
11389 * < "-moz-transition"
11390 * > hyphenateStyleName('msTransition')
11391 * < "-ms-transition"
11392 *
11393 * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
11394 * is converted to `-ms-`.
11395 *
11396 * @param {string} string
11397 * @return {string}
11398 */
11399 function hyphenateStyleName(string) {
11400 return string.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');
11401 }
11402
11403 //
11404
11405 // Taken from https://github.com/facebook/react/blob/b87aabdfe1b7461e7331abb3601d9e6bb27544bc/packages/react-dom/src/shared/dangerousStyleValue.js
11406 function addUnitIfNeeded(name, value) {
11407 // https://github.com/amilajack/eslint-plugin-flowtype-errors/issues/133
11408 // $FlowFixMe
11409 if (value == null || typeof value === 'boolean' || value === '') {
11410 return '';
11411 }
11412
11413 if (typeof value === 'number' && value !== 0 && !(name in _emotion_unitless__WEBPACK_IMPORTED_MODULE_3__["default"])) {
11414 return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers
11415 }
11416
11417 return String(value).trim();
11418 }
11419
11420 //
11421
11422 /**
11423 * It's falsish not falsy because 0 is allowed.
11424 */
11425 var isFalsish = function isFalsish(chunk) {
11426 return chunk === undefined || chunk === null || chunk === false || chunk === '';
11427 };
11428
11429 var objToCssArray = function objToCssArray(obj, prevKey) {
11430 var rules = [];
11431 var keys = Object.keys(obj);
11432
11433 keys.forEach(function (key) {
11434 if (!isFalsish(obj[key])) {
11435 if (isPlainObject(obj[key])) {
11436 rules.push.apply(rules, objToCssArray(obj[key], key));
11437
11438 return rules;
11439 } else if (isFunction(obj[key])) {
11440 rules.push(hyphenateStyleName(key) + ':', obj[key], ';');
11441
11442 return rules;
11443 }
11444 rules.push(hyphenateStyleName(key) + ': ' + addUnitIfNeeded(key, obj[key]) + ';');
11445 }
11446 return rules;
11447 });
11448
11449 return prevKey ? [prevKey + ' {'].concat(rules, ['}']) : rules;
11450 };
11451
11452 function flatten(chunk, executionContext, styleSheet) {
11453 if (Array.isArray(chunk)) {
11454 var ruleSet = [];
11455
11456 for (var i = 0, len = chunk.length, result; i < len; i += 1) {
11457 result = flatten(chunk[i], executionContext, styleSheet);
11458
11459 if (result === null) continue;else if (Array.isArray(result)) ruleSet.push.apply(ruleSet, result);else ruleSet.push(result);
11460 }
11461
11462 return ruleSet;
11463 }
11464
11465 if (isFalsish(chunk)) {
11466 return null;
11467 }
11468
11469 /* Handle other components */
11470 if (isStyledComponent(chunk)) {
11471 return '.' + chunk.styledComponentId;
11472 }
11473
11474 /* Either execute or defer the function */
11475 if (isFunction(chunk)) {
11476 if (isStatelessFunction(chunk) && executionContext) {
11477 var _result = chunk(executionContext);
11478
11479 if ( true && (0,react_is__WEBPACK_IMPORTED_MODULE_4__.isElement)(_result)) {
11480 // eslint-disable-next-line no-console
11481 console.warn(getComponentName(chunk) + ' is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.');
11482 }
11483
11484 return flatten(_result, executionContext, styleSheet);
11485 } else return chunk;
11486 }
11487
11488 if (chunk instanceof Keyframes) {
11489 if (styleSheet) {
11490 chunk.inject(styleSheet);
11491 return chunk.getName();
11492 } else return chunk;
11493 }
11494
11495 /* Handle objects */
11496 return isPlainObject(chunk) ? objToCssArray(chunk) : chunk.toString();
11497 }
11498
11499 //
11500
11501 function css(styles) {
11502 for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
11503 interpolations[_key - 1] = arguments[_key];
11504 }
11505
11506 if (isFunction(styles) || isPlainObject(styles)) {
11507 // $FlowFixMe
11508 return flatten(interleave(EMPTY_ARRAY, [styles].concat(interpolations)));
11509 }
11510
11511 // $FlowFixMe
11512 return flatten(interleave(styles, interpolations));
11513 }
11514
11515 //
11516
11517 function constructWithOptions(componentConstructor, tag) {
11518 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EMPTY_OBJECT;
11519
11520 if (!(0,react_is__WEBPACK_IMPORTED_MODULE_4__.isValidElementType)(tag)) {
11521 throw new StyledComponentsError(1, String(tag));
11522 }
11523
11524 /* This is callable directly as a template function */
11525 // $FlowFixMe: Not typed to avoid destructuring arguments
11526 var templateFunction = function templateFunction() {
11527 return componentConstructor(tag, options, css.apply(undefined, arguments));
11528 };
11529
11530 /* If config methods are called, wrap up a new template function and merge options */
11531 templateFunction.withConfig = function (config) {
11532 return constructWithOptions(componentConstructor, tag, _extends({}, options, config));
11533 };
11534
11535 /* Modify/inject new props at runtime */
11536 templateFunction.attrs = function (attrs) {
11537 return constructWithOptions(componentConstructor, tag, _extends({}, options, {
11538 attrs: Array.prototype.concat(options.attrs, attrs).filter(Boolean)
11539 }));
11540 };
11541
11542 return templateFunction;
11543 }
11544
11545 //
11546 // Source: https://github.com/garycourt/murmurhash-js/blob/master/murmurhash2_gc.js
11547 function murmurhash(c) {
11548 for (var e = c.length | 0, a = e | 0, d = 0, b; e >= 4;) {
11549 b = c.charCodeAt(d) & 255 | (c.charCodeAt(++d) & 255) << 8 | (c.charCodeAt(++d) & 255) << 16 | (c.charCodeAt(++d) & 255) << 24, b = 1540483477 * (b & 65535) + ((1540483477 * (b >>> 16) & 65535) << 16), b ^= b >>> 24, b = 1540483477 * (b & 65535) + ((1540483477 * (b >>> 16) & 65535) << 16), a = 1540483477 * (a & 65535) + ((1540483477 * (a >>> 16) & 65535) << 16) ^ b, e -= 4, ++d;
11550 }
11551 switch (e) {
11552 case 3:
11553 a ^= (c.charCodeAt(d + 2) & 255) << 16;
11554 case 2:
11555 a ^= (c.charCodeAt(d + 1) & 255) << 8;
11556 case 1:
11557 a ^= c.charCodeAt(d) & 255, a = 1540483477 * (a & 65535) + ((1540483477 * (a >>> 16) & 65535) << 16);
11558 }
11559 a ^= a >>> 13;
11560 a = 1540483477 * (a & 65535) + ((1540483477 * (a >>> 16) & 65535) << 16);
11561 return (a ^ a >>> 15) >>> 0;
11562 }
11563
11564 //
11565 /* eslint-disable no-bitwise */
11566
11567 /* This is the "capacity" of our alphabet i.e. 2x26 for all letters plus their capitalised
11568 * counterparts */
11569 var charsLength = 52;
11570
11571 /* start at 75 for 'a' until 'z' (25) and then start at 65 for capitalised letters */
11572 var getAlphabeticChar = function getAlphabeticChar(code) {
11573 return String.fromCharCode(code + (code > 25 ? 39 : 97));
11574 };
11575
11576 /* input a number, usually a hash and convert it to base-52 */
11577 function generateAlphabeticName(code) {
11578 var name = '';
11579 var x = void 0;
11580
11581 /* get a char and divide by alphabet-length */
11582 for (x = code; x > charsLength; x = Math.floor(x / charsLength)) {
11583 name = getAlphabeticChar(x % charsLength) + name;
11584 }
11585
11586 return getAlphabeticChar(x % charsLength) + name;
11587 }
11588
11589 //
11590
11591 function hasFunctionObjectKey(obj) {
11592 // eslint-disable-next-line guard-for-in, no-restricted-syntax
11593 for (var key in obj) {
11594 if (isFunction(obj[key])) {
11595 return true;
11596 }
11597 }
11598
11599 return false;
11600 }
11601
11602 function isStaticRules(rules, attrs) {
11603 for (var i = 0; i < rules.length; i += 1) {
11604 var rule = rules[i];
11605
11606 // recursive case
11607 if (Array.isArray(rule) && !isStaticRules(rule, attrs)) {
11608 return false;
11609 } else if (isFunction(rule) && !isStyledComponent(rule)) {
11610 // functions are allowed to be static if they're just being
11611 // used to get the classname of a nested styled component
11612 return false;
11613 }
11614 }
11615
11616 if (attrs.some(function (x) {
11617 return isFunction(x) || hasFunctionObjectKey(x);
11618 })) return false;
11619
11620 return true;
11621 }
11622
11623 //
11624
11625 /* combines hashStr (murmurhash) and nameGenerator for convenience */
11626 var hasher = function hasher(str) {
11627 return generateAlphabeticName(murmurhash(str));
11628 };
11629
11630 /*
11631 ComponentStyle is all the CSS-specific stuff, not
11632 the React-specific stuff.
11633 */
11634
11635 var ComponentStyle = function () {
11636 function ComponentStyle(rules, attrs, componentId) {
11637 classCallCheck(this, ComponentStyle);
11638
11639 this.rules = rules;
11640 this.isStatic = false && 0;
11641 this.componentId = componentId;
11642
11643 if (!StyleSheet.master.hasId(componentId)) {
11644 StyleSheet.master.deferredInject(componentId, []);
11645 }
11646 }
11647
11648 /*
11649 * Flattens a rule set into valid CSS
11650 * Hashes it, wraps the whole chunk in a .hash1234 {}
11651 * Returns the hash to be injected on render()
11652 * */
11653
11654
11655 ComponentStyle.prototype.generateAndInjectStyles = function generateAndInjectStyles(executionContext, styleSheet) {
11656 var isStatic = this.isStatic,
11657 componentId = this.componentId,
11658 lastClassName = this.lastClassName;
11659
11660 if (IS_BROWSER && isStatic && typeof lastClassName === 'string' && styleSheet.hasNameForId(componentId, lastClassName)) {
11661 return lastClassName;
11662 }
11663
11664 var flatCSS = flatten(this.rules, executionContext, styleSheet);
11665 var name = hasher(this.componentId + flatCSS.join(''));
11666 if (!styleSheet.hasNameForId(componentId, name)) {
11667 styleSheet.inject(this.componentId, stringifyRules(flatCSS, '.' + name, undefined, componentId), name);
11668 }
11669
11670 this.lastClassName = name;
11671 return name;
11672 };
11673
11674 ComponentStyle.generateName = function generateName(str) {
11675 return hasher(str);
11676 };
11677
11678 return ComponentStyle;
11679 }();
11680
11681 //
11682
11683 var LIMIT = 200;
11684
11685 var createWarnTooManyClasses = (function (displayName) {
11686 var generatedClasses = {};
11687 var warningSeen = false;
11688
11689 return function (className) {
11690 if (!warningSeen) {
11691 generatedClasses[className] = true;
11692 if (Object.keys(generatedClasses).length >= LIMIT) {
11693 // Unable to find latestRule in test environment.
11694 /* eslint-disable no-console, prefer-template */
11695 console.warn('Over ' + LIMIT + ' classes were generated for component ' + displayName + '. \n' + 'Consider using the attrs method, together with a style object for frequently changed styles.\n' + 'Example:\n' + ' const Component = styled.div.attrs(props => ({\n' + ' style: {\n' + ' background: props.background,\n' + ' },\n' + ' }))`width: 100%;`\n\n' + ' <Component />');
11696 warningSeen = true;
11697 generatedClasses = {};
11698 }
11699 }
11700 };
11701 });
11702
11703 //
11704
11705 var determineTheme = (function (props, fallbackTheme) {
11706 var defaultProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EMPTY_OBJECT;
11707
11708 // Props should take precedence over ThemeProvider, which should take precedence over
11709 // defaultProps, but React automatically puts defaultProps on props.
11710
11711 /* eslint-disable react/prop-types, flowtype-errors/show-errors */
11712 var isDefaultTheme = defaultProps ? props.theme === defaultProps.theme : false;
11713 var theme = props.theme && !isDefaultTheme ? props.theme : fallbackTheme || defaultProps.theme;
11714 /* eslint-enable */
11715
11716 return theme;
11717 });
11718
11719 //
11720 var escapeRegex = /[[\].#*$><+~=|^:(),"'`-]+/g;
11721 var dashesAtEnds = /(^-|-$)/g;
11722
11723 /**
11724 * TODO: Explore using CSS.escape when it becomes more available
11725 * in evergreen browsers.
11726 */
11727 function escape(str) {
11728 return str
11729 // Replace all possible CSS selectors
11730 .replace(escapeRegex, '-')
11731
11732 // Remove extraneous hyphens at the start and end
11733 .replace(dashesAtEnds, '');
11734 }
11735
11736 //
11737
11738 function isTag(target) {
11739 return typeof target === 'string' && ( true ? target.charAt(0) === target.charAt(0).toLowerCase() : 0);
11740 }
11741
11742 //
11743
11744 function generateDisplayName(target) {
11745 // $FlowFixMe
11746 return isTag(target) ? 'styled.' + target : 'Styled(' + getComponentName(target) + ')';
11747 }
11748
11749 var _TYPE_STATICS;
11750
11751 var REACT_STATICS = {
11752 childContextTypes: true,
11753 contextTypes: true,
11754 defaultProps: true,
11755 displayName: true,
11756 getDerivedStateFromProps: true,
11757 propTypes: true,
11758 type: true
11759 };
11760
11761 var KNOWN_STATICS = {
11762 name: true,
11763 length: true,
11764 prototype: true,
11765 caller: true,
11766 callee: true,
11767 arguments: true,
11768 arity: true
11769 };
11770
11771 var TYPE_STATICS = (_TYPE_STATICS = {}, _TYPE_STATICS[react_is__WEBPACK_IMPORTED_MODULE_4__.ForwardRef] = {
11772 $$typeof: true,
11773 render: true
11774 }, _TYPE_STATICS);
11775
11776 var defineProperty$1 = Object.defineProperty,
11777 getOwnPropertyNames = Object.getOwnPropertyNames,
11778 _Object$getOwnPropert = Object.getOwnPropertySymbols,
11779 getOwnPropertySymbols = _Object$getOwnPropert === undefined ? function () {
11780 return [];
11781 } : _Object$getOwnPropert,
11782 getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor,
11783 getPrototypeOf = Object.getPrototypeOf,
11784 objectPrototype = Object.prototype;
11785 var arrayPrototype = Array.prototype;
11786
11787
11788 function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
11789 if (typeof sourceComponent !== 'string') {
11790 // don't hoist over string (html) components
11791
11792 var inheritedComponent = getPrototypeOf(sourceComponent);
11793
11794 if (inheritedComponent && inheritedComponent !== objectPrototype) {
11795 hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
11796 }
11797
11798 var keys = arrayPrototype.concat(getOwnPropertyNames(sourceComponent),
11799 // $FlowFixMe
11800 getOwnPropertySymbols(sourceComponent));
11801
11802 var targetStatics = TYPE_STATICS[targetComponent.$$typeof] || REACT_STATICS;
11803
11804 var sourceStatics = TYPE_STATICS[sourceComponent.$$typeof] || REACT_STATICS;
11805
11806 var i = keys.length;
11807 var descriptor = void 0;
11808 var key = void 0;
11809
11810 // eslint-disable-next-line no-plusplus
11811 while (i--) {
11812 key = keys[i];
11813
11814 if (
11815 // $FlowFixMe
11816 !KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) &&
11817 // $FlowFixMe
11818 !(targetStatics && targetStatics[key])) {
11819 descriptor = getOwnPropertyDescriptor(sourceComponent, key);
11820
11821 if (descriptor) {
11822 try {
11823 // Avoid failures from read-only properties
11824 defineProperty$1(targetComponent, key, descriptor);
11825 } catch (e) {
11826 /* fail silently */
11827 }
11828 }
11829 }
11830 }
11831
11832 return targetComponent;
11833 }
11834
11835 return targetComponent;
11836 }
11837
11838 //
11839 function isDerivedReactComponent(fn) {
11840 return !!(fn && fn.prototype && fn.prototype.isReactComponent);
11841 }
11842
11843 //
11844 // Helper to call a given function, only once
11845 var once = (function (cb) {
11846 var called = false;
11847
11848 return function () {
11849 if (!called) {
11850 called = true;
11851 cb.apply(undefined, arguments);
11852 }
11853 };
11854 });
11855
11856 //
11857
11858 var ThemeContext = (0,react__WEBPACK_IMPORTED_MODULE_2__.createContext)();
11859
11860 var ThemeConsumer = ThemeContext.Consumer;
11861
11862 /**
11863 * Provide a theme to an entire react component tree via context
11864 */
11865
11866 var ThemeProvider = function (_Component) {
11867 inherits(ThemeProvider, _Component);
11868
11869 function ThemeProvider(props) {
11870 classCallCheck(this, ThemeProvider);
11871
11872 var _this = possibleConstructorReturn(this, _Component.call(this, props));
11873
11874 _this.getContext = (0,memoize_one__WEBPACK_IMPORTED_MODULE_7__["default"])(_this.getContext.bind(_this));
11875 _this.renderInner = _this.renderInner.bind(_this);
11876 return _this;
11877 }
11878
11879 ThemeProvider.prototype.render = function render() {
11880 if (!this.props.children) return null;
11881
11882 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
11883 ThemeContext.Consumer,
11884 null,
11885 this.renderInner
11886 );
11887 };
11888
11889 ThemeProvider.prototype.renderInner = function renderInner(outerTheme) {
11890 var context = this.getContext(this.props.theme, outerTheme);
11891
11892 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
11893 ThemeContext.Provider,
11894 { value: context },
11895 this.props.children
11896 );
11897 };
11898
11899 /**
11900 * Get the theme from the props, supporting both (outerTheme) => {}
11901 * as well as object notation
11902 */
11903
11904
11905 ThemeProvider.prototype.getTheme = function getTheme(theme, outerTheme) {
11906 if (isFunction(theme)) {
11907 var mergedTheme = theme(outerTheme);
11908
11909 if ( true && (mergedTheme === null || Array.isArray(mergedTheme) || (typeof mergedTheme === 'undefined' ? 'undefined' : _typeof(mergedTheme)) !== 'object')) {
11910 throw new StyledComponentsError(7);
11911 }
11912
11913 return mergedTheme;
11914 }
11915
11916 if (theme === null || Array.isArray(theme) || (typeof theme === 'undefined' ? 'undefined' : _typeof(theme)) !== 'object') {
11917 throw new StyledComponentsError(8);
11918 }
11919
11920 return _extends({}, outerTheme, theme);
11921 };
11922
11923 ThemeProvider.prototype.getContext = function getContext(theme, outerTheme) {
11924 return this.getTheme(theme, outerTheme);
11925 };
11926
11927 return ThemeProvider;
11928 }(react__WEBPACK_IMPORTED_MODULE_2__.Component);
11929
11930 //
11931
11932 var CLOSING_TAG_R = /^\s*<\/[a-z]/i;
11933
11934 var ServerStyleSheet = function () {
11935 function ServerStyleSheet() {
11936 classCallCheck(this, ServerStyleSheet);
11937
11938 /* The master sheet might be reset, so keep a reference here */
11939 this.masterSheet = StyleSheet.master;
11940 this.instance = this.masterSheet.clone();
11941 this.sealed = false;
11942 }
11943
11944 /**
11945 * Mark the ServerStyleSheet as being fully emitted and manually GC it from the
11946 * StyleSheet singleton.
11947 */
11948
11949
11950 ServerStyleSheet.prototype.seal = function seal() {
11951 if (!this.sealed) {
11952 /* Remove sealed StyleSheets from the master sheet */
11953 var index = this.masterSheet.clones.indexOf(this.instance);
11954 this.masterSheet.clones.splice(index, 1);
11955 this.sealed = true;
11956 }
11957 };
11958
11959 ServerStyleSheet.prototype.collectStyles = function collectStyles(children) {
11960 if (this.sealed) {
11961 throw new StyledComponentsError(2);
11962 }
11963
11964 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
11965 StyleSheetManager,
11966 { sheet: this.instance },
11967 children
11968 );
11969 };
11970
11971 ServerStyleSheet.prototype.getStyleTags = function getStyleTags() {
11972 this.seal();
11973 return this.instance.toHTML();
11974 };
11975
11976 ServerStyleSheet.prototype.getStyleElement = function getStyleElement() {
11977 this.seal();
11978 return this.instance.toReactElements();
11979 };
11980
11981 ServerStyleSheet.prototype.interleaveWithNodeStream = function interleaveWithNodeStream(readableStream) {
11982 var _this = this;
11983
11984 {
11985 throw new StyledComponentsError(3);
11986 }
11987
11988 /* the tag index keeps track of which tags have already been emitted */
11989 var instance = this.instance;
11990
11991 var instanceTagIndex = 0;
11992
11993 var streamAttr = SC_STREAM_ATTR + '="true"';
11994
11995 var transformer = new stream.Transform({
11996 transform: function appendStyleChunks(chunk, /* encoding */_, callback) {
11997 var tags = instance.tags;
11998
11999 var html = '';
12000
12001 /* retrieve html for each new style tag */
12002 for (; instanceTagIndex < tags.length; instanceTagIndex += 1) {
12003 var tag = tags[instanceTagIndex];
12004 html += tag.toHTML(streamAttr);
12005 }
12006
12007 /* force our StyleSheets to emit entirely new tags */
12008 instance.sealAllTags();
12009
12010 var renderedHtml = chunk.toString();
12011
12012 /* prepend style html to chunk, unless the start of the chunk is a closing tag in which case append right after that */
12013 if (CLOSING_TAG_R.test(renderedHtml)) {
12014 var endOfClosingTag = renderedHtml.indexOf('>');
12015
12016 this.push(renderedHtml.slice(0, endOfClosingTag + 1) + html + renderedHtml.slice(endOfClosingTag + 1));
12017 } else this.push(html + renderedHtml);
12018
12019 callback();
12020 }
12021 });
12022
12023 readableStream.on('end', function () {
12024 return _this.seal();
12025 });
12026
12027 readableStream.on('error', function (err) {
12028 _this.seal();
12029
12030 // forward the error to the transform stream
12031 transformer.emit('error', err);
12032 });
12033
12034 return readableStream.pipe(transformer);
12035 };
12036
12037 return ServerStyleSheet;
12038 }();
12039
12040 //
12041
12042 var StyleSheetContext = (0,react__WEBPACK_IMPORTED_MODULE_2__.createContext)();
12043 var StyleSheetConsumer = StyleSheetContext.Consumer;
12044
12045 var StyleSheetManager = function (_Component) {
12046 inherits(StyleSheetManager, _Component);
12047
12048 function StyleSheetManager(props) {
12049 classCallCheck(this, StyleSheetManager);
12050
12051 var _this = possibleConstructorReturn(this, _Component.call(this, props));
12052
12053 _this.getContext = (0,memoize_one__WEBPACK_IMPORTED_MODULE_7__["default"])(_this.getContext);
12054 return _this;
12055 }
12056
12057 StyleSheetManager.prototype.getContext = function getContext(sheet, target) {
12058 if (sheet) {
12059 return sheet;
12060 } else if (target) {
12061 return new StyleSheet(target);
12062 } else {
12063 throw new StyledComponentsError(4);
12064 }
12065 };
12066
12067 StyleSheetManager.prototype.render = function render() {
12068 var _props = this.props,
12069 children = _props.children,
12070 sheet = _props.sheet,
12071 target = _props.target;
12072
12073
12074 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12075 StyleSheetContext.Provider,
12076 { value: this.getContext(sheet, target) },
12077 true ? react__WEBPACK_IMPORTED_MODULE_2___default().Children.only(children) : 0
12078 );
12079 };
12080
12081 return StyleSheetManager;
12082 }(react__WEBPACK_IMPORTED_MODULE_2__.Component);
12083 true ? StyleSheetManager.propTypes = {
12084 sheet: prop_types__WEBPACK_IMPORTED_MODULE_8___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_8___default().instanceOf(StyleSheet), prop_types__WEBPACK_IMPORTED_MODULE_8___default().instanceOf(ServerStyleSheet)]),
12085
12086 target: prop_types__WEBPACK_IMPORTED_MODULE_8___default().shape({
12087 appendChild: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().func.isRequired)
12088 })
12089 } : 0;
12090
12091 //
12092
12093 var identifiers = {};
12094
12095 /* We depend on components having unique IDs */
12096 function generateId(_ComponentStyle, _displayName, parentComponentId) {
12097 var displayName = typeof _displayName !== 'string' ? 'sc' : escape(_displayName);
12098
12099 /**
12100 * This ensures uniqueness if two components happen to share
12101 * the same displayName.
12102 */
12103 var nr = (identifiers[displayName] || 0) + 1;
12104 identifiers[displayName] = nr;
12105
12106 var componentId = displayName + '-' + _ComponentStyle.generateName(displayName + nr);
12107
12108 return parentComponentId ? parentComponentId + '-' + componentId : componentId;
12109 }
12110
12111 // $FlowFixMe
12112
12113 var StyledComponent = function (_Component) {
12114 inherits(StyledComponent, _Component);
12115
12116 function StyledComponent() {
12117 classCallCheck(this, StyledComponent);
12118
12119 var _this = possibleConstructorReturn(this, _Component.call(this));
12120
12121 _this.attrs = {};
12122
12123 _this.renderOuter = _this.renderOuter.bind(_this);
12124 _this.renderInner = _this.renderInner.bind(_this);
12125
12126 if (true) {
12127 _this.warnInnerRef = once(function (displayName) {
12128 return (
12129 // eslint-disable-next-line no-console
12130 console.warn('The "innerRef" API has been removed in styled-components v4 in favor of React 16 ref forwarding, use "ref" instead like a typical component. "innerRef" was detected on component "' + displayName + '".')
12131 );
12132 });
12133
12134 _this.warnAttrsFnObjectKeyDeprecated = once(function (key, displayName) {
12135 return (
12136 // eslint-disable-next-line no-console
12137 console.warn('Functions as object-form attrs({}) keys are now deprecated and will be removed in a future version of styled-components. Switch to the new attrs(props => ({})) syntax instead for easier and more powerful composition. The attrs key in question is "' + key + '" on component "' + displayName + '".', '\n ' + new Error().stack)
12138 );
12139 });
12140
12141 _this.warnNonStyledComponentAttrsObjectKey = once(function (key, displayName) {
12142 return (
12143 // eslint-disable-next-line no-console
12144 console.warn('It looks like you\'ve used a non styled-component as the value for the "' + key + '" prop in an object-form attrs constructor of "' + displayName + '".\n' + 'You should use the new function-form attrs constructor which avoids this issue: attrs(props => ({ yourStuff }))\n' + "To continue using the deprecated object syntax, you'll need to wrap your component prop in a function to make it available inside the styled component (you'll still get the deprecation warning though.)\n" + ('For example, { ' + key + ': () => InnerComponent } instead of { ' + key + ': InnerComponent }'))
12145 );
12146 });
12147 }
12148 return _this;
12149 }
12150
12151 StyledComponent.prototype.render = function render() {
12152 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12153 StyleSheetConsumer,
12154 null,
12155 this.renderOuter
12156 );
12157 };
12158
12159 StyledComponent.prototype.renderOuter = function renderOuter() {
12160 var styleSheet = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : StyleSheet.master;
12161
12162 this.styleSheet = styleSheet;
12163
12164 // No need to subscribe a static component to theme changes, it won't change anything
12165 if (this.props.forwardedComponent.componentStyle.isStatic) return this.renderInner();
12166
12167 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12168 ThemeConsumer,
12169 null,
12170 this.renderInner
12171 );
12172 };
12173
12174 StyledComponent.prototype.renderInner = function renderInner(theme) {
12175 var _props$forwardedCompo = this.props.forwardedComponent,
12176 componentStyle = _props$forwardedCompo.componentStyle,
12177 defaultProps = _props$forwardedCompo.defaultProps,
12178 displayName = _props$forwardedCompo.displayName,
12179 foldedComponentIds = _props$forwardedCompo.foldedComponentIds,
12180 styledComponentId = _props$forwardedCompo.styledComponentId,
12181 target = _props$forwardedCompo.target;
12182
12183
12184 var generatedClassName = void 0;
12185 if (componentStyle.isStatic) {
12186 generatedClassName = this.generateAndInjectStyles(EMPTY_OBJECT, this.props);
12187 } else {
12188 generatedClassName = this.generateAndInjectStyles(determineTheme(this.props, theme, defaultProps) || EMPTY_OBJECT, this.props);
12189 }
12190
12191 var elementToBeCreated = this.props.as || this.attrs.as || target;
12192 var isTargetTag = isTag(elementToBeCreated);
12193
12194 var propsForElement = {};
12195 var computedProps = _extends({}, this.props, this.attrs);
12196
12197 var key = void 0;
12198 // eslint-disable-next-line guard-for-in
12199 for (key in computedProps) {
12200 if ( true && key === 'innerRef' && isTargetTag) {
12201 this.warnInnerRef(displayName);
12202 }
12203
12204 if (key === 'forwardedComponent' || key === 'as') {
12205 continue;
12206 } else if (key === 'forwardedRef') propsForElement.ref = computedProps[key];else if (key === 'forwardedAs') propsForElement.as = computedProps[key];else if (!isTargetTag || (0,_emotion_is_prop_valid__WEBPACK_IMPORTED_MODULE_5__["default"])(key)) {
12207 // Don't pass through non HTML tags through to HTML elements
12208 propsForElement[key] = computedProps[key];
12209 }
12210 }
12211
12212 if (this.props.style && this.attrs.style) {
12213 propsForElement.style = _extends({}, this.attrs.style, this.props.style);
12214 }
12215
12216 propsForElement.className = Array.prototype.concat(foldedComponentIds, styledComponentId, generatedClassName !== styledComponentId ? generatedClassName : null, this.props.className, this.attrs.className).filter(Boolean).join(' ');
12217
12218 return (0,react__WEBPACK_IMPORTED_MODULE_2__.createElement)(elementToBeCreated, propsForElement);
12219 };
12220
12221 StyledComponent.prototype.buildExecutionContext = function buildExecutionContext(theme, props, attrs) {
12222 var _this2 = this;
12223
12224 var context = _extends({}, props, { theme: theme });
12225
12226 if (!attrs.length) return context;
12227
12228 this.attrs = {};
12229
12230 attrs.forEach(function (attrDef) {
12231 var resolvedAttrDef = attrDef;
12232 var attrDefWasFn = false;
12233 var attr = void 0;
12234 var key = void 0;
12235
12236 if (isFunction(resolvedAttrDef)) {
12237 // $FlowFixMe
12238 resolvedAttrDef = resolvedAttrDef(context);
12239 attrDefWasFn = true;
12240 }
12241
12242 /* eslint-disable guard-for-in */
12243 // $FlowFixMe
12244 for (key in resolvedAttrDef) {
12245 attr = resolvedAttrDef[key];
12246
12247 if (!attrDefWasFn) {
12248 if (isFunction(attr) && !isDerivedReactComponent(attr) && !isStyledComponent(attr)) {
12249 if (true) {
12250 _this2.warnAttrsFnObjectKeyDeprecated(key, props.forwardedComponent.displayName);
12251 }
12252
12253 attr = attr(context);
12254
12255 if ( true && react__WEBPACK_IMPORTED_MODULE_2___default().isValidElement(attr)) {
12256 _this2.warnNonStyledComponentAttrsObjectKey(key, props.forwardedComponent.displayName);
12257 }
12258 }
12259 }
12260
12261 _this2.attrs[key] = attr;
12262 context[key] = attr;
12263 }
12264 /* eslint-enable */
12265 });
12266
12267 return context;
12268 };
12269
12270 StyledComponent.prototype.generateAndInjectStyles = function generateAndInjectStyles(theme, props) {
12271 var _props$forwardedCompo2 = props.forwardedComponent,
12272 attrs = _props$forwardedCompo2.attrs,
12273 componentStyle = _props$forwardedCompo2.componentStyle,
12274 warnTooManyClasses = _props$forwardedCompo2.warnTooManyClasses;
12275
12276 // statically styled-components don't need to build an execution context object,
12277 // and shouldn't be increasing the number of class names
12278
12279 if (componentStyle.isStatic && !attrs.length) {
12280 return componentStyle.generateAndInjectStyles(EMPTY_OBJECT, this.styleSheet);
12281 }
12282
12283 var className = componentStyle.generateAndInjectStyles(this.buildExecutionContext(theme, props, attrs), this.styleSheet);
12284
12285 if ( true && warnTooManyClasses) warnTooManyClasses(className);
12286
12287 return className;
12288 };
12289
12290 return StyledComponent;
12291 }(react__WEBPACK_IMPORTED_MODULE_2__.Component);
12292
12293 function createStyledComponent(target, options, rules) {
12294 var isTargetStyledComp = isStyledComponent(target);
12295 var isClass = !isTag(target);
12296
12297 var _options$displayName = options.displayName,
12298 displayName = _options$displayName === undefined ? generateDisplayName(target) : _options$displayName,
12299 _options$componentId = options.componentId,
12300 componentId = _options$componentId === undefined ? generateId(ComponentStyle, options.displayName, options.parentComponentId) : _options$componentId,
12301 _options$ParentCompon = options.ParentComponent,
12302 ParentComponent = _options$ParentCompon === undefined ? StyledComponent : _options$ParentCompon,
12303 _options$attrs = options.attrs,
12304 attrs = _options$attrs === undefined ? EMPTY_ARRAY : _options$attrs;
12305
12306
12307 var styledComponentId = options.displayName && options.componentId ? escape(options.displayName) + '-' + options.componentId : options.componentId || componentId;
12308
12309 // fold the underlying StyledComponent attrs up (implicit extend)
12310 var finalAttrs =
12311 // $FlowFixMe
12312 isTargetStyledComp && target.attrs ? Array.prototype.concat(target.attrs, attrs).filter(Boolean) : attrs;
12313
12314 var componentStyle = new ComponentStyle(isTargetStyledComp ? // fold the underlying StyledComponent rules up (implicit extend)
12315 // $FlowFixMe
12316 target.componentStyle.rules.concat(rules) : rules, finalAttrs, styledComponentId);
12317
12318 /**
12319 * forwardRef creates a new interim component, which we'll take advantage of
12320 * instead of extending ParentComponent to create _another_ interim class
12321 */
12322 var WrappedStyledComponent = void 0;
12323 var forwardRef = function forwardRef(props, ref) {
12324 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(ParentComponent, _extends({}, props, { forwardedComponent: WrappedStyledComponent, forwardedRef: ref }));
12325 };
12326 forwardRef.displayName = displayName;
12327 WrappedStyledComponent = react__WEBPACK_IMPORTED_MODULE_2___default().forwardRef(forwardRef);
12328 WrappedStyledComponent.displayName = displayName;
12329
12330 // $FlowFixMe
12331 WrappedStyledComponent.attrs = finalAttrs;
12332 // $FlowFixMe
12333 WrappedStyledComponent.componentStyle = componentStyle;
12334
12335 // $FlowFixMe
12336 WrappedStyledComponent.foldedComponentIds = isTargetStyledComp ? // $FlowFixMe
12337 Array.prototype.concat(target.foldedComponentIds, target.styledComponentId) : EMPTY_ARRAY;
12338
12339 // $FlowFixMe
12340 WrappedStyledComponent.styledComponentId = styledComponentId;
12341
12342 // fold the underlying StyledComponent target up since we folded the styles
12343 // $FlowFixMe
12344 WrappedStyledComponent.target = isTargetStyledComp ? target.target : target;
12345
12346 // $FlowFixMe
12347 WrappedStyledComponent.withComponent = function withComponent(tag) {
12348 var previousComponentId = options.componentId,
12349 optionsToCopy = objectWithoutProperties(options, ['componentId']);
12350
12351
12352 var newComponentId = previousComponentId && previousComponentId + '-' + (isTag(tag) ? tag : escape(getComponentName(tag)));
12353
12354 var newOptions = _extends({}, optionsToCopy, {
12355 attrs: finalAttrs,
12356 componentId: newComponentId,
12357 ParentComponent: ParentComponent
12358 });
12359
12360 return createStyledComponent(tag, newOptions, rules);
12361 };
12362
12363 // $FlowFixMe
12364 Object.defineProperty(WrappedStyledComponent, 'defaultProps', {
12365 get: function get$$1() {
12366 return this._foldedDefaultProps;
12367 },
12368 set: function set$$1(obj) {
12369 // $FlowFixMe
12370 this._foldedDefaultProps = isTargetStyledComp ? (0,merge_anything__WEBPACK_IMPORTED_MODULE_6__["default"])(target.defaultProps, obj) : obj;
12371 }
12372 });
12373
12374 if (true) {
12375 // $FlowFixMe
12376 WrappedStyledComponent.warnTooManyClasses = createWarnTooManyClasses(displayName);
12377 }
12378
12379 // $FlowFixMe
12380 WrappedStyledComponent.toString = function () {
12381 return '.' + WrappedStyledComponent.styledComponentId;
12382 };
12383
12384 if (isClass) {
12385 hoistNonReactStatics(WrappedStyledComponent, target, {
12386 // all SC-specific things should not be hoisted
12387 attrs: true,
12388 componentStyle: true,
12389 displayName: true,
12390 foldedComponentIds: true,
12391 styledComponentId: true,
12392 target: true,
12393 withComponent: true
12394 });
12395 }
12396
12397 return WrappedStyledComponent;
12398 }
12399
12400 //
12401 // Thanks to ReactDOMFactories for this handy list!
12402
12403 var domElements = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr',
12404
12405 // SVG
12406 'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'marker', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];
12407
12408 //
12409
12410 var styled = function styled(tag) {
12411 return constructWithOptions(createStyledComponent, tag);
12412 };
12413
12414 // Shorthands for all valid HTML Elements
12415 domElements.forEach(function (domElement) {
12416 styled[domElement] = styled(domElement);
12417 });
12418
12419 //
12420
12421 var GlobalStyle = function () {
12422 function GlobalStyle(rules, componentId) {
12423 classCallCheck(this, GlobalStyle);
12424
12425 this.rules = rules;
12426 this.componentId = componentId;
12427 this.isStatic = isStaticRules(rules, EMPTY_ARRAY);
12428
12429 if (!StyleSheet.master.hasId(componentId)) {
12430 StyleSheet.master.deferredInject(componentId, []);
12431 }
12432 }
12433
12434 GlobalStyle.prototype.createStyles = function createStyles(executionContext, styleSheet) {
12435 var flatCSS = flatten(this.rules, executionContext, styleSheet);
12436 var css = stringifyRules(flatCSS, '');
12437
12438 styleSheet.inject(this.componentId, css);
12439 };
12440
12441 GlobalStyle.prototype.removeStyles = function removeStyles(styleSheet) {
12442 var componentId = this.componentId;
12443
12444 if (styleSheet.hasId(componentId)) {
12445 styleSheet.remove(componentId);
12446 }
12447 };
12448
12449 // TODO: overwrite in-place instead of remove+create?
12450
12451
12452 GlobalStyle.prototype.renderStyles = function renderStyles(executionContext, styleSheet) {
12453 this.removeStyles(styleSheet);
12454 this.createStyles(executionContext, styleSheet);
12455 };
12456
12457 return GlobalStyle;
12458 }();
12459
12460 //
12461
12462 // place our cache into shared context so it'll persist between HMRs
12463 if (IS_BROWSER) {
12464 window.scCGSHMRCache = {};
12465 }
12466
12467 function createGlobalStyle(strings) {
12468 for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
12469 interpolations[_key - 1] = arguments[_key];
12470 }
12471
12472 var rules = css.apply(undefined, [strings].concat(interpolations));
12473 var id = 'sc-global-' + murmurhash(JSON.stringify(rules));
12474 var style = new GlobalStyle(rules, id);
12475
12476 var GlobalStyleComponent = function (_React$Component) {
12477 inherits(GlobalStyleComponent, _React$Component);
12478
12479 function GlobalStyleComponent(props) {
12480 classCallCheck(this, GlobalStyleComponent);
12481
12482 var _this = possibleConstructorReturn(this, _React$Component.call(this, props));
12483
12484 var _this$constructor = _this.constructor,
12485 globalStyle = _this$constructor.globalStyle,
12486 styledComponentId = _this$constructor.styledComponentId;
12487
12488
12489 if (IS_BROWSER) {
12490 window.scCGSHMRCache[styledComponentId] = (window.scCGSHMRCache[styledComponentId] || 0) + 1;
12491 }
12492
12493 /**
12494 * This fixes HMR compatibility. Don't ask me why, but this combination of
12495 * caching the closure variables via statics and then persisting the statics in
12496 * state works across HMR where no other combination did. ¯\_(ツ)_/¯
12497 */
12498 _this.state = {
12499 globalStyle: globalStyle,
12500 styledComponentId: styledComponentId
12501 };
12502 return _this;
12503 }
12504
12505 GlobalStyleComponent.prototype.componentWillUnmount = function componentWillUnmount() {
12506 if (window.scCGSHMRCache[this.state.styledComponentId]) {
12507 window.scCGSHMRCache[this.state.styledComponentId] -= 1;
12508 }
12509 /**
12510 * Depending on the order "render" is called this can cause the styles to be lost
12511 * until the next render pass of the remaining instance, which may
12512 * not be immediate.
12513 */
12514 if (window.scCGSHMRCache[this.state.styledComponentId] === 0) {
12515 this.state.globalStyle.removeStyles(this.styleSheet);
12516 }
12517 };
12518
12519 GlobalStyleComponent.prototype.render = function render() {
12520 var _this2 = this;
12521
12522 if ( true && react__WEBPACK_IMPORTED_MODULE_2___default().Children.count(this.props.children)) {
12523 // eslint-disable-next-line no-console
12524 console.warn('The global style component ' + this.state.styledComponentId + ' was given child JSX. createGlobalStyle does not render children.');
12525 }
12526
12527 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12528 StyleSheetConsumer,
12529 null,
12530 function (styleSheet) {
12531 _this2.styleSheet = styleSheet || StyleSheet.master;
12532
12533 var globalStyle = _this2.state.globalStyle;
12534
12535
12536 if (globalStyle.isStatic) {
12537 globalStyle.renderStyles(STATIC_EXECUTION_CONTEXT, _this2.styleSheet);
12538
12539 return null;
12540 } else {
12541 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12542 ThemeConsumer,
12543 null,
12544 function (theme) {
12545 // $FlowFixMe
12546 var defaultProps = _this2.constructor.defaultProps;
12547
12548
12549 var context = _extends({}, _this2.props);
12550
12551 if (typeof theme !== 'undefined') {
12552 context.theme = determineTheme(_this2.props, theme, defaultProps);
12553 }
12554
12555 globalStyle.renderStyles(context, _this2.styleSheet);
12556
12557 return null;
12558 }
12559 );
12560 }
12561 }
12562 );
12563 };
12564
12565 return GlobalStyleComponent;
12566 }((react__WEBPACK_IMPORTED_MODULE_2___default().Component));
12567
12568 GlobalStyleComponent.globalStyle = style;
12569 GlobalStyleComponent.styledComponentId = id;
12570
12571
12572 return GlobalStyleComponent;
12573 }
12574
12575 //
12576
12577 var replaceWhitespace = function replaceWhitespace(str) {
12578 return str.replace(/\s|\\n/g, '');
12579 };
12580
12581 function keyframes(strings) {
12582 /* Warning if you've used keyframes on React Native */
12583 if ( true && typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
12584 // eslint-disable-next-line no-console
12585 console.warn('`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.');
12586 }
12587
12588 for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
12589 interpolations[_key - 1] = arguments[_key];
12590 }
12591
12592 var rules = css.apply(undefined, [strings].concat(interpolations));
12593
12594 var name = generateAlphabeticName(murmurhash(replaceWhitespace(JSON.stringify(rules))));
12595
12596 return new Keyframes(name, stringifyRules(rules, name, '@keyframes'));
12597 }
12598
12599 //
12600
12601 var withTheme = (function (Component$$1) {
12602 var WithTheme = react__WEBPACK_IMPORTED_MODULE_2___default().forwardRef(function (props, ref) {
12603 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
12604 ThemeConsumer,
12605 null,
12606 function (theme) {
12607 // $FlowFixMe
12608 var defaultProps = Component$$1.defaultProps;
12609
12610 var themeProp = determineTheme(props, theme, defaultProps);
12611
12612 if ( true && themeProp === undefined) {
12613 // eslint-disable-next-line no-console
12614 console.warn('[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps in component class "' + getComponentName(Component$$1) + '"');
12615 }
12616
12617 return react__WEBPACK_IMPORTED_MODULE_2___default().createElement(Component$$1, _extends({}, props, { theme: themeProp, ref: ref }));
12618 }
12619 );
12620 });
12621
12622 hoistNonReactStatics(WithTheme, Component$$1);
12623
12624 WithTheme.displayName = 'WithTheme(' + getComponentName(Component$$1) + ')';
12625
12626 return WithTheme;
12627 });
12628
12629 //
12630
12631 /* eslint-disable */
12632 var __DO_NOT_USE_OR_YOU_WILL_BE_HAUNTED_BY_SPOOKY_GHOSTS = {
12633 StyleSheet: StyleSheet
12634 };
12635
12636 //
12637
12638 /* Warning if you've imported this file on React Native */
12639 if ( true && typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
12640 // eslint-disable-next-line no-console
12641 console.warn("It looks like you've imported 'styled-components' on React Native.\n" + "Perhaps you're looking to import 'styled-components/native'?\n" + 'Read more about this at https://www.styled-components.com/docs/basics#react-native');
12642 }
12643
12644 /* Warning if there are several instances of styled-components */
12645 if ( true && typeof window !== 'undefined' && typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' && navigator.userAgent.indexOf('Node.js') === -1 && navigator.userAgent.indexOf('jsdom') === -1) {
12646 window['__styled-components-init__'] = window['__styled-components-init__'] || 0;
12647
12648 if (window['__styled-components-init__'] === 1) {
12649 // eslint-disable-next-line no-console
12650 console.warn("It looks like there are several instances of 'styled-components' initialized in this application. " + 'This may cause dynamic styles not rendering properly, errors happening during rehydration process ' + 'and makes your application bigger without a good reason.\n\n' + 'See https://s-c.sh/2BAXzed for more info.');
12651 }
12652
12653 window['__styled-components-init__'] += 1;
12654 }
12655
12656 //
12657
12658 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (styled);
12659
12660 //# sourceMappingURL=styled-components.browser.esm.js.map
12661
12662
12663 /***/ }),
12664
12665 /***/ "./node_modules/stylis-rule-sheet/index.js":
12666 /*!*************************************************!*\
12667 !*** ./node_modules/stylis-rule-sheet/index.js ***!
12668 \*************************************************/
12669 /***/ ((module) => {
12670
12671 (function (factory) {
12672 true ? (module['exports'] = factory()) :
12673 0
12674 }(function () {
12675
12676 'use strict'
12677
12678 return function (insertRule) {
12679 var delimiter = '/*|*/'
12680 var needle = delimiter+'}'
12681
12682 function toSheet (block) {
12683 if (block)
12684 try {
12685 insertRule(block + '}')
12686 } catch (e) {}
12687 }
12688
12689 return function ruleSheet (context, content, selectors, parents, line, column, length, ns, depth, at) {
12690 switch (context) {
12691 // property
12692 case 1:
12693 // @import
12694 if (depth === 0 && content.charCodeAt(0) === 64)
12695 return insertRule(content+';'), ''
12696 break
12697 // selector
12698 case 2:
12699 if (ns === 0)
12700 return content + delimiter
12701 break
12702 // at-rule
12703 case 3:
12704 switch (ns) {
12705 // @font-face, @page
12706 case 102:
12707 case 112:
12708 return insertRule(selectors[0]+content), ''
12709 default:
12710 return content + (at === 0 ? delimiter : '')
12711 }
12712 case -2:
12713 content.split(needle).forEach(toSheet)
12714 }
12715 }
12716 }
12717 }))
12718
12719
12720 /***/ }),
12721
12722 /***/ "./node_modules/stylis/stylis.min.js":
12723 /*!*******************************************!*\
12724 !*** ./node_modules/stylis/stylis.min.js ***!
12725 \*******************************************/
12726 /***/ ((module) => {
12727
12728 !function(e){ true?module.exports=e(null):0}(function e(a){"use strict";var r=/^\0+/g,c=/[\0\r\f]/g,s=/: */g,t=/zoo|gra/,i=/([,: ])(transform)/g,f=/,+\s*(?![^(]*[)])/g,n=/ +\s*(?![^(]*[)])/g,l=/ *[\0] */g,o=/,\r+?/g,h=/([\t\r\n ])*\f?&/g,u=/:global\(((?:[^\(\)\[\]]*|\[.*\]|\([^\(\)]*\))*)\)/g,d=/\W+/g,b=/@(k\w+)\s*(\S*)\s*/,p=/::(place)/g,k=/:(read-only)/g,g=/\s+(?=[{\];=:>])/g,A=/([[}=:>])\s+/g,C=/(\{[^{]+?);(?=\})/g,w=/\s{2,}/g,v=/([^\(])(:+) */g,m=/[svh]\w+-[tblr]{2}/,x=/\(\s*(.*)\s*\)/g,$=/([\s\S]*?);/g,y=/-self|flex-/g,O=/[^]*?(:[rp][el]a[\w-]+)[^]*/,j=/stretch|:\s*\w+\-(?:conte|avail)/,z=/([^-])(image-set\()/,N="-webkit-",S="-moz-",F="-ms-",W=59,q=125,B=123,D=40,E=41,G=91,H=93,I=10,J=13,K=9,L=64,M=32,P=38,Q=45,R=95,T=42,U=44,V=58,X=39,Y=34,Z=47,_=62,ee=43,ae=126,re=0,ce=12,se=11,te=107,ie=109,fe=115,ne=112,le=111,oe=105,he=99,ue=100,de=112,be=1,pe=1,ke=0,ge=1,Ae=1,Ce=1,we=0,ve=0,me=0,xe=[],$e=[],ye=0,Oe=null,je=-2,ze=-1,Ne=0,Se=1,Fe=2,We=3,qe=0,Be=1,De="",Ee="",Ge="";function He(e,a,s,t,i){for(var f,n,o=0,h=0,u=0,d=0,g=0,A=0,C=0,w=0,m=0,$=0,y=0,O=0,j=0,z=0,R=0,we=0,$e=0,Oe=0,je=0,ze=s.length,Je=ze-1,Re="",Te="",Ue="",Ve="",Xe="",Ye="";R<ze;){if(C=s.charCodeAt(R),R===Je)if(h+d+u+o!==0){if(0!==h)C=h===Z?I:Z;d=u=o=0,ze++,Je++}if(h+d+u+o===0){if(R===Je){if(we>0)Te=Te.replace(c,"");if(Te.trim().length>0){switch(C){case M:case K:case W:case J:case I:break;default:Te+=s.charAt(R)}C=W}}if(1===$e)switch(C){case B:case q:case W:case Y:case X:case D:case E:case U:$e=0;case K:case J:case I:case M:break;default:for($e=0,je=R,g=C,R--,C=W;je<ze;)switch(s.charCodeAt(je++)){case I:case J:case W:++R,C=g,je=ze;break;case V:if(we>0)++R,C=g;case B:je=ze}}switch(C){case B:for(g=(Te=Te.trim()).charCodeAt(0),y=1,je=++R;R<ze;){switch(C=s.charCodeAt(R)){case B:y++;break;case q:y--;break;case Z:switch(A=s.charCodeAt(R+1)){case T:case Z:R=Qe(A,R,Je,s)}break;case G:C++;case D:C++;case Y:case X:for(;R++<Je&&s.charCodeAt(R)!==C;);}if(0===y)break;R++}if(Ue=s.substring(je,R),g===re)g=(Te=Te.replace(r,"").trim()).charCodeAt(0);switch(g){case L:if(we>0)Te=Te.replace(c,"");switch(A=Te.charCodeAt(1)){case ue:case ie:case fe:case Q:f=a;break;default:f=xe}if(je=(Ue=He(a,f,Ue,A,i+1)).length,me>0&&0===je)je=Te.length;if(ye>0)if(f=Ie(xe,Te,Oe),n=Pe(We,Ue,f,a,pe,be,je,A,i,t),Te=f.join(""),void 0!==n)if(0===(je=(Ue=n.trim()).length))A=0,Ue="";if(je>0)switch(A){case fe:Te=Te.replace(x,Me);case ue:case ie:case Q:Ue=Te+"{"+Ue+"}";break;case te:if(Ue=(Te=Te.replace(b,"$1 $2"+(Be>0?De:"")))+"{"+Ue+"}",1===Ae||2===Ae&&Le("@"+Ue,3))Ue="@"+N+Ue+"@"+Ue;else Ue="@"+Ue;break;default:if(Ue=Te+Ue,t===de)Ve+=Ue,Ue=""}else Ue="";break;default:Ue=He(a,Ie(a,Te,Oe),Ue,t,i+1)}Xe+=Ue,O=0,$e=0,z=0,we=0,Oe=0,j=0,Te="",Ue="",C=s.charCodeAt(++R);break;case q:case W:if((je=(Te=(we>0?Te.replace(c,""):Te).trim()).length)>1){if(0===z)if((g=Te.charCodeAt(0))===Q||g>96&&g<123)je=(Te=Te.replace(" ",":")).length;if(ye>0)if(void 0!==(n=Pe(Se,Te,a,e,pe,be,Ve.length,t,i,t)))if(0===(je=(Te=n.trim()).length))Te="\0\0";switch(g=Te.charCodeAt(0),A=Te.charCodeAt(1),g){case re:break;case L:if(A===oe||A===he){Ye+=Te+s.charAt(R);break}default:if(Te.charCodeAt(je-1)===V)break;Ve+=Ke(Te,g,A,Te.charCodeAt(2))}}O=0,$e=0,z=0,we=0,Oe=0,Te="",C=s.charCodeAt(++R)}}switch(C){case J:case I:if(h+d+u+o+ve===0)switch($){case E:case X:case Y:case L:case ae:case _:case T:case ee:case Z:case Q:case V:case U:case W:case B:case q:break;default:if(z>0)$e=1}if(h===Z)h=0;else if(ge+O===0&&t!==te&&Te.length>0)we=1,Te+="\0";if(ye*qe>0)Pe(Ne,Te,a,e,pe,be,Ve.length,t,i,t);be=1,pe++;break;case W:case q:if(h+d+u+o===0){be++;break}default:switch(be++,Re=s.charAt(R),C){case K:case M:if(d+o+h===0)switch(w){case U:case V:case K:case M:Re="";break;default:if(C!==M)Re=" "}break;case re:Re="\\0";break;case ce:Re="\\f";break;case se:Re="\\v";break;case P:if(d+h+o===0&&ge>0)Oe=1,we=1,Re="\f"+Re;break;case 108:if(d+h+o+ke===0&&z>0)switch(R-z){case 2:if(w===ne&&s.charCodeAt(R-3)===V)ke=w;case 8:if(m===le)ke=m}break;case V:if(d+h+o===0)z=R;break;case U:if(h+u+d+o===0)we=1,Re+="\r";break;case Y:case X:if(0===h)d=d===C?0:0===d?C:d;break;case G:if(d+h+u===0)o++;break;case H:if(d+h+u===0)o--;break;case E:if(d+h+o===0)u--;break;case D:if(d+h+o===0){if(0===O)switch(2*w+3*m){case 533:break;default:y=0,O=1}u++}break;case L:if(h+u+d+o+z+j===0)j=1;break;case T:case Z:if(d+o+u>0)break;switch(h){case 0:switch(2*C+3*s.charCodeAt(R+1)){case 235:h=Z;break;case 220:je=R,h=T}break;case T:if(C===Z&&w===T&&je+2!==R){if(33===s.charCodeAt(je+2))Ve+=s.substring(je,R+1);Re="",h=0}}}if(0===h){if(ge+d+o+j===0&&t!==te&&C!==W)switch(C){case U:case ae:case _:case ee:case E:case D:if(0===O){switch(w){case K:case M:case I:case J:Re+="\0";break;default:Re="\0"+Re+(C===U?"":"\0")}we=1}else switch(C){case D:if(z+7===R&&108===w)z=0;O=++y;break;case E:if(0==(O=--y))we=1,Re+="\0"}break;case K:case M:switch(w){case re:case B:case q:case W:case U:case ce:case K:case M:case I:case J:break;default:if(0===O)we=1,Re+="\0"}}if(Te+=Re,C!==M&&C!==K)$=C}}m=w,w=C,R++}if(je=Ve.length,me>0)if(0===je&&0===Xe.length&&0===a[0].length==false)if(t!==ie||1===a.length&&(ge>0?Ee:Ge)===a[0])je=a.join(",").length+2;if(je>0){if(f=0===ge&&t!==te?function(e){for(var a,r,s=0,t=e.length,i=Array(t);s<t;++s){for(var f=e[s].split(l),n="",o=0,h=0,u=0,d=0,b=f.length;o<b;++o){if(0===(h=(r=f[o]).length)&&b>1)continue;if(u=n.charCodeAt(n.length-1),d=r.charCodeAt(0),a="",0!==o)switch(u){case T:case ae:case _:case ee:case M:case D:break;default:a=" "}switch(d){case P:r=a+Ee;case ae:case _:case ee:case M:case E:case D:break;case G:r=a+r+Ee;break;case V:switch(2*r.charCodeAt(1)+3*r.charCodeAt(2)){case 530:if(Ce>0){r=a+r.substring(8,h-1);break}default:if(o<1||f[o-1].length<1)r=a+Ee+r}break;case U:a="";default:if(h>1&&r.indexOf(":")>0)r=a+r.replace(v,"$1"+Ee+"$2");else r=a+r+Ee}n+=r}i[s]=n.replace(c,"").trim()}return i}(a):a,ye>0)if(void 0!==(n=Pe(Fe,Ve,f,e,pe,be,je,t,i,t))&&0===(Ve=n).length)return Ye+Ve+Xe;if(Ve=f.join(",")+"{"+Ve+"}",Ae*ke!=0){if(2===Ae&&!Le(Ve,2))ke=0;switch(ke){case le:Ve=Ve.replace(k,":"+S+"$1")+Ve;break;case ne:Ve=Ve.replace(p,"::"+N+"input-$1")+Ve.replace(p,"::"+S+"$1")+Ve.replace(p,":"+F+"input-$1")+Ve}ke=0}}return Ye+Ve+Xe}function Ie(e,a,r){var c=a.trim().split(o),s=c,t=c.length,i=e.length;switch(i){case 0:case 1:for(var f=0,n=0===i?"":e[0]+" ";f<t;++f)s[f]=Je(n,s[f],r,i).trim();break;default:f=0;var l=0;for(s=[];f<t;++f)for(var h=0;h<i;++h)s[l++]=Je(e[h]+" ",c[f],r,i).trim()}return s}function Je(e,a,r,c){var s=a,t=s.charCodeAt(0);if(t<33)t=(s=s.trim()).charCodeAt(0);switch(t){case P:switch(ge+c){case 0:case 1:if(0===e.trim().length)break;default:return s.replace(h,"$1"+e.trim())}break;case V:switch(s.charCodeAt(1)){case 103:if(Ce>0&&ge>0)return s.replace(u,"$1").replace(h,"$1"+Ge);break;default:return e.trim()+s.replace(h,"$1"+e.trim())}default:if(r*ge>0&&s.indexOf("\f")>0)return s.replace(h,(e.charCodeAt(0)===V?"":"$1")+e.trim())}return e+s}function Ke(e,a,r,c){var l,o=0,h=e+";",u=2*a+3*r+4*c;if(944===u)return function(e){var a=e.length,r=e.indexOf(":",9)+1,c=e.substring(0,r).trim(),s=e.substring(r,a-1).trim();switch(e.charCodeAt(9)*Be){case 0:break;case Q:if(110!==e.charCodeAt(10))break;default:for(var t=s.split((s="",f)),i=0,r=0,a=t.length;i<a;r=0,++i){for(var l=t[i],o=l.split(n);l=o[r];){var h=l.charCodeAt(0);if(1===Be&&(h>L&&h<90||h>96&&h<123||h===R||h===Q&&l.charCodeAt(1)!==Q))switch(isNaN(parseFloat(l))+(-1!==l.indexOf("("))){case 1:switch(l){case"infinite":case"alternate":case"backwards":case"running":case"normal":case"forwards":case"both":case"none":case"linear":case"ease":case"ease-in":case"ease-out":case"ease-in-out":case"paused":case"reverse":case"alternate-reverse":case"inherit":case"initial":case"unset":case"step-start":case"step-end":break;default:l+=De}}o[r++]=l}s+=(0===i?"":",")+o.join(" ")}}if(s=c+s+";",1===Ae||2===Ae&&Le(s,1))return N+s+s;return s}(h);else if(0===Ae||2===Ae&&!Le(h,1))return h;switch(u){case 1015:return 97===h.charCodeAt(10)?N+h+h:h;case 951:return 116===h.charCodeAt(3)?N+h+h:h;case 963:return 110===h.charCodeAt(5)?N+h+h:h;case 1009:if(100!==h.charCodeAt(4))break;case 969:case 942:return N+h+h;case 978:return N+h+S+h+h;case 1019:case 983:return N+h+S+h+F+h+h;case 883:if(h.charCodeAt(8)===Q)return N+h+h;if(h.indexOf("image-set(",11)>0)return h.replace(z,"$1"+N+"$2")+h;return h;case 932:if(h.charCodeAt(4)===Q)switch(h.charCodeAt(5)){case 103:return N+"box-"+h.replace("-grow","")+N+h+F+h.replace("grow","positive")+h;case 115:return N+h+F+h.replace("shrink","negative")+h;case 98:return N+h+F+h.replace("basis","preferred-size")+h}return N+h+F+h+h;case 964:return N+h+F+"flex-"+h+h;case 1023:if(99!==h.charCodeAt(8))break;return l=h.substring(h.indexOf(":",15)).replace("flex-","").replace("space-between","justify"),N+"box-pack"+l+N+h+F+"flex-pack"+l+h;case 1005:return t.test(h)?h.replace(s,":"+N)+h.replace(s,":"+S)+h:h;case 1e3:switch(o=(l=h.substring(13).trim()).indexOf("-")+1,l.charCodeAt(0)+l.charCodeAt(o)){case 226:l=h.replace(m,"tb");break;case 232:l=h.replace(m,"tb-rl");break;case 220:l=h.replace(m,"lr");break;default:return h}return N+h+F+l+h;case 1017:if(-1===h.indexOf("sticky",9))return h;case 975:switch(o=(h=e).length-10,u=(l=(33===h.charCodeAt(o)?h.substring(0,o):h).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|l.charCodeAt(7))){case 203:if(l.charCodeAt(8)<111)break;case 115:h=h.replace(l,N+l)+";"+h;break;case 207:case 102:h=h.replace(l,N+(u>102?"inline-":"")+"box")+";"+h.replace(l,N+l)+";"+h.replace(l,F+l+"box")+";"+h}return h+";";case 938:if(h.charCodeAt(5)===Q)switch(h.charCodeAt(6)){case 105:return l=h.replace("-items",""),N+h+N+"box-"+l+F+"flex-"+l+h;case 115:return N+h+F+"flex-item-"+h.replace(y,"")+h;default:return N+h+F+"flex-line-pack"+h.replace("align-content","").replace(y,"")+h}break;case 973:case 989:if(h.charCodeAt(3)!==Q||122===h.charCodeAt(4))break;case 931:case 953:if(true===j.test(e))if(115===(l=e.substring(e.indexOf(":")+1)).charCodeAt(0))return Ke(e.replace("stretch","fill-available"),a,r,c).replace(":fill-available",":stretch");else return h.replace(l,N+l)+h.replace(l,S+l.replace("fill-",""))+h;break;case 962:if(h=N+h+(102===h.charCodeAt(5)?F+h:"")+h,r+c===211&&105===h.charCodeAt(13)&&h.indexOf("transform",10)>0)return h.substring(0,h.indexOf(";",27)+1).replace(i,"$1"+N+"$2")+h}return h}function Le(e,a){var r=e.indexOf(1===a?":":"{"),c=e.substring(0,3!==a?r:10),s=e.substring(r+1,e.length-1);return Oe(2!==a?c:c.replace(O,"$1"),s,a)}function Me(e,a){var r=Ke(a,a.charCodeAt(0),a.charCodeAt(1),a.charCodeAt(2));return r!==a+";"?r.replace($," or ($1)").substring(4):"("+a+")"}function Pe(e,a,r,c,s,t,i,f,n,l){for(var o,h=0,u=a;h<ye;++h)switch(o=$e[h].call(Te,e,u,r,c,s,t,i,f,n,l)){case void 0:case false:case true:case null:break;default:u=o}if(u!==a)return u}function Qe(e,a,r,c){for(var s=a+1;s<r;++s)switch(c.charCodeAt(s)){case Z:if(e===T)if(c.charCodeAt(s-1)===T&&a+2!==s)return s+1;break;case I:if(e===Z)return s+1}return s}function Re(e){for(var a in e){var r=e[a];switch(a){case"keyframe":Be=0|r;break;case"global":Ce=0|r;break;case"cascade":ge=0|r;break;case"compress":we=0|r;break;case"semicolon":ve=0|r;break;case"preserve":me=0|r;break;case"prefix":if(Oe=null,!r)Ae=0;else if("function"!=typeof r)Ae=1;else Ae=2,Oe=r}}return Re}function Te(a,r){if(void 0!==this&&this.constructor===Te)return e(a);var s=a,t=s.charCodeAt(0);if(t<33)t=(s=s.trim()).charCodeAt(0);if(Be>0)De=s.replace(d,t===G?"":"-");if(t=1,1===ge)Ge=s;else Ee=s;var i,f=[Ge];if(ye>0)if(void 0!==(i=Pe(ze,r,f,f,pe,be,0,0,0,0))&&"string"==typeof i)r=i;var n=He(xe,f,r,0,0);if(ye>0)if(void 0!==(i=Pe(je,n,f,f,pe,be,n.length,0,0,0))&&"string"!=typeof(n=i))t=0;return De="",Ge="",Ee="",ke=0,pe=1,be=1,we*t==0?n:n.replace(c,"").replace(g,"").replace(A,"$1").replace(C,"$1").replace(w," ")}if(Te.use=function e(a){switch(a){case void 0:case null:ye=$e.length=0;break;default:if("function"==typeof a)$e[ye++]=a;else if("object"==typeof a)for(var r=0,c=a.length;r<c;++r)e(a[r]);else qe=0|!!a}return e},Te.set=Re,void 0!==a)Re(a);return Te});
12729 //# sourceMappingURL=stylis.min.js.map
12730
12731 /***/ }),
12732
12733 /***/ "react":
12734 /*!************************!*\
12735 !*** external "React" ***!
12736 \************************/
12737 /***/ ((module) => {
12738
12739 "use strict";
12740 module.exports = window["React"];
12741
12742 /***/ }),
12743
12744 /***/ "jquery":
12745 /*!*************************!*\
12746 !*** external "jQuery" ***!
12747 \*************************/
12748 /***/ ((module) => {
12749
12750 "use strict";
12751 module.exports = window["jQuery"];
12752
12753 /***/ }),
12754
12755 /***/ "@wordpress/blocks":
12756 /*!********************************!*\
12757 !*** external ["wp","blocks"] ***!
12758 \********************************/
12759 /***/ ((module) => {
12760
12761 "use strict";
12762 module.exports = window["wp"]["blocks"];
12763
12764 /***/ }),
12765
12766 /***/ "@wordpress/components":
12767 /*!************************************!*\
12768 !*** external ["wp","components"] ***!
12769 \************************************/
12770 /***/ ((module) => {
12771
12772 "use strict";
12773 module.exports = window["wp"]["components"];
12774
12775 /***/ }),
12776
12777 /***/ "@wordpress/data":
12778 /*!******************************!*\
12779 !*** external ["wp","data"] ***!
12780 \******************************/
12781 /***/ ((module) => {
12782
12783 "use strict";
12784 module.exports = window["wp"]["data"];
12785
12786 /***/ }),
12787
12788 /***/ "@wordpress/edit-post":
12789 /*!**********************************!*\
12790 !*** external ["wp","editPost"] ***!
12791 \**********************************/
12792 /***/ ((module) => {
12793
12794 "use strict";
12795 module.exports = window["wp"]["editPost"];
12796
12797 /***/ }),
12798
12799 /***/ "@wordpress/element":
12800 /*!*********************************!*\
12801 !*** external ["wp","element"] ***!
12802 \*********************************/
12803 /***/ ((module) => {
12804
12805 "use strict";
12806 module.exports = window["wp"]["element"];
12807
12808 /***/ }),
12809
12810 /***/ "@wordpress/i18n":
12811 /*!******************************!*\
12812 !*** external ["wp","i18n"] ***!
12813 \******************************/
12814 /***/ ((module) => {
12815
12816 "use strict";
12817 module.exports = window["wp"]["i18n"];
12818
12819 /***/ }),
12820
12821 /***/ "@wordpress/plugins":
12822 /*!*********************************!*\
12823 !*** external ["wp","plugins"] ***!
12824 \*********************************/
12825 /***/ ((module) => {
12826
12827 "use strict";
12828 module.exports = window["wp"]["plugins"];
12829
12830 /***/ }),
12831
12832 /***/ "./node_modules/@linaria/react/dist/index.mjs":
12833 /*!****************************************************!*\
12834 !*** ./node_modules/@linaria/react/dist/index.mjs ***!
12835 \****************************************************/
12836 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
12837
12838 "use strict";
12839 __webpack_require__.r(__webpack_exports__);
12840 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12841 /* harmony export */ "styled": () => (/* binding */ styled_default)
12842 /* harmony export */ });
12843 /* 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");
12844 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
12845 /* harmony import */ var _linaria_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @linaria/core */ "./node_modules/@linaria/react/node_modules/@linaria/core/dist/index.mjs");
12846 // src/styled.ts
12847
12848
12849
12850 var isCapital = (ch) => ch.toUpperCase() === ch;
12851 var filterKey = (keys) => (key) => keys.indexOf(key) === -1;
12852 var omit = (obj, keys) => {
12853 const res = {};
12854 Object.keys(obj).filter(filterKey(keys)).forEach((key) => {
12855 res[key] = obj[key];
12856 });
12857 return res;
12858 };
12859 function filterProps(asIs, props, omitKeys) {
12860 const filteredProps = omit(props, omitKeys);
12861 if (!asIs) {
12862 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"];
12863 Object.keys(filteredProps).forEach((key) => {
12864 if (!interopValidAttr.default(key)) {
12865 delete filteredProps[key];
12866 }
12867 });
12868 }
12869 return filteredProps;
12870 }
12871 var warnIfInvalid = (value, componentName) => {
12872 if (true) {
12873 if (typeof value === "string" || typeof value === "number" && isFinite(value)) {
12874 return;
12875 }
12876 const stringified = typeof value === "object" ? JSON.stringify(value) : String(value);
12877 console.warn(
12878 `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.`
12879 );
12880 }
12881 };
12882 function styled(tag) {
12883 return (options) => {
12884 if (true) {
12885 if (Array.isArray(options)) {
12886 throw new Error(
12887 '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'
12888 );
12889 }
12890 }
12891 const render = (props, ref) => {
12892 const { as: component = tag, class: className } = props;
12893 const shouldKeepProps = options.propsAsIs === void 0 ? !(typeof component === "string" && component.indexOf("-") === -1 && !isCapital(component[0])) : options.propsAsIs;
12894 const filteredProps = filterProps(shouldKeepProps, props, [
12895 "as",
12896 "class"
12897 ]);
12898 filteredProps.ref = ref;
12899 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);
12900 const { vars } = options;
12901 if (vars) {
12902 const style = {};
12903 for (const name in vars) {
12904 const variable = vars[name];
12905 const result = variable[0];
12906 const unit = variable[1] || "";
12907 const value = typeof result === "function" ? result(props) : result;
12908 warnIfInvalid(value, options.name);
12909 style[`--${name}`] = `${value}${unit}`;
12910 }
12911 const ownStyle = filteredProps.style || {};
12912 const keys = Object.keys(ownStyle);
12913 if (keys.length > 0) {
12914 keys.forEach((key) => {
12915 style[key] = ownStyle[key];
12916 });
12917 }
12918 filteredProps.style = style;
12919 }
12920 if (tag.__linaria && tag !== component) {
12921 filteredProps.as = component;
12922 return react__WEBPACK_IMPORTED_MODULE_1__.createElement(tag, filteredProps);
12923 }
12924 return react__WEBPACK_IMPORTED_MODULE_1__.createElement(component, filteredProps);
12925 };
12926 const Result = react__WEBPACK_IMPORTED_MODULE_1__.forwardRef ? react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(render) : (props) => {
12927 const rest = omit(props, ["innerRef"]);
12928 return render(rest, props.innerRef);
12929 };
12930 Result.displayName = options.name;
12931 Result.__linaria = {
12932 className: options.class,
12933 extends: tag
12934 };
12935 return Result;
12936 };
12937 }
12938 var styled_default = true ? new Proxy(styled, {
12939 get(o, prop) {
12940 return o(prop);
12941 }
12942 }) : 0;
12943
12944 //# sourceMappingURL=index.mjs.map
12945
12946 /***/ }),
12947
12948 /***/ "./node_modules/@linaria/react/node_modules/@linaria/core/dist/index.mjs":
12949 /*!*******************************************************************************!*\
12950 !*** ./node_modules/@linaria/react/node_modules/@linaria/core/dist/index.mjs ***!
12951 \*******************************************************************************/
12952 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
12953
12954 "use strict";
12955 __webpack_require__.r(__webpack_exports__);
12956 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12957 /* harmony export */ "css": () => (/* binding */ css_default),
12958 /* harmony export */ "cx": () => (/* binding */ cx_default)
12959 /* harmony export */ });
12960 // src/css.ts
12961 var css = () => {
12962 throw new Error(
12963 'Using the "css" tag in runtime is not supported. Make sure you have set up the Babel plugin correctly.'
12964 );
12965 };
12966 var css_default = css;
12967
12968 // src/cx.ts
12969 var cx = function cx2() {
12970 const presentClassNames = Array.prototype.slice.call(arguments).filter(Boolean);
12971 const atomicClasses = {};
12972 const nonAtomicClasses = [];
12973 presentClassNames.forEach((arg) => {
12974 const individualClassNames = arg ? arg.split(" ") : [];
12975 individualClassNames.forEach((className) => {
12976 if (className.startsWith("atm_")) {
12977 const [, keyHash] = className.split("_");
12978 atomicClasses[keyHash] = className;
12979 } else {
12980 nonAtomicClasses.push(className);
12981 }
12982 });
12983 });
12984 const result = [];
12985 for (const keyHash in atomicClasses) {
12986 if (Object.prototype.hasOwnProperty.call(atomicClasses, keyHash)) {
12987 result.push(atomicClasses[keyHash]);
12988 }
12989 }
12990 result.push(...nonAtomicClasses);
12991 return result.join(" ");
12992 };
12993 var cx_default = cx;
12994
12995 //# sourceMappingURL=index.mjs.map
12996
12997 /***/ })
12998
12999 /******/ });
13000 /************************************************************************/
13001 /******/ // The module cache
13002 /******/ var __webpack_module_cache__ = {};
13003 /******/
13004 /******/ // The require function
13005 /******/ function __webpack_require__(moduleId) {
13006 /******/ // Check if module is in cache
13007 /******/ var cachedModule = __webpack_module_cache__[moduleId];
13008 /******/ if (cachedModule !== undefined) {
13009 /******/ return cachedModule.exports;
13010 /******/ }
13011 /******/ // Create a new module (and put it into the cache)
13012 /******/ var module = __webpack_module_cache__[moduleId] = {
13013 /******/ // no module.id needed
13014 /******/ // no module.loaded needed
13015 /******/ exports: {}
13016 /******/ };
13017 /******/
13018 /******/ // Execute the module function
13019 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
13020 /******/
13021 /******/ // Return the exports of the module
13022 /******/ return module.exports;
13023 /******/ }
13024 /******/
13025 /************************************************************************/
13026 /******/ /* webpack/runtime/compat get default export */
13027 /******/ (() => {
13028 /******/ // getDefaultExport function for compatibility with non-harmony modules
13029 /******/ __webpack_require__.n = (module) => {
13030 /******/ var getter = module && module.__esModule ?
13031 /******/ () => (module['default']) :
13032 /******/ () => (module);
13033 /******/ __webpack_require__.d(getter, { a: getter });
13034 /******/ return getter;
13035 /******/ };
13036 /******/ })();
13037 /******/
13038 /******/ /* webpack/runtime/define property getters */
13039 /******/ (() => {
13040 /******/ // define getter functions for harmony exports
13041 /******/ __webpack_require__.d = (exports, definition) => {
13042 /******/ for(var key in definition) {
13043 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
13044 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
13045 /******/ }
13046 /******/ }
13047 /******/ };
13048 /******/ })();
13049 /******/
13050 /******/ /* webpack/runtime/global */
13051 /******/ (() => {
13052 /******/ __webpack_require__.g = (function() {
13053 /******/ if (typeof globalThis === 'object') return globalThis;
13054 /******/ try {
13055 /******/ return this || new Function('return this')();
13056 /******/ } catch (e) {
13057 /******/ if (typeof window === 'object') return window;
13058 /******/ }
13059 /******/ })();
13060 /******/ })();
13061 /******/
13062 /******/ /* webpack/runtime/hasOwnProperty shorthand */
13063 /******/ (() => {
13064 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
13065 /******/ })();
13066 /******/
13067 /******/ /* webpack/runtime/make namespace object */
13068 /******/ (() => {
13069 /******/ // define __esModule on exports
13070 /******/ __webpack_require__.r = (exports) => {
13071 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
13072 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
13073 /******/ }
13074 /******/ Object.defineProperty(exports, '__esModule', { value: true });
13075 /******/ };
13076 /******/ })();
13077 /******/
13078 /******/ /* webpack/runtime/nonce */
13079 /******/ (() => {
13080 /******/ __webpack_require__.nc = undefined;
13081 /******/ })();
13082 /******/
13083 /************************************************************************/
13084 var __webpack_exports__ = {};
13085 // This entry need to be wrapped in an IIFE because it need to be in strict mode.
13086 (() => {
13087 "use strict";
13088 /*!**************************************!*\
13089 !*** ./scripts/entries/gutenberg.ts ***!
13090 \**************************************/
13091 __webpack_require__.r(__webpack_exports__);
13092 /* harmony import */ var _gutenberg_FormBlock_registerFormBlock__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../gutenberg/FormBlock/registerFormBlock */ "./scripts/gutenberg/FormBlock/registerFormBlock.tsx");
13093 /* harmony import */ var _gutenberg_Sidebar_contentType__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../gutenberg/Sidebar/contentType */ "./scripts/gutenberg/Sidebar/contentType.tsx");
13094 /* harmony import */ var _gutenberg_MeetingsBlock_registerMeetingBlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../gutenberg/MeetingsBlock/registerMeetingBlock */ "./scripts/gutenberg/MeetingsBlock/registerMeetingBlock.tsx");
13095 /* harmony import */ var _utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/backgroundAppUtils */ "./scripts/utils/backgroundAppUtils.ts");
13096
13097
13098
13099
13100 (0,_utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_3__.initBackgroundApp)([_gutenberg_FormBlock_registerFormBlock__WEBPACK_IMPORTED_MODULE_0__["default"], _gutenberg_MeetingsBlock_registerMeetingBlock__WEBPACK_IMPORTED_MODULE_2__["default"], _gutenberg_Sidebar_contentType__WEBPACK_IMPORTED_MODULE_1__.registerHubspotSidebar]);
13101 })();
13102
13103 /******/ })()
13104 ;
13105 //# sourceMappingURL=gutenberg.js.map