| 1 |
/******/ (() => { // webpackBootstrap |
| 2 |
/******/ var __webpack_modules__ = ({ |
| 3 |
|
| 4 |
/***/ "./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js": |
| 5 |
/*!*******************************************************************!*\ |
| 6 |
!*** ./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js ***! |
| 7 |
\*******************************************************************/ |
| 8 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 9 |
|
| 10 |
"use strict"; |
| 11 |
__webpack_require__.r(__webpack_exports__); |
| 12 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 13 |
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 14 |
/* harmony export */ }); |
| 15 |
function memoize(fn) { |
| 16 |
var cache = Object.create(null); |
| 17 |
return function (arg) { |
| 18 |
if (cache[arg] === undefined) cache[arg] = fn(arg); |
| 19 |
return cache[arg]; |
| 20 |
}; |
| 21 |
} |
| 22 |
|
| 23 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (memoize); |
| 24 |
|
| 25 |
|
| 26 |
/***/ }), |
| 27 |
|
| 28 |
/***/ "./node_modules/@linaria/react/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js": |
| 29 |
/*!***********************************************************************************************************!*\ |
| 30 |
!*** ./node_modules/@linaria/react/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js ***! |
| 31 |
\***********************************************************************************************************/ |
| 32 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 33 |
|
| 34 |
"use strict"; |
| 35 |
__webpack_require__.r(__webpack_exports__); |
| 36 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 37 |
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 38 |
/* harmony export */ }); |
| 39 |
/* harmony import */ var _emotion_memoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @emotion/memoize */ "./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js"); |
| 40 |
|
| 41 |
|
| 42 |
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23 |
| 43 |
|
| 44 |
var isPropValid = /* #__PURE__ */(0,_emotion_memoize__WEBPACK_IMPORTED_MODULE_0__["default"])(function (prop) { |
| 45 |
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 |
| 46 |
/* o */ |
| 47 |
&& prop.charCodeAt(1) === 110 |
| 48 |
/* n */ |
| 49 |
&& prop.charCodeAt(2) < 91; |
| 50 |
} |
| 51 |
/* Z+1 */ |
| 52 |
); |
| 53 |
|
| 54 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isPropValid); |
| 55 |
|
| 56 |
|
| 57 |
/***/ }), |
| 58 |
|
| 59 |
/***/ "./scripts/constants/defaultFormOptions.ts": |
| 60 |
/*!*************************************************!*\ |
| 61 |
!*** ./scripts/constants/defaultFormOptions.ts ***! |
| 62 |
\*************************************************/ |
| 63 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 64 |
|
| 65 |
"use strict"; |
| 66 |
__webpack_require__.r(__webpack_exports__); |
| 67 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 68 |
/* harmony export */ "DEFAULT_OPTIONS": () => (/* binding */ DEFAULT_OPTIONS), |
| 69 |
/* harmony export */ "isDefaultForm": () => (/* binding */ isDefaultForm) |
| 70 |
/* harmony export */ }); |
| 71 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 72 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); |
| 73 |
|
| 74 |
var REGISTRATION_FORM = 'REGISTRATION_FORM'; |
| 75 |
var CONTACT_US_FORM = 'CONTACT_US_FORM'; |
| 76 |
var NEWSLETTER_FORM = 'NEWSLETTER_FORM'; |
| 77 |
var SUPPORT_FORM = 'SUPPORT_FORM'; |
| 78 |
var EVENT_FORM = 'EVENT_FORM'; |
| 79 |
var DEFAULT_OPTIONS = { |
| 80 |
label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Templates', 'leadin'), |
| 81 |
options: [{ |
| 82 |
label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Registration Form', 'leadin'), |
| 83 |
value: REGISTRATION_FORM |
| 84 |
}, { |
| 85 |
label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Contact us Form', 'leadin'), |
| 86 |
value: CONTACT_US_FORM |
| 87 |
}, { |
| 88 |
label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Newsletter sign-up Form', 'leadin'), |
| 89 |
value: NEWSLETTER_FORM |
| 90 |
}, { |
| 91 |
label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Support Form', 'leadin'), |
| 92 |
value: SUPPORT_FORM |
| 93 |
}, { |
| 94 |
label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Event Registration Form', 'leadin'), |
| 95 |
value: EVENT_FORM |
| 96 |
}] |
| 97 |
}; |
| 98 |
function isDefaultForm(value) { |
| 99 |
return value === REGISTRATION_FORM || value === CONTACT_US_FORM || value === NEWSLETTER_FORM || value === SUPPORT_FORM || value === EVENT_FORM; |
| 100 |
} |
| 101 |
|
| 102 |
/***/ }), |
| 103 |
|
| 104 |
/***/ "./scripts/constants/leadinConfig.ts": |
| 105 |
/*!*******************************************!*\ |
| 106 |
!*** ./scripts/constants/leadinConfig.ts ***! |
| 107 |
\*******************************************/ |
| 108 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 109 |
|
| 110 |
"use strict"; |
| 111 |
__webpack_require__.r(__webpack_exports__); |
| 112 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 113 |
/* harmony export */ "accountName": () => (/* binding */ accountName), |
| 114 |
/* harmony export */ "activationTime": () => (/* binding */ activationTime), |
| 115 |
/* harmony export */ "adminUrl": () => (/* binding */ adminUrl), |
| 116 |
/* harmony export */ "connectionStatus": () => (/* binding */ connectionStatus), |
| 117 |
/* harmony export */ "contentEmbed": () => (/* binding */ contentEmbed), |
| 118 |
/* harmony export */ "deviceId": () => (/* binding */ deviceId), |
| 119 |
/* harmony export */ "didDisconnect": () => (/* binding */ didDisconnect), |
| 120 |
/* harmony export */ "encryptionError": () => (/* binding */ encryptionError), |
| 121 |
/* harmony export */ "env": () => (/* binding */ env), |
| 122 |
/* harmony export */ "formsScript": () => (/* binding */ formsScript), |
| 123 |
/* harmony export */ "formsScriptPayload": () => (/* binding */ formsScriptPayload), |
| 124 |
/* harmony export */ "hublet": () => (/* binding */ hublet), |
| 125 |
/* harmony export */ "hubspotBaseUrl": () => (/* binding */ hubspotBaseUrl), |
| 126 |
/* harmony export */ "hubspotNonce": () => (/* binding */ hubspotNonce), |
| 127 |
/* harmony export */ "iframeUrl": () => (/* binding */ iframeUrl), |
| 128 |
/* harmony export */ "impactLink": () => (/* binding */ impactLink), |
| 129 |
/* harmony export */ "lastAuthorizeTime": () => (/* binding */ lastAuthorizeTime), |
| 130 |
/* harmony export */ "lastDeauthorizeTime": () => (/* binding */ lastDeauthorizeTime), |
| 131 |
/* harmony export */ "lastDisconnectTime": () => (/* binding */ lastDisconnectTime), |
| 132 |
/* harmony export */ "leadinPluginVersion": () => (/* binding */ leadinPluginVersion), |
| 133 |
/* harmony export */ "leadinQueryParams": () => (/* binding */ leadinQueryParams), |
| 134 |
/* harmony export */ "locale": () => (/* binding */ locale), |
| 135 |
/* harmony export */ "loginUrl": () => (/* binding */ loginUrl), |
| 136 |
/* harmony export */ "meetingsScript": () => (/* binding */ meetingsScript), |
| 137 |
/* harmony export */ "phpVersion": () => (/* binding */ phpVersion), |
| 138 |
/* harmony export */ "pluginPath": () => (/* binding */ pluginPath), |
| 139 |
/* harmony export */ "plugins": () => (/* binding */ plugins), |
| 140 |
/* harmony export */ "portalDomain": () => (/* binding */ portalDomain), |
| 141 |
/* harmony export */ "portalEmail": () => (/* binding */ portalEmail), |
| 142 |
/* harmony export */ "portalId": () => (/* binding */ portalId), |
| 143 |
/* harmony export */ "redirectNonce": () => (/* binding */ redirectNonce), |
| 144 |
/* harmony export */ "refreshToken": () => (/* binding */ refreshToken), |
| 145 |
/* harmony export */ "refreshTokenError": () => (/* binding */ refreshTokenError), |
| 146 |
/* harmony export */ "requiresContentEmbedScope": () => (/* binding */ requiresContentEmbedScope), |
| 147 |
/* harmony export */ "restNonce": () => (/* binding */ restNonce), |
| 148 |
/* harmony export */ "restUrl": () => (/* binding */ restUrl), |
| 149 |
/* harmony export */ "reviewSkippedDate": () => (/* binding */ reviewSkippedDate), |
| 150 |
/* harmony export */ "theme": () => (/* binding */ theme), |
| 151 |
/* harmony export */ "trackConsent": () => (/* binding */ trackConsent), |
| 152 |
/* harmony export */ "wpVersion": () => (/* binding */ wpVersion) |
| 153 |
/* harmony export */ }); |
| 154 |
var _window$leadinConfig = window.leadinConfig, |
| 155 |
accountName = _window$leadinConfig.accountName, |
| 156 |
adminUrl = _window$leadinConfig.adminUrl, |
| 157 |
activationTime = _window$leadinConfig.activationTime, |
| 158 |
connectionStatus = _window$leadinConfig.connectionStatus, |
| 159 |
deviceId = _window$leadinConfig.deviceId, |
| 160 |
didDisconnect = _window$leadinConfig.didDisconnect, |
| 161 |
env = _window$leadinConfig.env, |
| 162 |
formsScript = _window$leadinConfig.formsScript, |
| 163 |
meetingsScript = _window$leadinConfig.meetingsScript, |
| 164 |
formsScriptPayload = _window$leadinConfig.formsScriptPayload, |
| 165 |
hublet = _window$leadinConfig.hublet, |
| 166 |
hubspotBaseUrl = _window$leadinConfig.hubspotBaseUrl, |
| 167 |
hubspotNonce = _window$leadinConfig.hubspotNonce, |
| 168 |
iframeUrl = _window$leadinConfig.iframeUrl, |
| 169 |
impactLink = _window$leadinConfig.impactLink, |
| 170 |
lastAuthorizeTime = _window$leadinConfig.lastAuthorizeTime, |
| 171 |
lastDeauthorizeTime = _window$leadinConfig.lastDeauthorizeTime, |
| 172 |
lastDisconnectTime = _window$leadinConfig.lastDisconnectTime, |
| 173 |
leadinPluginVersion = _window$leadinConfig.leadinPluginVersion, |
| 174 |
leadinQueryParams = _window$leadinConfig.leadinQueryParams, |
| 175 |
locale = _window$leadinConfig.locale, |
| 176 |
loginUrl = _window$leadinConfig.loginUrl, |
| 177 |
phpVersion = _window$leadinConfig.phpVersion, |
| 178 |
pluginPath = _window$leadinConfig.pluginPath, |
| 179 |
plugins = _window$leadinConfig.plugins, |
| 180 |
portalDomain = _window$leadinConfig.portalDomain, |
| 181 |
portalEmail = _window$leadinConfig.portalEmail, |
| 182 |
portalId = _window$leadinConfig.portalId, |
| 183 |
redirectNonce = _window$leadinConfig.redirectNonce, |
| 184 |
restNonce = _window$leadinConfig.restNonce, |
| 185 |
restUrl = _window$leadinConfig.restUrl, |
| 186 |
refreshToken = _window$leadinConfig.refreshToken, |
| 187 |
reviewSkippedDate = _window$leadinConfig.reviewSkippedDate, |
| 188 |
theme = _window$leadinConfig.theme, |
| 189 |
trackConsent = _window$leadinConfig.trackConsent, |
| 190 |
wpVersion = _window$leadinConfig.wpVersion, |
| 191 |
contentEmbed = _window$leadinConfig.contentEmbed, |
| 192 |
requiresContentEmbedScope = _window$leadinConfig.requiresContentEmbedScope, |
| 193 |
refreshTokenError = _window$leadinConfig.refreshTokenError, |
| 194 |
encryptionError = _window$leadinConfig.encryptionError; |
| 195 |
|
| 196 |
|
| 197 |
/***/ }), |
| 198 |
|
| 199 |
/***/ "./scripts/elementor/Common/ConnectPluginBanner.tsx": |
| 200 |
/*!**********************************************************!*\ |
| 201 |
!*** ./scripts/elementor/Common/ConnectPluginBanner.tsx ***! |
| 202 |
\**********************************************************/ |
| 203 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 204 |
|
| 205 |
"use strict"; |
| 206 |
__webpack_require__.r(__webpack_exports__); |
| 207 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 208 |
/* harmony export */ "default": () => (/* binding */ ConnectPluginBanner) |
| 209 |
/* harmony export */ }); |
| 210 |
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); |
| 211 |
/* harmony import */ var _ElementorBanner__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ElementorBanner */ "./scripts/elementor/Common/ElementorBanner.tsx"); |
| 212 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 213 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); |
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
function ConnectPluginBanner() { |
| 218 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_ElementorBanner__WEBPACK_IMPORTED_MODULE_1__["default"], { |
| 219 |
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("b", { |
| 220 |
dangerouslySetInnerHTML: { |
| 221 |
__html: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('The HubSpot plugin is not connected right now To use HubSpot tools on your WordPress site, %1$sconnect the plugin now%2$s').replace('%1$s', '<a class="leadin-banner__link" href="admin.php?page=leadin&bannerClick=true">').replace('%2$s', '</a>') |
| 222 |
} |
| 223 |
}) |
| 224 |
}); |
| 225 |
} |
| 226 |
|
| 227 |
/***/ }), |
| 228 |
|
| 229 |
/***/ "./scripts/elementor/Common/ElementorBanner.tsx": |
| 230 |
/*!******************************************************!*\ |
| 231 |
!*** ./scripts/elementor/Common/ElementorBanner.tsx ***! |
| 232 |
\******************************************************/ |
| 233 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 234 |
|
| 235 |
"use strict"; |
| 236 |
__webpack_require__.r(__webpack_exports__); |
| 237 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 238 |
/* harmony export */ "default": () => (/* binding */ ElementorBanner) |
| 239 |
/* harmony export */ }); |
| 240 |
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); |
| 241 |
|
| 242 |
function ElementorBanner(_ref) { |
| 243 |
var _ref$type = _ref.type, |
| 244 |
type = _ref$type === void 0 ? 'warning' : _ref$type, |
| 245 |
children = _ref.children; |
| 246 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { |
| 247 |
className: "elementor-control-content", |
| 248 |
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { |
| 249 |
className: "elementor-control-raw-html elementor-panel-alert elementor-panel-alert-".concat(type), |
| 250 |
children: children |
| 251 |
}) |
| 252 |
}); |
| 253 |
} |
| 254 |
|
| 255 |
/***/ }), |
| 256 |
|
| 257 |
/***/ "./scripts/elementor/Common/ElementorButton.tsx": |
| 258 |
/*!******************************************************!*\ |
| 259 |
!*** ./scripts/elementor/Common/ElementorButton.tsx ***! |
| 260 |
\******************************************************/ |
| 261 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 262 |
|
| 263 |
"use strict"; |
| 264 |
__webpack_require__.r(__webpack_exports__); |
| 265 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 266 |
/* harmony export */ "default": () => (/* binding */ ElementorButton) |
| 267 |
/* harmony export */ }); |
| 268 |
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); |
| 269 |
/* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs"); |
| 270 |
var _excluded = ["children"]; |
| 271 |
|
| 272 |
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; } |
| 273 |
|
| 274 |
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; } |
| 275 |
|
| 276 |
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; } |
| 277 |
|
| 278 |
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } |
| 279 |
|
| 280 |
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } |
| 281 |
|
| 282 |
|
| 283 |
|
| 284 |
var Container = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('div')({ |
| 285 |
name: "Container", |
| 286 |
"class": "czoccom", |
| 287 |
propsAsIs: false |
| 288 |
}); |
| 289 |
function ElementorButton(_ref) { |
| 290 |
var children = _ref.children, |
| 291 |
params = _objectWithoutProperties(_ref, _excluded); |
| 292 |
|
| 293 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Container, { |
| 294 |
className: "elementor-button-wrapper", |
| 295 |
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", _objectSpread(_objectSpread({ |
| 296 |
className: "elementor-button elementor-button-default", |
| 297 |
type: "button" |
| 298 |
}, params), {}, { |
| 299 |
children: children |
| 300 |
})) |
| 301 |
}); |
| 302 |
} |
| 303 |
|
| 304 |
__webpack_require__(/*! ./ElementorButton.linaria.css!=!../../../node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./ElementorButton.tsx */ "./scripts/elementor/Common/ElementorButton.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/elementor/Common/ElementorButton.tsx"); |
| 305 |
|
| 306 |
/***/ }), |
| 307 |
|
| 308 |
/***/ "./scripts/elementor/FormWidget/ElementorFormSelect.tsx": |
| 309 |
/*!**************************************************************!*\ |
| 310 |
!*** ./scripts/elementor/FormWidget/ElementorFormSelect.tsx ***! |
| 311 |
\**************************************************************/ |
| 312 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 313 |
|
| 314 |
"use strict"; |
| 315 |
__webpack_require__.r(__webpack_exports__); |
| 316 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 317 |
/* harmony export */ "default": () => (/* binding */ ElementorFormSelectContainer) |
| 318 |
/* harmony export */ }); |
| 319 |
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); |
| 320 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react"); |
| 321 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); |
| 322 |
/* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts"); |
| 323 |
/* harmony import */ var _Common_ElementorBanner__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Common/ElementorBanner */ "./scripts/elementor/Common/ElementorBanner.tsx"); |
| 324 |
/* harmony import */ var _shared_UIComponents_UISpinner__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../shared/UIComponents/UISpinner */ "./scripts/shared/UIComponents/UISpinner.tsx"); |
| 325 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 326 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__); |
| 327 |
/* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts"); |
| 328 |
/* harmony import */ var _hooks_useForms__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./hooks/useForms */ "./scripts/elementor/FormWidget/hooks/useForms.ts"); |
| 329 |
/* harmony import */ var _utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils/backgroundAppUtils */ "./scripts/utils/backgroundAppUtils.ts"); |
| 330 |
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; } |
| 331 |
|
| 332 |
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; } |
| 333 |
|
| 334 |
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; } |
| 335 |
|
| 336 |
|
| 337 |
|
| 338 |
|
| 339 |
|
| 340 |
|
| 341 |
|
| 342 |
|
| 343 |
|
| 344 |
|
| 345 |
|
| 346 |
function ElementorFormSelect(_ref) { |
| 347 |
var formId = _ref.formId, |
| 348 |
setAttributes = _ref.setAttributes; |
| 349 |
|
| 350 |
var _useForms = (0,_hooks_useForms__WEBPACK_IMPORTED_MODULE_7__["default"])(), |
| 351 |
hasError = _useForms.hasError, |
| 352 |
forms = _useForms.forms, |
| 353 |
loading = _useForms.loading; |
| 354 |
|
| 355 |
return loading ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { |
| 356 |
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_shared_UIComponents_UISpinner__WEBPACK_IMPORTED_MODULE_4__["default"], {}) |
| 357 |
}) : hasError ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_ElementorBanner__WEBPACK_IMPORTED_MODULE_3__["default"], { |
| 358 |
type: "danger", |
| 359 |
children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Please refresh your forms or try again in a few minutes', 'leadin') |
| 360 |
}) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { |
| 361 |
value: formId, |
| 362 |
onChange: function onChange(event) { |
| 363 |
var selectedForm = forms.find(function (form) { |
| 364 |
return form.value === event.target.value; |
| 365 |
}); |
| 366 |
|
| 367 |
if (selectedForm) { |
| 368 |
setAttributes({ |
| 369 |
portalId: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId, |
| 370 |
formId: selectedForm.value, |
| 371 |
formName: selectedForm.label |
| 372 |
}); |
| 373 |
} |
| 374 |
}, |
| 375 |
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { |
| 376 |
value: "", |
| 377 |
disabled: true, |
| 378 |
selected: true, |
| 379 |
children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Search for a form', 'leadin') |
| 380 |
}), forms.map(function (form) { |
| 381 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { |
| 382 |
value: form.value, |
| 383 |
children: form.label |
| 384 |
}, form.value); |
| 385 |
})] |
| 386 |
}); |
| 387 |
} |
| 388 |
|
| 389 |
function ElementorFormSelectWrapper(props) { |
| 390 |
var isBackgroundAppReady = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__.useBackgroundAppContext)(); |
| 391 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, { |
| 392 |
children: !isBackgroundAppReady ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { |
| 393 |
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_shared_UIComponents_UISpinner__WEBPACK_IMPORTED_MODULE_4__["default"], {}) |
| 394 |
}) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ElementorFormSelect, _objectSpread({}, props)) |
| 395 |
}); |
| 396 |
} |
| 397 |
|
| 398 |
function ElementorFormSelectContainer(props) { |
| 399 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__.BackgroudAppContext.Provider, { |
| 400 |
value: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.refreshToken && (0,_utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_8__.getOrCreateBackgroundApp)(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.refreshToken), |
| 401 |
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ElementorFormSelectWrapper, _objectSpread({}, props)) |
| 402 |
}); |
| 403 |
} |
| 404 |
|
| 405 |
/***/ }), |
| 406 |
|
| 407 |
/***/ "./scripts/elementor/FormWidget/FormControlController.tsx": |
| 408 |
/*!****************************************************************!*\ |
| 409 |
!*** ./scripts/elementor/FormWidget/FormControlController.tsx ***! |
| 410 |
\****************************************************************/ |
| 411 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 412 |
|
| 413 |
"use strict"; |
| 414 |
__webpack_require__.r(__webpack_exports__); |
| 415 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 416 |
/* harmony export */ "default": () => (/* binding */ FormControlController) |
| 417 |
/* harmony export */ }); |
| 418 |
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); |
| 419 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react"); |
| 420 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); |
| 421 |
/* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts"); |
| 422 |
/* harmony import */ var _Common_ConnectPluginBanner__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Common/ConnectPluginBanner */ "./scripts/elementor/Common/ConnectPluginBanner.tsx"); |
| 423 |
/* harmony import */ var _ElementorFormSelect__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ElementorFormSelect */ "./scripts/elementor/FormWidget/ElementorFormSelect.tsx"); |
| 424 |
|
| 425 |
|
| 426 |
|
| 427 |
|
| 428 |
|
| 429 |
var ConnectionStatus = { |
| 430 |
Connected: 'Connected', |
| 431 |
NotConnected: 'NotConnected' |
| 432 |
}; |
| 433 |
function FormControlController(attributes, setValue) { |
| 434 |
return function () { |
| 435 |
var render = function render() { |
| 436 |
if (_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.connectionStatus === ConnectionStatus.Connected) { |
| 437 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_ElementorFormSelect__WEBPACK_IMPORTED_MODULE_4__["default"], { |
| 438 |
formId: attributes.formId, |
| 439 |
setAttributes: setValue |
| 440 |
}); |
| 441 |
} else { |
| 442 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_ConnectPluginBanner__WEBPACK_IMPORTED_MODULE_3__["default"], {}); |
| 443 |
} |
| 444 |
}; |
| 445 |
|
| 446 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, { |
| 447 |
children: render() |
| 448 |
}); |
| 449 |
}; |
| 450 |
} |
| 451 |
|
| 452 |
/***/ }), |
| 453 |
|
| 454 |
/***/ "./scripts/elementor/FormWidget/FormWidgetController.tsx": |
| 455 |
/*!***************************************************************!*\ |
| 456 |
!*** ./scripts/elementor/FormWidget/FormWidgetController.tsx ***! |
| 457 |
\***************************************************************/ |
| 458 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 459 |
|
| 460 |
"use strict"; |
| 461 |
__webpack_require__.r(__webpack_exports__); |
| 462 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 463 |
/* harmony export */ "default": () => (/* binding */ FormWidgetController) |
| 464 |
/* harmony export */ }); |
| 465 |
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); |
| 466 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react"); |
| 467 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); |
| 468 |
/* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts"); |
| 469 |
/* harmony import */ var _shared_Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/Common/ErrorHandler */ "./scripts/shared/Common/ErrorHandler.tsx"); |
| 470 |
/* harmony import */ var _shared_Form_FormEdit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../shared/Form/FormEdit */ "./scripts/shared/Form/FormEdit.tsx"); |
| 471 |
/* harmony import */ var _shared_enums_connectionStatus__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../shared/enums/connectionStatus */ "./scripts/shared/enums/connectionStatus.ts"); |
| 472 |
|
| 473 |
|
| 474 |
|
| 475 |
|
| 476 |
|
| 477 |
|
| 478 |
function FormWidgetController(attributes, setValue) { |
| 479 |
return function () { |
| 480 |
var render = function render() { |
| 481 |
if (_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.connectionStatus === _shared_enums_connectionStatus__WEBPACK_IMPORTED_MODULE_5__["default"].Connected) { |
| 482 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_shared_Form_FormEdit__WEBPACK_IMPORTED_MODULE_4__["default"], { |
| 483 |
attributes: attributes, |
| 484 |
isSelected: true, |
| 485 |
setAttributes: setValue, |
| 486 |
preview: false, |
| 487 |
origin: "elementor" |
| 488 |
}); |
| 489 |
} else { |
| 490 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_shared_Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_3__["default"], { |
| 491 |
status: 401 |
| 492 |
}); |
| 493 |
} |
| 494 |
}; |
| 495 |
|
| 496 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, { |
| 497 |
children: render() |
| 498 |
}); |
| 499 |
}; |
| 500 |
} |
| 501 |
|
| 502 |
/***/ }), |
| 503 |
|
| 504 |
/***/ "./scripts/elementor/FormWidget/hooks/useForms.ts": |
| 505 |
/*!********************************************************!*\ |
| 506 |
!*** ./scripts/elementor/FormWidget/hooks/useForms.ts ***! |
| 507 |
\********************************************************/ |
| 508 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 509 |
|
| 510 |
"use strict"; |
| 511 |
__webpack_require__.r(__webpack_exports__); |
| 512 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 513 |
/* harmony export */ "default": () => (/* binding */ useForms) |
| 514 |
/* harmony export */ }); |
| 515 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 516 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 517 |
/* harmony import */ var _shared_enums_loadState__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../shared/enums/loadState */ "./scripts/shared/enums/loadState.ts"); |
| 518 |
/* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts"); |
| 519 |
/* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts"); |
| 520 |
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } |
| 521 |
|
| 522 |
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."); } |
| 523 |
|
| 524 |
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); } |
| 525 |
|
| 526 |
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; } |
| 527 |
|
| 528 |
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; } |
| 529 |
|
| 530 |
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
| 531 |
|
| 532 |
|
| 533 |
|
| 534 |
|
| 535 |
|
| 536 |
function useForms() { |
| 537 |
var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_3__.usePostAsyncBackgroundMessage)(); |
| 538 |
|
| 539 |
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(_shared_enums_loadState__WEBPACK_IMPORTED_MODULE_1__["default"].NotLoaded), |
| 540 |
_useState2 = _slicedToArray(_useState, 2), |
| 541 |
loadState = _useState2[0], |
| 542 |
setLoadState = _useState2[1]; |
| 543 |
|
| 544 |
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null), |
| 545 |
_useState4 = _slicedToArray(_useState3, 2), |
| 546 |
hasError = _useState4[0], |
| 547 |
setError = _useState4[1]; |
| 548 |
|
| 549 |
var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]), |
| 550 |
_useState6 = _slicedToArray(_useState5, 2), |
| 551 |
forms = _useState6[0], |
| 552 |
setForms = _useState6[1]; |
| 553 |
|
| 554 |
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { |
| 555 |
if (loadState === _shared_enums_loadState__WEBPACK_IMPORTED_MODULE_1__["default"].NotLoaded) { |
| 556 |
proxy({ |
| 557 |
key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_2__.ProxyMessages.FetchForms, |
| 558 |
payload: { |
| 559 |
search: '' |
| 560 |
} |
| 561 |
}).then(function (data) { |
| 562 |
setForms(data.map(function (form) { |
| 563 |
return { |
| 564 |
label: form.name, |
| 565 |
value: form.guid |
| 566 |
}; |
| 567 |
})); |
| 568 |
setLoadState(_shared_enums_loadState__WEBPACK_IMPORTED_MODULE_1__["default"].Loaded); |
| 569 |
})["catch"](function (error) { |
| 570 |
setError(error); |
| 571 |
setLoadState(_shared_enums_loadState__WEBPACK_IMPORTED_MODULE_1__["default"].Failed); |
| 572 |
}); |
| 573 |
} |
| 574 |
}, [loadState]); |
| 575 |
return { |
| 576 |
forms: forms, |
| 577 |
loading: loadState === _shared_enums_loadState__WEBPACK_IMPORTED_MODULE_1__["default"].Loading, |
| 578 |
hasError: hasError |
| 579 |
}; |
| 580 |
} |
| 581 |
|
| 582 |
/***/ }), |
| 583 |
|
| 584 |
/***/ "./scripts/elementor/FormWidget/registerFormWidget.ts": |
| 585 |
/*!************************************************************!*\ |
| 586 |
!*** ./scripts/elementor/FormWidget/registerFormWidget.ts ***! |
| 587 |
\************************************************************/ |
| 588 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 589 |
|
| 590 |
"use strict"; |
| 591 |
__webpack_require__.r(__webpack_exports__); |
| 592 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 593 |
/* harmony export */ "default": () => (/* binding */ registerFormWidget) |
| 594 |
/* harmony export */ }); |
| 595 |
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-dom */ "react-dom"); |
| 596 |
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_0__); |
| 597 |
/* harmony import */ var _FormControlController__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./FormControlController */ "./scripts/elementor/FormWidget/FormControlController.tsx"); |
| 598 |
/* harmony import */ var _FormWidgetController__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./FormWidgetController */ "./scripts/elementor/FormWidget/FormWidgetController.tsx"); |
| 599 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 600 |
|
| 601 |
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } |
| 602 |
|
| 603 |
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } |
| 604 |
|
| 605 |
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; } |
| 606 |
|
| 607 |
|
| 608 |
|
| 609 |
|
| 610 |
|
| 611 |
var registerFormWidget = /*#__PURE__*/function () { |
| 612 |
function registerFormWidget(controlContainer, widgetContainer, setValue) { |
| 613 |
_classCallCheck(this, registerFormWidget); |
| 614 |
|
| 615 |
_defineProperty(this, "widgetContainer", void 0); |
| 616 |
|
| 617 |
_defineProperty(this, "attributes", void 0); |
| 618 |
|
| 619 |
_defineProperty(this, "controlContainer", void 0); |
| 620 |
|
| 621 |
_defineProperty(this, "setValue", void 0); |
| 622 |
|
| 623 |
var attributes = widgetContainer.dataset.attributes ? JSON.parse(widgetContainer.dataset.attributes) : {}; |
| 624 |
this.widgetContainer = widgetContainer; |
| 625 |
this.controlContainer = controlContainer; |
| 626 |
this.setValue = setValue; |
| 627 |
this.attributes = attributes; |
| 628 |
} |
| 629 |
|
| 630 |
_createClass(registerFormWidget, [{ |
| 631 |
key: "render", |
| 632 |
value: function render() { |
| 633 |
react_dom__WEBPACK_IMPORTED_MODULE_0___default().render((0,_FormWidgetController__WEBPACK_IMPORTED_MODULE_2__["default"])(this.attributes, this.setValue)(), this.widgetContainer); |
| 634 |
react_dom__WEBPACK_IMPORTED_MODULE_0___default().render((0,_FormControlController__WEBPACK_IMPORTED_MODULE_1__["default"])(this.attributes, this.setValue)(), this.controlContainer); |
| 635 |
} |
| 636 |
}, { |
| 637 |
key: "done", |
| 638 |
value: function done() { |
| 639 |
react_dom__WEBPACK_IMPORTED_MODULE_0___default().unmountComponentAtNode(this.widgetContainer); |
| 640 |
react_dom__WEBPACK_IMPORTED_MODULE_0___default().unmountComponentAtNode(this.controlContainer); |
| 641 |
} |
| 642 |
}]); |
| 643 |
|
| 644 |
return registerFormWidget; |
| 645 |
}(); |
| 646 |
|
| 647 |
|
| 648 |
|
| 649 |
/***/ }), |
| 650 |
|
| 651 |
/***/ "./scripts/elementor/MeetingWidget/ElementorMeetingSelect.tsx": |
| 652 |
/*!********************************************************************!*\ |
| 653 |
!*** ./scripts/elementor/MeetingWidget/ElementorMeetingSelect.tsx ***! |
| 654 |
\********************************************************************/ |
| 655 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 656 |
|
| 657 |
"use strict"; |
| 658 |
__webpack_require__.r(__webpack_exports__); |
| 659 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 660 |
/* harmony export */ "default": () => (/* binding */ ElementorMeetingsSelectContainer) |
| 661 |
/* harmony export */ }); |
| 662 |
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); |
| 663 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react"); |
| 664 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); |
| 665 |
/* harmony import */ var _Common_ElementorBanner__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/ElementorBanner */ "./scripts/elementor/Common/ElementorBanner.tsx"); |
| 666 |
/* harmony import */ var _shared_UIComponents_UISpinner__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/UIComponents/UISpinner */ "./scripts/shared/UIComponents/UISpinner.tsx"); |
| 667 |
/* harmony import */ var _ElementorMeetingWarning__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ElementorMeetingWarning */ "./scripts/elementor/MeetingWidget/ElementorMeetingWarning.tsx"); |
| 668 |
/* harmony import */ var _shared_Meeting_hooks_useMeetings__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../shared/Meeting/hooks/useMeetings */ "./scripts/shared/Meeting/hooks/useMeetings.ts"); |
| 669 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 670 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__); |
| 671 |
/* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! raven-js */ "./node_modules/raven-js/src/singleton.js"); |
| 672 |
/* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(raven_js__WEBPACK_IMPORTED_MODULE_7__); |
| 673 |
/* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts"); |
| 674 |
/* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts"); |
| 675 |
/* harmony import */ var _utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../utils/backgroundAppUtils */ "./scripts/utils/backgroundAppUtils.ts"); |
| 676 |
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; } |
| 677 |
|
| 678 |
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; } |
| 679 |
|
| 680 |
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; } |
| 681 |
|
| 682 |
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } |
| 683 |
|
| 684 |
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."); } |
| 685 |
|
| 686 |
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); } |
| 687 |
|
| 688 |
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; } |
| 689 |
|
| 690 |
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; } |
| 691 |
|
| 692 |
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
| 693 |
|
| 694 |
|
| 695 |
|
| 696 |
|
| 697 |
|
| 698 |
|
| 699 |
|
| 700 |
|
| 701 |
|
| 702 |
|
| 703 |
|
| 704 |
|
| 705 |
|
| 706 |
function ElementorMeetingSelect(_ref) { |
| 707 |
var url = _ref.url, |
| 708 |
setAttributes = _ref.setAttributes; |
| 709 |
|
| 710 |
var _useMeetings = (0,_shared_Meeting_hooks_useMeetings__WEBPACK_IMPORTED_MODULE_5__["default"])(), |
| 711 |
meetings = _useMeetings.mappedMeetings, |
| 712 |
loading = _useMeetings.loading, |
| 713 |
error = _useMeetings.error, |
| 714 |
reload = _useMeetings.reload, |
| 715 |
connectCalendar = _useMeetings.connectCalendar; |
| 716 |
|
| 717 |
var selectedMeetingCalendar = (0,_shared_Meeting_hooks_useMeetings__WEBPACK_IMPORTED_MODULE_5__.useSelectedMeetingCalendar)(url); |
| 718 |
|
| 719 |
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(url), |
| 720 |
_useState2 = _slicedToArray(_useState, 2), |
| 721 |
localUrl = _useState2[0], |
| 722 |
setLocalUrl = _useState2[1]; |
| 723 |
|
| 724 |
var handleConnectCalendar = function handleConnectCalendar() { |
| 725 |
return connectCalendar().then(function () { |
| 726 |
reload(); |
| 727 |
})["catch"](function (error) { |
| 728 |
raven_js__WEBPACK_IMPORTED_MODULE_7___default().captureMessage('Unable to connect calendar', { |
| 729 |
extra: { |
| 730 |
error: error |
| 731 |
} |
| 732 |
}); |
| 733 |
}); |
| 734 |
}; |
| 735 |
|
| 736 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, { |
| 737 |
children: loading ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { |
| 738 |
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_shared_UIComponents_UISpinner__WEBPACK_IMPORTED_MODULE_3__["default"], {}) |
| 739 |
}) : error ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_ElementorBanner__WEBPACK_IMPORTED_MODULE_2__["default"], { |
| 740 |
type: "danger", |
| 741 |
children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Please refresh your meetings or try again in a few minutes', 'leadin') |
| 742 |
}) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, { |
| 743 |
children: [selectedMeetingCalendar && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_ElementorMeetingWarning__WEBPACK_IMPORTED_MODULE_4__["default"], { |
| 744 |
status: selectedMeetingCalendar, |
| 745 |
onConnectCalendar: connectCalendar |
| 746 |
}), meetings.length > 1 && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { |
| 747 |
value: localUrl, |
| 748 |
onChange: function onChange(event) { |
| 749 |
var newUrl = event.target.value; |
| 750 |
setLocalUrl(newUrl); |
| 751 |
setAttributes({ |
| 752 |
url: newUrl |
| 753 |
}); |
| 754 |
}, |
| 755 |
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { |
| 756 |
value: "", |
| 757 |
disabled: true, |
| 758 |
selected: true, |
| 759 |
children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Select a meeting', 'leadin') |
| 760 |
}), meetings.map(function (item) { |
| 761 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { |
| 762 |
value: item.value, |
| 763 |
children: item.label |
| 764 |
}, item.value); |
| 765 |
})] |
| 766 |
})] |
| 767 |
}) |
| 768 |
}); |
| 769 |
} |
| 770 |
|
| 771 |
function ElementorMeetingSelectWrapper(props) { |
| 772 |
var isBackgroundAppReady = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_8__.useBackgroundAppContext)(); |
| 773 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, { |
| 774 |
children: !isBackgroundAppReady ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { |
| 775 |
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_shared_UIComponents_UISpinner__WEBPACK_IMPORTED_MODULE_3__["default"], {}) |
| 776 |
}) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ElementorMeetingSelect, _objectSpread({}, props)) |
| 777 |
}); |
| 778 |
} |
| 779 |
|
| 780 |
function ElementorMeetingsSelectContainer(props) { |
| 781 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_8__.BackgroudAppContext.Provider, { |
| 782 |
value: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_9__.refreshToken && (0,_utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_10__.getOrCreateBackgroundApp)(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_9__.refreshToken), |
| 783 |
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ElementorMeetingSelectWrapper, _objectSpread({}, props)) |
| 784 |
}); |
| 785 |
} |
| 786 |
|
| 787 |
/***/ }), |
| 788 |
|
| 789 |
/***/ "./scripts/elementor/MeetingWidget/ElementorMeetingWarning.tsx": |
| 790 |
/*!*********************************************************************!*\ |
| 791 |
!*** ./scripts/elementor/MeetingWidget/ElementorMeetingWarning.tsx ***! |
| 792 |
\*********************************************************************/ |
| 793 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 794 |
|
| 795 |
"use strict"; |
| 796 |
__webpack_require__.r(__webpack_exports__); |
| 797 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 798 |
/* harmony export */ "default": () => (/* binding */ MeetingWarning) |
| 799 |
/* harmony export */ }); |
| 800 |
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); |
| 801 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react"); |
| 802 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); |
| 803 |
/* harmony import */ var _shared_Meeting_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/Meeting/constants */ "./scripts/shared/Meeting/constants.ts"); |
| 804 |
/* harmony import */ var _Common_ElementorButton__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Common/ElementorButton */ "./scripts/elementor/Common/ElementorButton.tsx"); |
| 805 |
/* harmony import */ var _Common_ElementorBanner__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Common/ElementorBanner */ "./scripts/elementor/Common/ElementorBanner.tsx"); |
| 806 |
/* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs"); |
| 807 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 808 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__); |
| 809 |
|
| 810 |
|
| 811 |
|
| 812 |
|
| 813 |
|
| 814 |
|
| 815 |
|
| 816 |
var Container = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_6__.styled)('div')({ |
| 817 |
name: "Container", |
| 818 |
"class": "c1p032ba", |
| 819 |
propsAsIs: false |
| 820 |
}); |
| 821 |
function MeetingWarning(_ref) { |
| 822 |
var onConnectCalendar = _ref.onConnectCalendar, |
| 823 |
status = _ref.status; |
| 824 |
var isMeetingOwner = status === _shared_Meeting_constants__WEBPACK_IMPORTED_MODULE_2__.CURRENT_USER_CALENDAR_MISSING; |
| 825 |
var titleText = isMeetingOwner ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Your calendar is not connected', 'leadin') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Calendar is not connected', 'leadin'); |
| 826 |
var titleMessage = isMeetingOwner ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Please connect your calendar to activate your scheduling pages', 'leadin') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Make sure that everybody in this meeting has connected their calendar from the Meetings page in HubSpot', 'leadin'); |
| 827 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, { |
| 828 |
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Container, { |
| 829 |
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_Common_ElementorBanner__WEBPACK_IMPORTED_MODULE_4__["default"], { |
| 830 |
type: "warning", |
| 831 |
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("b", { |
| 832 |
children: titleText |
| 833 |
}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("br", {}), titleMessage] |
| 834 |
}) |
| 835 |
}), isMeetingOwner && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_ElementorButton__WEBPACK_IMPORTED_MODULE_3__["default"], { |
| 836 |
id: "meetings-connect-calendar", |
| 837 |
onClick: onConnectCalendar, |
| 838 |
children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Connect calendar', 'leadin') |
| 839 |
})] |
| 840 |
}); |
| 841 |
} |
| 842 |
|
| 843 |
__webpack_require__(/*! ./ElementorMeetingWarning.linaria.css!=!../../../node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./ElementorMeetingWarning.tsx */ "./scripts/elementor/MeetingWidget/ElementorMeetingWarning.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/elementor/MeetingWidget/ElementorMeetingWarning.tsx"); |
| 844 |
|
| 845 |
/***/ }), |
| 846 |
|
| 847 |
/***/ "./scripts/elementor/MeetingWidget/MeetingControlController.tsx": |
| 848 |
/*!**********************************************************************!*\ |
| 849 |
!*** ./scripts/elementor/MeetingWidget/MeetingControlController.tsx ***! |
| 850 |
\**********************************************************************/ |
| 851 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 852 |
|
| 853 |
"use strict"; |
| 854 |
__webpack_require__.r(__webpack_exports__); |
| 855 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 856 |
/* harmony export */ "default": () => (/* binding */ MeetingControlController) |
| 857 |
/* harmony export */ }); |
| 858 |
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); |
| 859 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react"); |
| 860 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); |
| 861 |
/* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts"); |
| 862 |
/* harmony import */ var _Common_ConnectPluginBanner__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Common/ConnectPluginBanner */ "./scripts/elementor/Common/ConnectPluginBanner.tsx"); |
| 863 |
/* harmony import */ var _ElementorMeetingSelect__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ElementorMeetingSelect */ "./scripts/elementor/MeetingWidget/ElementorMeetingSelect.tsx"); |
| 864 |
|
| 865 |
|
| 866 |
|
| 867 |
|
| 868 |
|
| 869 |
var ConnectionStatus = { |
| 870 |
Connected: 'Connected', |
| 871 |
NotConnected: 'NotConnected' |
| 872 |
}; |
| 873 |
function MeetingControlController(attributes, setValue) { |
| 874 |
return function () { |
| 875 |
var render = function render() { |
| 876 |
if (_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.connectionStatus === ConnectionStatus.Connected) { |
| 877 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_ElementorMeetingSelect__WEBPACK_IMPORTED_MODULE_4__["default"], { |
| 878 |
url: attributes.url, |
| 879 |
setAttributes: setValue |
| 880 |
}); |
| 881 |
} else { |
| 882 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_ConnectPluginBanner__WEBPACK_IMPORTED_MODULE_3__["default"], {}); |
| 883 |
} |
| 884 |
}; |
| 885 |
|
| 886 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, { |
| 887 |
children: render() |
| 888 |
}); |
| 889 |
}; |
| 890 |
} |
| 891 |
|
| 892 |
/***/ }), |
| 893 |
|
| 894 |
/***/ "./scripts/elementor/MeetingWidget/MeetingWidgetController.tsx": |
| 895 |
/*!*********************************************************************!*\ |
| 896 |
!*** ./scripts/elementor/MeetingWidget/MeetingWidgetController.tsx ***! |
| 897 |
\*********************************************************************/ |
| 898 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 899 |
|
| 900 |
"use strict"; |
| 901 |
__webpack_require__.r(__webpack_exports__); |
| 902 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 903 |
/* harmony export */ "default": () => (/* binding */ MeetingWidgetController) |
| 904 |
/* harmony export */ }); |
| 905 |
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); |
| 906 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react"); |
| 907 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); |
| 908 |
/* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts"); |
| 909 |
/* harmony import */ var _shared_Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/Common/ErrorHandler */ "./scripts/shared/Common/ErrorHandler.tsx"); |
| 910 |
/* harmony import */ var _shared_Meeting_MeetingEdit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../shared/Meeting/MeetingEdit */ "./scripts/shared/Meeting/MeetingEdit.tsx"); |
| 911 |
|
| 912 |
|
| 913 |
|
| 914 |
|
| 915 |
|
| 916 |
var ConnectionStatus = { |
| 917 |
Connected: 'Connected', |
| 918 |
NotConnected: 'NotConnected' |
| 919 |
}; |
| 920 |
function MeetingWidgetController(attributes, setValue) { |
| 921 |
return function () { |
| 922 |
var render = function render() { |
| 923 |
if (_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.connectionStatus === ConnectionStatus.Connected) { |
| 924 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_shared_Meeting_MeetingEdit__WEBPACK_IMPORTED_MODULE_4__["default"], { |
| 925 |
attributes: attributes, |
| 926 |
isSelected: true, |
| 927 |
setAttributes: setValue, |
| 928 |
preview: false, |
| 929 |
origin: "elementor" |
| 930 |
}); |
| 931 |
} else { |
| 932 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_shared_Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_3__["default"], { |
| 933 |
status: 401 |
| 934 |
}); |
| 935 |
} |
| 936 |
}; |
| 937 |
|
| 938 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, { |
| 939 |
children: render() |
| 940 |
}); |
| 941 |
}; |
| 942 |
} |
| 943 |
|
| 944 |
/***/ }), |
| 945 |
|
| 946 |
/***/ "./scripts/elementor/MeetingWidget/registerMeetingWidget.ts": |
| 947 |
/*!******************************************************************!*\ |
| 948 |
!*** ./scripts/elementor/MeetingWidget/registerMeetingWidget.ts ***! |
| 949 |
\******************************************************************/ |
| 950 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 951 |
|
| 952 |
"use strict"; |
| 953 |
__webpack_require__.r(__webpack_exports__); |
| 954 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 955 |
/* harmony export */ "default": () => (/* binding */ registerMeetingsWidget) |
| 956 |
/* harmony export */ }); |
| 957 |
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-dom */ "react-dom"); |
| 958 |
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_0__); |
| 959 |
/* harmony import */ var _MeetingControlController__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./MeetingControlController */ "./scripts/elementor/MeetingWidget/MeetingControlController.tsx"); |
| 960 |
/* harmony import */ var _MeetingWidgetController__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./MeetingWidgetController */ "./scripts/elementor/MeetingWidget/MeetingWidgetController.tsx"); |
| 961 |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
| 962 |
|
| 963 |
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } |
| 964 |
|
| 965 |
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } |
| 966 |
|
| 967 |
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; } |
| 968 |
|
| 969 |
|
| 970 |
|
| 971 |
|
| 972 |
|
| 973 |
var registerMeetingsWidget = /*#__PURE__*/function () { |
| 974 |
function registerMeetingsWidget(controlContainer, widgetContainer, setValue) { |
| 975 |
_classCallCheck(this, registerMeetingsWidget); |
| 976 |
|
| 977 |
_defineProperty(this, "widgetContainer", void 0); |
| 978 |
|
| 979 |
_defineProperty(this, "controlContainer", void 0); |
| 980 |
|
| 981 |
_defineProperty(this, "setValue", void 0); |
| 982 |
|
| 983 |
_defineProperty(this, "attributes", void 0); |
| 984 |
|
| 985 |
var attributes = widgetContainer.dataset.attributes ? JSON.parse(widgetContainer.dataset.attributes) : {}; |
| 986 |
this.widgetContainer = widgetContainer; |
| 987 |
this.controlContainer = controlContainer; |
| 988 |
this.setValue = setValue; |
| 989 |
this.attributes = attributes; |
| 990 |
} |
| 991 |
|
| 992 |
_createClass(registerMeetingsWidget, [{ |
| 993 |
key: "render", |
| 994 |
value: function render() { |
| 995 |
react_dom__WEBPACK_IMPORTED_MODULE_0___default().render((0,_MeetingWidgetController__WEBPACK_IMPORTED_MODULE_2__["default"])(this.attributes, this.setValue)(), this.widgetContainer); |
| 996 |
react_dom__WEBPACK_IMPORTED_MODULE_0___default().render((0,_MeetingControlController__WEBPACK_IMPORTED_MODULE_1__["default"])(this.attributes, this.setValue)(), this.controlContainer); |
| 997 |
} |
| 998 |
}, { |
| 999 |
key: "done", |
| 1000 |
value: function done() { |
| 1001 |
react_dom__WEBPACK_IMPORTED_MODULE_0___default().unmountComponentAtNode(this.widgetContainer); |
| 1002 |
react_dom__WEBPACK_IMPORTED_MODULE_0___default().unmountComponentAtNode(this.controlContainer); |
| 1003 |
} |
| 1004 |
}]); |
| 1005 |
|
| 1006 |
return registerMeetingsWidget; |
| 1007 |
}(); |
| 1008 |
|
| 1009 |
|
| 1010 |
|
| 1011 |
/***/ }), |
| 1012 |
|
| 1013 |
/***/ "./scripts/elementor/elementorWidget.ts": |
| 1014 |
/*!**********************************************!*\ |
| 1015 |
!*** ./scripts/elementor/elementorWidget.ts ***! |
| 1016 |
\**********************************************/ |
| 1017 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1018 |
|
| 1019 |
"use strict"; |
| 1020 |
__webpack_require__.r(__webpack_exports__); |
| 1021 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1022 |
/* harmony export */ "default": () => (/* binding */ elementorWidget) |
| 1023 |
/* harmony export */ }); |
| 1024 |
function elementorWidget(elementor, options, callback) { |
| 1025 |
var done = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function () {}; |
| 1026 |
return elementor.modules.controls.BaseData.extend({ |
| 1027 |
onReady: function onReady() { |
| 1028 |
var self = this; |
| 1029 |
var controlContainer = this.ui.contentEditable.prevObject[0].querySelector(options.controlSelector); |
| 1030 |
var widgetContainer = this.options.element.$el[0].querySelector(options.containerSelector); |
| 1031 |
|
| 1032 |
if (widgetContainer) { |
| 1033 |
callback(controlContainer, widgetContainer, function (args) { |
| 1034 |
return self.setValue(args); |
| 1035 |
}); |
| 1036 |
} else { |
| 1037 |
//@ts-expect-error global |
| 1038 |
window.elementorFrontend.hooks.addAction("frontend/element_ready/".concat(options.widgetName, ".default"), function (element) { |
| 1039 |
widgetContainer = element[0].querySelector(options.containerSelector); |
| 1040 |
callback(controlContainer, widgetContainer, function (args) { |
| 1041 |
return self.setValue(args); |
| 1042 |
}); |
| 1043 |
}); |
| 1044 |
} |
| 1045 |
}, |
| 1046 |
saveValue: function saveValue(props) { |
| 1047 |
this.setValue(props); |
| 1048 |
}, |
| 1049 |
onBeforeDestroy: function onBeforeDestroy() { |
| 1050 |
//@ts-expect-error global |
| 1051 |
window.elementorFrontend.hooks.removeAction("frontend/element_ready/".concat(options.widgetName, ".default")); |
| 1052 |
done(); |
| 1053 |
} |
| 1054 |
}); |
| 1055 |
} |
| 1056 |
|
| 1057 |
/***/ }), |
| 1058 |
|
| 1059 |
/***/ "./scripts/iframe/integratedMessages/core/CoreMessages.ts": |
| 1060 |
/*!****************************************************************!*\ |
| 1061 |
!*** ./scripts/iframe/integratedMessages/core/CoreMessages.ts ***! |
| 1062 |
\****************************************************************/ |
| 1063 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1064 |
|
| 1065 |
"use strict"; |
| 1066 |
__webpack_require__.r(__webpack_exports__); |
| 1067 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1068 |
/* harmony export */ "CoreMessages": () => (/* binding */ CoreMessages) |
| 1069 |
/* harmony export */ }); |
| 1070 |
var CoreMessages = { |
| 1071 |
HandshakeReceive: 'INTEGRATED_APP_EMBEDDER_HANDSHAKE_RECEIVED', |
| 1072 |
SendRefreshToken: 'INTEGRATED_APP_EMBEDDER_SEND_REFRESH_TOKEN', |
| 1073 |
ReloadParentFrame: 'INTEGRATED_APP_EMBEDDER_RELOAD_PARENT_FRAME', |
| 1074 |
RedirectParentFrame: 'INTEGRATED_APP_EMBEDDER_REDIRECT_PARENT_FRAME', |
| 1075 |
SendLocale: 'INTEGRATED_APP_EMBEDDER_SEND_LOCALE', |
| 1076 |
SendDeviceId: 'INTEGRATED_APP_EMBEDDER_SEND_DEVICE_ID' |
| 1077 |
}; |
| 1078 |
|
| 1079 |
/***/ }), |
| 1080 |
|
| 1081 |
/***/ "./scripts/iframe/integratedMessages/forms/FormsMessages.ts": |
| 1082 |
/*!******************************************************************!*\ |
| 1083 |
!*** ./scripts/iframe/integratedMessages/forms/FormsMessages.ts ***! |
| 1084 |
\******************************************************************/ |
| 1085 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1086 |
|
| 1087 |
"use strict"; |
| 1088 |
__webpack_require__.r(__webpack_exports__); |
| 1089 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1090 |
/* harmony export */ "FormMessages": () => (/* binding */ FormMessages) |
| 1091 |
/* harmony export */ }); |
| 1092 |
var FormMessages = { |
| 1093 |
CreateFormAppNavigation: 'CREATE_FORM_APP_NAVIGATION' |
| 1094 |
}; |
| 1095 |
|
| 1096 |
/***/ }), |
| 1097 |
|
| 1098 |
/***/ "./scripts/iframe/integratedMessages/index.ts": |
| 1099 |
/*!****************************************************!*\ |
| 1100 |
!*** ./scripts/iframe/integratedMessages/index.ts ***! |
| 1101 |
\****************************************************/ |
| 1102 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1103 |
|
| 1104 |
"use strict"; |
| 1105 |
__webpack_require__.r(__webpack_exports__); |
| 1106 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1107 |
/* harmony export */ "CoreMessages": () => (/* reexport safe */ _core_CoreMessages__WEBPACK_IMPORTED_MODULE_0__.CoreMessages), |
| 1108 |
/* harmony export */ "FormMessages": () => (/* reexport safe */ _forms_FormsMessages__WEBPACK_IMPORTED_MODULE_1__.FormMessages), |
| 1109 |
/* harmony export */ "LiveChatMessages": () => (/* reexport safe */ _livechat_LiveChatMessages__WEBPACK_IMPORTED_MODULE_2__.LiveChatMessages), |
| 1110 |
/* harmony export */ "PluginMessages": () => (/* reexport safe */ _plugin_PluginMessages__WEBPACK_IMPORTED_MODULE_3__.PluginMessages), |
| 1111 |
/* harmony export */ "ProxyMessages": () => (/* reexport safe */ _proxy_ProxyMessages__WEBPACK_IMPORTED_MODULE_4__.ProxyMessages) |
| 1112 |
/* harmony export */ }); |
| 1113 |
/* harmony import */ var _core_CoreMessages__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core/CoreMessages */ "./scripts/iframe/integratedMessages/core/CoreMessages.ts"); |
| 1114 |
/* harmony import */ var _forms_FormsMessages__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./forms/FormsMessages */ "./scripts/iframe/integratedMessages/forms/FormsMessages.ts"); |
| 1115 |
/* harmony import */ var _livechat_LiveChatMessages__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./livechat/LiveChatMessages */ "./scripts/iframe/integratedMessages/livechat/LiveChatMessages.ts"); |
| 1116 |
/* harmony import */ var _plugin_PluginMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./plugin/PluginMessages */ "./scripts/iframe/integratedMessages/plugin/PluginMessages.ts"); |
| 1117 |
/* harmony import */ var _proxy_ProxyMessages__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./proxy/ProxyMessages */ "./scripts/iframe/integratedMessages/proxy/ProxyMessages.ts"); |
| 1118 |
|
| 1119 |
|
| 1120 |
|
| 1121 |
|
| 1122 |
|
| 1123 |
|
| 1124 |
/***/ }), |
| 1125 |
|
| 1126 |
/***/ "./scripts/iframe/integratedMessages/livechat/LiveChatMessages.ts": |
| 1127 |
/*!************************************************************************!*\ |
| 1128 |
!*** ./scripts/iframe/integratedMessages/livechat/LiveChatMessages.ts ***! |
| 1129 |
\************************************************************************/ |
| 1130 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1131 |
|
| 1132 |
"use strict"; |
| 1133 |
__webpack_require__.r(__webpack_exports__); |
| 1134 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1135 |
/* harmony export */ "LiveChatMessages": () => (/* binding */ LiveChatMessages) |
| 1136 |
/* harmony export */ }); |
| 1137 |
var LiveChatMessages = { |
| 1138 |
CreateLiveChatAppNavigation: 'CREATE_LIVE_CHAT_APP_NAVIGATION' |
| 1139 |
}; |
| 1140 |
|
| 1141 |
/***/ }), |
| 1142 |
|
| 1143 |
/***/ "./scripts/iframe/integratedMessages/plugin/PluginMessages.ts": |
| 1144 |
/*!********************************************************************!*\ |
| 1145 |
!*** ./scripts/iframe/integratedMessages/plugin/PluginMessages.ts ***! |
| 1146 |
\********************************************************************/ |
| 1147 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1148 |
|
| 1149 |
"use strict"; |
| 1150 |
__webpack_require__.r(__webpack_exports__); |
| 1151 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1152 |
/* harmony export */ "PluginMessages": () => (/* binding */ PluginMessages) |
| 1153 |
/* harmony export */ }); |
| 1154 |
var PluginMessages = { |
| 1155 |
PluginSettingsNavigation: 'PLUGIN_SETTINGS_NAVIGATION', |
| 1156 |
PluginLeadinConfig: 'PLUGIN_LEADIN_CONFIG', |
| 1157 |
TrackConsent: 'INTEGRATED_APP_EMBEDDER_TRACK_CONSENT', |
| 1158 |
InternalTrackingFetchRequest: 'INTEGRATED_TRACKING_FETCH_REQUEST', |
| 1159 |
InternalTrackingFetchResponse: 'INTEGRATED_TRACKING_FETCH_RESPONSE', |
| 1160 |
InternalTrackingFetchError: 'INTEGRATED_TRACKING_FETCH_ERROR', |
| 1161 |
InternalTrackingChangeRequest: 'INTEGRATED_TRACKING_CHANGE_REQUEST', |
| 1162 |
InternalTrackingChangeError: 'INTEGRATED_TRACKING_CHANGE_ERROR', |
| 1163 |
BusinessUnitFetchRequest: 'BUSINESS_UNIT_FETCH_REQUEST', |
| 1164 |
BusinessUnitFetchResponse: 'BUSINESS_UNIT_FETCH_FETCH_RESPONSE', |
| 1165 |
BusinessUnitFetchError: 'BUSINESS_UNIT_FETCH_FETCH_ERROR', |
| 1166 |
BusinessUnitChangeRequest: 'BUSINESS_UNIT_CHANGE_REQUEST', |
| 1167 |
BusinessUnitChangeError: 'BUSINESS_UNIT_CHANGE_ERROR', |
| 1168 |
SkipReviewRequest: 'SKIP_REVIEW_REQUEST', |
| 1169 |
SkipReviewResponse: 'SKIP_REVIEW_RESPONSE', |
| 1170 |
SkipReviewError: 'SKIP_REVIEW_ERROR', |
| 1171 |
RemoveParentQueryParam: 'REMOVE_PARENT_QUERY_PARAM', |
| 1172 |
ContentEmbedInstallRequest: 'CONTENT_EMBED_INSTALL_REQUEST', |
| 1173 |
ContentEmbedInstallResponse: 'CONTENT_EMBED_INSTALL_RESPONSE', |
| 1174 |
ContentEmbedInstallError: 'CONTENT_EMBED_INSTALL_ERROR', |
| 1175 |
ContentEmbedActivationRequest: 'CONTENT_EMBED_ACTIVATION_REQUEST', |
| 1176 |
ContentEmbedActivationResponse: 'CONTENT_EMBED_ACTIVATION_RESPONSE', |
| 1177 |
ContentEmbedActivationError: 'CONTENT_EMBED_ACTIVATION_ERROR' |
| 1178 |
}; |
| 1179 |
|
| 1180 |
/***/ }), |
| 1181 |
|
| 1182 |
/***/ "./scripts/iframe/integratedMessages/proxy/ProxyMessages.ts": |
| 1183 |
/*!******************************************************************!*\ |
| 1184 |
!*** ./scripts/iframe/integratedMessages/proxy/ProxyMessages.ts ***! |
| 1185 |
\******************************************************************/ |
| 1186 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1187 |
|
| 1188 |
"use strict"; |
| 1189 |
__webpack_require__.r(__webpack_exports__); |
| 1190 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1191 |
/* harmony export */ "ProxyMessages": () => (/* binding */ ProxyMessages) |
| 1192 |
/* harmony export */ }); |
| 1193 |
var ProxyMessages = { |
| 1194 |
FetchForms: 'FETCH_FORMS', |
| 1195 |
FetchForm: 'FETCH_FORM', |
| 1196 |
CreateFormFromTemplate: 'CREATE_FORM_FROM_TEMPLATE', |
| 1197 |
FetchAuth: 'FETCH_AUTH', |
| 1198 |
FetchMeetingsAndUsers: 'FETCH_MEETINGS_AND_USERS', |
| 1199 |
FetchContactsCreateSinceActivation: 'FETCH_CONTACTS_CREATED_SINCE_ACTIVATION', |
| 1200 |
FetchOrCreateMeetingUser: 'FETCH_OR_CREATE_MEETING_USER', |
| 1201 |
ConnectMeetingsCalendar: 'CONNECT_MEETINGS_CALENDAR', |
| 1202 |
TrackFormPreviewRender: 'TRACK_FORM_PREVIEW_RENDER', |
| 1203 |
TrackFormCreatedFromTemplate: 'TRACK_FORM_CREATED_FROM_TEMPLATE', |
| 1204 |
TrackFormCreationFailed: 'TRACK_FORM_CREATION_FAILED', |
| 1205 |
TrackMeetingPreviewRender: 'TRACK_MEETING_PREVIEW_RENDER', |
| 1206 |
TrackSidebarMetaChange: 'TRACK_SIDEBAR_META_CHANGE', |
| 1207 |
TrackReviewBannerRender: 'TRACK_REVIEW_BANNER_RENDER', |
| 1208 |
TrackReviewBannerInteraction: 'TRACK_REVIEW_BANNER_INTERACTION', |
| 1209 |
TrackReviewBannerDismissed: 'TRACK_REVIEW_BANNER_DISMISSED', |
| 1210 |
TrackPluginDeactivation: 'TRACK_PLUGIN_DEACTIVATION' |
| 1211 |
}; |
| 1212 |
|
| 1213 |
/***/ }), |
| 1214 |
|
| 1215 |
/***/ "./scripts/iframe/useBackgroundApp.ts": |
| 1216 |
/*!********************************************!*\ |
| 1217 |
!*** ./scripts/iframe/useBackgroundApp.ts ***! |
| 1218 |
\********************************************/ |
| 1219 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1220 |
|
| 1221 |
"use strict"; |
| 1222 |
__webpack_require__.r(__webpack_exports__); |
| 1223 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1224 |
/* harmony export */ "BackgroudAppContext": () => (/* binding */ BackgroudAppContext), |
| 1225 |
/* harmony export */ "useBackgroundAppContext": () => (/* binding */ useBackgroundAppContext), |
| 1226 |
/* harmony export */ "usePostAsyncBackgroundMessage": () => (/* binding */ usePostAsyncBackgroundMessage), |
| 1227 |
/* harmony export */ "usePostBackgroundMessage": () => (/* binding */ usePostBackgroundMessage) |
| 1228 |
/* harmony export */ }); |
| 1229 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 1230 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 1231 |
|
| 1232 |
var BackgroudAppContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null); |
| 1233 |
function useBackgroundAppContext() { |
| 1234 |
return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(BackgroudAppContext); |
| 1235 |
} |
| 1236 |
function usePostBackgroundMessage() { |
| 1237 |
var app = useBackgroundAppContext(); |
| 1238 |
return function (message) { |
| 1239 |
app.postMessage(message); |
| 1240 |
}; |
| 1241 |
} |
| 1242 |
function usePostAsyncBackgroundMessage() { |
| 1243 |
var app = useBackgroundAppContext(); |
| 1244 |
return function (message) { |
| 1245 |
return app.postAsyncMessage(message); |
| 1246 |
}; |
| 1247 |
} |
| 1248 |
|
| 1249 |
/***/ }), |
| 1250 |
|
| 1251 |
/***/ "./scripts/lib/Raven.ts": |
| 1252 |
/*!******************************!*\ |
| 1253 |
!*** ./scripts/lib/Raven.ts ***! |
| 1254 |
\******************************/ |
| 1255 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1256 |
|
| 1257 |
"use strict"; |
| 1258 |
__webpack_require__.r(__webpack_exports__); |
| 1259 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1260 |
/* harmony export */ "configureRaven": () => (/* binding */ configureRaven), |
| 1261 |
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 1262 |
/* harmony export */ }); |
| 1263 |
/* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! raven-js */ "./node_modules/raven-js/src/singleton.js"); |
| 1264 |
/* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(raven_js__WEBPACK_IMPORTED_MODULE_0__); |
| 1265 |
/* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts"); |
| 1266 |
|
| 1267 |
|
| 1268 |
function configureRaven() { |
| 1269 |
if (_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.hubspotBaseUrl.indexOf('app.hubspot.com') === -1) { |
| 1270 |
return; |
| 1271 |
} |
| 1272 |
|
| 1273 |
raven_js__WEBPACK_IMPORTED_MODULE_0___default().config('https://e9b8f382cdd130c0d415cd977d2be56f@exceptions.hubspot.com/1', { |
| 1274 |
instrument: { |
| 1275 |
tryCatch: false |
| 1276 |
}, |
| 1277 |
release: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.leadinPluginVersion |
| 1278 |
}).install(); |
| 1279 |
raven_js__WEBPACK_IMPORTED_MODULE_0___default().setTagsContext({ |
| 1280 |
v: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.leadinPluginVersion, |
| 1281 |
php: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.phpVersion, |
| 1282 |
wordpress: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.wpVersion |
| 1283 |
}); |
| 1284 |
raven_js__WEBPACK_IMPORTED_MODULE_0___default().setExtraContext({ |
| 1285 |
hub: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.portalId, |
| 1286 |
plugins: Object.keys(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.plugins).map(function (name) { |
| 1287 |
return "".concat(name, "#").concat(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_1__.plugins[name]); |
| 1288 |
}).join(',') |
| 1289 |
}); |
| 1290 |
} |
| 1291 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((raven_js__WEBPACK_IMPORTED_MODULE_0___default())); |
| 1292 |
|
| 1293 |
/***/ }), |
| 1294 |
|
| 1295 |
/***/ "./scripts/shared/Common/AsyncSelect.tsx": |
| 1296 |
/*!***********************************************!*\ |
| 1297 |
!*** ./scripts/shared/Common/AsyncSelect.tsx ***! |
| 1298 |
\***********************************************/ |
| 1299 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1300 |
|
| 1301 |
"use strict"; |
| 1302 |
__webpack_require__.r(__webpack_exports__); |
| 1303 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1304 |
/* harmony export */ "default": () => (/* binding */ AsyncSelect) |
| 1305 |
/* harmony export */ }); |
| 1306 |
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); |
| 1307 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react"); |
| 1308 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); |
| 1309 |
/* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs"); |
| 1310 |
/* harmony import */ var _UIComponents_colors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/colors */ "./scripts/shared/UIComponents/colors.ts"); |
| 1311 |
/* harmony import */ var _UIComponents_UISpinner__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../UIComponents/UISpinner */ "./scripts/shared/UIComponents/UISpinner.tsx"); |
| 1312 |
/* harmony import */ var _enums_loadState__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../enums/loadState */ "./scripts/shared/enums/loadState.ts"); |
| 1313 |
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } |
| 1314 |
|
| 1315 |
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."); } |
| 1316 |
|
| 1317 |
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); } |
| 1318 |
|
| 1319 |
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; } |
| 1320 |
|
| 1321 |
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; } |
| 1322 |
|
| 1323 |
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
| 1324 |
|
| 1325 |
|
| 1326 |
|
| 1327 |
|
| 1328 |
|
| 1329 |
|
| 1330 |
|
| 1331 |
var Container = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({ |
| 1332 |
name: "Container", |
| 1333 |
"class": "c1wxx7eu", |
| 1334 |
propsAsIs: false |
| 1335 |
}); |
| 1336 |
|
| 1337 |
var _exp2 = /*#__PURE__*/function _exp2() { |
| 1338 |
return function (props) { |
| 1339 |
return props.focused ? '0' : '1px'; |
| 1340 |
}; |
| 1341 |
}; |
| 1342 |
|
| 1343 |
var _exp3 = /*#__PURE__*/function _exp3() { |
| 1344 |
return function (props) { |
| 1345 |
return props.focused ? "0 0 0 2px ".concat(_UIComponents_colors__WEBPACK_IMPORTED_MODULE_2__.CALYPSO_MEDIUM) : 'none'; |
| 1346 |
}; |
| 1347 |
}; |
| 1348 |
|
| 1349 |
var ControlContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({ |
| 1350 |
name: "ControlContainer", |
| 1351 |
"class": "c1rgwbep", |
| 1352 |
propsAsIs: false, |
| 1353 |
vars: { |
| 1354 |
"c1rgwbep-0": [_exp2()], |
| 1355 |
"c1rgwbep-1": [_exp3()] |
| 1356 |
} |
| 1357 |
}); |
| 1358 |
var ValueContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({ |
| 1359 |
name: "ValueContainer", |
| 1360 |
"class": "v1mdmbaj", |
| 1361 |
propsAsIs: false |
| 1362 |
}); |
| 1363 |
var Placeholder = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({ |
| 1364 |
name: "Placeholder", |
| 1365 |
"class": "p1gwkvxy", |
| 1366 |
propsAsIs: false |
| 1367 |
}); |
| 1368 |
var SingleValue = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({ |
| 1369 |
name: "SingleValue", |
| 1370 |
"class": "s1bwlafs", |
| 1371 |
propsAsIs: false |
| 1372 |
}); |
| 1373 |
var IndicatorContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({ |
| 1374 |
name: "IndicatorContainer", |
| 1375 |
"class": "i196z9y5", |
| 1376 |
propsAsIs: false |
| 1377 |
}); |
| 1378 |
var DropdownIndicator = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({ |
| 1379 |
name: "DropdownIndicator", |
| 1380 |
"class": "d1dfo5ow", |
| 1381 |
propsAsIs: false |
| 1382 |
}); |
| 1383 |
var InputContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({ |
| 1384 |
name: "InputContainer", |
| 1385 |
"class": "if3lze", |
| 1386 |
propsAsIs: false |
| 1387 |
}); |
| 1388 |
var Input = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('input')({ |
| 1389 |
name: "Input", |
| 1390 |
"class": "i9kxf50", |
| 1391 |
propsAsIs: false |
| 1392 |
}); |
| 1393 |
var InputShadow = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({ |
| 1394 |
name: "InputShadow", |
| 1395 |
"class": "igjr3uc", |
| 1396 |
propsAsIs: false |
| 1397 |
}); |
| 1398 |
var MenuContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({ |
| 1399 |
name: "MenuContainer", |
| 1400 |
"class": "mhb9if7", |
| 1401 |
propsAsIs: false |
| 1402 |
}); |
| 1403 |
var MenuList = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({ |
| 1404 |
name: "MenuList", |
| 1405 |
"class": "mxaof7s", |
| 1406 |
propsAsIs: false |
| 1407 |
}); |
| 1408 |
var MenuGroup = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({ |
| 1409 |
name: "MenuGroup", |
| 1410 |
"class": "mw50s5v", |
| 1411 |
propsAsIs: false |
| 1412 |
}); |
| 1413 |
var MenuGroupHeader = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({ |
| 1414 |
name: "MenuGroupHeader", |
| 1415 |
"class": "m11rzvjw", |
| 1416 |
propsAsIs: false |
| 1417 |
}); |
| 1418 |
|
| 1419 |
var _exp5 = /*#__PURE__*/function _exp5() { |
| 1420 |
return function (props) { |
| 1421 |
return props.selected ? _UIComponents_colors__WEBPACK_IMPORTED_MODULE_2__.CALYPSO_MEDIUM : 'transparent'; |
| 1422 |
}; |
| 1423 |
}; |
| 1424 |
|
| 1425 |
var _exp6 = /*#__PURE__*/function _exp6() { |
| 1426 |
return function (props) { |
| 1427 |
return props.selected ? '#fff' : 'inherit'; |
| 1428 |
}; |
| 1429 |
}; |
| 1430 |
|
| 1431 |
var _exp7 = /*#__PURE__*/function _exp7() { |
| 1432 |
return function (props) { |
| 1433 |
return props.selected ? _UIComponents_colors__WEBPACK_IMPORTED_MODULE_2__.CALYPSO_MEDIUM : _UIComponents_colors__WEBPACK_IMPORTED_MODULE_2__.CALYPSO_LIGHT; |
| 1434 |
}; |
| 1435 |
}; |
| 1436 |
|
| 1437 |
var MenuItem = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_5__.styled)('div')({ |
| 1438 |
name: "MenuItem", |
| 1439 |
"class": "m1jcdsjv", |
| 1440 |
propsAsIs: false, |
| 1441 |
vars: { |
| 1442 |
"m1jcdsjv-0": [_exp5()], |
| 1443 |
"m1jcdsjv-1": [_exp6()], |
| 1444 |
"m1jcdsjv-2": [_exp7()] |
| 1445 |
} |
| 1446 |
}); |
| 1447 |
function AsyncSelect(_ref) { |
| 1448 |
var placeholder = _ref.placeholder, |
| 1449 |
value = _ref.value, |
| 1450 |
loadOptions = _ref.loadOptions, |
| 1451 |
onChange = _ref.onChange, |
| 1452 |
defaultOptions = _ref.defaultOptions; |
| 1453 |
var inputEl = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); |
| 1454 |
var inputShadowEl = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); |
| 1455 |
|
| 1456 |
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false), |
| 1457 |
_useState2 = _slicedToArray(_useState, 2), |
| 1458 |
isFocused = _useState2[0], |
| 1459 |
setFocus = _useState2[1]; |
| 1460 |
|
| 1461 |
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(_enums_loadState__WEBPACK_IMPORTED_MODULE_4__["default"].NotLoaded), |
| 1462 |
_useState4 = _slicedToArray(_useState3, 2), |
| 1463 |
loadState = _useState4[0], |
| 1464 |
setLoadState = _useState4[1]; |
| 1465 |
|
| 1466 |
var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''), |
| 1467 |
_useState6 = _slicedToArray(_useState5, 2), |
| 1468 |
localValue = _useState6[0], |
| 1469 |
setLocalValue = _useState6[1]; |
| 1470 |
|
| 1471 |
var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(defaultOptions), |
| 1472 |
_useState8 = _slicedToArray(_useState7, 2), |
| 1473 |
options = _useState8[0], |
| 1474 |
setOptions = _useState8[1]; |
| 1475 |
|
| 1476 |
var inputSize = "".concat(inputShadowEl.current ? inputShadowEl.current.clientWidth + 10 : 2, "px"); |
| 1477 |
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () { |
| 1478 |
if (loadOptions && loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_4__["default"].NotLoaded) { |
| 1479 |
loadOptions('', function (result) { |
| 1480 |
setOptions(result); |
| 1481 |
setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_4__["default"].Idle); |
| 1482 |
}); |
| 1483 |
} |
| 1484 |
}, [loadOptions, loadState]); |
| 1485 |
|
| 1486 |
var renderItems = function renderItems() { |
| 1487 |
var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; |
| 1488 |
var parentKey = arguments.length > 1 ? arguments[1] : undefined; |
| 1489 |
return items.map(function (item, index) { |
| 1490 |
if (item.options) { |
| 1491 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(MenuGroup, { |
| 1492 |
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MenuGroupHeader, { |
| 1493 |
id: "".concat(index, "-heading"), |
| 1494 |
children: item.label |
| 1495 |
}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { |
| 1496 |
children: renderItems(item.options, index) |
| 1497 |
})] |
| 1498 |
}, "async-select-item-".concat(index)); |
| 1499 |
} else { |
| 1500 |
var key = "async-select-item-".concat(parentKey !== undefined ? "".concat(parentKey, "-").concat(index) : index); |
| 1501 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MenuItem, { |
| 1502 |
id: key, |
| 1503 |
selected: value && item.value === value.value, |
| 1504 |
onClick: function onClick() { |
| 1505 |
onChange(item); |
| 1506 |
setFocus(false); |
| 1507 |
}, |
| 1508 |
children: item.label |
| 1509 |
}, key); |
| 1510 |
} |
| 1511 |
}); |
| 1512 |
}; |
| 1513 |
|
| 1514 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Container, { |
| 1515 |
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(ControlContainer, { |
| 1516 |
id: "leadin-async-selector", |
| 1517 |
focused: isFocused, |
| 1518 |
onClick: function onClick() { |
| 1519 |
if (isFocused) { |
| 1520 |
if (inputEl.current) { |
| 1521 |
inputEl.current.blur(); |
| 1522 |
} |
| 1523 |
|
| 1524 |
setFocus(false); |
| 1525 |
setLocalValue(''); |
| 1526 |
} else { |
| 1527 |
if (inputEl.current) { |
| 1528 |
inputEl.current.focus(); |
| 1529 |
} |
| 1530 |
|
| 1531 |
setFocus(true); |
| 1532 |
} |
| 1533 |
}, |
| 1534 |
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(ValueContainer, { |
| 1535 |
children: [localValue === '' && (!value ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Placeholder, { |
| 1536 |
children: placeholder |
| 1537 |
}) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SingleValue, { |
| 1538 |
children: value.label |
| 1539 |
})), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(InputContainer, { |
| 1540 |
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Input, { |
| 1541 |
ref: inputEl, |
| 1542 |
onFocus: function onFocus() { |
| 1543 |
setFocus(true); |
| 1544 |
}, |
| 1545 |
onChange: function onChange(e) { |
| 1546 |
setLocalValue(e.target.value); |
| 1547 |
setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_4__["default"].Loading); |
| 1548 |
loadOptions && loadOptions(e.target.value, function (result) { |
| 1549 |
setOptions(result); |
| 1550 |
setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_4__["default"].Idle); |
| 1551 |
}); |
| 1552 |
}, |
| 1553 |
value: localValue, |
| 1554 |
width: inputSize, |
| 1555 |
id: "asycn-select-input" |
| 1556 |
}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputShadow, { |
| 1557 |
ref: inputShadowEl, |
| 1558 |
children: localValue |
| 1559 |
})] |
| 1560 |
})] |
| 1561 |
}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(IndicatorContainer, { |
| 1562 |
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, {})] |
| 1563 |
})] |
| 1564 |
}), isFocused && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MenuContainer, { |
| 1565 |
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MenuList, { |
| 1566 |
children: renderItems(options) |
| 1567 |
}) |
| 1568 |
})] |
| 1569 |
}); |
| 1570 |
} |
| 1571 |
|
| 1572 |
__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"); |
| 1573 |
|
| 1574 |
/***/ }), |
| 1575 |
|
| 1576 |
/***/ "./scripts/shared/Common/ErrorHandler.tsx": |
| 1577 |
/*!************************************************!*\ |
| 1578 |
!*** ./scripts/shared/Common/ErrorHandler.tsx ***! |
| 1579 |
\************************************************/ |
| 1580 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1581 |
|
| 1582 |
"use strict"; |
| 1583 |
__webpack_require__.r(__webpack_exports__); |
| 1584 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1585 |
/* harmony export */ "default": () => (/* binding */ ErrorHandler) |
| 1586 |
/* harmony export */ }); |
| 1587 |
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); |
| 1588 |
/* harmony import */ var _UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../UIComponents/UIButton */ "./scripts/shared/UIComponents/UIButton.ts"); |
| 1589 |
/* harmony import */ var _UIComponents_UIContainer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UIContainer */ "./scripts/shared/UIComponents/UIContainer.ts"); |
| 1590 |
/* harmony import */ var _HubspotWrapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./HubspotWrapper */ "./scripts/shared/Common/HubspotWrapper.ts"); |
| 1591 |
/* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts"); |
| 1592 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 1593 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__); |
| 1594 |
|
| 1595 |
|
| 1596 |
|
| 1597 |
|
| 1598 |
|
| 1599 |
|
| 1600 |
|
| 1601 |
|
| 1602 |
function redirectToPlugin() { |
| 1603 |
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); |
| 1604 |
} |
| 1605 |
|
| 1606 |
function ErrorHandler(_ref) { |
| 1607 |
var status = _ref.status, |
| 1608 |
resetErrorState = _ref.resetErrorState, |
| 1609 |
_ref$errorInfo = _ref.errorInfo, |
| 1610 |
errorInfo = _ref$errorInfo === void 0 ? { |
| 1611 |
header: '', |
| 1612 |
message: '', |
| 1613 |
action: '' |
| 1614 |
} : _ref$errorInfo; |
| 1615 |
var isUnauthorized = status === 401 || status === 403; |
| 1616 |
var errorHeader = isUnauthorized ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)("Your plugin isn't authorized", 'leadin') : errorInfo.header; |
| 1617 |
var errorMessage = isUnauthorized ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Reauthorize your plugin to access your free HubSpot tools', 'leadin') : errorInfo.message; |
| 1618 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_HubspotWrapper__WEBPACK_IMPORTED_MODULE_3__["default"], { |
| 1619 |
pluginPath: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_4__.pluginPath, |
| 1620 |
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_UIComponents_UIContainer__WEBPACK_IMPORTED_MODULE_2__["default"], { |
| 1621 |
textAlign: "center", |
| 1622 |
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h4", { |
| 1623 |
children: errorHeader |
| 1624 |
}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { |
| 1625 |
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("b", { |
| 1626 |
children: errorMessage |
| 1627 |
}) |
| 1628 |
}), isUnauthorized ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_1__["default"], { |
| 1629 |
"data-test-id": "authorize-button", |
| 1630 |
onClick: redirectToPlugin, |
| 1631 |
children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Go to plugin', 'leadin') |
| 1632 |
}) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_1__["default"], { |
| 1633 |
"data-test-id": "retry-button", |
| 1634 |
onClick: resetErrorState, |
| 1635 |
children: errorInfo.action |
| 1636 |
})] |
| 1637 |
}) |
| 1638 |
}); |
| 1639 |
} |
| 1640 |
|
| 1641 |
/***/ }), |
| 1642 |
|
| 1643 |
/***/ "./scripts/shared/Common/HubspotWrapper.ts": |
| 1644 |
/*!*************************************************!*\ |
| 1645 |
!*** ./scripts/shared/Common/HubspotWrapper.ts ***! |
| 1646 |
\*************************************************/ |
| 1647 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1648 |
|
| 1649 |
"use strict"; |
| 1650 |
__webpack_require__.r(__webpack_exports__); |
| 1651 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1652 |
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 1653 |
/* harmony export */ }); |
| 1654 |
/* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs"); |
| 1655 |
|
| 1656 |
|
| 1657 |
var _exp = /*#__PURE__*/function _exp() { |
| 1658 |
return function (props) { |
| 1659 |
return "url(".concat(props.pluginPath, "/public/assets/images/hubspot.svg)"); |
| 1660 |
}; |
| 1661 |
}; |
| 1662 |
|
| 1663 |
var _exp2 = /*#__PURE__*/function _exp2() { |
| 1664 |
return function (props) { |
| 1665 |
return props.padding || '90px 20% 25px'; |
| 1666 |
}; |
| 1667 |
}; |
| 1668 |
|
| 1669 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_0__.styled)('div')({ |
| 1670 |
name: "HubspotWrapper0", |
| 1671 |
"class": "h1q5v5ee", |
| 1672 |
propsAsIs: false, |
| 1673 |
vars: { |
| 1674 |
"h1q5v5ee-0": [_exp()], |
| 1675 |
"h1q5v5ee-1": [_exp2()] |
| 1676 |
} |
| 1677 |
})); |
| 1678 |
|
| 1679 |
__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"); |
| 1680 |
|
| 1681 |
/***/ }), |
| 1682 |
|
| 1683 |
/***/ "./scripts/shared/Common/LoadingBlock.tsx": |
| 1684 |
/*!************************************************!*\ |
| 1685 |
!*** ./scripts/shared/Common/LoadingBlock.tsx ***! |
| 1686 |
\************************************************/ |
| 1687 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1688 |
|
| 1689 |
"use strict"; |
| 1690 |
__webpack_require__.r(__webpack_exports__); |
| 1691 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1692 |
/* harmony export */ "default": () => (/* binding */ LoadingBlock) |
| 1693 |
/* harmony export */ }); |
| 1694 |
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); |
| 1695 |
/* harmony import */ var _HubspotWrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./HubspotWrapper */ "./scripts/shared/Common/HubspotWrapper.ts"); |
| 1696 |
/* harmony import */ var _UIComponents_UISpinner__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UISpinner */ "./scripts/shared/UIComponents/UISpinner.tsx"); |
| 1697 |
/* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts"); |
| 1698 |
|
| 1699 |
|
| 1700 |
|
| 1701 |
|
| 1702 |
function LoadingBlock() { |
| 1703 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_HubspotWrapper__WEBPACK_IMPORTED_MODULE_1__["default"], { |
| 1704 |
pluginPath: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__.pluginPath, |
| 1705 |
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UISpinner__WEBPACK_IMPORTED_MODULE_2__["default"], { |
| 1706 |
size: 50 |
| 1707 |
}) |
| 1708 |
}); |
| 1709 |
} |
| 1710 |
|
| 1711 |
/***/ }), |
| 1712 |
|
| 1713 |
/***/ "./scripts/shared/Form/FormEdit.tsx": |
| 1714 |
/*!******************************************!*\ |
| 1715 |
!*** ./scripts/shared/Form/FormEdit.tsx ***! |
| 1716 |
\******************************************/ |
| 1717 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1718 |
|
| 1719 |
"use strict"; |
| 1720 |
__webpack_require__.r(__webpack_exports__); |
| 1721 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1722 |
/* harmony export */ "default": () => (/* binding */ FormEditContainer) |
| 1723 |
/* harmony export */ }); |
| 1724 |
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); |
| 1725 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react"); |
| 1726 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); |
| 1727 |
/* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts"); |
| 1728 |
/* harmony import */ var _UIComponents_UISpacer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../UIComponents/UISpacer */ "./scripts/shared/UIComponents/UISpacer.ts"); |
| 1729 |
/* harmony import */ var _PreviewForm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./PreviewForm */ "./scripts/shared/Form/PreviewForm.tsx"); |
| 1730 |
/* harmony import */ var _FormSelect__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./FormSelect */ "./scripts/shared/Form/FormSelect.tsx"); |
| 1731 |
/* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts"); |
| 1732 |
/* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts"); |
| 1733 |
/* harmony import */ var _Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../Common/LoadingBlock */ "./scripts/shared/Common/LoadingBlock.tsx"); |
| 1734 |
/* harmony import */ var _utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../utils/backgroundAppUtils */ "./scripts/utils/backgroundAppUtils.ts"); |
| 1735 |
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; } |
| 1736 |
|
| 1737 |
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; } |
| 1738 |
|
| 1739 |
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; } |
| 1740 |
|
| 1741 |
|
| 1742 |
|
| 1743 |
|
| 1744 |
|
| 1745 |
|
| 1746 |
|
| 1747 |
|
| 1748 |
|
| 1749 |
|
| 1750 |
|
| 1751 |
|
| 1752 |
function FormEdit(_ref) { |
| 1753 |
var attributes = _ref.attributes, |
| 1754 |
isSelected = _ref.isSelected, |
| 1755 |
setAttributes = _ref.setAttributes, |
| 1756 |
_ref$preview = _ref.preview, |
| 1757 |
preview = _ref$preview === void 0 ? true : _ref$preview, |
| 1758 |
_ref$origin = _ref.origin, |
| 1759 |
origin = _ref$origin === void 0 ? 'gutenberg' : _ref$origin; |
| 1760 |
var formId = attributes.formId, |
| 1761 |
formName = attributes.formName; |
| 1762 |
var formSelected = _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId && formId; |
| 1763 |
var isBackgroundAppReady = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__.useBackgroundAppContext)(); |
| 1764 |
var monitorFormPreviewRender = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__.usePostBackgroundMessage)(); |
| 1765 |
|
| 1766 |
var handleChange = function handleChange(selectedForm) { |
| 1767 |
setAttributes({ |
| 1768 |
portalId: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId, |
| 1769 |
formId: selectedForm.value, |
| 1770 |
formName: selectedForm.label |
| 1771 |
}); |
| 1772 |
}; |
| 1773 |
|
| 1774 |
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () { |
| 1775 |
monitorFormPreviewRender({ |
| 1776 |
key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_7__.ProxyMessages.TrackFormPreviewRender, |
| 1777 |
payload: { |
| 1778 |
origin: origin |
| 1779 |
} |
| 1780 |
}); |
| 1781 |
}, [origin]); |
| 1782 |
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, { |
| 1783 |
children: [(isSelected || !formSelected) && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_FormSelect__WEBPACK_IMPORTED_MODULE_5__["default"], { |
| 1784 |
formId: formId, |
| 1785 |
formName: formName, |
| 1786 |
handleChange: handleChange, |
| 1787 |
origin: origin |
| 1788 |
}), formSelected && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, { |
| 1789 |
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"], { |
| 1790 |
portalId: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.portalId, |
| 1791 |
formId: formId |
| 1792 |
})] |
| 1793 |
})] |
| 1794 |
}); |
| 1795 |
} |
| 1796 |
|
| 1797 |
function FormEditContainer(props) { |
| 1798 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__.BackgroudAppContext.Provider, { |
| 1799 |
value: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.refreshToken && (0,_utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_9__.getOrCreateBackgroundApp)(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.refreshToken), |
| 1800 |
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(FormEdit, _objectSpread({}, props)) |
| 1801 |
}); |
| 1802 |
} |
| 1803 |
|
| 1804 |
/***/ }), |
| 1805 |
|
| 1806 |
/***/ "./scripts/shared/Form/FormSelect.tsx": |
| 1807 |
/*!********************************************!*\ |
| 1808 |
!*** ./scripts/shared/Form/FormSelect.tsx ***! |
| 1809 |
\********************************************/ |
| 1810 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1811 |
|
| 1812 |
"use strict"; |
| 1813 |
__webpack_require__.r(__webpack_exports__); |
| 1814 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1815 |
/* harmony export */ "default": () => (/* binding */ FormSelect) |
| 1816 |
/* harmony export */ }); |
| 1817 |
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); |
| 1818 |
/* harmony import */ var _FormSelector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./FormSelector */ "./scripts/shared/Form/FormSelector.tsx"); |
| 1819 |
/* harmony import */ var _Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/LoadingBlock */ "./scripts/shared/Common/LoadingBlock.tsx"); |
| 1820 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 1821 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); |
| 1822 |
/* harmony import */ var _hooks_useForms__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./hooks/useForms */ "./scripts/shared/Form/hooks/useForms.ts"); |
| 1823 |
/* harmony import */ var _hooks_useCreateFormFromTemplate__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./hooks/useCreateFormFromTemplate */ "./scripts/shared/Form/hooks/useCreateFormFromTemplate.ts"); |
| 1824 |
/* harmony import */ var _constants_defaultFormOptions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../constants/defaultFormOptions */ "./scripts/constants/defaultFormOptions.ts"); |
| 1825 |
/* harmony import */ var _Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Common/ErrorHandler */ "./scripts/shared/Common/ErrorHandler.tsx"); |
| 1826 |
|
| 1827 |
|
| 1828 |
|
| 1829 |
|
| 1830 |
|
| 1831 |
|
| 1832 |
|
| 1833 |
|
| 1834 |
function FormSelect(_ref) { |
| 1835 |
var formId = _ref.formId, |
| 1836 |
formName = _ref.formName, |
| 1837 |
handleChange = _ref.handleChange, |
| 1838 |
_ref$origin = _ref.origin, |
| 1839 |
origin = _ref$origin === void 0 ? 'gutenberg' : _ref$origin; |
| 1840 |
|
| 1841 |
var _useForms = (0,_hooks_useForms__WEBPACK_IMPORTED_MODULE_4__["default"])(), |
| 1842 |
search = _useForms.search, |
| 1843 |
formApiError = _useForms.formApiError, |
| 1844 |
reset = _useForms.reset; |
| 1845 |
|
| 1846 |
var _useCreateFormFromTem = (0,_hooks_useCreateFormFromTemplate__WEBPACK_IMPORTED_MODULE_5__["default"])(origin), |
| 1847 |
createFormByTemplate = _useCreateFormFromTem.createFormByTemplate, |
| 1848 |
createReset = _useCreateFormFromTem.reset, |
| 1849 |
isCreating = _useCreateFormFromTem.isCreating, |
| 1850 |
hasError = _useCreateFormFromTem.hasError, |
| 1851 |
createApiError = _useCreateFormFromTem.formApiError; |
| 1852 |
|
| 1853 |
var value = formId && formName ? { |
| 1854 |
label: formName, |
| 1855 |
value: formId |
| 1856 |
} : null; |
| 1857 |
|
| 1858 |
var handleLocalChange = function handleLocalChange(option) { |
| 1859 |
if ((0,_constants_defaultFormOptions__WEBPACK_IMPORTED_MODULE_6__.isDefaultForm)(option.value)) { |
| 1860 |
createFormByTemplate(option.value).then(function (_ref2) { |
| 1861 |
var guid = _ref2.guid, |
| 1862 |
name = _ref2.name; |
| 1863 |
handleChange({ |
| 1864 |
value: guid, |
| 1865 |
label: name |
| 1866 |
}); |
| 1867 |
}); |
| 1868 |
} else { |
| 1869 |
handleChange(option); |
| 1870 |
} |
| 1871 |
}; |
| 1872 |
|
| 1873 |
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"], { |
| 1874 |
status: formApiError ? formApiError.status : createApiError.status, |
| 1875 |
resetErrorState: function resetErrorState() { |
| 1876 |
if (hasError) { |
| 1877 |
createReset(); |
| 1878 |
} else { |
| 1879 |
reset(); |
| 1880 |
} |
| 1881 |
}, |
| 1882 |
errorInfo: { |
| 1883 |
header: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('There was a problem retrieving your forms', 'leadin'), |
| 1884 |
message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Please refresh your forms or try again in a few minutes', 'leadin'), |
| 1885 |
action: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Refresh forms', 'leadin') |
| 1886 |
} |
| 1887 |
}) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_FormSelector__WEBPACK_IMPORTED_MODULE_1__["default"], { |
| 1888 |
loadOptions: search, |
| 1889 |
onChange: function onChange(option) { |
| 1890 |
return handleLocalChange(option); |
| 1891 |
}, |
| 1892 |
value: value |
| 1893 |
}); |
| 1894 |
} |
| 1895 |
|
| 1896 |
/***/ }), |
| 1897 |
|
| 1898 |
/***/ "./scripts/shared/Form/FormSelector.tsx": |
| 1899 |
/*!**********************************************!*\ |
| 1900 |
!*** ./scripts/shared/Form/FormSelector.tsx ***! |
| 1901 |
\**********************************************/ |
| 1902 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1903 |
|
| 1904 |
"use strict"; |
| 1905 |
__webpack_require__.r(__webpack_exports__); |
| 1906 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1907 |
/* harmony export */ "default": () => (/* binding */ FormSelector) |
| 1908 |
/* harmony export */ }); |
| 1909 |
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); |
| 1910 |
/* harmony import */ var _Common_HubspotWrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Common/HubspotWrapper */ "./scripts/shared/Common/HubspotWrapper.ts"); |
| 1911 |
/* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts"); |
| 1912 |
/* harmony import */ var _Common_AsyncSelect__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Common/AsyncSelect */ "./scripts/shared/Common/AsyncSelect.tsx"); |
| 1913 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 1914 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__); |
| 1915 |
|
| 1916 |
|
| 1917 |
|
| 1918 |
|
| 1919 |
|
| 1920 |
function FormSelector(_ref) { |
| 1921 |
var loadOptions = _ref.loadOptions, |
| 1922 |
onChange = _ref.onChange, |
| 1923 |
value = _ref.value; |
| 1924 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_Common_HubspotWrapper__WEBPACK_IMPORTED_MODULE_1__["default"], { |
| 1925 |
pluginPath: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.pluginPath, |
| 1926 |
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { |
| 1927 |
"data-test-id": "leadin-form-select", |
| 1928 |
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("b", { |
| 1929 |
children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Select an existing form or create a new one from a template', 'leadin') |
| 1930 |
}) |
| 1931 |
}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_AsyncSelect__WEBPACK_IMPORTED_MODULE_3__["default"], { |
| 1932 |
placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Search for a form', 'leadin'), |
| 1933 |
value: value, |
| 1934 |
loadOptions: loadOptions, |
| 1935 |
onChange: onChange |
| 1936 |
})] |
| 1937 |
}); |
| 1938 |
} |
| 1939 |
|
| 1940 |
/***/ }), |
| 1941 |
|
| 1942 |
/***/ "./scripts/shared/Form/PreviewForm.tsx": |
| 1943 |
/*!*********************************************!*\ |
| 1944 |
!*** ./scripts/shared/Form/PreviewForm.tsx ***! |
| 1945 |
\*********************************************/ |
| 1946 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1947 |
|
| 1948 |
"use strict"; |
| 1949 |
__webpack_require__.r(__webpack_exports__); |
| 1950 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1951 |
/* harmony export */ "default": () => (/* binding */ PreviewForm) |
| 1952 |
/* harmony export */ }); |
| 1953 |
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); |
| 1954 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react"); |
| 1955 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); |
| 1956 |
/* harmony import */ var _UIComponents_UIOverlay__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UIOverlay */ "./scripts/shared/UIComponents/UIOverlay.ts"); |
| 1957 |
/* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts"); |
| 1958 |
/* harmony import */ var _hooks_useFormsScript__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./hooks/useFormsScript */ "./scripts/shared/Form/hooks/useFormsScript.ts"); |
| 1959 |
|
| 1960 |
|
| 1961 |
|
| 1962 |
|
| 1963 |
|
| 1964 |
function PreviewForm(_ref) { |
| 1965 |
var portalId = _ref.portalId, |
| 1966 |
formId = _ref.formId; |
| 1967 |
var inputEl = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); |
| 1968 |
var ready = (0,_hooks_useFormsScript__WEBPACK_IMPORTED_MODULE_4__["default"])(); |
| 1969 |
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () { |
| 1970 |
if (!ready) { |
| 1971 |
return; |
| 1972 |
} |
| 1973 |
|
| 1974 |
if (inputEl.current) { |
| 1975 |
inputEl.current.innerHTML = ''; |
| 1976 |
var embedScript = document.createElement('script'); |
| 1977 |
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, " });"); |
| 1978 |
inputEl.current.appendChild(embedScript); |
| 1979 |
} |
| 1980 |
}, [formId, portalId, ready, inputEl]); |
| 1981 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIOverlay__WEBPACK_IMPORTED_MODULE_2__["default"], { |
| 1982 |
ref: inputEl |
| 1983 |
}); |
| 1984 |
} |
| 1985 |
|
| 1986 |
/***/ }), |
| 1987 |
|
| 1988 |
/***/ "./scripts/shared/Form/hooks/useCreateFormFromTemplate.ts": |
| 1989 |
/*!****************************************************************!*\ |
| 1990 |
!*** ./scripts/shared/Form/hooks/useCreateFormFromTemplate.ts ***! |
| 1991 |
\****************************************************************/ |
| 1992 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1993 |
|
| 1994 |
"use strict"; |
| 1995 |
__webpack_require__.r(__webpack_exports__); |
| 1996 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1997 |
/* harmony export */ "default": () => (/* binding */ useCreateFormFromTemplate) |
| 1998 |
/* harmony export */ }); |
| 1999 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 2000 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 2001 |
/* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts"); |
| 2002 |
/* harmony import */ var _enums_loadState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums/loadState */ "./scripts/shared/enums/loadState.ts"); |
| 2003 |
/* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts"); |
| 2004 |
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } |
| 2005 |
|
| 2006 |
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."); } |
| 2007 |
|
| 2008 |
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); } |
| 2009 |
|
| 2010 |
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; } |
| 2011 |
|
| 2012 |
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; } |
| 2013 |
|
| 2014 |
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
| 2015 |
|
| 2016 |
|
| 2017 |
|
| 2018 |
|
| 2019 |
|
| 2020 |
function useCreateFormFromTemplate() { |
| 2021 |
var origin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'gutenberg'; |
| 2022 |
var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__.usePostAsyncBackgroundMessage)(); |
| 2023 |
var track = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__.usePostBackgroundMessage)(); |
| 2024 |
|
| 2025 |
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Idle), |
| 2026 |
_useState2 = _slicedToArray(_useState, 2), |
| 2027 |
loadState = _useState2[0], |
| 2028 |
setLoadState = _useState2[1]; |
| 2029 |
|
| 2030 |
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null), |
| 2031 |
_useState4 = _slicedToArray(_useState3, 2), |
| 2032 |
formApiError = _useState4[0], |
| 2033 |
setFormApiError = _useState4[1]; |
| 2034 |
|
| 2035 |
var createFormByTemplate = function createFormByTemplate(type) { |
| 2036 |
setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loading); |
| 2037 |
track({ |
| 2038 |
key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.TrackFormCreatedFromTemplate, |
| 2039 |
payload: { |
| 2040 |
type: type, |
| 2041 |
origin: origin |
| 2042 |
} |
| 2043 |
}); |
| 2044 |
return proxy({ |
| 2045 |
key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.CreateFormFromTemplate, |
| 2046 |
payload: type |
| 2047 |
}).then(function (form) { |
| 2048 |
setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Idle); |
| 2049 |
return form; |
| 2050 |
})["catch"](function (err) { |
| 2051 |
setFormApiError(err); |
| 2052 |
track({ |
| 2053 |
key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.TrackFormCreationFailed, |
| 2054 |
payload: { |
| 2055 |
origin: origin |
| 2056 |
} |
| 2057 |
}); |
| 2058 |
setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Failed); |
| 2059 |
}); |
| 2060 |
}; |
| 2061 |
|
| 2062 |
return { |
| 2063 |
isCreating: loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loading, |
| 2064 |
hasError: loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Failed, |
| 2065 |
formApiError: formApiError, |
| 2066 |
createFormByTemplate: createFormByTemplate, |
| 2067 |
reset: function reset() { |
| 2068 |
return setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Idle); |
| 2069 |
} |
| 2070 |
}; |
| 2071 |
} |
| 2072 |
|
| 2073 |
/***/ }), |
| 2074 |
|
| 2075 |
/***/ "./scripts/shared/Form/hooks/useForms.ts": |
| 2076 |
/*!***********************************************!*\ |
| 2077 |
!*** ./scripts/shared/Form/hooks/useForms.ts ***! |
| 2078 |
\***********************************************/ |
| 2079 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2080 |
|
| 2081 |
"use strict"; |
| 2082 |
__webpack_require__.r(__webpack_exports__); |
| 2083 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2084 |
/* harmony export */ "default": () => (/* binding */ useForms) |
| 2085 |
/* harmony export */ }); |
| 2086 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 2087 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 2088 |
/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/debounce */ "./node_modules/lodash/debounce.js"); |
| 2089 |
/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_1__); |
| 2090 |
/* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts"); |
| 2091 |
/* harmony import */ var _constants_defaultFormOptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../constants/defaultFormOptions */ "./scripts/constants/defaultFormOptions.ts"); |
| 2092 |
/* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts"); |
| 2093 |
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } |
| 2094 |
|
| 2095 |
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."); } |
| 2096 |
|
| 2097 |
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } |
| 2098 |
|
| 2099 |
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } |
| 2100 |
|
| 2101 |
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } |
| 2102 |
|
| 2103 |
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."); } |
| 2104 |
|
| 2105 |
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); } |
| 2106 |
|
| 2107 |
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; } |
| 2108 |
|
| 2109 |
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; } |
| 2110 |
|
| 2111 |
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
| 2112 |
|
| 2113 |
|
| 2114 |
|
| 2115 |
|
| 2116 |
|
| 2117 |
|
| 2118 |
function useForms() { |
| 2119 |
var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_2__.usePostAsyncBackgroundMessage)(); |
| 2120 |
|
| 2121 |
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null), |
| 2122 |
_useState2 = _slicedToArray(_useState, 2), |
| 2123 |
formApiError = _useState2[0], |
| 2124 |
setFormApiError = _useState2[1]; |
| 2125 |
|
| 2126 |
var search = lodash_debounce__WEBPACK_IMPORTED_MODULE_1___default()(function (search, callback) { |
| 2127 |
return proxy({ |
| 2128 |
key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_4__.ProxyMessages.FetchForms, |
| 2129 |
payload: { |
| 2130 |
search: search |
| 2131 |
} |
| 2132 |
}).then(function (forms) { |
| 2133 |
callback([].concat(_toConsumableArray(forms.map(function (form) { |
| 2134 |
return { |
| 2135 |
label: form.name, |
| 2136 |
value: form.guid |
| 2137 |
}; |
| 2138 |
})), [_constants_defaultFormOptions__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_OPTIONS])); |
| 2139 |
})["catch"](function (error) { |
| 2140 |
setFormApiError(error); |
| 2141 |
}); |
| 2142 |
}, 300, { |
| 2143 |
trailing: true |
| 2144 |
}); |
| 2145 |
return { |
| 2146 |
search: search, |
| 2147 |
formApiError: formApiError, |
| 2148 |
reset: function reset() { |
| 2149 |
return setFormApiError(null); |
| 2150 |
} |
| 2151 |
}; |
| 2152 |
} |
| 2153 |
|
| 2154 |
/***/ }), |
| 2155 |
|
| 2156 |
/***/ "./scripts/shared/Form/hooks/useFormsScript.ts": |
| 2157 |
/*!*****************************************************!*\ |
| 2158 |
!*** ./scripts/shared/Form/hooks/useFormsScript.ts ***! |
| 2159 |
\*****************************************************/ |
| 2160 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2161 |
|
| 2162 |
"use strict"; |
| 2163 |
__webpack_require__.r(__webpack_exports__); |
| 2164 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2165 |
/* harmony export */ "default": () => (/* binding */ useFormScript) |
| 2166 |
/* harmony export */ }); |
| 2167 |
/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); |
| 2168 |
/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); |
| 2169 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react"); |
| 2170 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); |
| 2171 |
/* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts"); |
| 2172 |
/* harmony import */ var _lib_Raven__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../lib/Raven */ "./scripts/lib/Raven.ts"); |
| 2173 |
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } |
| 2174 |
|
| 2175 |
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."); } |
| 2176 |
|
| 2177 |
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); } |
| 2178 |
|
| 2179 |
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; } |
| 2180 |
|
| 2181 |
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; } |
| 2182 |
|
| 2183 |
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
| 2184 |
|
| 2185 |
|
| 2186 |
|
| 2187 |
|
| 2188 |
|
| 2189 |
var promise; |
| 2190 |
|
| 2191 |
function loadFormsScript() { |
| 2192 |
if (!promise) { |
| 2193 |
promise = new Promise(function (resolve, reject) { |
| 2194 |
return jquery__WEBPACK_IMPORTED_MODULE_0___default().getScript(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.formsScript).done(resolve).fail(reject); |
| 2195 |
}); |
| 2196 |
} |
| 2197 |
|
| 2198 |
return promise; |
| 2199 |
} |
| 2200 |
|
| 2201 |
function useFormScript() { |
| 2202 |
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false), |
| 2203 |
_useState2 = _slicedToArray(_useState, 2), |
| 2204 |
ready = _useState2[0], |
| 2205 |
setReady = _useState2[1]; |
| 2206 |
|
| 2207 |
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () { |
| 2208 |
loadFormsScript().then(function () { |
| 2209 |
return setReady(true); |
| 2210 |
})["catch"](function (error) { |
| 2211 |
return _lib_Raven__WEBPACK_IMPORTED_MODULE_3__["default"].captureException(error); |
| 2212 |
}); |
| 2213 |
}, []); |
| 2214 |
return ready; |
| 2215 |
} |
| 2216 |
|
| 2217 |
/***/ }), |
| 2218 |
|
| 2219 |
/***/ "./scripts/shared/Meeting/MeetingController.tsx": |
| 2220 |
/*!******************************************************!*\ |
| 2221 |
!*** ./scripts/shared/Meeting/MeetingController.tsx ***! |
| 2222 |
\******************************************************/ |
| 2223 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2224 |
|
| 2225 |
"use strict"; |
| 2226 |
__webpack_require__.r(__webpack_exports__); |
| 2227 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2228 |
/* harmony export */ "default": () => (/* binding */ MeetingController) |
| 2229 |
/* harmony export */ }); |
| 2230 |
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); |
| 2231 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react"); |
| 2232 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); |
| 2233 |
/* harmony import */ var _Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/LoadingBlock */ "./scripts/shared/Common/LoadingBlock.tsx"); |
| 2234 |
/* harmony import */ var _MeetingSelector__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./MeetingSelector */ "./scripts/shared/Meeting/MeetingSelector.tsx"); |
| 2235 |
/* harmony import */ var _MeetingWarning__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./MeetingWarning */ "./scripts/shared/Meeting/MeetingWarning.tsx"); |
| 2236 |
/* harmony import */ var _hooks_useMeetings__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./hooks/useMeetings */ "./scripts/shared/Meeting/hooks/useMeetings.ts"); |
| 2237 |
/* harmony import */ var _Common_HubspotWrapper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Common/HubspotWrapper */ "./scripts/shared/Common/HubspotWrapper.ts"); |
| 2238 |
/* harmony import */ var _Common_ErrorHandler__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Common/ErrorHandler */ "./scripts/shared/Common/ErrorHandler.tsx"); |
| 2239 |
/* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts"); |
| 2240 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 2241 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__); |
| 2242 |
/* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! raven-js */ "./node_modules/raven-js/src/singleton.js"); |
| 2243 |
/* harmony import */ var raven_js__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(raven_js__WEBPACK_IMPORTED_MODULE_10__); |
| 2244 |
|
| 2245 |
|
| 2246 |
|
| 2247 |
|
| 2248 |
|
| 2249 |
|
| 2250 |
|
| 2251 |
|
| 2252 |
|
| 2253 |
|
| 2254 |
|
| 2255 |
function MeetingController(_ref) { |
| 2256 |
var handleChange = _ref.handleChange, |
| 2257 |
url = _ref.url; |
| 2258 |
|
| 2259 |
var _useMeetings = (0,_hooks_useMeetings__WEBPACK_IMPORTED_MODULE_5__["default"])(), |
| 2260 |
meetings = _useMeetings.mappedMeetings, |
| 2261 |
loading = _useMeetings.loading, |
| 2262 |
error = _useMeetings.error, |
| 2263 |
reload = _useMeetings.reload, |
| 2264 |
connectCalendar = _useMeetings.connectCalendar; |
| 2265 |
|
| 2266 |
var selectedMeetingOption = (0,_hooks_useMeetings__WEBPACK_IMPORTED_MODULE_5__.useSelectedMeeting)(url); |
| 2267 |
var selectedMeetingCalendar = (0,_hooks_useMeetings__WEBPACK_IMPORTED_MODULE_5__.useSelectedMeetingCalendar)(url); |
| 2268 |
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () { |
| 2269 |
if (!url && meetings.length > 0) { |
| 2270 |
handleChange(meetings[0].value); |
| 2271 |
} |
| 2272 |
}, [meetings, url, handleChange]); |
| 2273 |
|
| 2274 |
var handleLocalChange = function handleLocalChange(option) { |
| 2275 |
handleChange(option.value); |
| 2276 |
}; |
| 2277 |
|
| 2278 |
var handleConnectCalendar = function handleConnectCalendar() { |
| 2279 |
return connectCalendar().then(function () { |
| 2280 |
reload(); |
| 2281 |
})["catch"](function (error) { |
| 2282 |
raven_js__WEBPACK_IMPORTED_MODULE_10___default().captureMessage('Unable to connect calendar', { |
| 2283 |
extra: { |
| 2284 |
error: error |
| 2285 |
} |
| 2286 |
}); |
| 2287 |
}); |
| 2288 |
}; |
| 2289 |
|
| 2290 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, { |
| 2291 |
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"], { |
| 2292 |
status: error && error.status || error, |
| 2293 |
resetErrorState: function resetErrorState() { |
| 2294 |
return reload(); |
| 2295 |
}, |
| 2296 |
errorInfo: { |
| 2297 |
header: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)('There was a problem retrieving your meetings', 'leadin'), |
| 2298 |
message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)('Please refresh your meetings or try again in a few minutes', 'leadin'), |
| 2299 |
action: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__.__)('Refresh meetings', 'leadin') |
| 2300 |
} |
| 2301 |
}) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_Common_HubspotWrapper__WEBPACK_IMPORTED_MODULE_6__["default"], { |
| 2302 |
padding: "90px 32px 24px", |
| 2303 |
pluginPath: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_8__.pluginPath, |
| 2304 |
children: [selectedMeetingCalendar && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_MeetingWarning__WEBPACK_IMPORTED_MODULE_4__["default"], { |
| 2305 |
status: selectedMeetingCalendar, |
| 2306 |
onConnectCalendar: handleConnectCalendar |
| 2307 |
}), meetings.length > 1 && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_MeetingSelector__WEBPACK_IMPORTED_MODULE_3__["default"], { |
| 2308 |
onChange: handleLocalChange, |
| 2309 |
options: meetings, |
| 2310 |
value: selectedMeetingOption |
| 2311 |
})] |
| 2312 |
}) |
| 2313 |
}); |
| 2314 |
} |
| 2315 |
|
| 2316 |
/***/ }), |
| 2317 |
|
| 2318 |
/***/ "./scripts/shared/Meeting/MeetingEdit.tsx": |
| 2319 |
/*!************************************************!*\ |
| 2320 |
!*** ./scripts/shared/Meeting/MeetingEdit.tsx ***! |
| 2321 |
\************************************************/ |
| 2322 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2323 |
|
| 2324 |
"use strict"; |
| 2325 |
__webpack_require__.r(__webpack_exports__); |
| 2326 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2327 |
/* harmony export */ "default": () => (/* binding */ MeetingsEditContainer) |
| 2328 |
/* harmony export */ }); |
| 2329 |
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); |
| 2330 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react"); |
| 2331 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); |
| 2332 |
/* harmony import */ var _MeetingController__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./MeetingController */ "./scripts/shared/Meeting/MeetingController.tsx"); |
| 2333 |
/* harmony import */ var _PreviewMeeting__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PreviewMeeting */ "./scripts/shared/Meeting/PreviewMeeting.tsx"); |
| 2334 |
/* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts"); |
| 2335 |
/* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts"); |
| 2336 |
/* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts"); |
| 2337 |
/* harmony import */ var _Common_LoadingBlock__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Common/LoadingBlock */ "./scripts/shared/Common/LoadingBlock.tsx"); |
| 2338 |
/* harmony import */ var _utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils/backgroundAppUtils */ "./scripts/utils/backgroundAppUtils.ts"); |
| 2339 |
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; } |
| 2340 |
|
| 2341 |
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; } |
| 2342 |
|
| 2343 |
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; } |
| 2344 |
|
| 2345 |
|
| 2346 |
|
| 2347 |
|
| 2348 |
|
| 2349 |
|
| 2350 |
|
| 2351 |
|
| 2352 |
|
| 2353 |
|
| 2354 |
|
| 2355 |
function MeetingEdit(_ref) { |
| 2356 |
var url = _ref.attributes.url, |
| 2357 |
isSelected = _ref.isSelected, |
| 2358 |
setAttributes = _ref.setAttributes, |
| 2359 |
_ref$preview = _ref.preview, |
| 2360 |
preview = _ref$preview === void 0 ? true : _ref$preview, |
| 2361 |
_ref$origin = _ref.origin, |
| 2362 |
origin = _ref$origin === void 0 ? 'gutenberg' : _ref$origin; |
| 2363 |
var isBackgroundAppReady = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_4__.useBackgroundAppContext)(); |
| 2364 |
var monitorFormPreviewRender = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_4__.usePostBackgroundMessage)(); |
| 2365 |
|
| 2366 |
var handleChange = function handleChange(newUrl) { |
| 2367 |
setAttributes({ |
| 2368 |
url: newUrl |
| 2369 |
}); |
| 2370 |
}; |
| 2371 |
|
| 2372 |
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () { |
| 2373 |
monitorFormPreviewRender({ |
| 2374 |
key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_6__.ProxyMessages.TrackMeetingPreviewRender, |
| 2375 |
payload: { |
| 2376 |
origin: origin |
| 2377 |
} |
| 2378 |
}); |
| 2379 |
}, [origin]); |
| 2380 |
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, { |
| 2381 |
children: [(isSelected || !url) && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_MeetingController__WEBPACK_IMPORTED_MODULE_2__["default"], { |
| 2382 |
url: url, |
| 2383 |
handleChange: handleChange |
| 2384 |
}), preview && url && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_PreviewMeeting__WEBPACK_IMPORTED_MODULE_3__["default"], { |
| 2385 |
url: url |
| 2386 |
})] |
| 2387 |
}); |
| 2388 |
} |
| 2389 |
|
| 2390 |
function MeetingsEditContainer(props) { |
| 2391 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_4__.BackgroudAppContext.Provider, { |
| 2392 |
value: _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_5__.refreshToken && (0,_utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_8__.getOrCreateBackgroundApp)(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_5__.refreshToken), |
| 2393 |
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MeetingEdit, _objectSpread({}, props)) |
| 2394 |
}); |
| 2395 |
} |
| 2396 |
|
| 2397 |
/***/ }), |
| 2398 |
|
| 2399 |
/***/ "./scripts/shared/Meeting/MeetingSelector.tsx": |
| 2400 |
/*!****************************************************!*\ |
| 2401 |
!*** ./scripts/shared/Meeting/MeetingSelector.tsx ***! |
| 2402 |
\****************************************************/ |
| 2403 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2404 |
|
| 2405 |
"use strict"; |
| 2406 |
__webpack_require__.r(__webpack_exports__); |
| 2407 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2408 |
/* harmony export */ "default": () => (/* binding */ MeetingSelector) |
| 2409 |
/* harmony export */ }); |
| 2410 |
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); |
| 2411 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react"); |
| 2412 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); |
| 2413 |
/* harmony import */ var _Common_AsyncSelect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Common/AsyncSelect */ "./scripts/shared/Common/AsyncSelect.tsx"); |
| 2414 |
/* harmony import */ var _UIComponents_UISpacer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../UIComponents/UISpacer */ "./scripts/shared/UIComponents/UISpacer.ts"); |
| 2415 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 2416 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__); |
| 2417 |
|
| 2418 |
|
| 2419 |
|
| 2420 |
|
| 2421 |
|
| 2422 |
function MeetingSelector(_ref) { |
| 2423 |
var options = _ref.options, |
| 2424 |
onChange = _ref.onChange, |
| 2425 |
value = _ref.value; |
| 2426 |
var optionsWrapper = [{ |
| 2427 |
label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Meeting name', 'leadin'), |
| 2428 |
options: options |
| 2429 |
}]; |
| 2430 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, { |
| 2431 |
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", { |
| 2432 |
"data-test-id": "leadin-meeting-select", |
| 2433 |
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("b", { |
| 2434 |
children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Select a meeting scheduling page', 'leadin') |
| 2435 |
}) |
| 2436 |
}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_Common_AsyncSelect__WEBPACK_IMPORTED_MODULE_2__["default"], { |
| 2437 |
defaultOptions: optionsWrapper, |
| 2438 |
onChange: onChange, |
| 2439 |
placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Select a meeting', 'leadin'), |
| 2440 |
value: value |
| 2441 |
})] |
| 2442 |
}); |
| 2443 |
} |
| 2444 |
|
| 2445 |
/***/ }), |
| 2446 |
|
| 2447 |
/***/ "./scripts/shared/Meeting/MeetingWarning.tsx": |
| 2448 |
/*!***************************************************!*\ |
| 2449 |
!*** ./scripts/shared/Meeting/MeetingWarning.tsx ***! |
| 2450 |
\***************************************************/ |
| 2451 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2452 |
|
| 2453 |
"use strict"; |
| 2454 |
__webpack_require__.r(__webpack_exports__); |
| 2455 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2456 |
/* harmony export */ "default": () => (/* binding */ MeetingWarning) |
| 2457 |
/* harmony export */ }); |
| 2458 |
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); |
| 2459 |
/* harmony import */ var _UIComponents_UIAlert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../UIComponents/UIAlert */ "./scripts/shared/UIComponents/UIAlert.tsx"); |
| 2460 |
/* harmony import */ var _UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UIButton */ "./scripts/shared/UIComponents/UIButton.ts"); |
| 2461 |
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ "./scripts/shared/Meeting/constants.ts"); |
| 2462 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 2463 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__); |
| 2464 |
|
| 2465 |
|
| 2466 |
|
| 2467 |
|
| 2468 |
|
| 2469 |
function MeetingWarning(_ref) { |
| 2470 |
var status = _ref.status, |
| 2471 |
onConnectCalendar = _ref.onConnectCalendar; |
| 2472 |
var isMeetingOwner = status === _constants__WEBPACK_IMPORTED_MODULE_3__.CURRENT_USER_CALENDAR_MISSING; |
| 2473 |
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'); |
| 2474 |
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'); |
| 2475 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIAlert__WEBPACK_IMPORTED_MODULE_1__["default"], { |
| 2476 |
titleText: titleText, |
| 2477 |
titleMessage: titleMessage, |
| 2478 |
children: isMeetingOwner && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIButton__WEBPACK_IMPORTED_MODULE_2__["default"], { |
| 2479 |
use: "tertiary", |
| 2480 |
id: "meetings-connect-calendar", |
| 2481 |
onClick: onConnectCalendar, |
| 2482 |
children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Connect calendar', 'leadin') |
| 2483 |
}) |
| 2484 |
}); |
| 2485 |
} |
| 2486 |
|
| 2487 |
/***/ }), |
| 2488 |
|
| 2489 |
/***/ "./scripts/shared/Meeting/PreviewMeeting.tsx": |
| 2490 |
/*!***************************************************!*\ |
| 2491 |
!*** ./scripts/shared/Meeting/PreviewMeeting.tsx ***! |
| 2492 |
\***************************************************/ |
| 2493 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2494 |
|
| 2495 |
"use strict"; |
| 2496 |
__webpack_require__.r(__webpack_exports__); |
| 2497 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2498 |
/* harmony export */ "default": () => (/* binding */ PreviewForm) |
| 2499 |
/* harmony export */ }); |
| 2500 |
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); |
| 2501 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react"); |
| 2502 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); |
| 2503 |
/* harmony import */ var _UIComponents_UIOverlay__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../UIComponents/UIOverlay */ "./scripts/shared/UIComponents/UIOverlay.ts"); |
| 2504 |
/* harmony import */ var _hooks_useMeetingsScript__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./hooks/useMeetingsScript */ "./scripts/shared/Meeting/hooks/useMeetingsScript.ts"); |
| 2505 |
|
| 2506 |
|
| 2507 |
|
| 2508 |
|
| 2509 |
function PreviewForm(_ref) { |
| 2510 |
var url = _ref.url; |
| 2511 |
var ready = (0,_hooks_useMeetingsScript__WEBPACK_IMPORTED_MODULE_3__["default"])(); |
| 2512 |
var inputEl = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); |
| 2513 |
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () { |
| 2514 |
if (!ready) { |
| 2515 |
return; |
| 2516 |
} |
| 2517 |
|
| 2518 |
if (inputEl.current) { |
| 2519 |
inputEl.current.innerHTML = ''; |
| 2520 |
var container = document.createElement('div'); |
| 2521 |
container.dataset.src = "".concat(url, "?embed=true"); |
| 2522 |
container.classList.add('meetings-iframe-container'); |
| 2523 |
inputEl.current.appendChild(container); |
| 2524 |
var embedScript = document.createElement('script'); |
| 2525 |
embedScript.innerHTML = 'hbspt.meetings.create(".meetings-iframe-container");'; |
| 2526 |
inputEl.current.appendChild(embedScript); |
| 2527 |
} |
| 2528 |
}, [url, ready, inputEl]); |
| 2529 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, { |
| 2530 |
children: url && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_UIComponents_UIOverlay__WEBPACK_IMPORTED_MODULE_2__["default"], { |
| 2531 |
ref: inputEl |
| 2532 |
}) |
| 2533 |
}); |
| 2534 |
} |
| 2535 |
|
| 2536 |
/***/ }), |
| 2537 |
|
| 2538 |
/***/ "./scripts/shared/Meeting/constants.ts": |
| 2539 |
/*!*********************************************!*\ |
| 2540 |
!*** ./scripts/shared/Meeting/constants.ts ***! |
| 2541 |
\*********************************************/ |
| 2542 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2543 |
|
| 2544 |
"use strict"; |
| 2545 |
__webpack_require__.r(__webpack_exports__); |
| 2546 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2547 |
/* harmony export */ "CURRENT_USER_CALENDAR_MISSING": () => (/* binding */ CURRENT_USER_CALENDAR_MISSING), |
| 2548 |
/* harmony export */ "OTHER_USER_CALENDAR_MISSING": () => (/* binding */ OTHER_USER_CALENDAR_MISSING) |
| 2549 |
/* harmony export */ }); |
| 2550 |
var OTHER_USER_CALENDAR_MISSING = 'OTHER_USER_CALENDAR_MISSING'; |
| 2551 |
var CURRENT_USER_CALENDAR_MISSING = 'CURRENT_USER_CALENDAR_MISSING'; |
| 2552 |
|
| 2553 |
/***/ }), |
| 2554 |
|
| 2555 |
/***/ "./scripts/shared/Meeting/hooks/useCurrentUserFetch.ts": |
| 2556 |
/*!*************************************************************!*\ |
| 2557 |
!*** ./scripts/shared/Meeting/hooks/useCurrentUserFetch.ts ***! |
| 2558 |
\*************************************************************/ |
| 2559 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2560 |
|
| 2561 |
"use strict"; |
| 2562 |
__webpack_require__.r(__webpack_exports__); |
| 2563 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2564 |
/* harmony export */ "default": () => (/* binding */ useCurrentUserFetch) |
| 2565 |
/* harmony export */ }); |
| 2566 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 2567 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 2568 |
/* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts"); |
| 2569 |
/* harmony import */ var _enums_loadState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums/loadState */ "./scripts/shared/enums/loadState.ts"); |
| 2570 |
/* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts"); |
| 2571 |
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } |
| 2572 |
|
| 2573 |
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."); } |
| 2574 |
|
| 2575 |
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); } |
| 2576 |
|
| 2577 |
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; } |
| 2578 |
|
| 2579 |
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; } |
| 2580 |
|
| 2581 |
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
| 2582 |
|
| 2583 |
|
| 2584 |
|
| 2585 |
|
| 2586 |
|
| 2587 |
var user = null; |
| 2588 |
function useCurrentUserFetch() { |
| 2589 |
var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__.usePostAsyncBackgroundMessage)(); |
| 2590 |
|
| 2591 |
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded), |
| 2592 |
_useState2 = _slicedToArray(_useState, 2), |
| 2593 |
loadState = _useState2[0], |
| 2594 |
setLoadState = _useState2[1]; |
| 2595 |
|
| 2596 |
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null), |
| 2597 |
_useState4 = _slicedToArray(_useState3, 2), |
| 2598 |
error = _useState4[0], |
| 2599 |
setError = _useState4[1]; |
| 2600 |
|
| 2601 |
var createUser = function createUser() { |
| 2602 |
if (!user) { |
| 2603 |
setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded); |
| 2604 |
} |
| 2605 |
}; |
| 2606 |
|
| 2607 |
var reload = function reload() { |
| 2608 |
user = null; |
| 2609 |
setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded); |
| 2610 |
setError(null); |
| 2611 |
}; |
| 2612 |
|
| 2613 |
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { |
| 2614 |
if (loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded && !user) { |
| 2615 |
setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loading); |
| 2616 |
proxy({ |
| 2617 |
key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.FetchOrCreateMeetingUser |
| 2618 |
}).then(function (data) { |
| 2619 |
user = data; |
| 2620 |
setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Idle); |
| 2621 |
})["catch"](function (err) { |
| 2622 |
setError(err); |
| 2623 |
setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Failed); |
| 2624 |
}); |
| 2625 |
} |
| 2626 |
}, [loadState]); |
| 2627 |
return { |
| 2628 |
user: user, |
| 2629 |
loadUserState: loadState, |
| 2630 |
error: error, |
| 2631 |
createUser: createUser, |
| 2632 |
reload: reload |
| 2633 |
}; |
| 2634 |
} |
| 2635 |
|
| 2636 |
/***/ }), |
| 2637 |
|
| 2638 |
/***/ "./scripts/shared/Meeting/hooks/useMeetings.ts": |
| 2639 |
/*!*****************************************************!*\ |
| 2640 |
!*** ./scripts/shared/Meeting/hooks/useMeetings.ts ***! |
| 2641 |
\*****************************************************/ |
| 2642 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2643 |
|
| 2644 |
"use strict"; |
| 2645 |
__webpack_require__.r(__webpack_exports__); |
| 2646 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2647 |
/* harmony export */ "default": () => (/* binding */ useMeetings), |
| 2648 |
/* harmony export */ "useSelectedMeeting": () => (/* binding */ useSelectedMeeting), |
| 2649 |
/* harmony export */ "useSelectedMeetingCalendar": () => (/* binding */ useSelectedMeetingCalendar) |
| 2650 |
/* harmony export */ }); |
| 2651 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 2652 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 2653 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 2654 |
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); |
| 2655 |
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants */ "./scripts/shared/Meeting/constants.ts"); |
| 2656 |
/* harmony import */ var _useMeetingsFetch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./useMeetingsFetch */ "./scripts/shared/Meeting/hooks/useMeetingsFetch.ts"); |
| 2657 |
/* harmony import */ var _useCurrentUserFetch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./useCurrentUserFetch */ "./scripts/shared/Meeting/hooks/useCurrentUserFetch.ts"); |
| 2658 |
/* harmony import */ var _enums_loadState__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../enums/loadState */ "./scripts/shared/enums/loadState.ts"); |
| 2659 |
/* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts"); |
| 2660 |
/* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts"); |
| 2661 |
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; } |
| 2662 |
|
| 2663 |
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; } |
| 2664 |
|
| 2665 |
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; } |
| 2666 |
|
| 2667 |
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } |
| 2668 |
|
| 2669 |
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."); } |
| 2670 |
|
| 2671 |
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); } |
| 2672 |
|
| 2673 |
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; } |
| 2674 |
|
| 2675 |
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; } |
| 2676 |
|
| 2677 |
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
| 2678 |
|
| 2679 |
|
| 2680 |
|
| 2681 |
|
| 2682 |
|
| 2683 |
|
| 2684 |
|
| 2685 |
|
| 2686 |
|
| 2687 |
|
| 2688 |
function getDefaultMeetingName(meeting, currentUser, meetingUsers) { |
| 2689 |
var _meeting$meetingsUser = _slicedToArray(meeting.meetingsUserIds, 1), |
| 2690 |
meetingOwnerId = _meeting$meetingsUser[0]; |
| 2691 |
|
| 2692 |
var result = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Default', 'leadin'); |
| 2693 |
|
| 2694 |
if (currentUser && meetingOwnerId !== currentUser.id && meetingUsers[meetingOwnerId]) { |
| 2695 |
var user = meetingUsers[meetingOwnerId]; |
| 2696 |
result += " (".concat(user.userProfile.fullName, ")"); |
| 2697 |
} |
| 2698 |
|
| 2699 |
return result; |
| 2700 |
} |
| 2701 |
|
| 2702 |
function hasCalendarObject(user) { |
| 2703 |
return user && user.meetingsUserBlob && user.meetingsUserBlob.calendarSettings && user.meetingsUserBlob.calendarSettings.email; |
| 2704 |
} |
| 2705 |
|
| 2706 |
function useMeetings() { |
| 2707 |
var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_6__.usePostAsyncBackgroundMessage)(); |
| 2708 |
|
| 2709 |
var _useMeetingsFetch = (0,_useMeetingsFetch__WEBPACK_IMPORTED_MODULE_3__["default"])(), |
| 2710 |
meetings = _useMeetingsFetch.meetings, |
| 2711 |
meetingUsers = _useMeetingsFetch.meetingUsers, |
| 2712 |
meetingsError = _useMeetingsFetch.error, |
| 2713 |
loadMeetingsState = _useMeetingsFetch.loadMeetingsState, |
| 2714 |
reloadMeetings = _useMeetingsFetch.reload; |
| 2715 |
|
| 2716 |
var _useCurrentUserFetch = (0,_useCurrentUserFetch__WEBPACK_IMPORTED_MODULE_4__["default"])(), |
| 2717 |
currentUser = _useCurrentUserFetch.user, |
| 2718 |
userError = _useCurrentUserFetch.error, |
| 2719 |
loadUserState = _useCurrentUserFetch.loadUserState, |
| 2720 |
reloadUser = _useCurrentUserFetch.reload; |
| 2721 |
|
| 2722 |
var reload = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () { |
| 2723 |
reloadUser(); |
| 2724 |
reloadMeetings(); |
| 2725 |
}, [reloadUser, reloadMeetings]); |
| 2726 |
|
| 2727 |
var connectCalendar = function connectCalendar() { |
| 2728 |
return proxy({ |
| 2729 |
key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_7__.ProxyMessages.ConnectMeetingsCalendar |
| 2730 |
}); |
| 2731 |
}; |
| 2732 |
|
| 2733 |
return { |
| 2734 |
mappedMeetings: meetings.map(function (meet) { |
| 2735 |
return { |
| 2736 |
label: meet.name || getDefaultMeetingName(meet, currentUser, meetingUsers), |
| 2737 |
value: meet.link |
| 2738 |
}; |
| 2739 |
}), |
| 2740 |
meetings: meetings, |
| 2741 |
meetingUsers: meetingUsers, |
| 2742 |
currentUser: currentUser, |
| 2743 |
error: meetingsError || userError, |
| 2744 |
loading: loadMeetingsState == _enums_loadState__WEBPACK_IMPORTED_MODULE_5__["default"].Loading || loadUserState === _enums_loadState__WEBPACK_IMPORTED_MODULE_5__["default"].Loading, |
| 2745 |
reload: reload, |
| 2746 |
connectCalendar: connectCalendar |
| 2747 |
}; |
| 2748 |
} |
| 2749 |
function useSelectedMeeting(url) { |
| 2750 |
var _useMeetings = useMeetings(), |
| 2751 |
meetings = _useMeetings.mappedMeetings; |
| 2752 |
|
| 2753 |
var option = meetings.find(function (_ref) { |
| 2754 |
var value = _ref.value; |
| 2755 |
return value === url; |
| 2756 |
}); |
| 2757 |
return option; |
| 2758 |
} |
| 2759 |
function useSelectedMeetingCalendar(url) { |
| 2760 |
var _useMeetings2 = useMeetings(), |
| 2761 |
meetings = _useMeetings2.meetings, |
| 2762 |
meetingUsers = _useMeetings2.meetingUsers, |
| 2763 |
currentUser = _useMeetings2.currentUser; |
| 2764 |
|
| 2765 |
var meeting = meetings.find(function (meet) { |
| 2766 |
return meet.link === url; |
| 2767 |
}); |
| 2768 |
var mappedMeetingUsersId = meetingUsers.reduce(function (p, c) { |
| 2769 |
return _objectSpread(_objectSpread({}, p), {}, _defineProperty({}, c.id, c)); |
| 2770 |
}, {}); |
| 2771 |
|
| 2772 |
if (!meeting) { |
| 2773 |
return null; |
| 2774 |
} else { |
| 2775 |
var meetingsUserIds = meeting.meetingsUserIds; |
| 2776 |
|
| 2777 |
if (currentUser && meetingsUserIds.includes(currentUser.id) && !hasCalendarObject(currentUser)) { |
| 2778 |
return _constants__WEBPACK_IMPORTED_MODULE_2__.CURRENT_USER_CALENDAR_MISSING; |
| 2779 |
} else if (meetingsUserIds.map(function (id) { |
| 2780 |
return mappedMeetingUsersId[id]; |
| 2781 |
}).some(function (user) { |
| 2782 |
return !hasCalendarObject(user); |
| 2783 |
})) { |
| 2784 |
return _constants__WEBPACK_IMPORTED_MODULE_2__.OTHER_USER_CALENDAR_MISSING; |
| 2785 |
} else { |
| 2786 |
return null; |
| 2787 |
} |
| 2788 |
} |
| 2789 |
} |
| 2790 |
|
| 2791 |
/***/ }), |
| 2792 |
|
| 2793 |
/***/ "./scripts/shared/Meeting/hooks/useMeetingsFetch.ts": |
| 2794 |
/*!**********************************************************!*\ |
| 2795 |
!*** ./scripts/shared/Meeting/hooks/useMeetingsFetch.ts ***! |
| 2796 |
\**********************************************************/ |
| 2797 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2798 |
|
| 2799 |
"use strict"; |
| 2800 |
__webpack_require__.r(__webpack_exports__); |
| 2801 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2802 |
/* harmony export */ "default": () => (/* binding */ useMeetingsFetch) |
| 2803 |
/* harmony export */ }); |
| 2804 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 2805 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 2806 |
/* harmony import */ var _iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../iframe/useBackgroundApp */ "./scripts/iframe/useBackgroundApp.ts"); |
| 2807 |
/* harmony import */ var _enums_loadState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums/loadState */ "./scripts/shared/enums/loadState.ts"); |
| 2808 |
/* harmony import */ var _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../iframe/integratedMessages */ "./scripts/iframe/integratedMessages/index.ts"); |
| 2809 |
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } |
| 2810 |
|
| 2811 |
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."); } |
| 2812 |
|
| 2813 |
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); } |
| 2814 |
|
| 2815 |
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; } |
| 2816 |
|
| 2817 |
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; } |
| 2818 |
|
| 2819 |
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
| 2820 |
|
| 2821 |
|
| 2822 |
|
| 2823 |
|
| 2824 |
|
| 2825 |
var meetings = []; |
| 2826 |
var meetingUsers = []; |
| 2827 |
function useMeetingsFetch() { |
| 2828 |
var proxy = (0,_iframe_useBackgroundApp__WEBPACK_IMPORTED_MODULE_1__.usePostAsyncBackgroundMessage)(); |
| 2829 |
|
| 2830 |
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded), |
| 2831 |
_useState2 = _slicedToArray(_useState, 2), |
| 2832 |
loadState = _useState2[0], |
| 2833 |
setLoadState = _useState2[1]; |
| 2834 |
|
| 2835 |
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null), |
| 2836 |
_useState4 = _slicedToArray(_useState3, 2), |
| 2837 |
error = _useState4[0], |
| 2838 |
setError = _useState4[1]; |
| 2839 |
|
| 2840 |
var reload = function reload() { |
| 2841 |
meetings = []; |
| 2842 |
setError(null); |
| 2843 |
setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded); |
| 2844 |
}; |
| 2845 |
|
| 2846 |
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { |
| 2847 |
if (loadState === _enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].NotLoaded && meetings.length === 0) { |
| 2848 |
setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loading); |
| 2849 |
proxy({ |
| 2850 |
key: _iframe_integratedMessages__WEBPACK_IMPORTED_MODULE_3__.ProxyMessages.FetchMeetingsAndUsers |
| 2851 |
}).then(function (data) { |
| 2852 |
setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Loaded); |
| 2853 |
meetings = data && data.meetingLinks; |
| 2854 |
meetingUsers = data && data.meetingUsers; |
| 2855 |
})["catch"](function (e) { |
| 2856 |
setError(e); |
| 2857 |
setLoadState(_enums_loadState__WEBPACK_IMPORTED_MODULE_2__["default"].Failed); |
| 2858 |
}); |
| 2859 |
} |
| 2860 |
}, [loadState]); |
| 2861 |
return { |
| 2862 |
meetings: meetings, |
| 2863 |
meetingUsers: meetingUsers, |
| 2864 |
loadMeetingsState: loadState, |
| 2865 |
error: error, |
| 2866 |
reload: reload |
| 2867 |
}; |
| 2868 |
} |
| 2869 |
|
| 2870 |
/***/ }), |
| 2871 |
|
| 2872 |
/***/ "./scripts/shared/Meeting/hooks/useMeetingsScript.ts": |
| 2873 |
/*!***********************************************************!*\ |
| 2874 |
!*** ./scripts/shared/Meeting/hooks/useMeetingsScript.ts ***! |
| 2875 |
\***********************************************************/ |
| 2876 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2877 |
|
| 2878 |
"use strict"; |
| 2879 |
__webpack_require__.r(__webpack_exports__); |
| 2880 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2881 |
/* harmony export */ "default": () => (/* binding */ useMeetingsScript) |
| 2882 |
/* harmony export */ }); |
| 2883 |
/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); |
| 2884 |
/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); |
| 2885 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react"); |
| 2886 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); |
| 2887 |
/* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts"); |
| 2888 |
/* harmony import */ var _lib_Raven__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../lib/Raven */ "./scripts/lib/Raven.ts"); |
| 2889 |
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } |
| 2890 |
|
| 2891 |
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."); } |
| 2892 |
|
| 2893 |
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); } |
| 2894 |
|
| 2895 |
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; } |
| 2896 |
|
| 2897 |
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; } |
| 2898 |
|
| 2899 |
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } |
| 2900 |
|
| 2901 |
|
| 2902 |
|
| 2903 |
|
| 2904 |
|
| 2905 |
var promise; |
| 2906 |
|
| 2907 |
function loadMeetingsScript() { |
| 2908 |
if (!promise) { |
| 2909 |
promise = new Promise(function (resolve, reject) { |
| 2910 |
return jquery__WEBPACK_IMPORTED_MODULE_0___default().getScript(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_2__.meetingsScript).done(resolve).fail(reject); |
| 2911 |
}); |
| 2912 |
} |
| 2913 |
|
| 2914 |
return promise; |
| 2915 |
} |
| 2916 |
|
| 2917 |
function useMeetingsScript() { |
| 2918 |
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false), |
| 2919 |
_useState2 = _slicedToArray(_useState, 2), |
| 2920 |
ready = _useState2[0], |
| 2921 |
setReady = _useState2[1]; |
| 2922 |
|
| 2923 |
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () { |
| 2924 |
loadMeetingsScript().then(function () { |
| 2925 |
return setReady(true); |
| 2926 |
})["catch"](function (error) { |
| 2927 |
return _lib_Raven__WEBPACK_IMPORTED_MODULE_3__["default"].captureException(error); |
| 2928 |
}); |
| 2929 |
}, []); |
| 2930 |
return ready; |
| 2931 |
} |
| 2932 |
|
| 2933 |
/***/ }), |
| 2934 |
|
| 2935 |
/***/ "./scripts/shared/UIComponents/UIAlert.tsx": |
| 2936 |
/*!*************************************************!*\ |
| 2937 |
!*** ./scripts/shared/UIComponents/UIAlert.tsx ***! |
| 2938 |
\*************************************************/ |
| 2939 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2940 |
|
| 2941 |
"use strict"; |
| 2942 |
__webpack_require__.r(__webpack_exports__); |
| 2943 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2944 |
/* harmony export */ "default": () => (/* binding */ UIAlert) |
| 2945 |
/* harmony export */ }); |
| 2946 |
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); |
| 2947 |
/* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs"); |
| 2948 |
|
| 2949 |
|
| 2950 |
var AlertContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('div')({ |
| 2951 |
name: "AlertContainer", |
| 2952 |
"class": "a1h8m4fo", |
| 2953 |
propsAsIs: false |
| 2954 |
}); |
| 2955 |
var Title = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('p')({ |
| 2956 |
name: "Title", |
| 2957 |
"class": "tyndzxk", |
| 2958 |
propsAsIs: false |
| 2959 |
}); |
| 2960 |
var Message = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('p')({ |
| 2961 |
name: "Message", |
| 2962 |
"class": "m1m9sbk4", |
| 2963 |
propsAsIs: false |
| 2964 |
}); |
| 2965 |
var MessageContainer = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('div')({ |
| 2966 |
name: "MessageContainer", |
| 2967 |
"class": "mg5o421", |
| 2968 |
propsAsIs: false |
| 2969 |
}); |
| 2970 |
function UIAlert(_ref) { |
| 2971 |
var titleText = _ref.titleText, |
| 2972 |
titleMessage = _ref.titleMessage, |
| 2973 |
children = _ref.children; |
| 2974 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(AlertContainer, { |
| 2975 |
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(MessageContainer, { |
| 2976 |
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Title, { |
| 2977 |
children: titleText |
| 2978 |
}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Message, { |
| 2979 |
children: titleMessage |
| 2980 |
})] |
| 2981 |
}), children] |
| 2982 |
}); |
| 2983 |
} |
| 2984 |
|
| 2985 |
__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"); |
| 2986 |
|
| 2987 |
/***/ }), |
| 2988 |
|
| 2989 |
/***/ "./scripts/shared/UIComponents/UIButton.ts": |
| 2990 |
/*!*************************************************!*\ |
| 2991 |
!*** ./scripts/shared/UIComponents/UIButton.ts ***! |
| 2992 |
\*************************************************/ |
| 2993 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2994 |
|
| 2995 |
"use strict"; |
| 2996 |
__webpack_require__.r(__webpack_exports__); |
| 2997 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2998 |
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 2999 |
/* harmony export */ }); |
| 3000 |
/* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs"); |
| 3001 |
/* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./colors */ "./scripts/shared/UIComponents/colors.ts"); |
| 3002 |
|
| 3003 |
|
| 3004 |
|
| 3005 |
var _exp2 = /*#__PURE__*/function _exp2() { |
| 3006 |
return function (props) { |
| 3007 |
return props.use === 'tertiary' ? _colors__WEBPACK_IMPORTED_MODULE_0__.HEFFALUMP : _colors__WEBPACK_IMPORTED_MODULE_0__.LORAX; |
| 3008 |
}; |
| 3009 |
}; |
| 3010 |
|
| 3011 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_1__.styled)('button')({ |
| 3012 |
name: "UIButton0", |
| 3013 |
"class": "ug152ch", |
| 3014 |
propsAsIs: false, |
| 3015 |
vars: { |
| 3016 |
"ug152ch-0": [_exp2()] |
| 3017 |
} |
| 3018 |
})); |
| 3019 |
|
| 3020 |
__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"); |
| 3021 |
|
| 3022 |
/***/ }), |
| 3023 |
|
| 3024 |
/***/ "./scripts/shared/UIComponents/UIContainer.ts": |
| 3025 |
/*!****************************************************!*\ |
| 3026 |
!*** ./scripts/shared/UIComponents/UIContainer.ts ***! |
| 3027 |
\****************************************************/ |
| 3028 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 3029 |
|
| 3030 |
"use strict"; |
| 3031 |
__webpack_require__.r(__webpack_exports__); |
| 3032 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 3033 |
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 3034 |
/* harmony export */ }); |
| 3035 |
/* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs"); |
| 3036 |
|
| 3037 |
|
| 3038 |
var _exp = /*#__PURE__*/function _exp() { |
| 3039 |
return function (props) { |
| 3040 |
return props.textAlign ? props.textAlign : 'inherit'; |
| 3041 |
}; |
| 3042 |
}; |
| 3043 |
|
| 3044 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_0__.styled)('div')({ |
| 3045 |
name: "UIContainer0", |
| 3046 |
"class": "ua13n1c", |
| 3047 |
propsAsIs: false, |
| 3048 |
vars: { |
| 3049 |
"ua13n1c-0": [_exp()] |
| 3050 |
} |
| 3051 |
})); |
| 3052 |
|
| 3053 |
__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"); |
| 3054 |
|
| 3055 |
/***/ }), |
| 3056 |
|
| 3057 |
/***/ "./scripts/shared/UIComponents/UIOverlay.ts": |
| 3058 |
/*!**************************************************!*\ |
| 3059 |
!*** ./scripts/shared/UIComponents/UIOverlay.ts ***! |
| 3060 |
\**************************************************/ |
| 3061 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 3062 |
|
| 3063 |
"use strict"; |
| 3064 |
__webpack_require__.r(__webpack_exports__); |
| 3065 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 3066 |
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 3067 |
/* harmony export */ }); |
| 3068 |
/* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs"); |
| 3069 |
|
| 3070 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_0__.styled)('div')({ |
| 3071 |
name: "UIOverlay0", |
| 3072 |
"class": "u1q7a48k", |
| 3073 |
propsAsIs: false |
| 3074 |
})); |
| 3075 |
|
| 3076 |
__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"); |
| 3077 |
|
| 3078 |
/***/ }), |
| 3079 |
|
| 3080 |
/***/ "./scripts/shared/UIComponents/UISpacer.ts": |
| 3081 |
/*!*************************************************!*\ |
| 3082 |
!*** ./scripts/shared/UIComponents/UISpacer.ts ***! |
| 3083 |
\*************************************************/ |
| 3084 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 3085 |
|
| 3086 |
"use strict"; |
| 3087 |
__webpack_require__.r(__webpack_exports__); |
| 3088 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 3089 |
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 3090 |
/* harmony export */ }); |
| 3091 |
/* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs"); |
| 3092 |
|
| 3093 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_0__.styled)('div')({ |
| 3094 |
name: "UISpacer0", |
| 3095 |
"class": "u3qxofx", |
| 3096 |
propsAsIs: false |
| 3097 |
})); |
| 3098 |
|
| 3099 |
__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"); |
| 3100 |
|
| 3101 |
/***/ }), |
| 3102 |
|
| 3103 |
/***/ "./scripts/shared/UIComponents/UISpinner.tsx": |
| 3104 |
/*!***************************************************!*\ |
| 3105 |
!*** ./scripts/shared/UIComponents/UISpinner.tsx ***! |
| 3106 |
\***************************************************/ |
| 3107 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 3108 |
|
| 3109 |
"use strict"; |
| 3110 |
__webpack_require__.r(__webpack_exports__); |
| 3111 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 3112 |
/* harmony export */ "default": () => (/* binding */ UISpinner) |
| 3113 |
/* harmony export */ }); |
| 3114 |
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js"); |
| 3115 |
/* harmony import */ var _linaria_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @linaria/react */ "./node_modules/@linaria/react/dist/index.mjs"); |
| 3116 |
/* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./colors */ "./scripts/shared/UIComponents/colors.ts"); |
| 3117 |
|
| 3118 |
|
| 3119 |
|
| 3120 |
var SpinnerOuter = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('div')({ |
| 3121 |
name: "SpinnerOuter", |
| 3122 |
"class": "sxa9zrc", |
| 3123 |
propsAsIs: false |
| 3124 |
}); |
| 3125 |
var SpinnerInner = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('div')({ |
| 3126 |
name: "SpinnerInner", |
| 3127 |
"class": "s14430wa", |
| 3128 |
propsAsIs: false |
| 3129 |
}); |
| 3130 |
|
| 3131 |
var _exp = /*#__PURE__*/function _exp() { |
| 3132 |
return function (props) { |
| 3133 |
return props.color; |
| 3134 |
}; |
| 3135 |
}; |
| 3136 |
|
| 3137 |
var Circle = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('circle')({ |
| 3138 |
name: "Circle", |
| 3139 |
"class": "ct87ghk", |
| 3140 |
propsAsIs: true, |
| 3141 |
vars: { |
| 3142 |
"ct87ghk-0": [_exp()] |
| 3143 |
} |
| 3144 |
}); |
| 3145 |
|
| 3146 |
var _exp2 = /*#__PURE__*/function _exp2() { |
| 3147 |
return function (props) { |
| 3148 |
return props.color; |
| 3149 |
}; |
| 3150 |
}; |
| 3151 |
|
| 3152 |
var AnimatedCircle = /*#__PURE__*/(0,_linaria_react__WEBPACK_IMPORTED_MODULE_2__.styled)('circle')({ |
| 3153 |
name: "AnimatedCircle", |
| 3154 |
"class": "avili0h", |
| 3155 |
propsAsIs: true, |
| 3156 |
vars: { |
| 3157 |
"avili0h-0": [_exp2()] |
| 3158 |
} |
| 3159 |
}); |
| 3160 |
function UISpinner(_ref) { |
| 3161 |
var _ref$size = _ref.size, |
| 3162 |
size = _ref$size === void 0 ? 20 : _ref$size; |
| 3163 |
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SpinnerOuter, { |
| 3164 |
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SpinnerInner, { |
| 3165 |
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { |
| 3166 |
height: size, |
| 3167 |
width: size, |
| 3168 |
viewBox: "0 0 50 50", |
| 3169 |
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Circle, { |
| 3170 |
color: _colors__WEBPACK_IMPORTED_MODULE_1__.CALYPSO_MEDIUM, |
| 3171 |
cx: "25", |
| 3172 |
cy: "25", |
| 3173 |
r: "22.5" |
| 3174 |
}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AnimatedCircle, { |
| 3175 |
color: _colors__WEBPACK_IMPORTED_MODULE_1__.CALYPSO, |
| 3176 |
cx: "25", |
| 3177 |
cy: "25", |
| 3178 |
r: "22.5" |
| 3179 |
})] |
| 3180 |
}) |
| 3181 |
}) |
| 3182 |
}); |
| 3183 |
} |
| 3184 |
|
| 3185 |
__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"); |
| 3186 |
|
| 3187 |
/***/ }), |
| 3188 |
|
| 3189 |
/***/ "./scripts/shared/UIComponents/colors.ts": |
| 3190 |
/*!***********************************************!*\ |
| 3191 |
!*** ./scripts/shared/UIComponents/colors.ts ***! |
| 3192 |
\***********************************************/ |
| 3193 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 3194 |
|
| 3195 |
"use strict"; |
| 3196 |
__webpack_require__.r(__webpack_exports__); |
| 3197 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 3198 |
/* harmony export */ "CALYPSO": () => (/* binding */ CALYPSO), |
| 3199 |
/* harmony export */ "CALYPSO_LIGHT": () => (/* binding */ CALYPSO_LIGHT), |
| 3200 |
/* harmony export */ "CALYPSO_MEDIUM": () => (/* binding */ CALYPSO_MEDIUM), |
| 3201 |
/* harmony export */ "HEFFALUMP": () => (/* binding */ HEFFALUMP), |
| 3202 |
/* harmony export */ "LORAX": () => (/* binding */ LORAX), |
| 3203 |
/* harmony export */ "MARIGOLD_LIGHT": () => (/* binding */ MARIGOLD_LIGHT), |
| 3204 |
/* harmony export */ "MARIGOLD_MEDIUM": () => (/* binding */ MARIGOLD_MEDIUM), |
| 3205 |
/* harmony export */ "OBSIDIAN": () => (/* binding */ OBSIDIAN), |
| 3206 |
/* harmony export */ "OLAF": () => (/* binding */ OLAF) |
| 3207 |
/* harmony export */ }); |
| 3208 |
var CALYPSO = '#00a4bd'; |
| 3209 |
var CALYPSO_MEDIUM = '#7fd1de'; |
| 3210 |
var CALYPSO_LIGHT = '#e5f5f8'; |
| 3211 |
var LORAX = '#ff7a59'; |
| 3212 |
var OLAF = '#ffffff'; |
| 3213 |
var HEFFALUMP = '#425b76'; |
| 3214 |
var MARIGOLD_LIGHT = '#fef8f0'; |
| 3215 |
var MARIGOLD_MEDIUM = '#fae0b5'; |
| 3216 |
var OBSIDIAN = '#33475b'; |
| 3217 |
|
| 3218 |
/***/ }), |
| 3219 |
|
| 3220 |
/***/ "./scripts/shared/enums/connectionStatus.ts": |
| 3221 |
/*!**************************************************!*\ |
| 3222 |
!*** ./scripts/shared/enums/connectionStatus.ts ***! |
| 3223 |
\**************************************************/ |
| 3224 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 3225 |
|
| 3226 |
"use strict"; |
| 3227 |
__webpack_require__.r(__webpack_exports__); |
| 3228 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 3229 |
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 3230 |
/* harmony export */ }); |
| 3231 |
var ConnectionStatus = { |
| 3232 |
Connected: 'Connected', |
| 3233 |
NotConnected: 'NotConnected' |
| 3234 |
}; |
| 3235 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ConnectionStatus); |
| 3236 |
|
| 3237 |
/***/ }), |
| 3238 |
|
| 3239 |
/***/ "./scripts/shared/enums/loadState.ts": |
| 3240 |
/*!*******************************************!*\ |
| 3241 |
!*** ./scripts/shared/enums/loadState.ts ***! |
| 3242 |
\*******************************************/ |
| 3243 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 3244 |
|
| 3245 |
"use strict"; |
| 3246 |
__webpack_require__.r(__webpack_exports__); |
| 3247 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 3248 |
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 3249 |
/* harmony export */ }); |
| 3250 |
var LoadState = { |
| 3251 |
NotLoaded: 'NotLoaded', |
| 3252 |
Loading: 'Loading', |
| 3253 |
Loaded: 'Loaded', |
| 3254 |
Idle: 'Idle', |
| 3255 |
Failed: 'Failed' |
| 3256 |
}; |
| 3257 |
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LoadState); |
| 3258 |
|
| 3259 |
/***/ }), |
| 3260 |
|
| 3261 |
/***/ "./scripts/utils/appUtils.ts": |
| 3262 |
/*!***********************************!*\ |
| 3263 |
!*** ./scripts/utils/appUtils.ts ***! |
| 3264 |
\***********************************/ |
| 3265 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 3266 |
|
| 3267 |
"use strict"; |
| 3268 |
__webpack_require__.r(__webpack_exports__); |
| 3269 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 3270 |
/* harmony export */ "initApp": () => (/* binding */ initApp), |
| 3271 |
/* harmony export */ "initAppOnReady": () => (/* binding */ initAppOnReady) |
| 3272 |
/* harmony export */ }); |
| 3273 |
/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); |
| 3274 |
/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); |
| 3275 |
/* harmony import */ var _lib_Raven__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/Raven */ "./scripts/lib/Raven.ts"); |
| 3276 |
|
| 3277 |
|
| 3278 |
function initApp(initFn) { |
| 3279 |
(0,_lib_Raven__WEBPACK_IMPORTED_MODULE_1__.configureRaven)(); |
| 3280 |
_lib_Raven__WEBPACK_IMPORTED_MODULE_1__["default"].context(initFn); |
| 3281 |
} |
| 3282 |
function initAppOnReady(initFn) { |
| 3283 |
function main() { |
| 3284 |
jquery__WEBPACK_IMPORTED_MODULE_0___default()(initFn); |
| 3285 |
} |
| 3286 |
|
| 3287 |
initApp(main); |
| 3288 |
} |
| 3289 |
|
| 3290 |
/***/ }), |
| 3291 |
|
| 3292 |
/***/ "./scripts/utils/backgroundAppUtils.ts": |
| 3293 |
/*!*********************************************!*\ |
| 3294 |
!*** ./scripts/utils/backgroundAppUtils.ts ***! |
| 3295 |
\*********************************************/ |
| 3296 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 3297 |
|
| 3298 |
"use strict"; |
| 3299 |
__webpack_require__.r(__webpack_exports__); |
| 3300 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 3301 |
/* harmony export */ "getOrCreateBackgroundApp": () => (/* binding */ getOrCreateBackgroundApp), |
| 3302 |
/* harmony export */ "initBackgroundApp": () => (/* binding */ initBackgroundApp) |
| 3303 |
/* harmony export */ }); |
| 3304 |
/* harmony import */ var _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/leadinConfig */ "./scripts/constants/leadinConfig.ts"); |
| 3305 |
/* harmony import */ var _appUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./appUtils */ "./scripts/utils/appUtils.ts"); |
| 3306 |
|
| 3307 |
|
| 3308 |
function initBackgroundApp(initFn) { |
| 3309 |
function main() { |
| 3310 |
if (Array.isArray(initFn)) { |
| 3311 |
initFn.forEach(function (callback) { |
| 3312 |
return callback(); |
| 3313 |
}); |
| 3314 |
} else { |
| 3315 |
initFn(); |
| 3316 |
} |
| 3317 |
} |
| 3318 |
|
| 3319 |
(0,_appUtils__WEBPACK_IMPORTED_MODULE_1__.initApp)(main); |
| 3320 |
} |
| 3321 |
var getOrCreateBackgroundApp = function getOrCreateBackgroundApp(refreshToken) { |
| 3322 |
if (window.LeadinBackgroundApp) { |
| 3323 |
return window.LeadinBackgroundApp; |
| 3324 |
} |
| 3325 |
|
| 3326 |
var _window = window, |
| 3327 |
IntegratedAppEmbedder = _window.IntegratedAppEmbedder, |
| 3328 |
IntegratedAppOptions = _window.IntegratedAppOptions; |
| 3329 |
var options = new IntegratedAppOptions().setLocale(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__.locale).setDeviceId(_constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__.deviceId).setRefreshToken(refreshToken); |
| 3330 |
var embedder = new IntegratedAppEmbedder('integrated-plugin-proxy', _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__.portalId, _constants_leadinConfig__WEBPACK_IMPORTED_MODULE_0__.hubspotBaseUrl, function () {}).setOptions(options); |
| 3331 |
embedder.attachTo(document.body, false); |
| 3332 |
embedder.postStartAppMessage(); // lets the app know all all data has been passed to it |
| 3333 |
|
| 3334 |
window.LeadinBackgroundApp = embedder; |
| 3335 |
return window.LeadinBackgroundApp; |
| 3336 |
}; |
| 3337 |
|
| 3338 |
/***/ }), |
| 3339 |
|
| 3340 |
/***/ "./node_modules/lodash/_Symbol.js": |
| 3341 |
/*!****************************************!*\ |
| 3342 |
!*** ./node_modules/lodash/_Symbol.js ***! |
| 3343 |
\****************************************/ |
| 3344 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 3345 |
|
| 3346 |
var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); |
| 3347 |
|
| 3348 |
/** Built-in value references. */ |
| 3349 |
var Symbol = root.Symbol; |
| 3350 |
|
| 3351 |
module.exports = Symbol; |
| 3352 |
|
| 3353 |
|
| 3354 |
/***/ }), |
| 3355 |
|
| 3356 |
/***/ "./node_modules/lodash/_baseGetTag.js": |
| 3357 |
/*!********************************************!*\ |
| 3358 |
!*** ./node_modules/lodash/_baseGetTag.js ***! |
| 3359 |
\********************************************/ |
| 3360 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 3361 |
|
| 3362 |
var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"), |
| 3363 |
getRawTag = __webpack_require__(/*! ./_getRawTag */ "./node_modules/lodash/_getRawTag.js"), |
| 3364 |
objectToString = __webpack_require__(/*! ./_objectToString */ "./node_modules/lodash/_objectToString.js"); |
| 3365 |
|
| 3366 |
/** `Object#toString` result references. */ |
| 3367 |
var nullTag = '[object Null]', |
| 3368 |
undefinedTag = '[object Undefined]'; |
| 3369 |
|
| 3370 |
/** Built-in value references. */ |
| 3371 |
var symToStringTag = Symbol ? Symbol.toStringTag : undefined; |
| 3372 |
|
| 3373 |
/** |
| 3374 |
* The base implementation of `getTag` without fallbacks for buggy environments. |
| 3375 |
* |
| 3376 |
* @private |
| 3377 |
* @param {*} value The value to query. |
| 3378 |
* @returns {string} Returns the `toStringTag`. |
| 3379 |
*/ |
| 3380 |
function baseGetTag(value) { |
| 3381 |
if (value == null) { |
| 3382 |
return value === undefined ? undefinedTag : nullTag; |
| 3383 |
} |
| 3384 |
return (symToStringTag && symToStringTag in Object(value)) |
| 3385 |
? getRawTag(value) |
| 3386 |
: objectToString(value); |
| 3387 |
} |
| 3388 |
|
| 3389 |
module.exports = baseGetTag; |
| 3390 |
|
| 3391 |
|
| 3392 |
/***/ }), |
| 3393 |
|
| 3394 |
/***/ "./node_modules/lodash/_baseTrim.js": |
| 3395 |
/*!******************************************!*\ |
| 3396 |
!*** ./node_modules/lodash/_baseTrim.js ***! |
| 3397 |
\******************************************/ |
| 3398 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 3399 |
|
| 3400 |
var trimmedEndIndex = __webpack_require__(/*! ./_trimmedEndIndex */ "./node_modules/lodash/_trimmedEndIndex.js"); |
| 3401 |
|
| 3402 |
/** Used to match leading whitespace. */ |
| 3403 |
var reTrimStart = /^\s+/; |
| 3404 |
|
| 3405 |
/** |
| 3406 |
* The base implementation of `_.trim`. |
| 3407 |
* |
| 3408 |
* @private |
| 3409 |
* @param {string} string The string to trim. |
| 3410 |
* @returns {string} Returns the trimmed string. |
| 3411 |
*/ |
| 3412 |
function baseTrim(string) { |
| 3413 |
return string |
| 3414 |
? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') |
| 3415 |
: string; |
| 3416 |
} |
| 3417 |
|
| 3418 |
module.exports = baseTrim; |
| 3419 |
|
| 3420 |
|
| 3421 |
/***/ }), |
| 3422 |
|
| 3423 |
/***/ "./node_modules/lodash/_freeGlobal.js": |
| 3424 |
/*!********************************************!*\ |
| 3425 |
!*** ./node_modules/lodash/_freeGlobal.js ***! |
| 3426 |
\********************************************/ |
| 3427 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 3428 |
|
| 3429 |
/** Detect free variable `global` from Node.js. */ |
| 3430 |
var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g; |
| 3431 |
|
| 3432 |
module.exports = freeGlobal; |
| 3433 |
|
| 3434 |
|
| 3435 |
/***/ }), |
| 3436 |
|
| 3437 |
/***/ "./node_modules/lodash/_getRawTag.js": |
| 3438 |
/*!*******************************************!*\ |
| 3439 |
!*** ./node_modules/lodash/_getRawTag.js ***! |
| 3440 |
\*******************************************/ |
| 3441 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 3442 |
|
| 3443 |
var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"); |
| 3444 |
|
| 3445 |
/** Used for built-in method references. */ |
| 3446 |
var objectProto = Object.prototype; |
| 3447 |
|
| 3448 |
/** Used to check objects for own properties. */ |
| 3449 |
var hasOwnProperty = objectProto.hasOwnProperty; |
| 3450 |
|
| 3451 |
/** |
| 3452 |
* Used to resolve the |
| 3453 |
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) |
| 3454 |
* of values. |
| 3455 |
*/ |
| 3456 |
var nativeObjectToString = objectProto.toString; |
| 3457 |
|
| 3458 |
/** Built-in value references. */ |
| 3459 |
var symToStringTag = Symbol ? Symbol.toStringTag : undefined; |
| 3460 |
|
| 3461 |
/** |
| 3462 |
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. |
| 3463 |
* |
| 3464 |
* @private |
| 3465 |
* @param {*} value The value to query. |
| 3466 |
* @returns {string} Returns the raw `toStringTag`. |
| 3467 |
*/ |
| 3468 |
function getRawTag(value) { |
| 3469 |
var isOwn = hasOwnProperty.call(value, symToStringTag), |
| 3470 |
tag = value[symToStringTag]; |
| 3471 |
|
| 3472 |
try { |
| 3473 |
value[symToStringTag] = undefined; |
| 3474 |
var unmasked = true; |
| 3475 |
} catch (e) {} |
| 3476 |
|
| 3477 |
var result = nativeObjectToString.call(value); |
| 3478 |
if (unmasked) { |
| 3479 |
if (isOwn) { |
| 3480 |
value[symToStringTag] = tag; |
| 3481 |
} else { |
| 3482 |
delete value[symToStringTag]; |
| 3483 |
} |
| 3484 |
} |
| 3485 |
return result; |
| 3486 |
} |
| 3487 |
|
| 3488 |
module.exports = getRawTag; |
| 3489 |
|
| 3490 |
|
| 3491 |
/***/ }), |
| 3492 |
|
| 3493 |
/***/ "./node_modules/lodash/_objectToString.js": |
| 3494 |
/*!************************************************!*\ |
| 3495 |
!*** ./node_modules/lodash/_objectToString.js ***! |
| 3496 |
\************************************************/ |
| 3497 |
/***/ ((module) => { |
| 3498 |
|
| 3499 |
/** Used for built-in method references. */ |
| 3500 |
var objectProto = Object.prototype; |
| 3501 |
|
| 3502 |
/** |
| 3503 |
* Used to resolve the |
| 3504 |
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) |
| 3505 |
* of values. |
| 3506 |
*/ |
| 3507 |
var nativeObjectToString = objectProto.toString; |
| 3508 |
|
| 3509 |
/** |
| 3510 |
* Converts `value` to a string using `Object.prototype.toString`. |
| 3511 |
* |
| 3512 |
* @private |
| 3513 |
* @param {*} value The value to convert. |
| 3514 |
* @returns {string} Returns the converted string. |
| 3515 |
*/ |
| 3516 |
function objectToString(value) { |
| 3517 |
return nativeObjectToString.call(value); |
| 3518 |
} |
| 3519 |
|
| 3520 |
module.exports = objectToString; |
| 3521 |
|
| 3522 |
|
| 3523 |
/***/ }), |
| 3524 |
|
| 3525 |
/***/ "./node_modules/lodash/_root.js": |
| 3526 |
/*!**************************************!*\ |
| 3527 |
!*** ./node_modules/lodash/_root.js ***! |
| 3528 |
\**************************************/ |
| 3529 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 3530 |
|
| 3531 |
var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "./node_modules/lodash/_freeGlobal.js"); |
| 3532 |
|
| 3533 |
/** Detect free variable `self`. */ |
| 3534 |
var freeSelf = typeof self == 'object' && self && self.Object === Object && self; |
| 3535 |
|
| 3536 |
/** Used as a reference to the global object. */ |
| 3537 |
var root = freeGlobal || freeSelf || Function('return this')(); |
| 3538 |
|
| 3539 |
module.exports = root; |
| 3540 |
|
| 3541 |
|
| 3542 |
/***/ }), |
| 3543 |
|
| 3544 |
/***/ "./node_modules/lodash/_trimmedEndIndex.js": |
| 3545 |
/*!*************************************************!*\ |
| 3546 |
!*** ./node_modules/lodash/_trimmedEndIndex.js ***! |
| 3547 |
\*************************************************/ |
| 3548 |
/***/ ((module) => { |
| 3549 |
|
| 3550 |
/** Used to match a single whitespace character. */ |
| 3551 |
var reWhitespace = /\s/; |
| 3552 |
|
| 3553 |
/** |
| 3554 |
* Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace |
| 3555 |
* character of `string`. |
| 3556 |
* |
| 3557 |
* @private |
| 3558 |
* @param {string} string The string to inspect. |
| 3559 |
* @returns {number} Returns the index of the last non-whitespace character. |
| 3560 |
*/ |
| 3561 |
function trimmedEndIndex(string) { |
| 3562 |
var index = string.length; |
| 3563 |
|
| 3564 |
while (index-- && reWhitespace.test(string.charAt(index))) {} |
| 3565 |
return index; |
| 3566 |
} |
| 3567 |
|
| 3568 |
module.exports = trimmedEndIndex; |
| 3569 |
|
| 3570 |
|
| 3571 |
/***/ }), |
| 3572 |
|
| 3573 |
/***/ "./node_modules/lodash/debounce.js": |
| 3574 |
/*!*****************************************!*\ |
| 3575 |
!*** ./node_modules/lodash/debounce.js ***! |
| 3576 |
\*****************************************/ |
| 3577 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 3578 |
|
| 3579 |
var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"), |
| 3580 |
now = __webpack_require__(/*! ./now */ "./node_modules/lodash/now.js"), |
| 3581 |
toNumber = __webpack_require__(/*! ./toNumber */ "./node_modules/lodash/toNumber.js"); |
| 3582 |
|
| 3583 |
/** Error message constants. */ |
| 3584 |
var FUNC_ERROR_TEXT = 'Expected a function'; |
| 3585 |
|
| 3586 |
/* Built-in method references for those with the same name as other `lodash` methods. */ |
| 3587 |
var nativeMax = Math.max, |
| 3588 |
nativeMin = Math.min; |
| 3589 |
|
| 3590 |
/** |
| 3591 |
* Creates a debounced function that delays invoking `func` until after `wait` |
| 3592 |
* milliseconds have elapsed since the last time the debounced function was |
| 3593 |
* invoked. The debounced function comes with a `cancel` method to cancel |
| 3594 |
* delayed `func` invocations and a `flush` method to immediately invoke them. |
| 3595 |
* Provide `options` to indicate whether `func` should be invoked on the |
| 3596 |
* leading and/or trailing edge of the `wait` timeout. The `func` is invoked |
| 3597 |
* with the last arguments provided to the debounced function. Subsequent |
| 3598 |
* calls to the debounced function return the result of the last `func` |
| 3599 |
* invocation. |
| 3600 |
* |
| 3601 |
* **Note:** If `leading` and `trailing` options are `true`, `func` is |
| 3602 |
* invoked on the trailing edge of the timeout only if the debounced function |
| 3603 |
* is invoked more than once during the `wait` timeout. |
| 3604 |
* |
| 3605 |
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred |
| 3606 |
* until to the next tick, similar to `setTimeout` with a timeout of `0`. |
| 3607 |
* |
| 3608 |
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) |
| 3609 |
* for details over the differences between `_.debounce` and `_.throttle`. |
| 3610 |
* |
| 3611 |
* @static |
| 3612 |
* @memberOf _ |
| 3613 |
* @since 0.1.0 |
| 3614 |
* @category Function |
| 3615 |
* @param {Function} func The function to debounce. |
| 3616 |
* @param {number} [wait=0] The number of milliseconds to delay. |
| 3617 |
* @param {Object} [options={}] The options object. |
| 3618 |
* @param {boolean} [options.leading=false] |
| 3619 |
* Specify invoking on the leading edge of the timeout. |
| 3620 |
* @param {number} [options.maxWait] |
| 3621 |
* The maximum time `func` is allowed to be delayed before it's invoked. |
| 3622 |
* @param {boolean} [options.trailing=true] |
| 3623 |
* Specify invoking on the trailing edge of the timeout. |
| 3624 |
* @returns {Function} Returns the new debounced function. |
| 3625 |
* @example |
| 3626 |
* |
| 3627 |
* // Avoid costly calculations while the window size is in flux. |
| 3628 |
* jQuery(window).on('resize', _.debounce(calculateLayout, 150)); |
| 3629 |
* |
| 3630 |
* // Invoke `sendMail` when clicked, debouncing subsequent calls. |
| 3631 |
* jQuery(element).on('click', _.debounce(sendMail, 300, { |
| 3632 |
* 'leading': true, |
| 3633 |
* 'trailing': false |
| 3634 |
* })); |
| 3635 |
* |
| 3636 |
* // Ensure `batchLog` is invoked once after 1 second of debounced calls. |
| 3637 |
* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); |
| 3638 |
* var source = new EventSource('/stream'); |
| 3639 |
* jQuery(source).on('message', debounced); |
| 3640 |
* |
| 3641 |
* // Cancel the trailing debounced invocation. |
| 3642 |
* jQuery(window).on('popstate', debounced.cancel); |
| 3643 |
*/ |
| 3644 |
function debounce(func, wait, options) { |
| 3645 |
var lastArgs, |
| 3646 |
lastThis, |
| 3647 |
maxWait, |
| 3648 |
result, |
| 3649 |
timerId, |
| 3650 |
lastCallTime, |
| 3651 |
lastInvokeTime = 0, |
| 3652 |
leading = false, |
| 3653 |
maxing = false, |
| 3654 |
trailing = true; |
| 3655 |
|
| 3656 |
if (typeof func != 'function') { |
| 3657 |
throw new TypeError(FUNC_ERROR_TEXT); |
| 3658 |
} |
| 3659 |
wait = toNumber(wait) || 0; |
| 3660 |
if (isObject(options)) { |
| 3661 |
leading = !!options.leading; |
| 3662 |
maxing = 'maxWait' in options; |
| 3663 |
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; |
| 3664 |
trailing = 'trailing' in options ? !!options.trailing : trailing; |
| 3665 |
} |
| 3666 |
|
| 3667 |
function invokeFunc(time) { |
| 3668 |
var args = lastArgs, |
| 3669 |
thisArg = lastThis; |
| 3670 |
|
| 3671 |
lastArgs = lastThis = undefined; |
| 3672 |
lastInvokeTime = time; |
| 3673 |
result = func.apply(thisArg, args); |
| 3674 |
return result; |
| 3675 |
} |
| 3676 |
|
| 3677 |
function leadingEdge(time) { |
| 3678 |
// Reset any `maxWait` timer. |
| 3679 |
lastInvokeTime = time; |
| 3680 |
// Start the timer for the trailing edge. |
| 3681 |
timerId = setTimeout(timerExpired, wait); |
| 3682 |
// Invoke the leading edge. |
| 3683 |
return leading ? invokeFunc(time) : result; |
| 3684 |
} |
| 3685 |
|
| 3686 |
function remainingWait(time) { |
| 3687 |
var timeSinceLastCall = time - lastCallTime, |
| 3688 |
timeSinceLastInvoke = time - lastInvokeTime, |
| 3689 |
timeWaiting = wait - timeSinceLastCall; |
| 3690 |
|
| 3691 |
return maxing |
| 3692 |
? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) |
| 3693 |
: timeWaiting; |
| 3694 |
} |
| 3695 |
|
| 3696 |
function shouldInvoke(time) { |
| 3697 |
var timeSinceLastCall = time - lastCallTime, |
| 3698 |
timeSinceLastInvoke = time - lastInvokeTime; |
| 3699 |
|
| 3700 |
// Either this is the first call, activity has stopped and we're at the |
| 3701 |
// trailing edge, the system time has gone backwards and we're treating |
| 3702 |
// it as the trailing edge, or we've hit the `maxWait` limit. |
| 3703 |
return (lastCallTime === undefined || (timeSinceLastCall >= wait) || |
| 3704 |
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); |
| 3705 |
} |
| 3706 |
|
| 3707 |
function timerExpired() { |
| 3708 |
var time = now(); |
| 3709 |
if (shouldInvoke(time)) { |
| 3710 |
return trailingEdge(time); |
| 3711 |
} |
| 3712 |
// Restart the timer. |
| 3713 |
timerId = setTimeout(timerExpired, remainingWait(time)); |
| 3714 |
} |
| 3715 |
|
| 3716 |
function trailingEdge(time) { |
| 3717 |
timerId = undefined; |
| 3718 |
|
| 3719 |
// Only invoke if we have `lastArgs` which means `func` has been |
| 3720 |
// debounced at least once. |
| 3721 |
if (trailing && lastArgs) { |
| 3722 |
return invokeFunc(time); |
| 3723 |
} |
| 3724 |
lastArgs = lastThis = undefined; |
| 3725 |
return result; |
| 3726 |
} |
| 3727 |
|
| 3728 |
function cancel() { |
| 3729 |
if (timerId !== undefined) { |
| 3730 |
clearTimeout(timerId); |
| 3731 |
} |
| 3732 |
lastInvokeTime = 0; |
| 3733 |
lastArgs = lastCallTime = lastThis = timerId = undefined; |
| 3734 |
} |
| 3735 |
|
| 3736 |
function flush() { |
| 3737 |
return timerId === undefined ? result : trailingEdge(now()); |
| 3738 |
} |
| 3739 |
|
| 3740 |
function debounced() { |
| 3741 |
var time = now(), |
| 3742 |
isInvoking = shouldInvoke(time); |
| 3743 |
|
| 3744 |
lastArgs = arguments; |
| 3745 |
lastThis = this; |
| 3746 |
lastCallTime = time; |
| 3747 |
|
| 3748 |
if (isInvoking) { |
| 3749 |
if (timerId === undefined) { |
| 3750 |
return leadingEdge(lastCallTime); |
| 3751 |
} |
| 3752 |
if (maxing) { |
| 3753 |
// Handle invocations in a tight loop. |
| 3754 |
clearTimeout(timerId); |
| 3755 |
timerId = setTimeout(timerExpired, wait); |
| 3756 |
return invokeFunc(lastCallTime); |
| 3757 |
} |
| 3758 |
} |
| 3759 |
if (timerId === undefined) { |
| 3760 |
timerId = setTimeout(timerExpired, wait); |
| 3761 |
} |
| 3762 |
return result; |
| 3763 |
} |
| 3764 |
debounced.cancel = cancel; |
| 3765 |
debounced.flush = flush; |
| 3766 |
return debounced; |
| 3767 |
} |
| 3768 |
|
| 3769 |
module.exports = debounce; |
| 3770 |
|
| 3771 |
|
| 3772 |
/***/ }), |
| 3773 |
|
| 3774 |
/***/ "./node_modules/lodash/isObject.js": |
| 3775 |
/*!*****************************************!*\ |
| 3776 |
!*** ./node_modules/lodash/isObject.js ***! |
| 3777 |
\*****************************************/ |
| 3778 |
/***/ ((module) => { |
| 3779 |
|
| 3780 |
/** |
| 3781 |
* Checks if `value` is the |
| 3782 |
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) |
| 3783 |
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) |
| 3784 |
* |
| 3785 |
* @static |
| 3786 |
* @memberOf _ |
| 3787 |
* @since 0.1.0 |
| 3788 |
* @category Lang |
| 3789 |
* @param {*} value The value to check. |
| 3790 |
* @returns {boolean} Returns `true` if `value` is an object, else `false`. |
| 3791 |
* @example |
| 3792 |
* |
| 3793 |
* _.isObject({}); |
| 3794 |
* // => true |
| 3795 |
* |
| 3796 |
* _.isObject([1, 2, 3]); |
| 3797 |
* // => true |
| 3798 |
* |
| 3799 |
* _.isObject(_.noop); |
| 3800 |
* // => true |
| 3801 |
* |
| 3802 |
* _.isObject(null); |
| 3803 |
* // => false |
| 3804 |
*/ |
| 3805 |
function isObject(value) { |
| 3806 |
var type = typeof value; |
| 3807 |
return value != null && (type == 'object' || type == 'function'); |
| 3808 |
} |
| 3809 |
|
| 3810 |
module.exports = isObject; |
| 3811 |
|
| 3812 |
|
| 3813 |
/***/ }), |
| 3814 |
|
| 3815 |
/***/ "./node_modules/lodash/isObjectLike.js": |
| 3816 |
/*!*********************************************!*\ |
| 3817 |
!*** ./node_modules/lodash/isObjectLike.js ***! |
| 3818 |
\*********************************************/ |
| 3819 |
/***/ ((module) => { |
| 3820 |
|
| 3821 |
/** |
| 3822 |
* Checks if `value` is object-like. A value is object-like if it's not `null` |
| 3823 |
* and has a `typeof` result of "object". |
| 3824 |
* |
| 3825 |
* @static |
| 3826 |
* @memberOf _ |
| 3827 |
* @since 4.0.0 |
| 3828 |
* @category Lang |
| 3829 |
* @param {*} value The value to check. |
| 3830 |
* @returns {boolean} Returns `true` if `value` is object-like, else `false`. |
| 3831 |
* @example |
| 3832 |
* |
| 3833 |
* _.isObjectLike({}); |
| 3834 |
* // => true |
| 3835 |
* |
| 3836 |
* _.isObjectLike([1, 2, 3]); |
| 3837 |
* // => true |
| 3838 |
* |
| 3839 |
* _.isObjectLike(_.noop); |
| 3840 |
* // => false |
| 3841 |
* |
| 3842 |
* _.isObjectLike(null); |
| 3843 |
* // => false |
| 3844 |
*/ |
| 3845 |
function isObjectLike(value) { |
| 3846 |
return value != null && typeof value == 'object'; |
| 3847 |
} |
| 3848 |
|
| 3849 |
module.exports = isObjectLike; |
| 3850 |
|
| 3851 |
|
| 3852 |
/***/ }), |
| 3853 |
|
| 3854 |
/***/ "./node_modules/lodash/isSymbol.js": |
| 3855 |
/*!*****************************************!*\ |
| 3856 |
!*** ./node_modules/lodash/isSymbol.js ***! |
| 3857 |
\*****************************************/ |
| 3858 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 3859 |
|
| 3860 |
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"), |
| 3861 |
isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js"); |
| 3862 |
|
| 3863 |
/** `Object#toString` result references. */ |
| 3864 |
var symbolTag = '[object Symbol]'; |
| 3865 |
|
| 3866 |
/** |
| 3867 |
* Checks if `value` is classified as a `Symbol` primitive or object. |
| 3868 |
* |
| 3869 |
* @static |
| 3870 |
* @memberOf _ |
| 3871 |
* @since 4.0.0 |
| 3872 |
* @category Lang |
| 3873 |
* @param {*} value The value to check. |
| 3874 |
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`. |
| 3875 |
* @example |
| 3876 |
* |
| 3877 |
* _.isSymbol(Symbol.iterator); |
| 3878 |
* // => true |
| 3879 |
* |
| 3880 |
* _.isSymbol('abc'); |
| 3881 |
* // => false |
| 3882 |
*/ |
| 3883 |
function isSymbol(value) { |
| 3884 |
return typeof value == 'symbol' || |
| 3885 |
(isObjectLike(value) && baseGetTag(value) == symbolTag); |
| 3886 |
} |
| 3887 |
|
| 3888 |
module.exports = isSymbol; |
| 3889 |
|
| 3890 |
|
| 3891 |
/***/ }), |
| 3892 |
|
| 3893 |
/***/ "./node_modules/lodash/now.js": |
| 3894 |
/*!************************************!*\ |
| 3895 |
!*** ./node_modules/lodash/now.js ***! |
| 3896 |
\************************************/ |
| 3897 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 3898 |
|
| 3899 |
var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"); |
| 3900 |
|
| 3901 |
/** |
| 3902 |
* Gets the timestamp of the number of milliseconds that have elapsed since |
| 3903 |
* the Unix epoch (1 January 1970 00:00:00 UTC). |
| 3904 |
* |
| 3905 |
* @static |
| 3906 |
* @memberOf _ |
| 3907 |
* @since 2.4.0 |
| 3908 |
* @category Date |
| 3909 |
* @returns {number} Returns the timestamp. |
| 3910 |
* @example |
| 3911 |
* |
| 3912 |
* _.defer(function(stamp) { |
| 3913 |
* console.log(_.now() - stamp); |
| 3914 |
* }, _.now()); |
| 3915 |
* // => Logs the number of milliseconds it took for the deferred invocation. |
| 3916 |
*/ |
| 3917 |
var now = function() { |
| 3918 |
return root.Date.now(); |
| 3919 |
}; |
| 3920 |
|
| 3921 |
module.exports = now; |
| 3922 |
|
| 3923 |
|
| 3924 |
/***/ }), |
| 3925 |
|
| 3926 |
/***/ "./node_modules/lodash/toNumber.js": |
| 3927 |
/*!*****************************************!*\ |
| 3928 |
!*** ./node_modules/lodash/toNumber.js ***! |
| 3929 |
\*****************************************/ |
| 3930 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 3931 |
|
| 3932 |
var baseTrim = __webpack_require__(/*! ./_baseTrim */ "./node_modules/lodash/_baseTrim.js"), |
| 3933 |
isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"), |
| 3934 |
isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js"); |
| 3935 |
|
| 3936 |
/** Used as references for various `Number` constants. */ |
| 3937 |
var NAN = 0 / 0; |
| 3938 |
|
| 3939 |
/** Used to detect bad signed hexadecimal string values. */ |
| 3940 |
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; |
| 3941 |
|
| 3942 |
/** Used to detect binary string values. */ |
| 3943 |
var reIsBinary = /^0b[01]+$/i; |
| 3944 |
|
| 3945 |
/** Used to detect octal string values. */ |
| 3946 |
var reIsOctal = /^0o[0-7]+$/i; |
| 3947 |
|
| 3948 |
/** Built-in method references without a dependency on `root`. */ |
| 3949 |
var freeParseInt = parseInt; |
| 3950 |
|
| 3951 |
/** |
| 3952 |
* Converts `value` to a number. |
| 3953 |
* |
| 3954 |
* @static |
| 3955 |
* @memberOf _ |
| 3956 |
* @since 4.0.0 |
| 3957 |
* @category Lang |
| 3958 |
* @param {*} value The value to process. |
| 3959 |
* @returns {number} Returns the number. |
| 3960 |
* @example |
| 3961 |
* |
| 3962 |
* _.toNumber(3.2); |
| 3963 |
* // => 3.2 |
| 3964 |
* |
| 3965 |
* _.toNumber(Number.MIN_VALUE); |
| 3966 |
* // => 5e-324 |
| 3967 |
* |
| 3968 |
* _.toNumber(Infinity); |
| 3969 |
* // => Infinity |
| 3970 |
* |
| 3971 |
* _.toNumber('3.2'); |
| 3972 |
* // => 3.2 |
| 3973 |
*/ |
| 3974 |
function toNumber(value) { |
| 3975 |
if (typeof value == 'number') { |
| 3976 |
return value; |
| 3977 |
} |
| 3978 |
if (isSymbol(value)) { |
| 3979 |
return NAN; |
| 3980 |
} |
| 3981 |
if (isObject(value)) { |
| 3982 |
var other = typeof value.valueOf == 'function' ? value.valueOf() : value; |
| 3983 |
value = isObject(other) ? (other + '') : other; |
| 3984 |
} |
| 3985 |
if (typeof value != 'string') { |
| 3986 |
return value === 0 ? value : +value; |
| 3987 |
} |
| 3988 |
value = baseTrim(value); |
| 3989 |
var isBinary = reIsBinary.test(value); |
| 3990 |
return (isBinary || reIsOctal.test(value)) |
| 3991 |
? freeParseInt(value.slice(2), isBinary ? 2 : 8) |
| 3992 |
: (reIsBadHex.test(value) ? NAN : +value); |
| 3993 |
} |
| 3994 |
|
| 3995 |
module.exports = toNumber; |
| 3996 |
|
| 3997 |
|
| 3998 |
/***/ }), |
| 3999 |
|
| 4000 |
/***/ "./scripts/elementor/Common/ElementorButton.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/elementor/Common/ElementorButton.tsx": |
| 4001 |
/*!*********************************************************************************************************************************************************************************************!*\ |
| 4002 |
!*** ./scripts/elementor/Common/ElementorButton.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/elementor/Common/ElementorButton.tsx ***! |
| 4003 |
\*********************************************************************************************************************************************************************************************/ |
| 4004 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 4005 |
|
| 4006 |
"use strict"; |
| 4007 |
__webpack_require__.r(__webpack_exports__); |
| 4008 |
// extracted by mini-css-extract-plugin |
| 4009 |
|
| 4010 |
|
| 4011 |
/***/ }), |
| 4012 |
|
| 4013 |
/***/ "./scripts/elementor/MeetingWidget/ElementorMeetingWarning.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/elementor/MeetingWidget/ElementorMeetingWarning.tsx": |
| 4014 |
/*!***************************************************************************************************************************************************************************************************************************!*\ |
| 4015 |
!*** ./scripts/elementor/MeetingWidget/ElementorMeetingWarning.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/elementor/MeetingWidget/ElementorMeetingWarning.tsx ***! |
| 4016 |
\***************************************************************************************************************************************************************************************************************************/ |
| 4017 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 4018 |
|
| 4019 |
"use strict"; |
| 4020 |
__webpack_require__.r(__webpack_exports__); |
| 4021 |
// extracted by mini-css-extract-plugin |
| 4022 |
|
| 4023 |
|
| 4024 |
/***/ }), |
| 4025 |
|
| 4026 |
/***/ "./scripts/shared/Common/AsyncSelect.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/Common/AsyncSelect.tsx": |
| 4027 |
/*!*******************************************************************************************************************************************************************************!*\ |
| 4028 |
!*** ./scripts/shared/Common/AsyncSelect.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/Common/AsyncSelect.tsx ***! |
| 4029 |
\*******************************************************************************************************************************************************************************/ |
| 4030 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 4031 |
|
| 4032 |
"use strict"; |
| 4033 |
__webpack_require__.r(__webpack_exports__); |
| 4034 |
// extracted by mini-css-extract-plugin |
| 4035 |
|
| 4036 |
|
| 4037 |
/***/ }), |
| 4038 |
|
| 4039 |
/***/ "./scripts/shared/Common/HubspotWrapper.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/Common/HubspotWrapper.ts": |
| 4040 |
/*!************************************************************************************************************************************************************************************!*\ |
| 4041 |
!*** ./scripts/shared/Common/HubspotWrapper.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/Common/HubspotWrapper.ts ***! |
| 4042 |
\************************************************************************************************************************************************************************************/ |
| 4043 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 4044 |
|
| 4045 |
"use strict"; |
| 4046 |
__webpack_require__.r(__webpack_exports__); |
| 4047 |
// extracted by mini-css-extract-plugin |
| 4048 |
|
| 4049 |
|
| 4050 |
/***/ }), |
| 4051 |
|
| 4052 |
/***/ "./scripts/shared/UIComponents/UIAlert.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIAlert.tsx": |
| 4053 |
/*!***********************************************************************************************************************************************************************************!*\ |
| 4054 |
!*** ./scripts/shared/UIComponents/UIAlert.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIAlert.tsx ***! |
| 4055 |
\***********************************************************************************************************************************************************************************/ |
| 4056 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 4057 |
|
| 4058 |
"use strict"; |
| 4059 |
__webpack_require__.r(__webpack_exports__); |
| 4060 |
// extracted by mini-css-extract-plugin |
| 4061 |
|
| 4062 |
|
| 4063 |
/***/ }), |
| 4064 |
|
| 4065 |
/***/ "./scripts/shared/UIComponents/UIButton.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIButton.ts": |
| 4066 |
/*!************************************************************************************************************************************************************************************!*\ |
| 4067 |
!*** ./scripts/shared/UIComponents/UIButton.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIButton.ts ***! |
| 4068 |
\************************************************************************************************************************************************************************************/ |
| 4069 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 4070 |
|
| 4071 |
"use strict"; |
| 4072 |
__webpack_require__.r(__webpack_exports__); |
| 4073 |
// extracted by mini-css-extract-plugin |
| 4074 |
|
| 4075 |
|
| 4076 |
/***/ }), |
| 4077 |
|
| 4078 |
/***/ "./scripts/shared/UIComponents/UIContainer.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIContainer.ts": |
| 4079 |
/*!******************************************************************************************************************************************************************************************!*\ |
| 4080 |
!*** ./scripts/shared/UIComponents/UIContainer.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIContainer.ts ***! |
| 4081 |
\******************************************************************************************************************************************************************************************/ |
| 4082 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 4083 |
|
| 4084 |
"use strict"; |
| 4085 |
__webpack_require__.r(__webpack_exports__); |
| 4086 |
// extracted by mini-css-extract-plugin |
| 4087 |
|
| 4088 |
|
| 4089 |
/***/ }), |
| 4090 |
|
| 4091 |
/***/ "./scripts/shared/UIComponents/UIOverlay.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIOverlay.ts": |
| 4092 |
/*!**************************************************************************************************************************************************************************************!*\ |
| 4093 |
!*** ./scripts/shared/UIComponents/UIOverlay.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UIOverlay.ts ***! |
| 4094 |
\**************************************************************************************************************************************************************************************/ |
| 4095 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 4096 |
|
| 4097 |
"use strict"; |
| 4098 |
__webpack_require__.r(__webpack_exports__); |
| 4099 |
// extracted by mini-css-extract-plugin |
| 4100 |
|
| 4101 |
|
| 4102 |
/***/ }), |
| 4103 |
|
| 4104 |
/***/ "./scripts/shared/UIComponents/UISpacer.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UISpacer.ts": |
| 4105 |
/*!************************************************************************************************************************************************************************************!*\ |
| 4106 |
!*** ./scripts/shared/UIComponents/UISpacer.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UISpacer.ts ***! |
| 4107 |
\************************************************************************************************************************************************************************************/ |
| 4108 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 4109 |
|
| 4110 |
"use strict"; |
| 4111 |
__webpack_require__.r(__webpack_exports__); |
| 4112 |
// extracted by mini-css-extract-plugin |
| 4113 |
|
| 4114 |
|
| 4115 |
/***/ }), |
| 4116 |
|
| 4117 |
/***/ "./scripts/shared/UIComponents/UISpinner.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UISpinner.tsx": |
| 4118 |
/*!***************************************************************************************************************************************************************************************!*\ |
| 4119 |
!*** ./scripts/shared/UIComponents/UISpinner.linaria.css!=!./node_modules/@linaria/webpack5-loader/lib/outputCssLoader.js?cacheProvider=!./scripts/shared/UIComponents/UISpinner.tsx ***! |
| 4120 |
\***************************************************************************************************************************************************************************************/ |
| 4121 |
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 4122 |
|
| 4123 |
"use strict"; |
| 4124 |
__webpack_require__.r(__webpack_exports__); |
| 4125 |
// extracted by mini-css-extract-plugin |
| 4126 |
|
| 4127 |
|
| 4128 |
/***/ }), |
| 4129 |
|
| 4130 |
/***/ "./node_modules/object-assign/index.js": |
| 4131 |
/*!*********************************************!*\ |
| 4132 |
!*** ./node_modules/object-assign/index.js ***! |
| 4133 |
\*********************************************/ |
| 4134 |
/***/ ((module) => { |
| 4135 |
|
| 4136 |
"use strict"; |
| 4137 |
/* |
| 4138 |
object-assign |
| 4139 |
(c) Sindre Sorhus |
| 4140 |
@license MIT |
| 4141 |
*/ |
| 4142 |
|
| 4143 |
|
| 4144 |
/* eslint-disable no-unused-vars */ |
| 4145 |
var getOwnPropertySymbols = Object.getOwnPropertySymbols; |
| 4146 |
var hasOwnProperty = Object.prototype.hasOwnProperty; |
| 4147 |
var propIsEnumerable = Object.prototype.propertyIsEnumerable; |
| 4148 |
|
| 4149 |
function toObject(val) { |
| 4150 |
if (val === null || val === undefined) { |
| 4151 |
throw new TypeError('Object.assign cannot be called with null or undefined'); |
| 4152 |
} |
| 4153 |
|
| 4154 |
return Object(val); |
| 4155 |
} |
| 4156 |
|
| 4157 |
function shouldUseNative() { |
| 4158 |
try { |
| 4159 |
if (!Object.assign) { |
| 4160 |
return false; |
| 4161 |
} |
| 4162 |
|
| 4163 |
// Detect buggy property enumeration order in older V8 versions. |
| 4164 |
|
| 4165 |
// https://bugs.chromium.org/p/v8/issues/detail?id=4118 |
| 4166 |
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers |
| 4167 |
test1[5] = 'de'; |
| 4168 |
if (Object.getOwnPropertyNames(test1)[0] === '5') { |
| 4169 |
return false; |
| 4170 |
} |
| 4171 |
|
| 4172 |
// https://bugs.chromium.org/p/v8/issues/detail?id=3056 |
| 4173 |
var test2 = {}; |
| 4174 |
for (var i = 0; i < 10; i++) { |
| 4175 |
test2['_' + String.fromCharCode(i)] = i; |
| 4176 |
} |
| 4177 |
var order2 = Object.getOwnPropertyNames(test2).map(function (n) { |
| 4178 |
return test2[n]; |
| 4179 |
}); |
| 4180 |
if (order2.join('') !== '0123456789') { |
| 4181 |
return false; |
| 4182 |
} |
| 4183 |
|
| 4184 |
// https://bugs.chromium.org/p/v8/issues/detail?id=3056 |
| 4185 |
var test3 = {}; |
| 4186 |
'abcdefghijklmnopqrst'.split('').forEach(function (letter) { |
| 4187 |
test3[letter] = letter; |
| 4188 |
}); |
| 4189 |
if (Object.keys(Object.assign({}, test3)).join('') !== |
| 4190 |
'abcdefghijklmnopqrst') { |
| 4191 |
return false; |
| 4192 |
} |
| 4193 |
|
| 4194 |
return true; |
| 4195 |
} catch (err) { |
| 4196 |
// We don't expect any of the above to throw, but better to be safe. |
| 4197 |
return false; |
| 4198 |
} |
| 4199 |
} |
| 4200 |
|
| 4201 |
module.exports = shouldUseNative() ? Object.assign : function (target, source) { |
| 4202 |
var from; |
| 4203 |
var to = toObject(target); |
| 4204 |
var symbols; |
| 4205 |
|
| 4206 |
for (var s = 1; s < arguments.length; s++) { |
| 4207 |
from = Object(arguments[s]); |
| 4208 |
|
| 4209 |
for (var key in from) { |
| 4210 |
if (hasOwnProperty.call(from, key)) { |
| 4211 |
to[key] = from[key]; |
| 4212 |
} |
| 4213 |
} |
| 4214 |
|
| 4215 |
if (getOwnPropertySymbols) { |
| 4216 |
symbols = getOwnPropertySymbols(from); |
| 4217 |
for (var i = 0; i < symbols.length; i++) { |
| 4218 |
if (propIsEnumerable.call(from, symbols[i])) { |
| 4219 |
to[symbols[i]] = from[symbols[i]]; |
| 4220 |
} |
| 4221 |
} |
| 4222 |
} |
| 4223 |
} |
| 4224 |
|
| 4225 |
return to; |
| 4226 |
}; |
| 4227 |
|
| 4228 |
|
| 4229 |
/***/ }), |
| 4230 |
|
| 4231 |
/***/ "./node_modules/raven-js/src/configError.js": |
| 4232 |
/*!**************************************************!*\ |
| 4233 |
!*** ./node_modules/raven-js/src/configError.js ***! |
| 4234 |
\**************************************************/ |
| 4235 |
/***/ ((module) => { |
| 4236 |
|
| 4237 |
function RavenConfigError(message) { |
| 4238 |
this.name = 'RavenConfigError'; |
| 4239 |
this.message = message; |
| 4240 |
} |
| 4241 |
RavenConfigError.prototype = new Error(); |
| 4242 |
RavenConfigError.prototype.constructor = RavenConfigError; |
| 4243 |
|
| 4244 |
module.exports = RavenConfigError; |
| 4245 |
|
| 4246 |
|
| 4247 |
/***/ }), |
| 4248 |
|
| 4249 |
/***/ "./node_modules/raven-js/src/console.js": |
| 4250 |
/*!**********************************************!*\ |
| 4251 |
!*** ./node_modules/raven-js/src/console.js ***! |
| 4252 |
\**********************************************/ |
| 4253 |
/***/ ((module) => { |
| 4254 |
|
| 4255 |
var wrapMethod = function(console, level, callback) { |
| 4256 |
var originalConsoleLevel = console[level]; |
| 4257 |
var originalConsole = console; |
| 4258 |
|
| 4259 |
if (!(level in console)) { |
| 4260 |
return; |
| 4261 |
} |
| 4262 |
|
| 4263 |
var sentryLevel = level === 'warn' ? 'warning' : level; |
| 4264 |
|
| 4265 |
console[level] = function() { |
| 4266 |
var args = [].slice.call(arguments); |
| 4267 |
|
| 4268 |
var msg = '' + args.join(' '); |
| 4269 |
var data = {level: sentryLevel, logger: 'console', extra: {arguments: args}}; |
| 4270 |
|
| 4271 |
if (level === 'assert') { |
| 4272 |
if (args[0] === false) { |
| 4273 |
// Default browsers message |
| 4274 |
msg = 'Assertion failed: ' + (args.slice(1).join(' ') || 'console.assert'); |
| 4275 |
data.extra.arguments = args.slice(1); |
| 4276 |
callback && callback(msg, data); |
| 4277 |
} |
| 4278 |
} else { |
| 4279 |
callback && callback(msg, data); |
| 4280 |
} |
| 4281 |
|
| 4282 |
// this fails for some browsers. :( |
| 4283 |
if (originalConsoleLevel) { |
| 4284 |
// IE9 doesn't allow calling apply on console functions directly |
| 4285 |
// See: https://stackoverflow.com/questions/5472938/does-ie9-support-console-log-and-is-it-a-real-function#answer-5473193 |
| 4286 |
Function.prototype.apply.call(originalConsoleLevel, originalConsole, args); |
| 4287 |
} |
| 4288 |
}; |
| 4289 |
}; |
| 4290 |
|
| 4291 |
module.exports = { |
| 4292 |
wrapMethod: wrapMethod |
| 4293 |
}; |
| 4294 |
|
| 4295 |
|
| 4296 |
/***/ }), |
| 4297 |
|
| 4298 |
/***/ "./node_modules/raven-js/src/raven.js": |
| 4299 |
/*!********************************************!*\ |
| 4300 |
!*** ./node_modules/raven-js/src/raven.js ***! |
| 4301 |
\********************************************/ |
| 4302 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 4303 |
|
| 4304 |
/*global XDomainRequest:false */ |
| 4305 |
|
| 4306 |
var TraceKit = __webpack_require__(/*! ../vendor/TraceKit/tracekit */ "./node_modules/raven-js/vendor/TraceKit/tracekit.js"); |
| 4307 |
var stringify = __webpack_require__(/*! ../vendor/json-stringify-safe/stringify */ "./node_modules/raven-js/vendor/json-stringify-safe/stringify.js"); |
| 4308 |
var RavenConfigError = __webpack_require__(/*! ./configError */ "./node_modules/raven-js/src/configError.js"); |
| 4309 |
|
| 4310 |
var utils = __webpack_require__(/*! ./utils */ "./node_modules/raven-js/src/utils.js"); |
| 4311 |
var isError = utils.isError; |
| 4312 |
var isObject = utils.isObject; |
| 4313 |
var isObject = utils.isObject; |
| 4314 |
var isErrorEvent = utils.isErrorEvent; |
| 4315 |
var isUndefined = utils.isUndefined; |
| 4316 |
var isFunction = utils.isFunction; |
| 4317 |
var isString = utils.isString; |
| 4318 |
var isEmptyObject = utils.isEmptyObject; |
| 4319 |
var each = utils.each; |
| 4320 |
var objectMerge = utils.objectMerge; |
| 4321 |
var truncate = utils.truncate; |
| 4322 |
var objectFrozen = utils.objectFrozen; |
| 4323 |
var hasKey = utils.hasKey; |
| 4324 |
var joinRegExp = utils.joinRegExp; |
| 4325 |
var urlencode = utils.urlencode; |
| 4326 |
var uuid4 = utils.uuid4; |
| 4327 |
var htmlTreeAsString = utils.htmlTreeAsString; |
| 4328 |
var isSameException = utils.isSameException; |
| 4329 |
var isSameStacktrace = utils.isSameStacktrace; |
| 4330 |
var parseUrl = utils.parseUrl; |
| 4331 |
var fill = utils.fill; |
| 4332 |
|
| 4333 |
var wrapConsoleMethod = (__webpack_require__(/*! ./console */ "./node_modules/raven-js/src/console.js").wrapMethod); |
| 4334 |
|
| 4335 |
var dsnKeys = 'source protocol user pass host port path'.split(' '), |
| 4336 |
dsnPattern = /^(?:(\w+):)?\/\/(?:(\w+)(:\w+)?@)?([\w\.-]+)(?::(\d+))?(\/.*)/; |
| 4337 |
|
| 4338 |
function now() { |
| 4339 |
return +new Date(); |
| 4340 |
} |
| 4341 |
|
| 4342 |
// This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785) |
| 4343 |
var _window = |
| 4344 |
typeof window !== 'undefined' |
| 4345 |
? window |
| 4346 |
: typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {}; |
| 4347 |
var _document = _window.document; |
| 4348 |
var _navigator = _window.navigator; |
| 4349 |
|
| 4350 |
function keepOriginalCallback(original, callback) { |
| 4351 |
return isFunction(callback) |
| 4352 |
? function(data) { |
| 4353 |
return callback(data, original); |
| 4354 |
} |
| 4355 |
: callback; |
| 4356 |
} |
| 4357 |
|
| 4358 |
// First, check for JSON support |
| 4359 |
// If there is no JSON, we no-op the core features of Raven |
| 4360 |
// since JSON is required to encode the payload |
| 4361 |
function Raven() { |
| 4362 |
this._hasJSON = !!(typeof JSON === 'object' && JSON.stringify); |
| 4363 |
// Raven can run in contexts where there's no document (react-native) |
| 4364 |
this._hasDocument = !isUndefined(_document); |
| 4365 |
this._hasNavigator = !isUndefined(_navigator); |
| 4366 |
this._lastCapturedException = null; |
| 4367 |
this._lastData = null; |
| 4368 |
this._lastEventId = null; |
| 4369 |
this._globalServer = null; |
| 4370 |
this._globalKey = null; |
| 4371 |
this._globalProject = null; |
| 4372 |
this._globalContext = {}; |
| 4373 |
this._globalOptions = { |
| 4374 |
logger: 'javascript', |
| 4375 |
ignoreErrors: [], |
| 4376 |
ignoreUrls: [], |
| 4377 |
whitelistUrls: [], |
| 4378 |
includePaths: [], |
| 4379 |
collectWindowErrors: true, |
| 4380 |
maxMessageLength: 0, |
| 4381 |
|
| 4382 |
// By default, truncates URL values to 250 chars |
| 4383 |
maxUrlLength: 250, |
| 4384 |
stackTraceLimit: 50, |
| 4385 |
autoBreadcrumbs: true, |
| 4386 |
instrument: true, |
| 4387 |
sampleRate: 1 |
| 4388 |
}; |
| 4389 |
this._ignoreOnError = 0; |
| 4390 |
this._isRavenInstalled = false; |
| 4391 |
this._originalErrorStackTraceLimit = Error.stackTraceLimit; |
| 4392 |
// capture references to window.console *and* all its methods first |
| 4393 |
// before the console plugin has a chance to monkey patch |
| 4394 |
this._originalConsole = _window.console || {}; |
| 4395 |
this._originalConsoleMethods = {}; |
| 4396 |
this._plugins = []; |
| 4397 |
this._startTime = now(); |
| 4398 |
this._wrappedBuiltIns = []; |
| 4399 |
this._breadcrumbs = []; |
| 4400 |
this._lastCapturedEvent = null; |
| 4401 |
this._keypressTimeout; |
| 4402 |
this._location = _window.location; |
| 4403 |
this._lastHref = this._location && this._location.href; |
| 4404 |
this._resetBackoff(); |
| 4405 |
|
| 4406 |
// eslint-disable-next-line guard-for-in |
| 4407 |
for (var method in this._originalConsole) { |
| 4408 |
this._originalConsoleMethods[method] = this._originalConsole[method]; |
| 4409 |
} |
| 4410 |
} |
| 4411 |
|
| 4412 |
/* |
| 4413 |
* The core Raven singleton |
| 4414 |
* |
| 4415 |
* @this {Raven} |
| 4416 |
*/ |
| 4417 |
|
| 4418 |
Raven.prototype = { |
| 4419 |
// Hardcode version string so that raven source can be loaded directly via |
| 4420 |
// webpack (using a build step causes webpack #1617). Grunt verifies that |
| 4421 |
// this value matches package.json during build. |
| 4422 |
// See: https://github.com/getsentry/raven-js/issues/465 |
| 4423 |
VERSION: '3.19.1', |
| 4424 |
|
| 4425 |
debug: false, |
| 4426 |
|
| 4427 |
TraceKit: TraceKit, // alias to TraceKit |
| 4428 |
|
| 4429 |
/* |
| 4430 |
* Configure Raven with a DSN and extra options |
| 4431 |
* |
| 4432 |
* @param {string} dsn The public Sentry DSN |
| 4433 |
* @param {object} options Set of global options [optional] |
| 4434 |
* @return {Raven} |
| 4435 |
*/ |
| 4436 |
config: function(dsn, options) { |
| 4437 |
var self = this; |
| 4438 |
|
| 4439 |
if (self._globalServer) { |
| 4440 |
this._logDebug('error', 'Error: Raven has already been configured'); |
| 4441 |
return self; |
| 4442 |
} |
| 4443 |
if (!dsn) return self; |
| 4444 |
|
| 4445 |
var globalOptions = self._globalOptions; |
| 4446 |
|
| 4447 |
// merge in options |
| 4448 |
if (options) { |
| 4449 |
each(options, function(key, value) { |
| 4450 |
// tags and extra are special and need to be put into context |
| 4451 |
if (key === 'tags' || key === 'extra' || key === 'user') { |
| 4452 |
self._globalContext[key] = value; |
| 4453 |
} else { |
| 4454 |
globalOptions[key] = value; |
| 4455 |
} |
| 4456 |
}); |
| 4457 |
} |
| 4458 |
|
| 4459 |
self.setDSN(dsn); |
| 4460 |
|
| 4461 |
// "Script error." is hard coded into browsers for errors that it can't read. |
| 4462 |
// this is the result of a script being pulled in from an external domain and CORS. |
| 4463 |
globalOptions.ignoreErrors.push(/^Script error\.?$/); |
| 4464 |
globalOptions.ignoreErrors.push(/^Javascript error: Script error\.? on line 0$/); |
| 4465 |
|
| 4466 |
// join regexp rules into one big rule |
| 4467 |
globalOptions.ignoreErrors = joinRegExp(globalOptions.ignoreErrors); |
| 4468 |
globalOptions.ignoreUrls = globalOptions.ignoreUrls.length |
| 4469 |
? joinRegExp(globalOptions.ignoreUrls) |
| 4470 |
: false; |
| 4471 |
globalOptions.whitelistUrls = globalOptions.whitelistUrls.length |
| 4472 |
? joinRegExp(globalOptions.whitelistUrls) |
| 4473 |
: false; |
| 4474 |
globalOptions.includePaths = joinRegExp(globalOptions.includePaths); |
| 4475 |
globalOptions.maxBreadcrumbs = Math.max( |
| 4476 |
0, |
| 4477 |
Math.min(globalOptions.maxBreadcrumbs || 100, 100) |
| 4478 |
); // default and hard limit is 100 |
| 4479 |
|
| 4480 |
var autoBreadcrumbDefaults = { |
| 4481 |
xhr: true, |
| 4482 |
console: true, |
| 4483 |
dom: true, |
| 4484 |
location: true |
| 4485 |
}; |
| 4486 |
|
| 4487 |
var autoBreadcrumbs = globalOptions.autoBreadcrumbs; |
| 4488 |
if ({}.toString.call(autoBreadcrumbs) === '[object Object]') { |
| 4489 |
autoBreadcrumbs = objectMerge(autoBreadcrumbDefaults, autoBreadcrumbs); |
| 4490 |
} else if (autoBreadcrumbs !== false) { |
| 4491 |
autoBreadcrumbs = autoBreadcrumbDefaults; |
| 4492 |
} |
| 4493 |
globalOptions.autoBreadcrumbs = autoBreadcrumbs; |
| 4494 |
|
| 4495 |
var instrumentDefaults = { |
| 4496 |
tryCatch: true |
| 4497 |
}; |
| 4498 |
|
| 4499 |
var instrument = globalOptions.instrument; |
| 4500 |
if ({}.toString.call(instrument) === '[object Object]') { |
| 4501 |
instrument = objectMerge(instrumentDefaults, instrument); |
| 4502 |
} else if (instrument !== false) { |
| 4503 |
instrument = instrumentDefaults; |
| 4504 |
} |
| 4505 |
globalOptions.instrument = instrument; |
| 4506 |
|
| 4507 |
TraceKit.collectWindowErrors = !!globalOptions.collectWindowErrors; |
| 4508 |
|
| 4509 |
// return for chaining |
| 4510 |
return self; |
| 4511 |
}, |
| 4512 |
|
| 4513 |
/* |
| 4514 |
* Installs a global window.onerror error handler |
| 4515 |
* to capture and report uncaught exceptions. |
| 4516 |
* At this point, install() is required to be called due |
| 4517 |
* to the way TraceKit is set up. |
| 4518 |
* |
| 4519 |
* @return {Raven} |
| 4520 |
*/ |
| 4521 |
install: function() { |
| 4522 |
var self = this; |
| 4523 |
if (self.isSetup() && !self._isRavenInstalled) { |
| 4524 |
TraceKit.report.subscribe(function() { |
| 4525 |
self._handleOnErrorStackInfo.apply(self, arguments); |
| 4526 |
}); |
| 4527 |
if (self._globalOptions.instrument && self._globalOptions.instrument.tryCatch) { |
| 4528 |
self._instrumentTryCatch(); |
| 4529 |
} |
| 4530 |
|
| 4531 |
if (self._globalOptions.autoBreadcrumbs) self._instrumentBreadcrumbs(); |
| 4532 |
|
| 4533 |
// Install all of the plugins |
| 4534 |
self._drainPlugins(); |
| 4535 |
|
| 4536 |
self._isRavenInstalled = true; |
| 4537 |
} |
| 4538 |
|
| 4539 |
Error.stackTraceLimit = self._globalOptions.stackTraceLimit; |
| 4540 |
return this; |
| 4541 |
}, |
| 4542 |
|
| 4543 |
/* |
| 4544 |
* Set the DSN (can be called multiple time unlike config) |
| 4545 |
* |
| 4546 |
* @param {string} dsn The public Sentry DSN |
| 4547 |
*/ |
| 4548 |
setDSN: function(dsn) { |
| 4549 |
var self = this, |
| 4550 |
uri = self._parseDSN(dsn), |
| 4551 |
lastSlash = uri.path.lastIndexOf('/'), |
| 4552 |
path = uri.path.substr(1, lastSlash); |
| 4553 |
|
| 4554 |
self._dsn = dsn; |
| 4555 |
self._globalKey = uri.user; |
| 4556 |
self._globalSecret = uri.pass && uri.pass.substr(1); |
| 4557 |
self._globalProject = uri.path.substr(lastSlash + 1); |
| 4558 |
|
| 4559 |
self._globalServer = self._getGlobalServer(uri); |
| 4560 |
|
| 4561 |
self._globalEndpoint = |
| 4562 |
self._globalServer + '/' + path + 'api/' + self._globalProject + '/store/'; |
| 4563 |
|
| 4564 |
// Reset backoff state since we may be pointing at a |
| 4565 |
// new project/server |
| 4566 |
this._resetBackoff(); |
| 4567 |
}, |
| 4568 |
|
| 4569 |
/* |
| 4570 |
* Wrap code within a context so Raven can capture errors |
| 4571 |
* reliably across domains that is executed immediately. |
| 4572 |
* |
| 4573 |
* @param {object} options A specific set of options for this context [optional] |
| 4574 |
* @param {function} func The callback to be immediately executed within the context |
| 4575 |
* @param {array} args An array of arguments to be called with the callback [optional] |
| 4576 |
*/ |
| 4577 |
context: function(options, func, args) { |
| 4578 |
if (isFunction(options)) { |
| 4579 |
args = func || []; |
| 4580 |
func = options; |
| 4581 |
options = undefined; |
| 4582 |
} |
| 4583 |
|
| 4584 |
return this.wrap(options, func).apply(this, args); |
| 4585 |
}, |
| 4586 |
|
| 4587 |
/* |
| 4588 |
* Wrap code within a context and returns back a new function to be executed |
| 4589 |
* |
| 4590 |
* @param {object} options A specific set of options for this context [optional] |
| 4591 |
* @param {function} func The function to be wrapped in a new context |
| 4592 |
* @param {function} func A function to call before the try/catch wrapper [optional, private] |
| 4593 |
* @return {function} The newly wrapped functions with a context |
| 4594 |
*/ |
| 4595 |
wrap: function(options, func, _before) { |
| 4596 |
var self = this; |
| 4597 |
// 1 argument has been passed, and it's not a function |
| 4598 |
// so just return it |
| 4599 |
if (isUndefined(func) && !isFunction(options)) { |
| 4600 |
return options; |
| 4601 |
} |
| 4602 |
|
| 4603 |
// options is optional |
| 4604 |
if (isFunction(options)) { |
| 4605 |
func = options; |
| 4606 |
options = undefined; |
| 4607 |
} |
| 4608 |
|
| 4609 |
// At this point, we've passed along 2 arguments, and the second one |
| 4610 |
// is not a function either, so we'll just return the second argument. |
| 4611 |
if (!isFunction(func)) { |
| 4612 |
return func; |
| 4613 |
} |
| 4614 |
|
| 4615 |
// We don't wanna wrap it twice! |
| 4616 |
try { |
| 4617 |
if (func.__raven__) { |
| 4618 |
return func; |
| 4619 |
} |
| 4620 |
|
| 4621 |
// If this has already been wrapped in the past, return that |
| 4622 |
if (func.__raven_wrapper__) { |
| 4623 |
return func.__raven_wrapper__; |
| 4624 |
} |
| 4625 |
} catch (e) { |
| 4626 |
// Just accessing custom props in some Selenium environments |
| 4627 |
// can cause a "Permission denied" exception (see raven-js#495). |
| 4628 |
// Bail on wrapping and return the function as-is (defers to window.onerror). |
| 4629 |
return func; |
| 4630 |
} |
| 4631 |
|
| 4632 |
function wrapped() { |
| 4633 |
var args = [], |
| 4634 |
i = arguments.length, |
| 4635 |
deep = !options || (options && options.deep !== false); |
| 4636 |
|
| 4637 |
if (_before && isFunction(_before)) { |
| 4638 |
_before.apply(this, arguments); |
| 4639 |
} |
| 4640 |
|
| 4641 |
// Recursively wrap all of a function's arguments that are |
| 4642 |
// functions themselves. |
| 4643 |
while (i--) args[i] = deep ? self.wrap(options, arguments[i]) : arguments[i]; |
| 4644 |
|
| 4645 |
try { |
| 4646 |
// Attempt to invoke user-land function |
| 4647 |
// NOTE: If you are a Sentry user, and you are seeing this stack frame, it |
| 4648 |
// means Raven caught an error invoking your application code. This is |
| 4649 |
// expected behavior and NOT indicative of a bug with Raven.js. |
| 4650 |
return func.apply(this, args); |
| 4651 |
} catch (e) { |
| 4652 |
self._ignoreNextOnError(); |
| 4653 |
self.captureException(e, options); |
| 4654 |
throw e; |
| 4655 |
} |
| 4656 |
} |
| 4657 |
|
| 4658 |
// copy over properties of the old function |
| 4659 |
for (var property in func) { |
| 4660 |
if (hasKey(func, property)) { |
| 4661 |
wrapped[property] = func[property]; |
| 4662 |
} |
| 4663 |
} |
| 4664 |
wrapped.prototype = func.prototype; |
| 4665 |
|
| 4666 |
func.__raven_wrapper__ = wrapped; |
| 4667 |
// Signal that this function has been wrapped already |
| 4668 |
// for both debugging and to prevent it to being wrapped twice |
| 4669 |
wrapped.__raven__ = true; |
| 4670 |
wrapped.__inner__ = func; |
| 4671 |
|
| 4672 |
return wrapped; |
| 4673 |
}, |
| 4674 |
|
| 4675 |
/* |
| 4676 |
* Uninstalls the global error handler. |
| 4677 |
* |
| 4678 |
* @return {Raven} |
| 4679 |
*/ |
| 4680 |
uninstall: function() { |
| 4681 |
TraceKit.report.uninstall(); |
| 4682 |
|
| 4683 |
this._restoreBuiltIns(); |
| 4684 |
|
| 4685 |
Error.stackTraceLimit = this._originalErrorStackTraceLimit; |
| 4686 |
this._isRavenInstalled = false; |
| 4687 |
|
| 4688 |
return this; |
| 4689 |
}, |
| 4690 |
|
| 4691 |
/* |
| 4692 |
* Manually capture an exception and send it over to Sentry |
| 4693 |
* |
| 4694 |
* @param {error} ex An exception to be logged |
| 4695 |
* @param {object} options A specific set of options for this error [optional] |
| 4696 |
* @return {Raven} |
| 4697 |
*/ |
| 4698 |
captureException: function(ex, options) { |
| 4699 |
// Cases for sending ex as a message, rather than an exception |
| 4700 |
var isNotError = !isError(ex); |
| 4701 |
var isNotErrorEvent = !isErrorEvent(ex); |
| 4702 |
var isErrorEventWithoutError = isErrorEvent(ex) && !ex.error; |
| 4703 |
|
| 4704 |
if ((isNotError && isNotErrorEvent) || isErrorEventWithoutError) { |
| 4705 |
return this.captureMessage( |
| 4706 |
ex, |
| 4707 |
objectMerge( |
| 4708 |
{ |
| 4709 |
trimHeadFrames: 1, |
| 4710 |
stacktrace: true // if we fall back to captureMessage, default to attempting a new trace |
| 4711 |
}, |
| 4712 |
options |
| 4713 |
) |
| 4714 |
); |
| 4715 |
} |
| 4716 |
|
| 4717 |
// Get actual Error from ErrorEvent |
| 4718 |
if (isErrorEvent(ex)) ex = ex.error; |
| 4719 |
|
| 4720 |
// Store the raw exception object for potential debugging and introspection |
| 4721 |
this._lastCapturedException = ex; |
| 4722 |
|
| 4723 |
// TraceKit.report will re-raise any exception passed to it, |
| 4724 |
// which means you have to wrap it in try/catch. Instead, we |
| 4725 |
// can wrap it here and only re-raise if TraceKit.report |
| 4726 |
// raises an exception different from the one we asked to |
| 4727 |
// report on. |
| 4728 |
try { |
| 4729 |
var stack = TraceKit.computeStackTrace(ex); |
| 4730 |
this._handleStackInfo(stack, options); |
| 4731 |
} catch (ex1) { |
| 4732 |
if (ex !== ex1) { |
| 4733 |
throw ex1; |
| 4734 |
} |
| 4735 |
} |
| 4736 |
|
| 4737 |
return this; |
| 4738 |
}, |
| 4739 |
|
| 4740 |
/* |
| 4741 |
* Manually send a message to Sentry |
| 4742 |
* |
| 4743 |
* @param {string} msg A plain message to be captured in Sentry |
| 4744 |
* @param {object} options A specific set of options for this message [optional] |
| 4745 |
* @return {Raven} |
| 4746 |
*/ |
| 4747 |
captureMessage: function(msg, options) { |
| 4748 |
// config() automagically converts ignoreErrors from a list to a RegExp so we need to test for an |
| 4749 |
// early call; we'll error on the side of logging anything called before configuration since it's |
| 4750 |
// probably something you should see: |
| 4751 |
if ( |
| 4752 |
!!this._globalOptions.ignoreErrors.test && |
| 4753 |
this._globalOptions.ignoreErrors.test(msg) |
| 4754 |
) { |
| 4755 |
return; |
| 4756 |
} |
| 4757 |
|
| 4758 |
options = options || {}; |
| 4759 |
|
| 4760 |
var data = objectMerge( |
| 4761 |
{ |
| 4762 |
message: msg + '' // Make sure it's actually a string |
| 4763 |
}, |
| 4764 |
options |
| 4765 |
); |
| 4766 |
|
| 4767 |
var ex; |
| 4768 |
// Generate a "synthetic" stack trace from this point. |
| 4769 |
// NOTE: If you are a Sentry user, and you are seeing this stack frame, it is NOT indicative |
| 4770 |
// of a bug with Raven.js. Sentry generates synthetic traces either by configuration, |
| 4771 |
// or if it catches a thrown object without a "stack" property. |
| 4772 |
try { |
| 4773 |
throw new Error(msg); |
| 4774 |
} catch (ex1) { |
| 4775 |
ex = ex1; |
| 4776 |
} |
| 4777 |
|
| 4778 |
// null exception name so `Error` isn't prefixed to msg |
| 4779 |
ex.name = null; |
| 4780 |
var stack = TraceKit.computeStackTrace(ex); |
| 4781 |
|
| 4782 |
// stack[0] is `throw new Error(msg)` call itself, we are interested in the frame that was just before that, stack[1] |
| 4783 |
var initialCall = stack.stack[1]; |
| 4784 |
|
| 4785 |
var fileurl = (initialCall && initialCall.url) || ''; |
| 4786 |
|
| 4787 |
if ( |
| 4788 |
!!this._globalOptions.ignoreUrls.test && |
| 4789 |
this._globalOptions.ignoreUrls.test(fileurl) |
| 4790 |
) { |
| 4791 |
return; |
| 4792 |
} |
| 4793 |
|
| 4794 |
if ( |
| 4795 |
!!this._globalOptions.whitelistUrls.test && |
| 4796 |
!this._globalOptions.whitelistUrls.test(fileurl) |
| 4797 |
) { |
| 4798 |
return; |
| 4799 |
} |
| 4800 |
|
| 4801 |
if (this._globalOptions.stacktrace || (options && options.stacktrace)) { |
| 4802 |
options = objectMerge( |
| 4803 |
{ |
| 4804 |
// fingerprint on msg, not stack trace (legacy behavior, could be |
| 4805 |
// revisited) |
| 4806 |
fingerprint: msg, |
| 4807 |
// since we know this is a synthetic trace, the top N-most frames |
| 4808 |
// MUST be from Raven.js, so mark them as in_app later by setting |
| 4809 |
// trimHeadFrames |
| 4810 |
trimHeadFrames: (options.trimHeadFrames || 0) + 1 |
| 4811 |
}, |
| 4812 |
options |
| 4813 |
); |
| 4814 |
|
| 4815 |
var frames = this._prepareFrames(stack, options); |
| 4816 |
data.stacktrace = { |
| 4817 |
// Sentry expects frames oldest to newest |
| 4818 |
frames: frames.reverse() |
| 4819 |
}; |
| 4820 |
} |
| 4821 |
|
| 4822 |
// Fire away! |
| 4823 |
this._send(data); |
| 4824 |
|
| 4825 |
return this; |
| 4826 |
}, |
| 4827 |
|
| 4828 |
captureBreadcrumb: function(obj) { |
| 4829 |
var crumb = objectMerge( |
| 4830 |
{ |
| 4831 |
timestamp: now() / 1000 |
| 4832 |
}, |
| 4833 |
obj |
| 4834 |
); |
| 4835 |
|
| 4836 |
if (isFunction(this._globalOptions.breadcrumbCallback)) { |
| 4837 |
var result = this._globalOptions.breadcrumbCallback(crumb); |
| 4838 |
|
| 4839 |
if (isObject(result) && !isEmptyObject(result)) { |
| 4840 |
crumb = result; |
| 4841 |
} else if (result === false) { |
| 4842 |
return this; |
| 4843 |
} |
| 4844 |
} |
| 4845 |
|
| 4846 |
this._breadcrumbs.push(crumb); |
| 4847 |
if (this._breadcrumbs.length > this._globalOptions.maxBreadcrumbs) { |
| 4848 |
this._breadcrumbs.shift(); |
| 4849 |
} |
| 4850 |
return this; |
| 4851 |
}, |
| 4852 |
|
| 4853 |
addPlugin: function(plugin /*arg1, arg2, ... argN*/) { |
| 4854 |
var pluginArgs = [].slice.call(arguments, 1); |
| 4855 |
|
| 4856 |
this._plugins.push([plugin, pluginArgs]); |
| 4857 |
if (this._isRavenInstalled) { |
| 4858 |
this._drainPlugins(); |
| 4859 |
} |
| 4860 |
|
| 4861 |
return this; |
| 4862 |
}, |
| 4863 |
|
| 4864 |
/* |
| 4865 |
* Set/clear a user to be sent along with the payload. |
| 4866 |
* |
| 4867 |
* @param {object} user An object representing user data [optional] |
| 4868 |
* @return {Raven} |
| 4869 |
*/ |
| 4870 |
setUserContext: function(user) { |
| 4871 |
// Intentionally do not merge here since that's an unexpected behavior. |
| 4872 |
this._globalContext.user = user; |
| 4873 |
|
| 4874 |
return this; |
| 4875 |
}, |
| 4876 |
|
| 4877 |
/* |
| 4878 |
* Merge extra attributes to be sent along with the payload. |
| 4879 |
* |
| 4880 |
* @param {object} extra An object representing extra data [optional] |
| 4881 |
* @return {Raven} |
| 4882 |
*/ |
| 4883 |
setExtraContext: function(extra) { |
| 4884 |
this._mergeContext('extra', extra); |
| 4885 |
|
| 4886 |
return this; |
| 4887 |
}, |
| 4888 |
|
| 4889 |
/* |
| 4890 |
* Merge tags to be sent along with the payload. |
| 4891 |
* |
| 4892 |
* @param {object} tags An object representing tags [optional] |
| 4893 |
* @return {Raven} |
| 4894 |
*/ |
| 4895 |
setTagsContext: function(tags) { |
| 4896 |
this._mergeContext('tags', tags); |
| 4897 |
|
| 4898 |
return this; |
| 4899 |
}, |
| 4900 |
|
| 4901 |
/* |
| 4902 |
* Clear all of the context. |
| 4903 |
* |
| 4904 |
* @return {Raven} |
| 4905 |
*/ |
| 4906 |
clearContext: function() { |
| 4907 |
this._globalContext = {}; |
| 4908 |
|
| 4909 |
return this; |
| 4910 |
}, |
| 4911 |
|
| 4912 |
/* |
| 4913 |
* Get a copy of the current context. This cannot be mutated. |
| 4914 |
* |
| 4915 |
* @return {object} copy of context |
| 4916 |
*/ |
| 4917 |
getContext: function() { |
| 4918 |
// lol javascript |
| 4919 |
return JSON.parse(stringify(this._globalContext)); |
| 4920 |
}, |
| 4921 |
|
| 4922 |
/* |
| 4923 |
* Set environment of application |
| 4924 |
* |
| 4925 |
* @param {string} environment Typically something like 'production'. |
| 4926 |
* @return {Raven} |
| 4927 |
*/ |
| 4928 |
setEnvironment: function(environment) { |
| 4929 |
this._globalOptions.environment = environment; |
| 4930 |
|
| 4931 |
return this; |
| 4932 |
}, |
| 4933 |
|
| 4934 |
/* |
| 4935 |
* Set release version of application |
| 4936 |
* |
| 4937 |
* @param {string} release Typically something like a git SHA to identify version |
| 4938 |
* @return {Raven} |
| 4939 |
*/ |
| 4940 |
setRelease: function(release) { |
| 4941 |
this._globalOptions.release = release; |
| 4942 |
|
| 4943 |
return this; |
| 4944 |
}, |
| 4945 |
|
| 4946 |
/* |
| 4947 |
* Set the dataCallback option |
| 4948 |
* |
| 4949 |
* @param {function} callback The callback to run which allows the |
| 4950 |
* data blob to be mutated before sending |
| 4951 |
* @return {Raven} |
| 4952 |
*/ |
| 4953 |
setDataCallback: function(callback) { |
| 4954 |
var original = this._globalOptions.dataCallback; |
| 4955 |
this._globalOptions.dataCallback = keepOriginalCallback(original, callback); |
| 4956 |
return this; |
| 4957 |
}, |
| 4958 |
|
| 4959 |
/* |
| 4960 |
* Set the breadcrumbCallback option |
| 4961 |
* |
| 4962 |
* @param {function} callback The callback to run which allows filtering |
| 4963 |
* or mutating breadcrumbs |
| 4964 |
* @return {Raven} |
| 4965 |
*/ |
| 4966 |
setBreadcrumbCallback: function(callback) { |
| 4967 |
var original = this._globalOptions.breadcrumbCallback; |
| 4968 |
this._globalOptions.breadcrumbCallback = keepOriginalCallback(original, callback); |
| 4969 |
return this; |
| 4970 |
}, |
| 4971 |
|
| 4972 |
/* |
| 4973 |
* Set the shouldSendCallback option |
| 4974 |
* |
| 4975 |
* @param {function} callback The callback to run which allows |
| 4976 |
* introspecting the blob before sending |
| 4977 |
* @return {Raven} |
| 4978 |
*/ |
| 4979 |
setShouldSendCallback: function(callback) { |
| 4980 |
var original = this._globalOptions.shouldSendCallback; |
| 4981 |
this._globalOptions.shouldSendCallback = keepOriginalCallback(original, callback); |
| 4982 |
return this; |
| 4983 |
}, |
| 4984 |
|
| 4985 |
/** |
| 4986 |
* Override the default HTTP transport mechanism that transmits data |
| 4987 |
* to the Sentry server. |
| 4988 |
* |
| 4989 |
* @param {function} transport Function invoked instead of the default |
| 4990 |
* `makeRequest` handler. |
| 4991 |
* |
| 4992 |
* @return {Raven} |
| 4993 |
*/ |
| 4994 |
setTransport: function(transport) { |
| 4995 |
this._globalOptions.transport = transport; |
| 4996 |
|
| 4997 |
return this; |
| 4998 |
}, |
| 4999 |
|
| 5000 |
/* |
| 5001 |
* Get the latest raw exception that was captured by Raven. |
| 5002 |
* |
| 5003 |
* @return {error} |
| 5004 |
*/ |
| 5005 |
lastException: function() { |
| 5006 |
return this._lastCapturedException; |
| 5007 |
}, |
| 5008 |
|
| 5009 |
/* |
| 5010 |
* Get the last event id |
| 5011 |
* |
| 5012 |
* @return {string} |
| 5013 |
*/ |
| 5014 |
lastEventId: function() { |
| 5015 |
return this._lastEventId; |
| 5016 |
}, |
| 5017 |
|
| 5018 |
/* |
| 5019 |
* Determine if Raven is setup and ready to go. |
| 5020 |
* |
| 5021 |
* @return {boolean} |
| 5022 |
*/ |
| 5023 |
isSetup: function() { |
| 5024 |
if (!this._hasJSON) return false; // needs JSON support |
| 5025 |
if (!this._globalServer) { |
| 5026 |
if (!this.ravenNotConfiguredError) { |
| 5027 |
this.ravenNotConfiguredError = true; |
| 5028 |
this._logDebug('error', 'Error: Raven has not been configured.'); |
| 5029 |
} |
| 5030 |
return false; |
| 5031 |
} |
| 5032 |
return true; |
| 5033 |
}, |
| 5034 |
|
| 5035 |
afterLoad: function() { |
| 5036 |
// TODO: remove window dependence? |
| 5037 |
|
| 5038 |
// Attempt to initialize Raven on load |
| 5039 |
var RavenConfig = _window.RavenConfig; |
| 5040 |
if (RavenConfig) { |
| 5041 |
this.config(RavenConfig.dsn, RavenConfig.config).install(); |
| 5042 |
} |
| 5043 |
}, |
| 5044 |
|
| 5045 |
showReportDialog: function(options) { |
| 5046 |
if ( |
| 5047 |
!_document // doesn't work without a document (React native) |
| 5048 |
) |
| 5049 |
return; |
| 5050 |
|
| 5051 |
options = options || {}; |
| 5052 |
|
| 5053 |
var lastEventId = options.eventId || this.lastEventId(); |
| 5054 |
if (!lastEventId) { |
| 5055 |
throw new RavenConfigError('Missing eventId'); |
| 5056 |
} |
| 5057 |
|
| 5058 |
var dsn = options.dsn || this._dsn; |
| 5059 |
if (!dsn) { |
| 5060 |
throw new RavenConfigError('Missing DSN'); |
| 5061 |
} |
| 5062 |
|
| 5063 |
var encode = encodeURIComponent; |
| 5064 |
var qs = ''; |
| 5065 |
qs += '?eventId=' + encode(lastEventId); |
| 5066 |
qs += '&dsn=' + encode(dsn); |
| 5067 |
|
| 5068 |
var user = options.user || this._globalContext.user; |
| 5069 |
if (user) { |
| 5070 |
if (user.name) qs += '&name=' + encode(user.name); |
| 5071 |
if (user.email) qs += '&email=' + encode(user.email); |
| 5072 |
} |
| 5073 |
|
| 5074 |
var globalServer = this._getGlobalServer(this._parseDSN(dsn)); |
| 5075 |
|
| 5076 |
var script = _document.createElement('script'); |
| 5077 |
script.async = true; |
| 5078 |
script.src = globalServer + '/api/embed/error-page/' + qs; |
| 5079 |
(_document.head || _document.body).appendChild(script); |
| 5080 |
}, |
| 5081 |
|
| 5082 |
/**** Private functions ****/ |
| 5083 |
_ignoreNextOnError: function() { |
| 5084 |
var self = this; |
| 5085 |
this._ignoreOnError += 1; |
| 5086 |
setTimeout(function() { |
| 5087 |
// onerror should trigger before setTimeout |
| 5088 |
self._ignoreOnError -= 1; |
| 5089 |
}); |
| 5090 |
}, |
| 5091 |
|
| 5092 |
_triggerEvent: function(eventType, options) { |
| 5093 |
// NOTE: `event` is a native browser thing, so let's avoid conflicting wiht it |
| 5094 |
var evt, key; |
| 5095 |
|
| 5096 |
if (!this._hasDocument) return; |
| 5097 |
|
| 5098 |
options = options || {}; |
| 5099 |
|
| 5100 |
eventType = 'raven' + eventType.substr(0, 1).toUpperCase() + eventType.substr(1); |
| 5101 |
|
| 5102 |
if (_document.createEvent) { |
| 5103 |
evt = _document.createEvent('HTMLEvents'); |
| 5104 |
evt.initEvent(eventType, true, true); |
| 5105 |
} else { |
| 5106 |
evt = _document.createEventObject(); |
| 5107 |
evt.eventType = eventType; |
| 5108 |
} |
| 5109 |
|
| 5110 |
for (key in options) |
| 5111 |
if (hasKey(options, key)) { |
| 5112 |
evt[key] = options[key]; |
| 5113 |
} |
| 5114 |
|
| 5115 |
if (_document.createEvent) { |
| 5116 |
// IE9 if standards |
| 5117 |
_document.dispatchEvent(evt); |
| 5118 |
} else { |
| 5119 |
// IE8 regardless of Quirks or Standards |
| 5120 |
// IE9 if quirks |
| 5121 |
try { |
| 5122 |
_document.fireEvent('on' + evt.eventType.toLowerCase(), evt); |
| 5123 |
} catch (e) { |
| 5124 |
// Do nothing |
| 5125 |
} |
| 5126 |
} |
| 5127 |
}, |
| 5128 |
|
| 5129 |
/** |
| 5130 |
* Wraps addEventListener to capture UI breadcrumbs |
| 5131 |
* @param evtName the event name (e.g. "click") |
| 5132 |
* @returns {Function} |
| 5133 |
* @private |
| 5134 |
*/ |
| 5135 |
_breadcrumbEventHandler: function(evtName) { |
| 5136 |
var self = this; |
| 5137 |
return function(evt) { |
| 5138 |
// reset keypress timeout; e.g. triggering a 'click' after |
| 5139 |
// a 'keypress' will reset the keypress debounce so that a new |
| 5140 |
// set of keypresses can be recorded |
| 5141 |
self._keypressTimeout = null; |
| 5142 |
|
| 5143 |
// It's possible this handler might trigger multiple times for the same |
| 5144 |
// event (e.g. event propagation through node ancestors). Ignore if we've |
| 5145 |
// already captured the event. |
| 5146 |
if (self._lastCapturedEvent === evt) return; |
| 5147 |
|
| 5148 |
self._lastCapturedEvent = evt; |
| 5149 |
|
| 5150 |
// try/catch both: |
| 5151 |
// - accessing evt.target (see getsentry/raven-js#838, #768) |
| 5152 |
// - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly |
| 5153 |
// can throw an exception in some circumstances. |
| 5154 |
var target; |
| 5155 |
try { |
| 5156 |
target = htmlTreeAsString(evt.target); |
| 5157 |
} catch (e) { |
| 5158 |
target = '<unknown>'; |
| 5159 |
} |
| 5160 |
|
| 5161 |
self.captureBreadcrumb({ |
| 5162 |
category: 'ui.' + evtName, // e.g. ui.click, ui.input |
| 5163 |
message: target |
| 5164 |
}); |
| 5165 |
}; |
| 5166 |
}, |
| 5167 |
|
| 5168 |
/** |
| 5169 |
* Wraps addEventListener to capture keypress UI events |
| 5170 |
* @returns {Function} |
| 5171 |
* @private |
| 5172 |
*/ |
| 5173 |
_keypressEventHandler: function() { |
| 5174 |
var self = this, |
| 5175 |
debounceDuration = 1000; // milliseconds |
| 5176 |
|
| 5177 |
// TODO: if somehow user switches keypress target before |
| 5178 |
// debounce timeout is triggered, we will only capture |
| 5179 |
// a single breadcrumb from the FIRST target (acceptable?) |
| 5180 |
return function(evt) { |
| 5181 |
var target; |
| 5182 |
try { |
| 5183 |
target = evt.target; |
| 5184 |
} catch (e) { |
| 5185 |
// just accessing event properties can throw an exception in some rare circumstances |
| 5186 |
// see: https://github.com/getsentry/raven-js/issues/838 |
| 5187 |
return; |
| 5188 |
} |
| 5189 |
var tagName = target && target.tagName; |
| 5190 |
|
| 5191 |
// only consider keypress events on actual input elements |
| 5192 |
// this will disregard keypresses targeting body (e.g. tabbing |
| 5193 |
// through elements, hotkeys, etc) |
| 5194 |
if ( |
| 5195 |
!tagName || |
| 5196 |
(tagName !== 'INPUT' && tagName !== 'TEXTAREA' && !target.isContentEditable) |
| 5197 |
) |
| 5198 |
return; |
| 5199 |
|
| 5200 |
// record first keypress in a series, but ignore subsequent |
| 5201 |
// keypresses until debounce clears |
| 5202 |
var timeout = self._keypressTimeout; |
| 5203 |
if (!timeout) { |
| 5204 |
self._breadcrumbEventHandler('input')(evt); |
| 5205 |
} |
| 5206 |
clearTimeout(timeout); |
| 5207 |
self._keypressTimeout = setTimeout(function() { |
| 5208 |
self._keypressTimeout = null; |
| 5209 |
}, debounceDuration); |
| 5210 |
}; |
| 5211 |
}, |
| 5212 |
|
| 5213 |
/** |
| 5214 |
* Captures a breadcrumb of type "navigation", normalizing input URLs |
| 5215 |
* @param to the originating URL |
| 5216 |
* @param from the target URL |
| 5217 |
* @private |
| 5218 |
*/ |
| 5219 |
_captureUrlChange: function(from, to) { |
| 5220 |
var parsedLoc = parseUrl(this._location.href); |
| 5221 |
var parsedTo = parseUrl(to); |
| 5222 |
var parsedFrom = parseUrl(from); |
| 5223 |
|
| 5224 |
// because onpopstate only tells you the "new" (to) value of location.href, and |
| 5225 |
// not the previous (from) value, we need to track the value of the current URL |
| 5226 |
// state ourselves |
| 5227 |
this._lastHref = to; |
| 5228 |
|
| 5229 |
// Use only the path component of the URL if the URL matches the current |
| 5230 |
// document (almost all the time when using pushState) |
| 5231 |
if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) |
| 5232 |
to = parsedTo.relative; |
| 5233 |
if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) |
| 5234 |
from = parsedFrom.relative; |
| 5235 |
|
| 5236 |
this.captureBreadcrumb({ |
| 5237 |
category: 'navigation', |
| 5238 |
data: { |
| 5239 |
to: to, |
| 5240 |
from: from |
| 5241 |
} |
| 5242 |
}); |
| 5243 |
}, |
| 5244 |
|
| 5245 |
/** |
| 5246 |
* Wrap timer functions and event targets to catch errors and provide |
| 5247 |
* better metadata. |
| 5248 |
*/ |
| 5249 |
_instrumentTryCatch: function() { |
| 5250 |
var self = this; |
| 5251 |
|
| 5252 |
var wrappedBuiltIns = self._wrappedBuiltIns; |
| 5253 |
|
| 5254 |
function wrapTimeFn(orig) { |
| 5255 |
return function(fn, t) { |
| 5256 |
// preserve arity |
| 5257 |
// Make a copy of the arguments to prevent deoptimization |
| 5258 |
// https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments |
| 5259 |
var args = new Array(arguments.length); |
| 5260 |
for (var i = 0; i < args.length; ++i) { |
| 5261 |
args[i] = arguments[i]; |
| 5262 |
} |
| 5263 |
var originalCallback = args[0]; |
| 5264 |
if (isFunction(originalCallback)) { |
| 5265 |
args[0] = self.wrap(originalCallback); |
| 5266 |
} |
| 5267 |
|
| 5268 |
// IE < 9 doesn't support .call/.apply on setInterval/setTimeout, but it |
| 5269 |
// also supports only two arguments and doesn't care what this is, so we |
| 5270 |
// can just call the original function directly. |
| 5271 |
if (orig.apply) { |
| 5272 |
return orig.apply(this, args); |
| 5273 |
} else { |
| 5274 |
return orig(args[0], args[1]); |
| 5275 |
} |
| 5276 |
}; |
| 5277 |
} |
| 5278 |
|
| 5279 |
var autoBreadcrumbs = this._globalOptions.autoBreadcrumbs; |
| 5280 |
|
| 5281 |
function wrapEventTarget(global) { |
| 5282 |
var proto = _window[global] && _window[global].prototype; |
| 5283 |
if (proto && proto.hasOwnProperty && proto.hasOwnProperty('addEventListener')) { |
| 5284 |
fill( |
| 5285 |
proto, |
| 5286 |
'addEventListener', |
| 5287 |
function(orig) { |
| 5288 |
return function(evtName, fn, capture, secure) { |
| 5289 |
// preserve arity |
| 5290 |
try { |
| 5291 |
if (fn && fn.handleEvent) { |
| 5292 |
fn.handleEvent = self.wrap(fn.handleEvent); |
| 5293 |
} |
| 5294 |
} catch (err) { |
| 5295 |
// can sometimes get 'Permission denied to access property "handle Event' |
| 5296 |
} |
| 5297 |
|
| 5298 |
// More breadcrumb DOM capture ... done here and not in `_instrumentBreadcrumbs` |
| 5299 |
// so that we don't have more than one wrapper function |
| 5300 |
var before, clickHandler, keypressHandler; |
| 5301 |
|
| 5302 |
if ( |
| 5303 |
autoBreadcrumbs && |
| 5304 |
autoBreadcrumbs.dom && |
| 5305 |
(global === 'EventTarget' || global === 'Node') |
| 5306 |
) { |
| 5307 |
// NOTE: generating multiple handlers per addEventListener invocation, should |
| 5308 |
// revisit and verify we can just use one (almost certainly) |
| 5309 |
clickHandler = self._breadcrumbEventHandler('click'); |
| 5310 |
keypressHandler = self._keypressEventHandler(); |
| 5311 |
before = function(evt) { |
| 5312 |
// need to intercept every DOM event in `before` argument, in case that |
| 5313 |
// same wrapped method is re-used for different events (e.g. mousemove THEN click) |
| 5314 |
// see #724 |
| 5315 |
if (!evt) return; |
| 5316 |
|
| 5317 |
var eventType; |
| 5318 |
try { |
| 5319 |
eventType = evt.type; |
| 5320 |
} catch (e) { |
| 5321 |
// just accessing event properties can throw an exception in some rare circumstances |
| 5322 |
// see: https://github.com/getsentry/raven-js/issues/838 |
| 5323 |
return; |
| 5324 |
} |
| 5325 |
if (eventType === 'click') return clickHandler(evt); |
| 5326 |
else if (eventType === 'keypress') return keypressHandler(evt); |
| 5327 |
}; |
| 5328 |
} |
| 5329 |
return orig.call( |
| 5330 |
this, |
| 5331 |
evtName, |
| 5332 |
self.wrap(fn, undefined, before), |
| 5333 |
capture, |
| 5334 |
secure |
| 5335 |
); |
| 5336 |
}; |
| 5337 |
}, |
| 5338 |
wrappedBuiltIns |
| 5339 |
); |
| 5340 |
fill( |
| 5341 |
proto, |
| 5342 |
'removeEventListener', |
| 5343 |
function(orig) { |
| 5344 |
return function(evt, fn, capture, secure) { |
| 5345 |
try { |
| 5346 |
fn = fn && (fn.__raven_wrapper__ ? fn.__raven_wrapper__ : fn); |
| 5347 |
} catch (e) { |
| 5348 |
// ignore, accessing __raven_wrapper__ will throw in some Selenium environments |
| 5349 |
} |
| 5350 |
return orig.call(this, evt, fn, capture, secure); |
| 5351 |
}; |
| 5352 |
}, |
| 5353 |
wrappedBuiltIns |
| 5354 |
); |
| 5355 |
} |
| 5356 |
} |
| 5357 |
|
| 5358 |
fill(_window, 'setTimeout', wrapTimeFn, wrappedBuiltIns); |
| 5359 |
fill(_window, 'setInterval', wrapTimeFn, wrappedBuiltIns); |
| 5360 |
if (_window.requestAnimationFrame) { |
| 5361 |
fill( |
| 5362 |
_window, |
| 5363 |
'requestAnimationFrame', |
| 5364 |
function(orig) { |
| 5365 |
return function(cb) { |
| 5366 |
return orig(self.wrap(cb)); |
| 5367 |
}; |
| 5368 |
}, |
| 5369 |
wrappedBuiltIns |
| 5370 |
); |
| 5371 |
} |
| 5372 |
|
| 5373 |
// event targets borrowed from bugsnag-js: |
| 5374 |
// https://github.com/bugsnag/bugsnag-js/blob/master/src/bugsnag.js#L666 |
| 5375 |
var eventTargets = [ |
| 5376 |
'EventTarget', |
| 5377 |
'Window', |
| 5378 |
'Node', |
| 5379 |
'ApplicationCache', |
| 5380 |
'AudioTrackList', |
| 5381 |
'ChannelMergerNode', |
| 5382 |
'CryptoOperation', |
| 5383 |
'EventSource', |
| 5384 |
'FileReader', |
| 5385 |
'HTMLUnknownElement', |
| 5386 |
'IDBDatabase', |
| 5387 |
'IDBRequest', |
| 5388 |
'IDBTransaction', |
| 5389 |
'KeyOperation', |
| 5390 |
'MediaController', |
| 5391 |
'MessagePort', |
| 5392 |
'ModalWindow', |
| 5393 |
'Notification', |
| 5394 |
'SVGElementInstance', |
| 5395 |
'Screen', |
| 5396 |
'TextTrack', |
| 5397 |
'TextTrackCue', |
| 5398 |
'TextTrackList', |
| 5399 |
'WebSocket', |
| 5400 |
'WebSocketWorker', |
| 5401 |
'Worker', |
| 5402 |
'XMLHttpRequest', |
| 5403 |
'XMLHttpRequestEventTarget', |
| 5404 |
'XMLHttpRequestUpload' |
| 5405 |
]; |
| 5406 |
for (var i = 0; i < eventTargets.length; i++) { |
| 5407 |
wrapEventTarget(eventTargets[i]); |
| 5408 |
} |
| 5409 |
}, |
| 5410 |
|
| 5411 |
/** |
| 5412 |
* Instrument browser built-ins w/ breadcrumb capturing |
| 5413 |
* - XMLHttpRequests |
| 5414 |
* - DOM interactions (click/typing) |
| 5415 |
* - window.location changes |
| 5416 |
* - console |
| 5417 |
* |
| 5418 |
* Can be disabled or individually configured via the `autoBreadcrumbs` config option |
| 5419 |
*/ |
| 5420 |
_instrumentBreadcrumbs: function() { |
| 5421 |
var self = this; |
| 5422 |
var autoBreadcrumbs = this._globalOptions.autoBreadcrumbs; |
| 5423 |
|
| 5424 |
var wrappedBuiltIns = self._wrappedBuiltIns; |
| 5425 |
|
| 5426 |
function wrapProp(prop, xhr) { |
| 5427 |
if (prop in xhr && isFunction(xhr[prop])) { |
| 5428 |
fill(xhr, prop, function(orig) { |
| 5429 |
return self.wrap(orig); |
| 5430 |
}); // intentionally don't track filled methods on XHR instances |
| 5431 |
} |
| 5432 |
} |
| 5433 |
|
| 5434 |
if (autoBreadcrumbs.xhr && 'XMLHttpRequest' in _window) { |
| 5435 |
var xhrproto = XMLHttpRequest.prototype; |
| 5436 |
fill( |
| 5437 |
xhrproto, |
| 5438 |
'open', |
| 5439 |
function(origOpen) { |
| 5440 |
return function(method, url) { |
| 5441 |
// preserve arity |
| 5442 |
|
| 5443 |
// if Sentry key appears in URL, don't capture |
| 5444 |
if (isString(url) && url.indexOf(self._globalKey) === -1) { |
| 5445 |
this.__raven_xhr = { |
| 5446 |
method: method, |
| 5447 |
url: url, |
| 5448 |
status_code: null |
| 5449 |
}; |
| 5450 |
} |
| 5451 |
|
| 5452 |
return origOpen.apply(this, arguments); |
| 5453 |
}; |
| 5454 |
}, |
| 5455 |
wrappedBuiltIns |
| 5456 |
); |
| 5457 |
|
| 5458 |
fill( |
| 5459 |
xhrproto, |
| 5460 |
'send', |
| 5461 |
function(origSend) { |
| 5462 |
return function(data) { |
| 5463 |
// preserve arity |
| 5464 |
var xhr = this; |
| 5465 |
|
| 5466 |
function onreadystatechangeHandler() { |
| 5467 |
if (xhr.__raven_xhr && xhr.readyState === 4) { |
| 5468 |
try { |
| 5469 |
// touching statusCode in some platforms throws |
| 5470 |
// an exception |
| 5471 |
xhr.__raven_xhr.status_code = xhr.status; |
| 5472 |
} catch (e) { |
| 5473 |
/* do nothing */ |
| 5474 |
} |
| 5475 |
|
| 5476 |
self.captureBreadcrumb({ |
| 5477 |
type: 'http', |
| 5478 |
category: 'xhr', |
| 5479 |
data: xhr.__raven_xhr |
| 5480 |
}); |
| 5481 |
} |
| 5482 |
} |
| 5483 |
|
| 5484 |
var props = ['onload', 'onerror', 'onprogress']; |
| 5485 |
for (var j = 0; j < props.length; j++) { |
| 5486 |
wrapProp(props[j], xhr); |
| 5487 |
} |
| 5488 |
|
| 5489 |
if ('onreadystatechange' in xhr && isFunction(xhr.onreadystatechange)) { |
| 5490 |
fill( |
| 5491 |
xhr, |
| 5492 |
'onreadystatechange', |
| 5493 |
function(orig) { |
| 5494 |
return self.wrap(orig, undefined, onreadystatechangeHandler); |
| 5495 |
} /* intentionally don't track this instrumentation */ |
| 5496 |
); |
| 5497 |
} else { |
| 5498 |
// if onreadystatechange wasn't actually set by the page on this xhr, we |
| 5499 |
// are free to set our own and capture the breadcrumb |
| 5500 |
xhr.onreadystatechange = onreadystatechangeHandler; |
| 5501 |
} |
| 5502 |
|
| 5503 |
return origSend.apply(this, arguments); |
| 5504 |
}; |
| 5505 |
}, |
| 5506 |
wrappedBuiltIns |
| 5507 |
); |
| 5508 |
} |
| 5509 |
|
| 5510 |
if (autoBreadcrumbs.xhr && 'fetch' in _window) { |
| 5511 |
fill( |
| 5512 |
_window, |
| 5513 |
'fetch', |
| 5514 |
function(origFetch) { |
| 5515 |
return function(fn, t) { |
| 5516 |
// preserve arity |
| 5517 |
// Make a copy of the arguments to prevent deoptimization |
| 5518 |
// https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments |
| 5519 |
var args = new Array(arguments.length); |
| 5520 |
for (var i = 0; i < args.length; ++i) { |
| 5521 |
args[i] = arguments[i]; |
| 5522 |
} |
| 5523 |
|
| 5524 |
var fetchInput = args[0]; |
| 5525 |
var method = 'GET'; |
| 5526 |
var url; |
| 5527 |
|
| 5528 |
if (typeof fetchInput === 'string') { |
| 5529 |
url = fetchInput; |
| 5530 |
} else if ('Request' in _window && fetchInput instanceof _window.Request) { |
| 5531 |
url = fetchInput.url; |
| 5532 |
if (fetchInput.method) { |
| 5533 |
method = fetchInput.method; |
| 5534 |
} |
| 5535 |
} else { |
| 5536 |
url = '' + fetchInput; |
| 5537 |
} |
| 5538 |
|
| 5539 |
if (args[1] && args[1].method) { |
| 5540 |
method = args[1].method; |
| 5541 |
} |
| 5542 |
|
| 5543 |
var fetchData = { |
| 5544 |
method: method, |
| 5545 |
url: url, |
| 5546 |
status_code: null |
| 5547 |
}; |
| 5548 |
|
| 5549 |
self.captureBreadcrumb({ |
| 5550 |
type: 'http', |
| 5551 |
category: 'fetch', |
| 5552 |
data: fetchData |
| 5553 |
}); |
| 5554 |
|
| 5555 |
return origFetch.apply(this, args).then(function(response) { |
| 5556 |
fetchData.status_code = response.status; |
| 5557 |
|
| 5558 |
return response; |
| 5559 |
}); |
| 5560 |
}; |
| 5561 |
}, |
| 5562 |
wrappedBuiltIns |
| 5563 |
); |
| 5564 |
} |
| 5565 |
|
| 5566 |
// Capture breadcrumbs from any click that is unhandled / bubbled up all the way |
| 5567 |
// to the document. Do this before we instrument addEventListener. |
| 5568 |
if (autoBreadcrumbs.dom && this._hasDocument) { |
| 5569 |
if (_document.addEventListener) { |
| 5570 |
_document.addEventListener('click', self._breadcrumbEventHandler('click'), false); |
| 5571 |
_document.addEventListener('keypress', self._keypressEventHandler(), false); |
| 5572 |
} else { |
| 5573 |
// IE8 Compatibility |
| 5574 |
_document.attachEvent('onclick', self._breadcrumbEventHandler('click')); |
| 5575 |
_document.attachEvent('onkeypress', self._keypressEventHandler()); |
| 5576 |
} |
| 5577 |
} |
| 5578 |
|
| 5579 |
// record navigation (URL) changes |
| 5580 |
// NOTE: in Chrome App environment, touching history.pushState, *even inside |
| 5581 |
// a try/catch block*, will cause Chrome to output an error to console.error |
| 5582 |
// borrowed from: https://github.com/angular/angular.js/pull/13945/files |
| 5583 |
var chrome = _window.chrome; |
| 5584 |
var isChromePackagedApp = chrome && chrome.app && chrome.app.runtime; |
| 5585 |
var hasPushAndReplaceState = |
| 5586 |
!isChromePackagedApp && |
| 5587 |
_window.history && |
| 5588 |
history.pushState && |
| 5589 |
history.replaceState; |
| 5590 |
if (autoBreadcrumbs.location && hasPushAndReplaceState) { |
| 5591 |
// TODO: remove onpopstate handler on uninstall() |
| 5592 |
var oldOnPopState = _window.onpopstate; |
| 5593 |
_window.onpopstate = function() { |
| 5594 |
var currentHref = self._location.href; |
| 5595 |
self._captureUrlChange(self._lastHref, currentHref); |
| 5596 |
|
| 5597 |
if (oldOnPopState) { |
| 5598 |
return oldOnPopState.apply(this, arguments); |
| 5599 |
} |
| 5600 |
}; |
| 5601 |
|
| 5602 |
var historyReplacementFunction = function(origHistFunction) { |
| 5603 |
// note history.pushState.length is 0; intentionally not declaring |
| 5604 |
// params to preserve 0 arity |
| 5605 |
return function(/* state, title, url */) { |
| 5606 |
var url = arguments.length > 2 ? arguments[2] : undefined; |
| 5607 |
|
| 5608 |
// url argument is optional |
| 5609 |
if (url) { |
| 5610 |
// coerce to string (this is what pushState does) |
| 5611 |
self._captureUrlChange(self._lastHref, url + ''); |
| 5612 |
} |
| 5613 |
|
| 5614 |
return origHistFunction.apply(this, arguments); |
| 5615 |
}; |
| 5616 |
}; |
| 5617 |
|
| 5618 |
fill(history, 'pushState', historyReplacementFunction, wrappedBuiltIns); |
| 5619 |
fill(history, 'replaceState', historyReplacementFunction, wrappedBuiltIns); |
| 5620 |
} |
| 5621 |
|
| 5622 |
if (autoBreadcrumbs.console && 'console' in _window && console.log) { |
| 5623 |
// console |
| 5624 |
var consoleMethodCallback = function(msg, data) { |
| 5625 |
self.captureBreadcrumb({ |
| 5626 |
message: msg, |
| 5627 |
level: data.level, |
| 5628 |
category: 'console' |
| 5629 |
}); |
| 5630 |
}; |
| 5631 |
|
| 5632 |
each(['debug', 'info', 'warn', 'error', 'log'], function(_, level) { |
| 5633 |
wrapConsoleMethod(console, level, consoleMethodCallback); |
| 5634 |
}); |
| 5635 |
} |
| 5636 |
}, |
| 5637 |
|
| 5638 |
_restoreBuiltIns: function() { |
| 5639 |
// restore any wrapped builtins |
| 5640 |
var builtin; |
| 5641 |
while (this._wrappedBuiltIns.length) { |
| 5642 |
builtin = this._wrappedBuiltIns.shift(); |
| 5643 |
|
| 5644 |
var obj = builtin[0], |
| 5645 |
name = builtin[1], |
| 5646 |
orig = builtin[2]; |
| 5647 |
|
| 5648 |
obj[name] = orig; |
| 5649 |
} |
| 5650 |
}, |
| 5651 |
|
| 5652 |
_drainPlugins: function() { |
| 5653 |
var self = this; |
| 5654 |
|
| 5655 |
// FIX ME TODO |
| 5656 |
each(this._plugins, function(_, plugin) { |
| 5657 |
var installer = plugin[0]; |
| 5658 |
var args = plugin[1]; |
| 5659 |
installer.apply(self, [self].concat(args)); |
| 5660 |
}); |
| 5661 |
}, |
| 5662 |
|
| 5663 |
_parseDSN: function(str) { |
| 5664 |
var m = dsnPattern.exec(str), |
| 5665 |
dsn = {}, |
| 5666 |
i = 7; |
| 5667 |
|
| 5668 |
try { |
| 5669 |
while (i--) dsn[dsnKeys[i]] = m[i] || ''; |
| 5670 |
} catch (e) { |
| 5671 |
throw new RavenConfigError('Invalid DSN: ' + str); |
| 5672 |
} |
| 5673 |
|
| 5674 |
if (dsn.pass && !this._globalOptions.allowSecretKey) { |
| 5675 |
throw new RavenConfigError( |
| 5676 |
'Do not specify your secret key in the DSN. See: http://bit.ly/raven-secret-key' |
| 5677 |
); |
| 5678 |
} |
| 5679 |
|
| 5680 |
return dsn; |
| 5681 |
}, |
| 5682 |
|
| 5683 |
_getGlobalServer: function(uri) { |
| 5684 |
// assemble the endpoint from the uri pieces |
| 5685 |
var globalServer = '//' + uri.host + (uri.port ? ':' + uri.port : ''); |
| 5686 |
|
| 5687 |
if (uri.protocol) { |
| 5688 |
globalServer = uri.protocol + ':' + globalServer; |
| 5689 |
} |
| 5690 |
return globalServer; |
| 5691 |
}, |
| 5692 |
|
| 5693 |
_handleOnErrorStackInfo: function() { |
| 5694 |
// if we are intentionally ignoring errors via onerror, bail out |
| 5695 |
if (!this._ignoreOnError) { |
| 5696 |
this._handleStackInfo.apply(this, arguments); |
| 5697 |
} |
| 5698 |
}, |
| 5699 |
|
| 5700 |
_handleStackInfo: function(stackInfo, options) { |
| 5701 |
var frames = this._prepareFrames(stackInfo, options); |
| 5702 |
|
| 5703 |
this._triggerEvent('handle', { |
| 5704 |
stackInfo: stackInfo, |
| 5705 |
options: options |
| 5706 |
}); |
| 5707 |
|
| 5708 |
this._processException( |
| 5709 |
stackInfo.name, |
| 5710 |
stackInfo.message, |
| 5711 |
stackInfo.url, |
| 5712 |
stackInfo.lineno, |
| 5713 |
frames, |
| 5714 |
options |
| 5715 |
); |
| 5716 |
}, |
| 5717 |
|
| 5718 |
_prepareFrames: function(stackInfo, options) { |
| 5719 |
var self = this; |
| 5720 |
var frames = []; |
| 5721 |
if (stackInfo.stack && stackInfo.stack.length) { |
| 5722 |
each(stackInfo.stack, function(i, stack) { |
| 5723 |
var frame = self._normalizeFrame(stack, stackInfo.url); |
| 5724 |
if (frame) { |
| 5725 |
frames.push(frame); |
| 5726 |
} |
| 5727 |
}); |
| 5728 |
|
| 5729 |
// e.g. frames captured via captureMessage throw |
| 5730 |
if (options && options.trimHeadFrames) { |
| 5731 |
for (var j = 0; j < options.trimHeadFrames && j < frames.length; j++) { |
| 5732 |
frames[j].in_app = false; |
| 5733 |
} |
| 5734 |
} |
| 5735 |
} |
| 5736 |
frames = frames.slice(0, this._globalOptions.stackTraceLimit); |
| 5737 |
return frames; |
| 5738 |
}, |
| 5739 |
|
| 5740 |
_normalizeFrame: function(frame, stackInfoUrl) { |
| 5741 |
// normalize the frames data |
| 5742 |
var normalized = { |
| 5743 |
filename: frame.url, |
| 5744 |
lineno: frame.line, |
| 5745 |
colno: frame.column, |
| 5746 |
function: frame.func || '?' |
| 5747 |
}; |
| 5748 |
|
| 5749 |
// Case when we don't have any information about the error |
| 5750 |
// E.g. throwing a string or raw object, instead of an `Error` in Firefox |
| 5751 |
// Generating synthetic error doesn't add any value here |
| 5752 |
// |
| 5753 |
// We should probably somehow let a user know that they should fix their code |
| 5754 |
if (!frame.url) { |
| 5755 |
normalized.filename = stackInfoUrl; // fallback to whole stacks url from onerror handler |
| 5756 |
} |
| 5757 |
|
| 5758 |
normalized.in_app = !// determine if an exception came from outside of our app |
| 5759 |
// first we check the global includePaths list. |
| 5760 |
( |
| 5761 |
(!!this._globalOptions.includePaths.test && |
| 5762 |
!this._globalOptions.includePaths.test(normalized.filename)) || |
| 5763 |
// Now we check for fun, if the function name is Raven or TraceKit |
| 5764 |
/(Raven|TraceKit)\./.test(normalized['function']) || |
| 5765 |
// finally, we do a last ditch effort and check for raven.min.js |
| 5766 |
/raven\.(min\.)?js$/.test(normalized.filename) |
| 5767 |
); |
| 5768 |
|
| 5769 |
return normalized; |
| 5770 |
}, |
| 5771 |
|
| 5772 |
_processException: function(type, message, fileurl, lineno, frames, options) { |
| 5773 |
var prefixedMessage = (type ? type + ': ' : '') + (message || ''); |
| 5774 |
if ( |
| 5775 |
!!this._globalOptions.ignoreErrors.test && |
| 5776 |
(this._globalOptions.ignoreErrors.test(message) || |
| 5777 |
this._globalOptions.ignoreErrors.test(prefixedMessage)) |
| 5778 |
) { |
| 5779 |
return; |
| 5780 |
} |
| 5781 |
|
| 5782 |
var stacktrace; |
| 5783 |
|
| 5784 |
if (frames && frames.length) { |
| 5785 |
fileurl = frames[0].filename || fileurl; |
| 5786 |
// Sentry expects frames oldest to newest |
| 5787 |
// and JS sends them as newest to oldest |
| 5788 |
frames.reverse(); |
| 5789 |
stacktrace = {frames: frames}; |
| 5790 |
} else if (fileurl) { |
| 5791 |
stacktrace = { |
| 5792 |
frames: [ |
| 5793 |
{ |
| 5794 |
filename: fileurl, |
| 5795 |
lineno: lineno, |
| 5796 |
in_app: true |
| 5797 |
} |
| 5798 |
] |
| 5799 |
}; |
| 5800 |
} |
| 5801 |
|
| 5802 |
if ( |
| 5803 |
!!this._globalOptions.ignoreUrls.test && |
| 5804 |
this._globalOptions.ignoreUrls.test(fileurl) |
| 5805 |
) { |
| 5806 |
return; |
| 5807 |
} |
| 5808 |
|
| 5809 |
if ( |
| 5810 |
!!this._globalOptions.whitelistUrls.test && |
| 5811 |
!this._globalOptions.whitelistUrls.test(fileurl) |
| 5812 |
) { |
| 5813 |
return; |
| 5814 |
} |
| 5815 |
|
| 5816 |
var data = objectMerge( |
| 5817 |
{ |
| 5818 |
// sentry.interfaces.Exception |
| 5819 |
exception: { |
| 5820 |
values: [ |
| 5821 |
{ |
| 5822 |
type: type, |
| 5823 |
value: message, |
| 5824 |
stacktrace: stacktrace |
| 5825 |
} |
| 5826 |
] |
| 5827 |
}, |
| 5828 |
culprit: fileurl |
| 5829 |
}, |
| 5830 |
options |
| 5831 |
); |
| 5832 |
|
| 5833 |
// Fire away! |
| 5834 |
this._send(data); |
| 5835 |
}, |
| 5836 |
|
| 5837 |
_trimPacket: function(data) { |
| 5838 |
// For now, we only want to truncate the two different messages |
| 5839 |
// but this could/should be expanded to just trim everything |
| 5840 |
var max = this._globalOptions.maxMessageLength; |
| 5841 |
if (data.message) { |
| 5842 |
data.message = truncate(data.message, max); |
| 5843 |
} |
| 5844 |
if (data.exception) { |
| 5845 |
var exception = data.exception.values[0]; |
| 5846 |
exception.value = truncate(exception.value, max); |
| 5847 |
} |
| 5848 |
|
| 5849 |
var request = data.request; |
| 5850 |
if (request) { |
| 5851 |
if (request.url) { |
| 5852 |
request.url = truncate(request.url, this._globalOptions.maxUrlLength); |
| 5853 |
} |
| 5854 |
if (request.Referer) { |
| 5855 |
request.Referer = truncate(request.Referer, this._globalOptions.maxUrlLength); |
| 5856 |
} |
| 5857 |
} |
| 5858 |
|
| 5859 |
if (data.breadcrumbs && data.breadcrumbs.values) |
| 5860 |
this._trimBreadcrumbs(data.breadcrumbs); |
| 5861 |
|
| 5862 |
return data; |
| 5863 |
}, |
| 5864 |
|
| 5865 |
/** |
| 5866 |
* Truncate breadcrumb values (right now just URLs) |
| 5867 |
*/ |
| 5868 |
_trimBreadcrumbs: function(breadcrumbs) { |
| 5869 |
// known breadcrumb properties with urls |
| 5870 |
// TODO: also consider arbitrary prop values that start with (https?)?:// |
| 5871 |
var urlProps = ['to', 'from', 'url'], |
| 5872 |
urlProp, |
| 5873 |
crumb, |
| 5874 |
data; |
| 5875 |
|
| 5876 |
for (var i = 0; i < breadcrumbs.values.length; ++i) { |
| 5877 |
crumb = breadcrumbs.values[i]; |
| 5878 |
if ( |
| 5879 |
!crumb.hasOwnProperty('data') || |
| 5880 |
!isObject(crumb.data) || |
| 5881 |
objectFrozen(crumb.data) |
| 5882 |
) |
| 5883 |
continue; |
| 5884 |
|
| 5885 |
data = objectMerge({}, crumb.data); |
| 5886 |
for (var j = 0; j < urlProps.length; ++j) { |
| 5887 |
urlProp = urlProps[j]; |
| 5888 |
if (data.hasOwnProperty(urlProp) && data[urlProp]) { |
| 5889 |
data[urlProp] = truncate(data[urlProp], this._globalOptions.maxUrlLength); |
| 5890 |
} |
| 5891 |
} |
| 5892 |
breadcrumbs.values[i].data = data; |
| 5893 |
} |
| 5894 |
}, |
| 5895 |
|
| 5896 |
_getHttpData: function() { |
| 5897 |
if (!this._hasNavigator && !this._hasDocument) return; |
| 5898 |
var httpData = {}; |
| 5899 |
|
| 5900 |
if (this._hasNavigator && _navigator.userAgent) { |
| 5901 |
httpData.headers = { |
| 5902 |
'User-Agent': navigator.userAgent |
| 5903 |
}; |
| 5904 |
} |
| 5905 |
|
| 5906 |
if (this._hasDocument) { |
| 5907 |
if (_document.location && _document.location.href) { |
| 5908 |
httpData.url = _document.location.href; |
| 5909 |
} |
| 5910 |
if (_document.referrer) { |
| 5911 |
if (!httpData.headers) httpData.headers = {}; |
| 5912 |
httpData.headers.Referer = _document.referrer; |
| 5913 |
} |
| 5914 |
} |
| 5915 |
|
| 5916 |
return httpData; |
| 5917 |
}, |
| 5918 |
|
| 5919 |
_resetBackoff: function() { |
| 5920 |
this._backoffDuration = 0; |
| 5921 |
this._backoffStart = null; |
| 5922 |
}, |
| 5923 |
|
| 5924 |
_shouldBackoff: function() { |
| 5925 |
return this._backoffDuration && now() - this._backoffStart < this._backoffDuration; |
| 5926 |
}, |
| 5927 |
|
| 5928 |
/** |
| 5929 |
* Returns true if the in-process data payload matches the signature |
| 5930 |
* of the previously-sent data |
| 5931 |
* |
| 5932 |
* NOTE: This has to be done at this level because TraceKit can generate |
| 5933 |
* data from window.onerror WITHOUT an exception object (IE8, IE9, |
| 5934 |
* other old browsers). This can take the form of an "exception" |
| 5935 |
* data object with a single frame (derived from the onerror args). |
| 5936 |
*/ |
| 5937 |
_isRepeatData: function(current) { |
| 5938 |
var last = this._lastData; |
| 5939 |
|
| 5940 |
if ( |
| 5941 |
!last || |
| 5942 |
current.message !== last.message || // defined for captureMessage |
| 5943 |
current.culprit !== last.culprit // defined for captureException/onerror |
| 5944 |
) |
| 5945 |
return false; |
| 5946 |
|
| 5947 |
// Stacktrace interface (i.e. from captureMessage) |
| 5948 |
if (current.stacktrace || last.stacktrace) { |
| 5949 |
return isSameStacktrace(current.stacktrace, last.stacktrace); |
| 5950 |
} else if (current.exception || last.exception) { |
| 5951 |
// Exception interface (i.e. from captureException/onerror) |
| 5952 |
return isSameException(current.exception, last.exception); |
| 5953 |
} |
| 5954 |
|
| 5955 |
return true; |
| 5956 |
}, |
| 5957 |
|
| 5958 |
_setBackoffState: function(request) { |
| 5959 |
// If we are already in a backoff state, don't change anything |
| 5960 |
if (this._shouldBackoff()) { |
| 5961 |
return; |
| 5962 |
} |
| 5963 |
|
| 5964 |
var status = request.status; |
| 5965 |
|
| 5966 |
// 400 - project_id doesn't exist or some other fatal |
| 5967 |
// 401 - invalid/revoked dsn |
| 5968 |
// 429 - too many requests |
| 5969 |
if (!(status === 400 || status === 401 || status === 429)) return; |
| 5970 |
|
| 5971 |
var retry; |
| 5972 |
try { |
| 5973 |
// If Retry-After is not in Access-Control-Expose-Headers, most |
| 5974 |
// browsers will throw an exception trying to access it |
| 5975 |
retry = request.getResponseHeader('Retry-After'); |
| 5976 |
retry = parseInt(retry, 10) * 1000; // Retry-After is returned in seconds |
| 5977 |
} catch (e) { |
| 5978 |
/* eslint no-empty:0 */ |
| 5979 |
} |
| 5980 |
|
| 5981 |
this._backoffDuration = retry |
| 5982 |
? // If Sentry server returned a Retry-After value, use it |
| 5983 |
retry |
| 5984 |
: // Otherwise, double the last backoff duration (starts at 1 sec) |
| 5985 |
this._backoffDuration * 2 || 1000; |
| 5986 |
|
| 5987 |
this._backoffStart = now(); |
| 5988 |
}, |
| 5989 |
|
| 5990 |
_send: function(data) { |
| 5991 |
var globalOptions = this._globalOptions; |
| 5992 |
|
| 5993 |
var baseData = { |
| 5994 |
project: this._globalProject, |
| 5995 |
logger: globalOptions.logger, |
| 5996 |
platform: 'javascript' |
| 5997 |
}, |
| 5998 |
httpData = this._getHttpData(); |
| 5999 |
|
| 6000 |
if (httpData) { |
| 6001 |
baseData.request = httpData; |
| 6002 |
} |
| 6003 |
|
| 6004 |
// HACK: delete `trimHeadFrames` to prevent from appearing in outbound payload |
| 6005 |
if (data.trimHeadFrames) delete data.trimHeadFrames; |
| 6006 |
|
| 6007 |
data = objectMerge(baseData, data); |
| 6008 |
|
| 6009 |
// Merge in the tags and extra separately since objectMerge doesn't handle a deep merge |
| 6010 |
data.tags = objectMerge(objectMerge({}, this._globalContext.tags), data.tags); |
| 6011 |
data.extra = objectMerge(objectMerge({}, this._globalContext.extra), data.extra); |
| 6012 |
|
| 6013 |
// Send along our own collected metadata with extra |
| 6014 |
data.extra['session:duration'] = now() - this._startTime; |
| 6015 |
|
| 6016 |
if (this._breadcrumbs && this._breadcrumbs.length > 0) { |
| 6017 |
// intentionally make shallow copy so that additions |
| 6018 |
// to breadcrumbs aren't accidentally sent in this request |
| 6019 |
data.breadcrumbs = { |
| 6020 |
values: [].slice.call(this._breadcrumbs, 0) |
| 6021 |
}; |
| 6022 |
} |
| 6023 |
|
| 6024 |
// If there are no tags/extra, strip the key from the payload alltogther. |
| 6025 |
if (isEmptyObject(data.tags)) delete data.tags; |
| 6026 |
|
| 6027 |
if (this._globalContext.user) { |
| 6028 |
// sentry.interfaces.User |
| 6029 |
data.user = this._globalContext.user; |
| 6030 |
} |
| 6031 |
|
| 6032 |
// Include the environment if it's defined in globalOptions |
| 6033 |
if (globalOptions.environment) data.environment = globalOptions.environment; |
| 6034 |
|
| 6035 |
// Include the release if it's defined in globalOptions |
| 6036 |
if (globalOptions.release) data.release = globalOptions.release; |
| 6037 |
|
| 6038 |
// Include server_name if it's defined in globalOptions |
| 6039 |
if (globalOptions.serverName) data.server_name = globalOptions.serverName; |
| 6040 |
|
| 6041 |
if (isFunction(globalOptions.dataCallback)) { |
| 6042 |
data = globalOptions.dataCallback(data) || data; |
| 6043 |
} |
| 6044 |
|
| 6045 |
// Why?????????? |
| 6046 |
if (!data || isEmptyObject(data)) { |
| 6047 |
return; |
| 6048 |
} |
| 6049 |
|
| 6050 |
// Check if the request should be filtered or not |
| 6051 |
if ( |
| 6052 |
isFunction(globalOptions.shouldSendCallback) && |
| 6053 |
!globalOptions.shouldSendCallback(data) |
| 6054 |
) { |
| 6055 |
return; |
| 6056 |
} |
| 6057 |
|
| 6058 |
// Backoff state: Sentry server previously responded w/ an error (e.g. 429 - too many requests), |
| 6059 |
// so drop requests until "cool-off" period has elapsed. |
| 6060 |
if (this._shouldBackoff()) { |
| 6061 |
this._logDebug('warn', 'Raven dropped error due to backoff: ', data); |
| 6062 |
return; |
| 6063 |
} |
| 6064 |
|
| 6065 |
if (typeof globalOptions.sampleRate === 'number') { |
| 6066 |
if (Math.random() < globalOptions.sampleRate) { |
| 6067 |
this._sendProcessedPayload(data); |
| 6068 |
} |
| 6069 |
} else { |
| 6070 |
this._sendProcessedPayload(data); |
| 6071 |
} |
| 6072 |
}, |
| 6073 |
|
| 6074 |
_getUuid: function() { |
| 6075 |
return uuid4(); |
| 6076 |
}, |
| 6077 |
|
| 6078 |
_sendProcessedPayload: function(data, callback) { |
| 6079 |
var self = this; |
| 6080 |
var globalOptions = this._globalOptions; |
| 6081 |
|
| 6082 |
if (!this.isSetup()) return; |
| 6083 |
|
| 6084 |
// Try and clean up the packet before sending by truncating long values |
| 6085 |
data = this._trimPacket(data); |
| 6086 |
|
| 6087 |
// ideally duplicate error testing should occur *before* dataCallback/shouldSendCallback, |
| 6088 |
// but this would require copying an un-truncated copy of the data packet, which can be |
| 6089 |
// arbitrarily deep (extra_data) -- could be worthwhile? will revisit |
| 6090 |
if (!this._globalOptions.allowDuplicates && this._isRepeatData(data)) { |
| 6091 |
this._logDebug('warn', 'Raven dropped repeat event: ', data); |
| 6092 |
return; |
| 6093 |
} |
| 6094 |
|
| 6095 |
// Send along an event_id if not explicitly passed. |
| 6096 |
// This event_id can be used to reference the error within Sentry itself. |
| 6097 |
// Set lastEventId after we know the error should actually be sent |
| 6098 |
this._lastEventId = data.event_id || (data.event_id = this._getUuid()); |
| 6099 |
|
| 6100 |
// Store outbound payload after trim |
| 6101 |
this._lastData = data; |
| 6102 |
|
| 6103 |
this._logDebug('debug', 'Raven about to send:', data); |
| 6104 |
|
| 6105 |
var auth = { |
| 6106 |
sentry_version: '7', |
| 6107 |
sentry_client: 'raven-js/' + this.VERSION, |
| 6108 |
sentry_key: this._globalKey |
| 6109 |
}; |
| 6110 |
|
| 6111 |
if (this._globalSecret) { |
| 6112 |
auth.sentry_secret = this._globalSecret; |
| 6113 |
} |
| 6114 |
|
| 6115 |
var exception = data.exception && data.exception.values[0]; |
| 6116 |
this.captureBreadcrumb({ |
| 6117 |
category: 'sentry', |
| 6118 |
message: exception |
| 6119 |
? (exception.type ? exception.type + ': ' : '') + exception.value |
| 6120 |
: data.message, |
| 6121 |
event_id: data.event_id, |
| 6122 |
level: data.level || 'error' // presume error unless specified |
| 6123 |
}); |
| 6124 |
|
| 6125 |
var url = this._globalEndpoint; |
| 6126 |
(globalOptions.transport || this._makeRequest).call(this, { |
| 6127 |
url: url, |
| 6128 |
auth: auth, |
| 6129 |
data: data, |
| 6130 |
options: globalOptions, |
| 6131 |
onSuccess: function success() { |
| 6132 |
self._resetBackoff(); |
| 6133 |
|
| 6134 |
self._triggerEvent('success', { |
| 6135 |
data: data, |
| 6136 |
src: url |
| 6137 |
}); |
| 6138 |
callback && callback(); |
| 6139 |
}, |
| 6140 |
onError: function failure(error) { |
| 6141 |
self._logDebug('error', 'Raven transport failed to send: ', error); |
| 6142 |
|
| 6143 |
if (error.request) { |
| 6144 |
self._setBackoffState(error.request); |
| 6145 |
} |
| 6146 |
|
| 6147 |
self._triggerEvent('failure', { |
| 6148 |
data: data, |
| 6149 |
src: url |
| 6150 |
}); |
| 6151 |
error = error || new Error('Raven send failed (no additional details provided)'); |
| 6152 |
callback && callback(error); |
| 6153 |
} |
| 6154 |
}); |
| 6155 |
}, |
| 6156 |
|
| 6157 |
_makeRequest: function(opts) { |
| 6158 |
var request = _window.XMLHttpRequest && new _window.XMLHttpRequest(); |
| 6159 |
if (!request) return; |
| 6160 |
|
| 6161 |
// if browser doesn't support CORS (e.g. IE7), we are out of luck |
| 6162 |
var hasCORS = 'withCredentials' in request || typeof XDomainRequest !== 'undefined'; |
| 6163 |
|
| 6164 |
if (!hasCORS) return; |
| 6165 |
|
| 6166 |
var url = opts.url; |
| 6167 |
|
| 6168 |
if ('withCredentials' in request) { |
| 6169 |
request.onreadystatechange = function() { |
| 6170 |
if (request.readyState !== 4) { |
| 6171 |
return; |
| 6172 |
} else if (request.status === 200) { |
| 6173 |
opts.onSuccess && opts.onSuccess(); |
| 6174 |
} else if (opts.onError) { |
| 6175 |
var err = new Error('Sentry error code: ' + request.status); |
| 6176 |
err.request = request; |
| 6177 |
opts.onError(err); |
| 6178 |
} |
| 6179 |
}; |
| 6180 |
} else { |
| 6181 |
request = new XDomainRequest(); |
| 6182 |
// xdomainrequest cannot go http -> https (or vice versa), |
| 6183 |
// so always use protocol relative |
| 6184 |
url = url.replace(/^https?:/, ''); |
| 6185 |
|
| 6186 |
// onreadystatechange not supported by XDomainRequest |
| 6187 |
if (opts.onSuccess) { |
| 6188 |
request.onload = opts.onSuccess; |
| 6189 |
} |
| 6190 |
if (opts.onError) { |
| 6191 |
request.onerror = function() { |
| 6192 |
var err = new Error('Sentry error code: XDomainRequest'); |
| 6193 |
err.request = request; |
| 6194 |
opts.onError(err); |
| 6195 |
}; |
| 6196 |
} |
| 6197 |
} |
| 6198 |
|
| 6199 |
// NOTE: auth is intentionally sent as part of query string (NOT as custom |
| 6200 |
// HTTP header) so as to avoid preflight CORS requests |
| 6201 |
request.open('POST', url + '?' + urlencode(opts.auth)); |
| 6202 |
request.send(stringify(opts.data)); |
| 6203 |
}, |
| 6204 |
|
| 6205 |
_logDebug: function(level) { |
| 6206 |
if (this._originalConsoleMethods[level] && this.debug) { |
| 6207 |
// In IE<10 console methods do not have their own 'apply' method |
| 6208 |
Function.prototype.apply.call( |
| 6209 |
this._originalConsoleMethods[level], |
| 6210 |
this._originalConsole, |
| 6211 |
[].slice.call(arguments, 1) |
| 6212 |
); |
| 6213 |
} |
| 6214 |
}, |
| 6215 |
|
| 6216 |
_mergeContext: function(key, context) { |
| 6217 |
if (isUndefined(context)) { |
| 6218 |
delete this._globalContext[key]; |
| 6219 |
} else { |
| 6220 |
this._globalContext[key] = objectMerge(this._globalContext[key] || {}, context); |
| 6221 |
} |
| 6222 |
} |
| 6223 |
}; |
| 6224 |
|
| 6225 |
// Deprecations |
| 6226 |
Raven.prototype.setUser = Raven.prototype.setUserContext; |
| 6227 |
Raven.prototype.setReleaseContext = Raven.prototype.setRelease; |
| 6228 |
|
| 6229 |
module.exports = Raven; |
| 6230 |
|
| 6231 |
|
| 6232 |
/***/ }), |
| 6233 |
|
| 6234 |
/***/ "./node_modules/raven-js/src/singleton.js": |
| 6235 |
/*!************************************************!*\ |
| 6236 |
!*** ./node_modules/raven-js/src/singleton.js ***! |
| 6237 |
\************************************************/ |
| 6238 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 6239 |
|
| 6240 |
/** |
| 6241 |
* Enforces a single instance of the Raven client, and the |
| 6242 |
* main entry point for Raven. If you are a consumer of the |
| 6243 |
* Raven library, you SHOULD load this file (vs raven.js). |
| 6244 |
**/ |
| 6245 |
|
| 6246 |
var RavenConstructor = __webpack_require__(/*! ./raven */ "./node_modules/raven-js/src/raven.js"); |
| 6247 |
|
| 6248 |
// This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785) |
| 6249 |
var _window = |
| 6250 |
typeof window !== 'undefined' |
| 6251 |
? window |
| 6252 |
: typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {}; |
| 6253 |
var _Raven = _window.Raven; |
| 6254 |
|
| 6255 |
var Raven = new RavenConstructor(); |
| 6256 |
|
| 6257 |
/* |
| 6258 |
* Allow multiple versions of Raven to be installed. |
| 6259 |
* Strip Raven from the global context and returns the instance. |
| 6260 |
* |
| 6261 |
* @return {Raven} |
| 6262 |
*/ |
| 6263 |
Raven.noConflict = function() { |
| 6264 |
_window.Raven = _Raven; |
| 6265 |
return Raven; |
| 6266 |
}; |
| 6267 |
|
| 6268 |
Raven.afterLoad(); |
| 6269 |
|
| 6270 |
module.exports = Raven; |
| 6271 |
|
| 6272 |
|
| 6273 |
/***/ }), |
| 6274 |
|
| 6275 |
/***/ "./node_modules/raven-js/src/utils.js": |
| 6276 |
/*!********************************************!*\ |
| 6277 |
!*** ./node_modules/raven-js/src/utils.js ***! |
| 6278 |
\********************************************/ |
| 6279 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 6280 |
|
| 6281 |
var _window = |
| 6282 |
typeof window !== 'undefined' |
| 6283 |
? window |
| 6284 |
: typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {}; |
| 6285 |
|
| 6286 |
function isObject(what) { |
| 6287 |
return typeof what === 'object' && what !== null; |
| 6288 |
} |
| 6289 |
|
| 6290 |
// Yanked from https://git.io/vS8DV re-used under CC0 |
| 6291 |
// with some tiny modifications |
| 6292 |
function isError(value) { |
| 6293 |
switch ({}.toString.call(value)) { |
| 6294 |
case '[object Error]': |
| 6295 |
return true; |
| 6296 |
case '[object Exception]': |
| 6297 |
return true; |
| 6298 |
case '[object DOMException]': |
| 6299 |
return true; |
| 6300 |
default: |
| 6301 |
return value instanceof Error; |
| 6302 |
} |
| 6303 |
} |
| 6304 |
|
| 6305 |
function isErrorEvent(value) { |
| 6306 |
return supportsErrorEvent() && {}.toString.call(value) === '[object ErrorEvent]'; |
| 6307 |
} |
| 6308 |
|
| 6309 |
function isUndefined(what) { |
| 6310 |
return what === void 0; |
| 6311 |
} |
| 6312 |
|
| 6313 |
function isFunction(what) { |
| 6314 |
return typeof what === 'function'; |
| 6315 |
} |
| 6316 |
|
| 6317 |
function isString(what) { |
| 6318 |
return Object.prototype.toString.call(what) === '[object String]'; |
| 6319 |
} |
| 6320 |
|
| 6321 |
function isEmptyObject(what) { |
| 6322 |
for (var _ in what) return false; // eslint-disable-line guard-for-in, no-unused-vars |
| 6323 |
return true; |
| 6324 |
} |
| 6325 |
|
| 6326 |
function supportsErrorEvent() { |
| 6327 |
try { |
| 6328 |
new ErrorEvent(''); // eslint-disable-line no-new |
| 6329 |
return true; |
| 6330 |
} catch (e) { |
| 6331 |
return false; |
| 6332 |
} |
| 6333 |
} |
| 6334 |
|
| 6335 |
function wrappedCallback(callback) { |
| 6336 |
function dataCallback(data, original) { |
| 6337 |
var normalizedData = callback(data) || data; |
| 6338 |
if (original) { |
| 6339 |
return original(normalizedData) || normalizedData; |
| 6340 |
} |
| 6341 |
return normalizedData; |
| 6342 |
} |
| 6343 |
|
| 6344 |
return dataCallback; |
| 6345 |
} |
| 6346 |
|
| 6347 |
function each(obj, callback) { |
| 6348 |
var i, j; |
| 6349 |
|
| 6350 |
if (isUndefined(obj.length)) { |
| 6351 |
for (i in obj) { |
| 6352 |
if (hasKey(obj, i)) { |
| 6353 |
callback.call(null, i, obj[i]); |
| 6354 |
} |
| 6355 |
} |
| 6356 |
} else { |
| 6357 |
j = obj.length; |
| 6358 |
if (j) { |
| 6359 |
for (i = 0; i < j; i++) { |
| 6360 |
callback.call(null, i, obj[i]); |
| 6361 |
} |
| 6362 |
} |
| 6363 |
} |
| 6364 |
} |
| 6365 |
|
| 6366 |
function objectMerge(obj1, obj2) { |
| 6367 |
if (!obj2) { |
| 6368 |
return obj1; |
| 6369 |
} |
| 6370 |
each(obj2, function(key, value) { |
| 6371 |
obj1[key] = value; |
| 6372 |
}); |
| 6373 |
return obj1; |
| 6374 |
} |
| 6375 |
|
| 6376 |
/** |
| 6377 |
* This function is only used for react-native. |
| 6378 |
* react-native freezes object that have already been sent over the |
| 6379 |
* js bridge. We need this function in order to check if the object is frozen. |
| 6380 |
* So it's ok that objectFrozen returns false if Object.isFrozen is not |
| 6381 |
* supported because it's not relevant for other "platforms". See related issue: |
| 6382 |
* https://github.com/getsentry/react-native-sentry/issues/57 |
| 6383 |
*/ |
| 6384 |
function objectFrozen(obj) { |
| 6385 |
if (!Object.isFrozen) { |
| 6386 |
return false; |
| 6387 |
} |
| 6388 |
return Object.isFrozen(obj); |
| 6389 |
} |
| 6390 |
|
| 6391 |
function truncate(str, max) { |
| 6392 |
return !max || str.length <= max ? str : str.substr(0, max) + '\u2026'; |
| 6393 |
} |
| 6394 |
|
| 6395 |
/** |
| 6396 |
* hasKey, a better form of hasOwnProperty |
| 6397 |
* Example: hasKey(MainHostObject, property) === true/false |
| 6398 |
* |
| 6399 |
* @param {Object} host object to check property |
| 6400 |
* @param {string} key to check |
| 6401 |
*/ |
| 6402 |
function hasKey(object, key) { |
| 6403 |
return Object.prototype.hasOwnProperty.call(object, key); |
| 6404 |
} |
| 6405 |
|
| 6406 |
function joinRegExp(patterns) { |
| 6407 |
// Combine an array of regular expressions and strings into one large regexp |
| 6408 |
// Be mad. |
| 6409 |
var sources = [], |
| 6410 |
i = 0, |
| 6411 |
len = patterns.length, |
| 6412 |
pattern; |
| 6413 |
|
| 6414 |
for (; i < len; i++) { |
| 6415 |
pattern = patterns[i]; |
| 6416 |
if (isString(pattern)) { |
| 6417 |
// If it's a string, we need to escape it |
| 6418 |
// Taken from: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions |
| 6419 |
sources.push(pattern.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, '\\$1')); |
| 6420 |
} else if (pattern && pattern.source) { |
| 6421 |
// If it's a regexp already, we want to extract the source |
| 6422 |
sources.push(pattern.source); |
| 6423 |
} |
| 6424 |
// Intentionally skip other cases |
| 6425 |
} |
| 6426 |
return new RegExp(sources.join('|'), 'i'); |
| 6427 |
} |
| 6428 |
|
| 6429 |
function urlencode(o) { |
| 6430 |
var pairs = []; |
| 6431 |
each(o, function(key, value) { |
| 6432 |
pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(value)); |
| 6433 |
}); |
| 6434 |
return pairs.join('&'); |
| 6435 |
} |
| 6436 |
|
| 6437 |
// borrowed from https://tools.ietf.org/html/rfc3986#appendix-B |
| 6438 |
// intentionally using regex and not <a/> href parsing trick because React Native and other |
| 6439 |
// environments where DOM might not be available |
| 6440 |
function parseUrl(url) { |
| 6441 |
var match = url.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/); |
| 6442 |
if (!match) return {}; |
| 6443 |
|
| 6444 |
// coerce to undefined values to empty string so we don't get 'undefined' |
| 6445 |
var query = match[6] || ''; |
| 6446 |
var fragment = match[8] || ''; |
| 6447 |
return { |
| 6448 |
protocol: match[2], |
| 6449 |
host: match[4], |
| 6450 |
path: match[5], |
| 6451 |
relative: match[5] + query + fragment // everything minus origin |
| 6452 |
}; |
| 6453 |
} |
| 6454 |
function uuid4() { |
| 6455 |
var crypto = _window.crypto || _window.msCrypto; |
| 6456 |
|
| 6457 |
if (!isUndefined(crypto) && crypto.getRandomValues) { |
| 6458 |
// Use window.crypto API if available |
| 6459 |
// eslint-disable-next-line no-undef |
| 6460 |
var arr = new Uint16Array(8); |
| 6461 |
crypto.getRandomValues(arr); |
| 6462 |
|
| 6463 |
// set 4 in byte 7 |
| 6464 |
arr[3] = (arr[3] & 0xfff) | 0x4000; |
| 6465 |
// set 2 most significant bits of byte 9 to '10' |
| 6466 |
arr[4] = (arr[4] & 0x3fff) | 0x8000; |
| 6467 |
|
| 6468 |
var pad = function(num) { |
| 6469 |
var v = num.toString(16); |
| 6470 |
while (v.length < 4) { |
| 6471 |
v = '0' + v; |
| 6472 |
} |
| 6473 |
return v; |
| 6474 |
}; |
| 6475 |
|
| 6476 |
return ( |
| 6477 |
pad(arr[0]) + |
| 6478 |
pad(arr[1]) + |
| 6479 |
pad(arr[2]) + |
| 6480 |
pad(arr[3]) + |
| 6481 |
pad(arr[4]) + |
| 6482 |
pad(arr[5]) + |
| 6483 |
pad(arr[6]) + |
| 6484 |
pad(arr[7]) |
| 6485 |
); |
| 6486 |
} else { |
| 6487 |
// http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523 |
| 6488 |
return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) { |
| 6489 |
var r = (Math.random() * 16) | 0, |
| 6490 |
v = c === 'x' ? r : (r & 0x3) | 0x8; |
| 6491 |
return v.toString(16); |
| 6492 |
}); |
| 6493 |
} |
| 6494 |
} |
| 6495 |
|
| 6496 |
/** |
| 6497 |
* Given a child DOM element, returns a query-selector statement describing that |
| 6498 |
* and its ancestors |
| 6499 |
* e.g. [HTMLElement] => body > div > input#foo.btn[name=baz] |
| 6500 |
* @param elem |
| 6501 |
* @returns {string} |
| 6502 |
*/ |
| 6503 |
function htmlTreeAsString(elem) { |
| 6504 |
/* eslint no-extra-parens:0*/ |
| 6505 |
var MAX_TRAVERSE_HEIGHT = 5, |
| 6506 |
MAX_OUTPUT_LEN = 80, |
| 6507 |
out = [], |
| 6508 |
height = 0, |
| 6509 |
len = 0, |
| 6510 |
separator = ' > ', |
| 6511 |
sepLength = separator.length, |
| 6512 |
nextStr; |
| 6513 |
|
| 6514 |
while (elem && height++ < MAX_TRAVERSE_HEIGHT) { |
| 6515 |
nextStr = htmlElementAsString(elem); |
| 6516 |
// bail out if |
| 6517 |
// - nextStr is the 'html' element |
| 6518 |
// - the length of the string that would be created exceeds MAX_OUTPUT_LEN |
| 6519 |
// (ignore this limit if we are on the first iteration) |
| 6520 |
if ( |
| 6521 |
nextStr === 'html' || |
| 6522 |
(height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN) |
| 6523 |
) { |
| 6524 |
break; |
| 6525 |
} |
| 6526 |
|
| 6527 |
out.push(nextStr); |
| 6528 |
|
| 6529 |
len += nextStr.length; |
| 6530 |
elem = elem.parentNode; |
| 6531 |
} |
| 6532 |
|
| 6533 |
return out.reverse().join(separator); |
| 6534 |
} |
| 6535 |
|
| 6536 |
/** |
| 6537 |
* Returns a simple, query-selector representation of a DOM element |
| 6538 |
* e.g. [HTMLElement] => input#foo.btn[name=baz] |
| 6539 |
* @param HTMLElement |
| 6540 |
* @returns {string} |
| 6541 |
*/ |
| 6542 |
function htmlElementAsString(elem) { |
| 6543 |
var out = [], |
| 6544 |
className, |
| 6545 |
classes, |
| 6546 |
key, |
| 6547 |
attr, |
| 6548 |
i; |
| 6549 |
|
| 6550 |
if (!elem || !elem.tagName) { |
| 6551 |
return ''; |
| 6552 |
} |
| 6553 |
|
| 6554 |
out.push(elem.tagName.toLowerCase()); |
| 6555 |
if (elem.id) { |
| 6556 |
out.push('#' + elem.id); |
| 6557 |
} |
| 6558 |
|
| 6559 |
className = elem.className; |
| 6560 |
if (className && isString(className)) { |
| 6561 |
classes = className.split(/\s+/); |
| 6562 |
for (i = 0; i < classes.length; i++) { |
| 6563 |
out.push('.' + classes[i]); |
| 6564 |
} |
| 6565 |
} |
| 6566 |
var attrWhitelist = ['type', 'name', 'title', 'alt']; |
| 6567 |
for (i = 0; i < attrWhitelist.length; i++) { |
| 6568 |
key = attrWhitelist[i]; |
| 6569 |
attr = elem.getAttribute(key); |
| 6570 |
if (attr) { |
| 6571 |
out.push('[' + key + '="' + attr + '"]'); |
| 6572 |
} |
| 6573 |
} |
| 6574 |
return out.join(''); |
| 6575 |
} |
| 6576 |
|
| 6577 |
/** |
| 6578 |
* Returns true if either a OR b is truthy, but not both |
| 6579 |
*/ |
| 6580 |
function isOnlyOneTruthy(a, b) { |
| 6581 |
return !!(!!a ^ !!b); |
| 6582 |
} |
| 6583 |
|
| 6584 |
/** |
| 6585 |
* Returns true if the two input exception interfaces have the same content |
| 6586 |
*/ |
| 6587 |
function isSameException(ex1, ex2) { |
| 6588 |
if (isOnlyOneTruthy(ex1, ex2)) return false; |
| 6589 |
|
| 6590 |
ex1 = ex1.values[0]; |
| 6591 |
ex2 = ex2.values[0]; |
| 6592 |
|
| 6593 |
if (ex1.type !== ex2.type || ex1.value !== ex2.value) return false; |
| 6594 |
|
| 6595 |
return isSameStacktrace(ex1.stacktrace, ex2.stacktrace); |
| 6596 |
} |
| 6597 |
|
| 6598 |
/** |
| 6599 |
* Returns true if the two input stack trace interfaces have the same content |
| 6600 |
*/ |
| 6601 |
function isSameStacktrace(stack1, stack2) { |
| 6602 |
if (isOnlyOneTruthy(stack1, stack2)) return false; |
| 6603 |
|
| 6604 |
var frames1 = stack1.frames; |
| 6605 |
var frames2 = stack2.frames; |
| 6606 |
|
| 6607 |
// Exit early if frame count differs |
| 6608 |
if (frames1.length !== frames2.length) return false; |
| 6609 |
|
| 6610 |
// Iterate through every frame; bail out if anything differs |
| 6611 |
var a, b; |
| 6612 |
for (var i = 0; i < frames1.length; i++) { |
| 6613 |
a = frames1[i]; |
| 6614 |
b = frames2[i]; |
| 6615 |
if ( |
| 6616 |
a.filename !== b.filename || |
| 6617 |
a.lineno !== b.lineno || |
| 6618 |
a.colno !== b.colno || |
| 6619 |
a['function'] !== b['function'] |
| 6620 |
) |
| 6621 |
return false; |
| 6622 |
} |
| 6623 |
return true; |
| 6624 |
} |
| 6625 |
|
| 6626 |
/** |
| 6627 |
* Polyfill a method |
| 6628 |
* @param obj object e.g. `document` |
| 6629 |
* @param name method name present on object e.g. `addEventListener` |
| 6630 |
* @param replacement replacement function |
| 6631 |
* @param track {optional} record instrumentation to an array |
| 6632 |
*/ |
| 6633 |
function fill(obj, name, replacement, track) { |
| 6634 |
var orig = obj[name]; |
| 6635 |
obj[name] = replacement(orig); |
| 6636 |
if (track) { |
| 6637 |
track.push([obj, name, orig]); |
| 6638 |
} |
| 6639 |
} |
| 6640 |
|
| 6641 |
module.exports = { |
| 6642 |
isObject: isObject, |
| 6643 |
isError: isError, |
| 6644 |
isErrorEvent: isErrorEvent, |
| 6645 |
isUndefined: isUndefined, |
| 6646 |
isFunction: isFunction, |
| 6647 |
isString: isString, |
| 6648 |
isEmptyObject: isEmptyObject, |
| 6649 |
supportsErrorEvent: supportsErrorEvent, |
| 6650 |
wrappedCallback: wrappedCallback, |
| 6651 |
each: each, |
| 6652 |
objectMerge: objectMerge, |
| 6653 |
truncate: truncate, |
| 6654 |
objectFrozen: objectFrozen, |
| 6655 |
hasKey: hasKey, |
| 6656 |
joinRegExp: joinRegExp, |
| 6657 |
urlencode: urlencode, |
| 6658 |
uuid4: uuid4, |
| 6659 |
htmlTreeAsString: htmlTreeAsString, |
| 6660 |
htmlElementAsString: htmlElementAsString, |
| 6661 |
isSameException: isSameException, |
| 6662 |
isSameStacktrace: isSameStacktrace, |
| 6663 |
parseUrl: parseUrl, |
| 6664 |
fill: fill |
| 6665 |
}; |
| 6666 |
|
| 6667 |
|
| 6668 |
/***/ }), |
| 6669 |
|
| 6670 |
/***/ "./node_modules/raven-js/vendor/TraceKit/tracekit.js": |
| 6671 |
/*!***********************************************************!*\ |
| 6672 |
!*** ./node_modules/raven-js/vendor/TraceKit/tracekit.js ***! |
| 6673 |
\***********************************************************/ |
| 6674 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 6675 |
|
| 6676 |
var utils = __webpack_require__(/*! ../../src/utils */ "./node_modules/raven-js/src/utils.js"); |
| 6677 |
|
| 6678 |
/* |
| 6679 |
TraceKit - Cross brower stack traces |
| 6680 |
|
| 6681 |
This was originally forked from github.com/occ/TraceKit, but has since been |
| 6682 |
largely re-written and is now maintained as part of raven-js. Tests for |
| 6683 |
this are in test/vendor. |
| 6684 |
|
| 6685 |
MIT license |
| 6686 |
*/ |
| 6687 |
|
| 6688 |
var TraceKit = { |
| 6689 |
collectWindowErrors: true, |
| 6690 |
debug: false |
| 6691 |
}; |
| 6692 |
|
| 6693 |
// This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785) |
| 6694 |
var _window = |
| 6695 |
typeof window !== 'undefined' |
| 6696 |
? window |
| 6697 |
: typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {}; |
| 6698 |
|
| 6699 |
// global reference to slice |
| 6700 |
var _slice = [].slice; |
| 6701 |
var UNKNOWN_FUNCTION = '?'; |
| 6702 |
|
| 6703 |
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Error_types |
| 6704 |
var ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/; |
| 6705 |
|
| 6706 |
function getLocationHref() { |
| 6707 |
if (typeof document === 'undefined' || document.location == null) return ''; |
| 6708 |
|
| 6709 |
return document.location.href; |
| 6710 |
} |
| 6711 |
|
| 6712 |
/** |
| 6713 |
* TraceKit.report: cross-browser processing of unhandled exceptions |
| 6714 |
* |
| 6715 |
* Syntax: |
| 6716 |
* TraceKit.report.subscribe(function(stackInfo) { ... }) |
| 6717 |
* TraceKit.report.unsubscribe(function(stackInfo) { ... }) |
| 6718 |
* TraceKit.report(exception) |
| 6719 |
* try { ...code... } catch(ex) { TraceKit.report(ex); } |
| 6720 |
* |
| 6721 |
* Supports: |
| 6722 |
* - Firefox: full stack trace with line numbers, plus column number |
| 6723 |
* on top frame; column number is not guaranteed |
| 6724 |
* - Opera: full stack trace with line and column numbers |
| 6725 |
* - Chrome: full stack trace with line and column numbers |
| 6726 |
* - Safari: line and column number for the top frame only; some frames |
| 6727 |
* may be missing, and column number is not guaranteed |
| 6728 |
* - IE: line and column number for the top frame only; some frames |
| 6729 |
* may be missing, and column number is not guaranteed |
| 6730 |
* |
| 6731 |
* In theory, TraceKit should work on all of the following versions: |
| 6732 |
* - IE5.5+ (only 8.0 tested) |
| 6733 |
* - Firefox 0.9+ (only 3.5+ tested) |
| 6734 |
* - Opera 7+ (only 10.50 tested; versions 9 and earlier may require |
| 6735 |
* Exceptions Have Stacktrace to be enabled in opera:config) |
| 6736 |
* - Safari 3+ (only 4+ tested) |
| 6737 |
* - Chrome 1+ (only 5+ tested) |
| 6738 |
* - Konqueror 3.5+ (untested) |
| 6739 |
* |
| 6740 |
* Requires TraceKit.computeStackTrace. |
| 6741 |
* |
| 6742 |
* Tries to catch all unhandled exceptions and report them to the |
| 6743 |
* subscribed handlers. Please note that TraceKit.report will rethrow the |
| 6744 |
* exception. This is REQUIRED in order to get a useful stack trace in IE. |
| 6745 |
* If the exception does not reach the top of the browser, you will only |
| 6746 |
* get a stack trace from the point where TraceKit.report was called. |
| 6747 |
* |
| 6748 |
* Handlers receive a stackInfo object as described in the |
| 6749 |
* TraceKit.computeStackTrace docs. |
| 6750 |
*/ |
| 6751 |
TraceKit.report = (function reportModuleWrapper() { |
| 6752 |
var handlers = [], |
| 6753 |
lastArgs = null, |
| 6754 |
lastException = null, |
| 6755 |
lastExceptionStack = null; |
| 6756 |
|
| 6757 |
/** |
| 6758 |
* Add a crash handler. |
| 6759 |
* @param {Function} handler |
| 6760 |
*/ |
| 6761 |
function subscribe(handler) { |
| 6762 |
installGlobalHandler(); |
| 6763 |
handlers.push(handler); |
| 6764 |
} |
| 6765 |
|
| 6766 |
/** |
| 6767 |
* Remove a crash handler. |
| 6768 |
* @param {Function} handler |
| 6769 |
*/ |
| 6770 |
function unsubscribe(handler) { |
| 6771 |
for (var i = handlers.length - 1; i >= 0; --i) { |
| 6772 |
if (handlers[i] === handler) { |
| 6773 |
handlers.splice(i, 1); |
| 6774 |
} |
| 6775 |
} |
| 6776 |
} |
| 6777 |
|
| 6778 |
/** |
| 6779 |
* Remove all crash handlers. |
| 6780 |
*/ |
| 6781 |
function unsubscribeAll() { |
| 6782 |
uninstallGlobalHandler(); |
| 6783 |
handlers = []; |
| 6784 |
} |
| 6785 |
|
| 6786 |
/** |
| 6787 |
* Dispatch stack information to all handlers. |
| 6788 |
* @param {Object.<string, *>} stack |
| 6789 |
*/ |
| 6790 |
function notifyHandlers(stack, isWindowError) { |
| 6791 |
var exception = null; |
| 6792 |
if (isWindowError && !TraceKit.collectWindowErrors) { |
| 6793 |
return; |
| 6794 |
} |
| 6795 |
for (var i in handlers) { |
| 6796 |
if (handlers.hasOwnProperty(i)) { |
| 6797 |
try { |
| 6798 |
handlers[i].apply(null, [stack].concat(_slice.call(arguments, 2))); |
| 6799 |
} catch (inner) { |
| 6800 |
exception = inner; |
| 6801 |
} |
| 6802 |
} |
| 6803 |
} |
| 6804 |
|
| 6805 |
if (exception) { |
| 6806 |
throw exception; |
| 6807 |
} |
| 6808 |
} |
| 6809 |
|
| 6810 |
var _oldOnerrorHandler, _onErrorHandlerInstalled; |
| 6811 |
|
| 6812 |
/** |
| 6813 |
* Ensures all global unhandled exceptions are recorded. |
| 6814 |
* Supported by Gecko and IE. |
| 6815 |
* @param {string} message Error message. |
| 6816 |
* @param {string} url URL of script that generated the exception. |
| 6817 |
* @param {(number|string)} lineNo The line number at which the error |
| 6818 |
* occurred. |
| 6819 |
* @param {?(number|string)} colNo The column number at which the error |
| 6820 |
* occurred. |
| 6821 |
* @param {?Error} ex The actual Error object. |
| 6822 |
*/ |
| 6823 |
function traceKitWindowOnError(message, url, lineNo, colNo, ex) { |
| 6824 |
var stack = null; |
| 6825 |
|
| 6826 |
if (lastExceptionStack) { |
| 6827 |
TraceKit.computeStackTrace.augmentStackTraceWithInitialElement( |
| 6828 |
lastExceptionStack, |
| 6829 |
url, |
| 6830 |
lineNo, |
| 6831 |
message |
| 6832 |
); |
| 6833 |
processLastException(); |
| 6834 |
} else if (ex && utils.isError(ex)) { |
| 6835 |
// non-string `ex` arg; attempt to extract stack trace |
| 6836 |
|
| 6837 |
// New chrome and blink send along a real error object |
| 6838 |
// Let's just report that like a normal error. |
| 6839 |
// See: https://mikewest.org/2013/08/debugging-runtime-errors-with-window-onerror |
| 6840 |
stack = TraceKit.computeStackTrace(ex); |
| 6841 |
notifyHandlers(stack, true); |
| 6842 |
} else { |
| 6843 |
var location = { |
| 6844 |
url: url, |
| 6845 |
line: lineNo, |
| 6846 |
column: colNo |
| 6847 |
}; |
| 6848 |
|
| 6849 |
var name = undefined; |
| 6850 |
var msg = message; // must be new var or will modify original `arguments` |
| 6851 |
var groups; |
| 6852 |
if ({}.toString.call(message) === '[object String]') { |
| 6853 |
var groups = message.match(ERROR_TYPES_RE); |
| 6854 |
if (groups) { |
| 6855 |
name = groups[1]; |
| 6856 |
msg = groups[2]; |
| 6857 |
} |
| 6858 |
} |
| 6859 |
|
| 6860 |
location.func = UNKNOWN_FUNCTION; |
| 6861 |
|
| 6862 |
stack = { |
| 6863 |
name: name, |
| 6864 |
message: msg, |
| 6865 |
url: getLocationHref(), |
| 6866 |
stack: [location] |
| 6867 |
}; |
| 6868 |
notifyHandlers(stack, true); |
| 6869 |
} |
| 6870 |
|
| 6871 |
if (_oldOnerrorHandler) { |
| 6872 |
return _oldOnerrorHandler.apply(this, arguments); |
| 6873 |
} |
| 6874 |
|
| 6875 |
return false; |
| 6876 |
} |
| 6877 |
|
| 6878 |
function installGlobalHandler() { |
| 6879 |
if (_onErrorHandlerInstalled) { |
| 6880 |
return; |
| 6881 |
} |
| 6882 |
_oldOnerrorHandler = _window.onerror; |
| 6883 |
_window.onerror = traceKitWindowOnError; |
| 6884 |
_onErrorHandlerInstalled = true; |
| 6885 |
} |
| 6886 |
|
| 6887 |
function uninstallGlobalHandler() { |
| 6888 |
if (!_onErrorHandlerInstalled) { |
| 6889 |
return; |
| 6890 |
} |
| 6891 |
_window.onerror = _oldOnerrorHandler; |
| 6892 |
_onErrorHandlerInstalled = false; |
| 6893 |
_oldOnerrorHandler = undefined; |
| 6894 |
} |
| 6895 |
|
| 6896 |
function processLastException() { |
| 6897 |
var _lastExceptionStack = lastExceptionStack, |
| 6898 |
_lastArgs = lastArgs; |
| 6899 |
lastArgs = null; |
| 6900 |
lastExceptionStack = null; |
| 6901 |
lastException = null; |
| 6902 |
notifyHandlers.apply(null, [_lastExceptionStack, false].concat(_lastArgs)); |
| 6903 |
} |
| 6904 |
|
| 6905 |
/** |
| 6906 |
* Reports an unhandled Error to TraceKit. |
| 6907 |
* @param {Error} ex |
| 6908 |
* @param {?boolean} rethrow If false, do not re-throw the exception. |
| 6909 |
* Only used for window.onerror to not cause an infinite loop of |
| 6910 |
* rethrowing. |
| 6911 |
*/ |
| 6912 |
function report(ex, rethrow) { |
| 6913 |
var args = _slice.call(arguments, 1); |
| 6914 |
if (lastExceptionStack) { |
| 6915 |
if (lastException === ex) { |
| 6916 |
return; // already caught by an inner catch block, ignore |
| 6917 |
} else { |
| 6918 |
processLastException(); |
| 6919 |
} |
| 6920 |
} |
| 6921 |
|
| 6922 |
var stack = TraceKit.computeStackTrace(ex); |
| 6923 |
lastExceptionStack = stack; |
| 6924 |
lastException = ex; |
| 6925 |
lastArgs = args; |
| 6926 |
|
| 6927 |
// If the stack trace is incomplete, wait for 2 seconds for |
| 6928 |
// slow slow IE to see if onerror occurs or not before reporting |
| 6929 |
// this exception; otherwise, we will end up with an incomplete |
| 6930 |
// stack trace |
| 6931 |
setTimeout(function() { |
| 6932 |
if (lastException === ex) { |
| 6933 |
processLastException(); |
| 6934 |
} |
| 6935 |
}, stack.incomplete ? 2000 : 0); |
| 6936 |
|
| 6937 |
if (rethrow !== false) { |
| 6938 |
throw ex; // re-throw to propagate to the top level (and cause window.onerror) |
| 6939 |
} |
| 6940 |
} |
| 6941 |
|
| 6942 |
report.subscribe = subscribe; |
| 6943 |
report.unsubscribe = unsubscribe; |
| 6944 |
report.uninstall = unsubscribeAll; |
| 6945 |
return report; |
| 6946 |
})(); |
| 6947 |
|
| 6948 |
/** |
| 6949 |
* TraceKit.computeStackTrace: cross-browser stack traces in JavaScript |
| 6950 |
* |
| 6951 |
* Syntax: |
| 6952 |
* s = TraceKit.computeStackTrace(exception) // consider using TraceKit.report instead (see below) |
| 6953 |
* Returns: |
| 6954 |
* s.name - exception name |
| 6955 |
* s.message - exception message |
| 6956 |
* s.stack[i].url - JavaScript or HTML file URL |
| 6957 |
* s.stack[i].func - function name, or empty for anonymous functions (if guessing did not work) |
| 6958 |
* s.stack[i].args - arguments passed to the function, if known |
| 6959 |
* s.stack[i].line - line number, if known |
| 6960 |
* s.stack[i].column - column number, if known |
| 6961 |
* |
| 6962 |
* Supports: |
| 6963 |
* - Firefox: full stack trace with line numbers and unreliable column |
| 6964 |
* number on top frame |
| 6965 |
* - Opera 10: full stack trace with line and column numbers |
| 6966 |
* - Opera 9-: full stack trace with line numbers |
| 6967 |
* - Chrome: full stack trace with line and column numbers |
| 6968 |
* - Safari: line and column number for the topmost stacktrace element |
| 6969 |
* only |
| 6970 |
* - IE: no line numbers whatsoever |
| 6971 |
* |
| 6972 |
* Tries to guess names of anonymous functions by looking for assignments |
| 6973 |
* in the source code. In IE and Safari, we have to guess source file names |
| 6974 |
* by searching for function bodies inside all page scripts. This will not |
| 6975 |
* work for scripts that are loaded cross-domain. |
| 6976 |
* Here be dragons: some function names may be guessed incorrectly, and |
| 6977 |
* duplicate functions may be mismatched. |
| 6978 |
* |
| 6979 |
* TraceKit.computeStackTrace should only be used for tracing purposes. |
| 6980 |
* Logging of unhandled exceptions should be done with TraceKit.report, |
| 6981 |
* which builds on top of TraceKit.computeStackTrace and provides better |
| 6982 |
* IE support by utilizing the window.onerror event to retrieve information |
| 6983 |
* about the top of the stack. |
| 6984 |
* |
| 6985 |
* Note: In IE and Safari, no stack trace is recorded on the Error object, |
| 6986 |
* so computeStackTrace instead walks its *own* chain of callers. |
| 6987 |
* This means that: |
| 6988 |
* * in Safari, some methods may be missing from the stack trace; |
| 6989 |
* * in IE, the topmost function in the stack trace will always be the |
| 6990 |
* caller of computeStackTrace. |
| 6991 |
* |
| 6992 |
* This is okay for tracing (because you are likely to be calling |
| 6993 |
* computeStackTrace from the function you want to be the topmost element |
| 6994 |
* of the stack trace anyway), but not okay for logging unhandled |
| 6995 |
* exceptions (because your catch block will likely be far away from the |
| 6996 |
* inner function that actually caused the exception). |
| 6997 |
* |
| 6998 |
*/ |
| 6999 |
TraceKit.computeStackTrace = (function computeStackTraceWrapper() { |
| 7000 |
// Contents of Exception in various browsers. |
| 7001 |
// |
| 7002 |
// SAFARI: |
| 7003 |
// ex.message = Can't find variable: qq |
| 7004 |
// ex.line = 59 |
| 7005 |
// ex.sourceId = 580238192 |
| 7006 |
// ex.sourceURL = http://... |
| 7007 |
// ex.expressionBeginOffset = 96 |
| 7008 |
// ex.expressionCaretOffset = 98 |
| 7009 |
// ex.expressionEndOffset = 98 |
| 7010 |
// ex.name = ReferenceError |
| 7011 |
// |
| 7012 |
// FIREFOX: |
| 7013 |
// ex.message = qq is not defined |
| 7014 |
// ex.fileName = http://... |
| 7015 |
// ex.lineNumber = 59 |
| 7016 |
// ex.columnNumber = 69 |
| 7017 |
// ex.stack = ...stack trace... (see the example below) |
| 7018 |
// ex.name = ReferenceError |
| 7019 |
// |
| 7020 |
// CHROME: |
| 7021 |
// ex.message = qq is not defined |
| 7022 |
// ex.name = ReferenceError |
| 7023 |
// ex.type = not_defined |
| 7024 |
// ex.arguments = ['aa'] |
| 7025 |
// ex.stack = ...stack trace... |
| 7026 |
// |
| 7027 |
// INTERNET EXPLORER: |
| 7028 |
// ex.message = ... |
| 7029 |
// ex.name = ReferenceError |
| 7030 |
// |
| 7031 |
// OPERA: |
| 7032 |
// ex.message = ...message... (see the example below) |
| 7033 |
// ex.name = ReferenceError |
| 7034 |
// ex.opera#sourceloc = 11 (pretty much useless, duplicates the info in ex.message) |
| 7035 |
// ex.stacktrace = n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace' |
| 7036 |
|
| 7037 |
/** |
| 7038 |
* Computes stack trace information from the stack property. |
| 7039 |
* Chrome and Gecko use this property. |
| 7040 |
* @param {Error} ex |
| 7041 |
* @return {?Object.<string, *>} Stack trace information. |
| 7042 |
*/ |
| 7043 |
function computeStackTraceFromStackProp(ex) { |
| 7044 |
if (typeof ex.stack === 'undefined' || !ex.stack) return; |
| 7045 |
|
| 7046 |
var chrome = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|[a-z]:|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i, |
| 7047 |
gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i, |
| 7048 |
winjs = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i, |
| 7049 |
// Used to additionally parse URL/line/column from eval frames |
| 7050 |
geckoEval = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i, |
| 7051 |
chromeEval = /\((\S*)(?::(\d+))(?::(\d+))\)/, |
| 7052 |
lines = ex.stack.split('\n'), |
| 7053 |
stack = [], |
| 7054 |
submatch, |
| 7055 |
parts, |
| 7056 |
element, |
| 7057 |
reference = /^(.*) is undefined$/.exec(ex.message); |
| 7058 |
|
| 7059 |
for (var i = 0, j = lines.length; i < j; ++i) { |
| 7060 |
if ((parts = chrome.exec(lines[i]))) { |
| 7061 |
var isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line |
| 7062 |
var isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line |
| 7063 |
if (isEval && (submatch = chromeEval.exec(parts[2]))) { |
| 7064 |
// throw out eval line/column and use top-most line/column number |
| 7065 |
parts[2] = submatch[1]; // url |
| 7066 |
parts[3] = submatch[2]; // line |
| 7067 |
parts[4] = submatch[3]; // column |
| 7068 |
} |
| 7069 |
element = { |
| 7070 |
url: !isNative ? parts[2] : null, |
| 7071 |
func: parts[1] || UNKNOWN_FUNCTION, |
| 7072 |
args: isNative ? [parts[2]] : [], |
| 7073 |
line: parts[3] ? +parts[3] : null, |
| 7074 |
column: parts[4] ? +parts[4] : null |
| 7075 |
}; |
| 7076 |
} else if ((parts = winjs.exec(lines[i]))) { |
| 7077 |
element = { |
| 7078 |
url: parts[2], |
| 7079 |
func: parts[1] || UNKNOWN_FUNCTION, |
| 7080 |
args: [], |
| 7081 |
line: +parts[3], |
| 7082 |
column: parts[4] ? +parts[4] : null |
| 7083 |
}; |
| 7084 |
} else if ((parts = gecko.exec(lines[i]))) { |
| 7085 |
var isEval = parts[3] && parts[3].indexOf(' > eval') > -1; |
| 7086 |
if (isEval && (submatch = geckoEval.exec(parts[3]))) { |
| 7087 |
// throw out eval line/column and use top-most line number |
| 7088 |
parts[3] = submatch[1]; |
| 7089 |
parts[4] = submatch[2]; |
| 7090 |
parts[5] = null; // no column when eval |
| 7091 |
} else if (i === 0 && !parts[5] && typeof ex.columnNumber !== 'undefined') { |
| 7092 |
// FireFox uses this awesome columnNumber property for its top frame |
| 7093 |
// Also note, Firefox's column number is 0-based and everything else expects 1-based, |
| 7094 |
// so adding 1 |
| 7095 |
// NOTE: this hack doesn't work if top-most frame is eval |
| 7096 |
stack[0].column = ex.columnNumber + 1; |
| 7097 |
} |
| 7098 |
element = { |
| 7099 |
url: parts[3], |
| 7100 |
func: parts[1] || UNKNOWN_FUNCTION, |
| 7101 |
args: parts[2] ? parts[2].split(',') : [], |
| 7102 |
line: parts[4] ? +parts[4] : null, |
| 7103 |
column: parts[5] ? +parts[5] : null |
| 7104 |
}; |
| 7105 |
} else { |
| 7106 |
continue; |
| 7107 |
} |
| 7108 |
|
| 7109 |
if (!element.func && element.line) { |
| 7110 |
element.func = UNKNOWN_FUNCTION; |
| 7111 |
} |
| 7112 |
|
| 7113 |
stack.push(element); |
| 7114 |
} |
| 7115 |
|
| 7116 |
if (!stack.length) { |
| 7117 |
return null; |
| 7118 |
} |
| 7119 |
|
| 7120 |
return { |
| 7121 |
name: ex.name, |
| 7122 |
message: ex.message, |
| 7123 |
url: getLocationHref(), |
| 7124 |
stack: stack |
| 7125 |
}; |
| 7126 |
} |
| 7127 |
|
| 7128 |
/** |
| 7129 |
* Adds information about the first frame to incomplete stack traces. |
| 7130 |
* Safari and IE require this to get complete data on the first frame. |
| 7131 |
* @param {Object.<string, *>} stackInfo Stack trace information from |
| 7132 |
* one of the compute* methods. |
| 7133 |
* @param {string} url The URL of the script that caused an error. |
| 7134 |
* @param {(number|string)} lineNo The line number of the script that |
| 7135 |
* caused an error. |
| 7136 |
* @param {string=} message The error generated by the browser, which |
| 7137 |
* hopefully contains the name of the object that caused the error. |
| 7138 |
* @return {boolean} Whether or not the stack information was |
| 7139 |
* augmented. |
| 7140 |
*/ |
| 7141 |
function augmentStackTraceWithInitialElement(stackInfo, url, lineNo, message) { |
| 7142 |
var initial = { |
| 7143 |
url: url, |
| 7144 |
line: lineNo |
| 7145 |
}; |
| 7146 |
|
| 7147 |
if (initial.url && initial.line) { |
| 7148 |
stackInfo.incomplete = false; |
| 7149 |
|
| 7150 |
if (!initial.func) { |
| 7151 |
initial.func = UNKNOWN_FUNCTION; |
| 7152 |
} |
| 7153 |
|
| 7154 |
if (stackInfo.stack.length > 0) { |
| 7155 |
if (stackInfo.stack[0].url === initial.url) { |
| 7156 |
if (stackInfo.stack[0].line === initial.line) { |
| 7157 |
return false; // already in stack trace |
| 7158 |
} else if ( |
| 7159 |
!stackInfo.stack[0].line && |
| 7160 |
stackInfo.stack[0].func === initial.func |
| 7161 |
) { |
| 7162 |
stackInfo.stack[0].line = initial.line; |
| 7163 |
return false; |
| 7164 |
} |
| 7165 |
} |
| 7166 |
} |
| 7167 |
|
| 7168 |
stackInfo.stack.unshift(initial); |
| 7169 |
stackInfo.partial = true; |
| 7170 |
return true; |
| 7171 |
} else { |
| 7172 |
stackInfo.incomplete = true; |
| 7173 |
} |
| 7174 |
|
| 7175 |
return false; |
| 7176 |
} |
| 7177 |
|
| 7178 |
/** |
| 7179 |
* Computes stack trace information by walking the arguments.caller |
| 7180 |
* chain at the time the exception occurred. This will cause earlier |
| 7181 |
* frames to be missed but is the only way to get any stack trace in |
| 7182 |
* Safari and IE. The top frame is restored by |
| 7183 |
* {@link augmentStackTraceWithInitialElement}. |
| 7184 |
* @param {Error} ex |
| 7185 |
* @return {?Object.<string, *>} Stack trace information. |
| 7186 |
*/ |
| 7187 |
function computeStackTraceByWalkingCallerChain(ex, depth) { |
| 7188 |
var functionName = /function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i, |
| 7189 |
stack = [], |
| 7190 |
funcs = {}, |
| 7191 |
recursion = false, |
| 7192 |
parts, |
| 7193 |
item, |
| 7194 |
source; |
| 7195 |
|
| 7196 |
for ( |
| 7197 |
var curr = computeStackTraceByWalkingCallerChain.caller; |
| 7198 |
curr && !recursion; |
| 7199 |
curr = curr.caller |
| 7200 |
) { |
| 7201 |
if (curr === computeStackTrace || curr === TraceKit.report) { |
| 7202 |
// console.log('skipping internal function'); |
| 7203 |
continue; |
| 7204 |
} |
| 7205 |
|
| 7206 |
item = { |
| 7207 |
url: null, |
| 7208 |
func: UNKNOWN_FUNCTION, |
| 7209 |
line: null, |
| 7210 |
column: null |
| 7211 |
}; |
| 7212 |
|
| 7213 |
if (curr.name) { |
| 7214 |
item.func = curr.name; |
| 7215 |
} else if ((parts = functionName.exec(curr.toString()))) { |
| 7216 |
item.func = parts[1]; |
| 7217 |
} |
| 7218 |
|
| 7219 |
if (typeof item.func === 'undefined') { |
| 7220 |
try { |
| 7221 |
item.func = parts.input.substring(0, parts.input.indexOf('{')); |
| 7222 |
} catch (e) {} |
| 7223 |
} |
| 7224 |
|
| 7225 |
if (funcs['' + curr]) { |
| 7226 |
recursion = true; |
| 7227 |
} else { |
| 7228 |
funcs['' + curr] = true; |
| 7229 |
} |
| 7230 |
|
| 7231 |
stack.push(item); |
| 7232 |
} |
| 7233 |
|
| 7234 |
if (depth) { |
| 7235 |
// console.log('depth is ' + depth); |
| 7236 |
// console.log('stack is ' + stack.length); |
| 7237 |
stack.splice(0, depth); |
| 7238 |
} |
| 7239 |
|
| 7240 |
var result = { |
| 7241 |
name: ex.name, |
| 7242 |
message: ex.message, |
| 7243 |
url: getLocationHref(), |
| 7244 |
stack: stack |
| 7245 |
}; |
| 7246 |
augmentStackTraceWithInitialElement( |
| 7247 |
result, |
| 7248 |
ex.sourceURL || ex.fileName, |
| 7249 |
ex.line || ex.lineNumber, |
| 7250 |
ex.message || ex.description |
| 7251 |
); |
| 7252 |
return result; |
| 7253 |
} |
| 7254 |
|
| 7255 |
/** |
| 7256 |
* Computes a stack trace for an exception. |
| 7257 |
* @param {Error} ex |
| 7258 |
* @param {(string|number)=} depth |
| 7259 |
*/ |
| 7260 |
function computeStackTrace(ex, depth) { |
| 7261 |
var stack = null; |
| 7262 |
depth = depth == null ? 0 : +depth; |
| 7263 |
|
| 7264 |
try { |
| 7265 |
stack = computeStackTraceFromStackProp(ex); |
| 7266 |
if (stack) { |
| 7267 |
return stack; |
| 7268 |
} |
| 7269 |
} catch (e) { |
| 7270 |
if (TraceKit.debug) { |
| 7271 |
throw e; |
| 7272 |
} |
| 7273 |
} |
| 7274 |
|
| 7275 |
try { |
| 7276 |
stack = computeStackTraceByWalkingCallerChain(ex, depth + 1); |
| 7277 |
if (stack) { |
| 7278 |
return stack; |
| 7279 |
} |
| 7280 |
} catch (e) { |
| 7281 |
if (TraceKit.debug) { |
| 7282 |
throw e; |
| 7283 |
} |
| 7284 |
} |
| 7285 |
return { |
| 7286 |
name: ex.name, |
| 7287 |
message: ex.message, |
| 7288 |
url: getLocationHref() |
| 7289 |
}; |
| 7290 |
} |
| 7291 |
|
| 7292 |
computeStackTrace.augmentStackTraceWithInitialElement = augmentStackTraceWithInitialElement; |
| 7293 |
computeStackTrace.computeStackTraceFromStackProp = computeStackTraceFromStackProp; |
| 7294 |
|
| 7295 |
return computeStackTrace; |
| 7296 |
})(); |
| 7297 |
|
| 7298 |
module.exports = TraceKit; |
| 7299 |
|
| 7300 |
|
| 7301 |
/***/ }), |
| 7302 |
|
| 7303 |
/***/ "./node_modules/raven-js/vendor/json-stringify-safe/stringify.js": |
| 7304 |
/*!***********************************************************************!*\ |
| 7305 |
!*** ./node_modules/raven-js/vendor/json-stringify-safe/stringify.js ***! |
| 7306 |
\***********************************************************************/ |
| 7307 |
/***/ ((module, exports) => { |
| 7308 |
|
| 7309 |
/* |
| 7310 |
json-stringify-safe |
| 7311 |
Like JSON.stringify, but doesn't throw on circular references. |
| 7312 |
|
| 7313 |
Originally forked from https://github.com/isaacs/json-stringify-safe |
| 7314 |
version 5.0.1 on 3/8/2017 and modified to handle Errors serialization |
| 7315 |
and IE8 compatibility. Tests for this are in test/vendor. |
| 7316 |
|
| 7317 |
ISC license: https://github.com/isaacs/json-stringify-safe/blob/master/LICENSE |
| 7318 |
*/ |
| 7319 |
|
| 7320 |
exports = module.exports = stringify; |
| 7321 |
exports.getSerialize = serializer; |
| 7322 |
|
| 7323 |
function indexOf(haystack, needle) { |
| 7324 |
for (var i = 0; i < haystack.length; ++i) { |
| 7325 |
if (haystack[i] === needle) return i; |
| 7326 |
} |
| 7327 |
return -1; |
| 7328 |
} |
| 7329 |
|
| 7330 |
function stringify(obj, replacer, spaces, cycleReplacer) { |
| 7331 |
return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces); |
| 7332 |
} |
| 7333 |
|
| 7334 |
// https://github.com/ftlabs/js-abbreviate/blob/fa709e5f139e7770a71827b1893f22418097fbda/index.js#L95-L106 |
| 7335 |
function stringifyError(value) { |
| 7336 |
var err = { |
| 7337 |
// These properties are implemented as magical getters and don't show up in for in |
| 7338 |
stack: value.stack, |
| 7339 |
message: value.message, |
| 7340 |
name: value.name |
| 7341 |
}; |
| 7342 |
|
| 7343 |
for (var i in value) { |
| 7344 |
if (Object.prototype.hasOwnProperty.call(value, i)) { |
| 7345 |
err[i] = value[i]; |
| 7346 |
} |
| 7347 |
} |
| 7348 |
|
| 7349 |
return err; |
| 7350 |
} |
| 7351 |
|
| 7352 |
function serializer(replacer, cycleReplacer) { |
| 7353 |
var stack = []; |
| 7354 |
var keys = []; |
| 7355 |
|
| 7356 |
if (cycleReplacer == null) { |
| 7357 |
cycleReplacer = function(key, value) { |
| 7358 |
if (stack[0] === value) { |
| 7359 |
return '[Circular ~]'; |
| 7360 |
} |
| 7361 |
return '[Circular ~.' + keys.slice(0, indexOf(stack, value)).join('.') + ']'; |
| 7362 |
}; |
| 7363 |
} |
| 7364 |
|
| 7365 |
return function(key, value) { |
| 7366 |
if (stack.length > 0) { |
| 7367 |
var thisPos = indexOf(stack, this); |
| 7368 |
~thisPos ? stack.splice(thisPos + 1) : stack.push(this); |
| 7369 |
~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key); |
| 7370 |
|
| 7371 |
if (~indexOf(stack, value)) { |
| 7372 |
value = cycleReplacer.call(this, key, value); |
| 7373 |
} |
| 7374 |
} else { |
| 7375 |
stack.push(value); |
| 7376 |
} |
| 7377 |
|
| 7378 |
return replacer == null |
| 7379 |
? value instanceof Error ? stringifyError(value) : value |
| 7380 |
: replacer.call(this, key, value); |
| 7381 |
}; |
| 7382 |
} |
| 7383 |
|
| 7384 |
|
| 7385 |
/***/ }), |
| 7386 |
|
| 7387 |
/***/ "./node_modules/react/cjs/react-jsx-runtime.development.js": |
| 7388 |
/*!*****************************************************************!*\ |
| 7389 |
!*** ./node_modules/react/cjs/react-jsx-runtime.development.js ***! |
| 7390 |
\*****************************************************************/ |
| 7391 |
/***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 7392 |
|
| 7393 |
"use strict"; |
| 7394 |
/** @license React v17.0.2 |
| 7395 |
* react-jsx-runtime.development.js |
| 7396 |
* |
| 7397 |
* Copyright (c) Facebook, Inc. and its affiliates. |
| 7398 |
* |
| 7399 |
* This source code is licensed under the MIT license found in the |
| 7400 |
* LICENSE file in the root directory of this source tree. |
| 7401 |
*/ |
| 7402 |
|
| 7403 |
|
| 7404 |
|
| 7405 |
if (true) { |
| 7406 |
(function() { |
| 7407 |
'use strict'; |
| 7408 |
|
| 7409 |
var React = __webpack_require__(/*! react */ "react"); |
| 7410 |
var _assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js"); |
| 7411 |
|
| 7412 |
// ATTENTION |
| 7413 |
// When adding new symbols to this file, |
| 7414 |
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' |
| 7415 |
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol |
| 7416 |
// nor polyfill, then a plain number is used for performance. |
| 7417 |
var REACT_ELEMENT_TYPE = 0xeac7; |
| 7418 |
var REACT_PORTAL_TYPE = 0xeaca; |
| 7419 |
exports.Fragment = 0xeacb; |
| 7420 |
var REACT_STRICT_MODE_TYPE = 0xeacc; |
| 7421 |
var REACT_PROFILER_TYPE = 0xead2; |
| 7422 |
var REACT_PROVIDER_TYPE = 0xeacd; |
| 7423 |
var REACT_CONTEXT_TYPE = 0xeace; |
| 7424 |
var REACT_FORWARD_REF_TYPE = 0xead0; |
| 7425 |
var REACT_SUSPENSE_TYPE = 0xead1; |
| 7426 |
var REACT_SUSPENSE_LIST_TYPE = 0xead8; |
| 7427 |
var REACT_MEMO_TYPE = 0xead3; |
| 7428 |
var REACT_LAZY_TYPE = 0xead4; |
| 7429 |
var REACT_BLOCK_TYPE = 0xead9; |
| 7430 |
var REACT_SERVER_BLOCK_TYPE = 0xeada; |
| 7431 |
var REACT_FUNDAMENTAL_TYPE = 0xead5; |
| 7432 |
var REACT_SCOPE_TYPE = 0xead7; |
| 7433 |
var REACT_OPAQUE_ID_TYPE = 0xeae0; |
| 7434 |
var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1; |
| 7435 |
var REACT_OFFSCREEN_TYPE = 0xeae2; |
| 7436 |
var REACT_LEGACY_HIDDEN_TYPE = 0xeae3; |
| 7437 |
|
| 7438 |
if (typeof Symbol === 'function' && Symbol.for) { |
| 7439 |
var symbolFor = Symbol.for; |
| 7440 |
REACT_ELEMENT_TYPE = symbolFor('react.element'); |
| 7441 |
REACT_PORTAL_TYPE = symbolFor('react.portal'); |
| 7442 |
exports.Fragment = symbolFor('react.fragment'); |
| 7443 |
REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode'); |
| 7444 |
REACT_PROFILER_TYPE = symbolFor('react.profiler'); |
| 7445 |
REACT_PROVIDER_TYPE = symbolFor('react.provider'); |
| 7446 |
REACT_CONTEXT_TYPE = symbolFor('react.context'); |
| 7447 |
REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref'); |
| 7448 |
REACT_SUSPENSE_TYPE = symbolFor('react.suspense'); |
| 7449 |
REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list'); |
| 7450 |
REACT_MEMO_TYPE = symbolFor('react.memo'); |
| 7451 |
REACT_LAZY_TYPE = symbolFor('react.lazy'); |
| 7452 |
REACT_BLOCK_TYPE = symbolFor('react.block'); |
| 7453 |
REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block'); |
| 7454 |
REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental'); |
| 7455 |
REACT_SCOPE_TYPE = symbolFor('react.scope'); |
| 7456 |
REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id'); |
| 7457 |
REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode'); |
| 7458 |
REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen'); |
| 7459 |
REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden'); |
| 7460 |
} |
| 7461 |
|
| 7462 |
var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; |
| 7463 |
var FAUX_ITERATOR_SYMBOL = '@@iterator'; |
| 7464 |
function getIteratorFn(maybeIterable) { |
| 7465 |
if (maybeIterable === null || typeof maybeIterable !== 'object') { |
| 7466 |
return null; |
| 7467 |
} |
| 7468 |
|
| 7469 |
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; |
| 7470 |
|
| 7471 |
if (typeof maybeIterator === 'function') { |
| 7472 |
return maybeIterator; |
| 7473 |
} |
| 7474 |
|
| 7475 |
return null; |
| 7476 |
} |
| 7477 |
|
| 7478 |
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; |
| 7479 |
|
| 7480 |
function error(format) { |
| 7481 |
{ |
| 7482 |
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { |
| 7483 |
args[_key2 - 1] = arguments[_key2]; |
| 7484 |
} |
| 7485 |
|
| 7486 |
printWarning('error', format, args); |
| 7487 |
} |
| 7488 |
} |
| 7489 |
|
| 7490 |
function printWarning(level, format, args) { |
| 7491 |
// When changing this logic, you might want to also |
| 7492 |
// update consoleWithStackDev.www.js as well. |
| 7493 |
{ |
| 7494 |
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; |
| 7495 |
var stack = ReactDebugCurrentFrame.getStackAddendum(); |
| 7496 |
|
| 7497 |
if (stack !== '') { |
| 7498 |
format += '%s'; |
| 7499 |
args = args.concat([stack]); |
| 7500 |
} |
| 7501 |
|
| 7502 |
var argsWithFormat = args.map(function (item) { |
| 7503 |
return '' + item; |
| 7504 |
}); // Careful: RN currently depends on this prefix |
| 7505 |
|
| 7506 |
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it |
| 7507 |
// breaks IE9: https://github.com/facebook/react/issues/13610 |
| 7508 |
// eslint-disable-next-line react-internal/no-production-logging |
| 7509 |
|
| 7510 |
Function.prototype.apply.call(console[level], console, argsWithFormat); |
| 7511 |
} |
| 7512 |
} |
| 7513 |
|
| 7514 |
// Filter certain DOM attributes (e.g. src, href) if their values are empty strings. |
| 7515 |
|
| 7516 |
var enableScopeAPI = false; // Experimental Create Event Handle API. |
| 7517 |
|
| 7518 |
function isValidElementType(type) { |
| 7519 |
if (typeof type === 'string' || typeof type === 'function') { |
| 7520 |
return true; |
| 7521 |
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). |
| 7522 |
|
| 7523 |
|
| 7524 |
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 ) { |
| 7525 |
return true; |
| 7526 |
} |
| 7527 |
|
| 7528 |
if (typeof type === 'object' && type !== null) { |
| 7529 |
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) { |
| 7530 |
return true; |
| 7531 |
} |
| 7532 |
} |
| 7533 |
|
| 7534 |
return false; |
| 7535 |
} |
| 7536 |
|
| 7537 |
function getWrappedName(outerType, innerType, wrapperName) { |
| 7538 |
var functionName = innerType.displayName || innerType.name || ''; |
| 7539 |
return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); |
| 7540 |
} |
| 7541 |
|
| 7542 |
function getContextName(type) { |
| 7543 |
return type.displayName || 'Context'; |
| 7544 |
} |
| 7545 |
|
| 7546 |
function getComponentName(type) { |
| 7547 |
if (type == null) { |
| 7548 |
// Host root, text node or just invalid type. |
| 7549 |
return null; |
| 7550 |
} |
| 7551 |
|
| 7552 |
{ |
| 7553 |
if (typeof type.tag === 'number') { |
| 7554 |
error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); |
| 7555 |
} |
| 7556 |
} |
| 7557 |
|
| 7558 |
if (typeof type === 'function') { |
| 7559 |
return type.displayName || type.name || null; |
| 7560 |
} |
| 7561 |
|
| 7562 |
if (typeof type === 'string') { |
| 7563 |
return type; |
| 7564 |
} |
| 7565 |
|
| 7566 |
switch (type) { |
| 7567 |
case exports.Fragment: |
| 7568 |
return 'Fragment'; |
| 7569 |
|
| 7570 |
case REACT_PORTAL_TYPE: |
| 7571 |
return 'Portal'; |
| 7572 |
|
| 7573 |
case REACT_PROFILER_TYPE: |
| 7574 |
return 'Profiler'; |
| 7575 |
|
| 7576 |
case REACT_STRICT_MODE_TYPE: |
| 7577 |
return 'StrictMode'; |
| 7578 |
|
| 7579 |
case REACT_SUSPENSE_TYPE: |
| 7580 |
return 'Suspense'; |
| 7581 |
|
| 7582 |
case REACT_SUSPENSE_LIST_TYPE: |
| 7583 |
return 'SuspenseList'; |
| 7584 |
} |
| 7585 |
|
| 7586 |
if (typeof type === 'object') { |
| 7587 |
switch (type.$$typeof) { |
| 7588 |
case REACT_CONTEXT_TYPE: |
| 7589 |
var context = type; |
| 7590 |
return getContextName(context) + '.Consumer'; |
| 7591 |
|
| 7592 |
case REACT_PROVIDER_TYPE: |
| 7593 |
var provider = type; |
| 7594 |
return getContextName(provider._context) + '.Provider'; |
| 7595 |
|
| 7596 |
case REACT_FORWARD_REF_TYPE: |
| 7597 |
return getWrappedName(type, type.render, 'ForwardRef'); |
| 7598 |
|
| 7599 |
case REACT_MEMO_TYPE: |
| 7600 |
return getComponentName(type.type); |
| 7601 |
|
| 7602 |
case REACT_BLOCK_TYPE: |
| 7603 |
return getComponentName(type._render); |
| 7604 |
|
| 7605 |
case REACT_LAZY_TYPE: |
| 7606 |
{ |
| 7607 |
var lazyComponent = type; |
| 7608 |
var payload = lazyComponent._payload; |
| 7609 |
var init = lazyComponent._init; |
| 7610 |
|
| 7611 |
try { |
| 7612 |
return getComponentName(init(payload)); |
| 7613 |
} catch (x) { |
| 7614 |
return null; |
| 7615 |
} |
| 7616 |
} |
| 7617 |
} |
| 7618 |
} |
| 7619 |
|
| 7620 |
return null; |
| 7621 |
} |
| 7622 |
|
| 7623 |
// Helpers to patch console.logs to avoid logging during side-effect free |
| 7624 |
// replaying on render function. This currently only patches the object |
| 7625 |
// lazily which won't cover if the log function was extracted eagerly. |
| 7626 |
// We could also eagerly patch the method. |
| 7627 |
var disabledDepth = 0; |
| 7628 |
var prevLog; |
| 7629 |
var prevInfo; |
| 7630 |
var prevWarn; |
| 7631 |
var prevError; |
| 7632 |
var prevGroup; |
| 7633 |
var prevGroupCollapsed; |
| 7634 |
var prevGroupEnd; |
| 7635 |
|
| 7636 |
function disabledLog() {} |
| 7637 |
|
| 7638 |
disabledLog.__reactDisabledLog = true; |
| 7639 |
function disableLogs() { |
| 7640 |
{ |
| 7641 |
if (disabledDepth === 0) { |
| 7642 |
/* eslint-disable react-internal/no-production-logging */ |
| 7643 |
prevLog = console.log; |
| 7644 |
prevInfo = console.info; |
| 7645 |
prevWarn = console.warn; |
| 7646 |
prevError = console.error; |
| 7647 |
prevGroup = console.group; |
| 7648 |
prevGroupCollapsed = console.groupCollapsed; |
| 7649 |
prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099 |
| 7650 |
|
| 7651 |
var props = { |
| 7652 |
configurable: true, |
| 7653 |
enumerable: true, |
| 7654 |
value: disabledLog, |
| 7655 |
writable: true |
| 7656 |
}; // $FlowFixMe Flow thinks console is immutable. |
| 7657 |
|
| 7658 |
Object.defineProperties(console, { |
| 7659 |
info: props, |
| 7660 |
log: props, |
| 7661 |
warn: props, |
| 7662 |
error: props, |
| 7663 |
group: props, |
| 7664 |
groupCollapsed: props, |
| 7665 |
groupEnd: props |
| 7666 |
}); |
| 7667 |
/* eslint-enable react-internal/no-production-logging */ |
| 7668 |
} |
| 7669 |
|
| 7670 |
disabledDepth++; |
| 7671 |
} |
| 7672 |
} |
| 7673 |
function reenableLogs() { |
| 7674 |
{ |
| 7675 |
disabledDepth--; |
| 7676 |
|
| 7677 |
if (disabledDepth === 0) { |
| 7678 |
/* eslint-disable react-internal/no-production-logging */ |
| 7679 |
var props = { |
| 7680 |
configurable: true, |
| 7681 |
enumerable: true, |
| 7682 |
writable: true |
| 7683 |
}; // $FlowFixMe Flow thinks console is immutable. |
| 7684 |
|
| 7685 |
Object.defineProperties(console, { |
| 7686 |
log: _assign({}, props, { |
| 7687 |
value: prevLog |
| 7688 |
}), |
| 7689 |
info: _assign({}, props, { |
| 7690 |
value: prevInfo |
| 7691 |
}), |
| 7692 |
warn: _assign({}, props, { |
| 7693 |
value: prevWarn |
| 7694 |
}), |
| 7695 |
error: _assign({}, props, { |
| 7696 |
value: prevError |
| 7697 |
}), |
| 7698 |
group: _assign({}, props, { |
| 7699 |
value: prevGroup |
| 7700 |
}), |
| 7701 |
groupCollapsed: _assign({}, props, { |
| 7702 |
value: prevGroupCollapsed |
| 7703 |
}), |
| 7704 |
groupEnd: _assign({}, props, { |
| 7705 |
value: prevGroupEnd |
| 7706 |
}) |
| 7707 |
}); |
| 7708 |
/* eslint-enable react-internal/no-production-logging */ |
| 7709 |
} |
| 7710 |
|
| 7711 |
if (disabledDepth < 0) { |
| 7712 |
error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.'); |
| 7713 |
} |
| 7714 |
} |
| 7715 |
} |
| 7716 |
|
| 7717 |
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; |
| 7718 |
var prefix; |
| 7719 |
function describeBuiltInComponentFrame(name, source, ownerFn) { |
| 7720 |
{ |
| 7721 |
if (prefix === undefined) { |
| 7722 |
// Extract the VM specific prefix used by each line. |
| 7723 |
try { |
| 7724 |
throw Error(); |
| 7725 |
} catch (x) { |
| 7726 |
var match = x.stack.trim().match(/\n( *(at )?)/); |
| 7727 |
prefix = match && match[1] || ''; |
| 7728 |
} |
| 7729 |
} // We use the prefix to ensure our stacks line up with native stack frames. |
| 7730 |
|
| 7731 |
|
| 7732 |
return '\n' + prefix + name; |
| 7733 |
} |
| 7734 |
} |
| 7735 |
var reentry = false; |
| 7736 |
var componentFrameCache; |
| 7737 |
|
| 7738 |
{ |
| 7739 |
var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; |
| 7740 |
componentFrameCache = new PossiblyWeakMap(); |
| 7741 |
} |
| 7742 |
|
| 7743 |
function describeNativeComponentFrame(fn, construct) { |
| 7744 |
// If something asked for a stack inside a fake render, it should get ignored. |
| 7745 |
if (!fn || reentry) { |
| 7746 |
return ''; |
| 7747 |
} |
| 7748 |
|
| 7749 |
{ |
| 7750 |
var frame = componentFrameCache.get(fn); |
| 7751 |
|
| 7752 |
if (frame !== undefined) { |
| 7753 |
return frame; |
| 7754 |
} |
| 7755 |
} |
| 7756 |
|
| 7757 |
var control; |
| 7758 |
reentry = true; |
| 7759 |
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined. |
| 7760 |
|
| 7761 |
Error.prepareStackTrace = undefined; |
| 7762 |
var previousDispatcher; |
| 7763 |
|
| 7764 |
{ |
| 7765 |
previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function |
| 7766 |
// for warnings. |
| 7767 |
|
| 7768 |
ReactCurrentDispatcher.current = null; |
| 7769 |
disableLogs(); |
| 7770 |
} |
| 7771 |
|
| 7772 |
try { |
| 7773 |
// This should throw. |
| 7774 |
if (construct) { |
| 7775 |
// Something should be setting the props in the constructor. |
| 7776 |
var Fake = function () { |
| 7777 |
throw Error(); |
| 7778 |
}; // $FlowFixMe |
| 7779 |
|
| 7780 |
|
| 7781 |
Object.defineProperty(Fake.prototype, 'props', { |
| 7782 |
set: function () { |
| 7783 |
// We use a throwing setter instead of frozen or non-writable props |
| 7784 |
// because that won't throw in a non-strict mode function. |
| 7785 |
throw Error(); |
| 7786 |
} |
| 7787 |
}); |
| 7788 |
|
| 7789 |
if (typeof Reflect === 'object' && Reflect.construct) { |
| 7790 |
// We construct a different control for this case to include any extra |
| 7791 |
// frames added by the construct call. |
| 7792 |
try { |
| 7793 |
Reflect.construct(Fake, []); |
| 7794 |
} catch (x) { |
| 7795 |
control = x; |
| 7796 |
} |
| 7797 |
|
| 7798 |
Reflect.construct(fn, [], Fake); |
| 7799 |
} else { |
| 7800 |
try { |
| 7801 |
Fake.call(); |
| 7802 |
} catch (x) { |
| 7803 |
control = x; |
| 7804 |
} |
| 7805 |
|
| 7806 |
fn.call(Fake.prototype); |
| 7807 |
} |
| 7808 |
} else { |
| 7809 |
try { |
| 7810 |
throw Error(); |
| 7811 |
} catch (x) { |
| 7812 |
control = x; |
| 7813 |
} |
| 7814 |
|
| 7815 |
fn(); |
| 7816 |
} |
| 7817 |
} catch (sample) { |
| 7818 |
// This is inlined manually because closure doesn't do it for us. |
| 7819 |
if (sample && control && typeof sample.stack === 'string') { |
| 7820 |
// This extracts the first frame from the sample that isn't also in the control. |
| 7821 |
// Skipping one frame that we assume is the frame that calls the two. |
| 7822 |
var sampleLines = sample.stack.split('\n'); |
| 7823 |
var controlLines = control.stack.split('\n'); |
| 7824 |
var s = sampleLines.length - 1; |
| 7825 |
var c = controlLines.length - 1; |
| 7826 |
|
| 7827 |
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { |
| 7828 |
// We expect at least one stack frame to be shared. |
| 7829 |
// Typically this will be the root most one. However, stack frames may be |
| 7830 |
// cut off due to maximum stack limits. In this case, one maybe cut off |
| 7831 |
// earlier than the other. We assume that the sample is longer or the same |
| 7832 |
// and there for cut off earlier. So we should find the root most frame in |
| 7833 |
// the sample somewhere in the control. |
| 7834 |
c--; |
| 7835 |
} |
| 7836 |
|
| 7837 |
for (; s >= 1 && c >= 0; s--, c--) { |
| 7838 |
// Next we find the first one that isn't the same which should be the |
| 7839 |
// frame that called our sample function and the control. |
| 7840 |
if (sampleLines[s] !== controlLines[c]) { |
| 7841 |
// In V8, the first line is describing the message but other VMs don't. |
| 7842 |
// If we're about to return the first line, and the control is also on the same |
| 7843 |
// line, that's a pretty good indicator that our sample threw at same line as |
| 7844 |
// the control. I.e. before we entered the sample frame. So we ignore this result. |
| 7845 |
// This can happen if you passed a class to function component, or non-function. |
| 7846 |
if (s !== 1 || c !== 1) { |
| 7847 |
do { |
| 7848 |
s--; |
| 7849 |
c--; // We may still have similar intermediate frames from the construct call. |
| 7850 |
// The next one that isn't the same should be our match though. |
| 7851 |
|
| 7852 |
if (c < 0 || sampleLines[s] !== controlLines[c]) { |
| 7853 |
// V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. |
| 7854 |
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); |
| 7855 |
|
| 7856 |
{ |
| 7857 |
if (typeof fn === 'function') { |
| 7858 |
componentFrameCache.set(fn, _frame); |
| 7859 |
} |
| 7860 |
} // Return the line we found. |
| 7861 |
|
| 7862 |
|
| 7863 |
return _frame; |
| 7864 |
} |
| 7865 |
} while (s >= 1 && c >= 0); |
| 7866 |
} |
| 7867 |
|
| 7868 |
break; |
| 7869 |
} |
| 7870 |
} |
| 7871 |
} |
| 7872 |
} finally { |
| 7873 |
reentry = false; |
| 7874 |
|
| 7875 |
{ |
| 7876 |
ReactCurrentDispatcher.current = previousDispatcher; |
| 7877 |
reenableLogs(); |
| 7878 |
} |
| 7879 |
|
| 7880 |
Error.prepareStackTrace = previousPrepareStackTrace; |
| 7881 |
} // Fallback to just using the name if we couldn't make it throw. |
| 7882 |
|
| 7883 |
|
| 7884 |
var name = fn ? fn.displayName || fn.name : ''; |
| 7885 |
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ''; |
| 7886 |
|
| 7887 |
{ |
| 7888 |
if (typeof fn === 'function') { |
| 7889 |
componentFrameCache.set(fn, syntheticFrame); |
| 7890 |
} |
| 7891 |
} |
| 7892 |
|
| 7893 |
return syntheticFrame; |
| 7894 |
} |
| 7895 |
function describeFunctionComponentFrame(fn, source, ownerFn) { |
| 7896 |
{ |
| 7897 |
return describeNativeComponentFrame(fn, false); |
| 7898 |
} |
| 7899 |
} |
| 7900 |
|
| 7901 |
function shouldConstruct(Component) { |
| 7902 |
var prototype = Component.prototype; |
| 7903 |
return !!(prototype && prototype.isReactComponent); |
| 7904 |
} |
| 7905 |
|
| 7906 |
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { |
| 7907 |
|
| 7908 |
if (type == null) { |
| 7909 |
return ''; |
| 7910 |
} |
| 7911 |
|
| 7912 |
if (typeof type === 'function') { |
| 7913 |
{ |
| 7914 |
return describeNativeComponentFrame(type, shouldConstruct(type)); |
| 7915 |
} |
| 7916 |
} |
| 7917 |
|
| 7918 |
if (typeof type === 'string') { |
| 7919 |
return describeBuiltInComponentFrame(type); |
| 7920 |
} |
| 7921 |
|
| 7922 |
switch (type) { |
| 7923 |
case REACT_SUSPENSE_TYPE: |
| 7924 |
return describeBuiltInComponentFrame('Suspense'); |
| 7925 |
|
| 7926 |
case REACT_SUSPENSE_LIST_TYPE: |
| 7927 |
return describeBuiltInComponentFrame('SuspenseList'); |
| 7928 |
} |
| 7929 |
|
| 7930 |
if (typeof type === 'object') { |
| 7931 |
switch (type.$$typeof) { |
| 7932 |
case REACT_FORWARD_REF_TYPE: |
| 7933 |
return describeFunctionComponentFrame(type.render); |
| 7934 |
|
| 7935 |
case REACT_MEMO_TYPE: |
| 7936 |
// Memo may contain any component type so we recursively resolve it. |
| 7937 |
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); |
| 7938 |
|
| 7939 |
case REACT_BLOCK_TYPE: |
| 7940 |
return describeFunctionComponentFrame(type._render); |
| 7941 |
|
| 7942 |
case REACT_LAZY_TYPE: |
| 7943 |
{ |
| 7944 |
var lazyComponent = type; |
| 7945 |
var payload = lazyComponent._payload; |
| 7946 |
var init = lazyComponent._init; |
| 7947 |
|
| 7948 |
try { |
| 7949 |
// Lazy may contain any component type so we recursively resolve it. |
| 7950 |
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); |
| 7951 |
} catch (x) {} |
| 7952 |
} |
| 7953 |
} |
| 7954 |
} |
| 7955 |
|
| 7956 |
return ''; |
| 7957 |
} |
| 7958 |
|
| 7959 |
var loggedTypeFailures = {}; |
| 7960 |
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; |
| 7961 |
|
| 7962 |
function setCurrentlyValidatingElement(element) { |
| 7963 |
{ |
| 7964 |
if (element) { |
| 7965 |
var owner = element._owner; |
| 7966 |
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); |
| 7967 |
ReactDebugCurrentFrame.setExtraStackFrame(stack); |
| 7968 |
} else { |
| 7969 |
ReactDebugCurrentFrame.setExtraStackFrame(null); |
| 7970 |
} |
| 7971 |
} |
| 7972 |
} |
| 7973 |
|
| 7974 |
function checkPropTypes(typeSpecs, values, location, componentName, element) { |
| 7975 |
{ |
| 7976 |
// $FlowFixMe This is okay but Flow doesn't know it. |
| 7977 |
var has = Function.call.bind(Object.prototype.hasOwnProperty); |
| 7978 |
|
| 7979 |
for (var typeSpecName in typeSpecs) { |
| 7980 |
if (has(typeSpecs, typeSpecName)) { |
| 7981 |
var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to |
| 7982 |
// fail the render phase where it didn't fail before. So we log it. |
| 7983 |
// After these have been cleaned up, we'll let them throw. |
| 7984 |
|
| 7985 |
try { |
| 7986 |
// This is intentionally an invariant that gets caught. It's the same |
| 7987 |
// behavior as without this statement except with a better message. |
| 7988 |
if (typeof typeSpecs[typeSpecName] !== 'function') { |
| 7989 |
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`.'); |
| 7990 |
err.name = 'Invariant Violation'; |
| 7991 |
throw err; |
| 7992 |
} |
| 7993 |
|
| 7994 |
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'); |
| 7995 |
} catch (ex) { |
| 7996 |
error$1 = ex; |
| 7997 |
} |
| 7998 |
|
| 7999 |
if (error$1 && !(error$1 instanceof Error)) { |
| 8000 |
setCurrentlyValidatingElement(element); |
| 8001 |
|
| 8002 |
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); |
| 8003 |
|
| 8004 |
setCurrentlyValidatingElement(null); |
| 8005 |
} |
| 8006 |
|
| 8007 |
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { |
| 8008 |
// Only monitor this failure once because there tends to be a lot of the |
| 8009 |
// same error. |
| 8010 |
loggedTypeFailures[error$1.message] = true; |
| 8011 |
setCurrentlyValidatingElement(element); |
| 8012 |
|
| 8013 |
error('Failed %s type: %s', location, error$1.message); |
| 8014 |
|
| 8015 |
setCurrentlyValidatingElement(null); |
| 8016 |
} |
| 8017 |
} |
| 8018 |
} |
| 8019 |
} |
| 8020 |
} |
| 8021 |
|
| 8022 |
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; |
| 8023 |
var hasOwnProperty = Object.prototype.hasOwnProperty; |
| 8024 |
var RESERVED_PROPS = { |
| 8025 |
key: true, |
| 8026 |
ref: true, |
| 8027 |
__self: true, |
| 8028 |
__source: true |
| 8029 |
}; |
| 8030 |
var specialPropKeyWarningShown; |
| 8031 |
var specialPropRefWarningShown; |
| 8032 |
var didWarnAboutStringRefs; |
| 8033 |
|
| 8034 |
{ |
| 8035 |
didWarnAboutStringRefs = {}; |
| 8036 |
} |
| 8037 |
|
| 8038 |
function hasValidRef(config) { |
| 8039 |
{ |
| 8040 |
if (hasOwnProperty.call(config, 'ref')) { |
| 8041 |
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; |
| 8042 |
|
| 8043 |
if (getter && getter.isReactWarning) { |
| 8044 |
return false; |
| 8045 |
} |
| 8046 |
} |
| 8047 |
} |
| 8048 |
|
| 8049 |
return config.ref !== undefined; |
| 8050 |
} |
| 8051 |
|
| 8052 |
function hasValidKey(config) { |
| 8053 |
{ |
| 8054 |
if (hasOwnProperty.call(config, 'key')) { |
| 8055 |
var getter = Object.getOwnPropertyDescriptor(config, 'key').get; |
| 8056 |
|
| 8057 |
if (getter && getter.isReactWarning) { |
| 8058 |
return false; |
| 8059 |
} |
| 8060 |
} |
| 8061 |
} |
| 8062 |
|
| 8063 |
return config.key !== undefined; |
| 8064 |
} |
| 8065 |
|
| 8066 |
function warnIfStringRefCannotBeAutoConverted(config, self) { |
| 8067 |
{ |
| 8068 |
if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) { |
| 8069 |
var componentName = getComponentName(ReactCurrentOwner.current.type); |
| 8070 |
|
| 8071 |
if (!didWarnAboutStringRefs[componentName]) { |
| 8072 |
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); |
| 8073 |
|
| 8074 |
didWarnAboutStringRefs[componentName] = true; |
| 8075 |
} |
| 8076 |
} |
| 8077 |
} |
| 8078 |
} |
| 8079 |
|
| 8080 |
function defineKeyPropWarningGetter(props, displayName) { |
| 8081 |
{ |
| 8082 |
var warnAboutAccessingKey = function () { |
| 8083 |
if (!specialPropKeyWarningShown) { |
| 8084 |
specialPropKeyWarningShown = true; |
| 8085 |
|
| 8086 |
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); |
| 8087 |
} |
| 8088 |
}; |
| 8089 |
|
| 8090 |
warnAboutAccessingKey.isReactWarning = true; |
| 8091 |
Object.defineProperty(props, 'key', { |
| 8092 |
get: warnAboutAccessingKey, |
| 8093 |
configurable: true |
| 8094 |
}); |
| 8095 |
} |
| 8096 |
} |
| 8097 |
|
| 8098 |
function defineRefPropWarningGetter(props, displayName) { |
| 8099 |
{ |
| 8100 |
var warnAboutAccessingRef = function () { |
| 8101 |
if (!specialPropRefWarningShown) { |
| 8102 |
specialPropRefWarningShown = true; |
| 8103 |
|
| 8104 |
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); |
| 8105 |
} |
| 8106 |
}; |
| 8107 |
|
| 8108 |
warnAboutAccessingRef.isReactWarning = true; |
| 8109 |
Object.defineProperty(props, 'ref', { |
| 8110 |
get: warnAboutAccessingRef, |
| 8111 |
configurable: true |
| 8112 |
}); |
| 8113 |
} |
| 8114 |
} |
| 8115 |
/** |
| 8116 |
* Factory method to create a new React element. This no longer adheres to |
| 8117 |
* the class pattern, so do not use new to call it. Also, instanceof check |
| 8118 |
* will not work. Instead test $$typeof field against Symbol.for('react.element') to check |
| 8119 |
* if something is a React Element. |
| 8120 |
* |
| 8121 |
* @param {*} type |
| 8122 |
* @param {*} props |
| 8123 |
* @param {*} key |
| 8124 |
* @param {string|object} ref |
| 8125 |
* @param {*} owner |
| 8126 |
* @param {*} self A *temporary* helper to detect places where `this` is |
| 8127 |
* different from the `owner` when React.createElement is called, so that we |
| 8128 |
* can warn. We want to get rid of owner and replace string `ref`s with arrow |
| 8129 |
* functions, and as long as `this` and owner are the same, there will be no |
| 8130 |
* change in behavior. |
| 8131 |
* @param {*} source An annotation object (added by a transpiler or otherwise) |
| 8132 |
* indicating filename, line number, and/or other information. |
| 8133 |
* @internal |
| 8134 |
*/ |
| 8135 |
|
| 8136 |
|
| 8137 |
var ReactElement = function (type, key, ref, self, source, owner, props) { |
| 8138 |
var element = { |
| 8139 |
// This tag allows us to uniquely identify this as a React Element |
| 8140 |
$$typeof: REACT_ELEMENT_TYPE, |
| 8141 |
// Built-in properties that belong on the element |
| 8142 |
type: type, |
| 8143 |
key: key, |
| 8144 |
ref: ref, |
| 8145 |
props: props, |
| 8146 |
// Record the component responsible for creating this element. |
| 8147 |
_owner: owner |
| 8148 |
}; |
| 8149 |
|
| 8150 |
{ |
| 8151 |
// The validation flag is currently mutative. We put it on |
| 8152 |
// an external backing store so that we can freeze the whole object. |
| 8153 |
// This can be replaced with a WeakMap once they are implemented in |
| 8154 |
// commonly used development environments. |
| 8155 |
element._store = {}; // To make comparing ReactElements easier for testing purposes, we make |
| 8156 |
// the validation flag non-enumerable (where possible, which should |
| 8157 |
// include every environment we run tests in), so the test framework |
| 8158 |
// ignores it. |
| 8159 |
|
| 8160 |
Object.defineProperty(element._store, 'validated', { |
| 8161 |
configurable: false, |
| 8162 |
enumerable: false, |
| 8163 |
writable: true, |
| 8164 |
value: false |
| 8165 |
}); // self and source are DEV only properties. |
| 8166 |
|
| 8167 |
Object.defineProperty(element, '_self', { |
| 8168 |
configurable: false, |
| 8169 |
enumerable: false, |
| 8170 |
writable: false, |
| 8171 |
value: self |
| 8172 |
}); // Two elements created in two different places should be considered |
| 8173 |
// equal for testing purposes and therefore we hide it from enumeration. |
| 8174 |
|
| 8175 |
Object.defineProperty(element, '_source', { |
| 8176 |
configurable: false, |
| 8177 |
enumerable: false, |
| 8178 |
writable: false, |
| 8179 |
value: source |
| 8180 |
}); |
| 8181 |
|
| 8182 |
if (Object.freeze) { |
| 8183 |
Object.freeze(element.props); |
| 8184 |
Object.freeze(element); |
| 8185 |
} |
| 8186 |
} |
| 8187 |
|
| 8188 |
return element; |
| 8189 |
}; |
| 8190 |
/** |
| 8191 |
* https://github.com/reactjs/rfcs/pull/107 |
| 8192 |
* @param {*} type |
| 8193 |
* @param {object} props |
| 8194 |
* @param {string} key |
| 8195 |
*/ |
| 8196 |
|
| 8197 |
function jsxDEV(type, config, maybeKey, source, self) { |
| 8198 |
{ |
| 8199 |
var propName; // Reserved names are extracted |
| 8200 |
|
| 8201 |
var props = {}; |
| 8202 |
var key = null; |
| 8203 |
var ref = null; // Currently, key can be spread in as a prop. This causes a potential |
| 8204 |
// issue if key is also explicitly declared (ie. <div {...props} key="Hi" /> |
| 8205 |
// or <div key="Hi" {...props} /> ). We want to deprecate key spread, |
| 8206 |
// but as an intermediary step, we will use jsxDEV for everything except |
| 8207 |
// <div {...props} key="Hi" />, because we aren't currently able to tell if |
| 8208 |
// key is explicitly declared to be undefined or not. |
| 8209 |
|
| 8210 |
if (maybeKey !== undefined) { |
| 8211 |
key = '' + maybeKey; |
| 8212 |
} |
| 8213 |
|
| 8214 |
if (hasValidKey(config)) { |
| 8215 |
key = '' + config.key; |
| 8216 |
} |
| 8217 |
|
| 8218 |
if (hasValidRef(config)) { |
| 8219 |
ref = config.ref; |
| 8220 |
warnIfStringRefCannotBeAutoConverted(config, self); |
| 8221 |
} // Remaining properties are added to a new props object |
| 8222 |
|
| 8223 |
|
| 8224 |
for (propName in config) { |
| 8225 |
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { |
| 8226 |
props[propName] = config[propName]; |
| 8227 |
} |
| 8228 |
} // Resolve default props |
| 8229 |
|
| 8230 |
|
| 8231 |
if (type && type.defaultProps) { |
| 8232 |
var defaultProps = type.defaultProps; |
| 8233 |
|
| 8234 |
for (propName in defaultProps) { |
| 8235 |
if (props[propName] === undefined) { |
| 8236 |
props[propName] = defaultProps[propName]; |
| 8237 |
} |
| 8238 |
} |
| 8239 |
} |
| 8240 |
|
| 8241 |
if (key || ref) { |
| 8242 |
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; |
| 8243 |
|
| 8244 |
if (key) { |
| 8245 |
defineKeyPropWarningGetter(props, displayName); |
| 8246 |
} |
| 8247 |
|
| 8248 |
if (ref) { |
| 8249 |
defineRefPropWarningGetter(props, displayName); |
| 8250 |
} |
| 8251 |
} |
| 8252 |
|
| 8253 |
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); |
| 8254 |
} |
| 8255 |
} |
| 8256 |
|
| 8257 |
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; |
| 8258 |
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; |
| 8259 |
|
| 8260 |
function setCurrentlyValidatingElement$1(element) { |
| 8261 |
{ |
| 8262 |
if (element) { |
| 8263 |
var owner = element._owner; |
| 8264 |
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); |
| 8265 |
ReactDebugCurrentFrame$1.setExtraStackFrame(stack); |
| 8266 |
} else { |
| 8267 |
ReactDebugCurrentFrame$1.setExtraStackFrame(null); |
| 8268 |
} |
| 8269 |
} |
| 8270 |
} |
| 8271 |
|
| 8272 |
var propTypesMisspellWarningShown; |
| 8273 |
|
| 8274 |
{ |
| 8275 |
propTypesMisspellWarningShown = false; |
| 8276 |
} |
| 8277 |
/** |
| 8278 |
* Verifies the object is a ReactElement. |
| 8279 |
* See https://reactjs.org/docs/react-api.html#isvalidelement |
| 8280 |
* @param {?object} object |
| 8281 |
* @return {boolean} True if `object` is a ReactElement. |
| 8282 |
* @final |
| 8283 |
*/ |
| 8284 |
|
| 8285 |
function isValidElement(object) { |
| 8286 |
{ |
| 8287 |
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; |
| 8288 |
} |
| 8289 |
} |
| 8290 |
|
| 8291 |
function getDeclarationErrorAddendum() { |
| 8292 |
{ |
| 8293 |
if (ReactCurrentOwner$1.current) { |
| 8294 |
var name = getComponentName(ReactCurrentOwner$1.current.type); |
| 8295 |
|
| 8296 |
if (name) { |
| 8297 |
return '\n\nCheck the render method of `' + name + '`.'; |
| 8298 |
} |
| 8299 |
} |
| 8300 |
|
| 8301 |
return ''; |
| 8302 |
} |
| 8303 |
} |
| 8304 |
|
| 8305 |
function getSourceInfoErrorAddendum(source) { |
| 8306 |
{ |
| 8307 |
if (source !== undefined) { |
| 8308 |
var fileName = source.fileName.replace(/^.*[\\\/]/, ''); |
| 8309 |
var lineNumber = source.lineNumber; |
| 8310 |
return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; |
| 8311 |
} |
| 8312 |
|
| 8313 |
return ''; |
| 8314 |
} |
| 8315 |
} |
| 8316 |
/** |
| 8317 |
* Warn if there's no key explicitly set on dynamic arrays of children or |
| 8318 |
* object keys are not valid. This allows us to keep track of children between |
| 8319 |
* updates. |
| 8320 |
*/ |
| 8321 |
|
| 8322 |
|
| 8323 |
var ownerHasKeyUseWarning = {}; |
| 8324 |
|
| 8325 |
function getCurrentComponentErrorInfo(parentType) { |
| 8326 |
{ |
| 8327 |
var info = getDeclarationErrorAddendum(); |
| 8328 |
|
| 8329 |
if (!info) { |
| 8330 |
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; |
| 8331 |
|
| 8332 |
if (parentName) { |
| 8333 |
info = "\n\nCheck the top-level render call using <" + parentName + ">."; |
| 8334 |
} |
| 8335 |
} |
| 8336 |
|
| 8337 |
return info; |
| 8338 |
} |
| 8339 |
} |
| 8340 |
/** |
| 8341 |
* Warn if the element doesn't have an explicit key assigned to it. |
| 8342 |
* This element is in an array. The array could grow and shrink or be |
| 8343 |
* reordered. All children that haven't already been validated are required to |
| 8344 |
* have a "key" property assigned to it. Error statuses are cached so a warning |
| 8345 |
* will only be shown once. |
| 8346 |
* |
| 8347 |
* @internal |
| 8348 |
* @param {ReactElement} element Element that requires a key. |
| 8349 |
* @param {*} parentType element's parent's type. |
| 8350 |
*/ |
| 8351 |
|
| 8352 |
|
| 8353 |
function validateExplicitKey(element, parentType) { |
| 8354 |
{ |
| 8355 |
if (!element._store || element._store.validated || element.key != null) { |
| 8356 |
return; |
| 8357 |
} |
| 8358 |
|
| 8359 |
element._store.validated = true; |
| 8360 |
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); |
| 8361 |
|
| 8362 |
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { |
| 8363 |
return; |
| 8364 |
} |
| 8365 |
|
| 8366 |
ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a |
| 8367 |
// property, it may be the creator of the child that's responsible for |
| 8368 |
// assigning it a key. |
| 8369 |
|
| 8370 |
var childOwner = ''; |
| 8371 |
|
| 8372 |
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) { |
| 8373 |
// Give the component that originally created this child. |
| 8374 |
childOwner = " It was passed a child from " + getComponentName(element._owner.type) + "."; |
| 8375 |
} |
| 8376 |
|
| 8377 |
setCurrentlyValidatingElement$1(element); |
| 8378 |
|
| 8379 |
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); |
| 8380 |
|
| 8381 |
setCurrentlyValidatingElement$1(null); |
| 8382 |
} |
| 8383 |
} |
| 8384 |
/** |
| 8385 |
* Ensure that every element either is passed in a static location, in an |
| 8386 |
* array with an explicit keys property defined, or in an object literal |
| 8387 |
* with valid key property. |
| 8388 |
* |
| 8389 |
* @internal |
| 8390 |
* @param {ReactNode} node Statically passed child of any type. |
| 8391 |
* @param {*} parentType node's parent's type. |
| 8392 |
*/ |
| 8393 |
|
| 8394 |
|
| 8395 |
function validateChildKeys(node, parentType) { |
| 8396 |
{ |
| 8397 |
if (typeof node !== 'object') { |
| 8398 |
return; |
| 8399 |
} |
| 8400 |
|
| 8401 |
if (Array.isArray(node)) { |
| 8402 |
for (var i = 0; i < node.length; i++) { |
| 8403 |
var child = node[i]; |
| 8404 |
|
| 8405 |
if (isValidElement(child)) { |
| 8406 |
validateExplicitKey(child, parentType); |
| 8407 |
} |
| 8408 |
} |
| 8409 |
} else if (isValidElement(node)) { |
| 8410 |
// This element was passed in a valid location. |
| 8411 |
if (node._store) { |
| 8412 |
node._store.validated = true; |
| 8413 |
} |
| 8414 |
} else if (node) { |
| 8415 |
var iteratorFn = getIteratorFn(node); |
| 8416 |
|
| 8417 |
if (typeof iteratorFn === 'function') { |
| 8418 |
// Entry iterators used to provide implicit keys, |
| 8419 |
// but now we print a separate warning for them later. |
| 8420 |
if (iteratorFn !== node.entries) { |
| 8421 |
var iterator = iteratorFn.call(node); |
| 8422 |
var step; |
| 8423 |
|
| 8424 |
while (!(step = iterator.next()).done) { |
| 8425 |
if (isValidElement(step.value)) { |
| 8426 |
validateExplicitKey(step.value, parentType); |
| 8427 |
} |
| 8428 |
} |
| 8429 |
} |
| 8430 |
} |
| 8431 |
} |
| 8432 |
} |
| 8433 |
} |
| 8434 |
/** |
| 8435 |
* Given an element, validate that its props follow the propTypes definition, |
| 8436 |
* provided by the type. |
| 8437 |
* |
| 8438 |
* @param {ReactElement} element |
| 8439 |
*/ |
| 8440 |
|
| 8441 |
|
| 8442 |
function validatePropTypes(element) { |
| 8443 |
{ |
| 8444 |
var type = element.type; |
| 8445 |
|
| 8446 |
if (type === null || type === undefined || typeof type === 'string') { |
| 8447 |
return; |
| 8448 |
} |
| 8449 |
|
| 8450 |
var propTypes; |
| 8451 |
|
| 8452 |
if (typeof type === 'function') { |
| 8453 |
propTypes = type.propTypes; |
| 8454 |
} else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. |
| 8455 |
// Inner props are checked in the reconciler. |
| 8456 |
type.$$typeof === REACT_MEMO_TYPE)) { |
| 8457 |
propTypes = type.propTypes; |
| 8458 |
} else { |
| 8459 |
return; |
| 8460 |
} |
| 8461 |
|
| 8462 |
if (propTypes) { |
| 8463 |
// Intentionally inside to avoid triggering lazy initializers: |
| 8464 |
var name = getComponentName(type); |
| 8465 |
checkPropTypes(propTypes, element.props, 'prop', name, element); |
| 8466 |
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { |
| 8467 |
propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers: |
| 8468 |
|
| 8469 |
var _name = getComponentName(type); |
| 8470 |
|
| 8471 |
error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown'); |
| 8472 |
} |
| 8473 |
|
| 8474 |
if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) { |
| 8475 |
error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); |
| 8476 |
} |
| 8477 |
} |
| 8478 |
} |
| 8479 |
/** |
| 8480 |
* Given a fragment, validate that it can only be provided with fragment props |
| 8481 |
* @param {ReactElement} fragment |
| 8482 |
*/ |
| 8483 |
|
| 8484 |
|
| 8485 |
function validateFragmentProps(fragment) { |
| 8486 |
{ |
| 8487 |
var keys = Object.keys(fragment.props); |
| 8488 |
|
| 8489 |
for (var i = 0; i < keys.length; i++) { |
| 8490 |
var key = keys[i]; |
| 8491 |
|
| 8492 |
if (key !== 'children' && key !== 'key') { |
| 8493 |
setCurrentlyValidatingElement$1(fragment); |
| 8494 |
|
| 8495 |
error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); |
| 8496 |
|
| 8497 |
setCurrentlyValidatingElement$1(null); |
| 8498 |
break; |
| 8499 |
} |
| 8500 |
} |
| 8501 |
|
| 8502 |
if (fragment.ref !== null) { |
| 8503 |
setCurrentlyValidatingElement$1(fragment); |
| 8504 |
|
| 8505 |
error('Invalid attribute `ref` supplied to `React.Fragment`.'); |
| 8506 |
|
| 8507 |
setCurrentlyValidatingElement$1(null); |
| 8508 |
} |
| 8509 |
} |
| 8510 |
} |
| 8511 |
|
| 8512 |
function jsxWithValidation(type, props, key, isStaticChildren, source, self) { |
| 8513 |
{ |
| 8514 |
var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to |
| 8515 |
// succeed and there will likely be errors in render. |
| 8516 |
|
| 8517 |
if (!validType) { |
| 8518 |
var info = ''; |
| 8519 |
|
| 8520 |
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { |
| 8521 |
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."; |
| 8522 |
} |
| 8523 |
|
| 8524 |
var sourceInfo = getSourceInfoErrorAddendum(source); |
| 8525 |
|
| 8526 |
if (sourceInfo) { |
| 8527 |
info += sourceInfo; |
| 8528 |
} else { |
| 8529 |
info += getDeclarationErrorAddendum(); |
| 8530 |
} |
| 8531 |
|
| 8532 |
var typeString; |
| 8533 |
|
| 8534 |
if (type === null) { |
| 8535 |
typeString = 'null'; |
| 8536 |
} else if (Array.isArray(type)) { |
| 8537 |
typeString = 'array'; |
| 8538 |
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { |
| 8539 |
typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />"; |
| 8540 |
info = ' Did you accidentally export a JSX literal instead of a component?'; |
| 8541 |
} else { |
| 8542 |
typeString = typeof type; |
| 8543 |
} |
| 8544 |
|
| 8545 |
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); |
| 8546 |
} |
| 8547 |
|
| 8548 |
var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used. |
| 8549 |
// TODO: Drop this when these are no longer allowed as the type argument. |
| 8550 |
|
| 8551 |
if (element == null) { |
| 8552 |
return element; |
| 8553 |
} // Skip key warning if the type isn't valid since our key validation logic |
| 8554 |
// doesn't expect a non-string/function type and can throw confusing errors. |
| 8555 |
// We don't want exception behavior to differ between dev and prod. |
| 8556 |
// (Rendering will throw with a helpful message and as soon as the type is |
| 8557 |
// fixed, the key warnings will appear.) |
| 8558 |
|
| 8559 |
|
| 8560 |
if (validType) { |
| 8561 |
var children = props.children; |
| 8562 |
|
| 8563 |
if (children !== undefined) { |
| 8564 |
if (isStaticChildren) { |
| 8565 |
if (Array.isArray(children)) { |
| 8566 |
for (var i = 0; i < children.length; i++) { |
| 8567 |
validateChildKeys(children[i], type); |
| 8568 |
} |
| 8569 |
|
| 8570 |
if (Object.freeze) { |
| 8571 |
Object.freeze(children); |
| 8572 |
} |
| 8573 |
} else { |
| 8574 |
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.'); |
| 8575 |
} |
| 8576 |
} else { |
| 8577 |
validateChildKeys(children, type); |
| 8578 |
} |
| 8579 |
} |
| 8580 |
} |
| 8581 |
|
| 8582 |
if (type === exports.Fragment) { |
| 8583 |
validateFragmentProps(element); |
| 8584 |
} else { |
| 8585 |
validatePropTypes(element); |
| 8586 |
} |
| 8587 |
|
| 8588 |
return element; |
| 8589 |
} |
| 8590 |
} // These two functions exist to still get child warnings in dev |
| 8591 |
// even with the prod transform. This means that jsxDEV is purely |
| 8592 |
// opt-in behavior for better messages but that we won't stop |
| 8593 |
// giving you warnings if you use production apis. |
| 8594 |
|
| 8595 |
function jsxWithValidationStatic(type, props, key) { |
| 8596 |
{ |
| 8597 |
return jsxWithValidation(type, props, key, true); |
| 8598 |
} |
| 8599 |
} |
| 8600 |
function jsxWithValidationDynamic(type, props, key) { |
| 8601 |
{ |
| 8602 |
return jsxWithValidation(type, props, key, false); |
| 8603 |
} |
| 8604 |
} |
| 8605 |
|
| 8606 |
var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children. |
| 8607 |
// for now we can ship identical prod functions |
| 8608 |
|
| 8609 |
var jsxs = jsxWithValidationStatic ; |
| 8610 |
|
| 8611 |
exports.jsx = jsx; |
| 8612 |
exports.jsxs = jsxs; |
| 8613 |
})(); |
| 8614 |
} |
| 8615 |
|
| 8616 |
|
| 8617 |
/***/ }), |
| 8618 |
|
| 8619 |
/***/ "./node_modules/react/jsx-runtime.js": |
| 8620 |
/*!*******************************************!*\ |
| 8621 |
!*** ./node_modules/react/jsx-runtime.js ***! |
| 8622 |
\*******************************************/ |
| 8623 |
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 8624 |
|
| 8625 |
"use strict"; |
| 8626 |
|
| 8627 |
|
| 8628 |
if (false) {} else { |
| 8629 |
module.exports = __webpack_require__(/*! ./cjs/react-jsx-runtime.development.js */ "./node_modules/react/cjs/react-jsx-runtime.development.js"); |
| 8630 |
} |
| 8631 |
|
| 8632 |
|
| 8633 |
/***/ }), |
| 8634 |
|
| 8635 |
/***/ "react": |
| 8636 |
/*!************************!*\ |
| 8637 |
!*** external "React" ***! |
| 8638 |
\************************/ |
| 8639 |
/***/ ((module) => { |
| 8640 |
|
| 8641 |
"use strict"; |
| 8642 |
module.exports = window["React"]; |
| 8643 |
|
| 8644 |
/***/ }), |
| 8645 |
|
| 8646 |
/***/ "react-dom": |
| 8647 |
/*!***************************!*\ |
| 8648 |
!*** external "ReactDOM" ***! |
| 8649 |
\***************************/ |
| 8650 |
/***/ ((module) => { |
| 8651 |
|
| 8652 |
"use strict"; |
| 8653 |
module.exports = window["ReactDOM"]; |
| 8654 |
|
| 8655 |
/***/ }), |
| 8656 |
|
| 8657 |
/***/ "jquery": |
| 8658 |
/*!*************************!*\ |
| 8659 |
!*** external "jQuery" ***! |
| 8660 |
\*************************/ |
| 8661 |
/***/ ((module) => { |
| 8662 |
|
| 8663 |
"use strict"; |
| 8664 |
module.exports = window["jQuery"]; |
| 8665 |
|
| 8666 |
/***/ }), |
| 8667 |
|
| 8668 |
/***/ "@wordpress/i18n": |
| 8669 |
/*!******************************!*\ |
| 8670 |
!*** external ["wp","i18n"] ***! |
| 8671 |
\******************************/ |
| 8672 |
/***/ ((module) => { |
| 8673 |
|
| 8674 |
"use strict"; |
| 8675 |
module.exports = window["wp"]["i18n"]; |
| 8676 |
|
| 8677 |
/***/ }), |
| 8678 |
|
| 8679 |
/***/ "./node_modules/@linaria/react/dist/index.mjs": |
| 8680 |
/*!****************************************************!*\ |
| 8681 |
!*** ./node_modules/@linaria/react/dist/index.mjs ***! |
| 8682 |
\****************************************************/ |
| 8683 |
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
| 8684 |
|
| 8685 |
"use strict"; |
| 8686 |
__webpack_require__.r(__webpack_exports__); |
| 8687 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 8688 |
/* harmony export */ "styled": () => (/* binding */ styled_default) |
| 8689 |
/* harmony export */ }); |
| 8690 |
/* 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"); |
| 8691 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react"); |
| 8692 |
/* harmony import */ var _linaria_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @linaria/core */ "./node_modules/@linaria/react/node_modules/@linaria/core/dist/index.mjs"); |
| 8693 |
// src/styled.ts |
| 8694 |
|
| 8695 |
|
| 8696 |
|
| 8697 |
var isCapital = (ch) => ch.toUpperCase() === ch; |
| 8698 |
var filterKey = (keys) => (key) => keys.indexOf(key) === -1; |
| 8699 |
var omit = (obj, keys) => { |
| 8700 |
const res = {}; |
| 8701 |
Object.keys(obj).filter(filterKey(keys)).forEach((key) => { |
| 8702 |
res[key] = obj[key]; |
| 8703 |
}); |
| 8704 |
return res; |
| 8705 |
}; |
| 8706 |
function filterProps(asIs, props, omitKeys) { |
| 8707 |
const filteredProps = omit(props, omitKeys); |
| 8708 |
if (!asIs) { |
| 8709 |
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"]; |
| 8710 |
Object.keys(filteredProps).forEach((key) => { |
| 8711 |
if (!interopValidAttr.default(key)) { |
| 8712 |
delete filteredProps[key]; |
| 8713 |
} |
| 8714 |
}); |
| 8715 |
} |
| 8716 |
return filteredProps; |
| 8717 |
} |
| 8718 |
var warnIfInvalid = (value, componentName) => { |
| 8719 |
if (true) { |
| 8720 |
if (typeof value === "string" || typeof value === "number" && isFinite(value)) { |
| 8721 |
return; |
| 8722 |
} |
| 8723 |
const stringified = typeof value === "object" ? JSON.stringify(value) : String(value); |
| 8724 |
console.warn( |
| 8725 |
`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.` |
| 8726 |
); |
| 8727 |
} |
| 8728 |
}; |
| 8729 |
function styled(tag) { |
| 8730 |
return (options) => { |
| 8731 |
if (true) { |
| 8732 |
if (Array.isArray(options)) { |
| 8733 |
throw new Error( |
| 8734 |
'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' |
| 8735 |
); |
| 8736 |
} |
| 8737 |
} |
| 8738 |
const render = (props, ref) => { |
| 8739 |
const { as: component = tag, class: className } = props; |
| 8740 |
const shouldKeepProps = options.propsAsIs === void 0 ? !(typeof component === "string" && component.indexOf("-") === -1 && !isCapital(component[0])) : options.propsAsIs; |
| 8741 |
const filteredProps = filterProps(shouldKeepProps, props, [ |
| 8742 |
"as", |
| 8743 |
"class" |
| 8744 |
]); |
| 8745 |
filteredProps.ref = ref; |
| 8746 |
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); |
| 8747 |
const { vars } = options; |
| 8748 |
if (vars) { |
| 8749 |
const style = {}; |
| 8750 |
for (const name in vars) { |
| 8751 |
const variable = vars[name]; |
| 8752 |
const result = variable[0]; |
| 8753 |
const unit = variable[1] || ""; |
| 8754 |
const value = typeof result === "function" ? result(props) : result; |
| 8755 |
warnIfInvalid(value, options.name); |
| 8756 |
style[`--${name}`] = `${value}${unit}`; |
| 8757 |
} |
| 8758 |
const ownStyle = filteredProps.style || {}; |
| 8759 |
const keys = Object.keys(ownStyle); |
| 8760 |
if (keys.length > 0) { |
| 8761 |
keys.forEach((key) => { |
| 8762 |
style[key] = ownStyle[key]; |
| 8763 |
}); |
| 8764 |
} |
| 8765 |
filteredProps.style = style; |
| 8766 |
} |
| 8767 |
if (tag.__linaria && tag !== component) { |
| 8768 |
filteredProps.as = component; |
| 8769 |
return react__WEBPACK_IMPORTED_MODULE_1__.createElement(tag, filteredProps); |
| 8770 |
} |
| 8771 |
return react__WEBPACK_IMPORTED_MODULE_1__.createElement(component, filteredProps); |
| 8772 |
}; |
| 8773 |
const Result = react__WEBPACK_IMPORTED_MODULE_1__.forwardRef ? react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(render) : (props) => { |
| 8774 |
const rest = omit(props, ["innerRef"]); |
| 8775 |
return render(rest, props.innerRef); |
| 8776 |
}; |
| 8777 |
Result.displayName = options.name; |
| 8778 |
Result.__linaria = { |
| 8779 |
className: options.class, |
| 8780 |
extends: tag |
| 8781 |
}; |
| 8782 |
return Result; |
| 8783 |
}; |
| 8784 |
} |
| 8785 |
var styled_default = true ? new Proxy(styled, { |
| 8786 |
get(o, prop) { |
| 8787 |
return o(prop); |
| 8788 |
} |
| 8789 |
}) : 0; |
| 8790 |
|
| 8791 |
//# sourceMappingURL=index.mjs.map |
| 8792 |
|
| 8793 |
/***/ }), |
| 8794 |
|
| 8795 |
/***/ "./node_modules/@linaria/react/node_modules/@linaria/core/dist/index.mjs": |
| 8796 |
/*!*******************************************************************************!*\ |
| 8797 |
!*** ./node_modules/@linaria/react/node_modules/@linaria/core/dist/index.mjs ***! |
| 8798 |
\*******************************************************************************/ |
| 8799 |
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
| 8800 |
|
| 8801 |
"use strict"; |
| 8802 |
__webpack_require__.r(__webpack_exports__); |
| 8803 |
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 8804 |
/* harmony export */ "css": () => (/* binding */ css_default), |
| 8805 |
/* harmony export */ "cx": () => (/* binding */ cx_default) |
| 8806 |
/* harmony export */ }); |
| 8807 |
// src/css.ts |
| 8808 |
var css = () => { |
| 8809 |
throw new Error( |
| 8810 |
'Using the "css" tag in runtime is not supported. Make sure you have set up the Babel plugin correctly.' |
| 8811 |
); |
| 8812 |
}; |
| 8813 |
var css_default = css; |
| 8814 |
|
| 8815 |
// src/cx.ts |
| 8816 |
var cx = function cx2() { |
| 8817 |
const presentClassNames = Array.prototype.slice.call(arguments).filter(Boolean); |
| 8818 |
const atomicClasses = {}; |
| 8819 |
const nonAtomicClasses = []; |
| 8820 |
presentClassNames.forEach((arg) => { |
| 8821 |
const individualClassNames = arg ? arg.split(" ") : []; |
| 8822 |
individualClassNames.forEach((className) => { |
| 8823 |
if (className.startsWith("atm_")) { |
| 8824 |
const [, keyHash] = className.split("_"); |
| 8825 |
atomicClasses[keyHash] = className; |
| 8826 |
} else { |
| 8827 |
nonAtomicClasses.push(className); |
| 8828 |
} |
| 8829 |
}); |
| 8830 |
}); |
| 8831 |
const result = []; |
| 8832 |
for (const keyHash in atomicClasses) { |
| 8833 |
if (Object.prototype.hasOwnProperty.call(atomicClasses, keyHash)) { |
| 8834 |
result.push(atomicClasses[keyHash]); |
| 8835 |
} |
| 8836 |
} |
| 8837 |
result.push(...nonAtomicClasses); |
| 8838 |
return result.join(" "); |
| 8839 |
}; |
| 8840 |
var cx_default = cx; |
| 8841 |
|
| 8842 |
//# sourceMappingURL=index.mjs.map |
| 8843 |
|
| 8844 |
/***/ }) |
| 8845 |
|
| 8846 |
/******/ }); |
| 8847 |
/************************************************************************/ |
| 8848 |
/******/ // The module cache |
| 8849 |
/******/ var __webpack_module_cache__ = {}; |
| 8850 |
/******/ |
| 8851 |
/******/ // The require function |
| 8852 |
/******/ function __webpack_require__(moduleId) { |
| 8853 |
/******/ // Check if module is in cache |
| 8854 |
/******/ var cachedModule = __webpack_module_cache__[moduleId]; |
| 8855 |
/******/ if (cachedModule !== undefined) { |
| 8856 |
/******/ return cachedModule.exports; |
| 8857 |
/******/ } |
| 8858 |
/******/ // Create a new module (and put it into the cache) |
| 8859 |
/******/ var module = __webpack_module_cache__[moduleId] = { |
| 8860 |
/******/ // no module.id needed |
| 8861 |
/******/ // no module.loaded needed |
| 8862 |
/******/ exports: {} |
| 8863 |
/******/ }; |
| 8864 |
/******/ |
| 8865 |
/******/ // Execute the module function |
| 8866 |
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); |
| 8867 |
/******/ |
| 8868 |
/******/ // Return the exports of the module |
| 8869 |
/******/ return module.exports; |
| 8870 |
/******/ } |
| 8871 |
/******/ |
| 8872 |
/************************************************************************/ |
| 8873 |
/******/ /* webpack/runtime/compat get default export */ |
| 8874 |
/******/ (() => { |
| 8875 |
/******/ // getDefaultExport function for compatibility with non-harmony modules |
| 8876 |
/******/ __webpack_require__.n = (module) => { |
| 8877 |
/******/ var getter = module && module.__esModule ? |
| 8878 |
/******/ () => (module['default']) : |
| 8879 |
/******/ () => (module); |
| 8880 |
/******/ __webpack_require__.d(getter, { a: getter }); |
| 8881 |
/******/ return getter; |
| 8882 |
/******/ }; |
| 8883 |
/******/ })(); |
| 8884 |
/******/ |
| 8885 |
/******/ /* webpack/runtime/define property getters */ |
| 8886 |
/******/ (() => { |
| 8887 |
/******/ // define getter functions for harmony exports |
| 8888 |
/******/ __webpack_require__.d = (exports, definition) => { |
| 8889 |
/******/ for(var key in definition) { |
| 8890 |
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
| 8891 |
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
| 8892 |
/******/ } |
| 8893 |
/******/ } |
| 8894 |
/******/ }; |
| 8895 |
/******/ })(); |
| 8896 |
/******/ |
| 8897 |
/******/ /* webpack/runtime/global */ |
| 8898 |
/******/ (() => { |
| 8899 |
/******/ __webpack_require__.g = (function() { |
| 8900 |
/******/ if (typeof globalThis === 'object') return globalThis; |
| 8901 |
/******/ try { |
| 8902 |
/******/ return this || new Function('return this')(); |
| 8903 |
/******/ } catch (e) { |
| 8904 |
/******/ if (typeof window === 'object') return window; |
| 8905 |
/******/ } |
| 8906 |
/******/ })(); |
| 8907 |
/******/ })(); |
| 8908 |
/******/ |
| 8909 |
/******/ /* webpack/runtime/hasOwnProperty shorthand */ |
| 8910 |
/******/ (() => { |
| 8911 |
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) |
| 8912 |
/******/ })(); |
| 8913 |
/******/ |
| 8914 |
/******/ /* webpack/runtime/make namespace object */ |
| 8915 |
/******/ (() => { |
| 8916 |
/******/ // define __esModule on exports |
| 8917 |
/******/ __webpack_require__.r = (exports) => { |
| 8918 |
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
| 8919 |
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
| 8920 |
/******/ } |
| 8921 |
/******/ Object.defineProperty(exports, '__esModule', { value: true }); |
| 8922 |
/******/ }; |
| 8923 |
/******/ })(); |
| 8924 |
/******/ |
| 8925 |
/************************************************************************/ |
| 8926 |
var __webpack_exports__ = {}; |
| 8927 |
// This entry need to be wrapped in an IIFE because it need to be in strict mode. |
| 8928 |
(() => { |
| 8929 |
"use strict"; |
| 8930 |
/*!**************************************!*\ |
| 8931 |
!*** ./scripts/entries/elementor.ts ***! |
| 8932 |
\**************************************/ |
| 8933 |
__webpack_require__.r(__webpack_exports__); |
| 8934 |
/* harmony import */ var _elementor_elementorWidget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../elementor/elementorWidget */ "./scripts/elementor/elementorWidget.ts"); |
| 8935 |
/* harmony import */ var _elementor_FormWidget_registerFormWidget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../elementor/FormWidget/registerFormWidget */ "./scripts/elementor/FormWidget/registerFormWidget.ts"); |
| 8936 |
/* harmony import */ var _utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/backgroundAppUtils */ "./scripts/utils/backgroundAppUtils.ts"); |
| 8937 |
/* harmony import */ var _elementor_MeetingWidget_registerMeetingWidget__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../elementor/MeetingWidget/registerMeetingWidget */ "./scripts/elementor/MeetingWidget/registerMeetingWidget.ts"); |
| 8938 |
|
| 8939 |
|
| 8940 |
|
| 8941 |
|
| 8942 |
var ELEMENTOR_READY_INTERVAL = 500; |
| 8943 |
var MAX_POLL_TIMEOUT = 30000; |
| 8944 |
|
| 8945 |
var registerElementorWidgets = function registerElementorWidgets() { |
| 8946 |
(0,_utils_backgroundAppUtils__WEBPACK_IMPORTED_MODULE_2__.initBackgroundApp)(function () { |
| 8947 |
var FormWidget; |
| 8948 |
var MeetingsWidget; |
| 8949 |
var leadinSelectFormItemView = (0,_elementor_elementorWidget__WEBPACK_IMPORTED_MODULE_0__["default"])( //@ts-expect-error global |
| 8950 |
window.elementor, { |
| 8951 |
widgetName: 'hubspot-form', |
| 8952 |
controlSelector: '.elementor-hbspt-form-selector', |
| 8953 |
containerSelector: '.hubspot-form-edit-mode' |
| 8954 |
}, function (controlContainer, widgetContainer, setValue) { |
| 8955 |
FormWidget = new _elementor_FormWidget_registerFormWidget__WEBPACK_IMPORTED_MODULE_1__["default"](controlContainer, widgetContainer, setValue); |
| 8956 |
FormWidget.render(); |
| 8957 |
}, function () { |
| 8958 |
FormWidget.done(); |
| 8959 |
}); |
| 8960 |
var leadinSelectMeetingItemView = (0,_elementor_elementorWidget__WEBPACK_IMPORTED_MODULE_0__["default"])( //@ts-expect-error global |
| 8961 |
window.elementor, { |
| 8962 |
widgetName: 'hubspot-meeting', |
| 8963 |
controlSelector: '.elementor-hbspt-meeting-selector', |
| 8964 |
containerSelector: '.hubspot-meeting-edit-mode' |
| 8965 |
}, function (controlContainer, widgetContainer, setValue) { |
| 8966 |
MeetingsWidget = new _elementor_MeetingWidget_registerMeetingWidget__WEBPACK_IMPORTED_MODULE_3__["default"](controlContainer, widgetContainer, setValue); |
| 8967 |
MeetingsWidget.render(); |
| 8968 |
}, function () { |
| 8969 |
MeetingsWidget.done(); |
| 8970 |
}); //@ts-expect-error global |
| 8971 |
|
| 8972 |
window.elementor.addControlView('leadinformselect', leadinSelectFormItemView); //@ts-expect-error global |
| 8973 |
|
| 8974 |
window.elementor.addControlView('leadinmeetingselect', leadinSelectMeetingItemView); |
| 8975 |
}); |
| 8976 |
}; |
| 8977 |
|
| 8978 |
var pollForElementorReady = setInterval(function () { |
| 8979 |
var elementorFrontend = window.elementorFrontend; |
| 8980 |
|
| 8981 |
if (elementorFrontend) { |
| 8982 |
registerElementorWidgets(); |
| 8983 |
clearInterval(pollForElementorReady); |
| 8984 |
} |
| 8985 |
}, ELEMENTOR_READY_INTERVAL); |
| 8986 |
setTimeout(function () { |
| 8987 |
clearInterval(pollForElementorReady); |
| 8988 |
}, MAX_POLL_TIMEOUT); |
| 8989 |
})(); |
| 8990 |
|
| 8991 |
/******/ })() |
| 8992 |
; |
| 8993 |
//# sourceMappingURL=elementor.js.map |