cluedin-widget
Version:
1,477 lines (1,190 loc) • 9.59 MB
JavaScript
/******/ (function(modules) { // webpackBootstrap
/******/ // install a JSONP callback for chunk loading
/******/ function webpackJsonpCallback(data) {
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1];
/******/
/******/
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0, resolves = [];
/******/ for(;i < chunkIds.length; i++) {
/******/ chunkId = chunkIds[i];
/******/ if(installedChunks[chunkId]) {
/******/ resolves.push(installedChunks[chunkId][0]);
/******/ }
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/ for(moduleId in moreModules) {
/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
/******/ modules[moduleId] = moreModules[moduleId];
/******/ }
/******/ }
/******/ if(parentJsonpFunction) parentJsonpFunction(data);
/******/
/******/ while(resolves.length) {
/******/ resolves.shift()();
/******/ }
/******/
/******/ };
/******/
/******/
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // object to store loaded and loading chunks
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ // Promise = chunk loading, 0 = chunk loaded
/******/ var installedChunks = {
/******/ 34: 0
/******/ };
/******/
/******/
/******/
/******/ // script path function
/******/ function jsonpScriptSrc(chunkId) {
/******/ return __webpack_require__.p + "" + chunkId + ".cluedin_frame-2.3.102.js"
/******/ }
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/ // This file contains only the entry chunk.
/******/ // The chunk loading function for additional chunks
/******/ __webpack_require__.e = function requireEnsure(chunkId) {
/******/ var promises = [];
/******/
/******/
/******/ // JSONP chunk loading for javascript
/******/
/******/ var installedChunkData = installedChunks[chunkId];
/******/ if(installedChunkData !== 0) { // 0 means "already installed".
/******/
/******/ // a Promise means "currently loading".
/******/ if(installedChunkData) {
/******/ promises.push(installedChunkData[2]);
/******/ } else {
/******/ // setup Promise in chunk cache
/******/ var promise = new Promise(function(resolve, reject) {
/******/ installedChunkData = installedChunks[chunkId] = [resolve, reject];
/******/ });
/******/ promises.push(installedChunkData[2] = promise);
/******/
/******/ // start chunk loading
/******/ var head = document.getElementsByTagName('head')[0];
/******/ var script = document.createElement('script');
/******/ var onScriptComplete;
/******/
/******/ script.charset = 'utf-8';
/******/ script.timeout = 120;
/******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ }
/******/ script.src = jsonpScriptSrc(chunkId);
/******/
/******/ onScriptComplete = function (event) {
/******/ // avoid mem leaks in IE.
/******/ script.onerror = script.onload = null;
/******/ clearTimeout(timeout);
/******/ var chunk = installedChunks[chunkId];
/******/ if(chunk !== 0) {
/******/ if(chunk) {
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
/******/ var realSrc = event && event.target && event.target.src;
/******/ var error = new Error('Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')');
/******/ error.type = errorType;
/******/ error.request = realSrc;
/******/ chunk[1](error);
/******/ }
/******/ installedChunks[chunkId] = undefined;
/******/ }
/******/ };
/******/ var timeout = setTimeout(function(){
/******/ onScriptComplete({ type: 'timeout', target: script });
/******/ }, 120000);
/******/ script.onerror = script.onload = onScriptComplete;
/******/ head.appendChild(script);
/******/ }
/******/ }
/******/ return Promise.all(promises);
/******/ };
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // on error function for async loading
/******/ __webpack_require__.oe = function(err) { console.error(err); throw err; };
/******/
/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || [];
/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
/******/ jsonpArray.push = webpackJsonpCallback;
/******/ jsonpArray = jsonpArray.slice();
/******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);
/******/ var parentJsonpFunction = oldJsonpFunction;
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 925);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
if (true) {
module.exports = __webpack_require__(1096);
} else {}
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
if (false) { var throwOnDirectAccess, isValidElement, REACT_ELEMENT_TYPE; } else {
// By explicitly using `prop-types` you are opting into new production behavior.
// http://fb.me/prop-types-in-prod
module.exports = __webpack_require__(1097)();
}
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
var defineProperty = __webpack_require__(3);
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === 'function') {
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
}));
}
ownKeys.forEach(function (key) {
defineProperty(target, key, source[key]);
});
}
return target;
}
module.exports = _objectSpread;
/***/ }),
/* 3 */
/***/ (function(module, exports) {
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;
}
module.exports = _defineProperty;
/***/ }),
/* 4 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addLocaleData", function() { return addLocaleData; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "intlShape", function() { return intlShape; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "injectIntl", function() { return injectIntl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defineMessages", function() { return defineMessages; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IntlProvider", function() { return IntlProvider; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormattedDate", function() { return FormattedDate; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormattedTime", function() { return FormattedTime; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormattedRelative", function() { return FormattedRelative; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormattedNumber", function() { return FormattedNumber; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormattedPlural", function() { return FormattedPlural; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormattedMessage", function() { return FormattedMessage; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormattedHTMLMessage", function() { return FormattedHTMLMessage; });
/* harmony import */ var _locale_data_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(876);
/* harmony import */ var _locale_data_index_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_locale_data_index_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var intl_messageformat__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(240);
/* harmony import */ var intl_messageformat__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(intl_messageformat__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var intl_relativeformat__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(304);
/* harmony import */ var intl_relativeformat__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(intl_relativeformat__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(0);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(259);
/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(44);
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var intl_format_cache__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(264);
/* harmony import */ var intl_format_cache__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(intl_format_cache__WEBPACK_IMPORTED_MODULE_7__);
/*
* Copyright 2018, Yahoo Inc.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
// GENERATED FILE
var defaultLocaleData = { "locale": "en", "pluralRuleFunction": function pluralRuleFunction(n, ord) {
var s = String(n).split("."),
v0 = !s[1],
t0 = Number(s[0]) == n,
n10 = t0 && s[0].slice(-1),
n100 = t0 && s[0].slice(-2);if (ord) return n10 == 1 && n100 != 11 ? "one" : n10 == 2 && n100 != 12 ? "two" : n10 == 3 && n100 != 13 ? "few" : "other";return n == 1 && v0 ? "one" : "other";
}, "fields": { "year": { "displayName": "year", "relative": { "0": "this year", "1": "next year", "-1": "last year" }, "relativeTime": { "future": { "one": "in {0} year", "other": "in {0} years" }, "past": { "one": "{0} year ago", "other": "{0} years ago" } } }, "month": { "displayName": "month", "relative": { "0": "this month", "1": "next month", "-1": "last month" }, "relativeTime": { "future": { "one": "in {0} month", "other": "in {0} months" }, "past": { "one": "{0} month ago", "other": "{0} months ago" } } }, "day": { "displayName": "day", "relative": { "0": "today", "1": "tomorrow", "-1": "yesterday" }, "relativeTime": { "future": { "one": "in {0} day", "other": "in {0} days" }, "past": { "one": "{0} day ago", "other": "{0} days ago" } } }, "hour": { "displayName": "hour", "relative": { "0": "this hour" }, "relativeTime": { "future": { "one": "in {0} hour", "other": "in {0} hours" }, "past": { "one": "{0} hour ago", "other": "{0} hours ago" } } }, "minute": { "displayName": "minute", "relative": { "0": "this minute" }, "relativeTime": { "future": { "one": "in {0} minute", "other": "in {0} minutes" }, "past": { "one": "{0} minute ago", "other": "{0} minutes ago" } } }, "second": { "displayName": "second", "relative": { "0": "now" }, "relativeTime": { "future": { "one": "in {0} second", "other": "in {0} seconds" }, "past": { "one": "{0} second ago", "other": "{0} seconds ago" } } } } };
/*
* Copyright 2015, Yahoo Inc.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
function addLocaleData() {
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
var locales = Array.isArray(data) ? data : [data];
locales.forEach(function (localeData) {
if (localeData && localeData.locale) {
intl_messageformat__WEBPACK_IMPORTED_MODULE_1___default.a.__addLocaleData(localeData);
intl_relativeformat__WEBPACK_IMPORTED_MODULE_2___default.a.__addLocaleData(localeData);
}
});
}
function hasLocaleData(locale) {
var localeParts = (locale || '').split('-');
while (localeParts.length > 0) {
if (hasIMFAndIRFLocaleData(localeParts.join('-'))) {
return true;
}
localeParts.pop();
}
return false;
}
function hasIMFAndIRFLocaleData(locale) {
var normalizedLocale = locale && locale.toLowerCase();
return !!(intl_messageformat__WEBPACK_IMPORTED_MODULE_1___default.a.__localeData__[normalizedLocale] && intl_relativeformat__WEBPACK_IMPORTED_MODULE_2___default.a.__localeData__[normalizedLocale]);
}
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
var asyncGenerator = function () {
function AwaitValue(value) {
this.value = value;
}
function AsyncGenerator(gen) {
var front, back;
function send(key, arg) {
return new Promise(function (resolve, reject) {
var request = {
key: key,
arg: arg,
resolve: resolve,
reject: reject,
next: null
};
if (back) {
back = back.next = request;
} else {
front = back = request;
resume(key, arg);
}
});
}
function resume(key, arg) {
try {
var result = gen[key](arg);
var value = result.value;
if (value instanceof AwaitValue) {
Promise.resolve(value.value).then(function (arg) {
resume("next", arg);
}, function (arg) {
resume("throw", arg);
});
} else {
settle(result.done ? "return" : "normal", result.value);
}
} catch (err) {
settle("throw", err);
}
}
function settle(type, value) {
switch (type) {
case "return":
front.resolve({
value: value,
done: true
});
break;
case "throw":
front.reject(value);
break;
default:
front.resolve({
value: value,
done: false
});
break;
}
front = front.next;
if (front) {
resume(front.key, front.arg);
} else {
back = null;
}
}
this._invoke = send;
if (typeof gen.return !== "function") {
this.return = undefined;
}
}
if (typeof Symbol === "function" && Symbol.asyncIterator) {
AsyncGenerator.prototype[Symbol.asyncIterator] = function () {
return this;
};
}
AsyncGenerator.prototype.next = function (arg) {
return this._invoke("next", arg);
};
AsyncGenerator.prototype.throw = function (arg) {
return this._invoke("throw", arg);
};
AsyncGenerator.prototype.return = function (arg) {
return this._invoke("return", arg);
};
return {
wrap: function (fn) {
return function () {
return new AsyncGenerator(fn.apply(this, arguments));
};
},
await: function (value) {
return new AwaitValue(value);
}
};
}();
var classCallCheck = function (instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
};
var createClass = function () {
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);
}
}
return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
var defineProperty = function (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;
};
var _extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
var inherits = function (subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
};
var objectWithoutProperties = function (obj, keys) {
var target = {};
for (var i in obj) {
if (keys.indexOf(i) >= 0) continue;
if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
target[i] = obj[i];
}
return target;
};
var possibleConstructorReturn = function (self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
};
var toConsumableArray = function (arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
return arr2;
} else {
return Array.from(arr);
}
};
/*
* Copyright 2015, Yahoo Inc.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
var bool = prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.bool;
var number = prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.number;
var string = prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string;
var func = prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.func;
var object = prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.object;
var oneOf = prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.oneOf;
var shape = prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.shape;
var any = prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.any;
var oneOfType = prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.oneOfType;
var localeMatcher = oneOf(['best fit', 'lookup']);
var narrowShortLong = oneOf(['narrow', 'short', 'long']);
var numeric2digit = oneOf(['numeric', '2-digit']);
var funcReq = func.isRequired;
var intlConfigPropTypes = {
locale: string,
timeZone: string,
formats: object,
messages: object,
textComponent: any,
defaultLocale: string,
defaultFormats: object,
onError: func
};
var intlFormatPropTypes = {
formatDate: funcReq,
formatTime: funcReq,
formatRelative: funcReq,
formatNumber: funcReq,
formatPlural: funcReq,
formatMessage: funcReq,
formatHTMLMessage: funcReq
};
var intlShape = shape(_extends({}, intlConfigPropTypes, intlFormatPropTypes, {
formatters: object,
now: funcReq
}));
var messageDescriptorPropTypes = {
id: string.isRequired,
description: oneOfType([string, object]),
defaultMessage: string
};
var dateTimeFormatPropTypes = {
localeMatcher: localeMatcher,
formatMatcher: oneOf(['basic', 'best fit']),
timeZone: string,
hour12: bool,
weekday: narrowShortLong,
era: narrowShortLong,
year: numeric2digit,
month: oneOf(['numeric', '2-digit', 'narrow', 'short', 'long']),
day: numeric2digit,
hour: numeric2digit,
minute: numeric2digit,
second: numeric2digit,
timeZoneName: oneOf(['short', 'long'])
};
var numberFormatPropTypes = {
localeMatcher: localeMatcher,
style: oneOf(['decimal', 'currency', 'percent']),
currency: string,
currencyDisplay: oneOf(['symbol', 'code', 'name']),
useGrouping: bool,
minimumIntegerDigits: number,
minimumFractionDigits: number,
maximumFractionDigits: number,
minimumSignificantDigits: number,
maximumSignificantDigits: number
};
var relativeFormatPropTypes = {
style: oneOf(['best fit', 'numeric']),
units: oneOf(['second', 'minute', 'hour', 'day', 'month', 'year', 'second-short', 'minute-short', 'hour-short', 'day-short', 'month-short', 'year-short'])
};
var pluralFormatPropTypes = {
style: oneOf(['cardinal', 'ordinal'])
};
/*
HTML escaping and shallow-equals implementations are the same as React's
(on purpose.) Therefore, it has the following Copyright and Licensing:
Copyright 2013-2014, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the LICENSE
file in the root directory of React's source tree.
*/
var intlConfigPropNames = Object.keys(intlConfigPropTypes);
var ESCAPED_CHARS = {
'&': '&',
'>': '>',
'<': '<',
'"': '"',
"'": '''
};
var UNSAFE_CHARS_REGEX = /[&><"']/g;
function escape(str) {
return ('' + str).replace(UNSAFE_CHARS_REGEX, function (match) {
return ESCAPED_CHARS[match];
});
}
function filterProps(props, whitelist) {
var defaults$$1 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
return whitelist.reduce(function (filtered, name) {
if (props.hasOwnProperty(name)) {
filtered[name] = props[name];
} else if (defaults$$1.hasOwnProperty(name)) {
filtered[name] = defaults$$1[name];
}
return filtered;
}, {});
}
function invariantIntlContext() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
intl = _ref.intl;
invariant__WEBPACK_IMPORTED_MODULE_6___default()(intl, '[React Intl] Could not find required `intl` object. ' + '<IntlProvider> needs to exist in the component ancestry.');
}
function shallowEquals(objA, objB) {
if (objA === objB) {
return true;
}
if ((typeof objA === 'undefined' ? 'undefined' : _typeof(objA)) !== 'object' || objA === null || (typeof objB === 'undefined' ? 'undefined' : _typeof(objB)) !== 'object' || objB === null) {
return false;
}
var keysA = Object.keys(objA);
var keysB = Object.keys(objB);
if (keysA.length !== keysB.length) {
return false;
}
// Test for A's keys different from B.
var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);
for (var i = 0; i < keysA.length; i++) {
if (!bHasOwnProperty(keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) {
return false;
}
}
return true;
}
function shouldIntlComponentUpdate(_ref2, nextProps, nextState) {
var props = _ref2.props,
state = _ref2.state,
_ref2$context = _ref2.context,
context = _ref2$context === undefined ? {} : _ref2$context;
var nextContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
var _context$intl = context.intl,
intl = _context$intl === undefined ? {} : _context$intl;
var _nextContext$intl = nextContext.intl,
nextIntl = _nextContext$intl === undefined ? {} : _nextContext$intl;
return !shallowEquals(nextProps, props) || !shallowEquals(nextState, state) || !(nextIntl === intl || shallowEquals(filterProps(nextIntl, intlConfigPropNames), filterProps(intl, intlConfigPropNames)));
}
function createError(message, exception) {
var eMsg = exception ? '\n' + exception : '';
return '[React Intl] ' + message + eMsg;
}
function defaultErrorHandler(error) {
if (false) {}
}
/*
* Copyright 2015, Yahoo Inc.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
// Inspired by react-redux's `connect()` HOC factory function implementation:
// https://github.com/rackt/react-redux
function getDisplayName(Component$$1) {
return Component$$1.displayName || Component$$1.name || 'Component';
}
function injectIntl(WrappedComponent) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var _options$intlPropName = options.intlPropName,
intlPropName = _options$intlPropName === undefined ? 'intl' : _options$intlPropName,
_options$withRef = options.withRef,
withRef = _options$withRef === undefined ? false : _options$withRef;
var InjectIntl = function (_Component) {
inherits(InjectIntl, _Component);
function InjectIntl(props, context) {
classCallCheck(this, InjectIntl);
var _this = possibleConstructorReturn(this, (InjectIntl.__proto__ || Object.getPrototypeOf(InjectIntl)).call(this, props, context));
invariantIntlContext(context);
return _this;
}
createClass(InjectIntl, [{
key: 'getWrappedInstance',
value: function getWrappedInstance() {
invariant__WEBPACK_IMPORTED_MODULE_6___default()(withRef, '[React Intl] To access the wrapped instance, ' + 'the `{withRef: true}` option must be set when calling: ' + '`injectIntl()`');
return this._wrappedInstance;
}
}, {
key: 'render',
value: function render() {
var _this2 = this;
return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(WrappedComponent, _extends({}, this.props, defineProperty({}, intlPropName, this.context.intl), {
ref: withRef ? /* istanbul ignore next */function (ref) {
return _this2._wrappedInstance = ref;
} : null
}));
}
}]);
return InjectIntl;
}(react__WEBPACK_IMPORTED_MODULE_4__["Component"]);
InjectIntl.displayName = 'InjectIntl(' + getDisplayName(WrappedComponent) + ')';
InjectIntl.contextTypes = {
intl: intlShape
};
InjectIntl.WrappedComponent = WrappedComponent;
return hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_5___default()(InjectIntl, WrappedComponent);
}
/*
* Copyright 2015, Yahoo Inc.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
function defineMessages(messageDescriptors) {
// This simply returns what's passed-in because it's meant to be a hook for
// babel-plugin-react-intl.
return messageDescriptors;
}
/*
* Copyright 2015, Yahoo Inc.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
// This is a "hack" until a proper `intl-pluralformat` package is created.
function resolveLocale(locales) {
// IntlMessageFormat#_resolveLocale() does not depend on `this`.
return intl_messageformat__WEBPACK_IMPORTED_MODULE_1___default.a.prototype._resolveLocale(locales);
}
function findPluralFunction(locale) {
// IntlMessageFormat#_findPluralFunction() does not depend on `this`.
return intl_messageformat__WEBPACK_IMPORTED_MODULE_1___default.a.prototype._findPluralRuleFunction(locale);
}
var IntlPluralFormat = function IntlPluralFormat(locales) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
classCallCheck(this, IntlPluralFormat);
var useOrdinal = options.style === 'ordinal';
var pluralFn = findPluralFunction(resolveLocale(locales));
this.format = function (value) {
return pluralFn(value, useOrdinal);
};
};
/*
* Copyright 2015, Yahoo Inc.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
var DATE_TIME_FORMAT_OPTIONS = Object.keys(dateTimeFormatPropTypes);
var NUMBER_FORMAT_OPTIONS = Object.keys(numberFormatPropTypes);
var RELATIVE_FORMAT_OPTIONS = Object.keys(relativeFormatPropTypes);
var PLURAL_FORMAT_OPTIONS = Object.keys(pluralFormatPropTypes);
var RELATIVE_FORMAT_THRESHOLDS = {
second: 60, // seconds to minute
minute: 60, // minutes to hour
hour: 24, // hours to day
day: 30, // days to month
month: 12 };
function updateRelativeFormatThresholds(newThresholds) {
var thresholds = intl_relativeformat__WEBPACK_IMPORTED_MODULE_2___default.a.thresholds;
thresholds.second = newThresholds.second;
thresholds.minute = newThresholds.minute;
thresholds.hour = newThresholds.hour;
thresholds.day = newThresholds.day;
thresholds.month = newThresholds.month;
thresholds['second-short'] = newThresholds['second-short'];
thresholds['minute-short'] = newThresholds['minute-short'];
thresholds['hour-short'] = newThresholds['hour-short'];
thresholds['day-short'] = newThresholds['day-short'];
thresholds['month-short'] = newThresholds['month-short'];
}
function getNamedFormat(formats, type, name, onError) {
var format = formats && formats[type] && formats[type][name];
if (format) {
return format;
}
onError(createError('No ' + type + ' format named: ' + name));
}
function formatDate(config, state, value) {
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
var locale = config.locale,
formats = config.formats,
timeZone = config.timeZone;
var format = options.format;
var onError = config.onError || defaultErrorHandler;
var date = new Date(value);
var defaults$$1 = _extends({}, timeZone && { timeZone: timeZone }, format && getNamedFormat(formats, 'date', format, onError));
var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS, defaults$$1);
try {
return state.getDateTimeFormat(locale, filteredOptions).format(date);
} catch (e) {
onError(createError('Error formatting date.', e));
}
return String(date);
}
function formatTime(config, state, value) {
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
var locale = config.locale,
formats = config.formats,
timeZone = config.timeZone;
var format = options.format;
var onError = config.onError || defaultErrorHandler;
var date = new Date(value);
var defaults$$1 = _extends({}, timeZone && { timeZone: timeZone }, format && getNamedFormat(formats, 'time', format, onError));
var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS, defaults$$1);
if (!filteredOptions.hour && !filteredOptions.minute && !filteredOptions.second) {
// Add default formatting options if hour, minute, or second isn't defined.
filteredOptions = _extends({}, filteredOptions, { hour: 'numeric', minute: 'numeric' });
}
try {
return state.getDateTimeFormat(locale, filteredOptions).format(date);
} catch (e) {
onError(createError('Error formatting time.', e));
}
return String(date);
}
function formatRelative(config, state, value) {
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
var locale = config.locale,
formats = config.formats;
var format = options.format;
var onError = config.onError || defaultErrorHandler;
var date = new Date(value);
var now = new Date(options.now);
var defaults$$1 = format && getNamedFormat(formats, 'relative', format, onError);
var filteredOptions = filterProps(options, RELATIVE_FORMAT_OPTIONS, defaults$$1);
// Capture the current threshold values, then temporarily override them with
// specific values just for this render.
var oldThresholds = _extends({}, intl_relativeformat__WEBPACK_IMPORTED_MODULE_2___default.a.thresholds);
updateRelativeFormatThresholds(RELATIVE_FORMAT_THRESHOLDS);
try {
return state.getRelativeFormat(locale, filteredOptions).format(date, {
now: isFinite(now) ? now : state.now()
});
} catch (e) {
onError(createError('Error formatting relative time.', e));
} finally {
updateRelativeFormatThresholds(oldThresholds);
}
return String(date);
}
function formatNumber(config, state, value) {
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
var locale = config.locale,
formats = config.formats;
var format = options.format;
var onError = config.onError || defaultErrorHandler;
var defaults$$1 = format && getNamedFormat(formats, 'number', format, onError);
var filteredOptions = filterProps(options, NUMBER_FORMAT_OPTIONS, defaults$$1);
try {
return state.getNumberFormat(locale, filteredOptions).format(value);
} catch (e) {
onError(createError('Error formatting number.', e));
}
return String(value);
}
function formatPlural(config, state, value) {
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
var locale = config.locale;
var filteredOptions = filterProps(options, PLURAL_FORMAT_OPTIONS);
var onError = config.onError || defaultErrorHandler;
try {
return state.getPluralFormat(locale, filteredOptions).format(value);
} catch (e) {
onError(createError('Error formatting plural.', e));
}
return 'other';
}
function formatMessage(config, state) {
var messageDescriptor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var values = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
var locale = config.locale,
formats = config.formats,
messages = config.messages,
defaultLocale = config.defaultLocale,
defaultFormats = config.defaultFormats;
var id = messageDescriptor.id,
defaultMessage = messageDescriptor.defaultMessage;
// Produce a better error if the user calls `intl.formatMessage(element)`
if (false) {}
// `id` is a required field of a Message Descriptor.
invariant__WEBPACK_IMPORTED_MODULE_6___default()(id, '[React Intl] An `id` must be provided to format a message.');
var message = messages && messages[id];
var hasValues = Object.keys(values).length > 0;
// Avoid expensive message formatting for simple messages without values. In
// development messages will always be formatted in case of missing values.
if (!hasValues && "production" === 'production') {
return message || defaultMessage || id;
}
var formattedMessage = void 0;
var onError = config.onError || defaultErrorHandler;
if (message) {
try {
var formatter = state.getMessageFormat(message, locale, formats);
formattedMessage = formatter.format(values);
} catch (e) {
onError(createError('Error formatting message: "' + id + '" for locale: "' + locale + '"' + (defaultMessage ? ', using default message as fallback.' : ''), e));
}
} else {
// This prevents warnings from littering the console in development
// when no `messages` are passed into the <IntlProvider> for the
// default locale, and a default message is in the source.
if (!defaultMessage || locale && locale.toLowerCase() !== defaultLocale.toLowerCase()) {
onError(createError('Missing message: "' + id + '" for locale: "' + locale + '"' + (defaultMessage ? ', using default message as fallback.' : '')));
}
}
if (!formattedMessage && defaultMessage) {
try {
var _formatter = state.getMessageFormat(defaultMessage, defaultLocale, defaultFormats);
formattedMessage = _formatter.format(values);
} catch (e) {
onError(createError('Error formatting the default message for: "' + id + '"', e));
}
}
if (!formattedMessage) {
onError(createError('Cannot format message: "' + id + '", ' + ('using message ' + (message || defaultMessage ? 'source' : 'id') + ' as fallback.')));
}
return formattedMessage || message || defaultMessage || id;
}
function formatHTMLMessage(config, state, messageDescriptor) {
var rawValues = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
// Process all the values before they are used when formatting the ICU
// Message string. Since the formatted message might be injected via
// `innerHTML`, all String-based values need to be HTML-escaped.
var escapedValues = Object.keys(rawValues).reduce(function (escaped, name) {
var value = rawValues[name];
escaped[name] = typeof value === 'string' ? escape(value) : value;
return escaped;
}, {});
return formatMessage(config, state, messageDescriptor, escapedValues);
}
var format = Object.freeze({
formatDate: formatDate,
formatTime: formatTime,
formatRelative: formatRelative,
formatNumber: formatNumber,
formatPlural: formatPlural,
formatMessage: formatMessage,
formatHTMLMessage: formatHTMLMessage
});
/*
* Copyright 2015, Yahoo Inc.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
var intlConfigPropNames$1 = Object.keys(intlConfigPropTypes);
var intlFormatPropNames = Object.keys(intlFormatPropTypes);
// These are not a static property on the `IntlProvider` class so the intl
// config values can be inherited from an <IntlProvider> ancestor.
var defaultProps = {
formats: {},
messages: {},
timeZone: null,
textComponent: 'span',
defaultLocale: 'en',
defaultFormats: {},
onError: defaultErrorHandler
};
var IntlProvider = function (_Component) {
inherits(IntlProvider, _Component);
function IntlProvider(props) {
var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
classCallCheck(this, IntlProvider);
var _this = possibleConstructorReturn(this, (IntlProvider.__proto__ || Object.getPrototypeOf(IntlProvider)).call(this, props, context));
invariant__WEBPACK_IMPORTED_MODULE_6___default()(typeof Intl !== 'undefined', '[React Intl] The `Intl` APIs must be available in the runtime, ' + 'and do not appear to be built-in. An `Intl` polyfill should be loaded.\n' + 'See: http://formatjs.io/guides/runtime-environments/');
var intlContext = context.intl;
// Used to stabilize time when performing an initial rendering so that
// all relative times use the same reference "now" time.
var initialNow = void 0;
if (isFinite(props.initialNow)) {
initialNow = Number(props.initialNow);
} else {
// When an `initialNow` isn't provided via `props`, look to see an
// <IntlProvider> exists in the ancestry and call its `now()`
// function to propagate its value for "now".
initialNow = intlContext ? intlContext.now() : Date.now();
}
// Creating `Intl*` formatters is expensive. If there's a parent
// `<IntlProvider>`, then its formatters will be used. Otherwise, this
// memoize the `Intl*` constructors and cache them for the lifecycle of
// this IntlProvider instance.
var _ref = intlContext || {},
_ref$formatters = _ref.formatters,
formatters = _ref$formatters === undefined ? {
getDateTimeFormat: intl_format_cache__WEBPACK_IMPORTED_MODULE_7___default()(Intl.DateTimeFormat),
getNumberFormat: intl_format_cache__WEBPACK_IMPORTED_MODULE_7___default()(Intl.NumberFormat),
getMessageFormat: intl_format_cache__WEBPACK_IMPORTED_MODULE_7___default()(intl_messageformat__WEBPACK_IMPORTED_MODULE_1___default.a),
getRelativeFormat: intl_format_cache__WEBPACK_IMPORTED_MODULE_7___default()(intl_relativeformat__WEBPACK_IMPORTED_MODULE_2___default.a),
getPluralFormat: intl_format_cache__WEBPACK_IMPORTED_MODULE_7___default()(IntlPluralFormat)
} : _ref$formatters;
_this.state = _extends({}, formatters, {
// Wrapper to provide stable "now" time for initial render.
now: function now() {
return _this._didDisplay ? Date.now() : initialNow;
}
});
return _this;
}
createClass(IntlProvider, [{
key: 'getConfig',
value: function getConfig() {
var intlContext = this.context.intl;
// Build a whitelisted config object from `props`, defaults, and
// `context.intl`, if an <IntlProvider> exists in the ancestry.
var config = filterProps(this.props, intlConfigPropNames$1, intlContext);
// Apply default props. This must be applied last after the props have
// been resolved and inherited from any <IntlProvider> in the ancestry.
// This matches how React resolves `defaultProps`.
for (var propName in defaultProps) {
if (config[propName] === undefined) {
config[propName] = defaultProps[propName];
}
}
if (!hasLocaleData(config.locale)) {
var _config = config,
locale = _config.locale,
defaultLocale = _config.defaultLocale,
defaultFormats = _config.defaultFormats,
onError = _config.onError;
onError(createError('Missing locale data for locale: "' + locale + '". ' + ('Using default locale: "' + defaultLocale + '" as fallback.')));
// Since there's no registered locale data for `locale`, this will
// fallback to the `defaultLocale` to make sure things can render.
// The `messages` are overridden to the `defaultProps` empty object
// to maintain referential equality across re-renders. It's assumed
// each <FormattedMessage> contains a `defaultMessage` prop.
config = _extends({}, config, {
locale: defaultLocale,
formats: defaultFormats,
messages: defaultProps.messages
});
}
return config;
}
}, {
key: 'getBoundFormatFns',
value: function getBoundFormatFns(config, state) {
return intlFormatPropNames.reduce(function (boundFormatFns, name) {
boundFormatFns[name] = format[name].bind(null, config, state);
return boundFormatFns;
}, {});
}
}, {
key: 'getChildContext',
value: function getChildContext() {
var config = this.getConfig();
// Bind intl factories and current config to the format functions.
var boundFormatFns = this.getBoundFormatFns(config, this.state);
var _state = this.state,
now = _state.now,
formatters = objectWithoutProperties(_state, ['now']);
return {
intl: _extends({}, config, boundFormatFns, {
formatters: formatters,
now: now
})
};
}
}, {
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate() {
for (var _len = arguments.length, next = Array(_len), _key = 0; _key < _len; _key++) {
next[_key] = arguments[_key];
}
return shouldIntlComponentUpdate.apply(undefined, [this].concat(next));
}
}, {
key: 'componentDidMount',
value: function componentDidMount() {
this._didDisplay = true;
}
}, {
key: 'render',
value: function render() {
return react__WEBPACK_IMPORTED_MODULE_4__["Children"].only(this.props.children);
}
}]);
return IntlProvider;
}(react__WEBPACK_IMPORTED_MODULE_4__["Component"]);
IntlProvider.displayName = 'IntlProvider';
IntlProvider.contextTypes = {
intl: intlShape
};
IntlProvider.childContextTypes = {
intl: intlShape.isRequired
};
false ? undefined : void 0;
/*
* Copyright 2015, Yahoo Inc.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
var FormattedDate = function (_Component) {
inherits(FormattedDate, _Component);
function FormattedDate(props, context) {
classCallCheck(this, FormattedDate);
var _this = possibleConstructorReturn(this, (FormattedDate.__proto__ || Object.getPrototypeOf(FormattedDate)).call(this, props, context));
invariantIntlContext(context);
return _this;
}
createClass(FormattedDate, [{
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate() {
for (var _len = arguments.length, next = Array(_len), _key = 0; _key < _len; _key++) {
next[_key] = arguments[_key];
}
return shouldIntlComponentUpdate.apply(undefined, [this].concat(next));
}
}, {
key: 'render',
value: function render() {
var _context$intl = this.context.intl,
formatDate = _context$intl.formatDate,
Text = _context$intl.textComponent;
var _props = this.props,
value = _props.value,
children = _props.children;
var formattedDate = formatDate(value, this.props);
if (typeof children === 'function') {
return children(formattedDate);
}
return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(
Text,
null,
formattedDate
);
}
}]);
return FormattedDate;
}(react__WEBPACK_IMPORTED_MODULE_4__["Component"]);
FormattedDate.displayName = 'FormattedDate';
FormattedDate.contextTypes = {
intl: intlShape
};
false ? undefined : void 0;
/*
* Copyright 2015, Yahoo Inc.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
var FormattedTime = function (_Component) {
inherits(FormattedTime, _Component);
function FormattedTime(props, context) {
classCallCheck(this, FormattedTime);
var _this = possibleConstructorReturn(this, (FormattedTime.__proto__ || Object.getPrototypeOf(FormattedTime)).call(this, props, context));
invariantIntlContext(context);
return _this;
}
createClass(FormattedTime, [{
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate() {
for (var _len = arguments.length, next = Array(_len), _key = 0; _key < _len; _key++) {
next[_key] = arguments[_key];
}
return shouldIntlComponentUpdate.apply(undefined, [this].concat(next));
}
}, {
key: 'render',
value: function render() {
var _context$intl = this.context.intl,
formatTime = _context$intl.formatTime,
Text = _context$intl.textComponent;
var _props = this.props,
value = _props.value,
children = _props.children;
var formattedTime = formatTime(value, this.props);
if (typeof children === 'function') {
return children(formattedTime);
}
return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(
Text,
null,
formattedTime
);
}
}]);
return FormattedTime;
}(react__WEBPACK_IMPORTED_MODULE_4__["Component"]);
FormattedTime.displayName = 'Format