text
stringlengths 3
1.05M
|
---|
const getAllTimePost = require('./getAllTimePost');
/**
* @param {('tags' | 'keywords' | 'categories')} type
*/
const getTagsAndCategories = (type) => {
/** @type {string[][]} */
const initialBox = [];
switch (type) {
case 'keywords': getAllTimePost()
.filter((post) => post.frontMatter.type === 'illust')
.filter((post) => { initialBox.push(post.frontMatter.keywords); });
break;
case 'tags': getAllTimePost()
.filter((post) => post.frontMatter.type === 'post')
.filter((post) => { initialBox.push(post.frontMatter.tags); });
break;
default: getAllTimePost()
.filter((post) => post.frontMatter.type === 'post')
.filter((post) => { initialBox.push(post.frontMatter.categories); });
}
/** @type {string[]} */
let CombineArray = [];
/**
* @typedef {Object} IObject
* @property {[key: string]: number}
*/
/** @type {IObject} */
let ArraytoObject;
for (let i = 0; i < initialBox.length; i++) {
CombineArray = CombineArray.concat(initialBox[i]);
}
ArraytoObject = CombineArray.reduce((pre, current) => {
pre[current] = (pre[current] || 0) + 1;
return pre;
}, {});
return ArraytoObject;
};
module.exports = getTagsAndCategories;
|
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["pages-category-category-module"],{
/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/category/category.page.html":
/*!*****************************************************************************************!*\
!*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/category/category.page.html ***!
\*****************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<ion-header>\n <ion-toolbar color=\"primary\">\n <ion-buttons slot=\"start\">\n <ion-back-button text=\"\" mode=\"md\"></ion-back-button>\n </ion-buttons>\n <ion-title>{{'Categories' | translate}}</ion-title>\n <ion-button (click)=\"addNewCat()\" fill=\"clear\" color=\"light\" slot=\"end\">\n <ion-icon slot=\"icon-only\" name=\"add\"></ion-icon>\n </ion-button>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\">\n <div class=\"mainContent\">\n <h2 class=\"ion-text-center\" *ngIf=\"!dummy?.length && !categories?.length\">{{'No Category Found' | translate}}</h2>\n <ion-item *ngFor=\"let item of dummy\">\n <ion-thumbnail slot=\"start\">\n <ion-skeleton-text animated></ion-skeleton-text>\n </ion-thumbnail>\n <ion-label>\n <h3>\n <ion-skeleton-text animated style=\"width: 50%\"></ion-skeleton-text>\n </h3>\n <p>\n <ion-skeleton-text animated style=\"width: 80%\"></ion-skeleton-text>\n </p>\n <p>\n <ion-skeleton-text animated style=\"width: 60%\"></ion-skeleton-text>\n </p>\n </ion-label>\n </ion-item>\n <ion-item lines=\"none\" *ngFor=\"let item of categories;\" (click)=\"edit(item)\">\n <ion-label>{{item.name}}</ion-label>\n <!-- <ion-icon slot=\"end\" name=\"pencil-sharp\"></ion-icon> -->\n <img src=\"assets/imgs/edit.png\" class=\"edt_icn\">\n </ion-item>\n </div>\n</ion-content>");
/***/ }),
/***/ "./src/app/pages/category/category-routing.module.ts":
/*!***********************************************************!*\
!*** ./src/app/pages/category/category-routing.module.ts ***!
\***********************************************************/
/*! exports provided: CategoryPageRoutingModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CategoryPageRoutingModule", function() { return CategoryPageRoutingModule; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm2015/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm2015/router.js");
/* harmony import */ var _category_page__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./category.page */ "./src/app/pages/category/category.page.ts");
const routes = [
{
path: '',
component: _category_page__WEBPACK_IMPORTED_MODULE_3__["CategoryPage"]
}
];
let CategoryPageRoutingModule = class CategoryPageRoutingModule {
};
CategoryPageRoutingModule = tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
imports: [_angular_router__WEBPACK_IMPORTED_MODULE_2__["RouterModule"].forChild(routes)],
exports: [_angular_router__WEBPACK_IMPORTED_MODULE_2__["RouterModule"]],
})
], CategoryPageRoutingModule);
/***/ }),
/***/ "./src/app/pages/category/category.module.ts":
/*!***************************************************!*\
!*** ./src/app/pages/category/category.module.ts ***!
\***************************************************/
/*! exports provided: CategoryPageModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CategoryPageModule", function() { return CategoryPageModule; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm2015/core.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm2015/common.js");
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/fesm2015/forms.js");
/* harmony import */ var _ionic_angular__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ionic/angular */ "./node_modules/@ionic/angular/fesm2015/ionic-angular.js");
/* harmony import */ var _category_routing_module__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./category-routing.module */ "./src/app/pages/category/category-routing.module.ts");
/* harmony import */ var _category_page__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./category.page */ "./src/app/pages/category/category.page.ts");
/* harmony import */ var src_app_shared_shared_module__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! src/app/shared/shared.module */ "./src/app/shared/shared.module.ts");
let CategoryPageModule = class CategoryPageModule {
};
CategoryPageModule = tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
imports: [
_angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"],
_angular_forms__WEBPACK_IMPORTED_MODULE_3__["FormsModule"],
_ionic_angular__WEBPACK_IMPORTED_MODULE_4__["IonicModule"],
src_app_shared_shared_module__WEBPACK_IMPORTED_MODULE_7__["SharedModule"],
_category_routing_module__WEBPACK_IMPORTED_MODULE_5__["CategoryPageRoutingModule"]
],
declarations: [_category_page__WEBPACK_IMPORTED_MODULE_6__["CategoryPage"]]
})
], CategoryPageModule);
/***/ }),
/***/ "./src/app/pages/category/category.page.scss":
/*!***************************************************!*\
!*** ./src/app/pages/category/category.page.scss ***!
\***************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = (".edt_icn {\n width: 20px;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9kYXZvY2hvYS9kZXYvdGlrby9lbmpveS9lbmpveV9yZXN0YXVyYW50X2FwcC9zcmMvYXBwL3BhZ2VzL2NhdGVnb3J5L2NhdGVnb3J5LnBhZ2Uuc2NzcyIsInNyYy9hcHAvcGFnZXMvY2F0ZWdvcnkvY2F0ZWdvcnkucGFnZS5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0VBQ0ksV0FBQTtBQ0NKIiwiZmlsZSI6InNyYy9hcHAvcGFnZXMvY2F0ZWdvcnkvY2F0ZWdvcnkucGFnZS5zY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmVkdF9pY257XG4gICAgd2lkdGg6IDIwcHg7XG59IiwiLmVkdF9pY24ge1xuICB3aWR0aDogMjBweDtcbn0iXX0= */");
/***/ }),
/***/ "./src/app/pages/category/category.page.ts":
/*!*************************************************!*\
!*** ./src/app/pages/category/category.page.ts ***!
\*************************************************/
/*! exports provided: CategoryPage */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CategoryPage", function() { return CategoryPage; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm2015/core.js");
/* harmony import */ var src_app_services_apis_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! src/app/services/apis.service */ "./src/app/services/apis.service.ts");
/* harmony import */ var _ionic_angular__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ionic/angular */ "./node_modules/@ionic/angular/fesm2015/ionic-angular.js");
/* harmony import */ var src_app_services_util_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! src/app/services/util.service */ "./src/app/services/util.service.ts");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm2015/router.js");
let CategoryPage = class CategoryPage {
constructor(api, alertController, util, router) {
this.api = api;
this.alertController = alertController;
this.util = util;
this.router = router;
this.categories = [];
this.dummy = Array(50);
this.getCategories();
}
getCategories() {
this.api.getVenueCategories(localStorage.getItem('uid')).then((data) => {
this.dummy = [];
console.log(data);
if (data) {
this.categories = data;
}
}, error => {
console.log(error);
this.dummy = [];
this.util.errorToast(this.util.translate('Something went wrong'));
}).catch(error => {
console.log(error);
this.dummy = [];
this.util.errorToast(this.util.translate('Something went wrong'));
});
}
ngOnInit() {
}
addNewCat() {
return tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"](this, void 0, void 0, function* () {
const alert = yield this.alertController.create({
header: this.util.translate('Add New!'),
inputs: [
{
name: 'name1',
type: 'text',
placeholder: this.util.translate('Category Name'),
},
],
buttons: [
{
text: this.util.translate('Cancel'),
role: 'cancel',
cssClass: 'secondary',
handler: () => {
console.log('Confirm Cancel');
}
}, {
text: this.util.translate('Ok'),
handler: (data) => {
console.log('Confirm Ok', data);
if (data && data.name1 !== '') {
console.log('add new');
const ids = this.util.makeid(10);
const param = {
uid: localStorage.getItem('uid'),
name: data.name1,
id: ids
};
this.util.show();
this.api.addVenueCategoies(localStorage.getItem('uid'), ids, param).then((data) => {
this.util.hide();
console.log(data);
this.getCategories();
}).catch(error => {
this.util.hide();
this.util.errorToast(this.util.translate('Something went wrong'));
console.log(error);
});
}
}
}
]
});
yield alert.present();
// this.router.navigate(['/add-category'])
});
}
edit(item) {
return tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"](this, void 0, void 0, function* () {
// console.log(item);
const alert = yield this.alertController.create({
header: this.util.translate('Edit'),
inputs: [
{
name: 'name1',
type: 'text',
placeholder: this.util.translate('Category Name'),
value: item.name
},
],
buttons: [
{
text: this.util.translate('Cancel'),
role: 'cancel',
cssClass: 'secondary',
handler: () => {
console.log('Confirm Cancel');
}
}, {
text: this.util.translate('Ok'),
handler: (data) => {
console.log('Confirm Ok', data);
if (data && data.name1 !== '') {
console.log('add new');
const param = {
uid: localStorage.getItem('uid'),
name: data.name1,
id: item.id
};
this.util.show();
this.api.updateVenueCategoies(localStorage.getItem('uid'), item.id, param).then((data) => {
this.util.hide();
console.log(data);
this.getCategories();
}).catch(error => {
this.util.hide();
this.util.errorToast(this.util.translate('Something went wrong'));
console.log(error);
});
}
}
}
]
});
yield alert.present();
});
}
};
CategoryPage.ctorParameters = () => [
{ type: src_app_services_apis_service__WEBPACK_IMPORTED_MODULE_2__["ApisService"] },
{ type: _ionic_angular__WEBPACK_IMPORTED_MODULE_3__["AlertController"] },
{ type: src_app_services_util_service__WEBPACK_IMPORTED_MODULE_4__["UtilService"] },
{ type: _angular_router__WEBPACK_IMPORTED_MODULE_5__["Router"] }
];
CategoryPage = tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
selector: 'app-category',
template: tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"](__webpack_require__(/*! raw-loader!./category.page.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/category/category.page.html")).default,
styles: [tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"](__webpack_require__(/*! ./category.page.scss */ "./src/app/pages/category/category.page.scss")).default]
}),
tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"]("design:paramtypes", [src_app_services_apis_service__WEBPACK_IMPORTED_MODULE_2__["ApisService"],
_ionic_angular__WEBPACK_IMPORTED_MODULE_3__["AlertController"],
src_app_services_util_service__WEBPACK_IMPORTED_MODULE_4__["UtilService"],
_angular_router__WEBPACK_IMPORTED_MODULE_5__["Router"]])
], CategoryPage);
/***/ })
}]);
//# sourceMappingURL=pages-category-category-module-es2015.js.map |
// 获取全局应用程序实例对象
const app = getApp()
// 创建页面实例对象
Page({
/**
* 页面的初始数据
*/
data: {
page: 1,
size: 20,
subtitle: '请在此输入搜索内容',
movies: [],
search: '',
loading: false,
hasMore: false
},
handleLoadMore () {
if (!this.data.hasMore) return
this.setData({ subtitle: '加载中...', loading: true })
app.douban.find('search', this.data.page++, this.data.size, this.data.search)
.then(d => {
if (d.subjects.length) {
this.setData({ subtitle: d.title, movies: this.data.movies.concat(d.subjects), loading: false })
} else {
this.setData({ hasMore: false, loading: false })
}
})
.catch(e => {
this.setData({ subtitle: '获取数据异常', loading: false })
console.error(e)
})
},
handleSearch (e) {
if (!e.detail.value) return
this.setData({ subtitle: '加载中...', hasMore: true, loading: true, search: e.detail.value })
this.handleLoadMore()
},
/**
* 生命周期函数--监听页面加载
*/
onLoad () {
// TODO: onLoad
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady () {
// TODO: onReady
},
/**
* 生命周期函数--监听页面显示
*/
onShow () {
// TODO: onShow
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide () {
// TODO: onHide
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload () {
// TODO: onUnload
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefreash () {
// TODO: onPullDownRefreash
}
})
|
/**
* @class Oskari.mapframework.bundle.featuredata2.FeatureDataBundleInstance
*
* Main component and starting point for the "featuredata2" functionality.
*
* See Oskari.mapframework.bundle.featuredata2.FeatureDataBundle for bundle definition.
*
*/
Oskari.clazz.define("Oskari.mapframework.bundle.featuredata2.FeatureDataBundleInstance",
/**
* @method create called automatically on construction
* @static
*/
function () {
this.sandbox = null;
this.started = false;
this.plugins = {};
this.localization = null;
this.popupHandler = null;
this.selectionPlugin = null;
this.conf = {};
this.__loadingStatus = {};
}, {
/**
* @static
* @property __name
*/
__name: 'FeatureData2',
/**
* @method getName
* @return {String} the name for the component
*/
"getName": function () {
return this.__name;
},
/**
* @method setSandbox
* @param {Oskari.mapframework.sandbox.Sandbox} sandbox
* Sets the sandbox reference to this component
*/
setSandbox: function (sandbox) {
this.sandbox = sandbox;
},
/**
* @method getSandbox
* @return {Oskari.mapframework.sandbox.Sandbox}
*/
getSandbox: function () {
return this.sandbox;
},
/**
* @method getLocalization
* Returns JSON presentation of bundles localization data for current language.
* If key-parameter is not given, returns the whole localization data.
*
* @param {String} key (optional) if given, returns the value for key
* @return {String/Object} returns single localization string or
* JSON object for complete data depending on localization
* structure and if parameter key is given
*/
getLocalization: function (key) {
if (!this._localization) {
this._localization = Oskari.getLocalization(this.getName());
}
if (key) {
return this._localization[key];
}
return this._localization;
},
/**
* @method start
* implements BundleInstance protocol start methdod
*/
"start": function () {
if (this.started) {
return;
}
var me = this,
sandboxName = (this.conf ? this.conf.sandbox : null) || 'sandbox',
sandbox = Oskari.getSandbox(sandboxName),
p,
localization,
layers = sandbox.findAllSelectedMapLayers(),
i;
me.started = true;
me.sandbox = sandbox;
this.localization = Oskari.getLocalization(this.getName());
sandbox.register(me);
for (p in me.eventHandlers) {
if(me.eventHandlers.hasOwnProperty(p)) {
sandbox.registerForEventByName(me, p);
}
}
//Let's extend UI
var requestBuilder = sandbox.getRequestBuilder('userinterface.AddExtensionRequest');
if (requestBuilder) {
var request = requestBuilder(this);
sandbox.request(this, request);
}
// draw ui
me.createUi();
localization = this.getLocalization('selectionTools');
//sends request via config to add tool selection button
if (this.conf && this.conf.selectionTools === true) {
this.popupHandler = Oskari.clazz.create('Oskari.mapframework.bundle.featuredata2.PopupHandler', this);
var addBtnRequestBuilder = sandbox.getRequestBuilder('Toolbar.AddToolButtonRequest'),
btn = {
iconCls: 'tool-feature-selection',
tooltip: localization.tools.select.tooltip,
sticky: false,
callback: function () {
me.popupHandler.showSelectionTools();
}
};
sandbox.request(this, addBtnRequestBuilder('dialog', 'selectiontools', btn));
this.selectionPlugin = this.sandbox.findRegisteredModuleInstance("MainMapModuleMapSelectionPlugin");
if (!this.selectionPlugin) {
var config = {
id: "FeatureData"
};
this.selectionPlugin = Oskari.clazz.create('Oskari.mapframework.bundle.featuredata2.plugin.MapSelectionPlugin', config, this.sandbox);
mapModule.registerPlugin(this.selectionPlugin);
mapModule.startPlugin(this.selectionPlugin);
}
}
// check if preselected layers included wfs layers -> act if they are added now
for (i = 0; i < layers.length; ++i) {
if (layers[i].hasFeatureData()) {
this.plugin.refresh();
this.plugins['Oskari.userinterface.Flyout'].layerAdded(layers[i]);
}
}
sandbox.addRequestHandler('ShowFeatureDataRequest', this.requestHandlers.showFeatureHandler);
this.__setupLayerTools();
},
/**
* @method init
* implements Module protocol init method - does nothing atm
*/
"init": function () {
var me = this;
this.requestHandlers = {
showFeatureHandler: Oskari.clazz.create('Oskari.mapframework.bundle.featuredata2.request.ShowFeatureDataRequestHandler', me)
};
return null;
},
/**
* @method getSelectionPlugin
* @return {Oskari.mapframework.bundle.metadata.plugin.MapSelectionPlugin}
**/
getSelectionPlugin: function () {
return this.selectionPlugin;
},
/**
* @method update
* implements BundleInstance protocol update method - does nothing atm
*/
"update": function () {
},
/**
* @method onEvent
* @param {Oskari.mapframework.event.Event} event a Oskari event object
* Event is handled forwarded to correct #eventHandlers if found or discarded if not.
*/
onEvent: function (event) {
var handler = this.eventHandlers[event.getName()];
if (!handler) {
return;
}
return handler.apply(this, [event]);
},
/**
* Fetches reference to the map layer service
* @return {Oskari.mapframework.service.MapLayerService}
*/
getLayerService : function() {
return this.sandbox.getService('Oskari.mapframework.service.MapLayerService');
},
/**
* Adds the Feature data tool for layer
* @param {String| Number} layerId layer to process
* @param {Boolean} suppressEvent true to not send event about updated layer (optional)
*/
__addTool : function(layerModel, suppressEvent) {
var me = this;
var service = this.getLayerService();
if(typeof layerModel !== 'object') {
// detect layerId and replace with the corresponding layerModel
layerModel = service.findMapLayer(layerModel);
}
if(!layerModel || !layerModel.hasFeatureData()) {
return;
}
// add feature data tool for layer
var layerLoc = this.getLocalization('layer') || {},
label = layerLoc['object-data'] || 'Feature data',
tool = Oskari.clazz.create('Oskari.mapframework.domain.Tool');
tool.setName("objectData");
tool.setTitle(label);
tool.setTooltip(label);
tool.setCallback(function () {
me.sandbox.postRequestByName('ShowFeatureDataRequest', [layerModel.getId()]);
});
service.addToolForLayer(layerModel, tool, suppressEvent);
},
/**
* Adds tools for all layers
*/
__setupLayerTools : function() {
var me = this;
// add tools for feature data layers
var service = this.getLayerService();
var layers = service.getAllLayers();
_.each(layers, function(layer) {
me.__addTool(layer, true);
});
// update all layers at once since we suppressed individual events
var event = me.sandbox.getEventBuilder('MapLayerEvent')(null, 'tool');
me.sandbox.notifyAll(event);
},
/**
* @property {Object} eventHandlers
* @static
*/
eventHandlers: {
'WFSStatusChangedEvent': function (event) {
if(event.getLayerId() === undefined) {
return;
}
var layer = this.sandbox.findMapLayerFromSelectedMapLayers(event.getLayerId());
if(!this.__loadingStatus) {
this.__loadingStatus = {};
}
if(event.getStatus() === event.status.loading) {
this.__loadingStatus['' + event.getLayerId()] = 'loading';
this.plugin.showLoadingIndicator(true);
this.plugins['Oskari.userinterface.Flyout'].showLoadingIndicator(event.getLayerId(), true);
this.plugins['Oskari.userinterface.Flyout'].showErrorIndicator(event.getLayerId(), false);
}
if(event.getStatus() === event.status.complete) {
delete this.__loadingStatus['' + event.getLayerId()];
this.plugins['Oskari.userinterface.Flyout'].showLoadingIndicator(event.getLayerId(), false);
this.plugins['Oskari.userinterface.Flyout'].showErrorIndicator(event.getLayerId(), false);
if (layer && !event.getNop()) {
this.plugins['Oskari.userinterface.Flyout'].updateData(layer);
}
else if (layer && layer.isManualRefresh()) {
this.plugins['Oskari.userinterface.Flyout'].setGridOpacity(layer, 0.5);
}
}
if(event.getStatus() === event.status.error) {
this.__loadingStatus['' + event.getLayerId()] = 'error';
this.plugins['Oskari.userinterface.Flyout'].showLoadingIndicator(event.getLayerId(), false);
this.plugins['Oskari.userinterface.Flyout'].showErrorIndicator(event.getLayerId(), true);
}
var status = {
loading : [],
error : []
};
_.each(this.__loadingStatus, function(value, key) {
status[value].push(key);
});
if(status.loading.length === 0) {
// no layers in loading state
this.plugin.showLoadingIndicator(false);
}
// setup error indicator based on error statuses
this.plugin.showErrorIndicator(status.error.length > 0);
},
'MapLayerEvent': function (event) {
if(event.getOperation() !== 'add') {
// only handle add layer
return;
}
if(event.getLayerId()) {
this.__addTool(event.getLayerId());
}
else {
// ajax call for all layers
this.__setupLayerTools();
}
},
/**
* @method AfterMapLayerRemoveEvent
* @param {Oskari.mapframework.event.common.AfterMapLayerRemoveEvent} event
*
* Calls flyouts layerRemoved() method
*/
'AfterMapLayerRemoveEvent': function (event) {
if (event.getMapLayer().hasFeatureData()) {
this.plugin.refresh();
this.plugins['Oskari.userinterface.Flyout'].layerRemoved(event.getMapLayer());
}
},
/**
* @method AfterMapLayerAddEvent
* @param {Oskari.mapframework.event.common.AfterMapLayerAddEvent} event
*
* Calls flyouts layerAdded() method
*/
'AfterMapLayerAddEvent': function (event) {
if (event.getMapLayer().hasFeatureData()) {
this.plugin.refresh();
this.plugins['Oskari.userinterface.Flyout'].layerAdded(event.getMapLayer());
}
},
/**
* @method WFSPropertiesEvent
* Update grid headers
*/
'WFSPropertiesEvent': function (event) {
// update grid information [don't update the grid if not active]
var layer = event.getLayer();
this.plugins['Oskari.userinterface.Flyout'].updateData(layer);
},
/**
* @method WFSFeatureEvent
* Update grid data
*/
'WFSFeatureEvent': function (event) {
// update grid information [don't update the grid if not active]
var layer = event.getLayer();
this.plugins['Oskari.userinterface.Flyout'].updateData(layer);
},
/**
* @method WFSFeaturesSelectedEvent
* Highlight the feature on flyout
*/
'WFSFeaturesSelectedEvent': function (event) {
this.plugins['Oskari.userinterface.Flyout'].featureSelected(event);
},
/**
* @method userinterface.ExtensionUpdatedEvent
* Disable grid updates on close, otherwise enable updates
*/
'userinterface.ExtensionUpdatedEvent': function (event) {
var plugin = this.plugins['Oskari.userinterface.Flyout'];
// ExtensionUpdateEvents are fired a lot, only let featuredata2 extension event to be handled when enabled
if (event.getExtension().getName() !== this.getName()) {
// wasn't me or disabled -> do nothing
return;
} else if (event.getViewState() === "close") {
plugin.setEnabled(false);
if (this.plugin) {
this.plugin.handleCloseFlyout();
}
} else {
plugin.setEnabled(true, true);
}
},
/**
* @method FeatureData.FinishedDrawingEvent
*/
'FeatureData.FinishedDrawingEvent': function () {
var me = this;
if (!me.selectionPlugin) {
me.selectionPlugin = me.sandbox.findRegisteredModuleInstance('MainMapModuleMapSelectionPlugin');
}
var features = me.selectionPlugin.getFeaturesAsGeoJSON();
me.selectionPlugin.removeFeatures();
var evt = me.sandbox.getEventBuilder("WFSSetFilter")(features);
me.sandbox.notifyAll(evt);
},
'AfterMapMoveEvent': function() {
var me = this;
me.plugin.mapStatusChanged();
}
},
/**
* @method stop
* implements BundleInstance protocol stop method
*/
"stop": function () {
var sandbox = this.sandbox(),
p;
for (p in this.eventHandlers) {
if (this.eventHandlers.hasOwnProperty(p)) {
sandbox.unregisterFromEventByName(this, p);
}
}
var request = sandbox.getRequestBuilder('userinterface.RemoveExtensionRequest')(this);
sandbox.request(this, request);
this.sandbox.unregister(this);
this.started = false;
},
/**
* @method startExtension
* implements Oskari.userinterface.Extension protocol startExtension method
* Creates a flyout and a tile:
* Oskari.mapframework.bundle.featuredata2.Flyout
* Oskari.mapframework.bundle.featuredata2.Tile
*/
startExtension: function () {
this.plugins['Oskari.userinterface.Flyout'] = Oskari.clazz.create('Oskari.mapframework.bundle.featuredata2.Flyout', this);
},
/**
* @method stopExtension
* implements Oskari.userinterface.Extension protocol stopExtension method
* Clears references to flyout and tile
*/
stopExtension: function () {
this.plugins['Oskari.userinterface.Flyout'] = null;
},
/**
* @method getPlugins
* implements Oskari.userinterface.Extension protocol getPlugins method
* @return {Object} references to flyout and tile
*/
getPlugins: function () {
return this.plugins;
},
/**
* @method getTitle
* @return {String} localized text for the title of the component
*/
getTitle: function () {
return this.getLocalization('title');
},
/**
* @method getDescription
* @return {String} localized text for the description of the component
*/
getDescription: function () {
return this.getLocalization('desc');
},
/**
* @method createUi
* (re)creates the UI for "selected layers" functionality
*/
createUi: function () {
this.plugins['Oskari.userinterface.Flyout'].createUi();
var mapModule = this.sandbox.findRegisteredModuleInstance('MainMapModule'),
plugin = Oskari.clazz.create('Oskari.mapframework.bundle.featuredata2.plugin.FeaturedataPlugin', {
instance: this
});
mapModule.registerPlugin(plugin);
mapModule.startPlugin(plugin);
this.plugin = plugin;
//get the plugin order straight in mobile toolbar even for the tools coming in late
if (Oskari.util.isMobile()) {
mapModule.redrawPluginUIs(true);
}
}
}, {
/**
* @property {String[]} protocol
* @static
*/
"protocol": ["Oskari.bundle.BundleInstance", 'Oskari.mapframework.module.Module', 'Oskari.userinterface.Extension']
});
|
import itertools as itt
from collections import OrderedDict
class SemanticError(Exception):
@property
def text(self):
return self.args[0]
class Attribute:
def __init__(self, name, typex):
self.name = name
self.type = typex
def __str__(self):
return f'[attrib] {self.name} : {self.type.name};'
def __repr__(self):
return str(self)
class Method:
def __init__(self, name, param_names, params_types, return_type):
self.name = name
self.param_names = param_names
self.param_types = params_types
self.return_type = return_type
def __str__(self):
params = ', '.join(f'{n}:{t.name}' for n,t in zip(self.param_names, self.param_types))
return f'[method] {self.name}({params}): {self.return_type.name};'
def __eq__(self, other):
return other.name == self.name and \
other.return_type == self.return_type and \
other.param_types == self.param_types
class Type:
def __init__(self, name:str):
self.name = name
self.attributes = []
self.methods = []
self.parent = None
def set_parent(self, parent):
if self.parent is not None:
raise SemanticError(f'Parent type is already set for {self.name}.')
self.parent = parent
def get_attribute(self, name:str):
try:
return next(attr for attr in self.attributes if attr.name == name)
except StopIteration:
if self.parent is None:
raise SemanticError(f'Attribute "{name}" is not defined in {self.name}.')
try:
return self.parent.get_attribute(name)
except SemanticError:
raise SemanticError(f'Attribute "{name}" is not defined in {self.name}.')
def define_attribute(self, name:str, typex):
try:
self.get_attribute(name)
except SemanticError:
attribute = Attribute(name, typex)
self.attributes.append(attribute)
return attribute
else:
raise SemanticError(f'Attribute "{name}" is already defined in {self.name}.')
def get_method(self, name:str):
try:
return next(method for method in self.methods if method.name == name)
except StopIteration:
if self.parent is None:
raise SemanticError(f'Method "{name}" is not defined in {self.name}.')
try:
return self.parent.get_method(name)
except SemanticError:
raise SemanticError(f'Method "{name}" is not defined in {self.name}.')
def define_method(self, name:str, param_names:list, param_types:list, return_type):
if name in (method.name for method in self.methods):
raise SemanticError(f'Method "{name}" already defined in {self.name}')
method = Method(name, param_names, param_types, return_type)
self.methods.append(method)
return method
def all_attributes(self, clean=True):
plain = OrderedDict() if self.parent is None else self.parent.all_attributes(False)
for attr in self.attributes:
plain[attr.name] = (attr, self)
return plain.values() if clean else plain
def all_attributes_names(self, clean=True):
plain = OrderedDict() if self.parent is None else self.parent.all_attributes(False)
for attr in self.attributes:
plain[attr.name] = (attr, self)
return plain.keys() if clean else plain
def all_methods(self, clean=True):
plain = OrderedDict() if self.parent is None else self.parent.all_methods(False)
for method in self.methods:
plain[method.name] = (method, self)
return plain.values() if clean else plain
def conforms_to(self, other):
return other.bypass() or self == other or self.parent is not None and self.parent.conforms_to(other)
def bypass(self):
return False
def get_all_parents(self):
if self.parent is None: return []
return [self.parent]+self.parent.get_all_parents()
def __str__(self):
output = f'type {self.name}'
parent = '' if self.parent is None else f' : {self.parent.name}'
output += parent
output += ' {'
output += '\n\t' if self.attributes or self.methods else ''
output += '\n\t'.join(str(x) for x in self.attributes)
output += '\n\t' if self.attributes else ''
output += '\n\t'.join(str(x) for x in self.methods)
output += '\n' if self.methods else ''
output += '}\n'
return output
def __repr__(self):
return str(self)
class ErrorType(Type):
def __init__(self):
Type.__init__(self, '<error>')
def conforms_to(self, other):
return True
def bypass(self):
return True
def __eq__(self, other):
return isinstance(other, Type)
class VoidType(Type):
def __init__(self):
Type.__init__(self, '<void>')
def conforms_to(self, other):
raise Exception('Invalid type: void type.')
def bypass(self):
return True
def __eq__(self, other):
return isinstance(other, VoidType)
class IntType(Type):
def __init__(self):
Type.__init__(self, 'int')
def __eq__(self, other):
return other.name == self.name or isinstance(other, IntType)
class Context:
def __init__(self):
self.types = {}
def create_type(self, name:str):
if name in self.types:
raise SemanticError(f'Type with the same name ({name}) already in context.')
typex = self.types[name] = Type(name)
return typex
def get_type(self, name:str):
try:
return self.types[name]
except KeyError:
raise SemanticError(f'Type "{name}" is not defined.')
def __str__(self):
return '{\n\t' + '\n\t'.join(y for x in self.types.values() for y in str(x).split('\n')) + '\n}'
def __repr__(self):
return str(self)
class VariableInfo:
def __init__(self, name, vtype):
self.name = name
self.type = vtype
class Scope:
def __init__(self, parent=None):
self.locals = []
self.parent = parent
self.children = []
self.index = 0 if parent is None else len(parent)
def __len__(self):
return len(self.locals)
def create_child(self):
child = Scope(self)
self.children.append(child)
return child
def define_variable(self, vname, vtype):
info = VariableInfo(vname, vtype)
self.locals.append(info)
return info
def find_variable(self, vname, index=None):
locals = self.locals if index is None else itt.islice(self.locals, index)
try:
return next(x for x in locals if x.name == vname)
except StopIteration:
return self.parent.find_variable(vname, self.index) if self.parent is None else None
def is_defined(self, vname):
return self.find_variable(vname) is not None
def is_local(self, vname):
return any(True for x in self.locals if x.name == vname)
|
const lookupChar = require('../3. Char Lookup.js');
let expect = require('chai').expect;
let mocha = require('mocha');
describe('Test lookupChar', function () {
it('first parameter is non-string, should return undefined ', function () {
expect(lookupChar(1, "string")).to.equal(undefined);
});
it('both parameter are non-strings, should return undefined ', function () {
expect(lookupChar(1, 1)).to.equal(undefined);
});
it('second parameter is non-integer, should return undefined ', function () {
expect(lookupChar("string", 1.1)).to.equal(undefined);
});
it('second parameter is non-number, should return undefined ', function () {
expect(lookupChar("string", "string")).to.equal(undefined);
});
it('Index is less then string length, should return Incorrect index ', function () {
expect(lookupChar("string", -1)).to.equal('Incorrect index');
});
it('Index is equal to string length, should return Incorrect index ', function () {
expect(lookupChar("string", 5)).to.equal('Incorrect index');
});
it('Index is bigger than string length, should return Incorrect index ', function () {
expect(lookupChar("string", 6)).to.equal('Incorrect index');
});
it('Index is inside string length, should return Incorrect index ', function () {
expect(lookupChar("string", 3)).to.equal('i');
});
});
|
module.exports = {
preset: 'ts-jest',
roots: ['<rootDir>/src', '<rootDir>/test'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
transform: {
'\\.(ts|tsx)$': 'ts-jest',
'^.+\\.(css|less)$': '<rootDir>test/styleMock.js'
},
coverageReporters: ['json-summary', 'text', 'lcov'],
coveragePathIgnorePatterns: ['/node_modules/'],
globals: {
'ts-jest': {
tsConfig: 'tsconfig.jest.json'
}
},
setupTestFrameworkScriptFile: '<rootDir>test/setupTests.ts',
snapshotSerializers: ['enzyme-to-json/serializer']
};
|
/// Copyright (c) 2012 Ecma International. All rights reserved.
/**
* @path ch15/15.4/15.4.4/15.4.4.18/15.4.4.18-7-c-i-1.js
* @description Array.prototype.forEach - element to be retrieved is own data property on an Array-like object
*/
function testcase() {
var kValue = { };
var testResult = false;
function callbackfn(val, idx, obj) {
if (idx === 5) {
testResult = (val === kValue);
}
}
var obj = { 5: kValue, length: 100 };
Array.prototype.forEach.call(obj, callbackfn);
return testResult;
}
runTestCase(testcase);
|
from django.shortcuts import render
# Create your views here.
def show_user_chat(request):
context = {}
return render(request,'userchats/show.html',context) |
$(function(){
var break1 = 1000;
var dataURL = 'https://docs.google.com/spreadsheets/d/1TC-h9T0NDX3NYeruEdfROaN894dm-VtKh0SKZO-9ets/pubhtml';
Tabletop.init({
key: dataURL,
callback: processData,
simpleSheet: true
});
if ( $(window).width() < break1 ) {
$('#listings').css('marginTop', $('header').outerHeight() + 300 + 10);
} else {
$('#listings').css('marginTop', $('header').outerHeight() + 10);
$('#map').css('height', $(window).height());
}
var map;
var all_bounds = [];
var saved_listings = [];
var listing_markers = {};
$('#list_switcher').find('li').click(function(){
if ($(this).hasClass('active')) return;
if ($(this).attr('id') == 'list_switcher_all') {
displayAllListings();
$(this).addClass('active');
$('#list_switcher_saved').removeClass('active');
} else {
displaySavedListings();
$(this).addClass('active');
$('#list_switcher_all').removeClass('active');
}
});
if (window.location.hash.length > 0) {
loadHashAttributes();
}
function processData(data, tabletop) {
setupMap(data);
$('.loading').hide();
for (var i = 0; i < data.length; i++) {
createListing(data[i]);
};
$('.list_btn').click(function(e){
e.preventDefault();
var listingID = $(this).parents('.listing').attr('id');
if ( $(this).hasClass('list_btn_add') ) {
addToList(listingID);
} else {
removeFromList(listingID);
}
return false;
});
}
function createListing(data) {
var id = 'l' + data.order;
var classes = createListingClasses(data);
if (saved_listings.indexOf(id) != -1) {
classes += ' in_list';
}
var html = '<div class="listing ' + classes + '" id="' + id + '">';
html += '<div class="header">';
if (saved_listings.indexOf(id) == -1) {
html += '<div class="list_btn list_btn_add"><i class="fa fa-plus-circle"></i></div>';
} else {
html += '<div class="list_btn list_btn_remove"><i class="fa fa-minus-circle"></i></div>';
}
html += '<div class="location">' + data.location + '</div>';
html += '<div class="address">' + data.address + '</div>';
html += '<ul class="features">'
if (data.accessible && data.accessible.toLowerCase() === "yes") {
html += '<li><i class="fa fa-wheelchair-alt"></i> <span class="text">Accessible</span></li>'
}
if (data.drinks && data.drinks.toLowerCase() === "yes") {
html += '<li><i class="fa fa-glass"></i> <span class="text">Refreshments</span></li>'
}
if (data.music && data.music.toLowerCase() === "yes") {
html += '<li><i class="fa fa-music"></i> <span class="text">Music</span></li>'
}
html += '<li class="location_area">' + data.where + '</li>';
html += '</ul>'
html += '</div>'
html += '<div class="body">'
html += '<img src="' + data.image + '"/>';
html += '<div class="desc">' + data.description + '</div>';
if (data.url && data.url.length > 0) {
html += '<div class="contact"><i class="fa fa-external-link"></i> <a href="http://' + data.url + '" target="_blank">' + data.url + '</a></div>';
}
if (data.phone && data.phone.length > 0) {
html += '<div class="contact"><i class="fa fa-phone"></i> <a href="tel:' + data.phone + '">' + data.phone + '</a></div>';
}
html += '</div>';
html += '</div>';
$('#listings_inner').append(html);
}
function text_to_var(text) {
return text.toLowerCase().replace(/\W/,'_');
}
function createListingClasses(data) {
var ret = [];
var location = "loc_" + text_to_var(data.where);
ret.push(location);
if (data.accessible && data.accessible.toLowerCase() === "yes") {
ret.push("feature_accessible");
}
if (data.drinks && data.drinks.toLowerCase() === "yes") {
ret.push("feature_drinks");
}
if (data.music && data.music.toLowerCase() === "yes") {
ret.push("feature_music");
}
return ret.join(' ');
}
function setupMap(data) {
$('#map').css('top', $('header').outerHeight());
map = L.map('map').setView([39.740317, -75.559411], 13);
var colors = {
downtown: '#C0243C',
west_end: '#1C9E7A',
north_wilmington: '#CE6F1A'
}
// L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
// attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
// }).addTo(map);
L.tileLayer('http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', {
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> © <a href="http://cartodb.com/attributions">CartoDB</a>',
subdomains: 'abcd',
maxZoom: 19
}).addTo(map);
// L.tileLayer.provider('CartoDB.Positron').addTo(map);
for (var i = 0; i < data.length; i++) {
var place = data[i];
var point = [place.lat, place.long];
var id = 'l' + place.order;
all_bounds.push(point);
var colorType = text_to_var(place.where);
var color = colors[colorType];
var markerOptions = {
color: color,
fillColor: color,
fillOpacity: 0.1,
opacity: 0.3
};
if (saved_listings.indexOf(id) != -1) {
markerOptions = {
color: color,
fillColor: color,
fillOpacity: 0.5,
opacity: 1
};
}
var marker = L.circleMarker(point, markerOptions);
marker.listingID = id;
marker.bindPopup(place.location, {
maxWidth: 200
});
marker.on('click', onMarkerClick);
marker.addTo(map);
listing_markers[id] = marker;
};
map.fitBounds(all_bounds);
}
function onMarkerClick() {
var topOffset = 0;
if ( $(window).width() < break1 ) {
topOffset = $('#map').outerHeight() + $('header').outerHeight() + 10;
} else {
topOffset = $('header').outerHeight() + 10;
}
var listingID = '#' + this.listingID;
var offset = $(listingID).offset().top - topOffset;
$('body').scrollTop(offset);
}
function addToList(listingID) {
var htmlID = '#' + listingID;
$(htmlID).find('.list_btn').removeClass('list_btn_add').addClass('list_btn_remove').html('<i class="fa fa-minus-circle"></i>');
$(htmlID).addClass('in_list');
var marker = listing_markers[listingID];
marker.setStyle({
fillOpacity: 0.5,
opacity: 1
});
saved_listings.push(listingID);
updateListingsState();
}
function removeFromList(listingID) {
var htmlID = '#' + listingID;
$(htmlID).find('.list_btn').removeClass('list_btn_remove').addClass('list_btn_add').html('<i class="fa fa-plus-circle"></i>');
$(htmlID).removeClass('in_list');
var marker = listing_markers[listingID];
var indexToRemove = saved_listings.indexOf(listingID);
saved_listings.splice(indexToRemove, 1);
updateListingsState();
if ($('#list_switcher_saved').hasClass('active')) {
$(htmlID).hide();
marker.setStyle({
fillOpacity: 0,
opacity: 0
});
} else {
marker.setStyle({
fillOpacity: 0.1,
opacity: 0.3
});
}
if (saved_listings.length == 0) {
$('#no_saved_listings').show();
}
}
function updateListingsState() {
$('#saved_listings_count').text(saved_listings.length);
var hash = '';
if (saved_listings.length > 0) {
var listings = saved_listings.sort().join('-');
hash = "ex-" + listings;
}
window.location.hash = hash;
}
function displayAllListings() {
$('.listing').show();
$('body').scrollTop(0);
map.fitBounds(all_bounds);
for (var listingID in listing_markers) {
var marker = listing_markers[listingID];
if (saved_listings.indexOf(listingID) == -1) {
marker.setStyle({
fillOpacity: 0.1,
opacity: 0.3
});
} else {
marker.setStyle({
fillOpacity: 0.5,
opacity: 1
});
}
}
$('#no_saved_listings').hide();
$('#intro').show();
}
function displaySavedListings() {
$('.listing').hide();
$('#intro').hide();
if (saved_listings.length == 0) {
$('#no_saved_listings').show();
} else {
$('#no_saved_listings').hide();
var bounds = [];
for (var i = 0; i < saved_listings.length; i++) {
var id = saved_listings[i]
var htmlID = '#' + id;
bounds.push( listing_markers[id].getLatLng() );
$(htmlID).show();
};
map.fitBounds(bounds);
for (var listingID in listing_markers) {
if (saved_listings.indexOf(listingID) == -1) {
var marker = listing_markers[listingID];
marker.setStyle({
fillOpacity: 0,
opacity: 0
});
}
}
}
}
function loadHashAttributes() {
var listStr = window.location.hash.replace('#ex-','');
saved_listings = listStr.split('-');
$('#saved_listings_count').text(saved_listings.length);
}
}); |
from .call_stack import Thread
from .object import Object
from .path import Path
class Choice(Object):
text: str
index: int
source_path: str
target_path: Path
thread_at_generation: Thread
original_thread_index: int
is_invisible_default: bool
def __init__(self):
super().__init__()
self.text = ""
self.source_path = ""
self.index = 0
self.target_path = None
self.thread_at_generation = None
self.original_thread_index = 0
self.is_invisible_default = False
@property
def path_string_on_choice(self) -> str:
return str(self.target_path)
@path_string_on_choice.setter
def path_string_on_choice(self, value: str):
self.target_path = Path(value)
|
var Bluebird = require('bluebird');
var Chalk = require('chalk');
var Cli = require('structured-cli');
var ConfigFile = require('../../lib/config');
var Sandbox = require('sandboxjs');
var SuperagentProxy = require('superagent-proxy');
var UserAuthenticator = require('../../lib/userAuthenticator');
var _ = require('lodash');
module.exports = {
onBeforeConfigure: require('./profileOptions').onBeforeConfigure,
onBeforeHandler: onBeforeHandler,
};
function onBeforeHandler(context) {
var args = context.args;
return sandboxFromArguments(args)
.then(onProfile);
function onProfile(profile) {
args.profile = profile;
// Ensure V2 access token is fresh enough
if (!args.profile.openid) return; // V1 webtask token, nothing to do
// If V2 access token expires in less than 5 mins, get a new one
var validUntil = new Date(args.profile.openid.valid_until);
var now = Date.now();
if ((validUntil - now) < 5 * 60 * 1000) {
var userAuthenticator = new UserAuthenticator({
sandboxUrl: args.profile.url,
authorizationServer: args.profile.openid.authorization_server,
audience: args.profile.openid.audience,
clientId: args.profile.openid.client_id,
refreshToken: args.profile.openid.refresh_token,
});
return userAuthenticator
.login({
container: args.profile.container,
admin: args.profile.openid.scopes.indexOf('wt:admin') > -1,
auth0: args.profile.openid.auth0,
profileName: args.profile.name,
requestedScopes: args.profile.openid.scope,
})
.then(function (profile) {
args.profile = profile;
var config = new ConfigFile();
config.load();
return config.setProfile(profile.name, {
url: profile.url,
token: profile.token,
container: profile.container,
openid: profile.openid,
})
.tap(function () {
return config.save();
});
});
}
else {
return; // access token still valid more than 5 mins
}
}
}
function sandboxFromArguments(args, options) {
return new Bluebird(function (resolve, reject) {
if (!options) options = {};
if (args.token) {
if (args.profile && !options.allowProfile) return reject(new Cli.error.invalid('--profile should not be specified with custom tokens'));
if (args.container && args.url) {
try {
return resolve(Sandbox.init({
onBeforeRequest: [
onBeforeRequestProxy,
onBeforeRequestRuntime
],
container: args.container,
token: args.token,
url: args.url,
}));
} catch (e) {
return reject(e);
}
}
}
var config = new ConfigFile();
var profile$ = config.load()
.then(loadProfile)
.then(onProfileLoaded);
return resolve(profile$);
function loadProfile(profiles) {
if (_.isEmpty(profiles)) {
throw Cli.error.hint('No webtask profiles found. To get started:\n'
+ Chalk.bold('$ wt init'));
}
return config.getProfile(args.profile);
}
function onBeforeRequestProxy(request) {
const proxy = process.env.http_proxy || process.env.HTTP_PROXY;
const result = proxy
? SuperagentProxy(request, proxy)
: request;
return result;
}
function onBeforeRequestRuntime(request) {
if (args.runtime) {
return request.set('x-wt-runtime', args.runtime);
}
return request;
}
function onProfileLoaded(profile) {
if (args.container) profile.container = args.container;
if (args.url) profile.url = args.url;
if (args.token) profile.token = args.token;
if (args.runtime) {
profile.onBeforeRequest = Array.isArray(profile.onBeforeRequest)
? profile.onBeforeRequest.concat(onBeforeRequestRuntime)
: [onBeforeRequestRuntime];
}
return profile;
}
});
}
|
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./utils.cjs.production.min.js');
} else {
module.exports = require('./utils.cjs.development.js');
} |
/**
* Controller for handling basic camera events on a Landmarker.
*
* A landmarker in general has complex state - what landmarks are selected,
* what mesh is being used, lighting arrangements, and so on. The camera's
* behavior however is simple - in response to certain mouse and touch
* interactions, the camera is rotated, zoomed, and panned around some sort of
* target. This class encapsulates this behavior.
*
* Takes a camera object as it's first parameter, and optionally a domElement to
* attach to (if none provided, the document is used).
*
* Hooks up the following callbacks to the domElement:
*
* - focus(target) // refocus the camera on a new target
* - pan(vector) // pan the camera along a certain vector
* - zoom(vector) // zoom the camera along a certain vector
* - rotate(delta) // rotate the camera around the target
*
* Note that other more complex behaviors (selecting and repositioning landmarks
* for instance) can disable the Controller temporarily with the enabled
* property.
*/
'use strict';
import _ from 'underscore';
import * as THREE from 'three';
import $ from 'jquery';
import Backbone from 'backbone';
const MOUSE_WHEEL_SENSITIVITY = 0.5;
const ROTATION_SENSITIVITY = 3.5;
const DAMPING_FACTOR = 0.2;
const PIP_ZOOM_FACTOR = 12.0;
// const EPS = 0.000001;
// see https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent.deltaMode
const UNITS_FOR_MOUSE_WHEEL_DELTA_MODE = {
0: 1.0, // The delta values are specified in pixels.
1: 34.0, // The delta values are specified in lines.
2: 1.0 // The delta values are specified in pages.
};
export default function CameraController (pCam, oCam, oCamZoom, domElement) {
const controller = {};
_.extend(controller, Backbone.Events);
const STATE = {
NONE: -1,
ROTATE: 0,
ZOOM: 1,
PAN: 2
};
let state = STATE.NONE; // the current state of the Camera
let canRotate = true;
let enabled = false; // note that we will enable on creation below!
const target = new THREE.Vector3(); // where the camera is looking
const origin = {
target: target.clone(),
pCamPosition: pCam.position.clone(),
pCamUp: pCam.up.clone(),
oCamPosition: oCam.position.clone(),
oCamUp: oCam.up.clone(),
oCamZoomPosition: oCamZoom.position.clone()
};
let height = 0, width = 0;
function focus (newTarget) {
// focus all cameras at a new target.
target.copy(newTarget || origin.target);
pCam.lookAt(target);
oCam.lookAt(target);
oCamZoom.lookAt(target);
}
function reset (newPosition, newTarget, newCanRotate) {
state = STATE.NONE;
allowRotation(newCanRotate);
position(newPosition);
pCam.up.copy(origin.pCamUp);
oCam.up.copy(origin.oCamUp);
focus(newTarget);
}
function position (v) {
// position all cameras at a new location.
pCam.position.copy(v || origin.pCamPosition);
oCam.position.copy(v || origin.oCamPosition);
oCamZoom.position.copy(v || origin.oCamZoomPosition);
}
function allowRotation (allowed=true) {
canRotate = allowed;
}
function disable () {
console.log('camera: disable');
enabled = false;
$(domElement).off('mousedown.camera');
$(domElement).off('wheel.camera');
$(document).off('mousemove.camera');
}
function enable () {
if (!enabled) {
console.log('camera: enable');
enabled = true;
$(domElement).on('mousedown.camera', onMouseDown);
$(domElement).on('wheel.camera', onMouseWheel);
}
}
function resize (w, h) {
const aspect = w / h;
height = h;
width = w;
// 1. Update the orthographic camera
if (aspect > 1) {
// w > h
oCam.left = -aspect;
oCam.right = aspect;
oCam.top = 1;
oCam.bottom = -1;
} else {
// h > w
oCam.left = -1;
oCam.right = 1;
oCam.top = 1 / aspect;
oCam.bottom = -1 / aspect;
}
oCam.updateProjectionMatrix();
// 2. Update the perceptive camera
pCam.aspect = aspect;
pCam.updateProjectionMatrix();
}
const tvec = new THREE.Vector3(); // a temporary vector for efficient maths
const tinput = new THREE.Vector3(); // temp vec used for
const normalMatrix = new THREE.Matrix3();
// mouse tracking variables
const mouseDownPosition = new THREE.Vector2();
const mousePrevPosition = new THREE.Vector2();
// Mouses position when in the middle of a click operation.
const mouseCurrentPosition = new THREE.Vector2();
// Mouses position hovering over the surface
const mouseHoverPosition = new THREE.Vector2();
const mouseMoveDelta = new THREE.Vector2();
function pan (distance) {
// first, handle the pCam...
const oDist = distance.clone();
normalMatrix.getNormalMatrix(pCam.matrix);
distance.applyMatrix3(normalMatrix);
distance.multiplyScalar(distanceToTarget() * 0.001);
pCam.position.add(distance);
// TODO should the target change as this?!
target.add(distance);
// second, the othoCam
const o = mousePositionInOrthographicView(oDist);
// relative x movement * otho width = how much to change horiz
const deltaH = o.xR * o.width;
oCam.left += deltaH;
oCam.right += deltaH;
// relative y movement * otho height = how much to change vert
const deltaV = o.yR * o.height;
oCam.top += deltaV;
oCam.bottom += deltaV;
oCam.updateProjectionMatrix();
controller.trigger('change');
}
function zoom (distance) {
const scalar = distance.z * 0.0007;
// First, handling the perspective matrix
normalMatrix.getNormalMatrix(pCam.matrix);
distance.applyMatrix3(normalMatrix);
distance.multiplyScalar(distanceToTarget() * 0.001);
pCam.position.add(distance);
// Then, the orthographic. In general, we are just going to squeeze in
// the bounds of the orthographic frustum to zoom.
if (oCam.right - oCam.left < 0.001 && scalar < 0) {
// trying to zoom in and we are already tight. return.
return;
}
// Difference must respect aspect ratio, otherwise we will distort
const a = ((oCam.top - oCam.bottom)) / (oCam.right - oCam.left);
// find out where the mouse currently is in the view.
const oM = mousePositionInOrthographicView(mouseHoverPosition);
// overall difference in height scale is scalar * 2, but we weight
// where this comes off based on mouse position
oCam.left -= (scalar * oM.xR) / (a);
oCam.right += (scalar * (1 - oM.xR)) / (a);
oCam.top += scalar * oM.yR;
oCam.bottom -= scalar * (1 - oM.yR);
if (oCam.left > oCam.right) {
oCam.left = oCam.right - 0.0001;
}
if (oCam.bottom > oCam.top) {
oCam.bottom = oCam.top - (0.0001 * a);
}
oCam.updateProjectionMatrix();
// call the mouse hover callback manually, he will trigger a change
// for us. Little nasty, but we mock the event...
onMouseMoveHover({
pageX: mouseHoverPosition.x,
pageY: mouseHoverPosition.y
});
controller.trigger('change');
}
function distanceToTarget () {
return tvec.subVectors(target, pCam.position).length();
}
const pVec = new THREE.Vector3();
// const sVec = new THREE.Vector3();
function projectMouseOnSphere (px, py) {
pVec.set(
(px - width / 2) / (width / 2),
(height - 2 * py) / screen.width,
0
);
return pVec;
}
// function projectMouseOnScreen (px, py) {
//
// }
// Rotation specific values
let lastAngle, angle;
const lastAxis = new THREE.Vector3();
const quaternion = new THREE.Quaternion();
const targetDirection = new THREE.Vector3();
const axis = new THREE.Vector3();
const upDirection = new THREE.Vector3();
const sidewaysDirection = new THREE.Vector3();
const moveDirection = new THREE.Vector3();
function rotateCamera (delta, camera, singleDir=false) {
let _delta;
if (singleDir) {
if (Math.abs(delta.x) >= Math.abs(delta.y)) {
_delta = new THREE.Vector3(delta.x, 0, 0);
} else {
_delta = new THREE.Vector3(0, delta.y, 0);
}
} else {
_delta = delta;
}
angle = _delta.length();
tvec.copy(camera.position).sub(target);
if (angle) {
targetDirection.copy(tvec).normalize();
upDirection.copy(camera.up).normalize();
sidewaysDirection.crossVectors(upDirection, targetDirection)
.normalize();
upDirection.setLength(_delta.y);
sidewaysDirection.setLength(_delta.x);
moveDirection.copy(upDirection.add(sidewaysDirection));
axis.crossVectors(moveDirection, tvec).normalize();
quaternion.setFromAxisAngle(axis, angle);
tvec.applyQuaternion(quaternion);
camera.up.applyQuaternion(quaternion);
lastAxis.copy(axis);
lastAngle = angle;
} else if (lastAngle) {
lastAngle *= Math.sqrt(1.0 - DAMPING_FACTOR);
quaternion.setFromAxisAngle(lastAxis, lastAngle);
tvec.applyQuaternion(quaternion);
camera.up.applyQuaternion(quaternion);
}
camera.position.copy(target).add(tvec);
camera.lookAt(target);
}
function rotate (delta, singleDir=false) {
rotateCamera(delta, pCam, singleDir);
rotateCamera(delta, oCam, singleDir);
rotateCamera(delta, oCamZoom, singleDir);
controller.trigger('change');
}
// mouse
function onMouseDown (event) {
console.log('camera: mousedown');
if (!enabled) {
return;
}
event.preventDefault();
switch (event.button) {
case 0:
if (!canRotate) {
state = STATE.PAN;
} else {
state = STATE.ROTATE;
}
break;
case 1:
state = STATE.ZOOM;
break;
case 2:
state = STATE.PAN;
break;
}
if (state === STATE.ROTATE) {
mouseDownPosition.copy(projectMouseOnSphere(event.pageX,
event.pageY));
} else {
mouseDownPosition.set(event.pageX, event.pageY);
}
mousePrevPosition.copy(mouseDownPosition);
mouseCurrentPosition.copy(mousePrevPosition);
$(document).on('mousemove.camera', onMouseMove);
// listen once for the mouse up
$(document).one('mouseup.camera', onMouseUp);
}
function onMouseMove (event) {
event.preventDefault();
if (state === STATE.ROTATE) {
mouseCurrentPosition.copy(
projectMouseOnSphere(event.pageX, event.pageY));
} else {
mouseCurrentPosition.set(event.pageX, event.pageY);
}
mouseMoveDelta.subVectors(mouseCurrentPosition, mousePrevPosition);
switch (state) {
case STATE.ROTATE:
tinput.copy(mouseMoveDelta);
tinput.z = 0;
tinput.multiplyScalar(ROTATION_SENSITIVITY);
rotate(tinput, event.ctrlKey);
break;
case STATE.ZOOM:
tinput.set(0, 0, mouseMoveDelta.y);
zoom(tinput);
break;
case STATE.PAN:
tinput.set(-mouseMoveDelta.x, mouseMoveDelta.y, 0);
pan(tinput);
break;
}
mousePrevPosition.copy(mouseCurrentPosition);
}
function mousePositionInOrthographicView (v) {
// convert into relative coordinates (0-1)
var x = v.x / domElement.offsetWidth;
var y = v.y / domElement.offsetHeight;
// get the current height and width of the orthographic
var oWidth = oCam.right - oCam.left;
var oHeight = oCam.top - oCam.bottom;
// so in this coordinate ortho matrix is focused around
var oX = oCam.left + x * oWidth;
var oY = oCam.bottom + (1 - y) * oHeight;
return {
x: oX,
y: oY,
xR: x,
yR: y,
width: oWidth,
height: oHeight
};
}
function onMouseMoveHover (event) {
mouseHoverPosition.set(event.pageX, event.pageY);
var oM = mousePositionInOrthographicView(mouseHoverPosition);
// and new bounds are
var zH = oM.height / PIP_ZOOM_FACTOR;
// TODO this assumes square PIP image
var zV = zH;
// reconstructing bounds is easy...
const zHm = zH / 2,
zVm = zV / 2;
oCamZoom.left = oM.x - (zHm);
oCamZoom.right = oM.x + (zHm);
oCamZoom.top = oM.y + (zVm);
oCamZoom.bottom = oM.y - (zVm);
oCamZoom.updateProjectionMatrix();
// emit a special change event. If the viewport is
// interested (i.e. we are in PIP mode) it can update
controller.trigger('changePip');
}
function onMouseUp (event) {
console.log('camera: up');
event.preventDefault();
$(document).off('mousemove.camera');
state = STATE.NONE;
}
function onMouseWheel (event) {
//console.log('camera: mousewheel');
if (!enabled) {
return;
}
// we need to check the deltaMode to determine the scale of the mouse
// wheel reading.
var scale = UNITS_FOR_MOUSE_WHEEL_DELTA_MODE[event.originalEvent.deltaMode];
tinput.set(0, 0, (-event.originalEvent.deltaY * MOUSE_WHEEL_SENSITIVITY * scale));
zoom(tinput);
}
// touch
const touch = new THREE.Vector3();
const prevTouch = new THREE.Vector3();
let prevDistance = null;
function touchStart (event) {
if (!enabled) {
return;
}
const touches = event.touches;
switch (touches.length) {
case 2:
var dx = touches[0].pageX - touches[1].pageX;
var dy = touches[0].pageY - touches[1].pageY;
prevDistance = Math.sqrt(dx * dx + dy * dy);
break;
}
prevTouch.set(touches[0].pageX, touches[0].pageY, 0);
}
function touchMove (event) {
if (!enabled) {
return;
}
event.preventDefault();
event.stopPropagation();
var touches = event.touches;
touch.set(touches[0].pageX, touches[0].pageY, 0);
switch (touches.length) {
case 1:
const delta = touch.sub(prevTouch).multiplyScalar(0.005);
delta.setY(-1 * delta.y);
rotate(delta);
break;
case 2:
var dx = touches[0].pageX - touches[1].pageX;
var dy = touches[0].pageY - touches[1].pageY;
var distance = Math.sqrt(dx * dx + dy * dy);
zoom(new THREE.Vector3(0, 0, prevDistance - distance));
prevDistance = distance;
break;
case 3:
pan(touch.sub(prevTouch).setX(-touch.x));
break;
}
prevTouch.set(touches[0].pageX, touches[0].pageY, 0);
}
//TODO should this always be enabled?
domElement.addEventListener('touchstart', touchStart, false);
domElement.addEventListener('touchmove', touchMove, false);
// enable everything on creation
enable();
$(domElement).on('mousemove.pip', onMouseMoveHover);
controller.allowRotation = allowRotation;
controller.enable = enable;
controller.disable = disable;
controller.resize = resize;
controller.focus = focus;
controller.position = position;
controller.reset = reset;
return controller;
}
|
//>>built
define("dojo/cldr/nls/zh-hant/indian",{"field-second":"\u79d2","field-year-relative+-1":"\u53bb\u5e74","field-week":"\u9031","field-month-relative+-1":"\u4e0a\u500b\u6708","field-day-relative+-1":"\u6628\u5929","months-format-narrow":"1 2 3 4 5 6 7 8 9 10 11 12".split(" "),"field-day-relative+-2":"\u524d\u5929","months-standAlone-narrow":"1 2 3 4 5 6 7 8 9 10 11 12".split(" "),"months-standAlone-wide":"\u5236\u6a80\u908f\u6708 \u5420\u820d\u4f49\u6708 \u901d\u745f\u5412\u6708 \u981e\u6c99\u837c\u6708 \u5ba4\u7f85\u4f10\u62cf\u6708 \u5a46\u7f85\u9262\u9640\u6708 \u981e\u6d87\u7e1b\u5e9a\u95cd\u6708 \u8fe6\u524c\u5e95\u8fe6\u6708 \u672b\u4f3d\u59cb\u7f85\u6708 \u5831\u6c99\u6708 \u78e8\u795b\u6708 \u9817\u52d2\u7ab6\u62cf\u6708".split(" "),
"field-year":"\u5e74","field-week-relative+0":"\u672c\u9031","months-standAlone-abbr":"\u5236\u6a80\u908f\u6708 \u5420\u820d\u4f49\u6708 \u901d\u745f\u5412\u6708 \u981e\u6c99\u837c\u6708 \u5ba4\u7f85\u4f10\u62cf\u6708 \u5a46\u7f85\u9262\u9640\u6708 \u981e\u6d87\u7e1b\u5e9a\u95cd\u6708 \u8fe6\u524c\u5e95\u8fe6\u6708 \u672b\u4f3d\u59cb\u7f85\u6708 \u5831\u6c99\u6708 \u78e8\u795b\u6708 \u9817\u52d2\u7ab6\u62cf\u6708".split(" "),"field-week-relative+1":"\u4e0b\u9031","field-minute":"\u5206\u9418","field-week-relative+-1":"\u4e0a\u9031",
"field-day-relative+0":"\u4eca\u5929","field-hour":"\u5c0f\u6642","field-day-relative+1":"\u660e\u5929","field-day-relative+2":"\u5f8c\u5929","field-day":"\u65e5","field-month-relative+0":"\u672c\u6708","field-month-relative+1":"\u4e0b\u500b\u6708","field-dayperiod":"\u4e0a\u5348/\u4e0b\u5348","field-month":"\u6708","months-format-wide":"\u5236\u6a80\u908f\u6708 \u5420\u820d\u4f49\u6708 \u901d\u745f\u5412\u6708 \u981e\u6c99\u837c\u6708 \u5ba4\u7f85\u4f10\u62cf\u6708 \u5a46\u7f85\u9262\u9640\u6708 \u981e\u6d87\u7e1b\u5e9a\u95cd\u6708 \u8fe6\u524c\u5e95\u8fe6\u6708 \u672b\u4f3d\u59cb\u7f85\u6708 \u5831\u6c99\u6708 \u78e8\u795b\u6708 \u9817\u52d2\u7ab6\u62cf\u6708".split(" "),
"field-era":"\u5e74\u4ee3","field-year-relative+0":"\u4eca\u5e74","field-year-relative+1":"\u660e\u5e74","months-format-abbr":"\u5236\u6a80\u908f\u6708 \u5420\u820d\u4f49\u6708 \u901d\u745f\u5412\u6708 \u981e\u6c99\u837c\u6708 \u5ba4\u7f85\u4f10\u62cf\u6708 \u5a46\u7f85\u9262\u9640\u6708 \u981e\u6d87\u7e1b\u5e9a\u95cd\u6708 \u8fe6\u524c\u5e95\u8fe6\u6708 \u672b\u4f3d\u59cb\u7f85\u6708 \u5831\u6c99\u6708 \u78e8\u795b\u6708 \u9817\u52d2\u7ab6\u62cf\u6708".split(" "),eraAbbr:["\u5370\u5ea6\u66c6"],"field-weekday":"\u9031\u5929",
"field-zone":"\u6642\u5340"});
//@ sourceMappingURL=indian.js.map |
import Vue from 'vue'
import App from './App'
import VueResource from 'vue-resource'
import VueRouter from 'vue-router'
import {config} from './setting'
Vue.use(VueResource)
Vue.use(VueRouter)
Vue.http.options.emulateJSON = true
var router = new VueRouter()
var Home = Vue.extend({
template: '<p>我是首页</p>',
created: function () {
this.$route.router.go('/quote')
}
})
var Page404 = Vue.extend({
template: '<p> 404 Not Found! redirect <h3><a style="color:blue" v-link="{path:\'/quote\'}">/</a> </p>' +
'<p><a style="color:blue" v-link="{path:\'/async\'}">async test</a></h3></p>'
})
// 创建一个路由器实例
// 创建实例时可以传入配置参数进行定制,为保持简单,这里使用默认配置
var router = new VueRouter()
// 定义路由规则
router.map({
'/': {
component: function (resolve) {
require(['./quote/quote-first.vue'], resolve)
},
config: config
},
'/quote': {
component: function (resolve) {
require(['./quote/quote-first.vue'], resolve)
},
config: config
},
'/quote-second': {
component: function (resolve) {
require(['./quote/quote-second.vue'], resolve)
},
config: config
},
'/quote-third': {
component: function (resolve) {
require(['./quote/quote-third.vue'], resolve)
},
config: config
},
'/quote-fourth': {
component: function (resolve) {
require(['./quote/quote-fourth.vue'], resolve)
},
config: config
},
'/404': {
component: Page404,
config: config
},
'/quote-photograph': {
component: function (resolve) {
require(['./quote/quote-photograph.vue'], resolve)
},
config: config
}
})
router.redirect({
'*' : '/404'
})
router.beforeEach(function(transition) {
transition.next()
})
router.start(App, 'app')
|
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @fileoverview
* settings-slider wraps a cr-slider. It maps the slider's values from a
* linear UI range to a range of real values. When |value| does not map exactly
* to a tick mark, it interpolates to the nearest tick.
*/
Polymer({
is: 'settings-slider',
behaviors: [CrPolicyPrefBehavior],
properties: {
/** @type {!chrome.settingsPrivate.PrefObject} */
pref: Object,
/**
* Values corresponding to each tick.
* @type {!Array<cr_slider.SliderTick>|!Array<number>}
*/
ticks: {
type: Array,
value: () => [],
},
/**
* A scale factor used to support fractional pref values. This is not
* compatible with |ticks|, i.e. if |scale| is not 1 then |ticks| must be
* empty.
*/
scale: {
type: Number,
value: 1,
},
min: Number,
max: Number,
labelAria: String,
labelMin: String,
labelMax: String,
disabled: Boolean,
showMarkers: Boolean,
/** @private */
disableSlider_: {
computed: 'computeDisableSlider_(pref.*, disabled, ticks.*)',
type: Boolean,
},
updateValueInstantly: {
type: Boolean,
value: true,
observer: 'onSliderChanged_',
},
loaded_: Boolean,
},
observers: [
'valueChanged_(pref.*, ticks.*, loaded_)',
],
attached() {
this.loaded_ = true;
},
/**
* @param {number|cr_slider.SliderTick} tick
* @return {number|undefined}
*/
getTickValue_(tick) {
return typeof tick === 'object' ? tick.value : tick;
},
/**
* @param {number} index
* @return {number|undefined}
* @private
*/
getTickValueAtIndex_(index) {
return this.getTickValue_(this.ticks[index]);
},
/**
* Sets the |pref.value| property to the value corresponding to the knob
* position after a user action.
* @private
*/
onSliderChanged_() {
if (!this.loaded_) {
return;
}
if (this.$.slider.dragging && !this.updateValueInstantly) {
return;
}
const sliderValue = this.$.slider.value;
let newValue;
if (this.ticks && this.ticks.length > 0) {
newValue = this.getTickValueAtIndex_(sliderValue);
} else {
newValue = sliderValue / this.scale;
}
this.set('pref.value', newValue);
},
/** @private */
computeDisableSlider_() {
return this.disabled || this.isPrefEnforced();
},
/**
* Updates the knob position when |pref.value| changes. If the knob is still
* being dragged, this instead forces |pref.value| back to the current
* position.
* @private
*/
valueChanged_() {
if (this.pref === undefined || !this.loaded_ || this.$.slider.dragging ||
this.$.slider.updatingFromKey) {
return;
}
// First update the slider settings if |ticks| was set.
const numTicks = this.ticks.length;
if (numTicks === 1) {
this.$.slider.disabled = true;
return;
}
const prefValue = /** @type {number} */ (this.pref.value);
// The preference and slider values are continuous when |ticks| is empty.
if (numTicks === 0) {
this.$.slider.value = prefValue * this.scale;
return;
}
assert(this.scale === 1);
// Limit the number of ticks to 10 to keep the slider from looking too busy.
const MAX_TICKS = 10;
this.$.slider.markerCount =
(this.showMarkers || numTicks <= MAX_TICKS) ? numTicks : 0;
// Convert from the public |value| to the slider index (where the knob
// should be positioned on the slider).
const index =
this.ticks.map(tick => Math.abs(this.getTickValue_(tick) - prefValue))
.reduce(
(acc, diff, index) => diff < acc.diff ? {index, diff} : acc,
{index: -1, diff: Number.MAX_VALUE})
.index;
assert(index !== -1);
if (this.$.slider.value !== index) {
this.$.slider.value = index;
}
const tickValue = this.getTickValueAtIndex_(index);
if (this.pref.value !== tickValue) {
this.set('pref.value', tickValue);
}
},
/**
* @return {string}
* @private
*/
getRoleDescription_() {
return loadTimeData.getStringF(
'settingsSliderRoleDescription', this.labelMin, this.labelMax);
},
});
|
from account.models import Account
from django.db import models
from time import time
def get_upload_file_name(instance, filename):
return "uploaded_files/%s" % filename
# TODO: OneToOne may be better instead of using username
class SolverListModel(models.Model):
username = models.CharField(max_length=30, null=False)
problem_id = models.PositiveSmallIntegerField(null=False)
breakthru_point = models.PositiveSmallIntegerField(default=0, null=False)
class Categories(models.Model):
title = models.CharField(max_length=40, null=False)
color = models.CharField(max_length=20, null=False)
class LogEntries(models.Model):
account = models.ForeignKey(Account, null=True)
description = models.CharField(max_length=100)
time = models.DateTimeField(auto_now_add=True, auto_now=False)
# It store CTF problem entry
class Entries(models.Model):
# problem title
title = models.CharField(max_length=50, null=False)
# problem description
description = models.TextField(null=False)
# count solver
solver_count = models.PositiveSmallIntegerField(default=0, null=True)
# problem points
point = models.PositiveSmallIntegerField(default=1, null=False)
# problem answer it save md5 value of answer
answer = models.CharField(max_length=32, null=False)
# problem file
problem_file = models.FileField(upload_to=get_upload_file_name)
# It save problem solver, so we can know who solve this problem
solver_list = models.ManyToManyField(SolverListModel)
# Problem Type -> Reversing, System, Web, Network, Crypto ...
category = models.ForeignKey(Categories)
# Problem can be deactivated when CTF is over or other reasons ...
is_active = models.BooleanField(default=True)
|
var nodebb = require('../nodebb'),
Groups = nodebb.Groups;
var config = require('../config');
(function (utils) {
//for visit control
utils.canMark = function (tid, uid, callback) {
config.getSettings(function(err,setting){
Groups.isMember(uid, setting.group, callback);
})
};
}(module.exports));
|
from wss_tools.utils.io import output_xml
def test_output_xml(tmpdir):
filename = str(tmpdir.join('simple.xml'))
xmldict = {'foo': 'bar'}
output_xml(xmldict, filename)
with open(filename) as f:
lines = f.readlines()
assert len(lines) == 2
assert lines[0] == '<?xml version="1.0" ?>\n'
assert lines[1] == '<foo>bar</foo>\n'
|
// theme.js
export const blueTheme = {
body: "#EDF9FE",
text: "#001C55",
highlight: "#A6E1FA",
dark: "#00072D",
secondaryText: "#7F8DAA",
imageHighlight: "#0E6BA8",
compImgHighlight: "#E6E6E6",
jacketColor: "#0A2472",
headerColor: "#0E6BA877",
};
export const brownTheme = {
body: "#FFFEFD",
text: "#5D2A42",
highlight: "#FFF9EC",
dark: "#00072D",
secondaryText: "#8D697A",
imageHighlight: "#E29F95",
compImgHighlight: "#E6E6E6",
jacketColor: "#FB6376",
headerColor: "#E29F9577",
};
export const purpleTheme = {
body: "#F8EFF4",
text: "#231942",
highlight: "#E0B1CB",
dark: "#00072D",
secondaryText: "#655E7A",
imageHighlight: "#BE95C4",
compImgHighlight: "#E6E6E6",
jacketColor: "#5E548E",
headerColor: "#BE95C477",
};
export const yelGreenTheme = {
body: "#FFFFEB",
text: "#003F2F",
highlight: "#dddf00",
dark: "#00072D",
secondaryText: "#4CA58F",
imageHighlight: "#55a630",
compImgHighlight: "#E6E6E6",
jacketColor: "#007f5f",
headerColor: "#55a63077",
};
export const redTheme = {
body: "#FFF8E6",
text: "#6a040f",
highlight: "#ffba08",
dark: "#03071e",
secondaryText: "#964F56",
imageHighlight: "#dc2f02",
compImgHighlight: "#E6E6E6",
jacketColor: "#9d0208",
headerColor: "#dc2f0277",
};
export const blackTheme = {
body: "#E5E5E5",
text: "#14213d",
highlight: "#ffffff",
dark: "#000000",
secondaryText: "#5A6377",
imageHighlight: "#fca311",
compImgHighlight: "#E6E6E6",
jacketColor: "#8d99ae",
headerColor: "#fca31177",
};
export const pinkTheme = {
body: "#FEE9F2",
text: "#620E34",
highlight: "#FBA7CD",
dark: "#31071A",
secondaryText: "#ef476f",
imageHighlight: "#ef476f",
compImgHighlight: "#E6E6E6",
jacketColor: "#8d99ae",
headerColor: "#ef476f77",
};
export const violetTheme = {
body: "#F4EEFC",
text: "#430A58",
highlight: "#D6BEF4",
dark: "#21052C",
secondaryText: "#875599",
imageHighlight: "#9b5de5",
compImgHighlight: "#E6E6E6",
jacketColor: "#763D8B",
headerColor: "#9b5de577",
};
export const greenTheme = {
body: "#E6FAF5",
text: "#084c61",
highlight: "#9BEED8",
dark: "#031E26",
secondaryText: "#528190",
imageHighlight: "#07beb8",
compImgHighlight: "#E6E6E6",
jacketColor: "#56a3a6",
headerColor: "#07beb877",
};
export const orangeTheme = {
body: "#FFF0EA",
text: "#99401F",
highlight: "#FFB59A",
dark: "#33150A",
secondaryText: "#CC552A",
imageHighlight: "#FF6B35",
compImgHighlight: "#E6E6E6",
jacketColor: "#d7263d",
headerColor: "#FF6B3577",
};
export const chosenTheme = redTheme;
|
"""
Copyright (c) Facebook, Inc. and its affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
import bisect
import logging
import math
import pickle
import random
import warnings
from pathlib import Path
import lmdb
import numpy as np
import torch
from torch.utils.data import Dataset
from torch_geometric.data import Batch
from ocpmodels.common import distutils
from ocpmodels.common.registry import registry
from ocpmodels.common.utils import pyg2_data_transform
@registry.register_dataset("oc22_lmdb")
class OC22LmdbDataset(Dataset):
r"""Dataset class to load from LMDB files containing relaxation
trajectories or single point computations.
Useful for Structure to Energy & Force (S2EF), Initial State to
Relaxed State (IS2RS), and Initial State to Relaxed Energy (IS2RE) tasks.
Args:
config (dict): Dataset configuration
transform (callable, optional): Data transform function.
(default: :obj:`None`)
"""
def __init__(self, config, transform=None):
super(OC22LmdbDataset, self).__init__()
self.config = config
self.path = Path(self.config["src"])
self.data2train = self.config.get("data2train", "all")
if not self.path.is_file():
db_paths = sorted(self.path.glob("*.lmdb"))
assert len(db_paths) > 0, f"No LMDBs found in '{self.path}'"
self.metadata_path = self.path / "metadata.npz"
self._keys, self.envs = [], []
for db_path in db_paths:
self.envs.append(self.connect_db(db_path))
try:
length = pickle.loads(
self.envs[-1].begin().get("length".encode("ascii"))
)
except TypeError:
length = self.envs[-1].stat()["entries"]
self._keys.append(list(range(length)))
keylens = [len(k) for k in self._keys]
self._keylen_cumulative = np.cumsum(keylens).tolist()
self.num_samples = sum(keylens)
if self.data2train != "all":
txt_paths = sorted(self.path.glob("*.txt"))
index = 0
self.indices = []
for txt_path in txt_paths:
lines = open(txt_path).read().splitlines()
for line in lines:
if self.data2train == "adslabs":
if "clean" not in line:
self.indices.append(index)
if self.data2train == "slabs":
if "clean" in line:
self.indices.append(index)
index += 1
self.num_samples = len(self.indices)
else:
self.metadata_path = self.path.parent / "metadata.npz"
self.env = self.connect_db(self.path)
self._keys = [
f"{j}".encode("ascii")
for j in range(self.env.stat()["entries"])
]
self.num_samples = len(self._keys)
self.transform = transform
self.lin_ref = self.oc20_ref = False
self.train_total = self.config.get("total_energy", False)
# only needed for oc20 datasets, oc22 is total by default
if self.train_total:
self.oc20_ref = pickle.load(open(config["oc20_ref"], "rb"))
if self.config.get("lin_ref", False):
coeff = np.load(self.config["lin_ref"], allow_pickle=True)["coeff"]
self.lin_ref = torch.nn.Parameter(
torch.tensor(coeff), requires_grad=False
)
self.subsample = self.config.get("subsample", False)
def __len__(self):
if self.subsample:
return min(self.subsample, self.num_samples)
return self.num_samples
def __getitem__(self, idx):
if self.data2train != "all":
idx = self.indices[idx]
if not self.path.is_file():
# Figure out which db this should be indexed from.
db_idx = bisect.bisect(self._keylen_cumulative, idx)
# Extract index of element within that db.
el_idx = idx
if db_idx != 0:
el_idx = idx - self._keylen_cumulative[db_idx - 1]
assert el_idx >= 0
# Return features.
datapoint_pickled = (
self.envs[db_idx]
.begin()
.get(f"{self._keys[db_idx][el_idx]}".encode("ascii"))
)
data_object = pyg2_data_transform(pickle.loads(datapoint_pickled))
data_object.id = f"{db_idx}_{el_idx}"
else:
datapoint_pickled = self.env.begin().get(self._keys[idx])
data_object = pyg2_data_transform(pickle.loads(datapoint_pickled))
if self.transform is not None:
data_object = self.transform(data_object)
# make types consistent
sid = data_object.sid
if isinstance(sid, torch.Tensor):
sid = sid.item()
data_object.sid = sid
if "fid" in data_object:
fid = data_object.fid
if isinstance(fid, torch.Tensor):
fid = fid.item()
data_object.fid = fid
if hasattr(data_object, "y_relaxed"):
attr = "y_relaxed"
elif hasattr(data_object, "y"):
attr = "y"
# if targets are not available, test data is being used
else:
return data_object
# convert s2ef energies to raw energies
if attr == "y":
# OC20 data
if "oc22" not in data_object and self.train_total:
randomid = f"random{sid}"
data_object[attr] += self.oc20_ref[randomid]
data_object.nads = 1
data_object.oc22 = 0
# convert is2re energies to raw energies
else:
if "oc22" not in data_object and self.train_total:
randomid = f"random{sid}"
data_object[attr] += self.oc20_ref[randomid]
del data_object.force
del data_object.y_init
data_object.nads = 1
data_object.oc22 = 0
if self.lin_ref is not False:
lin_energy = sum(self.lin_ref[data_object.atomic_numbers.long()])
data_object[attr] -= lin_energy
# to jointly train on oc22+oc20, need to delete these oc20-only attributes
# ensure otf_graph=1 in your model configuration
if "edge_index" in data_object:
del data_object.edge_index
if "cell_offsets" in data_object:
del data_object.cell_offsets
if "distances" in data_object:
del data_object.distances
return data_object
def connect_db(self, lmdb_path=None):
env = lmdb.open(
str(lmdb_path),
subdir=False,
readonly=True,
lock=False,
readahead=False,
meminit=False,
max_readers=1,
)
return env
def close_db(self):
if not self.path.is_file():
for env in self.envs:
env.close()
else:
self.env.close()
|
import { expect } from 'chai';
import { fromJS } from 'immutable';
import { reducer as maintainersReducer, MaintainersActions, MaintainersTypes } from '../maintainers.redux';
describe('Maintainers: redux', () => {
const state = fromJS({
items: [],
});
describe('reducer', () => {
it('should return initial state', () => {
expect(maintainersReducer(undefined, {}).toJS()).to.deep.equal(state.toJS());
});
it('should return state on unknown action', () => {
expect(maintainersReducer(state, { type: 'unknown-action' }).toJS()).to.deep.equal(state.toJS());
});
it('should set data on FETCH_SUCCESS', () => {
const data = ['object-1', 'object-2'];
const expectedState = state.set('items', data);
const action = { data, type: MaintainersTypes.FETCH_SUCCESS };
expect(maintainersReducer(state, action).toJS()).to.deep.equal(expectedState.toJS());
});
});
describe('fetch', () => {
it('should return correct type', () => {
expect(MaintainersActions.fetch().type).to.equal(MaintainersTypes.FETCH);
});
it('should return proper payload', () => {
const language = 'en';
expect(MaintainersActions.fetch(language).language).to.deep.equal(language);
});
});
describe('fetchSuccess', () => {
it('should return correct type', () => {
expect(MaintainersActions.fetchSuccess().type).to.equal(MaintainersTypes.FETCH_SUCCESS);
});
it('should return proper payload', () => {
const data = { key: 'value' };
expect(MaintainersActions.fetchSuccess(data).data).to.equal(data);
});
});
describe('fetchError', () => {
it('should return correct type', () => {
expect(MaintainersActions.fetchError().type).to.equal(MaintainersTypes.FETCH_ERROR);
});
it('should return proper payload', () => {
const error = { prop: 'value' };
expect(MaintainersActions.fetchError(error).payload).to.equal(error);
});
});
});
|
// console.log("main.js loaded");
var uni = (function () {
var template = $("body").data("template");
switch (template) {
case 'grd':
// Active Template Class
$("body").addClass(template);
// $("body").addClass("scroll-nav");
// console.log("Template: "+template);
break;
case 'pos':
$("body").addClass(template);
// $("body").addClass("switcher-nav");
if ($("body").hasClass("switcher-nav")) {
var prevScreen = $(".content-index li[class*='active'] a").data("switcher");
var activeScreen = $(".content-index li[class*='active'] a").data("switcher");
}
// console.log("Template: " + template);
break;
case 'pos100':
$("body").addClass(template);
// $("body").addClass("switcher-nav");
if ($("body").hasClass("switcher-nav")) {
var prevScreen = $(".content-index li[class*='active'] a").data("switcher");
var activeScreen = $(".content-index li[class*='active'] a").data("switcher");
}
// console.log("Template: " + template);
break;
case 'apr':
$("body").addClass(template);
// console.log("Template: " + template);
break;
default:
alert('Defina o Template!');
}
var hideTopbar = function () {
var wstPrev = $(window).scrollTop()
$(window).scroll(function () {
var wstNow = $(window).scrollTop();
// console.log('scrolling ', wstPrev, wstNow, dh);
if (wstPrev > wstNow) {
$('.top-bar').removeClass('hide');
} else {
$('.top-bar').addClass('hide');
}
wstPrev = wstNow;
return hideTopbar;
});
}
// Cover Start Animation
var coverAnimate = function () {
$("#cover").addClass("uk-animation-slide-top uk-animation-reverse");
$("#main-content").addClass("uk-animation-fade");
// UIkit.switcher($('.content-index')).show(screen);
setTimeout(function () {
$("#cover").addClass("hidden");
uni.activeNav(0);
$("#uni").removeClass("cover-lock");
}, 1000);
uni.loopNav(0);
return coverAnimate;
}
// Scroll Navigation
var scrollNav = function () {
$.scrollify({
section: '.section',
sectionName: 'section',
easing: "easeOutExpo",
standardScrollElements: ".scroll-defaut",
// interstitialSection: "",
offset: 0,
scrollSpeed: 500,
scrollbars: true,
setHeights: true,
overflowScroll: true,
updateHash: false,
touchScroll: true,
before: function (index, sections) {
// console.log("Before Index: " + index);
},
after: function (index, sections) {
// console.log("After Index: " + index);
$.scrollify.update()
},
afterResize: function () {
// console.log("After Render: Update");
$.scrollify.update();
},
afterRender: function () {
// console.log("After Render: Update");
$.scrollify.update();
}
});
// Atualiza o tamanho das seções de acordo com o conteúdo
// $(window).resize(function () {
// $.scrollify.update();
// });
$(".section").on("click", function () {
$.scrollify.update();
});
return scrollNav;
}
var switcherNav = function () {
// console.log("Screen: " + activeScreen);
// console.log("Prev Screen: " + prevScreen);
// console.log(" -- START -- ");
prevScreen = $(".content-index li[class*='active'] a").data("switcher");
// Screen Switch
$(".nav-switcher [data-switcher]").on("click", function (e) {
e.preventDefault();
var n = $(this).data("switcher");
// console.log("Screen: " + activeScreen);
// console.log("Prev Screen: " + prevScreen);
// console.log(" ");
if (n !== "undefined" || n !== "") {
UIkit.switcher($('.content-index')).show(n);
activeScreen = $(".content-index li[class*='active'] a").data("switcher");
// console.log("Screen: " + activeScreen);
// console.log("Prev Screen: " + prevScreen);
if (activeScreen !== prevScreen) {
uni.activeNav(activeScreen);
uni.loopNav(activeScreen);
$(document).scrollTop(0);
// console.log("=/=");
prevScreen = activeScreen;
// console.log("Screen: " + activeScreen);
// console.log("Prev Screen: " + prevScreen);
}
}
});
return switcherNav;
}
var activeNav = function (n) {
$(".nav-switcher [data-switcher]").removeClass("active");
$(".nav-menu li [data-switcher=" + n + "]").addClass("active");
return activeNav;
}
var loopNav = function (n) {
// console.log(":B");
if ($(".content-nav").hasClass("no-loop")) {
var firstScreen = $(".content-index li").first().index();
var lastScreen = $(".content-index li").last().index();
// console.log("FS: " + firstScreen + " | LS: " + lastScreen);
if (n === lastScreen) {
$(".content-nav a").removeClass("hidden");
$(".content-nav .next").addClass("hidden");
// console.log("Ultima tela: " + n);
} else if (n === firstScreen) {
$(".content-nav a").removeClass("hidden");
$(".content-nav .previous").addClass("hidden");
// console.log("Primeira Tela: " + n);
} else {
$(".content-nav a").removeClass("hidden");
// console.log("Outra Tela: " + n);
}
}
return loopNav;
}
// Content Controller
var contentController = function () {
var contents = $("#main-content > .section")
.map(function () { return this.id; }) // convert to set of IDs
.get();
// console.log("CC IDs " + contents);
var contentLinks = $("#uni .nav-menu:first [class*='nav-link'] a")
.map(function () { return $(this).attr("href").replace("#", ""); }) // convert to set of IDs
.get(); // convert to instance of Array (optional)
// console.log("CC Links " + contentLinks);
var contentOff = $("#main-content > .section[data-cc='off']")
.map(function () { return this.id; }) // convert to set of IDs
.get();
// console.log("CC OFF ARR: ["+contentOff+"]");
function compareArrays(arr1, arr2) {
return $(arr1).not(arr2).length == 0 && $(arr2).not(arr1).length == 0
};
if (!compareArrays(contents, contentLinks)) {
$.grep(contentLinks, function (el) {
if ($.inArray(el, contents) == -1) {
contentOff.push(el);
// console.log("CC OFF ARR: [" + contentOff + "]");
}
});
}
$.each(contentOff, function (index, value) {
// console.log("CC Link OFF EL: " + contentLinks.indexOf(value) + " : " + value);
// console.log("CC ID OFF EL: " + contents.indexOf(value) + " : " + value);
if (contentLinks.indexOf(value) > -1) {
contentLinks.splice(contentLinks.indexOf(value), 1);
}
if (contents.indexOf(value) > -1) {
contents.splice(contents.indexOf(value), 1);
}
$("#"+value).remove();
$("[class*='nav-link'] [href$='#"+value+"']").parent().remove();
// console.log("CC IDs " + contents);
// console.log("CC Links " + contentLinks);
// console.log("CC OFF ARR: [" + contentOff + "] | CC OFF Length: " + contentOff.length);
});
$.each(contentLinks, function (index, value) {
// console.log("CC Links " + index + " : " + value);
$("[class*='nav-link'] [href$='#" + value + "']").attr("data-switcher", index);
});
$.each(contents, function (index, value) {
// console.log("CC IDs: " + index + " : " + value);
$("#"+value).addClass("ok");
});
// console.log("CC Links " + contentLinks);
// console.log("CC IDs " + contents);
return contentController;
}
// Players Audio & Video
var players = Plyr.setup('.js-player');
// Scroll to Target
jQuery.fn.extend({
scrollTo: function (speed, easing) {
return this.each(function () {
var targetOffset = $(this).offset().top;
$('html,body').animate({
scrollTop: targetOffset
}, speed, easing);
});
}
});
// Height Calc
var heightCalc = function () {
$('[data-sizev="fit-content"]').each(function () {
var inner = $('[data-sizev="fit-content"] [data-sizev="target"]');
$('[data-sizev="fit-content"]').height(inner.outerHeight(true));
// console.log("H:" + $(this).innerHeight());
// $(this).height(inner.outerHeight(true));
// $(this).width(inner.outerWidth(true));
});
return heightCalc;
}
$(window).resize(function () {
heightCalc();
});
// ---
return {
coverAnimate: coverAnimate,
hideTopbar: hideTopbar,
activeNav: activeNav,
loopNav: loopNav,
scrollNav: scrollNav,
switcherNav: switcherNav,
contentController: contentController,
heightCalc: heightCalc
}
}());
// Start Scroll from Beginning
$(window).on('beforeunload', function () {
$(window).scrollTop(0);
});
// Start Document
$(document).ready(function () {
// === START ===
uni.contentController();
// console.log("> start");
// === NAVEGAÇÂO ===
// NAVEGAÇÃO SLIDES (SWITCHER)
if ($("body").hasClass("switcher-nav")) {
// console.log("> switcher-nav");
uni.switcherNav();
}
// NAV OFF-CANVAS - Controles da Navegação
$(".nav-off-canvas").sidenav({
// Desativa/Ativa o scrollify na navegaçã mobile
onOpenEnd: function () {
$(".nav-oc-trigger").addClass("open");
if ($("body").hasClass("scroll-nav")) {
$.scrollify.disable();
}
// console.log('side nav is open');
},
onCloseEnd: function () {
$(".nav-oc-trigger").removeClass("open");
if ($("body").hasClass("scroll-nav")) {
$.scrollify.enable();
}
// console.log('side nav is close');
}
});
// Nav-oc-trigger on/off
$(".nav-off-canvas li").on("click", function () {
$(".nav-off-canvas").sidenav("close");
});
$(".nav-oc-trigger .close").on("click", function () {
$(".nav-off-canvas").sidenav("close");
});
// Fix bug of sidenav link "close"
$(".nav-oc-trigger").on("click", function (e) {
e.preventDefault();
});
// NAV FLUTUANTE
$('.fixed-action-btn').floatingActionButton({
hoverEnabled: false
});
// NAVEGAÇÃO SCROLL
if ($("body").hasClass("scroll-nav")) {
// console.log("> scroll-nav");
uni.scrollNav();
}
// COVER - Animação da Capa (jQuery-Scroll-Trigger)
if ($("#cover").hasClass("cover-animate")) {
// console.log("> cover-animate");
$('#cover').scrolltrigger({
swipeMode: true,
swipeUp: function () {
uni.coverAnimate();
// console.log("SWUP");
},
scrollDown: function () {
uni.coverAnimate();
// console.log("SCDOWN");
}
});
$(".scroll-arrow").on("click", function (e) {
e.preventDefault();
uni.coverAnimate();
});
}
// TOPBAR - Hide topbar on scroll
if ($("body").hasClass("top-bar-hidden")) {
// console.log("> top-bar-hidden");
uni.hideTopbar();
}
// Dinamic Height Calculation
uni.heightCalc();
// Materialize Calls
// M.AutoInit(); // Materialize 'All Components' Start (não funciona bem)
$(".modal").modal();
$(".dropdown-button").dropdown();
$(".dropdown-trigger").dropdown();
$(".carousel.carousel-slider").carousel({
fullWidth: true,
indicators: true
});
$(".materialboxed").materialbox({
onOpenStart: function () {
$(".top-bar").addClass("opacity-0");
$(".content-nav").addClass("opacity-0");
},
onCloseStart: function () {
$(".top-bar").removeClass("opacity-0");
$(".content-nav").removeClass("opacity-0");
}
});
$('.collapsible').collapsible();
// Lightbox Transparent Image Fix
$("[uk-lightbox] a").on("click", function () {
var imgSrc = $(this).children("img").attr("src"),
transparentImg = $(this).children("img").hasClass("transparent-img");
// console.log("SRC: " + imgSrc);
$(document).on('itemshow', $("[uk-lightbox]"), function () {
if (transparentImg) {
// console.log("it works: .uk-lightbox img[src*='" + imgSrc + "']");
setTimeout(function () {
$(".uk-lightbox img[src*='" + imgSrc + "']").addClass("transparent-img transition");
}, 50);
}
});
});
// Topics Nav Sync
$(".topics-nav li").on("click", function () {
var i = ($(this).index()+1);
setTimeout(function () {
$(".topics-nav li").removeClass("uk-active");
$(".topics-nav li:nth-child("+i+")").addClass("uk-active");
// console.log("i: "+i);
}, 1000);
});
// DESAFIO
$('.desafio .collapsible.expandable').collapsible({
accordion: false
});
$(".desafio .collapsible-header").on("click", function () {
if (!$(".desafio .challenge-fields").hasClass("active")) {
$(".desafio .challenge-fields").addClass("active");
} else {
$(".desafio .challenge-fields").addClass("finished");
$(".desafio .challenge-fields .challenge-answer .challenge-text").attr("disabled", "disabled");
}
});
}); |
from flask import Flask, render_template, request, redirect, url_for
import mysql.connector
from flask_classful import FlaskView
from orders_class import OrderView
from products_class import ProductView
from stocks_class import StocksView
from info_class import InfoView
mydb = mysql.connector.connect(
host="localhost",
user="root",
password="Chellasami54321#",
database="inventory",
auth_plugin='mysql_native_password'
)
mycursor = mydb.cursor()
app = Flask(__name__)
class HomeView(FlaskView):
default_methods = ['GET','POST']
route_base='/'
mycursor.execute("CREATE DATABASE IF NOT EXISTS inventory")
def index(self):
return redirect(url_for('HomeView:login'))
def homepage_emp(self):
return render_template("home1.html")
def homepage_man(self):
return render_template("home2.html")
def login(self):
access ={
'employee':'pass',
'manager':'pass'}
error = None
if request.method == 'POST':
username = request.form['username']
passwd = request.form['password']
if username not in access.keys() or passwd != access[username]:
error = 'Invalid Credentials. Please try again.'
else:
if(username=='employee'):
return redirect(url_for('HomeView:homepage_emp'))
else:
return redirect(url_for('HomeView:homepage_man'))
return render_template('login.html', error=error)
HomeView.register(app)
StocksView.register(app)
OrderView.register(app)
ProductView.register(app)
InfoView.register(app)
if __name__ == '__main__':
app.run(debug=True)
|
import React from 'react';
import CharacterSheet from '../character-sheet';
import Player from './Player';
import Clipboard from '../utils/Clipboard';
import TestUtils from '../utils/TestUtils';
import CharacterData from '../model/CharacterData';
describe('CharacterSheet', () => {
let component;
let componentRoot;
let characterData;
let tree;
let clipboard;
describe('setup', () => {
describe('with no character data and no clipboard', () => {
beforeEach(() => {
characterData = {
...new CharacterData(),
player: {
name: 'playerName',
gameMaster: 'someGameMaster',
campaign: 'someCampaign',
campaignYear: 'someCampaignYear'
},
character: {
name: 'characterName'
}
};
clipboard = {
copyTextToClipboard: jest.fn()
};
component = TestUtils.buildComponent(<CharacterSheet/>).withIntl().build();
componentRoot = component.root;
tree = component.toJSON();
});
it('should match previous snapshot', () => {
expect(tree).toMatchSnapshot();
});
it('should have correct clipboard set', () => {
let characterSheet = componentRoot.findByType(CharacterSheet);
expect(characterSheet.children[0].instance.clipboard).toBe(Clipboard);
});
});
describe('with character data and clipboard', () => {
let alertMock;
beforeEach(() => {
alertMock = {
show: jest.fn()
};
characterData = {
...new CharacterData(),
player: {
name: 'someName',
gameMaster: 'someGameMaster',
campaign: 'someCampaign',
campaignYear: 'someCampaignYear'
},
character: {
name: 'characterName'
},
experiencePoints: {
current: 50,
total: 150
}
};
alertMock = {
show: jest.fn()
};
clipboard = {
copyTextToClipboard: jest.fn()
};
component = TestUtils.buildComponent(<CharacterSheet characterData={characterData} clipboard={clipboard} alert={alertMock}/>).withIntl().build();
componentRoot = component.root;
tree = component.toJSON();
});
it('should match previous snapshot', () => {
expect(tree).toMatchSnapshot();
});
describe('Copy character to clipboard', () => {
beforeEach(() => {
let containerDiv = componentRoot.findByProps({id: 'character-json'});
let button = containerDiv.findByType('button');
button.props.onClick();
});
it('should copy encoded character data to clipboard', () => {
expect(clipboard.copyTextToClipboard).toHaveBeenCalledWith(btoa(JSON.stringify(characterData)));
});
});
describe('Player data change', () => {
const changeData = {name: 'name', value: 'someNewName'};
let player;
beforeEach(() => {
player = componentRoot.findByType(Player);
player.props.onChange(changeData);
});
it('should change state', () => {
let characterSheet = componentRoot.findByType(CharacterSheet);
expect(characterSheet.children[0].instance.state.characterData.player.name).toEqual(changeData.value);
});
});
});
});
});
|
import React from 'react';
import { WebView } from 'react-native-webview';
function WebScreen({ route }) {
const { url } = route.params;
return <WebView source={{ uri: url }} />;
}
export default WebScreen;
|
"""Create Notepad using Tkinter."""
from tkinter import *
from tkinter import messagebox
from tkinter.constants import END, NONE
def YesClick():
global Name
Name = str(FileName.get()) + ".txt"
save = open(str(Name), "a")
save.write(text_area.get("1.0", END))
text_area.delete("1.0", END)
new_win.destroy()
def SaveClick():
global Name
Name = str(FileName.get()) + ".txt"
save = open(str(Name), "w")
save.write(text_area.get("1.0", END))
new_win.destroy()
def NewSheet():
ans = messagebox.askyesno("Question:", "Do you wish to save the file?")
if ans:
global new_win
new_win = Tk()
new_win.title("Enter file Name")
new_win.geometry("200x80")
Label(new_win, text="Enter the file Name").pack()
global FileName
FileName = Entry(new_win)
FileName.pack(pady=10)
Button(new_win, text="Yes", command=YesClick).pack()
else:
text_area.delete("1.0", END)
def SaveFile():
global new_win
new_win = Tk()
new_win.title("Enter file name")
new_win.geometry("200x80")
Label(new_win, text="Enter the file name").pack()
global FileName
FileName = Entry(new_win)
FileName.pack(pady=10)
Button(new_win, text="Yes", command=SaveClick).pack()
root = Tk()
root.title("Simple Notepad")
root.geometry("1280x720")
ribbon = Menu(root)
root.config(menu=ribbon)
ribbon.add_cascade(label="New", command=lambda: NewSheet())
ribbon.add_cascade(label="Save", command=lambda: SaveFile())
ribbon.add_cascade(label="Exit", command=root.quit())
scroll = Scrollbar(root)
scroll.pack(side="right", fill="y")
text_area = Text(root, yscrollcommand=scroll.set, font=("Arial", 12))
text_area.pack(fill="both", expand="true")
scroll.config(command=text_area.yview)
root.mainloop()
|
class Tree {
constructor(children = []) {
this.children = children;
}
}
function treeToString(tree) {
let elemsStr = '';
tree.children.forEach(function (elem) {
elemsStr += nodeToString(elem);
});
return "{" + elemsStr + "}";
}
class Node {
constructor(label, resID, children = []) {
this.label = label;
this.resID = resID;
this.children = children;
}
}
function nodeToString(node) {
if (node.children.length < 1) {
return "\"" + node.label + "\": " + node.resID + ",";
} else {
let elemsStr = '';
node.children.forEach(function (elem) {
elemsStr += nodeToString(elem);
});
return "\"" + node.label + "\": {" + elemsStr + "},";
}
}
function pushToLevel(element, valueToPush, actualLevel, levelTarget) {
if (!element.children) {
element.children = [];
}
let level = element.children.length - 1;
let next = element.children[level];
if (actualLevel == levelTarget) {
element.children.push(valueToPush);
} else if (next != null) {
pushToLevel(element.children[level], valueToPush, actualLevel + 1, levelTarget);
}
}
function parseHTML() {
let rows = document.querySelectorAll('div[class^="x-grid3-row"]');
let element = new Tree();
for (var i = 0; i < rows.length; i++) {
let row = rows[i];
if (row.hasAttribute('aria-level') && row.hasAttribute('data-resid') && row.hasAttribute('data-resname')) {
let level = parseInt(row.getAttribute('aria-level'));
let resID = row.getAttribute('data-resid');
let resName = row.getAttribute('data-resname').replace(/"/g, "");
if (resID == null) {
resID = -1;
} if (resName == null) {
resName = "null";
}
pushToLevel(element, new Node(resName, resID), 1, level);
}
}
let json = treeToString(element).replace(/,\}/g, '}').replace(/\}\}/g, '}}');
console.log(json);
} |
const { validateUserRegister } = require("../middleware/auth");
const User = require("../models/user");
const express = require("express");
const bcrypt = require("bcryptjs");
const jwt = require("jsonwebtoken");
const config = require("config");
const userRouter = express.Router();
// Registers user
userRouter.post("/", (req, res) => {
// Validates request body
const { error } = validateUserRegister(req.body);
if (error) {
return res.status(400).json({ msg: error.details[0].message });
}
const { name, email, password } = req.body;
// Check for existing user
User.findOne({ email })
.then((user) => {
if (user) {
return res.status(400).json({ msg: 'User already exists' });
}
user = new User({
name,
email,
password
});
// Create salt & hash
bcrypt.genSalt(10, (err, salt) => {
bcrypt.hash(user.password, salt, (err, hash) => {
if (err) {
return res.status(400).json({ msg: err.message });
}
user.password = hash;
// Saves user to db
user.save()
.then((user) => {
// Generates jwt token
jwt.sign(
{ _id: user._id, isAdmin: user.isAdmin },
config.get('jwtSecret'),
{ expiresIn: 3600 },
(err, token) => {
if (err) {
return res.status(400).json({ msg: err.message });
}
res
.header("x-auth-token", token)
.json({
user: {
_id: user._id,
name: user.name,
email: user.email
}
});
}
);
})
.catch((err) => console.log(err));
});
});
});
});
module.exports = userRouter; |
import {
handleChangePage,
handleSetPageSize,
exportConfig,
buildActiveFilters,
removeFilters
} from './TableToolbarHelper';
const mockGeneralFilters = {
rule_presence: "true",
sort: "-public_date",
};
const mockGeneralChip = {
key: 'rule_presence',
multiValue: [ 'true' ],
category: 'Security rules',
chips: [ {
name: "Has security rule",
value: "true",
},
]
};
const mockApply = jest.fn();
describe('TableToolbarHelper', () => {
it('Should handleChangePage apply with provided page', () => {
const testPage = 1;
const testApply = jest.fn();
handleChangePage(null, testPage, testApply);
expect(testApply).toHaveBeenCalledWith({ page: testPage })
});
it('Should handleSetPageSize apply with provided page size and page 1', () => {
const testPageSize = 1;
const testApply = jest.fn();
handleSetPageSize(null, testPageSize, testApply);
expect(testApply).toHaveBeenCalledWith({ page_size: testPageSize, page: 1 })
});
it('Should exportConfig call downloadReport with fileType', () => {
const testMethods = { downloadReport: jest.fn() };
const result = exportConfig(testMethods);
result.onSelect(null, 'testFileType');
expect(testMethods.downloadReport).toHaveBeenCalledWith('testFileType');
});
it('Should set filterRulevalues to empty array safely', () => {
const result = buildActiveFilters(mockGeneralFilters);
});
it('Should build active filters', () => {
const result = buildActiveFilters(mockGeneralFilters, []);
expect(result).toEqual([mockGeneralChip]
);
});
it('Should push search filter chip into filterChips array', () => {
const result = buildActiveFilters({ ...mockGeneralFilters, filter: 'testFilter' }, []);
expect(result).toEqual([
mockGeneralChip,
{
key: 'filter',
category: 'Search term',
chips: [{
name: 'testFilter'
}]
}
]);
});
it('Should handle multi value filters (e.g business_risk = "0,3"', () => {
const result = buildActiveFilters({ ...mockGeneralFilters, business_risk_id: '0,3' }, []);
expect(result).toEqual([
{
key: 'business_risk_id',
multiValue: [ '0', '3' ],
category: 'Business risk',
chips: [
{
name: "Not defined",
value: "0",
},
{
name: "High",
value: "3",
},
]
},
mockGeneralChip
]);
});
it('Should handle filters with a range', () => {
const result = buildActiveFilters({ ...mockGeneralFilters, cvss_filter: "less4", cvss_from: 0, cvss_to: 4 }, []);
expect(result).toEqual([
{
key: 'cvss_filter',
category: 'CVSS base score',
chips: [{
name: "0.0 - 4.0"
}]
},
mockGeneralChip
]);
});
it('Should handle security rule filters', () => {
const mockRuleFilters = [{ value: "testRulevalue", label: "testRuleLabel" }];
const result = buildActiveFilters({ rule_presence: "testRulevalue"}, mockRuleFilters);
expect(result).toEqual([
{
key: 'rule_presence',
multiValue: [ 'testRulevalue' ],
category: 'Security rules',
chips: [{
name: "testRuleLabel",
value: "testRulevalue",
}]
}
]);
});
it('Should handle security rule filters without label safely', () => {
const mockRuleFilters = [{ value: "testRulevalue" }];
const result = buildActiveFilters({ rule_presence: "testRulevalue"}, mockRuleFilters);
expect(result).toEqual([
{
key: 'rule_presence',
multiValue: [ 'testRulevalue' ],
category: 'Security rules',
chips: [{
name: "testRulevalue",
value: "testRulevalue",
}]
}
]);
});
it('Should exclude filters with undefined and empty string values filter', () => {
const result = buildActiveFilters({ ...mockGeneralFilters, status_id: undefined, business_risk_id: undefined }, []);
expect(result).toEqual([mockGeneralChip]);
});
it('Should remove filters', () => {
removeFilters([mockGeneralChip], mockApply);
expect(mockApply).toHaveBeenCalledWith({ rule_presence: undefined, rule: '', page: 1 });
});
it('Should remove search filters and multi value filters with only one value safely', () => {
const mockSingleValueChips = [
{
key: 'business_risk_id',
multiValue: [ '0' ],
category: 'Business risk',
chips: [
{
name: "Not defined",
value: "0",
}
]
}];
removeFilters(mockSingleValueChips, mockApply);
expect(mockApply).toHaveBeenCalledWith({ business_risk_id: undefined, page: 1});
});
it('Should handle multi value filters safely', () => {
const mockMultiValueChips = [{
key: 'business_risk_id',
multiValue: [ '0', '3' ],
category: 'Business risk',
chips: [
{
name: "Not defined",
value: "0",
},
{
name: "High",
value: "3",
},
]
}];
removeFilters(mockMultiValueChips, mockApply);
expect(mockApply).toHaveBeenCalledWith({ business_risk_id: undefined, page: 1 });
});
});
|
import configparser
import psycopg2
from sql_queries import create_table_queries, drop_table_queries, drop_schemas, create_schemas
def drop_tables(cur, conn):
"""
Drops all the existing tables.
"""
for query in drop_table_queries:
cur.execute(query)
conn.commit()
print('Tables Dropped')
def create_tables(cur, conn):
"""
Creates all the necessary tables for ETL and DW.
Output: Two staging tables created in the Staging_Area schema:
staging_events_table and staging_songss_table
Five tables created in the Sparkify Schema: 1 Fact table and 4 Dimension Tables
"""
for query in create_table_queries:
cur.execute(query)
conn.commit()
print('Tables Created')
def initialize_schemas(cur, conn):
"""
Drops and recreate the two schemas: Staging_Area schema for the staging tables, and Sparkify schema for the DW tables.
"""
for query in drop_schemas:
cur.execute(query)
conn.commit()
print('Schemas Dropped')
for query in create_schemas:
cur.execute(query)
conn.commit()
print('Staging_Area and Sparkify Schemas Created')
def main():
config = configparser.ConfigParser()
config.read('dwh.cfg')
conn = psycopg2.connect("host={} dbname={} user={} password={} port={}".format(*config['CLUSTER'].values()))
cur = conn.cursor()
drop_tables(cur, conn)
initialize_schemas(cur, conn)
create_tables(cur, conn)
conn.close()
if __name__ == "__main__":
main() |
class Computer{
mood = 0;
library = ['apple', 'hello', 'aloha', 'seed', 'christ', 'computer', 'men', 'like', 'kill', 'fruit', 'bottle', 'water', 'meat', 'master',
'mistress', 'cream', 'child', 'wild', 'element', 'class', 'number', 'count', 'input', 'output'];
makeMoodGood(){
this.mood++;
}
makeMoodBad(){
this.mood--;
}
showMood(){
switch (this.mood){
case 0:
return '-_-';
case 1:
return '^_^';
case -1:
document.getElementById('consoleWindow').style.animationName='medBlinking';
return '>_<';
case -2:
document.getElementById('consoleWindow').style.animationName='strongBlinking';
return '×_×';
case 2:
return '^v^';
case 3:
return '^v^';
default:
return '?-?';
}
}
makeCrypt(level){
var word = this.library[Math.trunc(Math.random()*this.library.length)];
console.log('Word: ' + word);
switch (level) {
case 0:
return SimpleCrypt(word);
case 1:
return MediumCrypt(word);
case 2:
return StrongCrypt(word);
default:
return '-';
}
}
}
function SimpleCrypt(input){
let output = '';
for (let i = input.length-1; i>=0; i--){
output+=input[i];
}
return output;
}
function MediumCrypt(input, isItDecoding){
let output = '';
let alphabet = [' ','a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
if (!isItDecoding){
for (let i = 0; i<input.length; i++){
output+=alphabet.indexOf(input[i]) + ' ';
}
return output;
}
else {
let number = '';
for (let i = 0; i<input.length; i++){
if (input[i]===' '){
output+='' + alphabet[number];
number='';
}
else{
number+=input[i];
}
}
return output;
}
}
function StrongCrypt(input, isItDecoding){
let output = '';
if (!isItDecoding){
output = MediumCrypt(SimpleCrypt(input),false);
return output;
}
else {
output = SimpleCrypt(MediumCrypt(input,true));
return output;
}
}
|
/**
* Chat system
*
* @param {SocketClient} client
*/
function Chat(client)
{
this.client = client;
this.currentMessage = new Message();
this.messages = [];
this.room = null;
this.$scope = null;
this.feed = null;
this.talk = this.talk.bind(this);
this.onTalk = this.onTalk.bind(this);
this.attachEvents();
}
/**
* Attach events
*/
Chat.prototype.attachEvents = function()
{
this.client.on('room:talk', this.onTalk);
};
/**
* Detach events
*/
Chat.prototype.detachEvents = function()
{
this.client.off('room:talk', this.onTalk);
};
/**
* Set player
*
* @param {Player} player
*/
Chat.prototype.setPlayer = function(player)
{
if (this.room && !this.currentMessage.player && player) {
this.currentMessage.player = player;
}
};
/**
* Set room
*
* @param {Room} room
*/
Chat.prototype.setRoom = function(room)
{
if (!this.room || !this.room.equal(room)) {
this.room = room;
this.messages.length = 0;
}
};
/**
* Set scope
*/
Chat.prototype.setScope = function($scope)
{
this.$scope = $scope;
this.feed = document.getElementById('feed');
this.$scope.messages = this.messages;
this.$scope.submitTalk = this.talk;
this.$scope.currentMessage = this.currentMessage;
this.$scope.messageMaxLength = Message.prototype.maxLength;
};
/**
* Refresh
*/
Chat.prototype.refresh = function()
{
try {
this.$scope.$apply();
} catch (e) {
}
this.feed.scrollTop = this.feed.scrollHeight;
};
/**
* Talk
*/
Chat.prototype.talk = function()
{
var chat = this;
if (this.currentMessage.content.length) {
this.client.addEvent(
'room:talk',
this.currentMessage.serialize(),
function (result) {
if (result.success) {
chat.currentMessage.clear();
chat.refresh();
} else {
console.error('Could not send %s', chat.currentMessage);
}
}
);
}
};
/**
* On talk
*/
Chat.prototype.onTalk = function(e)
{
var data = e.detail,
player = this.room.players.getById(data.player);
this.messages.push(new Message(player, data.content));
this.refresh();
};
/**
* Clear
*/
Chat.prototype.clear = function()
{
this.currentMessage = new Message();
this.room = null;
this.$scope = null;
this.messages.length = 0;
}; |
let fs = require('fs'),
request = require('request-promise'),
cheerio = require('cheerio')
let geojson = JSON.parse(fs.readFileSync('./data/all.gjson', 'utf8')),
details = JSON.parse(fs.readFileSync('./data/details.json', 'utf8')),
keys = {}
details.forEach((d,di)=>{
keys[d.title] = di
})
geojson.features.forEach((f,fi)=>{
let id = keys[f.properties.title]
geojson.features[fi].properties['details'] = {}
for(let key in details[id]){
geojson.features[fi].properties.details[key] = details[id][key]
}
})
Promise.all(geojson.features.map(function(feature) {
let options = {
uri: 'http://www.berlin.de' + feature.properties.data.profillink.split(':')[1],
transform: function (body) {
return cheerio.load(body);
}
}
return request(options).then(function($) {
return $('.column-content .html5-section.article').eq(0).html()
}).then(function(html) {
html = html.split('src="/lageso').join('src="http://www.berlin.de/lageso')
html = html.split('href="/lageso').join('href="http://www.berlin.de/lageso')
return html;
}).catch(function (err) {
console.log('getDetails-error', err)
})
})).then(function(values) {
geojson.features.forEach((feature,i)=>{
geojson.features[i].properties.details['profil'] = values[i]
})
fs.writeFileSync('./data/complete.geojson', JSON.stringify(geojson), 'utf8')
console.log('done')
}) |
const parseId = (size, matchedStr) => {
const id = parseInt(matchedStr, 10)
if (id < 0 || id >= size || id !== id) {
return undefined
}
return id
}
export default parseId
|
/****************************************************************************
Copyright (c) 2011-2012 cocos2d-x.org
Copyright (c) 2013-2014 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
/**
* movement event type
* @type {Object}
*/
ccs.MovementEventType = {
start: 0,
complete: 1,
loopComplete: 2
};
/**
* Base class for cc.MovementEvent objects.
* @class
* @extends ccs.Class
*/
ccs.AnimationEvent = ccs.Class.extend(/** @lends ccs.AnimationEvent# */{
_arguments: null,
_callFunc: null,
_selectorTarget: null,
ctor: function (target, callFunc, data) {
this._data = data;
this._callFunc = callFunc;
this._selectorTarget = target;
},
call: function () {
if (this._callFunc) {
this._callFunc.apply(this._selectorTarget, this._arguments);
}
},
setArguments: function (args) {
this._arguments = args;
}
});
/**
* movement event
* @constructor
*/
ccs.MovementEvent = function () {
this.armature = null;
this.movementType = "";
this.movementID = "";
};
/**
* frame event
* @constructor
*/
ccs.FrameEvent = function () {
this.bone = null;
this.frameEventName = "";
this.originFrameIndex = 0;
this.currentFrameIndex = 0;
};
/**
* Base class for ccs.ArmatureAnimation objects.
* @class
* @extends ccs.ProcessBase
*
* @property {ccs.AnimationData} animationData - Animation data
* @property {Object} userObject - User custom object
* @property {Boolean} ignoreFrameEvent - Indicate whether the frame event is ignored
* @property {Number} speedScale - Animation play speed scale
* @property {Number} animationScale - Animation play speed scale
*
*/
ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation# */{
animationData: null,
_movementData: null,
_armature: null,
_movementID: "",
_prevFrameIndex: 0,
_toIndex: 0,
_tweenList: null,
_frameEvent: null,
_movementEvent: null,
_speedScale: 1,
ignoreFrameEvent: false,
_frameEventQueue: null,
_movementEventQueue: null,
userObject: null,
_movementList: null,
_onMovementList: false,
_movementListLoop: false,
_movementIndex: 0,
ctor: function () {
ccs.ProcessBase.prototype.ctor.call(this);
this.animationData = null;
this._movementData = null;
this._movementID = "";
this._armature = null;
this._prevFrameIndex = 0;
this._toIndex = 0;
this._tweenList = [];
this._frameEvent = null;
this._movementEvent = null;
this._speedScale = 1;
this.ignoreFrameEvent = false;
this._frameEventQueue = [];
this._movementEventQueue = [];
this.userObject = null;
this._movementList = [];
this._onMovementList = false;
this._movementListLoop = false;
this._movementIndex = 0;
},
/**
* init with a CCArmature
* @param {ccs.Armature} armature
* @return {Boolean}
*/
init: function (armature) {
this._armature = armature;
this._tweenList = [];
return true;
},
pause: function () {
for (var i = 0; i < this._tweenList.length; i++) {
this._tweenList[i].pause();
}
ccs.ProcessBase.prototype.pause.call(this);
},
resume: function () {
for (var i = 0; i < this._tweenList.length; i++) {
this._tweenList[i].resume();
}
ccs.ProcessBase.prototype.resume.call(this);
},
stop: function () {
for (var i = 0; i < this._tweenList.length; i++) {
this._tweenList[i].stop();
}
this._tweenList = [];
ccs.ProcessBase.prototype.stop.call(this);
},
/**
* scale animation play speed
* @param {Number} speedScale
*/
setSpeedScale: function (speedScale) {
if (speedScale == this._speedScale) {
return;
}
this._speedScale = speedScale;
this._processScale = !this._movementData ? this._speedScale : this._speedScale * this._movementData.scale;
var dict = this._armature.getBoneDic();
for (var key in dict) {
var bone = dict[key];
bone.getTween().setProcessScale(this._processScale);
if (bone.getChildArmature()) {
bone.getChildArmature().getAnimation().setProcessScale(this._processScale);
}
}
},
getSpeedScale: function () {
return this._speedScale;
},
getAnimationScale: function () {
return this.getSpeedScale();
},
setAnimationScale: function (animationScale) {
return this.setSpeedScale(animationScale);
},
/**
* play animation by animation name.
* @param {String} animationName The animation name you want to play
* @param {Number} [durationTo=-1]
* he frames between two animation changing-over.It's meaning is changing to this animation need how many frames
* -1 : use the value from CCMovementData get from flash design panel
* @param {Number} [loop=-1]
* Whether the animation is loop.
* loop < 0 : use the value from CCMovementData get from flash design panel
* loop = 0 : this animation is not loop
* loop > 0 : this animation is loop
* @example
* // example
* armature.getAnimation().play("run",-1,1);//loop play
* armature.getAnimation().play("run",-1,0);//not loop play
*/
play: function (animationName, durationTo, loop) {
if (this.animationData == null) {
cc.log("this.animationData can not be null");
return;
}
this._movementData = this.animationData.getMovement(animationName);
if (this._movementData == null) {
cc.log("this._movementData can not be null");
return;
}
if (durationTo === undefined) {
durationTo = -1;
}
if (loop === undefined) {
loop = -1;
}
var locMovementData = this._movementData;
//Get key frame count
this._rawDuration = locMovementData.duration;
this._movementID = animationName;
this._processScale = this._speedScale * locMovementData.scale;
//Further processing parameters
durationTo = (durationTo == -1) ? locMovementData.durationTo : durationTo;
var durationTween = locMovementData.durationTween;
durationTween = (durationTween == 0) ? this._rawDuration : durationTween;//todo
var tweenEasing = locMovementData.tweenEasing;
if (loop < 0) {
loop = locMovementData.loop;
} else {
loop = Boolean(loop);
}
this._onMovementList = false;
ccs.ProcessBase.prototype.play.call(this, durationTo, tweenEasing);
if (this._rawDuration == 0) {
this._loopType = ccs.ANIMATION_TYPE_SINGLE_FRAME;
}
else {
if (loop) {
this._loopType = ccs.ANIMATION_TYPE_TO_LOOP_FRONT;
}
else {
this._loopType = ccs.ANIMATION_TYPE_NO_LOOP;
}
this._durationTween = durationTween;
}
this._tweenList = [];
var movementBoneData;
var dict = this._armature.getBoneDic();
for (var key in dict) {
var bone = dict[key];
movementBoneData = locMovementData.getMovementBoneData(bone.getName());
var tween = bone.getTween();
if (movementBoneData && movementBoneData.frameList.length > 0) {
this._tweenList.push(tween);
movementBoneData.duration = locMovementData.duration;
tween.play(movementBoneData, durationTo, durationTween, loop, tweenEasing);
tween.setProcessScale(this._processScale);
if (bone.getChildArmature()) {
bone.getChildArmature().getAnimation().setProcessScale(this._processScale);
}
} else {
if (!bone.getIgnoreMovementBoneData()) {
bone.getDisplayManager().changeDisplayWithIndex(-1, false);
tween.stop();
}
}
}
this._armature.update(0);
},
/**
* play with names
* @param {Array} movementNames
* @param {Number} durationTo
* @param {Boolean} loop
*/
playWithNames: function (movementNames, durationTo, loop) {
this._movementList = [];
this._movementListLoop = loop;
this._onMovementList = true;
this._movementIndex = 0;
for (var i = 0; i < movementNames.length; i++) {
this._movementList.push({name: movementNames[i], durationTo: durationTo});
}
this.updateMovementList();
},
updateMovementList: function () {
if (this._onMovementList) {
if (this._movementListLoop) {
var movementObj = this._movementList[this._movementIndex];
this.play(movementObj.name, movementObj.durationTo, -1, 0);
this._movementIndex++;
if (this._movementIndex >= this._movementList.length) {
this._movementIndex = 0;
}
}
else {
if (this._movementIndex < this._movementList.length) {
var movementObj = this._movementList[this._movementIndex];
this.play(movementObj.name, movementObj.durationTo, -1, 0);
this._movementIndex++;
}
else {
this._onMovementList = false;
}
}
this._onMovementList = true;
}
},
/**
* Go to specified frame and play current movement.
* You need first switch to the movement you want to play, then call this function.
*
* example : playByIndex(0);
* gotoAndPlay(0);
* playByIndex(1);
* gotoAndPlay(0);
* gotoAndPlay(15);
* @param {Number} frameIndex
*/
gotoAndPlay: function (frameIndex) {
if (!this._movementData || frameIndex < 0 || frameIndex >= this._movementData.duration) {
cc.log("Please ensure you have played a movement, and the frameIndex is in the range.");
return;
}
var ignoreFrameEvent = this.ignoreFrameEvent;
this.ignoreFrameEvent = true;
this._isPlaying = true;
this._isComplete = this._isPause = false;
ccs.ProcessBase.prototype.gotoFrame.call(this, frameIndex);
this._currentPercent = this._curFrameIndex / (this._movementData.duration - 1);
this._currentFrame = this._nextFrameIndex * this._currentPercent;
for (var i = 0; i < this._tweenList.length; i++) {
var tween = this._tweenList[i];
tween.gotoAndPlay(frameIndex);
}
this._armature.update(0);
this.ignoreFrameEvent = ignoreFrameEvent;
},
/**
* Go to specified frame and pause current movement.
* @param {Number} frameIndex
*/
gotoAndPause: function (frameIndex) {
this.gotoAndPlay(frameIndex);
this.pause();
},
/**
* Play animation with index, the other param is the same to play.
* @param {Number||Array} animationIndex
* @param {Number} durationTo
* @param {Number} durationTween
* @param {Number} loop
* @param {Number} tweenEasing
*/
playWithIndex: function (animationIndex, durationTo, durationTween, loop, tweenEasing) {
if (typeof durationTo == "undefined") {
durationTo = -1;
}
if (typeof loop == "undefined") {
loop = -1;
}
var moveNames = this.animationData.movementNames;
if (animationIndex < -1 || animationIndex >= moveNames.length) {
return;
}
var animationName = moveNames[animationIndex];
this.play(animationName, durationTo, -1, loop, 0);
},
/**
* Play animation with index, the o ther param is the same to play.
* @param {Number} animationIndex
* @param {Number} durationTo
* @param {Number} durationTween
* @param {Number} loop
* @param {Number} tweenEasing
*/
playByIndex: function (animationIndex, durationTo, durationTween, loop, tweenEasing) {
cc.log("playByIndex is deprecated. Use playWithIndex instead.");
this.playWithIndex(animationIndex, durationTo, durationTween, loop, tweenEasing);
},
/**
* play by indexes
* @param movementIndexes
* @param {Number} durationTo
* @param {Boolean} loop
*/
playWithIndexes: function (movementIndexes, durationTo, loop) {
this._movementList = [];
this._movementListLoop = loop;
this._onMovementList = true;
this._movementIndex = 0;
var movName = this.animationData.movementNames;
for (var i = 0; i < movementIndexes.length; i++) {
var name = movName[movementIndexes[i]];
this._movementList.push({name: name, durationTo: durationTo});
}
this.updateMovementList();
},
/**
* get movement count
* @return {Number}
*/
getMovementCount: function () {
return this.animationData.getMovementCount();
},
update: function (dt) {
if (ccs.ProcessBase.prototype.update.call(this, dt)) {
for (var i = 0; i < this._tweenList.length; i++) {
this._tweenList[i].update(dt);
}
}
var frameEvents = this._frameEventQueue;
while (frameEvents.length > 0) {
var frameEvent = frameEvents.shift();
this.ignoreFrameEvent = true;
this.callFrameEvent([frameEvent.bone, frameEvent.frameEventName, frameEvent.originFrameIndex, frameEvent.currentFrameIndex]);
this.ignoreFrameEvent = false;
}
var movementEvents = this._movementEventQueue;
while (movementEvents.length > 0) {
var movEvent = movementEvents.shift();
this.callMovementEvent([movEvent.armature, movEvent.movementType, movEvent.movementID]);
}
},
/**
* update will call this handler, you can handle your logic here
*/
updateHandler: function () {
var locCurrentPercent = this._currentPercent;
if (locCurrentPercent >= 1) {
switch (this._loopType) {
case ccs.ANIMATION_TYPE_NO_LOOP:
this._loopType = ccs.ANIMATION_TYPE_MAX;
this._currentFrame = (locCurrentPercent - 1) * this._nextFrameIndex;
locCurrentPercent = this._currentFrame / this._durationTween;
if (locCurrentPercent < 1.0) {
this._nextFrameIndex = this._durationTween;
this.movementEvent(this._armature, ccs.MovementEventType.start, this._movementID);
break;
}
case ccs.ANIMATION_TYPE_MAX:
case ccs.ANIMATION_TYPE_SINGLE_FRAME:
locCurrentPercent = 1;
this._isComplete = true;
this._isPlaying = false;
this.movementEvent(this._armature, ccs.MovementEventType.complete, this._movementID);
this.updateMovementList();
break;
case ccs.ANIMATION_TYPE_TO_LOOP_FRONT:
this._loopType = ccs.ANIMATION_TYPE_LOOP_FRONT;
locCurrentPercent = ccs.fmodf(locCurrentPercent, 1);
this._currentFrame = this._nextFrameIndex == 0 ? 0 : ccs.fmodf(this._currentFrame, this._nextFrameIndex);
this._nextFrameIndex = this._durationTween > 0 ? this._durationTween : 1;
this.movementEvent(this, ccs.MovementEventType.start, this._movementID);
break;
default:
//locCurrentPercent = ccs.fmodf(locCurrentPercent, 1);
this._currentFrame = ccs.fmodf(this._currentFrame, this._nextFrameIndex);
this._toIndex = 0;
this.movementEvent(this._armature, ccs.MovementEventType.loopComplete, this._movementID);
break;
}
this._currentPercent = locCurrentPercent;
}
},
/**
* Get current movementID
* @returns {String}
*/
getCurrentMovementID: function () {
if (this._isComplete)
return "";
return this._movementID;
},
/**
* connect a event
* @param {Object} target
* @param {function} callFunc
*/
setMovementEventCallFunc: function (callFunc, target) {
this._movementEvent = new ccs.AnimationEvent(target, callFunc);
},
/**
* call event
* @param {Array} args
*/
callMovementEvent: function (args) {
if (this._movementEvent) {
this._movementEvent.setArguments(args);
this._movementEvent.call();
}
},
/**
* connect a event
* @param {Object} target
* @param {function} callFunc
*/
setFrameEventCallFunc: function (callFunc, target) {
this._frameEvent = new ccs.AnimationEvent(target, callFunc);
},
/**
* call event
* @param {Array} args
*/
callFrameEvent: function (args) {
if (this._frameEvent) {
this._frameEvent.setArguments(args);
this._frameEvent.call();
}
},
movementEvent: function (armature, movementType, movementID) {
if (this._movementEvent) {
var event = new ccs.MovementEvent();
event.armature = armature;
event.movementType = movementType;
event.movementID = movementID;
this._movementEventQueue.push(event);
}
},
/**
* @param {ccs.Bone} bone
* @param {String} frameEventName
* @param {Number} originFrameIndex
* @param {Number} currentFrameIndex
*/
frameEvent: function (bone, frameEventName, originFrameIndex, currentFrameIndex) {
if (this._frameEvent) {
var frameEvent = new ccs.FrameEvent();
frameEvent.bone = bone;
frameEvent.frameEventName = frameEventName;
frameEvent.originFrameIndex = originFrameIndex;
frameEvent.currentFrameIndex = currentFrameIndex;
this._frameEventQueue.push(frameEvent);
}
},
/**
* animationData setter
* @param {ccs.AnimationData} aniData
*/
setAnimationData: function (aniData) {
this.animationData = aniData;
},
/**
* animationData getter
* @return {ccs.AnimationData}
*/
getAnimationData: function () {
return this.animationData;
},
/**
* userObject setter
* @param {Object} userObject
*/
setUserObject: function (userObject) {
this.userObject = userObject;
},
/**
* userObject getter
* @return {Object}
*/
getUserObject: function () {
return this.userObject;
},
/**
* Determines if the frame event is ignored
* @returns {boolean}
*/
isIgnoreFrameEvent: function () {
return this.ignoreFrameEvent;
},
/**
* Sets whether the frame event is ignored
* @param {Boolean} bool
*/
setIgnoreFrameEvent: function (bool) {
this.ignoreFrameEvent = bool;
}
});
var _p = ccs.ArmatureAnimation.prototype;
// Extended properties
/** @expose */
_p.speedScale;
cc.defineGetterSetter(_p, "speedScale", _p.getSpeedScale, _p.setSpeedScale);
/** @expose */
_p.animationScale;
cc.defineGetterSetter(_p, "animationScale", _p.getAnimationScale, _p.setAnimationScale);
_p = null;
/**
* allocates and initializes a ArmatureAnimation.
* @constructs
* @return {ccs.ArmatureAnimation}
* @example
* // example
* var animation = ccs.ArmatureAnimation.create();
*/
ccs.ArmatureAnimation.create = function (armature) {
var animation = new ccs.ArmatureAnimation();
if (animation && animation.init(armature)) {
return animation;
}
return null;
}; |
// modules are defined as an array
// [ module function, map of requireuires ]
//
// map of requireuires is short require name -> numeric require
//
// anything defined in a previous bundle is accessed via the
// orig method which is the requireuire for previous bundles
(function outer (modules, cache, entry) {
// Save the require from previous bundle to this closure if any
var previousRequire = typeof require == "function" && require;
function findProxyquireifyName() {
var deps = Object.keys(modules)
.map(function (k) { return modules[k][1]; });
for (var i = 0; i < deps.length; i++) {
var pq = deps[i]['proxyquireify'];
if (pq) return pq;
}
}
var proxyquireifyName = findProxyquireifyName();
function newRequire(name, jumped){
// Find the proxyquireify module, if present
var pqify = (proxyquireifyName != null) && cache[proxyquireifyName];
// Proxyquireify provides a separate cache that is used when inside
// a proxyquire call, and is set to null outside a proxyquire call.
// This allows the regular caching semantics to work correctly both
// inside and outside proxyquire calls while keeping the cached
// modules isolated.
// When switching from one proxyquire call to another, it clears
// the cache to prevent contamination between different sets
// of stubs.
var currentCache = (pqify && pqify.exports._cache) || cache;
if(!currentCache[name]) {
if(!modules[name]) {
// if we cannot find the the module within our internal map or
// cache jump to the current global require ie. the last bundle
// that was added to the page.
var currentRequire = typeof require == "function" && require;
if (!jumped && currentRequire) return currentRequire(name, true);
// If there are other bundles on this page the require from the
// previous one is saved to 'previousRequire'. Repeat this as
// many times as there are bundles until the module is found or
// we exhaust the require chain.
if (previousRequire) return previousRequire(name, true);
var err = new Error('Cannot find module \'' + name + '\'');
err.code = 'MODULE_NOT_FOUND';
throw err;
}
var m = currentCache[name] = {exports:{}};
// The normal browserify require function
var req = function(x){
var id = modules[name][1][x];
return newRequire(id ? id : x);
};
// The require function substituted for proxyquireify
var moduleRequire = function(x){
var pqify = (proxyquireifyName != null) && cache[proxyquireifyName];
// Only try to use the proxyquireify version if it has been `require`d
if (pqify && pqify.exports._proxy) {
return pqify.exports._proxy(req, x);
} else {
return req(x);
}
};
modules[name][0].call(m.exports,moduleRequire,m,m.exports,outer,modules,currentCache,entry);
}
return currentCache[name].exports;
}
for(var i=0;i<entry.length;i++) newRequire(entry[i]);
// Override the current require with this new one
return newRequire;
})
({1:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var ctor = ( typeof Float32Array === 'function' ) ? Float32Array : void 0; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{}],2:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Typed array constructor which returns a typed array representing an array of single-precision floating-point numbers in the platform byte order.
*
* @module @stdlib/array/float32
*
* @example
* var ctor = require( '@stdlib/array/float32' );
*
* var arr = new ctor( 10 );
* // returns <Float32Array>
*/
// MODULES //
var hasFloat32ArraySupport = require( '@stdlib/assert/has-float32array-support' );
var builtin = require( './float32array.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasFloat32ArraySupport() ) {
ctor = builtin;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./float32array.js":1,"./polyfill.js":3,"@stdlib/assert/has-float32array-support":33}],3:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// TODO: write polyfill
// MAIN //
/**
* Typed array which represents an array of single-precision floating-point numbers in the platform byte order.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],4:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var ctor = ( typeof Float64Array === 'function' ) ? Float64Array : void 0; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{}],5:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in the platform byte order.
*
* @module @stdlib/array/float64
*
* @example
* var ctor = require( '@stdlib/array/float64' );
*
* var arr = new ctor( 10 );
* // returns <Float64Array>
*/
// MODULES //
var hasFloat64ArraySupport = require( '@stdlib/assert/has-float64array-support' );
var builtin = require( './float64array.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasFloat64ArraySupport() ) {
ctor = builtin;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./float64array.js":4,"./polyfill.js":6,"@stdlib/assert/has-float64array-support":36}],6:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// TODO: write polyfill
// MAIN //
/**
* Typed array which represents an array of double-precision floating-point numbers in the platform byte order.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],7:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Typed array constructor which returns a typed array representing an array of twos-complement 16-bit signed integers in the platform byte order.
*
* @module @stdlib/array/int16
*
* @example
* var ctor = require( '@stdlib/array/int16' );
*
* var arr = new ctor( 10 );
* // returns <Int16Array>
*/
// MODULES //
var hasInt16ArraySupport = require( '@stdlib/assert/has-int16array-support' );
var builtin = require( './int16array.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasInt16ArraySupport() ) {
ctor = builtin;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./int16array.js":8,"./polyfill.js":9,"@stdlib/assert/has-int16array-support":41}],8:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var ctor = ( typeof Int16Array === 'function' ) ? Int16Array : void 0; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{}],9:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// TODO: write polyfill
// MAIN //
/**
* Typed array which represents an array of twos-complement 16-bit signed integers in the platform byte order.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],10:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Typed array constructor which returns a typed array representing an array of twos-complement 32-bit signed integers in the platform byte order.
*
* @module @stdlib/array/int32
*
* @example
* var ctor = require( '@stdlib/array/int32' );
*
* var arr = new ctor( 10 );
* // returns <Int32Array>
*/
// MODULES //
var hasInt32ArraySupport = require( '@stdlib/assert/has-int32array-support' );
var builtin = require( './int32array.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasInt32ArraySupport() ) {
ctor = builtin;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./int32array.js":11,"./polyfill.js":12,"@stdlib/assert/has-int32array-support":44}],11:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var ctor = ( typeof Int32Array === 'function' ) ? Int32Array : void 0; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{}],12:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// TODO: write polyfill
// MAIN //
/**
* Typed array which represents an array of twos-complement 32-bit signed integers in the platform byte order.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],13:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Typed array constructor which returns a typed array representing an array of twos-complement 8-bit signed integers in the platform byte order.
*
* @module @stdlib/array/int8
*
* @example
* var ctor = require( '@stdlib/array/int8' );
*
* var arr = new ctor( 10 );
* // returns <Int8Array>
*/
// MODULES //
var hasInt8ArraySupport = require( '@stdlib/assert/has-int8array-support' );
var builtin = require( './int8array.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasInt8ArraySupport() ) {
ctor = builtin;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./int8array.js":14,"./polyfill.js":15,"@stdlib/assert/has-int8array-support":47}],14:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var ctor = ( typeof Int8Array === 'function' ) ? Int8Array : void 0; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{}],15:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// TODO: write polyfill
// MAIN //
/**
* Typed array which represents an array of twos-complement 8-bit signed integers in the platform byte order.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],16:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var Int8Array = require( '@stdlib/array/int8' );
var Uint8Array = require( '@stdlib/array/uint8' );
var Uint8ClampedArray = require( '@stdlib/array/uint8c' );
var Int16Array = require( '@stdlib/array/int16' );
var Uint16Array = require( '@stdlib/array/uint16' );
var Int32Array = require( '@stdlib/array/int32' );
var Uint32Array = require( '@stdlib/array/uint32' );
var Float32Array = require( '@stdlib/array/float32' );
var Float64Array = require( '@stdlib/array/float64' );
// MAIN //
var CTORS = [
[ Float64Array, 'Float64Array' ],
[ Float32Array, 'Float32Array' ],
[ Int32Array, 'Int32Array' ],
[ Uint32Array, 'Uint32Array' ],
[ Int16Array, 'Int16Array' ],
[ Uint16Array, 'Uint16Array' ],
[ Int8Array, 'Int8Array' ],
[ Uint8Array, 'Uint8Array' ],
[ Uint8ClampedArray, 'Uint8ClampedArray' ]
];
// EXPORTS //
module.exports = CTORS;
},{"@stdlib/array/float32":2,"@stdlib/array/float64":5,"@stdlib/array/int16":7,"@stdlib/array/int32":10,"@stdlib/array/int8":13,"@stdlib/array/uint16":20,"@stdlib/array/uint32":23,"@stdlib/array/uint8":26,"@stdlib/array/uint8c":29}],17:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return a JSON representation of a typed array.
*
* @module @stdlib/array/to-json
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
* var toJSON = require( '@stdlib/array/to-json' );
*
* var arr = new Float64Array( [ 5.0, 3.0 ] );
* var json = toJSON( arr );
* // returns { 'type': 'Float64Array', 'data': [ 5.0, 3.0 ] }
*/
// MODULES //
var toJSON = require( './to_json.js' );
// EXPORTS //
module.exports = toJSON;
},{"./to_json.js":18}],18:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isTypedArray = require( '@stdlib/assert/is-typed-array' );
var typeName = require( './type.js' );
// MAIN //
/**
* Returns a JSON representation of a typed array.
*
* ## Notes
*
* - We build a JSON object representing a typed array similar to how Node.js `Buffer` objects are represented. See [Buffer][1].
*
* [1]: https://nodejs.org/api/buffer.html#buffer_buf_tojson
*
* @param {TypedArray} arr - typed array to serialize
* @throws {TypeError} first argument must be a typed array
* @returns {Object} JSON representation
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
*
* var arr = new Float64Array( [ 5.0, 3.0 ] );
* var json = toJSON( arr );
* // returns { 'type': 'Float64Array', 'data': [ 5.0, 3.0 ] }
*/
function toJSON( arr ) {
var out;
var i;
if ( !isTypedArray( arr ) ) {
throw new TypeError( 'invalid argument. Must provide a typed array. Value: `' + arr + '`.' );
}
out = {};
out.type = typeName( arr );
out.data = [];
for ( i = 0; i < arr.length; i++ ) {
out.data.push( arr[ i ] );
}
return out;
}
// EXPORTS //
module.exports = toJSON;
},{"./type.js":19,"@stdlib/assert/is-typed-array":165}],19:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var instanceOf = require( '@stdlib/assert/instance-of' );
var ctorName = require( '@stdlib/utils/constructor-name' );
var getPrototypeOf = require( '@stdlib/utils/get-prototype-of' );
var CTORS = require( './ctors.js' );
// MAIN //
/**
* Returns the typed array type.
*
* @private
* @param {TypedArray} arr - typed array
* @returns {(string|void)} typed array type
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
*
* var arr = new Float64Array( 5 );
* var str = typeName( arr );
* // returns 'Float64Array'
*/
function typeName( arr ) {
var v;
var i;
// Check for typed array objects from the same realm (same Node.js `vm` or same `Window` object)...
for ( i = 0; i < CTORS.length; i++ ) {
if ( instanceOf( arr, CTORS[ i ][ 0 ] ) ) {
return CTORS[ i ][ 1 ];
}
}
// Walk the prototype tree until we find an object having a desired native class...
while ( arr ) {
v = ctorName( arr );
for ( i = 0; i < CTORS.length; i++ ) {
if ( v === CTORS[ i ][ 1 ] ) {
return CTORS[ i ][ 1 ];
}
}
arr = getPrototypeOf( arr );
}
}
// EXPORTS //
module.exports = typeName;
},{"./ctors.js":16,"@stdlib/assert/instance-of":71,"@stdlib/utils/constructor-name":383,"@stdlib/utils/get-prototype-of":406}],20:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Typed array constructor which returns a typed array representing an array of 16-bit unsigned integers in the platform byte order.
*
* @module @stdlib/array/uint16
*
* @example
* var ctor = require( '@stdlib/array/uint16' );
*
* var arr = new ctor( 10 );
* // returns <Uint16Array>
*/
// MODULES //
var hasUint16ArraySupport = require( '@stdlib/assert/has-uint16array-support' );
var builtin = require( './uint16array.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasUint16ArraySupport() ) {
ctor = builtin;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./polyfill.js":21,"./uint16array.js":22,"@stdlib/assert/has-uint16array-support":59}],21:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// TODO: write polyfill
// MAIN //
/**
* Typed array which represents an array of 16-bit unsigned integers in the platform byte order.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],22:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var ctor = ( typeof Uint16Array === 'function' ) ? Uint16Array : void 0; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{}],23:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Typed array constructor which returns a typed array representing an array of 32-bit unsigned integers in the platform byte order.
*
* @module @stdlib/array/uint32
*
* @example
* var ctor = require( '@stdlib/array/uint32' );
*
* var arr = new ctor( 10 );
* // returns <Uint32Array>
*/
// MODULES //
var hasUint32ArraySupport = require( '@stdlib/assert/has-uint32array-support' );
var builtin = require( './uint32array.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasUint32ArraySupport() ) {
ctor = builtin;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./polyfill.js":24,"./uint32array.js":25,"@stdlib/assert/has-uint32array-support":62}],24:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// TODO: write polyfill
// MAIN //
/**
* Typed array which represents an array of 32-bit unsigned integers in the platform byte order.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],25:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var ctor = ( typeof Uint32Array === 'function' ) ? Uint32Array : void 0; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{}],26:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Typed array constructor which returns a typed array representing an array of 8-bit unsigned integers in the platform byte order.
*
* @module @stdlib/array/uint8
*
* @example
* var ctor = require( '@stdlib/array/uint8' );
*
* var arr = new ctor( 10 );
* // returns <Uint8Array>
*/
// MODULES //
var hasUint8ArraySupport = require( '@stdlib/assert/has-uint8array-support' );
var builtin = require( './uint8array.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasUint8ArraySupport() ) {
ctor = builtin;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./polyfill.js":27,"./uint8array.js":28,"@stdlib/assert/has-uint8array-support":65}],27:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// TODO: write polyfill
// MAIN //
/**
* Typed array which represents an array of 8-bit unsigned integers in the platform byte order.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],28:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var ctor = ( typeof Uint8Array === 'function' ) ? Uint8Array : void 0; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{}],29:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Typed array constructor which returns a typed array representing an array of 8-bit unsigned integers in the platform byte order clamped to 0-255.
*
* @module @stdlib/array/uint8c
*
* @example
* var ctor = require( '@stdlib/array/uint8c' );
*
* var arr = new ctor( 10 );
* // returns <Uint8ClampedArray>
*/
// MODULES //
var hasUint8ClampedArraySupport = require( '@stdlib/assert/has-uint8clampedarray-support' ); // eslint-disable-line id-length
var builtin = require( './uint8clampedarray.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasUint8ClampedArraySupport() ) {
ctor = builtin;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./polyfill.js":30,"./uint8clampedarray.js":31,"@stdlib/assert/has-uint8clampedarray-support":68}],30:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// TODO: write polyfill
// MAIN //
/**
* Typed array which represents an array of 8-bit unsigned integers in the platform byte order clamped to 0-255.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],31:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var ctor = ( typeof Uint8ClampedArray === 'function' ) ? Uint8ClampedArray : void 0; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{}],32:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var main = ( typeof Float32Array === 'function' ) ? Float32Array : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
},{}],33:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test for native `Float32Array` support.
*
* @module @stdlib/assert/has-float32array-support
*
* @example
* var hasFloat32ArraySupport = require( '@stdlib/assert/has-float32array-support' );
*
* var bool = hasFloat32ArraySupport();
* // returns <boolean>
*/
// MODULES //
var hasFloat32ArraySupport = require( './main.js' );
// EXPORTS //
module.exports = hasFloat32ArraySupport;
},{"./main.js":34}],34:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isFloat32Array = require( '@stdlib/assert/is-float32array' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var GlobalFloat32Array = require( './float32array.js' );
// MAIN //
/**
* Tests for native `Float32Array` support.
*
* @returns {boolean} boolean indicating if an environment has `Float32Array` support
*
* @example
* var bool = hasFloat32ArraySupport();
* // returns <boolean>
*/
function hasFloat32ArraySupport() {
var bool;
var arr;
if ( typeof GlobalFloat32Array !== 'function' ) {
return false;
}
// Test basic support...
try {
arr = new GlobalFloat32Array( [ 1.0, 3.14, -3.14, 5.0e40 ] );
bool = (
isFloat32Array( arr ) &&
arr[ 0 ] === 1.0 &&
arr[ 1 ] === 3.140000104904175 &&
arr[ 2 ] === -3.140000104904175 &&
arr[ 3 ] === PINF
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasFloat32ArraySupport;
},{"./float32array.js":32,"@stdlib/assert/is-float32array":98,"@stdlib/constants/float64/pinf":249}],35:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var main = ( typeof Float64Array === 'function' ) ? Float64Array : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
},{}],36:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test for native `Float64Array` support.
*
* @module @stdlib/assert/has-float64array-support
*
* @example
* var hasFloat64ArraySupport = require( '@stdlib/assert/has-float64array-support' );
*
* var bool = hasFloat64ArraySupport();
* // returns <boolean>
*/
// MODULES //
var hasFloat64ArraySupport = require( './main.js' );
// EXPORTS //
module.exports = hasFloat64ArraySupport;
},{"./main.js":37}],37:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isFloat64Array = require( '@stdlib/assert/is-float64array' );
var GlobalFloat64Array = require( './float64array.js' );
// MAIN //
/**
* Tests for native `Float64Array` support.
*
* @returns {boolean} boolean indicating if an environment has `Float64Array` support
*
* @example
* var bool = hasFloat64ArraySupport();
* // returns <boolean>
*/
function hasFloat64ArraySupport() {
var bool;
var arr;
if ( typeof GlobalFloat64Array !== 'function' ) {
return false;
}
// Test basic support...
try {
arr = new GlobalFloat64Array( [ 1.0, 3.14, -3.14, NaN ] );
bool = (
isFloat64Array( arr ) &&
arr[ 0 ] === 1.0 &&
arr[ 1 ] === 3.14 &&
arr[ 2 ] === -3.14 &&
arr[ 3 ] !== arr[ 3 ]
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasFloat64ArraySupport;
},{"./float64array.js":35,"@stdlib/assert/is-float64array":100}],38:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Dummy function.
*
* @private
*/
function foo() {
// No-op...
}
// EXPORTS //
module.exports = foo;
},{}],39:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test for native function `name` support.
*
* @module @stdlib/assert/has-function-name-support
*
* @example
* var hasFunctionNameSupport = require( '@stdlib/assert/has-function-name-support' );
*
* var bool = hasFunctionNameSupport();
* // returns <boolean>
*/
// MODULES //
var hasFunctionNameSupport = require( './main.js' );
// EXPORTS //
module.exports = hasFunctionNameSupport;
},{"./main.js":40}],40:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var foo = require( './foo.js' );
// MAIN //
/**
* Tests for native function `name` support.
*
* @returns {boolean} boolean indicating if an environment has function `name` support
*
* @example
* var bool = hasFunctionNameSupport();
* // returns <boolean>
*/
function hasFunctionNameSupport() {
return ( foo.name === 'foo' );
}
// EXPORTS //
module.exports = hasFunctionNameSupport;
},{"./foo.js":38}],41:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test for native `Int16Array` support.
*
* @module @stdlib/assert/has-int16array-support
*
* @example
* var hasInt16ArraySupport = require( '@stdlib/assert/has-int16array-support' );
*
* var bool = hasInt16ArraySupport();
* // returns <boolean>
*/
// MODULES //
var hasInt16ArraySupport = require( './main.js' );
// EXPORTS //
module.exports = hasInt16ArraySupport;
},{"./main.js":43}],42:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var main = ( typeof Int16Array === 'function' ) ? Int16Array : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
},{}],43:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isInt16Array = require( '@stdlib/assert/is-int16array' );
var INT16_MAX = require( '@stdlib/constants/int16/max' );
var INT16_MIN = require( '@stdlib/constants/int16/min' );
var GlobalInt16Array = require( './int16array.js' );
// MAIN //
/**
* Tests for native `Int16Array` support.
*
* @returns {boolean} boolean indicating if an environment has `Int16Array` support
*
* @example
* var bool = hasInt16ArraySupport();
* // returns <boolean>
*/
function hasInt16ArraySupport() {
var bool;
var arr;
if ( typeof GlobalInt16Array !== 'function' ) {
return false;
}
// Test basic support...
try {
arr = new GlobalInt16Array( [ 1, 3.14, -3.14, INT16_MAX+1 ] );
bool = (
isInt16Array( arr ) &&
arr[ 0 ] === 1 &&
arr[ 1 ] === 3 && // truncation
arr[ 2 ] === -3 && // truncation
arr[ 3 ] === INT16_MIN // wrap around
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasInt16ArraySupport;
},{"./int16array.js":42,"@stdlib/assert/is-int16array":104,"@stdlib/constants/int16/max":251,"@stdlib/constants/int16/min":252}],44:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test for native `Int32Array` support.
*
* @module @stdlib/assert/has-int32array-support
*
* @example
* var hasInt32ArraySupport = require( '@stdlib/assert/has-int32array-support' );
*
* var bool = hasInt32ArraySupport();
* // returns <boolean>
*/
// MODULES //
var hasInt32ArraySupport = require( './main.js' );
// EXPORTS //
module.exports = hasInt32ArraySupport;
},{"./main.js":46}],45:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var main = ( typeof Int32Array === 'function' ) ? Int32Array : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
},{}],46:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isInt32Array = require( '@stdlib/assert/is-int32array' );
var INT32_MAX = require( '@stdlib/constants/int32/max' );
var INT32_MIN = require( '@stdlib/constants/int32/min' );
var GlobalInt32Array = require( './int32array.js' );
// MAIN //
/**
* Tests for native `Int32Array` support.
*
* @returns {boolean} boolean indicating if an environment has `Int32Array` support
*
* @example
* var bool = hasInt32ArraySupport();
* // returns <boolean>
*/
function hasInt32ArraySupport() {
var bool;
var arr;
if ( typeof GlobalInt32Array !== 'function' ) {
return false;
}
// Test basic support...
try {
arr = new GlobalInt32Array( [ 1, 3.14, -3.14, INT32_MAX+1 ] );
bool = (
isInt32Array( arr ) &&
arr[ 0 ] === 1 &&
arr[ 1 ] === 3 && // truncation
arr[ 2 ] === -3 && // truncation
arr[ 3 ] === INT32_MIN // wrap around
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasInt32ArraySupport;
},{"./int32array.js":45,"@stdlib/assert/is-int32array":106,"@stdlib/constants/int32/max":253,"@stdlib/constants/int32/min":254}],47:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test for native `Int8Array` support.
*
* @module @stdlib/assert/has-int8array-support
*
* @example
* var hasInt8ArraySupport = require( '@stdlib/assert/has-int8array-support' );
*
* var bool = hasInt8ArraySupport();
* // returns <boolean>
*/
// MODULES //
var hasInt8ArraySupport = require( './main.js' );
// EXPORTS //
module.exports = hasInt8ArraySupport;
},{"./main.js":49}],48:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var main = ( typeof Int8Array === 'function' ) ? Int8Array : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
},{}],49:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isInt8Array = require( '@stdlib/assert/is-int8array' );
var INT8_MAX = require( '@stdlib/constants/int8/max' );
var INT8_MIN = require( '@stdlib/constants/int8/min' );
var GlobalInt8Array = require( './int8array.js' );
// MAIN //
/**
* Tests for native `Int8Array` support.
*
* @returns {boolean} boolean indicating if an environment has `Int8Array` support
*
* @example
* var bool = hasInt8ArraySupport();
* // returns <boolean>
*/
function hasInt8ArraySupport() {
var bool;
var arr;
if ( typeof GlobalInt8Array !== 'function' ) {
return false;
}
// Test basic support...
try {
arr = new GlobalInt8Array( [ 1, 3.14, -3.14, INT8_MAX+1 ] );
bool = (
isInt8Array( arr ) &&
arr[ 0 ] === 1 &&
arr[ 1 ] === 3 && // truncation
arr[ 2 ] === -3 && // truncation
arr[ 3 ] === INT8_MIN // wrap around
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasInt8ArraySupport;
},{"./int8array.js":48,"@stdlib/assert/is-int8array":108,"@stdlib/constants/int8/max":255,"@stdlib/constants/int8/min":256}],50:[function(require,module,exports){
(function (Buffer){(function (){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var main = ( typeof Buffer === 'function' ) ? Buffer : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
}).call(this)}).call(this,require("buffer").Buffer)
},{"buffer":473}],51:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test for native `Buffer` support.
*
* @module @stdlib/assert/has-node-buffer-support
*
* @example
* var hasNodeBufferSupport = require( '@stdlib/assert/has-node-buffer-support' );
*
* var bool = hasNodeBufferSupport();
* // returns <boolean>
*/
// MODULES //
var hasNodeBufferSupport = require( './main.js' );
// EXPORTS //
module.exports = hasNodeBufferSupport;
},{"./main.js":52}],52:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isBuffer = require( '@stdlib/assert/is-buffer' );
var GlobalBuffer = require( './buffer.js' );
// MAIN //
/**
* Tests for native `Buffer` support.
*
* @returns {boolean} boolean indicating if an environment has `Buffer` support
*
* @example
* var bool = hasNodeBufferSupport();
* // returns <boolean>
*/
function hasNodeBufferSupport() {
var bool;
var b;
if ( typeof GlobalBuffer !== 'function' ) {
return false;
}
// Test basic support...
try {
if ( typeof GlobalBuffer.from === 'function' ) {
b = GlobalBuffer.from( [ 1, 2, 3, 4 ] );
} else {
b = new GlobalBuffer( [ 1, 2, 3, 4 ] ); // Note: this is deprecated behavior starting in Node v6 (see https://nodejs.org/api/buffer.html#buffer_new_buffer_array)
}
bool = (
isBuffer( b ) &&
b[ 0 ] === 1 &&
b[ 1 ] === 2 &&
b[ 2 ] === 3 &&
b[ 3 ] === 4
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasNodeBufferSupport;
},{"./buffer.js":50,"@stdlib/assert/is-buffer":88}],53:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test whether an object has a specified property.
*
* @module @stdlib/assert/has-own-property
*
* @example
* var hasOwnProp = require( '@stdlib/assert/has-own-property' );
*
* var beep = {
* 'boop': true
* };
*
* var bool = hasOwnProp( beep, 'boop' );
* // returns true
*
* bool = hasOwnProp( beep, 'bop' );
* // returns false
*/
// MODULES //
var hasOwnProp = require( './main.js' );
// EXPORTS //
module.exports = hasOwnProp;
},{"./main.js":54}],54:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// FUNCTIONS //
var has = Object.prototype.hasOwnProperty;
// MAIN //
/**
* Tests if an object has a specified property.
*
* @param {*} value - value to test
* @param {*} property - property to test
* @returns {boolean} boolean indicating if an object has a specified property
*
* @example
* var beep = {
* 'boop': true
* };
*
* var bool = hasOwnProp( beep, 'boop' );
* // returns true
*
* @example
* var beep = {
* 'boop': true
* };
*
* var bool = hasOwnProp( beep, 'bap' );
* // returns false
*/
function hasOwnProp( value, property ) {
if (
value === void 0 ||
value === null
) {
return false;
}
return has.call( value, property );
}
// EXPORTS //
module.exports = hasOwnProp;
},{}],55:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test for native `Symbol` support.
*
* @module @stdlib/assert/has-symbol-support
*
* @example
* var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' );
*
* var bool = hasSymbolSupport();
* // returns <boolean>
*/
// MODULES //
var hasSymbolSupport = require( './main.js' );
// EXPORTS //
module.exports = hasSymbolSupport;
},{"./main.js":56}],56:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Tests for native `Symbol` support.
*
* @returns {boolean} boolean indicating if an environment has `Symbol` support
*
* @example
* var bool = hasSymbolSupport();
* // returns <boolean>
*/
function hasSymbolSupport() {
return (
typeof Symbol === 'function' &&
typeof Symbol( 'foo' ) === 'symbol'
);
}
// EXPORTS //
module.exports = hasSymbolSupport;
},{}],57:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test for native `toStringTag` support.
*
* @module @stdlib/assert/has-tostringtag-support
*
* @example
* var hasToStringTagSupport = require( '@stdlib/assert/has-tostringtag-support' );
*
* var bool = hasToStringTagSupport();
* // returns <boolean>
*/
// MODULES //
var hasToStringTagSupport = require( './main.js' );
// EXPORTS //
module.exports = hasToStringTagSupport;
},{"./main.js":58}],58:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var hasSymbols = require( '@stdlib/assert/has-symbol-support' );
// VARIABLES //
var FLG = hasSymbols();
// MAIN //
/**
* Tests for native `toStringTag` support.
*
* @returns {boolean} boolean indicating if an environment has `toStringTag` support
*
* @example
* var bool = hasToStringTagSupport();
* // returns <boolean>
*/
function hasToStringTagSupport() {
return ( FLG && typeof Symbol.toStringTag === 'symbol' );
}
// EXPORTS //
module.exports = hasToStringTagSupport;
},{"@stdlib/assert/has-symbol-support":55}],59:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test for native `Uint16Array` support.
*
* @module @stdlib/assert/has-uint16array-support
*
* @example
* var hasUint16ArraySupport = require( '@stdlib/assert/has-uint16array-support' );
*
* var bool = hasUint16ArraySupport();
* // returns <boolean>
*/
// MODULES //
var hasUint16ArraySupport = require( './main.js' );
// EXPORTS //
module.exports = hasUint16ArraySupport;
},{"./main.js":60}],60:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isUint16Array = require( '@stdlib/assert/is-uint16array' );
var UINT16_MAX = require( '@stdlib/constants/uint16/max' );
var GlobalUint16Array = require( './uint16array.js' );
// MAIN //
/**
* Tests for native `Uint16Array` support.
*
* @returns {boolean} boolean indicating if an environment has `Uint16Array` support
*
* @example
* var bool = hasUint16ArraySupport();
* // returns <boolean>
*/
function hasUint16ArraySupport() {
var bool;
var arr;
if ( typeof GlobalUint16Array !== 'function' ) {
return false;
}
// Test basic support...
try {
arr = [ 1, 3.14, -3.14, UINT16_MAX+1, UINT16_MAX+2 ];
arr = new GlobalUint16Array( arr );
bool = (
isUint16Array( arr ) &&
arr[ 0 ] === 1 &&
arr[ 1 ] === 3 && // truncation
arr[ 2 ] === UINT16_MAX-2 && // truncation and wrap around
arr[ 3 ] === 0 && // wrap around
arr[ 4 ] === 1 // wrap around
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasUint16ArraySupport;
},{"./uint16array.js":61,"@stdlib/assert/is-uint16array":168,"@stdlib/constants/uint16/max":257}],61:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var main = ( typeof Uint16Array === 'function' ) ? Uint16Array : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
},{}],62:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test for native `Uint32Array` support.
*
* @module @stdlib/assert/has-uint32array-support
*
* @example
* var hasUint32ArraySupport = require( '@stdlib/assert/has-uint32array-support' );
*
* var bool = hasUint32ArraySupport();
* // returns <boolean>
*/
// MODULES //
var hasUint32ArraySupport = require( './main.js' );
// EXPORTS //
module.exports = hasUint32ArraySupport;
},{"./main.js":63}],63:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isUint32Array = require( '@stdlib/assert/is-uint32array' );
var UINT32_MAX = require( '@stdlib/constants/uint32/max' );
var GlobalUint32Array = require( './uint32array.js' );
// MAIN //
/**
* Tests for native `Uint32Array` support.
*
* @returns {boolean} boolean indicating if an environment has `Uint32Array` support
*
* @example
* var bool = hasUint32ArraySupport();
* // returns <boolean>
*/
function hasUint32ArraySupport() {
var bool;
var arr;
if ( typeof GlobalUint32Array !== 'function' ) {
return false;
}
// Test basic support...
try {
arr = [ 1, 3.14, -3.14, UINT32_MAX+1, UINT32_MAX+2 ];
arr = new GlobalUint32Array( arr );
bool = (
isUint32Array( arr ) &&
arr[ 0 ] === 1 &&
arr[ 1 ] === 3 && // truncation
arr[ 2 ] === UINT32_MAX-2 && // truncation and wrap around
arr[ 3 ] === 0 && // wrap around
arr[ 4 ] === 1 // wrap around
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasUint32ArraySupport;
},{"./uint32array.js":64,"@stdlib/assert/is-uint32array":170,"@stdlib/constants/uint32/max":258}],64:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var main = ( typeof Uint32Array === 'function' ) ? Uint32Array : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
},{}],65:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test for native `Uint8Array` support.
*
* @module @stdlib/assert/has-uint8array-support
*
* @example
* var hasUint8ArraySupport = require( '@stdlib/assert/has-uint8array-support' );
*
* var bool = hasUint8ArraySupport();
* // returns <boolean>
*/
// MODULES //
var hasUint8ArraySupport = require( './main.js' );
// EXPORTS //
module.exports = hasUint8ArraySupport;
},{"./main.js":66}],66:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isUint8Array = require( '@stdlib/assert/is-uint8array' );
var UINT8_MAX = require( '@stdlib/constants/uint8/max' );
var GlobalUint8Array = require( './uint8array.js' );
// MAIN //
/**
* Tests for native `Uint8Array` support.
*
* @returns {boolean} boolean indicating if an environment has `Uint8Array` support
*
* @example
* var bool = hasUint8ArraySupport();
* // returns <boolean>
*/
function hasUint8ArraySupport() {
var bool;
var arr;
if ( typeof GlobalUint8Array !== 'function' ) {
return false;
}
// Test basic support...
try {
arr = [ 1, 3.14, -3.14, UINT8_MAX+1, UINT8_MAX+2 ];
arr = new GlobalUint8Array( arr );
bool = (
isUint8Array( arr ) &&
arr[ 0 ] === 1 &&
arr[ 1 ] === 3 && // truncation
arr[ 2 ] === UINT8_MAX-2 && // truncation and wrap around
arr[ 3 ] === 0 && // wrap around
arr[ 4 ] === 1 // wrap around
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasUint8ArraySupport;
},{"./uint8array.js":67,"@stdlib/assert/is-uint8array":172,"@stdlib/constants/uint8/max":259}],67:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var main = ( typeof Uint8Array === 'function' ) ? Uint8Array : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
},{}],68:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test for native `Uint8ClampedArray` support.
*
* @module @stdlib/assert/has-uint8clampedarray-support
*
* @example
* var hasUint8ClampedArraySupport = require( '@stdlib/assert/has-uint8clampedarray-support' );
*
* var bool = hasUint8ClampedArraySupport();
* // returns <boolean>
*/
// MODULES //
var hasUint8ClampedArraySupport = require( './main.js' );
// EXPORTS //
module.exports = hasUint8ClampedArraySupport;
},{"./main.js":69}],69:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isUint8ClampedArray = require( '@stdlib/assert/is-uint8clampedarray' );
var GlobalUint8ClampedArray = require( './uint8clampedarray.js' );
// MAIN //
/**
* Tests for native `Uint8ClampedArray` support.
*
* @returns {boolean} boolean indicating if an environment has `Uint8ClampedArray` support
*
* @example
* var bool = hasUint8ClampedArraySupport();
* // returns <boolean>
*/
function hasUint8ClampedArraySupport() { // eslint-disable-line id-length
var bool;
var arr;
if ( typeof GlobalUint8ClampedArray !== 'function' ) {
return false;
}
// Test basic support...
try {
arr = new GlobalUint8ClampedArray( [ -1, 0, 1, 3.14, 4.99, 255, 256 ] );
bool = (
isUint8ClampedArray( arr ) &&
arr[ 0 ] === 0 && // clamped
arr[ 1 ] === 0 &&
arr[ 2 ] === 1 &&
arr[ 3 ] === 3 && // round to nearest
arr[ 4 ] === 5 && // round to nearest
arr[ 5 ] === 255 &&
arr[ 6 ] === 255 // clamped
);
} catch ( err ) { // eslint-disable-line no-unused-vars
bool = false;
}
return bool;
}
// EXPORTS //
module.exports = hasUint8ClampedArraySupport;
},{"./uint8clampedarray.js":70,"@stdlib/assert/is-uint8clampedarray":174}],70:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var main = ( typeof Uint8ClampedArray === 'function' ) ? Uint8ClampedArray : null; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = main;
},{}],71:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test whether a value has in its prototype chain a specified constructor as a prototype property.
*
* @module @stdlib/assert/instance-of
*
* @example
* var instanceOf = require( '@stdlib/assert/instance-of' );
*
* var bool = instanceOf( [], Array );
* // returns true
*
* bool = instanceOf( {}, Object ); // exception
* // returns true
*
* bool = instanceOf( 'beep', String );
* // returns false
*
* bool = instanceOf( null, Object );
* // returns false
*
* bool = instanceOf( 5, Object );
* // returns false
*/
// MODULES //
var instanceOf = require( './main.js' );
// EXPORTS //
module.exports = instanceOf;
},{"./main.js":72}],72:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Tests whether a value has in its prototype chain a specified constructor as a prototype property.
*
* @param {*} value - value to test
* @param {Function} constructor - constructor to test against
* @throws {TypeError} constructor must be callable
* @returns {boolean} boolean indicating whether a value is an instance of a provided constructor
*
* @example
* var bool = instanceOf( [], Array );
* // returns true
*
* @example
* var bool = instanceOf( {}, Object ); // exception
* // returns true
*
* @example
* var bool = instanceOf( 'beep', String );
* // returns false
*
* @example
* var bool = instanceOf( null, Object );
* // returns false
*
* @example
* var bool = instanceOf( 5, Object );
* // returns false
*/
function instanceOf( value, constructor ) {
// TODO: replace with `isCallable` check
if ( typeof constructor !== 'function' ) {
throw new TypeError( 'invalid argument. `constructor` argument must be callable. Value: `'+constructor+'`.' );
}
return ( value instanceof constructor );
}
// EXPORTS //
module.exports = instanceOf;
},{}],73:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isArguments = require( './main.js' );
// VARIABLES //
var bool;
// FUNCTIONS //
/**
* Detects whether an environment returns the expected internal class of the `arguments` object.
*
* @private
* @returns {boolean} boolean indicating whether an environment behaves as expected
*
* @example
* var bool = detect();
* // returns <boolean>
*/
function detect() {
return isArguments( arguments );
}
// MAIN //
bool = detect();
// EXPORTS //
module.exports = bool;
},{"./main.js":75}],74:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is an `arguments` object.
*
* @module @stdlib/assert/is-arguments
*
* @example
* var isArguments = require( '@stdlib/assert/is-arguments' );
*
* function foo() {
* return arguments;
* }
*
* var bool = isArguments( foo() );
* // returns true
*
* bool = isArguments( [] );
* // returns false
*/
// MODULES //
var hasArgumentsClass = require( './detect.js' );
var main = require( './main.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var isArguments;
if ( hasArgumentsClass ) {
isArguments = main;
} else {
isArguments = polyfill;
}
// EXPORTS //
module.exports = isArguments;
},{"./detect.js":73,"./main.js":75,"./polyfill.js":76}],75:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// MAIN //
/**
* Tests whether a value is an `arguments` object.
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether a value is an `arguments` object
*
* @example
* function foo() {
* return arguments;
* }
*
* var bool = isArguments( foo() );
* // returns true
*
* @example
* var bool = isArguments( [] );
* // returns false
*/
function isArguments( value ) {
return ( nativeClass( value ) === '[object Arguments]' );
}
// EXPORTS //
module.exports = isArguments;
},{"@stdlib/utils/native-class":440}],76:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isEnumerableProperty = require( '@stdlib/assert/is-enumerable-property' );
var isArray = require( '@stdlib/assert/is-array' );
var isInteger = require( '@stdlib/math/base/assert/is-integer' );
var MAX_LENGTH = require( '@stdlib/constants/uint32/max' );
// MAIN //
/**
* Tests whether a value is an `arguments` object.
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether a value is an `arguments` object
*
* @example
* function foo() {
* return arguments;
* }
*
* var bool = isArguments( foo() );
* // returns true
*
* @example
* var bool = isArguments( [] );
* // returns false
*/
function isArguments( value ) {
return (
value !== null &&
typeof value === 'object' &&
!isArray( value ) &&
typeof value.length === 'number' &&
isInteger( value.length ) &&
value.length >= 0 &&
value.length <= MAX_LENGTH &&
hasOwnProp( value, 'callee' ) &&
!isEnumerableProperty( value, 'callee' )
);
}
// EXPORTS //
module.exports = isArguments;
},{"@stdlib/assert/has-own-property":53,"@stdlib/assert/is-array":79,"@stdlib/assert/is-enumerable-property":93,"@stdlib/constants/uint32/max":258,"@stdlib/math/base/assert/is-integer":266}],77:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is array-like.
*
* @module @stdlib/assert/is-array-like
*
* @example
* var isArrayLike = require( '@stdlib/assert/is-array-like' );
*
* var bool = isArrayLike( [] );
* // returns true
*
* bool = isArrayLike( { 'length': 10 } );
* // returns true
*
* bool = isArrayLike( 'beep' );
* // returns true
*/
// MODULES //
var isArrayLike = require( './main.js' );
// EXPORTS //
module.exports = isArrayLike;
},{"./main.js":78}],78:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isInteger = require( '@stdlib/math/base/assert/is-integer' );
var MAX_LENGTH = require( '@stdlib/constants/array/max-array-length' );
// MAIN //
/**
* Tests if a value is array-like.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is array-like
*
* @example
* var bool = isArrayLike( [] );
* // returns true
*
* @example
* var bool = isArrayLike( {'length':10} );
* // returns true
*/
function isArrayLike( value ) {
return (
value !== void 0 &&
value !== null &&
typeof value !== 'function' &&
typeof value.length === 'number' &&
isInteger( value.length ) &&
value.length >= 0 &&
value.length <= MAX_LENGTH
);
}
// EXPORTS //
module.exports = isArrayLike;
},{"@stdlib/constants/array/max-array-length":235,"@stdlib/math/base/assert/is-integer":266}],79:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is an array.
*
* @module @stdlib/assert/is-array
*
* @example
* var isArray = require( '@stdlib/assert/is-array' );
*
* var bool = isArray( [] );
* // returns true
*
* bool = isArray( {} );
* // returns false
*/
// MODULES //
var isArray = require( './main.js' );
// EXPORTS //
module.exports = isArray;
},{"./main.js":80}],80:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var f;
// FUNCTIONS //
/**
* Tests if a value is an array.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is an array
*
* @example
* var bool = isArray( [] );
* // returns true
*
* @example
* var bool = isArray( {} );
* // returns false
*/
function isArray( value ) {
return ( nativeClass( value ) === '[object Array]' );
}
// MAIN //
if ( Array.isArray ) {
f = Array.isArray;
} else {
f = isArray;
}
// EXPORTS //
module.exports = f;
},{"@stdlib/utils/native-class":440}],81:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a boolean.
*
* @module @stdlib/assert/is-boolean
*
* @example
* var isBoolean = require( '@stdlib/assert/is-boolean' );
*
* var bool = isBoolean( false );
* // returns true
*
* bool = isBoolean( new Boolean( false ) );
* // returns true
*
* @example
* // Use interface to check for boolean primitives...
* var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
*
* var bool = isBoolean( false );
* // returns true
*
* bool = isBoolean( new Boolean( true ) );
* // returns false
*
* @example
* // Use interface to check for boolean objects...
* var isBoolean = require( '@stdlib/assert/is-boolean' ).isObject;
*
* var bool = isBoolean( true );
* // returns false
*
* bool = isBoolean( new Boolean( false ) );
* // returns true
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var isBoolean = require( './main.js' );
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
setReadOnly( isBoolean, 'isPrimitive', isPrimitive );
setReadOnly( isBoolean, 'isObject', isObject );
// EXPORTS //
module.exports = isBoolean;
},{"./main.js":82,"./object.js":83,"./primitive.js":84,"@stdlib/utils/define-nonenumerable-read-only-property":391}],82:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
/**
* Tests if a value is a boolean.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a boolean
*
* @example
* var bool = isBoolean( false );
* // returns true
*
* @example
* var bool = isBoolean( true );
* // returns true
*
* @example
* var bool = isBoolean( new Boolean( false ) );
* // returns true
*
* @example
* var bool = isBoolean( new Boolean( true ) );
* // returns true
*/
function isBoolean( value ) {
return ( isPrimitive( value ) || isObject( value ) );
}
// EXPORTS //
module.exports = isBoolean;
},{"./object.js":83,"./primitive.js":84}],83:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var hasToStringTag = require( '@stdlib/assert/has-tostringtag-support' );
var nativeClass = require( '@stdlib/utils/native-class' );
var test = require( './try2serialize.js' );
// VARIABLES //
var FLG = hasToStringTag();
// MAIN //
/**
* Tests if a value is a boolean object.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a boolean object
*
* @example
* var bool = isBoolean( true );
* // returns false
*
* @example
* var bool = isBoolean( new Boolean( false ) );
* // returns true
*/
function isBoolean( value ) {
if ( typeof value === 'object' ) {
if ( value instanceof Boolean ) {
return true;
}
if ( FLG ) {
return test( value );
}
return ( nativeClass( value ) === '[object Boolean]' );
}
return false;
}
// EXPORTS //
module.exports = isBoolean;
},{"./try2serialize.js":86,"@stdlib/assert/has-tostringtag-support":57,"@stdlib/utils/native-class":440}],84:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Tests if a value is a boolean primitive.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a boolean primitive
*
* @example
* var bool = isBoolean( true );
* // returns true
*
* @example
* var bool = isBoolean( false );
* // returns true
*
* @example
* var bool = isBoolean( new Boolean( true ) );
* // returns false
*/
function isBoolean( value ) {
return ( typeof value === 'boolean' );
}
// EXPORTS //
module.exports = isBoolean;
},{}],85:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// eslint-disable-next-line stdlib/no-redeclare
var toString = Boolean.prototype.toString; // non-generic
// EXPORTS //
module.exports = toString;
},{}],86:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var toString = require( './tostring.js' ); // eslint-disable-line stdlib/no-redeclare
// MAIN //
/**
* Attempts to serialize a value to a string.
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value can be serialized
*/
function test( value ) {
try {
toString.call( value );
return true;
} catch ( err ) { // eslint-disable-line no-unused-vars
return false;
}
}
// EXPORTS //
module.exports = test;
},{"./tostring.js":85}],87:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// EXPORTS //
module.exports = true;
},{}],88:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a Buffer instance.
*
* @module @stdlib/assert/is-buffer
*
* @example
* var isBuffer = require( '@stdlib/assert/is-buffer' );
*
* var v = isBuffer( new Buffer( 'beep' ) );
* // returns true
*
* v = isBuffer( {} );
* // returns false
*/
// MODULES //
var isBuffer = require( './main.js' );
// EXPORTS //
module.exports = isBuffer;
},{"./main.js":89}],89:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isObjectLike = require( '@stdlib/assert/is-object-like' );
// MAIN //
/**
* Tests if a value is a Buffer instance.
*
* @param {*} value - value to validate
* @returns {boolean} boolean indicating if a value is a Buffer instance
*
* @example
* var v = isBuffer( new Buffer( 'beep' ) );
* // returns true
*
* @example
* var v = isBuffer( new Buffer( [1,2,3,4] ) );
* // returns true
*
* @example
* var v = isBuffer( {} );
* // returns false
*
* @example
* var v = isBuffer( [] );
* // returns false
*/
function isBuffer( value ) {
return (
isObjectLike( value ) &&
(
// eslint-disable-next-line no-underscore-dangle
value._isBuffer || // for envs missing Object.prototype.constructor (e.g., Safari 5-7)
(
value.constructor &&
// WARNING: `typeof` is not a foolproof check, as certain envs consider RegExp and NodeList instances to be functions
typeof value.constructor.isBuffer === 'function' &&
value.constructor.isBuffer( value )
)
)
);
}
// EXPORTS //
module.exports = isBuffer;
},{"@stdlib/assert/is-object-like":143}],90:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a collection.
*
* @module @stdlib/assert/is-collection
*
* @example
* var isCollection = require( '@stdlib/assert/is-collection' );
*
* var bool = isCollection( [] );
* // returns true
*
* bool = isCollection( {} );
* // returns false
*/
// MODULES //
var isCollection = require( './main.js' );
// EXPORTS //
module.exports = isCollection;
},{"./main.js":91}],91:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isInteger = require( '@stdlib/math/base/assert/is-integer' );
var MAX_LENGTH = require( '@stdlib/constants/array/max-typed-array-length' );
// MAIN //
/**
* Tests if a value is a collection.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether a value is a collection
*
* @example
* var bool = isCollection( [] );
* // returns true
*
* @example
* var bool = isCollection( {} );
* // returns false
*/
function isCollection( value ) {
return (
typeof value === 'object' &&
value !== null &&
typeof value.length === 'number' &&
isInteger( value.length ) &&
value.length >= 0 &&
value.length <= MAX_LENGTH
);
}
// EXPORTS //
module.exports = isCollection;
},{"@stdlib/constants/array/max-typed-array-length":236,"@stdlib/math/base/assert/is-integer":266}],92:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isEnum = require( './native.js' );
// VARIABLES //
var bool;
// FUNCTIONS //
/**
* Detects whether an environment has a bug where String indices are not detected as "enumerable" properties. Observed in Node v0.10.
*
* @private
* @returns {boolean} boolean indicating whether an environment has the bug
*/
function detect() {
return !isEnum.call( 'beep', '0' );
}
// MAIN //
bool = detect();
// EXPORTS //
module.exports = bool;
},{"./native.js":95}],93:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test whether an object's own property is enumerable.
*
* @module @stdlib/assert/is-enumerable-property
*
* @example
* var isEnumerableProperty = require( '@stdlib/assert/is-enumerable-property' );
*
* var beep = {
* 'boop': true
* };
*
* var bool = isEnumerableProperty( beep, 'boop' );
* // returns true
*
* bool = isEnumerableProperty( beep, 'hasOwnProperty' );
* // returns false
*/
// MODULES //
var isEnumerableProperty = require( './main.js' );
// EXPORTS //
module.exports = isEnumerableProperty;
},{"./main.js":94}],94:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isString = require( '@stdlib/assert/is-string' );
var isnan = require( '@stdlib/assert/is-nan' ).isPrimitive;
var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;
var isEnum = require( './native.js' );
var hasStringEnumBug = require( './has_string_enumerability_bug.js' );
// MAIN //
/**
* Tests if an object's own property is enumerable.
*
* @param {*} value - value to test
* @param {*} property - property to test
* @returns {boolean} boolean indicating if an object property is enumerable
*
* @example
* var beep = {
* 'boop': true
* };
*
* var bool = isEnumerableProperty( beep, 'boop' );
* // returns true
*
* @example
* var beep = {
* 'boop': true
* };
*
* var bool = isEnumerableProperty( beep, 'hasOwnProperty' );
* // returns false
*/
function isEnumerableProperty( value, property ) {
var bool;
if (
value === void 0 ||
value === null
) {
return false;
}
bool = isEnum.call( value, property );
if ( !bool && hasStringEnumBug && isString( value ) ) {
// Note: we only check for indices, as properties attached to a `String` object are properly detected as enumerable above.
property = +property;
return (
!isnan( property ) &&
isInteger( property ) &&
property >= 0 &&
property < value.length
);
}
return bool;
}
// EXPORTS //
module.exports = isEnumerableProperty;
},{"./has_string_enumerability_bug.js":92,"./native.js":95,"@stdlib/assert/is-integer":110,"@stdlib/assert/is-nan":118,"@stdlib/assert/is-string":158}],95:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Tests if an object's own property is enumerable.
*
* @private
* @name isEnumerableProperty
* @type {Function}
* @param {*} value - value to test
* @param {*} property - property to test
* @returns {boolean} boolean indicating if an object property is enumerable
*
* @example
* var beep = {
* 'boop': true
* };
*
* var bool = isEnumerableProperty( beep, 'boop' );
* // returns true
*
* @example
* var beep = {
* 'boop': true
* };
*
* var bool = isEnumerableProperty( beep, 'hasOwnProperty' );
* // returns false
*/
var isEnumerableProperty = Object.prototype.propertyIsEnumerable;
// EXPORTS //
module.exports = isEnumerableProperty;
},{}],96:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is an `Error` object.
*
* @module @stdlib/assert/is-error
*
* @example
* var isError = require( '@stdlib/assert/is-error' );
*
* var bool = isError( new Error( 'beep' ) );
* // returns true
*
* bool = isError( {} );
* // returns false
*/
// MODULES //
var isError = require( './main.js' );
// EXPORTS //
module.exports = isError;
},{"./main.js":97}],97:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var getPrototypeOf = require( '@stdlib/utils/get-prototype-of' );
var nativeClass = require( '@stdlib/utils/native-class' );
// MAIN //
/**
* Tests if a value is an `Error` object.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether a value is an `Error` object
*
* @example
* var bool = isError( new Error( 'beep' ) );
* // returns true
*
* @example
* var bool = isError( {} );
* // returns false
*/
function isError( value ) {
if ( typeof value !== 'object' || value === null ) {
return false;
}
// Check for `Error` objects from the same realm (same Node.js `vm` or same `Window` object)...
if ( value instanceof Error ) {
return true;
}
// Walk the prototype tree until we find an object having the desired native class...
while ( value ) {
if ( nativeClass( value ) === '[object Error]' ) {
return true;
}
value = getPrototypeOf( value );
}
return false;
}
// EXPORTS //
module.exports = isError;
},{"@stdlib/utils/get-prototype-of":406,"@stdlib/utils/native-class":440}],98:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a Float32Array.
*
* @module @stdlib/assert/is-float32array
*
* @example
* var isFloat32Array = require( '@stdlib/assert/is-float32array' );
*
* var bool = isFloat32Array( new Float32Array( 10 ) );
* // returns true
*
* bool = isFloat32Array( [] );
* // returns false
*/
// MODULES //
var isFloat32Array = require( './main.js' );
// EXPORTS //
module.exports = isFloat32Array;
},{"./main.js":99}],99:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var hasFloat32Array = ( typeof Float32Array === 'function' );// eslint-disable-line stdlib/require-globals
// MAIN //
/**
* Tests if a value is a Float32Array.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a Float32Array
*
* @example
* var bool = isFloat32Array( new Float32Array( 10 ) );
* // returns true
*
* @example
* var bool = isFloat32Array( [] );
* // returns false
*/
function isFloat32Array( value ) {
return (
( hasFloat32Array && value instanceof Float32Array ) || // eslint-disable-line stdlib/require-globals
nativeClass( value ) === '[object Float32Array]'
);
}
// EXPORTS //
module.exports = isFloat32Array;
},{"@stdlib/utils/native-class":440}],100:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a Float64Array.
*
* @module @stdlib/assert/is-float64array
*
* @example
* var isFloat64Array = require( '@stdlib/assert/is-float64array' );
*
* var bool = isFloat64Array( new Float64Array( 10 ) );
* // returns true
*
* bool = isFloat64Array( [] );
* // returns false
*/
// MODULES //
var isFloat64Array = require( './main.js' );
// EXPORTS //
module.exports = isFloat64Array;
},{"./main.js":101}],101:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var hasFloat64Array = ( typeof Float64Array === 'function' ); // eslint-disable-line stdlib/require-globals
// MAIN //
/**
* Tests if a value is a Float64Array.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a Float64Array
*
* @example
* var bool = isFloat64Array( new Float64Array( 10 ) );
* // returns true
*
* @example
* var bool = isFloat64Array( [] );
* // returns false
*/
function isFloat64Array( value ) {
return (
( hasFloat64Array && value instanceof Float64Array ) || // eslint-disable-line stdlib/require-globals
nativeClass( value ) === '[object Float64Array]'
);
}
// EXPORTS //
module.exports = isFloat64Array;
},{"@stdlib/utils/native-class":440}],102:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a function.
*
* @module @stdlib/assert/is-function
*
* @example
* var isFunction = require( '@stdlib/assert/is-function' );
*
* function beep() {
* return 'beep';
* }
*
* var bool = isFunction( beep );
* // returns true
*/
// MODULES //
var isFunction = require( './main.js' );
// EXPORTS //
module.exports = isFunction;
},{"./main.js":103}],103:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var typeOf = require( '@stdlib/utils/type-of' );
// MAIN //
/**
* Tests if a value is a function.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a function
*
* @example
* function beep() {
* return 'beep';
* }
*
* var bool = isFunction( beep );
* // returns true
*/
function isFunction( value ) {
// Note: cannot use `typeof` directly, as various browser engines incorrectly return `'function'` when operating on non-function objects, such as regular expressions and NodeLists.
return ( typeOf( value ) === 'function' );
}
// EXPORTS //
module.exports = isFunction;
},{"@stdlib/utils/type-of":467}],104:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is an Int16Array.
*
* @module @stdlib/assert/is-int16array
*
* @example
* var isInt16Array = require( '@stdlib/assert/is-int16array' );
*
* var bool = isInt16Array( new Int16Array( 10 ) );
* // returns true
*
* bool = isInt16Array( [] );
* // returns false
*/
// MODULES //
var isInt16Array = require( './main.js' );
// EXPORTS //
module.exports = isInt16Array;
},{"./main.js":105}],105:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var hasInt16Array = ( typeof Int16Array === 'function' ); // eslint-disable-line stdlib/require-globals
// MAIN //
/**
* Tests if a value is an Int16Array.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is an Int16Array
*
* @example
* var bool = isInt16Array( new Int16Array( 10 ) );
* // returns true
*
* @example
* var bool = isInt16Array( [] );
* // returns false
*/
function isInt16Array( value ) {
return (
( hasInt16Array && value instanceof Int16Array ) || // eslint-disable-line stdlib/require-globals
nativeClass( value ) === '[object Int16Array]'
);
}
// EXPORTS //
module.exports = isInt16Array;
},{"@stdlib/utils/native-class":440}],106:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is an Int32Array.
*
* @module @stdlib/assert/is-int32array
*
* @example
* var isInt32Array = require( '@stdlib/assert/is-int32array' );
*
* var bool = isInt32Array( new Int32Array( 10 ) );
* // returns true
*
* bool = isInt32Array( [] );
* // returns false
*/
// MODULES //
var isInt32Array = require( './main.js' );
// EXPORTS //
module.exports = isInt32Array;
},{"./main.js":107}],107:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var hasInt32Array = ( typeof Int32Array === 'function' ); // eslint-disable-line stdlib/require-globals
// MAIN //
/**
* Tests if a value is an Int32Array.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is an Int32Array
*
* @example
* var bool = isInt32Array( new Int32Array( 10 ) );
* // returns true
*
* @example
* var bool = isInt32Array( [] );
* // returns false
*/
function isInt32Array( value ) {
return (
( hasInt32Array && value instanceof Int32Array ) || // eslint-disable-line stdlib/require-globals
nativeClass( value ) === '[object Int32Array]'
);
}
// EXPORTS //
module.exports = isInt32Array;
},{"@stdlib/utils/native-class":440}],108:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is an Int8Array.
*
* @module @stdlib/assert/is-int8array
*
* @example
* var isInt8Array = require( '@stdlib/assert/is-int8array' );
*
* var bool = isInt8Array( new Int8Array( 10 ) );
* // returns true
*
* bool = isInt8Array( [] );
* // returns false
*/
// MODULES //
var isInt8Array = require( './main.js' );
// EXPORTS //
module.exports = isInt8Array;
},{"./main.js":109}],109:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var hasInt8Array = ( typeof Int8Array === 'function' ); // eslint-disable-line stdlib/require-globals
// MAIN //
/**
* Tests if a value is an Int8Array.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is an Int8Array
*
* @example
* var bool = isInt8Array( new Int8Array( 10 ) );
* // returns true
*
* @example
* var bool = isInt8Array( [] );
* // returns false
*/
function isInt8Array( value ) {
return (
( hasInt8Array && value instanceof Int8Array ) || // eslint-disable-line stdlib/require-globals
nativeClass( value ) === '[object Int8Array]'
);
}
// EXPORTS //
module.exports = isInt8Array;
},{"@stdlib/utils/native-class":440}],110:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is an integer.
*
* @module @stdlib/assert/is-integer
*
* @example
* var isInteger = require( '@stdlib/assert/is-integer' );
*
* var bool = isInteger( 5.0 );
* // returns true
*
* bool = isInteger( new Number( 5.0 ) );
* // returns true
*
* bool = isInteger( -3.14 );
* // returns false
*
* bool = isInteger( null );
* // returns false
*
* @example
* // Use interface to check for integer primitives...
* var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;
*
* var bool = isInteger( -3.0 );
* // returns true
*
* bool = isInteger( new Number( -3.0 ) );
* // returns false
*
* @example
* // Use interface to check for integer objects...
* var isInteger = require( '@stdlib/assert/is-integer' ).isObject;
*
* var bool = isInteger( 3.0 );
* // returns false
*
* bool = isInteger( new Number( 3.0 ) );
* // returns true
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var isInteger = require( './main.js' );
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
setReadOnly( isInteger, 'isPrimitive', isPrimitive );
setReadOnly( isInteger, 'isObject', isObject );
// EXPORTS //
module.exports = isInteger;
},{"./main.js":112,"./object.js":113,"./primitive.js":114,"@stdlib/utils/define-nonenumerable-read-only-property":391}],111:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var PINF = require( '@stdlib/constants/float64/pinf' );
var NINF = require( '@stdlib/constants/float64/ninf' );
var isInt = require( '@stdlib/math/base/assert/is-integer' );
// MAIN //
/**
* Tests if a number primitive is an integer value.
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a number primitive is an integer value
*/
function isInteger( value ) {
return (
value < PINF &&
value > NINF &&
isInt( value )
);
}
// EXPORTS //
module.exports = isInteger;
},{"@stdlib/constants/float64/ninf":248,"@stdlib/constants/float64/pinf":249,"@stdlib/math/base/assert/is-integer":266}],112:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
/**
* Tests if a value is an integer.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is an integer
*
* @example
* var bool = isInteger( 5.0 );
* // returns true
*
* @example
* var bool = isInteger( new Number( 5.0 ) );
* // returns true
*
* @example
* var bool = isInteger( -3.14 );
* // returns false
*
* @example
* var bool = isInteger( null );
* // returns false
*/
function isInteger( value ) {
return ( isPrimitive( value ) || isObject( value ) );
}
// EXPORTS //
module.exports = isInteger;
},{"./object.js":113,"./primitive.js":114}],113:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isNumber = require( '@stdlib/assert/is-number' ).isObject;
var isInt = require( './integer.js' );
// MAIN //
/**
* Tests if a value is a number object having an integer value.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number object having an integer value
*
* @example
* var bool = isInteger( 3.0 );
* // returns false
*
* @example
* var bool = isInteger( new Number( 3.0 ) );
* // returns true
*/
function isInteger( value ) {
return (
isNumber( value ) &&
isInt( value.valueOf() )
);
}
// EXPORTS //
module.exports = isInteger;
},{"./integer.js":111,"@stdlib/assert/is-number":137}],114:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;
var isInt = require( './integer.js' );
// MAIN //
/**
* Tests if a value is a number primitive having an integer value.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number primitive having an integer value
*
* @example
* var bool = isInteger( -3.0 );
* // returns true
*
* @example
* var bool = isInteger( new Number( -3.0 ) );
* // returns false
*/
function isInteger( value ) {
return (
isNumber( value ) &&
isInt( value )
);
}
// EXPORTS //
module.exports = isInteger;
},{"./integer.js":111,"@stdlib/assert/is-number":137}],115:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var Uint8Array = require( '@stdlib/array/uint8' );
var Uint16Array = require( '@stdlib/array/uint16' );
// MAIN //
var ctors = {
'uint16': Uint16Array,
'uint8': Uint8Array
};
// EXPORTS //
module.exports = ctors;
},{"@stdlib/array/uint16":20,"@stdlib/array/uint8":26}],116:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return a boolean indicating if an environment is little endian.
*
* @module @stdlib/assert/is-little-endian
*
* @example
* var IS_LITTLE_ENDIAN = require( '@stdlib/assert/is-little-endian' );
*
* var bool = IS_LITTLE_ENDIAN;
* // returns <boolean>
*/
// MODULES //
var IS_LITTLE_ENDIAN = require( './main.js' );
// EXPORTS //
module.exports = IS_LITTLE_ENDIAN;
},{"./main.js":117}],117:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var ctors = require( './ctors.js' );
// VARIABLES //
var bool;
// FUNCTIONS //
/**
* Returns a boolean indicating if an environment is little endian.
*
* @private
* @returns {boolean} boolean indicating if an environment is little endian
*
* @example
* var bool = isLittleEndian();
* // returns <boolean>
*/
function isLittleEndian() {
var uint16view;
var uint8view;
uint16view = new ctors[ 'uint16' ]( 1 );
/*
* Set the uint16 view to a value having distinguishable lower and higher order words.
*
* 4660 => 0x1234 => 0x12 0x34 => '00010010 00110100' => (0x12,0x34) == (18,52)
*/
uint16view[ 0 ] = 0x1234;
// Create a uint8 view on top of the uint16 buffer:
uint8view = new ctors[ 'uint8' ]( uint16view.buffer );
// If little endian, the least significant byte will be first...
return ( uint8view[ 0 ] === 0x34 );
}
// MAIN //
bool = isLittleEndian();
// EXPORTS //
module.exports = bool;
},{"./ctors.js":115}],118:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is `NaN`.
*
* @module @stdlib/assert/is-nan
*
* @example
* var isnan = require( '@stdlib/assert/is-nan' );
*
* var bool = isnan( NaN );
* // returns true
*
* bool = isnan( new Number( NaN ) );
* // returns true
*
* bool = isnan( 3.14 );
* // returns false
*
* bool = isnan( null );
* // returns false
*
* @example
* var isnan = require( '@stdlib/assert/is-nan' ).isPrimitive;
*
* var bool = isnan( NaN );
* // returns true
*
* bool = isnan( 3.14 );
* // returns false
*
* bool = isnan( new Number( NaN ) );
* // returns false
*
* @example
* var isnan = require( '@stdlib/assert/is-nan' ).isObject;
*
* var bool = isnan( NaN );
* // returns false
*
* bool = isnan( new Number( NaN ) );
* // returns true
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var isnan = require( './main.js' );
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
setReadOnly( isnan, 'isPrimitive', isPrimitive );
setReadOnly( isnan, 'isObject', isObject );
// EXPORTS //
module.exports = isnan;
},{"./main.js":119,"./object.js":120,"./primitive.js":121,"@stdlib/utils/define-nonenumerable-read-only-property":391}],119:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
/**
* Tests if a value is `NaN`.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is `NaN`
*
* @example
* var bool = isnan( NaN );
* // returns true
*
* @example
* var bool = isnan( new Number( NaN ) );
* // returns true
*
* @example
* var bool = isnan( 3.14 );
* // returns false
*
* @example
* var bool = isnan( null );
* // returns false
*/
function isnan( value ) {
return ( isPrimitive( value ) || isObject( value ) );
}
// EXPORTS //
module.exports = isnan;
},{"./object.js":120,"./primitive.js":121}],120:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isNumber = require( '@stdlib/assert/is-number' ).isObject;
var isNan = require( '@stdlib/math/base/assert/is-nan' );
// MAIN //
/**
* Tests if a value is a number object having a value of `NaN`.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number object having a value of `NaN`
*
* @example
* var bool = isnan( NaN );
* // returns false
*
* @example
* var bool = isnan( new Number( NaN ) );
* // returns true
*/
function isnan( value ) {
return (
isNumber( value ) &&
isNan( value.valueOf() )
);
}
// EXPORTS //
module.exports = isnan;
},{"@stdlib/assert/is-number":137,"@stdlib/math/base/assert/is-nan":268}],121:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;
var isNan = require( '@stdlib/math/base/assert/is-nan' );
// MAIN //
/**
* Tests if a value is a `NaN` number primitive.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a `NaN` number primitive
*
* @example
* var bool = isnan( NaN );
* // returns true
*
* @example
* var bool = isnan( 3.14 );
* // returns false
*
* @example
* var bool = isnan( new Number( NaN ) );
* // returns false
*/
function isnan( value ) {
return (
isNumber( value ) &&
isNan( value )
);
}
// EXPORTS //
module.exports = isnan;
},{"@stdlib/assert/is-number":137,"@stdlib/math/base/assert/is-nan":268}],122:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is Node stream-like.
*
* @module @stdlib/assert/is-node-stream-like
*
* @example
* var transformStream = require( '@stdlib/streams/node/transform' );
* var isNodeStreamLike = require( '@stdlib/assert/is-node-stream-like' );
*
* var stream = transformStream();
*
* var bool = isNodeStreamLike( stream );
* // returns true
*
* bool = isNodeStreamLike( {} );
* // returns false
*/
// MODULES //
var isNodeStreamLike = require( './main.js' );
// EXPORTS //
module.exports = isNodeStreamLike;
},{"./main.js":123}],123:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Tests if a value is Node stream-like.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is Node stream-like
*
* @example
* var transformStream = require( '@stdlib/streams/node/transform' );
*
* var stream = transformStream();
*
* var bool = isNodeStreamLike( stream );
* // returns true
*
* bool = isNodeStreamLike( {} );
* // returns false
*/
function isNodeStreamLike( value ) {
return (
// Must be an object:
value !== null &&
typeof value === 'object' &&
// Should be an event emitter:
typeof value.on === 'function' &&
typeof value.once === 'function' &&
typeof value.emit === 'function' &&
typeof value.addListener === 'function' &&
typeof value.removeListener === 'function' &&
typeof value.removeAllListeners === 'function' &&
// Should have a `pipe` method (Node streams inherit from `Stream`, including writable streams):
typeof value.pipe === 'function'
);
}
// EXPORTS //
module.exports = isNodeStreamLike;
},{}],124:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is Node writable stream-like.
*
* @module @stdlib/assert/is-node-writable-stream-like
*
* @example
* var transformStream = require( '@stdlib/streams/node/transform' );
* var isNodeWritableStreamLike = require( '@stdlib/assert/is-node-writable-stream-like' );
*
* var stream = transformStream();
*
* var bool = isNodeWritableStreamLike( stream );
* // returns true
*
* bool = isNodeWritableStreamLike( {} );
* // returns false
*/
// MODULES //
var isNodeWritableStreamLike = require( './main.js' );
// EXPORTS //
module.exports = isNodeWritableStreamLike;
},{"./main.js":125}],125:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable no-underscore-dangle */
'use strict';
// MODULES //
var isNodeStreamLike = require( '@stdlib/assert/is-node-stream-like' );
// MAIN //
/**
* Tests if a value is Node writable stream-like.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is Node writable stream-like
*
* @example
* var transformStream = require( '@stdlib/streams/node/transform' );
*
* var stream = transformStream();
*
* var bool = isNodeWritableStreamLike( stream );
* // returns true
*
* bool = isNodeWritableStreamLike( {} );
* // returns false
*/
function isNodeWritableStreamLike( value ) {
return (
// Must be stream-like:
isNodeStreamLike( value ) &&
// Should have writable stream methods:
typeof value._write === 'function' &&
// Should have writable stream state:
typeof value._writableState === 'object'
);
}
// EXPORTS //
module.exports = isNodeWritableStreamLike;
},{"@stdlib/assert/is-node-stream-like":122}],126:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is an array-like object containing only nonnegative integers.
*
* @module @stdlib/assert/is-nonnegative-integer-array
*
* @example
* var isNonNegativeIntegerArray = require( '@stdlib/assert/is-nonnegative-integer-array' );
*
* var bool = isNonNegativeIntegerArray( [ 3.0, new Number(3.0) ] );
* // returns true
*
* bool = isNonNegativeIntegerArray( [ 3.0, '3.0' ] );
* // returns false
*
* @example
* var isNonNegativeIntegerArray = require( '@stdlib/assert/is-nonnegative-integer-array' ).primitives;
*
* var bool = isNonNegativeIntegerArray( [ 1.0, 0.0, 10.0 ] );
* // returns true
*
* bool = isNonNegativeIntegerArray( [ 3.0, new Number(1.0) ] );
* // returns false
*
* @example
* var isNonNegativeIntegerArray = require( '@stdlib/assert/is-nonnegative-integer-array' ).objects;
*
* var bool = isNonNegativeIntegerArray( [ new Number(3.0), new Number(1.0) ] );
* // returns true
*
* bool = isNonNegativeIntegerArray( [ 1.0, 0.0, 10.0 ] );
* // returns false
*/
// MODULES //
var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' );
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var arrayfun = require( '@stdlib/assert/tools/array-like-function' );
// MAIN //
var isNonNegativeIntegerArray = arrayfun( isNonNegativeInteger );
setReadOnly( isNonNegativeIntegerArray, 'primitives', arrayfun( isNonNegativeInteger.isPrimitive ) );
setReadOnly( isNonNegativeIntegerArray, 'objects', arrayfun( isNonNegativeInteger.isObject ) );
// EXPORTS //
module.exports = isNonNegativeIntegerArray;
},{"@stdlib/assert/is-nonnegative-integer":127,"@stdlib/assert/tools/array-like-function":179,"@stdlib/utils/define-nonenumerable-read-only-property":391}],127:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a nonnegative integer.
*
* @module @stdlib/assert/is-nonnegative-integer
*
* @example
* var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' );
*
* var bool = isNonNegativeInteger( 5.0 );
* // returns true
*
* bool = isNonNegativeInteger( new Number( 5.0 ) );
* // returns true
*
* bool = isNonNegativeInteger( -5.0 );
* // returns false
*
* bool = isNonNegativeInteger( 3.14 );
* // returns false
*
* bool = isNonNegativeInteger( null );
* // returns false
*
* @example
* var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;
*
* var bool = isNonNegativeInteger( 3.0 );
* // returns true
*
* bool = isNonNegativeInteger( new Number( 3.0 ) );
* // returns false
*
* @example
* var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isObject;
*
* var bool = isNonNegativeInteger( 3.0 );
* // returns false
*
* bool = isNonNegativeInteger( new Number( 3.0 ) );
* // returns true
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var isNonNegativeInteger = require( './main.js' );
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
setReadOnly( isNonNegativeInteger, 'isPrimitive', isPrimitive );
setReadOnly( isNonNegativeInteger, 'isObject', isObject );
// EXPORTS //
module.exports = isNonNegativeInteger;
},{"./main.js":128,"./object.js":129,"./primitive.js":130,"@stdlib/utils/define-nonenumerable-read-only-property":391}],128:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
/**
* Tests if a value is a nonnegative integer.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a nonnegative integer
*
* @example
* var bool = isNonNegativeInteger( 5.0 );
* // returns true
*
* @example
* var bool = isNonNegativeInteger( new Number( 5.0 ) );
* // returns true
*
* @example
* var bool = isNonNegativeInteger( -5.0 );
* // returns false
*
* @example
* var bool = isNonNegativeInteger( 3.14 );
* // returns false
*
* @example
* var bool = isNonNegativeInteger( null );
* // returns false
*/
function isNonNegativeInteger( value ) {
return ( isPrimitive( value ) || isObject( value ) );
}
// EXPORTS //
module.exports = isNonNegativeInteger;
},{"./object.js":129,"./primitive.js":130}],129:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isInteger = require( '@stdlib/assert/is-integer' ).isObject;
// MAIN //
/**
* Tests if a value is a number object having a nonnegative integer value.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number object having a nonnegative integer value
*
* @example
* var bool = isNonNegativeInteger( 3.0 );
* // returns false
*
* @example
* var bool = isNonNegativeInteger( new Number( 3.0 ) );
* // returns true
*/
function isNonNegativeInteger( value ) {
return (
isInteger( value ) &&
value.valueOf() >= 0
);
}
// EXPORTS //
module.exports = isNonNegativeInteger;
},{"@stdlib/assert/is-integer":110}],130:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;
// MAIN //
/**
* Tests if a value is a number primitive having a nonnegative integer value.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number primitive having a nonnegative integer value
*
* @example
* var bool = isNonNegativeInteger( 3.0 );
* // returns true
*
* @example
* var bool = isNonNegativeInteger( new Number( 3.0 ) );
* // returns false
*/
function isNonNegativeInteger( value ) {
return (
isInteger( value ) &&
value >= 0
);
}
// EXPORTS //
module.exports = isNonNegativeInteger;
},{"@stdlib/assert/is-integer":110}],131:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a nonnegative number.
*
* @module @stdlib/assert/is-nonnegative-number
*
* @example
* var isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' );
*
* var bool = isNonNegativeNumber( 5.0 );
* // returns true
*
* bool = isNonNegativeNumber( new Number( 5.0 ) );
* // returns true
*
* bool = isNonNegativeNumber( 3.14 );
* // returns true
*
* bool = isNonNegativeNumber( -5.0 );
* // returns false
*
* bool = isNonNegativeNumber( null );
* // returns false
*
* @example
* var isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;
*
* var bool = isNonNegativeNumber( 3.0 );
* // returns true
*
* bool = isNonNegativeNumber( new Number( 3.0 ) );
* // returns false
*
* @example
* var isNonNegativeNumber = require( '@stdlib/assert/is-nonnegative-number' ).isObject;
*
* var bool = isNonNegativeNumber( 3.0 );
* // returns false
*
* bool = isNonNegativeNumber( new Number( 3.0 ) );
* // returns true
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var isNonNegativeNumber = require( './main.js' );
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
setReadOnly( isNonNegativeNumber, 'isPrimitive', isPrimitive );
setReadOnly( isNonNegativeNumber, 'isObject', isObject );
// EXPORTS //
module.exports = isNonNegativeNumber;
},{"./main.js":132,"./object.js":133,"./primitive.js":134,"@stdlib/utils/define-nonenumerable-read-only-property":391}],132:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
/**
* Tests if a value is a nonnegative number.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a nonnegative number
*
* @example
* var bool = isNonNegativeNumber( 5.0 );
* // returns true
*
* @example
* var bool = isNonNegativeNumber( new Number( 5.0 ) );
* // returns true
*
* @example
* var bool = isNonNegativeNumber( 3.14 );
* // returns true
*
* @example
* var bool = isNonNegativeNumber( -5.0 );
* // returns false
*
* @example
* var bool = isNonNegativeNumber( null );
* // returns false
*/
function isNonNegativeNumber( value ) {
return ( isPrimitive( value ) || isObject( value ) );
}
// EXPORTS //
module.exports = isNonNegativeNumber;
},{"./object.js":133,"./primitive.js":134}],133:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isNumber = require( '@stdlib/assert/is-number' ).isObject;
// MAIN //
/**
* Tests if a value is a number object having a nonnegative value.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number object having a nonnegative number value
*
* @example
* var bool = isNonNegativeNumber( 3.0 );
* // returns false
*
* @example
* var bool = isNonNegativeNumber( new Number( 3.0 ) );
* // returns true
*/
function isNonNegativeNumber( value ) {
return (
isNumber( value ) &&
value.valueOf() >= 0.0
);
}
// EXPORTS //
module.exports = isNonNegativeNumber;
},{"@stdlib/assert/is-number":137}],134:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;
// MAIN //
/**
* Tests if a value is a number primitive having a nonnegative value.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number primitive having a nonnegative number value
*
* @example
* var bool = isNonNegativeNumber( 3.0 );
* // returns true
*
* @example
* var bool = isNonNegativeNumber( new Number( 3.0 ) );
* // returns false
*/
function isNonNegativeNumber( value ) {
return (
isNumber( value ) &&
value >= 0.0
);
}
// EXPORTS //
module.exports = isNonNegativeNumber;
},{"@stdlib/assert/is-number":137}],135:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is `null`.
*
* @module @stdlib/assert/is-null
*
* @example
* var isNull = require( '@stdlib/assert/is-null' );
*
* var value = null;
*
* var bool = isNull( value );
* // returns true
*/
// MODULES //
var isNull = require( './main.js' );
// EXPORTS //
module.exports = isNull;
},{"./main.js":136}],136:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Tests if a value is `null`.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is null
*
* @example
* var bool = isNull( null );
* // returns true
*
* bool = isNull( true );
* // returns false
*/
function isNull( value ) {
return value === null;
}
// EXPORTS //
module.exports = isNull;
},{}],137:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a number.
*
* @module @stdlib/assert/is-number
*
* @example
* var isNumber = require( '@stdlib/assert/is-number' );
*
* var bool = isNumber( 3.14 );
* // returns true
*
* bool = isNumber( new Number( 3.14 ) );
* // returns true
*
* bool = isNumber( NaN );
* // returns true
*
* bool = isNumber( null );
* // returns false
*
* @example
* var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;
*
* var bool = isNumber( 3.14 );
* // returns true
*
* bool = isNumber( NaN );
* // returns true
*
* bool = isNumber( new Number( 3.14 ) );
* // returns false
*
* @example
* var isNumber = require( '@stdlib/assert/is-number' ).isObject;
*
* var bool = isNumber( 3.14 );
* // returns false
*
* bool = isNumber( new Number( 3.14 ) );
* // returns true
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var isNumber = require( './main.js' );
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
setReadOnly( isNumber, 'isPrimitive', isPrimitive );
setReadOnly( isNumber, 'isObject', isObject );
// EXPORTS //
module.exports = isNumber;
},{"./main.js":138,"./object.js":139,"./primitive.js":140,"@stdlib/utils/define-nonenumerable-read-only-property":391}],138:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
/**
* Tests if a value is a number.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a number
*
* @example
* var bool = isNumber( 3.14 );
* // returns true
*
* @example
* var bool = isNumber( new Number( 3.14 ) );
* // returns true
*
* @example
* var bool = isNumber( NaN );
* // returns true
*
* @example
* var bool = isNumber( null );
* // returns false
*/
function isNumber( value ) {
return ( isPrimitive( value ) || isObject( value ) );
}
// EXPORTS //
module.exports = isNumber;
},{"./object.js":139,"./primitive.js":140}],139:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var hasToStringTag = require( '@stdlib/assert/has-tostringtag-support' );
var nativeClass = require( '@stdlib/utils/native-class' );
var Number = require( '@stdlib/number/ctor' );
var test = require( './try2serialize.js' );
// VARIABLES //
var FLG = hasToStringTag();
// MAIN //
/**
* Tests if a value is a number object.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number object
*
* @example
* var bool = isNumber( 3.14 );
* // returns false
*
* @example
* var bool = isNumber( new Number( 3.14 ) );
* // returns true
*/
function isNumber( value ) {
if ( typeof value === 'object' ) {
if ( value instanceof Number ) {
return true;
}
if ( FLG ) {
return test( value );
}
return ( nativeClass( value ) === '[object Number]' );
}
return false;
}
// EXPORTS //
module.exports = isNumber;
},{"./try2serialize.js":142,"@stdlib/assert/has-tostringtag-support":57,"@stdlib/number/ctor":308,"@stdlib/utils/native-class":440}],140:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Tests if a value is a number primitive.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number primitive
*
* @example
* var bool = isNumber( 3.14 );
* // returns true
*
* @example
* var bool = isNumber( NaN );
* // returns true
*
* @example
* var bool = isNumber( new Number( 3.14 ) );
* // returns false
*/
function isNumber( value ) {
return ( typeof value === 'number' );
}
// EXPORTS //
module.exports = isNumber;
},{}],141:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var Number = require( '@stdlib/number/ctor' );
// MAIN //
// eslint-disable-next-line stdlib/no-redeclare
var toString = Number.prototype.toString; // non-generic
// EXPORTS //
module.exports = toString;
},{"@stdlib/number/ctor":308}],142:[function(require,module,exports){
arguments[4][86][0].apply(exports,arguments)
},{"./tostring.js":141,"dup":86}],143:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is object-like.
*
* @module @stdlib/assert/is-object-like
*
* @example
* var isObjectLike = require( '@stdlib/assert/is-object-like' );
*
* var bool = isObjectLike( {} );
* // returns true
*
* bool = isObjectLike( [] );
* // returns true
*
* bool = isObjectLike( null );
* // returns false
*
* @example
* var isObjectLike = require( '@stdlib/assert/is-object-like' ).isObjectLikeArray;
*
* var bool = isObjectLike( [ {}, [] ] );
* // returns true
*
* bool = isObjectLike( [ {}, '3.0' ] );
* // returns false
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var arrayfun = require( '@stdlib/assert/tools/array-function' );
var isObjectLike = require( './main.js' );
// MAIN //
setReadOnly( isObjectLike, 'isObjectLikeArray', arrayfun( isObjectLike ) );
// EXPORTS //
module.exports = isObjectLike;
},{"./main.js":144,"@stdlib/assert/tools/array-function":177,"@stdlib/utils/define-nonenumerable-read-only-property":391}],144:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Tests if a value is object-like.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether a value is object-like
*
* @example
* var bool = isObjectLike( {} );
* // returns true
*
* @example
* var bool = isObjectLike( [] );
* // returns true
*
* @example
* var bool = isObjectLike( null );
* // returns false
*/
function isObjectLike( value ) {
return (
value !== null &&
typeof value === 'object'
);
}
// EXPORTS //
module.exports = isObjectLike;
},{}],145:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is an object.
*
* @module @stdlib/assert/is-object
*
* @example
* var isObject = require( '@stdlib/assert/is-object' );
*
* var bool = isObject( {} );
* // returns true
*
* bool = isObject( true );
* // returns false
*/
// MODULES //
var isObject = require( './main.js' );
// EXPORTS //
module.exports = isObject;
},{"./main.js":146}],146:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isArray = require( '@stdlib/assert/is-array' );
// MAIN //
/**
* Tests if a value is an object; e.g., `{}`.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is an object
*
* @example
* var bool = isObject( {} );
* // returns true
*
* @example
* var bool = isObject( null );
* // returns false
*/
function isObject( value ) {
return (
typeof value === 'object' &&
value !== null &&
!isArray( value )
);
}
// EXPORTS //
module.exports = isObject;
},{"@stdlib/assert/is-array":79}],147:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a plain object.
*
* @module @stdlib/assert/is-plain-object
*
* @example
* var isPlainObject = require( '@stdlib/assert/is-plain-object' );
*
* var bool = isPlainObject( {} );
* // returns true
*
* bool = isPlainObject( null );
* // returns false
*/
// MODULES //
var isPlainObject = require( './main.js' );
// EXPORTS //
module.exports = isPlainObject;
},{"./main.js":148}],148:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isObject = require( '@stdlib/assert/is-object' );
var isFunction = require( '@stdlib/assert/is-function' );
var getPrototypeOf = require( '@stdlib/utils/get-prototype-of' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var objectPrototype = Object.prototype;
// FUNCTIONS //
/**
* Tests that an object only has own properties.
*
* @private
* @param {Object} obj - value to test
* @returns {boolean} boolean indicating if an object only has own properties
*/
function ownProps( obj ) {
var key;
// NOTE: possibility of perf boost if key enumeration order is known (see http://stackoverflow.com/questions/18531624/isplainobject-thing).
for ( key in obj ) {
if ( !hasOwnProp( obj, key ) ) {
return false;
}
}
return true;
}
// MAIN //
/**
* Tests if a value is a plain object.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a plain object
*
* @example
* var bool = isPlainObject( {} );
* // returns true
*
* @example
* var bool = isPlainObject( null );
* // returns false
*/
function isPlainObject( value ) {
var proto;
// Screen for obvious non-objects...
if ( !isObject( value ) ) {
return false;
}
// Objects with no prototype (e.g., `Object.create( null )`) are plain...
proto = getPrototypeOf( value );
if ( !proto ) {
return true;
}
// Objects having a prototype are plain if and only if they are constructed with a global `Object` function and the prototype points to the prototype of a plain object...
return (
// Cannot have own `constructor` property:
!hasOwnProp( value, 'constructor' ) &&
// Prototype `constructor` property must be a function (see also https://bugs.jquery.com/ticket/9897 and http://stackoverflow.com/questions/18531624/isplainobject-thing):
hasOwnProp( proto, 'constructor' ) &&
isFunction( proto.constructor ) &&
nativeClass( proto.constructor ) === '[object Function]' &&
// Test for object-specific method:
hasOwnProp( proto, 'isPrototypeOf' ) &&
isFunction( proto.isPrototypeOf ) &&
(
// Test if the prototype matches the global `Object` prototype (same realm):
proto === objectPrototype ||
// Test that all properties are own properties (cross-realm; *most* likely a plain object):
ownProps( value )
)
);
}
// EXPORTS //
module.exports = isPlainObject;
},{"@stdlib/assert/has-own-property":53,"@stdlib/assert/is-function":102,"@stdlib/assert/is-object":145,"@stdlib/utils/get-prototype-of":406,"@stdlib/utils/native-class":440}],149:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a positive integer.
*
* @module @stdlib/assert/is-positive-integer
*
* @example
* var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' );
*
* var bool = isPositiveInteger( 5.0 );
* // returns true
*
* bool = isPositiveInteger( new Number( 5.0 ) );
* // returns true
*
* bool = isPositiveInteger( -5.0 );
* // returns false
*
* bool = isPositiveInteger( 3.14 );
* // returns false
*
* bool = isPositiveInteger( null );
* // returns false
*
* @example
* var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
*
* var bool = isPositiveInteger( 3.0 );
* // returns true
*
* bool = isPositiveInteger( new Number( 3.0 ) );
* // returns false
*
* @example
* var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isObject;
*
* var bool = isPositiveInteger( 3.0 );
* // returns false
*
* bool = isPositiveInteger( new Number( 3.0 ) );
* // returns true
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var isPositiveInteger = require( './main.js' );
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
setReadOnly( isPositiveInteger, 'isPrimitive', isPrimitive );
setReadOnly( isPositiveInteger, 'isObject', isObject );
// EXPORTS //
module.exports = isPositiveInteger;
},{"./main.js":150,"./object.js":151,"./primitive.js":152,"@stdlib/utils/define-nonenumerable-read-only-property":391}],150:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
/**
* Tests if a value is a positive integer.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a positive integer
*
* @example
* var bool = isPositiveInteger( 5.0 );
* // returns true
*
* @example
* var bool = isPositiveInteger( new Number( 5.0 ) );
* // returns true
*
* @example
* var bool = isPositiveInteger( 0.0 );
* // returns false
*
* @example
* var bool = isPositiveInteger( -5.0 );
* // returns false
*
* @example
* var bool = isPositiveInteger( 3.14 );
* // returns false
*
* @example
* var bool = isPositiveInteger( null );
* // returns false
*/
function isPositiveInteger( value ) {
return ( isPrimitive( value ) || isObject( value ) );
}
// EXPORTS //
module.exports = isPositiveInteger;
},{"./object.js":151,"./primitive.js":152}],151:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isInteger = require( '@stdlib/assert/is-integer' ).isObject;
// MAIN //
/**
* Tests if a value is a number object having a positive integer value.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number object having a positive integer value
*
* @example
* var bool = isPositiveInteger( 3.0 );
* // returns false
*
* @example
* var bool = isPositiveInteger( new Number( 3.0 ) );
* // returns true
*/
function isPositiveInteger( value ) {
return (
isInteger( value ) &&
value.valueOf() > 0.0
);
}
// EXPORTS //
module.exports = isPositiveInteger;
},{"@stdlib/assert/is-integer":110}],152:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;
// MAIN //
/**
* Tests if a value is a number primitive having a positive integer value.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a number primitive having a positive integer value
*
* @example
* var bool = isPositiveInteger( 3.0 );
* // returns true
*
* @example
* var bool = isPositiveInteger( new Number( 3.0 ) );
* // returns false
*/
function isPositiveInteger( value ) {
return (
isInteger( value ) &&
value > 0.0
);
}
// EXPORTS //
module.exports = isPositiveInteger;
},{"@stdlib/assert/is-integer":110}],153:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
var exec = RegExp.prototype.exec; // non-generic
// EXPORTS //
module.exports = exec;
},{}],154:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a regular expression.
*
* @module @stdlib/assert/is-regexp
*
* @example
* var isRegExp = require( '@stdlib/assert/is-regexp' );
*
* var bool = isRegExp( /\.+/ );
* // returns true
*
* bool = isRegExp( {} );
* // returns false
*/
// MODULES //
var isRegExp = require( './main.js' );
// EXPORTS //
module.exports = isRegExp;
},{"./main.js":155}],155:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var hasToStringTag = require( '@stdlib/assert/has-tostringtag-support' );
var nativeClass = require( '@stdlib/utils/native-class' );
var test = require( './try2exec.js' );
// VARIABLES //
var FLG = hasToStringTag();
// MAIN //
/**
* Tests if a value is a regular expression.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a regular expression
*
* @example
* var bool = isRegExp( /\.+/ );
* // returns true
*
* @example
* var bool = isRegExp( {} );
* // returns false
*/
function isRegExp( value ) {
if ( typeof value === 'object' ) {
if ( value instanceof RegExp ) {
return true;
}
if ( FLG ) {
return test( value );
}
return ( nativeClass( value ) === '[object RegExp]' );
}
return false;
}
// EXPORTS //
module.exports = isRegExp;
},{"./try2exec.js":156,"@stdlib/assert/has-tostringtag-support":57,"@stdlib/utils/native-class":440}],156:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var exec = require( './exec.js' );
// MAIN //
/**
* Attempts to call a `RegExp` method.
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating if able to call a `RegExp` method
*/
function test( value ) {
try {
exec.call( value );
return true;
} catch ( err ) { // eslint-disable-line no-unused-vars
return false;
}
}
// EXPORTS //
module.exports = test;
},{"./exec.js":153}],157:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is an array of strings.
*
* @module @stdlib/assert/is-string-array
*
* @example
* var isStringArray = require( '@stdlib/assert/is-string-array' );
*
* var bool = isStringArray( [ 'abc', 'def' ] );
* // returns true
*
* bool = isStringArray( [ 'abc', 123 ] );
* // returns false
*
* @example
* var isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;
*
* var bool = isStringArray( [ 'abc', 'def' ] );
* // returns true
*
* bool = isStringArray( [ 'abc', new String( 'def' ) ] );
* // returns false
*
* @example
* var isStringArray = require( '@stdlib/assert/is-string-array' ).objects;
*
* var bool = isStringArray( [ new String( 'abc' ), new String( 'def' ) ] );
* // returns true
*
* bool = isStringArray( [ new String( 'abc' ), 'def' ] );
* // returns false
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var arrayfun = require( '@stdlib/assert/tools/array-function' );
var isString = require( '@stdlib/assert/is-string' );
// MAIN //
var isStringArray = arrayfun( isString );
setReadOnly( isStringArray, 'primitives', arrayfun( isString.isPrimitive ) );
setReadOnly( isStringArray, 'objects', arrayfun( isString.isObject ) );
// EXPORTS //
module.exports = isStringArray;
},{"@stdlib/assert/is-string":158,"@stdlib/assert/tools/array-function":177,"@stdlib/utils/define-nonenumerable-read-only-property":391}],158:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a string.
*
* @module @stdlib/assert/is-string
*
* @example
* var isString = require( '@stdlib/assert/is-string' );
*
* var bool = isString( 'beep' );
* // returns true
*
* bool = isString( new String( 'beep' ) );
* // returns true
*
* bool = isString( 5 );
* // returns false
*
* @example
* var isString = require( '@stdlib/assert/is-string' ).isObject;
*
* var bool = isString( new String( 'beep' ) );
* // returns true
*
* bool = isString( 'beep' );
* // returns false
*
* @example
* var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
*
* var bool = isString( 'beep' );
* // returns true
*
* bool = isString( new String( 'beep' ) );
* // returns false
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var isString = require( './main.js' );
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
setReadOnly( isString, 'isPrimitive', isPrimitive );
setReadOnly( isString, 'isObject', isObject );
// EXPORTS //
module.exports = isString;
},{"./main.js":159,"./object.js":160,"./primitive.js":161,"@stdlib/utils/define-nonenumerable-read-only-property":391}],159:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isPrimitive = require( './primitive.js' );
var isObject = require( './object.js' );
// MAIN //
/**
* Tests if a value is a string.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a string
*
* @example
* var bool = isString( new String( 'beep' ) );
* // returns true
*
* @example
* var bool = isString( 'beep' );
* // returns true
*/
function isString( value ) {
return ( isPrimitive( value ) || isObject( value ) );
}
// EXPORTS //
module.exports = isString;
},{"./object.js":160,"./primitive.js":161}],160:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var hasToStringTag = require( '@stdlib/assert/has-tostringtag-support' );
var nativeClass = require( '@stdlib/utils/native-class' );
var test = require( './try2valueof.js' );
// VARIABLES //
var FLG = hasToStringTag();
// MAIN //
/**
* Tests if a value is a string object.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a string object
*
* @example
* var bool = isString( new String( 'beep' ) );
* // returns true
*
* @example
* var bool = isString( 'beep' );
* // returns false
*/
function isString( value ) {
if ( typeof value === 'object' ) {
if ( value instanceof String ) {
return true;
}
if ( FLG ) {
return test( value );
}
return ( nativeClass( value ) === '[object String]' );
}
return false;
}
// EXPORTS //
module.exports = isString;
},{"./try2valueof.js":162,"@stdlib/assert/has-tostringtag-support":57,"@stdlib/utils/native-class":440}],161:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Tests if a value is a string primitive.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a string primitive
*
* @example
* var bool = isString( 'beep' );
* // returns true
*
* @example
* var bool = isString( new String( 'beep' ) );
* // returns false
*/
function isString( value ) {
return ( typeof value === 'string' );
}
// EXPORTS //
module.exports = isString;
},{}],162:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var valueOf = require( './valueof.js' ); // eslint-disable-line stdlib/no-redeclare
// MAIN //
/**
* Attempts to extract a string value.
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a string can be extracted
*/
function test( value ) {
try {
valueOf.call( value );
return true;
} catch ( err ) { // eslint-disable-line no-unused-vars
return false;
}
}
// EXPORTS //
module.exports = test;
},{"./valueof.js":163}],163:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// eslint-disable-next-line stdlib/no-redeclare
var valueOf = String.prototype.valueOf; // non-generic
// EXPORTS //
module.exports = valueOf;
},{}],164:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var Int8Array = require( '@stdlib/array/int8' );
var Uint8Array = require( '@stdlib/array/uint8' );
var Uint8ClampedArray = require( '@stdlib/array/uint8c' );
var Int16Array = require( '@stdlib/array/int16' );
var Uint16Array = require( '@stdlib/array/uint16' );
var Int32Array = require( '@stdlib/array/int32' );
var Uint32Array = require( '@stdlib/array/uint32' );
var Float32Array = require( '@stdlib/array/float32' );
var Float64Array = require( '@stdlib/array/float64' );
// MAIN //
var CTORS = [
Float64Array,
Float32Array,
Int32Array,
Uint32Array,
Int16Array,
Uint16Array,
Int8Array,
Uint8Array,
Uint8ClampedArray
];
// EXPORTS //
module.exports = CTORS;
},{"@stdlib/array/float32":2,"@stdlib/array/float64":5,"@stdlib/array/int16":7,"@stdlib/array/int32":10,"@stdlib/array/int8":13,"@stdlib/array/uint16":20,"@stdlib/array/uint32":23,"@stdlib/array/uint8":26,"@stdlib/array/uint8c":29}],165:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a typed array.
*
* @module @stdlib/assert/is-typed-array
*
* @example
* var Int8Array = require( '@stdlib/array/int8' );
* var isTypedArray = require( '@stdlib/assert/is-typed-array' );
*
* var bool = isTypedArray( new Int8Array( 10 ) );
* // returns true
*/
// MODULES //
var isTypedArray = require( './main.js' );
// EXPORTS //
module.exports = isTypedArray;
},{"./main.js":166}],166:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var ctorName = require( '@stdlib/utils/constructor-name' );
var fcnName = require( '@stdlib/utils/function-name' );
var getPrototypeOf = require( '@stdlib/utils/get-prototype-of' );
var hasFloat64ArraySupport = require( '@stdlib/assert/has-float64array-support' );
var Float64Array = require( '@stdlib/array/float64' );
var CTORS = require( './ctors.js' );
var NAMES = require( './names.json' );
// VARIABLES //
// Abstract `TypedArray` class:
var TypedArray = ( hasFloat64ArraySupport() ) ? getPrototypeOf( Float64Array ) : Dummy; // eslint-disable-line max-len
// Ensure abstract typed array class has expected name:
TypedArray = ( fcnName( TypedArray ) === 'TypedArray' ) ? TypedArray : Dummy;
// FUNCTIONS //
/**
* Dummy constructor.
*
* @private
*/
function Dummy() {} // eslint-disable-line no-empty-function
// MAIN //
/**
* Tests if a value is a typed array.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating if a value is a typed array
*
* @example
* var Int8Array = require( '@stdlib/array/int8' );
*
* var bool = isTypedArray( new Int8Array( 10 ) );
* // returns true
*/
function isTypedArray( value ) {
var v;
var i;
if ( typeof value !== 'object' || value === null ) {
return false;
}
// Check for the abstract class...
if ( value instanceof TypedArray ) {
return true;
}
// Check for typed array objects from the same realm (same Node.js `vm` or same `Window` object)...
for ( i = 0; i < CTORS.length; i++ ) {
if ( value instanceof CTORS[ i ] ) {
return true;
}
}
// Walk the prototype tree until we find an object having a desired class...
while ( value ) {
v = ctorName( value );
for ( i = 0; i < NAMES.length; i++ ) {
if ( NAMES[ i ] === v ) {
return true;
}
}
value = getPrototypeOf( value );
}
return false;
}
// EXPORTS //
module.exports = isTypedArray;
},{"./ctors.js":164,"./names.json":167,"@stdlib/array/float64":5,"@stdlib/assert/has-float64array-support":36,"@stdlib/utils/constructor-name":383,"@stdlib/utils/function-name":403,"@stdlib/utils/get-prototype-of":406}],167:[function(require,module,exports){
module.exports=[
"Int8Array",
"Uint8Array",
"Uint8ClampedArray",
"Int16Array",
"Uint16Array",
"Int32Array",
"Uint32Array",
"Float32Array",
"Float64Array"
]
},{}],168:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a Uint16Array.
*
* @module @stdlib/assert/is-uint16array
*
* @example
* var isUint16Array = require( '@stdlib/assert/is-uint16array' );
*
* var bool = isUint16Array( new Uint16Array( 10 ) );
* // returns true
*
* bool = isUint16Array( [] );
* // returns false
*/
// MODULES //
var isUint16Array = require( './main.js' );
// EXPORTS //
module.exports = isUint16Array;
},{"./main.js":169}],169:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var hasUint16Array = ( typeof Uint16Array === 'function' ); // eslint-disable-line stdlib/require-globals
// MAIN //
/**
* Tests if a value is a Uint16Array.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a Uint16Array
*
* @example
* var bool = isUint16Array( new Uint16Array( 10 ) );
* // returns true
*
* @example
* var bool = isUint16Array( [] );
* // returns false
*/
function isUint16Array( value ) {
return (
( hasUint16Array && value instanceof Uint16Array ) || // eslint-disable-line stdlib/require-globals
nativeClass( value ) === '[object Uint16Array]'
);
}
// EXPORTS //
module.exports = isUint16Array;
},{"@stdlib/utils/native-class":440}],170:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a Uint32Array.
*
* @module @stdlib/assert/is-uint32array
*
* @example
* var isUint32Array = require( '@stdlib/assert/is-uint32array' );
*
* var bool = isUint32Array( new Uint32Array( 10 ) );
* // returns true
*
* bool = isUint32Array( [] );
* // returns false
*/
// MODULES //
var isUint32Array = require( './main.js' );
// EXPORTS //
module.exports = isUint32Array;
},{"./main.js":171}],171:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var hasUint32Array = ( typeof Uint32Array === 'function' ); // eslint-disable-line stdlib/require-globals
// MAIN //
/**
* Tests if a value is a Uint32Array.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a Uint32Array
*
* @example
* var bool = isUint32Array( new Uint32Array( 10 ) );
* // returns true
*
* @example
* var bool = isUint32Array( [] );
* // returns false
*/
function isUint32Array( value ) {
return (
( hasUint32Array && value instanceof Uint32Array ) || // eslint-disable-line stdlib/require-globals
nativeClass( value ) === '[object Uint32Array]'
);
}
// EXPORTS //
module.exports = isUint32Array;
},{"@stdlib/utils/native-class":440}],172:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a Uint8Array.
*
* @module @stdlib/assert/is-uint8array
*
* @example
* var isUint8Array = require( '@stdlib/assert/is-uint8array' );
*
* var bool = isUint8Array( new Uint8Array( 10 ) );
* // returns true
*
* bool = isUint8Array( [] );
* // returns false
*/
// MODULES //
var isUint8Array = require( './main.js' );
// EXPORTS //
module.exports = isUint8Array;
},{"./main.js":173}],173:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var hasUint8Array = ( typeof Uint8Array === 'function' ); // eslint-disable-line stdlib/require-globals
// MAIN //
/**
* Tests if a value is a Uint8Array.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a Uint8Array
*
* @example
* var bool = isUint8Array( new Uint8Array( 10 ) );
* // returns true
*
* @example
* var bool = isUint8Array( [] );
* // returns false
*/
function isUint8Array( value ) {
return (
( hasUint8Array && value instanceof Uint8Array ) || // eslint-disable-line stdlib/require-globals
nativeClass( value ) === '[object Uint8Array]'
);
}
// EXPORTS //
module.exports = isUint8Array;
},{"@stdlib/utils/native-class":440}],174:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a value is a Uint8ClampedArray.
*
* @module @stdlib/assert/is-uint8clampedarray
*
* @example
* var isUint8ClampedArray = require( '@stdlib/assert/is-uint8clampedarray' );
*
* var bool = isUint8ClampedArray( new Uint8ClampedArray( 10 ) );
* // returns true
*
* bool = isUint8ClampedArray( [] );
* // returns false
*/
// MODULES //
var isUint8ClampedArray = require( './main.js' );
// EXPORTS //
module.exports = isUint8ClampedArray;
},{"./main.js":175}],175:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
// VARIABLES //
var hasUint8ClampedArray = ( typeof Uint8ClampedArray === 'function' ); // eslint-disable-line stdlib/require-globals
// MAIN //
/**
* Tests if a value is a Uint8ClampedArray.
*
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether value is a Uint8ClampedArray
*
* @example
* var bool = isUint8ClampedArray( new Uint8ClampedArray( 10 ) );
* // returns true
*
* @example
* var bool = isUint8ClampedArray( [] );
* // returns false
*/
function isUint8ClampedArray( value ) {
return (
( hasUint8ClampedArray && value instanceof Uint8ClampedArray ) || // eslint-disable-line stdlib/require-globals
nativeClass( value ) === '[object Uint8ClampedArray]'
);
}
// EXPORTS //
module.exports = isUint8ClampedArray;
},{"@stdlib/utils/native-class":440}],176:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isArray = require( '@stdlib/assert/is-array' );
// MAIN //
/**
* Returns a function which tests if every element in an array passes a test condition.
*
* @param {Function} predicate - function to apply
* @throws {TypeError} must provide a function
* @returns {Function} an array function
*
* @example
* var isOdd = require( '@stdlib/assert/is-odd' );
*
* var arr1 = [ 1, 3, 5, 7 ];
* var arr2 = [ 3, 5, 8 ];
*
* var validate = arrayfcn( isOdd );
*
* var bool = validate( arr1 );
* // returns true
*
* bool = validate( arr2 );
* // returns false
*/
function arrayfcn( predicate ) {
if ( typeof predicate !== 'function' ) {
throw new TypeError( 'invalid argument. Must provide a function. Value: `' + predicate + '`.' );
}
return every;
/**
* Tests if every element in an array passes a test condition.
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether a value is an array for which all elements pass a test condition
*/
function every( value ) {
var len;
var i;
if ( !isArray( value ) ) {
return false;
}
len = value.length;
if ( len === 0 ) {
return false;
}
for ( i = 0; i < len; i++ ) {
if ( predicate( value[ i ] ) === false ) {
return false;
}
}
return true;
}
}
// EXPORTS //
module.exports = arrayfcn;
},{"@stdlib/assert/is-array":79}],177:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return a function which tests if every element in an array passes a test condition.
*
* @module @stdlib/assert/tools/array-function
*
* @example
* var isOdd = require( '@stdlib/assert/is-odd' );
* var arrayfcn = require( '@stdlib/assert/tools/array-function' );
*
* var arr1 = [ 1, 3, 5, 7 ];
* var arr2 = [ 3, 5, 8 ];
*
* var validate = arrayfcn( isOdd );
*
* var bool = validate( arr1 );
* // returns true
*
* bool = validate( arr2 );
* // returns false
*/
// MODULES //
var arrayfcn = require( './arrayfcn.js' );
// EXPORTS //
module.exports = arrayfcn;
},{"./arrayfcn.js":176}],178:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isArrayLike = require( '@stdlib/assert/is-array-like' );
// MAIN //
/**
* Returns a function which tests if every element in an array-like object passes a test condition.
*
* @param {Function} predicate - function to apply
* @throws {TypeError} must provide a function
* @returns {Function} an array-like object function
*
* @example
* var isOdd = require( '@stdlib/assert/is-odd' );
*
* var arr1 = [ 1, 3, 5, 7 ];
* var arr2 = [ 3, 5, 8 ];
*
* var validate = arraylikefcn( isOdd );
*
* var bool = validate( arr1 );
* // returns true
*
* bool = validate( arr2 );
* // returns false
*/
function arraylikefcn( predicate ) {
if ( typeof predicate !== 'function' ) {
throw new TypeError( 'invalid argument. Must provide a function. Value: `' + predicate + '`.' );
}
return every;
/**
* Tests if every element in an array-like object passes a test condition.
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether a value is an array-like object for which all elements pass a test condition
*/
function every( value ) {
var len;
var i;
if ( !isArrayLike( value ) ) {
return false;
}
len = value.length;
if ( len === 0 ) {
return false;
}
for ( i = 0; i < len; i++ ) {
if ( predicate( value[ i ] ) === false ) {
return false;
}
}
return true;
}
}
// EXPORTS //
module.exports = arraylikefcn;
},{"@stdlib/assert/is-array-like":77}],179:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return a function which tests if every element in an array-like object passes a test condition.
*
* @module @stdlib/assert/tools/array-like-function
*
* @example
* var isOdd = require( '@stdlib/assert/is-odd' );
* var arraylikefcn = require( '@stdlib/assert/tools/array-like-function' );
*
* var arr1 = [ 1, 3, 5, 7 ];
* var arr2 = [ 3, 5, 8 ];
*
* var validate = arraylikefcn( isOdd );
*
* var bool = validate( arr1 );
* // returns true
*
* bool = validate( arr2 );
* // returns false
*/
// MODULES //
var arraylikefcn = require( './arraylikefcn.js' );
// EXPORTS //
module.exports = arraylikefcn;
},{"./arraylikefcn.js":178}],180:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var TransformStream = require( '@stdlib/streams/node/transform' );
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var isFunction = require( '@stdlib/assert/is-function' );
var createHarness = require( './harness' );
var harness = require( './get_harness.js' );
// VARIABLES //
var listeners = [];
// FUNCTIONS //
/**
* Callback invoked when a harness finishes running all benchmarks.
*
* @private
*/
function done() {
var len;
var f;
var i;
len = listeners.length;
// Inform all the listeners that the harness has finished...
for ( i = 0; i < len; i++ ) {
f = listeners.shift();
f();
}
}
/**
* Creates a results stream.
*
* @private
* @param {Options} [options] - stream options
* @throws {Error} must provide valid stream options
* @returns {TransformStream} results stream
*/
function createStream( options ) {
var stream;
var bench;
var opts;
if ( arguments.length ) {
opts = options;
} else {
opts = {};
}
// If we have already created a harness, calling this function simply creates another results stream...
if ( harness.cached ) {
bench = harness();
return bench.createStream( opts );
}
stream = new TransformStream( opts );
opts.stream = stream;
// Create a harness which uses the created output stream:
harness( opts, done );
return stream;
}
/**
* Adds a listener for when a harness finishes running all benchmarks.
*
* @private
* @param {Callback} clbk - listener
* @throws {TypeError} must provide a function
* @throws {Error} must provide a listener only once
* @returns {void}
*/
function onFinish( clbk ) {
var i;
if ( !isFunction( clbk ) ) {
throw new TypeError( 'invalid argument. Must provide a function. Value: `'+clbk+'`.' );
}
// Allow adding a listener only once...
for ( i = 0; i < listeners.length; i++ ) {
if ( clbk === listeners[ i ] ) {
throw new Error( 'invalid argument. Attempted to add duplicate listener.' );
}
}
listeners.push( clbk );
}
// MAIN //
/**
* Runs a benchmark.
*
* @param {string} name - benchmark name
* @param {Options} [options] - benchmark options
* @param {boolean} [options.skip=false] - boolean indicating whether to skip a benchmark
* @param {(PositiveInteger|null)} [options.iterations=null] - number of iterations
* @param {PositiveInteger} [options.repeats=3] - number of repeats
* @param {PositiveInteger} [options.timeout=300000] - number of milliseconds before a benchmark automatically fails
* @param {Function} [benchmark] - function containing benchmark code
* @throws {TypeError} first argument must be a string
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @throws {TypeError} benchmark argument must a function
* @returns {Benchmark} benchmark harness
*
* @example
* bench( 'beep', function benchmark( b ) {
* var x;
* var i;
* b.tic();
* for ( i = 0; i < b.iterations; i++ ) {
* x = Math.sin( Math.random() );
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* }
* b.toc();
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* b.end();
* });
*/
function bench( name, options, benchmark ) {
var h = harness( done );
if ( arguments.length < 2 ) {
h( name );
} else if ( arguments.length === 2 ) {
h( name, options );
} else {
h( name, options, benchmark );
}
return bench;
}
/**
* Creates a benchmark harness.
*
* @name createHarness
* @memberof bench
* @type {Function}
* @param {Options} [options] - harness options
* @param {Callback} [clbk] - callback to invoke when a harness finishes running all benchmarks
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @throws {TypeError} callback argument must be a function
* @returns {Function} benchmark harness
*/
setReadOnly( bench, 'createHarness', createHarness );
/**
* Creates a results stream.
*
* @name createStream
* @memberof bench
* @type {Function}
* @param {Options} [options] - stream options
* @throws {Error} must provide valid stream options
* @returns {TransformStream} results stream
*/
setReadOnly( bench, 'createStream', createStream );
/**
* Adds a listener for when a harness finishes running all benchmarks.
*
* @name onFinish
* @memberof bench
* @type {Function}
* @param {Callback} clbk - listener
* @throws {TypeError} must provide a function
* @throws {Error} must provide a listener only once
* @returns {void}
*/
setReadOnly( bench, 'onFinish', onFinish );
// EXPORTS //
module.exports = bench;
},{"./get_harness.js":202,"./harness":203,"@stdlib/assert/is-function":102,"@stdlib/streams/node/transform":367,"@stdlib/utils/define-nonenumerable-read-only-property":391}],181:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
// MAIN //
/**
* Generates an assertion.
*
* @private
* @param {boolean} ok - assertion outcome
* @param {Options} opts - options
*/
function assert( ok, opts ) {
/* eslint-disable no-invalid-this, no-unused-vars */ // TODO: remove no-unused-vars once `err` is used
var result;
var err;
result = {
'id': this._count,
'ok': ok,
'skip': opts.skip,
'todo': opts.todo,
'name': opts.message || '(unnamed assert)',
'operator': opts.operator
};
if ( hasOwnProp( opts, 'actual' ) ) {
result.actual = opts.actual;
}
if ( hasOwnProp( opts, 'expected' ) ) {
result.expected = opts.expected;
}
if ( !ok ) {
result.error = opts.error || new Error( this.name );
err = new Error( 'exception' );
// TODO: generate an exception in order to locate the calling function (https://github.com/substack/tape/blob/master/lib/test.js#L215)
}
this._count += 1;
this.emit( 'result', result );
}
// EXPORTS //
module.exports = assert;
},{"@stdlib/assert/has-own-property":53}],182:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// EXPORTS //
module.exports = clearTimeout;
},{}],183:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var trim = require( '@stdlib/string/trim' );
var replace = require( '@stdlib/string/replace' );
var EOL = require( '@stdlib/regexp/eol' ).REGEXP;
// VARIABLES //
var RE_COMMENT = /^#\s*/;
// MAIN //
/**
* Writes a comment.
*
* @private
* @param {string} msg - comment message
*/
function comment( msg ) {
/* eslint-disable no-invalid-this */
var lines;
var i;
msg = trim( msg );
lines = msg.split( EOL );
for ( i = 0; i < lines.length; i++ ) {
msg = trim( lines[ i ] );
msg = replace( msg, RE_COMMENT, '' );
this.emit( 'result', msg );
}
}
// EXPORTS //
module.exports = comment;
},{"@stdlib/regexp/eol":351,"@stdlib/string/replace":373,"@stdlib/string/trim":375}],184:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Asserts that `actual` is deeply equal to `expected`.
*
* @private
* @param {*} actual - actual value
* @param {*} expected - expected value
* @param {string} [msg] message
*/
function deepEqual( actual, expected, msg ) {
/* eslint-disable no-invalid-this */
this.comment( 'actual: '+actual+'. expected: '+expected+'. msg: '+msg+'.' );
// TODO: implement
}
// EXPORTS //
module.exports = deepEqual;
},{}],185:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var nextTick = require( './../utils/next_tick.js' );
// MAIN //
/**
* Ends a benchmark.
*
* @private
*/
function end() {
/* eslint-disable no-invalid-this */
var self = this;
if ( this._ended ) {
this.fail( '.end() called more than once' );
} else {
// Prevents releasing the zalgo when running synchronous benchmarks.
nextTick( onTick );
}
this._ended = true;
this._running = false;
/**
* Callback invoked upon a subsequent tick of the event loop.
*
* @private
*/
function onTick() {
self.emit( 'end' );
}
}
// EXPORTS //
module.exports = end;
},{"./../utils/next_tick.js":222}],186:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Returns a `boolean` indicating if a benchmark has ended.
*
* @private
* @returns {boolean} boolean indicating if a benchmark has ended
*/
function ended() {
/* eslint-disable no-invalid-this */
return this._ended;
}
// EXPORTS //
module.exports = ended;
},{}],187:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Asserts that `actual` is strictly equal to `expected`.
*
* @private
* @param {*} actual - actual value
* @param {*} expected - expected value
* @param {string} [msg] - message
*/
function equal( actual, expected, msg ) {
/* eslint-disable no-invalid-this */
this._assert( actual === expected, {
'message': msg || 'should be equal',
'operator': 'equal',
'expected': expected,
'actual': actual
});
}
// EXPORTS //
module.exports = equal;
},{}],188:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Forcefully ends a benchmark.
*
* @private
* @returns {void}
*/
function exit() {
/* eslint-disable no-invalid-this */
if ( this._exited ) {
// If we have already "exited", do not create more failing assertions when one should suffice...
return;
}
// Only "exit" when a benchmark has either not yet been run or is currently running. If a benchmark has already ended, no need to generate a failing assertion.
if ( !this._ended ) {
this._exited = true;
this.fail( 'benchmark exited without ending' );
// Allow running benchmarks to call `end` on their own...
if ( !this._running ) {
this.end();
}
}
}
// EXPORTS //
module.exports = exit;
},{}],189:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Generates a failing assertion.
*
* @private
* @param {string} msg - message
*/
function fail( msg ) {
/* eslint-disable no-invalid-this */
this._assert( false, {
'message': msg,
'operator': 'fail'
});
}
// EXPORTS //
module.exports = fail;
},{}],190:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var EventEmitter = require( 'events' ).EventEmitter;
var inherit = require( '@stdlib/utils/inherit' );
var defineProperty = require( '@stdlib/utils/define-property' );
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var tic = require( '@stdlib/time/tic' );
var toc = require( '@stdlib/time/toc' );
var run = require( './run.js' );
var exit = require( './exit.js' );
var ended = require( './ended.js' );
var assert = require( './assert.js' );
var comment = require( './comment.js' );
var skip = require( './skip.js' );
var todo = require( './todo.js' );
var fail = require( './fail.js' );
var pass = require( './pass.js' );
var ok = require( './ok.js' );
var notOk = require( './not_ok.js' );
var equal = require( './equal.js' );
var notEqual = require( './not_equal.js' );
var deepEqual = require( './deep_equal.js' );
var notDeepEqual = require( './not_deep_equal.js' );
var end = require( './end.js' );
// MAIN //
/**
* Benchmark constructor.
*
* @constructor
* @param {string} name - benchmark name
* @param {Options} opts - benchmark options
* @param {boolean} opts.skip - boolean indicating whether to skip a benchmark
* @param {PositiveInteger} opts.iterations - number of iterations
* @param {PositiveInteger} opts.timeout - number of milliseconds before a benchmark automatically fails
* @param {Function} [benchmark] - function containing benchmark code
* @returns {Benchmark} Benchmark instance
*
* @example
* var bench = new Benchmark( 'beep', function benchmark( b ) {
* var x;
* var i;
* b.comment( 'Running benchmarks...' );
* b.tic();
* for ( i = 0; i < b.iterations; i++ ) {
* x = Math.sin( Math.random() );
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* }
* b.toc();
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* b.comment( 'Finished running benchmarks.' );
* b.end();
* });
*/
function Benchmark( name, opts, benchmark ) {
var hasTicked;
var hasTocked;
var self;
var time;
if ( !( this instanceof Benchmark ) ) {
return new Benchmark( name, opts, benchmark );
}
self = this;
hasTicked = false;
hasTocked = false;
EventEmitter.call( this );
// Private properties:
setReadOnly( this, '_benchmark', benchmark );
setReadOnly( this, '_skip', opts.skip );
defineProperty( this, '_ended', {
'configurable': false,
'enumerable': false,
'writable': true,
'value': false
});
defineProperty( this, '_running', {
'configurable': false,
'enumerable': false,
'writable': true,
'value': false
});
defineProperty( this, '_exited', {
'configurable': false,
'enumerable': false,
'writable': true,
'value': false
});
defineProperty( this, '_count', {
'configurable': false,
'enumerable': false,
'writable': true,
'value': 0
});
// Read-only:
setReadOnly( this, 'name', name );
setReadOnly( this, 'tic', start );
setReadOnly( this, 'toc', stop );
setReadOnly( this, 'iterations', opts.iterations );
setReadOnly( this, 'timeout', opts.timeout );
return this;
/**
* Starts a benchmark timer.
*
* ## Notes
*
* - Using a scoped variable prevents nefarious mutation by bad actors hoping to manipulate benchmark results.
* - The one attack vector which remains is manipulation of the `require` cache for `tic` and `toc`.
* - One way to combat cache manipulation is by comparing the checksum of `Function#toString()` against known values.
*
* @private
*/
function start() {
if ( hasTicked ) {
self.fail( '.tic() called more than once' );
} else {
self.emit( 'tic' );
hasTicked = true;
time = tic();
}
}
/**
* Stops a benchmark timer.
*
* @private
* @returns {void}
*/
function stop() {
var elapsed;
var secs;
var rate;
var out;
if ( hasTicked === false ) {
return self.fail( '.toc() called before .tic()' );
}
elapsed = toc( time );
if ( hasTocked ) {
return self.fail( '.toc() called more than once' );
}
hasTocked = true;
self.emit( 'toc' );
secs = elapsed[ 0 ] + ( elapsed[ 1 ]/1e9 );
rate = self.iterations / secs;
out = {
'ok': true,
'operator': 'result',
'iterations': self.iterations,
'elapsed': secs,
'rate': rate
};
self.emit( 'result', out );
}
}
/*
* Inherit from the `EventEmitter` prototype.
*/
inherit( Benchmark, EventEmitter );
/**
* Runs a benchmark.
*
* @private
* @name run
* @memberof Benchmark.prototype
* @type {Function}
*/
setReadOnly( Benchmark.prototype, 'run', run );
/**
* Forcefully ends a benchmark.
*
* @private
* @name exit
* @memberof Benchmark.prototype
* @type {Function}
*/
setReadOnly( Benchmark.prototype, 'exit', exit );
/**
* Returns a `boolean` indicating if a benchmark has ended.
*
* @private
* @name ended
* @memberof Benchmark.prototype
* @type {Function}
* @returns {boolean} boolean indicating if a benchmark has ended
*/
setReadOnly( Benchmark.prototype, 'ended', ended );
/**
* Generates an assertion.
*
* @private
* @name _assert
* @memberof Benchmark.prototype
* @type {Function}
* @param {boolean} ok - assertion outcome
* @param {Options} opts - options
*/
setReadOnly( Benchmark.prototype, '_assert', assert );
/**
* Writes a comment.
*
* @name comment
* @memberof Benchmark.prototype
* @type {Function}
* @param {string} msg - comment message
*/
setReadOnly( Benchmark.prototype, 'comment', comment );
/**
* Generates an assertion which will be skipped.
*
* @name skip
* @memberof Benchmark.prototype
* @type {Function}
* @param {*} value - value
* @param {string} msg - message
*/
setReadOnly( Benchmark.prototype, 'skip', skip );
/**
* Generates an assertion which should be implemented.
*
* @name todo
* @memberof Benchmark.prototype
* @type {Function}
* @param {*} value - value
* @param {string} msg - message
*/
setReadOnly( Benchmark.prototype, 'todo', todo );
/**
* Generates a failing assertion.
*
* @name fail
* @memberof Benchmark.prototype
* @type {Function}
* @param {string} msg - message
*/
setReadOnly( Benchmark.prototype, 'fail', fail );
/**
* Generates a passing assertion.
*
* @name pass
* @memberof Benchmark.prototype
* @type {Function}
* @param {string} msg - message
*/
setReadOnly( Benchmark.prototype, 'pass', pass );
/**
* Asserts that a `value` is truthy.
*
* @name ok
* @memberof Benchmark.prototype
* @type {Function}
* @param {*} value - value
* @param {string} [msg] - message
*/
setReadOnly( Benchmark.prototype, 'ok', ok );
/**
* Asserts that a `value` is falsy.
*
* @name notOk
* @memberof Benchmark.prototype
* @type {Function}
* @param {*} value - value
* @param {string} [msg] - message
*/
setReadOnly( Benchmark.prototype, 'notOk', notOk );
/**
* Asserts that `actual` is strictly equal to `expected`.
*
* @name equal
* @memberof Benchmark.prototype
* @type {Function}
* @param {*} actual - actual value
* @param {*} expected - expected value
* @param {string} [msg] - message
*/
setReadOnly( Benchmark.prototype, 'equal', equal );
/**
* Asserts that `actual` is not strictly equal to `expected`.
*
* @name notEqual
* @memberof Benchmark.prototype
* @type {Function}
* @param {*} actual - actual value
* @param {*} expected - expected value
* @param {string} [msg] - message
*/
setReadOnly( Benchmark.prototype, 'notEqual', notEqual );
/**
* Asserts that `actual` is deeply equal to `expected`.
*
* @name deepEqual
* @memberof Benchmark.prototype
* @type {Function}
* @param {*} actual - actual value
* @param {*} expected - expected value
* @param {string} [msg] message
*/
setReadOnly( Benchmark.prototype, 'deepEqual', deepEqual );
/**
* Asserts that `actual` is not deeply equal to `expected`.
*
* @name notDeepEqual
* @memberof Benchmark.prototype
* @type {Function}
* @param {*} actual - actual value
* @param {*} expected - expected value
* @param {string} [msg] message
*/
setReadOnly( Benchmark.prototype, 'notDeepEqual', notDeepEqual );
/**
* Ends a benchmark.
*
* @name end
* @memberof Benchmark.prototype
* @type {Function}
*/
setReadOnly( Benchmark.prototype, 'end', end );
// EXPORTS //
module.exports = Benchmark;
},{"./assert.js":181,"./comment.js":183,"./deep_equal.js":184,"./end.js":185,"./ended.js":186,"./equal.js":187,"./exit.js":188,"./fail.js":189,"./not_deep_equal.js":191,"./not_equal.js":192,"./not_ok.js":193,"./ok.js":194,"./pass.js":195,"./run.js":196,"./skip.js":198,"./todo.js":199,"@stdlib/time/tic":377,"@stdlib/time/toc":381,"@stdlib/utils/define-nonenumerable-read-only-property":391,"@stdlib/utils/define-property":398,"@stdlib/utils/inherit":419,"events":472}],191:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Asserts that `actual` is not deeply equal to `expected`.
*
* @private
* @param {*} actual - actual value
* @param {*} expected - expected value
* @param {string} [msg] message
*/
function notDeepEqual( actual, expected, msg ) {
/* eslint-disable no-invalid-this */
this.comment( 'actual: '+actual+'. expected: '+expected+'. msg: '+msg+'.' );
// TODO: implement
}
// EXPORTS //
module.exports = notDeepEqual;
},{}],192:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Asserts that `actual` is not strictly equal to `expected`.
*
* @private
* @param {*} actual - actual value
* @param {*} expected - expected value
* @param {string} [msg] - message
*/
function notEqual( actual, expected, msg ) {
/* eslint-disable no-invalid-this */
this._assert( actual !== expected, {
'message': msg || 'should not be equal',
'operator': 'notEqual',
'expected': expected,
'actual': actual
});
}
// EXPORTS //
module.exports = notEqual;
},{}],193:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Asserts that a `value` is falsy.
*
* @private
* @param {*} value - value
* @param {string} [msg] - message
*/
function notOk( value, msg ) {
/* eslint-disable no-invalid-this */
this._assert( !value, {
'message': msg || 'should be falsy',
'operator': 'notOk',
'expected': false,
'actual': value
});
}
// EXPORTS //
module.exports = notOk;
},{}],194:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Asserts that a `value` is truthy.
*
* @private
* @param {*} value - value
* @param {string} [msg] - message
*/
function ok( value, msg ) {
/* eslint-disable no-invalid-this */
this._assert( !!value, {
'message': msg || 'should be truthy',
'operator': 'ok',
'expected': true,
'actual': value
});
}
// EXPORTS //
module.exports = ok;
},{}],195:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Generates a passing assertion.
*
* @private
* @param {string} msg - message
*/
function pass( msg ) {
/* eslint-disable no-invalid-this */
this._assert( true, {
'message': msg,
'operator': 'pass'
});
}
// EXPORTS //
module.exports = pass;
},{}],196:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var timeout = require( './set_timeout.js' );
var clear = require( './clear_timeout.js' );
// MAIN //
/**
* Runs a benchmark.
*
* @private
* @returns {void}
*/
function run() {
/* eslint-disable no-invalid-this */
var self;
var id;
if ( this._skip ) {
this.comment( 'SKIP '+this.name );
return this.end();
}
if ( !this._benchmark ) {
this.comment( 'TODO '+this.name );
return this.end();
}
self = this;
this._running = true;
id = timeout( onTimeout, this.timeout );
this.once( 'end', endTimeout );
this.emit( 'prerun' );
this._benchmark( this );
this.emit( 'run' );
/**
* Callback invoked once a timeout ends.
*
* @private
*/
function onTimeout() {
self.fail( 'benchmark timed out after '+self.timeout+'ms' );
}
/**
* Clears a timeout.
*
* @private
*/
function endTimeout() {
clear( id );
}
}
// EXPORTS //
module.exports = run;
},{"./clear_timeout.js":182,"./set_timeout.js":197}],197:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// EXPORTS //
module.exports = setTimeout;
},{}],198:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Generates an assertion which will be skipped.
*
* @private
* @param {*} value - value
* @param {string} msg - message
*/
function skip( value, msg ) {
/* eslint-disable no-invalid-this */
this._assert( true, {
'message': msg,
'operator': 'skip',
'skip': true
});
}
// EXPORTS //
module.exports = skip;
},{}],199:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Generates an assertion which should be implemented.
*
* @private
* @param {*} value - value
* @param {string} msg - message
*/
function todo( value, msg ) {
/* eslint-disable no-invalid-this */
this._assert( !!value, {
'message': msg,
'operator': 'todo',
'todo': true
});
}
// EXPORTS //
module.exports = todo;
},{}],200:[function(require,module,exports){
module.exports={
"skip": false,
"iterations": null,
"repeats": 3,
"timeout": 300000
}
},{}],201:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isFunction = require( '@stdlib/assert/is-function' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isObject = require( '@stdlib/assert/is-plain-object' );
var isNodeWritableStreamLike = require( '@stdlib/assert/is-node-writable-stream-like' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var pick = require( '@stdlib/utils/pick' );
var omit = require( '@stdlib/utils/omit' );
var noop = require( '@stdlib/utils/noop' );
var createHarness = require( './harness' );
var logStream = require( './log' );
var canEmitExit = require( './utils/can_emit_exit.js' );
var proc = require( './utils/process.js' );
// MAIN //
/**
* Creates a benchmark harness which supports closing when a process exits.
*
* @private
* @param {Options} [options] - function options
* @param {boolean} [options.autoclose] - boolean indicating whether to automatically close a harness after a harness finishes running all benchmarks
* @param {Stream} [options.stream] - output writable stream
* @param {Callback} [clbk] - callback to invoke when a harness finishes running all benchmarks
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @throws {TypeError} callback argument must be a function
* @returns {Function} benchmark harness
*
* @example
* var proc = require( 'process' );
* var bench = createExitHarness( onFinish );
*
* function onFinish() {
* bench.close();
* }
*
* bench( 'beep', function benchmark( b ) {
* var x;
* var i;
* b.tic();
* for ( i = 0; i < b.iterations; i++ ) {
* x = Math.sin( Math.random() );
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* }
* b.toc();
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* b.end();
* });
*
* @example
* var stdout = require( '@stdlib/streams/node/stdout' );
*
* var stream = createExitHarness().createStream();
* stream.pipe( stdout );
*/
function createExitHarness() {
var exitCode;
var pipeline;
var harness;
var options;
var stream;
var topts;
var opts;
var clbk;
if ( arguments.length === 0 ) {
options = {};
clbk = noop;
} else if ( arguments.length === 1 ) {
if ( isFunction( arguments[ 0 ] ) ) {
options = {};
clbk = arguments[ 0 ];
} else if ( isObject( arguments[ 0 ] ) ) {
options = arguments[ 0 ];
clbk = noop;
} else {
throw new TypeError( 'invalid argument. Must provide either an options object or a callback function. Value: `'+arguments[ 0 ]+'`.' );
}
} else {
options = arguments[ 0 ];
if ( !isObject( options ) ) {
throw new TypeError( 'invalid argument. First argument must be an object. Value: `'+options+'`.' );
}
clbk = arguments[ 1 ];
if ( !isFunction( clbk ) ) {
throw new TypeError( 'invalid argument. Second argument must be a function. Value: `'+clbk+'`.' );
}
}
opts = {};
if ( hasOwnProp( options, 'autoclose' ) ) {
opts.autoclose = options.autoclose;
if ( !isBoolean( opts.autoclose ) ) {
throw new TypeError( 'invalid option. `autoclose` option must be a boolean primitive. Option: `'+opts.autoclose+'`.' );
}
}
if ( hasOwnProp( options, 'stream' ) ) {
opts.stream = options.stream;
if ( !isNodeWritableStreamLike( opts.stream ) ) {
throw new TypeError( 'invalid option. `stream` option must be a writable stream. Option: `'+opts.stream+'`.' );
}
}
exitCode = 0;
// Create a new harness:
topts = pick( opts, [ 'autoclose' ] );
harness = createHarness( topts, done );
// Create a results stream:
topts = omit( options, [ 'autoclose', 'stream' ] );
stream = harness.createStream( topts );
// Pipe results to an output stream:
pipeline = stream.pipe( opts.stream || logStream() );
// If a process can emit an 'exit' event, capture errors in order to set the exit code...
if ( canEmitExit ) {
pipeline.on( 'error', onError );
proc.on( 'exit', onExit );
}
return harness;
/**
* Callback invoked when a harness finishes.
*
* @private
* @returns {void}
*/
function done() {
return clbk();
}
/**
* Callback invoked upon a stream `error` event.
*
* @private
* @param {Error} error - error object
*/
function onError() {
exitCode = 1;
}
/**
* Callback invoked upon an `exit` event.
*
* @private
* @param {integer} code - exit code
*/
function onExit( code ) {
if ( code !== 0 ) {
// Allow the process to exit...
return;
}
harness.close();
proc.exit( exitCode || harness.exitCode );
}
}
// EXPORTS //
module.exports = createExitHarness;
},{"./harness":203,"./log":209,"./utils/can_emit_exit.js":220,"./utils/process.js":223,"@stdlib/assert/has-own-property":53,"@stdlib/assert/is-boolean":81,"@stdlib/assert/is-function":102,"@stdlib/assert/is-node-writable-stream-like":124,"@stdlib/assert/is-plain-object":147,"@stdlib/utils/noop":447,"@stdlib/utils/omit":449,"@stdlib/utils/pick":451}],202:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var canEmitExit = require( './utils/can_emit_exit.js' );
var createExitHarness = require( './exit_harness.js' );
// VARIABLES //
var harness;
// MAIN //
/**
* Returns a benchmark harness. If a harness has already been created, returns the cached harness.
*
* @private
* @param {Options} [options] - harness options
* @param {Callback} [clbk] - callback to invoke when a harness finishes running all benchmarks
* @returns {Function} benchmark harness
*/
function getHarness( options, clbk ) {
var opts;
var cb;
if ( harness ) {
return harness;
}
if ( arguments.length > 1 ) {
opts = options;
cb = clbk;
} else {
opts = {};
cb = options;
}
opts.autoclose = !canEmitExit;
harness = createExitHarness( opts, cb );
// Update state:
getHarness.cached = true;
return harness;
}
// EXPORTS //
module.exports = getHarness;
},{"./exit_harness.js":201,"./utils/can_emit_exit.js":220}],203:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var isFunction = require( '@stdlib/assert/is-function' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isObject = require( '@stdlib/assert/is-plain-object' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var copy = require( '@stdlib/utils/copy' );
var Benchmark = require( './../benchmark-class' );
var Runner = require( './../runner' );
var nextTick = require( './../utils/next_tick.js' );
var DEFAULTS = require( './../defaults.json' );
var validate = require( './validate.js' );
var init = require( './init.js' );
// MAIN //
/**
* Creates a benchmark harness.
*
* @param {Options} [options] - function options
* @param {boolean} [options.autoclose] - boolean indicating whether to automatically close a harness after a harness finishes running all benchmarks
* @param {Callback} [clbk] - callback to invoke when a harness finishes running all benchmarks
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @throws {TypeError} callback argument must be a function
* @returns {Function} benchmark harness
*
* @example
* var bench = createHarness( onFinish );
*
* function onFinish() {
* bench.close();
* console.log( 'Exit code: %d', bench.exitCode );
* }
*
* bench( 'beep', function benchmark( b ) {
* var x;
* var i;
* b.tic();
* for ( i = 0; i < b.iterations; i++ ) {
* x = Math.sin( Math.random() );
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* }
* b.toc();
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* b.end();
* });
*
* @example
* var stdout = require( '@stdlib/streams/node/stdout' );
*
* var stream = createHarness().createStream();
* stream.pipe( stdout );
*/
function createHarness( options, clbk ) {
var exitCode;
var runner;
var queue;
var opts;
var cb;
opts = {};
if ( arguments.length === 1 ) {
if ( isFunction( options ) ) {
cb = options;
} else if ( isObject( options ) ) {
opts = options;
} else {
throw new TypeError( 'invalid argument. Must provide either an options object or a callback function. Value: `'+options+'`.' );
}
} else if ( arguments.length > 1 ) {
if ( !isObject( options ) ) {
throw new TypeError( 'invalid argument. First argument must be an object. Value: `'+options+'`.' );
}
if ( hasOwnProp( options, 'autoclose' ) ) {
opts.autoclose = options.autoclose;
if ( !isBoolean( opts.autoclose ) ) {
throw new TypeError( 'invalid option. `autoclose` option must be a boolean primitive. Option: `'+opts.autoclose+'`.' );
}
}
cb = clbk;
if ( !isFunction( cb ) ) {
throw new TypeError( 'invalid argument. Second argument must be a function. Value: `'+cb+'`.' );
}
}
runner = new Runner();
if ( opts.autoclose ) {
runner.once( 'done', close );
}
if ( cb ) {
runner.once( 'done', cb );
}
exitCode = 0;
queue = [];
/**
* Benchmark harness.
*
* @private
* @param {string} name - benchmark name
* @param {Options} [options] - benchmark options
* @param {boolean} [options.skip=false] - boolean indicating whether to skip a benchmark
* @param {(PositiveInteger|null)} [options.iterations=null] - number of iterations
* @param {PositiveInteger} [options.repeats=3] - number of repeats
* @param {PositiveInteger} [options.timeout=300000] - number of milliseconds before a benchmark automatically fails
* @param {Function} [benchmark] - function containing benchmark code
* @throws {TypeError} first argument must be a string
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @throws {TypeError} benchmark argument must a function
* @throws {Error} benchmark error
* @returns {Function} benchmark harness
*/
function harness( name, options, benchmark ) {
var opts;
var err;
var b;
if ( !isString( name ) ) {
throw new TypeError( 'invalid argument. First argument must be a string. Value: `'+name+'`.' );
}
opts = copy( DEFAULTS );
if ( arguments.length === 2 ) {
if ( isFunction( options ) ) {
b = options;
} else {
err = validate( opts, options );
if ( err ) {
throw err;
}
}
} else if ( arguments.length > 2 ) {
err = validate( opts, options );
if ( err ) {
throw err;
}
b = benchmark;
if ( !isFunction( b ) ) {
throw new TypeError( 'invalid argument. Third argument must be a function. Value: `'+b+'`.' );
}
}
// Add the benchmark to the initialization queue:
queue.push( [ name, opts, b ] );
// Perform initialization on the next turn of the event loop (note: this allows all benchmarks to be "registered" within the same turn of the loop; otherwise, we run the risk of registration-execution race conditions (i.e., a benchmark registers and executes before other benchmarks can register, depleting the benchmark queue and leading the harness to close)):
if ( queue.length === 1 ) {
nextTick( initialize );
}
return harness;
}
/**
* Initializes each benchmark.
*
* @private
* @returns {void}
*/
function initialize() {
var idx = -1;
return next();
/**
* Initialize the next benchmark.
*
* @private
* @returns {void}
*/
function next() {
var args;
idx += 1;
// If all benchmarks have been initialized, begin running the benchmarks:
if ( idx === queue.length ) {
queue.length = 0;
return runner.run();
}
// Initialize the next benchmark:
args = queue[ idx ];
init( args[ 0 ], args[ 1 ], args[ 2 ], onInit );
}
/**
* Callback invoked after performing initialization tasks.
*
* @private
* @param {string} name - benchmark name
* @param {Options} opts - benchmark options
* @param {(Function|undefined)} benchmark - function containing benchmark code
* @returns {void}
*/
function onInit( name, opts, benchmark ) {
var b;
var i;
// Create a `Benchmark` instance for each repeat to ensure each benchmark has its own state...
for ( i = 0; i < opts.repeats; i++ ) {
b = new Benchmark( name, opts, benchmark );
b.on( 'result', onResult );
runner.push( b );
}
return next();
}
}
/**
* Callback invoked upon a `result` event.
*
* @private
* @param {(string|Object)} result - result
*/
function onResult( result ) {
if (
!isString( result ) &&
!result.ok &&
!result.todo
) {
exitCode = 1;
}
}
/**
* Returns a results stream.
*
* @private
* @param {Object} [options] - options
* @returns {TransformStream} transform stream
*/
function createStream( options ) {
if ( arguments.length ) {
return runner.createStream( options );
}
return runner.createStream();
}
/**
* Closes a benchmark harness.
*
* @private
*/
function close() {
runner.close();
}
/**
* Forcefully exits a benchmark harness.
*
* @private
*/
function exit() {
runner.exit();
}
/**
* Returns the harness exit code.
*
* @private
* @returns {NonNegativeInteger} exit code
*/
function getExitCode() {
return exitCode;
}
setReadOnly( harness, 'createStream', createStream );
setReadOnly( harness, 'close', close );
setReadOnly( harness, 'exit', exit );
setReadOnlyAccessor( harness, 'exitCode', getExitCode );
return harness;
}
// EXPORTS //
module.exports = createHarness;
},{"./../benchmark-class":190,"./../defaults.json":200,"./../runner":217,"./../utils/next_tick.js":222,"./init.js":204,"./validate.js":207,"@stdlib/assert/has-own-property":53,"@stdlib/assert/is-boolean":81,"@stdlib/assert/is-function":102,"@stdlib/assert/is-plain-object":147,"@stdlib/assert/is-string":158,"@stdlib/utils/copy":387,"@stdlib/utils/define-nonenumerable-read-only-accessor":389,"@stdlib/utils/define-nonenumerable-read-only-property":391}],204:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var pretest = require( './pretest.js' );
var iterations = require( './iterations.js' );
// MAIN //
/**
* Performs benchmark initialization tasks.
*
* @private
* @param {string} name - benchmark name
* @param {Options} opts - benchmark options
* @param {(Function|undefined)} benchmark - function containing benchmark code
* @param {Callback} clbk - callback to invoke after completing initialization tasks
* @returns {void}
*/
function init( name, opts, benchmark, clbk ) {
// If no benchmark function, then the benchmark is considered a "todo", so no need to repeat multiple times...
if ( !benchmark ) {
opts.repeats = 1;
return clbk( name, opts, benchmark );
}
// If the `skip` option to `true`, no need to initialize or repeat multiple times as will not be running the benchmark:
if ( opts.skip ) {
opts.repeats = 1;
return clbk( name, opts, benchmark );
}
// Perform pretests:
pretest( name, opts, benchmark, onPreTest );
/**
* Callback invoked upon completing pretests.
*
* @private
* @param {Error} [error] - error object
* @returns {void}
*/
function onPreTest( error ) {
// If the pretests failed, don't run the benchmark multiple times...
if ( error ) {
opts.repeats = 1;
opts.iterations = 1;
return clbk( name, opts, benchmark );
}
// If a user specified an iteration number, we can begin running benchmarks...
if ( opts.iterations ) {
return clbk( name, opts, benchmark );
}
// Determine iteration number:
iterations( name, opts, benchmark, onIterations );
}
/**
* Callback invoked upon determining an iteration number.
*
* @private
* @param {(Error|null)} error - error object
* @param {PositiveInteger} iter - number of iterations
* @returns {void}
*/
function onIterations( error, iter ) {
// If provided an error, then a benchmark failed, and, similar to pretests, don't run the benchmark multiple times...
if ( error ) {
opts.repeats = 1;
opts.iterations = 1;
return clbk( name, opts, benchmark );
}
opts.iterations = iter;
return clbk( name, opts, benchmark );
}
}
// EXPORTS //
module.exports = init;
},{"./iterations.js":205,"./pretest.js":206}],205:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var copy = require( '@stdlib/utils/copy' );
var Benchmark = require( './../benchmark-class' );
// VARIABLES //
var MIN_TIME = 0.1; // seconds
var ITERATIONS = 10; // 10^1
var MAX_ITERATIONS = 10000000000; // 10^10
// MAIN //
/**
* Determines the number of iterations.
*
* @private
* @param {string} name - benchmark name
* @param {Options} options - benchmark options
* @param {(Function|undefined)} benchmark - function containing benchmark code
* @param {Callback} clbk - callback to invoke after determining number of iterations
* @returns {void}
*/
function iterations( name, options, benchmark, clbk ) {
var opts;
var time;
// Elapsed time (in seconds):
time = 0;
// Create a local copy:
opts = copy( options );
opts.iterations = ITERATIONS;
// Begin running benchmarks:
return next();
/**
* Run a new benchmark.
*
* @private
*/
function next() {
var b = new Benchmark( name, opts, benchmark );
b.on( 'result', onResult );
b.once( 'end', onEnd );
b.run();
}
/**
* Callback invoked upon a `result` event.
*
* @private
* @param {(string|Object)} result - result
*/
function onResult( result ) {
if ( !isString( result ) && result.operator === 'result' ) {
time = result.elapsed;
}
}
/**
* Callback invoked upon an `end` event.
*
* @private
* @returns {void}
*/
function onEnd() {
if (
time < MIN_TIME &&
opts.iterations < MAX_ITERATIONS
) {
opts.iterations *= 10;
return next();
}
clbk( null, opts.iterations );
}
}
// EXPORTS //
module.exports = iterations;
},{"./../benchmark-class":190,"@stdlib/assert/is-string":158,"@stdlib/utils/copy":387}],206:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var copy = require( '@stdlib/utils/copy' );
var Benchmark = require( './../benchmark-class' );
// MAIN //
/**
* Runs pretests to sanity check and/or catch failures.
*
* @private
* @param {string} name - benchmark name
* @param {Options} options - benchmark options
* @param {(Function|undefined)} benchmark - function containing benchmark code
* @param {Callback} clbk - callback to invoke after completing pretests
*/
function pretest( name, options, benchmark, clbk ) {
var fail;
var opts;
var tic;
var toc;
var b;
// Counters to determine the number of `tic` and `toc` events:
tic = 0;
toc = 0;
// Local copy:
opts = copy( options );
opts.iterations = 1;
// Pretest to check for minimum requirements and/or errors...
b = new Benchmark( name, opts, benchmark );
b.on( 'result', onResult );
b.on( 'tic', onTic );
b.on( 'toc', onToc );
b.once( 'end', onEnd );
b.run();
/**
* Callback invoked upon a `result` event.
*
* @private
* @param {(string|Object)} result - result
*/
function onResult( result ) {
if (
!isString( result ) &&
!result.ok &&
!result.todo
) {
fail = true;
}
}
/**
* Callback invoked upon a `tic` event.
*
* @private
*/
function onTic() {
tic += 1;
}
/**
* Callback invoked upon a `toc` event.
*
* @private
*/
function onToc() {
toc += 1;
}
/**
* Callback invoked upon an `end` event.
*
* @private
* @returns {void}
*/
function onEnd() {
var err;
if ( fail ) {
// Possibility that failure is intermittent, but we will assume that the usual case is that the failure would persist across all repeats and no sense failing multiple times when once suffices.
err = new Error( 'benchmark failed' );
} else if ( tic !== 1 || toc !== 1 ) {
// Unable to do anything definitive with timing information (e.g., a tic with no toc or vice versa, or benchmark function calls neither tic nor toc).
err = new Error( 'invalid benchmark' );
}
if ( err ) {
return clbk( err );
}
return clbk();
}
}
// EXPORTS //
module.exports = pretest;
},{"./../benchmark-class":190,"@stdlib/assert/is-string":158,"@stdlib/utils/copy":387}],207:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isObject = require( '@stdlib/assert/is-plain-object' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isNull = require( '@stdlib/assert/is-null' );
var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
// MAIN //
/**
* Validates function options.
*
* @private
* @param {Object} opts - destination object
* @param {Options} options - function options
* @param {boolean} [options.skip] - boolean indicating whether to skip a benchmark
* @param {(PositiveInteger|null)} [options.iterations] - number of iterations
* @param {PositiveInteger} [options.repeats] - number of repeats
* @param {PositiveInteger} [options.timeout] - number of milliseconds before a benchmark automatically fails
* @returns {(Error|null)} error object or null
*
* @example
* var opts = {};
* var options = {
* 'skip': false,
* 'iterations': 1e6,
* 'repeats': 3,
* 'timeout': 10000
* };
*
* var err = validate( opts, options );
* if ( err ) {
* throw err;
* }
*/
function validate( opts, options ) {
if ( !isObject( options ) ) {
return new TypeError( 'invalid argument. Options argument must be an object. Value: `' + options + '`.' );
}
if ( hasOwnProp( options, 'skip' ) ) {
opts.skip = options.skip;
if ( !isBoolean( opts.skip ) ) {
return new TypeError( 'invalid option. `skip` option must be a boolean primitive. Option: `' + opts.skip + '`.' );
}
}
if ( hasOwnProp( options, 'iterations' ) ) {
opts.iterations = options.iterations;
if (
!isPositiveInteger( opts.iterations ) &&
!isNull( opts.iterations )
) {
return new TypeError( 'invalid option. `iterations` option must be either a positive integer or `null`. Option: `' + opts.iterations + '`.' );
}
}
if ( hasOwnProp( options, 'repeats' ) ) {
opts.repeats = options.repeats;
if ( !isPositiveInteger( opts.repeats ) ) {
return new TypeError( 'invalid option. `repeats` option must be a positive integer. Option: `' + opts.repeats + '`.' );
}
}
if ( hasOwnProp( options, 'timeout' ) ) {
opts.timeout = options.timeout;
if ( !isPositiveInteger( opts.timeout ) ) {
return new TypeError( 'invalid option. `timeout` option must be a positive integer. Option: `' + opts.timeout + '`.' );
}
}
return null;
}
// EXPORTS //
module.exports = validate;
},{"@stdlib/assert/has-own-property":53,"@stdlib/assert/is-boolean":81,"@stdlib/assert/is-null":135,"@stdlib/assert/is-plain-object":147,"@stdlib/assert/is-positive-integer":149}],208:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Benchmark harness.
*
* @module @stdlib/bench/harness
*
* @example
* var bench = require( '@stdlib/bench/harness' );
*
* bench( 'beep', function benchmark( b ) {
* var x;
* var i;
* b.tic();
* for ( i = 0; i < b.iterations; i++ ) {
* x = Math.sin( Math.random() );
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* }
* b.toc();
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* b.end();
* });
*/
// MODULES //
var bench = require( './bench.js' );
// EXPORTS //
module.exports = bench;
},{"./bench.js":180}],209:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var TransformStream = require( '@stdlib/streams/node/transform' );
var fromCodePoint = require( '@stdlib/string/from-code-point' );
var log = require( './log.js' );
// MAIN //
/**
* Returns a Transform stream for logging to the console.
*
* @private
* @returns {TransformStream} transform stream
*/
function createStream() {
var stream;
var line;
stream = new TransformStream({
'transform': transform,
'flush': flush
});
line = '';
return stream;
/**
* Callback invoked upon receiving a new chunk.
*
* @private
* @param {(Buffer|string)} chunk - chunk
* @param {string} enc - Buffer encoding
* @param {Callback} clbk - callback to invoke after transforming the streamed chunk
*/
function transform( chunk, enc, clbk ) {
var c;
var i;
for ( i = 0; i < chunk.length; i++ ) {
c = fromCodePoint( chunk[ i ] );
if ( c === '\n' ) {
flush();
} else {
line += c;
}
}
clbk();
}
/**
* Callback to flush data to `stdout`.
*
* @private
* @param {Callback} [clbk] - callback to invoke after processing data
* @returns {void}
*/
function flush( clbk ) {
try {
log( line );
} catch ( err ) {
stream.emit( 'error', err );
}
line = '';
if ( clbk ) {
return clbk();
}
}
}
// EXPORTS //
module.exports = createStream;
},{"./log.js":210,"@stdlib/streams/node/transform":367,"@stdlib/string/from-code-point":371}],210:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Writes a string to the console.
*
* @private
* @param {string} str - string to write
*/
function log( str ) {
console.log( str ); // eslint-disable-line no-console
}
// EXPORTS //
module.exports = log;
},{}],211:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Removes any pending benchmarks.
*
* @private
*/
function clear() {
/* eslint-disable no-invalid-this */
this._benchmarks.length = 0;
}
// EXPORTS //
module.exports = clear;
},{}],212:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Closes a benchmark runner.
*
* @private
* @returns {void}
*/
function closeRunner() {
/* eslint-disable no-invalid-this */
var self = this;
if ( this._closed ) {
return;
}
this._closed = true;
if ( this._benchmarks.length ) {
this.clear();
this._stream.write( '# WARNING: harness closed before completion.\n' );
} else {
this._stream.write( '#\n' );
this._stream.write( '1..'+this.total+'\n' );
this._stream.write( '# total '+this.total+'\n' );
this._stream.write( '# pass '+this.pass+'\n' );
if ( this.fail ) {
this._stream.write( '# fail '+this.fail+'\n' );
}
if ( this.skip ) {
this._stream.write( '# skip '+this.skip+'\n' );
}
if ( this.todo ) {
this._stream.write( '# todo '+this.todo+'\n' );
}
if ( !this.fail ) {
this._stream.write( '#\n# ok\n' );
}
}
this._stream.once( 'close', onClose );
this._stream.destroy();
/**
* Callback invoked upon a `close` event.
*
* @private
*/
function onClose() {
self.emit( 'close' );
}
}
// EXPORTS //
module.exports = closeRunner;
},{}],213:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable no-underscore-dangle */
'use strict';
// MODULES //
var TransformStream = require( '@stdlib/streams/node/transform' );
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var nextTick = require( './../utils/next_tick.js' );
// VARIABLES //
var TAP_HEADER = 'TAP version 13';
// MAIN //
/**
* Creates a results stream.
*
* @private
* @param {Options} [options] - stream options
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @returns {TransformStream} transform stream
*/
function createStream( options ) {
/* eslint-disable no-invalid-this */
var stream;
var opts;
var self;
var id;
self = this;
if ( arguments.length ) {
opts = options;
} else {
opts = {};
}
stream = new TransformStream( opts );
if ( opts.objectMode ) {
id = 0;
this.on( '_push', onPush );
this.on( 'done', onDone );
} else {
stream.write( TAP_HEADER+'\n' );
this._stream.pipe( stream );
}
this.on( '_run', onRun );
return stream;
/**
* Runs the next benchmark.
*
* @private
*/
function next() {
nextTick( onTick );
}
/**
* Callback invoked upon the next tick.
*
* @private
* @returns {void}
*/
function onTick() {
var b = self._benchmarks.shift();
if ( b ) {
b.run();
if ( !b.ended() ) {
return b.once( 'end', next );
}
return next();
}
self._running = false;
self.emit( 'done' );
}
/**
* Callback invoked upon a run event.
*
* @private
* @returns {void}
*/
function onRun() {
if ( !self._running ) {
self._running = true;
return next();
}
}
/**
* Callback invoked upon a push event.
*
* @private
* @param {Benchmark} b - benchmark
*/
function onPush( b ) {
var bid = id;
id += 1;
b.once( 'prerun', onPreRun );
b.on( 'result', onResult );
b.on( 'end', onEnd );
/**
* Callback invoked upon a `prerun` event.
*
* @private
*/
function onPreRun() {
var row = {
'type': 'benchmark',
'name': b.name,
'id': bid
};
stream.write( row );
}
/**
* Callback invoked upon a `result` event.
*
* @private
* @param {(Object|string)} res - result
*/
function onResult( res ) {
if ( isString( res ) ) {
res = {
'benchmark': bid,
'type': 'comment',
'name': res
};
} else if ( res.operator === 'result' ) {
res.benchmark = bid;
res.type = 'result';
} else {
res.benchmark = bid;
res.type = 'assert';
}
stream.write( res );
}
/**
* Callback invoked upon an `end` event.
*
* @private
*/
function onEnd() {
stream.write({
'benchmark': bid,
'type': 'end'
});
}
}
/**
* Callback invoked upon a `done` event.
*
* @private
*/
function onDone() {
stream.destroy();
}
}
// EXPORTS //
module.exports = createStream;
},{"./../utils/next_tick.js":222,"@stdlib/assert/is-string":158,"@stdlib/streams/node/transform":367}],214:[function(require,module,exports){
/* eslint-disable stdlib/jsdoc-require-throws-tags */
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var replace = require( '@stdlib/string/replace' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var reEOL = require( '@stdlib/regexp/eol' );
// VARIABLES //
var RE_WHITESPACE = /\s+/g;
// MAIN //
/**
* Encodes an assertion.
*
* @private
* @param {Object} result - result
* @param {PositiveInteger} count - result count
* @returns {string} encoded assertion
*/
function encodeAssertion( result, count ) {
var actualStack;
var errorStack;
var expected;
var actual;
var indent;
var stack;
var lines;
var out;
var i;
out = '';
if ( !result.ok ) {
out += 'not ';
}
// Add result count:
out += 'ok ' + count;
// Add description:
if ( result.name ) {
out += ' ' + replace( result.name.toString(), RE_WHITESPACE, ' ' );
}
// Append directives:
if ( result.skip ) {
out += ' # SKIP';
} else if ( result.todo ) {
out += ' # TODO';
}
out += '\n';
if ( result.ok ) {
return out;
}
// Format diagnostics as YAML...
indent = ' ';
out += indent + '---\n';
out += indent + 'operator: ' + result.operator + '\n';
if (
hasOwnProp( result, 'actual' ) ||
hasOwnProp( result, 'expected' )
) {
// TODO: inspect object logic (https://github.com/substack/tape/blob/master/lib/results.js#L145)
expected = result.expected;
actual = result.actual;
if ( actual !== actual && expected !== expected ) {
throw new Error( 'TODO: remove me' );
}
}
if ( result.at ) {
out += indent + 'at: ' + result.at + '\n';
}
if ( result.actual ) {
actualStack = result.actual.stack;
}
if ( result.error ) {
errorStack = result.error.stack;
}
if ( actualStack ) {
stack = actualStack;
} else {
stack = errorStack;
}
if ( stack ) {
lines = stack.toString().split( reEOL.REGEXP );
out += indent + 'stack: |-\n';
for ( i = 0; i < lines.length; i++ ) {
out += indent + ' ' + lines[ i ] + '\n';
}
}
out += indent + '...\n';
return out;
}
// EXPORTS //
module.exports = encodeAssertion;
},{"@stdlib/assert/has-own-property":53,"@stdlib/regexp/eol":351,"@stdlib/string/replace":373}],215:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// VARIABLES //
var YAML_INDENT = ' ';
var YAML_BEGIN = YAML_INDENT + '---\n';
var YAML_END = YAML_INDENT + '...\n';
// MAIN //
/**
* Encodes a result as a YAML block.
*
* @private
* @param {Object} result - result
* @returns {string} encoded result
*/
function encodeResult( result ) {
var out = YAML_BEGIN;
out += YAML_INDENT + 'iterations: '+result.iterations+'\n';
out += YAML_INDENT + 'elapsed: '+result.elapsed+'\n';
out += YAML_INDENT + 'rate: '+result.rate+'\n';
out += YAML_END;
return out;
}
// EXPORTS //
module.exports = encodeResult;
},{}],216:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Forcefully exits a benchmark runner.
*
* @private
*/
function exit() {
/* eslint-disable no-invalid-this */
var self;
var i;
for ( i = 0; i < this._benchmarks.length; i++ ) {
this._benchmarks[ i ].exit();
}
self = this;
this.clear();
this._stream.once( 'close', onClose );
this._stream.destroy();
/**
* Callback invoked upon a `close` event.
*
* @private
*/
function onClose() {
self.emit( 'close' );
}
}
// EXPORTS //
module.exports = exit;
},{}],217:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var EventEmitter = require( 'events' ).EventEmitter;
var inherit = require( '@stdlib/utils/inherit' );
var defineProperty = require( '@stdlib/utils/define-property' );
var TransformStream = require( '@stdlib/streams/node/transform' );
var push = require( './push.js' );
var createStream = require( './create_stream.js' );
var run = require( './run.js' );
var clear = require( './clear.js' );
var close = require( './close.js' ); // eslint-disable-line stdlib/no-redeclare
var exit = require( './exit.js' );
// MAIN //
/**
* Benchmark runner.
*
* @private
* @constructor
* @returns {Runner} Runner instance
*
* @example
* var runner = new Runner();
*/
function Runner() {
if ( !( this instanceof Runner ) ) {
return new Runner();
}
EventEmitter.call( this );
// Private properties:
defineProperty( this, '_benchmarks', {
'value': [],
'configurable': false,
'writable': false,
'enumerable': false
});
defineProperty( this, '_stream', {
'value': new TransformStream(),
'configurable': false,
'writable': false,
'enumerable': false
});
defineProperty( this, '_closed', {
'value': false,
'configurable': false,
'writable': true,
'enumerable': false
});
defineProperty( this, '_running', {
'value': false,
'configurable': false,
'writable': true,
'enumerable': false
});
// Public properties:
defineProperty( this, 'total', {
'value': 0,
'configurable': false,
'writable': true,
'enumerable': true
});
defineProperty( this, 'fail', {
'value': 0,
'configurable': false,
'writable': true,
'enumerable': true
});
defineProperty( this, 'pass', {
'value': 0,
'configurable': false,
'writable': true,
'enumerable': true
});
defineProperty( this, 'skip', {
'value': 0,
'configurable': false,
'writable': true,
'enumerable': true
});
defineProperty( this, 'todo', {
'value': 0,
'configurable': false,
'writable': true,
'enumerable': true
});
return this;
}
/*
* Inherit from the `EventEmitter` prototype.
*/
inherit( Runner, EventEmitter );
/**
* Adds a new benchmark.
*
* @private
* @memberof Runner.prototype
* @function push
* @param {Benchmark} b - benchmark
*/
defineProperty( Runner.prototype, 'push', {
'value': push,
'configurable': false,
'writable': false,
'enumerable': false
});
/**
* Creates a results stream.
*
* @private
* @memberof Runner.prototype
* @function createStream
* @param {Options} [options] - stream options
* @returns {TransformStream} transform stream
*/
defineProperty( Runner.prototype, 'createStream', {
'value': createStream,
'configurable': false,
'writable': false,
'enumerable': false
});
/**
* Runs pending benchmarks.
*
* @private
* @memberof Runner.prototype
* @function run
*/
defineProperty( Runner.prototype, 'run', {
'value': run,
'configurable': false,
'writable': false,
'enumerable': false
});
/**
* Removes any pending benchmarks.
*
* @private
* @memberof Runner.prototype
* @function clear
*/
defineProperty( Runner.prototype, 'clear', {
'value': clear,
'configurable': false,
'writable': false,
'enumerable': false
});
/**
* Closes a benchmark runner.
*
* @private
* @memberof Runner.prototype
* @function close
*/
defineProperty( Runner.prototype, 'close', {
'value': close,
'configurable': false,
'writable': false,
'enumerable': false
});
/**
* Forcefully exits a benchmark runner.
*
* @private
* @memberof Runner.prototype
* @function exit
*/
defineProperty( Runner.prototype, 'exit', {
'value': exit,
'configurable': false,
'writable': false,
'enumerable': false
});
// EXPORTS //
module.exports = Runner;
},{"./clear.js":211,"./close.js":212,"./create_stream.js":213,"./exit.js":216,"./push.js":218,"./run.js":219,"@stdlib/streams/node/transform":367,"@stdlib/utils/define-property":398,"@stdlib/utils/inherit":419,"events":472}],218:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable no-underscore-dangle */
'use strict';
// MODULES //
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var encodeAssertion = require( './encode_assertion.js' );
var encodeResult = require( './encode_result.js' );
// MAIN //
/**
* Adds a new benchmark.
*
* @private
* @param {Benchmark} b - benchmark
*/
function push( b ) {
/* eslint-disable no-invalid-this */
var self = this;
this._benchmarks.push( b );
b.once( 'prerun', onPreRun );
b.on( 'result', onResult );
this.emit( '_push', b );
/**
* Callback invoked upon a `prerun` event.
*
* @private
*/
function onPreRun() {
self._stream.write( '# '+b.name+'\n' );
}
/**
* Callback invoked upon a `result` event.
*
* @private
* @param {(Object|string)} res - result
* @returns {void}
*/
function onResult( res ) {
// Check for a comment...
if ( isString( res ) ) {
return self._stream.write( '# '+res+'\n' );
}
if ( res.operator === 'result' ) {
res = encodeResult( res );
return self._stream.write( res );
}
self.total += 1;
if ( res.ok ) {
if ( res.skip ) {
self.skip += 1;
} else if ( res.todo ) {
self.todo += 1;
}
self.pass += 1;
}
// According to the TAP spec, todos pass even if not "ok"...
else if ( res.todo ) {
self.pass += 1;
self.todo += 1;
}
// Everything else is a failure...
else {
self.fail += 1;
}
res = encodeAssertion( res, self.total );
self._stream.write( res );
}
}
// EXPORTS //
module.exports = push;
},{"./encode_assertion.js":214,"./encode_result.js":215,"@stdlib/assert/is-string":158}],219:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Runs pending benchmarks.
*
* @private
*/
function run() {
/* eslint-disable no-invalid-this */
this.emit( '_run' );
}
// EXPORTS //
module.exports = run;
},{}],220:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var IS_BROWSER = require( '@stdlib/assert/is-browser' );
var canExit = require( './can_exit.js' );
// MAIN //
var bool = ( !IS_BROWSER && canExit );
// EXPORTS //
module.exports = bool;
},{"./can_exit.js":221,"@stdlib/assert/is-browser":87}],221:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var proc = require( './process.js' );
// MAIN //
var bool = ( proc && typeof proc.exit === 'function' );
// EXPORTS //
module.exports = bool;
},{"./process.js":223}],222:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Runs a function on a subsequent turn of the event loop.
*
* ## Notes
*
* - `process.nextTick` is only Node.js.
* - `setImmediate` is non-standard.
* - Everything else is browser based (e.g., mutation observer, requestAnimationFrame, etc).
* - Only API which is universal is `setTimeout`.
* - Note that `0` is not actually `0ms`. Browser environments commonly have a minimum delay of `4ms`. This is acceptable. Here, the main intent of this function is to give the runtime a chance to run garbage collection, clear state, and tend to any other pending tasks before returning control to benchmark tasks. The larger aim (attainable or not) is to provide each benchmark run with as much of a fresh state as possible.
*
*
* @private
* @param {Function} fcn - function to run upon a subsequent turn of the event loop
*/
function nextTick( fcn ) {
setTimeout( fcn, 0 );
}
// EXPORTS //
module.exports = nextTick;
},{}],223:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var proc = require( 'process' );
// EXPORTS //
module.exports = proc;
},{"process":483}],224:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Benchmark harness.
*
* @module @stdlib/bench
*
* @example
* var bench = require( '@stdlib/bench' );
*
* bench( 'beep', function benchmark( b ) {
* var x;
* var i;
* b.tic();
* for ( i = 0; i < b.iterations; i++ ) {
* x = Math.sin( Math.random() );
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* }
* b.toc();
* if ( x !== x ) {
* b.ok( false, 'should not return NaN' );
* }
* b.end();
* });
*/
// MODULES //
var bench = require( '@stdlib/bench/harness' );
// EXPORTS //
module.exports = bench;
},{"@stdlib/bench/harness":208}],225:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* BLAS level 1 routine to copy values from `x` into `y`.
*
* @module @stdlib/blas/base/gcopy
*
* @example
* var gcopy = require( '@stdlib/blas/base/gcopy' );
*
* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];
* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];
*
* gcopy( x.length, x, 1, y, 1 );
* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]
*
* @example
* var gcopy = require( '@stdlib/blas/base/gcopy' );
*
* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];
* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];
*
* gcopy.ndarray( x.length, x, 1, 0, y, 1, 0 );
* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var gcopy = require( './main.js' );
var ndarray = require( './ndarray.js' );
// MAIN //
setReadOnly( gcopy, 'ndarray', ndarray );
// EXPORTS //
module.exports = gcopy;
},{"./main.js":226,"./ndarray.js":227,"@stdlib/utils/define-nonenumerable-read-only-property":391}],226:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// VARIABLES //
var M = 8;
// MAIN //
/**
* Copies values from `x` into `y`.
*
* @param {PositiveInteger} N - number of values to copy
* @param {NumericArray} x - input array
* @param {integer} strideX - `x` stride length
* @param {NumericArray} y - destination array
* @param {integer} strideY - `y` stride length
* @returns {NumericArray} `y`
*
* @example
* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];
* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];
*
* gcopy( x.length, x, 1, y, 1 );
* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]
*/
function gcopy( N, x, strideX, y, strideY ) {
var ix;
var iy;
var m;
var i;
if ( N <= 0 ) {
return y;
}
// Use unrolled loops if both strides are equal to `1`...
if ( strideX === 1 && strideY === 1 ) {
m = N % M;
// If we have a remainder, run a clean-up loop...
if ( m > 0 ) {
for ( i = 0; i < m; i++ ) {
y[ i ] = x[ i ];
}
}
if ( N < M ) {
return y;
}
for ( i = m; i < N; i += M ) {
y[ i ] = x[ i ];
y[ i+1 ] = x[ i+1 ];
y[ i+2 ] = x[ i+2 ];
y[ i+3 ] = x[ i+3 ];
y[ i+4 ] = x[ i+4 ];
y[ i+5 ] = x[ i+5 ];
y[ i+6 ] = x[ i+6 ];
y[ i+7 ] = x[ i+7 ];
}
return y;
}
if ( strideX < 0 ) {
ix = (1-N) * strideX;
} else {
ix = 0;
}
if ( strideY < 0 ) {
iy = (1-N) * strideY;
} else {
iy = 0;
}
for ( i = 0; i < N; i++ ) {
y[ iy ] = x[ ix ];
ix += strideX;
iy += strideY;
}
return y;
}
// EXPORTS //
module.exports = gcopy;
},{}],227:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// VARIABLES //
var M = 8;
// MAIN //
/**
* Copies values from `x` into `y`.
*
* @param {PositiveInteger} N - number of values to copy
* @param {NumericArray} x - input array
* @param {integer} strideX - `x` stride length
* @param {NonNegativeInteger} offsetX - starting `x` index
* @param {NumericArray} y - destination array
* @param {integer} strideY - `y` stride length
* @param {NonNegativeInteger} offsetY - starting `y` index
* @returns {NumericArray} `y`
*
* @example
* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];
* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];
*
* gcopy( x.length, x, 1, 0, y, 1, 0 );
* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]
*/
function gcopy( N, x, strideX, offsetX, y, strideY, offsetY ) {
var ix;
var iy;
var m;
var i;
if ( N <= 0 ) {
return y;
}
ix = offsetX;
iy = offsetY;
// Use unrolled loops if both strides are equal to `1`...
if ( strideX === 1 && strideY === 1 ) {
m = N % M;
// If we have a remainder, run a clean-up loop...
if ( m > 0 ) {
for ( i = 0; i < m; i++ ) {
y[ iy ] = x[ ix ];
ix += strideX;
iy += strideY;
}
}
if ( N < M ) {
return y;
}
for ( i = m; i < N; i += M ) {
y[ iy ] = x[ ix ];
y[ iy+1 ] = x[ ix+1 ];
y[ iy+2 ] = x[ ix+2 ];
y[ iy+3 ] = x[ ix+3 ];
y[ iy+4 ] = x[ ix+4 ];
y[ iy+5 ] = x[ ix+5 ];
y[ iy+6 ] = x[ ix+6 ];
y[ iy+7 ] = x[ ix+7 ];
ix += M;
iy += M;
}
return y;
}
for ( i = 0; i < N; i++ ) {
y[ iy ] = x[ ix ];
ix += strideX;
iy += strideY;
}
return y;
}
// EXPORTS //
module.exports = gcopy;
},{}],228:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var ctor = require( 'buffer' ).Buffer; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = ctor;
},{"buffer":473}],229:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Buffer constructor.
*
* @module @stdlib/buffer/ctor
*
* @example
* var ctor = require( '@stdlib/buffer/ctor' );
*
* var b = new ctor( [ 1, 2, 3, 4 ] );
* // returns <Buffer>
*/
// MODULES //
var hasNodeBufferSupport = require( '@stdlib/assert/has-node-buffer-support' );
var main = require( './buffer.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var ctor;
if ( hasNodeBufferSupport() ) {
ctor = main;
} else {
ctor = polyfill;
}
// EXPORTS //
module.exports = ctor;
},{"./buffer.js":228,"./polyfill.js":230,"@stdlib/assert/has-node-buffer-support":51}],230:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// TODO: write (browser) polyfill
// MAIN //
/**
* Buffer constructor.
*
* @throws {Error} not implemented
*/
function polyfill() {
throw new Error( 'not implemented' );
}
// EXPORTS //
module.exports = polyfill;
},{}],231:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isFunction = require( '@stdlib/assert/is-function' );
var Buffer = require( '@stdlib/buffer/ctor' );
// MAIN //
var bool = isFunction( Buffer.from );
// EXPORTS //
module.exports = bool;
},{"@stdlib/assert/is-function":102,"@stdlib/buffer/ctor":229}],232:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Copy buffer data to a new `Buffer` instance.
*
* @module @stdlib/buffer/from-buffer
*
* @example
* var fromArray = require( '@stdlib/buffer/from-array' );
* var copyBuffer = require( '@stdlib/buffer/from-buffer' );
*
* var b1 = fromArray( [ 1, 2, 3, 4 ] );
* // returns <Buffer>
*
* var b2 = copyBuffer( b1 );
* // returns <Buffer>
*/
// MODULES //
var hasFrom = require( './has_from.js' );
var main = require( './main.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var copyBuffer;
if ( hasFrom ) {
copyBuffer = main;
} else {
copyBuffer = polyfill;
}
// EXPORTS //
module.exports = copyBuffer;
},{"./has_from.js":231,"./main.js":233,"./polyfill.js":234}],233:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isBuffer = require( '@stdlib/assert/is-buffer' );
var Buffer = require( '@stdlib/buffer/ctor' );
// MAIN //
/**
* Copies buffer data to a new `Buffer` instance.
*
* @param {Buffer} buffer - buffer from which to copy
* @throws {TypeError} must provide a `Buffer` instance
* @returns {Buffer} new `Buffer` instance
*
* @example
* var fromArray = require( '@stdlib/buffer/from-array' );
*
* var b1 = fromArray( [ 1, 2, 3, 4 ] );
* // returns <Buffer>
*
* var b2 = fromBuffer( b1 );
* // returns <Buffer>
*/
function fromBuffer( buffer ) {
if ( !isBuffer( buffer ) ) {
throw new TypeError( 'invalid argument. Must provide a Buffer. Value: `' + buffer + '`' );
}
return Buffer.from( buffer );
}
// EXPORTS //
module.exports = fromBuffer;
},{"@stdlib/assert/is-buffer":88,"@stdlib/buffer/ctor":229}],234:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isBuffer = require( '@stdlib/assert/is-buffer' );
var Buffer = require( '@stdlib/buffer/ctor' );
// MAIN //
/**
* Copies buffer data to a new `Buffer` instance.
*
* @param {Buffer} buffer - buffer from which to copy
* @throws {TypeError} must provide a `Buffer` instance
* @returns {Buffer} new `Buffer` instance
*
* @example
* var fromArray = require( '@stdlib/buffer/from-array' );
*
* var b1 = fromArray( [ 1, 2, 3, 4 ] );
* // returns <Buffer>
*
* var b2 = fromBuffer( b1 );
* // returns <Buffer>
*/
function fromBuffer( buffer ) {
if ( !isBuffer( buffer ) ) {
throw new TypeError( 'invalid argument. Must provide a Buffer. Value: `' + buffer + '`' );
}
return new Buffer( buffer ); // eslint-disable-line no-buffer-constructor
}
// EXPORTS //
module.exports = fromBuffer;
},{"@stdlib/assert/is-buffer":88,"@stdlib/buffer/ctor":229}],235:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Maximum length of a generic array.
*
* @module @stdlib/constants/array/max-array-length
*
* @example
* var MAX_ARRAY_LENGTH = require( '@stdlib/constants/array/max-array-length' );
* // returns 4294967295
*/
// MAIN //
/**
* Maximum length of a generic array.
*
* ```tex
* 2^{32} - 1
* ```
*
* @constant
* @type {uinteger32}
* @default 4294967295
*/
var MAX_ARRAY_LENGTH = 4294967295>>>0; // asm type annotation
// EXPORTS //
module.exports = MAX_ARRAY_LENGTH;
},{}],236:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Maximum length of a typed array.
*
* @module @stdlib/constants/array/max-typed-array-length
*
* @example
* var MAX_TYPED_ARRAY_LENGTH = require( '@stdlib/constants/array/max-typed-array-length' );
* // returns 9007199254740991
*/
// MAIN //
/**
* Maximum length of a typed array.
*
* ```tex
* 2^{53} - 1
* ```
*
* @constant
* @type {number}
* @default 9007199254740991
*/
var MAX_TYPED_ARRAY_LENGTH = 9007199254740991;
// EXPORTS //
module.exports = MAX_TYPED_ARRAY_LENGTH;
},{}],237:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* The bias of a double-precision floating-point number's exponent.
*
* @module @stdlib/constants/float64/exponent-bias
* @type {integer32}
*
* @example
* var FLOAT64_EXPONENT_BIAS = require( '@stdlib/constants/float64/exponent-bias' );
* // returns 1023
*/
// MAIN //
/**
* Bias of a double-precision floating-point number's exponent.
*
* ## Notes
*
* The bias can be computed via
*
* ```tex
* \mathrm{bias} = 2^{k-1} - 1
* ```
*
* where \\(k\\) is the number of bits in the exponent; here, \\(k = 11\\).
*
* @constant
* @type {integer32}
* @default 1023
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
*/
var FLOAT64_EXPONENT_BIAS = 1023|0; // asm type annotation
// EXPORTS //
module.exports = FLOAT64_EXPONENT_BIAS;
},{}],238:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* High word mask for the exponent of a double-precision floating-point number.
*
* @module @stdlib/constants/float64/high-word-exponent-mask
* @type {uinteger32}
*
* @example
* var FLOAT64_HIGH_WORD_EXPONENT_MASK = require( '@stdlib/constants/float64/high-word-exponent-mask' );
* // returns 2146435072
*/
// MAIN //
/**
* High word mask for the exponent of a double-precision floating-point number.
*
* ## Notes
*
* The high word mask for the exponent of a double-precision floating-point number is an unsigned 32-bit integer with the value \\( 2146435072 \\), which corresponds to the bit sequence
*
* ```binarystring
* 0 11111111111 00000000000000000000
* ```
*
* @constant
* @type {uinteger32}
* @default 0x7ff00000
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
*/
var FLOAT64_HIGH_WORD_EXPONENT_MASK = 0x7ff00000;
// EXPORTS //
module.exports = FLOAT64_HIGH_WORD_EXPONENT_MASK;
},{}],239:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* High word mask for the significand of a double-precision floating-point number.
*
* @module @stdlib/constants/float64/high-word-significand-mask
* @type {uinteger32}
*
* @example
* var FLOAT64_HIGH_WORD_SIGNIFICAND_MASK = require( '@stdlib/constants/float64/high-word-significand-mask' );
* // returns 1048575
*/
// MAIN //
/**
* High word mask for the significand of a double-precision floating-point number.
*
* ## Notes
*
* The high word mask for the significand of a double-precision floating-point number is an unsigned 32-bit integer with the value \\( 1048575 \\), which corresponds to the bit sequence
*
* ```binarystring
* 0 00000000000 11111111111111111111
* ```
*
* @constant
* @type {uinteger32}
* @default 0x000fffff
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
*/
var FLOAT64_HIGH_WORD_SIGNIFICAND_MASK = 0x000fffff;
// EXPORTS //
module.exports = FLOAT64_HIGH_WORD_SIGNIFICAND_MASK;
},{}],240:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Natural logarithm of `2`.
*
* @module @stdlib/constants/float64/ln-two
* @type {number}
*
* @example
* var LN2 = require( '@stdlib/constants/float64/ln-two' );
* // returns 0.6931471805599453
*/
// MAIN //
/**
* Natural logarithm of `2`.
*
* ```tex
* \ln 2
* ```
*
* @constant
* @type {number}
* @default 0.6931471805599453
*/
var LN2 = 6.93147180559945309417232121458176568075500134360255254120680009493393621969694715605863326996418687542001481021e-01; // eslint-disable-line max-len
// EXPORTS //
module.exports = LN2;
},{}],241:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* The maximum base 10 exponent for a double-precision floating-point number.
*
* @module @stdlib/constants/float64/max-base10-exponent
* @type {integer32}
*
* @example
* var FLOAT64_MAX_BASE10_EXPONENT = require( '@stdlib/constants/float64/max-base10-exponent' );
* // returns 308
*/
// MAIN //
/**
* The maximum base 10 exponent for a double-precision floating-point number.
*
* @constant
* @type {integer32}
* @default 308
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
*/
var FLOAT64_MAX_BASE10_EXPONENT = 308|0; // asm type annotation
// EXPORTS //
module.exports = FLOAT64_MAX_BASE10_EXPONENT;
},{}],242:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* The maximum biased base 2 exponent for a subnormal double-precision floating-point number.
*
* @module @stdlib/constants/float64/max-base2-exponent-subnormal
* @type {integer32}
*
* @example
* var FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float64/max-base2-exponent-subnormal' );
* // returns -1023
*/
// MAIN //
/**
* The maximum biased base 2 exponent for a subnormal double-precision floating-point number.
*
* ```text
* 00000000000 => 0 - BIAS = -1023
* ```
*
* where `BIAS = 1023`.
*
* @constant
* @type {integer32}
* @default -1023
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
*/
var FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL = -1023|0; // asm type annotation
// EXPORTS //
module.exports = FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL;
},{}],243:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* The maximum biased base 2 exponent for a double-precision floating-point number.
*
* @module @stdlib/constants/float64/max-base2-exponent
* @type {integer32}
*
* @example
* var FLOAT64_MAX_BASE2_EXPONENT = require( '@stdlib/constants/float64/max-base2-exponent' );
* // returns 1023
*/
// MAIN //
/**
* The maximum biased base 2 exponent for a double-precision floating-point number.
*
* ```text
* 11111111110 => 2046 - BIAS = 1023
* ```
*
* where `BIAS = 1023`.
*
* @constant
* @type {integer32}
* @default 1023
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
*/
var FLOAT64_MAX_BASE2_EXPONENT = 1023|0; // asm type annotation
// EXPORTS //
module.exports = FLOAT64_MAX_BASE2_EXPONENT;
},{}],244:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Maximum safe double-precision floating-point integer.
*
* @module @stdlib/constants/float64/max-safe-integer
* @type {number}
*
* @example
* var FLOAT64_MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );
* // returns 9007199254740991
*/
// MAIN //
/**
* Maximum safe double-precision floating-point integer.
*
* ## Notes
*
* The integer has the value
*
* ```tex
* 2^{53} - 1
* ```
*
* @constant
* @type {number}
* @default 9007199254740991
* @see [Safe Integers]{@link http://www.2ality.com/2013/10/safe-integers.html}
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
*/
var FLOAT64_MAX_SAFE_INTEGER = 9007199254740991;
// EXPORTS //
module.exports = FLOAT64_MAX_SAFE_INTEGER;
},{}],245:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* The minimum base 10 exponent for a subnormal double-precision floating-point number.
*
* @module @stdlib/constants/float64/min-base10-exponent-subnormal
* @type {integer32}
*
* @example
* var FLOAT64_MIN_BASE10_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float64/min-base10-exponent-subnormal' );
* // returns -324
*/
// MAIN //
/**
* The minimum base 10 exponent for a subnormal double-precision floating-point number.
*
* @constant
* @type {integer32}
* @default -324
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
*/
var FLOAT64_MIN_BASE10_EXPONENT_SUBNORMAL = -324|0; // asm type annotation
// EXPORTS //
module.exports = FLOAT64_MIN_BASE10_EXPONENT_SUBNORMAL;
},{}],246:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* The minimum base 10 exponent for a normal double-precision floating-point number.
*
* @module @stdlib/constants/float64/min-base10-exponent
* @type {integer32}
*
* @example
* var FLOAT64_MIN_BASE10_EXPONENT = require( '@stdlib/constants/float64/min-base10-exponent' );
* // returns -308
*/
// MAIN //
/**
* The minimum base 10 exponent for a normal double-precision floating-point number.
*
* ```text
* 2^-1022 = 2.2250738585072014e-308 => -308
* ```
*
* @constant
* @type {integer32}
* @default -308
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
*/
var FLOAT64_MIN_BASE10_EXPONENT = -308|0; // asm type annotation
// EXPORTS //
module.exports = FLOAT64_MIN_BASE10_EXPONENT;
},{}],247:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* The minimum biased base 2 exponent for a subnormal double-precision floating-point number.
*
* @module @stdlib/constants/float64/min-base2-exponent-subnormal
* @type {integer32}
*
* @example
* var FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float64/min-base2-exponent-subnormal' );
* // returns -1074
*/
// MAIN //
/**
* The minimum biased base 2 exponent for a subnormal double-precision floating-point number.
*
* ```text
* -(BIAS+(52-1)) = -(1023+51) = -1074
* ```
*
* where `BIAS = 1023` and `52` is the number of digits in the significand.
*
* @constant
* @type {integer32}
* @default -1074
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
*/
var FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL = -1074|0; // asm type annotation
// EXPORTS //
module.exports = FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL;
},{}],248:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Double-precision floating-point negative infinity.
*
* @module @stdlib/constants/float64/ninf
* @type {number}
*
* @example
* var FLOAT64_NINF = require( '@stdlib/constants/float64/ninf' );
* // returns -Infinity
*/
// MODULES //
var Number = require( '@stdlib/number/ctor' );
// MAIN //
/**
* Double-precision floating-point negative infinity.
*
* ## Notes
*
* Double-precision floating-point negative infinity has the bit sequence
*
* ```binarystring
* 1 11111111111 00000000000000000000 00000000000000000000000000000000
* ```
*
* @constant
* @type {number}
* @default Number.NEGATIVE_INFINITY
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
*/
var FLOAT64_NINF = Number.NEGATIVE_INFINITY;
// EXPORTS //
module.exports = FLOAT64_NINF;
},{"@stdlib/number/ctor":308}],249:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Double-precision floating-point positive infinity.
*
* @module @stdlib/constants/float64/pinf
* @type {number}
*
* @example
* var FLOAT64_PINF = require( '@stdlib/constants/float64/pinf' );
* // returns Infinity
*/
// MAIN //
/**
* Double-precision floating-point positive infinity.
*
* ## Notes
*
* Double-precision floating-point positive infinity has the bit sequence
*
* ```binarystring
* 0 11111111111 00000000000000000000 00000000000000000000000000000000
* ```
*
* @constant
* @type {number}
* @default Number.POSITIVE_INFINITY
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
*/
var FLOAT64_PINF = Number.POSITIVE_INFINITY; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = FLOAT64_PINF;
},{}],250:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Smallest positive double-precision floating-point normal number.
*
* @module @stdlib/constants/float64/smallest-normal
* @type {number}
*
* @example
* var FLOAT64_SMALLEST_NORMAL = require( '@stdlib/constants/float64/smallest-normal' );
* // returns 2.2250738585072014e-308
*/
// MAIN //
/**
* The smallest positive double-precision floating-point normal number.
*
* ## Notes
*
* The number has the value
*
* ```tex
* \frac{1}{2^{1023-1}}
* ```
*
* which corresponds to the bit sequence
*
* ```binarystring
* 0 00000000001 00000000000000000000 00000000000000000000000000000000
* ```
*
* @constant
* @type {number}
* @default 2.2250738585072014e-308
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
*/
var FLOAT64_SMALLEST_NORMAL = 2.2250738585072014e-308;
// EXPORTS //
module.exports = FLOAT64_SMALLEST_NORMAL;
},{}],251:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Maximum signed 16-bit integer.
*
* @module @stdlib/constants/int16/max
* @type {integer32}
*
* @example
* var INT16_MAX = require( '@stdlib/constants/int16/max' );
* // returns 32767
*/
// MAIN //
/**
* Maximum signed 16-bit integer.
*
* ## Notes
*
* The number has the value
*
* ```tex
* 2^{15} - 1
* ```
*
* which corresponds to the bit sequence
*
* ```binarystring
* 0111111111111111
* ```
*
* @constant
* @type {integer32}
* @default 32767
*/
var INT16_MAX = 32767|0; // asm type annotation
// EXPORTS //
module.exports = INT16_MAX;
},{}],252:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Minimum signed 16-bit integer.
*
* @module @stdlib/constants/int16/min
* @type {integer32}
*
* @example
* var INT16_MIN = require( '@stdlib/constants/int16/min' );
* // returns -32768
*/
// MAIN //
/**
* Minimum signed 16-bit integer.
*
* ## Notes
*
* The number has the value
*
* ```tex
* -(2^{15})
* ```
*
* which corresponds to the two's complement bit sequence
*
* ```binarystring
* 1000000000000000
* ```
*
* @constant
* @type {integer32}
* @default -32768
*/
var INT16_MIN = -32768|0; // asm type annotation
// EXPORTS //
module.exports = INT16_MIN;
},{}],253:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Maximum signed 32-bit integer.
*
* @module @stdlib/constants/int32/max
* @type {integer32}
*
* @example
* var INT32_MAX = require( '@stdlib/constants/int32/max' );
* // returns 2147483647
*/
// MAIN //
/**
* Maximum signed 32-bit integer.
*
* ## Notes
*
* The number has the value
*
* ```tex
* 2^{31} - 1
* ```
*
* which corresponds to the bit sequence
*
* ```binarystring
* 01111111111111111111111111111111
* ```
*
* @constant
* @type {integer32}
* @default 2147483647
*/
var INT32_MAX = 2147483647|0; // asm type annotation
// EXPORTS //
module.exports = INT32_MAX;
},{}],254:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Minimum signed 32-bit integer.
*
* @module @stdlib/constants/int32/min
* @type {integer32}
*
* @example
* var INT32_MIN = require( '@stdlib/constants/int32/min' );
* // returns -2147483648
*/
// MAIN //
/**
* Minimum signed 32-bit integer.
*
* ## Notes
*
* The number has the value
*
* ```tex
* -(2^{31})
* ```
*
* which corresponds to the two's complement bit sequence
*
* ```binarystring
* 10000000000000000000000000000000
* ```
*
* @constant
* @type {integer32}
* @default -2147483648
*/
var INT32_MIN = -2147483648|0; // asm type annotation
// EXPORTS //
module.exports = INT32_MIN;
},{}],255:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Maximum signed 8-bit integer.
*
* @module @stdlib/constants/int8/max
* @type {integer32}
*
* @example
* var INT8_MAX = require( '@stdlib/constants/int8/max' );
* // returns 127
*/
// MAIN //
/**
* Maximum signed 8-bit integer.
*
* ## Notes
*
* The number is given by
*
* ```tex
* 2^{7} - 1
* ```
*
* which corresponds to the bit sequence
*
* ```binarystring
* 01111111
* ```
*
* @constant
* @type {integer32}
* @default 127
*/
var INT8_MAX = 127|0; // asm type annotation
// EXPORTS //
module.exports = INT8_MAX;
},{}],256:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Minimum signed 8-bit integer.
*
* @module @stdlib/constants/int8/min
* @type {integer32}
*
* @example
* var INT8_MIN = require( '@stdlib/constants/int8/min' );
* // returns -128
*/
// MAIN //
/**
* Minimum signed 8-bit integer.
*
* ## Notes
*
* The number is given by
*
* ```tex
* -(2^{7})
* ```
*
* which corresponds to the two's complement bit sequence
*
* ```binarystring
* 10000000
* ```
*
* @constant
* @type {integer32}
* @default -128
*/
var INT8_MIN = -128|0; // asm type annotation
// EXPORTS //
module.exports = INT8_MIN;
},{}],257:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Maximum unsigned 16-bit integer.
*
* @module @stdlib/constants/uint16/max
* @type {integer32}
*
* @example
* var UINT16_MAX = require( '@stdlib/constants/uint16/max' );
* // returns 65535
*/
// MAIN //
/**
* Maximum unsigned 16-bit integer.
*
* ## Notes
*
* The number has the value
*
* ```tex
* 2^{16} - 1
* ```
*
* which corresponds to the bit sequence
*
* ```binarystring
* 1111111111111111
* ```
*
* @constant
* @type {integer32}
* @default 65535
*/
var UINT16_MAX = 65535|0; // asm type annotation
// EXPORTS //
module.exports = UINT16_MAX;
},{}],258:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Maximum unsigned 32-bit integer.
*
* @module @stdlib/constants/uint32/max
* @type {uinteger32}
*
* @example
* var UINT32_MAX = require( '@stdlib/constants/uint32/max' );
* // returns 4294967295
*/
// MAIN //
/**
* Maximum unsigned 32-bit integer.
*
* ## Notes
*
* The number has the value
*
* ```tex
* 2^{32} - 1
* ```
*
* which corresponds to the bit sequence
*
* ```binarystring
* 11111111111111111111111111111111
* ```
*
* @constant
* @type {uinteger32}
* @default 4294967295
*/
var UINT32_MAX = 4294967295;
// EXPORTS //
module.exports = UINT32_MAX;
},{}],259:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Maximum unsigned 8-bit integer.
*
* @module @stdlib/constants/uint8/max
* @type {integer32}
*
* @example
* var UINT8_MAX = require( '@stdlib/constants/uint8/max' );
* // returns 255
*/
// MAIN //
/**
* Maximum unsigned 8-bit integer.
*
* ## Notes
*
* The number has the value
*
* ```tex
* 2^{8} - 1
* ```
*
* which corresponds to the bit sequence
*
* ```binarystring
* 11111111
* ```
*
* @constant
* @type {integer32}
* @default 255
*/
var UINT8_MAX = 255|0; // asm type annotation
// EXPORTS //
module.exports = UINT8_MAX;
},{}],260:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Maximum Unicode code point in the Basic Multilingual Plane (BMP).
*
* @module @stdlib/constants/unicode/max-bmp
* @type {integer32}
*
* @example
* var UNICODE_MAX_BMP = require( '@stdlib/constants/unicode/max-bmp' );
* // returns 65535
*/
// MAIN //
/**
* Maximum Unicode code point in the Basic Multilingual Plane (BMP).
*
* @constant
* @type {integer32}
* @default 65535
* @see [Unicode]{@link https://en.wikipedia.org/wiki/Unicode}
*/
var UNICODE_MAX_BMP = 0xFFFF|0; // asm type annotation
// EXPORTS //
module.exports = UNICODE_MAX_BMP;
},{}],261:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Maximum Unicode code point.
*
* @module @stdlib/constants/unicode/max
* @type {integer32}
*
* @example
* var UNICODE_MAX = require( '@stdlib/constants/unicode/max' );
* // returns 1114111
*/
// MAIN //
/**
* Maximum Unicode code point.
*
* @constant
* @type {integer32}
* @default 1114111
* @see [Unicode]{@link https://en.wikipedia.org/wiki/Unicode}
*/
var UNICODE_MAX = 0x10FFFF|0; // asm type annotation
// EXPORTS //
module.exports = UNICODE_MAX;
},{}],262:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a finite numeric value is an even number.
*
* @module @stdlib/math/base/assert/is-even
*
* @example
* var isEven = require( '@stdlib/math/base/assert/is-even' );
*
* var bool = isEven( 5.0 );
* // returns false
*
* bool = isEven( -2.0 );
* // returns true
*
* bool = isEven( 0.0 );
* // returns true
*
* bool = isEven( NaN );
* // returns false
*/
// MODULES //
var isEven = require( './is_even.js' );
// EXPORTS //
module.exports = isEven;
},{"./is_even.js":263}],263:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isInteger = require( '@stdlib/math/base/assert/is-integer' );
// MAIN //
/**
* Tests if a finite numeric value is an even number.
*
* @param {number} x - value to test
* @returns {boolean} boolean indicating whether the value is an even number
*
* @example
* var bool = isEven( 5.0 );
* // returns false
*
* @example
* var bool = isEven( -2.0 );
* // returns true
*
* @example
* var bool = isEven( 0.0 );
* // returns true
*
* @example
* var bool = isEven( NaN );
* // returns false
*/
function isEven( x ) {
return isInteger( x/2.0 );
}
// EXPORTS //
module.exports = isEven;
},{"@stdlib/math/base/assert/is-integer":266}],264:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a double-precision floating-point numeric value is infinite.
*
* @module @stdlib/math/base/assert/is-infinite
*
* @example
* var isInfinite = require( '@stdlib/math/base/assert/is-infinite' );
*
* var bool = isInfinite( Infinity );
* // returns true
*
* bool = isInfinite( -Infinity );
* // returns true
*
* bool = isInfinite( 5.0 );
* // returns false
*
* bool = isInfinite( NaN );
* // returns false
*/
// MODULES //
var isInfinite = require( './main.js' );
// EXPORTS //
module.exports = isInfinite;
},{"./main.js":265}],265:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var PINF = require( '@stdlib/constants/float64/pinf' );
var NINF = require( '@stdlib/constants/float64/ninf' );
// MAIN //
/**
* Tests if a double-precision floating-point numeric value is infinite.
*
* @param {number} x - value to test
* @returns {boolean} boolean indicating whether the value is infinite
*
* @example
* var bool = isInfinite( Infinity );
* // returns true
*
* @example
* var bool = isInfinite( -Infinity );
* // returns true
*
* @example
* var bool = isInfinite( 5.0 );
* // returns false
*
* @example
* var bool = isInfinite( NaN );
* // returns false
*/
function isInfinite( x ) {
return (x === PINF || x === NINF);
}
// EXPORTS //
module.exports = isInfinite;
},{"@stdlib/constants/float64/ninf":248,"@stdlib/constants/float64/pinf":249}],266:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a finite double-precision floating-point number is an integer.
*
* @module @stdlib/math/base/assert/is-integer
*
* @example
* var isInteger = require( '@stdlib/math/base/assert/is-integer' );
*
* var bool = isInteger( 1.0 );
* // returns true
*
* bool = isInteger( 3.14 );
* // returns false
*/
// MODULES //
var isInteger = require( './is_integer.js' );
// EXPORTS //
module.exports = isInteger;
},{"./is_integer.js":267}],267:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var floor = require( '@stdlib/math/base/special/floor' );
// MAIN //
/**
* Tests if a finite double-precision floating-point number is an integer.
*
* @param {number} x - value to test
* @returns {boolean} boolean indicating whether the value is an integer
*
* @example
* var bool = isInteger( 1.0 );
* // returns true
*
* @example
* var bool = isInteger( 3.14 );
* // returns false
*/
function isInteger( x ) {
return (floor(x) === x);
}
// EXPORTS //
module.exports = isInteger;
},{"@stdlib/math/base/special/floor":278}],268:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a double-precision floating-point numeric value is `NaN`.
*
* @module @stdlib/math/base/assert/is-nan
*
* @example
* var isnan = require( '@stdlib/math/base/assert/is-nan' );
*
* var bool = isnan( NaN );
* // returns true
*
* bool = isnan( 7.0 );
* // returns false
*/
// MODULES //
var isnan = require( './main.js' );
// EXPORTS //
module.exports = isnan;
},{"./main.js":269}],269:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Tests if a double-precision floating-point numeric value is `NaN`.
*
* @param {number} x - value to test
* @returns {boolean} boolean indicating whether the value is `NaN`
*
* @example
* var bool = isnan( NaN );
* // returns true
*
* @example
* var bool = isnan( 7.0 );
* // returns false
*/
function isnan( x ) {
return ( x !== x );
}
// EXPORTS //
module.exports = isnan;
},{}],270:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a finite numeric value is an odd number.
*
* @module @stdlib/math/base/assert/is-odd
*
* @example
* var isOdd = require( '@stdlib/math/base/assert/is-odd' );
*
* var bool = isOdd( 5.0 );
* // returns true
*
* bool = isOdd( -2.0 );
* // returns false
*
* bool = isOdd( 0.0 );
* // returns false
*
* bool = isOdd( NaN );
* // returns false
*/
// MODULES //
var isOdd = require( './is_odd.js' );
// EXPORTS //
module.exports = isOdd;
},{"./is_odd.js":271}],271:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isEven = require( '@stdlib/math/base/assert/is-even' );
// MAIN //
/**
* Tests if a finite numeric value is an odd number.
*
* @param {number} x - value to test
* @returns {boolean} boolean indicating whether the value is an odd number
*
* @example
* var bool = isOdd( 5.0 );
* // returns true
*
* @example
* var bool = isOdd( -2.0 );
* // returns false
*
* @example
* var bool = isOdd( 0.0 );
* // returns false
*
* @example
* var bool = isOdd( NaN );
* // returns false
*/
function isOdd( x ) {
// Check sign to prevent overflow...
if ( x > 0.0 ) {
return isEven( x-1.0 );
}
return isEven( x+1.0 );
}
// EXPORTS //
module.exports = isOdd;
},{"@stdlib/math/base/assert/is-even":262}],272:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Test if a double-precision floating-point numeric value is positive zero.
*
* @module @stdlib/math/base/assert/is-positive-zero
*
* @example
* var isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );
*
* var bool = isPositiveZero( 0.0 );
* // returns true
*
* bool = isPositiveZero( -0.0 );
* // returns false
*/
// MODULES //
var isPositiveZero = require( './main.js' );
// EXPORTS //
module.exports = isPositiveZero;
},{"./main.js":273}],273:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var PINF = require( '@stdlib/constants/float64/pinf' );
// MAIN //
/**
* Tests if a double-precision floating-point numeric value is positive zero.
*
* @param {number} x - value to test
* @returns {boolean} boolean indicating whether the value is positive zero
*
* @example
* var bool = isPositiveZero( 0.0 );
* // returns true
*
* @example
* var bool = isPositiveZero( -0.0 );
* // returns false
*/
function isPositiveZero( x ) {
return (x === 0.0 && 1.0/x === PINF);
}
// EXPORTS //
module.exports = isPositiveZero;
},{"@stdlib/constants/float64/pinf":249}],274:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Compute an absolute value of a double-precision floating-point number.
*
* @module @stdlib/math/base/special/abs
*
* @example
* var abs = require( '@stdlib/math/base/special/abs' );
*
* var v = abs( -1.0 );
* // returns 1.0
*
* v = abs( 2.0 );
* // returns 2.0
*
* v = abs( 0.0 );
* // returns 0.0
*
* v = abs( -0.0 );
* // returns 0.0
*
* v = abs( NaN );
* // returns NaN
*/
// MODULES //
var abs = require( './main.js' );
// EXPORTS //
module.exports = abs;
},{"./main.js":275}],275:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Computes the absolute value of a double-precision floating-point number `x`.
*
* @param {number} x - input value
* @returns {number} absolute value
*
* @example
* var v = abs( -1.0 );
* // returns 1.0
*
* @example
* var v = abs( 2.0 );
* // returns 2.0
*
* @example
* var v = abs( 0.0 );
* // returns 0.0
*
* @example
* var v = abs( -0.0 );
* // returns 0.0
*
* @example
* var v = abs( NaN );
* // returns NaN
*/
function abs( x ) {
return Math.abs( x ); // eslint-disable-line stdlib/no-builtin-math
}
// EXPORTS //
module.exports = abs;
},{}],276:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var toWords = require( '@stdlib/number/float64/base/to-words' );
var getHighWord = require( '@stdlib/number/float64/base/get-high-word' );
var fromWords = require( '@stdlib/number/float64/base/from-words' );
// VARIABLES //
// 10000000000000000000000000000000 => 2147483648 => 0x80000000
var SIGN_MASK = 0x80000000>>>0; // asm type annotation
// 01111111111111111111111111111111 => 2147483647 => 0x7fffffff
var MAGNITUDE_MASK = 0x7fffffff|0; // asm type annotation
// High/low words workspace:
var WORDS = [ 0, 0 ]; // WARNING: not thread safe
// MAIN //
/**
* Returns a double-precision floating-point number with the magnitude of `x` and the sign of `y`.
*
* @param {number} x - number from which to derive a magnitude
* @param {number} y - number from which to derive a sign
* @returns {number} a double-precision floating-point number
*
* @example
* var z = copysign( -3.14, 10.0 );
* // returns 3.14
*
* @example
* var z = copysign( 3.14, -1.0 );
* // returns -3.14
*
* @example
* var z = copysign( 1.0, -0.0 );
* // returns -1.0
*
* @example
* var z = copysign( -3.14, -0.0 );
* // returns -3.14
*
* @example
* var z = copysign( -0.0, 1.0 );
* // returns 0.0
*/
function copysign( x, y ) {
var hx;
var hy;
// Split `x` into higher and lower order words:
toWords( WORDS, x );
hx = WORDS[ 0 ];
// Turn off the sign bit of `x`:
hx &= MAGNITUDE_MASK;
// Extract the higher order word from `y`:
hy = getHighWord( y );
// Leave only the sign bit of `y` turned on:
hy &= SIGN_MASK;
// Copy the sign bit of `y` to `x`:
hx |= hy;
// Return a new value having the same magnitude as `x`, but with the sign of `y`:
return fromWords( hx, WORDS[ 1 ] );
}
// EXPORTS //
module.exports = copysign;
},{"@stdlib/number/float64/base/from-words":312,"@stdlib/number/float64/base/get-high-word":316,"@stdlib/number/float64/base/to-words":327}],277:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return a double-precision floating-point number with the magnitude of `x` and the sign of `y`.
*
* @module @stdlib/math/base/special/copysign
*
* @example
* var copysign = require( '@stdlib/math/base/special/copysign' );
*
* var z = copysign( -3.14, 10.0 );
* // returns 3.14
*
* z = copysign( 3.14, -1.0 );
* // returns -3.14
*
* z = copysign( 1.0, -0.0 );
* // returns -1.0
*
* z = copysign( -3.14, -0.0 );
* // returns -3.14
*
* z = copysign( -0.0, 1.0 );
* // returns 0.0
*/
// MODULES //
var copysign = require( './copysign.js' );
// EXPORTS //
module.exports = copysign;
},{"./copysign.js":276}],278:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Round a double-precision floating-point number toward negative infinity.
*
* @module @stdlib/math/base/special/floor
*
* @example
* var floor = require( '@stdlib/math/base/special/floor' );
*
* var v = floor( -4.2 );
* // returns -5.0
*
* v = floor( 9.99999 );
* // returns 9.0
*
* v = floor( 0.0 );
* // returns 0.0
*
* v = floor( NaN );
* // returns NaN
*/
// MODULES //
var floor = require( './main.js' );
// EXPORTS //
module.exports = floor;
},{"./main.js":279}],279:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// TODO: implementation (?)
/**
* Rounds a double-precision floating-point number toward negative infinity.
*
* @param {number} x - input value
* @returns {number} rounded value
*
* @example
* var v = floor( -4.2 );
* // returns -5.0
*
* @example
* var v = floor( 9.99999 );
* // returns 9.0
*
* @example
* var v = floor( 0.0 );
* // returns 0.0
*
* @example
* var v = floor( NaN );
* // returns NaN
*/
var floor = Math.floor; // eslint-disable-line stdlib/no-builtin-math
// EXPORTS //
module.exports = floor;
},{}],280:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var bench = require( '@stdlib/bench' );
var randu = require( '@stdlib/random/base/randu' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var pkg = require( './../package.json' ).name;
var floorn = require( './../lib' );
// MAIN //
bench( pkg, function benchmark( b ) {
var x;
var y;
var i;
b.tic();
for ( i = 0; i < b.iterations; i++ ) {
x = ( randu()*1.0e7 ) - 5.0e6;
y = floorn( x, -2 );
if ( isnan( y ) ) {
b.fail( 'should not return NaN' );
}
}
b.toc();
if ( isnan( y ) ) {
b.fail( 'should not return NaN' );
}
b.pass( 'benchmark finished' );
b.end();
});
},{"./../lib":282,"./../package.json":283,"@stdlib/bench":224,"@stdlib/math/base/assert/is-nan":268,"@stdlib/random/base/randu":348}],281:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var isInfinite = require( '@stdlib/math/base/assert/is-infinite' );
var pow = require( '@stdlib/math/base/special/pow' );
var abs = require( '@stdlib/math/base/special/abs' );
var floor = require( '@stdlib/math/base/special/floor' );
var MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );
var MAX_EXP = require( '@stdlib/constants/float64/max-base10-exponent' );
var MIN_EXP = require( '@stdlib/constants/float64/min-base10-exponent' );
var MIN_EXP_SUBNORMAL = require( '@stdlib/constants/float64/min-base10-exponent-subnormal' );
var NINF = require( '@stdlib/constants/float64/ninf' );
// VARIABLES //
var MAX_INT = MAX_SAFE_INTEGER + 1;
var HUGE = 1.0e+308;
// MAIN //
/**
* Rounds a numeric value to the nearest multiple of \\(10^n\\) toward negative infinity.
*
* ## Method
*
* 1. If \\(|x| <= 2^{53}\\) and \\(|n| <= 308\\), we can use the formula
*
* ```tex
* \operatorname{floorn}(x,n) = \frac{\operatorname{floor}(x \cdot 10^{-n})}{10^{-n}}
* ```
*
* which shifts the decimal to the nearest multiple of \\(10^n\\), performs a standard \\(\mathrm{floor}\\) operation, and then shifts the decimal to its original position.
*
* <!-- <note> -->
*
* If \\(x \cdot 10^{-n}\\) overflows, \\(x\\) lacks a sufficient number of decimal digits to have any effect when rounding. Accordingly, the rounded value is \\(x\\).
*
* <!-- </note> -->
*
* <!-- <note> -->
*
* Note that rescaling \\(x\\) can result in unexpected behavior. For instance, the result of \\(\operatorname{floorn}(-0.2-0.1,-16)\\) is \\(-0.3000000000000001\\) and not \\(-0.3\\). While possibly unexpected, this is not a bug. The behavior stems from the fact that most decimal fractions cannot be exactly represented as floating-point numbers. And further, rescaling can lead to slightly different fractional values, which, in turn, affects the result of \\(\mathrm{floor}\\).
*
* <!-- </note> -->
*
* 2. If \\(n > 308\\), we recognize that the maximum absolute double-precision floating-point number is \\(\approx 1.8\mbox{e}308\\) and, thus, the result of rounding any possible negative finite number \\(x\\) to the nearest \\(10^n\\) is \\(-\infty\\) and any possible positive finite number \\(x\\) is \\(+0\\). To ensure consistent behavior with \\(\operatorname{floor}(x)\\), if \\(x > 0\\), the sign of \\(x\\) is preserved.
*
* 3. If \\(n < -324\\), \\(n\\) exceeds the maximum number of possible decimal places (such as with subnormal numbers), and, thus, the rounded value is \\(x\\).
*
* 4. If \\(x > 2^{53}\\), \\(x\\) is **always** an integer (i.e., \\(x\\) has no decimal digits). If \\(n <= 0\\), the rounded value is \\(x\\).
*
* 5. If \\(n < -308\\), we let \\(m = n + 308\\) and modify the above formula to avoid overflow.
*
* ```tex
* \operatorname{floorn}(x,n) = \frac{\biggl(\frac{\operatorname{floor}( (x \cdot 10^{308}) 10^{-m})}{10^{308}}\biggr)}{10^{-m}}
* ```
*
* If overflow occurs, the rounded value is \\(x\\).
*
*
* ## Special Cases
*
* ```tex
* \begin{align*}
* \operatorname{floorn}(\mathrm{NaN}, n) &= \mathrm{NaN} \\
* \operatorname{floorn}(x, \mathrm{NaN}) &= \mathrm{NaN} \\
* \operatorname{floorn}(x, \pm\infty) &= \mathrm{NaN} \\
* \operatorname{floorn}(\pm\infty, n) &= \pm\infty \\
* \operatorname{floorn}(\pm 0, n) &= \pm 0
* \end{align*}
* ```
*
*
* @param {number} x - input value
* @param {integer} n - integer power of 10
* @returns {number} rounded value
*
* @example
* // Round a value to 4 decimal places:
* var v = floorn( 3.141592653589793, -4 );
* // returns 3.1415
*
* @example
* // If n = 0, `floorn` behaves like `floor`:
* var v = floorn( 3.141592653589793, 0 );
* // returns 3.0
*
* @example
* // Round a value to the nearest thousand:
* var v = floorn( 12368.0, 3 );
* // returns 12000.0
*/
function floorn( x, n ) {
var s;
var y;
if (
isnan( x ) ||
isnan( n ) ||
isInfinite( n )
) {
return NaN;
}
if (
// Handle infinities...
isInfinite( x ) ||
// Handle +-0...
x === 0.0 ||
// If `n` exceeds the maximum number of feasible decimal places (such as with subnormal numbers), nothing to round...
n < MIN_EXP_SUBNORMAL ||
// If `|x|` is large enough, no decimals to round...
( abs( x ) > MAX_INT && n <= 0 )
) {
return x;
}
// The maximum absolute double is ~1.8e308. Accordingly, any possible positive finite `x` rounded to the nearest >=10^309 is infinity and any negative finite `x` is zero.
if ( n > MAX_EXP ) {
if ( x >= 0.0 ) {
return 0.0; // preserve the sign (same behavior as floor)
}
return NINF;
}
// If we overflow, return `x`, as the number of digits to the right of the decimal is too small (i.e., `x` is too large / lacks sufficient fractional precision) for there to be any effect when rounding...
if ( n < MIN_EXP ) {
s = pow( 10.0, -(n + MAX_EXP) );
y = (x*HUGE) * s; // order of operation matters!
if ( isInfinite( y ) ) {
return x;
}
return ( floor(y)/HUGE ) / s;
}
s = pow( 10.0, -n );
y = x * s;
if ( isInfinite( y ) ) {
return x;
}
return floor( y ) / s;
}
// EXPORTS //
module.exports = floorn;
},{"@stdlib/constants/float64/max-base10-exponent":241,"@stdlib/constants/float64/max-safe-integer":244,"@stdlib/constants/float64/min-base10-exponent":246,"@stdlib/constants/float64/min-base10-exponent-subnormal":245,"@stdlib/constants/float64/ninf":248,"@stdlib/math/base/assert/is-infinite":264,"@stdlib/math/base/assert/is-nan":268,"@stdlib/math/base/special/abs":274,"@stdlib/math/base/special/floor":278,"@stdlib/math/base/special/pow":291}],282:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Round a numeric value to the nearest multiple of `10^n` toward negative infinity.
*
* @module @stdlib/math/base/special/floorn
*
* @example
* var floorn = require( '@stdlib/math/base/special/floorn' );
*
* // Round a value to 4 decimal places:
* var v = floorn( 3.141592653589793, -4 );
* // returns 3.1415
*
* // If n = 0, `floorn` behaves like `floor`:
* v = floorn( 3.141592653589793, 0 );
* // returns 3.0
*
* // Round a value to the nearest thousand:
* v = floorn( 12368.0, 3 );
* // returns 12000.0
*/
// MODULES //
var floorn = require( './floorn.js' );
// EXPORTS //
module.exports = floorn;
},{"./floorn.js":281}],283:[function(require,module,exports){
module.exports={
"name": "@stdlib/math/base/special/floorn",
"version": "0.0.0",
"description": "Round a numeric value to the nearest multiple of 10^n toward negative infinity.",
"license": "Apache-2.0",
"author": {
"name": "The Stdlib Authors",
"url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
},
"contributors": [
{
"name": "The Stdlib Authors",
"url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
}
],
"main": "./lib",
"directories": {
"benchmark": "./benchmark",
"doc": "./docs",
"example": "./examples",
"lib": "./lib",
"test": "./test"
},
"types": "./docs/types",
"scripts": {},
"homepage": "https://github.com/stdlib-js/stdlib",
"repository": {
"type": "git",
"url": "git://github.com/stdlib-js/stdlib.git"
},
"bugs": {
"url": "https://github.com/stdlib-js/stdlib/issues"
},
"dependencies": {},
"devDependencies": {},
"engines": {
"node": ">=0.10.0",
"npm": ">2.7.0"
},
"os": [
"aix",
"darwin",
"freebsd",
"linux",
"macos",
"openbsd",
"sunos",
"win32",
"windows"
],
"keywords": [
"stdlib",
"stdmath",
"mathematics",
"math",
"math.floor",
"floor",
"floorn",
"round",
"fix",
"tofixed",
"integer",
"nearest",
"number"
]
}
},{}],284:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Multiply a double-precision floating-point number by an integer power of two.
*
* @module @stdlib/math/base/special/ldexp
*
* @example
* var ldexp = require( '@stdlib/math/base/special/ldexp' );
*
* var x = ldexp( 0.5, 3 ); // => 0.5 * 2^3 = 0.5 * 8
* // returns 4.0
*
* x = ldexp( 4.0, -2 ); // => 4 * 2^(-2) = 4 * (1/4)
* // returns 1.0
*
* x = ldexp( 0.0, 20 );
* // returns 0.0
*
* x = ldexp( -0.0, 39 );
* // returns -0.0
*
* x = ldexp( NaN, -101 );
* // returns NaN
*
* x = ldexp( Infinity, 11 );
* // returns Infinity
*
* x = ldexp( -Infinity, -118 );
* // returns -Infinity
*/
// MODULES //
var ldexp = require( './ldexp.js' );
// EXPORTS //
module.exports = ldexp;
},{"./ldexp.js":285}],285:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// NOTES //
/*
* => ldexp: load exponent (see [The Open Group]{@link http://pubs.opengroup.org/onlinepubs/9699919799/functions/ldexp.html} and [cppreference]{@link http://en.cppreference.com/w/c/numeric/math/ldexp}).
*/
// MODULES //
var PINF = require( '@stdlib/constants/float64/pinf' );
var NINF = require( '@stdlib/constants/float64/ninf' );
var BIAS = require( '@stdlib/constants/float64/exponent-bias' );
var MAX_EXPONENT = require( '@stdlib/constants/float64/max-base2-exponent' );
var MAX_SUBNORMAL_EXPONENT = require( '@stdlib/constants/float64/max-base2-exponent-subnormal' );
var MIN_SUBNORMAL_EXPONENT = require( '@stdlib/constants/float64/min-base2-exponent-subnormal' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var isInfinite = require( '@stdlib/math/base/assert/is-infinite' );
var copysign = require( '@stdlib/math/base/special/copysign' );
var normalize = require( '@stdlib/number/float64/base/normalize' );
var floatExp = require( '@stdlib/number/float64/base/exponent' );
var toWords = require( '@stdlib/number/float64/base/to-words' );
var fromWords = require( '@stdlib/number/float64/base/from-words' );
// VARIABLES //
// 1/(1<<52) = 1/(2**52) = 1/4503599627370496
var TWO52_INV = 2.220446049250313e-16;
// Exponent all 0s: 1 00000000000 11111111111111111111 => 2148532223
var CLEAR_EXP_MASK = 0x800fffff>>>0; // asm type annotation
// Normalization workspace:
var FRAC = [ 0.0, 0.0 ]; // WARNING: not thread safe
// High/low words workspace:
var WORDS = [ 0, 0 ]; // WARNING: not thread safe
// MAIN //
/**
* Multiplies a double-precision floating-point number by an integer power of two.
*
* @param {number} frac - fraction
* @param {integer} exp - exponent
* @returns {number} double-precision floating-point number
*
* @example
* var x = ldexp( 0.5, 3 ); // => 0.5 * 2^3 = 0.5 * 8
* // returns 4.0
*
* @example
* var x = ldexp( 4.0, -2 ); // => 4 * 2^(-2) = 4 * (1/4)
* // returns 1.0
*
* @example
* var x = ldexp( 0.0, 20 );
* // returns 0.0
*
* @example
* var x = ldexp( -0.0, 39 );
* // returns -0.0
*
* @example
* var x = ldexp( NaN, -101 );
* // returns NaN
*
* @example
* var x = ldexp( Infinity, 11 );
* // returns Infinity
*
* @example
* var x = ldexp( -Infinity, -118 );
* // returns -Infinity
*/
function ldexp( frac, exp ) {
var high;
var m;
if (
frac === 0.0 || // handles +-0
isnan( frac ) ||
isInfinite( frac )
) {
return frac;
}
// Normalize the input fraction:
normalize( FRAC, frac );
frac = FRAC[ 0 ];
exp += FRAC[ 1 ];
// Extract the exponent from `frac` and add it to `exp`:
exp += floatExp( frac );
// Check for underflow/overflow...
if ( exp < MIN_SUBNORMAL_EXPONENT ) {
return copysign( 0.0, frac );
}
if ( exp > MAX_EXPONENT ) {
if ( frac < 0.0 ) {
return NINF;
}
return PINF;
}
// Check for a subnormal and scale accordingly to retain precision...
if ( exp <= MAX_SUBNORMAL_EXPONENT ) {
exp += 52;
m = TWO52_INV;
} else {
m = 1.0;
}
// Split the fraction into higher and lower order words:
toWords( WORDS, frac );
high = WORDS[ 0 ];
// Clear the exponent bits within the higher order word:
high &= CLEAR_EXP_MASK;
// Set the exponent bits to the new exponent:
high |= ((exp+BIAS) << 20);
// Create a new floating-point number:
return m * fromWords( high, WORDS[ 1 ] );
}
// EXPORTS //
module.exports = ldexp;
},{"@stdlib/constants/float64/exponent-bias":237,"@stdlib/constants/float64/max-base2-exponent":243,"@stdlib/constants/float64/max-base2-exponent-subnormal":242,"@stdlib/constants/float64/min-base2-exponent-subnormal":247,"@stdlib/constants/float64/ninf":248,"@stdlib/constants/float64/pinf":249,"@stdlib/math/base/assert/is-infinite":264,"@stdlib/math/base/assert/is-nan":268,"@stdlib/math/base/special/copysign":277,"@stdlib/number/float64/base/exponent":310,"@stdlib/number/float64/base/from-words":312,"@stdlib/number/float64/base/normalize":318,"@stdlib/number/float64/base/to-words":327}],286:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return the maximum value.
*
* @module @stdlib/math/base/special/max
*
* @example
* var max = require( '@stdlib/math/base/special/max' );
*
* var v = max( 3.14, 4.2 );
* // returns 4.2
*
* v = max( 5.9, 3.14, 4.2 );
* // returns 5.9
*
* v = max( 3.14, NaN );
* // returns NaN
*
* v = max( +0.0, -0.0 );
* // returns +0.0
*/
// MODULES //
var max = require( './max.js' );
// EXPORTS //
module.exports = max;
},{"./max.js":287}],287:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var NINF = require( '@stdlib/constants/float64/ninf' );
var PINF = require( '@stdlib/constants/float64/pinf' );
// MAIN //
/**
* Returns the maximum value.
*
* @param {number} [x] - first number
* @param {number} [y] - second number
* @param {...number} [args] - numbers
* @returns {number} maximum value
*
* @example
* var v = max( 3.14, 4.2 );
* // returns 4.2
*
* @example
* var v = max( 5.9, 3.14, 4.2 );
* // returns 5.9
*
* @example
* var v = max( 3.14, NaN );
* // returns NaN
*
* @example
* var v = max( +0.0, -0.0 );
* // returns +0.0
*/
function max( x, y ) {
var len;
var m;
var v;
var i;
len = arguments.length;
if ( len === 2 ) {
if ( isnan( x ) || isnan( y ) ) {
return NaN;
}
if ( x === PINF || y === PINF ) {
return PINF;
}
if ( x === y && x === 0.0 ) {
if ( isPositiveZero( x ) ) {
return x;
}
return y;
}
if ( x > y ) {
return x;
}
return y;
}
m = NINF;
for ( i = 0; i < len; i++ ) {
v = arguments[ i ];
if ( isnan( v ) || v === PINF ) {
return v;
}
if ( v > m ) {
m = v;
} else if (
v === m &&
v === 0.0 &&
isPositiveZero( v )
) {
m = v;
}
}
return m;
}
// EXPORTS //
module.exports = max;
},{"@stdlib/constants/float64/ninf":248,"@stdlib/constants/float64/pinf":249,"@stdlib/math/base/assert/is-nan":268,"@stdlib/math/base/assert/is-positive-zero":272}],288:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Decompose a double-precision floating-point number into integral and fractional parts.
*
* @module @stdlib/math/base/special/modf
*
* @example
* var modf = require( '@stdlib/math/base/special/modf' );
*
* var parts = modf( 3.14 );
* // returns [ 3.0, 0.14000000000000012 ]
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
* var modf = require( '@stdlib/math/base/special/modf' );
*
* var out = new Float64Array( 2 );
*
* var parts = modf( out, 3.14 );
* // returns [ 3.0, 0.14000000000000012 ]
*
* var bool = ( parts === out );
* // returns true
*/
// MODULES //
var modf = require( './main.js' );
// EXPORTS //
module.exports = modf;
},{"./main.js":289}],289:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var fcn = require( './modf.js' );
// MAIN //
/**
* Decomposes a double-precision floating-point number into integral and fractional parts, each having the same type and sign as the input value.
*
* @param {(Array|TypedArray|Object)} [out] - output array
* @param {number} x - input value
* @returns {(Array|TypedArray|Object)} output array
*
* @example
* var parts = modf( 3.14 );
* // returns [ 3.0, 0.14000000000000012 ]
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
*
* var out = new Float64Array( 2 );
*
* var parts = modf( out, 3.14 );
* // returns <Float64Array>[ 3.0, 0.14000000000000012 ]
*
* var bool = ( parts === out );
* // returns true
*/
function modf( out, x ) {
if ( arguments.length === 1 ) {
return fcn( [ 0.0, 0.0 ], out );
}
return fcn( out, x );
}
// EXPORTS //
module.exports = modf;
},{"./modf.js":290}],290:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var toWords = require( '@stdlib/number/float64/base/to-words' );
var fromWords = require( '@stdlib/number/float64/base/from-words' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var FLOAT64_EXPONENT_BIAS = require( '@stdlib/constants/float64/exponent-bias' );
var FLOAT64_HIGH_WORD_EXPONENT_MASK = require( '@stdlib/constants/float64/high-word-exponent-mask' ); // eslint-disable-line id-length
var FLOAT64_HIGH_WORD_SIGNIFICAND_MASK = require( '@stdlib/constants/float64/high-word-significand-mask' ); // eslint-disable-line id-length
// VARIABLES //
// 4294967295 => 0xffffffff => 11111111111111111111111111111111
var ALL_ONES = 4294967295>>>0; // asm type annotation
// High/low words workspace:
var WORDS = [ 0|0, 0|0 ]; // WARNING: not thread safe
// MAIN //
/**
* Decomposes a double-precision floating-point number into integral and fractional parts, each having the same type and sign as the input value.
*
* @private
* @param {(Array|TypedArray|Object)} out - output array
* @param {number} x - input value
* @returns {(Array|TypedArray|Object)} output array
*
* @example
* var parts = modf( [ 0.0, 0.0 ], 3.14 );
* // returns [ 3.0, 0.14000000000000012 ]
*/
function modf( out, x ) {
var high;
var low;
var exp;
var i;
// Special cases...
if ( x < 1.0 ) {
if ( x < 0.0 ) {
modf( out, -x );
out[ 0 ] *= -1.0;
out[ 1 ] *= -1.0;
return out;
}
if ( x === 0.0 ) { // [ +-0, +-0 ]
out[ 0 ] = x;
out[ 1 ] = x;
return out;
}
out[ 0 ] = 0.0;
out[ 1 ] = x;
return out;
}
if ( isnan( x ) ) {
out[ 0 ] = NaN;
out[ 1 ] = NaN;
return out;
}
if ( x === PINF ) {
out[ 0 ] = PINF;
out[ 1 ] = 0.0;
return out;
}
// Decompose |x|...
// Extract the high and low words:
toWords( WORDS, x );
high = WORDS[ 0 ];
low = WORDS[ 1 ];
// Extract the unbiased exponent from the high word:
exp = ((high & FLOAT64_HIGH_WORD_EXPONENT_MASK) >> 20)|0; // asm type annotation
exp -= FLOAT64_EXPONENT_BIAS|0; // asm type annotation
// Handle smaller values (x < 2**20 = 1048576)...
if ( exp < 20 ) {
i = (FLOAT64_HIGH_WORD_SIGNIFICAND_MASK >> exp)|0; // asm type annotation
// Determine if `x` is integral by checking for significand bits which cannot be exponentiated away...
if ( ((high&i)|low) === 0 ) {
out[ 0 ] = x;
out[ 1 ] = 0.0;
return out;
}
// Turn off all the bits which cannot be exponentiated away:
high &= (~i);
// Generate the integral part:
i = fromWords( high, 0 );
// The fractional part is whatever is leftover:
out[ 0 ] = i;
out[ 1 ] = x - i;
return out;
}
// Check if `x` can even have a fractional part...
if ( exp > 51 ) {
// `x` is integral:
out[ 0 ] = x;
out[ 1 ] = 0.0;
return out;
}
i = ALL_ONES >>> (exp-20);
// Determine if `x` is integral by checking for less significant significand bits which cannot be exponentiated away...
if ( (low&i) === 0 ) {
out[ 0 ] = x;
out[ 1 ] = 0.0;
return out;
}
// Turn off all the bits which cannot be exponentiated away:
low &= (~i);
// Generate the integral part:
i = fromWords( high, low );
// The fractional part is whatever is leftover:
out[ 0 ] = i;
out[ 1 ] = x - i;
return out;
}
// EXPORTS //
module.exports = modf;
},{"@stdlib/constants/float64/exponent-bias":237,"@stdlib/constants/float64/high-word-exponent-mask":238,"@stdlib/constants/float64/high-word-significand-mask":239,"@stdlib/constants/float64/pinf":249,"@stdlib/math/base/assert/is-nan":268,"@stdlib/number/float64/base/from-words":312,"@stdlib/number/float64/base/to-words":327}],291:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Evaluate the exponential function.
*
* @module @stdlib/math/base/special/pow
*
* @example
* var pow = require( '@stdlib/math/base/special/pow' );
*
* var v = pow( 2.0, 3.0 );
* // returns 8.0
*
* v = pow( 4.0, 0.5 );
* // returns 2.0
*
* v = pow( 100.0, 0.0 );
* // returns 1.0
*
* v = pow( 3.141592653589793, 5.0 );
* // returns ~306.0197
*
* v = pow( 3.141592653589793, -0.2 );
* // returns ~0.7954
*
* v = pow( NaN, 3.0 );
* // returns NaN
*
* v = pow( 5.0, NaN );
* // returns NaN
*
* v = pow( NaN, NaN );
* // returns NaN
*/
// MODULES //
var pow = require( './pow.js' );
// EXPORTS //
module.exports = pow;
},{"./pow.js":297}],292:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The following copyright and license were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/s_pow.c}. The implementation follows the original, but has been modified for JavaScript.
*
* ```text
* Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ```
*/
'use strict';
// MODULES //
var getHighWord = require( '@stdlib/number/float64/base/get-high-word' );
var setLowWord = require( '@stdlib/number/float64/base/set-low-word' );
var setHighWord = require( '@stdlib/number/float64/base/set-high-word' );
var BIAS = require( '@stdlib/constants/float64/exponent-bias' );
var polyvalL = require( './polyval_l.js' );
// VARIABLES //
// 0x000fffff = 1048575 => 0 00000000000 11111111111111111111
var HIGH_SIGNIFICAND_MASK = 0x000fffff|0; // asm type annotation
// 0x00100000 = 1048576 => 0 00000000001 00000000000000000000 => biased exponent: 1 = -1022+1023 => 2^-1022
var HIGH_MIN_NORMAL_EXP = 0x00100000|0; // asm type annotation
// 0x3ff00000 = 1072693248 => 0 01111111111 00000000000000000000 => biased exponent: 1023 = 0+1023 => 2^0 = 1
var HIGH_BIASED_EXP_0 = 0x3ff00000|0; // asm type annotation
// 0x20000000 = 536870912 => 0 01000000000 00000000000000000000 => biased exponent: 512 = -511+1023
var HIGH_BIASED_EXP_NEG_512 = 0x20000000|0; // asm type annotation
// 0x00080000 = 524288 => 0 00000000000 10000000000000000000
var HIGH_SIGNIFICAND_HALF = 0x00080000|0; // asm type annotation
// TODO: consider making an external constant
var HIGH_NUM_SIGNIFICAND_BITS = 20|0; // asm type annotation
var TWO53 = 9007199254740992.0; // 0x43400000, 0x00000000
// 2/(3*LN2)
var CP = 9.61796693925975554329e-01; // 0x3FEEC709, 0xDC3A03FD
// (float)CP
var CP_HI = 9.61796700954437255859e-01; // 0x3FEEC709, 0xE0000000
// Low: CP_HI
var CP_LO = -7.02846165095275826516e-09; // 0xBE3E2FE0, 0x145B01F5
var BP = [
1.0,
1.5
];
var DP_HI = [
0.0,
5.84962487220764160156e-01 // 0x3FE2B803, 0x40000000
];
var DP_LO = [
0.0,
1.35003920212974897128e-08 // 0x3E4CFDEB, 0x43CFD006
];
// MAIN //
/**
* Computes \\(\operatorname{log2}(ax)\\).
*
* @private
* @param {Array} out - output array
* @param {number} ax - absolute value of `x`
* @param {number} ahx - high word of `ax`
* @returns {Array} output array containing a tuple comprised of high and low parts
*
* @example
* var t = log2ax( [ 0.0, 0.0 ], 9.0, 1075970048 ); // => [ t1, t2 ]
* // returns [ 3.169923782348633, 0.0000012190936795504075 ]
*/
function log2ax( out, ax, ahx ) {
var tmp;
var ss; // `hs + ls`
var s2; // `ss` squared
var hs;
var ls;
var ht;
var lt;
var bp; // `BP` constant
var dp; // `DP` constant
var hp;
var lp;
var hz;
var lz;
var t1;
var t2;
var t;
var r;
var u;
var v;
var n;
var j;
var k;
n = 0|0; // asm type annotation
// Check if `x` is subnormal...
if ( ahx < HIGH_MIN_NORMAL_EXP ) {
ax *= TWO53;
n -= 53|0; // asm type annotation
ahx = getHighWord( ax );
}
// Extract the unbiased exponent of `x`:
n += ((ahx >> HIGH_NUM_SIGNIFICAND_BITS) - BIAS)|0; // asm type annotation
// Isolate the significand bits of `x`:
j = (ahx & HIGH_SIGNIFICAND_MASK)|0; // asm type annotation
// Normalize `ahx` by setting the (biased) exponent to `1023`:
ahx = (j | HIGH_BIASED_EXP_0)|0; // asm type annotation
// Determine the interval of `|x|` by comparing significand bits...
// |x| < sqrt(3/2)
if ( j <= 0x3988E ) { // 0 00000000000 00111001100010001110
k = 0;
}
// |x| < sqrt(3)
else if ( j < 0xBB67A ) { // 0 00000000000 10111011011001111010
k = 1;
}
// |x| >= sqrt(3)
else {
k = 0;
n += 1|0; // asm type annotation
ahx -= HIGH_MIN_NORMAL_EXP;
}
// Load the normalized high word into `|x|`:
ax = setHighWord( ax, ahx );
// Compute `ss = hs + ls = (x-1)/(x+1)` or `(x-1.5)/(x+1.5)`:
bp = BP[ k ]; // BP[0] = 1.0, BP[1] = 1.5
u = ax - bp; // (x-1) || (x-1.5)
v = 1.0 / (ax + bp); // 1/(x+1) || 1/(x+1.5)
ss = u * v;
hs = setLowWord( ss, 0 ); // set all low word (less significant significand) bits to 0s
// Compute `ht = ax + bp` (via manipulation, i.e., bit flipping, of the high word):
tmp = ((ahx>>1) | HIGH_BIASED_EXP_NEG_512) + HIGH_SIGNIFICAND_HALF;
tmp += (k << 18); // `(k<<18)` can be considered the word equivalent of `1.0` or `1.5`
ht = setHighWord( 0.0, tmp );
lt = ax - (ht - bp);
ls = v * ( ( u - (hs*ht) ) - ( hs*lt ) );
// Compute `log(ax)`...
s2 = ss * ss;
r = s2 * s2 * polyvalL( s2 );
r += ls * (hs + ss);
s2 = hs * hs;
ht = 3.0 + s2 + r;
ht = setLowWord( ht, 0 );
lt = r - ((ht-3.0) - s2);
// u+v = ss*(1+...):
u = hs * ht;
v = ( ls*ht ) + ( lt*ss );
// 2/(3LN2) * (ss+...):
hp = u + v;
hp = setLowWord( hp, 0 );
lp = v - (hp - u);
hz = CP_HI * hp; // CP_HI+CP_LO = 2/(3*LN2)
lz = ( CP_LO*hp ) + ( lp*CP ) + DP_LO[ k ];
// log2(ax) = (ss+...)*2/(3*LN2) = n + dp + hz + lz
dp = DP_HI[ k ];
t = n;
t1 = ((hz+lz) + dp) + t; // log2(ax)
t1 = setLowWord( t1, 0 );
t2 = lz - (((t1-t) - dp) - hz);
out[ 0 ] = t1;
out[ 1 ] = t2;
return out;
}
// EXPORTS //
module.exports = log2ax;
},{"./polyval_l.js":294,"@stdlib/constants/float64/exponent-bias":237,"@stdlib/number/float64/base/get-high-word":316,"@stdlib/number/float64/base/set-high-word":322,"@stdlib/number/float64/base/set-low-word":324}],293:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The following copyright and license were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/s_pow.c}. The implementation follows the original, but has been modified for JavaScript.
*
* ```text
* Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ```
*/
'use strict';
// MODULES //
var setLowWord = require( '@stdlib/number/float64/base/set-low-word' );
var polyvalW = require( './polyval_w.js' );
// VARIABLES //
// 1/LN2
var INV_LN2 = 1.44269504088896338700e+00; // 0x3FF71547, 0x652B82FE
// High (24 bits): 1/LN2
var INV_LN2_HI = 1.44269502162933349609e+00; // 0x3FF71547, 0x60000000
// Low: 1/LN2
var INV_LN2_LO = 1.92596299112661746887e-08; // 0x3E54AE0B, 0xF85DDF44
// MAIN //
/**
* Computes \\(\operatorname{log}(x)\\) assuming \\(|1-x|\\) is small and using the approximation \\(x - x^2/2 + x^3/3 - x^4/4\\).
*
* @private
* @param {Array} out - output array
* @param {number} ax - absolute value of `x`
* @returns {Array} output array containing a tuple comprised of high and low parts
*
* @example
* var t = logx( [ 0.0, 0.0 ], 9.0 ); // => [ t1, t2 ]
* // returns [ -1265.7236328125, -0.0008163940840404393 ]
*/
function logx( out, ax ) {
var t2;
var t1;
var t;
var w;
var u;
var v;
t = ax - 1.0; // `t` has `20` trailing zeros
w = t * t * polyvalW( t );
u = INV_LN2_HI * t; // `INV_LN2_HI` has `21` significant bits
v = ( t*INV_LN2_LO ) - ( w*INV_LN2 );
t1 = u + v;
t1 = setLowWord( t1, 0 );
t2 = v - (t1 - u);
out[ 0 ] = t1;
out[ 1 ] = t2;
return out;
}
// EXPORTS //
module.exports = logx;
},{"./polyval_w.js":296,"@stdlib/number/float64/base/set-low-word":324}],294:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* This is a generated file. Do not edit directly. */
'use strict';
// MAIN //
/**
* Evaluates a polynomial.
*
* ## Notes
*
* - The implementation uses [Horner's rule][horners-method] for efficient computation.
*
* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method
*
*
* @private
* @param {number} x - value at which to evaluate the polynomial
* @returns {number} evaluated polynomial
*/
function evalpoly( x ) {
if ( x === 0.0 ) {
return 0.5999999999999946;
}
return 0.5999999999999946 + (x * (0.4285714285785502 + (x * (0.33333332981837743 + (x * (0.272728123808534 + (x * (0.23066074577556175 + (x * 0.20697501780033842))))))))); // eslint-disable-line max-len
}
// EXPORTS //
module.exports = evalpoly;
},{}],295:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* This is a generated file. Do not edit directly. */
'use strict';
// MAIN //
/**
* Evaluates a polynomial.
*
* ## Notes
*
* - The implementation uses [Horner's rule][horners-method] for efficient computation.
*
* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method
*
*
* @private
* @param {number} x - value at which to evaluate the polynomial
* @returns {number} evaluated polynomial
*/
function evalpoly( x ) {
if ( x === 0.0 ) {
return 0.16666666666666602;
}
return 0.16666666666666602 + (x * (-0.0027777777777015593 + (x * (0.00006613756321437934 + (x * (-0.0000016533902205465252 + (x * 4.1381367970572385e-8))))))); // eslint-disable-line max-len
}
// EXPORTS //
module.exports = evalpoly;
},{}],296:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* This is a generated file. Do not edit directly. */
'use strict';
// MAIN //
/**
* Evaluates a polynomial.
*
* ## Notes
*
* - The implementation uses [Horner's rule][horners-method] for efficient computation.
*
* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method
*
*
* @private
* @param {number} x - value at which to evaluate the polynomial
* @returns {number} evaluated polynomial
*/
function evalpoly( x ) {
if ( x === 0.0 ) {
return 0.5;
}
return 0.5 + (x * (-0.3333333333333333 + (x * 0.25)));
}
// EXPORTS //
module.exports = evalpoly;
},{}],297:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The following copyright and license were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/s_pow.c}. The implementation follows the original, but has been modified for JavaScript.
*
* ```text
* Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ```
*/
'use strict';
// MODULES //
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var isOdd = require( '@stdlib/math/base/assert/is-odd' );
var isInfinite = require( '@stdlib/math/base/assert/is-infinite' );
var isInteger = require( '@stdlib/math/base/assert/is-integer' );
var sqrt = require( '@stdlib/math/base/special/sqrt' );
var abs = require( '@stdlib/math/base/special/abs' );
var toWords = require( '@stdlib/number/float64/base/to-words' );
var setLowWord = require( '@stdlib/number/float64/base/set-low-word' );
var uint32ToInt32 = require( '@stdlib/number/uint32/base/to-int32' );
var NINF = require( '@stdlib/constants/float64/ninf' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var xIsZero = require( './x_is_zero.js' );
var yIsHuge = require( './y_is_huge.js' );
var yIsInfinite = require( './y_is_infinite.js' );
var log2ax = require( './log2ax.js' );
var logx = require( './logx.js' );
var pow2 = require( './pow2.js' );
// VARIABLES //
// 0x7fffffff = 2147483647 => 0 11111111111 11111111111111111111
var ABS_MASK = 0x7fffffff|0; // asm type annotation
// 0x3fefffff = 1072693247 => 0 01111111110 11111111111111111111 => biased exponent: 1022 = -1+1023 => 2^-1
var HIGH_MAX_NEAR_UNITY = 0x3fefffff|0; // asm type annotation
// 0x41e00000 = 1105199104 => 0 10000011110 00000000000000000000 => biased exponent: 1054 = 31+1023 => 2^31
var HIGH_BIASED_EXP_31 = 0x41e00000|0; // asm type annotation
// 0x43f00000 = 1139802112 => 0 10000111111 00000000000000000000 => biased exponent: 1087 = 64+1023 => 2^64
var HIGH_BIASED_EXP_64 = 0x43f00000|0; // asm type annotation
// 0x40900000 = 1083179008 => 0 10000001001 00000000000000000000 => biased exponent: 1033 = 10+1023 => 2^10 = 1024
var HIGH_BIASED_EXP_10 = 0x40900000|0; // asm type annotation
// 0x3ff00000 = 1072693248 => 0 01111111111 00000000000000000000 => biased exponent: 1023 = 0+1023 => 2^0 = 1
var HIGH_BIASED_EXP_0 = 0x3ff00000|0; // asm type annotation
// 0x4090cc00 = 1083231232 => 0 10000001001 00001100110000000000
var HIGH_1075 = 0x4090cc00|0; // asm type annotation
// 0xc090cc00 = 3230714880 => 1 10000001001 00001100110000000000
var HIGH_NEG_1075 = 0xc090cc00>>>0; // asm type annotation
var HIGH_NUM_NONSIGN_BITS = 31|0; // asm type annotation
var HUGE = 1.0e300;
var TINY = 1.0e-300;
// -(1024-log2(ovfl+.5ulp))
var OVT = 8.0085662595372944372e-17;
// High/low words workspace:
var WORDS = [ 0|0, 0|0 ]; // WARNING: not thread safe
// Log workspace:
var LOG_WORKSPACE = [ 0.0, 0.0 ]; // WARNING: not thread safe
// MAIN //
/**
* Evaluates the exponential function.
*
* ## Method
*
* 1. Let \\(x = 2^n (1+f)\\).
*
* 2. Compute \\(\operatorname{log2}(x)\\) as
*
* ```tex
* \operatorname{log2}(x) = w_1 + w_2
* ```
*
* where \\(w_1\\) has \\(53 - 24 = 29\\) bit trailing zeros.
*
* 3. Compute
*
* ```tex
* y \cdot \operatorname{log2}(x) = n + y^\prime
* ```
*
* by simulating multi-precision arithmetic, where \\(|y^\prime| \leq 0.5\\).
*
* 4. Return
*
* ```tex
* x^y = 2^n e^{y^\prime \cdot \mathrm{log2}}
* ```
*
* ## Special Cases
*
* ```tex
* \begin{align*}
* x^{\mathrm{NaN}} &= \mathrm{NaN} & \\
* (\mathrm{NaN})^y &= \mathrm{NaN} & \\
* 1^y &= 1 & \\
* x^0 &= 1 & \\
* x^1 &= x & \\
* (\pm 0)^\infty &= +0 & \\
* (\pm 0)^{-\infty} &= +\infty & \\
* (+0)^y &= +0 & \mathrm{if}\ y > 0 \\
* (+0)^y &= +\infty & \mathrm{if}\ y < 0 \\
* (-0)^y &= -\infty & \mathrm{if}\ y\ \mathrm{is\ an\ odd\ integer\ and}\ y < 0 \\
* (-0)^y &= +\infty & \mathrm{if}\ y\ \mathrm{is\ not\ an\ odd\ integer\ and}\ y < 0 \\
* (-0)^y &= -0 & \mathrm{if}\ y\ \mathrm{is\ an\ odd\ integer\ and}\ y > 0 \\
* (-0)^y &= +0 & \mathrm{if}\ y\ \mathrm{is\ not\ an\ odd\ integer\ and}\ y > 0 \\
* (-1)^{\pm\infty} &= \mathrm{NaN} & \\
* x^{\infty} &= +\infty & |x| > 1 \\
* x^{\infty} &= +0 & |x| < 1 \\
* x^{-\infty} &= +0 & |x| > 1 \\
* x^{-\infty} &= +\infty & |x| < 1 \\
* (-\infty)^y &= (-0)^y & \\
* \infty^y &= +0 & y < 0 \\
* \infty^y &= +\infty & y > 0 \\
* x^y &= \mathrm{NaN} & \mathrm{if}\ y\ \mathrm{is\ not\ a\ finite\ integer\ and}\ x < 0
* \end{align*}
* ```
*
* ## Notes
*
* - \\(\operatorname{pow}(x,y)\\) returns \\(x^y\\) nearly rounded. In particular, \\(\operatorname{pow}(<\mathrm{integer}>,<\mathrm{integer}>)\\) **always** returns the correct integer, provided the value is representable.
* - The hexadecimal values shown in the source code are the intended values for used constants. Decimal values may be used, provided the compiler will accurately convert decimal to binary in order to produce the hexadecimal values.
*
*
* @param {number} x - base
* @param {number} y - exponent
* @returns {number} function value
*
* @example
* var v = pow( 2.0, 3.0 );
* // returns 8.0
*
* @example
* var v = pow( 4.0, 0.5 );
* // returns 2.0
*
* @example
* var v = pow( 100.0, 0.0 );
* // returns 1.0
*
* @example
* var v = pow( 3.141592653589793, 5.0 );
* // returns ~306.0197
*
* @example
* var v = pow( 3.141592653589793, -0.2 );
* // returns ~0.7954
*
* @example
* var v = pow( NaN, 3.0 );
* // returns NaN
*
* @example
* var v = pow( 5.0, NaN );
* // returns NaN
*
* @example
* var v = pow( NaN, NaN );
* // returns NaN
*/
function pow( x, y ) {
var ahx; // absolute value high word `x`
var ahy; // absolute value high word `y`
var ax; // absolute value `x`
var hx; // high word `x`
var lx; // low word `x`
var hy; // high word `y`
var ly; // low word `y`
var sx; // sign `x`
var sy; // sign `y`
var y1;
var hp;
var lp;
var t;
var z; // y prime
var j;
var i;
if ( isnan( x ) || isnan( y ) ) {
return NaN;
}
// Split `y` into high and low words:
toWords( WORDS, y );
hy = WORDS[ 0 ];
ly = WORDS[ 1 ];
// Special cases `y`...
if ( ly === 0 ) {
if ( y === 0.0 ) {
return 1.0;
}
if ( y === 1.0 ) {
return x;
}
if ( y === -1.0 ) {
return 1.0 / x;
}
if ( y === 0.5 ) {
return sqrt( x );
}
if ( y === -0.5 ) {
return 1.0 / sqrt( x );
}
if ( y === 2.0 ) {
return x * x;
}
if ( y === 3.0 ) {
return x * x * x;
}
if ( y === 4.0 ) {
x *= x;
return x * x;
}
if ( isInfinite( y ) ) {
return yIsInfinite( x, y );
}
}
// Split `x` into high and low words:
toWords( WORDS, x );
hx = WORDS[ 0 ];
lx = WORDS[ 1 ];
// Special cases `x`...
if ( lx === 0 ) {
if ( hx === 0 ) {
return xIsZero( x, y );
}
if ( x === 1.0 ) {
return 1.0;
}
if (
x === -1.0 &&
isOdd( y )
) {
return -1.0;
}
if ( isInfinite( x ) ) {
if ( x === NINF ) {
// `pow( 1/x, -y )`
return pow( -0.0, -y );
}
if ( y < 0.0 ) {
return 0.0;
}
return PINF;
}
}
if (
x < 0.0 &&
isInteger( y ) === false
) {
// Signal NaN...
return (x-x)/(x-x);
}
ax = abs( x );
// Remove the sign bits (i.e., get absolute values):
ahx = (hx & ABS_MASK)|0; // asm type annotation
ahy = (hy & ABS_MASK)|0; // asm type annotation
// Extract the sign bits:
sx = (hx >>> HIGH_NUM_NONSIGN_BITS)|0; // asm type annotation
sy = (hy >>> HIGH_NUM_NONSIGN_BITS)|0; // asm type annotation
// Determine the sign of the result...
if ( sx && isOdd( y ) ) {
sx = -1.0;
} else {
sx = 1.0;
}
// Case 1: `|y|` is huge...
// |y| > 2^31
if ( ahy > HIGH_BIASED_EXP_31 ) {
// `|y| > 2^64`, then must over- or underflow...
if ( ahy > HIGH_BIASED_EXP_64 ) {
return yIsHuge( x, y );
}
// Over- or underflow if `x` is not close to unity...
if ( ahx < HIGH_MAX_NEAR_UNITY ) {
// y < 0
if ( sy === 1 ) {
// Signal overflow...
return sx * HUGE * HUGE;
}
// Signal underflow...
return sx * TINY * TINY;
}
if ( ahx > HIGH_BIASED_EXP_0 ) {
// y > 0
if ( sy === 0 ) {
// Signal overflow...
return sx * HUGE * HUGE;
}
// Signal underflow...
return sx * TINY * TINY;
}
// At this point, `|1-x|` is tiny (`<= 2^-20`). Suffice to compute `log(x)` by `x - x^2/2 + x^3/3 - x^4/4`.
t = logx( LOG_WORKSPACE, ax );
}
// Case 2: `|y|` is not huge...
else {
t = log2ax( LOG_WORKSPACE, ax, ahx );
}
// Split `y` into `y1 + y2` and compute `(y1+y2) * (t1+t2)`...
y1 = setLowWord( y, 0 );
lp = ( (y-y1)*t[0] ) + ( y*t[1] );
hp = y1 * t[0];
z = lp + hp;
// Note: *can* be more performant to use `getHighWord` and `getLowWord` directly, but using `toWords` looks cleaner.
toWords( WORDS, z );
j = uint32ToInt32( WORDS[0] );
i = uint32ToInt32( WORDS[1] );
// z >= 1024
if ( j >= HIGH_BIASED_EXP_10 ) {
// z > 1024
if ( ((j-HIGH_BIASED_EXP_10)|i) !== 0 ) {
// Signal overflow...
return sx * HUGE * HUGE;
}
if ( (lp+OVT) > (z-hp) ) {
// Signal overflow...
return sx * HUGE * HUGE;
}
}
// z <= -1075
else if ( (j&ABS_MASK) >= HIGH_1075 ) {
// z < -1075
if ( ((j-HIGH_NEG_1075)|i) !== 0 ) {
// signal underflow...
return sx * TINY * TINY;
}
if ( lp <= (z-hp) ) {
// signal underflow...
return sx * TINY * TINY;
}
}
// Compute `2^(hp+lp)`...
z = pow2( j, hp, lp );
return sx * z;
}
// EXPORTS //
module.exports = pow;
},{"./log2ax.js":292,"./logx.js":293,"./pow2.js":298,"./x_is_zero.js":299,"./y_is_huge.js":300,"./y_is_infinite.js":301,"@stdlib/constants/float64/ninf":248,"@stdlib/constants/float64/pinf":249,"@stdlib/math/base/assert/is-infinite":264,"@stdlib/math/base/assert/is-integer":266,"@stdlib/math/base/assert/is-nan":268,"@stdlib/math/base/assert/is-odd":270,"@stdlib/math/base/special/abs":274,"@stdlib/math/base/special/sqrt":304,"@stdlib/number/float64/base/set-low-word":324,"@stdlib/number/float64/base/to-words":327,"@stdlib/number/uint32/base/to-int32":331}],298:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The following copyright and license were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/s_pow.c}. The implementation follows the original, but has been modified for JavaScript.
*
* ```text
* Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ```
*/
'use strict';
// MODULES //
var getHighWord = require( '@stdlib/number/float64/base/get-high-word' );
var setHighWord = require( '@stdlib/number/float64/base/set-high-word' );
var setLowWord = require( '@stdlib/number/float64/base/set-low-word' );
var uint32ToInt32 = require( '@stdlib/number/uint32/base/to-int32' );
var ldexp = require( '@stdlib/math/base/special/ldexp' );
var LN2 = require( '@stdlib/constants/float64/ln-two' );
var BIAS = require( '@stdlib/constants/float64/exponent-bias' );
var polyvalP = require( './polyval_p.js' );
// VARIABLES //
// 0x7fffffff = 2147483647 => 0 11111111111 11111111111111111111
var ABS_MASK = 0x7fffffff|0; // asm type annotation
// 0x000fffff = 1048575 => 0 00000000000 11111111111111111111
var HIGH_SIGNIFICAND_MASK = 0x000fffff|0; // asm type annotation
// 0x00100000 = 1048576 => 0 00000000001 00000000000000000000 => biased exponent: 1 = -1022+1023 => 2^-1022
var HIGH_MIN_NORMAL_EXP = 0x00100000|0; // asm type annotation
// 0x3fe00000 = 1071644672 => 0 01111111110 00000000000000000000 => biased exponent: 1022 = -1+1023 => 2^-1
var HIGH_BIASED_EXP_NEG_1 = 0x3fe00000|0; // asm type annotation
// TODO: consider making into an external constant
var HIGH_NUM_SIGNIFICAND_BITS = 20|0; // asm type annotation
// High: LN2
var LN2_HI = 6.93147182464599609375e-01; // 0x3FE62E43, 0x00000000
// Low: LN2
var LN2_LO = -1.90465429995776804525e-09; // 0xBE205C61, 0x0CA86C39
// MAIN //
/**
* Computes \\(2^{\mathrm{hp} + \mathrm{lp}\\).
*
* @private
* @param {number} j - high word of `hp + lp`
* @param {number} hp - first power summand
* @param {number} lp - second power summand
* @returns {number} function value
*
* @example
* var z = pow2( 1065961648, -0.3398475646972656, -0.000002438187359100815 );
* // returns ~0.79
*/
function pow2( j, hp, lp ) {
var tmp;
var t1;
var t;
var r;
var u;
var v;
var w;
var z;
var n;
var i;
var k;
i = (j & ABS_MASK)|0; // asm type annotation
k = ((i>>HIGH_NUM_SIGNIFICAND_BITS) - BIAS)|0; // asm type annotation
n = 0;
// `|z| > 0.5`, set `n = z+0.5`
if ( i > HIGH_BIASED_EXP_NEG_1 ) {
n = (j + (HIGH_MIN_NORMAL_EXP>>(k+1)))>>>0; // asm type annotation
k = (((n & ABS_MASK)>>HIGH_NUM_SIGNIFICAND_BITS) - BIAS)|0; // new k for n
tmp = ((n & ~(HIGH_SIGNIFICAND_MASK >> k)))>>>0; // asm type annotation
t = setHighWord( 0.0, tmp );
n = (((n & HIGH_SIGNIFICAND_MASK)|HIGH_MIN_NORMAL_EXP) >> (HIGH_NUM_SIGNIFICAND_BITS-k))>>>0; // eslint-disable-line max-len
if ( j < 0 ) {
n = -n;
}
hp -= t;
}
t = lp + hp;
t = setLowWord( t, 0 );
u = t * LN2_HI;
v = ( (lp - (t-hp))*LN2 ) + ( t*LN2_LO );
z = u + v;
w = v - (z - u);
t = z * z;
t1 = z - ( t*polyvalP( t ) );
r = ( (z*t1) / (t1-2.0) ) - ( w + (z*w) );
z = 1.0 - (r - z);
j = getHighWord( z );
j = uint32ToInt32( j );
j += (n << HIGH_NUM_SIGNIFICAND_BITS)>>>0; // asm type annotation
// Check for subnormal output...
if ( (j>>HIGH_NUM_SIGNIFICAND_BITS) <= 0 ) {
z = ldexp( z, n );
} else {
z = setHighWord( z, j );
}
return z;
}
// EXPORTS //
module.exports = pow2;
},{"./polyval_p.js":295,"@stdlib/constants/float64/exponent-bias":237,"@stdlib/constants/float64/ln-two":240,"@stdlib/math/base/special/ldexp":284,"@stdlib/number/float64/base/get-high-word":316,"@stdlib/number/float64/base/set-high-word":322,"@stdlib/number/float64/base/set-low-word":324,"@stdlib/number/uint32/base/to-int32":331}],299:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The following copyright and license were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/s_pow.c}. The implementation follows the original, but has been modified for JavaScript.
*
* ```text
* Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ```
*/
'use strict';
// MODULES //
var isOdd = require( '@stdlib/math/base/assert/is-odd' );
var copysign = require( '@stdlib/math/base/special/copysign' );
var NINF = require( '@stdlib/constants/float64/ninf' );
var PINF = require( '@stdlib/constants/float64/pinf' );
// MAIN //
/**
* Evaluates the exponential function when \\(|x| = 0\\).
*
* @private
* @param {number} x - base
* @param {number} y - exponent
* @returns {number} function value
*
* @example
* var v = pow( 0.0, 2 );
* // returns 0.0
*
* @example
* var v = pow( -0.0, -9 );
* // returns -Infinity
*
* @example
* var v = pow( 0.0, -9 );
* // returns Infinity
*
* @example
* var v = pow( -0.0, 9 );
* // returns 0.0
*
* @example
* var v = pow( 0.0, -Infinity );
* // returns Infinity
*
* @example
* var v = pow( 0.0, Infinity );
* // returns 0.0
*/
function pow( x, y ) {
if ( y === NINF ) {
return PINF;
}
if ( y === PINF ) {
return 0.0;
}
if ( y > 0.0 ) {
if ( isOdd( y ) ) {
return x; // handles +-0
}
return 0.0;
}
// y < 0.0
if ( isOdd( y ) ) {
return copysign( PINF, x ); // handles +-0
}
return PINF;
}
// EXPORTS //
module.exports = pow;
},{"@stdlib/constants/float64/ninf":248,"@stdlib/constants/float64/pinf":249,"@stdlib/math/base/assert/is-odd":270,"@stdlib/math/base/special/copysign":277}],300:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The following copyright and license were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/s_pow.c}. The implementation follows the original, but has been modified for JavaScript.
*
* ```text
* Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ```
*/
'use strict';
// MODULES //
var getHighWord = require( '@stdlib/number/float64/base/get-high-word' );
// VARIABLES //
// 0x7fffffff = 2147483647 => 0 11111111111 11111111111111111111
var ABS_MASK = 0x7fffffff|0; // asm type annotation
// 0x3fefffff = 1072693247 => 0 01111111110 11111111111111111111 => biased exponent: 1022 = -1+1023 => 2^-1
var HIGH_MAX_NEAR_UNITY = 0x3fefffff|0; // asm type annotation
var HUGE = 1.0e300;
var TINY = 1.0e-300;
// MAIN //
/**
* Evaluates the exponential function when \\(|y| > 2^64\\).
*
* @private
* @param {number} x - base
* @param {number} y - exponent
* @returns {number} overflow or underflow result
*
* @example
* var v = pow( 9.0, 3.6893488147419103e19 );
* // returns Infinity
*
* @example
* var v = pow( -3.14, -3.6893488147419103e19 );
* // returns 0.0
*/
function pow( x, y ) {
var ahx;
var hx;
hx = getHighWord( x );
ahx = (hx & ABS_MASK);
if ( ahx <= HIGH_MAX_NEAR_UNITY ) {
if ( y < 0 ) {
// signal overflow...
return HUGE * HUGE;
}
// signal underflow...
return TINY * TINY;
}
// `x` has a biased exponent greater than or equal to `0`...
if ( y > 0 ) {
// signal overflow...
return HUGE * HUGE;
}
// signal underflow...
return TINY * TINY;
}
// EXPORTS //
module.exports = pow;
},{"@stdlib/number/float64/base/get-high-word":316}],301:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var abs = require( '@stdlib/math/base/special/abs' );
var PINF = require( '@stdlib/constants/float64/pinf' );
// MAIN //
/**
* Evaluates the exponential function when \\( y = \pm \infty\\).
*
* @private
* @param {number} x - base
* @param {number} y - exponent
* @returns {number} function value
*
* @example
* var v = pow( -1.0, Infinity );
* // returns NaN
*
* @example
* var v = pow( -1.0, -Infinity );
* // returns NaN
*
* @example
* var v = pow( 1.0, Infinity );
* // returns 1.0
*
* @example
* var v = pow( 1.0, -Infinity );
* // returns 1.0
*
* @example
* var v = pow( 0.5, Infinity );
* // returns 0.0
*
* @example
* var v = pow( 0.5, -Infinity );
* // returns Infinity
*
* @example
* var v = pow( 1.5, -Infinity );
* // returns 0.0
*
* @example
* var v = pow( 1.5, Infinity );
* // returns Infinity
*/
function pow( x, y ) {
if ( x === -1.0 ) {
// Julia (0.4.2) and Python (2.7.9) return `1.0` (WTF???). JavaScript (`Math.pow`), R, and libm return `NaN`. We choose `NaN`, as the value is indeterminate; i.e., we cannot determine whether `y` is odd, even, or somewhere in between.
return (x-x)/(x-x); // signal NaN
}
if ( x === 1.0 ) {
return 1.0;
}
// (|x| > 1 && y === NINF) || (|x| < 1 && y === PINF)
if ( (abs(x) < 1.0) === (y === PINF) ) {
return 0.0;
}
// (|x| > 1 && y === PINF) || (|x| < 1 && y === NINF)
return PINF;
}
// EXPORTS //
module.exports = pow;
},{"@stdlib/constants/float64/pinf":249,"@stdlib/math/base/special/abs":274}],302:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// TODO: implementation
/**
* Round a numeric value to the nearest integer.
*
* @module @stdlib/math/base/special/round
*
* @example
* var round = require( '@stdlib/math/base/special/round' );
*
* var v = round( -4.2 );
* // returns -4.0
*
* v = round( -4.5 );
* // returns -4.0
*
* v = round( -4.6 );
* // returns -5.0
*
* v = round( 9.99999 );
* // returns 10.0
*
* v = round( 9.5 );
* // returns 10.0
*
* v = round( 9.2 );
* // returns 9.0
*
* v = round( 0.0 );
* // returns 0.0
*
* v = round( -0.0 );
* // returns -0.0
*
* v = round( Infinity );
* // returns Infinity
*
* v = round( -Infinity );
* // returns -Infinity
*
* v = round( NaN );
* // returns NaN
*/
// MODULES //
var round = require( './round.js' );
// EXPORTS //
module.exports = round;
},{"./round.js":303}],303:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// TODO: implementation
/**
* Rounds a numeric value to the nearest integer.
*
* @param {number} x - input value
* @returns {number} function value
*
* @example
* var v = round( -4.2 );
* // returns -4.0
*
* @example
* var v = round( -4.5 );
* // returns -4.0
*
* @example
* var v = round( -4.6 );
* // returns -5.0
*
* @example
* var v = round( 9.99999 );
* // returns 10.0
*
* @example
* var v = round( 9.5 );
* // returns 10.0
*
* @example
* var v = round( 9.2 );
* // returns 9.0
*
* @example
* var v = round( 0.0 );
* // returns 0.0
*
* @example
* var v = round( -0.0 );
* // returns -0.0
*
* @example
* var v = round( Infinity );
* // returns Infinity
*
* @example
* var v = round( -Infinity );
* // returns -Infinity
*
* @example
* var v = round( NaN );
* // returns NaN
*/
var round = Math.round; // eslint-disable-line stdlib/no-builtin-math
// EXPORTS //
module.exports = round;
},{}],304:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Compute the principal square root of a double-precision floating-point number.
*
* @module @stdlib/math/base/special/sqrt
*
* @example
* var sqrt = require( '@stdlib/math/base/special/sqrt' );
*
* var v = sqrt( 4.0 );
* // returns 2.0
*
* v = sqrt( 9.0 );
* // returns 3.0
*
* v = sqrt( 0.0 );
* // returns 0.0
*
* v = sqrt( -4.0 );
* // returns NaN
*
* v = sqrt( NaN );
* // returns NaN
*/
// MODULES //
var sqrt = require( './main.js' );
// EXPORTS //
module.exports = sqrt;
},{"./main.js":305}],305:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Compute the principal square root of a double-precision floating-point number.
*
* @type {Function}
* @param {number} x - input value
* @returns {number} principal square root
*
* @example
* var v = sqrt( 4.0 );
* // returns 2.0
*
* v = sqrt( 9.0 );
* // returns 3.0
*
* v = sqrt( 0.0 );
* // returns 0.0
*
* v = sqrt( -4.0 );
* // returns NaN
*
* v = sqrt( NaN );
* // returns NaN
*/
var sqrt = Math.sqrt; // eslint-disable-line stdlib/no-builtin-math
// EXPORTS //
module.exports = sqrt;
},{}],306:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Perform C-like multiplication of two unsigned 32-bit integers.
*
* @module @stdlib/math/base/special/uimul
*
* @example
* var uimul = require( '@stdlib/math/base/special/uimul' );
*
* var v = uimul( 10>>>0, 4>>>0 );
* // returns 40
*/
// MODULES //
var uimul = require( './main.js' );
// EXPORTS //
module.exports = uimul;
},{"./main.js":307}],307:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// VARIABLES //
// Define a mask for the least significant 16 bits (low word): 65535 => 0x0000ffff => 00000000000000001111111111111111
var LOW_WORD_MASK = 0x0000ffff>>>0; // asm type annotation
// MAIN //
/**
* Performs C-like multiplication of two unsigned 32-bit integers.
*
* ## Method
*
* - To emulate C-like multiplication without the aid of 64-bit integers, we recognize that a 32-bit integer can be split into two 16-bit words
*
* ```tex
* a = w_h*2^{16} + w_l
* ```
*
* where \\( w_h \\) is the most significant 16 bits and \\( w_l \\) is the least significant 16 bits. For example, consider the maximum unsigned 32-bit integer \\( 2^{32}-1 \\)
*
* ```binarystring
* 11111111111111111111111111111111
* ```
*
* The 16-bit high word is then
*
* ```binarystring
* 1111111111111111
* ```
*
* and the 16-bit low word
*
* ```binarystring
* 1111111111111111
* ```
*
* If we cast the high word to 32-bit precision and multiply by \\( 2^{16} \\) (equivalent to a 16-bit left shift), then the bit sequence is
*
* ```binarystring
* 11111111111111110000000000000000
* ```
*
* Similarly, upon casting the low word to 32-bit precision, the bit sequence is
*
* ```binarystring
* 00000000000000001111111111111111
* ```
*
* From the rules of binary addition, we recognize that adding the two 32-bit values for the high and low words will return our original value \\( 2^{32}-1 \\).
*
* - Accordingly, the multiplication of two 32-bit integers can be expressed
*
* ```tex
* \begin{align*}
* a \cdot b &= ( a_h \cdot 2^{16} + a_l) \cdot ( b_h \cdot 2^{16} + b_l) \\
* &= a_l \cdot b_l + a_h \cdot b_l \cdot 2^{16} + a_l \cdot b_h \cdot 2^{16} + (a_h \cdot b_h) \cdot 2^{32} \\
* &= a_l \cdot b_l + (a_h \cdot b_l + a_l \cdot b_h) \cdot 2^{16} + (a_h \cdot b_h) \cdot 2^{32}
* \end{align*}
* ```
*
* - We note that multiplying (dividing) an integer by \\( 2^n \\) is equivalent to performing a left (right) shift of \\( n \\) bits.
*
* - Further, as we want to return an integer of the same precision, for a 32-bit integer, the return value will be modulo \\( 2^{32} \\). Stated another way, we only care about the low word of a 64-bit result.
*
* - Accordingly, the last term, being evenly divisible by \\( 2^{32} \\), drops from the equation leaving the remaining two terms as the remainder.
*
* ```tex
* a \cdot b = a_l \cdot b_l + (a_h \cdot b_l + a_l \cdot b_h) << 16
* ```
*
* - Lastly, the second term in the above equation contributes to the middle bits and may cause the product to "overflow". However, we can disregard (`>>>0`) overflow bits due modulo arithmetic, as discussed earlier with regard to the term involving the partial product of high words.
*
*
* @param {uinteger32} a - integer
* @param {uinteger32} b - integer
* @returns {uinteger32} product
*
* @example
* var v = uimul( 10>>>0, 4>>>0 );
* // returns 40
*/
function uimul( a, b ) {
var lbits;
var mbits;
var ha;
var hb;
var la;
var lb;
a >>>= 0; // asm type annotation
b >>>= 0; // asm type annotation
// Isolate the most significant 16-bits:
ha = ( a>>>16 )>>>0; // asm type annotation
hb = ( b>>>16 )>>>0; // asm type annotation
// Isolate the least significant 16-bits:
la = ( a&LOW_WORD_MASK )>>>0; // asm type annotation
lb = ( b&LOW_WORD_MASK )>>>0; // asm type annotation
// Compute partial sums:
lbits = ( la*lb )>>>0; // asm type annotation; no integer overflow possible
mbits = ( ((ha*lb) + (la*hb))<<16 )>>>0; // asm type annotation; possible integer overflow
// The final `>>>0` converts the intermediate sum to an unsigned integer (possible integer overflow during sum):
return ( lbits + mbits )>>>0; // asm type annotation
}
// EXPORTS //
module.exports = uimul;
},{}],308:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Constructor which returns a `Number` object.
*
* @module @stdlib/number/ctor
*
* @example
* var Number = require( '@stdlib/number/ctor' );
*
* var v = new Number( 10.0 );
* // returns <Number>
*/
// MODULES //
var Number = require( './number.js' );
// EXPORTS //
module.exports = Number;
},{"./number.js":309}],309:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// EXPORTS //
module.exports = Number; // eslint-disable-line stdlib/require-globals
},{}],310:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return an integer corresponding to the unbiased exponent of a double-precision floating-point number.
*
* @module @stdlib/number/float64/base/exponent
*
* @example
* var exponent = require( '@stdlib/number/float64/base/exponent' );
*
* var exp = exponent( 3.14e-307 ); // => 2**-1019 ~ 1e-307
* // returns -1019
*
* exp = exponent( -3.14 );
* // returns 1
*
* exp = exponent( 0.0 );
* // returns -1023
*
* exp = exponent( NaN );
* // returns 1024
*/
// MODULES //
var exponent = require( './main.js' );
// EXPORTS //
module.exports = exponent;
},{"./main.js":311}],311:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var getHighWord = require( '@stdlib/number/float64/base/get-high-word' );
var EXP_MASK = require( '@stdlib/constants/float64/high-word-exponent-mask' );
var BIAS = require( '@stdlib/constants/float64/exponent-bias' );
// MAIN //
/**
* Returns an integer corresponding to the unbiased exponent of a double-precision floating-point number.
*
* @param {number} x - input value
* @returns {integer32} unbiased exponent
*
* @example
* var exp = exponent( 3.14e-307 ); // => 2**-1019 ~ 1e-307
* // returns -1019
*
* @example
* var exp = exponent( -3.14 );
* // returns 1
*
* @example
* var exp = exponent( 0.0 );
* // returns -1023
*
* @example
* var exp = exponent( NaN );
* // returns 1024
*/
function exponent( x ) {
// Extract from the input value a higher order word (unsigned 32-bit integer) which contains the exponent:
var high = getHighWord( x );
// Apply a mask to isolate only the exponent bits and then shift off all bits which are part of the fraction:
high = ( high & EXP_MASK ) >>> 20;
// Remove the bias and return:
return (high - BIAS)|0; // asm type annotation
}
// EXPORTS //
module.exports = exponent;
},{"@stdlib/constants/float64/exponent-bias":237,"@stdlib/constants/float64/high-word-exponent-mask":238,"@stdlib/number/float64/base/get-high-word":316}],312:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Create a double-precision floating-point number from a higher order word (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).
*
* @module @stdlib/number/float64/base/from-words
*
* @example
* var fromWords = require( '@stdlib/number/float64/base/from-words' );
*
* var v = fromWords( 1774486211, 2479577218 );
* // returns 3.14e201
*
* v = fromWords( 3221823995, 1413754136 );
* // returns -3.141592653589793
*
* v = fromWords( 0, 0 );
* // returns 0.0
*
* v = fromWords( 2147483648, 0 );
* // returns -0.0
*
* v = fromWords( 2146959360, 0 );
* // returns NaN
*
* v = fromWords( 2146435072, 0 );
* // returns Infinity
*
* v = fromWords( 4293918720, 0 );
* // returns -Infinity
*/
// MODULES //
var fromWords = require( './main.js' );
// EXPORTS //
module.exports = fromWords;
},{"./main.js":314}],313:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isLittleEndian = require( '@stdlib/assert/is-little-endian' );
// MAIN //
var indices;
var HIGH;
var LOW;
if ( isLittleEndian === true ) {
HIGH = 1; // second index
LOW = 0; // first index
} else {
HIGH = 0; // first index
LOW = 1; // second index
}
indices = {
'HIGH': HIGH,
'LOW': LOW
};
// EXPORTS //
module.exports = indices;
},{"@stdlib/assert/is-little-endian":116}],314:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var Uint32Array = require( '@stdlib/array/uint32' );
var Float64Array = require( '@stdlib/array/float64' );
var indices = require( './indices.js' );
// VARIABLES //
var FLOAT64_VIEW = new Float64Array( 1 );
var UINT32_VIEW = new Uint32Array( FLOAT64_VIEW.buffer );
var HIGH = indices.HIGH;
var LOW = indices.LOW;
// MAIN //
/**
* Creates a double-precision floating-point number from a higher order word (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).
*
* ## Notes
*
* ```text
* float64 (64 bits)
* f := fraction (significand/mantissa) (52 bits)
* e := exponent (11 bits)
* s := sign bit (1 bit)
*
* |-------- -------- -------- -------- -------- -------- -------- --------|
* | Float64 |
* |-------- -------- -------- -------- -------- -------- -------- --------|
* | Uint32 | Uint32 |
* |-------- -------- -------- -------- -------- -------- -------- --------|
* ```
*
* If little endian (more significant bits last):
*
* ```text
* <-- lower higher -->
* | f7 f6 f5 f4 f3 f2 e2 | f1 |s| e1 |
* ```
*
* If big endian (more significant bits first):
*
* ```text
* <-- higher lower -->
* |s| e1 e2 | f1 f2 f3 f4 f5 f6 f7 |
* ```
*
*
* In which Uint32 should we place the higher order bits? If little endian, the second; if big endian, the first.
*
*
* ## References
*
* - [Open Group][1]
*
* [1]: http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm
*
* @param {uinteger32} high - higher order word (unsigned 32-bit integer)
* @param {uinteger32} low - lower order word (unsigned 32-bit integer)
* @returns {number} floating-point number
*
* @example
* var v = fromWords( 1774486211, 2479577218 );
* // returns 3.14e201
*
* @example
* var v = fromWords( 3221823995, 1413754136 );
* // returns -3.141592653589793
*
* @example
* var v = fromWords( 0, 0 );
* // returns 0.0
*
* @example
* var v = fromWords( 2147483648, 0 );
* // returns -0.0
*
* @example
* var v = fromWords( 2146959360, 0 );
* // returns NaN
*
* @example
* var v = fromWords( 2146435072, 0 );
* // returns Infinity
*
* @example
* var v = fromWords( 4293918720, 0 );
* // returns -Infinity
*/
function fromWords( high, low ) {
UINT32_VIEW[ HIGH ] = high;
UINT32_VIEW[ LOW ] = low;
return FLOAT64_VIEW[ 0 ];
}
// EXPORTS //
module.exports = fromWords;
},{"./indices.js":313,"@stdlib/array/float64":5,"@stdlib/array/uint32":23}],315:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isLittleEndian = require( '@stdlib/assert/is-little-endian' );
// MAIN //
var HIGH;
if ( isLittleEndian === true ) {
HIGH = 1; // second index
} else {
HIGH = 0; // first index
}
// EXPORTS //
module.exports = HIGH;
},{"@stdlib/assert/is-little-endian":116}],316:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return an unsigned 32-bit integer corresponding to the more significant 32 bits of a double-precision floating-point number.
*
* @module @stdlib/number/float64/base/get-high-word
*
* @example
* var getHighWord = require( '@stdlib/number/float64/base/get-high-word' );
*
* var w = getHighWord( 3.14e201 ); // => 01101001110001001000001011000011
* // returns 1774486211
*/
// MODULES //
var getHighWord = require( './main.js' );
// EXPORTS //
module.exports = getHighWord;
},{"./main.js":317}],317:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var Uint32Array = require( '@stdlib/array/uint32' );
var Float64Array = require( '@stdlib/array/float64' );
var HIGH = require( './high.js' );
// VARIABLES //
var FLOAT64_VIEW = new Float64Array( 1 );
var UINT32_VIEW = new Uint32Array( FLOAT64_VIEW.buffer );
// MAIN //
/**
* Returns an unsigned 32-bit integer corresponding to the more significant 32 bits of a double-precision floating-point number.
*
* ## Notes
*
* ```text
* float64 (64 bits)
* f := fraction (significand/mantissa) (52 bits)
* e := exponent (11 bits)
* s := sign bit (1 bit)
*
* |-------- -------- -------- -------- -------- -------- -------- --------|
* | Float64 |
* |-------- -------- -------- -------- -------- -------- -------- --------|
* | Uint32 | Uint32 |
* |-------- -------- -------- -------- -------- -------- -------- --------|
* ```
*
* If little endian (more significant bits last):
*
* ```text
* <-- lower higher -->
* | f7 f6 f5 f4 f3 f2 e2 | f1 |s| e1 |
* ```
*
* If big endian (more significant bits first):
*
* ```text
* <-- higher lower -->
* |s| e1 e2 | f1 f2 f3 f4 f5 f6 f7 |
* ```
*
* In which Uint32 can we find the higher order bits? If little endian, the second; if big endian, the first.
*
*
* ## References
*
* - [Open Group][1]
*
* [1]: http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm
*
* @param {number} x - input value
* @returns {uinteger32} higher order word
*
* @example
* var w = getHighWord( 3.14e201 ); // => 01101001110001001000001011000011
* // returns 1774486211
*/
function getHighWord( x ) {
FLOAT64_VIEW[ 0 ] = x;
return UINT32_VIEW[ HIGH ];
}
// EXPORTS //
module.exports = getHighWord;
},{"./high.js":315,"@stdlib/array/float64":5,"@stdlib/array/uint32":23}],318:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return a normal number `y` and exponent `exp` satisfying \\(x = y \cdot 2^\mathrm{exp}\\).
*
* @module @stdlib/number/float64/base/normalize
*
* @example
* var normalize = require( '@stdlib/number/float64/base/normalize' );
* var pow = require( '@stdlib/math/base/special/pow' );
*
* var out = normalize( 3.14e-319 );
* // returns [ 1.4141234400356668e-303, -52 ]
*
* var y = out[ 0 ];
* var exp = out[ 1 ];
*
* var bool = ( y*pow(2.0,exp) === 3.14e-319 );
* // returns true
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
* var normalize = require( '@stdlib/number/float64/base/normalize' );
*
* var out = new Float64Array( 2 );
*
* var v = normalize( out, 3.14e-319 );
* // returns <Float64Array>[ 1.4141234400356668e-303, -52 ]
*
* var bool = ( v === out );
* // returns true
*/
// MODULES //
var normalize = require( './main.js' );
// EXPORTS //
module.exports = normalize;
},{"./main.js":319}],319:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var fcn = require( './normalize.js' );
// MAIN //
/**
* Returns a normal number `y` and exponent `exp` satisfying \\(x = y \cdot 2^\mathrm{exp}\\).
*
* @param {(Array|TypedArray|Object)} [out] - output array
* @param {number} x - input value
* @returns {(Array|TypedArray|Object)} output array
*
* @example
* var pow = require( '@stdlib/math/base/special/pow' );
*
* var out = normalize( [ 0.0, 0 ], 3.14e-319 );
* // returns [ 1.4141234400356668e-303, -52 ]
*
* var y = out[ 0 ];
* var exp = out[ 1 ];
*
* var bool = ( y*pow(2.0,exp) === 3.14e-319 );
* // returns true
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
* var pow = require( '@stdlib/math/base/special/pow' );
*
* var out = new Float64Array( 2 );
*
* var v = normalize( out, 3.14e-319 );
* // returns <Float64Array>[ 1.4141234400356668e-303, -52 ]
*
* var bool = ( v === out );
* // returns true
*
* @example
* var out = normalize( [ 0.0, 0 ], 0.0 );
* // returns [ 0.0, 0 ]
*
* @example
* var out = normalize( [ 0.0, 0 ], Infinity );
* // returns [ Infinity, 0 ]
*
* @example
* var out = normalize( [ 0.0, 0 ], -Infinity );
* // returns [ -Infinity, 0 ]
*
* @example
* var out = normalize( [ 0.0, 0 ], NaN );
* // returns [ NaN, 0 ]
*/
function normalize( out, x ) {
if ( arguments.length === 1 ) {
return fcn( [ 0.0, 0 ], out );
}
return fcn( out, x );
}
// EXPORTS //
module.exports = normalize;
},{"./normalize.js":320}],320:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var FLOAT64_SMALLEST_NORMAL = require( '@stdlib/constants/float64/smallest-normal' );
var isInfinite = require( '@stdlib/math/base/assert/is-infinite' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var abs = require( '@stdlib/math/base/special/abs' );
// VARIABLES //
// (1<<52)
var SCALAR = 4503599627370496;
// MAIN //
/**
* Returns a normal number `y` and exponent `exp` satisfying \\(x = y \cdot 2^\mathrm{exp}\\).
*
* @private
* @param {(Array|TypedArray|Object)} out - output array
* @param {number} x - input value
* @returns {(Array|TypedArray|Object)} output array
*
* @example
* var pow = require( '@stdlib/math/base/special/pow' );
*
* var out = normalize( [ 0.0, 0 ], 3.14e-319 );
* // returns [ 1.4141234400356668e-303, -52 ]
*
* var y = out[ 0 ];
* var exp = out[ 1 ];
*
* var bool = ( y*pow(2.0,exp) === 3.14e-319 );
* // returns true
*
* @example
* var out = normalize( [ 0.0, 0 ], 0.0 );
* // returns [ 0.0, 0 ];
*
* @example
* var out = normalize( [ 0.0, 0 ], Infinity );
* // returns [ Infinity, 0 ]
*
* @example
* var out = normalize( [ 0.0, 0 ], -Infinity );
* // returns [ -Infinity, 0 ]
*
* @example
* var out = normalize( [ 0.0, 0 ], NaN );
* // returns [ NaN, 0 ]
*/
function normalize( out, x ) {
if ( isnan( x ) || isInfinite( x ) ) {
out[ 0 ] = x;
out[ 1 ] = 0;
return out;
}
if ( x !== 0.0 && abs( x ) < FLOAT64_SMALLEST_NORMAL ) {
out[ 0 ] = x * SCALAR;
out[ 1 ] = -52;
return out;
}
out[ 0 ] = x;
out[ 1 ] = 0;
return out;
}
// EXPORTS //
module.exports = normalize;
},{"@stdlib/constants/float64/smallest-normal":250,"@stdlib/math/base/assert/is-infinite":264,"@stdlib/math/base/assert/is-nan":268,"@stdlib/math/base/special/abs":274}],321:[function(require,module,exports){
arguments[4][315][0].apply(exports,arguments)
},{"@stdlib/assert/is-little-endian":116,"dup":315}],322:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Set the more significant 32 bits of a double-precision floating-point number.
*
* @module @stdlib/number/float64/base/set-high-word
*
* @example
* var setHighWord = require( '@stdlib/number/float64/base/set-high-word' );
*
* var high = 5 >>> 0; // => 0 00000000000 00000000000000000101
*
* var y = setHighWord( 3.14e201, high ); // => 0 00000000000 0000000000000000010110010011110010110101100010000010
* // returns 1.18350528745e-313
*
* @example
* var setHighWord = require( '@stdlib/number/float64/base/set-high-word' );
* var PINF = require( '@stdlib/constants/float64/pinf' ); // => 0 11111111111 00000000000000000000 00000000000000000000000000000000
*
* var high = 1072693248 >>> 0; // => 0 01111111111 00000000000000000000
*
* // Set the higher order bits of `+infinity` to return `1`:
* var y = setHighWord( PINF, high ); => 0 01111111111 0000000000000000000000000000000000000000000000000000
* // returns 1.0
*/
// MODULES //
var setHighWord = require( './main.js' );
// EXPORTS //
module.exports = setHighWord;
},{"./main.js":323}],323:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var Uint32Array = require( '@stdlib/array/uint32' );
var Float64Array = require( '@stdlib/array/float64' );
var HIGH = require( './high.js' );
// VARIABLES //
var FLOAT64_VIEW = new Float64Array( 1 );
var UINT32_VIEW = new Uint32Array( FLOAT64_VIEW.buffer );
// MAIN //
/**
* Sets the more significant 32 bits of a double-precision floating-point number.
*
* ## Notes
*
* ```text
* float64 (64 bits)
* f := fraction (significand/mantissa) (52 bits)
* e := exponent (11 bits)
* s := sign bit (1 bit)
*
* |-------- -------- -------- -------- -------- -------- -------- --------|
* | Float64 |
* |-------- -------- -------- -------- -------- -------- -------- --------|
* | Uint32 | Uint32 |
* |-------- -------- -------- -------- -------- -------- -------- --------|
* ```
*
* If little endian (more significant bits last):
*
* ```text
* <-- lower higher -->
* | f7 f6 f5 f4 f3 f2 e2 | f1 |s| e1 |
* ```
*
* If big endian (more significant bits first):
*
* ```text
* <-- higher lower -->
* |s| e1 e2 | f1 f2 f3 f4 f5 f6 f7 |
* ```
*
* In which Uint32 can we find the higher order bits? If little endian, the second; if big endian, the first.
*
*
* ## References
*
* - [Open Group][1]
*
* [1]: http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm
*
* @param {number} x - double
* @param {uinteger32} high - unsigned 32-bit integer to replace the higher order word of `x`
* @returns {number} double having the same lower order word as `x`
*
* @example
* var high = 5 >>> 0; // => 0 00000000000 00000000000000000101
*
* var y = setHighWord( 3.14e201, high ); // => 0 00000000000 0000000000000000010110010011110010110101100010000010
* // returns 1.18350528745e-313
*
* @example
* var PINF = require( '@stdlib/constants/float64/pinf' ); // => 0 11111111111 00000000000000000000 00000000000000000000000000000000
*
* var high = 1072693248 >>> 0; // => 0 01111111111 00000000000000000000
*
* // Set the higher order bits of `+infinity` to return `1`:
* var y = setHighWord( PINF, high ); // => 0 01111111111 0000000000000000000000000000000000000000000000000000
* // returns 1.0
*/
function setHighWord( x, high ) {
FLOAT64_VIEW[ 0 ] = x;
UINT32_VIEW[ HIGH ] = ( high >>> 0 ); // identity bit shift to ensure integer
return FLOAT64_VIEW[ 0 ];
}
// EXPORTS //
module.exports = setHighWord;
},{"./high.js":321,"@stdlib/array/float64":5,"@stdlib/array/uint32":23}],324:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Set the less significant 32 bits of a double-precision floating-point number.
*
* @module @stdlib/number/float64/base/set-low-word
*
* @example
* var setLowWord = require( '@stdlib/number/float64/base/set-low-word' );
*
* var low = 5 >>> 0; // => 00000000000000000000000000000101
*
* var x = 3.14e201; // => 0 11010011100 01001000001011000011 10010011110010110101100010000010
*
* var y = setLowWord( x, low ); // => 0 11010011100 01001000001011000011 00000000000000000000000000000101
* // returns 3.139998651394392e+201
*
* @example
* var setLowWord = require( '@stdlib/number/float64/base/set-low-word' );
* var PINF = require( '@stdlib/constants/float64/pinf' );
* var NINF = require( '@stdlib/constants/float64/ninf' );
*
* var low = 12345678;
*
* var y = setLowWord( PINF, low );
* // returns NaN
*
* y = setLowWord( NINF, low );
* // returns NaN
*
* y = setLowWord( NaN, low );
* // returns NaN
*/
// MODULES //
var setLowWord = require( './main.js' );
// EXPORTS //
module.exports = setLowWord;
},{"./main.js":326}],325:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isLittleEndian = require( '@stdlib/assert/is-little-endian' );
// MAIN //
var LOW;
if ( isLittleEndian === true ) {
LOW = 0; // first index
} else {
LOW = 1; // second index
}
// EXPORTS //
module.exports = LOW;
},{"@stdlib/assert/is-little-endian":116}],326:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var Uint32Array = require( '@stdlib/array/uint32' );
var Float64Array = require( '@stdlib/array/float64' );
var LOW = require( './low.js' );
// VARIABLES //
var FLOAT64_VIEW = new Float64Array( 1 );
var UINT32_VIEW = new Uint32Array( FLOAT64_VIEW.buffer );
// MAIN //
/**
* Sets the less significant 32 bits of a double-precision floating-point number.
*
* ## Notes
*
* ```text
* float64 (64 bits)
* f := fraction (significand/mantissa) (52 bits)
* e := exponent (11 bits)
* s := sign bit (1 bit)
*
* |-------- -------- -------- -------- -------- -------- -------- --------|
* | Float64 |
* |-------- -------- -------- -------- -------- -------- -------- --------|
* | Uint32 | Uint32 |
* |-------- -------- -------- -------- -------- -------- -------- --------|
* ```
*
* If little endian (more significant bits last):
*
* ```text
* <-- lower higher -->
* | f7 f6 f5 f4 f3 f2 e2 | f1 |s| e1 |
* ```
*
* If big endian (more significant bits first):
*
* ```text
* <-- higher lower -->
* |s| e1 e2 | f1 f2 f3 f4 f5 f6 f7 |
* ```
*
* In which Uint32 can we find the lower order bits? If little endian, the first; if big endian, the second.
*
*
* ## References
*
* - [Open Group][1]
*
* [1]: http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm
*
* @param {number} x - double
* @param {uinteger32} low - unsigned 32-bit integer to replace the lower order word of `x`
* @returns {number} double having the same higher order word as `x`
*
* @example
* var low = 5 >>> 0; // => 00000000000000000000000000000101
*
* var x = 3.14e201; // => 0 11010011100 01001000001011000011 10010011110010110101100010000010
*
* var y = setLowWord( x, low ); // => 0 11010011100 01001000001011000011 00000000000000000000000000000101
* // returns 3.139998651394392e+201
*
* @example
* var PINF = require( '@stdlib/constants/float64/pinf' );
* var NINF = require( '@stdlib/constants/float64/ninf' );
*
* var low = 12345678;
*
* var y = setLowWord( PINF, low );
* // returns NaN
*
* y = setLowWord( NINF, low );
* // returns NaN
*
* y = setLowWord( NaN, low );
* // returns NaN
*/
function setLowWord( x, low ) {
FLOAT64_VIEW[ 0 ] = x;
UINT32_VIEW[ LOW ] = ( low >>> 0 ); // identity bit shift to ensure integer
return FLOAT64_VIEW[ 0 ];
}
// EXPORTS //
module.exports = setLowWord;
},{"./low.js":325,"@stdlib/array/float64":5,"@stdlib/array/uint32":23}],327:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Split a double-precision floating-point number into a higher order word (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).
*
* @module @stdlib/number/float64/base/to-words
*
* @example
* var toWords = require( '@stdlib/number/float64/base/to-words' );
*
* var w = toWords( 3.14e201 );
* // returns [ 1774486211, 2479577218 ]
*
* @example
* var Uint32Array = require( '@stdlib/array/uint32' );
* var toWords = require( '@stdlib/number/float64/base/to-words' );
*
* var out = new Uint32Array( 2 );
*
* var w = toWords( out, 3.14e201 );
* // returns <Uint32Array>[ 1774486211, 2479577218 ]
*
* var bool = ( w === out );
* // returns true
*/
// MODULES //
var toWords = require( './main.js' );
// EXPORTS //
module.exports = toWords;
},{"./main.js":329}],328:[function(require,module,exports){
arguments[4][313][0].apply(exports,arguments)
},{"@stdlib/assert/is-little-endian":116,"dup":313}],329:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var fcn = require( './to_words.js' );
// MAIN //
/**
* Splits a double-precision floating-point number into a higher order word (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).
*
* @param {(Array|TypedArray|Object)} [out] - output array
* @param {number} x - input value
* @returns {(Array|TypedArray|Object)} output array
*
* @example
* var w = toWords( 3.14e201 );
* // returns [ 1774486211, 2479577218 ]
*
* @example
* var Uint32Array = require( '@stdlib/array/uint32' );
*
* var out = new Uint32Array( 2 );
*
* var w = toWords( out, 3.14e201 );
* // returns <Uint32Array>[ 1774486211, 2479577218 ]
*
* var bool = ( w === out );
* // returns true
*/
function toWords( out, x ) {
if ( arguments.length === 1 ) {
return fcn( [ 0, 0 ], out );
}
return fcn( out, x );
}
// EXPORTS //
module.exports = toWords;
},{"./to_words.js":330}],330:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var Uint32Array = require( '@stdlib/array/uint32' );
var Float64Array = require( '@stdlib/array/float64' );
var indices = require( './indices.js' );
// VARIABLES //
var FLOAT64_VIEW = new Float64Array( 1 );
var UINT32_VIEW = new Uint32Array( FLOAT64_VIEW.buffer );
var HIGH = indices.HIGH;
var LOW = indices.LOW;
// MAIN //
/**
* Splits a double-precision floating-point number into a higher order word (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).
*
* ## Notes
*
* ```text
* float64 (64 bits)
* f := fraction (significand/mantissa) (52 bits)
* e := exponent (11 bits)
* s := sign bit (1 bit)
*
* |-------- -------- -------- -------- -------- -------- -------- --------|
* | Float64 |
* |-------- -------- -------- -------- -------- -------- -------- --------|
* | Uint32 | Uint32 |
* |-------- -------- -------- -------- -------- -------- -------- --------|
* ```
*
* If little endian (more significant bits last):
*
* ```text
* <-- lower higher -->
* | f7 f6 f5 f4 f3 f2 e2 | f1 |s| e1 |
* ```
*
* If big endian (more significant bits first):
*
* ```text
* <-- higher lower -->
* |s| e1 e2 | f1 f2 f3 f4 f5 f6 f7 |
* ```
*
* In which Uint32 can we find the higher order bits? If little endian, the second; if big endian, the first.
*
*
* ## References
*
* - [Open Group][1]
*
* [1]: http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm
*
*
* @private
* @param {(Array|TypedArray|Object)} out - output array
* @param {number} x - input value
* @returns {(Array|TypedArray|Object)} output array
*
* @example
* var Uint32Array = require( '@stdlib/array/uint32' );
*
* var out = new Uint32Array( 2 );
*
* var w = toWords( out, 3.14e201 );
* // returns <Uint32Array>[ 1774486211, 2479577218 ]
*
* var bool = ( w === out );
* // returns true
*/
function toWords( out, x ) {
FLOAT64_VIEW[ 0 ] = x;
out[ 0 ] = UINT32_VIEW[ HIGH ];
out[ 1 ] = UINT32_VIEW[ LOW ];
return out;
}
// EXPORTS //
module.exports = toWords;
},{"./indices.js":328,"@stdlib/array/float64":5,"@stdlib/array/uint32":23}],331:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Convert an unsigned 32-bit integer to a signed 32-bit integer.
*
* @module @stdlib/number/uint32/base/to-int32
*
* @example
* var float64ToUint32 = require( '@stdlib/number/float64/base/to-uint32' );
* var uint32ToInt32 = require( '@stdlib/number/uint32/base/to-int32' );
*
* var y = uint32ToInt32( float64ToUint32( 4294967295 ) );
* // returns -1
*
* y = uint32ToInt32( float64ToUint32( 3 ) );
* // returns 3
*/
// MODULES //
var uint32ToInt32 = require( './main.js' );
// EXPORTS //
module.exports = uint32ToInt32;
},{"./main.js":332}],332:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Converts an unsigned 32-bit integer to a signed 32-bit integer.
*
* @param {uinteger32} x - unsigned 32-bit integer
* @returns {integer32} signed 32-bit integer
*
* @example
* var float64ToUint32 = require( '@stdlib/number/float64/base/to-uint32' );
* var y = uint32ToInt32( float64ToUint32( 4294967295 ) );
* // returns -1
*
* @example
* var float64ToUint32 = require( '@stdlib/number/float64/base/to-uint32' );
* var y = uint32ToInt32( float64ToUint32( 3 ) );
* // returns 3
*/
function uint32ToInt32( x ) {
// NOTE: we could also use typed-arrays to achieve the same end.
return x|0; // asm type annotation
}
// EXPORTS //
module.exports = uint32ToInt32;
},{}],333:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isnan = require( '@stdlib/math/base/assert/is-nan' );
// VARIABLES //
var NUM_WARMUPS = 8;
// MAIN //
/**
* Initializes a shuffle table.
*
* @private
* @param {PRNG} rand - pseudorandom number generator
* @param {Int32Array} table - table
* @param {PositiveInteger} N - table size
* @throws {Error} PRNG returned `NaN`
* @returns {NumberArray} shuffle table
*/
function createTable( rand, table, N ) {
var v;
var i;
// "warm-up" the PRNG...
for ( i = 0; i < NUM_WARMUPS; i++ ) {
v = rand();
// Prevent the above loop from being discarded by the compiler...
if ( isnan( v ) ) {
throw new Error( 'unexpected error. PRNG returned `NaN`.' );
}
}
// Initialize the shuffle table...
for ( i = N-1; i >= 0; i-- ) {
table[ i ] = rand();
}
return table;
}
// EXPORTS //
module.exports = createTable;
},{"@stdlib/math/base/assert/is-nan":268}],334:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable max-len */
'use strict';
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );
var setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isObject = require( '@stdlib/assert/is-plain-object' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isCollection = require( '@stdlib/assert/is-collection' );
var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
var isInt32Array = require( '@stdlib/assert/is-int32array' );
var gcopy = require( '@stdlib/blas/base/gcopy' );
var floor = require( '@stdlib/math/base/special/floor' );
var Int32Array = require( '@stdlib/array/int32' );
var INT32_MAX = require( '@stdlib/constants/int32/max' );
var typedarray2json = require( '@stdlib/array/to-json' );
var createTable = require( './create_table.js' );
var randint32 = require( './rand_int32.js' );
// VARIABLES //
var NORMALIZATION_CONSTANT = (INT32_MAX - 1)|0; // asm type annotation
var MAX_SEED = (INT32_MAX - 1)|0; // asm type annotation
var A = 16807|0; // asm type annotation
// Define the number of elements in the shuffle table:
var TABLE_LENGTH = 32;
// Define the state array schema version:
var STATE_ARRAY_VERSION = 1; // NOTE: anytime the state array schema changes, this value should be incremented!!!
// Define the number of sections in the state array:
var NUM_STATE_SECTIONS = 3; // table, other, seed
// Define the index offset of the "table" section in the state array:
var TABLE_SECTION_OFFSET = 2; // | version | num_sections | table_length | ...table | other_length | shuffle_state | prng_state | seed_length | ...seed |
// Define the index offset of the "state" section in the state array:
var STATE_SECTION_OFFSET = TABLE_LENGTH + 3; // | version | num_sections | table_length | ...table | state_length | shuffle_state | prng_state | seed_length | ...seed |
// Define the index offset of the seed section in the state array:
var SEED_SECTION_OFFSET = TABLE_LENGTH + 6; // | version | num_sections | table_length | ...table | state_length | shuffle_state | prng_state | seed_length | ...seed |
// Define the length of the "fixed" length portion of the state array:
var STATE_FIXED_LENGTH = TABLE_LENGTH + 7; // 1 (version) + 1 (num_sections) + 1 (table_length) + TABLE_LENGTH (table) + 1 (state_length) + 1 (shuffle_state) + 1 (prng_state) + 1 (seed_length)
// Define the indices for the shuffle table and PRNG states:
var SHUFFLE_STATE = STATE_SECTION_OFFSET + 1;
var PRNG_STATE = STATE_SECTION_OFFSET + 2;
// FUNCTIONS //
/**
* Verifies state array integrity.
*
* @private
* @param {Int32Array} state - state array
* @param {boolean} FLG - flag indicating whether the state array was provided as an option (true) or an argument (false)
* @returns {(Error|null)} an error or `null`
*/
function verifyState( state, FLG ) {
var s1;
if ( FLG ) {
s1 = 'option';
} else {
s1 = 'argument';
}
// The state array must have a minimum length...
if ( state.length < STATE_FIXED_LENGTH+1 ) {
return new RangeError( 'invalid '+s1+'. `state` array has insufficient length.' );
}
// The first element of the state array must equal the supported state array schema version...
if ( state[ 0 ] !== STATE_ARRAY_VERSION ) {
return new RangeError( 'invalid '+s1+'. `state` array has an incompatible schema version. Expected: '+STATE_ARRAY_VERSION+'. Actual: '+state[ 0 ]+'.' );
}
// The second element of the state array must contain the number of sections...
if ( state[ 1 ] !== NUM_STATE_SECTIONS ) {
return new RangeError( 'invalid '+s1+'. `state` array has an incompatible number of sections. Expected: '+NUM_STATE_SECTIONS+'. Actual: '+state[ 1 ]+'.' );
}
// The length of the "table" section must equal `TABLE_LENGTH`...
if ( state[ TABLE_SECTION_OFFSET ] !== TABLE_LENGTH ) {
return new RangeError( 'invalid '+s1+'. `state` array has an incompatible table length. Expected: '+TABLE_LENGTH+'. Actual: '+state[ TABLE_SECTION_OFFSET ]+'.' );
}
// The length of the "state" section must equal `2`...
if ( state[ STATE_SECTION_OFFSET ] !== 2 ) {
return new RangeError( 'invalid '+s1+'. `state` array has an incompatible state length. Expected: '+(2).toString()+'. Actual: '+state[ STATE_SECTION_OFFSET ]+'.' );
}
// The length of the "seed" section much match the empirical length...
if ( state[ SEED_SECTION_OFFSET ] !== state.length-STATE_FIXED_LENGTH ) {
return new RangeError( 'invalid '+s1+'. `state` array length is incompatible with seed section length. Expected: '+(state.length-STATE_FIXED_LENGTH)+'. Actual: '+state[ SEED_SECTION_OFFSET ]+'.' );
}
return null;
}
// MAIN //
/**
* Returns a linear congruential pseudorandom number generator (LCG) whose output is shuffled.
*
* @param {Options} [options] - options
* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed
* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state
* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state
* @throws {TypeError} options argument must be an object
* @throws {TypeError} a seed must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integers less than the maximum signed 32-bit integer
* @throws {RangeError} a numeric seed must be a positive integer less than the maximum signed 32-bit integer
* @throws {TypeError} state must be an `Int32Array`
* @throws {Error} must provide a valid state
* @throws {TypeError} `copy` option must be a boolean
* @returns {PRNG} shuffled LCG PRNG
*
* @example
* var minstd = factory();
*
* var v = minstd();
* // returns <number>
*
* @example
* // Return a seeded LCG:
* var minstd = factory({
* 'seed': 1234
* });
*
* var v = minstd();
* // returns 1421600654
*/
function factory( options ) {
var STATE;
var state;
var opts;
var seed;
var slen;
var err;
opts = {};
if ( arguments.length ) {
if ( !isObject( options ) ) {
throw new TypeError( 'invalid argument. Options argument must be an object. Value: `' + options + '`.' );
}
if ( hasOwnProp( options, 'copy' ) ) {
opts.copy = options.copy;
if ( !isBoolean( options.copy ) ) {
throw new TypeError( 'invalid option. `copy` option must be a boolean. Option: `' + options.copy + '`.' );
}
}
if ( hasOwnProp( options, 'state' ) ) {
state = options.state;
opts.state = true;
if ( !isInt32Array( state ) ) {
throw new TypeError( 'invalid option. `state` option must be an Int32Array. Option: `' + state + '`.' );
}
err = verifyState( state, true );
if ( err ) {
throw err;
}
if ( opts.copy === false ) {
STATE = state;
} else {
STATE = new Int32Array( state.length );
gcopy( state.length, state, 1, STATE, 1 );
}
// Create a state (table) "view":
state = new Int32Array( STATE.buffer, STATE.byteOffset+((TABLE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), TABLE_LENGTH );
// Create a seed "view":
seed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), state[ SEED_SECTION_OFFSET ] );
}
// If provided a PRNG state, we ignore the `seed` option...
if ( seed === void 0 ) {
if ( hasOwnProp( options, 'seed' ) ) {
seed = options.seed;
opts.seed = true;
if ( isPositiveInteger( seed ) ) {
if ( seed > MAX_SEED ) {
throw new RangeError( 'invalid option. `seed` option must be a positive integer less than the maximum signed 32-bit integer. Option: `' + seed + '`.' );
}
seed |= 0; // asm type annotation
} else if ( isCollection( seed ) && seed.length > 0 ) {
slen = seed.length;
STATE = new Int32Array( STATE_FIXED_LENGTH+slen );
// Initialize sections:
STATE[ 0 ] = STATE_ARRAY_VERSION;
STATE[ 1 ] = NUM_STATE_SECTIONS;
STATE[ TABLE_SECTION_OFFSET ] = TABLE_LENGTH;
STATE[ STATE_SECTION_OFFSET ] = 2;
STATE[ PRNG_STATE ] = seed[ 0 ];
STATE[ SEED_SECTION_OFFSET ] = slen;
// Copy the provided seed array to prevent external mutation, as mutation would lead to an inability to reproduce PRNG values according to the PRNG's stated seed:
gcopy.ndarray( slen, seed, 1, 0, STATE, 1, SEED_SECTION_OFFSET+1 );
// Create a state (table) "view":
state = new Int32Array( STATE.buffer, STATE.byteOffset+((TABLE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), TABLE_LENGTH );
// Create a seed "view":
seed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), slen );
// Initialize the internal PRNG state:
state = createTable( minstd, state, TABLE_LENGTH );
STATE[ SHUFFLE_STATE ] = state[ 0 ];
} else {
throw new TypeError( 'invalid option. `seed` option must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integer values less than the maximum signed 32-bit integer. Option: `' + seed + '`.' );
}
} else {
seed = randint32()|0; // asm type annotation
}
}
} else {
seed = randint32()|0; // asm type annotation
}
if ( state === void 0 ) {
STATE = new Int32Array( STATE_FIXED_LENGTH+1 );
// Initialize sections:
STATE[ 0 ] = STATE_ARRAY_VERSION;
STATE[ 1 ] = NUM_STATE_SECTIONS;
STATE[ TABLE_SECTION_OFFSET ] = TABLE_LENGTH;
STATE[ STATE_SECTION_OFFSET ] = 2;
STATE[ PRNG_STATE ] = seed;
STATE[ SEED_SECTION_OFFSET ] = 1;
STATE[ SEED_SECTION_OFFSET+1 ] = seed;
// Create a state (table) "view":
state = new Int32Array( STATE.buffer, STATE.byteOffset+((TABLE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), TABLE_LENGTH );
// Create a seed "view":
seed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );
// Initialize the internal PRNG state:
state = createTable( minstd, state, TABLE_LENGTH );
STATE[ SHUFFLE_STATE ] = state[ 0 ];
}
setReadOnly( minstdShuffle, 'NAME', 'minstd-shuffle' );
setReadOnlyAccessor( minstdShuffle, 'seed', getSeed );
setReadOnlyAccessor( minstdShuffle, 'seedLength', getSeedLength );
setReadWriteAccessor( minstdShuffle, 'state', getState, setState );
setReadOnlyAccessor( minstdShuffle, 'stateLength', getStateLength );
setReadOnlyAccessor( minstdShuffle, 'byteLength', getStateSize );
setReadOnly( minstdShuffle, 'toJSON', toJSON );
setReadOnly( minstdShuffle, 'MIN', 1 );
setReadOnly( minstdShuffle, 'MAX', INT32_MAX-1 );
setReadOnly( minstdShuffle, 'normalized', normalized );
setReadOnly( normalized, 'NAME', minstdShuffle.NAME );
setReadOnlyAccessor( normalized, 'seed', getSeed );
setReadOnlyAccessor( normalized, 'seedLength', getSeedLength );
setReadWriteAccessor( normalized, 'state', getState, setState );
setReadOnlyAccessor( normalized, 'stateLength', getStateLength );
setReadOnlyAccessor( normalized, 'byteLength', getStateSize );
setReadOnly( normalized, 'toJSON', toJSON );
setReadOnly( normalized, 'MIN', (minstdShuffle.MIN-1.0) / NORMALIZATION_CONSTANT );
setReadOnly( normalized, 'MAX', (minstdShuffle.MAX-1.0) / NORMALIZATION_CONSTANT );
return minstdShuffle;
/**
* Returns the PRNG seed.
*
* @private
* @returns {PRNGSeedMINSTD} seed
*/
function getSeed() {
var len = STATE[ SEED_SECTION_OFFSET ];
return gcopy( len, seed, 1, new Int32Array( len ), 1 );
}
/**
* Returns the PRNG seed length.
*
* @private
* @returns {PositiveInteger} seed length
*/
function getSeedLength() {
return STATE[ SEED_SECTION_OFFSET ];
}
/**
* Returns the PRNG state length.
*
* @private
* @returns {PositiveInteger} state length
*/
function getStateLength() {
return STATE.length;
}
/**
* Returns the PRNG state size (in bytes).
*
* @private
* @returns {PositiveInteger} state size (in bytes)
*/
function getStateSize() {
return STATE.byteLength;
}
/**
* Returns the current PRNG state.
*
* ## Notes
*
* - The PRNG state array is comprised of a preamble followed by `3` sections:
*
* 0. preamble (version + number of sections)
* 1. shuffle table
* 2. internal PRNG state
* 3. PRNG seed
*
* - The first element of the PRNG state array preamble is the state array schema version.
*
* - The second element of the PRNG state array preamble is the number of state array sections (i.e., `3`).
*
* - The first element of each section following the preamble specifies the section length. The remaining section elements comprise the section contents.
*
* @private
* @returns {PRNGStateMINSTD} current state
*/
function getState() {
var len = STATE.length;
return gcopy( len, STATE, 1, new Int32Array( len ), 1 );
}
/**
* Sets the PRNG state.
*
* ## Notes
*
* - If PRNG state is "shared" (meaning a state array was provided during PRNG creation and **not** copied) and one sets the generator state to a state array having a different length, the PRNG does **not** update the existing shared state and, instead, points to the newly provided state array. In order to synchronize PRNG output according to the new shared state array, the state array for **each** relevant PRNG must be **explicitly** set.
* - If PRNG state is "shared" and one sets the generator state to a state array of the same length, the PRNG state is updated (along with the state of all other PRNGs sharing the PRNG's state array).
*
* @private
* @param {PRNGStateMINSTD} s - generator state
* @throws {TypeError} must provide an `Int32Array`
* @throws {Error} must provide a valid state
*/
function setState( s ) {
var err;
if ( !isInt32Array( s ) ) {
throw new TypeError( 'invalid argument. Must provide an Int32Array. Value: `' + s + '`.' );
}
err = verifyState( s, false );
if ( err ) {
throw err;
}
if ( opts.copy === false ) {
if ( opts.state && s.length === STATE.length ) {
gcopy( s.length, s, 1, STATE, 1 ); // update current shared state
} else {
STATE = s; // point to new shared state
opts.state = true; // setting this flag allows updating a shared state even if a state array was not provided at PRNG creation
}
} else {
// Check if we can reuse allocated memory...
if ( s.length !== STATE.length ) {
STATE = new Int32Array( s.length ); // reallocate
}
gcopy( s.length, s, 1, STATE, 1 );
}
// Create a new state (table) "view":
state = new Int32Array( STATE.buffer, STATE.byteOffset+((TABLE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), TABLE_LENGTH );
// Create a new seed "view":
seed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), STATE[ SEED_SECTION_OFFSET ] );
}
/**
* Serializes the pseudorandom number generator as a JSON object.
*
* ## Notes
*
* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.
*
* @private
* @returns {Object} JSON representation
*/
function toJSON() {
var out = {};
out.type = 'PRNG';
out.name = minstdShuffle.NAME;
out.state = typedarray2json( STATE );
out.params = [];
return out;
}
/**
* Generates a pseudorandom integer on the interval \\( [1,2^{31}-1) \\).
*
* @private
* @returns {integer32} pseudorandom integer
*/
function minstd() {
var s = STATE[ PRNG_STATE ]|0; // asm type annotation
s = ( (A*s)%INT32_MAX )|0; // asm type annotation
STATE[ PRNG_STATE ] = s;
return s|0; // asm type annotation
}
/**
* Generates a pseudorandom integer on the interval \\( [1,2^{31}-1) \\).
*
* @private
* @returns {integer32} pseudorandom integer
*
* @example
* var v = minstd();
* // returns <number>
*/
function minstdShuffle() {
var s;
var i;
s = STATE[ SHUFFLE_STATE ];
i = floor( TABLE_LENGTH * (s/INT32_MAX) );
// Pull a state from the table:
s = state[ i ];
// Update the PRNG state:
STATE[ SHUFFLE_STATE ] = s;
// Replace the pulled state:
state[ i ] = minstd();
return s;
}
/**
* Generates a pseudorandom number on the interval \\( [0,1) \\).
*
* @private
* @returns {number} pseudorandom number
*
* @example
* var v = normalized();
* // returns <number>
*/
function normalized() {
return (minstdShuffle()-1) / NORMALIZATION_CONSTANT;
}
}
// EXPORTS //
module.exports = factory;
},{"./create_table.js":333,"./rand_int32.js":337,"@stdlib/array/int32":10,"@stdlib/array/to-json":17,"@stdlib/assert/has-own-property":53,"@stdlib/assert/is-boolean":81,"@stdlib/assert/is-collection":90,"@stdlib/assert/is-int32array":106,"@stdlib/assert/is-plain-object":147,"@stdlib/assert/is-positive-integer":149,"@stdlib/blas/base/gcopy":225,"@stdlib/constants/int32/max":253,"@stdlib/math/base/special/floor":278,"@stdlib/utils/define-nonenumerable-read-only-accessor":389,"@stdlib/utils/define-nonenumerable-read-only-property":391,"@stdlib/utils/define-nonenumerable-read-write-accessor":393}],335:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* A linear congruential pseudorandom number generator (LCG) whose output is shuffled.
*
* @module @stdlib/random/base/minstd-shuffle
*
* @example
* var minstd = require( '@stdlib/random/base/minstd-shuffle' );
*
* var v = minstd();
* // returns <number>
*
* @example
* var factory = require( '@stdlib/random/base/minstd-shuffle' ).factory;
*
* var minstd = factory({
* 'seed': 1234
* });
*
* var v = minstd();
* // returns 1421600654
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var minstd = require( './main.js' );
var factory = require( './factory.js' );
// MAIN //
setReadOnly( minstd, 'factory', factory );
// EXPORTS //
module.exports = minstd;
},{"./factory.js":334,"./main.js":336,"@stdlib/utils/define-nonenumerable-read-only-property":391}],336:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var factory = require( './factory.js' );
var randint32 = require( './rand_int32.js' );
// MAIN //
/**
* Generates a pseudorandom integer on the interval \\( [1,2^{31}-1) \\).
*
* ## Method
*
* Linear congruential generators (LCGs) use the recurrence relation
*
* ```tex
* X_{n+1} = ( a \cdot X_n + c ) \operatorname{mod}(m)
* ```
*
* where the modulus \\( m \\) is a prime number or power of a prime number and \\( a \\) is a primitive root modulo \\( m \\).
*
* <!-- <note> -->
*
* For an LCG to be a Lehmer RNG, the seed \\( X_0 \\) must be coprime to \\( m \\).
*
* <!-- </note> -->
*
* In this implementation, the constants \\( a \\), \\( c \\), and \\( m \\) have the values
*
* ```tex
* \begin{align*}
* a &= 7^5 = 16807 \\
* c &= 0 \\
* m &= 2^{31} - 1 = 2147483647
* \end{align*}
* ```
*
* <!-- <note> -->
*
* The constant \\( m \\) is a Mersenne prime (modulo \\(31\\)).
*
* <!-- </note> -->
*
* <!-- <note> -->
*
* The constant \\( a \\) is a primitive root (modulo \\(31\\)).
*
* <!-- </note> -->
*
* Accordingly, the maximum possible product is
*
* ```tex
* 16807 \cdot (m - 1) \approx 2^{46}
* ```
*
* The values for \\( a \\), \\( c \\), and \\( m \\) are taken from Park and Miller, "Random Number Generators: Good Ones Are Hard To Find". Park's and Miller's article is also the basis for a recipe in the second edition of _Numerical Recipes in C_.
*
* This implementation subsequently shuffles the output of a linear congruential pseudorandom number generator (LCG) using a shuffle table in accordance with the Bays-Durham algorithm.
*
*
* ## Notes
*
* - The generator has a period of approximately \\(2.1\mbox{e}9\\) (see [Numerical Recipes in C, 2nd Edition](#references), p. 279).
*
*
* ## References
*
* - Bays, Carter, and S. D. Durham. 1976. "Improving a Poor Random Number Generator." _ACM Transactions on Mathematical Software_ 2 (1). New York, NY, USA: ACM: 59–64. doi:[10.1145/355666.355670](http://dx.doi.org/10.1145/355666.355670).
* - Herzog, T.N., and G. Lord. 2002. _Applications of Monte Carlo Methods to Finance and Insurance_. ACTEX Publications. [https://books.google.com/books?id=vC7I\\\_gdX-A0C](https://books.google.com/books?id=vC7I\_gdX-A0C).
* - Press, William H., Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. 1992. _Numerical Recipes in C: The Art of Scientific Computing, Second Edition_. Cambridge University Press.
*
*
* @function minstd
* @type {PRNG}
* @returns {PositiveInteger} pseudorandom integer
*
* @example
* var v = minstd();
* // returns <number>
*/
var minstd = factory({
'seed': randint32()
});
// EXPORTS //
module.exports = minstd;
},{"./factory.js":334,"./rand_int32.js":337}],337:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var INT32_MAX = require( '@stdlib/constants/int32/max' );
var floor = require( '@stdlib/math/base/special/floor' );
// VARIABLES //
var MAX = INT32_MAX - 1;
// MAIN //
/**
* Returns a pseudorandom integer on the interval \\([1, 2^{31}-1)\\).
*
* @private
* @returns {PositiveInteger} pseudorandom integer
*
* @example
* var v = randint32();
* // returns <number>
*/
function randint32() {
var v = floor( 1.0 + (MAX*Math.random()) ); // eslint-disable-line stdlib/no-builtin-math
return v|0; // asm type annotation
}
// EXPORTS //
module.exports = randint32;
},{"@stdlib/constants/int32/max":253,"@stdlib/math/base/special/floor":278}],338:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable max-len */
'use strict';
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );
var setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isObject = require( '@stdlib/assert/is-plain-object' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isCollection = require( '@stdlib/assert/is-collection' );
var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
var isInt32Array = require( '@stdlib/assert/is-int32array' );
var INT32_MAX = require( '@stdlib/constants/int32/max' );
var Int32Array = require( '@stdlib/array/int32' );
var gcopy = require( '@stdlib/blas/base/gcopy' );
var typedarray2json = require( '@stdlib/array/to-json' );
var randint32 = require( './rand_int32.js' );
// VARIABLES //
var NORMALIZATION_CONSTANT = (INT32_MAX - 1)|0; // asm type annotation
var MAX_SEED = (INT32_MAX - 1)|0; // asm type annotation
var A = 16807|0; // asm type annotation
// Define the state array schema version:
var STATE_ARRAY_VERSION = 1; // NOTE: anytime the state array schema changes, this value should be incremented!!!
// Define the number of sections in the state array:
var NUM_STATE_SECTIONS = 2; // state, seed
// Define the index offset of the "state" section in the state array:
var STATE_SECTION_OFFSET = 2; // | version | num_sections | state_length | ...state | seed_length | ...seed |
// Define the index offset of the seed section in the state array:
var SEED_SECTION_OFFSET = 4; // | version | num_sections | state_length | ...state | seed_length | ...seed |
// Define the length of the "fixed" length portion of the state array:
var STATE_FIXED_LENGTH = 5; // 1 (version) + 1 (num_sections) + 1 (state_length) + 1 (state) + 1 (seed_length)
// FUNCTIONS //
/**
* Verifies state array integrity.
*
* @private
* @param {Int32Array} state - state array
* @param {boolean} FLG - flag indicating whether the state array was provided as an option (true) or an argument (false)
* @returns {(Error|null)} an error or `null`
*/
function verifyState( state, FLG ) {
var s1;
if ( FLG ) {
s1 = 'option';
} else {
s1 = 'argument';
}
// The state array must have a minimum length...
if ( state.length < STATE_FIXED_LENGTH+1 ) {
return new RangeError( 'invalid '+s1+'. `state` array has insufficient length.' );
}
// The first element of the state array must equal the supported state array schema version...
if ( state[ 0 ] !== STATE_ARRAY_VERSION ) {
return new RangeError( 'invalid '+s1+'. `state` array has an incompatible schema version. Expected: '+STATE_ARRAY_VERSION+'. Actual: '+state[ 0 ]+'.' );
}
// The second element of the state array must contain the number of sections...
if ( state[ 1 ] !== NUM_STATE_SECTIONS ) {
return new RangeError( 'invalid '+s1+'. `state` array has an incompatible number of sections. Expected: '+NUM_STATE_SECTIONS+'. Actual: '+state[ 1 ]+'.' );
}
// The length of the "state" section must equal `1`...
if ( state[ STATE_SECTION_OFFSET ] !== 1 ) {
return new RangeError( 'invalid '+s1+'. `state` array has an incompatible state length. Expected: '+(1).toString()+'. Actual: '+state[ STATE_SECTION_OFFSET ]+'.' );
}
// The length of the "seed" section much match the empirical length...
if ( state[ SEED_SECTION_OFFSET ] !== state.length-STATE_FIXED_LENGTH ) {
return new RangeError( 'invalid '+s1+'. `state` array length is incompatible with seed section length. Expected: '+(state.length-STATE_FIXED_LENGTH)+'. Actual: '+state[ SEED_SECTION_OFFSET ]+'.' );
}
return null;
}
// MAIN //
/**
* Returns a linear congruential pseudorandom number generator (LCG) based on Park and Miller.
*
* @param {Options} [options] - options
* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed
* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state
* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state
* @throws {TypeError} options argument must be an object
* @throws {TypeError} a seed must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integers less than the maximum signed 32-bit integer
* @throws {RangeError} a numeric seed must be a positive integer less than the maximum signed 32-bit integer
* @throws {TypeError} state must be an `Int32Array`
* @throws {Error} must provide a valid state
* @throws {TypeError} `copy` option must be a boolean
* @returns {PRNG} LCG PRNG
*
* @example
* var minstd = factory();
*
* var v = minstd();
* // returns <number>
*
* @example
* // Return a seeded LCG:
* var minstd = factory({
* 'seed': 1234
* });
*
* var v = minstd();
* // returns 20739838
*/
function factory( options ) {
var STATE;
var state;
var opts;
var seed;
var slen;
var err;
opts = {};
if ( arguments.length ) {
if ( !isObject( options ) ) {
throw new TypeError( 'invalid argument. Options argument must be an object. Value: `' + options + '`.' );
}
if ( hasOwnProp( options, 'copy' ) ) {
opts.copy = options.copy;
if ( !isBoolean( options.copy ) ) {
throw new TypeError( 'invalid option. `copy` option must be a boolean. Option: `' + options.copy + '`.' );
}
}
if ( hasOwnProp( options, 'state' ) ) {
state = options.state;
opts.state = true;
if ( !isInt32Array( state ) ) {
throw new TypeError( 'invalid option. `state` option must be an Int32Array. Option: `' + state + '`.' );
}
err = verifyState( state, true );
if ( err ) {
throw err;
}
if ( opts.copy === false ) {
STATE = state;
} else {
STATE = new Int32Array( state.length );
gcopy( state.length, state, 1, STATE, 1 );
}
// Create a state "view":
state = new Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );
// Create a seed "view":
seed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), state[ SEED_SECTION_OFFSET ] );
}
// If provided a PRNG state, we ignore the `seed` option...
if ( seed === void 0 ) {
if ( hasOwnProp( options, 'seed' ) ) {
seed = options.seed;
opts.seed = true;
if ( isPositiveInteger( seed ) ) {
if ( seed > MAX_SEED ) {
throw new RangeError( 'invalid option. `seed` option must be a positive integer less than the maximum signed 32-bit integer. Option: `' + seed + '`.' );
}
seed |= 0; // asm type annotation
} else if ( isCollection( seed ) && seed.length > 0 ) {
slen = seed.length;
STATE = new Int32Array( STATE_FIXED_LENGTH+slen );
// Initialize sections:
STATE[ 0 ] = STATE_ARRAY_VERSION;
STATE[ 1 ] = NUM_STATE_SECTIONS;
STATE[ STATE_SECTION_OFFSET ] = 1;
STATE[ SEED_SECTION_OFFSET ] = slen;
// Copy the provided seed array to prevent external mutation, as mutation would lead to an inability to reproduce PRNG values according to the PRNG's stated seed:
gcopy.ndarray( slen, seed, 1, 0, STATE, 1, SEED_SECTION_OFFSET+1 );
// Create a state "view":
state = new Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );
// Create a seed "view":
seed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), slen );
// Initialize the internal PRNG state:
state[ 0 ] = seed[ 0 ];
} else {
throw new TypeError( 'invalid option. `seed` option must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integer values less than the maximum signed 32-bit integer. Option: `' + seed + '`.' );
}
} else {
seed = randint32()|0; // asm type annotation
}
}
} else {
seed = randint32()|0; // asm type annotation
}
if ( state === void 0 ) {
STATE = new Int32Array( STATE_FIXED_LENGTH+1 );
// Initialize sections:
STATE[ 0 ] = STATE_ARRAY_VERSION;
STATE[ 1 ] = NUM_STATE_SECTIONS;
STATE[ STATE_SECTION_OFFSET ] = 1;
STATE[ SEED_SECTION_OFFSET ] = 1;
STATE[ SEED_SECTION_OFFSET+1 ] = seed;
// Create a state "view":
state = new Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );
// Create a seed "view":
seed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );
// Initialize the internal PRNG state:
state[ 0 ] = seed[ 0 ];
}
setReadOnly( minstd, 'NAME', 'minstd' );
setReadOnlyAccessor( minstd, 'seed', getSeed );
setReadOnlyAccessor( minstd, 'seedLength', getSeedLength );
setReadWriteAccessor( minstd, 'state', getState, setState );
setReadOnlyAccessor( minstd, 'stateLength', getStateLength );
setReadOnlyAccessor( minstd, 'byteLength', getStateSize );
setReadOnly( minstd, 'toJSON', toJSON );
setReadOnly( minstd, 'MIN', 1 );
setReadOnly( minstd, 'MAX', INT32_MAX-1 );
setReadOnly( minstd, 'normalized', normalized );
setReadOnly( normalized, 'NAME', minstd.NAME );
setReadOnlyAccessor( normalized, 'seed', getSeed );
setReadOnlyAccessor( normalized, 'seedLength', getSeedLength );
setReadWriteAccessor( normalized, 'state', getState, setState );
setReadOnlyAccessor( normalized, 'stateLength', getStateLength );
setReadOnlyAccessor( normalized, 'byteLength', getStateSize );
setReadOnly( normalized, 'toJSON', toJSON );
setReadOnly( normalized, 'MIN', (minstd.MIN-1.0) / NORMALIZATION_CONSTANT );
setReadOnly( normalized, 'MAX', (minstd.MAX-1.0) / NORMALIZATION_CONSTANT );
return minstd;
/**
* Returns the PRNG seed.
*
* @private
* @returns {PRNGSeedMINSTD} seed
*/
function getSeed() {
var len = STATE[ SEED_SECTION_OFFSET ];
return gcopy( len, seed, 1, new Int32Array( len ), 1 );
}
/**
* Returns the PRNG seed length.
*
* @private
* @returns {PositiveInteger} seed length
*/
function getSeedLength() {
return STATE[ SEED_SECTION_OFFSET ];
}
/**
* Returns the PRNG state length.
*
* @private
* @returns {PositiveInteger} state length
*/
function getStateLength() {
return STATE.length;
}
/**
* Returns the PRNG state size (in bytes).
*
* @private
* @returns {PositiveInteger} state size (in bytes)
*/
function getStateSize() {
return STATE.byteLength;
}
/**
* Returns the current PRNG state.
*
* ## Notes
*
* - The PRNG state array is comprised of a preamble followed by `2` sections:
*
* 0. preamble (version + number of sections)
* 1. internal PRNG state
* 2. PRNG seed
*
* - The first element of the PRNG state array preamble is the state array schema version.
*
* - The second element of the PRNG state array preamble is the number of state array sections (i.e., `2`).
*
* - The first element of each section following the preamble specifies the section length. The remaining section elements comprise the section contents.
*
* @private
* @returns {PRNGStateMINSTD} current state
*/
function getState() {
var len = STATE.length;
return gcopy( len, STATE, 1, new Int32Array( len ), 1 );
}
/**
* Sets the PRNG state.
*
* ## Notes
*
* - If PRNG state is "shared" (meaning a state array was provided during PRNG creation and **not** copied) and one sets the generator state to a state array having a different length, the PRNG does **not** update the existing shared state and, instead, points to the newly provided state array. In order to synchronize PRNG output according to the new shared state array, the state array for **each** relevant PRNG must be **explicitly** set.
* - If PRNG state is "shared" and one sets the generator state to a state array of the same length, the PRNG state is updated (along with the state of all other PRNGs sharing the PRNG's state array).
*
* @private
* @param {PRNGStateMINSTD} s - generator state
* @throws {TypeError} must provide an `Int32Array`
* @throws {Error} must provide a valid state
*/
function setState( s ) {
var err;
if ( !isInt32Array( s ) ) {
throw new TypeError( 'invalid argument. Must provide an Int32Array. Value: `' + s + '`.' );
}
err = verifyState( s, false );
if ( err ) {
throw err;
}
if ( opts.copy === false ) {
if ( opts.state && s.length === STATE.length ) {
gcopy( s.length, s, 1, STATE, 1 ); // update current shared state
} else {
STATE = s; // point to new shared state
opts.state = true; // setting this flag allows updating a shared state even if a state array was not provided at PRNG creation
}
} else {
// Check if we can reuse allocated memory...
if ( s.length !== STATE.length ) {
STATE = new Int32Array( s.length ); // reallocate
}
gcopy( s.length, s, 1, STATE, 1 );
}
// Create a new state "view":
state = new Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );
// Create a new seed "view":
seed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), STATE[ SEED_SECTION_OFFSET ] );
}
/**
* Serializes the pseudorandom number generator as a JSON object.
*
* ## Notes
*
* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.
*
* @private
* @returns {Object} JSON representation
*/
function toJSON() {
var out = {};
out.type = 'PRNG';
out.name = minstd.NAME;
out.state = typedarray2json( STATE );
out.params = [];
return out;
}
/**
* Generates a pseudorandom integer on the interval \\( [1,2^{31}-1) \\).
*
* @private
* @returns {integer32} pseudorandom integer
*/
function minstd() {
var s = state[ 0 ]|0; // asm type annotation
s = ( (A*s)%INT32_MAX )|0; // asm type annotation
state[ 0 ] = s;
return s|0; // asm type annotation
}
/**
* Generates a pseudorandom number on the interval \\( [0,1) \\).
*
* @private
* @returns {number} pseudorandom number
*/
function normalized() {
return (minstd()-1) / NORMALIZATION_CONSTANT;
}
}
// EXPORTS //
module.exports = factory;
},{"./rand_int32.js":341,"@stdlib/array/int32":10,"@stdlib/array/to-json":17,"@stdlib/assert/has-own-property":53,"@stdlib/assert/is-boolean":81,"@stdlib/assert/is-collection":90,"@stdlib/assert/is-int32array":106,"@stdlib/assert/is-plain-object":147,"@stdlib/assert/is-positive-integer":149,"@stdlib/blas/base/gcopy":225,"@stdlib/constants/int32/max":253,"@stdlib/utils/define-nonenumerable-read-only-accessor":389,"@stdlib/utils/define-nonenumerable-read-only-property":391,"@stdlib/utils/define-nonenumerable-read-write-accessor":393}],339:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* A linear congruential pseudorandom number generator (LCG) based on Park and Miller.
*
* @module @stdlib/random/base/minstd
*
* @example
* var minstd = require( '@stdlib/random/base/minstd' );
*
* var v = minstd();
* // returns <number>
*
* @example
* var factory = require( '@stdlib/random/base/minstd' ).factory;
*
* var minstd = factory({
* 'seed': 1234
* });
*
* var v = minstd();
* // returns 20739838
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var minstd = require( './main.js' );
var factory = require( './factory.js' );
// MAIN //
setReadOnly( minstd, 'factory', factory );
// EXPORTS //
module.exports = minstd;
},{"./factory.js":338,"./main.js":340,"@stdlib/utils/define-nonenumerable-read-only-property":391}],340:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var factory = require( './factory.js' );
var randint32 = require( './rand_int32.js' );
// MAIN //
/**
* Generates a pseudorandom integer on the interval \\( [1,2^{31}-1) \\).
*
* ## Method
*
* Linear congruential generators (LCGs) use the recurrence relation
*
* ```tex
* X_{n+1} = ( a \cdot X_n + c ) \operatorname{mod}(m)
* ```
*
* where the modulus \\( m \\) is a prime number or power of a prime number and \\( a \\) is a primitive root modulo \\( m \\).
*
* <!-- <note> -->
*
* For an LCG to be a Lehmer RNG, the seed \\( X_0 \\) must be coprime to \\( m \\).
*
* <!-- </note> -->
*
* In this implementation, the constants \\( a \\), \\( c \\), and \\( m \\) have the values
*
* ```tex
* \begin{align*}
* a &= 7^5 = 16807 \\
* c &= 0 \\
* m &= 2^{31} - 1 = 2147483647
* \end{align*}
* ```
*
* <!-- <note> -->
*
* The constant \\( m \\) is a Mersenne prime (modulo \\(31\\)).
*
* <!-- </note> -->
*
* <!-- <note> -->
*
* The constant \\( a \\) is a primitive root (modulo \\(31\\)).
*
* <!-- </note> -->
*
* Accordingly, the maximum possible product is
*
* ```tex
* 16807 \cdot (m - 1) \approx 2^{46}
* ```
*
* The values for \\( a \\), \\( c \\), and \\( m \\) are taken from Park and Miller, "Random Number Generators: Good Ones Are Hard To Find". Park's and Miller's article is also the basis for a recipe in the second edition of _Numerical Recipes in C_.
*
*
* ## Notes
*
* - The generator has a period of approximately \\(2.1\mbox{e}9\\) (see [Numerical Recipes in C, 2nd Edition](#references), p. 279).
*
*
* ## References
*
* - Park, S. K., and K. W. Miller. 1988. "Random Number Generators: Good Ones Are Hard to Find." _Communications of the ACM_ 31 (10). New York, NY, USA: ACM: 1192–1201. doi:[10.1145/63039.63042](http://dx.doi.org/10.1145/63039.63042).
* - Press, William H., Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. 1992. _Numerical Recipes in C: The Art of Scientific Computing, Second Edition_. Cambridge University Press.
*
*
* @function minstd
* @type {PRNG}
* @returns {PositiveInteger} pseudorandom integer
*
* @example
* var v = minstd();
* // returns <number>
*/
var minstd = factory({
'seed': randint32()
});
// EXPORTS //
module.exports = minstd;
},{"./factory.js":338,"./rand_int32.js":341}],341:[function(require,module,exports){
arguments[4][337][0].apply(exports,arguments)
},{"@stdlib/constants/int32/max":253,"@stdlib/math/base/special/floor":278,"dup":337}],342:[function(require,module,exports){
/* eslint-disable max-lines, max-len */
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* ## Notice
*
* The original C code and copyright notice are from the [source implementation]{@link http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/mt19937ar.c}. The implementation has been modified for JavaScript.
*
* ```text
* Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. The names of its contributors may not be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ```
*/
'use strict';
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );
var setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isObject = require( '@stdlib/assert/is-plain-object' );
var isCollection = require( '@stdlib/assert/is-collection' );
var isUint32Array = require( '@stdlib/assert/is-uint32array' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
var FLOAT64_MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );
var UINT32_MAX = require( '@stdlib/constants/uint32/max' );
var Uint32Array = require( '@stdlib/array/uint32' );
var max = require( '@stdlib/math/base/special/max' );
var uimul = require( '@stdlib/math/base/special/uimul' );
var gcopy = require( '@stdlib/blas/base/gcopy' );
var typedarray2json = require( '@stdlib/array/to-json' );
var randuint32 = require( './rand_uint32.js' );
// VARIABLES //
// Define the size of the state array (see refs):
var N = 624;
// Define a (magic) constant used for indexing into the state array:
var M = 397;
// Define the maximum seed: 11111111111111111111111111111111
var MAX_SEED = UINT32_MAX >>> 0; // asm type annotation
// For seed arrays, define an initial state (magic) constant: 19650218 => 00000001001010111101011010101010
var SEED_ARRAY_INIT_STATE = 19650218 >>> 0; // asm type annotation
// Define a mask for the most significant `w-r` bits, where `w` is the word size (32 bits) and `r` is the separation point of one word (see refs): 2147483648 => 0x80000000 => 10000000000000000000000000000000
var UPPER_MASK = 0x80000000 >>> 0; // asm type annotation
// Define a mask for the least significant `r` bits (see refs): 2147483647 => 0x7fffffff => 01111111111111111111111111111111
var LOWER_MASK = 0x7fffffff >>> 0; // asm type annotation
// Define a multiplier (see Knuth TAOCP Vol2. 3rd Ed. P.106): 1812433253 => 01101100000001111000100101100101
var KNUTH_MULTIPLIER = 1812433253 >>> 0; // asm type annotation
// Define a (magic) multiplier: 1664525 => 00000000000110010110011000001101
var MAGIC_MULTIPLIER_1 = 1664525 >>> 0; // asm type annotation
// Define a (magic) multiplier: 1566083941 => 01011101010110001000101101100101
var MAGIC_MULTIPLIER_2 = 1566083941 >>> 0; // asm type annotation
// Define a tempering coefficient: 2636928640 => 0x9d2c5680 => 10011101001011000101011010000000
var TEMPERING_COEFFICIENT_1 = 0x9d2c5680 >>> 0; // asm type annotation
// Define a tempering coefficient: 4022730752 => 0xefc60000 => 11101111110001100000000000000000
var TEMPERING_COEFFICIENT_2 = 0xefc60000 >>> 0; // asm type annotation
// Define a constant vector `a` (see refs): 2567483615 => 0x9908b0df => 10011001000010001011000011011111
var MATRIX_A = 0x9908b0df >>> 0; // asm type annotation
// MAG01[x] = x * MATRIX_A; for x = {0,1}
var MAG01 = [ 0x0 >>> 0, MATRIX_A >>> 0 ]; // asm type annotation
// Define a normalization constant when generating double-precision floating-point numbers: 2^53 => 9007199254740992
var FLOAT64_NORMALIZATION_CONSTANT = 1.0 / ( FLOAT64_MAX_SAFE_INTEGER+1.0 ); // eslint-disable-line id-length
// 2^26: 67108864
var TWO_26 = 67108864 >>> 0; // asm type annotation
// 2^32: 2147483648 => 0x80000000 => 10000000000000000000000000000000
var TWO_32 = 0x80000000 >>> 0; // asm type annotation
// 1 (as a 32-bit unsigned integer): 1 => 0x1 => 00000000000000000000000000000001
var ONE = 0x1 >>> 0; // asm type annotation
// Define the maximum normalized pseudorandom double-precision floating-point number: ( (((2^32-1)>>>5)*2^26)+( (2^32-1)>>>6) ) / 2^53
var MAX_NORMALIZED = FLOAT64_MAX_SAFE_INTEGER * FLOAT64_NORMALIZATION_CONSTANT;
// Define the state array schema version:
var STATE_ARRAY_VERSION = 1; // NOTE: anytime the state array schema changes, this value should be incremented!!!
// Define the number of sections in the state array:
var NUM_STATE_SECTIONS = 3; // state, other, seed
// Define the index offset of the "state" section in the state array:
var STATE_SECTION_OFFSET = 2; // | version | num_sections | state_length | ...state | other_length | state_index | seed_length | ...seed |
// Define the index offset of the "other" section in the state array:
var OTHER_SECTION_OFFSET = N + 3; // | version | num_sections | state_length | ...state | other_length | state_index | seed_length | ...seed |
// Define the index offset of the seed section in the state array:
var SEED_SECTION_OFFSET = N + 5; // | version | num_sections | state_length | ...state | other_length | state_index | seed_length | ...seed |
// Define the length of the "fixed" length portion of the state array:
var STATE_FIXED_LENGTH = N + 6; // 1 (version) + 1 (num_sections) + 1 (state_length) + N (state) + 1 (other_length) + 1 (state_index) + 1 (seed_length)
// FUNCTIONS //
/**
* Verifies state array integrity.
*
* @private
* @param {Uint32Array} state - state array
* @param {boolean} FLG - flag indicating whether the state array was provided as an option (true) or an argument (false)
* @returns {(Error|null)} an error or `null`
*/
function verifyState( state, FLG ) {
var s1;
if ( FLG ) {
s1 = 'option';
} else {
s1 = 'argument';
}
// The state array must have a minimum length...
if ( state.length < STATE_FIXED_LENGTH+1 ) {
return new RangeError( 'invalid '+s1+'. `state` array has insufficient length.' );
}
// The first element of the state array must equal the supported state array schema version...
if ( state[ 0 ] !== STATE_ARRAY_VERSION ) {
return new RangeError( 'invalid '+s1+'. `state` array has an incompatible schema version. Expected: '+STATE_ARRAY_VERSION+'. Actual: '+state[ 0 ]+'.' );
}
// The second element of the state array must contain the number of sections...
if ( state[ 1 ] !== NUM_STATE_SECTIONS ) {
return new RangeError( 'invalid '+s1+'. `state` array has an incompatible number of sections. Expected: '+NUM_STATE_SECTIONS+'. Actual: '+state[ 1 ]+'.' );
}
// The length of the "state" section must equal `N`...
if ( state[ STATE_SECTION_OFFSET ] !== N ) {
return new RangeError( 'invalid '+s1+'. `state` array has an incompatible state length. Expected: '+N+'. Actual: '+state[ STATE_SECTION_OFFSET ]+'.' );
}
// The length of the "other" section must equal `1`...
if ( state[ OTHER_SECTION_OFFSET ] !== 1 ) {
return new RangeError( 'invalid '+s1+'. `state` array has an incompatible section length. Expected: '+(1).toString()+'. Actual: '+state[ OTHER_SECTION_OFFSET ]+'.' );
}
// The length of the "seed" section much match the empirical length...
if ( state[ SEED_SECTION_OFFSET ] !== state.length-STATE_FIXED_LENGTH ) {
return new RangeError( 'invalid '+s1+'. `state` array length is incompatible with seed section length. Expected: '+(state.length-STATE_FIXED_LENGTH)+'. Actual: '+state[ SEED_SECTION_OFFSET ]+'.' );
}
return null;
}
/**
* Returns an initial PRNG state.
*
* @private
* @param {Uint32Array} state - state array
* @param {PositiveInteger} N - state size
* @param {uinteger32} s - seed
* @returns {Uint32Array} state array
*/
function createState( state, N, s ) {
var i;
// Set the first element of the state array to the provided seed:
state[ 0 ] = s >>> 0; // equivalent to `s & 0xffffffffUL` in original C implementation
// Initialize the remaining state array elements:
for ( i = 1; i < N; i++ ) {
/*
* In the original C implementation (see `init_genrand()`),
*
* ```c
* mt[i] = (KNUTH_MULTIPLIER * (mt[i-1] ^ (mt[i-1] >> 30)) + i)
* ```
*
* In order to replicate this in JavaScript, we must emulate C-like multiplication of unsigned 32-bit integers.
*/
s = state[ i-1 ]>>>0; // asm type annotation
s = ( s^(s>>>30) )>>>0; // asm type annotation
state[ i ] = ( uimul( s, KNUTH_MULTIPLIER ) + i )>>>0; // asm type annotation
}
return state;
}
/**
* Initializes a PRNG state array according to a seed array.
*
* @private
* @param {Uint32Array} state - state array
* @param {NonNegativeInteger} N - state array length
* @param {Collection} seed - seed array
* @param {NonNegativeInteger} M - seed array length
* @returns {Uint32Array} state array
*/
function initState( state, N, seed, M ) {
var s;
var i;
var j;
var k;
i = 1;
j = 0;
for ( k = max( N, M ); k > 0; k-- ) {
/*
* In the original C implementation (see `init_by_array()`),
*
* ```c
* mt[i] = (mt[i]^((mt[i-1]^(mt[i-1]>>30))*1664525UL)) + seed[j] + j;
* ```
*
* In order to replicate this in JavaScript, we must emulate C-like multiplication of unsigned 32-bit integers.
*/
s = state[ i-1 ]>>>0; // asm type annotation
s = ( s^(s>>>30) )>>>0; // asm type annotation
s = ( uimul( s, MAGIC_MULTIPLIER_1 ) )>>>0; // asm type annotation
state[ i ] = ( ((state[i]>>>0)^s) + seed[j] + j )>>>0; /* non-linear */ // asm type annotation
i += 1;
j += 1;
if ( i >= N ) {
state[ 0 ] = state[ N-1 ];
i = 1;
}
if ( j >= M ) {
j = 0;
}
}
for ( k = N-1; k > 0; k-- ) {
/*
* In the original C implementation (see `init_by_array()`),
*
* ```c
* mt[i] = (mt[i]^((mt[i-1]^(mt[i-1]>>30))*1566083941UL)) - i;
* ```
*
* In order to replicate this in JavaScript, we must emulate C-like multiplication of unsigned 32-bit integers.
*/
s = state[ i-1 ]>>>0; // asm type annotation
s = ( s^(s>>>30) )>>>0; // asm type annotation
s = ( uimul( s, MAGIC_MULTIPLIER_2 ) )>>>0; // asm type annotation
state[ i ] = ( ((state[i]>>>0)^s) - i )>>>0; /* non-linear */ // asm type annotation
i += 1;
if ( i >= N ) {
state[ 0 ] = state[ N-1 ];
i = 1;
}
}
// Ensure a non-zero initial state array:
state[ 0 ] = TWO_32; // MSB (most significant bit) is 1
return state;
}
/**
* Updates a PRNG's internal state by generating the next `N` words.
*
* @private
* @param {Uint32Array} state - state array
* @returns {Uint32Array} state array
*/
function twist( state ) {
var w;
var i;
var j;
var k;
k = N - M;
for ( i = 0; i < k; i++ ) {
w = ( state[i]&UPPER_MASK ) | ( state[i+1]&LOWER_MASK );
state[ i ] = state[ i+M ] ^ ( w>>>1 ) ^ MAG01[ w&ONE ];
}
j = N - 1;
for ( ; i < j; i++ ) {
w = ( state[i]&UPPER_MASK ) | ( state[i+1]&LOWER_MASK );
state[ i ] = state[ i-k ] ^ ( w>>>1 ) ^ MAG01[ w&ONE ];
}
w = ( state[j]&UPPER_MASK ) | ( state[0]&LOWER_MASK );
state[ j ] = state[ M-1 ] ^ ( w>>>1 ) ^ MAG01[ w&ONE ];
return state;
}
// MAIN //
/**
* Returns a 32-bit Mersenne Twister pseudorandom number generator.
*
* ## Notes
*
* - In contrast to the original C implementation, array seeds of length `1` are considered integer seeds. This ensures that the seed `[ 1234 ]` generates the same output as the seed `1234`. In the original C implementation, the two seeds would yield different output, which is **not** obvious from a user perspective.
*
* @param {Options} [options] - options
* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed
* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state
* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state
* @throws {TypeError} options argument must be an object
* @throws {TypeError} a seed must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integers less than or equal to the maximum unsigned 32-bit integer
* @throws {RangeError} a numeric seed must be a positive integer less than or equal to the maximum unsigned 32-bit integer
* @throws {TypeError} state must be a `Uint32Array`
* @throws {Error} must provide a valid state
* @throws {TypeError} `copy` option must be a boolean
* @returns {PRNG} Mersenne Twister PRNG
*
* @example
* var mt19937 = factory();
*
* var v = mt19937();
* // returns <number>
*
* @example
* // Return a seeded Mersenne Twister PRNG:
* var mt19937 = factory({
* 'seed': 1234
* });
*
* var v = mt19937();
* // returns 822569775
*/
function factory( options ) {
var STATE;
var state;
var opts;
var seed;
var slen;
var err;
opts = {};
if ( arguments.length ) {
if ( !isObject( options ) ) {
throw new TypeError( 'invalid argument. Options argument must be an object. Value: `' + options + '`.' );
}
if ( hasOwnProp( options, 'copy' ) ) {
opts.copy = options.copy;
if ( !isBoolean( options.copy ) ) {
throw new TypeError( 'invalid option. `copy` option must be a boolean. Option: `' + options.copy + '`.' );
}
}
if ( hasOwnProp( options, 'state' ) ) {
state = options.state;
opts.state = true;
if ( !isUint32Array( state ) ) {
throw new TypeError( 'invalid option. `state` option must be a Uint32Array. Option: `' + state + '`.' );
}
err = verifyState( state, true );
if ( err ) {
throw err;
}
if ( opts.copy === false ) {
STATE = state;
} else {
STATE = new Uint32Array( state.length );
gcopy( state.length, state, 1, STATE, 1 );
}
// Create a state "view":
state = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );
// Create a seed "view":
seed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), state[ SEED_SECTION_OFFSET ] );
}
// If provided a PRNG state, we ignore the `seed` option...
if ( seed === void 0 ) {
if ( hasOwnProp( options, 'seed' ) ) {
seed = options.seed;
opts.seed = true;
if ( isPositiveInteger( seed ) ) {
if ( seed > MAX_SEED ) {
throw new RangeError( 'invalid option. `seed` option must be a positive integer less than or equal to the maximum unsigned 32-bit integer. Option: `' + seed + '`.' );
}
seed >>>= 0; // asm type annotation
} else if ( isCollection( seed ) === false || seed.length < 1 ) {
throw new TypeError( 'invalid option. `seed` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `' + seed + '`.' );
} else if ( seed.length === 1 ) {
seed = seed[ 0 ];
if ( !isPositiveInteger( seed ) ) {
throw new TypeError( 'invalid option. `seed` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `' + seed + '`.' );
}
if ( seed > MAX_SEED ) {
throw new RangeError( 'invalid option. `seed` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `' + seed + '`.' );
}
seed >>>= 0; // asm type annotation
} else {
slen = seed.length;
STATE = new Uint32Array( STATE_FIXED_LENGTH+slen );
// Initialize sections:
STATE[ 0 ] = STATE_ARRAY_VERSION;
STATE[ 1 ] = NUM_STATE_SECTIONS;
STATE[ STATE_SECTION_OFFSET ] = N;
STATE[ OTHER_SECTION_OFFSET ] = 1;
STATE[ OTHER_SECTION_OFFSET+1 ] = N; // state index
STATE[ SEED_SECTION_OFFSET ] = slen;
// Copy the provided seed array to prevent external mutation, as mutation would lead to an inability to reproduce PRNG values according to the PRNG's stated seed:
gcopy.ndarray( slen, seed, 1, 0, STATE, 1, SEED_SECTION_OFFSET+1 );
// Create a state "view":
state = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );
// Create a seed "view":
seed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), slen );
// Initialize the internal PRNG state:
state = createState( state, N, SEED_ARRAY_INIT_STATE );
state = initState( state, N, seed, slen );
}
} else {
seed = randuint32() >>> 0; // asm type annotation
}
}
} else {
seed = randuint32() >>> 0; // asm type annotation
}
if ( state === void 0 ) {
STATE = new Uint32Array( STATE_FIXED_LENGTH+1 );
// Initialize sections:
STATE[ 0 ] = STATE_ARRAY_VERSION;
STATE[ 1 ] = NUM_STATE_SECTIONS;
STATE[ STATE_SECTION_OFFSET ] = N;
STATE[ OTHER_SECTION_OFFSET ] = 1;
STATE[ OTHER_SECTION_OFFSET+1 ] = N; // state index
STATE[ SEED_SECTION_OFFSET ] = 1;
STATE[ SEED_SECTION_OFFSET+1 ] = seed;
// Create a state "view":
state = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );
// Create a seed "view":
seed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );
// Initialize the internal PRNG state:
state = createState( state, N, seed );
}
// Note: property order matters in order to maintain consistency of PRNG "shape" (hidden classes).
setReadOnly( mt19937, 'NAME', 'mt19937' );
setReadOnlyAccessor( mt19937, 'seed', getSeed );
setReadOnlyAccessor( mt19937, 'seedLength', getSeedLength );
setReadWriteAccessor( mt19937, 'state', getState, setState );
setReadOnlyAccessor( mt19937, 'stateLength', getStateLength );
setReadOnlyAccessor( mt19937, 'byteLength', getStateSize );
setReadOnly( mt19937, 'toJSON', toJSON );
setReadOnly( mt19937, 'MIN', 1 );
setReadOnly( mt19937, 'MAX', UINT32_MAX );
setReadOnly( mt19937, 'normalized', normalized );
setReadOnly( normalized, 'NAME', mt19937.NAME );
setReadOnlyAccessor( normalized, 'seed', getSeed );
setReadOnlyAccessor( normalized, 'seedLength', getSeedLength );
setReadWriteAccessor( normalized, 'state', getState, setState );
setReadOnlyAccessor( normalized, 'stateLength', getStateLength );
setReadOnlyAccessor( normalized, 'byteLength', getStateSize );
setReadOnly( normalized, 'toJSON', toJSON );
setReadOnly( normalized, 'MIN', 0.0 );
setReadOnly( normalized, 'MAX', MAX_NORMALIZED );
return mt19937;
/**
* Returns the PRNG seed.
*
* @private
* @returns {PRNGSeedMT19937} seed
*/
function getSeed() {
var len = STATE[ SEED_SECTION_OFFSET ];
return gcopy( len, seed, 1, new Uint32Array( len ), 1 );
}
/**
* Returns the PRNG seed length.
*
* @private
* @returns {PositiveInteger} seed length
*/
function getSeedLength() {
return STATE[ SEED_SECTION_OFFSET ];
}
/**
* Returns the PRNG state length.
*
* @private
* @returns {PositiveInteger} state length
*/
function getStateLength() {
return STATE.length;
}
/**
* Returns the PRNG state size (in bytes).
*
* @private
* @returns {PositiveInteger} state size (in bytes)
*/
function getStateSize() {
return STATE.byteLength;
}
/**
* Returns the current PRNG state.
*
* ## Notes
*
* - The PRNG state array is comprised of a preamble followed by `3` sections:
*
* 0. preamble (version + number of sections)
* 1. internal PRNG state
* 2. auxiliary state information
* 3. PRNG seed
*
* - The first element of the PRNG state array preamble is the state array schema version.
*
* - The second element of the PRNG state array preamble is the number of state array sections (i.e., `3`).
*
* - The first element of each section following the preamble specifies the section length. The remaining section elements comprise the section contents.
*
* @private
* @returns {PRNGStateMT19937} current state
*/
function getState() {
var len = STATE.length;
return gcopy( len, STATE, 1, new Uint32Array( len ), 1 );
}
/**
* Sets the PRNG state.
*
* ## Notes
*
* - If PRNG state is "shared" (meaning a state array was provided during PRNG creation and **not** copied) and one sets the generator state to a state array having a different length, the PRNG does **not** update the existing shared state and, instead, points to the newly provided state array. In order to synchronize PRNG output according to the new shared state array, the state array for **each** relevant PRNG must be **explicitly** set.
* - If PRNG state is "shared" and one sets the generator state to a state array of the same length, the PRNG state is updated (along with the state of all other PRNGs sharing the PRNG's state array).
*
* @private
* @param {PRNGStateMT19937} s - generator state
* @throws {TypeError} must provide a `Uint32Array`
* @throws {Error} must provide a valid state
*/
function setState( s ) {
var err;
if ( !isUint32Array( s ) ) {
throw new TypeError( 'invalid argument. Must provide a Uint32Array. Value: `' + s + '`.' );
}
err = verifyState( s, false );
if ( err ) {
throw err;
}
if ( opts.copy === false ) {
if ( opts.state && s.length === STATE.length ) {
gcopy( s.length, s, 1, STATE, 1 ); // update current shared state
} else {
STATE = s; // point to new shared state
opts.state = true; // setting this flag allows updating a shared state even if a state array was not provided at PRNG creation
}
} else {
// Check if we can reuse allocated memory...
if ( s.length !== STATE.length ) {
STATE = new Uint32Array( s.length ); // reallocate
}
gcopy( s.length, s, 1, STATE, 1 );
}
// Create a new state "view":
state = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );
// Create a new seed "view":
seed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), STATE[ SEED_SECTION_OFFSET ] );
}
/**
* Serializes the pseudorandom number generator as a JSON object.
*
* ## Notes
*
* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.
*
* @private
* @returns {Object} JSON representation
*/
function toJSON() {
var out = {};
out.type = 'PRNG';
out.name = mt19937.NAME;
out.state = typedarray2json( STATE );
out.params = [];
return out;
}
/**
* Generates a pseudorandom integer on the interval \\( [1,2^{32}-1) \\).
*
* @private
* @returns {uinteger32} pseudorandom integer
*
* @example
* var r = mt19937();
* // returns <number>
*/
function mt19937() {
var r;
var i;
// Retrieve the current state index:
i = STATE[ OTHER_SECTION_OFFSET+1 ];
// Determine whether we need to update the PRNG state:
if ( i >= N ) {
state = twist( state );
i = 0;
}
// Get the next word of "raw"/untempered state:
r = state[ i ];
// Update the state index:
STATE[ OTHER_SECTION_OFFSET+1 ] = i + 1;
// Tempering transform to compensate for the reduced dimensionality of equidistribution:
r ^= r >>> 11;
r ^= ( r << 7 ) & TEMPERING_COEFFICIENT_1;
r ^= ( r << 15 ) & TEMPERING_COEFFICIENT_2;
r ^= r >>> 18;
return r >>> 0;
}
/**
* Generates a pseudorandom number on the interval \\( [0,1) \\).
*
* ## Notes
*
* - The original C implementation credits Isaku Wada for this algorithm (2002/01/09).
*
* @private
* @returns {number} pseudorandom number
*
* @example
* var r = normalized();
* // returns <number>
*/
function normalized() {
var x = mt19937() >>> 5;
var y = mt19937() >>> 6;
return ( (x*TWO_26)+y ) * FLOAT64_NORMALIZATION_CONSTANT;
}
}
// EXPORTS //
module.exports = factory;
},{"./rand_uint32.js":345,"@stdlib/array/to-json":17,"@stdlib/array/uint32":23,"@stdlib/assert/has-own-property":53,"@stdlib/assert/is-boolean":81,"@stdlib/assert/is-collection":90,"@stdlib/assert/is-plain-object":147,"@stdlib/assert/is-positive-integer":149,"@stdlib/assert/is-uint32array":170,"@stdlib/blas/base/gcopy":225,"@stdlib/constants/float64/max-safe-integer":244,"@stdlib/constants/uint32/max":258,"@stdlib/math/base/special/max":286,"@stdlib/math/base/special/uimul":306,"@stdlib/utils/define-nonenumerable-read-only-accessor":389,"@stdlib/utils/define-nonenumerable-read-only-property":391,"@stdlib/utils/define-nonenumerable-read-write-accessor":393}],343:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* A 32-bit Mersenne Twister pseudorandom number generator.
*
* @module @stdlib/random/base/mt19937
*
* @example
* var mt19937 = require( '@stdlib/random/base/mt19937' );
*
* var v = mt19937();
* // returns <number>
*
* @example
* var factory = require( '@stdlib/random/base/mt19937' ).factory;
*
* var mt19937 = factory({
* 'seed': 1234
* });
*
* var v = mt19937();
* // returns 822569775
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var mt19937 = require( './main.js' );
var factory = require( './factory.js' );
// MAIN //
setReadOnly( mt19937, 'factory', factory );
// EXPORTS //
module.exports = mt19937;
},{"./factory.js":342,"./main.js":344,"@stdlib/utils/define-nonenumerable-read-only-property":391}],344:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var factory = require( './factory.js' );
var randuint32 = require( './rand_uint32.js' );
// MAIN //
/**
* Generates a pseudorandom integer on the interval \\( [1,2^{32}-1) \\).
*
* ## Method
*
* - When generating normalized double-precision floating-point numbers, we first generate two pseudorandom integers \\( x \\) and \\( y \\) on the interval \\( [1,2^{32}-1) \\) for a combined \\( 64 \\) random bits.
*
* - We would like \\( 53 \\) random bits to generate a 53-bit precision integer and, thus, want to discard \\( 11 \\) of the generated bits.
*
* - We do so by discarding \\( 5 \\) bits from \\( x \\) and \\( 6 \\) bits from \\( y \\).
*
* - Accordingly, \\( x \\) contains \\( 27 \\) random bits, which are subsequently shifted left \\( 26 \\) bits (multiplied by \\( 2^{26} \\), and \\( y \\) contains \\( 26 \\) random bits to fill in the lower \\( 26 \\) bits. When summed, they combine to comprise \\( 53 \\) random bits of a double-precision floating-point integer.
*
* - As an example, suppose, for the sake of argument, the 32-bit PRNG generates the maximum unsigned 32-bit integer \\( 2^{32}-1 \\) twice in a row. Then,
*
* ```javascript
* x = 4294967295 >>> 5; // 00000111111111111111111111111111
* y = 4294967295 >>> 6; // 00000011111111111111111111111111
* ```
*
* Multiplying \\( x \\) by \\( 2^{26} \\) returns \\( 9007199187632128 \\), which, in binary, is
*
* ```binarystring
* 0 10000110011 11111111111111111111 11111100000000000000000000000000
* ```
*
* Adding \\( y \\) yields \\( 9007199254740991 \\) (the maximum "safe" double-precision floating-point integer value), which, in binary, is
*
* ```binarystring
* 0 10000110011 11111111111111111111 11111111111111111111111111111111
* ```
*
* - Similarly, suppose the 32-bit PRNG generates the following values
*
* ```javascript
* x = 1 >>> 5; // 0 => 00000000000000000000000000000000
* y = 64 >>> 6; // 1 => 00000000000000000000000000000001
* ```
*
* Multiplying \\( x \\) by \\( 2^{26} \\) returns \\( 0 \\), which, in binary, is
*
* ```binarystring
* 0 00000000000 00000000000000000000 00000000000000000000000000000000
* ```
*
* Adding \\( y \\) yields \\( 1 \\), which, in binary, is
*
* ```binarystring
* 0 01111111111 00000000000000000000 00000000000000000000000000000000
* ```
*
* - As different combinations of \\( x \\) and \\( y \\) are generated, different combinations of double-precision floating-point exponent and significand bits will be toggled, thus generating pseudorandom double-precision floating-point numbers.
*
*
* ## References
*
* - Matsumoto, Makoto, and Takuji Nishimura. 1998. "Mersenne Twister: A 623-dimensionally Equidistributed Uniform Pseudo-random Number Generator." _ACM Transactions on Modeling and Computer Simulation_ 8 (1). New York, NY, USA: ACM: 3–30. doi:[10.1145/272991.272995][@matsumoto:1998a].
* - Harase, Shin. 2017. "Conversion of Mersenne Twister to double-precision floating-point numbers." _ArXiv_ abs/1708.06018 (September). <https://arxiv.org/abs/1708.06018>.
*
* [@matsumoto:1998a]: https://doi.org/10.1145/272991.272995
*
*
* @function mt19937
* @type {PRNG}
* @returns {PositiveInteger} pseudorandom integer
*
* @example
* var v = mt19937();
* // returns <number>
*/
var mt19937 = factory({
'seed': randuint32()
});
// EXPORTS //
module.exports = mt19937;
},{"./factory.js":342,"./rand_uint32.js":345}],345:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var UINT32_MAX = require( '@stdlib/constants/uint32/max' );
var floor = require( '@stdlib/math/base/special/floor' );
// VARIABLES //
var MAX = UINT32_MAX - 1;
// MAIN //
/**
* Returns a pseudorandom integer on the interval \\([1, 2^{32}-1)\\).
*
* @private
* @returns {PositiveInteger} pseudorandom integer
*
* @example
* var v = randuint32();
* // returns <number>
*/
function randuint32() {
var v = floor( 1.0 + (MAX*Math.random()) ); // eslint-disable-line stdlib/no-builtin-math
return v >>> 0; // asm type annotation
}
// EXPORTS //
module.exports = randuint32;
},{"@stdlib/constants/uint32/max":258,"@stdlib/math/base/special/floor":278}],346:[function(require,module,exports){
module.exports={
"name": "mt19937",
"copy": true
}
},{}],347:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );
var setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );
var isObject = require( '@stdlib/assert/is-plain-object' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var typedarray2json = require( '@stdlib/array/to-json' );
var defaults = require( './defaults.json' );
var PRNGS = require( './prngs.js' );
// MAIN //
/**
* Returns a pseudorandom number generator for generating uniformly distributed random numbers on the interval \\( [0,1) \\).
*
* @param {Options} [options] - function options
* @param {string} [options.name='mt19937'] - name of pseudorandom number generator
* @param {*} [options.seed] - pseudorandom number generator seed
* @param {*} [options.state] - pseudorandom number generator state
* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state
* @throws {TypeError} must provide an object
* @throws {TypeError} must provide valid options
* @throws {Error} must provide the name of a supported pseudorandom number generator
* @returns {PRNG} pseudorandom number generator
*
* @example
* var uniform = factory();
* var v = uniform();
* // returns <number>
*
* @example
* var uniform = factory({
* 'name': 'minstd'
* });
* var v = uniform();
* // returns <number>
*
* @example
* var uniform = factory({
* 'seed': 12345
* });
* var v = uniform();
* // returns <number>
*
* @example
* var uniform = factory({
* 'name': 'minstd',
* 'seed': 12345
* });
* var v = uniform();
* // returns <number>
*/
function factory( options ) {
var opts;
var rand;
var prng;
opts = {
'name': defaults.name,
'copy': defaults.copy
};
if ( arguments.length ) {
if ( !isObject( options ) ) {
throw new TypeError( 'invalid argument. Must provide an object. Value: `' + options + '`.' );
}
if ( hasOwnProp( options, 'name' ) ) {
opts.name = options.name;
}
if ( hasOwnProp( options, 'state' ) ) {
opts.state = options.state;
if ( opts.state === void 0 ) {
throw new TypeError( 'invalid option. `state` option cannot be undefined. Option: `' + opts.state + '`.' );
}
} else if ( hasOwnProp( options, 'seed' ) ) {
opts.seed = options.seed;
if ( opts.seed === void 0 ) {
throw new TypeError( 'invalid option. `seed` option cannot be undefined. Option: `' + opts.seed + '`.' );
}
}
if ( hasOwnProp( options, 'copy' ) ) {
opts.copy = options.copy;
if ( !isBoolean( opts.copy ) ) {
throw new TypeError( 'invalid option. `copy` option must be a boolean. Option: `' + opts.copy + '`.' );
}
}
}
prng = PRNGS[ opts.name ];
if ( prng === void 0 ) {
throw new Error( 'invalid option. Unrecognized/unsupported PRNG. Option: `' + opts.name + '`.' );
}
if ( opts.state === void 0 ) {
if ( opts.seed === void 0 ) {
rand = prng.factory();
} else {
rand = prng.factory({
'seed': opts.seed
});
}
} else {
rand = prng.factory({
'state': opts.state,
'copy': opts.copy
});
}
setReadOnly( uniform, 'NAME', 'randu' );
setReadOnlyAccessor( uniform, 'seed', getSeed );
setReadOnlyAccessor( uniform, 'seedLength', getSeedLength );
setReadWriteAccessor( uniform, 'state', getState, setState );
setReadOnlyAccessor( uniform, 'stateLength', getStateLength );
setReadOnlyAccessor( uniform, 'byteLength', getStateSize );
setReadOnly( uniform, 'toJSON', toJSON );
setReadOnly( uniform, 'PRNG', rand );
setReadOnly( uniform, 'MIN', rand.normalized.MIN );
setReadOnly( uniform, 'MAX', rand.normalized.MAX );
return uniform;
/**
* Returns the PRNG seed.
*
* @private
* @returns {*} seed
*/
function getSeed() {
return rand.seed;
}
/**
* Returns the PRNG seed length.
*
* @private
* @returns {PositiveInteger} seed length
*/
function getSeedLength() {
return rand.seedLength;
}
/**
* Returns the PRNG state length.
*
* @private
* @returns {PositiveInteger} state length
*/
function getStateLength() {
return rand.stateLength;
}
/**
* Returns the PRNG state size (in bytes).
*
* @private
* @returns {PositiveInteger} state size (in bytes)
*/
function getStateSize() {
return rand.byteLength;
}
/**
* Returns the current pseudorandom number generator state.
*
* @private
* @returns {*} current state
*/
function getState() {
return rand.state;
}
/**
* Sets the pseudorandom number generator state.
*
* @private
* @param {*} s - generator state
* @throws {Error} must provide a valid state
*/
function setState( s ) {
rand.state = s;
}
/**
* Serializes the pseudorandom number generator as a JSON object.
*
* ## Notes
*
* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.
*
* @private
* @returns {Object} JSON representation
*/
function toJSON() {
var out = {};
out.type = 'PRNG';
out.name = uniform.NAME + '-' + rand.NAME;
out.state = typedarray2json( rand.state );
out.params = [];
return out;
}
/**
* Returns a uniformly distributed pseudorandom number on the interval \\( [0,1) \\).
*
* @private
* @returns {number} pseudorandom number
*
* @example
* var v = uniform();
* // returns <number>
*/
function uniform() {
return rand.normalized();
}
}
// EXPORTS //
module.exports = factory;
},{"./defaults.json":346,"./prngs.js":350,"@stdlib/array/to-json":17,"@stdlib/assert/has-own-property":53,"@stdlib/assert/is-boolean":81,"@stdlib/assert/is-plain-object":147,"@stdlib/utils/define-nonenumerable-read-only-accessor":389,"@stdlib/utils/define-nonenumerable-read-only-property":391,"@stdlib/utils/define-nonenumerable-read-write-accessor":393}],348:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Uniformly distributed pseudorandom numbers on the interval \\( [0,1) \\).
*
* @module @stdlib/random/base/randu
*
* @example
* var randu = require( '@stdlib/random/base/randu' );
*
* var v = randu();
* // returns <number>
*
* @example
* var factory = require( '@stdlib/random/base/randu' ).factory;
*
* var randu = factory({
* 'name': 'minstd',
* 'seed': 12345
* });
*
* var v = randu();
* // returns <number>
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var randu = require( './main.js' );
var factory = require( './factory.js' );
// MAIN //
setReadOnly( randu, 'factory', factory );
// EXPORTS //
module.exports = randu;
},{"./factory.js":347,"./main.js":349,"@stdlib/utils/define-nonenumerable-read-only-property":391}],349:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var factory = require( './factory.js' );
// MAIN //
/**
* Returns a uniformly distributed random number on the interval \\( [0,1) \\).
*
* @name randu
* @type {PRNG}
* @returns {number} pseudorandom number
*
* @example
* var v = randu();
* // returns <number>
*/
var randu = factory();
// EXPORTS //
module.exports = randu;
},{"./factory.js":347}],350:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var prngs = {};
prngs[ 'minstd' ] = require( '@stdlib/random/base/minstd' );
prngs[ 'minstd-shuffle' ] = require( '@stdlib/random/base/minstd-shuffle' );
prngs[ 'mt19937' ] = require( '@stdlib/random/base/mt19937' );
// EXPORTS //
module.exports = prngs;
},{"@stdlib/random/base/minstd":339,"@stdlib/random/base/minstd-shuffle":335,"@stdlib/random/base/mt19937":343}],351:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Regular expression to match a newline character sequence.
*
* @module @stdlib/regexp/eol
*
* @example
* var reEOL = require( '@stdlib/regexp/eol' );
* var RE_EOL = reEOL();
*
* var bool = RE_EOL.test( '\n' );
* // returns true
*
* bool = RE_EOL.test( '\\r\\n' );
* // returns false
*
* @example
* var reEOL = require( '@stdlib/regexp/eol' );
* var replace = require( '@stdlib/string/replace' );
*
* var RE_EOL = reEOL({
* 'flags': 'g'
* });
* var str = '1\n2\n3';
* var out = replace( str, RE_EOL, '' );
*
* @example
* var reEOL = require( '@stdlib/regexp/eol' );
* var bool = reEOL.REGEXP.test( '\r\n' );
* // returns true
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var reEOL = require( './main.js' );
var REGEXP_CAPTURE = require( './regexp_capture.js' );
var REGEXP = require( './regexp.js' );
// MAIN //
setReadOnly( reEOL, 'REGEXP', REGEXP );
setReadOnly( reEOL, 'REGEXP_CAPTURE', REGEXP_CAPTURE );
// EXPORTS //
module.exports = reEOL;
},{"./main.js":352,"./regexp.js":353,"./regexp_capture.js":354,"@stdlib/utils/define-nonenumerable-read-only-property":391}],352:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var validate = require( './validate.js' );
// VARIABLES //
var REGEXP_STRING = '\\r?\\n';
// MAIN //
/**
* Returns a regular expression to match a newline character sequence.
*
* @param {Options} [options] - function options
* @param {string} [options.flags=''] - regular expression flags
* @param {boolean} [options.capture=false] - boolean indicating whether to create a capture group for the match
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @returns {RegExp} regular expression
*
* @example
* var RE_EOL = reEOL();
* var bool = RE_EOL.test( '\r\n' );
* // returns true
*
* @example
* var replace = require( '@stdlib/string/replace' );
*
* var RE_EOL = reEOL({
* 'flags': 'g'
* });
* var str = '1\n2\n3';
* var out = replace( str, RE_EOL, '' );
*/
function reEOL( options ) {
var opts;
var err;
if ( arguments.length > 0 ) {
opts = {};
err = validate( opts, options );
if ( err ) {
throw err;
}
if ( opts.capture ) {
return new RegExp( '('+REGEXP_STRING+')', opts.flags );
}
return new RegExp( REGEXP_STRING, opts.flags );
}
return /\r?\n/;
}
// EXPORTS //
module.exports = reEOL;
},{"./validate.js":355}],353:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var reEOL = require( './main.js' );
// MAIN //
/**
* Matches a newline character sequence.
*
* Regular expression: `/\r?\n/`
*
* - `\r?`
* - match a carriage return character (optional)
*
* - `\n`
* - match a line feed character
*
* @constant
* @type {RegExp}
* @default /\r?\n/
*/
var REGEXP = reEOL();
// EXPORTS //
module.exports = REGEXP;
},{"./main.js":352}],354:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var reEOL = require( './main.js' );
// MAIN //
/**
* Captures a newline character sequence.
*
* Regular expression: `/\r?\n/`
*
* - `()`
* - capture
*
* - `\r?`
* - match a carriage return character (optional)
*
* - `\n`
* - match a line feed character
*
* @constant
* @type {RegExp}
* @default /(\r?\n)/
*/
var REGEXP_CAPTURE = reEOL({
'capture': true
});
// EXPORTS //
module.exports = REGEXP_CAPTURE;
},{"./main.js":352}],355:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isObject = require( '@stdlib/assert/is-plain-object' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
// MAIN //
/**
* Validates function options.
*
* @private
* @param {Object} opts - destination object
* @param {Options} options - function options
* @param {string} [options.flags] - regular expression flags
* @param {boolean} [options.capture] - boolean indicating whether to wrap a regular expression matching a decimal number with a capture group
* @returns {(Error|null)} null or an error object
*
* @example
* var opts = {};
* var options = {
* 'flags': 'gm'
* };
* var err = validate( opts, options );
* if ( err ) {
* throw err;
* }
*/
function validate( opts, options ) {
if ( !isObject( options ) ) {
return new TypeError( 'invalid argument. Options must be an object. Value: `' + options + '`.' );
}
if ( hasOwnProp( options, 'flags' ) ) {
opts.flags = options.flags;
if ( !isString( opts.flags ) ) {
return new TypeError( 'invalid option. `flags` option must be a string primitive. Option: `' + opts.flags + '`.' );
}
}
if ( hasOwnProp( options, 'capture' ) ) {
opts.capture = options.capture;
if ( !isBoolean( opts.capture ) ) {
return new TypeError( 'invalid option. `capture` option must be a boolean primitive. Option: `' + opts.capture + '`.' );
}
}
return null;
}
// EXPORTS //
module.exports = validate;
},{"@stdlib/assert/has-own-property":53,"@stdlib/assert/is-boolean":81,"@stdlib/assert/is-plain-object":147,"@stdlib/assert/is-string":158}],356:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Regular expression to capture everything that is not a space immediately after the `function` keyword and before the first left parenthesis.
*
* @module @stdlib/regexp/function-name
*
* @example
* var reFunctionName = require( '@stdlib/regexp/function-name' );
* var RE_FUNCTION_NAME = reFunctionName();
*
* function fname( fcn ) {
* return RE_FUNCTION_NAME.exec( fcn.toString() )[ 1 ];
* }
*
* var fn = fname( Math.sqrt );
* // returns 'sqrt'
*
* fn = fname( Int8Array );
* // returns 'Int8Array'
*
* fn = fname( Object.prototype.toString );
* // returns 'toString'
*
* fn = fname( function(){} );
* // returns ''
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var reFunctionName = require( './main.js' );
var REGEXP = require( './regexp.js' );
// MAIN //
setReadOnly( reFunctionName, 'REGEXP', REGEXP );
// EXPORTS //
module.exports = reFunctionName;
},{"./main.js":357,"./regexp.js":358,"@stdlib/utils/define-nonenumerable-read-only-property":391}],357:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Returns a regular expression to capture everything that is not a space immediately after the `function` keyword and before the first left parenthesis.
*
* @returns {RegExp} regular expression
*
* @example
* var RE_FUNCTION_NAME = reFunctionName();
*
* function fname( fcn ) {
* return RE_FUNCTION_NAME.exec( fcn.toString() )[ 1 ];
* }
*
* var fn = fname( Math.sqrt );
* // returns 'sqrt'
*
* fn = fname( Int8Array );
* // returns 'Int8Array'
*
* fn = fname( Object.prototype.toString );
* // returns 'toString'
*
* fn = fname( function(){} );
* // returns ''
*/
function reFunctionName() {
return /^\s*function\s*([^(]*)/i;
}
// EXPORTS //
module.exports = reFunctionName;
},{}],358:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var reFunctionName = require( './main.js' );
// MAIN //
/**
* Captures everything that is not a space immediately after the `function` keyword and before the first left parenthesis.
*
* Regular expression: `/^\s*function\s*([^(]*)/i`
*
* - `/^\s*`
* - Match zero or more spaces at beginning
*
* - `function`
* - Match the word `function`
*
* - `\s*`
* - Match zero or more spaces after the word `function`
*
* - `()`
* - Capture
*
* - `[^(]*`
* - Match anything except a left parenthesis `(` zero or more times
*
* - `/i`
* - ignore case
*
* @constant
* @type {RegExp}
* @default /^\s*function\s*([^(]*)/i
*/
var RE_FUNCTION_NAME = reFunctionName();
// EXPORTS //
module.exports = RE_FUNCTION_NAME;
},{"./main.js":357}],359:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return a regular expression to parse a regular expression string.
*
* @module @stdlib/regexp/regexp
*
* @example
* var reRegExp = require( '@stdlib/regexp/regexp' );
*
* var RE_REGEXP = reRegExp();
*
* var bool = RE_REGEXP.test( '/^beep$/' );
* // returns true
*
* bool = RE_REGEXP.test( '' );
* // returns false
*
* @example
* var reRegExp = require( '@stdlib/regexp/regexp' );
*
* var RE_REGEXP = reRegExp();
*
* var parts = RE_REGEXP.exec( '/^.*$/ig' );
* // returns [ '/^.*$/ig', '^.*$', 'ig', 'index': 0, 'input': '/^.*$/ig' ]
*/
// MAIN //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var reRegExp = require( './main.js' );
var REGEXP = require( './regexp.js' );
// MAIN //
setReadOnly( reRegExp, 'REGEXP', REGEXP );
// EXPORTS //
module.exports = reRegExp;
// EXPORTS //
module.exports = reRegExp;
},{"./main.js":360,"./regexp.js":361,"@stdlib/utils/define-nonenumerable-read-only-property":391}],360:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Returns a regular expression to parse a regular expression string.
*
* @returns {RegExp} regular expression
*
* @example
* var RE_REGEXP = reRegExp();
*
* var bool = RE_REGEXP.test( '/^beep$/' );
* // returns true
*
* bool = RE_REGEXP.test( '' );
* // returns false
*/
function reRegExp() {
return /^\/((?:\\\/|[^\/])+)\/([imgy]*)$/; // eslint-disable-line no-useless-escape
}
// EXPORTS //
module.exports = reRegExp;
},{}],361:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var reRegExp = require( './main.js' );
// MAIN //
/**
* Matches parts of a regular expression string.
*
* Regular expression: `/^\/((?:\\\/|[^\/])+)\/([imgy]*)$/`
*
* - `/^\/`
* - match a string that begins with a `/`
*
* - `()`
* - capture
*
* - `(?:)+`
* - capture, but do not remember, a group of characters which occur one or more times
*
* - `\\\/`
* - match the literal `\/`
*
* - `|`
* - OR
*
* - `[^\/]`
* - anything which is not the literal `\/`
*
* - `\/`
* - match the literal `/`
*
* - `([imgy]*)`
* - capture any characters matching `imgy` occurring zero or more times
*
* - `$/`
* - string end
*
*
* @constant
* @type {RegExp}
* @default /^\/((?:\\\/|[^\/])+)\/([imgy]*)$/
*/
var RE_REGEXP = reRegExp();
// EXPORTS //
module.exports = RE_REGEXP;
},{"./main.js":360}],362:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var logger = require( 'debug' );
// VARIABLES //
var debug = logger( 'transform-stream:transform' );
// MAIN //
/**
* Implements the `_transform` method as a pass through.
*
* @private
* @param {(Uint8Array|Buffer|string)} chunk - streamed chunk
* @param {string} encoding - Buffer encoding
* @param {Callback} clbk - callback to invoke after transforming the streamed chunk
*/
function transform( chunk, encoding, clbk ) {
debug( 'Received a new chunk. Chunk: %s. Encoding: %s.', chunk.toString(), encoding );
clbk( null, chunk );
}
// EXPORTS //
module.exports = transform;
},{"debug":475}],363:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var logger = require( 'debug' );
var Transform = require( 'readable-stream' ).Transform;
var inherit = require( '@stdlib/utils/inherit' );
var copy = require( '@stdlib/utils/copy' );
var DEFAULTS = require( './defaults.json' );
var validate = require( './validate.js' );
var destroy = require( './destroy.js' );
var _transform = require( './_transform.js' ); // eslint-disable-line no-underscore-dangle
// VARIABLES //
var debug = logger( 'transform-stream:ctor' );
// MAIN //
/**
* Transform stream constructor factory.
*
* @param {Options} [options] - stream options
* @param {Function} [options.transform] - callback to invoke upon receiving a new chunk
* @param {Function} [options.flush] - callback to invoke after receiving all chunks and prior to the stream closing
* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode
* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`
* @param {NonNegativeNumber} [options.highWaterMark] - specifies the `Buffer` level for when `write()` starts returning `false`
* @param {boolean} [options.allowHalfOpen=false] - specifies whether the stream should remain open even if one side ends
* @param {boolean} [options.decodeStrings=true] - specifies whether to decode `strings` into `Buffer` objects when writing
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @returns {Function} Transform stream constructor
*
* @example
* var stdout = require( '@stdlib/streams/node/stdout' );
*
* function transform( chunk, enc, clbk ) {
* clbk( null, chunk.toString()+'\n' );
* }
*
* var opts = {
* 'transform': transform
* };
*
* var TransformStream = ctor( opts );
*
* var stream = new TransformStream();
*
* stream.pipe( stdout );
*
* stream.write( '1' );
* stream.write( '2' );
* stream.write( '3' );
*
* stream.end();
*
* // prints: '1\n2\n3\n'
*/
function ctor( options ) {
var transform;
var copts;
var err;
copts = copy( DEFAULTS );
if ( arguments.length ) {
err = validate( copts, options );
if ( err ) {
throw err;
}
}
if ( copts.transform ) {
transform = copts.transform;
} else {
transform = _transform;
}
/**
* Transform stream constructor.
*
* @private
* @constructor
* @param {Options} [options] - stream options
* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode
* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`
* @param {NonNegativeNumber} [options.highWaterMark] - specifies the `Buffer` level for when `write()` starts returning `false`
* @param {boolean} [options.allowHalfOpen=false] - specifies whether the stream should remain open even if one side ends
* @param {boolean} [options.decodeStrings=true] - specifies whether to decode `strings` into `Buffer` objects when writing
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @returns {TransformStream} transform stream
*
* @example
* var stdout = require( '@stdlib/streams/node/stdout' );
*
* var stream = new TransformStream();
*
* stream.pipe( stdout );
*
* stream.write( '1' );
* stream.write( '2' );
* stream.write( '3' );
*
* stream.end();
*
* // prints: '1\n2\n3\n'
*/
function TransformStream( options ) {
var opts;
var err;
if ( !( this instanceof TransformStream ) ) {
if ( arguments.length ) {
return new TransformStream( options );
}
return new TransformStream();
}
opts = copy( copts );
if ( arguments.length ) {
err = validate( opts, options );
if ( err ) {
throw err;
}
}
debug( 'Creating a transform stream configured with the following options: %s.', JSON.stringify( opts ) );
Transform.call( this, opts );
this._destroyed = false;
return this;
}
/**
* Inherit from the `Transform` prototype.
*/
inherit( TransformStream, Transform );
/**
* Implements the `_transform` method.
*
* @private
* @name _transform
* @memberof TransformStream.prototype
* @type {Function}
* @param {(Buffer|string)} chunk - streamed chunk
* @param {string} encoding - Buffer encoding
* @param {Callback} clbk - callback to invoke after transforming the streamed chunk
*/
TransformStream.prototype._transform = transform; // eslint-disable-line no-underscore-dangle
if ( copts.flush ) {
/**
* Implements the `_flush` method.
*
* @private
* @name _flush
* @memberof TransformStream.prototype
* @type {Function}
* @param {Callback} callback to invoke after performing flush tasks
*/
TransformStream.prototype._flush = copts.flush; // eslint-disable-line no-underscore-dangle
}
/**
* Gracefully destroys a stream, providing backward compatibility.
*
* @private
* @name destroy
* @memberof TransformStream.prototype
* @type {Function}
* @param {Object} [error] - optional error message
* @returns {TransformStream} stream instance
*/
TransformStream.prototype.destroy = destroy;
return TransformStream;
}
// EXPORTS //
module.exports = ctor;
},{"./_transform.js":362,"./defaults.json":364,"./destroy.js":365,"./validate.js":370,"@stdlib/utils/copy":387,"@stdlib/utils/inherit":419,"debug":475,"readable-stream":492}],364:[function(require,module,exports){
module.exports={
"objectMode": false,
"encoding": null,
"allowHalfOpen": false,
"decodeStrings": true
}
},{}],365:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var logger = require( 'debug' );
var nextTick = require( '@stdlib/utils/next-tick' );
// VARIABLES //
var debug = logger( 'transform-stream:destroy' );
// MAIN //
/**
* Gracefully destroys a stream, providing backward compatibility.
*
* @private
* @param {Object} [error] - optional error message
* @returns {Stream} stream instance
*/
function destroy( error ) {
/* eslint-disable no-invalid-this */
var self;
if ( this._destroyed ) {
debug( 'Attempted to destroy an already destroyed stream.' );
return this;
}
self = this;
this._destroyed = true;
nextTick( close );
return this;
/**
* Closes a stream.
*
* @private
*/
function close() {
if ( error ) {
debug( 'Stream was destroyed due to an error. Error: %s.', JSON.stringify( error ) );
self.emit( 'error', error );
}
debug( 'Closing the stream...' );
self.emit( 'close' );
}
}
// EXPORTS //
module.exports = destroy;
},{"@stdlib/utils/next-tick":445,"debug":475}],366:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isObject = require( '@stdlib/assert/is-plain-object' );
var copy = require( '@stdlib/utils/copy' );
var Stream = require( './main.js' );
// MAIN //
/**
* Creates a reusable transform stream factory.
*
* @param {Options} [options] - stream options
* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode
* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`
* @param {NonNegativeNumber} [options.highWaterMark] - specifies the `Buffer` level for when `write()` starts returning `false`
* @param {boolean} [options.allowHalfOpen=false] - specifies whether the stream should remain open even if one side ends
* @param {boolean} [options.decodeStrings=true] - specifies whether to decode `strings` into `Buffer` objects when writing
* @throws {TypeError} options argument must be an object
* @returns {Function} transform stream factory
*
* @example
* function transform( chunk, enc, clbk ) {
* clbk( null, chunk.toString()+'\n' );
* }
*
* var opts = {
* 'objectMode': true,
* 'encoding': 'utf8',
* 'highWaterMark': 64,
* 'decodeStrings': false
* };
*
* var factory = streamFactory( opts );
*
* // Create 10 identically configured streams...
* var streams = [];
* var i;
* for ( i = 0; i < 10; i++ ) {
* streams.push( factory( transform ) );
* }
*/
function streamFactory( options ) {
var opts;
if ( arguments.length ) {
if ( !isObject( options ) ) {
throw new TypeError( 'invalid argument. Options argument must be an object. Value: `' + options + '`.' );
}
opts = copy( options );
} else {
opts = {};
}
return createStream;
/**
* Creates a transform stream.
*
* @private
* @param {Function} transform - callback to invoke upon receiving a new chunk
* @param {Function} [flush] - callback to invoke after receiving all chunks and prior to the stream closing
* @throws {TypeError} must provide valid options
* @throws {TypeError} transform callback must be a function
* @throws {TypeError} flush callback must be a function
* @returns {TransformStream} transform stream
*/
function createStream( transform, flush ) {
opts.transform = transform;
if ( arguments.length > 1 ) {
opts.flush = flush;
} else {
delete opts.flush; // clear any previous `flush`
}
return new Stream( opts );
}
}
// EXPORTS //
module.exports = streamFactory;
},{"./main.js":368,"@stdlib/assert/is-plain-object":147,"@stdlib/utils/copy":387}],367:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Transform stream.
*
* @module @stdlib/streams/node/transform
*
* @example
* var stdout = require( '@stdlib/streams/node/stdout' );
* var transformStream = require( '@stdlib/streams/node/transform' );
*
* function transform( chunk, enc, clbk ) {
* clbk( null, chunk.toString()+'\n' );
* }
*
* var opts = {
* 'transform': transform
* };
* var stream = transformStream( opts );
*
* stream.pipe( stdout );
*
* stream.write( '1' );
* stream.write( '2' );
* stream.write( '3' );
*
* stream.end();
* // => '1\n2\n3\n'
*
*
* @example
* var transformStream = require( '@stdlib/streams/node/transform' );
*
* function transform( chunk, enc, clbk ) {
* clbk( null, chunk.toString()+'\n' );
* }
*
* var opts = {
* 'objectMode': true,
* 'encoding': 'utf8',
* 'highWaterMark': 64,
* 'decodeStrings': false
* };
*
* var factory = transformStream.factory( opts );
*
* // Create 10 identically configured streams...
* var streams = [];
* var i;
* for ( i = 0; i < 10; i++ ) {
* streams.push( factory( transform ) );
* }
*
*
* @example
* var stdout = require( '@stdlib/streams/node/stdout' );
* var transformStream = require( '@stdlib/streams/node/transform' );
*
* function stringify( chunk, enc, clbk ) {
* clbk( null, JSON.stringify( chunk ) );
* }
*
* function newline( chunk, enc, clbk ) {
* clbk( null, chunk+'\n' );
* }
*
* var s1 = transformStream.objectMode({
* 'transform': stringify
* });
*
* var s2 = transformStream.objectMode({
* 'transform': newline
* });
*
* s1.pipe( s2 ).pipe( stdout );
*
* s1.write( {'value': 'a'} );
* s1.write( {'value': 'b'} );
* s1.write( {'value': 'c'} );
*
* s1.end();
* // => '{"value":"a"}\n{"value":"b"}\n{"value":"c"}\n'
*
*
* @example
* var stdout = require( '@stdlib/streams/node/stdout' );
* var transformStream = require( '@stdlib/streams/node/transform' );
*
* function transform( chunk, enc, clbk ) {
* clbk( null, chunk.toString()+'\n' );
* }
*
* var opts = {
* 'transform': transform
* };
*
* var Stream = transformStream.ctor( opts );
*
* var stream = new Stream();
*
* stream.pipe( stdout );
*
* stream.write( '1' );
* stream.write( '2' );
* stream.write( '3' );
*
* stream.end();
* // => '1\n2\n3\n'
*/
// MODULES //
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var transform = require( './main.js' );
var objectMode = require( './object_mode.js' );
var factory = require( './factory.js' );
var ctor = require( './ctor.js' );
// MAIN //
setReadOnly( transform, 'objectMode', objectMode );
setReadOnly( transform, 'factory', factory );
setReadOnly( transform, 'ctor', ctor );
// EXPORTS //
module.exports = transform;
},{"./ctor.js":363,"./factory.js":366,"./main.js":368,"./object_mode.js":369,"@stdlib/utils/define-nonenumerable-read-only-property":391}],368:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var logger = require( 'debug' );
var Transform = require( 'readable-stream' ).Transform;
var inherit = require( '@stdlib/utils/inherit' );
var copy = require( '@stdlib/utils/copy' );
var DEFAULTS = require( './defaults.json' );
var validate = require( './validate.js' );
var destroy = require( './destroy.js' );
var _transform = require( './_transform.js' ); // eslint-disable-line no-underscore-dangle
// VARIABLES //
var debug = logger( 'transform-stream:main' );
// MAIN //
/**
* Transform stream constructor.
*
* @constructor
* @param {Options} [options] - stream options
* @param {Function} [options.transform] - callback to invoke upon receiving a new chunk
* @param {Function} [options.flush] - callback to invoke after receiving all chunks and prior to the stream closing
* @param {boolean} [options.objectMode=false] - specifies whether stream should operate in object mode
* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`
* @param {NonNegativeNumber} [options.highWaterMark] - specifies the `Buffer` level for when `write()` starts returning `false`
* @param {boolean} [options.allowHalfOpen=false] - specifies whether the stream should remain open even if one side ends
* @param {boolean} [options.decodeStrings=true] - specifies whether to decode `strings` into `Buffer` objects when writing
* @throws {TypeError} must provide valid options
* @returns {TransformStream} transform stream
*
* @example
* var stdout = require( '@stdlib/streams/node/stdout' );
*
* function transform( chunk, enc, clbk ) {
* clbk( null, chunk.toString()+'\n' );
* }
*
* var opts = {
* 'transform': transform
* };
* var stream = new TransformStream( opts );
*
* stream.pipe( stdout );
*
* stream.write( '1' );
* stream.write( '2' );
* stream.write( '3' );
*
* stream.end();
*
* // prints: '1\n2\n3\n'
*/
function TransformStream( options ) {
var opts;
var err;
if ( !( this instanceof TransformStream ) ) {
if ( arguments.length ) {
return new TransformStream( options );
}
return new TransformStream();
}
opts = copy( DEFAULTS );
if ( arguments.length ) {
err = validate( opts, options );
if ( err ) {
throw err;
}
}
debug( 'Creating a transform stream configured with the following options: %s.', JSON.stringify( opts ) );
Transform.call( this, opts );
this._destroyed = false;
if ( opts.transform ) {
this._transform = opts.transform;
} else {
this._transform = _transform;
}
if ( opts.flush ) {
this._flush = opts.flush;
}
return this;
}
/*
* Inherit from the `Transform` prototype.
*/
inherit( TransformStream, Transform );
/**
* Gracefully destroys a stream, providing backward compatibility.
*
* @name destroy
* @memberof TransformStream.prototype
* @type {Function}
* @param {Object} [error] - optional error message
* @returns {TransformStream} stream instance
*/
TransformStream.prototype.destroy = destroy;
// EXPORTS //
module.exports = TransformStream;
},{"./_transform.js":362,"./defaults.json":364,"./destroy.js":365,"./validate.js":370,"@stdlib/utils/copy":387,"@stdlib/utils/inherit":419,"debug":475,"readable-stream":492}],369:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isObject = require( '@stdlib/assert/is-plain-object' );
var copy = require( '@stdlib/utils/copy' );
var Stream = require( './main.js' );
// MAIN //
/**
* Returns a transform stream with `objectMode` set to `true`.
*
* @param {Options} [options] - stream options
* @param {Function} [options.transform] - callback to invoke upon receiving a new chunk
* @param {Function} [options.flush] - callback to invoke after receiving all chunks and prior to the stream closing
* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`
* @param {NonNegativeNumber} [options.highWaterMark] - specifies the `Buffer` level for when `write()` starts returning `false`
* @param {boolean} [options.allowHalfOpen=false] - specifies whether the stream should remain open even if one side ends
* @param {boolean} [options.decodeStrings=true] - specifies whether to decode `strings` into `Buffer` objects when writing
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @returns {TransformStream} transform stream
*
* @example
* var stdout = require( '@stdlib/streams/node/stdout' );
*
* function stringify( chunk, enc, clbk ) {
* clbk( null, JSON.stringify( chunk ) );
* }
*
* function newline( chunk, enc, clbk ) {
* clbk( null, chunk+'\n' );
* }
*
* var s1 = objectMode({
* 'transform': stringify
* });
*
* var s2 = objectMode({
* 'transform': newline
* });
*
* s1.pipe( s2 ).pipe( stdout );
*
* s1.write( {'value': 'a'} );
* s1.write( {'value': 'b'} );
* s1.write( {'value': 'c'} );
*
* s1.end();
*
* // prints: '{"value":"a"}\n{"value":"b"}\n{"value":"c"}\n'
*/
function objectMode( options ) {
var opts;
if ( arguments.length ) {
if ( !isObject( options ) ) {
throw new TypeError( 'invalid argument. Options argument must be an object. Value: `' + options + '`.' );
}
opts = copy( options );
} else {
opts = {};
}
opts.objectMode = true;
return new Stream( opts );
}
// EXPORTS //
module.exports = objectMode;
},{"./main.js":368,"@stdlib/assert/is-plain-object":147,"@stdlib/utils/copy":387}],370:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isObject = require( '@stdlib/assert/is-plain-object' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isFunction = require( '@stdlib/assert/is-function' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
// MAIN //
/**
* Validates function options.
*
* @private
* @param {Object} opts - destination object
* @param {Options} options - function options
* @param {Function} [options.transform] - callback to invoke upon receiving a new chunk
* @param {Function} [options.flush] - callback to invoke after receiving all chunks and prior to the stream closing
* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode
* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`
* @param {NonNegativeNumber} [options.highWaterMark] - specifies the `Buffer` level for when `write()` starts returning `false`
* @param {boolean} [options.allowHalfOpen] - specifies whether the stream should remain open even if one side ends
* @param {boolean} [options.decodeStrings] - specifies whether to decode `strings` into `Buffer` objects when writing
* @returns {(Error|null)} null or an error object
*/
function validate( opts, options ) {
if ( !isObject( options ) ) {
return new TypeError( 'invalid argument. Options must be an object. Value: `' + options + '`.' );
}
if ( hasOwnProp( options, 'transform' ) ) {
opts.transform = options.transform;
if ( !isFunction( opts.transform ) ) {
return new TypeError( 'invalid option. `transform` option must be a function. Option: `' + opts.transform + '`.' );
}
}
if ( hasOwnProp( options, 'flush' ) ) {
opts.flush = options.flush;
if ( !isFunction( opts.flush ) ) {
return new TypeError( 'invalid option. `flush` option must be a function. Option: `' + opts.flush + '`.' );
}
}
if ( hasOwnProp( options, 'objectMode' ) ) {
opts.objectMode = options.objectMode;
if ( !isBoolean( opts.objectMode ) ) {
return new TypeError( 'invalid option. `objectMode` option must be a primitive boolean. Option: `' + opts.objectMode + '`.' );
}
}
if ( hasOwnProp( options, 'encoding' ) ) {
opts.encoding = options.encoding;
if ( !isString( opts.encoding ) ) {
return new TypeError( 'invalid option. `encoding` option must be a primitive string. Option: `' + opts.encoding + '`.' );
}
}
if ( hasOwnProp( options, 'allowHalfOpen' ) ) {
opts.allowHalfOpen = options.allowHalfOpen;
if ( !isBoolean( opts.allowHalfOpen ) ) {
return new TypeError( 'invalid option. `allowHalfOpen` option must be a primitive boolean. Option: `' + opts.allowHalfOpen + '`.' );
}
}
if ( hasOwnProp( options, 'highWaterMark' ) ) {
opts.highWaterMark = options.highWaterMark;
if ( !isNonNegative( opts.highWaterMark ) ) {
return new TypeError( 'invalid option. `highWaterMark` option must be a nonnegative number. Option: `' + opts.highWaterMark + '`.' );
}
}
if ( hasOwnProp( options, 'decodeStrings' ) ) {
opts.decodeStrings = options.decodeStrings;
if ( !isBoolean( opts.decodeStrings ) ) {
return new TypeError( 'invalid option. `decodeStrings` option must be a primitive boolean. Option: `' + opts.decodeStrings + '`.' );
}
}
return null;
}
// EXPORTS //
module.exports = validate;
},{"@stdlib/assert/has-own-property":53,"@stdlib/assert/is-boolean":81,"@stdlib/assert/is-function":102,"@stdlib/assert/is-nonnegative-number":131,"@stdlib/assert/is-plain-object":147,"@stdlib/assert/is-string":158}],371:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Create a string from a sequence of Unicode code points.
*
* @module @stdlib/string/from-code-point
*
* @example
* var fromCodePoint = require( '@stdlib/string/from-code-point' );
*
* var str = fromCodePoint( 9731 );
* // returns '☃'
*/
// MODULES //
var fromCodePoint = require( './main.js' );
// EXPORTS //
module.exports = fromCodePoint;
},{"./main.js":372}],372:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;
var isCollection = require( '@stdlib/assert/is-collection' );
var UNICODE_MAX = require( '@stdlib/constants/unicode/max' );
var UNICODE_MAX_BMP = require( '@stdlib/constants/unicode/max-bmp' );
// VARIABLES //
var fromCharCode = String.fromCharCode;
// Factor to rescale a code point from a supplementary plane:
var Ox10000 = 0x10000|0; // 65536
// Factor added to obtain a high surrogate:
var OxD800 = 0xD800|0; // 55296
// Factor added to obtain a low surrogate:
var OxDC00 = 0xDC00|0; // 56320
// 10-bit mask: 2^10-1 = 1023 => 0x3ff => 00000000 00000000 00000011 11111111
var Ox3FF = 1023|0;
// MAIN //
/**
* Creates a string from a sequence of Unicode code points.
*
* ## Notes
*
* - UTF-16 encoding uses one 16-bit unit for non-surrogates (U+0000 to U+D7FF and U+E000 to U+FFFF).
* - UTF-16 encoding uses two 16-bit units (surrogate pairs) for U+10000 to U+10FFFF and encodes U+10000-U+10FFFF by subtracting 0x10000 from the code point, expressing the result as a 20-bit binary, and splitting the 20 bits of 0x0-0xFFFFF as upper and lower 10-bits. The respective 10-bits are stored in two 16-bit words: a high and a low surrogate.
*
*
* @param {...NonNegativeInteger} args - sequence of code points
* @throws {Error} must provide either an array-like object of code points or one or more code points as separate arguments
* @throws {TypeError} a code point must be a nonnegative integer
* @throws {RangeError} must provide a valid Unicode code point
* @returns {string} created string
*
* @example
* var str = fromCodePoint( 9731 );
* // returns '☃'
*/
function fromCodePoint( args ) {
var len;
var str;
var arr;
var low;
var hi;
var pt;
var i;
len = arguments.length;
if ( len === 1 && isCollection( args ) ) {
arr = arguments[ 0 ];
len = arr.length;
} else {
arr = [];
for ( i = 0; i < len; i++ ) {
arr.push( arguments[ i ] );
}
}
if ( len === 0 ) {
throw new Error( 'insufficient input arguments. Must provide either an array of code points or one or more code points as separate arguments.' );
}
str = '';
for ( i = 0; i < len; i++ ) {
pt = arr[ i ];
if ( !isNonNegativeInteger( pt ) ) {
throw new TypeError( 'invalid argument. Must provide valid code points (nonnegative integers). Value: `'+pt+'`.' );
}
if ( pt > UNICODE_MAX ) {
throw new RangeError( 'invalid argument. Must provide a valid code point (cannot exceed max). Value: `'+pt+'`.' );
}
if ( pt <= UNICODE_MAX_BMP ) {
str += fromCharCode( pt );
} else {
// Code point from a supplementary plane. Split into two 16-bit code units (surrogate pair).
pt -= Ox10000;
hi = (pt >> 10) + OxD800;
low = (pt & Ox3FF) + OxDC00;
str += fromCharCode( hi, low );
}
}
return str;
}
// EXPORTS //
module.exports = fromCodePoint;
},{"@stdlib/assert/is-collection":90,"@stdlib/assert/is-nonnegative-integer":127,"@stdlib/constants/unicode/max":261,"@stdlib/constants/unicode/max-bmp":260}],373:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Replace search occurrences with a replacement string.
*
* @module @stdlib/string/replace
*
* @example
* var replace = require( '@stdlib/string/replace' );
*
* var str = 'beep';
* var out = replace( str, 'e', 'o' );
* // returns 'boop'
*
* str = 'Hello World';
* out = replace( str, /world/i, 'Mr. President' );
* // returns 'Hello Mr. President'
*/
// MODULES //
var replace = require( './replace.js' );
// EXPORTS //
module.exports = replace;
},{"./replace.js":374}],374:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var rescape = require( '@stdlib/utils/escape-regexp-string' );
var isFunction = require( '@stdlib/assert/is-function' );
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var isRegExp = require( '@stdlib/assert/is-regexp' );
// MAIN //
/**
* Replace search occurrences with a replacement string.
*
* @param {string} str - input string
* @param {(string|RegExp)} search - search expression
* @param {(string|Function)} newval - replacement value or function
* @throws {TypeError} first argument must be a string primitive
* @throws {TypeError} second argument argument must be a string primitive or regular expression
* @throws {TypeError} third argument must be a string primitive or function
* @returns {string} new string containing replacement(s)
*
* @example
* var str = 'beep';
* var out = replace( str, 'e', 'o' );
* // returns 'boop'
*
* @example
* var str = 'Hello World';
* var out = replace( str, /world/i, 'Mr. President' );
* // returns 'Hello Mr. President'
*
* @example
* var capitalize = require( '@stdlib/string/capitalize' );
*
* var str = 'Oranges and lemons say the bells of St. Clement\'s';
*
* function replacer( match, p1 ) {
* return capitalize( p1 );
* }
*
* var out = replace( str, /([^\s]*)/gi, replacer);
* // returns 'Oranges And Lemons Say The Bells Of St. Clement\'s'
*/
function replace( str, search, newval ) {
if ( !isString( str ) ) {
throw new TypeError( 'invalid argument. First argument must be a string primitive. Value: `' + str + '`.' );
}
if ( isString( search ) ) {
search = rescape( search );
search = new RegExp( search, 'g' );
}
else if ( !isRegExp( search ) ) {
throw new TypeError( 'invalid argument. Second argument must be a string primitive or regular expression. Value: `' + search + '`.' );
}
if ( !isString( newval ) && !isFunction( newval ) ) {
throw new TypeError( 'invalid argument. Third argument must be a string primitive or replacement function. Value: `' + newval + '`.' );
}
return str.replace( search, newval );
}
// EXPORTS //
module.exports = replace;
},{"@stdlib/assert/is-function":102,"@stdlib/assert/is-regexp":154,"@stdlib/assert/is-string":158,"@stdlib/utils/escape-regexp-string":400}],375:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Trim whitespace characters from the beginning and end of a string.
*
* @module @stdlib/string/trim
*
* @example
* var trim = require( '@stdlib/string/trim' );
*
* var out = trim( ' Whitespace ' );
* // returns 'Whitespace'
*
* out = trim( '\t\t\tTabs\t\t\t' );
* // returns 'Tabs'
*
* out = trim( '\n\n\nNew Lines\n\n\n' );
* // returns 'New Lines'
*/
// MODULES //
var trim = require( './trim.js' );
// EXPORTS //
module.exports = trim;
},{"./trim.js":376}],376:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var replace = require( '@stdlib/string/replace' );
// VARIABLES //
// The following regular expression should suffice to polyfill (most?) all environments.
var RE = /^[\u0020\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]*([\S\s]*?)[\u0020\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]*$/;
// MAIN //
/**
* Trim whitespace characters from beginning and end of a string.
*
* @param {string} str - input string
* @throws {TypeError} must provide a string primitive
* @returns {string} trimmed string
*
* @example
* var out = trim( ' Whitespace ' );
* // returns 'Whitespace'
*
* @example
* var out = trim( '\t\t\tTabs\t\t\t' );
* // returns 'Tabs'
*
* @example
* var out = trim( '\n\n\nNew Lines\n\n\n' );
* // returns 'New Lines'
*/
function trim( str ) {
if ( !isString( str ) ) {
throw new TypeError( 'invalid argument. Must provide a string primitive. Value: `' + str + '`.' );
}
return replace( str, RE, '$1' );
}
// EXPORTS //
module.exports = trim;
},{"@stdlib/assert/is-string":158,"@stdlib/string/replace":373}],377:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var getGlobal = require( '@stdlib/utils/global' );
var isObject = require( '@stdlib/assert/is-object' );
var modf = require( '@stdlib/math/base/special/modf' );
var round = require( '@stdlib/math/base/special/round' );
var now = require( './now.js' );
// VARIABLES //
var Global = getGlobal();
var ts;
var ns;
if ( isObject( Global.performance ) ) {
ns = Global.performance;
} else {
ns = {};
}
if ( ns.now ) {
ts = ns.now.bind( ns );
} else if ( ns.mozNow ) {
ts = ns.mozNow.bind( ns );
} else if ( ns.msNow ) {
ts = ns.msNow.bind( ns );
} else if ( ns.oNow ) {
ts = ns.oNow.bind( ns );
} else if ( ns.webkitNow ) {
ts = ns.webkitNow.bind( ns );
} else {
ts = now;
}
// MAIN //
/**
* Returns a high-resolution time.
*
* ## Notes
*
* - Output format: `[seconds, nanoseconds]`.
*
*
* @private
* @returns {NumberArray} high-resolution time
*
* @example
* var t = tic();
* // returns [<number>,<number>]
*/
function tic() {
var parts;
var t;
// Get a millisecond timestamp and convert to seconds:
t = ts() / 1000;
// Decompose the timestamp into integer (seconds) and fractional parts:
parts = modf( t );
// Convert the fractional part to nanoseconds:
parts[ 1 ] = round( parts[1] * 1.0e9 );
// Return the high-resolution time:
return parts;
}
// EXPORTS //
module.exports = tic;
},{"./now.js":379,"@stdlib/assert/is-object":145,"@stdlib/math/base/special/modf":288,"@stdlib/math/base/special/round":302,"@stdlib/utils/global":412}],378:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isFunction = require( '@stdlib/assert/is-function' );
// MAIN //
var bool = isFunction( Date.now );
// EXPORTS //
module.exports = bool;
},{"@stdlib/assert/is-function":102}],379:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var bool = require( './detect.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var now;
if ( bool ) {
now = Date.now;
} else {
now = polyfill;
}
// EXPORTS //
module.exports = now;
},{"./detect.js":378,"./polyfill.js":380}],380:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Returns the time in milliseconds since the epoch.
*
* @private
* @returns {number} time
*
* @example
* var ts = now();
* // returns <number>
*/
function now() {
var d = new Date();
return d.getTime();
}
// EXPORTS //
module.exports = now;
},{}],381:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return a high-resolution time difference.
*
* @module @stdlib/time/toc
*
* @example
* var tic = require( '@stdlib/time/tic' );
* var toc = require( '@stdlib/time/toc' );
*
* var start = tic();
* var delta = toc( start );
* // returns [<number>,<number>]
*/
// MODULES //
var toc = require( './toc.js' );
// EXPORTS //
module.exports = toc;
},{"./toc.js":382}],382:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isNonNegativeIntegerArray = require( '@stdlib/assert/is-nonnegative-integer-array' ).primitives;
var tic = require( '@stdlib/time/tic' );
// MAIN //
/**
* Returns a high-resolution time difference.
*
* ## Notes
*
* - Output format: `[seconds, nanoseconds]`.
*
*
* @param {NonNegativeIntegerArray} time - high-resolution time
* @throws {TypeError} must provide a nonnegative integer array
* @throws {RangeError} input array must have length `2`
* @returns {NumberArray} high resolution time difference
*
* @example
* var tic = require( '@stdlib/time/tic' );
*
* var start = tic();
* var delta = toc( start );
* // returns [<number>,<number>]
*/
function toc( time ) {
var now = tic();
var sec;
var ns;
if ( !isNonNegativeIntegerArray( time ) ) {
throw new TypeError( 'invalid argument. Must provide an array of nonnegative integers. Value: `' + time + '`.' );
}
if ( time.length !== 2 ) {
throw new RangeError( 'invalid argument. Input array must have length `2`.' );
}
sec = now[ 0 ] - time[ 0 ];
ns = now[ 1 ] - time[ 1 ];
if ( sec > 0 && ns < 0 ) {
sec -= 1;
ns += 1e9;
}
else if ( sec < 0 && ns > 0 ) {
sec += 1;
ns -= 1e9;
}
return [ sec, ns ];
}
// EXPORTS //
module.exports = toc;
},{"@stdlib/assert/is-nonnegative-integer-array":126,"@stdlib/time/tic":377}],383:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Determine the name of a value's constructor.
*
* @module @stdlib/utils/constructor-name
*
* @example
* var constructorName = require( '@stdlib/utils/constructor-name' );
*
* var v = constructorName( 'a' );
* // returns 'String'
*
* v = constructorName( {} );
* // returns 'Object'
*
* v = constructorName( true );
* // returns 'Boolean'
*/
// MODULES //
var constructorName = require( './main.js' );
// EXPORTS //
module.exports = constructorName;
},{"./main.js":384}],384:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
var RE = require( '@stdlib/regexp/function-name' ).REGEXP;
var isBuffer = require( '@stdlib/assert/is-buffer' );
// MAIN //
/**
* Determines the name of a value's constructor.
*
* @param {*} v - input value
* @returns {string} name of a value's constructor
*
* @example
* var v = constructorName( 'a' );
* // returns 'String'
*
* @example
* var v = constructorName( 5 );
* // returns 'Number'
*
* @example
* var v = constructorName( null );
* // returns 'Null'
*
* @example
* var v = constructorName( undefined );
* // returns 'Undefined'
*
* @example
* var v = constructorName( function noop() {} );
* // returns 'Function'
*/
function constructorName( v ) {
var match;
var name;
var ctor;
name = nativeClass( v ).slice( 8, -1 );
if ( (name === 'Object' || name === 'Error') && v.constructor ) {
ctor = v.constructor;
if ( typeof ctor.name === 'string' ) {
return ctor.name;
}
match = RE.exec( ctor.toString() );
if ( match ) {
return match[ 1 ];
}
}
if ( isBuffer( v ) ) {
return 'Buffer';
}
return name;
}
// EXPORTS //
module.exports = constructorName;
},{"@stdlib/assert/is-buffer":88,"@stdlib/regexp/function-name":356,"@stdlib/utils/native-class":440}],385:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isArray = require( '@stdlib/assert/is-array' );
var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;
var PINF = require( '@stdlib/constants/float64/pinf' );
var deepCopy = require( './deep_copy.js' );
// MAIN //
/**
* Copies or deep clones a value to an arbitrary depth.
*
* @param {*} value - value to copy
* @param {NonNegativeInteger} [level=+infinity] - copy depth
* @throws {TypeError} `level` must be a nonnegative integer
* @returns {*} value copy
*
* @example
* var out = copy( 'beep' );
* // returns 'beep'
*
* @example
* var value = [
* {
* 'a': 1,
* 'b': true,
* 'c': [ 1, 2, 3 ]
* }
* ];
* var out = copy( value );
* // returns [ { 'a': 1, 'b': true, 'c': [ 1, 2, 3 ] } ]
*
* var bool = ( value[0].c === out[0].c );
* // returns false
*/
function copy( value, level ) {
var out;
if ( arguments.length > 1 ) {
if ( !isNonNegativeInteger( level ) ) {
throw new TypeError( 'invalid argument. `level` must be a nonnegative integer. Value: `' + level + '`.' );
}
if ( level === 0 ) {
return value;
}
} else {
level = PINF;
}
out = ( isArray( value ) ) ? new Array( value.length ) : {};
return deepCopy( value, out, [value], [out], level );
}
// EXPORTS //
module.exports = copy;
},{"./deep_copy.js":386,"@stdlib/assert/is-array":79,"@stdlib/assert/is-nonnegative-integer":127,"@stdlib/constants/float64/pinf":249}],386:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isArray = require( '@stdlib/assert/is-array' );
var isBuffer = require( '@stdlib/assert/is-buffer' );
var isError = require( '@stdlib/assert/is-error' );
var typeOf = require( '@stdlib/utils/type-of' );
var regexp = require( '@stdlib/utils/regexp-from-string' );
var indexOf = require( '@stdlib/utils/index-of' );
var objectKeys = require( '@stdlib/utils/keys' );
var propertyNames = require( '@stdlib/utils/property-names' );
var propertyDescriptor = require( '@stdlib/utils/property-descriptor' );
var getPrototypeOf = require( '@stdlib/utils/get-prototype-of' );
var defineProperty = require( '@stdlib/utils/define-property' );
var copyBuffer = require( '@stdlib/buffer/from-buffer' );
var typedArrays = require( './typed_arrays.js' );
// FUNCTIONS //
/**
* Clones a class instance.
*
* ## Notes
*
* - This should **only** be used for simple cases. Any instances with privileged access to variables (e.g., within closures) cannot be cloned. This approach should be considered **fragile**.
* - The function is greedy, disregarding the notion of a `level`. Instead, the function deep copies all properties, as we assume the concept of `level` applies only to the class instance reference but not to its internal state. This prevents, in theory, two instances from sharing state.
*
*
* @private
* @param {Object} val - class instance
* @returns {Object} new instance
*/
function cloneInstance( val ) {
var cache;
var names;
var name;
var refs;
var desc;
var tmp;
var ref;
var i;
cache = [];
refs = [];
ref = Object.create( getPrototypeOf( val ) );
cache.push( val );
refs.push( ref );
names = propertyNames( val );
for ( i = 0; i < names.length; i++ ) {
name = names[ i ];
desc = propertyDescriptor( val, name );
if ( hasOwnProp( desc, 'value' ) ) {
tmp = ( isArray( val[name] ) ) ? [] : {};
desc.value = deepCopy( val[name], tmp, cache, refs, -1 );
}
defineProperty( ref, name, desc );
}
if ( !Object.isExtensible( val ) ) {
Object.preventExtensions( ref );
}
if ( Object.isSealed( val ) ) {
Object.seal( ref );
}
if ( Object.isFrozen( val ) ) {
Object.freeze( ref );
}
return ref;
}
/**
* Copies an error object.
*
* @private
* @param {(Error|TypeError|SyntaxError|URIError|ReferenceError|RangeError|EvalError)} error - error to copy
* @returns {(Error|TypeError|SyntaxError|URIError|ReferenceError|RangeError|EvalError)} error copy
*
* @example
* var err1 = new TypeError( 'beep' );
*
* var err2 = copyError( err1 );
* // returns <TypeError>
*/
function copyError( error ) {
var cache = [];
var refs = [];
var keys;
var desc;
var tmp;
var key;
var err;
var i;
// Create a new error...
err = new error.constructor( error.message );
cache.push( error );
refs.push( err );
// If a `stack` property is present, copy it over...
if ( error.stack ) {
err.stack = error.stack;
}
// Node.js specific (system errors)...
if ( error.code ) {
err.code = error.code;
}
if ( error.errno ) {
err.errno = error.errno;
}
if ( error.syscall ) {
err.syscall = error.syscall;
}
// Any enumerable properties...
keys = objectKeys( error );
for ( i = 0; i < keys.length; i++ ) {
key = keys[ i ];
desc = propertyDescriptor( error, key );
if ( hasOwnProp( desc, 'value' ) ) {
tmp = ( isArray( error[ key ] ) ) ? [] : {};
desc.value = deepCopy( error[ key ], tmp, cache, refs, -1 );
}
defineProperty( err, key, desc );
}
return err;
}
// MAIN //
/**
* Recursively performs a deep copy of an input object.
*
* @private
* @param {*} val - value to copy
* @param {(Array|Object)} copy - copy
* @param {Array} cache - an array of visited objects
* @param {Array} refs - an array of object references
* @param {NonNegativeInteger} level - copy depth
* @returns {*} deep copy
*/
function deepCopy( val, copy, cache, refs, level ) {
var parent;
var keys;
var name;
var desc;
var ctor;
var key;
var ref;
var x;
var i;
var j;
level -= 1;
// Primitives and functions...
if (
typeof val !== 'object' ||
val === null
) {
return val;
}
if ( isBuffer( val ) ) {
return copyBuffer( val );
}
if ( isError( val ) ) {
return copyError( val );
}
// Objects...
name = typeOf( val );
if ( name === 'date' ) {
return new Date( +val );
}
if ( name === 'regexp' ) {
return regexp( val.toString() );
}
if ( name === 'set' ) {
return new Set( val );
}
if ( name === 'map' ) {
return new Map( val );
}
if (
name === 'string' ||
name === 'boolean' ||
name === 'number'
) {
// If provided an `Object`, return an equivalent primitive!
return val.valueOf();
}
ctor = typedArrays[ name ];
if ( ctor ) {
return ctor( val );
}
// Class instances...
if (
name !== 'array' &&
name !== 'object'
) {
// Cloning requires ES5 or higher...
if ( typeof Object.freeze === 'function' ) {
return cloneInstance( val );
}
return {};
}
// Arrays and plain objects...
keys = objectKeys( val );
if ( level > 0 ) {
parent = name;
for ( j = 0; j < keys.length; j++ ) {
key = keys[ j ];
x = val[ key ];
// Primitive, Buffer, special class instance...
name = typeOf( x );
if (
typeof x !== 'object' ||
x === null ||
(
name !== 'array' &&
name !== 'object'
) ||
isBuffer( x )
) {
if ( parent === 'object' ) {
desc = propertyDescriptor( val, key );
if ( hasOwnProp( desc, 'value' ) ) {
desc.value = deepCopy( x );
}
defineProperty( copy, key, desc );
} else {
copy[ key ] = deepCopy( x );
}
continue;
}
// Circular reference...
i = indexOf( cache, x );
if ( i !== -1 ) {
copy[ key ] = refs[ i ];
continue;
}
// Plain array or object...
ref = ( isArray( x ) ) ? new Array( x.length ) : {};
cache.push( x );
refs.push( ref );
if ( parent === 'array' ) {
copy[ key ] = deepCopy( x, ref, cache, refs, level );
} else {
desc = propertyDescriptor( val, key );
if ( hasOwnProp( desc, 'value' ) ) {
desc.value = deepCopy( x, ref, cache, refs, level );
}
defineProperty( copy, key, desc );
}
}
} else if ( name === 'array' ) {
for ( j = 0; j < keys.length; j++ ) {
key = keys[ j ];
copy[ key ] = val[ key ];
}
} else {
for ( j = 0; j < keys.length; j++ ) {
key = keys[ j ];
desc = propertyDescriptor( val, key );
defineProperty( copy, key, desc );
}
}
if ( !Object.isExtensible( val ) ) {
Object.preventExtensions( copy );
}
if ( Object.isSealed( val ) ) {
Object.seal( copy );
}
if ( Object.isFrozen( val ) ) {
Object.freeze( copy );
}
return copy;
}
// EXPORTS //
module.exports = deepCopy;
},{"./typed_arrays.js":388,"@stdlib/assert/has-own-property":53,"@stdlib/assert/is-array":79,"@stdlib/assert/is-buffer":88,"@stdlib/assert/is-error":96,"@stdlib/buffer/from-buffer":232,"@stdlib/utils/define-property":398,"@stdlib/utils/get-prototype-of":406,"@stdlib/utils/index-of":416,"@stdlib/utils/keys":433,"@stdlib/utils/property-descriptor":455,"@stdlib/utils/property-names":459,"@stdlib/utils/regexp-from-string":462,"@stdlib/utils/type-of":467}],387:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Copy or deep clone a value to an arbitrary depth.
*
* @module @stdlib/utils/copy
*
* @example
* var copy = require( '@stdlib/utils/copy' );
*
* var out = copy( 'beep' );
* // returns 'beep'
*
* @example
* var copy = require( '@stdlib/utils/copy' );
*
* var value = [
* {
* 'a': 1,
* 'b': true,
* 'c': [ 1, 2, 3 ]
* }
* ];
* var out = copy( value );
* // returns [ {'a': 1, 'b': true, 'c': [ 1, 2, 3 ] } ]
*
* var bool = ( value[0].c === out[0].c );
* // returns false
*/
// MODULES //
var copy = require( './copy.js' );
// EXPORTS //
module.exports = copy;
},{"./copy.js":385}],388:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var Int8Array = require( '@stdlib/array/int8' );
var Uint8Array = require( '@stdlib/array/uint8' );
var Uint8ClampedArray = require( '@stdlib/array/uint8c' );
var Int16Array = require( '@stdlib/array/int16' );
var Uint16Array = require( '@stdlib/array/uint16' );
var Int32Array = require( '@stdlib/array/int32' );
var Uint32Array = require( '@stdlib/array/uint32' );
var Float32Array = require( '@stdlib/array/float32' );
var Float64Array = require( '@stdlib/array/float64' );
// VARIABLES //
var hash;
// FUNCTIONS //
/**
* Copies an `Int8Array`.
*
* @private
* @param {Int8Array} arr - array to copy
* @returns {Int8Array} new array
*/
function int8array( arr ) {
return new Int8Array( arr );
}
/**
* Copies a `Uint8Array`.
*
* @private
* @param {Uint8Array} arr - array to copy
* @returns {Uint8Array} new array
*/
function uint8array( arr ) {
return new Uint8Array( arr );
}
/**
* Copies a `Uint8ClampedArray`.
*
* @private
* @param {Uint8ClampedArray} arr - array to copy
* @returns {Uint8ClampedArray} new array
*/
function uint8clampedarray( arr ) {
return new Uint8ClampedArray( arr );
}
/**
* Copies an `Int16Array`.
*
* @private
* @param {Int16Array} arr - array to copy
* @returns {Int16Array} new array
*/
function int16array( arr ) {
return new Int16Array( arr );
}
/**
* Copies a `Uint16Array`.
*
* @private
* @param {Uint16Array} arr - array to copy
* @returns {Uint16Array} new array
*/
function uint16array( arr ) {
return new Uint16Array( arr );
}
/**
* Copies an `Int32Array`.
*
* @private
* @param {Int32Array} arr - array to copy
* @returns {Int32Array} new array
*/
function int32array( arr ) {
return new Int32Array( arr );
}
/**
* Copies a `Uint32Array`.
*
* @private
* @param {Uint32Array} arr - array to copy
* @returns {Uint32Array} new array
*/
function uint32array( arr ) {
return new Uint32Array( arr );
}
/**
* Copies a `Float32Array`.
*
* @private
* @param {Float32Array} arr - array to copy
* @returns {Float32Array} new array
*/
function float32array( arr ) {
return new Float32Array( arr );
}
/**
* Copies a `Float64Array`.
*
* @private
* @param {Float64Array} arr - array to copy
* @returns {Float64Array} new array
*/
function float64array( arr ) {
return new Float64Array( arr );
}
/**
* Returns a hash of functions for copying typed arrays.
*
* @private
* @returns {Object} function hash
*/
function typedarrays() {
var out = {
'int8array': int8array,
'uint8array': uint8array,
'uint8clampedarray': uint8clampedarray,
'int16array': int16array,
'uint16array': uint16array,
'int32array': int32array,
'uint32array': uint32array,
'float32array': float32array,
'float64array': float64array
};
return out;
}
// MAIN //
hash = typedarrays();
// EXPORTS //
module.exports = hash;
},{"@stdlib/array/float32":2,"@stdlib/array/float64":5,"@stdlib/array/int16":7,"@stdlib/array/int32":10,"@stdlib/array/int8":13,"@stdlib/array/uint16":20,"@stdlib/array/uint32":23,"@stdlib/array/uint8":26,"@stdlib/array/uint8c":29}],389:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Define a non-enumerable read-only accessor.
*
* @module @stdlib/utils/define-nonenumerable-read-only-accessor
*
* @example
* var setNonEnumerableReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );
*
* function getter() {
* return 'bar';
* }
*
* var obj = {};
*
* setNonEnumerableReadOnlyAccessor( obj, 'foo', getter );
*
* try {
* obj.foo = 'boop';
* } catch ( err ) {
* console.error( err.message );
* }
*/
// MODULES //
var setNonEnumerableReadOnlyAccessor = require( './main.js' ); // eslint-disable-line id-length
// EXPORTS //
module.exports = setNonEnumerableReadOnlyAccessor;
},{"./main.js":390}],390:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var defineProperty = require( '@stdlib/utils/define-property' );
// MAIN //
/**
* Defines a non-enumerable read-only accessor.
*
* @param {Object} obj - object on which to define the property
* @param {(string|symbol)} prop - property name
* @param {Function} getter - accessor
*
* @example
* function getter() {
* return 'bar';
* }
*
* var obj = {};
*
* setNonEnumerableReadOnlyAccessor( obj, 'foo', getter );
*
* try {
* obj.foo = 'boop';
* } catch ( err ) {
* console.error( err.message );
* }
*/
function setNonEnumerableReadOnlyAccessor( obj, prop, getter ) { // eslint-disable-line id-length
defineProperty( obj, prop, {
'configurable': false,
'enumerable': false,
'get': getter
});
}
// EXPORTS //
module.exports = setNonEnumerableReadOnlyAccessor;
},{"@stdlib/utils/define-property":398}],391:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Define a non-enumerable read-only property.
*
* @module @stdlib/utils/define-nonenumerable-read-only-property
*
* @example
* var setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
*
* var obj = {};
*
* setNonEnumerableReadOnly( obj, 'foo', 'bar' );
*
* try {
* obj.foo = 'boop';
* } catch ( err ) {
* console.error( err.message );
* }
*/
// MODULES //
var setNonEnumerableReadOnly = require( './main.js' );
// EXPORTS //
module.exports = setNonEnumerableReadOnly;
},{"./main.js":392}],392:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var defineProperty = require( '@stdlib/utils/define-property' );
// MAIN //
/**
* Defines a non-enumerable read-only property.
*
* @param {Object} obj - object on which to define the property
* @param {(string|symbol)} prop - property name
* @param {*} value - value to set
*
* @example
* var obj = {};
*
* setNonEnumerableReadOnly( obj, 'foo', 'bar' );
*
* try {
* obj.foo = 'boop';
* } catch ( err ) {
* console.error( err.message );
* }
*/
function setNonEnumerableReadOnly( obj, prop, value ) {
defineProperty( obj, prop, {
'configurable': false,
'enumerable': false,
'writable': false,
'value': value
});
}
// EXPORTS //
module.exports = setNonEnumerableReadOnly;
},{"@stdlib/utils/define-property":398}],393:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Define a non-enumerable read-write accessor.
*
* @module @stdlib/utils/define-nonenumerable-read-write-accessor
*
* @example
* var setNonEnumerableReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );
*
* function getter() {
* return name + ' foo';
* }
*
* function setter( v ) {
* name = v;
* }
*
* var name = 'bar';
* var obj = {};
*
* setNonEnumerableReadWriteAccessor( obj, 'foo', getter, setter );
*
* var v = obj.foo;
* // returns 'bar foo'
*
* obj.foo = 'beep';
*
* v = obj.foo;
* // returns 'beep foo'
*/
// MODULES //
var setNonEnumerableReadWriteAccessor = require( './main.js' );
// EXPORTS //
module.exports = setNonEnumerableReadWriteAccessor;
},{"./main.js":394}],394:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var defineProperty = require( '@stdlib/utils/define-property' );
// MAIN //
/**
* Defines a non-enumerable read-write accessor.
*
* @param {Object} obj - object on which to define the property
* @param {(string|symbol)} prop - property name
* @param {Function} getter - get accessor
* @param {Function} setter - set accessor
*
* @example
* function getter() {
* return name + ' foo';
* }
*
* function setter( v ) {
* name = v;
* }
*
* var name = 'bar';
* var obj = {};
*
* setNonEnumerableReadWriteAccessor( obj, 'foo', getter, setter );
*
* var v = obj.foo;
* // returns 'bar foo'
*
* obj.foo = 'beep';
*
* v = obj.foo;
* // returns 'beep foo'
*/
function setNonEnumerableReadWriteAccessor( obj, prop, getter, setter ) { // eslint-disable-line id-length
defineProperty( obj, prop, {
'configurable': false,
'enumerable': false,
'get': getter,
'set': setter
});
}
// EXPORTS //
module.exports = setNonEnumerableReadWriteAccessor;
},{"@stdlib/utils/define-property":398}],395:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Defines (or modifies) an object property.
*
* ## Notes
*
* - Property descriptors come in two flavors: **data descriptors** and **accessor descriptors**. A data descriptor is a property that has a value, which may or may not be writable. An accessor descriptor is a property described by a getter-setter function pair. A descriptor must be one of these two flavors and cannot be both.
*
* @name defineProperty
* @type {Function}
* @param {Object} obj - object on which to define the property
* @param {(string|symbol)} prop - property name
* @param {Object} descriptor - property descriptor
* @param {boolean} [descriptor.configurable=false] - boolean indicating if property descriptor can be changed and if the property can be deleted from the provided object
* @param {boolean} [descriptor.enumerable=false] - boolean indicating if the property shows up when enumerating object properties
* @param {boolean} [descriptor.writable=false] - boolean indicating if the value associated with the property can be changed with an assignment operator
* @param {*} [descriptor.value] - property value
* @param {(Function|void)} [descriptor.get=undefined] - function which serves as a getter for the property, or, if no getter, undefined. When the property is accessed, a getter function is called without arguments and with the `this` context set to the object through which the property is accessed (which may not be the object on which the property is defined due to inheritance). The return value will be used as the property value.
* @param {(Function|void)} [descriptor.set=undefined] - function which serves as a setter for the property, or, if no setter, undefined. When assigning a property value, a setter function is called with one argument (the value being assigned to the property) and with the `this` context set to the object through which the property is assigned.
* @throws {TypeError} first argument must be an object
* @throws {TypeError} third argument must be an object
* @throws {Error} property descriptor cannot have both a value and a setter and/or getter
* @returns {Object} object with added property
*
* @example
* var obj = {};
*
* defineProperty( obj, 'foo', {
* 'value': 'bar'
* });
*
* var str = obj.foo;
* // returns 'bar'
*/
var defineProperty = Object.defineProperty;
// EXPORTS //
module.exports = defineProperty;
},{}],396:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var main = ( typeof Object.defineProperty === 'function' ) ? Object.defineProperty : null;
// EXPORTS //
module.exports = main;
},{}],397:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var defineProperty = require( './define_property.js' );
// MAIN //
/**
* Tests for `Object.defineProperty` support.
*
* @private
* @returns {boolean} boolean indicating if an environment has `Object.defineProperty` support
*
* @example
* var bool = hasDefinePropertySupport();
* // returns <boolean>
*/
function hasDefinePropertySupport() {
// Test basic support...
try {
defineProperty( {}, 'x', {} );
return true;
} catch ( err ) { // eslint-disable-line no-unused-vars
return false;
}
}
// EXPORTS //
module.exports = hasDefinePropertySupport;
},{"./define_property.js":396}],398:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Define (or modify) an object property.
*
* @module @stdlib/utils/define-property
*
* @example
* var defineProperty = require( '@stdlib/utils/define-property' );
*
* var obj = {};
* defineProperty( obj, 'foo', {
* 'value': 'bar',
* 'writable': false,
* 'configurable': false,
* 'enumerable': false
* });
* obj.foo = 'boop'; // => throws
*/
// MODULES //
var hasDefinePropertySupport = require( './has_define_property_support.js' );
var builtin = require( './builtin.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var defineProperty;
if ( hasDefinePropertySupport() ) {
defineProperty = builtin;
} else {
defineProperty = polyfill;
}
// EXPORTS //
module.exports = defineProperty;
},{"./builtin.js":395,"./has_define_property_support.js":397,"./polyfill.js":399}],399:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable no-underscore-dangle, no-proto */
'use strict';
// VARIABLES //
var objectProtoype = Object.prototype;
var toStr = objectProtoype.toString;
var defineGetter = objectProtoype.__defineGetter__;
var defineSetter = objectProtoype.__defineSetter__;
var lookupGetter = objectProtoype.__lookupGetter__;
var lookupSetter = objectProtoype.__lookupSetter__;
// MAIN //
/**
* Defines (or modifies) an object property.
*
* ## Notes
*
* - Property descriptors come in two flavors: **data descriptors** and **accessor descriptors**. A data descriptor is a property that has a value, which may or may not be writable. An accessor descriptor is a property described by a getter-setter function pair. A descriptor must be one of these two flavors and cannot be both.
*
* @param {Object} obj - object on which to define the property
* @param {string} prop - property name
* @param {Object} descriptor - property descriptor
* @param {boolean} [descriptor.configurable=false] - boolean indicating if property descriptor can be changed and if the property can be deleted from the provided object
* @param {boolean} [descriptor.enumerable=false] - boolean indicating if the property shows up when enumerating object properties
* @param {boolean} [descriptor.writable=false] - boolean indicating if the value associated with the property can be changed with an assignment operator
* @param {*} [descriptor.value] - property value
* @param {(Function|void)} [descriptor.get=undefined] - function which serves as a getter for the property, or, if no getter, undefined. When the property is accessed, a getter function is called without arguments and with the `this` context set to the object through which the property is accessed (which may not be the object on which the property is defined due to inheritance). The return value will be used as the property value.
* @param {(Function|void)} [descriptor.set=undefined] - function which serves as a setter for the property, or, if no setter, undefined. When assigning a property value, a setter function is called with one argument (the value being assigned to the property) and with the `this` context set to the object through which the property is assigned.
* @throws {TypeError} first argument must be an object
* @throws {TypeError} third argument must be an object
* @throws {Error} property descriptor cannot have both a value and a setter and/or getter
* @returns {Object} object with added property
*
* @example
* var obj = {};
*
* defineProperty( obj, 'foo', {
* 'value': 'bar'
* });
*
* var str = obj.foo;
* // returns 'bar'
*/
function defineProperty( obj, prop, descriptor ) {
var prototype;
var hasValue;
var hasGet;
var hasSet;
if ( typeof obj !== 'object' || obj === null || toStr.call( obj ) === '[object Array]' ) {
throw new TypeError( 'invalid argument. First argument must be an object. Value: `' + obj + '`.' );
}
if ( typeof descriptor !== 'object' || descriptor === null || toStr.call( descriptor ) === '[object Array]' ) {
throw new TypeError( 'invalid argument. Property descriptor must be an object. Value: `' + descriptor + '`.' );
}
hasValue = ( 'value' in descriptor );
if ( hasValue ) {
if (
lookupGetter.call( obj, prop ) ||
lookupSetter.call( obj, prop )
) {
// Override `__proto__` to avoid touching inherited accessors:
prototype = obj.__proto__;
obj.__proto__ = objectProtoype;
// Delete property as existing getters/setters prevent assigning value to specified property:
delete obj[ prop ];
obj[ prop ] = descriptor.value;
// Restore original prototype:
obj.__proto__ = prototype;
} else {
obj[ prop ] = descriptor.value;
}
}
hasGet = ( 'get' in descriptor );
hasSet = ( 'set' in descriptor );
if ( hasValue && ( hasGet || hasSet ) ) {
throw new Error( 'invalid argument. Cannot specify one or more accessors and a value or writable attribute in the property descriptor.' );
}
if ( hasGet && defineGetter ) {
defineGetter.call( obj, prop, descriptor.get );
}
if ( hasSet && defineSetter ) {
defineSetter.call( obj, prop, descriptor.set );
}
return obj;
}
// EXPORTS //
module.exports = defineProperty;
},{}],400:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Escape a regular expression string or pattern.
*
* @module @stdlib/utils/escape-regexp-string
*
* @example
* var rescape = require( '@stdlib/utils/escape-regexp-string' );
*
* var str = rescape( '[A-Z]*' );
* // returns '\\[A\\-Z\\]\\*'
*/
// MODULES //
var rescape = require( './main.js' );
// EXPORTS //
module.exports = rescape;
},{"./main.js":401}],401:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
// VARIABLES //
var RE_CHARS = /[-\/\\^$*+?.()|[\]{}]/g; // eslint-disable-line no-useless-escape
// MAIN //
/**
* Escapes a regular expression string.
*
* @param {string} str - regular expression string
* @throws {TypeError} first argument must be a string primitive
* @returns {string} escaped string
*
* @example
* var str = rescape( '[A-Z]*' );
* // returns '\\[A\\-Z\\]\\*'
*/
function rescape( str ) {
var len;
var s;
var i;
if ( !isString( str ) ) {
throw new TypeError( 'invalid argument. Must provide a regular expression string. Value: `' + str + '`.' );
}
// Check if the string starts with a forward slash...
if ( str[ 0 ] === '/' ) {
// Find the last forward slash...
len = str.length;
for ( i = len-1; i >= 0; i-- ) {
if ( str[ i ] === '/' ) {
break;
}
}
}
// If we searched the string to no avail or if the first letter is not `/`, assume that the string is not of the form `/[...]/[guimy]`:
if ( i === void 0 || i <= 0 ) {
return str.replace( RE_CHARS, '\\$&' );
}
// We need to de-construct the string...
s = str.substring( 1, i );
// Only escape the characters between the `/`:
s = s.replace( RE_CHARS, '\\$&' );
// Reassemble:
str = str[ 0 ] + s + str.substring( i );
return str;
}
// EXPORTS //
module.exports = rescape;
},{"@stdlib/assert/is-string":158}],402:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isFunction = require( '@stdlib/assert/is-function' );
var hasFunctionNameSupport = require( '@stdlib/assert/has-function-name-support' );
var RE = require( '@stdlib/regexp/function-name' ).REGEXP;
// VARIABLES //
var isFunctionNameSupported = hasFunctionNameSupport();
// MAIN //
/**
* Returns the name of a function.
*
* @param {Function} fcn - input function
* @throws {TypeError} must provide a function
* @returns {string} function name
*
* @example
* var v = functionName( Math.sqrt );
* // returns 'sqrt'
*
* @example
* var v = functionName( function foo(){} );
* // returns 'foo'
*
* @example
* var v = functionName( function(){} );
* // returns '' || 'anonymous'
*
* @example
* var v = functionName( String );
* // returns 'String'
*/
function functionName( fcn ) {
// TODO: add support for generator functions?
if ( isFunction( fcn ) === false ) {
throw new TypeError( 'invalid argument. Must provide a function. Value: `' + fcn + '`.' );
}
if ( isFunctionNameSupported ) {
return fcn.name;
}
return RE.exec( fcn.toString() )[ 1 ];
}
// EXPORTS //
module.exports = functionName;
},{"@stdlib/assert/has-function-name-support":39,"@stdlib/assert/is-function":102,"@stdlib/regexp/function-name":356}],403:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return the name of a function.
*
* @module @stdlib/utils/function-name
*
* @example
* var functionName = require( '@stdlib/utils/function-name' );
*
* var v = functionName( String );
* // returns 'String'
*
* v = functionName( function foo(){} );
* // returns 'foo'
*
* v = functionName( function(){} );
* // returns '' || 'anonymous'
*/
// MODULES //
var functionName = require( './function_name.js' );
// EXPORTS //
module.exports = functionName;
},{"./function_name.js":402}],404:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isFunction = require( '@stdlib/assert/is-function' );
var builtin = require( './native.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var getProto;
if ( isFunction( Object.getPrototypeOf ) ) {
getProto = builtin;
} else {
getProto = polyfill;
}
// EXPORTS //
module.exports = getProto;
},{"./native.js":407,"./polyfill.js":408,"@stdlib/assert/is-function":102}],405:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var getProto = require( './detect.js' );
// MAIN //
/**
* Returns the prototype of a provided object.
*
* @param {*} value - input value
* @returns {(Object|null)} prototype
*
* @example
* var proto = getPrototypeOf( {} );
* // returns {}
*/
function getPrototypeOf( value ) {
if (
value === null ||
value === void 0
) {
return null;
}
// In order to ensure consistent ES5/ES6 behavior, cast input value to an object (strings, numbers, booleans); ES5 `Object.getPrototypeOf` throws when provided primitives and ES6 `Object.getPrototypeOf` casts:
value = Object( value );
return getProto( value );
}
// EXPORTS //
module.exports = getPrototypeOf;
},{"./detect.js":404}],406:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return the prototype of a provided object.
*
* @module @stdlib/utils/get-prototype-of
*
* @example
* var getPrototype = require( '@stdlib/utils/get-prototype-of' );
*
* var proto = getPrototype( {} );
* // returns {}
*/
// MODULES //
var getPrototype = require( './get_prototype_of.js' );
// EXPORTS //
module.exports = getPrototype;
},{"./get_prototype_of.js":405}],407:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var getProto = Object.getPrototypeOf;
// EXPORTS //
module.exports = getProto;
},{}],408:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var nativeClass = require( '@stdlib/utils/native-class' );
var getProto = require( './proto.js' );
// MAIN //
/**
* Returns the prototype of a provided object.
*
* @private
* @param {Object} obj - input object
* @returns {(Object|null)} prototype
*/
function getPrototypeOf( obj ) {
var proto = getProto( obj );
if ( proto || proto === null ) {
return proto;
}
if ( nativeClass( obj.constructor ) === '[object Function]' ) {
// May break if the constructor has been tampered with...
return obj.constructor.prototype;
}
if ( obj instanceof Object ) {
return Object.prototype;
}
// Return `null` for objects created via `Object.create( null )`. Also return `null` for cross-realm objects on browsers that lack `__proto__` support, such as IE < 11.
return null;
}
// EXPORTS //
module.exports = getPrototypeOf;
},{"./proto.js":409,"@stdlib/utils/native-class":440}],409:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Returns the value of the `__proto__` property.
*
* @private
* @param {Object} obj - input object
* @returns {*} value of `__proto__` property
*/
function getProto( obj ) {
// eslint-disable-next-line no-proto
return obj.__proto__;
}
// EXPORTS //
module.exports = getProto;
},{}],410:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Returns the global object using code generation.
*
* @private
* @returns {Object} global object
*/
function getGlobal() {
return new Function( 'return this;' )(); // eslint-disable-line no-new-func
}
// EXPORTS //
module.exports = getGlobal;
},{}],411:[function(require,module,exports){
(function (global){(function (){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var obj = ( typeof global === 'object' ) ? global : null;
// EXPORTS //
module.exports = obj;
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],412:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return the global object.
*
* @module @stdlib/utils/global
*
* @example
* var getGlobal = require( '@stdlib/utils/global' );
*
* var g = getGlobal();
* // returns {...}
*/
// MODULES //
var getGlobal = require( './main.js' );
// EXPORTS //
module.exports = getGlobal;
},{"./main.js":413}],413:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var getThis = require( './codegen.js' );
var Self = require( './self.js' );
var Win = require( './window.js' );
var Global = require( './global.js' );
// MAIN //
/**
* Returns the global object.
*
* ## Notes
*
* - Using code generation is the **most** reliable way to resolve the global object; however, doing so is likely to violate content security policies (CSPs) in, e.g., Chrome Apps and elsewhere.
*
* @param {boolean} [codegen=false] - boolean indicating whether to use code generation to resolve the global object
* @throws {TypeError} must provide a boolean
* @throws {Error} unable to resolve global object
* @returns {Object} global object
*
* @example
* var g = getGlobal();
* // returns {...}
*/
function getGlobal( codegen ) {
if ( arguments.length ) {
if ( !isBoolean( codegen ) ) {
throw new TypeError( 'invalid argument. Must provide a boolean primitive. Value: `'+codegen+'`.' );
}
if ( codegen ) {
return getThis();
}
// Fall through...
}
// Case: browsers and web workers
if ( Self ) {
return Self;
}
// Case: browsers
if ( Win ) {
return Win;
}
// Case: Node.js
if ( Global ) {
return Global;
}
// Case: unknown
throw new Error( 'unexpected error. Unable to resolve global object.' );
}
// EXPORTS //
module.exports = getGlobal;
},{"./codegen.js":410,"./global.js":411,"./self.js":414,"./window.js":415,"@stdlib/assert/is-boolean":81}],414:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var obj = ( typeof self === 'object' ) ? self : null;
// EXPORTS //
module.exports = obj;
},{}],415:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var obj = ( typeof window === 'object' ) ? window : null;
// EXPORTS //
module.exports = obj;
},{}],416:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return the first index at which a given element can be found.
*
* @module @stdlib/utils/index-of
*
* @example
* var indexOf = require( '@stdlib/utils/index-of' );
*
* var arr = [ 4, 3, 2, 1 ];
* var idx = indexOf( arr, 3 );
* // returns 1
*
* arr = [ 4, 3, 2, 1 ];
* idx = indexOf( arr, 5 );
* // returns -1
*
* // Using a `fromIndex`:
* arr = [ 1, 2, 3, 4, 5, 2, 6 ];
* idx = indexOf( arr, 2, 3 );
* // returns 5
*
* // `fromIndex` which exceeds `array` length:
* arr = [ 1, 2, 3, 4, 2, 5 ];
* idx = indexOf( arr, 2, 10 );
* // returns -1
*
* // Negative `fromIndex`:
* arr = [ 1, 2, 3, 4, 5, 2, 6, 2 ];
* idx = indexOf( arr, 2, -4 );
* // returns 5
*
* idx = indexOf( arr, 2, -1 );
* // returns 7
*
* // Negative `fromIndex` exceeding input `array` length:
* arr = [ 1, 2, 3, 4, 5, 2, 6 ];
* idx = indexOf( arr, 2, -10 );
* // returns 1
*
* // Array-like objects:
* var str = 'bebop';
* idx = indexOf( str, 'o' );
* // returns 3
*/
// MODULES //
var indexOf = require( './index_of.js' );
// EXPORTS //
module.exports = indexOf;
},{"./index_of.js":417}],417:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isnan = require( '@stdlib/assert/is-nan' );
var isCollection = require( '@stdlib/assert/is-collection' );
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;
// MAIN //
/**
* Returns the first index at which a given element can be found.
*
* @param {ArrayLike} arr - array-like object
* @param {*} searchElement - element to find
* @param {integer} [fromIndex] - starting index (if negative, the start index is determined relative to last element)
* @throws {TypeError} must provide an array-like object
* @throws {TypeError} `fromIndex` must be an integer
* @returns {integer} index or -1
*
* @example
* var arr = [ 4, 3, 2, 1 ];
* var idx = indexOf( arr, 3 );
* // returns 1
*
* @example
* var arr = [ 4, 3, 2, 1 ];
* var idx = indexOf( arr, 5 );
* // returns -1
*
* @example
* // Using a `fromIndex`:
* var arr = [ 1, 2, 3, 4, 5, 2, 6 ];
* var idx = indexOf( arr, 2, 3 );
* // returns 5
*
* @example
* // `fromIndex` which exceeds `array` length:
* var arr = [ 1, 2, 3, 4, 2, 5 ];
* var idx = indexOf( arr, 2, 10 );
* // returns -1
*
* @example
* // Negative `fromIndex`:
* var arr = [ 1, 2, 3, 4, 5, 2, 6, 2 ];
* var idx = indexOf( arr, 2, -4 );
* // returns 5
*
* idx = indexOf( arr, 2, -1 );
* // returns 7
*
* @example
* // Negative `fromIndex` exceeding input `array` length:
* var arr = [ 1, 2, 3, 4, 5, 2, 6 ];
* var idx = indexOf( arr, 2, -10 );
* // returns 1
*
* @example
* // Array-like objects:
* var str = 'bebop';
* var idx = indexOf( str, 'o' );
* // returns 3
*/
function indexOf( arr, searchElement, fromIndex ) {
var len;
var i;
if ( !isCollection( arr ) && !isString( arr ) ) {
throw new TypeError( 'invalid argument. First argument must be an array-like object. Value: `' + arr + '`.' );
}
len = arr.length;
if ( len === 0 ) {
return -1;
}
if ( arguments.length === 3 ) {
if ( !isInteger( fromIndex ) ) {
throw new TypeError( 'invalid argument. `fromIndex` must be an integer. Value: `' + fromIndex + '`.' );
}
if ( fromIndex >= 0 ) {
if ( fromIndex >= len ) {
return -1;
}
i = fromIndex;
} else {
i = len + fromIndex;
if ( i < 0 ) {
i = 0;
}
}
} else {
i = 0;
}
// Check for `NaN`...
if ( isnan( searchElement ) ) {
for ( ; i < len; i++ ) {
if ( isnan( arr[i] ) ) {
return i;
}
}
} else {
for ( ; i < len; i++ ) {
if ( arr[ i ] === searchElement ) {
return i;
}
}
}
return -1;
}
// EXPORTS //
module.exports = indexOf;
},{"@stdlib/assert/is-collection":90,"@stdlib/assert/is-integer":110,"@stdlib/assert/is-nan":118,"@stdlib/assert/is-string":158}],418:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var builtin = require( './native.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var createObject;
if ( typeof builtin === 'function' ) {
createObject = builtin;
} else {
createObject = polyfill;
}
// EXPORTS //
module.exports = createObject;
},{"./native.js":421,"./polyfill.js":422}],419:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Implement prototypical inheritance by replacing the prototype of one constructor with the prototype of another constructor.
*
* @module @stdlib/utils/inherit
*
* @example
* var inherit = require( '@stdlib/utils/inherit' );
*
* function Foo() {
* return this;
* }
* Foo.prototype.beep = function beep() {
* return 'boop';
* };
*
* function Bar() {
* Foo.call( this );
* return this;
* }
* inherit( Bar, Foo );
*
* var bar = new Bar();
* var v = bar.beep();
* // returns 'boop'
*/
// MODULES //
var inherit = require( './inherit.js' );
// EXPORTS //
module.exports = inherit;
},{"./inherit.js":420}],420:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var defineProperty = require( '@stdlib/utils/define-property' );
var validate = require( './validate.js' );
var createObject = require( './detect.js' );
// MAIN //
/**
* Implements prototypical inheritance by replacing the prototype of one constructor with the prototype of another constructor.
*
* ## Notes
*
* - This implementation is not designed to work with ES2015/ES6 classes. For ES2015/ES6 classes, use `class` with `extends`.
* - For reference, see [node#3455](https://github.com/nodejs/node/pull/3455), [node#4179](https://github.com/nodejs/node/issues/4179), [node#3452](https://github.com/nodejs/node/issues/3452), and [node commit](https://github.com/nodejs/node/commit/29da8cf8d7ab8f66b9091ab22664067d4468461e#diff-3deb3f32958bb937ae05c6f3e4abbdf5).
*
*
* @param {(Object|Function)} ctor - constructor which will inherit
* @param {(Object|Function)} superCtor - super (parent) constructor
* @throws {TypeError} first argument must be either an object or a function which can inherit
* @throws {TypeError} second argument must be either an object or a function from which a constructor can inherit
* @throws {TypeError} second argument must have an inheritable prototype
* @returns {(Object|Function)} child constructor
*
* @example
* function Foo() {
* return this;
* }
* Foo.prototype.beep = function beep() {
* return 'boop';
* };
*
* function Bar() {
* Foo.call( this );
* return this;
* }
* inherit( Bar, Foo );
*
* var bar = new Bar();
* var v = bar.beep();
* // returns 'boop'
*/
function inherit( ctor, superCtor ) {
var err = validate( ctor );
if ( err ) {
throw err;
}
err = validate( superCtor );
if ( err ) {
throw err;
}
if ( typeof superCtor.prototype === 'undefined' ) {
throw new TypeError( 'invalid argument. Second argument must have a prototype from which another object can inherit. Value: `'+superCtor.prototype+'`.' );
}
// Create a prototype which inherits from the parent prototype:
ctor.prototype = createObject( superCtor.prototype );
// Set the constructor to refer to the child constructor:
defineProperty( ctor.prototype, 'constructor', {
'configurable': true,
'enumerable': false,
'writable': true,
'value': ctor
});
return ctor;
}
// EXPORTS //
module.exports = inherit;
},{"./detect.js":418,"./validate.js":423,"@stdlib/utils/define-property":398}],421:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// EXPORTS //
module.exports = Object.create;
},{}],422:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// FUNCTIONS //
/**
* Dummy constructor.
*
* @private
*/
function Ctor() {
// Empty...
}
// MAIN //
/**
* An `Object.create` shim for older JavaScript engines.
*
* @private
* @param {Object} proto - prototype
* @returns {Object} created object
*
* @example
* var obj = createObject( Object.prototype );
* // returns {}
*/
function createObject( proto ) {
Ctor.prototype = proto;
return new Ctor();
}
// EXPORTS //
module.exports = createObject;
},{}],423:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Tests that a value is a valid constructor.
*
* @private
* @param {*} value - value to test
* @returns {(Error|null)} error object or null
*
* @example
* var ctor = function ctor() {};
*
* var err = validate( ctor );
* // returns null
*
* err = validate( null );
* // returns <TypeError>
*/
function validate( value ) {
var type = typeof value;
if (
value === null ||
(type !== 'object' && type !== 'function')
) {
return new TypeError( 'invalid argument. A provided constructor must be either an object (except null) or a function. Value: `'+value+'`.' );
}
return null;
}
// EXPORTS //
module.exports = validate;
},{}],424:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Returns an array of an object's own enumerable property names.
*
* ## Notes
*
* - In contrast to the built-in `Object.keys()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.
*
* @private
* @param {*} value - input object
* @returns {Array} a list of own enumerable property names
*
* @example
* var obj = {
* 'beep': 'boop',
* 'foo': 3.14
* };
*
* var k = keys( obj );
* // e.g., returns [ 'beep', 'foo' ]
*/
function keys( value ) {
return Object.keys( Object( value ) );
}
// EXPORTS //
module.exports = keys;
},{}],425:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isArguments = require( '@stdlib/assert/is-arguments' );
var builtin = require( './builtin.js' );
// VARIABLES //
var slice = Array.prototype.slice;
// MAIN //
/**
* Returns an array of an object's own enumerable property names.
*
* @private
* @param {*} value - input object
* @returns {Array} a list of own enumerable property names
*
* @example
* var obj = {
* 'beep': 'boop',
* 'foo': 3.14
* };
*
* var k = keys( obj );
* // e.g., returns [ 'beep', 'foo' ]
*/
function keys( value ) {
if ( isArguments( value ) ) {
return builtin( slice.call( value ) );
}
return builtin( value );
}
// EXPORTS //
module.exports = keys;
},{"./builtin.js":424,"@stdlib/assert/is-arguments":74}],426:[function(require,module,exports){
module.exports=[
"console",
"external",
"frame",
"frameElement",
"frames",
"innerHeight",
"innerWidth",
"outerHeight",
"outerWidth",
"pageXOffset",
"pageYOffset",
"parent",
"scrollLeft",
"scrollTop",
"scrollX",
"scrollY",
"self",
"webkitIndexedDB",
"webkitStorageInfo",
"window"
]
},{}],427:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var keys = require( './builtin.js' );
// FUNCTIONS //
/**
* Tests the built-in `Object.keys()` implementation when provided `arguments`.
*
* @private
* @returns {boolean} boolean indicating whether the built-in implementation returns the expected number of keys
*/
function test() {
return ( keys( arguments ) || '' ).length !== 2;
}
// MAIN //
/**
* Tests whether the built-in `Object.keys()` implementation supports providing `arguments` as an input value.
*
* ## Notes
*
* - Safari 5.0 does **not** support `arguments` as an input value.
*
* @private
* @returns {boolean} boolean indicating whether a built-in implementation supports `arguments`
*/
function check() {
return test( 1, 2 );
}
// EXPORTS //
module.exports = check;
},{"./builtin.js":424}],428:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var indexOf = require( '@stdlib/utils/index-of' );
var typeOf = require( '@stdlib/utils/type-of' );
var isConstructorPrototype = require( './is_constructor_prototype.js' );
var EXCLUDED_KEYS = require( './excluded_keys.json' );
var win = require( './window.js' );
// VARIABLES //
var bool;
// FUNCTIONS //
/**
* Determines whether an environment throws when comparing to the prototype of a value's constructor (e.g., [IE9][1]).
*
* [1]: https://stackoverflow.com/questions/7688070/why-is-comparing-the-constructor-property-of-two-windows-unreliable
*
* @private
* @returns {boolean} boolean indicating whether an environment is buggy
*/
function check() {
var k;
if ( typeOf( win ) === 'undefined' ) {
return false;
}
for ( k in win ) { // eslint-disable-line guard-for-in
try {
if (
indexOf( EXCLUDED_KEYS, k ) === -1 &&
hasOwnProp( win, k ) &&
win[ k ] !== null &&
typeOf( win[ k ] ) === 'object'
) {
isConstructorPrototype( win[ k ] );
}
} catch ( err ) { // eslint-disable-line no-unused-vars
return true;
}
}
return false;
}
// MAIN //
bool = check();
// EXPORTS //
module.exports = bool;
},{"./excluded_keys.json":426,"./is_constructor_prototype.js":434,"./window.js":439,"@stdlib/assert/has-own-property":53,"@stdlib/utils/index-of":416,"@stdlib/utils/type-of":467}],429:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var bool = ( typeof Object.keys !== 'undefined' );
// EXPORTS //
module.exports = bool;
},{}],430:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isEnumerableProperty = require( '@stdlib/assert/is-enumerable-property' );
var noop = require( '@stdlib/utils/noop' );
// MAIN //
// Note: certain environments treat an object's prototype as enumerable, which, as a matter of convention, it shouldn't be...
var bool = isEnumerableProperty( noop, 'prototype' );
// EXPORTS //
module.exports = bool;
},{"@stdlib/assert/is-enumerable-property":93,"@stdlib/utils/noop":447}],431:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isEnumerableProperty = require( '@stdlib/assert/is-enumerable-property' );
// VARIABLES //
var obj = {
'toString': null
};
// MAIN //
// Note: certain environments don't allow enumeration of overwritten properties which are considered non-enumerable...
var bool = !isEnumerableProperty( obj, 'toString' );
// EXPORTS //
module.exports = bool;
},{"@stdlib/assert/is-enumerable-property":93}],432:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var bool = ( typeof window !== 'undefined' );
// EXPORTS //
module.exports = bool;
},{}],433:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return an array of an object's own enumerable property names.
*
* @module @stdlib/utils/keys
*
* @example
* var keys = require( '@stdlib/utils/keys' );
*
* var obj = {
* 'beep': 'boop',
* 'foo': 3.14
* };
*
* var k = keys( obj );
* // e.g., returns [ 'beep', 'foo' ]
*/
// MODULES //
var keys = require( './main.js' );
// EXPORTS //
module.exports = keys;
},{"./main.js":436}],434:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
/**
* Tests whether a value equals the prototype of its constructor.
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether a value equals the prototype of its constructor
*/
function isConstructorPrototype( value ) {
return ( value.constructor && value.constructor.prototype === value );
}
// EXPORTS //
module.exports = isConstructorPrototype;
},{}],435:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var hasAutomationEqualityBug = require( './has_automation_equality_bug.js' );
var isConstructorPrototype = require( './is_constructor_prototype.js' );
var HAS_WINDOW = require( './has_window.js' );
// MAIN //
/**
* Wraps the test for constructor prototype equality to accommodate buggy environments (e.g., environments which throw when testing equality).
*
* @private
* @param {*} value - value to test
* @returns {boolean} boolean indicating whether a value equals the prototype of its constructor
*/
function wrapper( value ) {
if ( HAS_WINDOW === false && !hasAutomationEqualityBug ) {
return isConstructorPrototype( value );
}
try {
return isConstructorPrototype( value );
} catch ( error ) { // eslint-disable-line no-unused-vars
return false;
}
}
// EXPORTS //
module.exports = wrapper;
},{"./has_automation_equality_bug.js":428,"./has_window.js":432,"./is_constructor_prototype.js":434}],436:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var hasArgumentsBug = require( './has_arguments_bug.js' );
var HAS_BUILTIN = require( './has_builtin.js' );
var builtin = require( './builtin.js' );
var wrapper = require( './builtin_wrapper.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
/**
* Returns an array of an object's own enumerable property names.
*
* @name keys
* @type {Function}
* @param {*} value - input object
* @returns {Array} a list of own enumerable property names
*
* @example
* var obj = {
* 'beep': 'boop',
* 'foo': 3.14
* };
*
* var k = keys( obj );
* // e.g., returns [ 'beep', 'foo' ]
*/
var keys;
if ( HAS_BUILTIN ) {
if ( hasArgumentsBug() ) {
keys = wrapper;
} else {
keys = builtin;
}
} else {
keys = polyfill;
}
// EXPORTS //
module.exports = keys;
},{"./builtin.js":424,"./builtin_wrapper.js":425,"./has_arguments_bug.js":427,"./has_builtin.js":429,"./polyfill.js":438}],437:[function(require,module,exports){
module.exports=[
"toString",
"toLocaleString",
"valueOf",
"hasOwnProperty",
"isPrototypeOf",
"propertyIsEnumerable",
"constructor"
]
},{}],438:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isObjectLike = require( '@stdlib/assert/is-object-like' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var isArguments = require( '@stdlib/assert/is-arguments' );
var HAS_ENUM_PROTO_BUG = require( './has_enumerable_prototype_bug.js' );
var HAS_NON_ENUM_PROPS_BUG = require( './has_non_enumerable_properties_bug.js' );
var isConstructorPrototype = require( './is_constructor_prototype_wrapper.js' );
var NON_ENUMERABLE = require( './non_enumerable.json' );
// MAIN //
/**
* Returns an array of an object's own enumerable property names.
*
* @private
* @param {*} value - input object
* @returns {Array} a list of own enumerable property names
*
* @example
* var obj = {
* 'beep': 'boop',
* 'foo': 3.14
* };
*
* var k = keys( obj );
* // e.g., returns [ 'beep', 'foo' ]
*/
function keys( value ) {
var skipConstructor;
var skipPrototype;
var isFcn;
var out;
var k;
var p;
var i;
out = [];
if ( isArguments( value ) ) {
// Account for environments which treat `arguments` differently...
for ( i = 0; i < value.length; i++ ) {
out.push( i.toString() );
}
// Note: yes, we are precluding the `arguments` array-like object from having other enumerable properties; however, this should (1) be very rare and (2) not be encouraged (e.g., doing something like `arguments.a = 'b'`; in certain engines directly manipulating the `arguments` value results in automatic de-optimization).
return out;
}
if ( typeof value === 'string' ) {
// Account for environments which do not treat string character indices as "own" properties...
if ( value.length > 0 && !hasOwnProp( value, '0' ) ) {
for ( i = 0; i < value.length; i++ ) {
out.push( i.toString() );
}
}
} else {
isFcn = ( typeof value === 'function' );
if ( isFcn === false && !isObjectLike( value ) ) {
return out;
}
skipPrototype = ( HAS_ENUM_PROTO_BUG && isFcn );
}
for ( k in value ) {
if ( !( skipPrototype && k === 'prototype' ) && hasOwnProp( value, k ) ) {
out.push( String( k ) );
}
}
if ( HAS_NON_ENUM_PROPS_BUG ) {
skipConstructor = isConstructorPrototype( value );
for ( i = 0; i < NON_ENUMERABLE.length; i++ ) {
p = NON_ENUMERABLE[ i ];
if ( !( skipConstructor && p === 'constructor' ) && hasOwnProp( value, p ) ) {
out.push( String( p ) );
}
}
}
return out;
}
// EXPORTS //
module.exports = keys;
},{"./has_enumerable_prototype_bug.js":430,"./has_non_enumerable_properties_bug.js":431,"./is_constructor_prototype_wrapper.js":435,"./non_enumerable.json":437,"@stdlib/assert/has-own-property":53,"@stdlib/assert/is-arguments":74,"@stdlib/assert/is-object-like":143}],439:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var w = ( typeof window === 'undefined' ) ? void 0 : window;
// EXPORTS //
module.exports = w;
},{}],440:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return a string value indicating a specification defined classification of an object.
*
* @module @stdlib/utils/native-class
*
* @example
* var nativeClass = require( '@stdlib/utils/native-class' );
*
* var str = nativeClass( 'a' );
* // returns '[object String]'
*
* str = nativeClass( 5 );
* // returns '[object Number]'
*
* function Beep() {
* return this;
* }
* str = nativeClass( new Beep() );
* // returns '[object Object]'
*/
// MODULES //
var hasToStringTag = require( '@stdlib/assert/has-tostringtag-support' );
var builtin = require( './native_class.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var nativeClass;
if ( hasToStringTag() ) {
nativeClass = polyfill;
} else {
nativeClass = builtin;
}
// EXPORTS //
module.exports = nativeClass;
},{"./native_class.js":441,"./polyfill.js":442,"@stdlib/assert/has-tostringtag-support":57}],441:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var toStr = require( './tostring.js' );
// MAIN //
/**
* Returns a string value indicating a specification defined classification (via the internal property `[[Class]]`) of an object.
*
* @param {*} v - input value
* @returns {string} string value indicating a specification defined classification of the input value
*
* @example
* var str = nativeClass( 'a' );
* // returns '[object String]'
*
* @example
* var str = nativeClass( 5 );
* // returns '[object Number]'
*
* @example
* function Beep() {
* return this;
* }
* var str = nativeClass( new Beep() );
* // returns '[object Object]'
*/
function nativeClass( v ) {
return toStr.call( v );
}
// EXPORTS //
module.exports = nativeClass;
},{"./tostring.js":443}],442:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var toStringTag = require( './tostringtag.js' );
var toStr = require( './tostring.js' );
// MAIN //
/**
* Returns a string value indicating a specification defined classification of an object in environments supporting `Symbol.toStringTag`.
*
* @param {*} v - input value
* @returns {string} string value indicating a specification defined classification of the input value
*
* @example
* var str = nativeClass( 'a' );
* // returns '[object String]'
*
* @example
* var str = nativeClass( 5 );
* // returns '[object Number]'
*
* @example
* function Beep() {
* return this;
* }
* var str = nativeClass( new Beep() );
* // returns '[object Object]'
*/
function nativeClass( v ) {
var isOwn;
var tag;
var out;
if ( v === null || v === void 0 ) {
return toStr.call( v );
}
tag = v[ toStringTag ];
isOwn = hasOwnProp( v, toStringTag );
// Attempt to override the `toStringTag` property. For built-ins having a `Symbol.toStringTag` property (e.g., `JSON`, `Math`, etc), the `Symbol.toStringTag` property is read-only (e.g., , so we need to wrap in a `try/catch`.
try {
v[ toStringTag ] = void 0;
} catch ( err ) { // eslint-disable-line no-unused-vars
return toStr.call( v );
}
out = toStr.call( v );
if ( isOwn ) {
v[ toStringTag ] = tag;
} else {
delete v[ toStringTag ];
}
return out;
}
// EXPORTS //
module.exports = nativeClass;
},{"./tostring.js":443,"./tostringtag.js":444,"@stdlib/assert/has-own-property":53}],443:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var toStr = Object.prototype.toString;
// EXPORTS //
module.exports = toStr;
},{}],444:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var toStrTag = ( typeof Symbol === 'function' ) ? Symbol.toStringTag : '';
// EXPORTS //
module.exports = toStrTag;
},{}],445:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2020 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Add a callback to the "next tick queue".
*
* @module @stdlib/utils/next-tick
*
* @example
* var nextTick = require( '@stdlib/utils/next-tick' );
*
* function beep() {
* console.log( 'boop' );
* }
*
* nextTick( beep );
*/
// MODULES //
var nextTick = require( './main.js' );
// EXPORTS //
module.exports = nextTick;
},{"./main.js":446}],446:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2020 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var proc = require( 'process' );
// MAIN //
/**
* Adds a callback to the "next tick queue".
*
* ## Notes
*
* - The queue is fully drained after the current operation on the JavaScript stack runs to completion and before the event loop is allowed to continue.
*
* @param {Callback} clbk - callback
* @param {...*} [args] - arguments to provide to the callback upon invocation
*
* @example
* function beep() {
* console.log( 'boop' );
* }
*
* nextTick( beep );
*/
function nextTick( clbk ) {
var args;
var i;
args = [];
for ( i = 1; i < arguments.length; i++ ) {
args.push( arguments[ i ] );
}
proc.nextTick( wrapper );
/**
* Callback wrapper.
*
* ## Notes
*
* - The ability to provide additional arguments was added in Node.js v1.8.1. The wrapper provides support for earlier Node.js versions.
*
* @private
*/
function wrapper() {
clbk.apply( null, args );
}
}
// EXPORTS //
module.exports = nextTick;
},{"process":483}],447:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* No operation.
*
* @module @stdlib/utils/noop
*
* @example
* var noop = require( '@stdlib/utils/noop' );
*
* noop();
* // ...does nothing.
*/
// MODULES //
var noop = require( './noop.js' );
// EXPORTS //
module.exports = noop;
},{"./noop.js":448}],448:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* No operation.
*
* @example
* noop();
* // ...does nothing.
*/
function noop() {
// Empty function...
}
// EXPORTS //
module.exports = noop;
},{}],449:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return a partial object copy excluding specified keys.
*
* @module @stdlib/utils/omit
*
* @example
* var omit = require( '@stdlib/utils/omit' );
*
* var obj1 = {
* 'a': 1,
* 'b': 2
* };
*
* var obj2 = omit( obj1, 'b' );
* // returns { 'a': 1 }
*/
// MODULES //
var omit = require( './omit.js' );
// EXPORTS //
module.exports = omit;
},{"./omit.js":450}],450:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var objectKeys = require( '@stdlib/utils/keys' );
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;
var indexOf = require( '@stdlib/utils/index-of' );
// MAIN //
/**
* Returns a partial object copy excluding specified keys.
*
* @param {Object} obj - source object
* @param {(string|StringArray)} keys - keys to exclude
* @throws {TypeError} first argument must be an object
* @throws {TypeError} second argument must be either a string or an array of strings
* @returns {Object} new object
*
* @example
* var obj1 = {
* 'a': 1,
* 'b': 2
* };
*
* var obj2 = omit( obj1, 'b' );
* // returns { 'a': 1 }
*/
function omit( obj, keys ) {
var ownKeys;
var out;
var key;
var i;
if ( typeof obj !== 'object' || obj === null ) {
throw new TypeError( 'invalid argument. First argument must be an object. Value: `'+obj+'`.' );
}
ownKeys = objectKeys( obj );
out = {};
if ( isString( keys ) ) {
for ( i = 0; i < ownKeys.length; i++ ) {
key = ownKeys[ i ];
if ( key !== keys ) {
out[ key ] = obj[ key ];
}
}
return out;
}
if ( isStringArray( keys ) ) {
for ( i = 0; i < ownKeys.length; i++ ) {
key = ownKeys[ i ];
if ( indexOf( keys, key ) === -1 ) {
out[ key ] = obj[ key ];
}
}
return out;
}
throw new TypeError( 'invalid argument. Second argument must be either a string primitive or an array of string primitives. Value: `'+keys+'`.' );
}
// EXPORTS //
module.exports = omit;
},{"@stdlib/assert/is-string":158,"@stdlib/assert/is-string-array":157,"@stdlib/utils/index-of":416,"@stdlib/utils/keys":433}],451:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return a partial object copy containing only specified keys.
*
* @module @stdlib/utils/pick
*
* @example
* var pick = require( '@stdlib/utils/pick' );
*
* var obj1 = {
* 'a': 1,
* 'b': 2
* };
*
* var obj2 = pick( obj1, 'b' );
* // returns { 'b': 2 }
*/
// MODULES //
var pick = require( './pick.js' );
// EXPORTS //
module.exports = pick;
},{"./pick.js":452}],452:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
// MAIN //
/**
* Returns a partial object copy containing only specified keys. If a key does not exist as an own property in a source object, the key is ignored.
*
* @param {Object} obj - source object
* @param {(string|StringArray)} keys - keys to copy
* @throws {TypeError} first argument must be an object
* @throws {TypeError} second argument must be either a string or an array of strings
* @returns {Object} new object
*
* @example
* var obj1 = {
* 'a': 1,
* 'b': 2
* };
*
* var obj2 = pick( obj1, 'b' );
* // returns { 'b': 2 }
*/
function pick( obj, keys ) {
var out;
var key;
var i;
if ( typeof obj !== 'object' || obj === null ) {
throw new TypeError( 'invalid argument. First argument must be an object. Value: `'+obj+'`.' );
}
out = {};
if ( isString( keys ) ) {
if ( hasOwnProp( obj, keys ) ) {
out[ keys ] = obj[ keys ];
}
return out;
}
if ( isStringArray( keys ) ) {
for ( i = 0; i < keys.length; i++ ) {
key = keys[ i ];
if ( hasOwnProp( obj, key ) ) {
out[ key ] = obj[ key ];
}
}
return out;
}
throw new TypeError( 'invalid argument. Second argument must be either a string primitive or an array of string primitives. Value: `'+keys+'`.' );
}
// EXPORTS //
module.exports = pick;
},{"@stdlib/assert/has-own-property":53,"@stdlib/assert/is-string":158,"@stdlib/assert/is-string-array":157}],453:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// VARIABLES //
var propertyDescriptor = Object.getOwnPropertyDescriptor;
// MAIN //
/**
* Returns a property descriptor for an object's own property.
*
* ## Notes
*
* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if provided `undefined` or `null`, rather than throwing an error.
* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if an object does not have a provided property, rather than `undefined`.
*
* @private
* @param {*} value - input object
* @param {(string|symbol)} property - property
* @returns {(Object|null)} property descriptor or null
*
* @example
* var obj = {
* 'beep': 'boop',
* 'foo': 3.14
* };
*
* var desc = getOwnPropertyDescriptor( obj, 'foo' );
* // returns {'configurable':true,'enumerable':true,'writable':true,'value':3.14}
*/
function getOwnPropertyDescriptor( value, property ) {
var desc;
if ( value === null || value === void 0 ) {
return null;
}
desc = propertyDescriptor( value, property );
return ( desc === void 0 ) ? null : desc;
}
// EXPORTS //
module.exports = getOwnPropertyDescriptor;
},{}],454:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var bool = ( typeof Object.getOwnPropertyDescriptor !== 'undefined' );
// EXPORTS //
module.exports = bool;
},{}],455:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return a property descriptor for an object's own property.
*
* @module @stdlib/utils/property-descriptor
*
* @example
* var getOwnPropertyDescriptor = require( '@stdlib/utils/property-descriptor' );
*
* var obj = {
* 'foo': 'bar',
* 'beep': 'boop'
* };
*
* var keys = getOwnPropertyDescriptor( obj, 'foo' );
* // returns {'configurable':true,'enumerable':true,'writable':true,'value':'bar'}
*/
// MODULES //
var HAS_BUILTIN = require( './has_builtin.js' );
var builtin = require( './builtin.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var main;
if ( HAS_BUILTIN ) {
main = builtin;
} else {
main = polyfill;
}
// EXPORTS //
module.exports = main;
},{"./builtin.js":453,"./has_builtin.js":454,"./polyfill.js":456}],456:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
// MAIN //
/**
* Returns a property descriptor for an object's own property.
*
* ## Notes
*
* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if provided `undefined` or `null`, rather than throwing an error.
* - In contrast to the built-in `Object.getOwnPropertyDescriptor()`, this function returns `null` if an object does not have a provided property, rather than `undefined`.
* - In environments lacking `Object.getOwnPropertyDescriptor()` support, property descriptors do not exist. In non-supporting environment, if an object has a provided property, this function returns a descriptor object equivalent to that returned in a supporting environment; otherwise, the function returns `null`.
*
* @private
* @param {*} value - input object
* @param {(string|symbol)} property - property
* @returns {(Object|null)} property descriptor or null
*
* @example
* var obj = {
* 'beep': 'boop',
* 'foo': 3.14
* };
*
* var desc = getOwnPropertyDescriptor( obj, 'foo' );
* // returns {'configurable':true,'enumerable':true,'writable':true,'value':3.14}
*/
function getOwnPropertyDescriptor( value, property ) {
if ( hasOwnProp( value, property ) ) {
return {
'configurable': true,
'enumerable': true,
'writable': true,
'value': value[ property ]
};
}
return null;
}
// EXPORTS //
module.exports = getOwnPropertyDescriptor;
},{"@stdlib/assert/has-own-property":53}],457:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// VARIABLES //
var propertyNames = Object.getOwnPropertyNames;
// MAIN //
/**
* Returns an array of an object's own enumerable and non-enumerable property names.
*
* ## Notes
*
* - In contrast to the built-in `Object.getOwnPropertyNames()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.
*
* @private
* @param {*} value - input object
* @returns {Array} a list of own property names
*
* @example
* var obj = {
* 'beep': 'boop',
* 'foo': 3.14
* };
*
* var keys = getOwnPropertyNames( obj );
* // e.g., returns [ 'beep', 'foo' ]
*/
function getOwnPropertyNames( value ) {
return propertyNames( Object( value ) );
}
// EXPORTS //
module.exports = getOwnPropertyNames;
},{}],458:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MAIN //
var bool = ( typeof Object.getOwnPropertyNames !== 'undefined' );
// EXPORTS //
module.exports = bool;
},{}],459:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Return an array of an object's own enumerable and non-enumerable property names.
*
* @module @stdlib/utils/property-names
*
* @example
* var getOwnPropertyNames = require( '@stdlib/utils/property-names' );
*
* var keys = getOwnPropertyNames({
* 'foo': 'bar',
* 'beep': 'boop'
* });
* // e.g., returns [ 'foo', 'beep' ]
*/
// MODULES //
var HAS_BUILTIN = require( './has_builtin.js' );
var builtin = require( './builtin.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var main;
if ( HAS_BUILTIN ) {
main = builtin;
} else {
main = polyfill;
}
// EXPORTS //
module.exports = main;
},{"./builtin.js":457,"./has_builtin.js":458,"./polyfill.js":460}],460:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var keys = require( '@stdlib/utils/keys' );
// MAIN //
/**
* Returns an array of an object's own enumerable and non-enumerable property names.
*
* ## Notes
*
* - In contrast to the built-in `Object.getOwnPropertyNames()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.
* - In environments lacking support for `Object.getOwnPropertyNames()`, property descriptors are unavailable, and thus all properties can be safely assumed to be enumerable. Hence, we can defer to calling `Object.keys`, which retrieves all own enumerable property names.
*
* @private
* @param {*} value - input object
* @returns {Array} a list of own property names
*
* @example
* var obj = {
* 'beep': 'boop',
* 'foo': 3.14
* };
*
* var keys = getOwnPropertyNames( obj );
* // e.g., returns [ 'beep', 'foo' ]
*/
function getOwnPropertyNames( value ) {
return keys( Object( value ) );
}
// EXPORTS //
module.exports = getOwnPropertyNames;
},{"@stdlib/utils/keys":433}],461:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var reRegExp = require( '@stdlib/regexp/regexp' );
// MAIN //
/**
* Parses a regular expression string and returns a new regular expression.
*
* @param {string} str - regular expression string
* @throws {TypeError} must provide a regular expression string
* @returns {(RegExp|null)} regular expression or null
*
* @example
* var re = reFromString( '/beep/' );
* // returns /beep/
*/
function reFromString( str ) {
if ( !isString( str ) ) {
throw new TypeError( 'invalid argument. Must provide a regular expression string. Value: `' + str + '`.' );
}
// Capture the regular expression pattern and any flags:
str = reRegExp().exec( str );
// Create a new regular expression:
return ( str ) ? new RegExp( str[1], str[2] ) : null;
}
// EXPORTS //
module.exports = reFromString;
},{"@stdlib/assert/is-string":158,"@stdlib/regexp/regexp":359}],462:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Create a regular expression from a regular expression string.
*
* @module @stdlib/utils/regexp-from-string
*
* @example
* var reFromString = require( '@stdlib/utils/regexp-from-string' );
*
* var re = reFromString( '/beep/' );
* // returns /beep/
*/
// MODULES //
var reFromString = require( './from_string.js' );
// EXPORTS //
module.exports = reFromString;
},{"./from_string.js":461}],463:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var RE = require( './fixtures/re.js' );
var nodeList = require( './fixtures/nodelist.js' );
var typedarray = require( './fixtures/typedarray.js' );
// MAIN //
/**
* Checks whether a polyfill is needed when using the `typeof` operator.
*
* @private
* @returns {boolean} boolean indicating whether a polyfill is needed
*/
function check() {
if (
// Chrome 1-12 returns 'function' for regular expression instances (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof):
typeof RE === 'function' ||
// Safari 8 returns 'object' for typed array and weak map constructors (underscore #1929):
typeof typedarray === 'object' ||
// PhantomJS 1.9 returns 'function' for `NodeList` instances (underscore #2236):
typeof nodeList === 'function'
) {
return true;
}
return false;
}
// EXPORTS //
module.exports = check;
},{"./fixtures/nodelist.js":464,"./fixtures/re.js":465,"./fixtures/typedarray.js":466}],464:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var getGlobal = require( '@stdlib/utils/global' );
// MAIN //
var root = getGlobal();
var nodeList = root.document && root.document.childNodes;
// EXPORTS //
module.exports = nodeList;
},{"@stdlib/utils/global":412}],465:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
var RE = /./;
// EXPORTS //
module.exports = RE;
},{}],466:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
var typedarray = Int8Array; // eslint-disable-line stdlib/require-globals
// EXPORTS //
module.exports = typedarray;
},{}],467:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
/**
* Determine a value's type.
*
* @module @stdlib/utils/type-of
*
* @example
* var typeOf = require( '@stdlib/utils/type-of' );
*
* var str = typeOf( 'a' );
* // returns 'string'
*
* str = typeOf( 5 );
* // returns 'number'
*/
// MODULES //
var usePolyfill = require( './check.js' );
var typeOf = require( './typeof.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var main = ( usePolyfill() ) ? polyfill : typeOf;
// EXPORTS //
module.exports = main;
},{"./check.js":463,"./polyfill.js":468,"./typeof.js":469}],468:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var ctorName = require( '@stdlib/utils/constructor-name' );
// MAIN //
/**
* Determines a value's type.
*
* @param {*} v - input value
* @returns {string} string indicating the value's type
*/
function typeOf( v ) {
return ctorName( v ).toLowerCase();
}
// EXPORTS //
module.exports = typeOf;
},{"@stdlib/utils/constructor-name":383}],469:[function(require,module,exports){
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
// MODULES //
var ctorName = require( '@stdlib/utils/constructor-name' );
// NOTES //
/*
* Built-in `typeof` operator behavior:
*
* ```text
* typeof null => 'object'
* typeof undefined => 'undefined'
* typeof 'a' => 'string'
* typeof 5 => 'number'
* typeof NaN => 'number'
* typeof true => 'boolean'
* typeof false => 'boolean'
* typeof {} => 'object'
* typeof [] => 'object'
* typeof function foo(){} => 'function'
* typeof function* foo(){} => 'object'
* typeof Symbol() => 'symbol'
* ```
*
*/
// MAIN //
/**
* Determines a value's type.
*
* @param {*} v - input value
* @returns {string} string indicating the value's type
*/
function typeOf( v ) {
var type;
// Address `typeof null` => `object` (see http://wiki.ecmascript.org/doku.php?id=harmony:typeof_null):
if ( v === null ) {
return 'null';
}
type = typeof v;
// If the `typeof` operator returned something other than `object`, we are done. Otherwise, we need to check for an internal class name or search for a constructor.
if ( type === 'object' ) {
return ctorName( v ).toLowerCase();
}
return type;
}
// EXPORTS //
module.exports = typeOf;
},{"@stdlib/utils/constructor-name":383}],470:[function(require,module,exports){
'use strict'
exports.byteLength = byteLength
exports.toByteArray = toByteArray
exports.fromByteArray = fromByteArray
var lookup = []
var revLookup = []
var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
for (var i = 0, len = code.length; i < len; ++i) {
lookup[i] = code[i]
revLookup[code.charCodeAt(i)] = i
}
// Support decoding URL-safe base64 strings, as Node.js does.
// See: https://en.wikipedia.org/wiki/Base64#URL_applications
revLookup['-'.charCodeAt(0)] = 62
revLookup['_'.charCodeAt(0)] = 63
function getLens (b64) {
var len = b64.length
if (len % 4 > 0) {
throw new Error('Invalid string. Length must be a multiple of 4')
}
// Trim off extra bytes after placeholder bytes are found
// See: https://github.com/beatgammit/base64-js/issues/42
var validLen = b64.indexOf('=')
if (validLen === -1) validLen = len
var placeHoldersLen = validLen === len
? 0
: 4 - (validLen % 4)
return [validLen, placeHoldersLen]
}
// base64 is 4/3 + up to two characters of the original data
function byteLength (b64) {
var lens = getLens(b64)
var validLen = lens[0]
var placeHoldersLen = lens[1]
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
}
function _byteLength (b64, validLen, placeHoldersLen) {
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
}
function toByteArray (b64) {
var tmp
var lens = getLens(b64)
var validLen = lens[0]
var placeHoldersLen = lens[1]
var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
var curByte = 0
// if there are placeholders, only get up to the last complete 4 chars
var len = placeHoldersLen > 0
? validLen - 4
: validLen
var i
for (i = 0; i < len; i += 4) {
tmp =
(revLookup[b64.charCodeAt(i)] << 18) |
(revLookup[b64.charCodeAt(i + 1)] << 12) |
(revLookup[b64.charCodeAt(i + 2)] << 6) |
revLookup[b64.charCodeAt(i + 3)]
arr[curByte++] = (tmp >> 16) & 0xFF
arr[curByte++] = (tmp >> 8) & 0xFF
arr[curByte++] = tmp & 0xFF
}
if (placeHoldersLen === 2) {
tmp =
(revLookup[b64.charCodeAt(i)] << 2) |
(revLookup[b64.charCodeAt(i + 1)] >> 4)
arr[curByte++] = tmp & 0xFF
}
if (placeHoldersLen === 1) {
tmp =
(revLookup[b64.charCodeAt(i)] << 10) |
(revLookup[b64.charCodeAt(i + 1)] << 4) |
(revLookup[b64.charCodeAt(i + 2)] >> 2)
arr[curByte++] = (tmp >> 8) & 0xFF
arr[curByte++] = tmp & 0xFF
}
return arr
}
function tripletToBase64 (num) {
return lookup[num >> 18 & 0x3F] +
lookup[num >> 12 & 0x3F] +
lookup[num >> 6 & 0x3F] +
lookup[num & 0x3F]
}
function encodeChunk (uint8, start, end) {
var tmp
var output = []
for (var i = start; i < end; i += 3) {
tmp =
((uint8[i] << 16) & 0xFF0000) +
((uint8[i + 1] << 8) & 0xFF00) +
(uint8[i + 2] & 0xFF)
output.push(tripletToBase64(tmp))
}
return output.join('')
}
function fromByteArray (uint8) {
var tmp
var len = uint8.length
var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
var parts = []
var maxChunkLength = 16383 // must be multiple of 3
// go through the array every three bytes, we'll deal with trailing stuff later
for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
}
// pad the end with zeros, but make sure to not forget the extra bytes
if (extraBytes === 1) {
tmp = uint8[len - 1]
parts.push(
lookup[tmp >> 2] +
lookup[(tmp << 4) & 0x3F] +
'=='
)
} else if (extraBytes === 2) {
tmp = (uint8[len - 2] << 8) + uint8[len - 1]
parts.push(
lookup[tmp >> 10] +
lookup[(tmp >> 4) & 0x3F] +
lookup[(tmp << 2) & 0x3F] +
'='
)
}
return parts.join('')
}
},{}],471:[function(require,module,exports){
},{}],472:[function(require,module,exports){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
var R = typeof Reflect === 'object' ? Reflect : null
var ReflectApply = R && typeof R.apply === 'function'
? R.apply
: function ReflectApply(target, receiver, args) {
return Function.prototype.apply.call(target, receiver, args);
}
var ReflectOwnKeys
if (R && typeof R.ownKeys === 'function') {
ReflectOwnKeys = R.ownKeys
} else if (Object.getOwnPropertySymbols) {
ReflectOwnKeys = function ReflectOwnKeys(target) {
return Object.getOwnPropertyNames(target)
.concat(Object.getOwnPropertySymbols(target));
};
} else {
ReflectOwnKeys = function ReflectOwnKeys(target) {
return Object.getOwnPropertyNames(target);
};
}
function ProcessEmitWarning(warning) {
if (console && console.warn) console.warn(warning);
}
var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
return value !== value;
}
function EventEmitter() {
EventEmitter.init.call(this);
}
module.exports = EventEmitter;
module.exports.once = once;
// Backwards-compat with node 0.10.x
EventEmitter.EventEmitter = EventEmitter;
EventEmitter.prototype._events = undefined;
EventEmitter.prototype._eventsCount = 0;
EventEmitter.prototype._maxListeners = undefined;
// By default EventEmitters will print a warning if more than 10 listeners are
// added to it. This is a useful default which helps finding memory leaks.
var defaultMaxListeners = 10;
function checkListener(listener) {
if (typeof listener !== 'function') {
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
}
}
Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
enumerable: true,
get: function() {
return defaultMaxListeners;
},
set: function(arg) {
if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
}
defaultMaxListeners = arg;
}
});
EventEmitter.init = function() {
if (this._events === undefined ||
this._events === Object.getPrototypeOf(this)._events) {
this._events = Object.create(null);
this._eventsCount = 0;
}
this._maxListeners = this._maxListeners || undefined;
};
// Obviously not all Emitters should be limited to 10. This function allows
// that to be increased. Set to zero for unlimited.
EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
}
this._maxListeners = n;
return this;
};
function _getMaxListeners(that) {
if (that._maxListeners === undefined)
return EventEmitter.defaultMaxListeners;
return that._maxListeners;
}
EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
return _getMaxListeners(this);
};
EventEmitter.prototype.emit = function emit(type) {
var args = [];
for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
var doError = (type === 'error');
var events = this._events;
if (events !== undefined)
doError = (doError && events.error === undefined);
else if (!doError)
return false;
// If there is no 'error' event listener then throw.
if (doError) {
var er;
if (args.length > 0)
er = args[0];
if (er instanceof Error) {
// Note: The comments on the `throw` lines are intentional, they show
// up in Node's output if this results in an unhandled exception.
throw er; // Unhandled 'error' event
}
// At least give some kind of context to the user
var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
err.context = er;
throw err; // Unhandled 'error' event
}
var handler = events[type];
if (handler === undefined)
return false;
if (typeof handler === 'function') {
ReflectApply(handler, this, args);
} else {
var len = handler.length;
var listeners = arrayClone(handler, len);
for (var i = 0; i < len; ++i)
ReflectApply(listeners[i], this, args);
}
return true;
};
function _addListener(target, type, listener, prepend) {
var m;
var events;
var existing;
checkListener(listener);
events = target._events;
if (events === undefined) {
events = target._events = Object.create(null);
target._eventsCount = 0;
} else {
// To avoid recursion in the case that type === "newListener"! Before
// adding it to the listeners, first emit "newListener".
if (events.newListener !== undefined) {
target.emit('newListener', type,
listener.listener ? listener.listener : listener);
// Re-assign `events` because a newListener handler could have caused the
// this._events to be assigned to a new object
events = target._events;
}
existing = events[type];
}
if (existing === undefined) {
// Optimize the case of one listener. Don't need the extra array object.
existing = events[type] = listener;
++target._eventsCount;
} else {
if (typeof existing === 'function') {
// Adding the second element, need to change to array.
existing = events[type] =
prepend ? [listener, existing] : [existing, listener];
// If we've already got an array, just append.
} else if (prepend) {
existing.unshift(listener);
} else {
existing.push(listener);
}
// Check for listener leak
m = _getMaxListeners(target);
if (m > 0 && existing.length > m && !existing.warned) {
existing.warned = true;
// No error code for this since it is a Warning
// eslint-disable-next-line no-restricted-syntax
var w = new Error('Possible EventEmitter memory leak detected. ' +
existing.length + ' ' + String(type) + ' listeners ' +
'added. Use emitter.setMaxListeners() to ' +
'increase limit');
w.name = 'MaxListenersExceededWarning';
w.emitter = target;
w.type = type;
w.count = existing.length;
ProcessEmitWarning(w);
}
}
return target;
}
EventEmitter.prototype.addListener = function addListener(type, listener) {
return _addListener(this, type, listener, false);
};
EventEmitter.prototype.on = EventEmitter.prototype.addListener;
EventEmitter.prototype.prependListener =
function prependListener(type, listener) {
return _addListener(this, type, listener, true);
};
function onceWrapper() {
if (!this.fired) {
this.target.removeListener(this.type, this.wrapFn);
this.fired = true;
if (arguments.length === 0)
return this.listener.call(this.target);
return this.listener.apply(this.target, arguments);
}
}
function _onceWrap(target, type, listener) {
var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
var wrapped = onceWrapper.bind(state);
wrapped.listener = listener;
state.wrapFn = wrapped;
return wrapped;
}
EventEmitter.prototype.once = function once(type, listener) {
checkListener(listener);
this.on(type, _onceWrap(this, type, listener));
return this;
};
EventEmitter.prototype.prependOnceListener =
function prependOnceListener(type, listener) {
checkListener(listener);
this.prependListener(type, _onceWrap(this, type, listener));
return this;
};
// Emits a 'removeListener' event if and only if the listener was removed.
EventEmitter.prototype.removeListener =
function removeListener(type, listener) {
var list, events, position, i, originalListener;
checkListener(listener);
events = this._events;
if (events === undefined)
return this;
list = events[type];
if (list === undefined)
return this;
if (list === listener || list.listener === listener) {
if (--this._eventsCount === 0)
this._events = Object.create(null);
else {
delete events[type];
if (events.removeListener)
this.emit('removeListener', type, list.listener || listener);
}
} else if (typeof list !== 'function') {
position = -1;
for (i = list.length - 1; i >= 0; i--) {
if (list[i] === listener || list[i].listener === listener) {
originalListener = list[i].listener;
position = i;
break;
}
}
if (position < 0)
return this;
if (position === 0)
list.shift();
else {
spliceOne(list, position);
}
if (list.length === 1)
events[type] = list[0];
if (events.removeListener !== undefined)
this.emit('removeListener', type, originalListener || listener);
}
return this;
};
EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
EventEmitter.prototype.removeAllListeners =
function removeAllListeners(type) {
var listeners, events, i;
events = this._events;
if (events === undefined)
return this;
// not listening for removeListener, no need to emit
if (events.removeListener === undefined) {
if (arguments.length === 0) {
this._events = Object.create(null);
this._eventsCount = 0;
} else if (events[type] !== undefined) {
if (--this._eventsCount === 0)
this._events = Object.create(null);
else
delete events[type];
}
return this;
}
// emit removeListener for all listeners on all events
if (arguments.length === 0) {
var keys = Object.keys(events);
var key;
for (i = 0; i < keys.length; ++i) {
key = keys[i];
if (key === 'removeListener') continue;
this.removeAllListeners(key);
}
this.removeAllListeners('removeListener');
this._events = Object.create(null);
this._eventsCount = 0;
return this;
}
listeners = events[type];
if (typeof listeners === 'function') {
this.removeListener(type, listeners);
} else if (listeners !== undefined) {
// LIFO order
for (i = listeners.length - 1; i >= 0; i--) {
this.removeListener(type, listeners[i]);
}
}
return this;
};
function _listeners(target, type, unwrap) {
var events = target._events;
if (events === undefined)
return [];
var evlistener = events[type];
if (evlistener === undefined)
return [];
if (typeof evlistener === 'function')
return unwrap ? [evlistener.listener || evlistener] : [evlistener];
return unwrap ?
unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
}
EventEmitter.prototype.listeners = function listeners(type) {
return _listeners(this, type, true);
};
EventEmitter.prototype.rawListeners = function rawListeners(type) {
return _listeners(this, type, false);
};
EventEmitter.listenerCount = function(emitter, type) {
if (typeof emitter.listenerCount === 'function') {
return emitter.listenerCount(type);
} else {
return listenerCount.call(emitter, type);
}
};
EventEmitter.prototype.listenerCount = listenerCount;
function listenerCount(type) {
var events = this._events;
if (events !== undefined) {
var evlistener = events[type];
if (typeof evlistener === 'function') {
return 1;
} else if (evlistener !== undefined) {
return evlistener.length;
}
}
return 0;
}
EventEmitter.prototype.eventNames = function eventNames() {
return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
};
function arrayClone(arr, n) {
var copy = new Array(n);
for (var i = 0; i < n; ++i)
copy[i] = arr[i];
return copy;
}
function spliceOne(list, index) {
for (; index + 1 < list.length; index++)
list[index] = list[index + 1];
list.pop();
}
function unwrapListeners(arr) {
var ret = new Array(arr.length);
for (var i = 0; i < ret.length; ++i) {
ret[i] = arr[i].listener || arr[i];
}
return ret;
}
function once(emitter, name) {
return new Promise(function (resolve, reject) {
function errorListener(err) {
emitter.removeListener(name, resolver);
reject(err);
}
function resolver() {
if (typeof emitter.removeListener === 'function') {
emitter.removeListener('error', errorListener);
}
resolve([].slice.call(arguments));
};
eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
if (name !== 'error') {
addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
}
});
}
function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
if (typeof emitter.on === 'function') {
eventTargetAgnosticAddListener(emitter, 'error', handler, flags);
}
}
function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
if (typeof emitter.on === 'function') {
if (flags.once) {
emitter.once(name, listener);
} else {
emitter.on(name, listener);
}
} else if (typeof emitter.addEventListener === 'function') {
// EventTarget does not have `error` event semantics like Node
// EventEmitters, we do not listen for `error` events here.
emitter.addEventListener(name, function wrapListener(arg) {
// IE does not have builtin `{ once: true }` support so we
// have to do it manually.
if (flags.once) {
emitter.removeEventListener(name, wrapListener);
}
listener(arg);
});
} else {
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
}
}
},{}],473:[function(require,module,exports){
(function (Buffer){(function (){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
/* eslint-disable no-proto */
'use strict'
var base64 = require('base64-js')
var ieee754 = require('ieee754')
exports.Buffer = Buffer
exports.SlowBuffer = SlowBuffer
exports.INSPECT_MAX_BYTES = 50
var K_MAX_LENGTH = 0x7fffffff
exports.kMaxLength = K_MAX_LENGTH
/**
* If `Buffer.TYPED_ARRAY_SUPPORT`:
* === true Use Uint8Array implementation (fastest)
* === false Print warning and recommend using `buffer` v4.x which has an Object
* implementation (most compatible, even IE6)
*
* Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
* Opera 11.6+, iOS 4.2+.
*
* We report that the browser does not support typed arrays if the are not subclassable
* using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`
* (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
* for __proto__ and has a buggy typed array implementation.
*/
Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport()
if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&
typeof console.error === 'function') {
console.error(
'This browser lacks typed array (Uint8Array) support which is required by ' +
'`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'
)
}
function typedArraySupport () {
// Can typed array instances can be augmented?
try {
var arr = new Uint8Array(1)
arr.__proto__ = { __proto__: Uint8Array.prototype, foo: function () { return 42 } }
return arr.foo() === 42
} catch (e) {
return false
}
}
Object.defineProperty(Buffer.prototype, 'parent', {
enumerable: true,
get: function () {
if (!Buffer.isBuffer(this)) return undefined
return this.buffer
}
})
Object.defineProperty(Buffer.prototype, 'offset', {
enumerable: true,
get: function () {
if (!Buffer.isBuffer(this)) return undefined
return this.byteOffset
}
})
function createBuffer (length) {
if (length > K_MAX_LENGTH) {
throw new RangeError('The value "' + length + '" is invalid for option "size"')
}
// Return an augmented `Uint8Array` instance
var buf = new Uint8Array(length)
buf.__proto__ = Buffer.prototype
return buf
}
/**
* The Buffer constructor returns instances of `Uint8Array` that have their
* prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
* `Uint8Array`, so the returned instances will have all the node `Buffer` methods
* and the `Uint8Array` methods. Square bracket notation works as expected -- it
* returns a single octet.
*
* The `Uint8Array` prototype remains unmodified.
*/
function Buffer (arg, encodingOrOffset, length) {
// Common case.
if (typeof arg === 'number') {
if (typeof encodingOrOffset === 'string') {
throw new TypeError(
'The "string" argument must be of type string. Received type number'
)
}
return allocUnsafe(arg)
}
return from(arg, encodingOrOffset, length)
}
// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
if (typeof Symbol !== 'undefined' && Symbol.species != null &&
Buffer[Symbol.species] === Buffer) {
Object.defineProperty(Buffer, Symbol.species, {
value: null,
configurable: true,
enumerable: false,
writable: false
})
}
Buffer.poolSize = 8192 // not used by this implementation
function from (value, encodingOrOffset, length) {
if (typeof value === 'string') {
return fromString(value, encodingOrOffset)
}
if (ArrayBuffer.isView(value)) {
return fromArrayLike(value)
}
if (value == null) {
throw TypeError(
'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
'or Array-like Object. Received type ' + (typeof value)
)
}
if (isInstance(value, ArrayBuffer) ||
(value && isInstance(value.buffer, ArrayBuffer))) {
return fromArrayBuffer(value, encodingOrOffset, length)
}
if (typeof value === 'number') {
throw new TypeError(
'The "value" argument must not be of type number. Received type number'
)
}
var valueOf = value.valueOf && value.valueOf()
if (valueOf != null && valueOf !== value) {
return Buffer.from(valueOf, encodingOrOffset, length)
}
var b = fromObject(value)
if (b) return b
if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&
typeof value[Symbol.toPrimitive] === 'function') {
return Buffer.from(
value[Symbol.toPrimitive]('string'), encodingOrOffset, length
)
}
throw new TypeError(
'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
'or Array-like Object. Received type ' + (typeof value)
)
}
/**
* Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
* if value is a number.
* Buffer.from(str[, encoding])
* Buffer.from(array)
* Buffer.from(buffer)
* Buffer.from(arrayBuffer[, byteOffset[, length]])
**/
Buffer.from = function (value, encodingOrOffset, length) {
return from(value, encodingOrOffset, length)
}
// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:
// https://github.com/feross/buffer/pull/148
Buffer.prototype.__proto__ = Uint8Array.prototype
Buffer.__proto__ = Uint8Array
function assertSize (size) {
if (typeof size !== 'number') {
throw new TypeError('"size" argument must be of type number')
} else if (size < 0) {
throw new RangeError('The value "' + size + '" is invalid for option "size"')
}
}
function alloc (size, fill, encoding) {
assertSize(size)
if (size <= 0) {
return createBuffer(size)
}
if (fill !== undefined) {
// Only pay attention to encoding if it's a string. This
// prevents accidentally sending in a number that would
// be interpretted as a start offset.
return typeof encoding === 'string'
? createBuffer(size).fill(fill, encoding)
: createBuffer(size).fill(fill)
}
return createBuffer(size)
}
/**
* Creates a new filled Buffer instance.
* alloc(size[, fill[, encoding]])
**/
Buffer.alloc = function (size, fill, encoding) {
return alloc(size, fill, encoding)
}
function allocUnsafe (size) {
assertSize(size)
return createBuffer(size < 0 ? 0 : checked(size) | 0)
}
/**
* Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
* */
Buffer.allocUnsafe = function (size) {
return allocUnsafe(size)
}
/**
* Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
*/
Buffer.allocUnsafeSlow = function (size) {
return allocUnsafe(size)
}
function fromString (string, encoding) {
if (typeof encoding !== 'string' || encoding === '') {
encoding = 'utf8'
}
if (!Buffer.isEncoding(encoding)) {
throw new TypeError('Unknown encoding: ' + encoding)
}
var length = byteLength(string, encoding) | 0
var buf = createBuffer(length)
var actual = buf.write(string, encoding)
if (actual !== length) {
// Writing a hex string, for example, that contains invalid characters will
// cause everything after the first invalid character to be ignored. (e.g.
// 'abxxcd' will be treated as 'ab')
buf = buf.slice(0, actual)
}
return buf
}
function fromArrayLike (array) {
var length = array.length < 0 ? 0 : checked(array.length) | 0
var buf = createBuffer(length)
for (var i = 0; i < length; i += 1) {
buf[i] = array[i] & 255
}
return buf
}
function fromArrayBuffer (array, byteOffset, length) {
if (byteOffset < 0 || array.byteLength < byteOffset) {
throw new RangeError('"offset" is outside of buffer bounds')
}
if (array.byteLength < byteOffset + (length || 0)) {
throw new RangeError('"length" is outside of buffer bounds')
}
var buf
if (byteOffset === undefined && length === undefined) {
buf = new Uint8Array(array)
} else if (length === undefined) {
buf = new Uint8Array(array, byteOffset)
} else {
buf = new Uint8Array(array, byteOffset, length)
}
// Return an augmented `Uint8Array` instance
buf.__proto__ = Buffer.prototype
return buf
}
function fromObject (obj) {
if (Buffer.isBuffer(obj)) {
var len = checked(obj.length) | 0
var buf = createBuffer(len)
if (buf.length === 0) {
return buf
}
obj.copy(buf, 0, 0, len)
return buf
}
if (obj.length !== undefined) {
if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {
return createBuffer(0)
}
return fromArrayLike(obj)
}
if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
return fromArrayLike(obj.data)
}
}
function checked (length) {
// Note: cannot use `length < K_MAX_LENGTH` here because that fails when
// length is NaN (which is otherwise coerced to zero.)
if (length >= K_MAX_LENGTH) {
throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')
}
return length | 0
}
function SlowBuffer (length) {
if (+length != length) { // eslint-disable-line eqeqeq
length = 0
}
return Buffer.alloc(+length)
}
Buffer.isBuffer = function isBuffer (b) {
return b != null && b._isBuffer === true &&
b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false
}
Buffer.compare = function compare (a, b) {
if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)
if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)
if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
throw new TypeError(
'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
)
}
if (a === b) return 0
var x = a.length
var y = b.length
for (var i = 0, len = Math.min(x, y); i < len; ++i) {
if (a[i] !== b[i]) {
x = a[i]
y = b[i]
break
}
}
if (x < y) return -1
if (y < x) return 1
return 0
}
Buffer.isEncoding = function isEncoding (encoding) {
switch (String(encoding).toLowerCase()) {
case 'hex':
case 'utf8':
case 'utf-8':
case 'ascii':
case 'latin1':
case 'binary':
case 'base64':
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return true
default:
return false
}
}
Buffer.concat = function concat (list, length) {
if (!Array.isArray(list)) {
throw new TypeError('"list" argument must be an Array of Buffers')
}
if (list.length === 0) {
return Buffer.alloc(0)
}
var i
if (length === undefined) {
length = 0
for (i = 0; i < list.length; ++i) {
length += list[i].length
}
}
var buffer = Buffer.allocUnsafe(length)
var pos = 0
for (i = 0; i < list.length; ++i) {
var buf = list[i]
if (isInstance(buf, Uint8Array)) {
buf = Buffer.from(buf)
}
if (!Buffer.isBuffer(buf)) {
throw new TypeError('"list" argument must be an Array of Buffers')
}
buf.copy(buffer, pos)
pos += buf.length
}
return buffer
}
function byteLength (string, encoding) {
if (Buffer.isBuffer(string)) {
return string.length
}
if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {
return string.byteLength
}
if (typeof string !== 'string') {
throw new TypeError(
'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' +
'Received type ' + typeof string
)
}
var len = string.length
var mustMatch = (arguments.length > 2 && arguments[2] === true)
if (!mustMatch && len === 0) return 0
// Use a for loop to avoid recursion
var loweredCase = false
for (;;) {
switch (encoding) {
case 'ascii':
case 'latin1':
case 'binary':
return len
case 'utf8':
case 'utf-8':
return utf8ToBytes(string).length
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return len * 2
case 'hex':
return len >>> 1
case 'base64':
return base64ToBytes(string).length
default:
if (loweredCase) {
return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8
}
encoding = ('' + encoding).toLowerCase()
loweredCase = true
}
}
}
Buffer.byteLength = byteLength
function slowToString (encoding, start, end) {
var loweredCase = false
// No need to verify that "this.length <= MAX_UINT32" since it's a read-only
// property of a typed array.
// This behaves neither like String nor Uint8Array in that we set start/end
// to their upper/lower bounds if the value passed is out of range.
// undefined is handled specially as per ECMA-262 6th Edition,
// Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
if (start === undefined || start < 0) {
start = 0
}
// Return early if start > this.length. Done here to prevent potential uint32
// coercion fail below.
if (start > this.length) {
return ''
}
if (end === undefined || end > this.length) {
end = this.length
}
if (end <= 0) {
return ''
}
// Force coersion to uint32. This will also coerce falsey/NaN values to 0.
end >>>= 0
start >>>= 0
if (end <= start) {
return ''
}
if (!encoding) encoding = 'utf8'
while (true) {
switch (encoding) {
case 'hex':
return hexSlice(this, start, end)
case 'utf8':
case 'utf-8':
return utf8Slice(this, start, end)
case 'ascii':
return asciiSlice(this, start, end)
case 'latin1':
case 'binary':
return latin1Slice(this, start, end)
case 'base64':
return base64Slice(this, start, end)
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return utf16leSlice(this, start, end)
default:
if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
encoding = (encoding + '').toLowerCase()
loweredCase = true
}
}
}
// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)
// to detect a Buffer instance. It's not possible to use `instanceof Buffer`
// reliably in a browserify context because there could be multiple different
// copies of the 'buffer' package in use. This method works even for Buffer
// instances that were created from another copy of the `buffer` package.
// See: https://github.com/feross/buffer/issues/154
Buffer.prototype._isBuffer = true
function swap (b, n, m) {
var i = b[n]
b[n] = b[m]
b[m] = i
}
Buffer.prototype.swap16 = function swap16 () {
var len = this.length
if (len % 2 !== 0) {
throw new RangeError('Buffer size must be a multiple of 16-bits')
}
for (var i = 0; i < len; i += 2) {
swap(this, i, i + 1)
}
return this
}
Buffer.prototype.swap32 = function swap32 () {
var len = this.length
if (len % 4 !== 0) {
throw new RangeError('Buffer size must be a multiple of 32-bits')
}
for (var i = 0; i < len; i += 4) {
swap(this, i, i + 3)
swap(this, i + 1, i + 2)
}
return this
}
Buffer.prototype.swap64 = function swap64 () {
var len = this.length
if (len % 8 !== 0) {
throw new RangeError('Buffer size must be a multiple of 64-bits')
}
for (var i = 0; i < len; i += 8) {
swap(this, i, i + 7)
swap(this, i + 1, i + 6)
swap(this, i + 2, i + 5)
swap(this, i + 3, i + 4)
}
return this
}
Buffer.prototype.toString = function toString () {
var length = this.length
if (length === 0) return ''
if (arguments.length === 0) return utf8Slice(this, 0, length)
return slowToString.apply(this, arguments)
}
Buffer.prototype.toLocaleString = Buffer.prototype.toString
Buffer.prototype.equals = function equals (b) {
if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
if (this === b) return true
return Buffer.compare(this, b) === 0
}
Buffer.prototype.inspect = function inspect () {
var str = ''
var max = exports.INSPECT_MAX_BYTES
str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()
if (this.length > max) str += ' ... '
return '<Buffer ' + str + '>'
}
Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
if (isInstance(target, Uint8Array)) {
target = Buffer.from(target, target.offset, target.byteLength)
}
if (!Buffer.isBuffer(target)) {
throw new TypeError(
'The "target" argument must be one of type Buffer or Uint8Array. ' +
'Received type ' + (typeof target)
)
}
if (start === undefined) {
start = 0
}
if (end === undefined) {
end = target ? target.length : 0
}
if (thisStart === undefined) {
thisStart = 0
}
if (thisEnd === undefined) {
thisEnd = this.length
}
if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
throw new RangeError('out of range index')
}
if (thisStart >= thisEnd && start >= end) {
return 0
}
if (thisStart >= thisEnd) {
return -1
}
if (start >= end) {
return 1
}
start >>>= 0
end >>>= 0
thisStart >>>= 0
thisEnd >>>= 0
if (this === target) return 0
var x = thisEnd - thisStart
var y = end - start
var len = Math.min(x, y)
var thisCopy = this.slice(thisStart, thisEnd)
var targetCopy = target.slice(start, end)
for (var i = 0; i < len; ++i) {
if (thisCopy[i] !== targetCopy[i]) {
x = thisCopy[i]
y = targetCopy[i]
break
}
}
if (x < y) return -1
if (y < x) return 1
return 0
}
// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
//
// Arguments:
// - buffer - a Buffer to search
// - val - a string, Buffer, or number
// - byteOffset - an index into `buffer`; will be clamped to an int32
// - encoding - an optional encoding, relevant is val is a string
// - dir - true for indexOf, false for lastIndexOf
function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
// Empty buffer means no match
if (buffer.length === 0) return -1
// Normalize byteOffset
if (typeof byteOffset === 'string') {
encoding = byteOffset
byteOffset = 0
} else if (byteOffset > 0x7fffffff) {
byteOffset = 0x7fffffff
} else if (byteOffset < -0x80000000) {
byteOffset = -0x80000000
}
byteOffset = +byteOffset // Coerce to Number.
if (numberIsNaN(byteOffset)) {
// byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
byteOffset = dir ? 0 : (buffer.length - 1)
}
// Normalize byteOffset: negative offsets start from the end of the buffer
if (byteOffset < 0) byteOffset = buffer.length + byteOffset
if (byteOffset >= buffer.length) {
if (dir) return -1
else byteOffset = buffer.length - 1
} else if (byteOffset < 0) {
if (dir) byteOffset = 0
else return -1
}
// Normalize val
if (typeof val === 'string') {
val = Buffer.from(val, encoding)
}
// Finally, search either indexOf (if dir is true) or lastIndexOf
if (Buffer.isBuffer(val)) {
// Special case: looking for empty string/buffer always fails
if (val.length === 0) {
return -1
}
return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
} else if (typeof val === 'number') {
val = val & 0xFF // Search for a byte value [0-255]
if (typeof Uint8Array.prototype.indexOf === 'function') {
if (dir) {
return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
} else {
return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
}
}
return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
}
throw new TypeError('val must be string, number or Buffer')
}
function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
var indexSize = 1
var arrLength = arr.length
var valLength = val.length
if (encoding !== undefined) {
encoding = String(encoding).toLowerCase()
if (encoding === 'ucs2' || encoding === 'ucs-2' ||
encoding === 'utf16le' || encoding === 'utf-16le') {
if (arr.length < 2 || val.length < 2) {
return -1
}
indexSize = 2
arrLength /= 2
valLength /= 2
byteOffset /= 2
}
}
function read (buf, i) {
if (indexSize === 1) {
return buf[i]
} else {
return buf.readUInt16BE(i * indexSize)
}
}
var i
if (dir) {
var foundIndex = -1
for (i = byteOffset; i < arrLength; i++) {
if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
if (foundIndex === -1) foundIndex = i
if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
} else {
if (foundIndex !== -1) i -= i - foundIndex
foundIndex = -1
}
}
} else {
if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
for (i = byteOffset; i >= 0; i--) {
var found = true
for (var j = 0; j < valLength; j++) {
if (read(arr, i + j) !== read(val, j)) {
found = false
break
}
}
if (found) return i
}
}
return -1
}
Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
return this.indexOf(val, byteOffset, encoding) !== -1
}
Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
}
Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
}
function hexWrite (buf, string, offset, length) {
offset = Number(offset) || 0
var remaining = buf.length - offset
if (!length) {
length = remaining
} else {
length = Number(length)
if (length > remaining) {
length = remaining
}
}
var strLen = string.length
if (length > strLen / 2) {
length = strLen / 2
}
for (var i = 0; i < length; ++i) {
var parsed = parseInt(string.substr(i * 2, 2), 16)
if (numberIsNaN(parsed)) return i
buf[offset + i] = parsed
}
return i
}
function utf8Write (buf, string, offset, length) {
return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
}
function asciiWrite (buf, string, offset, length) {
return blitBuffer(asciiToBytes(string), buf, offset, length)
}
function latin1Write (buf, string, offset, length) {
return asciiWrite(buf, string, offset, length)
}
function base64Write (buf, string, offset, length) {
return blitBuffer(base64ToBytes(string), buf, offset, length)
}
function ucs2Write (buf, string, offset, length) {
return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
}
Buffer.prototype.write = function write (string, offset, length, encoding) {
// Buffer#write(string)
if (offset === undefined) {
encoding = 'utf8'
length = this.length
offset = 0
// Buffer#write(string, encoding)
} else if (length === undefined && typeof offset === 'string') {
encoding = offset
length = this.length
offset = 0
// Buffer#write(string, offset[, length][, encoding])
} else if (isFinite(offset)) {
offset = offset >>> 0
if (isFinite(length)) {
length = length >>> 0
if (encoding === undefined) encoding = 'utf8'
} else {
encoding = length
length = undefined
}
} else {
throw new Error(
'Buffer.write(string, encoding, offset[, length]) is no longer supported'
)
}
var remaining = this.length - offset
if (length === undefined || length > remaining) length = remaining
if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
throw new RangeError('Attempt to write outside buffer bounds')
}
if (!encoding) encoding = 'utf8'
var loweredCase = false
for (;;) {
switch (encoding) {
case 'hex':
return hexWrite(this, string, offset, length)
case 'utf8':
case 'utf-8':
return utf8Write(this, string, offset, length)
case 'ascii':
return asciiWrite(this, string, offset, length)
case 'latin1':
case 'binary':
return latin1Write(this, string, offset, length)
case 'base64':
// Warning: maxLength not taken into account in base64Write
return base64Write(this, string, offset, length)
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return ucs2Write(this, string, offset, length)
default:
if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
encoding = ('' + encoding).toLowerCase()
loweredCase = true
}
}
}
Buffer.prototype.toJSON = function toJSON () {
return {
type: 'Buffer',
data: Array.prototype.slice.call(this._arr || this, 0)
}
}
function base64Slice (buf, start, end) {
if (start === 0 && end === buf.length) {
return base64.fromByteArray(buf)
} else {
return base64.fromByteArray(buf.slice(start, end))
}
}
function utf8Slice (buf, start, end) {
end = Math.min(buf.length, end)
var res = []
var i = start
while (i < end) {
var firstByte = buf[i]
var codePoint = null
var bytesPerSequence = (firstByte > 0xEF) ? 4
: (firstByte > 0xDF) ? 3
: (firstByte > 0xBF) ? 2
: 1
if (i + bytesPerSequence <= end) {
var secondByte, thirdByte, fourthByte, tempCodePoint
switch (bytesPerSequence) {
case 1:
if (firstByte < 0x80) {
codePoint = firstByte
}
break
case 2:
secondByte = buf[i + 1]
if ((secondByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
if (tempCodePoint > 0x7F) {
codePoint = tempCodePoint
}
}
break
case 3:
secondByte = buf[i + 1]
thirdByte = buf[i + 2]
if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
codePoint = tempCodePoint
}
}
break
case 4:
secondByte = buf[i + 1]
thirdByte = buf[i + 2]
fourthByte = buf[i + 3]
if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
codePoint = tempCodePoint
}
}
}
}
if (codePoint === null) {
// we did not generate a valid codePoint so insert a
// replacement char (U+FFFD) and advance only 1 byte
codePoint = 0xFFFD
bytesPerSequence = 1
} else if (codePoint > 0xFFFF) {
// encode to utf16 (surrogate pair dance)
codePoint -= 0x10000
res.push(codePoint >>> 10 & 0x3FF | 0xD800)
codePoint = 0xDC00 | codePoint & 0x3FF
}
res.push(codePoint)
i += bytesPerSequence
}
return decodeCodePointsArray(res)
}
// Based on http://stackoverflow.com/a/22747272/680742, the browser with
// the lowest limit is Chrome, with 0x10000 args.
// We go 1 magnitude less, for safety
var MAX_ARGUMENTS_LENGTH = 0x1000
function decodeCodePointsArray (codePoints) {
var len = codePoints.length
if (len <= MAX_ARGUMENTS_LENGTH) {
return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
}
// Decode in chunks to avoid "call stack size exceeded".
var res = ''
var i = 0
while (i < len) {
res += String.fromCharCode.apply(
String,
codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
)
}
return res
}
function asciiSlice (buf, start, end) {
var ret = ''
end = Math.min(buf.length, end)
for (var i = start; i < end; ++i) {
ret += String.fromCharCode(buf[i] & 0x7F)
}
return ret
}
function latin1Slice (buf, start, end) {
var ret = ''
end = Math.min(buf.length, end)
for (var i = start; i < end; ++i) {
ret += String.fromCharCode(buf[i])
}
return ret
}
function hexSlice (buf, start, end) {
var len = buf.length
if (!start || start < 0) start = 0
if (!end || end < 0 || end > len) end = len
var out = ''
for (var i = start; i < end; ++i) {
out += toHex(buf[i])
}
return out
}
function utf16leSlice (buf, start, end) {
var bytes = buf.slice(start, end)
var res = ''
for (var i = 0; i < bytes.length; i += 2) {
res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))
}
return res
}
Buffer.prototype.slice = function slice (start, end) {
var len = this.length
start = ~~start
end = end === undefined ? len : ~~end
if (start < 0) {
start += len
if (start < 0) start = 0
} else if (start > len) {
start = len
}
if (end < 0) {
end += len
if (end < 0) end = 0
} else if (end > len) {
end = len
}
if (end < start) end = start
var newBuf = this.subarray(start, end)
// Return an augmented `Uint8Array` instance
newBuf.__proto__ = Buffer.prototype
return newBuf
}
/*
* Need to make sure that buffer isn't trying to write out of bounds.
*/
function checkOffset (offset, ext, length) {
if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
}
Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
offset = offset >>> 0
byteLength = byteLength >>> 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var val = this[offset]
var mul = 1
var i = 0
while (++i < byteLength && (mul *= 0x100)) {
val += this[offset + i] * mul
}
return val
}
Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
offset = offset >>> 0
byteLength = byteLength >>> 0
if (!noAssert) {
checkOffset(offset, byteLength, this.length)
}
var val = this[offset + --byteLength]
var mul = 1
while (byteLength > 0 && (mul *= 0x100)) {
val += this[offset + --byteLength] * mul
}
return val
}
Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 1, this.length)
return this[offset]
}
Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 2, this.length)
return this[offset] | (this[offset + 1] << 8)
}
Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 2, this.length)
return (this[offset] << 8) | this[offset + 1]
}
Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 4, this.length)
return ((this[offset]) |
(this[offset + 1] << 8) |
(this[offset + 2] << 16)) +
(this[offset + 3] * 0x1000000)
}
Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset] * 0x1000000) +
((this[offset + 1] << 16) |
(this[offset + 2] << 8) |
this[offset + 3])
}
Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
offset = offset >>> 0
byteLength = byteLength >>> 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var val = this[offset]
var mul = 1
var i = 0
while (++i < byteLength && (mul *= 0x100)) {
val += this[offset + i] * mul
}
mul *= 0x80
if (val >= mul) val -= Math.pow(2, 8 * byteLength)
return val
}
Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
offset = offset >>> 0
byteLength = byteLength >>> 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var i = byteLength
var mul = 1
var val = this[offset + --i]
while (i > 0 && (mul *= 0x100)) {
val += this[offset + --i] * mul
}
mul *= 0x80
if (val >= mul) val -= Math.pow(2, 8 * byteLength)
return val
}
Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 1, this.length)
if (!(this[offset] & 0x80)) return (this[offset])
return ((0xff - this[offset] + 1) * -1)
}
Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 2, this.length)
var val = this[offset] | (this[offset + 1] << 8)
return (val & 0x8000) ? val | 0xFFFF0000 : val
}
Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 2, this.length)
var val = this[offset + 1] | (this[offset] << 8)
return (val & 0x8000) ? val | 0xFFFF0000 : val
}
Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset]) |
(this[offset + 1] << 8) |
(this[offset + 2] << 16) |
(this[offset + 3] << 24)
}
Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset] << 24) |
(this[offset + 1] << 16) |
(this[offset + 2] << 8) |
(this[offset + 3])
}
Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 4, this.length)
return ieee754.read(this, offset, true, 23, 4)
}
Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 4, this.length)
return ieee754.read(this, offset, false, 23, 4)
}
Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 8, this.length)
return ieee754.read(this, offset, true, 52, 8)
}
Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 8, this.length)
return ieee754.read(this, offset, false, 52, 8)
}
function checkInt (buf, value, offset, ext, max, min) {
if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
if (offset + ext > buf.length) throw new RangeError('Index out of range')
}
Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
value = +value
offset = offset >>> 0
byteLength = byteLength >>> 0
if (!noAssert) {
var maxBytes = Math.pow(2, 8 * byteLength) - 1
checkInt(this, value, offset, byteLength, maxBytes, 0)
}
var mul = 1
var i = 0
this[offset] = value & 0xFF
while (++i < byteLength && (mul *= 0x100)) {
this[offset + i] = (value / mul) & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
value = +value
offset = offset >>> 0
byteLength = byteLength >>> 0
if (!noAssert) {
var maxBytes = Math.pow(2, 8 * byteLength) - 1
checkInt(this, value, offset, byteLength, maxBytes, 0)
}
var i = byteLength - 1
var mul = 1
this[offset + i] = value & 0xFF
while (--i >= 0 && (mul *= 0x100)) {
this[offset + i] = (value / mul) & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
this[offset] = (value & 0xff)
return offset + 1
}
Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
return offset + 2
}
Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
this[offset] = (value >>> 8)
this[offset + 1] = (value & 0xff)
return offset + 2
}
Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
this[offset + 3] = (value >>> 24)
this[offset + 2] = (value >>> 16)
this[offset + 1] = (value >>> 8)
this[offset] = (value & 0xff)
return offset + 4
}
Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
this[offset] = (value >>> 24)
this[offset + 1] = (value >>> 16)
this[offset + 2] = (value >>> 8)
this[offset + 3] = (value & 0xff)
return offset + 4
}
Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) {
var limit = Math.pow(2, (8 * byteLength) - 1)
checkInt(this, value, offset, byteLength, limit - 1, -limit)
}
var i = 0
var mul = 1
var sub = 0
this[offset] = value & 0xFF
while (++i < byteLength && (mul *= 0x100)) {
if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
sub = 1
}
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) {
var limit = Math.pow(2, (8 * byteLength) - 1)
checkInt(this, value, offset, byteLength, limit - 1, -limit)
}
var i = byteLength - 1
var mul = 1
var sub = 0
this[offset + i] = value & 0xFF
while (--i >= 0 && (mul *= 0x100)) {
if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
sub = 1
}
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
if (value < 0) value = 0xff + value + 1
this[offset] = (value & 0xff)
return offset + 1
}
Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
return offset + 2
}
Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
this[offset] = (value >>> 8)
this[offset + 1] = (value & 0xff)
return offset + 2
}
Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
this[offset + 2] = (value >>> 16)
this[offset + 3] = (value >>> 24)
return offset + 4
}
Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
if (value < 0) value = 0xffffffff + value + 1
this[offset] = (value >>> 24)
this[offset + 1] = (value >>> 16)
this[offset + 2] = (value >>> 8)
this[offset + 3] = (value & 0xff)
return offset + 4
}
function checkIEEE754 (buf, value, offset, ext, max, min) {
if (offset + ext > buf.length) throw new RangeError('Index out of range')
if (offset < 0) throw new RangeError('Index out of range')
}
function writeFloat (buf, value, offset, littleEndian, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) {
checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
}
ieee754.write(buf, value, offset, littleEndian, 23, 4)
return offset + 4
}
Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
return writeFloat(this, value, offset, true, noAssert)
}
Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
return writeFloat(this, value, offset, false, noAssert)
}
function writeDouble (buf, value, offset, littleEndian, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) {
checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
}
ieee754.write(buf, value, offset, littleEndian, 52, 8)
return offset + 8
}
Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
return writeDouble(this, value, offset, true, noAssert)
}
Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
return writeDouble(this, value, offset, false, noAssert)
}
// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
Buffer.prototype.copy = function copy (target, targetStart, start, end) {
if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')
if (!start) start = 0
if (!end && end !== 0) end = this.length
if (targetStart >= target.length) targetStart = target.length
if (!targetStart) targetStart = 0
if (end > 0 && end < start) end = start
// Copy 0 bytes; we're done
if (end === start) return 0
if (target.length === 0 || this.length === 0) return 0
// Fatal error conditions
if (targetStart < 0) {
throw new RangeError('targetStart out of bounds')
}
if (start < 0 || start >= this.length) throw new RangeError('Index out of range')
if (end < 0) throw new RangeError('sourceEnd out of bounds')
// Are we oob?
if (end > this.length) end = this.length
if (target.length - targetStart < end - start) {
end = target.length - targetStart + start
}
var len = end - start
if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {
// Use built-in when available, missing from IE11
this.copyWithin(targetStart, start, end)
} else if (this === target && start < targetStart && targetStart < end) {
// descending copy from end
for (var i = len - 1; i >= 0; --i) {
target[i + targetStart] = this[i + start]
}
} else {
Uint8Array.prototype.set.call(
target,
this.subarray(start, end),
targetStart
)
}
return len
}
// Usage:
// buffer.fill(number[, offset[, end]])
// buffer.fill(buffer[, offset[, end]])
// buffer.fill(string[, offset[, end]][, encoding])
Buffer.prototype.fill = function fill (val, start, end, encoding) {
// Handle string cases:
if (typeof val === 'string') {
if (typeof start === 'string') {
encoding = start
start = 0
end = this.length
} else if (typeof end === 'string') {
encoding = end
end = this.length
}
if (encoding !== undefined && typeof encoding !== 'string') {
throw new TypeError('encoding must be a string')
}
if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
throw new TypeError('Unknown encoding: ' + encoding)
}
if (val.length === 1) {
var code = val.charCodeAt(0)
if ((encoding === 'utf8' && code < 128) ||
encoding === 'latin1') {
// Fast path: If `val` fits into a single byte, use that numeric value.
val = code
}
}
} else if (typeof val === 'number') {
val = val & 255
}
// Invalid ranges are not set to a default, so can range check early.
if (start < 0 || this.length < start || this.length < end) {
throw new RangeError('Out of range index')
}
if (end <= start) {
return this
}
start = start >>> 0
end = end === undefined ? this.length : end >>> 0
if (!val) val = 0
var i
if (typeof val === 'number') {
for (i = start; i < end; ++i) {
this[i] = val
}
} else {
var bytes = Buffer.isBuffer(val)
? val
: Buffer.from(val, encoding)
var len = bytes.length
if (len === 0) {
throw new TypeError('The value "' + val +
'" is invalid for argument "value"')
}
for (i = 0; i < end - start; ++i) {
this[i + start] = bytes[i % len]
}
}
return this
}
// HELPER FUNCTIONS
// ================
var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g
function base64clean (str) {
// Node takes equal signs as end of the Base64 encoding
str = str.split('=')[0]
// Node strips out invalid characters like \n and \t from the string, base64-js does not
str = str.trim().replace(INVALID_BASE64_RE, '')
// Node converts strings with length < 2 to ''
if (str.length < 2) return ''
// Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
while (str.length % 4 !== 0) {
str = str + '='
}
return str
}
function toHex (n) {
if (n < 16) return '0' + n.toString(16)
return n.toString(16)
}
function utf8ToBytes (string, units) {
units = units || Infinity
var codePoint
var length = string.length
var leadSurrogate = null
var bytes = []
for (var i = 0; i < length; ++i) {
codePoint = string.charCodeAt(i)
// is surrogate component
if (codePoint > 0xD7FF && codePoint < 0xE000) {
// last char was a lead
if (!leadSurrogate) {
// no lead yet
if (codePoint > 0xDBFF) {
// unexpected trail
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
continue
} else if (i + 1 === length) {
// unpaired lead
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
continue
}
// valid lead
leadSurrogate = codePoint
continue
}
// 2 leads in a row
if (codePoint < 0xDC00) {
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
leadSurrogate = codePoint
continue
}
// valid surrogate pair
codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
} else if (leadSurrogate) {
// valid bmp char, but last char was a lead
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
}
leadSurrogate = null
// encode utf8
if (codePoint < 0x80) {
if ((units -= 1) < 0) break
bytes.push(codePoint)
} else if (codePoint < 0x800) {
if ((units -= 2) < 0) break
bytes.push(
codePoint >> 0x6 | 0xC0,
codePoint & 0x3F | 0x80
)
} else if (codePoint < 0x10000) {
if ((units -= 3) < 0) break
bytes.push(
codePoint >> 0xC | 0xE0,
codePoint >> 0x6 & 0x3F | 0x80,
codePoint & 0x3F | 0x80
)
} else if (codePoint < 0x110000) {
if ((units -= 4) < 0) break
bytes.push(
codePoint >> 0x12 | 0xF0,
codePoint >> 0xC & 0x3F | 0x80,
codePoint >> 0x6 & 0x3F | 0x80,
codePoint & 0x3F | 0x80
)
} else {
throw new Error('Invalid code point')
}
}
return bytes
}
function asciiToBytes (str) {
var byteArray = []
for (var i = 0; i < str.length; ++i) {
// Node's code seems to be doing this and not & 0x7F..
byteArray.push(str.charCodeAt(i) & 0xFF)
}
return byteArray
}
function utf16leToBytes (str, units) {
var c, hi, lo
var byteArray = []
for (var i = 0; i < str.length; ++i) {
if ((units -= 2) < 0) break
c = str.charCodeAt(i)
hi = c >> 8
lo = c % 256
byteArray.push(lo)
byteArray.push(hi)
}
return byteArray
}
function base64ToBytes (str) {
return base64.toByteArray(base64clean(str))
}
function blitBuffer (src, dst, offset, length) {
for (var i = 0; i < length; ++i) {
if ((i + offset >= dst.length) || (i >= src.length)) break
dst[i + offset] = src[i]
}
return i
}
// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass
// the `instanceof` check but they should be treated as of that type.
// See: https://github.com/feross/buffer/issues/166
function isInstance (obj, type) {
return obj instanceof type ||
(obj != null && obj.constructor != null && obj.constructor.name != null &&
obj.constructor.name === type.name)
}
function numberIsNaN (obj) {
// For IE11 support
return obj !== obj // eslint-disable-line no-self-compare
}
}).call(this)}).call(this,require("buffer").Buffer)
},{"base64-js":470,"buffer":473,"ieee754":477}],474:[function(require,module,exports){
(function (Buffer){(function (){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// NOTE: These type checking functions intentionally don't use `instanceof`
// because it is fragile and can be easily faked with `Object.create()`.
function isArray(arg) {
if (Array.isArray) {
return Array.isArray(arg);
}
return objectToString(arg) === '[object Array]';
}
exports.isArray = isArray;
function isBoolean(arg) {
return typeof arg === 'boolean';
}
exports.isBoolean = isBoolean;
function isNull(arg) {
return arg === null;
}
exports.isNull = isNull;
function isNullOrUndefined(arg) {
return arg == null;
}
exports.isNullOrUndefined = isNullOrUndefined;
function isNumber(arg) {
return typeof arg === 'number';
}
exports.isNumber = isNumber;
function isString(arg) {
return typeof arg === 'string';
}
exports.isString = isString;
function isSymbol(arg) {
return typeof arg === 'symbol';
}
exports.isSymbol = isSymbol;
function isUndefined(arg) {
return arg === void 0;
}
exports.isUndefined = isUndefined;
function isRegExp(re) {
return objectToString(re) === '[object RegExp]';
}
exports.isRegExp = isRegExp;
function isObject(arg) {
return typeof arg === 'object' && arg !== null;
}
exports.isObject = isObject;
function isDate(d) {
return objectToString(d) === '[object Date]';
}
exports.isDate = isDate;
function isError(e) {
return (objectToString(e) === '[object Error]' || e instanceof Error);
}
exports.isError = isError;
function isFunction(arg) {
return typeof arg === 'function';
}
exports.isFunction = isFunction;
function isPrimitive(arg) {
return arg === null ||
typeof arg === 'boolean' ||
typeof arg === 'number' ||
typeof arg === 'string' ||
typeof arg === 'symbol' || // ES6 symbol
typeof arg === 'undefined';
}
exports.isPrimitive = isPrimitive;
exports.isBuffer = Buffer.isBuffer;
function objectToString(o) {
return Object.prototype.toString.call(o);
}
}).call(this)}).call(this,{"isBuffer":require("../../is-buffer/index.js")})
},{"../../is-buffer/index.js":479}],475:[function(require,module,exports){
(function (process){(function (){
/**
* This is the web browser implementation of `debug()`.
*
* Expose `debug()` as the module.
*/
exports = module.exports = require('./debug');
exports.log = log;
exports.formatArgs = formatArgs;
exports.save = save;
exports.load = load;
exports.useColors = useColors;
exports.storage = 'undefined' != typeof chrome
&& 'undefined' != typeof chrome.storage
? chrome.storage.local
: localstorage();
/**
* Colors.
*/
exports.colors = [
'lightseagreen',
'forestgreen',
'goldenrod',
'dodgerblue',
'darkorchid',
'crimson'
];
/**
* Currently only WebKit-based Web Inspectors, Firefox >= v31,
* and the Firebug extension (any Firefox version) are known
* to support "%c" CSS customizations.
*
* TODO: add a `localStorage` variable to explicitly enable/disable colors
*/
function useColors() {
// NB: In an Electron preload script, document will be defined but not fully
// initialized. Since we know we're in Chrome, we'll just detect this case
// explicitly
if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
return true;
}
// is webkit? http://stackoverflow.com/a/16459606/376773
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
// is firebug? http://stackoverflow.com/a/398120/376773
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
// is firefox >= v31?
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
// double check webkit in userAgent just in case we are in a worker
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
}
/**
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
*/
exports.formatters.j = function(v) {
try {
return JSON.stringify(v);
} catch (err) {
return '[UnexpectedJSONParseError]: ' + err.message;
}
};
/**
* Colorize log arguments if enabled.
*
* @api public
*/
function formatArgs(args) {
var useColors = this.useColors;
args[0] = (useColors ? '%c' : '')
+ this.namespace
+ (useColors ? ' %c' : ' ')
+ args[0]
+ (useColors ? '%c ' : ' ')
+ '+' + exports.humanize(this.diff);
if (!useColors) return;
var c = 'color: ' + this.color;
args.splice(1, 0, c, 'color: inherit')
// the final "%c" is somewhat tricky, because there could be other
// arguments passed either before or after the %c, so we need to
// figure out the correct index to insert the CSS into
var index = 0;
var lastC = 0;
args[0].replace(/%[a-zA-Z%]/g, function(match) {
if ('%%' === match) return;
index++;
if ('%c' === match) {
// we only are interested in the *last* %c
// (the user may have provided their own)
lastC = index;
}
});
args.splice(lastC, 0, c);
}
/**
* Invokes `console.log()` when available.
* No-op when `console.log` is not a "function".
*
* @api public
*/
function log() {
// this hackery is required for IE8/9, where
// the `console.log` function doesn't have 'apply'
return 'object' === typeof console
&& console.log
&& Function.prototype.apply.call(console.log, console, arguments);
}
/**
* Save `namespaces`.
*
* @param {String} namespaces
* @api private
*/
function save(namespaces) {
try {
if (null == namespaces) {
exports.storage.removeItem('debug');
} else {
exports.storage.debug = namespaces;
}
} catch(e) {}
}
/**
* Load `namespaces`.
*
* @return {String} returns the previously persisted debug modes
* @api private
*/
function load() {
var r;
try {
r = exports.storage.debug;
} catch(e) {}
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
if (!r && typeof process !== 'undefined' && 'env' in process) {
r = process.env.DEBUG;
}
return r;
}
/**
* Enable namespaces listed in `localStorage.debug` initially.
*/
exports.enable(load());
/**
* Localstorage attempts to return the localstorage.
*
* This is necessary because safari throws
* when a user disables cookies/localstorage
* and you attempt to access it.
*
* @return {LocalStorage}
* @api private
*/
function localstorage() {
try {
return window.localStorage;
} catch (e) {}
}
}).call(this)}).call(this,require('_process'))
},{"./debug":476,"_process":483}],476:[function(require,module,exports){
/**
* This is the common logic for both the Node.js and web browser
* implementations of `debug()`.
*
* Expose `debug()` as the module.
*/
exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
exports.coerce = coerce;
exports.disable = disable;
exports.enable = enable;
exports.enabled = enabled;
exports.humanize = require('ms');
/**
* The currently active debug mode names, and names to skip.
*/
exports.names = [];
exports.skips = [];
/**
* Map of special "%n" handling functions, for the debug "format" argument.
*
* Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
*/
exports.formatters = {};
/**
* Previous log timestamp.
*/
var prevTime;
/**
* Select a color.
* @param {String} namespace
* @return {Number}
* @api private
*/
function selectColor(namespace) {
var hash = 0, i;
for (i in namespace) {
hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
hash |= 0; // Convert to 32bit integer
}
return exports.colors[Math.abs(hash) % exports.colors.length];
}
/**
* Create a debugger with the given `namespace`.
*
* @param {String} namespace
* @return {Function}
* @api public
*/
function createDebug(namespace) {
function debug() {
// disabled?
if (!debug.enabled) return;
var self = debug;
// set `diff` timestamp
var curr = +new Date();
var ms = curr - (prevTime || curr);
self.diff = ms;
self.prev = prevTime;
self.curr = curr;
prevTime = curr;
// turn the `arguments` into a proper Array
var args = new Array(arguments.length);
for (var i = 0; i < args.length; i++) {
args[i] = arguments[i];
}
args[0] = exports.coerce(args[0]);
if ('string' !== typeof args[0]) {
// anything else let's inspect with %O
args.unshift('%O');
}
// apply any `formatters` transformations
var index = 0;
args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
// if we encounter an escaped % then don't increase the array index
if (match === '%%') return match;
index++;
var formatter = exports.formatters[format];
if ('function' === typeof formatter) {
var val = args[index];
match = formatter.call(self, val);
// now we need to remove `args[index]` since it's inlined in the `format`
args.splice(index, 1);
index--;
}
return match;
});
// apply env-specific formatting (colors, etc.)
exports.formatArgs.call(self, args);
var logFn = debug.log || exports.log || console.log.bind(console);
logFn.apply(self, args);
}
debug.namespace = namespace;
debug.enabled = exports.enabled(namespace);
debug.useColors = exports.useColors();
debug.color = selectColor(namespace);
// env-specific initialization logic for debug instances
if ('function' === typeof exports.init) {
exports.init(debug);
}
return debug;
}
/**
* Enables a debug mode by namespaces. This can include modes
* separated by a colon and wildcards.
*
* @param {String} namespaces
* @api public
*/
function enable(namespaces) {
exports.save(namespaces);
exports.names = [];
exports.skips = [];
var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
var len = split.length;
for (var i = 0; i < len; i++) {
if (!split[i]) continue; // ignore empty strings
namespaces = split[i].replace(/\*/g, '.*?');
if (namespaces[0] === '-') {
exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
} else {
exports.names.push(new RegExp('^' + namespaces + '$'));
}
}
}
/**
* Disable debug output.
*
* @api public
*/
function disable() {
exports.enable('');
}
/**
* Returns true if the given mode name is enabled, false otherwise.
*
* @param {String} name
* @return {Boolean}
* @api public
*/
function enabled(name) {
var i, len;
for (i = 0, len = exports.skips.length; i < len; i++) {
if (exports.skips[i].test(name)) {
return false;
}
}
for (i = 0, len = exports.names.length; i < len; i++) {
if (exports.names[i].test(name)) {
return true;
}
}
return false;
}
/**
* Coerce `val`.
*
* @param {Mixed} val
* @return {Mixed}
* @api private
*/
function coerce(val) {
if (val instanceof Error) return val.stack || val.message;
return val;
}
},{"ms":481}],477:[function(require,module,exports){
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
exports.read = function (buffer, offset, isLE, mLen, nBytes) {
var e, m
var eLen = (nBytes * 8) - mLen - 1
var eMax = (1 << eLen) - 1
var eBias = eMax >> 1
var nBits = -7
var i = isLE ? (nBytes - 1) : 0
var d = isLE ? -1 : 1
var s = buffer[offset + i]
i += d
e = s & ((1 << (-nBits)) - 1)
s >>= (-nBits)
nBits += eLen
for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
m = e & ((1 << (-nBits)) - 1)
e >>= (-nBits)
nBits += mLen
for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
if (e === 0) {
e = 1 - eBias
} else if (e === eMax) {
return m ? NaN : ((s ? -1 : 1) * Infinity)
} else {
m = m + Math.pow(2, mLen)
e = e - eBias
}
return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
}
exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
var e, m, c
var eLen = (nBytes * 8) - mLen - 1
var eMax = (1 << eLen) - 1
var eBias = eMax >> 1
var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
var i = isLE ? 0 : (nBytes - 1)
var d = isLE ? 1 : -1
var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
value = Math.abs(value)
if (isNaN(value) || value === Infinity) {
m = isNaN(value) ? 1 : 0
e = eMax
} else {
e = Math.floor(Math.log(value) / Math.LN2)
if (value * (c = Math.pow(2, -e)) < 1) {
e--
c *= 2
}
if (e + eBias >= 1) {
value += rt / c
} else {
value += rt * Math.pow(2, 1 - eBias)
}
if (value * c >= 2) {
e++
c /= 2
}
if (e + eBias >= eMax) {
m = 0
e = eMax
} else if (e + eBias >= 1) {
m = ((value * c) - 1) * Math.pow(2, mLen)
e = e + eBias
} else {
m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
e = 0
}
}
for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
e = (e << mLen) | m
eLen += mLen
for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
buffer[offset + i - d] |= s * 128
}
},{}],478:[function(require,module,exports){
if (typeof Object.create === 'function') {
// implementation from standard node.js 'util' module
module.exports = function inherits(ctor, superCtor) {
if (superCtor) {
ctor.super_ = superCtor
ctor.prototype = Object.create(superCtor.prototype, {
constructor: {
value: ctor,
enumerable: false,
writable: true,
configurable: true
}
})
}
};
} else {
// old school shim for old browsers
module.exports = function inherits(ctor, superCtor) {
if (superCtor) {
ctor.super_ = superCtor
var TempCtor = function () {}
TempCtor.prototype = superCtor.prototype
ctor.prototype = new TempCtor()
ctor.prototype.constructor = ctor
}
}
}
},{}],479:[function(require,module,exports){
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
// The _isBuffer check is for Safari 5-7 support, because it's missing
// Object.prototype.constructor. Remove this eventually
module.exports = function (obj) {
return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
}
function isBuffer (obj) {
return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
}
// For Node v0.10 support. Remove this eventually.
function isSlowBuffer (obj) {
return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
}
},{}],480:[function(require,module,exports){
var toString = {}.toString;
module.exports = Array.isArray || function (arr) {
return toString.call(arr) == '[object Array]';
};
},{}],481:[function(require,module,exports){
/**
* Helpers.
*/
var s = 1000;
var m = s * 60;
var h = m * 60;
var d = h * 24;
var y = d * 365.25;
/**
* Parse or format the given `val`.
*
* Options:
*
* - `long` verbose formatting [false]
*
* @param {String|Number} val
* @param {Object} [options]
* @throws {Error} throw an error if val is not a non-empty string or a number
* @return {String|Number}
* @api public
*/
module.exports = function(val, options) {
options = options || {};
var type = typeof val;
if (type === 'string' && val.length > 0) {
return parse(val);
} else if (type === 'number' && isNaN(val) === false) {
return options.long ? fmtLong(val) : fmtShort(val);
}
throw new Error(
'val is not a non-empty string or a valid number. val=' +
JSON.stringify(val)
);
};
/**
* Parse the given `str` and return milliseconds.
*
* @param {String} str
* @return {Number}
* @api private
*/
function parse(str) {
str = String(str);
if (str.length > 100) {
return;
}
var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
str
);
if (!match) {
return;
}
var n = parseFloat(match[1]);
var type = (match[2] || 'ms').toLowerCase();
switch (type) {
case 'years':
case 'year':
case 'yrs':
case 'yr':
case 'y':
return n * y;
case 'days':
case 'day':
case 'd':
return n * d;
case 'hours':
case 'hour':
case 'hrs':
case 'hr':
case 'h':
return n * h;
case 'minutes':
case 'minute':
case 'mins':
case 'min':
case 'm':
return n * m;
case 'seconds':
case 'second':
case 'secs':
case 'sec':
case 's':
return n * s;
case 'milliseconds':
case 'millisecond':
case 'msecs':
case 'msec':
case 'ms':
return n;
default:
return undefined;
}
}
/**
* Short format for `ms`.
*
* @param {Number} ms
* @return {String}
* @api private
*/
function fmtShort(ms) {
if (ms >= d) {
return Math.round(ms / d) + 'd';
}
if (ms >= h) {
return Math.round(ms / h) + 'h';
}
if (ms >= m) {
return Math.round(ms / m) + 'm';
}
if (ms >= s) {
return Math.round(ms / s) + 's';
}
return ms + 'ms';
}
/**
* Long format for `ms`.
*
* @param {Number} ms
* @return {String}
* @api private
*/
function fmtLong(ms) {
return plural(ms, d, 'day') ||
plural(ms, h, 'hour') ||
plural(ms, m, 'minute') ||
plural(ms, s, 'second') ||
ms + ' ms';
}
/**
* Pluralization helper.
*/
function plural(ms, n, name) {
if (ms < n) {
return;
}
if (ms < n * 1.5) {
return Math.floor(ms / n) + ' ' + name;
}
return Math.ceil(ms / n) + ' ' + name + 's';
}
},{}],482:[function(require,module,exports){
(function (process){(function (){
'use strict';
if (typeof process === 'undefined' ||
!process.version ||
process.version.indexOf('v0.') === 0 ||
process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
module.exports = { nextTick: nextTick };
} else {
module.exports = process
}
function nextTick(fn, arg1, arg2, arg3) {
if (typeof fn !== 'function') {
throw new TypeError('"callback" argument must be a function');
}
var len = arguments.length;
var args, i;
switch (len) {
case 0:
case 1:
return process.nextTick(fn);
case 2:
return process.nextTick(function afterTickOne() {
fn.call(null, arg1);
});
case 3:
return process.nextTick(function afterTickTwo() {
fn.call(null, arg1, arg2);
});
case 4:
return process.nextTick(function afterTickThree() {
fn.call(null, arg1, arg2, arg3);
});
default:
args = new Array(len - 1);
i = 0;
while (i < args.length) {
args[i++] = arguments[i];
}
return process.nextTick(function afterTick() {
fn.apply(null, args);
});
}
}
}).call(this)}).call(this,require('_process'))
},{"_process":483}],483:[function(require,module,exports){
// shim for using process in browser
var process = module.exports = {};
// cached from whatever global is present so that test runners that stub it
// don't break things. But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals. It's inside a
// function because try/catches deoptimize in certain engines.
var cachedSetTimeout;
var cachedClearTimeout;
function defaultSetTimout() {
throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout () {
throw new Error('clearTimeout has not been defined');
}
(function () {
try {
if (typeof setTimeout === 'function') {
cachedSetTimeout = setTimeout;
} else {
cachedSetTimeout = defaultSetTimout;
}
} catch (e) {
cachedSetTimeout = defaultSetTimout;
}
try {
if (typeof clearTimeout === 'function') {
cachedClearTimeout = clearTimeout;
} else {
cachedClearTimeout = defaultClearTimeout;
}
} catch (e) {
cachedClearTimeout = defaultClearTimeout;
}
} ())
function runTimeout(fun) {
if (cachedSetTimeout === setTimeout) {
//normal enviroments in sane situations
return setTimeout(fun, 0);
}
// if setTimeout wasn't available but was latter defined
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
cachedSetTimeout = setTimeout;
return setTimeout(fun, 0);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedSetTimeout(fun, 0);
} catch(e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedSetTimeout.call(null, fun, 0);
} catch(e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
return cachedSetTimeout.call(this, fun, 0);
}
}
}
function runClearTimeout(marker) {
if (cachedClearTimeout === clearTimeout) {
//normal enviroments in sane situations
return clearTimeout(marker);
}
// if clearTimeout wasn't available but was latter defined
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
cachedClearTimeout = clearTimeout;
return clearTimeout(marker);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedClearTimeout(marker);
} catch (e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedClearTimeout.call(null, marker);
} catch (e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
return cachedClearTimeout.call(this, marker);
}
}
}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
if (!draining || !currentQueue) {
return;
}
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = runTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while(len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
currentQueue[queueIndex].run();
}
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
runClearTimeout(timeout);
}
process.nextTick = function (fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
runTimeout(drainQueue);
}
};
// v8 likes predictible objects
function Item(fun, array) {
this.fun = fun;
this.array = array;
}
Item.prototype.run = function () {
this.fun.apply(null, this.array);
};
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = ''; // empty string to avoid regexp issues
process.versions = {};
function noop() {}
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.prependListener = noop;
process.prependOnceListener = noop;
process.listeners = function (name) { return [] }
process.binding = function (name) {
throw new Error('process.binding is not supported');
};
process.cwd = function () { return '/' };
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
process.umask = function() { return 0; };
},{}],484:[function(require,module,exports){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// a duplex stream is just a stream that is both readable and writable.
// Since JS doesn't have multiple prototypal inheritance, this class
// prototypally inherits from Readable, and then parasitically from
// Writable.
'use strict';
/*<replacement>*/
var pna = require('process-nextick-args');
/*</replacement>*/
/*<replacement>*/
var objectKeys = Object.keys || function (obj) {
var keys = [];
for (var key in obj) {
keys.push(key);
}return keys;
};
/*</replacement>*/
module.exports = Duplex;
/*<replacement>*/
var util = Object.create(require('core-util-is'));
util.inherits = require('inherits');
/*</replacement>*/
var Readable = require('./_stream_readable');
var Writable = require('./_stream_writable');
util.inherits(Duplex, Readable);
{
// avoid scope creep, the keys array can then be collected
var keys = objectKeys(Writable.prototype);
for (var v = 0; v < keys.length; v++) {
var method = keys[v];
if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
}
}
function Duplex(options) {
if (!(this instanceof Duplex)) return new Duplex(options);
Readable.call(this, options);
Writable.call(this, options);
if (options && options.readable === false) this.readable = false;
if (options && options.writable === false) this.writable = false;
this.allowHalfOpen = true;
if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
this.once('end', onend);
}
Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
// making it explicit this property is not enumerable
// because otherwise some prototype manipulation in
// userland will fail
enumerable: false,
get: function () {
return this._writableState.highWaterMark;
}
});
// the no-half-open enforcer
function onend() {
// if we allow half-open state, or if the writable side ended,
// then we're ok.
if (this.allowHalfOpen || this._writableState.ended) return;
// no more data can be written.
// But allow more writes to happen in this tick.
pna.nextTick(onEndNT, this);
}
function onEndNT(self) {
self.end();
}
Object.defineProperty(Duplex.prototype, 'destroyed', {
get: function () {
if (this._readableState === undefined || this._writableState === undefined) {
return false;
}
return this._readableState.destroyed && this._writableState.destroyed;
},
set: function (value) {
// we ignore the value if the stream
// has not been initialized yet
if (this._readableState === undefined || this._writableState === undefined) {
return;
}
// backward compatibility, the user is explicitly
// managing destroyed
this._readableState.destroyed = value;
this._writableState.destroyed = value;
}
});
Duplex.prototype._destroy = function (err, cb) {
this.push(null);
this.end();
pna.nextTick(cb, err);
};
},{"./_stream_readable":486,"./_stream_writable":488,"core-util-is":474,"inherits":478,"process-nextick-args":482}],485:[function(require,module,exports){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// a passthrough stream.
// basically just the most minimal sort of Transform stream.
// Every written chunk gets output as-is.
'use strict';
module.exports = PassThrough;
var Transform = require('./_stream_transform');
/*<replacement>*/
var util = Object.create(require('core-util-is'));
util.inherits = require('inherits');
/*</replacement>*/
util.inherits(PassThrough, Transform);
function PassThrough(options) {
if (!(this instanceof PassThrough)) return new PassThrough(options);
Transform.call(this, options);
}
PassThrough.prototype._transform = function (chunk, encoding, cb) {
cb(null, chunk);
};
},{"./_stream_transform":487,"core-util-is":474,"inherits":478}],486:[function(require,module,exports){
(function (process,global){(function (){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
/*<replacement>*/
var pna = require('process-nextick-args');
/*</replacement>*/
module.exports = Readable;
/*<replacement>*/
var isArray = require('isarray');
/*</replacement>*/
/*<replacement>*/
var Duplex;
/*</replacement>*/
Readable.ReadableState = ReadableState;
/*<replacement>*/
var EE = require('events').EventEmitter;
var EElistenerCount = function (emitter, type) {
return emitter.listeners(type).length;
};
/*</replacement>*/
/*<replacement>*/
var Stream = require('./internal/streams/stream');
/*</replacement>*/
/*<replacement>*/
var Buffer = require('safe-buffer').Buffer;
var OurUint8Array = global.Uint8Array || function () {};
function _uint8ArrayToBuffer(chunk) {
return Buffer.from(chunk);
}
function _isUint8Array(obj) {
return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
}
/*</replacement>*/
/*<replacement>*/
var util = Object.create(require('core-util-is'));
util.inherits = require('inherits');
/*</replacement>*/
/*<replacement>*/
var debugUtil = require('util');
var debug = void 0;
if (debugUtil && debugUtil.debuglog) {
debug = debugUtil.debuglog('stream');
} else {
debug = function () {};
}
/*</replacement>*/
var BufferList = require('./internal/streams/BufferList');
var destroyImpl = require('./internal/streams/destroy');
var StringDecoder;
util.inherits(Readable, Stream);
var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
function prependListener(emitter, event, fn) {
// Sadly this is not cacheable as some libraries bundle their own
// event emitter implementation with them.
if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);
// This is a hack to make sure that our error handler is attached before any
// userland ones. NEVER DO THIS. This is here only because this code needs
// to continue to work with older versions of Node.js that do not include
// the prependListener() method. The goal is to eventually remove this hack.
if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
}
function ReadableState(options, stream) {
Duplex = Duplex || require('./_stream_duplex');
options = options || {};
// Duplex streams are both readable and writable, but share
// the same options object.
// However, some cases require setting options to different
// values for the readable and the writable sides of the duplex stream.
// These options can be provided separately as readableXXX and writableXXX.
var isDuplex = stream instanceof Duplex;
// object stream flag. Used to make read(n) ignore n and to
// make all the buffer merging and length checks go away
this.objectMode = !!options.objectMode;
if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
// the point at which it stops calling _read() to fill the buffer
// Note: 0 is a valid value, means "don't call _read preemptively ever"
var hwm = options.highWaterMark;
var readableHwm = options.readableHighWaterMark;
var defaultHwm = this.objectMode ? 16 : 16 * 1024;
if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;
// cast to ints.
this.highWaterMark = Math.floor(this.highWaterMark);
// A linked list is used to store data chunks instead of an array because the
// linked list can remove elements from the beginning faster than
// array.shift()
this.buffer = new BufferList();
this.length = 0;
this.pipes = null;
this.pipesCount = 0;
this.flowing = null;
this.ended = false;
this.endEmitted = false;
this.reading = false;
// a flag to be able to tell if the event 'readable'/'data' is emitted
// immediately, or on a later tick. We set this to true at first, because
// any actions that shouldn't happen until "later" should generally also
// not happen before the first read call.
this.sync = true;
// whenever we return null, then we set a flag to say
// that we're awaiting a 'readable' event emission.
this.needReadable = false;
this.emittedReadable = false;
this.readableListening = false;
this.resumeScheduled = false;
// has it been destroyed
this.destroyed = false;
// Crypto is kind of old and crusty. Historically, its default string
// encoding is 'binary' so we have to make this configurable.
// Everything else in the universe uses 'utf8', though.
this.defaultEncoding = options.defaultEncoding || 'utf8';
// the number of writers that are awaiting a drain event in .pipe()s
this.awaitDrain = 0;
// if true, a maybeReadMore has been scheduled
this.readingMore = false;
this.decoder = null;
this.encoding = null;
if (options.encoding) {
if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
this.decoder = new StringDecoder(options.encoding);
this.encoding = options.encoding;
}
}
function Readable(options) {
Duplex = Duplex || require('./_stream_duplex');
if (!(this instanceof Readable)) return new Readable(options);
this._readableState = new ReadableState(options, this);
// legacy
this.readable = true;
if (options) {
if (typeof options.read === 'function') this._read = options.read;
if (typeof options.destroy === 'function') this._destroy = options.destroy;
}
Stream.call(this);
}
Object.defineProperty(Readable.prototype, 'destroyed', {
get: function () {
if (this._readableState === undefined) {
return false;
}
return this._readableState.destroyed;
},
set: function (value) {
// we ignore the value if the stream
// has not been initialized yet
if (!this._readableState) {
return;
}
// backward compatibility, the user is explicitly
// managing destroyed
this._readableState.destroyed = value;
}
});
Readable.prototype.destroy = destroyImpl.destroy;
Readable.prototype._undestroy = destroyImpl.undestroy;
Readable.prototype._destroy = function (err, cb) {
this.push(null);
cb(err);
};
// Manually shove something into the read() buffer.
// This returns true if the highWaterMark has not been hit yet,
// similar to how Writable.write() returns true if you should
// write() some more.
Readable.prototype.push = function (chunk, encoding) {
var state = this._readableState;
var skipChunkCheck;
if (!state.objectMode) {
if (typeof chunk === 'string') {
encoding = encoding || state.defaultEncoding;
if (encoding !== state.encoding) {
chunk = Buffer.from(chunk, encoding);
encoding = '';
}
skipChunkCheck = true;
}
} else {
skipChunkCheck = true;
}
return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
};
// Unshift should *always* be something directly out of read()
Readable.prototype.unshift = function (chunk) {
return readableAddChunk(this, chunk, null, true, false);
};
function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
var state = stream._readableState;
if (chunk === null) {
state.reading = false;
onEofChunk(stream, state);
} else {
var er;
if (!skipChunkCheck) er = chunkInvalid(state, chunk);
if (er) {
stream.emit('error', er);
} else if (state.objectMode || chunk && chunk.length > 0) {
if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
chunk = _uint8ArrayToBuffer(chunk);
}
if (addToFront) {
if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);
} else if (state.ended) {
stream.emit('error', new Error('stream.push() after EOF'));
} else {
state.reading = false;
if (state.decoder && !encoding) {
chunk = state.decoder.write(chunk);
if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
} else {
addChunk(stream, state, chunk, false);
}
}
} else if (!addToFront) {
state.reading = false;
}
}
return needMoreData(state);
}
function addChunk(stream, state, chunk, addToFront) {
if (state.flowing && state.length === 0 && !state.sync) {
stream.emit('data', chunk);
stream.read(0);
} else {
// update the buffer info.
state.length += state.objectMode ? 1 : chunk.length;
if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
if (state.needReadable) emitReadable(stream);
}
maybeReadMore(stream, state);
}
function chunkInvalid(state, chunk) {
var er;
if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
er = new TypeError('Invalid non-string/buffer chunk');
}
return er;
}
// if it's past the high water mark, we can push in some more.
// Also, if we have no data yet, we can stand some
// more bytes. This is to work around cases where hwm=0,
// such as the repl. Also, if the push() triggered a
// readable event, and the user called read(largeNumber) such that
// needReadable was set, then we ought to push more, so that another
// 'readable' event will be triggered.
function needMoreData(state) {
return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
}
Readable.prototype.isPaused = function () {
return this._readableState.flowing === false;
};
// backwards compatibility.
Readable.prototype.setEncoding = function (enc) {
if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
this._readableState.decoder = new StringDecoder(enc);
this._readableState.encoding = enc;
return this;
};
// Don't raise the hwm > 8MB
var MAX_HWM = 0x800000;
function computeNewHighWaterMark(n) {
if (n >= MAX_HWM) {
n = MAX_HWM;
} else {
// Get the next highest power of 2 to prevent increasing hwm excessively in
// tiny amounts
n--;
n |= n >>> 1;
n |= n >>> 2;
n |= n >>> 4;
n |= n >>> 8;
n |= n >>> 16;
n++;
}
return n;
}
// This function is designed to be inlinable, so please take care when making
// changes to the function body.
function howMuchToRead(n, state) {
if (n <= 0 || state.length === 0 && state.ended) return 0;
if (state.objectMode) return 1;
if (n !== n) {
// Only flow one buffer at a time
if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
}
// If we're asking for more than the current hwm, then raise the hwm.
if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
if (n <= state.length) return n;
// Don't have enough
if (!state.ended) {
state.needReadable = true;
return 0;
}
return state.length;
}
// you can override either this method, or the async _read(n) below.
Readable.prototype.read = function (n) {
debug('read', n);
n = parseInt(n, 10);
var state = this._readableState;
var nOrig = n;
if (n !== 0) state.emittedReadable = false;
// if we're doing read(0) to trigger a readable event, but we
// already have a bunch of data in the buffer, then just trigger
// the 'readable' event and move on.
if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
debug('read: emitReadable', state.length, state.ended);
if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
return null;
}
n = howMuchToRead(n, state);
// if we've ended, and we're now clear, then finish it up.
if (n === 0 && state.ended) {
if (state.length === 0) endReadable(this);
return null;
}
// All the actual chunk generation logic needs to be
// *below* the call to _read. The reason is that in certain
// synthetic stream cases, such as passthrough streams, _read
// may be a completely synchronous operation which may change
// the state of the read buffer, providing enough data when
// before there was *not* enough.
//
// So, the steps are:
// 1. Figure out what the state of things will be after we do
// a read from the buffer.
//
// 2. If that resulting state will trigger a _read, then call _read.
// Note that this may be asynchronous, or synchronous. Yes, it is
// deeply ugly to write APIs this way, but that still doesn't mean
// that the Readable class should behave improperly, as streams are
// designed to be sync/async agnostic.
// Take note if the _read call is sync or async (ie, if the read call
// has returned yet), so that we know whether or not it's safe to emit
// 'readable' etc.
//
// 3. Actually pull the requested chunks out of the buffer and return.
// if we need a readable event, then we need to do some reading.
var doRead = state.needReadable;
debug('need readable', doRead);
// if we currently have less than the highWaterMark, then also read some
if (state.length === 0 || state.length - n < state.highWaterMark) {
doRead = true;
debug('length less than watermark', doRead);
}
// however, if we've ended, then there's no point, and if we're already
// reading, then it's unnecessary.
if (state.ended || state.reading) {
doRead = false;
debug('reading or ended', doRead);
} else if (doRead) {
debug('do read');
state.reading = true;
state.sync = true;
// if the length is currently zero, then we *need* a readable event.
if (state.length === 0) state.needReadable = true;
// call internal read method
this._read(state.highWaterMark);
state.sync = false;
// If _read pushed data synchronously, then `reading` will be false,
// and we need to re-evaluate how much data we can return to the user.
if (!state.reading) n = howMuchToRead(nOrig, state);
}
var ret;
if (n > 0) ret = fromList(n, state);else ret = null;
if (ret === null) {
state.needReadable = true;
n = 0;
} else {
state.length -= n;
}
if (state.length === 0) {
// If we have nothing in the buffer, then we want to know
// as soon as we *do* get something into the buffer.
if (!state.ended) state.needReadable = true;
// If we tried to read() past the EOF, then emit end on the next tick.
if (nOrig !== n && state.ended) endReadable(this);
}
if (ret !== null) this.emit('data', ret);
return ret;
};
function onEofChunk(stream, state) {
if (state.ended) return;
if (state.decoder) {
var chunk = state.decoder.end();
if (chunk && chunk.length) {
state.buffer.push(chunk);
state.length += state.objectMode ? 1 : chunk.length;
}
}
state.ended = true;
// emit 'readable' now to make sure it gets picked up.
emitReadable(stream);
}
// Don't emit readable right away in sync mode, because this can trigger
// another read() call => stack overflow. This way, it might trigger
// a nextTick recursion warning, but that's not so bad.
function emitReadable(stream) {
var state = stream._readableState;
state.needReadable = false;
if (!state.emittedReadable) {
debug('emitReadable', state.flowing);
state.emittedReadable = true;
if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);
}
}
function emitReadable_(stream) {
debug('emit readable');
stream.emit('readable');
flow(stream);
}
// at this point, the user has presumably seen the 'readable' event,
// and called read() to consume some data. that may have triggered
// in turn another _read(n) call, in which case reading = true if
// it's in progress.
// However, if we're not ended, or reading, and the length < hwm,
// then go ahead and try to read some more preemptively.
function maybeReadMore(stream, state) {
if (!state.readingMore) {
state.readingMore = true;
pna.nextTick(maybeReadMore_, stream, state);
}
}
function maybeReadMore_(stream, state) {
var len = state.length;
while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
debug('maybeReadMore read 0');
stream.read(0);
if (len === state.length)
// didn't get any data, stop spinning.
break;else len = state.length;
}
state.readingMore = false;
}
// abstract method. to be overridden in specific implementation classes.
// call cb(er, data) where data is <= n in length.
// for virtual (non-string, non-buffer) streams, "length" is somewhat
// arbitrary, and perhaps not very meaningful.
Readable.prototype._read = function (n) {
this.emit('error', new Error('_read() is not implemented'));
};
Readable.prototype.pipe = function (dest, pipeOpts) {
var src = this;
var state = this._readableState;
switch (state.pipesCount) {
case 0:
state.pipes = dest;
break;
case 1:
state.pipes = [state.pipes, dest];
break;
default:
state.pipes.push(dest);
break;
}
state.pipesCount += 1;
debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
var endFn = doEnd ? onend : unpipe;
if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);
dest.on('unpipe', onunpipe);
function onunpipe(readable, unpipeInfo) {
debug('onunpipe');
if (readable === src) {
if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
unpipeInfo.hasUnpiped = true;
cleanup();
}
}
}
function onend() {
debug('onend');
dest.end();
}
// when the dest drains, it reduces the awaitDrain counter
// on the source. This would be more elegant with a .once()
// handler in flow(), but adding and removing repeatedly is
// too slow.
var ondrain = pipeOnDrain(src);
dest.on('drain', ondrain);
var cleanedUp = false;
function cleanup() {
debug('cleanup');
// cleanup event handlers once the pipe is broken
dest.removeListener('close', onclose);
dest.removeListener('finish', onfinish);
dest.removeListener('drain', ondrain);
dest.removeListener('error', onerror);
dest.removeListener('unpipe', onunpipe);
src.removeListener('end', onend);
src.removeListener('end', unpipe);
src.removeListener('data', ondata);
cleanedUp = true;
// if the reader is waiting for a drain event from this
// specific writer, then it would cause it to never start
// flowing again.
// So, if this is awaiting a drain, then we just call it now.
// If we don't know, then assume that we are waiting for one.
if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
}
// If the user pushes more data while we're writing to dest then we'll end up
// in ondata again. However, we only want to increase awaitDrain once because
// dest will only emit one 'drain' event for the multiple writes.
// => Introduce a guard on increasing awaitDrain.
var increasedAwaitDrain = false;
src.on('data', ondata);
function ondata(chunk) {
debug('ondata');
increasedAwaitDrain = false;
var ret = dest.write(chunk);
if (false === ret && !increasedAwaitDrain) {
// If the user unpiped during `dest.write()`, it is possible
// to get stuck in a permanently paused state if that write
// also returned false.
// => Check whether `dest` is still a piping destination.
if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
debug('false write response, pause', src._readableState.awaitDrain);
src._readableState.awaitDrain++;
increasedAwaitDrain = true;
}
src.pause();
}
}
// if the dest has an error, then stop piping into it.
// however, don't suppress the throwing behavior for this.
function onerror(er) {
debug('onerror', er);
unpipe();
dest.removeListener('error', onerror);
if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
}
// Make sure our error handler is attached before userland ones.
prependListener(dest, 'error', onerror);
// Both close and finish should trigger unpipe, but only once.
function onclose() {
dest.removeListener('finish', onfinish);
unpipe();
}
dest.once('close', onclose);
function onfinish() {
debug('onfinish');
dest.removeListener('close', onclose);
unpipe();
}
dest.once('finish', onfinish);
function unpipe() {
debug('unpipe');
src.unpipe(dest);
}
// tell the dest that it's being piped to
dest.emit('pipe', src);
// start the flow if it hasn't been started already.
if (!state.flowing) {
debug('pipe resume');
src.resume();
}
return dest;
};
function pipeOnDrain(src) {
return function () {
var state = src._readableState;
debug('pipeOnDrain', state.awaitDrain);
if (state.awaitDrain) state.awaitDrain--;
if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
state.flowing = true;
flow(src);
}
};
}
Readable.prototype.unpipe = function (dest) {
var state = this._readableState;
var unpipeInfo = { hasUnpiped: false };
// if we're not piping anywhere, then do nothing.
if (state.pipesCount === 0) return this;
// just one destination. most common case.
if (state.pipesCount === 1) {
// passed in one, but it's not the right one.
if (dest && dest !== state.pipes) return this;
if (!dest) dest = state.pipes;
// got a match.
state.pipes = null;
state.pipesCount = 0;
state.flowing = false;
if (dest) dest.emit('unpipe', this, unpipeInfo);
return this;
}
// slow case. multiple pipe destinations.
if (!dest) {
// remove all.
var dests = state.pipes;
var len = state.pipesCount;
state.pipes = null;
state.pipesCount = 0;
state.flowing = false;
for (var i = 0; i < len; i++) {
dests[i].emit('unpipe', this, unpipeInfo);
}return this;
}
// try to find the right one.
var index = indexOf(state.pipes, dest);
if (index === -1) return this;
state.pipes.splice(index, 1);
state.pipesCount -= 1;
if (state.pipesCount === 1) state.pipes = state.pipes[0];
dest.emit('unpipe', this, unpipeInfo);
return this;
};
// set up data events if they are asked for
// Ensure readable listeners eventually get something
Readable.prototype.on = function (ev, fn) {
var res = Stream.prototype.on.call(this, ev, fn);
if (ev === 'data') {
// Start flowing on next tick if stream isn't explicitly paused
if (this._readableState.flowing !== false) this.resume();
} else if (ev === 'readable') {
var state = this._readableState;
if (!state.endEmitted && !state.readableListening) {
state.readableListening = state.needReadable = true;
state.emittedReadable = false;
if (!state.reading) {
pna.nextTick(nReadingNextTick, this);
} else if (state.length) {
emitReadable(this);
}
}
}
return res;
};
Readable.prototype.addListener = Readable.prototype.on;
function nReadingNextTick(self) {
debug('readable nexttick read 0');
self.read(0);
}
// pause() and resume() are remnants of the legacy readable stream API
// If the user uses them, then switch into old mode.
Readable.prototype.resume = function () {
var state = this._readableState;
if (!state.flowing) {
debug('resume');
state.flowing = true;
resume(this, state);
}
return this;
};
function resume(stream, state) {
if (!state.resumeScheduled) {
state.resumeScheduled = true;
pna.nextTick(resume_, stream, state);
}
}
function resume_(stream, state) {
if (!state.reading) {
debug('resume read 0');
stream.read(0);
}
state.resumeScheduled = false;
state.awaitDrain = 0;
stream.emit('resume');
flow(stream);
if (state.flowing && !state.reading) stream.read(0);
}
Readable.prototype.pause = function () {
debug('call pause flowing=%j', this._readableState.flowing);
if (false !== this._readableState.flowing) {
debug('pause');
this._readableState.flowing = false;
this.emit('pause');
}
return this;
};
function flow(stream) {
var state = stream._readableState;
debug('flow', state.flowing);
while (state.flowing && stream.read() !== null) {}
}
// wrap an old-style stream as the async data source.
// This is *not* part of the readable stream interface.
// It is an ugly unfortunate mess of history.
Readable.prototype.wrap = function (stream) {
var _this = this;
var state = this._readableState;
var paused = false;
stream.on('end', function () {
debug('wrapped end');
if (state.decoder && !state.ended) {
var chunk = state.decoder.end();
if (chunk && chunk.length) _this.push(chunk);
}
_this.push(null);
});
stream.on('data', function (chunk) {
debug('wrapped data');
if (state.decoder) chunk = state.decoder.write(chunk);
// don't skip over falsy values in objectMode
if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
var ret = _this.push(chunk);
if (!ret) {
paused = true;
stream.pause();
}
});
// proxy all the other methods.
// important when wrapping filters and duplexes.
for (var i in stream) {
if (this[i] === undefined && typeof stream[i] === 'function') {
this[i] = function (method) {
return function () {
return stream[method].apply(stream, arguments);
};
}(i);
}
}
// proxy certain important events.
for (var n = 0; n < kProxyEvents.length; n++) {
stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
}
// when we try to consume some more bytes, simply unpause the
// underlying stream.
this._read = function (n) {
debug('wrapped _read', n);
if (paused) {
paused = false;
stream.resume();
}
};
return this;
};
Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
// making it explicit this property is not enumerable
// because otherwise some prototype manipulation in
// userland will fail
enumerable: false,
get: function () {
return this._readableState.highWaterMark;
}
});
// exposed for testing purposes only.
Readable._fromList = fromList;
// Pluck off n bytes from an array of buffers.
// Length is the combined lengths of all the buffers in the list.
// This function is designed to be inlinable, so please take care when making
// changes to the function body.
function fromList(n, state) {
// nothing buffered
if (state.length === 0) return null;
var ret;
if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
// read it all, truncate the list
if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
state.buffer.clear();
} else {
// read part of list
ret = fromListPartial(n, state.buffer, state.decoder);
}
return ret;
}
// Extracts only enough buffered data to satisfy the amount requested.
// This function is designed to be inlinable, so please take care when making
// changes to the function body.
function fromListPartial(n, list, hasStrings) {
var ret;
if (n < list.head.data.length) {
// slice is the same for buffers and strings
ret = list.head.data.slice(0, n);
list.head.data = list.head.data.slice(n);
} else if (n === list.head.data.length) {
// first chunk is a perfect match
ret = list.shift();
} else {
// result spans more than one buffer
ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
}
return ret;
}
// Copies a specified amount of characters from the list of buffered data
// chunks.
// This function is designed to be inlinable, so please take care when making
// changes to the function body.
function copyFromBufferString(n, list) {
var p = list.head;
var c = 1;
var ret = p.data;
n -= ret.length;
while (p = p.next) {
var str = p.data;
var nb = n > str.length ? str.length : n;
if (nb === str.length) ret += str;else ret += str.slice(0, n);
n -= nb;
if (n === 0) {
if (nb === str.length) {
++c;
if (p.next) list.head = p.next;else list.head = list.tail = null;
} else {
list.head = p;
p.data = str.slice(nb);
}
break;
}
++c;
}
list.length -= c;
return ret;
}
// Copies a specified amount of bytes from the list of buffered data chunks.
// This function is designed to be inlinable, so please take care when making
// changes to the function body.
function copyFromBuffer(n, list) {
var ret = Buffer.allocUnsafe(n);
var p = list.head;
var c = 1;
p.data.copy(ret);
n -= p.data.length;
while (p = p.next) {
var buf = p.data;
var nb = n > buf.length ? buf.length : n;
buf.copy(ret, ret.length - n, 0, nb);
n -= nb;
if (n === 0) {
if (nb === buf.length) {
++c;
if (p.next) list.head = p.next;else list.head = list.tail = null;
} else {
list.head = p;
p.data = buf.slice(nb);
}
break;
}
++c;
}
list.length -= c;
return ret;
}
function endReadable(stream) {
var state = stream._readableState;
// If we get here before consuming all the bytes, then that is a
// bug in node. Should never happen.
if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
if (!state.endEmitted) {
state.ended = true;
pna.nextTick(endReadableNT, state, stream);
}
}
function endReadableNT(state, stream) {
// Check that we didn't get one last unshift.
if (!state.endEmitted && state.length === 0) {
state.endEmitted = true;
stream.readable = false;
stream.emit('end');
}
}
function indexOf(xs, x) {
for (var i = 0, l = xs.length; i < l; i++) {
if (xs[i] === x) return i;
}
return -1;
}
}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"./_stream_duplex":484,"./internal/streams/BufferList":489,"./internal/streams/destroy":490,"./internal/streams/stream":491,"_process":483,"core-util-is":474,"events":472,"inherits":478,"isarray":480,"process-nextick-args":482,"safe-buffer":493,"string_decoder/":494,"util":471}],487:[function(require,module,exports){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// a transform stream is a readable/writable stream where you do
// something with the data. Sometimes it's called a "filter",
// but that's not a great name for it, since that implies a thing where
// some bits pass through, and others are simply ignored. (That would
// be a valid example of a transform, of course.)
//
// While the output is causally related to the input, it's not a
// necessarily symmetric or synchronous transformation. For example,
// a zlib stream might take multiple plain-text writes(), and then
// emit a single compressed chunk some time in the future.
//
// Here's how this works:
//
// The Transform stream has all the aspects of the readable and writable
// stream classes. When you write(chunk), that calls _write(chunk,cb)
// internally, and returns false if there's a lot of pending writes
// buffered up. When you call read(), that calls _read(n) until
// there's enough pending readable data buffered up.
//
// In a transform stream, the written data is placed in a buffer. When
// _read(n) is called, it transforms the queued up data, calling the
// buffered _write cb's as it consumes chunks. If consuming a single
// written chunk would result in multiple output chunks, then the first
// outputted bit calls the readcb, and subsequent chunks just go into
// the read buffer, and will cause it to emit 'readable' if necessary.
//
// This way, back-pressure is actually determined by the reading side,
// since _read has to be called to start processing a new chunk. However,
// a pathological inflate type of transform can cause excessive buffering
// here. For example, imagine a stream where every byte of input is
// interpreted as an integer from 0-255, and then results in that many
// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
// 1kb of data being output. In this case, you could write a very small
// amount of input, and end up with a very large amount of output. In
// such a pathological inflating mechanism, there'd be no way to tell
// the system to stop doing the transform. A single 4MB write could
// cause the system to run out of memory.
//
// However, even in such a pathological case, only a single written chunk
// would be consumed, and then the rest would wait (un-transformed) until
// the results of the previous transformed chunk were consumed.
'use strict';
module.exports = Transform;
var Duplex = require('./_stream_duplex');
/*<replacement>*/
var util = Object.create(require('core-util-is'));
util.inherits = require('inherits');
/*</replacement>*/
util.inherits(Transform, Duplex);
function afterTransform(er, data) {
var ts = this._transformState;
ts.transforming = false;
var cb = ts.writecb;
if (!cb) {
return this.emit('error', new Error('write callback called multiple times'));
}
ts.writechunk = null;
ts.writecb = null;
if (data != null) // single equals check for both `null` and `undefined`
this.push(data);
cb(er);
var rs = this._readableState;
rs.reading = false;
if (rs.needReadable || rs.length < rs.highWaterMark) {
this._read(rs.highWaterMark);
}
}
function Transform(options) {
if (!(this instanceof Transform)) return new Transform(options);
Duplex.call(this, options);
this._transformState = {
afterTransform: afterTransform.bind(this),
needTransform: false,
transforming: false,
writecb: null,
writechunk: null,
writeencoding: null
};
// start out asking for a readable event once data is transformed.
this._readableState.needReadable = true;
// we have implemented the _read method, and done the other things
// that Readable wants before the first _read call, so unset the
// sync guard flag.
this._readableState.sync = false;
if (options) {
if (typeof options.transform === 'function') this._transform = options.transform;
if (typeof options.flush === 'function') this._flush = options.flush;
}
// When the writable side finishes, then flush out anything remaining.
this.on('prefinish', prefinish);
}
function prefinish() {
var _this = this;
if (typeof this._flush === 'function') {
this._flush(function (er, data) {
done(_this, er, data);
});
} else {
done(this, null, null);
}
}
Transform.prototype.push = function (chunk, encoding) {
this._transformState.needTransform = false;
return Duplex.prototype.push.call(this, chunk, encoding);
};
// This is the part where you do stuff!
// override this function in implementation classes.
// 'chunk' is an input chunk.
//
// Call `push(newChunk)` to pass along transformed output
// to the readable side. You may call 'push' zero or more times.
//
// Call `cb(err)` when you are done with this chunk. If you pass
// an error, then that'll put the hurt on the whole operation. If you
// never call cb(), then you'll never get another chunk.
Transform.prototype._transform = function (chunk, encoding, cb) {
throw new Error('_transform() is not implemented');
};
Transform.prototype._write = function (chunk, encoding, cb) {
var ts = this._transformState;
ts.writecb = cb;
ts.writechunk = chunk;
ts.writeencoding = encoding;
if (!ts.transforming) {
var rs = this._readableState;
if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
}
};
// Doesn't matter what the args are here.
// _transform does all the work.
// That we got here means that the readable side wants more data.
Transform.prototype._read = function (n) {
var ts = this._transformState;
if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
ts.transforming = true;
this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
} else {
// mark that we need a transform, so that any data that comes in
// will get processed, now that we've asked for it.
ts.needTransform = true;
}
};
Transform.prototype._destroy = function (err, cb) {
var _this2 = this;
Duplex.prototype._destroy.call(this, err, function (err2) {
cb(err2);
_this2.emit('close');
});
};
function done(stream, er, data) {
if (er) return stream.emit('error', er);
if (data != null) // single equals check for both `null` and `undefined`
stream.push(data);
// if there's nothing in the write buffer, then that means
// that nothing more will ever be provided
if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');
if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');
return stream.push(null);
}
},{"./_stream_duplex":484,"core-util-is":474,"inherits":478}],488:[function(require,module,exports){
(function (process,global,setImmediate){(function (){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// A bit simpler than readable streams.
// Implement an async ._write(chunk, encoding, cb), and it'll handle all
// the drain event emission and buffering.
'use strict';
/*<replacement>*/
var pna = require('process-nextick-args');
/*</replacement>*/
module.exports = Writable;
/* <replacement> */
function WriteReq(chunk, encoding, cb) {
this.chunk = chunk;
this.encoding = encoding;
this.callback = cb;
this.next = null;
}
// It seems a linked list but it is not
// there will be only 2 of these for each stream
function CorkedRequest(state) {
var _this = this;
this.next = null;
this.entry = null;
this.finish = function () {
onCorkedFinish(_this, state);
};
}
/* </replacement> */
/*<replacement>*/
var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
/*</replacement>*/
/*<replacement>*/
var Duplex;
/*</replacement>*/
Writable.WritableState = WritableState;
/*<replacement>*/
var util = Object.create(require('core-util-is'));
util.inherits = require('inherits');
/*</replacement>*/
/*<replacement>*/
var internalUtil = {
deprecate: require('util-deprecate')
};
/*</replacement>*/
/*<replacement>*/
var Stream = require('./internal/streams/stream');
/*</replacement>*/
/*<replacement>*/
var Buffer = require('safe-buffer').Buffer;
var OurUint8Array = global.Uint8Array || function () {};
function _uint8ArrayToBuffer(chunk) {
return Buffer.from(chunk);
}
function _isUint8Array(obj) {
return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
}
/*</replacement>*/
var destroyImpl = require('./internal/streams/destroy');
util.inherits(Writable, Stream);
function nop() {}
function WritableState(options, stream) {
Duplex = Duplex || require('./_stream_duplex');
options = options || {};
// Duplex streams are both readable and writable, but share
// the same options object.
// However, some cases require setting options to different
// values for the readable and the writable sides of the duplex stream.
// These options can be provided separately as readableXXX and writableXXX.
var isDuplex = stream instanceof Duplex;
// object stream flag to indicate whether or not this stream
// contains buffers or objects.
this.objectMode = !!options.objectMode;
if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
// the point at which write() starts returning false
// Note: 0 is a valid value, means that we always return false if
// the entire buffer is not flushed immediately on write()
var hwm = options.highWaterMark;
var writableHwm = options.writableHighWaterMark;
var defaultHwm = this.objectMode ? 16 : 16 * 1024;
if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;
// cast to ints.
this.highWaterMark = Math.floor(this.highWaterMark);
// if _final has been called
this.finalCalled = false;
// drain event flag.
this.needDrain = false;
// at the start of calling end()
this.ending = false;
// when end() has been called, and returned
this.ended = false;
// when 'finish' is emitted
this.finished = false;
// has it been destroyed
this.destroyed = false;
// should we decode strings into buffers before passing to _write?
// this is here so that some node-core streams can optimize string
// handling at a lower level.
var noDecode = options.decodeStrings === false;
this.decodeStrings = !noDecode;
// Crypto is kind of old and crusty. Historically, its default string
// encoding is 'binary' so we have to make this configurable.
// Everything else in the universe uses 'utf8', though.
this.defaultEncoding = options.defaultEncoding || 'utf8';
// not an actual buffer we keep track of, but a measurement
// of how much we're waiting to get pushed to some underlying
// socket or file.
this.length = 0;
// a flag to see when we're in the middle of a write.
this.writing = false;
// when true all writes will be buffered until .uncork() call
this.corked = 0;
// a flag to be able to tell if the onwrite cb is called immediately,
// or on a later tick. We set this to true at first, because any
// actions that shouldn't happen until "later" should generally also
// not happen before the first write call.
this.sync = true;
// a flag to know if we're processing previously buffered items, which
// may call the _write() callback in the same tick, so that we don't
// end up in an overlapped onwrite situation.
this.bufferProcessing = false;
// the callback that's passed to _write(chunk,cb)
this.onwrite = function (er) {
onwrite(stream, er);
};
// the callback that the user supplies to write(chunk,encoding,cb)
this.writecb = null;
// the amount that is being written when _write is called.
this.writelen = 0;
this.bufferedRequest = null;
this.lastBufferedRequest = null;
// number of pending user-supplied write callbacks
// this must be 0 before 'finish' can be emitted
this.pendingcb = 0;
// emit prefinish if the only thing we're waiting for is _write cbs
// This is relevant for synchronous Transform streams
this.prefinished = false;
// True if the error was already emitted and should not be thrown again
this.errorEmitted = false;
// count buffered requests
this.bufferedRequestCount = 0;
// allocate the first CorkedRequest, there is always
// one allocated and free to use, and we maintain at most two
this.corkedRequestsFree = new CorkedRequest(this);
}
WritableState.prototype.getBuffer = function getBuffer() {
var current = this.bufferedRequest;
var out = [];
while (current) {
out.push(current);
current = current.next;
}
return out;
};
(function () {
try {
Object.defineProperty(WritableState.prototype, 'buffer', {
get: internalUtil.deprecate(function () {
return this.getBuffer();
}, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
});
} catch (_) {}
})();
// Test _writableState for inheritance to account for Duplex streams,
// whose prototype chain only points to Readable.
var realHasInstance;
if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
realHasInstance = Function.prototype[Symbol.hasInstance];
Object.defineProperty(Writable, Symbol.hasInstance, {
value: function (object) {
if (realHasInstance.call(this, object)) return true;
if (this !== Writable) return false;
return object && object._writableState instanceof WritableState;
}
});
} else {
realHasInstance = function (object) {
return object instanceof this;
};
}
function Writable(options) {
Duplex = Duplex || require('./_stream_duplex');
// Writable ctor is applied to Duplexes, too.
// `realHasInstance` is necessary because using plain `instanceof`
// would return false, as no `_writableState` property is attached.
// Trying to use the custom `instanceof` for Writable here will also break the
// Node.js LazyTransform implementation, which has a non-trivial getter for
// `_writableState` that would lead to infinite recursion.
if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
return new Writable(options);
}
this._writableState = new WritableState(options, this);
// legacy.
this.writable = true;
if (options) {
if (typeof options.write === 'function') this._write = options.write;
if (typeof options.writev === 'function') this._writev = options.writev;
if (typeof options.destroy === 'function') this._destroy = options.destroy;
if (typeof options.final === 'function') this._final = options.final;
}
Stream.call(this);
}
// Otherwise people can pipe Writable streams, which is just wrong.
Writable.prototype.pipe = function () {
this.emit('error', new Error('Cannot pipe, not readable'));
};
function writeAfterEnd(stream, cb) {
var er = new Error('write after end');
// TODO: defer error events consistently everywhere, not just the cb
stream.emit('error', er);
pna.nextTick(cb, er);
}
// Checks that a user-supplied chunk is valid, especially for the particular
// mode the stream is in. Currently this means that `null` is never accepted
// and undefined/non-string values are only allowed in object mode.
function validChunk(stream, state, chunk, cb) {
var valid = true;
var er = false;
if (chunk === null) {
er = new TypeError('May not write null values to stream');
} else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
er = new TypeError('Invalid non-string/buffer chunk');
}
if (er) {
stream.emit('error', er);
pna.nextTick(cb, er);
valid = false;
}
return valid;
}
Writable.prototype.write = function (chunk, encoding, cb) {
var state = this._writableState;
var ret = false;
var isBuf = !state.objectMode && _isUint8Array(chunk);
if (isBuf && !Buffer.isBuffer(chunk)) {
chunk = _uint8ArrayToBuffer(chunk);
}
if (typeof encoding === 'function') {
cb = encoding;
encoding = null;
}
if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
if (typeof cb !== 'function') cb = nop;
if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
state.pendingcb++;
ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
}
return ret;
};
Writable.prototype.cork = function () {
var state = this._writableState;
state.corked++;
};
Writable.prototype.uncork = function () {
var state = this._writableState;
if (state.corked) {
state.corked--;
if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
}
};
Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
// node::ParseEncoding() requires lower case.
if (typeof encoding === 'string') encoding = encoding.toLowerCase();
if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
this._writableState.defaultEncoding = encoding;
return this;
};
function decodeChunk(state, chunk, encoding) {
if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
chunk = Buffer.from(chunk, encoding);
}
return chunk;
}
Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
// making it explicit this property is not enumerable
// because otherwise some prototype manipulation in
// userland will fail
enumerable: false,
get: function () {
return this._writableState.highWaterMark;
}
});
// if we're already writing something, then just put this
// in the queue, and wait our turn. Otherwise, call _write
// If we return false, then we need a drain event, so set that flag.
function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
if (!isBuf) {
var newChunk = decodeChunk(state, chunk, encoding);
if (chunk !== newChunk) {
isBuf = true;
encoding = 'buffer';
chunk = newChunk;
}
}
var len = state.objectMode ? 1 : chunk.length;
state.length += len;
var ret = state.length < state.highWaterMark;
// we must ensure that previous needDrain will not be reset to false.
if (!ret) state.needDrain = true;
if (state.writing || state.corked) {
var last = state.lastBufferedRequest;
state.lastBufferedRequest = {
chunk: chunk,
encoding: encoding,
isBuf: isBuf,
callback: cb,
next: null
};
if (last) {
last.next = state.lastBufferedRequest;
} else {
state.bufferedRequest = state.lastBufferedRequest;
}
state.bufferedRequestCount += 1;
} else {
doWrite(stream, state, false, len, chunk, encoding, cb);
}
return ret;
}
function doWrite(stream, state, writev, len, chunk, encoding, cb) {
state.writelen = len;
state.writecb = cb;
state.writing = true;
state.sync = true;
if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
state.sync = false;
}
function onwriteError(stream, state, sync, er, cb) {
--state.pendingcb;
if (sync) {
// defer the callback if we are being called synchronously
// to avoid piling up things on the stack
pna.nextTick(cb, er);
// this can emit finish, and it will always happen
// after error
pna.nextTick(finishMaybe, stream, state);
stream._writableState.errorEmitted = true;
stream.emit('error', er);
} else {
// the caller expect this to happen before if
// it is async
cb(er);
stream._writableState.errorEmitted = true;
stream.emit('error', er);
// this can emit finish, but finish must
// always follow error
finishMaybe(stream, state);
}
}
function onwriteStateUpdate(state) {
state.writing = false;
state.writecb = null;
state.length -= state.writelen;
state.writelen = 0;
}
function onwrite(stream, er) {
var state = stream._writableState;
var sync = state.sync;
var cb = state.writecb;
onwriteStateUpdate(state);
if (er) onwriteError(stream, state, sync, er, cb);else {
// Check if we're actually ready to finish, but don't emit yet
var finished = needFinish(state);
if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
clearBuffer(stream, state);
}
if (sync) {
/*<replacement>*/
asyncWrite(afterWrite, stream, state, finished, cb);
/*</replacement>*/
} else {
afterWrite(stream, state, finished, cb);
}
}
}
function afterWrite(stream, state, finished, cb) {
if (!finished) onwriteDrain(stream, state);
state.pendingcb--;
cb();
finishMaybe(stream, state);
}
// Must force callback to be called on nextTick, so that we don't
// emit 'drain' before the write() consumer gets the 'false' return
// value, and has a chance to attach a 'drain' listener.
function onwriteDrain(stream, state) {
if (state.length === 0 && state.needDrain) {
state.needDrain = false;
stream.emit('drain');
}
}
// if there's something in the buffer waiting, then process it
function clearBuffer(stream, state) {
state.bufferProcessing = true;
var entry = state.bufferedRequest;
if (stream._writev && entry && entry.next) {
// Fast case, write everything using _writev()
var l = state.bufferedRequestCount;
var buffer = new Array(l);
var holder = state.corkedRequestsFree;
holder.entry = entry;
var count = 0;
var allBuffers = true;
while (entry) {
buffer[count] = entry;
if (!entry.isBuf) allBuffers = false;
entry = entry.next;
count += 1;
}
buffer.allBuffers = allBuffers;
doWrite(stream, state, true, state.length, buffer, '', holder.finish);
// doWrite is almost always async, defer these to save a bit of time
// as the hot path ends with doWrite
state.pendingcb++;
state.lastBufferedRequest = null;
if (holder.next) {
state.corkedRequestsFree = holder.next;
holder.next = null;
} else {
state.corkedRequestsFree = new CorkedRequest(state);
}
state.bufferedRequestCount = 0;
} else {
// Slow case, write chunks one-by-one
while (entry) {
var chunk = entry.chunk;
var encoding = entry.encoding;
var cb = entry.callback;
var len = state.objectMode ? 1 : chunk.length;
doWrite(stream, state, false, len, chunk, encoding, cb);
entry = entry.next;
state.bufferedRequestCount--;
// if we didn't call the onwrite immediately, then
// it means that we need to wait until it does.
// also, that means that the chunk and cb are currently
// being processed, so move the buffer counter past them.
if (state.writing) {
break;
}
}
if (entry === null) state.lastBufferedRequest = null;
}
state.bufferedRequest = entry;
state.bufferProcessing = false;
}
Writable.prototype._write = function (chunk, encoding, cb) {
cb(new Error('_write() is not implemented'));
};
Writable.prototype._writev = null;
Writable.prototype.end = function (chunk, encoding, cb) {
var state = this._writableState;
if (typeof chunk === 'function') {
cb = chunk;
chunk = null;
encoding = null;
} else if (typeof encoding === 'function') {
cb = encoding;
encoding = null;
}
if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
// .end() fully uncorks
if (state.corked) {
state.corked = 1;
this.uncork();
}
// ignore unnecessary end() calls.
if (!state.ending && !state.finished) endWritable(this, state, cb);
};
function needFinish(state) {
return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
}
function callFinal(stream, state) {
stream._final(function (err) {
state.pendingcb--;
if (err) {
stream.emit('error', err);
}
state.prefinished = true;
stream.emit('prefinish');
finishMaybe(stream, state);
});
}
function prefinish(stream, state) {
if (!state.prefinished && !state.finalCalled) {
if (typeof stream._final === 'function') {
state.pendingcb++;
state.finalCalled = true;
pna.nextTick(callFinal, stream, state);
} else {
state.prefinished = true;
stream.emit('prefinish');
}
}
}
function finishMaybe(stream, state) {
var need = needFinish(state);
if (need) {
prefinish(stream, state);
if (state.pendingcb === 0) {
state.finished = true;
stream.emit('finish');
}
}
return need;
}
function endWritable(stream, state, cb) {
state.ending = true;
finishMaybe(stream, state);
if (cb) {
if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);
}
state.ended = true;
stream.writable = false;
}
function onCorkedFinish(corkReq, state, err) {
var entry = corkReq.entry;
corkReq.entry = null;
while (entry) {
var cb = entry.callback;
state.pendingcb--;
cb(err);
entry = entry.next;
}
if (state.corkedRequestsFree) {
state.corkedRequestsFree.next = corkReq;
} else {
state.corkedRequestsFree = corkReq;
}
}
Object.defineProperty(Writable.prototype, 'destroyed', {
get: function () {
if (this._writableState === undefined) {
return false;
}
return this._writableState.destroyed;
},
set: function (value) {
// we ignore the value if the stream
// has not been initialized yet
if (!this._writableState) {
return;
}
// backward compatibility, the user is explicitly
// managing destroyed
this._writableState.destroyed = value;
}
});
Writable.prototype.destroy = destroyImpl.destroy;
Writable.prototype._undestroy = destroyImpl.undestroy;
Writable.prototype._destroy = function (err, cb) {
this.end();
cb(err);
};
}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("timers").setImmediate)
},{"./_stream_duplex":484,"./internal/streams/destroy":490,"./internal/streams/stream":491,"_process":483,"core-util-is":474,"inherits":478,"process-nextick-args":482,"safe-buffer":493,"timers":495,"util-deprecate":496}],489:[function(require,module,exports){
'use strict';
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Buffer = require('safe-buffer').Buffer;
var util = require('util');
function copyBuffer(src, target, offset) {
src.copy(target, offset);
}
module.exports = function () {
function BufferList() {
_classCallCheck(this, BufferList);
this.head = null;
this.tail = null;
this.length = 0;
}
BufferList.prototype.push = function push(v) {
var entry = { data: v, next: null };
if (this.length > 0) this.tail.next = entry;else this.head = entry;
this.tail = entry;
++this.length;
};
BufferList.prototype.unshift = function unshift(v) {
var entry = { data: v, next: this.head };
if (this.length === 0) this.tail = entry;
this.head = entry;
++this.length;
};
BufferList.prototype.shift = function shift() {
if (this.length === 0) return;
var ret = this.head.data;
if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
--this.length;
return ret;
};
BufferList.prototype.clear = function clear() {
this.head = this.tail = null;
this.length = 0;
};
BufferList.prototype.join = function join(s) {
if (this.length === 0) return '';
var p = this.head;
var ret = '' + p.data;
while (p = p.next) {
ret += s + p.data;
}return ret;
};
BufferList.prototype.concat = function concat(n) {
if (this.length === 0) return Buffer.alloc(0);
if (this.length === 1) return this.head.data;
var ret = Buffer.allocUnsafe(n >>> 0);
var p = this.head;
var i = 0;
while (p) {
copyBuffer(p.data, ret, i);
i += p.data.length;
p = p.next;
}
return ret;
};
return BufferList;
}();
if (util && util.inspect && util.inspect.custom) {
module.exports.prototype[util.inspect.custom] = function () {
var obj = util.inspect({ length: this.length });
return this.constructor.name + ' ' + obj;
};
}
},{"safe-buffer":493,"util":471}],490:[function(require,module,exports){
'use strict';
/*<replacement>*/
var pna = require('process-nextick-args');
/*</replacement>*/
// undocumented cb() API, needed for core, not for public API
function destroy(err, cb) {
var _this = this;
var readableDestroyed = this._readableState && this._readableState.destroyed;
var writableDestroyed = this._writableState && this._writableState.destroyed;
if (readableDestroyed || writableDestroyed) {
if (cb) {
cb(err);
} else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
pna.nextTick(emitErrorNT, this, err);
}
return this;
}
// we set destroyed to true before firing error callbacks in order
// to make it re-entrance safe in case destroy() is called within callbacks
if (this._readableState) {
this._readableState.destroyed = true;
}
// if this is a duplex stream mark the writable part as destroyed as well
if (this._writableState) {
this._writableState.destroyed = true;
}
this._destroy(err || null, function (err) {
if (!cb && err) {
pna.nextTick(emitErrorNT, _this, err);
if (_this._writableState) {
_this._writableState.errorEmitted = true;
}
} else if (cb) {
cb(err);
}
});
return this;
}
function undestroy() {
if (this._readableState) {
this._readableState.destroyed = false;
this._readableState.reading = false;
this._readableState.ended = false;
this._readableState.endEmitted = false;
}
if (this._writableState) {
this._writableState.destroyed = false;
this._writableState.ended = false;
this._writableState.ending = false;
this._writableState.finished = false;
this._writableState.errorEmitted = false;
}
}
function emitErrorNT(self, err) {
self.emit('error', err);
}
module.exports = {
destroy: destroy,
undestroy: undestroy
};
},{"process-nextick-args":482}],491:[function(require,module,exports){
module.exports = require('events').EventEmitter;
},{"events":472}],492:[function(require,module,exports){
exports = module.exports = require('./lib/_stream_readable.js');
exports.Stream = exports;
exports.Readable = exports;
exports.Writable = require('./lib/_stream_writable.js');
exports.Duplex = require('./lib/_stream_duplex.js');
exports.Transform = require('./lib/_stream_transform.js');
exports.PassThrough = require('./lib/_stream_passthrough.js');
},{"./lib/_stream_duplex.js":484,"./lib/_stream_passthrough.js":485,"./lib/_stream_readable.js":486,"./lib/_stream_transform.js":487,"./lib/_stream_writable.js":488}],493:[function(require,module,exports){
/* eslint-disable node/no-deprecated-api */
var buffer = require('buffer')
var Buffer = buffer.Buffer
// alternative to using Object.keys for old browsers
function copyProps (src, dst) {
for (var key in src) {
dst[key] = src[key]
}
}
if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
module.exports = buffer
} else {
// Copy properties from require('buffer')
copyProps(buffer, exports)
exports.Buffer = SafeBuffer
}
function SafeBuffer (arg, encodingOrOffset, length) {
return Buffer(arg, encodingOrOffset, length)
}
// Copy static methods from Buffer
copyProps(Buffer, SafeBuffer)
SafeBuffer.from = function (arg, encodingOrOffset, length) {
if (typeof arg === 'number') {
throw new TypeError('Argument must not be a number')
}
return Buffer(arg, encodingOrOffset, length)
}
SafeBuffer.alloc = function (size, fill, encoding) {
if (typeof size !== 'number') {
throw new TypeError('Argument must be a number')
}
var buf = Buffer(size)
if (fill !== undefined) {
if (typeof encoding === 'string') {
buf.fill(fill, encoding)
} else {
buf.fill(fill)
}
} else {
buf.fill(0)
}
return buf
}
SafeBuffer.allocUnsafe = function (size) {
if (typeof size !== 'number') {
throw new TypeError('Argument must be a number')
}
return Buffer(size)
}
SafeBuffer.allocUnsafeSlow = function (size) {
if (typeof size !== 'number') {
throw new TypeError('Argument must be a number')
}
return buffer.SlowBuffer(size)
}
},{"buffer":473}],494:[function(require,module,exports){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
/*<replacement>*/
var Buffer = require('safe-buffer').Buffer;
/*</replacement>*/
var isEncoding = Buffer.isEncoding || function (encoding) {
encoding = '' + encoding;
switch (encoding && encoding.toLowerCase()) {
case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
return true;
default:
return false;
}
};
function _normalizeEncoding(enc) {
if (!enc) return 'utf8';
var retried;
while (true) {
switch (enc) {
case 'utf8':
case 'utf-8':
return 'utf8';
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return 'utf16le';
case 'latin1':
case 'binary':
return 'latin1';
case 'base64':
case 'ascii':
case 'hex':
return enc;
default:
if (retried) return; // undefined
enc = ('' + enc).toLowerCase();
retried = true;
}
}
};
// Do not cache `Buffer.isEncoding` when checking encoding names as some
// modules monkey-patch it to support additional encodings
function normalizeEncoding(enc) {
var nenc = _normalizeEncoding(enc);
if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
return nenc || enc;
}
// StringDecoder provides an interface for efficiently splitting a series of
// buffers into a series of JS strings without breaking apart multi-byte
// characters.
exports.StringDecoder = StringDecoder;
function StringDecoder(encoding) {
this.encoding = normalizeEncoding(encoding);
var nb;
switch (this.encoding) {
case 'utf16le':
this.text = utf16Text;
this.end = utf16End;
nb = 4;
break;
case 'utf8':
this.fillLast = utf8FillLast;
nb = 4;
break;
case 'base64':
this.text = base64Text;
this.end = base64End;
nb = 3;
break;
default:
this.write = simpleWrite;
this.end = simpleEnd;
return;
}
this.lastNeed = 0;
this.lastTotal = 0;
this.lastChar = Buffer.allocUnsafe(nb);
}
StringDecoder.prototype.write = function (buf) {
if (buf.length === 0) return '';
var r;
var i;
if (this.lastNeed) {
r = this.fillLast(buf);
if (r === undefined) return '';
i = this.lastNeed;
this.lastNeed = 0;
} else {
i = 0;
}
if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
return r || '';
};
StringDecoder.prototype.end = utf8End;
// Returns only complete characters in a Buffer
StringDecoder.prototype.text = utf8Text;
// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
StringDecoder.prototype.fillLast = function (buf) {
if (this.lastNeed <= buf.length) {
buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
}
buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
this.lastNeed -= buf.length;
};
// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
// continuation byte. If an invalid byte is detected, -2 is returned.
function utf8CheckByte(byte) {
if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
return byte >> 6 === 0x02 ? -1 : -2;
}
// Checks at most 3 bytes at the end of a Buffer in order to detect an
// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
// needed to complete the UTF-8 character (if applicable) are returned.
function utf8CheckIncomplete(self, buf, i) {
var j = buf.length - 1;
if (j < i) return 0;
var nb = utf8CheckByte(buf[j]);
if (nb >= 0) {
if (nb > 0) self.lastNeed = nb - 1;
return nb;
}
if (--j < i || nb === -2) return 0;
nb = utf8CheckByte(buf[j]);
if (nb >= 0) {
if (nb > 0) self.lastNeed = nb - 2;
return nb;
}
if (--j < i || nb === -2) return 0;
nb = utf8CheckByte(buf[j]);
if (nb >= 0) {
if (nb > 0) {
if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
}
return nb;
}
return 0;
}
// Validates as many continuation bytes for a multi-byte UTF-8 character as
// needed or are available. If we see a non-continuation byte where we expect
// one, we "replace" the validated continuation bytes we've seen so far with
// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
// behavior. The continuation byte check is included three times in the case
// where all of the continuation bytes for a character exist in the same buffer.
// It is also done this way as a slight performance increase instead of using a
// loop.
function utf8CheckExtraBytes(self, buf, p) {
if ((buf[0] & 0xC0) !== 0x80) {
self.lastNeed = 0;
return '\ufffd';
}
if (self.lastNeed > 1 && buf.length > 1) {
if ((buf[1] & 0xC0) !== 0x80) {
self.lastNeed = 1;
return '\ufffd';
}
if (self.lastNeed > 2 && buf.length > 2) {
if ((buf[2] & 0xC0) !== 0x80) {
self.lastNeed = 2;
return '\ufffd';
}
}
}
}
// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
function utf8FillLast(buf) {
var p = this.lastTotal - this.lastNeed;
var r = utf8CheckExtraBytes(this, buf, p);
if (r !== undefined) return r;
if (this.lastNeed <= buf.length) {
buf.copy(this.lastChar, p, 0, this.lastNeed);
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
}
buf.copy(this.lastChar, p, 0, buf.length);
this.lastNeed -= buf.length;
}
// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
// partial character, the character's bytes are buffered until the required
// number of bytes are available.
function utf8Text(buf, i) {
var total = utf8CheckIncomplete(this, buf, i);
if (!this.lastNeed) return buf.toString('utf8', i);
this.lastTotal = total;
var end = buf.length - (total - this.lastNeed);
buf.copy(this.lastChar, 0, end);
return buf.toString('utf8', i, end);
}
// For UTF-8, a replacement character is added when ending on a partial
// character.
function utf8End(buf) {
var r = buf && buf.length ? this.write(buf) : '';
if (this.lastNeed) return r + '\ufffd';
return r;
}
// UTF-16LE typically needs two bytes per character, but even if we have an even
// number of bytes available, we need to check if we end on a leading/high
// surrogate. In that case, we need to wait for the next two bytes in order to
// decode the last character properly.
function utf16Text(buf, i) {
if ((buf.length - i) % 2 === 0) {
var r = buf.toString('utf16le', i);
if (r) {
var c = r.charCodeAt(r.length - 1);
if (c >= 0xD800 && c <= 0xDBFF) {
this.lastNeed = 2;
this.lastTotal = 4;
this.lastChar[0] = buf[buf.length - 2];
this.lastChar[1] = buf[buf.length - 1];
return r.slice(0, -1);
}
}
return r;
}
this.lastNeed = 1;
this.lastTotal = 2;
this.lastChar[0] = buf[buf.length - 1];
return buf.toString('utf16le', i, buf.length - 1);
}
// For UTF-16LE we do not explicitly append special replacement characters if we
// end on a partial character, we simply let v8 handle that.
function utf16End(buf) {
var r = buf && buf.length ? this.write(buf) : '';
if (this.lastNeed) {
var end = this.lastTotal - this.lastNeed;
return r + this.lastChar.toString('utf16le', 0, end);
}
return r;
}
function base64Text(buf, i) {
var n = (buf.length - i) % 3;
if (n === 0) return buf.toString('base64', i);
this.lastNeed = 3 - n;
this.lastTotal = 3;
if (n === 1) {
this.lastChar[0] = buf[buf.length - 1];
} else {
this.lastChar[0] = buf[buf.length - 2];
this.lastChar[1] = buf[buf.length - 1];
}
return buf.toString('base64', i, buf.length - n);
}
function base64End(buf) {
var r = buf && buf.length ? this.write(buf) : '';
if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
return r;
}
// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
function simpleWrite(buf) {
return buf.toString(this.encoding);
}
function simpleEnd(buf) {
return buf && buf.length ? this.write(buf) : '';
}
},{"safe-buffer":493}],495:[function(require,module,exports){
(function (setImmediate,clearImmediate){(function (){
var nextTick = require('process/browser.js').nextTick;
var apply = Function.prototype.apply;
var slice = Array.prototype.slice;
var immediateIds = {};
var nextImmediateId = 0;
// DOM APIs, for completeness
exports.setTimeout = function() {
return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);
};
exports.setInterval = function() {
return new Timeout(apply.call(setInterval, window, arguments), clearInterval);
};
exports.clearTimeout =
exports.clearInterval = function(timeout) { timeout.close(); };
function Timeout(id, clearFn) {
this._id = id;
this._clearFn = clearFn;
}
Timeout.prototype.unref = Timeout.prototype.ref = function() {};
Timeout.prototype.close = function() {
this._clearFn.call(window, this._id);
};
// Does not start the time, just sets up the members needed.
exports.enroll = function(item, msecs) {
clearTimeout(item._idleTimeoutId);
item._idleTimeout = msecs;
};
exports.unenroll = function(item) {
clearTimeout(item._idleTimeoutId);
item._idleTimeout = -1;
};
exports._unrefActive = exports.active = function(item) {
clearTimeout(item._idleTimeoutId);
var msecs = item._idleTimeout;
if (msecs >= 0) {
item._idleTimeoutId = setTimeout(function onTimeout() {
if (item._onTimeout)
item._onTimeout();
}, msecs);
}
};
// That's not how node.js implements it but the exposed api is the same.
exports.setImmediate = typeof setImmediate === "function" ? setImmediate : function(fn) {
var id = nextImmediateId++;
var args = arguments.length < 2 ? false : slice.call(arguments, 1);
immediateIds[id] = true;
nextTick(function onNextTick() {
if (immediateIds[id]) {
// fn.call() is faster so we optimize for the common use-case
// @see http://jsperf.com/call-apply-segu
if (args) {
fn.apply(null, args);
} else {
fn.call(null);
}
// Prevent ids from leaking
exports.clearImmediate(id);
}
});
return id;
};
exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate : function(id) {
delete immediateIds[id];
};
}).call(this)}).call(this,require("timers").setImmediate,require("timers").clearImmediate)
},{"process/browser.js":483,"timers":495}],496:[function(require,module,exports){
(function (global){(function (){
/**
* Module exports.
*/
module.exports = deprecate;
/**
* Mark that a method should not be used.
* Returns a modified function which warns once by default.
*
* If `localStorage.noDeprecation = true` is set, then it is a no-op.
*
* If `localStorage.throwDeprecation = true` is set, then deprecated functions
* will throw an Error when invoked.
*
* If `localStorage.traceDeprecation = true` is set, then deprecated functions
* will invoke `console.trace()` instead of `console.error()`.
*
* @param {Function} fn - the function to deprecate
* @param {String} msg - the string to print to the console when `fn` is invoked
* @returns {Function} a new "deprecated" version of `fn`
* @api public
*/
function deprecate (fn, msg) {
if (config('noDeprecation')) {
return fn;
}
var warned = false;
function deprecated() {
if (!warned) {
if (config('throwDeprecation')) {
throw new Error(msg);
} else if (config('traceDeprecation')) {
console.trace(msg);
} else {
console.warn(msg);
}
warned = true;
}
return fn.apply(this, arguments);
}
return deprecated;
}
/**
* Checks `localStorage` for boolean values for the given `name`.
*
* @param {String} name
* @returns {Boolean}
* @api private
*/
function config (name) {
// accessing global.localStorage can trigger a DOMException in sandboxed iframes
try {
if (!global.localStorage) return false;
} catch (_) {
return false;
}
var val = global.localStorage[name];
if (null == val) return false;
return String(val).toLowerCase() === 'true';
}
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}]},{},[280]);
|
const path = require("path");
const { VueLoaderPlugin } = require("vue-loader");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const { ModuleFederationPlugin } = require("webpack").container;
module.exports = (env = {}) => ({
mode: "development",
cache: false,
devtool: "source-map",
optimization: {
minimize: false,
},
target: "web",
entry: path.resolve(__dirname, "./src/main.js"),
output: {
publicPath: "auto",
},
resolve: {
extensions: [".vue", ".jsx", ".js", ".json"],
alias: {
// this isn't technically needed, since the default `vue` entry for bundlers
// is a simple `export * from '@vue/runtime-dom`. However having this
// extra re-export somehow causes webpack to always invalidate the module
// on the first HMR update and causes the page to reload.
vue: "@vue/runtime-dom",
},
},
module: {
rules: [
{
test: /\.vue$/,
use: "vue-loader",
},
{
test: /\.png$/,
use: {
loader: "url-loader",
options: { limit: 8192 },
},
},
{
test: /\.css$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
},
"css-loader",
],
},
],
},
plugins: [
new MiniCssExtractPlugin({
filename: "[name].css",
}),
new ModuleFederationPlugin({
name: "app-shell",
filename: "remoteEntry.js",
remotes: {
mfe1: "mfe1@http://localhost:3001/remoteEntry.js",
mfe2: "mfe2@http://localhost:3002/remoteEntry.js",
reactmf: "reactmf@http://localhost:3003/remoteEntry.js",
},
exposes: {},
}),
new HtmlWebpackPlugin({
template: path.resolve(__dirname, "./index.html"),
chunks: ["main"],
}),
new VueLoaderPlugin(),
],
devServer: {
contentBase: path.join(__dirname),
compress: true,
port: 8080,
hot: true,
headers: {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
"Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization",
},
},
}); |
/*! For license information please see 2.661418fb.chunk.js.LICENSE.txt */
(this.webpackJsonpcast=this.webpackJsonpcast||[]).push([[2],[function(e,t,n){"use strict";e.exports=n(189)},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(30);function o(e,t){if(null==e)return{};var n,o,i=Object(r.a)(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}},function(e,t,n){e.exports=n(229)()},function(e,t,n){"use strict";function r(e){var t,n,o="";if("string"===typeof e||"number"===typeof e)o+=e;else if("object"===typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=r(e[t]))&&(o&&(o+=" "),o+=n);else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}n.r(t),t.default=function(){for(var e,t,n=0,o="";n<arguments.length;)(e=arguments[n++])&&(t=r(e))&&(o&&(o+=" "),o+=t);return o}},function(e,t,n){"use strict";function r(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];if(!e){var i;if(void 0===t)i=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;(i=new Error(t.replace(/%s/g,(function(){return r[a++]})))).name="Invariant Violation"}throw i.framesToPop=1,i}}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n.n(i),l=(n(3),n(58)),u=n.n(l),c=n(400),s=n(435),f=n(401),d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var i=t.defaultTheme,l=t.withTheme,d=void 0!==l&&l,p=t.name,h=Object(o.a)(t,["defaultTheme","withTheme","name"]);var v=p,m=Object(c.a)(e,Object(r.a)({defaultTheme:i,Component:n,name:p||n.displayName,classNamePrefix:v},h)),g=a.a.forwardRef((function(e,t){e.classes;var l,u=e.innerRef,c=Object(o.a)(e,["classes","innerRef"]),h=m(Object(r.a)(Object(r.a)({},n.defaultProps),e)),v=c;return("string"===typeof p||d)&&(l=Object(f.a)()||i,p&&(v=Object(s.a)({theme:l,name:p,props:c})),d&&!v.theme&&(v.theme=l)),a.a.createElement(n,Object(r.a)({ref:u||t,classes:h},v))}));return u()(g,n),g}},p=n(61);t.a=function(e,t){return d(e,Object(r.a)({defaultTheme:p.a},t))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(176);function o(e){if("string"!==typeof e)throw new Error(Object(r.a)(7));return e.charAt(0).toUpperCase()+e.slice(1)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return p})),n.d(t,"d",(function(){return E})),n.d(t,"e",(function(){return k})),n.d(t,"f",(function(){return v})),n.d(t,"g",(function(){return m})),n.d(t,"h",(function(){return g}));var r=n(33),o=(n(3),n(0));function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var a=function(e){return e};function l(e,t){if(!e)throw Error(t)}var u=Object(o.createContext)({static:!1}),c=Object(o.createContext)({outlet:null,params:a({}),pathname:"",route:null});function s(){return Object(o.useContext)(c).outlet}function f(e){return void 0===(e=e.element)?Object(o.createElement)(s,null):e}function d(e){var t=e.children;t=void 0===t?null:t;var n=e.action;n=void 0===n?r.a.Pop:n;var i=e.location,a=e.navigator;return e=void 0!==(e=e.static)&&e,h()&&l(!1),Object(o.createElement)(u.Provider,{children:t,value:{action:n,location:i,navigator:a,static:e}})}function p(e){var t=e.basename;return t=void 0===t?"":t,y(e=function e(t){var n=[];return o.Children.forEach(t,(function(t){if(Object(o.isValidElement)(t))if(t.type===o.Fragment)n.push.apply(n,e(t.props.children));else{var r={path:t.props.path||"/",caseSensitive:!0===t.props.caseSensitive,element:t};t.props.children&&((t=e(t.props.children)).length&&(r.children=t)),n.push(r)}})),n}(e.children),t)}function h(){return null!=Object(o.useContext)(u).location}function v(){return h()||l(!1),Object(o.useContext)(u).location}function m(){h()||l(!1);var e=Object(o.useContext)(u).navigator,t=Object(o.useContext)(c).pathname,n=Object(o.useRef)(!1);return Object(o.useEffect)((function(){n.current=!0})),Object(o.useCallback)((function(r,o){void 0===o&&(o={}),n.current&&("number"===typeof r?e.go(r):(r=O(r,t),(o.replace?e.replace:e.push)(r,o.state)))}),[e,t])}function g(e){var t=Object(o.useContext)(c).pathname;return Object(o.useMemo)((function(){return O(e,t)}),[e,t])}function y(e,t){void 0===t&&(t="");var n=Object(o.useContext)(c),l=n.route,u=n.pathname,s=n.params;t=t?C([u,t]):u;var f=v();return(l=Object(o.useMemo)((function(){return function(e,t,n){if(void 0===n&&(n=""),"string"===typeof t&&(t=Object(r.f)(t)),t=t.pathname||"/",n){if(n=n.replace(/^\/*/,"/").replace(/\/+$/,""),!t.startsWith(n))return null;t=t===n?"/":t.slice(n.length)}!function(e){var t=e.reduce((function(e,t){return e[t=t[0]]=function(e){var t=(e=e.split("/")).length;return e.some(S)&&(t+=-2),e.filter((function(e){return!S(e)})).reduce((function(e,t){return e+(b.test(t)?2:""===t?1:10)}),t)}(t),e}),{});!function(e,t){var n=e.slice(0);e.sort((function(e,r){return t(e,r)||n.indexOf(e)-n.indexOf(r)}))}(e,(function(e,n){var r=e[2];e=t[e[0]];var o=n[2];return e!==(n=t[n[0]])?n-e:function(e,t){return e.length===t.length&&e.slice(0,-1).every((function(e,n){return e===t[n]}))?e[e.length-1]-t[t.length-1]:0}(r,o)}))}(e=function e(t,n,r,o,i){return void 0===n&&(n=[]),void 0===r&&(r=""),void 0===o&&(o=[]),void 0===i&&(i=[]),t.forEach((function(t,a){var l=C([r,t.path]),u=o.concat(t);a=i.concat(a),t.children&&e(t.children,n,l,u,a),n.push([l,u,a])})),n}(e));var o=null;for(n=0;null==o&&n<e.length;++n)e:{o=t;for(var l=e[n][1],u="/",c={},s=[],f=0;f<l.length;++f){var d=l[f],p="/"===u?o:o.slice(u.length)||"/";if(!(p=w({path:d.path,caseSensitive:d.caseSensitive,end:f===l.length-1},p))){o=null;break e}u=C([u,p.pathname]),c=i({},c,{},p.params),s.push({route:d,pathname:u,params:a(c)})}o=s}return o}(e,f,t)}),[f,e,t]))?l.reduceRight((function(e,n){var r=n.pathname,l=n.route;return Object(o.createElement)(c.Provider,{children:l.element,value:{outlet:e,params:a(i({},s,{},n.params)),pathname:C([t,r]),route:l}})}),null):null}var b=/^:\w+$/;function S(e){return"*"===e}function w(e,t){"string"===typeof e&&(e={path:e});var n=e;e=n.path;var r=n.caseSensitive;if(n=function(e,t,n){var r=[],o="^("+e.replace(/^\/*/,"/").replace(/\/?\*?$/,"").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/:(\w+)/g,(function(e,t){return r.push(t),"([^\\/]+)"}))+")";return e.endsWith("*")?(e.endsWith("/*")&&(o+="\\/?"),r.push("*"),o+="(.*)"):n&&(o+="\\/?"),n&&(o+="$"),[new RegExp(o,t?void 0:"i"),r]}(e,void 0!==r&&r,void 0===(n=n.end)||n),r=n[1],!(n=t.match(n[0])))return null;t=n[1];var o=n.slice(2);return r=r.reduce((function(e,t,n){n=o[n];try{var r=decodeURIComponent(n.replace(/\+/g," "))}catch(i){r=n}return e[t]=r,e}),{}),{path:e,pathname:t,params:r}}function O(e,t){void 0===t&&(t="/");var n="string"===typeof e?Object(r.f)(e):e;e=n.pathname;var o=n.search;return o=void 0===o?"":o,n=void 0===(n=n.hash)?"":n,{pathname:e?x(e,e.startsWith("/")?"/":t):t,search:o,hash:n}}function C(e){return e.join("/").replace(/\/\/+/g,"/")}function x(e,t){var n=t.replace(/\/+$/,"").replace(/\/\/+/g,"/").split("/");return e.replace(/\/\/+/g,"/").split("/").forEach((function(e){".."===e?1<n.length&&n.pop():"."!==e&&n.push(e)})),1<n.length?C(n):"/"}function E(e,t){void 0===t&&(t=!0),h()||l(!1);var n=Object(o.useContext)(u).navigator;Object(o.useEffect)((function(){if(t){var r=n.block((function(t){var n=i({},t,{retry:function(){r(),t.retry()}});e(n)}));return r}}),[n,e,t])}function k(e){h()||l(!1);var t=Object(o.useContext)(u).navigator;return e=g(e),t.createHref(e)}},function(e,t,n){"use strict";e.exports=n(195)},function(e,t,n){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}}(),e.exports=n(190)},,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o=n(26);function i(e,t){return r.useMemo((function(){return null==e&&null==t?null:function(n){Object(o.a)(e,n),Object(o.a)(t,n)}}),[e,t])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(194);Object.defineProperty(t,"FileBrowser",{enumerable:!0,get:function(){return r.FileBrowser}});var o=n(386);Object.defineProperty(t,"FileToolbar",{enumerable:!0,get:function(){return o.FileToolbar}});var i=n(391);Object.defineProperty(t,"FileSearch",{enumerable:!0,get:function(){return i.FileSearch}});var a=n(392);Object.defineProperty(t,"FileList",{enumerable:!0,get:function(){return a.FileList}});var l=n(42);Object.defineProperty(t,"ChonkyIconFA",{enumerable:!0,get:function(){return l.ChonkyIconFA}});var u=n(34);Object.defineProperty(t,"ChonkyActions",{enumerable:!0,get:function(){return u.ChonkyActions}});var c=n(28);Object.defineProperty(t,"FileHelper",{enumerable:!0,get:function(){return c.FileHelper}});var s=n(48);Object.defineProperty(t,"SpecialAction",{enumerable:!0,get:function(){return s.SpecialAction}});var f=n(22);Object.defineProperty(t,"ChonkyIconName",{enumerable:!0,get:function(){return f.ChonkyIconName}})},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"c",(function(){return l})),n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return s})),n.d(t,"d",(function(){return f}));var r=n(176);function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),n)}function i(e){if(e.type)return e;if("#"===e.charAt(0))return i(function(e){e=e.substr(1);var t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map((function(e){return e+e}))),n?"rgb".concat(4===n.length?"a":"","(").concat(n.map((function(e,t){return t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3})).join(", "),")"):""}(e));var t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla"].indexOf(n))throw new Error(Object(r.a)(3,e));var o=e.substring(t+1,e.length-1).split(",");return{type:n,values:o=o.map((function(e){return parseFloat(e)}))}}function a(e){var t=e.type,n=e.values;return-1!==t.indexOf("rgb")?n=n.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),"".concat(t,"(").concat(n.join(", "),")")}function l(e,t){var n=u(e),r=u(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function u(e){var t="hsl"===(e=i(e)).type?i(function(e){var t=(e=i(e)).values,n=t[0],r=t[1]/100,o=t[2]/100,l=r*Math.min(o,1-o),u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return o-l*Math.max(Math.min(t-3,9-t,1),-1)},c="rgb",s=[Math.round(255*u(0)),Math.round(255*u(8)),Math.round(255*u(4))];return"hsla"===e.type&&(c+="a",s.push(t[3])),a({type:c,values:s})}(e)).values:e.values;return t=t.map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function c(e,t){return e=i(e),t=o(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),e.values[3]=t,a(e)}function s(e,t){if(e=i(e),t=o(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return a(e)}function f(e,t){if(e=i(e),t=o(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;return a(e)}},function(e,t,n){"use strict";function r(e){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e){return"function"===typeof e}function i(){}function a(e){if(!function(e){return"object"===r(e)&&null!==e}(e))return!1;if(null===Object.getPrototypeOf(e))return!0;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}n.d(t,"a",(function(){return o})),n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return a}))},function(e,t,n){"use strict";function r(e){return e&&e.ownerDocument||document}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t,n,r){var o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!==typeof e||!e||"object"!==typeof t||!t)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(t),u=0;u<i.length;u++){var c=i[u];if(!l(c))return!1;var s=e[c],f=t[c];if(!1===(o=n?n.call(r,s,f,c):void 0)||void 0===o&&s!==f)return!1}return!0}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(82);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(u){o=!0,i=u}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}}(e,t)||Object(r.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o="undefined"!==typeof window?r.useLayoutEffect:r.useEffect;function i(e){var t=r.useRef(e);return o((function(){t.current=e})),r.useCallback((function(){return t.current.apply(void 0,arguments)}),[])}},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChonkyIconName=void 0,function(e){e.loading="loading",e.dropdown="dropdown",e.circle="circle",e.dndDragging="dndDragging",e.dndCanDrop="dndCanDrop",e.dndCannotDrop="dndCannotDrop",e.openFiles="openFiles",e.openParentFolder="openParentFolder",e.copy="copy",e.search="search",e.selectAllFiles="selectAllFiles",e.clearSelection="clearSelection",e.sortAsc="sortAsc",e.sortDesc="sortDesc",e.checkActive="checkActive",e.checkInactive="checkInactive",e.list="list",e.folder="folder",e.folderCreate="folderCreate",e.folderOpen="folderOpen",e.smallThumbnail="smallThumbnail",e.largeThumbnail="largeThumbnail",e.folderChainSeparator="folderChainSeparator",e.download="download",e.upload="upload",e.trash="trash",e.fallbackIcon="fallbackIcon",e.symlink="symlink",e.hidden="hidden",e.file="file",e.license="license",e.code="code",e.config="config",e.model="model",e.database="database",e.text="text",e.archive="archive",e.image="image",e.video="video",e.info="info",e.key="key",e.lock="lock",e.music="music",e.terminal="terminal",e.users="users",e.linux="linux",e.ubuntu="ubuntu",e.windows="windows",e.rust="rust",e.python="python",e.nodejs="nodejs",e.php="php",e.git="git",e.adobe="adobe",e.pdf="pdf",e.excel="excel",e.word="word",e.flash="flash"}(t.ChonkyIconName||(t.ChonkyIconName={}))},function(e,t,n){"use strict";function r(e){var t=e.current;return null==t?null:t.decoratedRef?t.decoratedRef.current:t}function o(e){return(t=e)&&t.prototype&&"function"===typeof t.prototype.render||function(e){var t;return"Symbol(react.forward_ref)"===(null===e||void 0===e||null===(t=e.$$typeof)||void 0===t?void 0:t.toString())}(e);var t}function i(e,t){}n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return i}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fileActionSelectedFilesCountState=t.fileActionSelectedFilesState=t.fileActionDataState=t.doubleClickDelayState=t.requestFileActionState=t.dispatchFileActionState=t.fileActionMapState=t.fileActionsState=void 0;var r=n(9),o=n(101),i=n(38);t.fileActionsState=r.atom({key:"fileActionsState",default:[]}),t.fileActionMapState=r.atom({key:"fileActionMapState",default:{}}),t.dispatchFileActionState=r.atom({key:"dispatchFileActionState",default:o.NOOP_FUNCTION}),t.requestFileActionState=r.atom({key:"requestFileActionState",default:o.NOOP_FUNCTION}),t.doubleClickDelayState=r.atom({key:"doubleClickDelayState",default:300}),t.fileActionDataState=r.selectorFamily({key:"fileActionDataState",get:function(e){return function(n){var r=n.get;if(!e)return null;var o=r(t.fileActionMapState)[e];return null!==o&&void 0!==o?o:null}}}),t.fileActionSelectedFilesState=r.selectorFamily({key:"fileActionSelectedFilesState",get:function(e){return function(n){var r=n.get;if(!e)return[];var o=r(t.fileActionMapState)[e];if(!o)return[];var a=r(i.selectedFilesState);return o.fileFilter?a.filter(o.fileFilter):a}}}),t.fileActionSelectedFilesCountState=r.selectorFamily({key:"fileActionSelectedFilesCountState",get:function(e){return function(n){return(0,n.get)(t.fileActionSelectedFilesState(e)).length}}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(1),o=n(0),i=n.n(o),a=n(95);function l(e,t){var n=i.a.memo(i.a.forwardRef((function(t,n){return i.a.createElement(a.a,Object(r.a)({ref:n},t),e)})));return n.muiName=a.a.muiName,n}},function(e,t,n){"use strict";function r(e,t){"function"===typeof e?e(t):e&&(e.current=t)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}t.a=function(e,t){var n;void 0===t&&(t=r);var o,i=[],a=!1;return function(){for(var r=[],l=0;l<arguments.length;l++)r[l]=arguments[l];return a&&n===this&&t(r,i)||(o=e.apply(this,r),a=!0,n=this,i=r),o}}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FileHelper=void 0;var o=r(n(218)),i=r(n(219)),a=function(){function e(){}return e.isDirectory=function(e){return!!e&&!0===e.isDir},e.isHidden=function(e){return!!e&&!0===e.isHidden},e.isSymlink=function(e){return!!e&&!0===e.isSymlink},e.isClickable=function(e){return!!e},e.isOpenable=function(e){return!!e&&!1!==e.openable},e.isSelectable=function(e){return!!e&&!1!==e.selectable},e.isDraggable=function(e){return!!e&&!1!==e.draggable},e.isDroppable=function(e){return!!e&&(!(!e.isDir||!1===e.droppable)||!0===e.droppable)},e.getReadableFileSize=function(e){if(!e||"number"!==typeof e.size)return null;var t=e.size,n=i.default(t,{bits:!1,output:"object"});return"B"===n.symbol?Math.round(n.value/10)/100+" KB":"KB"===n.symbol?Math.round(n.value)+" "+n.symbol:n.value+" "+n.symbol},e.getReadableDate=function(e){if(!e||!(e.modDate instanceof Date||"string"===typeof e.modDate))return null;var t=e.modDate;return"string"===typeof t&&(t=new Date(t)),isNaN(t.getTime())?null:t.getFullYear()===(new Date).getFullYear()?o.default(t,"d mmmm, HH:MM"):o.default(t,"d mmm yyyy, HH:MM")},e.getChildrenCount=function(e){return e&&"number"===typeof e.childrenCount?e.childrenCount:null},e}();t.FileHelper=a},function(e,t,n){"use strict";n.d(t,"a",(function(){return He})),n.d(t,"b",(function(){return Be}));var r=n(0),o=n(114),i=function(){return Math.random().toString(36).substring(7).split("").join(".")},a={INIT:"@@redux/INIT"+i(),REPLACE:"@@redux/REPLACE"+i(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+i()}};function l(e){if("object"!==typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function u(e,t,n){var r;if("function"===typeof t&&"function"===typeof n||"function"===typeof n&&"function"===typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");if("function"===typeof t&&"undefined"===typeof n&&(n=t,t=void 0),"undefined"!==typeof n){if("function"!==typeof n)throw new Error("Expected the enhancer to be a function.");return n(u)(e,t)}if("function"!==typeof e)throw new Error("Expected the reducer to be a function.");var i=e,c=t,s=[],f=s,d=!1;function p(){f===s&&(f=s.slice())}function h(){if(d)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return c}function v(e){if("function"!==typeof e)throw new Error("Expected the listener to be a function.");if(d)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribelistener for more details.");var t=!0;return p(),f.push(e),function(){if(t){if(d)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribelistener for more details.");t=!1,p();var n=f.indexOf(e);f.splice(n,1),s=null}}}function m(e){if(!l(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if("undefined"===typeof e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(d)throw new Error("Reducers may not dispatch actions.");try{d=!0,c=i(c,e)}finally{d=!1}for(var t=s=f,n=0;n<t.length;n++){(0,t[n])()}return e}function g(e){if("function"!==typeof e)throw new Error("Expected the nextReducer to be a function.");i=e,m({type:a.REPLACE})}function y(){var e,t=v;return(e={subscribe:function(e){if("object"!==typeof e||null===e)throw new TypeError("Expected the observer to be an object.");function n(){e.next&&e.next(h())}return n(),{unsubscribe:t(n)}}})[o.a]=function(){return this},e}return m({type:a.INIT}),(r={dispatch:m,subscribe:v,getState:h,replaceReducer:g})[o.a]=y,r}var c="dnd-core/INIT_COORDS",s="dnd-core/BEGIN_DRAG",f="dnd-core/PUBLISH_DRAG_SOURCE",d="dnd-core/HOVER",p="dnd-core/DROP",h="dnd-core/END_DRAG",v=function(e,t){return e===t};function m(e,t){return!e&&!t||!(!e||!t)&&(e.x===t.x&&e.y===t.y)}function g(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v;if(e.length!==t.length)return!1;for(var r=0;r<e.length;++r)if(!n(e[r],t[r]))return!1;return!0}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){S(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function S(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var w={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function O(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w,t=arguments.length>1?arguments[1]:void 0,n=t.payload;switch(t.type){case c:case s:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case d:return m(e.clientOffset,n.clientOffset)?e:b(b({},e),{},{clientOffset:n.clientOffset});case h:case p:return w;default:return e}}var C="dnd-core/ADD_SOURCE",x="dnd-core/ADD_TARGET",E="dnd-core/REMOVE_SOURCE",k="dnd-core/REMOVE_TARGET";function _(e){return(_="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function T(e,t,n){return t.split(".").reduce((function(e,t){return e&&e[t]?e[t]:n||null}),e)}function j(e,t){return e.filter((function(e){return e!==t}))}function P(e){return"object"===_(e)}function A(e,t){var n=new Map,r=function(e){n.set(e,n.has(e)?n.get(e)+1:1)};e.forEach(r),t.forEach(r);var o=[];return n.forEach((function(e,t){1===e&&o.push(t)})),o}function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function D(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var R={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function N(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:R,t=arguments.length>1?arguments[1]:void 0,n=t.payload;switch(t.type){case s:return M(M({},e),{},{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case f:return M(M({},e),{},{isSourcePublic:!0});case d:return M(M({},e),{},{targetIds:n.targetIds});case k:return-1===e.targetIds.indexOf(n.targetId)?e:M(M({},e),{},{targetIds:j(e.targetIds,n.targetId)});case p:return M(M({},e),{},{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case h:return M(M({},e),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function F(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case C:case x:return e+1;case E:case k:return e-1;default:return e}}var z=[],L=[];function V(e,t){return e!==z&&(e===L||"undefined"===typeof t||(n=e,t.filter((function(e){return n.indexOf(e)>-1}))).length>0);var n}function H(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case d:break;case C:case x:case k:case E:return z;case s:case f:case h:case p:default:return L}var t=e.payload,n=t.targetIds,r=void 0===n?[]:n,o=t.prevTargetIds,i=void 0===o?[]:o,a=A(r,i),l=a.length>0||!g(r,i);if(!l)return z;var u=i[i.length-1],c=r[r.length-1];return u!==c&&(u&&a.push(u),c&&a.push(c)),a}function B(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e+1}function W(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function U(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?W(Object(n),!0).forEach((function(t){$(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function $(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function K(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:H(e.dirtyHandlerIds,{type:t.type,payload:U(U({},t.payload),{},{prevTargetIds:T(e,"dragOperation.targetIds",[])})}),dragOffset:O(e.dragOffset,t),refCount:F(e.refCount,t),dragOperation:N(e.dragOperation,t),stateId:B(e.stateId)}}z.__IS_NONE__=!0,L.__IS_ALL__=!0;var q=n(5);function G(e,t){return{type:c,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}var Y={type:c,payload:{clientOffset:null,sourceClientOffset:null}};function X(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{publishSource:!0},r=n.publishSource,o=void 0===r||r,i=n.clientOffset,a=n.getSourceClientOffset,l=e.getMonitor(),u=e.getRegistry();e.dispatch(G(i)),Q(t,l,u);var c=ee(t,l);if(null!==c){var f=null;if(i){if(!a)throw new Error("getSourceClientOffset must be defined");Z(a),f=a(c)}e.dispatch(G(i,f));var d=u.getSource(c),p=d.beginDrag(l,c);J(p),u.pinSource(c);var h=u.getSourceType(c);return{type:s,payload:{itemType:h,item:p,sourceId:c,clientOffset:i||null,sourceClientOffset:f||null,isSourcePublic:!!o}}}e.dispatch(Y)}}function Q(e,t,n){Object(q.a)(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach((function(e){Object(q.a)(n.getSource(e),"Expected sourceIds to be registered.")}))}function Z(e){Object(q.a)("function"===typeof e,"When clientOffset is provided, getSourceClientOffset must be a function.")}function J(e){Object(q.a)(P(e),"Item must be an object.")}function ee(e,t){for(var n=null,r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}function te(e){return function(){if(e.getMonitor().isDragging())return{type:f}}}function ne(e,t){return null===t?null===e:Array.isArray(e)?e.some((function(e){return e===t})):e===t}function re(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.clientOffset;oe(t);var o=t.slice(0),i=e.getMonitor(),a=e.getRegistry();ie(o,i,a);var l=i.getItemType();return ae(o,a,l),le(o,i,a),{type:d,payload:{targetIds:o,clientOffset:r||null}}}}function oe(e){Object(q.a)(Array.isArray(e),"Expected targetIds to be an array.")}function ie(e,t,n){Object(q.a)(t.isDragging(),"Cannot call hover while not dragging."),Object(q.a)(!t.didDrop(),"Cannot call hover after drop.");for(var r=0;r<e.length;r++){var o=e[r];Object(q.a)(e.lastIndexOf(o)===r,"Expected targetIds to be unique in the passed array.");var i=n.getTarget(o);Object(q.a)(i,"Expected targetIds to be registered.")}}function ae(e,t,n){for(var r=e.length-1;r>=0;r--){var o=e[r];ne(t.getTargetType(o),n)||e.splice(r,1)}}function le(e,t,n){e.forEach((function(e){n.getTarget(e).hover(t,e)}))}function ue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ce(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ue(Object(n),!0).forEach((function(t){se(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ue(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function se(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fe(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.getMonitor(),r=e.getRegistry();de(n);var o=he(n);o.forEach((function(o,i){var a=pe(o,i,r,n),l={type:p,payload:{dropResult:ce(ce({},t),a)}};e.dispatch(l)}))}}function de(e){Object(q.a)(e.isDragging(),"Cannot call drop while not dragging."),Object(q.a)(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function pe(e,t,n,r){var o=n.getTarget(e),i=o?o.drop(r,e):void 0;return function(e){Object(q.a)("undefined"===typeof e||P(e),"Drop result must either be an object or undefined.")}(i),"undefined"===typeof i&&(i=0===t?{}:r.getDropResult()),i}function he(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function ve(e){return function(){var t=e.getMonitor(),n=e.getRegistry();!function(e){Object(q.a)(e.isDragging(),"Cannot call endDrag while not dragging.")}(t);var r=t.getSourceId();null!=r&&(n.getSource(r,!0).endDrag(t,r),n.unpinSource());return{type:h}}}function me(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ge(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var ye,be=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.store=t,this.registry=n}var t,n,r;return t=e,(n=[{key:"subscribeToStateChange",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{handlerIds:void 0},r=n.handlerIds;Object(q.a)("function"===typeof e,"listener must be a function."),Object(q.a)("undefined"===typeof r||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");var o=this.store.getState().stateId,i=function(){var n=t.store.getState(),i=n.stateId;try{i===o||i===o+1&&!V(n.dirtyHandlerIds,r)||e()}finally{o=i}};return this.store.subscribe(i)}},{key:"subscribeToOffsetChange",value:function(e){var t=this;Object(q.a)("function"===typeof e,"listener must be a function.");var n=this.store.getState().dragOffset;return this.store.subscribe((function(){var r=t.store.getState().dragOffset;r!==n&&(n=r,e())}))}},{key:"canDragSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e);return Object(q.a)(t,"Expected to find a valid source."),!this.isDragging()&&t.canDrag(this,e)}},{key:"canDropOnTarget",value:function(e){if(!e)return!1;var t=this.registry.getTarget(e);return Object(q.a)(t,"Expected to find a valid target."),!(!this.isDragging()||this.didDrop())&&ne(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e)}},{key:"isDragging",value:function(){return Boolean(this.getItemType())}},{key:"isDraggingSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e,!0);return Object(q.a)(t,"Expected to find a valid source."),!(!this.isDragging()||!this.isSourcePublic())&&this.registry.getSourceType(e)===this.getItemType()&&t.isDragging(this,e)}},{key:"isOverTarget",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shallow:!1};if(!e)return!1;var n=t.shallow;if(!this.isDragging())return!1;var r=this.registry.getTargetType(e),o=this.getItemType();if(o&&!ne(r,o))return!1;var i=this.getTargetIds();if(!i.length)return!1;var a=i.indexOf(e);return n?a===i.length-1:a>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return Boolean(this.store.getState().dragOperation.isSourcePublic)}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return function(e){var t,n,r=e.clientOffset,o=e.initialClientOffset,i=e.initialSourceClientOffset;return r&&o&&i?me((n=i,{x:(t=r).x+n.x,y:t.y+n.y}),o):null}(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return function(e){var t=e.clientOffset,n=e.initialClientOffset;return t&&n?me(t,n):null}(this.store.getState().dragOffset)}}])&&ge(t.prototype,n),r&&ge(t,r),e}(),Se=0;function we(e){return(we="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Oe(e,t){t&&Array.isArray(e)?e.forEach((function(e){return Oe(e,!1)})):Object(q.a)("string"===typeof e||"symbol"===we(e),t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}!function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"}(ye||(ye={}));var Ce=n(115),xe=[],Ee=[],ke=Ce.a.makeRequestCallFromTimer((function(){if(Ee.length)throw Ee.shift()}));function _e(e){var t;(t=xe.length?xe.pop():new Te).task=e,Object(Ce.a)(t)}var Te=function(){function e(){}return e.prototype.call=function(){try{this.task.call()}catch(e){_e.onerror?_e.onerror(e):(Ee.push(e),ke())}finally{this.task=null,xe[xe.length]=this}},e}();function je(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Pe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(u){o=!0,i=u}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return Ae(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ae(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ae(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ie(e){var t=(Se++).toString();switch(e){case ye.SOURCE:return"S".concat(t);case ye.TARGET:return"T".concat(t);default:throw new Error("Unknown Handler Role: ".concat(e))}}function Me(e){switch(e[0]){case"S":return ye.SOURCE;case"T":return ye.TARGET;default:Object(q.a)(!1,"Cannot parse handler ID: ".concat(e))}}function De(e,t){var n=e.entries(),r=!1;do{var o=n.next(),i=o.done;if(Pe(o.value,2)[1]===t)return!0;r=!!i}while(!r);return!1}var Re=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=t}var t,n,r;return t=e,(n=[{key:"addSource",value:function(e,t){Oe(e),function(e){Object(q.a)("function"===typeof e.canDrag,"Expected canDrag to be a function."),Object(q.a)("function"===typeof e.beginDrag,"Expected beginDrag to be a function."),Object(q.a)("function"===typeof e.endDrag,"Expected endDrag to be a function.")}(t);var n=this.addHandler(ye.SOURCE,e,t);return this.store.dispatch(function(e){return{type:C,payload:{sourceId:e}}}(n)),n}},{key:"addTarget",value:function(e,t){Oe(e,!0),function(e){Object(q.a)("function"===typeof e.canDrop,"Expected canDrop to be a function."),Object(q.a)("function"===typeof e.hover,"Expected hover to be a function."),Object(q.a)("function"===typeof e.drop,"Expected beginDrag to be a function.")}(t);var n=this.addHandler(ye.TARGET,e,t);return this.store.dispatch(function(e){return{type:x,payload:{targetId:e}}}(n)),n}},{key:"containsHandler",value:function(e){return De(this.dragSources,e)||De(this.dropTargets,e)}},{key:"getSource",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Object(q.a)(this.isSourceId(e),"Expected a valid source ID.");var n=t&&e===this.pinnedSourceId,r=n?this.pinnedSource:this.dragSources.get(e);return r}},{key:"getTarget",value:function(e){return Object(q.a)(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}},{key:"getSourceType",value:function(e){return Object(q.a)(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}},{key:"getTargetType",value:function(e){return Object(q.a)(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}},{key:"isSourceId",value:function(e){return Me(e)===ye.SOURCE}},{key:"isTargetId",value:function(e){return Me(e)===ye.TARGET}},{key:"removeSource",value:function(e){var t=this;Object(q.a)(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(e){return{type:E,payload:{sourceId:e}}}(e)),_e((function(){t.dragSources.delete(e),t.types.delete(e)}))}},{key:"removeTarget",value:function(e){Object(q.a)(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(e){return{type:k,payload:{targetId:e}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}},{key:"pinSource",value:function(e){var t=this.getSource(e);Object(q.a)(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}},{key:"unpinSource",value:function(){Object(q.a)(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(e,t,n){var r=Ie(e);return this.types.set(r,t),e===ye.SOURCE?this.dragSources.set(r,n):e===ye.TARGET&&this.dropTargets.set(r,n),r}}])&&je(t.prototype,n),r&&je(t,r),e}();function Ne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ze(e){var t="undefined"!==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__;return u(K,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}var Le=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];Ne(this,e),this.isSetUp=!1,this.handleRefCountChange=function(){var e=t.store.getState().refCount>0;t.backend&&(e&&!t.isSetUp?(t.backend.setup(),t.isSetUp=!0):!e&&t.isSetUp&&(t.backend.teardown(),t.isSetUp=!1))};var r=ze(n);this.store=r,this.monitor=new be(r,new Re(r)),r.subscribe(this.handleRefCountChange)}var t,n,r;return t=e,(n=[{key:"receiveBackend",value:function(e){this.backend=e}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var e=this,t=this.store.dispatch,n=function(e){return{beginDrag:X(e),publishDragSource:te(e),hover:re(e),drop:fe(e),endDrag:ve(e)}}(this);return Object.keys(n).reduce((function(r,o){var i,a=n[o];return r[o]=(i=a,function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var a=i.apply(e,r);"undefined"!==typeof a&&t(a)}),r}),{})}},{key:"dispatch",value:function(e){this.store.dispatch(e)}}])&&Fe(t.prototype,n),r&&Fe(t,r),e}();function Ve(e,t,n,r){var o=new Le(r),i=e(o,t,n);return o.receiveBackend(i),o}var He=r.createContext({dragDropManager:void 0});function Be(e,t,n,r){return{dragDropManager:Ve(e,t,n,r)}}},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(401),o=(n(0),n(61));function i(){return Object(r.a)()||o.a}},function(e,t,n){"use strict";function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return p})),n.d(t,"d",(function(){return h})),n.d(t,"e",(function(){return s})),n.d(t,"f",(function(){return f}));var r,o=n(1),i=r||(r={});i.Pop="POP",i.Push="PUSH",i.Replace="REPLACE";var a=function(e){return e};function l(e){e.preventDefault(),e.returnValue=""}function u(){var e=[];return{get length(){return e.length},push:function(t){return e.push(t),function(){e=e.filter((function(e){return e!==t}))}},call:function(t){e.forEach((function(e){return e&&e(t)}))}}}function c(){return Math.random().toString(36).substr(2,8)}function s(e){var t=e.pathname,n=e.search;return(void 0===t?"/":t)+(void 0===n?"":n)+(void 0===(e=e.hash)?"":e)}function f(e){var t={};if(e){var n=e.indexOf("#");0<=n&&(t.hash=e.substr(n),e=e.substr(0,n)),0<=(n=e.indexOf("?"))&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function d(e){function t(){var e=h.location,t=v.state||{};return[t.idx,a({pathname:e.pathname,search:e.search,hash:e.hash,state:t.usr||null,key:t.key||"default"})]}function n(e){return"string"===typeof e?e:s(e)}function i(e,t){return void 0===t&&(t=null),a(Object(o.a)({},b,{},"string"===typeof e?f(e):e,{state:t,key:c()}))}function d(e){g=e,e=t(),y=e[0],b=e[1],S.call({action:g,location:b})}function p(e){v.go(e)}void 0===e&&(e={});var h=void 0===(e=e.window)?document.defaultView:e,v=h.history,m=null;h.addEventListener("popstate",(function(){if(m)w.call(m),m=null;else{var e=r.Pop,n=t(),o=n[0];if(n=n[1],w.length){if(null!=o){var i=y-o;i&&(m={action:e,location:n,retry:function(){p(-1*i)}},p(i))}}else d(e)}}));var g=r.Pop,y=(e=t())[0],b=e[1],S=u(),w=u();return null==y&&(y=0,v.replaceState(Object(o.a)({},v.state,{idx:y}),"")),{get action(){return g},get location(){return b},createHref:n,push:function e(t,o){var a=r.Push,l=i(t,o);if(!w.length||(w.call({action:a,location:l,retry:function(){e(t,o)}}),0)){var u=[{usr:l.state,key:l.key,idx:y+1},n(l)];l=u[0],u=u[1];try{v.pushState(l,"",u)}catch(c){h.location.assign(u)}d(a)}},replace:function e(t,o){var a=r.Replace,l=i(t,o);w.length&&(w.call({action:a,location:l,retry:function(){e(t,o)}}),1)||(l=[{usr:l.state,key:l.key,idx:y},n(l)],v.replaceState(l[0],"",l[1]),d(a))},go:p,back:function(){p(-1)},forward:function(){p(1)},listen:function(e){return S.push(e)},block:function(e){var t=w.push(e);return 1===w.length&&h.addEventListener("beforeunload",l),function(){t(),w.length||h.removeEventListener("beforeunload",l)}}}}function p(e){function t(){var e=f(v.location.hash.substr(1)),t=e.pathname,n=e.search;e=e.hash;var r=m.state||{};return[r.idx,a({pathname:void 0===t?"/":t,search:void 0===n?"":n,hash:void 0===e?"":e,state:r.usr||null,key:r.key||"default"})]}function n(){if(g)O.call(g),g=null;else{var e=r.Pop,n=t(),o=n[0];if(n=n[1],O.length){if(null!=o){var i=b-o;i&&(g={action:e,location:n,retry:function(){h(-1*i)}},h(i))}}else p(e)}}function i(e){var t=document.querySelector("base"),n="";return t&&t.getAttribute("href")&&(n=-1===(n=(t=v.location.href).indexOf("#"))?t:t.slice(0,n)),n+"#"+("string"===typeof e?e:s(e))}function d(e,t){return void 0===t&&(t=null),a(Object(o.a)({},S,{},"string"===typeof e?f(e):e,{state:t,key:c()}))}function p(e){y=e,e=t(),b=e[0],S=e[1],w.call({action:y,location:S})}function h(e){m.go(e)}void 0===e&&(e={});var v=void 0===(e=e.window)?document.defaultView:e,m=v.history,g=null;v.addEventListener("popstate",n),v.addEventListener("hashchange",(function(){s(t()[1])!==s(S)&&n()}));var y=r.Pop,b=(e=t())[0],S=e[1],w=u(),O=u();return null==b&&(b=0,m.replaceState(Object(o.a)({},m.state,{idx:b}),"")),{get action(){return y},get location(){return S},createHref:i,push:function e(t,n){var o=r.Push,a=d(t,n);if(!O.length||(O.call({action:o,location:a,retry:function(){e(t,n)}}),0)){var l=[{usr:a.state,key:a.key,idx:b+1},i(a)];a=l[0],l=l[1];try{m.pushState(a,"",l)}catch(u){v.location.assign(l)}p(o)}},replace:function e(t,n){var o=r.Replace,a=d(t,n);O.length&&(O.call({action:o,location:a,retry:function(){e(t,n)}}),1)||(a=[{usr:a.state,key:a.key,idx:b},i(a)],m.replaceState(a[0],"",a[1]),p(o))},go:h,back:function(){h(-1)},forward:function(){h(1)},listen:function(e){return w.push(e)},block:function(e){var t=O.push(e);return 1===O.length&&v.addEventListener("beforeunload",l),function(){t(),O.length||v.removeEventListener("beforeunload",l)}}}}function h(e){function t(e,t){return void 0===t&&(t=null),a(Object(o.a)({},m,{},"string"===typeof e?f(e):e,{state:t,key:c()}))}function n(e,t,n){return!y.length||(y.call({action:e,location:t,retry:n}),!1)}function i(e,t){v=e,m=t,g.call({action:v,location:m})}function l(e){var t=Math.min(Math.max(h+e,0),p.length-1),o=r.Pop,a=p[t];n(o,a,(function(){l(e)}))&&(h=t,i(o,a))}void 0===e&&(e={});var d=e;e=d.initialEntries,d=d.initialIndex;var p=(void 0===e?["/"]:e).map((function(e){return a(Object(o.a)({pathname:"/",search:"",hash:"",state:null,key:c()},"string"===typeof e?f(e):e))})),h=Math.min(Math.max(null==d?p.length-1:d,0),p.length-1),v=r.Pop,m=p[h],g=u(),y=u();return{get index(){return h},get action(){return v},get location(){return m},createHref:function(e){return"string"===typeof e?e:s(e)},push:function e(o,a){var l=r.Push,u=t(o,a);n(l,u,(function(){e(o,a)}))&&(h+=1,p.splice(h,p.length,u),i(l,u))},replace:function e(o,a){var l=r.Replace,u=t(o,a);n(l,u,(function(){e(o,a)}))&&(p[h]=u,i(l,u))},go:l,back:function(){l(-1)},forward:function(){l(1)},listen:function(e){return g.push(e)},block:function(e){return y.push(e)}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultFileActions=t.ChonkyActions=void 0;var r=n(22),o=n(48),i=n(28);t.ChonkyActions={MoveFilesTo:{id:"move_files_to"},DuplicateFilesTo:{id:"duplicate_files_to"},ChangeSelection:{id:"change_selection"},OpenFiles:{id:"open_files",requiresSelection:!0,hotkeys:["enter"],fileFilter:i.FileHelper.isOpenable,toolbarButton:{name:"Open selection",group:"Actions",dropdown:!0,icon:r.ChonkyIconName.openFiles}},OpenParentFolder:{id:"open_parent_folder",hotkeys:["backspace"],toolbarButton:{name:"Go up a directory",icon:r.ChonkyIconName.openParentFolder,iconOnly:!0},specialActionToDispatch:o.SpecialAction.OpenParentFolder},ToggleSearch:{id:"toggle_search",hotkeys:["ctrl+f"],toolbarButton:{name:"Search",icon:r.ChonkyIconName.search,iconOnly:!0},specialActionToDispatch:o.SpecialAction.ToggleSearchBar},SelectAllFiles:{id:"select_all_files",hotkeys:["ctrl+a"],toolbarButton:{name:"Select all files",group:"Actions",dropdown:!0,icon:r.ChonkyIconName.selectAllFiles,iconOnly:!0},specialActionToDispatch:o.SpecialAction.SelectAllFiles},ClearSelection:{id:"clear_selection",hotkeys:["escape"],toolbarButton:{name:"Clear selection",group:"Actions",dropdown:!0,icon:r.ChonkyIconName.clearSelection,iconOnly:!0},specialActionToDispatch:o.SpecialAction.ClearSelection},SortFilesByName:{id:"sort_files_by_name",sortKeySelector:function(e){return e?e.name:void 0},toolbarButton:{name:"Sort by name",group:"Sort",dropdown:!0}},SortFilesBySize:{id:"sort_files_by_size",sortKeySelector:function(e){return e?e.size:void 0},toolbarButton:{name:"Sort by size",group:"Sort",dropdown:!0}},SortFilesByDate:{id:"sort_files_by_date",sortKeySelector:function(e){return e?e.modDate:void 0},toolbarButton:{name:"Sort by date",group:"Sort",dropdown:!0}},ToggleHiddenFiles:{id:"toggle_hidden_files",hotkeys:["ctrl+h"],option:{id:"show_hidden_files",defaultValue:!0},toolbarButton:{name:"Show hidden files",group:"Options",dropdown:!0}},ToggleShowFoldersFirst:{id:"toggle_show_folders_first",option:{id:"show_folders_first",defaultValue:!0},toolbarButton:{name:"Show folders first",group:"Options",dropdown:!0}},CopyFiles:{id:"copy_files",requiresSelection:!0,hotkeys:["ctrl+c"],toolbarButton:{name:"Copy selection",group:"Actions",dropdown:!0,icon:r.ChonkyIconName.copy}},CreateFolder:{id:"create_folder",toolbarButton:{name:"Create folder",tooltip:"Create a folder",icon:r.ChonkyIconName.folderCreate}},UploadFiles:{id:"upload_files",toolbarButton:{name:"Upload files",tooltip:"Upload files",icon:r.ChonkyIconName.upload}},DownloadFiles:{id:"download_files",requiresSelection:!0,toolbarButton:{name:"Download files",group:"Actions",tooltip:"Download files",dropdown:!0,icon:r.ChonkyIconName.download}},DeleteFiles:{id:"delete_files",requiresSelection:!0,hotkeys:["delete"],toolbarButton:{name:"Delete files",group:"Actions",tooltip:"Delete files",dropdown:!0,icon:r.ChonkyIconName.trash}}},t.DefaultFileActions=[t.ChonkyActions.MoveFilesTo,t.ChonkyActions.DuplicateFilesTo,t.ChonkyActions.ChangeSelection,t.ChonkyActions.OpenParentFolder,t.ChonkyActions.ToggleSearch,t.ChonkyActions.OpenFiles,t.ChonkyActions.SelectAllFiles,t.ChonkyActions.ClearSelection,t.ChonkyActions.SortFilesByName,t.ChonkyActions.SortFilesBySize,t.ChonkyActions.SortFilesByDate,t.ChonkyActions.ToggleHiddenFiles,t.ChonkyActions.ToggleShowFoldersFirst]},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";function r(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:166;function r(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];var a=this,l=function(){e.apply(a,o)};clearTimeout(t),t=setTimeout(l,n)}return r.clear=function(){clearTimeout(t)},r}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fileSelectedState=t.selectionSizeState=t.selectedFilesState=t.selectionModifiersState=t.selectionState=void 0;var r=n(9),o=n(101),i=n(102),a=n(39);t.selectionState=r.atom({key:"selectionState",default:new Set}),t.selectionModifiersState=r.atom({key:"selectionModifiersState",default:{selectFiles:o.NOOP_FUNCTION,toggleSelection:o.NOOP_FUNCTION,clearSelection:o.NOOP_FUNCTION}}),t.selectedFilesState=r.selector({key:"selectedFilesState",get:function(e){var n=e.get,r=n(a.filesState),o=n(t.selectionState);return i.SelectionHelper.getSelectedFiles(r,o)}}),t.selectionSizeState=r.selector({key:"selectionSizeState",get:function(e){var n=e.get;return n(t.selectionState).size}}),t.fileSelectedState=r.selectorFamily({key:"fileSelectedState",get:function(e){return function(n){var r=n.get;return!!e&&r(t.selectionState).has(e)}}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fileDataState=t.fileMapState=t.parentFolderState=t.folderChainState=t.filesState=void 0;var r=n(9);t.filesState=r.atom({key:"filesState",default:[]}),t.folderChainState=r.atom({key:"folderChainState",default:null}),t.parentFolderState=r.atom({key:"parentFolderState",default:null}),t.fileMapState=r.selector({key:"fileMapState",get:function(e){for(var n=e.get,r={},o=0,i=n(t.filesState);o<i.length;o++){var a=i[o];a&&(r[a.id]=a)}return r}}),t.fileDataState=r.selectorFamily({key:"fileDataState",get:function(e){return function(n){var r=n.get;if(!e)return null;var o=r(t.fileMapState)[e];return null!==o&&void 0!==o?o:null}}})},function(e,t,n){"use strict";var r=n(36),o=n(103);Object.defineProperty(t,"__esModule",{value:!0}),t.bpfrpt_proptype_VisibleCellRange=t.bpfrpt_proptype_Alignment=t.bpfrpt_proptype_OverscanIndicesGetter=t.bpfrpt_proptype_OverscanIndices=t.bpfrpt_proptype_OverscanIndicesGetterParams=t.bpfrpt_proptype_RenderedSection=t.bpfrpt_proptype_ScrollbarPresenceChange=t.bpfrpt_proptype_Scroll=t.bpfrpt_proptype_NoContentRenderer=t.bpfrpt_proptype_CellSize=t.bpfrpt_proptype_CellSizeGetter=t.bpfrpt_proptype_CellRangeRenderer=t.bpfrpt_proptype_CellRangeRendererParams=t.bpfrpt_proptype_StyleCache=t.bpfrpt_proptype_CellCache=t.bpfrpt_proptype_CellRenderer=t.bpfrpt_proptype_CellRendererParams=t.bpfrpt_proptype_CellPosition=void 0;o(n(0)),r(n(105)),r(n(3));t.bpfrpt_proptype_CellPosition=null;t.bpfrpt_proptype_CellRendererParams=null;t.bpfrpt_proptype_CellRenderer=null;t.bpfrpt_proptype_CellCache=null;t.bpfrpt_proptype_StyleCache=null;t.bpfrpt_proptype_CellRangeRendererParams=null;t.bpfrpt_proptype_CellRangeRenderer=null;t.bpfrpt_proptype_CellSizeGetter=null;t.bpfrpt_proptype_CellSize=null;t.bpfrpt_proptype_NoContentRenderer=null;t.bpfrpt_proptype_Scroll=null;t.bpfrpt_proptype_ScrollbarPresenceChange=null;t.bpfrpt_proptype_RenderedSection=null;t.bpfrpt_proptype_OverscanIndicesGetterParams=null;t.bpfrpt_proptype_OverscanIndices=null;t.bpfrpt_proptype_OverscanIndicesGetter=null;t.bpfrpt_proptype_Alignment=null;t.bpfrpt_proptype_VisibleCellRange=null},function(e,t,n){"use strict";e.exports=function(e){if("function"!==typeof e)throw new TypeError(e+" is not a function");return e}},function(e,t,n){"use strict";var r,o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ChonkyIconFA=void 0;var a=n(309),l=n(310),u=n(311),c=n(312),s=n(313),f=n(314),d=n(315),p=n(316),h=n(317),v=n(318),m=n(319),g=n(320),y=n(321),b=n(322),S=n(323),w=n(324),O=n(325),C=n(326),x=n(327),E=n(328),k=n(329),_=n(330),T=n(331),j=n(332),P=n(333),A=n(334),I=n(335),M=n(336),D=n(337),R=n(338),N=n(339),F=n(340),z=n(341),L=n(342),V=n(343),H=n(344),B=n(345),W=n(346),U=n(347),$=n(348),K=n(349),q=n(350),G=n(351),Y=n(352),X=n(353),Q=n(354),Z=n(355),J=n(356),ee=n(357),te=n(358),ne=n(359),re=n(360),oe=n(361),ie=n(362),ae=n(363),le=n(364),ue=n(365),ce=n(366),se=n(367),fe=i(n(0)),de=n(22),pe=((r={})[de.ChonkyIconName.loading]=O.faCircleNotch,r[de.ChonkyIconName.dropdown]=b.faChevronDown,r[de.ChonkyIconName.circle]=$.faGenderless,r[de.ChonkyIconName.dndDragging]=H.faFistRaised,r[de.ChonkyIconName.dndCanDrop]=v.faArrowDown,r[de.ChonkyIconName.dndCannotDrop]=ae.faTimes,r[de.ChonkyIconName.openFiles]=g.faBoxOpen,r[de.ChonkyIconName.openParentFolder]=G.faLevelUpAlt,r[de.ChonkyIconName.copy]=x.faCopy,r[de.ChonkyIconName.search]=ee.faSearch,r[de.ChonkyIconName.selectAllFiles]=Z.faObjectGroup,r[de.ChonkyIconName.clearSelection]=T.faEraser,r[de.ChonkyIconName.sortAsc]=te.faSortAmountDownAlt,r[de.ChonkyIconName.sortDesc]=ne.faSortAmountUpAlt,r[de.ChonkyIconName.checkActive]=y.faCheckCircle,r[de.ChonkyIconName.checkInactive]=w.faCircle,r[de.ChonkyIconName.list]=Y.faList,r[de.ChonkyIconName.folder]=B.faFolder,r[de.ChonkyIconName.folderCreate]=U.faFolderPlus,r[de.ChonkyIconName.folderOpen]=W.faFolderOpen,r[de.ChonkyIconName.smallThumbnail]=oe.faTh,r[de.ChonkyIconName.largeThumbnail]=ie.faThLarge,r[de.ChonkyIconName.folderChainSeparator]=S.faChevronRight,r[de.ChonkyIconName.download]=_.faDownload,r[de.ChonkyIconName.upload]=ue.faUpload,r[de.ChonkyIconName.trash]=le.faTrash,r[de.ChonkyIconName.fallbackIcon]=j.faExclamationTriangle,r[de.ChonkyIconName.symlink]=P.faExternalLinkAlt,r[de.ChonkyIconName.hidden]=A.faEyeSlash,r[de.ChonkyIconName.file]=I.faFile,r[de.ChonkyIconName.license]=m.faBalanceScale,r[de.ChonkyIconName.code]=R.faFileCode,r[de.ChonkyIconName.config]=C.faCogs,r[de.ChonkyIconName.model]=E.faCubes,r[de.ChonkyIconName.database]=k.faDatabase,r[de.ChonkyIconName.text]=M.faFileAlt,r[de.ChonkyIconName.archive]=D.faFileArchive,r[de.ChonkyIconName.image]=F.faFileImage,r[de.ChonkyIconName.video]=V.faFilm,r[de.ChonkyIconName.info]=K.faInfoCircle,r[de.ChonkyIconName.key]=q.faKey,r[de.ChonkyIconName.lock]=X.faLock,r[de.ChonkyIconName.music]=Q.faMusic,r[de.ChonkyIconName.terminal]=re.faTerminal,r[de.ChonkyIconName.users]=ce.faUsers,r[de.ChonkyIconName.linux]=u.faLinux,r[de.ChonkyIconName.ubuntu]=p.faUbuntu,r[de.ChonkyIconName.windows]=h.faWindows,r[de.ChonkyIconName.rust]=d.faRust,r[de.ChonkyIconName.python]=f.faPython,r[de.ChonkyIconName.nodejs]=c.faNodeJs,r[de.ChonkyIconName.php]=s.faPhp,r[de.ChonkyIconName.git]=l.faGitAlt,r[de.ChonkyIconName.adobe]=a.faAdobe,r[de.ChonkyIconName.pdf]=z.faFilePdf,r[de.ChonkyIconName.excel]=N.faFileExcel,r[de.ChonkyIconName.word]=L.faFileWord,r[de.ChonkyIconName.flash]=J.faRunning,r);t.ChonkyIconFA=fe.default.memo((function(e){var t=e.icon,n=o(o({},e),{icon:pe[t]?pe[t]:pe.fallbackIcon});return fe.default.createElement(se.FontAwesomeIcon,o({},n))}))},function(e,t,n){"use strict";function r(e,t,n){var r=n.getRegistry(),o=r.addTarget(e,t);return[o,function(){return r.removeTarget(o)}]}function o(e,t,n){var r=n.getRegistry(),o=r.addSource(e,t);return[o,function(){return r.removeSource(o)}]}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(71);var o=n(171),i=n(89);function a(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||Object(o.a)(e)||Object(i.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(172);var o=n(89),i=n(173);function a(e,t){return Object(r.a)(e)||function(e,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(u){o=!0,i=u}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}}(e,t)||Object(o.a)(e,t)||Object(i.a)()}},function(e,t,n){"use strict";var r=n(0),o=r.createContext({});t.a=o},function(e,t,n){"use strict";function r(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce((function(e,t){return null==t?e:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];e.apply(this,r),t.apply(this,r)}}),(function(){}))}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpecialAction=void 0,function(e){e.MouseClickFile="mouse_click_file",e.KeyboardClickFile="keyboard_click_file",e.OpenParentFolder="open_parent_folder",e.OpenFolderChainFolder="open_folder_chain_folder",e.ToggleSearchBar="toggle_search_bar",e.SelectAllFiles="select_all_files",e.ClearSelection="clear_selection",e.DragNDropStart="drag_n_drop_start",e.DragNDropEnd="drag_n_drop_end"}(t.SpecialAction||(t.SpecialAction={}))},function(e,t,n){"use strict";var r=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,l=i.length;a<l;a++,o++)r[o]=i[a];return r};Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=void 0;var o=function(){function e(){}return e.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.error.apply(console,r(["[Chonky runtime error]"],e))},e.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.warn.apply(console,r(["[Chonky runtime warning]"],e))},e.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.debug.apply(console,r(["[Chonky runtime debug]"],e))},e.formatBullets=function(e){return"\n- "+e.join("\n- ")},e}();t.Logger=o},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)&&r.length){var a=o.apply(null,r);a&&e.push(a)}else if("object"===i)for(var l in r)n.call(r,l)&&r[l]&&e.push(l)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){"use strict";var r=n(246)();e.exports=function(e){return e!==r&&null!==e}},function(e,t,n){"use strict";var r=n(247),o=Math.max;e.exports=function(e){return o(0,r(e))}},function(e,t,n){},function(e,t,n){"use strict";var r=n(144),o=n(261),i=n(141),a=n(139),l=n(265);(e.exports=function(e,t){var n,o,u,c,s;return arguments.length<2||"string"!==typeof e?(c=t,t=e,e=null):c=arguments[2],r(e)?(n=l.call(e,"c"),o=l.call(e,"e"),u=l.call(e,"w")):(n=u=!0,o=!1),s={value:t,configurable:n,enumerable:o,writable:u},c?i(a(c),s):s}).gs=function(e,t,n){var u,c,s,f;return"string"!==typeof e?(s=n,n=t,t=e,e=null):s=arguments[3],r(t)?o(t)?r(n)?o(n)||(s=n,n=void 0):n=void 0:(s=t,t=n=void 0):t=void 0,r(e)?(u=l.call(e,"c"),c=l.call(e,"e")):(u=!0,c=!1),f={get:t,set:n,configurable:u,enumerable:c},s?i(a(s),f):f}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useRefCallbackWithErrorHandling=t.useClickListener=t.useInstanceVariable=t.useStaticValue=t.useDebounce=void 0;var r=n(0),o=n(49);t.useDebounce=function(e,t){var n=r.useState(e),o=n[0],i=n[1];return r.useEffect((function(){var n=setTimeout((function(){i(e)}),t);return function(){clearTimeout(n)}}),[e,t]),[o,i]};var i={};t.useStaticValue=function(e){var t=r.useRef(i);return t.current===i&&(t.current=e()),t.current},t.useInstanceVariable=function(e){var t=r.useRef(e);return r.useEffect((function(){t.current=e}),[t,e]),t},t.useClickListener=function(e){var t=e.onClick,n=e.onInsideClick,o=e.onOutsideClick,i=r.useRef(null),a=r.useCallback((function(e){var r=e.target;if(!i.current||i.current.contains(r))n&&n(e);else{var a=r&&"string"===typeof r.tagName&&"button"===r.tagName.toLowerCase();o&&o(e,a)}t&&t(e)}),[t,n,o,i]);return r.useEffect((function(){return document.addEventListener("mousedown",a,!1),function(){document.removeEventListener("mousedown",a,!1)}}),[a]),i},t.useRefCallbackWithErrorHandling=function(e,n){var i=t.useInstanceVariable(e);return r.useCallback((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{i.current.apply(i,e)}catch(r){o.Logger.error("An error occurred inside "+n+":",r)}}),[i,n])}},function(e,t,n){"use strict";function r(e){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(51);e.exports=function(e){if(!r(e))throw new TypeError("Cannot use null or undefined");return e}},function(e,t,n){"use strict";var r=n(67),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function u(e){return r.isMemo(e)?a:l[e.$$typeof]||o}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=a;var c=Object.defineProperty,s=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(h){var o=p(n);o&&o!==h&&e(t,o,r)}var a=s(n);f&&(a=a.concat(f(n)));for(var l=u(t),v=u(n),m=0;m<a.length;++m){var g=a[m];if(!i[g]&&(!r||!r[g])&&(!v||!v[g])&&(!l||!l[g])){var y=d(n,g);try{c(t,g,y)}catch(b){}}}}return t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(1),o=n(0),i=n.n(o),a=n(95);function l(e,t){var n=function(t,n){return i.a.createElement(a.a,Object(r.a)({ref:n},t),e)};return n.muiName=a.a.muiName,i.a.memo(i.a.forwardRef(n))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(17);function o(e){return Object(r.a)(e).defaultView||window}},function(e,t,n){"use strict";var r=n(14),o=n(2),i=n(434),a=n(1),l=["xs","sm","md","lg","xl"];function u(e){var t=e.values,n=void 0===t?{xs:0,sm:600,md:960,lg:1280,xl:1920}:t,r=e.unit,i=void 0===r?"px":r,u=e.step,c=void 0===u?5:u,s=Object(o.a)(e,["values","unit","step"]);function f(e){var t="number"===typeof n[e]?n[e]:e;return"@media (min-width:".concat(t).concat(i,")")}function d(e,t){var r=l.indexOf(t);return r===l.length-1?f(e):"@media (min-width:".concat("number"===typeof n[e]?n[e]:e).concat(i,") and ")+"(max-width:".concat((-1!==r&&"number"===typeof n[l[r+1]]?n[l[r+1]]:t)-c/100).concat(i,")")}return Object(a.a)({keys:l,values:n,up:f,down:function(e){var t=l.indexOf(e)+1,r=n[l[t]];return t===l.length?f("xs"):"@media (max-width:".concat(("number"===typeof r&&t>0?r:e)-c/100).concat(i,")")},between:d,only:function(e){return d(e,e)},width:function(e){return n[e]}},s)}function c(e,t,n){var o;return Object(a.a)({gutters:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(a.a)({paddingLeft:t(2),paddingRight:t(2)},n,Object(r.a)({},e.up("sm"),Object(a.a)({paddingLeft:t(3),paddingRight:t(3)},n[e.up("sm")])))},toolbar:(o={minHeight:56},Object(r.a)(o,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),Object(r.a)(o,e.up("sm"),{minHeight:64}),o)},n)}var s=n(176),f={black:"#000",white:"#fff"},d={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},p={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},h={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},v={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},m={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},g={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},y={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},b=n(15),S={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:f.white,default:d[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},w={text:{primary:f.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:d[800],default:"#303030"},action:{active:f.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function O(e,t,n,r){var o=r.light||r,i=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=Object(b.d)(e.main,o):"dark"===t&&(e.dark=Object(b.a)(e.main,i)))}function C(e){var t=e.primary,n=void 0===t?{light:p[300],main:p[500],dark:p[700]}:t,r=e.secondary,l=void 0===r?{light:h.A200,main:h.A400,dark:h.A700}:r,u=e.error,c=void 0===u?{light:v[300],main:v[500],dark:v[700]}:u,C=e.warning,x=void 0===C?{light:m[300],main:m[500],dark:m[700]}:C,E=e.info,k=void 0===E?{light:g[300],main:g[500],dark:g[700]}:E,_=e.success,T=void 0===_?{light:y[300],main:y[500],dark:y[700]}:_,j=e.type,P=void 0===j?"light":j,A=e.contrastThreshold,I=void 0===A?3:A,M=e.tonalOffset,D=void 0===M?.2:M,R=Object(o.a)(e,["primary","secondary","error","warning","info","success","type","contrastThreshold","tonalOffset"]);function N(e){return Object(b.c)(e,w.text.primary)>=I?w.text.primary:S.text.primary}var F=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;if(!(e=Object(a.a)({},e)).main&&e[t]&&(e.main=e[t]),!e.main)throw new Error(Object(s.a)(4,t));if("string"!==typeof e.main)throw new Error(Object(s.a)(5,JSON.stringify(e.main)));return O(e,"light",n,D),O(e,"dark",r,D),e.contrastText||(e.contrastText=N(e.main)),e},z={dark:w,light:S};return Object(i.a)(Object(a.a)({common:f,type:P,primary:F(n),secondary:F(l,"A400","A200","A700"),error:F(c),warning:F(x),info:F(k),success:F(T),grey:d,contrastThreshold:I,getContrastText:N,augmentColor:F,tonalOffset:D},z[P]),R)}function x(e){return Math.round(1e5*e)/1e5}var E={textTransform:"uppercase"};function k(e,t){var n="function"===typeof t?t(e):t,r=n.fontFamily,l=void 0===r?'"Roboto", "Helvetica", "Arial", sans-serif':r,u=n.fontSize,c=void 0===u?14:u,s=n.fontWeightLight,f=void 0===s?300:s,d=n.fontWeightRegular,p=void 0===d?400:d,h=n.fontWeightMedium,v=void 0===h?500:h,m=n.fontWeightBold,g=void 0===m?700:m,y=n.htmlFontSize,b=void 0===y?16:y,S=n.allVariants,w=n.pxToRem,O=Object(o.a)(n,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]);var C=c/14,k=w||function(e){return"".concat(e/b*C,"rem")},_=function(e,t,n,r,o){return Object(a.a)({fontFamily:l,fontWeight:e,fontSize:k(t),lineHeight:n},'"Roboto", "Helvetica", "Arial", sans-serif'===l?{letterSpacing:"".concat(x(r/t),"em")}:{},o,S)},T={h1:_(f,96,1.167,-1.5),h2:_(f,60,1.2,-.5),h3:_(p,48,1.167,0),h4:_(p,34,1.235,.25),h5:_(p,24,1.334,0),h6:_(v,20,1.6,.15),subtitle1:_(p,16,1.75,.15),subtitle2:_(v,14,1.57,.1),body1:_(p,16,1.5,.15),body2:_(p,14,1.43,.15),button:_(v,14,1.75,.4,E),caption:_(p,12,1.66,.4),overline:_(p,12,2.66,1,E)};return Object(i.a)(Object(a.a)({htmlFontSize:b,pxToRem:k,round:x,fontFamily:l,fontSize:c,fontWeightLight:f,fontWeightRegular:p,fontWeightMedium:v,fontWeightBold:g},T),O,{clone:!1})}function _(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}var T=["none",_(0,2,1,-1,0,1,1,0,0,1,3,0),_(0,3,1,-2,0,2,2,0,0,1,5,0),_(0,3,3,-2,0,3,4,0,0,1,8,0),_(0,2,4,-1,0,4,5,0,0,1,10,0),_(0,3,5,-1,0,5,8,0,0,1,14,0),_(0,3,5,-1,0,6,10,0,0,1,18,0),_(0,4,5,-2,0,7,10,1,0,2,16,1),_(0,5,5,-3,0,8,10,1,0,3,14,2),_(0,5,6,-3,0,9,12,1,0,3,16,2),_(0,6,6,-3,0,10,14,1,0,4,18,3),_(0,6,7,-4,0,11,15,1,0,4,20,3),_(0,7,8,-4,0,12,17,2,0,5,22,4),_(0,7,8,-4,0,13,19,2,0,5,24,4),_(0,7,9,-4,0,14,21,2,0,5,26,4),_(0,8,9,-5,0,15,22,2,0,6,28,5),_(0,8,10,-5,0,16,24,2,0,6,30,5),_(0,8,11,-5,0,17,26,2,0,6,32,5),_(0,9,11,-5,0,18,28,2,0,7,34,6),_(0,9,12,-6,0,19,29,2,0,7,36,6),_(0,10,13,-6,0,20,31,3,0,8,38,7),_(0,10,13,-6,0,21,33,3,0,8,40,7),_(0,10,14,-6,0,22,35,3,0,8,42,7),_(0,11,14,-7,0,23,36,3,0,9,44,8),_(0,11,15,-7,0,24,38,3,0,9,46,8)],j={borderRadius:4},P=n(45),A=(n(44),n(56));n(3);var I=function(e,t){return t?Object(i.a)(e,t,{clone:!1}):e},M={xs:0,sm:600,md:960,lg:1280,xl:1920},D={keys:["xs","sm","md","lg","xl"],up:function(e){return"@media (min-width:".concat(M[e],"px)")}};var R={m:"margin",p:"padding"},N={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},F={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},z=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}((function(e){if(e.length>2){if(!F[e])return[e];e=F[e]}var t=e.split(""),n=Object(P.a)(t,2),r=n[0],o=n[1],i=R[r],a=N[o]||"";return Array.isArray(a)?a.map((function(e){return i+e})):[i+a]})),L=["m","mt","mr","mb","ml","mx","my","p","pt","pr","pb","pl","px","py","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY"];function V(e){var t=e.spacing||8;return"number"===typeof t?function(e){return t*e}:Array.isArray(t)?function(e){return t[e]}:"function"===typeof t?t:function(){}}function H(e,t){return function(n){return e.reduce((function(e,r){return e[r]=function(e,t){if("string"===typeof t)return t;var n=e(Math.abs(t));return t>=0?n:"number"===typeof n?-n:"-".concat(n)}(t,n),e}),{})}}function B(e){var t=V(e.theme);return Object.keys(e).map((function(n){if(-1===L.indexOf(n))return null;var r=H(z(n),t),o=e[n];return function(e,t,n){if(Array.isArray(t)){var r=e.theme.breakpoints||D;return t.reduce((function(e,o,i){return e[r.up(r.keys[i])]=n(t[i]),e}),{})}if("object"===Object(A.a)(t)){var o=e.theme.breakpoints||D;return Object.keys(t).reduce((function(e,r){return e[o.up(r)]=n(t[r]),e}),{})}return n(t)}(e,o,r)})).reduce(I,{})}B.propTypes={},B.filterProps=L;function W(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=V({spacing:e}),n=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return 0===n.length?t(1):1===n.length?t(n[0]):n.map((function(e){if("string"===typeof e)return e;var n=t(e);return"number"===typeof n?"".concat(n,"px"):n})).join(" ")};return Object.defineProperty(n,"unit",{get:function(){return e}}),n.mui=!0,n}var U={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},$={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function K(e){return"".concat(Math.round(e),"ms")}var q={easing:U,duration:$,create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.duration,r=void 0===n?$.standard:n,i=t.easing,a=void 0===i?U.easeInOut:i,l=t.delay,u=void 0===l?0:l;Object(o.a)(t,["duration","easing","delay"]);return(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"===typeof r?r:K(r)," ").concat(a," ").concat("string"===typeof u?u:K(u))})).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}},G=n(90);var Y=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,n=void 0===t?{}:t,r=e.mixins,a=void 0===r?{}:r,l=e.palette,s=void 0===l?{}:l,f=e.spacing,d=e.typography,p=void 0===d?{}:d,h=Object(o.a)(e,["breakpoints","mixins","palette","spacing","typography"]),v=C(s),m=u(n),g=W(f),y=Object(i.a)({breakpoints:m,direction:"ltr",mixins:c(m,g,a),overrides:{},palette:v,props:{},shadows:T,typography:k(v,p),spacing:g,shape:j,transitions:q,zIndex:G.a},h),b=arguments.length,S=new Array(b>1?b-1:0),w=1;w<b;w++)S[w-1]=arguments[w];return y=S.reduce((function(e,t){return Object(i.a)(e,t)}),y)}();t.a=Y},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0);function o(e,t){return r.isValidElement(e)&&-1!==t.indexOf(e.type.muiName)}},function(e,t,n){"use strict";var r=n(0),o=n.n(r);t.a=o.a.createContext(null)},function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}n.d(t,"a",(function(){return o}))},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dispatchSpecialActionState=void 0;var r=n(9),o=n(101);t.dispatchSpecialActionState=r.atom({key:"dispatchSpecialActionState",default:o.NOOP_FUNCTION})},function(e,t,n){"use strict";e.exports=n(374)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.searchFilterState=t.searchBarVisibleState=t.searchBarEnabledState=void 0;var r=n(9);t.searchBarEnabledState=r.atom({key:"searchBarEnabledState",default:!1}),t.searchBarVisibleState=r.atom({key:"searchBarVisibleState",default:!1}),t.searchFilterState=r.atom({key:"searchFilterState",default:""})},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e){return null!==e&&"object"===r(e)&&Object.prototype.hasOwnProperty.call(e,"current")}n.d(t,"a",(function(){return o}))},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(0),o=n.n(r),i=n(27),a=n(169),l=n.n(a);var u=function(){function e(e){this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)===0){var t,n=function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);t=0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling,this.container.insertBefore(n,t),this.tags.push(n)}var r=this.tags[this.tags.length-1];if(this.isSpeedy){var o=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(r);try{var i=105===e.charCodeAt(1)&&64===e.charCodeAt(0);o.insertRule(e,i?0:o.cssRules.length)}catch(a){0}}else r.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){return e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0},e}();var c=function(e){function t(e,t,r){var o=t.trim().split(h);t=o;var i=o.length,a=e.length;switch(a){case 0:case 1:var l=0;for(e=0===a?"":e[0]+" ";l<i;++l)t[l]=n(e,t[l],r).trim();break;default:var u=l=0;for(t=[];l<i;++l)for(var c=0;c<a;++c)t[u++]=n(e[c]+" ",o[l],r).trim()}return t}function n(e,t,n){var r=t.charCodeAt(0);switch(33>r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(v,"$1"+e.trim());case 58:return e.trim()+t.replace(v,"$1"+e.trim());default:if(0<1*n&&0<t.indexOf("\f"))return t.replace(v,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function r(e,t,n,i){var a=e+";",l=2*t+3*n+4*i;if(944===l){e=a.indexOf(":",9)+1;var u=a.substring(e,a.length-1).trim();return u=a.substring(0,e).trim()+u+";",1===j||2===j&&o(u,1)?"-webkit-"+u+u:u}if(0===j||2===j&&!o(a,1))return a;switch(l){case 1015:return 97===a.charCodeAt(10)?"-webkit-"+a+a:a;case 951:return 116===a.charCodeAt(3)?"-webkit-"+a+a:a;case 963:return 110===a.charCodeAt(5)?"-webkit-"+a+a:a;case 1009:if(100!==a.charCodeAt(4))break;case 969:case 942:return"-webkit-"+a+a;case 978:return"-webkit-"+a+"-moz-"+a+a;case 1019:case 983:return"-webkit-"+a+"-moz-"+a+"-ms-"+a+a;case 883:if(45===a.charCodeAt(8))return"-webkit-"+a+a;if(0<a.indexOf("image-set(",11))return a.replace(E,"$1-webkit-$2")+a;break;case 932:if(45===a.charCodeAt(4))switch(a.charCodeAt(5)){case 103:return"-webkit-box-"+a.replace("-grow","")+"-webkit-"+a+"-ms-"+a.replace("grow","positive")+a;case 115:return"-webkit-"+a+"-ms-"+a.replace("shrink","negative")+a;case 98:return"-webkit-"+a+"-ms-"+a.replace("basis","preferred-size")+a}return"-webkit-"+a+"-ms-"+a+a;case 964:return"-webkit-"+a+"-ms-flex-"+a+a;case 1023:if(99!==a.charCodeAt(8))break;return"-webkit-box-pack"+(u=a.substring(a.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+a+"-ms-flex-pack"+u+a;case 1005:return d.test(a)?a.replace(f,":-webkit-")+a.replace(f,":-moz-")+a:a;case 1e3:switch(t=(u=a.substring(13).trim()).indexOf("-")+1,u.charCodeAt(0)+u.charCodeAt(t)){case 226:u=a.replace(b,"tb");break;case 232:u=a.replace(b,"tb-rl");break;case 220:u=a.replace(b,"lr");break;default:return a}return"-webkit-"+a+"-ms-"+u+a;case 1017:if(-1===a.indexOf("sticky",9))break;case 975:switch(t=(a=e).length-10,l=(u=(33===a.charCodeAt(t)?a.substring(0,t):a).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|u.charCodeAt(7))){case 203:if(111>u.charCodeAt(8))break;case 115:a=a.replace(u,"-webkit-"+u)+";"+a;break;case 207:case 102:a=a.replace(u,"-webkit-"+(102<l?"inline-":"")+"box")+";"+a.replace(u,"-webkit-"+u)+";"+a.replace(u,"-ms-"+u+"box")+";"+a}return a+";";case 938:if(45===a.charCodeAt(5))switch(a.charCodeAt(6)){case 105:return u=a.replace("-items",""),"-webkit-"+a+"-webkit-box-"+u+"-ms-flex-"+u+a;case 115:return"-webkit-"+a+"-ms-flex-item-"+a.replace(O,"")+a;default:return"-webkit-"+a+"-ms-flex-line-pack"+a.replace("align-content","").replace(O,"")+a}break;case 973:case 989:if(45!==a.charCodeAt(3)||122===a.charCodeAt(4))break;case 931:case 953:if(!0===x.test(e))return 115===(u=e.substring(e.indexOf(":")+1)).charCodeAt(0)?r(e.replace("stretch","fill-available"),t,n,i).replace(":fill-available",":stretch"):a.replace(u,"-webkit-"+u)+a.replace(u,"-moz-"+u.replace("fill-",""))+a;break;case 962:if(a="-webkit-"+a+(102===a.charCodeAt(5)?"-ms-"+a:"")+a,211===n+i&&105===a.charCodeAt(13)&&0<a.indexOf("transform",10))return a.substring(0,a.indexOf(";",27)+1).replace(p,"$1-webkit-$2")+a}return a}function o(e,t){var n=e.indexOf(1===t?":":"{"),r=e.substring(0,3!==t?n:10);return n=e.substring(n+1,e.length-1),M(2!==t?r:r.replace(C,"$1"),n,t)}function i(e,t){var n=r(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return n!==t+";"?n.replace(w," or ($1)").substring(4):"("+t+")"}function a(e,t,n,r,o,i,a,l,c,s){for(var f,d=0,p=t;d<I;++d)switch(f=A[d].call(u,e,p,n,r,o,i,a,l,c,s)){case void 0:case!1:case!0:case null:break;default:p=f}if(p!==t)return p}function l(e){return void 0!==(e=e.prefix)&&(M=null,e?"function"!==typeof e?j=1:(j=2,M=e):j=0),l}function u(e,n){var l=e;if(33>l.charCodeAt(0)&&(l=l.trim()),l=[l],0<I){var u=a(-1,n,l,l,_,k,0,0,0,0);void 0!==u&&"string"===typeof u&&(n=u)}var f=function e(n,l,u,f,d){for(var p,h,v,b,w,O=0,C=0,x=0,E=0,A=0,M=0,R=v=p=0,N=0,F=0,z=0,L=0,V=u.length,H=V-1,B="",W="",U="",$="";N<V;){if(h=u.charCodeAt(N),N===H&&0!==C+E+x+O&&(0!==C&&(h=47===C?10:47),E=x=O=0,V++,H++),0===C+E+x+O){if(N===H&&(0<F&&(B=B.replace(s,"")),0<B.trim().length)){switch(h){case 32:case 9:case 59:case 13:case 10:break;default:B+=u.charAt(N)}h=59}switch(h){case 123:for(p=(B=B.trim()).charCodeAt(0),v=1,L=++N;N<V;){switch(h=u.charCodeAt(N)){case 123:v++;break;case 125:v--;break;case 47:switch(h=u.charCodeAt(N+1)){case 42:case 47:e:{for(R=N+1;R<H;++R)switch(u.charCodeAt(R)){case 47:if(42===h&&42===u.charCodeAt(R-1)&&N+2!==R){N=R+1;break e}break;case 10:if(47===h){N=R+1;break e}}N=R}}break;case 91:h++;case 40:h++;case 34:case 39:for(;N++<H&&u.charCodeAt(N)!==h;);}if(0===v)break;N++}switch(v=u.substring(L,N),0===p&&(p=(B=B.replace(c,"").trim()).charCodeAt(0)),p){case 64:switch(0<F&&(B=B.replace(s,"")),h=B.charCodeAt(1)){case 100:case 109:case 115:case 45:F=l;break;default:F=P}if(L=(v=e(l,F,v,h,d+1)).length,0<I&&(w=a(3,v,F=t(P,B,z),l,_,k,L,h,d,f),B=F.join(""),void 0!==w&&0===(L=(v=w.trim()).length)&&(h=0,v="")),0<L)switch(h){case 115:B=B.replace(S,i);case 100:case 109:case 45:v=B+"{"+v+"}";break;case 107:v=(B=B.replace(m,"$1 $2"))+"{"+v+"}",v=1===j||2===j&&o("@"+v,3)?"@-webkit-"+v+"@"+v:"@"+v;break;default:v=B+v,112===f&&(W+=v,v="")}else v="";break;default:v=e(l,t(l,B,z),v,f,d+1)}U+=v,v=z=F=R=p=0,B="",h=u.charCodeAt(++N);break;case 125:case 59:if(1<(L=(B=(0<F?B.replace(s,""):B).trim()).length))switch(0===R&&(p=B.charCodeAt(0),45===p||96<p&&123>p)&&(L=(B=B.replace(" ",":")).length),0<I&&void 0!==(w=a(1,B,l,n,_,k,W.length,f,d,f))&&0===(L=(B=w.trim()).length)&&(B="\0\0"),p=B.charCodeAt(0),h=B.charCodeAt(1),p){case 0:break;case 64:if(105===h||99===h){$+=B+u.charAt(N);break}default:58!==B.charCodeAt(L-1)&&(W+=r(B,p,h,B.charCodeAt(2)))}z=F=R=p=0,B="",h=u.charCodeAt(++N)}}switch(h){case 13:case 10:47===C?C=0:0===1+p&&107!==f&&0<B.length&&(F=1,B+="\0"),0<I*D&&a(0,B,l,n,_,k,W.length,f,d,f),k=1,_++;break;case 59:case 125:if(0===C+E+x+O){k++;break}default:switch(k++,b=u.charAt(N),h){case 9:case 32:if(0===E+O+C)switch(A){case 44:case 58:case 9:case 32:b="";break;default:32!==h&&(b=" ")}break;case 0:b="\\0";break;case 12:b="\\f";break;case 11:b="\\v";break;case 38:0===E+C+O&&(F=z=1,b="\f"+b);break;case 108:if(0===E+C+O+T&&0<R)switch(N-R){case 2:112===A&&58===u.charCodeAt(N-3)&&(T=A);case 8:111===M&&(T=M)}break;case 58:0===E+C+O&&(R=N);break;case 44:0===C+x+E+O&&(F=1,b+="\r");break;case 34:case 39:0===C&&(E=E===h?0:0===E?h:E);break;case 91:0===E+C+x&&O++;break;case 93:0===E+C+x&&O--;break;case 41:0===E+C+O&&x--;break;case 40:if(0===E+C+O){if(0===p)switch(2*A+3*M){case 533:break;default:p=1}x++}break;case 64:0===C+x+E+O+R+v&&(v=1);break;case 42:case 47:if(!(0<E+O+x))switch(C){case 0:switch(2*h+3*u.charCodeAt(N+1)){case 235:C=47;break;case 220:L=N,C=42}break;case 42:47===h&&42===A&&L+2!==N&&(33===u.charCodeAt(L+2)&&(W+=u.substring(L,N+1)),b="",C=0)}}0===C&&(B+=b)}M=A,A=h,N++}if(0<(L=W.length)){if(F=l,0<I&&(void 0!==(w=a(2,W,F,n,_,k,L,f,d,f))&&0===(W=w).length))return $+W+U;if(W=F.join(",")+"{"+W+"}",0!==j*T){switch(2!==j||o(W,2)||(T=0),T){case 111:W=W.replace(y,":-moz-$1")+W;break;case 112:W=W.replace(g,"::-webkit-input-$1")+W.replace(g,"::-moz-$1")+W.replace(g,":-ms-input-$1")+W}T=0}}return $+W+U}(P,l,n,0,0);return 0<I&&(void 0!==(u=a(-2,f,l,l,_,k,f.length,0,0,0))&&(f=u)),"",T=0,k=_=1,f}var c=/^\0+/g,s=/[\0\r\f]/g,f=/: */g,d=/zoo|gra/,p=/([,: ])(transform)/g,h=/,\r+?/g,v=/([\t\r\n ])*\f?&/g,m=/@(k\w+)\s*(\S*)\s*/,g=/::(place)/g,y=/:(read-only)/g,b=/[svh]\w+-[tblr]{2}/,S=/\(\s*(.*)\s*\)/g,w=/([\s\S]*?);/g,O=/-self|flex-/g,C=/[^]*?(:[rp][el]a[\w-]+)[^]*/,x=/stretch|:\s*\w+\-(?:conte|avail)/,E=/([^-])(image-set\()/,k=1,_=1,T=0,j=1,P=[],A=[],I=0,M=null,D=0;return u.use=function e(t){switch(t){case void 0:case null:I=A.length=0;break;default:if("function"===typeof t)A[I++]=t;else if("object"===typeof t)for(var n=0,r=t.length;n<r;++n)e(t[n]);else D=0|!!t}return e},u.set=l,void 0!==e&&l(e),u};function s(e){e&&f.current.insert(e+"}")}var f={current:null},d=function(e,t,n,r,o,i,a,l,u,c){switch(e){case 1:switch(t.charCodeAt(0)){case 64:return f.current.insert(t+";"),"";case 108:if(98===t.charCodeAt(2))return""}break;case 2:if(0===l)return t+"/*|*/";break;case 3:switch(l){case 102:case 112:return f.current.insert(n[0]+t),"";default:return t+(0===c?"/*|*/":"")}case-2:t.split("/*|*/}").forEach(s)}},p=function(e){void 0===e&&(e={});var t,n=e.key||"css";void 0!==e.prefix&&(t={prefix:e.prefix});var r=new c(t);var o,i={};o=e.container||document.head;var a,l=document.querySelectorAll("style[data-emotion-"+n+"]");Array.prototype.forEach.call(l,(function(e){e.getAttribute("data-emotion-"+n).split(" ").forEach((function(e){i[e]=!0})),e.parentNode!==o&&o.appendChild(e)})),r.use(e.stylisPlugins)(d),a=function(e,t,n,o){var i=t.name;f.current=n,r(e,t.styles),o&&(s.inserted[i]=!0)};var s={key:n,sheet:new u({key:n,container:o,nonce:e.nonce,speedy:e.speedy}),nonce:e.nonce,inserted:i,registered:{},insert:a};return s};function h(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]):r+=n+" "})),r}var v=function(e,t,n){var r=e.key+"-"+t.name;if(!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles),void 0===e.inserted[t.name]){var o=t;do{e.insert("."+r,o,e.sheet,!0);o=o.next}while(void 0!==o)}};var m=function(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},g={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var y=/[A-Z]|^ms/g,b=/_EMO_([^_]+?)_([^]*?)_EMO_/g,S=function(e){return 45===e.charCodeAt(1)},w=function(e){return null!=e&&"boolean"!==typeof e},O=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}((function(e){return S(e)?e:e.replace(y,"-$&").toLowerCase()})),C=function(e,t){switch(e){case"animation":case"animationName":if("string"===typeof t)return t.replace(b,(function(e,t,n){return E={name:t,styles:n,next:E},t}))}return 1===g[e]||S(e)||"number"!==typeof t||0===t?t:t+"px"};function x(e,t,n,r){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return E={name:n.name,styles:n.styles,next:E},n.name;if(void 0!==n.styles){var o=n.next;if(void 0!==o)for(;void 0!==o;)E={name:o.name,styles:o.styles,next:E},o=o.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=x(e,t,n[o],!1);else for(var i in n){var a=n[i];if("object"!==typeof a)null!=t&&void 0!==t[a]?r+=i+"{"+t[a]+"}":w(a)&&(r+=O(i)+":"+C(i,a)+";");else if(!Array.isArray(a)||"string"!==typeof a[0]||null!=t&&void 0!==t[a[0]]){var l=x(e,t,a,!1);switch(i){case"animation":case"animationName":r+=O(i)+":"+l+";";break;default:r+=i+"{"+l+"}"}}else for(var u=0;u<a.length;u++)w(a[u])&&(r+=O(i)+":"+C(i,a[u])+";")}return r}(e,t,n);case"function":if(void 0!==e){var i=E,a=n(e);return E=i,x(e,t,a,r)}break;case"string":}if(null==t)return n;var l=t[n];return void 0===l||r?n:l}var E,k=/label:\s*([^\s;\n{]+)\s*;/g;var _=function(e,t,n){if(1===e.length&&"object"===typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,o="";E=void 0;var i=e[0];null==i||void 0===i.raw?(r=!1,o+=x(n,t,i,!1)):o+=i[0];for(var a=1;a<e.length;a++)o+=x(n,t,e[a],46===o.charCodeAt(o.length-1)),r&&(o+=i[a]);k.lastIndex=0;for(var l,u="";null!==(l=k.exec(o));)u+="-"+l[1];return{name:m(o)+u,styles:o,next:E}};var T=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return _(t)},j=Object(r.createContext)("undefined"!==typeof HTMLElement?p():null),P=Object(r.createContext)({}),A=j.Provider,I=function(e){return Object(r.forwardRef)((function(t,n){return Object(r.createElement)(j.Consumer,null,(function(r){return e(t,r,n)}))}))},M="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",D=Object.prototype.hasOwnProperty,R=function(e,t,n,o){var i=null===n?t.css:t.css(n);"string"===typeof i&&void 0!==e.registered[i]&&(i=e.registered[i]);var a=t[M],l=[i],u="";"string"===typeof t.className?u=h(e.registered,l,t.className):null!=t.className&&(u=t.className+" ");var c=_(l);v(e,c,"string"===typeof a);u+=e.key+"-"+c.name;var s={};for(var f in t)D.call(t,f)&&"css"!==f&&f!==M&&(s[f]=t[f]);return s.ref=o,s.className=u,Object(r.createElement)(a,s)},N=I((function(e,t,n){return"function"===typeof e.css?Object(r.createElement)(P.Consumer,null,(function(r){return R(t,e,r,n)})):R(t,e,null,n)}));var F=function(e,t){var n=arguments;if(null==t||!D.call(t,"css"))return r.createElement.apply(void 0,n);var o=n.length,i=new Array(o);i[0]=N;var a={};for(var l in t)D.call(t,l)&&(a[l]=t[l]);a[M]=e,i[1]=a;for(var u=2;u<o;u++)i[u]=n[u];return r.createElement.apply(null,i)},z=(r.Component,function e(t){for(var n=t.length,r=0,o="";r<n;r++){var i=t[r];if(null!=i){var a=void 0;switch(typeof i){case"boolean":break;case"object":if(Array.isArray(i))a=e(i);else for(var l in a="",i)i[l]&&l&&(a&&(a+=" "),a+=l);break;default:a=i}a&&(o&&(o+=" "),o+=a)}}return o});function L(e,t,n){var r=[],o=h(e,r,n);return r.length<2?n:o+t(r)}var V=I((function(e,t){return Object(r.createElement)(P.Consumer,null,(function(n){var r=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var o=_(n,t.registered);return v(t,o,!1),t.key+"-"+o.name},o={css:r,cx:function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return L(t.registered,r,z(n))},theme:n},i=e.children(o);return!0,i}))})),H=n(10),B=n(3),W=n.n(B),U=function(){};function $(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function K(e,t,n){var r=[n];if(t&&e)for(var o in t)t.hasOwnProperty(o)&&t[o]&&r.push(""+$(e,o));return r.filter((function(e){return e})).map((function(e){return String(e).trim()})).join(" ")}var q=function(e){return Array.isArray(e)?e.filter(Boolean):"object"===typeof e&&null!==e?[e]:[]};function G(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function Y(e){return G(e)?window.pageYOffset:e.scrollTop}function X(e,t){G(e)?window.scrollTo(0,t):e.scrollTop=t}function Q(e,t,n,r){void 0===n&&(n=200),void 0===r&&(r=U);var o=Y(e),i=t-o,a=0;!function t(){var l,u=i*((l=(l=a+=10)/n-1)*l*l+1)+o;X(e,u),a<n?window.requestAnimationFrame(t):r(e)}()}function Z(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}var J=n(112),ee=n.n(J);function te(){return(te=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ne(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function re(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,o=e.placement,i=e.shouldScroll,a=e.isFixedPosition,l=e.theme.spacing,u=function(e){var t=getComputedStyle(e),n="absolute"===t.position,r=/(auto|scroll)/,o=document.documentElement;if("fixed"===t.position)return o;for(var i=e;i=i.parentElement;)if(t=getComputedStyle(i),(!n||"static"!==t.position)&&r.test(t.overflow+t.overflowY+t.overflowX))return i;return o}(n),c={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return c;var s=u.getBoundingClientRect().height,f=n.getBoundingClientRect(),d=f.bottom,p=f.height,h=f.top,v=n.offsetParent.getBoundingClientRect().top,m=window.innerHeight,g=Y(u),y=parseInt(getComputedStyle(n).marginBottom,10),b=parseInt(getComputedStyle(n).marginTop,10),S=v-b,w=m-h,O=S+g,C=s-g-h,x=d-m+g+y,E=g+h-b;switch(o){case"auto":case"bottom":if(w>=p)return{placement:"bottom",maxHeight:t};if(C>=p&&!a)return i&&Q(u,x,160),{placement:"bottom",maxHeight:t};if(!a&&C>=r||a&&w>=r)return i&&Q(u,x,160),{placement:"bottom",maxHeight:a?w-y:C-y};if("auto"===o||a){var k=t,_=a?S:O;return _>=r&&(k=Math.min(_-y-l.controlHeight,t)),{placement:"top",maxHeight:k}}if("bottom"===o)return X(u,x),{placement:"bottom",maxHeight:t};break;case"top":if(S>=p)return{placement:"top",maxHeight:t};if(O>=p&&!a)return i&&Q(u,E,160),{placement:"top",maxHeight:t};if(!a&&O>=r||a&&S>=r){var T=t;return(!a&&O>=r||a&&S>=r)&&(T=a?S-b:O-b),i&&Q(u,E,160),{placement:"top",maxHeight:T}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'+o+'".')}return c}var oe=function(e){return"auto"===e?"bottom":e},ie=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).state={maxHeight:t.props.maxMenuHeight,placement:null},t.getPlacement=function(e){var n=t.props,r=n.minMenuHeight,o=n.maxMenuHeight,i=n.menuPlacement,a=n.menuPosition,l=n.menuShouldScrollIntoView,u=n.theme,c=t.context.getPortalPlacement;if(e){var s="fixed"===a,f=re({maxHeight:o,menuEl:e,minHeight:r,placement:i,shouldScroll:l&&!s,isFixedPosition:s,theme:u});c&&c(f),t.setState(f)}},t.getUpdatedProps=function(){var e=t.props.menuPlacement,n=t.state.placement||oe(e);return te({},t.props,{placement:n,maxHeight:t.state.maxHeight})},t}return ne(t,e),t.prototype.render=function(){return(0,this.props.children)({ref:this.getPlacement,placerProps:this.getUpdatedProps()})},t}(r.Component);ie.contextTypes={getPortalPlacement:W.a.func};var ae=function(e){var t=e.theme,n=t.spacing.baseUnit;return{color:t.colors.neutral40,padding:2*n+"px "+3*n+"px",textAlign:"center"}},le=ae,ue=ae,ce=function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerProps;return F("div",te({css:o("noOptionsMessage",e),className:r({"menu-notice":!0,"menu-notice--no-options":!0},n)},i),t)};ce.defaultProps={children:"No options"};var se=function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerProps;return F("div",te({css:o("loadingMessage",e),className:r({"menu-notice":!0,"menu-notice--loading":!0},n)},i),t)};se.defaultProps={children:"Loading..."};var fe=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).state={placement:null},t.getPortalPlacement=function(e){var n=e.placement;n!==oe(t.props.menuPlacement)&&t.setState({placement:n})},t}ne(t,e);var n=t.prototype;return n.getChildContext=function(){return{getPortalPlacement:this.getPortalPlacement}},n.render=function(){var e=this.props,t=e.appendTo,n=e.children,r=e.controlElement,o=e.menuPlacement,i=e.menuPosition,a=e.getStyles,l="fixed"===i;if(!t&&!l||!r)return null;var u=this.state.placement||oe(o),c=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}(r),s=l?0:window.pageYOffset,f=c[u]+s,d=F("div",{css:a("menuPortal",{offset:f,position:i,rect:c})},n);return t?Object(H.createPortal)(d,t):d},t}(r.Component);fe.childContextTypes={getPortalPlacement:W.a.func};var de=Array.isArray,pe=Object.keys,he=Object.prototype.hasOwnProperty;function ve(e,t){try{return function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){var r,o,i,a=de(t),l=de(n);if(a&&l){if((o=t.length)!=n.length)return!1;for(r=o;0!==r--;)if(!e(t[r],n[r]))return!1;return!0}if(a!=l)return!1;var u=t instanceof Date,c=n instanceof Date;if(u!=c)return!1;if(u&&c)return t.getTime()==n.getTime();var s=t instanceof RegExp,f=n instanceof RegExp;if(s!=f)return!1;if(s&&f)return t.toString()==n.toString();var d=pe(t);if((o=d.length)!==pe(n).length)return!1;for(r=o;0!==r--;)if(!he.call(n,d[r]))return!1;for(r=o;0!==r--;)if(("_owner"!==(i=d[r])||!t.$$typeof)&&!e(t[i],n[i]))return!1;return!0}return t!==t&&n!==n}(e,t)}catch(n){if(n.message&&n.message.match(/stack|recursion/i))return console.warn("Warning: react-fast-compare does not handle circular references.",n.name,n.message),!1;throw n}}function me(){return(me=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ge(){var e=function(e,t){t||(t=e.slice(0));return e.raw=t,e}(["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"]);return ge=function(){return e},e}function ye(){return(ye=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var be={name:"19bqh2r",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0;"},Se=function(e){var t=e.size,n=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,["size"]);return F("svg",ye({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:be},n))},we=function(e){return F(Se,ye({size:20},e),F("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},Oe=function(e){return F(Se,ye({size:20},e),F("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},Ce=function(e){var t=e.isFocused,n=e.theme,r=n.spacing.baseUnit,o=n.colors;return{label:"indicatorContainer",color:t?o.neutral60:o.neutral20,display:"flex",padding:2*r,transition:"color 150ms",":hover":{color:t?o.neutral80:o.neutral40}}},xe=Ce,Ee=Ce,ke=function(){var e=T.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}(ge()),_e=function(e){var t=e.delay,n=e.offset;return F("span",{css:T({animation:ke+" 1s ease-in-out "+t+"ms infinite;",backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":null,height:"1em",verticalAlign:"top",width:"1em"},"")})},Te=function(e){var t=e.className,n=e.cx,r=e.getStyles,o=e.innerProps,i=e.isRtl;return F("div",ye({},o,{css:r("loadingIndicator",e),className:n({indicator:!0,"loading-indicator":!0},t)}),F(_e,{delay:0,offset:i}),F(_e,{delay:160,offset:!0}),F(_e,{delay:320,offset:!i}))};function je(){return(je=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}Te.defaultProps={size:4};function Pe(){return(Pe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ae(){return(Ae=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Ie=function(e){return{label:"input",background:0,border:0,fontSize:"inherit",opacity:e?0:1,outline:0,padding:0,color:"inherit"}};function Me(){return(Me=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var De=function(e){var t=e.children,n=e.innerProps;return F("div",n,t)},Re=De,Ne=De;var Fe=function(e){var t=e.children,n=e.className,r=e.components,o=e.cx,i=e.data,a=e.getStyles,l=e.innerProps,u=e.isDisabled,c=e.removeProps,s=e.selectProps,f=r.Container,d=r.Label,p=r.Remove;return F(V,null,(function(r){var h=r.css,v=r.cx;return F(f,{data:i,innerProps:Me({},l,{className:v(h(a("multiValue",e)),o({"multi-value":!0,"multi-value--is-disabled":u},n))}),selectProps:s},F(d,{data:i,innerProps:{className:v(h(a("multiValueLabel",e)),o({"multi-value__label":!0},n))},selectProps:s},t),F(p,{data:i,innerProps:Me({className:v(h(a("multiValueRemove",e)),o({"multi-value__remove":!0},n))},c),selectProps:s}))}))};function ze(){return(ze=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}Fe.defaultProps={cropWithEllipsis:!0};function Le(){return(Le=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ve(){return(Ve=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function He(){return(He=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Be={ClearIndicator:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerProps;return F("div",ye({},i,{css:o("clearIndicator",e),className:r({indicator:!0,"clear-indicator":!0},n)}),t||F(we,null))},Control:function(e){var t=e.children,n=e.cx,r=e.getStyles,o=e.className,i=e.isDisabled,a=e.isFocused,l=e.innerRef,u=e.innerProps,c=e.menuIsOpen;return F("div",je({ref:l,css:r("control",e),className:n({control:!0,"control--is-disabled":i,"control--is-focused":a,"control--menu-is-open":c},o)},u),t)},DropdownIndicator:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerProps;return F("div",ye({},i,{css:o("dropdownIndicator",e),className:r({indicator:!0,"dropdown-indicator":!0},n)}),t||F(Oe,null))},DownChevron:Oe,CrossIcon:we,Group:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.Heading,a=e.headingProps,l=e.label,u=e.theme,c=e.selectProps;return F("div",{css:o("group",e),className:r({group:!0},n)},F(i,Pe({},a,{selectProps:c,theme:u,getStyles:o,cx:r}),l),F("div",null,t))},GroupHeading:function(e){var t=e.className,n=e.cx,r=e.getStyles,o=e.theme,i=(e.selectProps,function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,["className","cx","getStyles","theme","selectProps"]));return F("div",Pe({css:r("groupHeading",Pe({theme:o},i)),className:n({"group-heading":!0},t)},i))},IndicatorsContainer:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles;return F("div",{css:o("indicatorsContainer",e),className:r({indicators:!0},n)},t)},IndicatorSeparator:function(e){var t=e.className,n=e.cx,r=e.getStyles,o=e.innerProps;return F("span",ye({},o,{css:r("indicatorSeparator",e),className:n({"indicator-separator":!0},t)}))},Input:function(e){var t=e.className,n=e.cx,r=e.getStyles,o=e.innerRef,i=e.isHidden,a=e.isDisabled,l=e.theme,u=(e.selectProps,function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,["className","cx","getStyles","innerRef","isHidden","isDisabled","theme","selectProps"]));return F("div",{css:r("input",Ae({theme:l},u))},F(ee.a,Ae({className:n({input:!0},t),inputRef:o,inputStyle:Ie(i),disabled:a},u)))},LoadingIndicator:Te,Menu:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerRef,a=e.innerProps;return F("div",te({css:o("menu",e),className:r({menu:!0},n)},a,{ref:i}),t)},MenuList:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.isMulti,a=e.innerRef;return F("div",{css:o("menuList",e),className:r({"menu-list":!0,"menu-list--is-multi":i},n),ref:a},t)},MenuPortal:fe,LoadingMessage:se,NoOptionsMessage:ce,MultiValue:Fe,MultiValueContainer:Re,MultiValueLabel:Ne,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return F("div",n,t||F(we,{size:14}))},Option:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.isDisabled,a=e.isFocused,l=e.isSelected,u=e.innerRef,c=e.innerProps;return F("div",ze({css:o("option",e),className:r({option:!0,"option--is-disabled":i,"option--is-focused":a,"option--is-selected":l},n),ref:u},c),t)},Placeholder:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerProps;return F("div",Le({css:o("placeholder",e),className:r({placeholder:!0},n)},i),t)},SelectContainer:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerProps,a=e.isDisabled,l=e.isRtl;return F("div",me({css:o("container",e),className:r({"--is-disabled":a,"--is-rtl":l},n)},i),t)},SingleValue:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.isDisabled,a=e.innerProps;return F("div",Ve({css:o("singleValue",e),className:r({"single-value":!0,"single-value--is-disabled":i},n)},a),t)},ValueContainer:function(e){var t=e.children,n=e.className,r=e.cx,o=e.isMulti,i=e.getStyles,a=e.hasValue;return F("div",{css:i("valueContainer",e),className:r({"value-container":!0,"value-container--is-multi":o,"value-container--has-value":a},n)},t)}},We=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}],Ue=function(e){for(var t=0;t<We.length;t++)e=e.replace(We[t].letters,We[t].base);return e};function $e(){return($e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Ke=function(e){return e.replace(/^\s+|\s+$/g,"")},qe=function(e){return e.label+" "+e.value};function Ge(){return(Ge=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Ye={name:"1laao21-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap;"},Xe=function(e){return F("span",Ge({css:Ye},e))};function Qe(){return(Qe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ze(e){e.in,e.out,e.onExited,e.appear,e.enter,e.exit;var t=e.innerRef,n=(e.emotion,function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,["in","out","onExited","appear","enter","exit","innerRef","emotion"]));return F("input",Qe({ref:t},n,{css:T({label:"dummyInput",background:0,border:0,fontSize:"inherit",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(0)"},"")}))}var Je=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var o=r.prototype;return o.componentDidMount=function(){this.props.innerRef(Object(H.findDOMNode)(this))},o.componentWillUnmount=function(){this.props.innerRef(null)},o.render=function(){return this.props.children},r}(r.Component),et=["boxSizing","height","overflow","paddingRight","position"],tt={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function nt(e){e.preventDefault()}function rt(e){e.stopPropagation()}function ot(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;0===e?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function it(){return"ontouchstart"in window||navigator.maxTouchPoints}var at=!(!window.document||!window.document.createElement),lt=0,ut=function(e){var t,n;function r(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).originalStyles={},t.listenerOptions={capture:!1,passive:!1},t}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var o=r.prototype;return o.componentDidMount=function(){var e=this;if(at){var t=this.props,n=t.accountForScrollbars,r=t.touchScrollTarget,o=document.body,i=o&&o.style;if(n&&et.forEach((function(t){var n=i&&i[t];e.originalStyles[t]=n})),n&<<1){var a=parseInt(this.originalStyles.paddingRight,10)||0,l=document.body?document.body.clientWidth:0,u=window.innerWidth-l+a||0;Object.keys(tt).forEach((function(e){var t=tt[e];i&&(i[e]=t)})),i&&(i.paddingRight=u+"px")}o&&it()&&(o.addEventListener("touchmove",nt,this.listenerOptions),r&&(r.addEventListener("touchstart",ot,this.listenerOptions),r.addEventListener("touchmove",rt,this.listenerOptions))),lt+=1}},o.componentWillUnmount=function(){var e=this;if(at){var t=this.props,n=t.accountForScrollbars,r=t.touchScrollTarget,o=document.body,i=o&&o.style;lt=Math.max(lt-1,0),n&<<1&&et.forEach((function(t){var n=e.originalStyles[t];i&&(i[t]=n)})),o&&it()&&(o.removeEventListener("touchmove",nt,this.listenerOptions),r&&(r.removeEventListener("touchstart",ot,this.listenerOptions),r.removeEventListener("touchmove",rt,this.listenerOptions)))}},o.render=function(){return null},r}(r.Component);ut.defaultProps={accountForScrollbars:!0};var ct={name:"1dsbpcp",styles:"position:fixed;left:0;bottom:0;right:0;top:0;"},st=function(e){var t,n;function r(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).state={touchScrollTarget:null},t.getScrollTarget=function(e){e!==t.state.touchScrollTarget&&t.setState({touchScrollTarget:e})},t.blurSelectInput=function(){document.activeElement&&document.activeElement.blur()},t}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,r.prototype.render=function(){var e=this.props,t=e.children,n=e.isEnabled,r=this.state.touchScrollTarget;return n?F("div",null,F("div",{onClick:this.blurSelectInput,css:ct}),F(Je,{innerRef:this.getScrollTarget},t),r?F(ut,{touchScrollTarget:r}):null):t},r}(r.PureComponent);var ft=function(e){var t,n;function r(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).isBottom=!1,t.isTop=!1,t.scrollTarget=void 0,t.touchStart=void 0,t.cancelScroll=function(e){e.preventDefault(),e.stopPropagation()},t.handleEventDelta=function(e,n){var r=t.props,o=r.onBottomArrive,i=r.onBottomLeave,a=r.onTopArrive,l=r.onTopLeave,u=t.scrollTarget,c=u.scrollTop,s=u.scrollHeight,f=u.clientHeight,d=t.scrollTarget,p=n>0,h=s-f-c,v=!1;h>n&&t.isBottom&&(i&&i(e),t.isBottom=!1),p&&t.isTop&&(l&&l(e),t.isTop=!1),p&&n>h?(o&&!t.isBottom&&o(e),d.scrollTop=s,v=!0,t.isBottom=!0):!p&&-n>c&&(a&&!t.isTop&&a(e),d.scrollTop=0,v=!0,t.isTop=!0),v&&t.cancelScroll(e)},t.onWheel=function(e){t.handleEventDelta(e,e.deltaY)},t.onTouchStart=function(e){t.touchStart=e.changedTouches[0].clientY},t.onTouchMove=function(e){var n=t.touchStart-e.changedTouches[0].clientY;t.handleEventDelta(e,n)},t.getScrollTarget=function(e){t.scrollTarget=e},t}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var i=r.prototype;return i.componentDidMount=function(){this.startListening(this.scrollTarget)},i.componentWillUnmount=function(){this.stopListening(this.scrollTarget)},i.startListening=function(e){e&&("function"===typeof e.addEventListener&&e.addEventListener("wheel",this.onWheel,!1),"function"===typeof e.addEventListener&&e.addEventListener("touchstart",this.onTouchStart,!1),"function"===typeof e.addEventListener&&e.addEventListener("touchmove",this.onTouchMove,!1))},i.stopListening=function(e){"function"===typeof e.removeEventListener&&e.removeEventListener("wheel",this.onWheel,!1),"function"===typeof e.removeEventListener&&e.removeEventListener("touchstart",this.onTouchStart,!1),"function"===typeof e.removeEventListener&&e.removeEventListener("touchmove",this.onTouchMove,!1)},i.render=function(){return o.a.createElement(Je,{innerRef:this.getScrollTarget},this.props.children)},r}(r.Component);function dt(e){var t=e.isEnabled,n=void 0===t||t,r=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,["isEnabled"]);return n?o.a.createElement(ft,r):r.children}var pt=function(e,t){void 0===t&&(t={});var n=t,r=n.isSearchable,o=n.isMulti,i=n.label,a=n.isDisabled;switch(e){case"menu":return"Use Up and Down to choose options"+(a?"":", press Enter to select the currently focused option")+", press Escape to exit the menu, press Tab to select the option and exit the menu.";case"input":return(i||"Select")+" is focused "+(r?",type to refine list":"")+", press Down to open the menu, "+(o?" press left to focus selected values":"");case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value"}},ht=function(e,t){var n=t.value,r=t.isDisabled;if(n)switch(e){case"deselect-option":case"pop-value":case"remove-value":return"option "+n+", deselected.";case"select-option":return r?"option "+n+" is disabled. Select another option.":"option "+n+", selected."}},vt=function(e){return!!e.isDisabled};var mt={clearIndicator:Ee,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":null,pointerEvents:t?"none":null,position:"relative"}},control:function(e){var t=e.isDisabled,n=e.isFocused,r=e.theme,o=r.colors,i=r.borderRadius,a=r.spacing;return{label:"control",alignItems:"center",backgroundColor:t?o.neutral5:o.neutral0,borderColor:t?o.neutral10:n?o.primary:o.neutral20,borderRadius:i,borderStyle:"solid",borderWidth:1,boxShadow:n?"0 0 0 1px "+o.primary:null,cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:a.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms","&:hover":{borderColor:n?o.primary:o.neutral30}}},dropdownIndicator:xe,group:function(e){var t=e.theme.spacing;return{paddingBottom:2*t.baseUnit,paddingTop:2*t.baseUnit}},groupHeading:function(e){var t=e.theme.spacing;return{label:"group",color:"#999",cursor:"default",display:"block",fontSize:"75%",fontWeight:"500",marginBottom:"0.25em",paddingLeft:3*t.baseUnit,paddingRight:3*t.baseUnit,textTransform:"uppercase"}},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing.baseUnit,o=n.colors;return{label:"indicatorSeparator",alignSelf:"stretch",backgroundColor:t?o.neutral10:o.neutral20,marginBottom:2*r,marginTop:2*r,width:1}},input:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing,o=n.colors;return{margin:r.baseUnit/2,paddingBottom:r.baseUnit/2,paddingTop:r.baseUnit/2,visibility:t?"hidden":"visible",color:o.neutral80}},loadingIndicator:function(e){var t=e.isFocused,n=e.size,r=e.theme,o=r.colors,i=r.spacing.baseUnit;return{label:"loadingIndicator",color:t?o.neutral60:o.neutral20,display:"flex",padding:2*i,transition:"color 150ms",alignSelf:"center",fontSize:n,lineHeight:1,marginRight:n,textAlign:"center",verticalAlign:"middle"}},loadingMessage:ue,menu:function(e){var t,n=e.placement,r=e.theme,o=r.borderRadius,i=r.spacing,a=r.colors;return(t={label:"menu"})[function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(n)]="100%",t.backgroundColor=a.neutral0,t.borderRadius=o,t.boxShadow="0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",t.marginBottom=i.menuGutter,t.marginTop=i.menuGutter,t.position="absolute",t.width="100%",t.zIndex=1,t},menuList:function(e){var t=e.maxHeight,n=e.theme.spacing.baseUnit;return{maxHeight:t,overflowY:"auto",paddingBottom:n,paddingTop:n,position:"relative",WebkitOverflowScrolling:"touch"}},menuPortal:function(e){var t=e.rect,n=e.offset,r=e.position;return{left:t.left,position:r,top:n,width:t.width,zIndex:1}},multiValue:function(e){var t=e.theme,n=t.spacing,r=t.borderRadius;return{label:"multiValue",backgroundColor:t.colors.neutral10,borderRadius:r/2,display:"flex",margin:n.baseUnit/2,minWidth:0}},multiValueLabel:function(e){var t=e.theme,n=t.borderRadius,r=t.colors,o=e.cropWithEllipsis;return{borderRadius:n/2,color:r.neutral80,fontSize:"85%",overflow:"hidden",padding:3,paddingLeft:6,textOverflow:o?"ellipsis":null,whiteSpace:"nowrap"}},multiValueRemove:function(e){var t=e.theme,n=t.spacing,r=t.borderRadius,o=t.colors;return{alignItems:"center",borderRadius:r/2,backgroundColor:e.isFocused&&o.dangerLight,display:"flex",paddingLeft:n.baseUnit,paddingRight:n.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}}},noOptionsMessage:le,option:function(e){var t=e.isDisabled,n=e.isFocused,r=e.isSelected,o=e.theme,i=o.spacing,a=o.colors;return{label:"option",backgroundColor:r?a.primary:n?a.primary25:"transparent",color:t?a.neutral20:r?a.neutral0:"inherit",cursor:"default",display:"block",fontSize:"inherit",padding:2*i.baseUnit+"px "+3*i.baseUnit+"px",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",":active":{backgroundColor:!t&&(r?a.primary:a.primary50)}}},placeholder:function(e){var t=e.theme,n=t.spacing;return{label:"placeholder",color:t.colors.neutral50,marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2,position:"absolute",top:"50%",transform:"translateY(-50%)"}},singleValue:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing,o=n.colors;return{label:"singleValue",color:t?o.neutral40:o.neutral80,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2,maxWidth:"calc(100% - "+2*r.baseUnit+"px)",overflow:"hidden",position:"absolute",textOverflow:"ellipsis",whiteSpace:"nowrap",top:"50%",transform:"translateY(-50%)"}},valueContainer:function(e){var t=e.theme.spacing;return{alignItems:"center",display:"flex",flex:1,flexWrap:"wrap",padding:t.baseUnit/2+"px "+2*t.baseUnit+"px",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"}}};var gt={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}};function yt(){return(yt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function bt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var St,wt={backspaceRemovesValue:!0,blurInputOnSelect:Z(),captureMenuScroll:!Z(),closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){var n=$e({ignoreCase:!0,ignoreAccents:!0,stringify:qe,trim:!0,matchFrom:"any"},St),r=n.ignoreCase,o=n.ignoreAccents,i=n.stringify,a=n.trim,l=n.matchFrom,u=a?Ke(t):t,c=a?Ke(i(e)):i(e);return r&&(u=u.toLowerCase(),c=c.toLowerCase()),o&&(u=Ue(u),c=Ue(c)),"start"===l?c.substr(0,u.length)===u:c.indexOf(u)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:vt,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return t+" result"+(1!==t?"s":"")+" available"},styles:{},tabIndex:"0",tabSelectsValue:!0},Ot=1,Ct=function(e){var t,n;function r(t){var n;(n=e.call(this,t)||this).state={ariaLiveSelection:"",ariaLiveContext:"",focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,menuOptions:{render:[],focusable:[]},selectValue:[]},n.blockOptionHover=!1,n.isComposing=!1,n.clearFocusValueOnUpdate=!1,n.commonProps=void 0,n.components=void 0,n.hasGroups=!1,n.initialTouchX=0,n.initialTouchY=0,n.inputIsHiddenAfterUpdate=void 0,n.instancePrefix="",n.openAfterFocus=!1,n.scrollToFocusedOptionOnUpdate=!1,n.userIsDragging=void 0,n.controlRef=null,n.getControlRef=function(e){n.controlRef=e},n.focusedOptionRef=null,n.getFocusedOptionRef=function(e){n.focusedOptionRef=e},n.menuListRef=null,n.getMenuListRef=function(e){n.menuListRef=e},n.inputRef=null,n.getInputRef=function(e){n.inputRef=e},n.cacheComponents=function(e){n.components=He({},Be,{components:e}.components)},n.focus=n.focusInput,n.blur=n.blurInput,n.onChange=function(e,t){var r=n.props;(0,r.onChange)(e,yt({},t,{name:r.name}))},n.setValue=function(e,t,r){void 0===t&&(t="set-value");var o=n.props,i=o.closeMenuOnSelect,a=o.isMulti;n.onInputChange("",{action:"set-value"}),i&&(n.inputIsHiddenAfterUpdate=!a,n.onMenuClose()),n.clearFocusValueOnUpdate=!0,n.onChange(e,{action:t,option:r})},n.selectOption=function(e){var t=n.props,r=t.blurInputOnSelect,o=t.isMulti,i=n.state.selectValue;if(o)if(n.isOptionSelected(e,i)){var a=n.getOptionValue(e);n.setValue(i.filter((function(e){return n.getOptionValue(e)!==a})),"deselect-option",e),n.announceAriaLiveSelection({event:"deselect-option",context:{value:n.getOptionLabel(e)}})}else n.isOptionDisabled(e,i)?n.announceAriaLiveSelection({event:"select-option",context:{value:n.getOptionLabel(e),isDisabled:!0}}):(n.setValue([].concat(i,[e]),"select-option",e),n.announceAriaLiveSelection({event:"select-option",context:{value:n.getOptionLabel(e)}}));else n.isOptionDisabled(e,i)?n.announceAriaLiveSelection({event:"select-option",context:{value:n.getOptionLabel(e),isDisabled:!0}}):(n.setValue(e,"select-option"),n.announceAriaLiveSelection({event:"select-option",context:{value:n.getOptionLabel(e)}}));r&&n.blurInput()},n.removeValue=function(e){var t=n.state.selectValue,r=n.getOptionValue(e),o=t.filter((function(e){return n.getOptionValue(e)!==r}));n.onChange(o.length?o:null,{action:"remove-value",removedValue:e}),n.announceAriaLiveSelection({event:"remove-value",context:{value:e?n.getOptionLabel(e):""}}),n.focusInput()},n.clearValue=function(){var e=n.props.isMulti;n.onChange(e?[]:null,{action:"clear"})},n.popValue=function(){var e=n.state.selectValue,t=e[e.length-1],r=e.slice(0,e.length-1);n.announceAriaLiveSelection({event:"pop-value",context:{value:t?n.getOptionLabel(t):""}}),n.onChange(r.length?r:null,{action:"pop-value",removedValue:t})},n.getOptionLabel=function(e){return n.props.getOptionLabel(e)},n.getOptionValue=function(e){return n.props.getOptionValue(e)},n.getStyles=function(e,t){var r=mt[e](t);r.boxSizing="border-box";var o=n.props.styles[e];return o?o(r,t):r},n.getElementId=function(e){return n.instancePrefix+"-"+e},n.getActiveDescendentId=function(){var e=n.props.menuIsOpen,t=n.state,r=t.menuOptions,o=t.focusedOption;if(o&&e){var i=r.focusable.indexOf(o),a=r.render[i];return a&&a.key}},n.announceAriaLiveSelection=function(e){var t=e.event,r=e.context;n.setState({ariaLiveSelection:ht(t,r)})},n.announceAriaLiveContext=function(e){var t=e.event,r=e.context;n.setState({ariaLiveContext:pt(t,yt({},r,{label:n.props["aria-label"]}))})},n.onMenuMouseDown=function(e){0===e.button&&(e.stopPropagation(),e.preventDefault(),n.focusInput())},n.onMenuMouseMove=function(e){n.blockOptionHover=!1},n.onControlMouseDown=function(e){var t=n.props.openMenuOnClick;n.state.isFocused?n.props.menuIsOpen?"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&n.onMenuClose():t&&n.openMenu("first"):(t&&(n.openAfterFocus=!0),n.focusInput()),"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&e.preventDefault()},n.onDropdownIndicatorMouseDown=function(e){if((!e||"mousedown"!==e.type||0===e.button)&&!n.props.isDisabled){var t=n.props,r=t.isMulti,o=t.menuIsOpen;n.focusInput(),o?(n.inputIsHiddenAfterUpdate=!r,n.onMenuClose()):n.openMenu("first"),e.preventDefault(),e.stopPropagation()}},n.onClearIndicatorMouseDown=function(e){e&&"mousedown"===e.type&&0!==e.button||(n.clearValue(),e.stopPropagation(),n.openAfterFocus=!1,"touchend"===e.type?n.focusInput():setTimeout((function(){return n.focusInput()})))},n.onScroll=function(e){"boolean"===typeof n.props.closeMenuOnScroll?e.target instanceof HTMLElement&&G(e.target)&&n.props.onMenuClose():"function"===typeof n.props.closeMenuOnScroll&&n.props.closeMenuOnScroll(e)&&n.props.onMenuClose()},n.onCompositionStart=function(){n.isComposing=!0},n.onCompositionEnd=function(){n.isComposing=!1},n.onTouchStart=function(e){var t=e.touches.item(0);t&&(n.initialTouchX=t.clientX,n.initialTouchY=t.clientY,n.userIsDragging=!1)},n.onTouchMove=function(e){var t=e.touches.item(0);if(t){var r=Math.abs(t.clientX-n.initialTouchX),o=Math.abs(t.clientY-n.initialTouchY);n.userIsDragging=r>5||o>5}},n.onTouchEnd=function(e){n.userIsDragging||(n.controlRef&&!n.controlRef.contains(e.target)&&n.menuListRef&&!n.menuListRef.contains(e.target)&&n.blurInput(),n.initialTouchX=0,n.initialTouchY=0)},n.onControlTouchEnd=function(e){n.userIsDragging||n.onControlMouseDown(e)},n.onClearIndicatorTouchEnd=function(e){n.userIsDragging||n.onClearIndicatorMouseDown(e)},n.onDropdownIndicatorTouchEnd=function(e){n.userIsDragging||n.onDropdownIndicatorMouseDown(e)},n.handleInputChange=function(e){var t=e.currentTarget.value;n.inputIsHiddenAfterUpdate=!1,n.onInputChange(t,{action:"input-change"}),n.onMenuOpen()},n.onInputFocus=function(e){var t=n.props,r=t.isSearchable,o=t.isMulti;n.props.onFocus&&n.props.onFocus(e),n.inputIsHiddenAfterUpdate=!1,n.announceAriaLiveContext({event:"input",context:{isSearchable:r,isMulti:o}}),n.setState({isFocused:!0}),(n.openAfterFocus||n.props.openMenuOnFocus)&&n.openMenu("first"),n.openAfterFocus=!1},n.onInputBlur=function(e){n.menuListRef&&n.menuListRef.contains(document.activeElement)?n.inputRef.focus():(n.props.onBlur&&n.props.onBlur(e),n.onInputChange("",{action:"input-blur"}),n.onMenuClose(),n.setState({focusedValue:null,isFocused:!1}))},n.onOptionHover=function(e){n.blockOptionHover||n.state.focusedOption===e||n.setState({focusedOption:e})},n.shouldHideSelectedOptions=function(){var e=n.props,t=e.hideSelectedOptions,r=e.isMulti;return void 0===t?r:t},n.onKeyDown=function(e){var t=n.props,r=t.isMulti,o=t.backspaceRemovesValue,i=t.escapeClearsValue,a=t.inputValue,l=t.isClearable,u=t.isDisabled,c=t.menuIsOpen,s=t.onKeyDown,f=t.tabSelectsValue,d=t.openMenuOnFocus,p=n.state,h=p.focusedOption,v=p.focusedValue,m=p.selectValue;if(!u&&("function"!==typeof s||(s(e),!e.defaultPrevented))){switch(n.blockOptionHover=!0,e.key){case"ArrowLeft":if(!r||a)return;n.focusValue("previous");break;case"ArrowRight":if(!r||a)return;n.focusValue("next");break;case"Delete":case"Backspace":if(a)return;if(v)n.removeValue(v);else{if(!o)return;r?n.popValue():l&&n.clearValue()}break;case"Tab":if(n.isComposing)return;if(e.shiftKey||!c||!f||!h||d&&n.isOptionSelected(h,m))return;n.selectOption(h);break;case"Enter":if(229===e.keyCode)break;if(c){if(!h)return;if(n.isComposing)return;n.selectOption(h);break}return;case"Escape":c?(n.inputIsHiddenAfterUpdate=!1,n.onInputChange("",{action:"menu-close"}),n.onMenuClose()):l&&i&&n.clearValue();break;case" ":if(a)return;if(!c){n.openMenu("first");break}if(!h)return;n.selectOption(h);break;case"ArrowUp":c?n.focusOption("up"):n.openMenu("last");break;case"ArrowDown":c?n.focusOption("down"):n.openMenu("first");break;case"PageUp":if(!c)return;n.focusOption("pageup");break;case"PageDown":if(!c)return;n.focusOption("pagedown");break;case"Home":if(!c)return;n.focusOption("first");break;case"End":if(!c)return;n.focusOption("last");break;default:return}e.preventDefault()}},n.buildMenuOptions=function(e,t){var r=e.inputValue,o=void 0===r?"":r,i=e.options,a=function(e,r){var i=n.isOptionDisabled(e,t),a=n.isOptionSelected(e,t),l=n.getOptionLabel(e),u=n.getOptionValue(e);if(!(n.shouldHideSelectedOptions()&&a||!n.filterOption({label:l,value:u,data:e},o))){var c=i?void 0:function(){return n.onOptionHover(e)},s=i?void 0:function(){return n.selectOption(e)},f=n.getElementId("option")+"-"+r;return{innerProps:{id:f,onClick:s,onMouseMove:c,onMouseOver:c,tabIndex:-1},data:e,isDisabled:i,isSelected:a,key:f,label:l,type:"option",value:u}}};return i.reduce((function(e,t,r){if(t.options){n.hasGroups||(n.hasGroups=!0);var o=t.options.map((function(t,n){var o=a(t,r+"-"+n);return o&&e.focusable.push(t),o})).filter(Boolean);if(o.length){var i=n.getElementId("group")+"-"+r;e.render.push({type:"group",key:i,data:t,options:o})}}else{var l=a(t,""+r);l&&(e.render.push(l),e.focusable.push(t))}return e}),{render:[],focusable:[]})};var r=t.value;n.cacheComponents=Object(i.a)(n.cacheComponents,ve).bind(bt(bt(n))),n.cacheComponents(t.components),n.instancePrefix="react-select-"+(n.props.instanceId||++Ot);var o=q(r);n.buildMenuOptions=Object(i.a)(n.buildMenuOptions,(function(e,t){var n=e,r=n[0],o=n[1],i=t,a=i[0];return ve(o,i[1])&&ve(r.inputValue,a.inputValue)&&ve(r.options,a.options)})).bind(bt(bt(n)));var a=t.menuIsOpen?n.buildMenuOptions(t,o):{render:[],focusable:[]};return n.state.menuOptions=a,n.state.selectValue=o,n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var a=r.prototype;return a.componentDidMount=function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput()},a.UNSAFE_componentWillReceiveProps=function(e){var t=this.props,n=t.options,r=t.value,o=t.menuIsOpen,i=t.inputValue;if(this.cacheComponents(e.components),e.value!==r||e.options!==n||e.menuIsOpen!==o||e.inputValue!==i){var a=q(e.value),l=e.menuIsOpen?this.buildMenuOptions(e,a):{render:[],focusable:[]},u=this.getNextFocusedValue(a),c=this.getNextFocusedOption(l.focusable);this.setState({menuOptions:l,selectValue:a,focusedOption:c,focusedValue:u})}null!=this.inputIsHiddenAfterUpdate&&(this.setState({inputIsHidden:this.inputIsHiddenAfterUpdate}),delete this.inputIsHiddenAfterUpdate)},a.componentDidUpdate=function(e){var t=this.props,n=t.isDisabled,r=t.menuIsOpen,o=this.state.isFocused;(o&&!n&&e.isDisabled||o&&r&&!e.menuIsOpen)&&this.focusInput(),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(!function(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=t.offsetHeight/3;r.bottom+o>n.bottom?X(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+o,e.scrollHeight)):r.top-o<n.top&&X(e,Math.max(t.offsetTop-o,0))}(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)},a.componentWillUnmount=function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)},a.onMenuOpen=function(){this.props.onMenuOpen()},a.onMenuClose=function(){var e=this.props,t=e.isSearchable,n=e.isMulti;this.announceAriaLiveContext({event:"input",context:{isSearchable:t,isMulti:n}}),this.onInputChange("",{action:"menu-close"}),this.props.onMenuClose()},a.onInputChange=function(e,t){this.props.onInputChange(e,t)},a.focusInput=function(){this.inputRef&&this.inputRef.focus()},a.blurInput=function(){this.inputRef&&this.inputRef.blur()},a.openMenu=function(e){var t=this,n=this.state,r=n.selectValue,o=n.isFocused,i=this.buildMenuOptions(this.props,r),a=this.props.isMulti,l="first"===e?0:i.focusable.length-1;if(!a){var u=i.focusable.indexOf(r[0]);u>-1&&(l=u)}this.scrollToFocusedOptionOnUpdate=!(o&&this.menuListRef),this.inputIsHiddenAfterUpdate=!1,this.setState({menuOptions:i,focusedValue:null,focusedOption:i.focusable[l]},(function(){t.onMenuOpen(),t.announceAriaLiveContext({event:"menu"})}))},a.focusValue=function(e){var t=this.props,n=t.isMulti,r=t.isSearchable,o=this.state,i=o.selectValue,a=o.focusedValue;if(n){this.setState({focusedOption:null});var l=i.indexOf(a);a||(l=-1,this.announceAriaLiveContext({event:"value"}));var u=i.length-1,c=-1;if(i.length){switch(e){case"previous":c=0===l?0:-1===l?u:l-1;break;case"next":l>-1&&l<u&&(c=l+1)}-1===c&&this.announceAriaLiveContext({event:"input",context:{isSearchable:r,isMulti:n}}),this.setState({inputIsHidden:-1!==c,focusedValue:i[c]})}}},a.focusOption=function(e){void 0===e&&(e="first");var t=this.props.pageSize,n=this.state,r=n.focusedOption,o=n.menuOptions.focusable;if(o.length){var i=0,a=o.indexOf(r);r||(a=-1,this.announceAriaLiveContext({event:"menu"})),"up"===e?i=a>0?a-1:o.length-1:"down"===e?i=(a+1)%o.length:"pageup"===e?(i=a-t)<0&&(i=0):"pagedown"===e?(i=a+t)>o.length-1&&(i=o.length-1):"last"===e&&(i=o.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:o[i],focusedValue:null}),this.announceAriaLiveContext({event:"menu",context:{isDisabled:vt(o[i])}})}},a.getTheme=function(){return this.props.theme?"function"===typeof this.props.theme?this.props.theme(gt):yt({},gt,this.props.theme):gt},a.getCommonProps=function(){var e=this.clearValue,t=this.getStyles,n=this.setValue,r=this.selectOption,o=this.props,i=o.classNamePrefix,a=o.isMulti,l=o.isRtl,u=o.options,c=this.state.selectValue,s=this.hasValue();return{cx:K.bind(null,i),clearValue:e,getStyles:t,getValue:function(){return c},hasValue:s,isMulti:a,isRtl:l,options:u,selectOption:r,setValue:n,selectProps:o,theme:this.getTheme()}},a.getNextFocusedValue=function(e){if(this.clearFocusValueOnUpdate)return this.clearFocusValueOnUpdate=!1,null;var t=this.state,n=t.focusedValue,r=t.selectValue.indexOf(n);if(r>-1){if(e.indexOf(n)>-1)return n;if(r<e.length)return e[r]}return null},a.getNextFocusedOption=function(e){var t=this.state.focusedOption;return t&&e.indexOf(t)>-1?t:e[0]},a.hasValue=function(){return this.state.selectValue.length>0},a.hasOptions=function(){return!!this.state.menuOptions.render.length},a.countOptions=function(){return this.state.menuOptions.focusable.length},a.isClearable=function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t},a.isOptionDisabled=function(e,t){return"function"===typeof this.props.isOptionDisabled&&this.props.isOptionDisabled(e,t)},a.isOptionSelected=function(e,t){var n=this;if(t.indexOf(e)>-1)return!0;if("function"===typeof this.props.isOptionSelected)return this.props.isOptionSelected(e,t);var r=this.getOptionValue(e);return t.some((function(e){return n.getOptionValue(e)===r}))},a.filterOption=function(e,t){return!this.props.filterOption||this.props.filterOption(e,t)},a.formatOptionLabel=function(e,t){if("function"===typeof this.props.formatOptionLabel){var n=this.props.inputValue,r=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:r})}return this.getOptionLabel(e)},a.formatGroupLabel=function(e){return this.props.formatGroupLabel(e)},a.startListeningComposition=function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))},a.stopListeningComposition=function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))},a.startListeningToTouch=function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))},a.stopListeningToTouch=function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))},a.constructAriaLiveMessage=function(){var e=this.state,t=e.ariaLiveContext,n=e.selectValue,r=e.focusedValue,o=e.focusedOption,i=this.props,a=i.options,l=i.menuIsOpen,u=i.inputValue,c=i.screenReaderStatus;return(r?function(e){var t=e.focusedValue,n=e.getOptionLabel,r=e.selectValue;return"value "+n(t)+" focused, "+(r.indexOf(t)+1)+" of "+r.length+"."}({focusedValue:r,getOptionLabel:this.getOptionLabel,selectValue:n}):"")+" "+(o&&l?function(e){var t=e.focusedOption,n=e.getOptionLabel,r=e.options;return"option "+n(t)+" focused"+(t.isDisabled?" disabled":"")+", "+(r.indexOf(t)+1)+" of "+r.length+"."}({focusedOption:o,getOptionLabel:this.getOptionLabel,options:a}):"")+" "+function(e){var t=e.inputValue;return e.screenReaderMessage+(t?" for search term "+t:"")+"."}({inputValue:u,screenReaderMessage:c({count:this.countOptions()})})+" "+t},a.renderInput=function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,r=e.inputId,i=e.inputValue,a=e.tabIndex,l=this.components.Input,u=this.state.inputIsHidden,c=r||this.getElementId("input"),s={"aria-autocomplete":"list","aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"]};if(!n)return o.a.createElement(Ze,yt({id:c,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:U,onFocus:this.onInputFocus,readOnly:!0,disabled:t,tabIndex:a,value:""},s));var f=this.commonProps,d=f.cx,p=f.theme,h=f.selectProps;return o.a.createElement(l,yt({autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",cx:d,getStyles:this.getStyles,id:c,innerRef:this.getInputRef,isDisabled:t,isHidden:u,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,selectProps:h,spellCheck:"false",tabIndex:a,theme:p,type:"text",value:i},s))},a.renderPlaceholderOrValue=function(){var e=this,t=this.components,n=t.MultiValue,r=t.MultiValueContainer,i=t.MultiValueLabel,a=t.MultiValueRemove,l=t.SingleValue,u=t.Placeholder,c=this.commonProps,s=this.props,f=s.controlShouldRenderValue,d=s.isDisabled,p=s.isMulti,h=s.inputValue,v=s.placeholder,m=this.state,g=m.selectValue,y=m.focusedValue,b=m.isFocused;if(!this.hasValue()||!f)return h?null:o.a.createElement(u,yt({},c,{key:"placeholder",isDisabled:d,isFocused:b}),v);if(p)return g.map((function(t,l){var u=t===y;return o.a.createElement(n,yt({},c,{components:{Container:r,Label:i,Remove:a},isFocused:u,isDisabled:d,key:e.getOptionValue(t),index:l,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault(),e.stopPropagation()}},data:t}),e.formatOptionLabel(t,"value"))}));if(h)return null;var S=g[0];return o.a.createElement(l,yt({},c,{data:S,isDisabled:d}),this.formatOptionLabel(S,"value"))},a.renderClearIndicator=function(){var e=this.components.ClearIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,i=n.isLoading,a=this.state.isFocused;if(!this.isClearable()||!e||r||!this.hasValue()||i)return null;var l={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return o.a.createElement(e,yt({},t,{innerProps:l,isFocused:a}))},a.renderLoadingIndicator=function(){var e=this.components.LoadingIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,i=n.isLoading,a=this.state.isFocused;if(!e||!i)return null;return o.a.createElement(e,yt({},t,{innerProps:{"aria-hidden":"true"},isDisabled:r,isFocused:a}))},a.renderIndicatorSeparator=function(){var e=this.components,t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var r=this.commonProps,i=this.props.isDisabled,a=this.state.isFocused;return o.a.createElement(n,yt({},r,{isDisabled:i,isFocused:a}))},a.renderDropdownIndicator=function(){var e=this.components.DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,r=this.state.isFocused,i={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return o.a.createElement(e,yt({},t,{innerProps:i,isDisabled:n,isFocused:r}))},a.renderMenu=function(){var e=this,t=this.components,n=t.Group,r=t.GroupHeading,i=t.Menu,a=t.MenuList,l=t.MenuPortal,u=t.LoadingMessage,c=t.NoOptionsMessage,s=t.Option,f=this.commonProps,d=this.state,p=d.focusedOption,h=d.menuOptions,v=this.props,m=v.captureMenuScroll,g=v.inputValue,y=v.isLoading,b=v.loadingMessage,S=v.minMenuHeight,w=v.maxMenuHeight,O=v.menuIsOpen,C=v.menuPlacement,x=v.menuPosition,E=v.menuPortalTarget,k=v.menuShouldBlockScroll,_=v.menuShouldScrollIntoView,T=v.noOptionsMessage,j=v.onMenuScrollToTop,P=v.onMenuScrollToBottom;if(!O)return null;var A,I=function(t){var n=p===t.data;return t.innerRef=n?e.getFocusedOptionRef:void 0,o.a.createElement(s,yt({},f,t,{isFocused:n}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())A=h.render.map((function(t){if("group"===t.type){t.type;var i=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(t,["type"]),a=t.key+"-heading";return o.a.createElement(n,yt({},f,i,{Heading:r,headingProps:{id:a},label:e.formatGroupLabel(t.data)}),t.options.map((function(e){return I(e)})))}if("option"===t.type)return I(t)}));else if(y){var M=b({inputValue:g});if(null===M)return null;A=o.a.createElement(u,f,M)}else{var D=T({inputValue:g});if(null===D)return null;A=o.a.createElement(c,f,D)}var R={minMenuHeight:S,maxMenuHeight:w,menuPlacement:C,menuPosition:x,menuShouldScrollIntoView:_},N=o.a.createElement(ie,yt({},f,R),(function(t){var n=t.ref,r=t.placerProps,l=r.placement,u=r.maxHeight;return o.a.createElement(i,yt({},f,R,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:y,placement:l}),o.a.createElement(dt,{isEnabled:m,onTopArrive:j,onBottomArrive:P},o.a.createElement(st,{isEnabled:k},o.a.createElement(a,yt({},f,{innerRef:e.getMenuListRef,isLoading:y,maxHeight:u}),A))))}));return E||"fixed"===x?o.a.createElement(l,yt({},f,{appendTo:E,controlElement:this.controlRef,menuPlacement:C,menuPosition:x}),N):N},a.renderFormField=function(){var e=this,t=this.props,n=t.delimiter,r=t.isDisabled,i=t.isMulti,a=t.name,l=this.state.selectValue;if(a&&!r){if(i){if(n){var u=l.map((function(t){return e.getOptionValue(t)})).join(n);return o.a.createElement("input",{name:a,type:"hidden",value:u})}var c=l.length>0?l.map((function(t,n){return o.a.createElement("input",{key:"i-"+n,name:a,type:"hidden",value:e.getOptionValue(t)})})):o.a.createElement("input",{name:a,type:"hidden"});return o.a.createElement("div",null,c)}var s=l[0]?this.getOptionValue(l[0]):"";return o.a.createElement("input",{name:a,type:"hidden",value:s})}},a.renderLiveRegion=function(){return this.state.isFocused?o.a.createElement(Xe,{"aria-live":"polite"},o.a.createElement("p",{id:"aria-selection-event"},"\xa0",this.state.ariaLiveSelection),o.a.createElement("p",{id:"aria-context"},"\xa0",this.constructAriaLiveMessage())):null},a.render=function(){var e=this.components,t=e.Control,n=e.IndicatorsContainer,r=e.SelectContainer,i=e.ValueContainer,a=this.props,l=a.className,u=a.id,c=a.isDisabled,s=a.menuIsOpen,f=this.state.isFocused,d=this.commonProps=this.getCommonProps();return o.a.createElement(r,yt({},d,{className:l,innerProps:{id:u,onKeyDown:this.onKeyDown},isDisabled:c,isFocused:f}),this.renderLiveRegion(),o.a.createElement(t,yt({},d,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:c,isFocused:f,menuIsOpen:s}),o.a.createElement(i,yt({},d,{isDisabled:c}),this.renderPlaceholderOrValue(),this.renderInput()),o.a.createElement(n,yt({},d,{isDisabled:c}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())},r}(r.Component);function xt(){return(xt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}Ct.defaultProps=wt;var Et={defaultInputValue:"",defaultMenuIsOpen:!1,defaultValue:null};r.Component;var kt=function(e){var t,n;return n=t=function(t){var n,r;function i(){for(var e,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(e=t.call.apply(t,[this].concat(r))||this).select=void 0,e.state={inputValue:void 0!==e.props.inputValue?e.props.inputValue:e.props.defaultInputValue,menuIsOpen:void 0!==e.props.menuIsOpen?e.props.menuIsOpen:e.props.defaultMenuIsOpen,value:void 0!==e.props.value?e.props.value:e.props.defaultValue},e.onChange=function(t,n){e.callProp("onChange",t,n),e.setState({value:t})},e.onInputChange=function(t,n){var r=e.callProp("onInputChange",t,n);e.setState({inputValue:void 0!==r?r:t})},e.onMenuOpen=function(){e.callProp("onMenuOpen"),e.setState({menuIsOpen:!0})},e.onMenuClose=function(){e.callProp("onMenuClose"),e.setState({menuIsOpen:!1})},e}r=t,(n=i).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r;var a=i.prototype;return a.focus=function(){this.select.focus()},a.blur=function(){this.select.blur()},a.getProp=function(e){return void 0!==this.props[e]?this.props[e]:this.state[e]},a.callProp=function(e){if("function"===typeof this.props[e]){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return(t=this.props)[e].apply(t,r)}},a.render=function(){var t=this,n=this.props,r=(n.defaultInputValue,n.defaultMenuIsOpen,n.defaultValue,function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(n,["defaultInputValue","defaultMenuIsOpen","defaultValue"]));return o.a.createElement(e,xt({},r,{ref:function(e){t.select=e},inputValue:this.getProp("inputValue"),menuIsOpen:this.getProp("menuIsOpen"),onChange:this.onChange,onInputChange:this.onInputChange,onMenuClose:this.onMenuClose,onMenuOpen:this.onMenuOpen,value:this.getProp("value")}))},i}(r.Component),t.defaultProps=Et,n}(Ct);t.a=kt},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(69);var o=n(82);function i(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||function(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Object(o.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},,function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){"use strict";e.exports=n(252)("forEach")},function(e,t,n){"use strict";e.exports=n(275)()?globalThis:n(276)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.optionState=t.optionMapState=void 0;var r=n(9);t.optionMapState=r.atom({key:"optionMapState",default:{}}),t.optionState=r.selectorFamily({key:"optionEnabledState",get:function(e){return function(n){return(0,n.get)(t.optionMapState)[e]}}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SortOrder=void 0,function(e){e.Asc="asc",e.Desc="desc"}(t.SortOrder||(t.SortOrder={}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(69);function o(e,t){if(e){if("string"===typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(5);function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var i=!1,a=!1,l=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sourceId=null,this.internalMonitor=t.getMonitor()}var t,n,l;return t=e,(n=[{key:"receiveHandlerId",value:function(e){this.sourceId=e}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){Object(r.a)(!i,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return i=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{i=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;Object(r.a)(!a,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return a=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{a=!1}}},{key:"subscribeToStateChange",value:function(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}},{key:"isDraggingSource",value:function(e){return this.internalMonitor.isDraggingSource(e)}},{key:"isOverTarget",value:function(e,t){return this.internalMonitor.isOverTarget(e,t)}},{key:"getTargetIds",value:function(){return this.internalMonitor.getTargetIds()}},{key:"isSourcePublic",value:function(){return this.internalMonitor.isSourcePublic()}},{key:"getSourceId",value:function(){return this.internalMonitor.getSourceId()}},{key:"subscribeToOffsetChange",value:function(e){return this.internalMonitor.subscribeToOffsetChange(e)}},{key:"canDragSource",value:function(e){return this.internalMonitor.canDragSource(e)}},{key:"canDropOnTarget",value:function(e){return this.internalMonitor.canDropOnTarget(e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}])&&o(t.prototype,n),l&&o(t,l),e}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(93),o=n(70),i=n(18);function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var l=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.hooks=Object(r.a)({dragSource:function(e,t){n.clearDragSource(),n.dragSourceOptions=t||null,Object(o.a)(e)?n.dragSourceRef=e:n.dragSourceNode=e,n.reconnectDragSource()},dragPreview:function(e,t){n.clearDragPreview(),n.dragPreviewOptions=t||null,Object(o.a)(e)?n.dragPreviewRef=e:n.dragPreviewNode=e,n.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}var t,n,l;return t=e,(n=[{key:"receiveHandlerId",value:function(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}},{key:"reconnect",value:function(){this.reconnectDragSource(),this.reconnectDragPreview()}},{key:"reconnectDragSource",value:function(){var e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();t&&this.disconnectDragSource(),this.handlerId&&(e?t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)):this.lastConnectedDragSource=e)}},{key:"reconnectDragPreview",value:function(){var e=this.dragPreview,t=this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();t&&this.disconnectDragPreview(),this.handlerId&&(e?t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=e,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,e,this.dragPreviewOptions)):this.lastConnectedDragPreview=e)}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didConnectedDragSourceChange",value:function(){return this.lastConnectedDragSource!==this.dragSource}},{key:"didConnectedDragPreviewChange",value:function(){return this.lastConnectedDragPreview!==this.dragPreview}},{key:"didDragSourceOptionsChange",value:function(){return!Object(i.a)(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!Object(i.a)(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}},{key:"disconnectDragSource",value:function(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}},{key:"disconnectDragPreview",value:function(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}},{key:"clearDragSource",value:function(){this.dragSourceNode=null,this.dragSourceRef=null}},{key:"clearDragPreview",value:function(){this.dragPreviewNode=null,this.dragPreviewRef=null}},{key:"connectTarget",get:function(){return this.dragSource}},{key:"dragSourceOptions",get:function(){return this.dragSourceOptionsInternal},set:function(e){this.dragSourceOptionsInternal=e}},{key:"dragPreviewOptions",get:function(){return this.dragPreviewOptionsInternal},set:function(e){this.dragPreviewOptionsInternal=e}},{key:"dragSource",get:function(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}},{key:"dragPreview",get:function(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}}])&&a(t.prototype,n),l&&a(t,l),e}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(5);function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var i=!1,a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.targetId=null,this.internalMonitor=t.getMonitor()}var t,n,a;return t=e,(n=[{key:"receiveHandlerId",value:function(e){this.targetId=e}},{key:"getHandlerId",value:function(){return this.targetId}},{key:"subscribeToStateChange",value:function(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}},{key:"canDrop",value:function(){if(!this.targetId)return!1;Object(r.a)(!i,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return i=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{i=!1}}},{key:"isOver",value:function(e){return!!this.targetId&&this.internalMonitor.isOverTarget(this.targetId,e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}])&&o(t.prototype,n),a&&o(t,a),e}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(18),o=n(93),i=n(70);function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var l=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.hooks=Object(o.a)({dropTarget:function(e,t){n.clearDropTarget(),n.dropTargetOptions=t,Object(i.a)(e)?n.dropTargetRef=e:n.dropTargetNode=e,n.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}var t,n,l;return t=e,(n=[{key:"reconnect",value:function(){var e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();var t=this.dropTarget;this.handlerId&&(t?e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions)):this.lastConnectedDropTarget=t)}},{key:"receiveHandlerId",value:function(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didDropTargetChange",value:function(){return this.lastConnectedDropTarget!==this.dropTarget}},{key:"didOptionsChange",value:function(){return!Object(r.a)(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}},{key:"disconnectDropTarget",value:function(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}},{key:"clearDropTarget",value:function(){this.dropTargetRef=null,this.dropTargetNode=null}},{key:"connectTarget",get:function(){return this.dropTarget}},{key:"dropTargetOptions",get:function(){return this.dropTargetOptionsInternal},set:function(e){this.dropTargetOptionsInternal=e}},{key:"dropTarget",get:function(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}}])&&a(t.prototype,n),l&&a(t,l),e}()},function(e,t,n){"use strict";function r(e){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){return"string"===typeof e||"symbol"===r(e)||!!t&&Array.isArray(e)&&e.every((function(e){return o(e,!1)}))}n.d(t,"a",(function(){return o}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n(0),o=n(10),i=!0,a=!1,l=null,u={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function c(e){e.metaKey||e.altKey||e.ctrlKey||(i=!0)}function s(){i=!1}function f(){"hidden"===this.visibilityState&&a&&(i=!0)}function d(e){var t=e.target;try{return t.matches(":focus-visible")}catch(n){}return i||function(e){var t=e.type,n=e.tagName;return!("INPUT"!==n||!u[t]||e.readOnly)||("TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable)}(t)}function p(){a=!0,window.clearTimeout(l),l=window.setTimeout((function(){a=!1}),100)}function h(){return{isFocusVisible:d,onBlurVisible:p,ref:r.useCallback((function(e){var t,n=o.findDOMNode(e);null!=n&&((t=n.ownerDocument).addEventListener("keydown",c,!0),t.addEventListener("mousedown",s,!0),t.addEventListener("pointerdown",s,!0),t.addEventListener("touchstart",s,!0),t.addEventListener("visibilitychange",f,!0))}),[])}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(71);function o(e,t){if(e){if("string"===typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";t.a={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0);function o(e){var t=e.controlled,n=e.default,o=(e.name,e.state,r.useRef(void 0!==t).current),i=r.useState(n),a=i[0],l=i[1];return[o?t:a,r.useCallback((function(e){o||l(e)}),[])]}},function(e,t,n){"use strict";n.d(t,"a",(function(){return E}));var r=n(0),o=n(18),i=n(5),a=n(58),l=n.n(a),u=n(29),c=n(16);function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e,t,n){return t&&f(e.prototype,t),n&&f(e,n),e}var p=function(){var e=function(){function e(t){s(this,e),this.isDisposed=!1,this.action=Object(c.a)(t)?t:c.c}return d(e,[{key:"dispose",value:function(){this.isDisposed||(this.action(),this.isDisposed=!0)}}],[{key:"isDisposable",value:function(e){return Boolean(e&&Object(c.a)(e.dispose))}},{key:"_fixup",value:function(t){return e.isDisposable(t)?t:e.empty}},{key:"create",value:function(t){return new e(t)}}]),e}();return e.empty={dispose:c.c},e}(),h=function(){function e(){s(this,e),this.isDisposed=!1;for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];this.disposables=n}return d(e,[{key:"add",value:function(e){this.isDisposed?e.dispose():this.disposables.push(e)}},{key:"remove",value:function(e){var t=!1;if(!this.isDisposed){var n=this.disposables.indexOf(e);-1!==n&&(t=!0,this.disposables.splice(n,1),e.dispose())}return t}},{key:"clear",value:function(){if(!this.isDisposed){for(var e=this.disposables.length,t=new Array(e),n=0;n<e;n++)t[n]=this.disposables[n];this.disposables=[];for(var r=0;r<e;r++)t[r].dispose()}}},{key:"dispose",value:function(){if(!this.isDisposed){this.isDisposed=!0;for(var e=this.disposables.length,t=new Array(e),n=0;n<e;n++)t[n]=this.disposables[n];this.disposables=[];for(var r=0;r<e;r++)t[r].dispose()}}}]),e}(),v=function(){function e(){s(this,e),this.isDisposed=!1}return d(e,[{key:"getDisposable",value:function(){return this.current}},{key:"setDisposable",value:function(e){var t=this.isDisposed;if(!t){var n=this.current;this.current=e,n&&n.dispose()}t&&e&&e.dispose()}},{key:"dispose",value:function(){if(!this.isDisposed){this.isDisposed=!0;var e=this.current;this.current=void 0,e&&e.dispose()}}}]),e}(),m=n(23);function g(e){return(g="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(u){o=!0,i=u}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function S(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function w(e,t){return(w=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function O(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=x(e);if(t){var o=x(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return C(this,n)}}function C(e,t){return!t||"object"!==g(t)&&"function"!==typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function x(e){return(x=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function E(e){var t=e.DecoratedComponent,n=e.createHandler,a=e.createMonitor,c=e.createConnector,s=e.registerHandler,f=e.containerDisplayName,d=e.getType,g=e.collect,b=e.options.arePropsEqual,C=void 0===b?o.a:b,x=t,E=t.displayName||t.name||"Component",k=function(){var e=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&w(e,t)}(k,e);var t,l,f,b=O(k);function k(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,k),(t=b.call(this,e)).decoratedRef=r.createRef(),t.handleChange=function(){var e=t.getCurrentState();Object(o.a)(e,t.state)||t.setState(e)},t.disposable=new v,t.receiveProps(e),t.dispose(),t}return t=k,(l=[{key:"getHandlerId",value:function(){return this.handlerId}},{key:"getDecoratedComponentInstance",value:function(){return Object(i.a)(this.decoratedRef.current,"In order to access an instance of the decorated component, it must either be a class component or use React.forwardRef()"),this.decoratedRef.current}},{key:"shouldComponentUpdate",value:function(e,t){return!C(e,this.props)||!Object(o.a)(t,this.state)}},{key:"componentDidMount",value:function(){this.disposable=new v,this.currentType=void 0,this.receiveProps(this.props),this.handleChange()}},{key:"componentDidUpdate",value:function(e){C(this.props,e)||(this.receiveProps(this.props),this.handleChange())}},{key:"componentWillUnmount",value:function(){this.dispose()}},{key:"receiveProps",value:function(e){this.handler&&(this.handler.receiveProps(e),this.receiveType(d(e)))}},{key:"receiveType",value:function(e){if(this.handlerMonitor&&this.manager&&this.handlerConnector&&e!==this.currentType){this.currentType=e;var t=y(s(e,this.handler,this.manager),2),n=t[0],r=t[1];this.handlerId=n,this.handlerMonitor.receiveHandlerId(n),this.handlerConnector.receiveHandlerId(n);var o=this.manager.getMonitor().subscribeToStateChange(this.handleChange,{handlerIds:[n]});this.disposable.setDisposable(new h(new p(o),new p(r)))}}},{key:"dispose",value:function(){this.disposable.dispose(),this.handlerConnector&&this.handlerConnector.receiveHandlerId(null)}},{key:"getCurrentState",value:function(){return this.handlerConnector?g(this.handlerConnector.hooks,this.handlerMonitor,this.props):{}}},{key:"render",value:function(){var e=this;return r.createElement(u.a.Consumer,null,(function(t){var n=t.dragDropManager;return e.receiveDragDropManager(n),"undefined"!==typeof requestAnimationFrame&&requestAnimationFrame((function(){var t;return null===(t=e.handlerConnector)||void 0===t?void 0:t.reconnect()})),r.createElement(x,Object.assign({},e.props,e.getCurrentState(),{ref:Object(m.c)(x)?e.decoratedRef:null}))}))}},{key:"receiveDragDropManager",value:function(e){void 0===this.manager&&(Object(i.a)(void 0!==e,"Could not find the drag and drop manager in the context of %s. Make sure to render a DndProvider component in your top-level component. Read more: http://react-dnd.github.io/react-dnd/docs/troubleshooting#could-not-find-the-drag-and-drop-manager-in-the-context",E,E),void 0!==e&&(this.manager=e,this.handlerMonitor=a(e),this.handlerConnector=c(e.getBackend()),this.handler=n(this.handlerMonitor,this.decoratedRef)))}}])&&S(t.prototype,l),f&&S(t,f),k}(r.Component);return e.DecoratedComponent=t,e.displayName="".concat(f,"(").concat(E,")"),e}();return l()(k,t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(0),o=n(5);function i(e,t){"function"===typeof e?e(t):e.current=t}function a(e,t){var n=e.ref;return Object(o.a)("string"!==typeof n,"Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute"),n?Object(r.cloneElement)(e,{ref:function(e){i(n,e),i(t,e)}}):Object(r.cloneElement)(e,{ref:t})}function l(e){if("string"!==typeof e.type){var t=e.type.displayName||e.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(t," into a <div>, or turn it into a ")+"drag source or a drop target itself.")}}function u(e){var t={};return Object.keys(e).forEach((function(n){var o=e[n];if(n.endsWith("Ref"))t[n]=e[n];else{var i=function(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!Object(r.isValidElement)(t)){var o=t;return e(o,n),o}var i=t;l(i);var u=n?function(t){return e(t,n)}:e;return a(i,u)}}(o);t[n]=function(){return i}}})),t}},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=(n(3),n(4)),l=n(6),u=n(7),c={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"},s=i.forwardRef((function(e,t){var n=e.align,l=void 0===n?"inherit":n,s=e.classes,f=e.className,d=e.color,p=void 0===d?"initial":d,h=e.component,v=e.display,m=void 0===v?"initial":v,g=e.gutterBottom,y=void 0!==g&&g,b=e.noWrap,S=void 0!==b&&b,w=e.paragraph,O=void 0!==w&&w,C=e.variant,x=void 0===C?"body1":C,E=e.variantMapping,k=void 0===E?c:E,_=Object(o.a)(e,["align","classes","className","color","component","display","gutterBottom","noWrap","paragraph","variant","variantMapping"]),T=h||(O?"p":k[x]||c[x])||"span";return i.createElement(T,Object(r.a)({className:Object(a.default)(s.root,f,"inherit"!==x&&s[x],"initial"!==p&&s["color".concat(Object(u.a)(p))],S&&s.noWrap,y&&s.gutterBottom,O&&s.paragraph,"inherit"!==l&&s["align".concat(Object(u.a)(l))],"initial"!==m&&s["display".concat(Object(u.a)(m))]),ref:t},_))}));t.a=Object(l.a)((function(e){return{root:{margin:0},body2:e.typography.body2,body1:e.typography.body1,caption:e.typography.caption,button:e.typography.button,h1:e.typography.h1,h2:e.typography.h2,h3:e.typography.h3,h4:e.typography.h4,h5:e.typography.h5,h6:e.typography.h6,subtitle1:e.typography.subtitle1,subtitle2:e.typography.subtitle2,overline:e.typography.overline,srOnly:{position:"absolute",height:1,width:1,overflow:"hidden"},alignLeft:{textAlign:"left"},alignCenter:{textAlign:"center"},alignRight:{textAlign:"right"},alignJustify:{textAlign:"justify"},noWrap:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},gutterBottom:{marginBottom:"0.35em"},paragraph:{marginBottom:16},colorInherit:{color:"inherit"},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},colorTextPrimary:{color:e.palette.text.primary},colorTextSecondary:{color:e.palette.text.secondary},colorError:{color:e.palette.error.main},displayInline:{display:"inline"},displayBlock:{display:"block"}}}),{name:"MuiTypography"})(s)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=(n(3),n(4)),l=n(6),u=n(7),c=i.forwardRef((function(e,t){var n=e.children,l=e.classes,c=e.className,s=e.color,f=void 0===s?"inherit":s,d=e.component,p=void 0===d?"svg":d,h=e.fontSize,v=void 0===h?"default":h,m=e.htmlColor,g=e.titleAccess,y=e.viewBox,b=void 0===y?"0 0 24 24":y,S=Object(o.a)(e,["children","classes","className","color","component","fontSize","htmlColor","titleAccess","viewBox"]);return i.createElement(p,Object(r.a)({className:Object(a.default)(l.root,c,"inherit"!==f&&l["color".concat(Object(u.a)(f))],"default"!==v&&l["fontSize".concat(Object(u.a)(v))]),focusable:"false",viewBox:b,color:m,"aria-hidden":!g||void 0,role:g?"img":void 0,ref:t},S),n,g?i.createElement("title",null,g):null)}));c.muiName="SvgIcon",t.a=Object(l.a)((function(e){return{root:{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0,fontSize:e.typography.pxToRem(24),transition:e.transitions.create("fill",{duration:e.transitions.duration.shorter})},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},colorAction:{color:e.palette.action.active},colorError:{color:e.palette.error.main},colorDisabled:{color:e.palette.action.disabled},fontSizeInherit:{fontSize:"inherit"},fontSizeSmall:{fontSize:e.typography.pxToRem(20)},fontSizeLarge:{fontSize:e.typography.pxToRem(35)}}}),{name:"MuiSvgIcon"})(c)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=n.n(i),l=(n(3),n(10)),u=n(4),c=n(12),s=n(20),f=n(6),d=n(88),p=n(44),h=n(30),v=n(21),m=n(32),g=n(63);function y(e,t){var n=Object.create(null);return e&&i.Children.map(e,(function(e){return e})).forEach((function(e){n[e.key]=function(e){return t&&Object(i.isValidElement)(e)?t(e):e}(e)})),n}function b(e,t,n){return null!=n[t]?n[t]:e.props[t]}function S(e,t,n){var r=y(e.children),o=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,o=Object.create(null),i=[];for(var a in e)a in t?i.length&&(o[a]=i,i=[]):i.push(a);var l={};for(var u in t){if(o[u])for(r=0;r<o[u].length;r++){var c=o[u][r];l[o[u][r]]=n(c)}l[u]=n(u)}for(r=0;r<i.length;r++)l[i[r]]=n(i[r]);return l}(t,r);return Object.keys(o).forEach((function(a){var l=o[a];if(Object(i.isValidElement)(l)){var u=a in t,c=a in r,s=t[a],f=Object(i.isValidElement)(s)&&!s.props.in;!c||u&&!f?c||!u||f?c&&u&&Object(i.isValidElement)(s)&&(o[a]=Object(i.cloneElement)(l,{onExited:n.bind(null,l),in:s.props.in,exit:b(l,"exit",e),enter:b(l,"enter",e)})):o[a]=Object(i.cloneElement)(l,{in:!1}):o[a]=Object(i.cloneElement)(l,{onExited:n.bind(null,l),in:!0,exit:b(l,"exit",e),enter:b(l,"enter",e)})}})),o}var w=Object.values||function(e){return Object.keys(e).map((function(t){return e[t]}))},O=function(e){function t(t,n){var r,o=(r=e.call(this,t,n)||this).handleExited.bind(Object(v.a)(r));return r.state={contextValue:{isMounting:!0},handleExited:o,firstRender:!0},r}Object(m.a)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n,r,o=t.children,a=t.handleExited;return{children:t.firstRender?(n=e,r=a,y(n.children,(function(e){return Object(i.cloneElement)(e,{onExited:r.bind(null,e),in:!0,appear:b(e,"appear",n),enter:b(e,"enter",n),exit:b(e,"exit",n)})}))):S(e,o,a),firstRender:!1}},n.handleExited=function(e,t){var n=y(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState((function(t){var n=Object(r.a)({},t.children);return delete n[e.key],{children:n}})))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=Object(h.a)(e,["component","childFactory"]),o=this.state.contextValue,i=w(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,null===t?a.a.createElement(g.a.Provider,{value:o},i):a.a.createElement(g.a.Provider,{value:o},a.a.createElement(t,r,i))},t}(a.a.Component);O.propTypes={},O.defaultProps={component:"div",childFactory:function(e){return e}};var C=O,x="undefined"===typeof window?i.useEffect:i.useLayoutEffect;var E=function(e){var t=e.classes,n=e.pulsate,r=void 0!==n&&n,o=e.rippleX,a=e.rippleY,l=e.rippleSize,c=e.in,f=e.onExited,d=void 0===f?function(){}:f,p=e.timeout,h=i.useState(!1),v=h[0],m=h[1],g=Object(u.default)(t.ripple,t.rippleVisible,r&&t.ripplePulsate),y={width:l,height:l,top:-l/2+a,left:-l/2+o},b=Object(u.default)(t.child,v&&t.childLeaving,r&&t.childPulsate),S=Object(s.a)(d);return x((function(){if(!c){m(!0);var e=setTimeout(S,p);return function(){clearTimeout(e)}}}),[S,c,p]),i.createElement("span",{className:g,style:y},i.createElement("span",{className:b}))},k=i.forwardRef((function(e,t){var n=e.center,a=void 0!==n&&n,l=e.classes,c=e.className,s=Object(o.a)(e,["center","classes","className"]),f=i.useState([]),d=f[0],h=f[1],v=i.useRef(0),m=i.useRef(null);i.useEffect((function(){m.current&&(m.current(),m.current=null)}),[d]);var g=i.useRef(!1),y=i.useRef(null),b=i.useRef(null),S=i.useRef(null);i.useEffect((function(){return function(){clearTimeout(y.current)}}),[]);var w=i.useCallback((function(e){var t=e.pulsate,n=e.rippleX,r=e.rippleY,o=e.rippleSize,a=e.cb;h((function(e){return[].concat(Object(p.a)(e),[i.createElement(E,{key:v.current,classes:l,timeout:550,pulsate:t,rippleX:n,rippleY:r,rippleSize:o})])})),v.current+=1,m.current=a}),[l]),O=i.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=t.pulsate,o=void 0!==r&&r,i=t.center,l=void 0===i?a||t.pulsate:i,u=t.fakeElement,c=void 0!==u&&u;if("mousedown"===e.type&&g.current)g.current=!1;else{"touchstart"===e.type&&(g.current=!0);var s,f,d,p=c?null:S.current,h=p?p.getBoundingClientRect():{width:0,height:0,left:0,top:0};if(l||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)s=Math.round(h.width/2),f=Math.round(h.height/2);else{var v=e.touches?e.touches[0]:e,m=v.clientX,O=v.clientY;s=Math.round(m-h.left),f=Math.round(O-h.top)}if(l)(d=Math.sqrt((2*Math.pow(h.width,2)+Math.pow(h.height,2))/3))%2===0&&(d+=1);else{var C=2*Math.max(Math.abs((p?p.clientWidth:0)-s),s)+2,x=2*Math.max(Math.abs((p?p.clientHeight:0)-f),f)+2;d=Math.sqrt(Math.pow(C,2)+Math.pow(x,2))}e.touches?null===b.current&&(b.current=function(){w({pulsate:o,rippleX:s,rippleY:f,rippleSize:d,cb:n})},y.current=setTimeout((function(){b.current&&(b.current(),b.current=null)}),80)):w({pulsate:o,rippleX:s,rippleY:f,rippleSize:d,cb:n})}}),[a,w]),x=i.useCallback((function(){O({},{pulsate:!0})}),[O]),k=i.useCallback((function(e,t){if(clearTimeout(y.current),"touchend"===e.type&&b.current)return e.persist(),b.current(),b.current=null,void(y.current=setTimeout((function(){k(e,t)})));b.current=null,h((function(e){return e.length>0?e.slice(1):e})),m.current=t}),[]);return i.useImperativeHandle(t,(function(){return{pulsate:x,start:O,stop:k}}),[x,O,k]),i.createElement("span",Object(r.a)({className:Object(u.default)(l.root,c),ref:S},s),i.createElement(C,{component:null,exit:!0},d))})),_=Object(f.a)((function(e){return{root:{overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"},ripple:{opacity:0,position:"absolute"},rippleVisible:{opacity:.3,transform:"scale(1)",animation:"$enter ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},ripplePulsate:{animationDuration:"".concat(e.transitions.duration.shorter,"ms")},child:{opacity:1,display:"block",width:"100%",height:"100%",borderRadius:"50%",backgroundColor:"currentColor"},childLeaving:{opacity:0,animation:"$exit ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},childPulsate:{position:"absolute",left:0,top:0,animation:"$pulsate 2500ms ".concat(e.transitions.easing.easeInOut," 200ms infinite")},"@keyframes enter":{"0%":{transform:"scale(0)",opacity:.1},"100%":{transform:"scale(1)",opacity:.3}},"@keyframes exit":{"0%":{opacity:1},"100%":{opacity:0}},"@keyframes pulsate":{"0%":{transform:"scale(1)"},"50%":{transform:"scale(0.92)"},"100%":{transform:"scale(1)"}}}}),{flip:!1,name:"MuiTouchRipple"})(i.memo(k)),T=i.forwardRef((function(e,t){var n=e.action,a=e.buttonRef,f=e.centerRipple,p=void 0!==f&&f,h=e.children,v=e.classes,m=e.className,g=e.component,y=void 0===g?"button":g,b=e.disabled,S=void 0!==b&&b,w=e.disableRipple,O=void 0!==w&&w,C=e.disableTouchRipple,x=void 0!==C&&C,E=e.focusRipple,k=void 0!==E&&E,T=e.focusVisibleClassName,j=e.onBlur,P=e.onClick,A=e.onFocus,I=e.onFocusVisible,M=e.onKeyDown,D=e.onKeyUp,R=e.onMouseDown,N=e.onMouseLeave,F=e.onMouseUp,z=e.onTouchEnd,L=e.onTouchMove,V=e.onTouchStart,H=e.onDragLeave,B=e.tabIndex,W=void 0===B?0:B,U=e.TouchRippleProps,$=e.type,K=void 0===$?"button":$,q=Object(o.a)(e,["action","buttonRef","centerRipple","children","classes","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","onBlur","onClick","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","onDragLeave","tabIndex","TouchRippleProps","type"]),G=i.useRef(null);var Y=i.useRef(null),X=i.useState(!1),Q=X[0],Z=X[1];S&&Q&&Z(!1);var J=Object(d.a)(),ee=J.isFocusVisible,te=J.onBlurVisible,ne=J.ref;function re(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:x;return Object(s.a)((function(r){return t&&t(r),!n&&Y.current&&Y.current[e](r),!0}))}i.useImperativeHandle(n,(function(){return{focusVisible:function(){Z(!0),G.current.focus()}}}),[]),i.useEffect((function(){Q&&k&&!O&&Y.current.pulsate()}),[O,k,Q]);var oe=re("start",R),ie=re("stop",H),ae=re("stop",F),le=re("stop",(function(e){Q&&e.preventDefault(),N&&N(e)})),ue=re("start",V),ce=re("stop",z),se=re("stop",L),fe=re("stop",(function(e){Q&&(te(e),Z(!1)),j&&j(e)}),!1),de=Object(s.a)((function(e){G.current||(G.current=e.currentTarget),ee(e)&&(Z(!0),I&&I(e)),A&&A(e)})),pe=function(){var e=l.findDOMNode(G.current);return y&&"button"!==y&&!("A"===e.tagName&&e.href)},he=i.useRef(!1),ve=Object(s.a)((function(e){k&&!he.current&&Q&&Y.current&&" "===e.key&&(he.current=!0,e.persist(),Y.current.stop(e,(function(){Y.current.start(e)}))),e.target===e.currentTarget&&pe()&&" "===e.key&&e.preventDefault(),M&&M(e),e.target===e.currentTarget&&pe()&&"Enter"===e.key&&!S&&(e.preventDefault(),P&&P(e))})),me=Object(s.a)((function(e){k&&" "===e.key&&Y.current&&Q&&!e.defaultPrevented&&(he.current=!1,e.persist(),Y.current.stop(e,(function(){Y.current.pulsate(e)}))),D&&D(e),P&&e.target===e.currentTarget&&pe()&&" "===e.key&&!e.defaultPrevented&&P(e)})),ge=y;"button"===ge&&q.href&&(ge="a");var ye={};"button"===ge?(ye.type=K,ye.disabled=S):("a"===ge&&q.href||(ye.role="button"),ye["aria-disabled"]=S);var be=Object(c.a)(a,t),Se=Object(c.a)(ne,G),we=Object(c.a)(be,Se),Oe=i.useState(!1),Ce=Oe[0],xe=Oe[1];i.useEffect((function(){xe(!0)}),[]);var Ee=Ce&&!O&&!S;return i.createElement(ge,Object(r.a)({className:Object(u.default)(v.root,m,Q&&[v.focusVisible,T],S&&v.disabled),onBlur:fe,onClick:P,onFocus:de,onKeyDown:ve,onKeyUp:me,onMouseDown:oe,onMouseLeave:le,onMouseUp:ae,onDragLeave:ie,onTouchEnd:ce,onTouchMove:se,onTouchStart:ue,ref:we,tabIndex:S?-1:W},ye,q),h,Ee?i.createElement(_,Object(r.a)({ref:Y,center:p},U)):null)}));t.a=Object(f.a)({root:{display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},"&$disabled":{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}},disabled:{},focusVisible:{}},{name:"MuiButtonBase"})(T)},function(e,t,n){var r=n(126);e.exports=function(e,t){if(e){if("string"===typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t,n){"use strict";var r=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,l=i.length;a<l;a++,o++)r[o]=i[a];return r};Object.defineProperty(t,"__esModule",{value:!0}),t.cleanupFileActions=t.useFileActionsValidation=t.useFileArrayValidation=t.cleanupFileArray=t.isMobileDevice=t.isFunction=t.isPlainObject=void 0;var o=n(0),i=n(49);t.isPlainObject=function(e){return"[object Object]"===Object.prototype.toString.call(e)},t.isFunction=function(e){return!!(e&&e.constructor&&e.call&&e.apply)},t.isMobileDevice=function(){return"undefined"!==typeof window.orientation||-1!==navigator.userAgent.indexOf("IEMobile")},t.cleanupFileArray=function(e,n){var r,o=null,i=[];if(Array.isArray(e)){for(var a=new Set,l=new Set,u=new Set,c=[],s=[],f=[],d=0;d<e.length;++d){var p=e[d];t.isPlainObject(p)?(p.id&&l.has(p.id)?(u.add(p.id),a.add(d)):l.add(p.id),p.name||(s.push(d),a.add(d)),p.id||(c.push(d),a.add(d))):null!==p&&(f.push(d),a.add(d))}u.size>0&&i.push("Some files have duplicate IDs. These IDs appeared multiple times: "+Array.from(u)),c.length>0&&i.push('Some files are missing the "id" field. Relevant file indices: '+c.join(", ")),s.length>0&&i.push('Some files are missing the "name" field. Relevant file indices: '+s.join(", ")),f.length>0&&i.push('Some files have invalid type (they are neither a plain object nor "null"). Relevant file indices: '+f.join(", ")),a.size>0?(r=e.filter((function(e,t){return!a.has(t)})),o=a.size+" offending file"+(1===a.size?" was":"s were")+" removed from the array."):r=e}else r=n?null:[],n&&null===e||(o="Provided value was replaced with "+(n?"null":"empty array")+".",i.push('Expected "files" to be an array, got type "'+typeof e+'" instead (value: '+e+")."));return{cleanFileArray:r,warningMessage:o,warningBullets:i}},t.useFileArrayValidation=function(e,n){var a=o.useMemo((function(){var n=[],r=t.cleanupFileArray(e,!1);if(r.warningMessage){var o='The "files" prop passed to FileBrowser did not pass validation. '+r.warningMessage+" The following errors were encountered:";i.Logger.error(o,i.Logger.formatBullets(r.warningBullets)),n.push({message:o,bullets:r.warningBullets})}return{cleanFiles:r.cleanFileArray,errorMessages:n}}),[e]),l=a.cleanFiles,u=a.errorMessages,c=o.useMemo((function(){var e=[],r=t.cleanupFileArray(n,!0);if(r.warningMessage){var o='The "folderChain" prop passed to FileBrowser did not pass validation. '+r.warningMessage+" The following errors were encountered:";i.Logger.error(o,i.Logger.formatBullets(r.warningBullets)),e.push({message:o,bullets:r.warningBullets})}return{cleanFolderChain:r.cleanFileArray,errorMessages:e}}),[n]),s=c.cleanFolderChain,f=c.errorMessages;return{cleanFiles:l,cleanFolderChain:s,errorMessages:r(u,f)}},t.useFileActionsValidation=function(e,n,a){var l=o.useMemo((function(){if(!a)return e;var t={};e.map((function(e){e&&e.id&&(t[e.id]=!0)}));for(var o=r(e),i=0,l=n;i<l.length;i++){var u=l[i];t[u.id]||o.push(u)}return o}),[e,n,a]),u=o.useMemo((function(){var e=[],n=t.cleanupFileActions(l);if(n.warningMessage){var r='The "fileActions" prop passed to FileBrowser did not pass validation. '+n.warningMessage+" The following errors were encountered:";i.Logger.error(r,i.Logger.formatBullets(n.warningBullets)),e.push({message:r,bullets:n.warningBullets})}return{cleanFileActions:n.cleanFileActions,errorMessages:e}}),[l]);return{cleanFileActions:u.cleanFileActions,errorMessages:u.errorMessages}},t.cleanupFileActions=function(e){var n,r=null,o=[];if(Array.isArray(e)){for(var i=new Set,a=new Set,l=new Set,u=[],c=[],s=0;s<e.length;++s){var f=e[s];t.isPlainObject(f)?(f.id&&a.has(f.id)?(l.add(f.id),i.add(s)):a.add(f.id),f.id||(u.push(s),i.add(s))):(c.push(s),i.add(s))}l.size>0&&o.push("Some file actions have duplicate IDs. These IDs appeared multiple times: "+Array.from(l)),u.length>0&&o.push('Some file actions are missing the "id" field. Relevant file indices: '+u.join(", ")),c.length>0&&o.push("Some files actions have invalid type (they are not plain object). Relevant file indices: "+c.join(", ")),i.size>0?(n=e.filter((function(e,t){return!i.has(t)})),r=i.size+" offending file action"+(1===i.size?" was":"s were")+" removed from the array."):n=e}else n=[],r="Provided value was replaced with an empty array.",o.push('Expected "fileActions" to be an array, got type "'+typeof e+'" instead (value: '+e+").");return{cleanFileActions:n,warningMessage:r,warningBullets:o}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.enableDragAndDropState=void 0;var r=n(9);t.enableDragAndDropState=r.atom({key:"enableDragAndDropState",default:!1})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NOOP_FUNCTION=t.INTENTIONAL_EMPTY_DEPS=void 0;var r=n(49);t.INTENTIONAL_EMPTY_DEPS=[],t.NOOP_FUNCTION=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r.Logger.warn('The "NOOP_FUNCTION" from the constants module was called. This can indicate a bug in one of the components. Supplied args:',e)}},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,l=i.length;a<l;a++,o++)r[o]=i[a];return r};Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionUtil=t.SelectionHelper=t.useSelection=void 0;var i=n(0),a=n(9),l=n(24),u=n(34),c=n(28);t.useSelection=function(e,t){var n=a.useRecoilValue(l.dispatchFileActionState),r=i.useState(new Set),o=r[0],c=r[1],d=i.useRef(0);i.useEffect((function(){var t=f.getSelectedFiles(e,o);d.current===t.length&&0===t.length||(d.current=t.length,n({actionId:u.ChonkyActions.ChangeSelection.id,files:t}))}),[e,n,o]);var h=i.useMemo((function(){return f.getSelectionSize(e,o)}),[e,o]),v=s(t,c),m=i.useRef(new p(e,o));return i.useEffect((function(){m.current.update(e,o)}),[e,o]),{selection:o,selectionSize:h,selectionUtilRef:m,selectionModifiers:v}};var s=function(e,t){var n=i.useCallback((function(n,r){void 0===r&&(r=!0),e||t((function(e){for(var t=r?new Set:new Set(e),o=0,i=n;o<i.length;o++){var a=i[o];t.add(a)}return t}))}),[e,t]),r=i.useCallback((function(n,r){void 0===r&&(r=!1),e||t((function(e){var t=r?new Set:new Set(e);return e.has(n)?t.delete(n):t.add(n),t}))}),[e,t]),o=i.useCallback((function(){e||t((function(e){return 0===e.size?e:new Set}))}),[e,t]);return i.useMemo((function(){return{selectFiles:n,toggleSelection:r,clearSelection:o}}),[n,r,o])},f=function(){function e(){}return e.getSelectedFiles=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=e.filter((function(e){return c.FileHelper.isSelectable(e)&&t.has(e.id)}));return n.reduce((function(e,t){return t?e.filter(t):e}),o)},e.getSelectionSize=function(t,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return e.getSelectedFiles.apply(e,o([t,n],r)).length},e.isSelected=function(e,t){return c.FileHelper.isSelectable(t)&&e.has(t.id)},e}();t.SelectionHelper=f;var d=function(){function e(e,t){void 0===e&&(e=[]),void 0===t&&(t=new Set),this.protectedUpdate(e,t)}return e.prototype.protectedUpdate=function(e,t){this.files=e,this.selection=t},e.prototype.getSelection=function(){return this.selection},e.prototype.getSelectedFiles=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return f.getSelectedFiles.apply(f,o([this.files,this.selection],e))},e.prototype.getSelectionSize=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return f.getSelectionSize.apply(f,o([this.files,this.selection],e))},e.prototype.isSelected=function(e){return f.isSelected(this.selection,e)},e}();t.SelectionUtil=d;var p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.update=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.protectedUpdate.apply(this,e)},t}(d)},function(e,t,n){var r=n(132);function o(){if("function"!==typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}e.exports=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!==typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var l=i?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(n,a,l):n[a]=e[a]}return n.default=e,t&&t.set(e,n),n}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){"use strict";var r=n(36);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(226)),i=r(n(75)),a=r(n(76)),l=r(n(77)),u=r(n(228)),c=n(231),s=(n(40),function(){function e(t){var n=t.maxScrollSize,r=void 0===n?(0,c.getMaxElementSize)():n,a=(0,o.default)(t,["maxScrollSize"]);(0,i.default)(this,e),(0,l.default)(this,"_cellSizeAndPositionManager",void 0),(0,l.default)(this,"_maxScrollSize",void 0),this._cellSizeAndPositionManager=new u.default(a),this._maxScrollSize=r}return(0,a.default)(e,[{key:"areOffsetsAdjusted",value:function(){return this._cellSizeAndPositionManager.getTotalSize()>this._maxScrollSize}},{key:"configure",value:function(e){this._cellSizeAndPositionManager.configure(e)}},{key:"getCellCount",value:function(){return this._cellSizeAndPositionManager.getCellCount()}},{key:"getEstimatedCellSize",value:function(){return this._cellSizeAndPositionManager.getEstimatedCellSize()}},{key:"getLastMeasuredIndex",value:function(){return this._cellSizeAndPositionManager.getLastMeasuredIndex()}},{key:"getOffsetAdjustment",value:function(e){var t=e.containerSize,n=e.offset,r=this._cellSizeAndPositionManager.getTotalSize(),o=this.getTotalSize(),i=this._getOffsetPercentage({containerSize:t,offset:n,totalSize:o});return Math.round(i*(o-r))}},{key:"getSizeAndPositionOfCell",value:function(e){return this._cellSizeAndPositionManager.getSizeAndPositionOfCell(e)}},{key:"getSizeAndPositionOfLastMeasuredCell",value:function(){return this._cellSizeAndPositionManager.getSizeAndPositionOfLastMeasuredCell()}},{key:"getTotalSize",value:function(){return Math.min(this._maxScrollSize,this._cellSizeAndPositionManager.getTotalSize())}},{key:"getUpdatedOffsetForIndex",value:function(e){var t=e.align,n=void 0===t?"auto":t,r=e.containerSize,o=e.currentOffset,i=e.targetIndex;o=this._safeOffsetToOffset({containerSize:r,offset:o});var a=this._cellSizeAndPositionManager.getUpdatedOffsetForIndex({align:n,containerSize:r,currentOffset:o,targetIndex:i});return this._offsetToSafeOffset({containerSize:r,offset:a})}},{key:"getVisibleCellRange",value:function(e){var t=e.containerSize,n=e.offset;return n=this._safeOffsetToOffset({containerSize:t,offset:n}),this._cellSizeAndPositionManager.getVisibleCellRange({containerSize:t,offset:n})}},{key:"resetCell",value:function(e){this._cellSizeAndPositionManager.resetCell(e)}},{key:"_getOffsetPercentage",value:function(e){var t=e.containerSize,n=e.offset,r=e.totalSize;return r<=t?0:n/(r-t)}},{key:"_offsetToSafeOffset",value:function(e){var t=e.containerSize,n=e.offset,r=this._cellSizeAndPositionManager.getTotalSize(),o=this.getTotalSize();if(r===o)return n;var i=this._getOffsetPercentage({containerSize:t,offset:n,totalSize:r});return Math.round(i*(o-t))}},{key:"_safeOffsetToOffset",value:function(e){var t=e.containerSize,n=e.offset,r=this._cellSizeAndPositionManager.getTotalSize(),o=this.getTotalSize();if(r===o)return n;var i=this._getOffsetPercentage({containerSize:t,offset:n,totalSize:o});return Math.round(i*(r-t))}}]),e}());t.default=s},function(e,t,n){"use strict";e.exports=n(271)()?Array.from:n(272)},function(e,t,n){"use strict";var r=n(289),o=n(52),i=n(57),a=Array.prototype.indexOf,l=Object.prototype.hasOwnProperty,u=Math.abs,c=Math.floor;e.exports=function(e){var t,n,s,f;if(!r(e))return a.apply(this,arguments);for(n=o(i(this).length),s=arguments[1],t=s=isNaN(s)?0:s>=0?c(s):o(this.length)-c(u(s));t<n;++t)if(l.call(this,t)&&(f=this[t],r(f)))return t;return-1}},function(e,t,n){"use strict";(function(t,n){var r,o;r=function(e){if("function"!==typeof e)throw new TypeError(e+" is not a function");return e},o=function(e){var t,n,o=document.createTextNode(""),i=0;return new e((function(){var e;if(t)n&&(t=n.concat(t));else{if(!n)return;t=n}if(n=t,t=null,"function"===typeof n)return e=n,n=null,void e();for(o.data=i=++i%2;n;)e=n.shift(),n.length||(n=null),e()})).observe(o,{characterData:!0}),function(e){r(e),t?"function"===typeof t?t=[t,e]:t.push(e):(t=e,o.data=i=++i%2)}},e.exports=function(){if("object"===typeof t&&t&&"function"===typeof t.nextTick)return t.nextTick;if("object"===typeof document&&document){if("function"===typeof MutationObserver)return o(MutationObserver);if("function"===typeof WebKitMutationObserver)return o(WebKitMutationObserver)}return"function"===typeof n?function(e){n(r(e))}:"function"===typeof setTimeout||"object"===typeof setTimeout?function(e){setTimeout(r(e),0)}:null}()}).call(this,n(109),n(147).setImmediate)},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function l(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"===typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"===typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,c=[],s=!1,f=-1;function d(){s&&u&&(s=!1,u.length?c=u.concat(c):f=-1,c.length&&p())}function p(){if(!s){var e=l(d);s=!0;for(var t=c.length;t;){for(u=c,c=[];++f<t;)u&&u[f].run();f=-1,t=c.length}u=null,s=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function v(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new h(e,t)),1!==c.length||s||l(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useFileActionProps=t.useFileActionTrigger=t.useFileActions=void 0;var r=n(0),o=n(9),i=n(24),a=n(39),l=n(80),u=n(68),c=n(111),s=n(22),f=n(81),d=n(375),p=n(34),h=n(28),v=n(55);t.useFileActions=function(e,t){var n=o.useSetRecoilState(i.fileActionsState),a=o.useSetRecoilState(i.fileActionMapState);r.useEffect((function(){for(var t={},r=0,o=e;r<o.length;r++){var i=o[r];t[i.id]=i}n(e),a(t)}),[e,n,a]);var l=d.useInternalFileActionDispatcher(t),u=v.useRefCallbackWithErrorHandling(l,"the internal file action requester"),c=o.useSetRecoilState(i.dispatchFileActionState);r.useEffect((function(){return c((function(){return u}))}),[u,c]);var s=d.useInternalFileActionRequester(),f=v.useRefCallbackWithErrorHandling(s,"the internal file action requester"),p=o.useSetRecoilState(i.requestFileActionState);return r.useEffect((function(){return p((function(){return f}))}),[f,p]),{internalFileActionDispatcher:l,internalFileActionRequester:s}},t.useFileActionTrigger=function(e){var t=o.useRecoilValue(i.requestFileActionState);return r.useCallback((function(){return t(e)}),[e,t])},t.useFileActionProps=function(e){var t=o.useRecoilValue(a.parentFolderState),n=o.useRecoilValue(c.sortConfigState),d=o.useRecoilValue(l.optionMapState),v=o.useRecoilValue(u.searchBarVisibleState),m=o.useRecoilValue(i.fileActionDataState(e)),g=0===o.useRecoilValue(i.fileActionSelectedFilesCountState(e));return r.useMemo((function(){var e,r;if(!m)return{icon:null,active:!1,disabled:!0};var o=null!==(r=null===(e=m.toolbarButton)||void 0===e?void 0:e.icon)&&void 0!==r?r:null;m.sortKeySelector?o=n.fileActionId===m.id?n.order===f.SortOrder.Asc?s.ChonkyIconName.sortAsc:s.ChonkyIconName.sortDesc:s.ChonkyIconName.circle:m.option&&(o=d[m.option.id]?s.ChonkyIconName.checkActive:s.ChonkyIconName.checkInactive);var i=m.id===p.ChonkyActions.ToggleSearch.id&&v,a=m.id===n.fileActionId,l=!!m.option&&!!d[m.option.id],u=i||a||l,c=!!m.requiresSelection&&g;return m.id===p.ChonkyActions.OpenParentFolder.id&&(c=c||!h.FileHelper.isOpenable(t)),{icon:o,active:u,disabled:c}}),[m,n,d,v,t,g])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sortConfigState=void 0;var r=n(9),o=n(81),i=n(34);t.sortConfigState=r.atom({key:"sortConfigState",default:{fileActionId:i.ChonkyActions.SortFilesByName.id,sortKeySelector:i.ChonkyActions.SortFilesByName.sortKeySelector,order:o.SortOrder.Asc}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),a=u(i),l=u(n(3));function u(e){return e&&e.__esModule?e:{default:e}}var c={position:"absolute",top:0,left:0,visibility:"hidden",height:0,overflow:"scroll",whiteSpace:"pre"},s=["extraWidth","injectStyles","inputClassName","inputRef","inputStyle","minWidth","onAutosize","placeholderIsMinWidth"],f=function(e,t){t.style.fontSize=e.fontSize,t.style.fontFamily=e.fontFamily,t.style.fontWeight=e.fontWeight,t.style.fontStyle=e.fontStyle,t.style.letterSpacing=e.letterSpacing,t.style.textTransform=e.textTransform},d=!("undefined"===typeof window||!window.navigator)&&/MSIE |Trident\/|Edge\//.test(window.navigator.userAgent),p=function(){return d?"_"+Math.random().toString(36).substr(2,12):void 0},h=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.inputRef=function(e){n.input=e,"function"===typeof n.props.inputRef&&n.props.inputRef(e)},n.placeHolderSizerRef=function(e){n.placeHolderSizer=e},n.sizerRef=function(e){n.sizer=e},n.state={inputWidth:e.minWidth,inputId:e.id||p()},n}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){this.mounted=!0,this.copyInputStyles(),this.updateInputWidth()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){var t=e.id;t!==this.props.id&&this.setState({inputId:t||p()})}},{key:"componentDidUpdate",value:function(e,t){t.inputWidth!==this.state.inputWidth&&"function"===typeof this.props.onAutosize&&this.props.onAutosize(this.state.inputWidth),this.updateInputWidth()}},{key:"componentWillUnmount",value:function(){this.mounted=!1}},{key:"copyInputStyles",value:function(){if(this.mounted&&window.getComputedStyle){var e=this.input&&window.getComputedStyle(this.input);e&&(f(e,this.sizer),this.placeHolderSizer&&f(e,this.placeHolderSizer))}}},{key:"updateInputWidth",value:function(){if(this.mounted&&this.sizer&&"undefined"!==typeof this.sizer.scrollWidth){var e=void 0;e=this.props.placeholder&&(!this.props.value||this.props.value&&this.props.placeholderIsMinWidth)?Math.max(this.sizer.scrollWidth,this.placeHolderSizer.scrollWidth)+2:this.sizer.scrollWidth+2,(e+="number"===this.props.type&&void 0===this.props.extraWidth?16:parseInt(this.props.extraWidth)||0)<this.props.minWidth&&(e=this.props.minWidth),e!==this.state.inputWidth&&this.setState({inputWidth:e})}}},{key:"getInput",value:function(){return this.input}},{key:"focus",value:function(){this.input.focus()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"renderStyles",value:function(){var e=this.props.injectStyles;return d&&e?a.default.createElement("style",{dangerouslySetInnerHTML:{__html:"input#"+this.state.inputId+"::-ms-clear {display: none;}"}}):null}},{key:"render",value:function(){var e=[this.props.defaultValue,this.props.value,""].reduce((function(e,t){return null!==e&&void 0!==e?e:t})),t=r({},this.props.style);t.display||(t.display="inline-block");var n=r({boxSizing:"content-box",width:this.state.inputWidth+"px"},this.props.inputStyle),o=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(this.props,[]);return function(e){s.forEach((function(t){return delete e[t]}))}(o),o.className=this.props.inputClassName,o.id=this.state.inputId,o.style=n,a.default.createElement("div",{className:this.props.className,style:t},this.renderStyles(),a.default.createElement("input",r({},o,{ref:this.inputRef})),a.default.createElement("div",{ref:this.sizerRef,style:c},e),this.props.placeholder?a.default.createElement("div",{ref:this.placeHolderSizerRef,style:c},this.props.placeholder):null)}}]),t}(i.Component);h.propTypes={className:l.default.string,defaultValue:l.default.any,extraWidth:l.default.oneOfType([l.default.number,l.default.string]),id:l.default.string,injectStyles:l.default.bool,inputClassName:l.default.string,inputRef:l.default.func,inputStyle:l.default.object,minWidth:l.default.oneOfType([l.default.number,l.default.string]),onAutosize:l.default.func,onChange:l.default.func,placeholder:l.default.string,placeholderIsMinWidth:l.default.bool,style:l.default.object,value:l.default.any},h.defaultProps={minWidth:1,injectStyles:!0},t.default=h},function(e,t,n){"use strict";(function(e,r){function o(e){return(o="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){a(e,t,n[t])}))}return e}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(u){o=!0,i=u}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}n.d(t,"a",(function(){return xe})),n.d(t,"b",(function(){return Ce}));var c=function(){},s={},f={},d={mark:c,measure:c};try{"undefined"!==typeof window&&(s=window),"undefined"!==typeof document&&(f=document),"undefined"!==typeof MutationObserver&&MutationObserver,"undefined"!==typeof performance&&(d=performance)}catch(Ee){}var p=(s.navigator||{}).userAgent,h=void 0===p?"":p,v=s,m=f,g=d,y=(v.document,!!m.documentElement&&!!m.head&&"function"===typeof m.addEventListener&&"function"===typeof m.createElement),b=(~h.indexOf("MSIE")||h.indexOf("Trident/"),function(){try{}catch(Ee){return!1}}(),[1,2,3,4,5,6,7,8,9,10]),S=b.concat([11,12,13,14,15,16,17,18,19,20]),w={GROUP:"group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},O=(["xs","sm","lg","fw","ul","li","border","pull-left","pull-right","spin","pulse","rotate-90","rotate-180","rotate-270","flip-horizontal","flip-vertical","flip-both","stack","stack-1x","stack-2x","inverse","layers","layers-text","layers-counter",w.GROUP,w.SWAP_OPACITY,w.PRIMARY,w.SECONDARY].concat(b.map((function(e){return"".concat(e,"x")}))).concat(S.map((function(e){return"w-".concat(e)}))),v.FontAwesomeConfig||{});if(m&&"function"===typeof m.querySelector){[["data-family-prefix","familyPrefix"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach((function(e){var t=u(e,2),n=t[0],r=t[1],o=function(e){return""===e||"false"!==e&&("true"===e||e)}(function(e){var t=m.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}(n));void 0!==o&&null!==o&&(O[r]=o)}))}var C=l({},{familyPrefix:"fa",replacementClass:"svg-inline--fa",autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0},O);C.autoReplaceSvg||(C.observeMutations=!1);var x=l({},C);v.FontAwesomeConfig=x;var E=v||{};E.___FONT_AWESOME___||(E.___FONT_AWESOME___={}),E.___FONT_AWESOME___.styles||(E.___FONT_AWESOME___.styles={}),E.___FONT_AWESOME___.hooks||(E.___FONT_AWESOME___.hooks={}),E.___FONT_AWESOME___.shims||(E.___FONT_AWESOME___.shims=[]);var k=E.___FONT_AWESOME___,_=[];y&&((m.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(m.readyState)||m.addEventListener("DOMContentLoaded",(function e(){m.removeEventListener("DOMContentLoaded",e),1,_.map((function(e){return e()}))})));var T,j=function(){},P="undefined"!==typeof e&&"undefined"!==typeof e.process&&"function"===typeof e.process.emit,A="undefined"===typeof r?setTimeout:r,I=[];function M(){for(var e=0;e<I.length;e++)I[e][0](I[e][1]);I=[],T=!1}function D(e,t){I.push([e,t]),T||(T=!0,A(M,0))}function R(e){var t=e.owner,n=t._state,r=t._data,o=e[n],i=e.then;if("function"===typeof o){n="fulfilled";try{r=o(r)}catch(Ee){L(i,Ee)}}N(i,r)||("fulfilled"===n&&F(i,r),"rejected"===n&&L(i,r))}function N(e,t){var n;try{if(e===t)throw new TypeError("A promises callback cannot return that same promise.");if(t&&("function"===typeof t||"object"===o(t))){var r=t.then;if("function"===typeof r)return r.call(t,(function(r){n||(n=!0,t===r?z(e,r):F(e,r))}),(function(t){n||(n=!0,L(e,t))})),!0}}catch(Ee){return n||L(e,Ee),!0}return!1}function F(e,t){e!==t&&N(e,t)||z(e,t)}function z(e,t){"pending"===e._state&&(e._state="settled",e._data=t,D(H,e))}function L(e,t){"pending"===e._state&&(e._state="settled",e._data=t,D(B,e))}function V(e){e._then=e._then.forEach(R)}function H(e){e._state="fulfilled",V(e)}function B(t){t._state="rejected",V(t),!t._handled&&P&&e.process.emit("unhandledRejection",t._data,t)}function W(t){e.process.emit("rejectionHandled",t)}function U(e){if("function"!==typeof e)throw new TypeError("Promise resolver "+e+" is not a function");if(this instanceof U===!1)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._then=[],function(e,t){function n(e){L(t,e)}try{e((function(e){F(t,e)}),n)}catch(Ee){n(Ee)}}(e,this)}U.prototype={constructor:U,_state:"pending",_then:null,_data:void 0,_handled:!1,then:function(e,t){var n={owner:this,then:new this.constructor(j),fulfilled:e,rejected:t};return!t&&!e||this._handled||(this._handled=!0,"rejected"===this._state&&P&&D(W,this)),"fulfilled"===this._state||"rejected"===this._state?D(R,n):this._then.push(n),n.then},catch:function(e){return this.then(null,e)}},U.all=function(e){if(!Array.isArray(e))throw new TypeError("You must pass an array to Promise.all().");return new U((function(t,n){var r=[],o=0;function i(e){return o++,function(n){r[e]=n,--o||t(r)}}for(var a,l=0;l<e.length;l++)(a=e[l])&&"function"===typeof a.then?a.then(i(l),n):r[l]=a;o||t(r)}))},U.race=function(e){if(!Array.isArray(e))throw new TypeError("You must pass an array to Promise.race().");return new U((function(t,n){for(var r,o=0;o<e.length;o++)(r=e[o])&&"function"===typeof r.then?r.then(t,n):t(r)}))},U.resolve=function(e){return e&&"object"===o(e)&&e.constructor===U?e:new U((function(t){t(e)}))},U.reject=function(e){return new U((function(t,n){n(e)}))};var $={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function K(e){if(e&&y){var t=m.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e;for(var n=m.head.childNodes,r=null,o=n.length-1;o>-1;o--){var i=n[o],a=(i.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(a)>-1&&(r=i)}return m.head.insertBefore(t,r),e}}function q(){for(var e=12,t="";e-- >0;)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[62*Math.random()|0];return t}function G(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function Y(e){return Object.keys(e||{}).reduce((function(t,n){return t+"".concat(n,": ").concat(e[n],";")}),"")}function X(e){return e.size!==$.size||e.x!==$.x||e.y!==$.y||e.rotate!==$.rotate||e.flipX||e.flipY}function Q(e){var t=e.transform,n=e.containerWidth,r=e.iconWidth,o={transform:"translate(".concat(n/2," 256)")},i="translate(".concat(32*t.x,", ").concat(32*t.y,") "),a="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),l="rotate(".concat(t.rotate," 0 0)");return{outer:o,inner:{transform:"".concat(i," ").concat(a," ").concat(l)},path:{transform:"translate(".concat(r/2*-1," -256)")}}}var Z={x:0,y:0,width:"100%",height:"100%"};function J(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.attributes&&(e.attributes.fill||t)&&(e.attributes.fill="black"),e}function ee(e){var t=e.icons,n=t.main,r=t.mask,o=e.prefix,i=e.iconName,a=e.transform,u=e.symbol,c=e.title,s=e.maskId,f=e.titleId,d=e.extra,p=e.watchable,h=void 0!==p&&p,v=r.found?r:n,m=v.width,g=v.height,y="fa-w-".concat(Math.ceil(m/g*16)),b=[x.replacementClass,i?"".concat(x.familyPrefix,"-").concat(i):"",y].filter((function(e){return-1===d.classes.indexOf(e)})).concat(d.classes).join(" "),S={children:[],attributes:l({},d.attributes,{"data-prefix":o,"data-icon":i,class:b,role:d.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(m," ").concat(g)})};h&&(S.attributes["data-fa-i2svg"]=""),c&&S.children.push({tag:"title",attributes:{id:S.attributes["aria-labelledby"]||"title-".concat(f||q())},children:[c]});var w=l({},S,{prefix:o,iconName:i,main:n,mask:r,maskId:s,transform:a,symbol:u,styles:d.styles}),O=r.found&&n.found?function(e){var t,n=e.children,r=e.attributes,o=e.main,i=e.mask,a=e.maskId,u=e.transform,c=o.width,s=o.icon,f=i.width,d=i.icon,p=Q({transform:u,containerWidth:f,iconWidth:c}),h={tag:"rect",attributes:l({},Z,{fill:"white"})},v=s.children?{children:s.children.map(J)}:{},m={tag:"g",attributes:l({},p.inner),children:[J(l({tag:s.tag,attributes:l({},s.attributes,p.path)},v))]},g={tag:"g",attributes:l({},p.outer),children:[m]},y="mask-".concat(a||q()),b="clip-".concat(a||q()),S={tag:"mask",attributes:l({},Z,{id:y,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[h,g]},w={tag:"defs",children:[{tag:"clipPath",attributes:{id:b},children:(t=d,"g"===t.tag?t.children:[t])},S]};return n.push(w,{tag:"rect",attributes:l({fill:"currentColor","clip-path":"url(#".concat(b,")"),mask:"url(#".concat(y,")")},Z)}),{children:n,attributes:r}}(w):function(e){var t=e.children,n=e.attributes,r=e.main,o=e.transform,i=Y(e.styles);if(i.length>0&&(n.style=i),X(o)){var a=Q({transform:o,containerWidth:r.width,iconWidth:r.width});t.push({tag:"g",attributes:l({},a.outer),children:[{tag:"g",attributes:l({},a.inner),children:[{tag:r.icon.tag,children:r.icon.children,attributes:l({},r.icon.attributes,a.path)}]}]})}else t.push(r.icon);return{children:t,attributes:n}}(w),C=O.children,E=O.attributes;return w.children=C,w.attributes=E,u?function(e){var t=e.prefix,n=e.iconName,r=e.children,o=e.attributes,i=e.symbol;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:l({},o,{id:!0===i?"".concat(t,"-").concat(x.familyPrefix,"-").concat(n):i}),children:r}]}]}(w):function(e){var t=e.children,n=e.main,r=e.mask,o=e.attributes,i=e.styles,a=e.transform;if(X(a)&&n.found&&!r.found){var u={x:n.width/n.height/2,y:.5};o.style=Y(l({},i,{"transform-origin":"".concat(u.x+a.x/16,"em ").concat(u.y+a.y/16,"em")}))}return[{tag:"svg",attributes:o,children:t}]}(w)}var te=function(){},ne=(x.measurePerformance&&g&&g.mark&&g.measure,function(e,t,n,r){var o,i,a,l=Object.keys(e),u=l.length,c=void 0!==r?function(e,t){return function(n,r,o,i){return e.call(t,n,r,o,i)}}(t,r):t;for(void 0===n?(o=1,a=e[l[0]]):(o=0,a=n);o<u;o++)a=c(a,e[i=l[o]],i,e);return a});function re(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.skipHooks,o=void 0!==r&&r,i=Object.keys(t).reduce((function(e,n){var r=t[n];return!!r.icon?e[r.iconName]=r.icon:e[n]=r,e}),{});"function"!==typeof k.hooks.addPack||o?k.styles[e]=l({},k.styles[e]||{},i):k.hooks.addPack(e,i),"fas"===e&&re("fa",t)}var oe=k.styles,ie=k.shims,ae=function(){var e=function(e){return ne(oe,(function(t,n,r){return t[r]=ne(n,e,{}),t}),{})};e((function(e,t,n){return t[3]&&(e[t[3]]=n),e})),e((function(e,t,n){var r=t[2];return e[n]=n,r.forEach((function(t){e[t]=n})),e}));var t="far"in oe;ne(ie,(function(e,n){var r=n[0],o=n[1],i=n[2];return"far"!==o||t||(o="fas"),e[r]={prefix:o,iconName:i},e}),{})};ae();k.styles;function le(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}function ue(e){var t=e.tag,n=e.attributes,r=void 0===n?{}:n,o=e.children,i=void 0===o?[]:o;return"string"===typeof e?G(e):"<".concat(t," ").concat(function(e){return Object.keys(e||{}).reduce((function(t,n){return t+"".concat(n,'="').concat(G(e[n]),'" ')}),"").trim()}(r),">").concat(i.map(ue).join(""),"</").concat(t,">")}var ce=function(e){var t={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return e?e.toLowerCase().split(" ").reduce((function(e,t){var n=t.toLowerCase().split("-"),r=n[0],o=n.slice(1).join("-");if(r&&"h"===o)return e.flipX=!0,e;if(r&&"v"===o)return e.flipY=!0,e;if(o=parseFloat(o),isNaN(o))return e;switch(r){case"grow":e.size=e.size+o;break;case"shrink":e.size=e.size-o;break;case"left":e.x=e.x-o;break;case"right":e.x=e.x+o;break;case"up":e.y=e.y-o;break;case"down":e.y=e.y+o;break;case"rotate":e.rotate=e.rotate+o}return e}),t):t};function se(e){this.name="MissingIcon",this.message=e||"Icon unavailable",this.stack=(new Error).stack}se.prototype=Object.create(Error.prototype),se.prototype.constructor=se;var fe={fill:"currentColor"},de={attributeType:"XML",repeatCount:"indefinite",dur:"2s"},pe={tag:"path",attributes:l({},fe,{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})},he=l({},de,{attributeName:"opacity"});l({},fe,{cx:"256",cy:"364",r:"28"}),l({},de,{attributeName:"r",values:"28;14;28;28;14;28;"}),l({},he,{values:"1;0;1;1;0;1;"}),l({},fe,{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),l({},he,{values:"1;0;0;0;0;1;"}),l({},fe,{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),l({},he,{values:"0;0;1;1;0;0;"}),k.styles;function ve(e){var t=e[0],n=e[1],r=u(e.slice(4),1)[0];return{found:!0,width:t,height:n,icon:Array.isArray(r)?{tag:"g",attributes:{class:"".concat(x.familyPrefix,"-").concat(w.GROUP)},children:[{tag:"path",attributes:{class:"".concat(x.familyPrefix,"-").concat(w.SECONDARY),fill:"currentColor",d:r[0]}},{tag:"path",attributes:{class:"".concat(x.familyPrefix,"-").concat(w.PRIMARY),fill:"currentColor",d:r[1]}}]}:{tag:"path",attributes:{fill:"currentColor",d:r}}}}k.styles;function me(){var e="svg-inline--fa",t=x.familyPrefix,n=x.replacementClass,r='svg:not(:root).svg-inline--fa {\n overflow: visible;\n}\n\n.svg-inline--fa {\n display: inline-block;\n font-size: inherit;\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-lg {\n vertical-align: -0.225em;\n}\n.svg-inline--fa.fa-w-1 {\n width: 0.0625em;\n}\n.svg-inline--fa.fa-w-2 {\n width: 0.125em;\n}\n.svg-inline--fa.fa-w-3 {\n width: 0.1875em;\n}\n.svg-inline--fa.fa-w-4 {\n width: 0.25em;\n}\n.svg-inline--fa.fa-w-5 {\n width: 0.3125em;\n}\n.svg-inline--fa.fa-w-6 {\n width: 0.375em;\n}\n.svg-inline--fa.fa-w-7 {\n width: 0.4375em;\n}\n.svg-inline--fa.fa-w-8 {\n width: 0.5em;\n}\n.svg-inline--fa.fa-w-9 {\n width: 0.5625em;\n}\n.svg-inline--fa.fa-w-10 {\n width: 0.625em;\n}\n.svg-inline--fa.fa-w-11 {\n width: 0.6875em;\n}\n.svg-inline--fa.fa-w-12 {\n width: 0.75em;\n}\n.svg-inline--fa.fa-w-13 {\n width: 0.8125em;\n}\n.svg-inline--fa.fa-w-14 {\n width: 0.875em;\n}\n.svg-inline--fa.fa-w-15 {\n width: 0.9375em;\n}\n.svg-inline--fa.fa-w-16 {\n width: 1em;\n}\n.svg-inline--fa.fa-w-17 {\n width: 1.0625em;\n}\n.svg-inline--fa.fa-w-18 {\n width: 1.125em;\n}\n.svg-inline--fa.fa-w-19 {\n width: 1.1875em;\n}\n.svg-inline--fa.fa-w-20 {\n width: 1.25em;\n}\n.svg-inline--fa.fa-pull-left {\n margin-right: 0.3em;\n width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n margin-left: 0.3em;\n width: auto;\n}\n.svg-inline--fa.fa-border {\n height: 1.5em;\n}\n.svg-inline--fa.fa-li {\n width: 2em;\n}\n.svg-inline--fa.fa-fw {\n width: 1.25em;\n}\n\n.fa-layers svg.svg-inline--fa {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.fa-layers {\n display: inline-block;\n height: 1em;\n position: relative;\n text-align: center;\n vertical-align: -0.125em;\n width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-counter, .fa-layers-text {\n display: inline-block;\n position: absolute;\n text-align: center;\n}\n\n.fa-layers-text {\n left: 50%;\n top: 50%;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-counter {\n background-color: #ff253a;\n border-radius: 1em;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n color: #fff;\n height: 1.5em;\n line-height: 1;\n max-width: 5em;\n min-width: 1.5em;\n overflow: hidden;\n padding: 0.25em;\n right: 0;\n text-overflow: ellipsis;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n bottom: 0;\n right: 0;\n top: auto;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: bottom right;\n transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n bottom: 0;\n left: 0;\n right: auto;\n top: auto;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: bottom left;\n transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n right: 0;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-top-left {\n left: 0;\n right: auto;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top left;\n transform-origin: top left;\n}\n\n.fa-lg {\n font-size: 1.3333333333em;\n line-height: 0.75em;\n vertical-align: -0.0667em;\n}\n\n.fa-xs {\n font-size: 0.75em;\n}\n\n.fa-sm {\n font-size: 0.875em;\n}\n\n.fa-1x {\n font-size: 1em;\n}\n\n.fa-2x {\n font-size: 2em;\n}\n\n.fa-3x {\n font-size: 3em;\n}\n\n.fa-4x {\n font-size: 4em;\n}\n\n.fa-5x {\n font-size: 5em;\n}\n\n.fa-6x {\n font-size: 6em;\n}\n\n.fa-7x {\n font-size: 7em;\n}\n\n.fa-8x {\n font-size: 8em;\n}\n\n.fa-9x {\n font-size: 9em;\n}\n\n.fa-10x {\n font-size: 10em;\n}\n\n.fa-fw {\n text-align: center;\n width: 1.25em;\n}\n\n.fa-ul {\n list-style-type: none;\n margin-left: 2.5em;\n padding-left: 0;\n}\n.fa-ul > li {\n position: relative;\n}\n\n.fa-li {\n left: -2em;\n position: absolute;\n text-align: center;\n width: 2em;\n line-height: inherit;\n}\n\n.fa-border {\n border: solid 0.08em #eee;\n border-radius: 0.1em;\n padding: 0.2em 0.25em 0.15em;\n}\n\n.fa-pull-left {\n float: left;\n}\n\n.fa-pull-right {\n float: right;\n}\n\n.fa.fa-pull-left,\n.fas.fa-pull-left,\n.far.fa-pull-left,\n.fal.fa-pull-left,\n.fab.fa-pull-left {\n margin-right: 0.3em;\n}\n.fa.fa-pull-right,\n.fas.fa-pull-right,\n.far.fa-pull-right,\n.fal.fa-pull-right,\n.fab.fa-pull-right {\n margin-left: 0.3em;\n}\n\n.fa-spin {\n -webkit-animation: fa-spin 2s infinite linear;\n animation: fa-spin 2s infinite linear;\n}\n\n.fa-pulse {\n -webkit-animation: fa-spin 1s infinite steps(8);\n animation: fa-spin 1s infinite steps(8);\n}\n\n@-webkit-keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.fa-rotate-90 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";\n -webkit-transform: rotate(90deg);\n transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";\n -webkit-transform: scale(-1, 1);\n transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";\n -webkit-transform: scale(1, -1);\n transform: scale(1, -1);\n}\n\n.fa-flip-both, .fa-flip-horizontal.fa-flip-vertical {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";\n -webkit-transform: scale(-1, -1);\n transform: scale(-1, -1);\n}\n\n:root .fa-rotate-90,\n:root .fa-rotate-180,\n:root .fa-rotate-270,\n:root .fa-flip-horizontal,\n:root .fa-flip-vertical,\n:root .fa-flip-both {\n -webkit-filter: none;\n filter: none;\n}\n\n.fa-stack {\n display: inline-block;\n height: 2em;\n position: relative;\n width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.svg-inline--fa.fa-stack-1x {\n height: 1em;\n width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n height: 2em;\n width: 2.5em;\n}\n\n.fa-inverse {\n color: #fff;\n}\n\n.sr-only {\n border: 0;\n clip: rect(0, 0, 0, 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n width: 1px;\n}\n\n.sr-only-focusable:active, .sr-only-focusable:focus {\n clip: auto;\n height: auto;\n margin: 0;\n overflow: visible;\n position: static;\n width: auto;\n}\n\n.svg-inline--fa .fa-primary {\n fill: var(--fa-primary-color, currentColor);\n opacity: 1;\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n fill: var(--fa-secondary-color, currentColor);\n opacity: 0.4;\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n opacity: 0.4;\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n opacity: 1;\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n fill: black;\n}\n\n.fad.fa-inverse {\n color: #fff;\n}';if("fa"!==t||n!==e){var o=new RegExp("\\.".concat("fa","\\-"),"g"),i=new RegExp("\\--".concat("fa","\\-"),"g"),a=new RegExp("\\.".concat(e),"g");r=r.replace(o,".".concat(t,"-")).replace(i,"--".concat(t,"-")).replace(a,".".concat(n))}return r}function ge(){x.autoAddCss&&!Oe&&(K(me()),Oe=!0)}function ye(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map((function(e){return ue(e)}))}}),Object.defineProperty(e,"node",{get:function(){if(y){var t=m.createElement("div");return t.innerHTML=e.html,t.children}}}),e}function be(e){var t=e.prefix,n=void 0===t?"fa":t,r=e.iconName;if(r)return le(we.definitions,n,r)||le(k.styles,n,r)}var Se,we=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.definitions={}}var t,n,r;return t=e,(n=[{key:"add",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n.reduce(this._pullDefinitions,{});Object.keys(o).forEach((function(t){e.definitions[t]=l({},e.definitions[t]||{},o[t]),re(t,o[t]),ae()}))}},{key:"reset",value:function(){this.definitions={}}},{key:"_pullDefinitions",value:function(e,t){var n=t.prefix&&t.iconName&&t.icon?{0:t}:t;return Object.keys(n).map((function(t){var r=n[t],o=r.prefix,i=r.iconName,a=r.icon;e[o]||(e[o]={}),e[o][i]=a})),e}}])&&i(t.prototype,n),r&&i(t,r),e}()),Oe=!1,Ce={transform:function(e){return ce(e)}},xe=(Se=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.transform,r=void 0===n?$:n,o=t.symbol,i=void 0!==o&&o,a=t.mask,u=void 0===a?null:a,c=t.maskId,s=void 0===c?null:c,f=t.title,d=void 0===f?null:f,p=t.titleId,h=void 0===p?null:p,v=t.classes,m=void 0===v?[]:v,g=t.attributes,y=void 0===g?{}:g,b=t.styles,S=void 0===b?{}:b;if(e){var w=e.prefix,O=e.iconName,C=e.icon;return ye(l({type:"icon"},e),(function(){return ge(),x.autoA11y&&(d?y["aria-labelledby"]="".concat(x.replacementClass,"-title-").concat(h||q()):(y["aria-hidden"]="true",y.focusable="false")),ee({icons:{main:ve(C),mask:u?ve(u.icon):{found:!1,width:null,height:null,icon:{}}},prefix:w,iconName:O,transform:l({},$,r),symbol:i,title:d,maskId:s,titleId:h,extra:{attributes:y,styles:S,classes:m}})}))}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(e||{}).icon?e:be(e||{}),r=t.mask;return r&&(r=(r||{}).icon?r:be(r||{})),Se(n,l({},t,{mask:r}))})}).call(this,n(35),n(147).setImmediate)},function(e,t,n){"use strict";(function(e,r){var o,i=n(168);o="undefined"!==typeof self?self:"undefined"!==typeof window?window:"undefined"!==typeof e?e:r;var a=Object(i.a)(o);t.a=a}).call(this,n(35),n(373)(e))},function(e,t,n){"use strict";(function(e){function r(e){i.length||(o(),!0),i[i.length]=e}n.d(t,"a",(function(){return r}));var o,i=[],a=0;function l(){for(;a<i.length;){var e=a;if(a+=1,i[e].call(),a>1024){for(var t=0,n=i.length-a;t<n;t++)i[t]=i[t+a];i.length-=a,a=0}}i.length=0,a=0,!1}var u="undefined"!==typeof e?e:self,c=u.MutationObserver||u.WebKitMutationObserver;function s(e){return function(){var t=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(t),clearInterval(n),e()}}}o="function"===typeof c?function(e){var t=1,n=new c(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}(l):s(l),r.requestFlush=o,r.makeRequestCallFromTimer=s}).call(this,n(35))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"d",(function(){return a})),n.d(t,"b",(function(){return l})),n.d(t,"c",(function(){return u}));var r=n(0),o=(n(3),r.createContext(null));function i(e){var t=e.children,n=e.value,i=function(){var e=r.useState(null),t=e[0],n=e[1];return r.useEffect((function(){n("mui-p-".concat(Math.round(1e5*Math.random())))}),[]),t}(),a=r.useMemo((function(){return{idPrefix:i,value:n}}),[i,n]);return r.createElement(o.Provider,{value:a},t)}function a(){return r.useContext(o)}function l(e,t){return null===e.idPrefix?null:"".concat(e.idPrefix,"-P-").concat(t)}function u(e,t){return null===e.idPrefix?null:"".concat(e.idPrefix,"-T-").concat(t)}},,,,function(e,t,n){"use strict";var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(o){return!1}}()?Object.assign:function(e,t){for(var n,l,u=a(e),c=1;c<arguments.length;c++){for(var s in n=Object(arguments[c]))o.call(n,s)&&(u[s]=n[s]);if(r){l=r(n);for(var f=0;f<l.length;f++)i.call(n,l[f])&&(u[l[f]]=n[l[f]])}}return u}},,function(e,t,n){},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t){e.exports=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fileEntrySizeState=void 0;var r=n(9),o=n(131);t.fileEntrySizeState=r.atom({key:"fileEntrySizeState",default:o.DefaultEntrySize})},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useGridRenderer=t.noContentRenderer=t.useEntryRenderer=t.getRowHeight=t.getColWidth=t.DefaultEntrySize=t.SmallThumbsSize=void 0;var u=l(n(50)),c=a(n(0)),s=n(221),f=n(22),d=n(99),p=n(238),h=n(42);t.SmallThumbsSize={width:165,height:130},t.DefaultEntrySize=t.SmallThumbsSize,t.getColWidth=function(e,t,n,r){return e===t-1?n.width:n.width+r},t.getRowHeight=function(e,t,n,r){return n.height+r},t.useEntryRenderer=function(e){return c.useCallback((function(t,n,r,o,i,a,l){if("number"===typeof i&&(l||(r.width=r.width-i),r.height=r.height-i),a&&(r.height=r.height-1),l&&(r.width=r.width-1),n>=e.length)return null;var u=e[n],s=u?u.id:"loading-file-"+t;return c.default.createElement("div",{key:s,className:"chonky-virtualization-wrapper",style:r},c.default.createElement(p.SmartFileEntry,{fileId:u?u.id:null,displayIndex:n}))}),[e])},t.noContentRenderer=function(e){var t={className:u.default({"chonky-file-list-notification":!0,"chonky-file-list-notification-empty":!0})};return"number"===typeof e&&(t.style={height:e}),c.default.createElement("div",r({},t),c.default.createElement("div",{className:"chonky-file-list-notification-content"},c.default.createElement(h.ChonkyIconFA,{icon:f.ChonkyIconName.folderOpen}),"\xa0 Nothing to show"))},t.useGridRenderer=function(e,n,o,i,a){return c.useCallback((function(l){var u,f=l.width,p=l.height,h=d.isMobileDevice(),v=h?5:8;if(h)u=2;else{var m=(f+v-(!a||h?0:16))/(n.width+v);u=Math.max(1,Math.floor(m))}var g=Math.ceil(e.length/u);return c.default.createElement(s.Grid,{style:{minHeight:n.height+10},ref:i,cellRenderer:function(e){var t=e.rowIndex*u+e.columnIndex;return o(e.key,t,r({},e.style),e.parent,v,e.rowIndex===g-1,e.columnIndex===u-1)},noContentRenderer:function(){return t.noContentRenderer(n.height)},rowCount:g,columnCount:u,columnWidth:function(e){var r=e.index;return t.getColWidth(r,u,n,v)},rowHeight:function(e){var r=e.index;return t.getRowHeight(r,g,n,v)},overscanRowCount:2,width:f,containerStyle:{minHeight:50},height:"number"===typeof p?p:500,autoHeight:!a,tabIndex:null})}),[e,n,o,i,a])}},function(e,t){function n(t){return"function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t,n){var r=n(132),o=n(104);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!==typeof t?o(e):t}},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t,n){var r=n(224);e.exports=function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.cellCount,n=e.overscanCellsCount,r=e.scrollDirection,o=e.startIndex,i=e.stopIndex;return 1===r?{overscanStartIndex:Math.max(0,o),overscanStopIndex:Math.min(t-1,i+n)}:{overscanStartIndex:Math.max(0,o-n),overscanStopIndex:Math.min(t-1,i)}},t.SCROLL_DIRECTION_VERTICAL=t.SCROLL_DIRECTION_HORIZONTAL=t.SCROLL_DIRECTION_FORWARD=t.SCROLL_DIRECTION_BACKWARD=void 0;n(40);t.SCROLL_DIRECTION_BACKWARD=-1;t.SCROLL_DIRECTION_FORWARD=1;t.SCROLL_DIRECTION_HORIZONTAL="horizontal";t.SCROLL_DIRECTION_VERTICAL="vertical"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){for(var t=e.cellCache,n=e.cellRenderer,r=e.columnSizeAndPositionManager,o=e.columnStartIndex,i=e.columnStopIndex,a=e.deferredMeasurementCache,l=e.horizontalOffsetAdjustment,u=e.isScrolling,c=e.isScrollingOptOut,s=e.parent,f=e.rowSizeAndPositionManager,d=e.rowStartIndex,p=e.rowStopIndex,h=e.styleCache,v=e.verticalOffsetAdjustment,m=e.visibleColumnIndices,g=e.visibleRowIndices,y=[],b=r.areOffsetsAdjusted()||f.areOffsetsAdjusted(),S=!u&&!b,w=d;w<=p;w++)for(var O=f.getSizeAndPositionOfCell(w),C=o;C<=i;C++){var x=r.getSizeAndPositionOfCell(C),E=C>=m.start&&C<=m.stop&&w>=g.start&&w<=g.stop,k="".concat(w,"-").concat(C),_=void 0;S&&h[k]?_=h[k]:a&&!a.has(w,C)?_={height:"auto",left:0,position:"absolute",top:0,width:"auto"}:(_={height:O.size,left:x.offset+l,position:"absolute",top:O.offset+v,width:x.size},h[k]=_);var T={columnIndex:C,isScrolling:u,isVisible:E,key:k,parent:s,rowIndex:w,style:_},j=void 0;!c&&!u||l||v?j=n(T):(t[k]||(t[k]=n(T)),j=t[k]),null!=j&&!1!==j&&y.push(j)}return y};n(40)},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ClickableFileEntry=void 0;var i=o(n(0)),a=n(28),l=n(239),u=n(241),c=n(372);t.ClickableFileEntry=i.default.memo((function(e){var t=e.file,n=e.displayIndex,o=c.useFileClickHandlers(t,n),s=r({wrapperTag:"div",passthroughProps:{className:"chonky-file-entry-clickable-wrapper chonky-fill-parent"}},a.FileHelper.isClickable(t)?o:void 0);return i.default.createElement(l.ClickableWrapper,r({},s),i.default.createElement(u.BaseFileEntry,r({},e)))}))},function(e,t,n){"use strict";var r=n(51),o=Array.prototype.forEach,i=Object.create,a=function(e,t){var n;for(n in e)t[n]=e[n]};e.exports=function(e){var t=i(null);return o.call(arguments,(function(e){r(e)&&a(Object(e),t)})),t}},function(e,t,n){"use strict";var r=n(52);e.exports=function(e,t,n){var o;return isNaN(e)?(o=t)>=0?n&&o?o-1:o:1:!1!==e&&r(e)}},function(e,t,n){"use strict";e.exports=n(255)()?Object.assign:n(256)},function(e,t,n){"use strict";var r,o,i,a,l=n(52),u=function(e,t){return t};try{Object.defineProperty(u,"length",{configurable:!0,writable:!1,enumerable:!1,value:1})}catch(c){}1===u.length?(r={configurable:!0,writable:!1,enumerable:!1},o=Object.defineProperty,e.exports=function(e,t){return t=l(t),e.length===t?e:(r.value=t,o(e,"length",r))}):(a=n(143),i=function(){var e=[];return function(t){var n,r=0;if(e[t])return e[t];for(n=[];t--;)n.push("a"+(++r).toString(36));return new Function("fn","return function ("+n.join(", ")+") { return fn.apply(this, arguments); };")}}(),e.exports=function(e,t){var n;if(t=l(t),e.length===t)return e;n=i(t)(e);try{a(n,e)}catch(c){}return n})},function(e,t,n){"use strict";var r=n(57),o=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols;e.exports=function(e,t){var n,u=Object(r(t));if(e=Object(r(e)),a(u).forEach((function(r){try{o(e,r,i(t,r))}catch(a){n=a}})),"function"===typeof l&&l(u).forEach((function(r){try{o(e,r,i(t,r))}catch(a){n=a}})),void 0!==n)throw n;return e}},function(e,t,n){"use strict";e.exports=function(e){return void 0!==e&&null!==e}},function(e,t,n){"use strict";var r=n(278);e.exports=function(e){if(!r(e))throw new TypeError(e+" is not a symbol");return e}},function(e,t,n){"use strict";var r=n(41),o=n(78),i=Function.prototype.call;e.exports=function(e,t){var n={},a=arguments[2];return r(t),o(e,(function(e,r,o,l){n[r]=i.call(t,a,e,r,o,l)})),n}},function(e,t,n){(function(e){var r="undefined"!==typeof e&&e||"undefined"!==typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(295),t.setImmediate="undefined"!==typeof self&&self.setImmediate||"undefined"!==typeof e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!==typeof self&&self.clearImmediate||"undefined"!==typeof e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(35))},function(e,t,n){"use strict";e.exports=function(e){return"function"===typeof e}},function(e,t){function n(e){return!!e&&("object"===typeof e||"function"===typeof e)&&"function"===typeof e.then}e.exports=n,e.exports.default=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.thumbnailGeneratorState=void 0;var r=n(9);t.thumbnailGeneratorState=r.atom({key:"thumbnailGeneratorState",default:null})},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.DnDFileEntry=t.DnDFileEntryType=void 0;var l=a(n(0)),u=n(152),c=n(396),s=n(9),f=n(66),d=n(48),p=n(28),h=n(138);t.DnDFileEntryType="chonky-file-entry",t.DnDFileEntry=l.default.memo((function(e){var n=e.file,o=s.useRecoilValue(f.dispatchSpecialActionState),i=p.FileHelper.isDraggable(n),a=l.useCallback((function(){p.FileHelper.isDraggable(n)&&o({actionId:d.SpecialAction.DragNDropStart,dragSource:n})}),[o,n]),v=l.useCallback((function(e,t){var r=t.getDropResult();p.FileHelper.isDraggable(n)&&r&&r.dropTarget&&o({actionId:d.SpecialAction.DragNDropEnd,dragSource:n,dropTarget:r.dropTarget,dropEffect:r.dropEffect})}),[o,n]),m=l.useCallback((function(e,t){if(t.canDrop())return{dropTarget:n}}),[n]),g=l.useCallback((function(e){var t=n&&e.file&&n.id===e.file.id;return p.FileHelper.isDroppable(n)&&!t}),[n]),y=u.useDrag({item:{type:t.DnDFileEntryType,file:n},canDrag:i,begin:a,end:v,collect:function(e){return{isDragging:e.isDragging()}}}),b=y[0].isDragging,S=y[1],w=y[2],O=u.useDrop({accept:t.DnDFileEntryType,drop:m,canDrop:g,collect:function(e){return{isOver:e.isOver(),canDrop:e.canDrop()}}}),C=O[0],x=C.isOver,E=C.canDrop,k=O[1];return l.useEffect((function(){w(c.getEmptyImage(),{captureDraggingState:!0})}),[w]),l.default.createElement("div",{ref:k,className:"chonky-file-entry-droppable-wrapper chonky-fill-parent"},l.default.createElement("div",{ref:p.FileHelper.isDraggable(n)?S:null,className:"chonky-file-entry-draggable-wrapper chonky-fill-parent"},l.default.createElement(h.ClickableFileEntry,r({},e,{dndIsDragging:b,dndIsOver:x,dndCanDrop:E}))))}))},function(e,t,n){"use strict";n.r(t);var r=n(165);n.d(t,"DndContext",(function(){return r.a})),n.d(t,"createDndContext",(function(){return r.d})),n.d(t,"DndProvider",(function(){return r.b})),n.d(t,"DragPreviewImage",(function(){return r.c}));var o=n(154);for(var i in o)["DndContext","createDndContext","DndProvider","DragPreviewImage","default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(i);var a=n(164);n.d(t,"useDrag",(function(){return a.a})),n.d(t,"useDrop",(function(){return a.d})),n.d(t,"useDragLayer",(function(){return a.c})),n.d(t,"useDragDropManager",(function(){return a.b}));var l=n(159);for(var i in l)["DndContext","createDndContext","DndProvider","DragPreviewImage","useDrag","useDrop","useDragLayer","useDragDropManager","default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return l[e]}))}(i)},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return c}));var r=n(0),o=n(29);function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(u){o=!0,i=u}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var u=0,c=Object(r.memo)((function(e){var t=e.children,n=i(function(e){if("manager"in e){return[{dragDropManager:e.manager},!1]}var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f(),n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=t;i[s]||(i[s]=Object(o.b)(e,t,n,r));return i[s]}(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[t,n]}(l(e,["children"])),2),a=n[0],c=n[1];return r.useEffect((function(){return c&&u++,function(){c&&(0===--u&&(f()[s]=null))}}),[]),r.createElement(o.a.Provider,{value:a},t)}));c.displayName="DndProvider";var s=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");function f(){return"undefined"!==typeof e?e:window}}).call(this,n(35))},function(e,t,n){"use strict";n.r(t);var r=n(155);for(var o in r)"default"!==o&&function(e){n.d(t,e,(function(){return r[e]}))}(o);var i=n(156);for(var o in i)"default"!==o&&function(e){n.d(t,e,(function(){return i[e]}))}(o);var a=n(157);for(var o in a)"default"!==o&&function(e){n.d(t,e,(function(){return a[e]}))}(o);var l=n(158);for(var o in l)"default"!==o&&function(e){n.d(t,e,(function(){return l[e]}))}(o)},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.r(t);var r=n(166);n.d(t,"DragSource",(function(){return r.a}));var o=n(167);n.d(t,"DropTarget",(function(){return o.a}));var i=n(160);n.d(t,"DragLayer",(function(){return i.a}));var a=n(161);for(var l in a)["DragSource","DropTarget","DragLayer","default"].indexOf(l)<0&&function(e){n.d(t,e,(function(){return a[e]}))}(l)},function(e,t,n){"use strict";n.d(t,"a",(function(){return S}));var r=n(0),o=n(18),i=n(58),a=n.n(i),l=n(5),u=n(29),c=n(16),s=n(23);function f(e){return(f="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e,t,n){return t&&p(e.prototype,t),n&&p(e,n),e}function v(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=b(e);if(t){var o=b(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}function y(e,t){return!t||"object"!==f(t)&&"function"!==typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function S(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(s.a)("DragLayer","collect[, options]",e,t),Object(l.a)("function"===typeof e,'Expected "collect" provided as the first argument to DragLayer to be a function that collects props to inject into the component. ',"Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-layer",e),Object(l.a)(Object(c.b)(t),'Expected "options" provided as the second argument to DragLayer to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-layer',t),function(n){var i=n,c=t.arePropsEqual,p=void 0===c?o.a:c,m=i.displayName||i.name||"Component",y=function(){var t=function(t){v(a,t);var n=g(a);function a(){var e;return d(this,a),(e=n.apply(this,arguments)).isCurrentlyMounted=!1,e.ref=r.createRef(),e.handleChange=function(){if(e.isCurrentlyMounted){var t=e.getCurrentState();Object(o.a)(t,e.state)||e.setState(t)}},e}return h(a,[{key:"getDecoratedComponentInstance",value:function(){return Object(l.a)(this.ref.current,"In order to access an instance of the decorated component, it must either be a class component or use React.forwardRef()"),this.ref.current}},{key:"shouldComponentUpdate",value:function(e,t){return!p(e,this.props)||!Object(o.a)(t,this.state)}},{key:"componentDidMount",value:function(){this.isCurrentlyMounted=!0,this.handleChange()}},{key:"componentWillUnmount",value:function(){this.isCurrentlyMounted=!1,this.unsubscribeFromOffsetChange&&(this.unsubscribeFromOffsetChange(),this.unsubscribeFromOffsetChange=void 0),this.unsubscribeFromStateChange&&(this.unsubscribeFromStateChange(),this.unsubscribeFromStateChange=void 0)}},{key:"render",value:function(){var e=this;return r.createElement(u.a.Consumer,null,(function(t){var n=t.dragDropManager;return void 0===n?null:(e.receiveDragDropManager(n),e.isCurrentlyMounted?r.createElement(i,Object.assign({},e.props,e.state,{ref:Object(s.c)(i)?e.ref:null})):null)}))}},{key:"receiveDragDropManager",value:function(e){if(void 0===this.manager){this.manager=e,Object(l.a)("object"===f(e),"Could not find the drag and drop manager in the context of %s. Make sure to render a DndProvider component in your top-level component. Read more: http://react-dnd.github.io/react-dnd/docs/troubleshooting#could-not-find-the-drag-and-drop-manager-in-the-context",m,m);var t=this.manager.getMonitor();this.unsubscribeFromOffsetChange=t.subscribeToOffsetChange(this.handleChange),this.unsubscribeFromStateChange=t.subscribeToStateChange(this.handleChange)}}},{key:"getCurrentState",value:function(){if(!this.manager)return{};var t=this.manager.getMonitor();return e(t,this.props)}}]),a}(r.Component);return t.displayName="DragLayer(".concat(m,")"),t.DecoratedComponent=n,t}();return a()(y,n)}}},function(e,t){},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorMessage=void 0;var o=r(n(0));t.ErrorMessage=o.default.memo((function(e){var t=e.message,n=e.bullets,r=null;if(n&&n.length>0){for(var i=[],a=0;a<n.length;++a)i.push(o.default.createElement("li",{key:"error-bullet-"+a},n[a]));r=o.default.createElement("ul",null,i)}return o.default.createElement("div",{className:"chonky-error"},o.default.createElement("span",{className:"chonky-error-name"},"Chonky runtime error:")," ",t,r)}))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SmartToolbarButton=t.ToolbarButton=void 0;var o=r(n(50)),i=r(n(0)),a=n(9),l=n(24),u=n(22),c=n(110),s=n(42);t.ToolbarButton=i.default.memo((function(e){var t=e.text,n=e.tooltip,r=e.active,a=e.icon,l=e.iconOnly,c=e.iconOnRight,f=e.onClick,d=e.disabled,p=a||l?i.default.createElement("div",{className:"chonky-toolbar-button-icon"},i.default.createElement(s.ChonkyIconFA,{icon:a||u.ChonkyIconName.fallbackIcon,fixedWidth:!0})):null,h=o.default({"chonky-toolbar-button":!0,"chonky-active":!!r});return i.default.createElement("button",{type:"button",className:h,onClick:f,title:n||t,disabled:!f||d},!c&&p,t&&!l&&i.default.createElement("div",{className:"chonky-toolbar-button-text"},t),c&&p)})),t.SmartToolbarButton=i.default.memo((function(e){var n=e.fileActionId,r=a.useRecoilValue(l.fileActionDataState(n)),o=c.useFileActionTrigger(n),u=c.useFileActionProps(n),s=u.icon,f=u.active,d=u.disabled;if(!r)return null;var p=r.toolbarButton;return p?i.default.createElement(t.ToolbarButton,{text:p.name,tooltip:p.tooltip,icon:s,iconOnly:p.iconOnly,active:f,onClick:o,disabled:d}):null}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return C})),n.d(t,"d",(function(){return P})),n.d(t,"c",(function(){return M})),n.d(t,"b",(function(){return v}));var r=n(0),o=n(5),i="undefined"!==typeof window?r.useLayoutEffect:r.useEffect,a=n(18);function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(u){o=!0,i=u}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n){var o=l(Object(r.useState)((function(){return t(e)})),2),u=o[0],c=o[1],s=Object(r.useCallback)((function(){var r=t(e);Object(a.a)(u,r)||(c(r),n&&n())}),[u,e,n]);return i(s,[]),[u,s]}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(u){o=!0,i=u}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function d(e,t,n){var r=s(c(e,t,n),2),o=r[0],a=r[1];return i((function(){var t=e.getHandlerId();if(null!=t)return e.subscribeToStateChange(a,{handlerIds:[t]})}),[e,a]),o}var p=n(43),h=n(29);function v(){var e=Object(r.useContext)(h.a).dragDropManager;return Object(o.a)(null!=e,"Expected drag drop context"),e}var m=n(83),g=n(84);function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(u){o=!0,i=u}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function S(e){return(S="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function w(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(u){o=!0,i=u}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return O(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return O(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function C(e){var t=Object(r.useRef)(e);t.current=e,Object(o.a)(null!=e.item,"item must be defined"),Object(o.a)(null!=e.item.type,"item type must be defined");var n=w(function(){var e=v();return[Object(r.useMemo)((function(){return new m.a(e)}),[e]),Object(r.useMemo)((function(){return new g.a(e.getBackend())}),[e])]}(),2),a=n[0],l=n[1];!function(e,t,n){var a=v(),l=Object(r.useMemo)((function(){return{beginDrag:function(){var n=e.current,r=n.begin,i=n.item;if(r){var a=r(t);return Object(o.a)(null==a||"object"===S(a),"dragSpec.begin() must either return an object, undefined, or null"),a||i||{}}return i||{}},canDrag:function(){return"boolean"===typeof e.current.canDrag?e.current.canDrag:"function"!==typeof e.current.canDrag||e.current.canDrag(t)},isDragging:function(n,r){var o=e.current.isDragging;return o?o(t):r===n.getSourceId()},endDrag:function(){var r=e.current.end;r&&r(t.getItem(),t),n.reconnect()}}}),[]);i((function(){var r=y(Object(p.a)(e.current.item.type,l,a),2),o=r[0],i=r[1];return t.receiveHandlerId(o),n.receiveHandlerId(o),i}),[])}(t,a,l);var u=d(a,t.current.collect||function(){return{}},(function(){return l.reconnect()})),c=Object(r.useMemo)((function(){return l.hooks.dragSource()}),[l]),s=Object(r.useMemo)((function(){return l.hooks.dragPreview()}),[l]);return i((function(){l.dragSourceOptions=t.current.options||null,l.reconnect()}),[l]),i((function(){l.dragPreviewOptions=t.current.previewOptions||null,l.reconnect()}),[l]),[u,c,s]}var x=n(86),E=n(85);function k(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(u){o=!0,i=u}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function T(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(u){o=!0,i=u}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return j(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return j(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function P(e){var t=Object(r.useRef)(e);t.current=e,Object(o.a)(null!=e.accept,"accept must be defined");var n=T(function(){var e=v();return[Object(r.useMemo)((function(){return new E.a(e)}),[e]),Object(r.useMemo)((function(){return new x.a(e.getBackend())}),[e])]}(),2),a=n[0],l=n[1];!function(e,t,n){var o=v(),a=Object(r.useMemo)((function(){return{canDrop:function(){var n=e.current.canDrop;return!n||n(t.getItem(),t)},hover:function(){var n=e.current.hover;n&&n(t.getItem(),t)},drop:function(){var n=e.current.drop;if(n)return n(t.getItem(),t)}}}),[t]);i((function(){var r=k(Object(p.b)(e.current.accept,a,o),2),i=r[0],l=r[1];return t.receiveHandlerId(i),n.receiveHandlerId(i),l}),[t,n])}(t,a,l);var u=d(a,t.current.collect||function(){return{}},(function(){return l.reconnect()})),c=Object(r.useMemo)((function(){return l.hooks.dropTarget()}),[l]);return i((function(){l.dropTargetOptions=e.options||null,l.reconnect()}),[e.options]),[u,c]}function A(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(u){o=!0,i=u}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return I(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return I(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function M(e){var t=v().getMonitor(),n=A(c(t,e),2),o=n[0],i=n[1];return Object(r.useEffect)((function(){return t.subscribeToOffsetChange(i)})),Object(r.useEffect)((function(){return t.subscribeToStateChange(i)})),o}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r.a})),n.d(t,"d",(function(){return r.b})),n.d(t,"b",(function(){return o.a})),n.d(t,"c",(function(){return a}));var r=n(29),o=n(153),i=n(0),a=i.memo((function(e){var t=e.connect,n=e.src;return i.useEffect((function(){if("undefined"!==typeof Image){var e=!1,r=new Image;return r.src=n,r.onload=function(){t(r),e=!0},function(){e&&t(null)}}})),null}));a.displayName="DragPreviewImage"},function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var r=n(5),o=n(16),i=n(23),a=n(92),l=n(43),u=n(83),c=n(84),s=n(87);function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var d=["canDrag","beginDrag","isDragging","endDrag"],p=["beginDrag"],h=function(){function e(t,n,r){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.props=null,this.beginDrag=function(){if(o.props)return o.spec.beginDrag(o.props,o.monitor,o.ref.current)},this.spec=t,this.monitor=n,this.ref=r}var t,n,r;return t=e,(n=[{key:"receiveProps",value:function(e){this.props=e}},{key:"canDrag",value:function(){return!!this.props&&(!this.spec.canDrag||this.spec.canDrag(this.props,this.monitor))}},{key:"isDragging",value:function(e,t){return!!this.props&&(this.spec.isDragging?this.spec.isDragging(this.props,this.monitor):t===e.getSourceId())}},{key:"endDrag",value:function(){this.props&&this.spec.endDrag&&this.spec.endDrag(this.props,this.monitor,Object(i.b)(this.ref))}}])&&f(t.prototype,n),r&&f(t,r),e}();function v(e){return Object.keys(e).forEach((function(t){Object(r.a)(d.indexOf(t)>-1,'Expected the drag source specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',d.join(", "),t),Object(r.a)("function"===typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source",t,t,e[t])})),p.forEach((function(t){Object(r.a)("function"===typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source",t,t,e[t])})),function(t,n){return new h(e,t,n)}}function m(e,t,n){var f=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};Object(i.a)("DragSource","type, spec, collect[, options]",e,t,n,f);var d=e;"function"!==typeof e&&(Object(r.a)(Object(s.a)(e),'Expected "type" provided as the first argument to DragSource to be a string, or a function that returns a string given the current props. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',e),d=function(){return e}),Object(r.a)(Object(o.b)(t),'Expected "spec" provided as the second argument to DragSource to be a plain object. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',t);var p=v(t);return Object(r.a)("function"===typeof n,'Expected "collect" provided as the third argument to DragSource to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',n),Object(r.a)(Object(o.b)(f),'Expected "options" provided as the fourth argument to DragSource to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',n),function(e){return Object(a.a)({containerDisplayName:"DragSource",createHandler:p,registerHandler:l.a,createConnector:function(e){return new c.a(e)},createMonitor:function(e){return new u.a(e)},DecoratedComponent:e,getType:d,collect:n,options:f})}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var r=n(5),o=n(16),i=n(43),a=n(87),l=n(86),u=n(85),c=n(23),s=n(92);function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var d=["canDrop","hover","drop"],p=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.props=null,this.spec=t,this.monitor=n,this.ref=r}var t,n,r;return t=e,(n=[{key:"receiveProps",value:function(e){this.props=e}},{key:"receiveMonitor",value:function(e){this.monitor=e}},{key:"canDrop",value:function(){return!this.spec.canDrop||this.spec.canDrop(this.props,this.monitor)}},{key:"hover",value:function(){this.spec.hover&&this.props&&this.spec.hover(this.props,this.monitor,Object(c.b)(this.ref))}},{key:"drop",value:function(){if(this.spec.drop)return this.spec.drop(this.props,this.monitor,this.ref.current)}}])&&f(t.prototype,n),r&&f(t,r),e}();function h(e){return Object.keys(e).forEach((function(t){Object(r.a)(d.indexOf(t)>-1,'Expected the drop target specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',d.join(", "),t),Object(r.a)("function"===typeof e[t],"Expected %s in the drop target specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target",t,t,e[t])})),function(t,n){return new p(e,t,n)}}function v(e,t,n){var f=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};Object(c.a)("DropTarget","type, spec, collect[, options]",e,t,n,f);var d=e;"function"!==typeof e&&(Object(r.a)(Object(a.a)(e,!0),'Expected "type" provided as the first argument to DropTarget to be a string, an array of strings, or a function that returns either given the current props. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',e),d=function(){return e}),Object(r.a)(Object(o.b)(t),'Expected "spec" provided as the second argument to DropTarget to be a plain object. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',t);var p=h(t);return Object(r.a)("function"===typeof n,'Expected "collect" provided as the third argument to DropTarget to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',n),Object(r.a)(Object(o.b)(f),'Expected "options" provided as the fourth argument to DropTarget to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',n),function(e){return Object(s.a)({containerDisplayName:"DropTarget",createHandler:p,registerHandler:i.b,createMonitor:function(e){return new u.a(e)},createConnector:function(e){return new l.a(e)},DecoratedComponent:e,getType:d,collect:n,options:f})}}},function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"===typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}n.d(t,"a",(function(){return r}))},function(e,t){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var r=n(1),o=n(32),i=n(21),a=n(27),l=n(0),u=(n(30),"object"===typeof performance&&"function"===typeof performance.now?function(){return performance.now()}:function(){return Date.now()});function c(e){cancelAnimationFrame(e.id)}function s(e,t){var n=u();var r={id:requestAnimationFrame((function o(){u()-n>=t?e.call(null):r.id=requestAnimationFrame(o)}))};return r}var f=null;function d(e){if(void 0===e&&(e=!1),null===f||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),o=r.style;return o.width="100px",o.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?f="positive-descending":(t.scrollLeft=1,f=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),f}return f}var p=function(e,t){return e};function h(e){var t,n,u=e.getItemOffset,f=e.getEstimatedTotalSize,h=e.getItemSize,m=e.getOffsetForIndexAndAlignment,g=e.getStartIndexForOffset,y=e.getStopIndexForStartIndex,b=e.initInstanceProps,S=e.shouldResetStyleCacheOnItemSizeChange,w=e.validateProps;return n=t=function(e){function t(t){var n;return(n=e.call(this,t)||this)._instanceProps=b(n.props,Object(i.a)(Object(i.a)(n))),n._outerRef=void 0,n._resetIsScrollingTimeoutId=null,n.state={instance:Object(i.a)(Object(i.a)(n)),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"===typeof n.props.initialScrollOffset?n.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},n._callOnItemsRendered=void 0,n._callOnItemsRendered=Object(a.a)((function(e,t,r,o){return n.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:r,visibleStopIndex:o})})),n._callOnScroll=void 0,n._callOnScroll=Object(a.a)((function(e,t,r){return n.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:r})})),n._getItemStyle=void 0,n._getItemStyle=function(e){var t,r=n.props,o=r.direction,i=r.itemSize,a=r.layout,l=n._getItemStyleCache(S&&i,S&&a,S&&o);if(l.hasOwnProperty(e))t=l[e];else{var c,s=u(n.props,e,n._instanceProps),f=h(n.props,e,n._instanceProps),d="horizontal"===o||"horizontal"===a;l[e]=((c={position:"absolute"})["rtl"===o?"right":"left"]=d?s:0,c.top=d?0:s,c.height=d?"100%":f,c.width=d?f:"100%",t=c)}return t},n._getItemStyleCache=void 0,n._getItemStyleCache=Object(a.a)((function(e,t,n){return{}})),n._onScrollHorizontal=function(e){var t=e.currentTarget,r=t.clientWidth,o=t.scrollLeft,i=t.scrollWidth;n.setState((function(e){if(e.scrollOffset===o)return null;var t=n.props.direction,a=o;if("rtl"===t)switch(d()){case"negative":a=-o;break;case"positive-descending":a=i-r-o}return a=Math.max(0,Math.min(a,i-r)),{isScrolling:!0,scrollDirection:e.scrollOffset<o?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!1}}),n._resetIsScrollingDebounced)},n._onScrollVertical=function(e){var t=e.currentTarget,r=t.clientHeight,o=t.scrollHeight,i=t.scrollTop;n.setState((function(e){if(e.scrollOffset===i)return null;var t=Math.max(0,Math.min(i,o-r));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}}),n._resetIsScrollingDebounced)},n._outerRefSetter=function(e){var t=n.props.outerRef;n._outerRef=e,"function"===typeof t?t(e):null!=t&&"object"===typeof t&&t.hasOwnProperty("current")&&(t.current=e)},n._resetIsScrollingDebounced=function(){null!==n._resetIsScrollingTimeoutId&&c(n._resetIsScrollingTimeoutId),n._resetIsScrollingTimeoutId=s(n._resetIsScrolling,150)},n._resetIsScrolling=function(){n._resetIsScrollingTimeoutId=null,n.setState({isScrolling:!1},(function(){n._getItemStyleCache(-1,null)}))},n}Object(o.a)(t,e),t.getDerivedStateFromProps=function(e,t){return v(e,t),w(e),null};var n=t.prototype;return n.scrollTo=function(e){e=Math.max(0,e),this.setState((function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}}),this._resetIsScrollingDebounced)},n.scrollToItem=function(e,t){void 0===t&&(t="auto");var n=this.props.itemCount,r=this.state.scrollOffset;e=Math.max(0,Math.min(e,n-1)),this.scrollTo(m(this.props,e,t,r,this._instanceProps))},n.componentDidMount=function(){var e=this.props,t=e.direction,n=e.initialScrollOffset,r=e.layout;if("number"===typeof n&&null!=this._outerRef){var o=this._outerRef;"horizontal"===t||"horizontal"===r?o.scrollLeft=n:o.scrollTop=n}this._callPropsCallbacks()},n.componentDidUpdate=function(){var e=this.props,t=e.direction,n=e.layout,r=this.state,o=r.scrollOffset;if(r.scrollUpdateWasRequested&&null!=this._outerRef){var i=this._outerRef;if("horizontal"===t||"horizontal"===n)if("rtl"===t)switch(d()){case"negative":i.scrollLeft=-o;break;case"positive-ascending":i.scrollLeft=o;break;default:var a=i.clientWidth,l=i.scrollWidth;i.scrollLeft=l-a-o}else i.scrollLeft=o;else i.scrollTop=o}this._callPropsCallbacks()},n.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&c(this._resetIsScrollingTimeoutId)},n.render=function(){var e=this.props,t=e.children,n=e.className,o=e.direction,i=e.height,a=e.innerRef,u=e.innerElementType,c=e.innerTagName,s=e.itemCount,d=e.itemData,h=e.itemKey,v=void 0===h?p:h,m=e.layout,g=e.outerElementType,y=e.outerTagName,b=e.style,S=e.useIsScrolling,w=e.width,O=this.state.isScrolling,C="horizontal"===o||"horizontal"===m,x=C?this._onScrollHorizontal:this._onScrollVertical,E=this._getRangeToRender(),k=E[0],_=E[1],T=[];if(s>0)for(var j=k;j<=_;j++)T.push(Object(l.createElement)(t,{data:d,key:v(j,d),index:j,isScrolling:S?O:void 0,style:this._getItemStyle(j)}));var P=f(this.props,this._instanceProps);return Object(l.createElement)(g||y||"div",{className:n,onScroll:x,ref:this._outerRefSetter,style:Object(r.a)({position:"relative",height:i,width:w,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:o},b)},Object(l.createElement)(u||c||"div",{children:T,ref:a,style:{height:C?"100%":P,pointerEvents:O?"none":void 0,width:C?P:"100%"}}))},n._callPropsCallbacks=function(){if("function"===typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],n=e[1],r=e[2],o=e[3];this._callOnItemsRendered(t,n,r,o)}if("function"===typeof this.props.onScroll){var i=this.state,a=i.scrollDirection,l=i.scrollOffset,u=i.scrollUpdateWasRequested;this._callOnScroll(a,l,u)}},n._getRangeToRender=function(){var e=this.props,t=e.itemCount,n=e.overscanCount,r=this.state,o=r.isScrolling,i=r.scrollDirection,a=r.scrollOffset;if(0===t)return[0,0,0,0];var l=g(this.props,a,this._instanceProps),u=y(this.props,l,a,this._instanceProps),c=o&&"backward"!==i?1:Math.max(1,n),s=o&&"forward"!==i?1:Math.max(1,n);return[Math.max(0,l-c),Math.max(0,Math.min(t-1,u+s)),l,u]},t}(l.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},n}var v=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},m=h({getItemOffset:function(e,t){return t*e.itemSize},getItemSize:function(e,t){return e.itemSize},getEstimatedTotalSize:function(e){var t=e.itemCount;return e.itemSize*t},getOffsetForIndexAndAlignment:function(e,t,n,r){var o=e.direction,i=e.height,a=e.itemCount,l=e.itemSize,u=e.layout,c=e.width,s="horizontal"===o||"horizontal"===u?c:i,f=Math.max(0,a*l-s),d=Math.min(f,t*l),p=Math.max(0,t*l-s+l);switch("smart"===n&&(n=r>=p-s&&r<=d+s?"auto":"center"),n){case"start":return d;case"end":return p;case"center":var h=Math.round(p+(d-p)/2);return h<Math.ceil(s/2)?0:h>f+Math.floor(s/2)?f:h;case"auto":default:return r>=p&&r<=d?r:r<p?p:d}},getStartIndexForOffset:function(e,t){var n=e.itemCount,r=e.itemSize;return Math.max(0,Math.min(n-1,Math.floor(t/r)))},getStopIndexForStartIndex:function(e,t,n){var r=e.direction,o=e.height,i=e.itemCount,a=e.itemSize,l=e.layout,u=e.width,c=t*a,s="horizontal"===r||"horizontal"===l?u:o,f=Math.ceil((s+n-c)/a);return Math.max(0,Math.min(i-1,t+f-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){e.itemSize}})},function(e,t,n){"use strict";function r(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){if(Array.isArray(e))return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";(function(e){var n="undefined"!==typeof window&&"undefined"!==typeof document&&"undefined"!==typeof navigator,r=function(){for(var e=["Edge","Trident","Firefox"],t=0;t<e.length;t+=1)if(n&&navigator.userAgent.indexOf(e[t])>=0)return 1;return 0}();var o=n&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then((function(){t=!1,e()})))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout((function(){t=!1,e()}),r))}};function i(e){return e&&"[object Function]"==={}.toString.call(e)}function a(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function l(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function u(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=a(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/(auto|scroll|overlay)/.test(n+o+r)?e:u(l(e))}function c(e){return e&&e.referenceNode?e.referenceNode:e}var s=n&&!(!window.MSInputMethodContext||!document.documentMode),f=n&&/MSIE 10/.test(navigator.userAgent);function d(e){return 11===e?s:10===e?f:s||f}function p(e){if(!e)return document.documentElement;for(var t=d(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===a(n,"position")?p(n):n:e?e.ownerDocument.documentElement:document.documentElement}function h(e){return null!==e.parentNode?h(e.parentNode):e}function v(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,o=n?t:e,i=document.createRange();i.setStart(r,0),i.setEnd(o,0);var a=i.commonAncestorContainer;if(e!==a&&t!==a||r.contains(o))return function(e){var t=e.nodeName;return"BODY"!==t&&("HTML"===t||p(e.firstElementChild)===e)}(a)?a:p(a);var l=h(e);return l.host?v(l.host,t):v(e,h(t).host)}function m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",r=e.nodeName;if("BODY"===r||"HTML"===r){var o=e.ownerDocument.documentElement,i=e.ownerDocument.scrollingElement||o;return i[n]}return e[n]}function g(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=m(t,"top"),o=m(t,"left"),i=n?-1:1;return e.top+=r*i,e.bottom+=r*i,e.left+=o*i,e.right+=o*i,e}function y(e,t){var n="x"===t?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"])+parseFloat(e["border"+r+"Width"])}function b(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],d(10)?parseInt(n["offset"+e])+parseInt(r["margin"+("Height"===e?"Top":"Left")])+parseInt(r["margin"+("Height"===e?"Bottom":"Right")]):0)}function S(e){var t=e.body,n=e.documentElement,r=d(10)&&getComputedStyle(n);return{height:b("Height",t,n,r),width:b("Width",t,n,r)}}var w=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},O=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),C=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},x=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function E(e){return x({},e,{right:e.left+e.width,bottom:e.top+e.height})}function k(e){var t={};try{if(d(10)){t=e.getBoundingClientRect();var n=m(e,"top"),r=m(e,"left");t.top+=n,t.left+=r,t.bottom+=n,t.right+=r}else t=e.getBoundingClientRect()}catch(p){}var o={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},i="HTML"===e.nodeName?S(e.ownerDocument):{},l=i.width||e.clientWidth||o.width,u=i.height||e.clientHeight||o.height,c=e.offsetWidth-l,s=e.offsetHeight-u;if(c||s){var f=a(e);c-=y(f,"x"),s-=y(f,"y"),o.width-=c,o.height-=s}return E(o)}function _(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=d(10),o="HTML"===t.nodeName,i=k(e),l=k(t),c=u(e),s=a(t),f=parseFloat(s.borderTopWidth),p=parseFloat(s.borderLeftWidth);n&&o&&(l.top=Math.max(l.top,0),l.left=Math.max(l.left,0));var h=E({top:i.top-l.top-f,left:i.left-l.left-p,width:i.width,height:i.height});if(h.marginTop=0,h.marginLeft=0,!r&&o){var v=parseFloat(s.marginTop),m=parseFloat(s.marginLeft);h.top-=f-v,h.bottom-=f-v,h.left-=p-m,h.right-=p-m,h.marginTop=v,h.marginLeft=m}return(r&&!n?t.contains(c):t===c&&"BODY"!==c.nodeName)&&(h=g(h,t)),h}function T(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,r=_(e,n),o=Math.max(n.clientWidth,window.innerWidth||0),i=Math.max(n.clientHeight,window.innerHeight||0),a=t?0:m(n),l=t?0:m(n,"left"),u={top:a-r.top+r.marginTop,left:l-r.left+r.marginLeft,width:o,height:i};return E(u)}function j(e){var t=e.nodeName;if("BODY"===t||"HTML"===t)return!1;if("fixed"===a(e,"position"))return!0;var n=l(e);return!!n&&j(n)}function P(e){if(!e||!e.parentElement||d())return document.documentElement;for(var t=e.parentElement;t&&"none"===a(t,"transform");)t=t.parentElement;return t||document.documentElement}function A(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i={top:0,left:0},a=o?P(e):v(e,c(t));if("viewport"===r)i=T(a,o);else{var s=void 0;"scrollParent"===r?"BODY"===(s=u(l(t))).nodeName&&(s=e.ownerDocument.documentElement):s="window"===r?e.ownerDocument.documentElement:r;var f=_(s,a,o);if("HTML"!==s.nodeName||j(a))i=f;else{var d=S(e.ownerDocument),p=d.height,h=d.width;i.top+=f.top-f.marginTop,i.bottom=p+f.top,i.left+=f.left-f.marginLeft,i.right=h+f.left}}var m="number"===typeof(n=n||0);return i.left+=m?n:n.left||0,i.top+=m?n:n.top||0,i.right-=m?n:n.right||0,i.bottom-=m?n:n.bottom||0,i}function I(e){return e.width*e.height}function M(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var a=A(n,r,i,o),l={top:{width:a.width,height:t.top-a.top},right:{width:a.right-t.right,height:a.height},bottom:{width:a.width,height:a.bottom-t.bottom},left:{width:t.left-a.left,height:a.height}},u=Object.keys(l).map((function(e){return x({key:e},l[e],{area:I(l[e])})})).sort((function(e,t){return t.area-e.area})),c=u.filter((function(e){var t=e.width,r=e.height;return t>=n.clientWidth&&r>=n.clientHeight})),s=c.length>0?c[0].key:u[0].key,f=e.split("-")[1];return s+(f?"-"+f:"")}function D(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=r?P(t):v(t,c(n));return _(n,o,r)}function R(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),r=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+r,height:e.offsetHeight+n}}function N(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,(function(e){return t[e]}))}function F(e,t,n){n=n.split("-")[0];var r=R(e),o={width:r.width,height:r.height},i=-1!==["right","left"].indexOf(n),a=i?"top":"left",l=i?"left":"top",u=i?"height":"width",c=i?"width":"height";return o[a]=t[a]+t[u]/2-r[u]/2,o[l]=n===l?t[l]-r[c]:t[N(l)],o}function z(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function L(e,t,n){return(void 0===n?e:e.slice(0,function(e,t,n){if(Array.prototype.findIndex)return e.findIndex((function(e){return e[t]===n}));var r=z(e,(function(e){return e[t]===n}));return e.indexOf(r)}(e,"name",n))).forEach((function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&i(n)&&(t.offsets.popper=E(t.offsets.popper),t.offsets.reference=E(t.offsets.reference),t=n(t,e))})),t}function V(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=D(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=M(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=F(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=L(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function H(e,t){return e.some((function(e){var n=e.name;return e.enabled&&n===t}))}function B(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;r<t.length;r++){var o=t[r],i=o?""+o+n:e;if("undefined"!==typeof document.body.style[i])return i}return null}function W(){return this.state.isDestroyed=!0,H(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[B("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function U(e){var t=e.ownerDocument;return t?t.defaultView:window}function $(e,t,n,r){n.updateBound=r,U(e).addEventListener("resize",n.updateBound,{passive:!0});var o=u(e);return function e(t,n,r,o){var i="BODY"===t.nodeName,a=i?t.ownerDocument.defaultView:t;a.addEventListener(n,r,{passive:!0}),i||e(u(a.parentNode),n,r,o),o.push(a)}(o,"scroll",n.updateBound,n.scrollParents),n.scrollElement=o,n.eventsEnabled=!0,n}function K(){this.state.eventsEnabled||(this.state=$(this.reference,this.options,this.state,this.scheduleUpdate))}function q(){var e,t;this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=(e=this.reference,t=this.state,U(e).removeEventListener("resize",t.updateBound),t.scrollParents.forEach((function(e){e.removeEventListener("scroll",t.updateBound)})),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t))}function G(e){return""!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function Y(e,t){Object.keys(t).forEach((function(n){var r="";-1!==["width","height","top","right","bottom","left"].indexOf(n)&&G(t[n])&&(r="px"),e.style[n]=t[n]+r}))}var X=n&&/Firefox/i.test(navigator.userAgent);function Q(e,t,n){var r=z(e,(function(e){return e.name===t})),o=!!r&&e.some((function(e){return e.name===n&&e.enabled&&e.order<r.order}));if(!o){var i="`"+t+"`",a="`"+n+"`";console.warn(a+" modifier is required by "+i+" modifier in order to work, be sure to include it before "+i+"!")}return o}var Z=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],J=Z.slice(3);function ee(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=J.indexOf(e),r=J.slice(n+1).concat(J.slice(0,n));return t?r.reverse():r}var te="flip",ne="clockwise",re="counterclockwise";function oe(e,t,n,r){var o=[0,0],i=-1!==["right","left"].indexOf(r),a=e.split(/(\+|\-)/).map((function(e){return e.trim()})),l=a.indexOf(z(a,(function(e){return-1!==e.search(/,|\s/)})));a[l]&&-1===a[l].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var u=/\s*,\s*|\s+/,c=-1!==l?[a.slice(0,l).concat([a[l].split(u)[0]]),[a[l].split(u)[1]].concat(a.slice(l+1))]:[a];return(c=c.map((function(e,r){var o=(1===r?!i:i)?"height":"width",a=!1;return e.reduce((function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,a=!0,e):a?(e[e.length-1]+=t,a=!1,e):e.concat(t)}),[]).map((function(e){return function(e,t,n,r){var o=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),i=+o[1],a=o[2];if(!i)return e;if(0===a.indexOf("%")){var l=void 0;switch(a){case"%p":l=n;break;case"%":case"%r":default:l=r}return E(l)[t]/100*i}if("vh"===a||"vw"===a){return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*i}return i}(e,o,t,n)}))}))).forEach((function(e,t){e.forEach((function(n,r){G(n)&&(o[t]+=n*("-"===e[r-1]?-1:1))}))})),o}var ie={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var o=e.offsets,i=o.reference,a=o.popper,l=-1!==["bottom","top"].indexOf(n),u=l?"left":"top",c=l?"width":"height",s={start:C({},u,i[u]),end:C({},u,i[u]+i[c]-a[c])};e.offsets.popper=x({},a,s[r])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n=t.offset,r=e.placement,o=e.offsets,i=o.popper,a=o.reference,l=r.split("-")[0],u=void 0;return u=G(+n)?[+n,0]:oe(n,i,a,l),"left"===l?(i.top+=u[0],i.left-=u[1]):"right"===l?(i.top+=u[0],i.left+=u[1]):"top"===l?(i.left+=u[0],i.top-=u[1]):"bottom"===l&&(i.left+=u[0],i.top+=u[1]),e.popper=i,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var n=t.boundariesElement||p(e.instance.popper);e.instance.reference===n&&(n=p(n));var r=B("transform"),o=e.instance.popper.style,i=o.top,a=o.left,l=o[r];o.top="",o.left="",o[r]="";var u=A(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);o.top=i,o.left=a,o[r]=l,t.boundaries=u;var c=t.priority,s=e.offsets.popper,f={primary:function(e){var n=s[e];return s[e]<u[e]&&!t.escapeWithReference&&(n=Math.max(s[e],u[e])),C({},e,n)},secondary:function(e){var n="right"===e?"left":"top",r=s[n];return s[e]>u[e]&&!t.escapeWithReference&&(r=Math.min(s[n],u[e]-("right"===e?s.width:s.height))),C({},n,r)}};return c.forEach((function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";s=x({},s,f[t](e))})),e.offsets.popper=s,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,r=t.reference,o=e.placement.split("-")[0],i=Math.floor,a=-1!==["top","bottom"].indexOf(o),l=a?"right":"bottom",u=a?"left":"top",c=a?"width":"height";return n[l]<i(r[u])&&(e.offsets.popper[u]=i(r[u])-n[c]),n[u]>i(r[l])&&(e.offsets.popper[u]=i(r[l])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!Q(e.instance.modifiers,"arrow","keepTogether"))return e;var r=t.element;if("string"===typeof r){if(!(r=e.instance.popper.querySelector(r)))return e}else if(!e.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var o=e.placement.split("-")[0],i=e.offsets,l=i.popper,u=i.reference,c=-1!==["left","right"].indexOf(o),s=c?"height":"width",f=c?"Top":"Left",d=f.toLowerCase(),p=c?"left":"top",h=c?"bottom":"right",v=R(r)[s];u[h]-v<l[d]&&(e.offsets.popper[d]-=l[d]-(u[h]-v)),u[d]+v>l[h]&&(e.offsets.popper[d]+=u[d]+v-l[h]),e.offsets.popper=E(e.offsets.popper);var m=u[d]+u[s]/2-v/2,g=a(e.instance.popper),y=parseFloat(g["margin"+f]),b=parseFloat(g["border"+f+"Width"]),S=m-e.offsets.popper[d]-y-b;return S=Math.max(Math.min(l[s]-v,S),0),e.arrowElement=r,e.offsets.arrow=(C(n={},d,Math.round(S)),C(n,p,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(H(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=A(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],o=N(r),i=e.placement.split("-")[1]||"",a=[];switch(t.behavior){case te:a=[r,o];break;case ne:a=ee(r);break;case re:a=ee(r,!0);break;default:a=t.behavior}return a.forEach((function(l,u){if(r!==l||a.length===u+1)return e;r=e.placement.split("-")[0],o=N(r);var c=e.offsets.popper,s=e.offsets.reference,f=Math.floor,d="left"===r&&f(c.right)>f(s.left)||"right"===r&&f(c.left)<f(s.right)||"top"===r&&f(c.bottom)>f(s.top)||"bottom"===r&&f(c.top)<f(s.bottom),p=f(c.left)<f(n.left),h=f(c.right)>f(n.right),v=f(c.top)<f(n.top),m=f(c.bottom)>f(n.bottom),g="left"===r&&p||"right"===r&&h||"top"===r&&v||"bottom"===r&&m,y=-1!==["top","bottom"].indexOf(r),b=!!t.flipVariations&&(y&&"start"===i&&p||y&&"end"===i&&h||!y&&"start"===i&&v||!y&&"end"===i&&m),S=!!t.flipVariationsByContent&&(y&&"start"===i&&h||y&&"end"===i&&p||!y&&"start"===i&&m||!y&&"end"===i&&v),w=b||S;(d||g||w)&&(e.flipped=!0,(d||g)&&(r=a[u+1]),w&&(i=function(e){return"end"===e?"start":"start"===e?"end":e}(i)),e.placement=r+(i?"-"+i:""),e.offsets.popper=x({},e.offsets.popper,F(e.instance.popper,e.offsets.reference,e.placement)),e=L(e.instance.modifiers,e,"flip"))})),e},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],r=e.offsets,o=r.popper,i=r.reference,a=-1!==["left","right"].indexOf(n),l=-1===["top","left"].indexOf(n);return o[a?"left":"top"]=i[n]-(l?o[a?"width":"height"]:0),e.placement=N(t),e.offsets.popper=E(o),e}},hide:{order:800,enabled:!0,fn:function(e){if(!Q(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=z(e.instance.modifiers,(function(e){return"preventOverflow"===e.name})).boundaries;if(t.bottom<n.top||t.left>n.right||t.top>n.bottom||t.right<n.left){if(!0===e.hide)return e;e.hide=!0,e.attributes["x-out-of-boundaries"]=""}else{if(!1===e.hide)return e;e.hide=!1,e.attributes["x-out-of-boundaries"]=!1}return e}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var n=t.x,r=t.y,o=e.offsets.popper,i=z(e.instance.modifiers,(function(e){return"applyStyle"===e.name})).gpuAcceleration;void 0!==i&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var a=void 0!==i?i:t.gpuAcceleration,l=p(e.instance.popper),u=k(l),c={position:o.position},s=function(e,t){var n=e.offsets,r=n.popper,o=n.reference,i=Math.round,a=Math.floor,l=function(e){return e},u=i(o.width),c=i(r.width),s=-1!==["left","right"].indexOf(e.placement),f=-1!==e.placement.indexOf("-"),d=t?s||f||u%2===c%2?i:a:l,p=t?i:l;return{left:d(u%2===1&&c%2===1&&!f&&t?r.left-1:r.left),top:p(r.top),bottom:p(r.bottom),right:d(r.right)}}(e,window.devicePixelRatio<2||!X),f="bottom"===n?"top":"bottom",d="right"===r?"left":"right",h=B("transform"),v=void 0,m=void 0;if(m="bottom"===f?"HTML"===l.nodeName?-l.clientHeight+s.bottom:-u.height+s.bottom:s.top,v="right"===d?"HTML"===l.nodeName?-l.clientWidth+s.right:-u.width+s.right:s.left,a&&h)c[h]="translate3d("+v+"px, "+m+"px, 0)",c[f]=0,c[d]=0,c.willChange="transform";else{var g="bottom"===f?-1:1,y="right"===d?-1:1;c[f]=m*g,c[d]=v*y,c.willChange=f+", "+d}var b={"x-placement":e.placement};return e.attributes=x({},b,e.attributes),e.styles=x({},c,e.styles),e.arrowStyles=x({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:function(e){var t,n;return Y(e.instance.popper,e.styles),t=e.instance.popper,n=e.attributes,Object.keys(n).forEach((function(e){!1!==n[e]?t.setAttribute(e,n[e]):t.removeAttribute(e)})),e.arrowElement&&Object.keys(e.arrowStyles).length&&Y(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,n,r,o){var i=D(o,t,e,n.positionFixed),a=M(n.placement,i,t,e,n.modifiers.flip.boundariesElement,n.modifiers.flip.padding);return t.setAttribute("x-placement",a),Y(t,{position:n.positionFixed?"fixed":"absolute"}),n},gpuAcceleration:void 0}}},ae=function(){function e(t,n){var r=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};w(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=o(this.update.bind(this)),this.options=x({},e.Defaults,a),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(x({},e.Defaults.modifiers,a.modifiers)).forEach((function(t){r.options.modifiers[t]=x({},e.Defaults.modifiers[t]||{},a.modifiers?a.modifiers[t]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(e){return x({name:e},r.options.modifiers[e])})).sort((function(e,t){return e.order-t.order})),this.modifiers.forEach((function(e){e.enabled&&i(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)})),this.update();var l=this.options.eventsEnabled;l&&this.enableEventListeners(),this.state.eventsEnabled=l}return O(e,[{key:"update",value:function(){return V.call(this)}},{key:"destroy",value:function(){return W.call(this)}},{key:"enableEventListeners",value:function(){return K.call(this)}},{key:"disableEventListeners",value:function(){return q.call(this)}}]),e}();ae.Utils=("undefined"!==typeof window?window:e).PopperUtils,ae.placements=Z,ae.Defaults=ie,t.a=ae}).call(this,n(35))},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(8),o=n(33),i=(n(3),n(0));function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function l(e,t){if(null==e)return{};var n,r={},o=Object.keys(e);for(n=0;n<o.length;n++){var i=o[n];0<=t.indexOf(i)||(r[i]=e[i])}return r}function u(e){var t=e.children;e=e.window;var n=Object(i.useRef)();null==n.current&&(n.current=Object(o.b)({window:e}));var a=n.current;n=(e=Object(i.useReducer)((function(e,t){return t}),{action:a.action,location:a.location}))[0];var l=e[1];return Object(i.useLayoutEffect)((function(){return a.listen(l)}),[a]),Object(i.createElement)(r.b,{children:t,action:n.action,location:n.location,navigator:a})}var c=Object(i.forwardRef)((function(e,t){var n=e.onClick,a=e.replace,u=void 0!==a&&a,c=e.state,s=e.target,f=e.to;e=l(e,["onClick","replace","state","target","to"]),a=Object(r.e)(f);var d=Object(r.g)(),p=Object(r.f)(),h=Object(r.h)(f);return Object(i.createElement)("a",Object.assign({},e,{href:a,onClick:function(e){n&&n(e),e.defaultPrevented||0!==e.button||s&&"_self"!==s||e.metaKey||e.altKey||e.ctrlKey||e.shiftKey||(e.preventDefault(),e=!!u||Object(o.e)(p)===Object(o.e)(h),d(f,{replace:e,state:c}))},ref:t,target:s}))}));Object(i.forwardRef)((function(e,t){var n=e["aria-current"],o=void 0===n?"page":n,u=void 0===(n=e.activeClassName)?"active":n;n=e.activeStyle;var s=e.caseSensitive,f=void 0!==s&&s,d=void 0===(s=e.className)?"":s,p=void 0!==(s=e.end)&&s,h=e.style;s=e.to,e=l(e,"aria-current activeClassName activeStyle caseSensitive className end style to".split(" "));var v=Object(r.f)(),m=Object(r.h)(s);return v=v.pathname,m=m.pathname,f||(v=v.toLowerCase(),m=m.toLowerCase()),o=(f=p?v===m:v.startsWith(m))?o:void 0,u=[d,f?u:null].filter(Boolean).join(" "),n=a({},h,{},f?n:null),Object(i.createElement)(c,Object.assign({},e,{"aria-current":o,className:u,ref:t,style:n,to:s}))}))},function(e,t,n){"use strict";function r(e){for(var t="https://material-ui.com/production-error/?code="+e,n=1;n<arguments.length;n+=1)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified Material-UI error #"+e+"; visit "+t+" for the full message."}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(2),o=n(1),i=n(0),a=(n(3),n(4)),l=n(6),u=i.forwardRef((function(e,t){var n=e.classes,l=e.className,u=e.component,c=void 0===u?"div":u,s=e.square,f=void 0!==s&&s,d=e.elevation,p=void 0===d?1:d,h=e.variant,v=void 0===h?"elevation":h,m=Object(r.a)(e,["classes","className","component","square","elevation","variant"]);return i.createElement(c,Object(o.a)({className:Object(a.default)(n.root,l,"outlined"===v?n.outlined:n["elevation".concat(p)],!f&&n.rounded),ref:t},m))}));t.a=Object(l.a)((function(e){var t={};return e.shadows.forEach((function(e,n){t["elevation".concat(n)]={boxShadow:e}})),Object(o.a)({root:{backgroundColor:e.palette.background.paper,color:e.palette.text.primary,transition:e.transitions.create("box-shadow")},rounded:{borderRadius:e.shape.borderRadius},outlined:{border:"1px solid ".concat(e.palette.divider)}},t)}),{name:"MuiPaper"})(u)},,,,,,,,,,,,function(e,t,n){"use strict";var r=n(120),o="function"===typeof Symbol&&Symbol.for,i=o?Symbol.for("react.element"):60103,a=o?Symbol.for("react.portal"):60106,l=o?Symbol.for("react.fragment"):60107,u=o?Symbol.for("react.strict_mode"):60108,c=o?Symbol.for("react.profiler"):60114,s=o?Symbol.for("react.provider"):60109,f=o?Symbol.for("react.context"):60110,d=o?Symbol.for("react.forward_ref"):60112,p=o?Symbol.for("react.suspense"):60113,h=o?Symbol.for("react.memo"):60115,v=o?Symbol.for("react.lazy"):60116,m="function"===typeof Symbol&&Symbol.iterator;function g(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b={};function S(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||y}function w(){}function O(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||y}S.prototype.isReactComponent={},S.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error(g(85));this.updater.enqueueSetState(this,e,t,"setState")},S.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},w.prototype=S.prototype;var C=O.prototype=new w;C.constructor=O,r(C,S.prototype),C.isPureReactComponent=!0;var x={current:null},E=Object.prototype.hasOwnProperty,k={key:!0,ref:!0,__self:!0,__source:!0};function _(e,t,n){var r,o={},a=null,l=null;if(null!=t)for(r in void 0!==t.ref&&(l=t.ref),void 0!==t.key&&(a=""+t.key),t)E.call(t,r)&&!k.hasOwnProperty(r)&&(o[r]=t[r]);var u=arguments.length-2;if(1===u)o.children=n;else if(1<u){for(var c=Array(u),s=0;s<u;s++)c[s]=arguments[s+2];o.children=c}if(e&&e.defaultProps)for(r in u=e.defaultProps)void 0===o[r]&&(o[r]=u[r]);return{$$typeof:i,type:e,key:a,ref:l,props:o,_owner:x.current}}function T(e){return"object"===typeof e&&null!==e&&e.$$typeof===i}var j=/\/+/g,P=[];function A(e,t,n,r){if(P.length){var o=P.pop();return o.result=e,o.keyPrefix=t,o.func=n,o.context=r,o.count=0,o}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function I(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>P.length&&P.push(e)}function M(e,t,n){return null==e?0:function e(t,n,r,o){var l=typeof t;"undefined"!==l&&"boolean"!==l||(t=null);var u=!1;if(null===t)u=!0;else switch(l){case"string":case"number":u=!0;break;case"object":switch(t.$$typeof){case i:case a:u=!0}}if(u)return r(o,t,""===n?"."+D(t,0):n),1;if(u=0,n=""===n?".":n+":",Array.isArray(t))for(var c=0;c<t.length;c++){var s=n+D(l=t[c],c);u+=e(l,s,r,o)}else if(null===t||"object"!==typeof t?s=null:s="function"===typeof(s=m&&t[m]||t["@@iterator"])?s:null,"function"===typeof s)for(t=s.call(t),c=0;!(l=t.next()).done;)u+=e(l=l.value,s=n+D(l,c++),r,o);else if("object"===l)throw r=""+t,Error(g(31,"[object Object]"===r?"object with keys {"+Object.keys(t).join(", ")+"}":r,""));return u}(e,"",t,n)}function D(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,(function(e){return t[e]}))}(e.key):t.toString(36)}function R(e,t){e.func.call(e.context,t,e.count++)}function N(e,t,n){var r=e.result,o=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?F(e,r,n,(function(e){return e})):null!=e&&(T(e)&&(e=function(e,t){return{$$typeof:i,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,o+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(j,"$&/")+"/")+n)),r.push(e))}function F(e,t,n,r,o){var i="";null!=n&&(i=(""+n).replace(j,"$&/")+"/"),M(e,N,t=A(t,i,r,o)),I(t)}var z={current:null};function L(){var e=z.current;if(null===e)throw Error(g(321));return e}var V={ReactCurrentDispatcher:z,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:x,IsSomeRendererActing:{current:!1},assign:r};t.Children={map:function(e,t,n){if(null==e)return e;var r=[];return F(e,r,null,t,n),r},forEach:function(e,t,n){if(null==e)return e;M(e,R,t=A(null,null,t,n)),I(t)},count:function(e){return M(e,(function(){return null}),null)},toArray:function(e){var t=[];return F(e,t,null,(function(e){return e})),t},only:function(e){if(!T(e))throw Error(g(143));return e}},t.Component=S,t.Fragment=l,t.Profiler=c,t.PureComponent=O,t.StrictMode=u,t.Suspense=p,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=V,t.cloneElement=function(e,t,n){if(null===e||void 0===e)throw Error(g(267,e));var o=r({},e.props),a=e.key,l=e.ref,u=e._owner;if(null!=t){if(void 0!==t.ref&&(l=t.ref,u=x.current),void 0!==t.key&&(a=""+t.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(s in t)E.call(t,s)&&!k.hasOwnProperty(s)&&(o[s]=void 0===t[s]&&void 0!==c?c[s]:t[s])}var s=arguments.length-2;if(1===s)o.children=n;else if(1<s){c=Array(s);for(var f=0;f<s;f++)c[f]=arguments[f+2];o.children=c}return{$$typeof:i,type:e.type,key:a,ref:l,props:o,_owner:u}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:f,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:s,_context:e},e.Consumer=e},t.createElement=_,t.createFactory=function(e){var t=_.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:d,render:e}},t.isValidElement=T,t.lazy=function(e){return{$$typeof:v,_ctor:e,_status:-1,_result:null}},t.memo=function(e,t){return{$$typeof:h,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return L().useCallback(e,t)},t.useContext=function(e,t){return L().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return L().useEffect(e,t)},t.useImperativeHandle=function(e,t,n){return L().useImperativeHandle(e,t,n)},t.useLayoutEffect=function(e,t){return L().useLayoutEffect(e,t)},t.useMemo=function(e,t){return L().useMemo(e,t)},t.useReducer=function(e,t,n){return L().useReducer(e,t,n)},t.useRef=function(e){return L().useRef(e)},t.useState=function(e){return L().useState(e)},t.version="16.13.1"},function(e,t,n){"use strict";var r=n(0),o=n(120),i=n(191);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!r)throw Error(a(227));function l(e,t,n,r,o,i,a,l,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(s){this.onError(s)}}var u=!1,c=null,s=!1,f=null,d={onError:function(e){u=!0,c=e}};function p(e,t,n,r,o,i,a,s,f){u=!1,c=null,l.apply(d,arguments)}var h=null,v=null,m=null;function g(e,t,n){var r=e.type||"unknown-event";e.currentTarget=m(n),function(e,t,n,r,o,i,l,d,h){if(p.apply(this,arguments),u){if(!u)throw Error(a(198));var v=c;u=!1,c=null,s||(s=!0,f=v)}}(r,t,void 0,e),e.currentTarget=null}var y=null,b={};function S(){if(y)for(var e in b){var t=b[e],n=y.indexOf(e);if(!(-1<n))throw Error(a(96,e));if(!O[n]){if(!t.extractEvents)throw Error(a(97,e));for(var r in O[n]=t,n=t.eventTypes){var o=void 0,i=n[r],l=t,u=r;if(C.hasOwnProperty(u))throw Error(a(99,u));C[u]=i;var c=i.phasedRegistrationNames;if(c){for(o in c)c.hasOwnProperty(o)&&w(c[o],l,u);o=!0}else i.registrationName?(w(i.registrationName,l,u),o=!0):o=!1;if(!o)throw Error(a(98,r,e))}}}}function w(e,t,n){if(x[e])throw Error(a(100,e));x[e]=t,E[e]=t.eventTypes[n].dependencies}var O=[],C={},x={},E={};function k(e){var t,n=!1;for(t in e)if(e.hasOwnProperty(t)){var r=e[t];if(!b.hasOwnProperty(t)||b[t]!==r){if(b[t])throw Error(a(102,t));b[t]=r,n=!0}}n&&S()}var _=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),T=null,j=null,P=null;function A(e){if(e=v(e)){if("function"!==typeof T)throw Error(a(280));var t=e.stateNode;t&&(t=h(t),T(e.stateNode,e.type,t))}}function I(e){j?P?P.push(e):P=[e]:j=e}function M(){if(j){var e=j,t=P;if(P=j=null,A(e),t)for(e=0;e<t.length;e++)A(t[e])}}function D(e,t){return e(t)}function R(e,t,n,r,o){return e(t,n,r,o)}function N(){}var F=D,z=!1,L=!1;function V(){null===j&&null===P||(N(),M())}function H(e,t,n){if(L)return e(t,n);L=!0;try{return F(e,t,n)}finally{L=!1,V()}}var B=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,W=Object.prototype.hasOwnProperty,U={},$={};function K(e,t,n,r,o,i){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i}var q={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){q[e]=new K(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];q[t]=new K(t,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){q[e]=new K(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){q[e]=new K(e,2,!1,e,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){q[e]=new K(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){q[e]=new K(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){q[e]=new K(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){q[e]=new K(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){q[e]=new K(e,5,!1,e.toLowerCase(),null,!1)}));var G=/[\-:]([a-z])/g;function Y(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(G,Y);q[t]=new K(t,1,!1,e,null,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(G,Y);q[t]=new K(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(G,Y);q[t]=new K(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)})),["tabIndex","crossOrigin"].forEach((function(e){q[e]=new K(e,1,!1,e.toLowerCase(),null,!1)})),q.xlinkHref=new K("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach((function(e){q[e]=new K(e,1,!1,e.toLowerCase(),null,!0)}));var X=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function Q(e,t,n,r){var o=q.hasOwnProperty(t)?q[t]:null;(null!==o?0===o.type:!r&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,n,r){if(null===t||"undefined"===typeof t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,o,r)&&(n=null),r||null===o?function(e){return!!W.call($,e)||!W.call(U,e)&&(B.test(e)?$[e]=!0:(U[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(o=o.type)||4===o&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}X.hasOwnProperty("ReactCurrentDispatcher")||(X.ReactCurrentDispatcher={current:null}),X.hasOwnProperty("ReactCurrentBatchConfig")||(X.ReactCurrentBatchConfig={suspense:null});var Z=/^(.*)[\\\/]/,J="function"===typeof Symbol&&Symbol.for,ee=J?Symbol.for("react.element"):60103,te=J?Symbol.for("react.portal"):60106,ne=J?Symbol.for("react.fragment"):60107,re=J?Symbol.for("react.strict_mode"):60108,oe=J?Symbol.for("react.profiler"):60114,ie=J?Symbol.for("react.provider"):60109,ae=J?Symbol.for("react.context"):60110,le=J?Symbol.for("react.concurrent_mode"):60111,ue=J?Symbol.for("react.forward_ref"):60112,ce=J?Symbol.for("react.suspense"):60113,se=J?Symbol.for("react.suspense_list"):60120,fe=J?Symbol.for("react.memo"):60115,de=J?Symbol.for("react.lazy"):60116,pe=J?Symbol.for("react.block"):60121,he="function"===typeof Symbol&&Symbol.iterator;function ve(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=he&&e[he]||e["@@iterator"])?e:null}function me(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case ne:return"Fragment";case te:return"Portal";case oe:return"Profiler";case re:return"StrictMode";case ce:return"Suspense";case se:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case ae:return"Context.Consumer";case ie:return"Context.Provider";case ue:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case fe:return me(e.type);case pe:return me(e.render);case de:if(e=1===e._status?e._result:null)return me(e)}return null}function ge(e){var t="";do{e:switch(e.tag){case 3:case 4:case 6:case 7:case 10:case 9:var n="";break e;default:var r=e._debugOwner,o=e._debugSource,i=me(e.type);n=null,r&&(n=me(r.type)),r=i,i="",o?i=" (at "+o.fileName.replace(Z,"")+":"+o.lineNumber+")":n&&(i=" (created by "+n+")"),n="\n in "+(r||"Unknown")+i}t+=n,e=e.return}while(e);return t}function ye(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function be(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function Se(e){e._valueTracker||(e._valueTracker=function(e){var t=be(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){r=""+e,i.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function we(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=be(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function Oe(e,t){var n=t.checked;return o({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function Ce(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=ye(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function xe(e,t){null!=(t=t.checked)&&Q(e,"checked",t,!1)}function Ee(e,t){xe(e,t);var n=ye(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?_e(e,t.type,n):t.hasOwnProperty("defaultValue")&&_e(e,t.type,ye(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function ke(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function _e(e,t,n){"number"===t&&e.ownerDocument.activeElement===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function Te(e,t){return e=o({children:void 0},t),(t=function(e){var t="";return r.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(t.children))&&(e.children=t),e}function je(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+ye(n),t=null,o=0;o<e.length;o++){if(e[o].value===n)return e[o].selected=!0,void(r&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function Pe(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(a(91));return o({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ae(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(a(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(a(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:ye(n)}}function Ie(e,t){var n=ye(t.value),r=ye(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function Me(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var De="http://www.w3.org/1999/xhtml",Re="http://www.w3.org/2000/svg";function Ne(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Fe(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?Ne(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ze,Le=function(e){return"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction((function(){return e(t,n)}))}:e}((function(e,t){if(e.namespaceURI!==Re||"innerHTML"in e)e.innerHTML=t;else{for((ze=ze||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ze.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}));function Ve(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}function He(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Be={animationend:He("Animation","AnimationEnd"),animationiteration:He("Animation","AnimationIteration"),animationstart:He("Animation","AnimationStart"),transitionend:He("Transition","TransitionEnd")},We={},Ue={};function $e(e){if(We[e])return We[e];if(!Be[e])return e;var t,n=Be[e];for(t in n)if(n.hasOwnProperty(t)&&t in Ue)return We[e]=n[t];return e}_&&(Ue=document.createElement("div").style,"AnimationEvent"in window||(delete Be.animationend.animation,delete Be.animationiteration.animation,delete Be.animationstart.animation),"TransitionEvent"in window||delete Be.transitionend.transition);var Ke=$e("animationend"),qe=$e("animationiteration"),Ge=$e("animationstart"),Ye=$e("transitionend"),Xe="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Qe=new("function"===typeof WeakMap?WeakMap:Map);function Ze(e){var t=Qe.get(e);return void 0===t&&(t=new Map,Qe.set(e,t)),t}function Je(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(1026&(t=e).effectTag)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function et(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function tt(e){if(Je(e)!==e)throw Error(a(188))}function nt(e){if(!(e=function(e){var t=e.alternate;if(!t){if(null===(t=Je(e)))throw Error(a(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(null===o)break;var i=o.alternate;if(null===i){if(null!==(r=o.return)){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return tt(o),e;if(i===r)return tt(o),t;i=i.sibling}throw Error(a(188))}if(n.return!==r.return)n=o,r=i;else{for(var l=!1,u=o.child;u;){if(u===n){l=!0,n=o,r=i;break}if(u===r){l=!0,r=o,n=i;break}u=u.sibling}if(!l){for(u=i.child;u;){if(u===n){l=!0,n=i,r=o;break}if(u===r){l=!0,r=i,n=o;break}u=u.sibling}if(!l)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?e:t}(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function rt(e,t){if(null==t)throw Error(a(30));return null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function ot(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}var it=null;function at(e){if(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t))for(var r=0;r<t.length&&!e.isPropagationStopped();r++)g(e,t[r],n[r]);else t&&g(e,t,n);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}function lt(e){if(null!==e&&(it=rt(it,e)),e=it,it=null,e){if(ot(e,at),it)throw Error(a(95));if(s)throw e=f,s=!1,f=null,e}}function ut(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}function ct(e){if(!_)return!1;var t=(e="on"+e)in document;return t||((t=document.createElement("div")).setAttribute(e,"return;"),t="function"===typeof t[e]),t}var st=[];function ft(e){e.topLevelType=null,e.nativeEvent=null,e.targetInst=null,e.ancestors.length=0,10>st.length&&st.push(e)}function dt(e,t,n,r){if(st.length){var o=st.pop();return o.topLevelType=e,o.eventSystemFlags=r,o.nativeEvent=t,o.targetInst=n,o}return{topLevelType:e,eventSystemFlags:r,nativeEvent:t,targetInst:n,ancestors:[]}}function pt(e){var t=e.targetInst,n=t;do{if(!n){e.ancestors.push(n);break}var r=n;if(3===r.tag)r=r.stateNode.containerInfo;else{for(;r.return;)r=r.return;r=3!==r.tag?null:r.stateNode.containerInfo}if(!r)break;5!==(t=n.tag)&&6!==t||e.ancestors.push(n),n=_n(r)}while(n);for(n=0;n<e.ancestors.length;n++){t=e.ancestors[n];var o=ut(e.nativeEvent);r=e.topLevelType;var i=e.nativeEvent,a=e.eventSystemFlags;0===n&&(a|=64);for(var l=null,u=0;u<O.length;u++){var c=O[u];c&&(c=c.extractEvents(r,t,i,o,a))&&(l=rt(l,c))}lt(l)}}function ht(e,t,n){if(!n.has(e)){switch(e){case"scroll":Gt(t,"scroll",!0);break;case"focus":case"blur":Gt(t,"focus",!0),Gt(t,"blur",!0),n.set("blur",null),n.set("focus",null);break;case"cancel":case"close":ct(e)&&Gt(t,e,!0);break;case"invalid":case"submit":case"reset":break;default:-1===Xe.indexOf(e)&&qt(e,t)}n.set(e,null)}}var vt,mt,gt,yt=!1,bt=[],St=null,wt=null,Ot=null,Ct=new Map,xt=new Map,Et=[],kt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput close cancel copy cut paste click change contextmenu reset submit".split(" "),_t="focus blur dragenter dragleave mouseover mouseout pointerover pointerout gotpointercapture lostpointercapture".split(" ");function Tt(e,t,n,r,o){return{blockedOn:e,topLevelType:t,eventSystemFlags:32|n,nativeEvent:o,container:r}}function jt(e,t){switch(e){case"focus":case"blur":St=null;break;case"dragenter":case"dragleave":wt=null;break;case"mouseover":case"mouseout":Ot=null;break;case"pointerover":case"pointerout":Ct.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":xt.delete(t.pointerId)}}function Pt(e,t,n,r,o,i){return null===e||e.nativeEvent!==i?(e=Tt(t,n,r,o,i),null!==t&&(null!==(t=Tn(t))&&mt(t)),e):(e.eventSystemFlags|=r,e)}function At(e){var t=_n(e.target);if(null!==t){var n=Je(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=et(n)))return e.blockedOn=t,void i.unstable_runWithPriority(e.priority,(function(){gt(n)}))}else if(3===t&&n.stateNode.hydrate)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function It(e){if(null!==e.blockedOn)return!1;var t=Zt(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);if(null!==t){var n=Tn(t);return null!==n&&mt(n),e.blockedOn=t,!1}return!0}function Mt(e,t,n){It(e)&&n.delete(t)}function Dt(){for(yt=!1;0<bt.length;){var e=bt[0];if(null!==e.blockedOn){null!==(e=Tn(e.blockedOn))&&vt(e);break}var t=Zt(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);null!==t?e.blockedOn=t:bt.shift()}null!==St&&It(St)&&(St=null),null!==wt&&It(wt)&&(wt=null),null!==Ot&&It(Ot)&&(Ot=null),Ct.forEach(Mt),xt.forEach(Mt)}function Rt(e,t){e.blockedOn===t&&(e.blockedOn=null,yt||(yt=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Dt)))}function Nt(e){function t(t){return Rt(t,e)}if(0<bt.length){Rt(bt[0],e);for(var n=1;n<bt.length;n++){var r=bt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==St&&Rt(St,e),null!==wt&&Rt(wt,e),null!==Ot&&Rt(Ot,e),Ct.forEach(t),xt.forEach(t),n=0;n<Et.length;n++)(r=Et[n]).blockedOn===e&&(r.blockedOn=null);for(;0<Et.length&&null===(n=Et[0]).blockedOn;)At(n),null===n.blockedOn&&Et.shift()}var Ft={},zt=new Map,Lt=new Map,Vt=["abort","abort",Ke,"animationEnd",qe,"animationIteration",Ge,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",Ye,"transitionEnd","waiting","waiting"];function Ht(e,t){for(var n=0;n<e.length;n+=2){var r=e[n],o=e[n+1],i="on"+(o[0].toUpperCase()+o.slice(1));i={phasedRegistrationNames:{bubbled:i,captured:i+"Capture"},dependencies:[r],eventPriority:t},Lt.set(r,t),zt.set(r,i),Ft[o]=i}}Ht("blur blur cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focus focus input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),Ht("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),Ht(Vt,2);for(var Bt="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),Wt=0;Wt<Bt.length;Wt++)Lt.set(Bt[Wt],0);var Ut=i.unstable_UserBlockingPriority,$t=i.unstable_runWithPriority,Kt=!0;function qt(e,t){Gt(t,e,!1)}function Gt(e,t,n){var r=Lt.get(t);switch(void 0===r?2:r){case 0:r=Yt.bind(null,t,1,e);break;case 1:r=Xt.bind(null,t,1,e);break;default:r=Qt.bind(null,t,1,e)}n?e.addEventListener(t,r,!0):e.addEventListener(t,r,!1)}function Yt(e,t,n,r){z||N();var o=Qt,i=z;z=!0;try{R(o,e,t,n,r)}finally{(z=i)||V()}}function Xt(e,t,n,r){$t(Ut,Qt.bind(null,e,t,n,r))}function Qt(e,t,n,r){if(Kt)if(0<bt.length&&-1<kt.indexOf(e))e=Tt(null,e,t,n,r),bt.push(e);else{var o=Zt(e,t,n,r);if(null===o)jt(e,r);else if(-1<kt.indexOf(e))e=Tt(o,e,t,n,r),bt.push(e);else if(!function(e,t,n,r,o){switch(t){case"focus":return St=Pt(St,e,t,n,r,o),!0;case"dragenter":return wt=Pt(wt,e,t,n,r,o),!0;case"mouseover":return Ot=Pt(Ot,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Ct.set(i,Pt(Ct.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,xt.set(i,Pt(xt.get(i)||null,e,t,n,r,o)),!0}return!1}(o,e,t,n,r)){jt(e,r),e=dt(e,r,null,t);try{H(pt,e)}finally{ft(e)}}}}function Zt(e,t,n,r){if(null!==(n=_n(n=ut(r)))){var o=Je(n);if(null===o)n=null;else{var i=o.tag;if(13===i){if(null!==(n=et(o)))return n;n=null}else if(3===i){if(o.stateNode.hydrate)return 3===o.tag?o.stateNode.containerInfo:null;n=null}else o!==n&&(n=null)}}e=dt(e,r,n,t);try{H(pt,e)}finally{ft(e)}return null}var Jt={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},en=["Webkit","ms","Moz","O"];function tn(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||Jt.hasOwnProperty(e)&&Jt[e]?(""+t).trim():t+"px"}function nn(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=tn(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}Object.keys(Jt).forEach((function(e){en.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Jt[t]=Jt[e]}))}));var rn=o({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function on(e,t){if(t){if(rn[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(a(137,e,""));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(a(60));if("object"!==typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(null!=t.style&&"object"!==typeof t.style)throw Error(a(62,""))}}function an(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ln=De;function un(e,t){var n=Ze(e=9===e.nodeType||11===e.nodeType?e:e.ownerDocument);t=E[t];for(var r=0;r<t.length;r++)ht(t[r],e,n)}function cn(){}function sn(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function fn(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function dn(e,t){var n,r=fn(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=fn(r)}}function pn(){for(var e=window,t=sn();t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=sn((e=t.contentWindow).document)}return t}function hn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var vn=null,mn=null;function gn(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function yn(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var bn="function"===typeof setTimeout?setTimeout:void 0,Sn="function"===typeof clearTimeout?clearTimeout:void 0;function wn(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function On(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var Cn=Math.random().toString(36).slice(2),xn="__reactInternalInstance$"+Cn,En="__reactEventHandlers$"+Cn,kn="__reactContainere$"+Cn;function _n(e){var t=e[xn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[kn]||n[xn]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=On(e);null!==e;){if(n=e[xn])return n;e=On(e)}return t}n=(e=n).parentNode}return null}function Tn(e){return!(e=e[xn]||e[kn])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function jn(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(a(33))}function Pn(e){return e[En]||null}function An(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function In(e,t){var n=e.stateNode;if(!n)return null;var r=h(n);if(!r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!==typeof n)throw Error(a(231,t,typeof n));return n}function Mn(e,t,n){(t=In(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=rt(n._dispatchListeners,t),n._dispatchInstances=rt(n._dispatchInstances,e))}function Dn(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,n=[];t;)n.push(t),t=An(t);for(t=n.length;0<t--;)Mn(n[t],"captured",e);for(t=0;t<n.length;t++)Mn(n[t],"bubbled",e)}}function Rn(e,t,n){e&&n&&n.dispatchConfig.registrationName&&(t=In(e,n.dispatchConfig.registrationName))&&(n._dispatchListeners=rt(n._dispatchListeners,t),n._dispatchInstances=rt(n._dispatchInstances,e))}function Nn(e){e&&e.dispatchConfig.registrationName&&Rn(e._targetInst,null,e)}function Fn(e){ot(e,Dn)}var zn=null,Ln=null,Vn=null;function Hn(){if(Vn)return Vn;var e,t,n=Ln,r=n.length,o="value"in zn?zn.value:zn.textContent,i=o.length;for(e=0;e<r&&n[e]===o[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===o[i-t];t++);return Vn=o.slice(e,1<t?1-t:void 0)}function Bn(){return!0}function Wn(){return!1}function Un(e,t,n,r){for(var o in this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n,e=this.constructor.Interface)e.hasOwnProperty(o)&&((t=e[o])?this[o]=t(n):"target"===o?this.target=r:this[o]=n[o]);return this.isDefaultPrevented=(null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue)?Bn:Wn,this.isPropagationStopped=Wn,this}function $n(e,t,n,r){if(this.eventPool.length){var o=this.eventPool.pop();return this.call(o,e,t,n,r),o}return new this(e,t,n,r)}function Kn(e){if(!(e instanceof this))throw Error(a(279));e.destructor(),10>this.eventPool.length&&this.eventPool.push(e)}function qn(e){e.eventPool=[],e.getPooled=$n,e.release=Kn}o(Un.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Bn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Bn)},persist:function(){this.isPersistent=Bn},isPersistent:Wn,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=Wn,this._dispatchInstances=this._dispatchListeners=null}}),Un.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},Un.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var i=new t;return o(i,n.prototype),n.prototype=i,n.prototype.constructor=n,n.Interface=o({},r.Interface,e),n.extend=r.extend,qn(n),n},qn(Un);var Gn=Un.extend({data:null}),Yn=Un.extend({data:null}),Xn=[9,13,27,32],Qn=_&&"CompositionEvent"in window,Zn=null;_&&"documentMode"in document&&(Zn=document.documentMode);var Jn=_&&"TextEvent"in window&&!Zn,er=_&&(!Qn||Zn&&8<Zn&&11>=Zn),tr=String.fromCharCode(32),nr={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},rr=!1;function or(e,t){switch(e){case"keyup":return-1!==Xn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function ir(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var ar=!1;var lr={eventTypes:nr,extractEvents:function(e,t,n,r){var o;if(Qn)e:{switch(e){case"compositionstart":var i=nr.compositionStart;break e;case"compositionend":i=nr.compositionEnd;break e;case"compositionupdate":i=nr.compositionUpdate;break e}i=void 0}else ar?or(e,n)&&(i=nr.compositionEnd):"keydown"===e&&229===n.keyCode&&(i=nr.compositionStart);return i?(er&&"ko"!==n.locale&&(ar||i!==nr.compositionStart?i===nr.compositionEnd&&ar&&(o=Hn()):(Ln="value"in(zn=r)?zn.value:zn.textContent,ar=!0)),i=Gn.getPooled(i,t,n,r),o?i.data=o:null!==(o=ir(n))&&(i.data=o),Fn(i),o=i):o=null,(e=Jn?function(e,t){switch(e){case"compositionend":return ir(t);case"keypress":return 32!==t.which?null:(rr=!0,tr);case"textInput":return(e=t.data)===tr&&rr?null:e;default:return null}}(e,n):function(e,t){if(ar)return"compositionend"===e||!Qn&&or(e,t)?(e=Hn(),Vn=Ln=zn=null,ar=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return er&&"ko"!==t.locale?null:t.data;default:return null}}(e,n))?((t=Yn.getPooled(nr.beforeInput,t,n,r)).data=e,Fn(t)):t=null,null===o?t:null===t?o:[o,t]}},ur={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!ur[e.type]:"textarea"===t}var sr={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}};function fr(e,t,n){return(e=Un.getPooled(sr.change,e,t,n)).type="change",I(n),Fn(e),e}var dr=null,pr=null;function hr(e){lt(e)}function vr(e){if(we(jn(e)))return e}function mr(e,t){if("change"===e)return t}var gr=!1;function yr(){dr&&(dr.detachEvent("onpropertychange",br),pr=dr=null)}function br(e){if("value"===e.propertyName&&vr(pr))if(e=fr(pr,e,ut(e)),z)lt(e);else{z=!0;try{D(hr,e)}finally{z=!1,V()}}}function Sr(e,t,n){"focus"===e?(yr(),pr=n,(dr=t).attachEvent("onpropertychange",br)):"blur"===e&&yr()}function wr(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return vr(pr)}function Or(e,t){if("click"===e)return vr(t)}function Cr(e,t){if("input"===e||"change"===e)return vr(t)}_&&(gr=ct("input")&&(!document.documentMode||9<document.documentMode));var xr={eventTypes:sr,_isInputEventSupported:gr,extractEvents:function(e,t,n,r){var o=t?jn(t):window,i=o.nodeName&&o.nodeName.toLowerCase();if("select"===i||"input"===i&&"file"===o.type)var a=mr;else if(cr(o))if(gr)a=Cr;else{a=wr;var l=Sr}else(i=o.nodeName)&&"input"===i.toLowerCase()&&("checkbox"===o.type||"radio"===o.type)&&(a=Or);if(a&&(a=a(e,t)))return fr(a,n,r);l&&l(e,o,t),"blur"===e&&(e=o._wrapperState)&&e.controlled&&"number"===o.type&&_e(o,"number",o.value)}},Er=Un.extend({view:null,detail:null}),kr={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _r(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=kr[e])&&!!t[e]}function Tr(){return _r}var jr=0,Pr=0,Ar=!1,Ir=!1,Mr=Er.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:Tr,button:null,buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},movementX:function(e){if("movementX"in e)return e.movementX;var t=jr;return jr=e.screenX,Ar?"mousemove"===e.type?e.screenX-t:0:(Ar=!0,0)},movementY:function(e){if("movementY"in e)return e.movementY;var t=Pr;return Pr=e.screenY,Ir?"mousemove"===e.type?e.screenY-t:0:(Ir=!0,0)}}),Dr=Mr.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),Rr={mouseEnter:{registrationName:"onMouseEnter",dependencies:["mouseout","mouseover"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["mouseout","mouseover"]},pointerEnter:{registrationName:"onPointerEnter",dependencies:["pointerout","pointerover"]},pointerLeave:{registrationName:"onPointerLeave",dependencies:["pointerout","pointerover"]}},Nr={eventTypes:Rr,extractEvents:function(e,t,n,r,o){var i="mouseover"===e||"pointerover"===e,a="mouseout"===e||"pointerout"===e;if(i&&0===(32&o)&&(n.relatedTarget||n.fromElement)||!a&&!i)return null;(i=r.window===r?r:(i=r.ownerDocument)?i.defaultView||i.parentWindow:window,a)?(a=t,null!==(t=(t=n.relatedTarget||n.toElement)?_n(t):null)&&(t!==Je(t)||5!==t.tag&&6!==t.tag)&&(t=null)):a=null;if(a===t)return null;if("mouseout"===e||"mouseover"===e)var l=Mr,u=Rr.mouseLeave,c=Rr.mouseEnter,s="mouse";else"pointerout"!==e&&"pointerover"!==e||(l=Dr,u=Rr.pointerLeave,c=Rr.pointerEnter,s="pointer");if(e=null==a?i:jn(a),i=null==t?i:jn(t),(u=l.getPooled(u,a,n,r)).type=s+"leave",u.target=e,u.relatedTarget=i,(n=l.getPooled(c,t,n,r)).type=s+"enter",n.target=i,n.relatedTarget=e,s=t,(r=a)&&s)e:{for(c=s,a=0,e=l=r;e;e=An(e))a++;for(e=0,t=c;t;t=An(t))e++;for(;0<a-e;)l=An(l),a--;for(;0<e-a;)c=An(c),e--;for(;a--;){if(l===c||l===c.alternate)break e;l=An(l),c=An(c)}l=null}else l=null;for(c=l,l=[];r&&r!==c&&(null===(a=r.alternate)||a!==c);)l.push(r),r=An(r);for(r=[];s&&s!==c&&(null===(a=s.alternate)||a!==c);)r.push(s),s=An(s);for(s=0;s<l.length;s++)Rn(l[s],"bubbled",u);for(s=r.length;0<s--;)Rn(r[s],"captured",n);return 0===(64&o)?[u]:[u,n]}};var Fr="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t},zr=Object.prototype.hasOwnProperty;function Lr(e,t){if(Fr(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!zr.call(t,n[r])||!Fr(e[n[r]],t[n[r]]))return!1;return!0}var Vr=_&&"documentMode"in document&&11>=document.documentMode,Hr={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Br=null,Wr=null,Ur=null,$r=!1;function Kr(e,t){var n=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return $r||null==Br||Br!==sn(n)?null:("selectionStart"in(n=Br)&&hn(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},Ur&&Lr(Ur,n)?null:(Ur=n,(e=Un.getPooled(Hr.select,Wr,e,t)).type="select",e.target=Br,Fn(e),e))}var qr={eventTypes:Hr,extractEvents:function(e,t,n,r,o,i){if(!(i=!(o=i||(r.window===r?r.document:9===r.nodeType?r:r.ownerDocument)))){e:{o=Ze(o),i=E.onSelect;for(var a=0;a<i.length;a++)if(!o.has(i[a])){o=!1;break e}o=!0}i=!o}if(i)return null;switch(o=t?jn(t):window,e){case"focus":(cr(o)||"true"===o.contentEditable)&&(Br=o,Wr=t,Ur=null);break;case"blur":Ur=Wr=Br=null;break;case"mousedown":$r=!0;break;case"contextmenu":case"mouseup":case"dragend":return $r=!1,Kr(n,r);case"selectionchange":if(Vr)break;case"keydown":case"keyup":return Kr(n,r)}return null}},Gr=Un.extend({animationName:null,elapsedTime:null,pseudoElement:null}),Yr=Un.extend({clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Xr=Er.extend({relatedTarget:null});function Qr(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}var Zr={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Jr={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},eo=Er.extend({key:function(e){if(e.key){var t=Zr[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=Qr(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Jr[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:Tr,charCode:function(e){return"keypress"===e.type?Qr(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Qr(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),to=Mr.extend({dataTransfer:null}),no=Er.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:Tr}),ro=Un.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),oo=Mr.extend({deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),io={eventTypes:Ft,extractEvents:function(e,t,n,r){var o=zt.get(e);if(!o)return null;switch(e){case"keypress":if(0===Qr(n))return null;case"keydown":case"keyup":e=eo;break;case"blur":case"focus":e=Xr;break;case"click":if(2===n.button)return null;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":e=Mr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":e=to;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":e=no;break;case Ke:case qe:case Ge:e=Gr;break;case Ye:e=ro;break;case"scroll":e=Er;break;case"wheel":e=oo;break;case"copy":case"cut":case"paste":e=Yr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":e=Dr;break;default:e=Un}return Fn(t=e.getPooled(o,t,n,r)),t}};if(y)throw Error(a(101));y=Array.prototype.slice.call("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" ")),S(),h=Pn,v=Tn,m=jn,k({SimpleEventPlugin:io,EnterLeaveEventPlugin:Nr,ChangeEventPlugin:xr,SelectEventPlugin:qr,BeforeInputEventPlugin:lr});var ao=[],lo=-1;function uo(e){0>lo||(e.current=ao[lo],ao[lo]=null,lo--)}function co(e,t){lo++,ao[lo]=e.current,e.current=t}var so={},fo={current:so},po={current:!1},ho=so;function vo(e,t){var n=e.type.contextTypes;if(!n)return so;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in n)i[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function mo(e){return null!==(e=e.childContextTypes)&&void 0!==e}function go(){uo(po),uo(fo)}function yo(e,t,n){if(fo.current!==so)throw Error(a(168));co(fo,t),co(po,n)}function bo(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in e))throw Error(a(108,me(t)||"Unknown",i));return o({},n,{},r)}function So(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||so,ho=fo.current,co(fo,e),co(po,po.current),!0}function wo(e,t,n){var r=e.stateNode;if(!r)throw Error(a(169));n?(e=bo(e,t,ho),r.__reactInternalMemoizedMergedChildContext=e,uo(po),uo(fo),co(fo,e)):uo(po),co(po,n)}var Oo=i.unstable_runWithPriority,Co=i.unstable_scheduleCallback,xo=i.unstable_cancelCallback,Eo=i.unstable_requestPaint,ko=i.unstable_now,_o=i.unstable_getCurrentPriorityLevel,To=i.unstable_ImmediatePriority,jo=i.unstable_UserBlockingPriority,Po=i.unstable_NormalPriority,Ao=i.unstable_LowPriority,Io=i.unstable_IdlePriority,Mo={},Do=i.unstable_shouldYield,Ro=void 0!==Eo?Eo:function(){},No=null,Fo=null,zo=!1,Lo=ko(),Vo=1e4>Lo?ko:function(){return ko()-Lo};function Ho(){switch(_o()){case To:return 99;case jo:return 98;case Po:return 97;case Ao:return 96;case Io:return 95;default:throw Error(a(332))}}function Bo(e){switch(e){case 99:return To;case 98:return jo;case 97:return Po;case 96:return Ao;case 95:return Io;default:throw Error(a(332))}}function Wo(e,t){return e=Bo(e),Oo(e,t)}function Uo(e,t,n){return e=Bo(e),Co(e,t,n)}function $o(e){return null===No?(No=[e],Fo=Co(To,qo)):No.push(e),Mo}function Ko(){if(null!==Fo){var e=Fo;Fo=null,xo(e)}qo()}function qo(){if(!zo&&null!==No){zo=!0;var e=0;try{var t=No;Wo(99,(function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}})),No=null}catch(n){throw null!==No&&(No=No.slice(e+1)),Co(To,Ko),n}finally{zo=!1}}}function Go(e,t,n){return 1073741821-(1+((1073741821-e+t/10)/(n/=10)|0))*n}function Yo(e,t){if(e&&e.defaultProps)for(var n in t=o({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}var Xo={current:null},Qo=null,Zo=null,Jo=null;function ei(){Jo=Zo=Qo=null}function ti(e){var t=Xo.current;uo(Xo),e.type._context._currentValue=t}function ni(e,t){for(;null!==e;){var n=e.alternate;if(e.childExpirationTime<t)e.childExpirationTime=t,null!==n&&n.childExpirationTime<t&&(n.childExpirationTime=t);else{if(!(null!==n&&n.childExpirationTime<t))break;n.childExpirationTime=t}e=e.return}}function ri(e,t){Qo=e,Jo=Zo=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(e.expirationTime>=t&&(Pa=!0),e.firstContext=null)}function oi(e,t){if(Jo!==e&&!1!==t&&0!==t)if("number"===typeof t&&1073741823!==t||(Jo=e,t=1073741823),t={context:e,observedBits:t,next:null},null===Zo){if(null===Qo)throw Error(a(308));Zo=t,Qo.dependencies={expirationTime:0,firstContext:t,responders:null}}else Zo=Zo.next=t;return e._currentValue}var ii=!1;function ai(e){e.updateQueue={baseState:e.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}function li(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,baseQueue:e.baseQueue,shared:e.shared,effects:e.effects})}function ui(e,t){return(e={expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null}).next=e}function ci(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function si(e,t){var n=e.alternate;null!==n&&li(n,e),null===(n=(e=e.updateQueue).baseQueue)?(e.baseQueue=t.next=t,t.next=t):(t.next=n.next,n.next=t)}function fi(e,t,n,r){var i=e.updateQueue;ii=!1;var a=i.baseQueue,l=i.shared.pending;if(null!==l){if(null!==a){var u=a.next;a.next=l.next,l.next=u}a=l,i.shared.pending=null,null!==(u=e.alternate)&&(null!==(u=u.updateQueue)&&(u.baseQueue=l))}if(null!==a){u=a.next;var c=i.baseState,s=0,f=null,d=null,p=null;if(null!==u)for(var h=u;;){if((l=h.expirationTime)<r){var v={expirationTime:h.expirationTime,suspenseConfig:h.suspenseConfig,tag:h.tag,payload:h.payload,callback:h.callback,next:null};null===p?(d=p=v,f=c):p=p.next=v,l>s&&(s=l)}else{null!==p&&(p=p.next={expirationTime:1073741823,suspenseConfig:h.suspenseConfig,tag:h.tag,payload:h.payload,callback:h.callback,next:null}),iu(l,h.suspenseConfig);e:{var m=e,g=h;switch(l=t,v=n,g.tag){case 1:if("function"===typeof(m=g.payload)){c=m.call(v,c,l);break e}c=m;break e;case 3:m.effectTag=-4097&m.effectTag|64;case 0:if(null===(l="function"===typeof(m=g.payload)?m.call(v,c,l):m)||void 0===l)break e;c=o({},c,l);break e;case 2:ii=!0}}null!==h.callback&&(e.effectTag|=32,null===(l=i.effects)?i.effects=[h]:l.push(h))}if(null===(h=h.next)||h===u){if(null===(l=i.shared.pending))break;h=a.next=l.next,l.next=u,i.baseQueue=a=l,i.shared.pending=null}}null===p?f=c:p.next=d,i.baseState=f,i.baseQueue=p,au(s),e.expirationTime=s,e.memoizedState=c}}function di(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(null!==o){if(r.callback=null,r=o,o=n,"function"!==typeof r)throw Error(a(191,r));r.call(o)}}}var pi=X.ReactCurrentBatchConfig,hi=(new r.Component).refs;function vi(e,t,n,r){n=null===(n=n(r,t=e.memoizedState))||void 0===n?t:o({},t,n),e.memoizedState=n,0===e.expirationTime&&(e.updateQueue.baseState=n)}var mi={isMounted:function(e){return!!(e=e._reactInternalFiber)&&Je(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternalFiber;var r=Kl(),o=pi.suspense;(o=ui(r=ql(r,e,o),o)).payload=t,void 0!==n&&null!==n&&(o.callback=n),ci(e,o),Gl(e,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternalFiber;var r=Kl(),o=pi.suspense;(o=ui(r=ql(r,e,o),o)).tag=1,o.payload=t,void 0!==n&&null!==n&&(o.callback=n),ci(e,o),Gl(e,r)},enqueueForceUpdate:function(e,t){e=e._reactInternalFiber;var n=Kl(),r=pi.suspense;(r=ui(n=ql(n,e,r),r)).tag=2,void 0!==t&&null!==t&&(r.callback=t),ci(e,r),Gl(e,n)}};function gi(e,t,n,r,o,i,a){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,i,a):!t.prototype||!t.prototype.isPureReactComponent||(!Lr(n,r)||!Lr(o,i))}function yi(e,t,n){var r=!1,o=so,i=t.contextType;return"object"===typeof i&&null!==i?i=oi(i):(o=mo(t)?ho:fo.current,i=(r=null!==(r=t.contextTypes)&&void 0!==r)?vo(e,o):so),t=new t(n,i),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=mi,e.stateNode=t,t._reactInternalFiber=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function bi(e,t,n,r){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&mi.enqueueReplaceState(t,t.state,null)}function Si(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=hi,ai(e);var i=t.contextType;"object"===typeof i&&null!==i?o.context=oi(i):(i=mo(t)?ho:fo.current,o.context=vo(e,i)),fi(e,n,o,r),o.state=e.memoizedState,"function"===typeof(i=t.getDerivedStateFromProps)&&(vi(e,t,i,n),o.state=e.memoizedState),"function"===typeof t.getDerivedStateFromProps||"function"===typeof o.getSnapshotBeforeUpdate||"function"!==typeof o.UNSAFE_componentWillMount&&"function"!==typeof o.componentWillMount||(t=o.state,"function"===typeof o.componentWillMount&&o.componentWillMount(),"function"===typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),t!==o.state&&mi.enqueueReplaceState(o,o.state,null),fi(e,n,o,r),o.state=e.memoizedState),"function"===typeof o.componentDidMount&&(e.effectTag|=4)}var wi=Array.isArray;function Oi(e,t,n){if(null!==(e=n.ref)&&"function"!==typeof e&&"object"!==typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(a(309));var r=n.stateNode}if(!r)throw Error(a(147,e));var o=""+e;return null!==t&&null!==t.ref&&"function"===typeof t.ref&&t.ref._stringRef===o?t.ref:((t=function(e){var t=r.refs;t===hi&&(t=r.refs={}),null===e?delete t[o]:t[o]=e})._stringRef=o,t)}if("string"!==typeof e)throw Error(a(284));if(!n._owner)throw Error(a(290,e))}return e}function Ci(e,t){if("textarea"!==e.type)throw Error(a(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t,""))}function xi(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.effectTag=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function o(e,t){return(e=ku(e,t)).index=0,e.sibling=null,e}function i(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.effectTag=2,n):r:(t.effectTag=2,n):n}function l(t){return e&&null===t.alternate&&(t.effectTag=2),t}function u(e,t,n,r){return null===t||6!==t.tag?((t=ju(n,e.mode,r)).return=e,t):((t=o(t,n)).return=e,t)}function c(e,t,n,r){return null!==t&&t.elementType===n.type?((r=o(t,n.props)).ref=Oi(e,t,n),r.return=e,r):((r=_u(n.type,n.key,n.props,null,e.mode,r)).ref=Oi(e,t,n),r.return=e,r)}function s(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Pu(n,e.mode,r)).return=e,t):((t=o(t,n.children||[])).return=e,t)}function f(e,t,n,r,i){return null===t||7!==t.tag?((t=Tu(n,e.mode,r,i)).return=e,t):((t=o(t,n)).return=e,t)}function d(e,t,n){if("string"===typeof t||"number"===typeof t)return(t=ju(""+t,e.mode,n)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case ee:return(n=_u(t.type,t.key,t.props,null,e.mode,n)).ref=Oi(e,null,t),n.return=e,n;case te:return(t=Pu(t,e.mode,n)).return=e,t}if(wi(t)||ve(t))return(t=Tu(t,e.mode,n,null)).return=e,t;Ci(e,t)}return null}function p(e,t,n,r){var o=null!==t?t.key:null;if("string"===typeof n||"number"===typeof n)return null!==o?null:u(e,t,""+n,r);if("object"===typeof n&&null!==n){switch(n.$$typeof){case ee:return n.key===o?n.type===ne?f(e,t,n.props.children,r,o):c(e,t,n,r):null;case te:return n.key===o?s(e,t,n,r):null}if(wi(n)||ve(n))return null!==o?null:f(e,t,n,r,null);Ci(e,n)}return null}function h(e,t,n,r,o){if("string"===typeof r||"number"===typeof r)return u(t,e=e.get(n)||null,""+r,o);if("object"===typeof r&&null!==r){switch(r.$$typeof){case ee:return e=e.get(null===r.key?n:r.key)||null,r.type===ne?f(t,e,r.props.children,o,r.key):c(t,e,r,o);case te:return s(t,e=e.get(null===r.key?n:r.key)||null,r,o)}if(wi(r)||ve(r))return f(t,e=e.get(n)||null,r,o,null);Ci(t,r)}return null}function v(o,a,l,u){for(var c=null,s=null,f=a,v=a=0,m=null;null!==f&&v<l.length;v++){f.index>v?(m=f,f=null):m=f.sibling;var g=p(o,f,l[v],u);if(null===g){null===f&&(f=m);break}e&&f&&null===g.alternate&&t(o,f),a=i(g,a,v),null===s?c=g:s.sibling=g,s=g,f=m}if(v===l.length)return n(o,f),c;if(null===f){for(;v<l.length;v++)null!==(f=d(o,l[v],u))&&(a=i(f,a,v),null===s?c=f:s.sibling=f,s=f);return c}for(f=r(o,f);v<l.length;v++)null!==(m=h(f,o,v,l[v],u))&&(e&&null!==m.alternate&&f.delete(null===m.key?v:m.key),a=i(m,a,v),null===s?c=m:s.sibling=m,s=m);return e&&f.forEach((function(e){return t(o,e)})),c}function m(o,l,u,c){var s=ve(u);if("function"!==typeof s)throw Error(a(150));if(null==(u=s.call(u)))throw Error(a(151));for(var f=s=null,v=l,m=l=0,g=null,y=u.next();null!==v&&!y.done;m++,y=u.next()){v.index>m?(g=v,v=null):g=v.sibling;var b=p(o,v,y.value,c);if(null===b){null===v&&(v=g);break}e&&v&&null===b.alternate&&t(o,v),l=i(b,l,m),null===f?s=b:f.sibling=b,f=b,v=g}if(y.done)return n(o,v),s;if(null===v){for(;!y.done;m++,y=u.next())null!==(y=d(o,y.value,c))&&(l=i(y,l,m),null===f?s=y:f.sibling=y,f=y);return s}for(v=r(o,v);!y.done;m++,y=u.next())null!==(y=h(v,o,m,y.value,c))&&(e&&null!==y.alternate&&v.delete(null===y.key?m:y.key),l=i(y,l,m),null===f?s=y:f.sibling=y,f=y);return e&&v.forEach((function(e){return t(o,e)})),s}return function(e,r,i,u){var c="object"===typeof i&&null!==i&&i.type===ne&&null===i.key;c&&(i=i.props.children);var s="object"===typeof i&&null!==i;if(s)switch(i.$$typeof){case ee:e:{for(s=i.key,c=r;null!==c;){if(c.key===s){switch(c.tag){case 7:if(i.type===ne){n(e,c.sibling),(r=o(c,i.props.children)).return=e,e=r;break e}break;default:if(c.elementType===i.type){n(e,c.sibling),(r=o(c,i.props)).ref=Oi(e,c,i),r.return=e,e=r;break e}}n(e,c);break}t(e,c),c=c.sibling}i.type===ne?((r=Tu(i.props.children,e.mode,u,i.key)).return=e,e=r):((u=_u(i.type,i.key,i.props,null,e.mode,u)).ref=Oi(e,r,i),u.return=e,e=u)}return l(e);case te:e:{for(c=i.key;null!==r;){if(r.key===c){if(4===r.tag&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),(r=o(r,i.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Pu(i,e.mode,u)).return=e,e=r}return l(e)}if("string"===typeof i||"number"===typeof i)return i=""+i,null!==r&&6===r.tag?(n(e,r.sibling),(r=o(r,i)).return=e,e=r):(n(e,r),(r=ju(i,e.mode,u)).return=e,e=r),l(e);if(wi(i))return v(e,r,i,u);if(ve(i))return m(e,r,i,u);if(s&&Ci(e,i),"undefined"===typeof i&&!c)switch(e.tag){case 1:case 0:throw e=e.type,Error(a(152,e.displayName||e.name||"Component"))}return n(e,r)}}var Ei=xi(!0),ki=xi(!1),_i={},Ti={current:_i},ji={current:_i},Pi={current:_i};function Ai(e){if(e===_i)throw Error(a(174));return e}function Ii(e,t){switch(co(Pi,t),co(ji,e),co(Ti,_i),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Fe(null,"");break;default:t=Fe(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}uo(Ti),co(Ti,t)}function Mi(){uo(Ti),uo(ji),uo(Pi)}function Di(e){Ai(Pi.current);var t=Ai(Ti.current),n=Fe(t,e.type);t!==n&&(co(ji,e),co(Ti,n))}function Ri(e){ji.current===e&&(uo(Ti),uo(ji))}var Ni={current:0};function Fi(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(64&t.effectTag))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function zi(e,t){return{responder:e,props:t}}var Li=X.ReactCurrentDispatcher,Vi=X.ReactCurrentBatchConfig,Hi=0,Bi=null,Wi=null,Ui=null,$i=!1;function Ki(){throw Error(a(321))}function qi(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Fr(e[n],t[n]))return!1;return!0}function Gi(e,t,n,r,o,i){if(Hi=i,Bi=t,t.memoizedState=null,t.updateQueue=null,t.expirationTime=0,Li.current=null===e||null===e.memoizedState?ga:ya,e=n(r,o),t.expirationTime===Hi){i=0;do{if(t.expirationTime=0,!(25>i))throw Error(a(301));i+=1,Ui=Wi=null,t.updateQueue=null,Li.current=ba,e=n(r,o)}while(t.expirationTime===Hi)}if(Li.current=ma,t=null!==Wi&&null!==Wi.next,Hi=0,Ui=Wi=Bi=null,$i=!1,t)throw Error(a(300));return e}function Yi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Ui?Bi.memoizedState=Ui=e:Ui=Ui.next=e,Ui}function Xi(){if(null===Wi){var e=Bi.alternate;e=null!==e?e.memoizedState:null}else e=Wi.next;var t=null===Ui?Bi.memoizedState:Ui.next;if(null!==t)Ui=t,Wi=e;else{if(null===e)throw Error(a(310));e={memoizedState:(Wi=e).memoizedState,baseState:Wi.baseState,baseQueue:Wi.baseQueue,queue:Wi.queue,next:null},null===Ui?Bi.memoizedState=Ui=e:Ui=Ui.next=e}return Ui}function Qi(e,t){return"function"===typeof t?t(e):t}function Zi(e){var t=Xi(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=Wi,o=r.baseQueue,i=n.pending;if(null!==i){if(null!==o){var l=o.next;o.next=i.next,i.next=l}r.baseQueue=o=i,n.pending=null}if(null!==o){o=o.next,r=r.baseState;var u=l=i=null,c=o;do{var s=c.expirationTime;if(s<Hi){var f={expirationTime:c.expirationTime,suspenseConfig:c.suspenseConfig,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null};null===u?(l=u=f,i=r):u=u.next=f,s>Bi.expirationTime&&(Bi.expirationTime=s,au(s))}else null!==u&&(u=u.next={expirationTime:1073741823,suspenseConfig:c.suspenseConfig,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),iu(s,c.suspenseConfig),r=c.eagerReducer===e?c.eagerState:e(r,c.action);c=c.next}while(null!==c&&c!==o);null===u?i=r:u.next=l,Fr(r,t.memoizedState)||(Pa=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=u,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function Ji(e){var t=Xi(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(null!==o){n.pending=null;var l=o=o.next;do{i=e(i,l.action),l=l.next}while(l!==o);Fr(i,t.memoizedState)||(Pa=!0),t.memoizedState=i,null===t.baseQueue&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function ea(e){var t=Yi();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:Qi,lastRenderedState:e}).dispatch=va.bind(null,Bi,e),[t.memoizedState,e]}function ta(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=Bi.updateQueue)?(t={lastEffect:null},Bi.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function na(){return Xi().memoizedState}function ra(e,t,n,r){var o=Yi();Bi.effectTag|=e,o.memoizedState=ta(1|t,n,void 0,void 0===r?null:r)}function oa(e,t,n,r){var o=Xi();r=void 0===r?null:r;var i=void 0;if(null!==Wi){var a=Wi.memoizedState;if(i=a.destroy,null!==r&&qi(r,a.deps))return void ta(t,n,i,r)}Bi.effectTag|=e,o.memoizedState=ta(1|t,n,i,r)}function ia(e,t){return ra(516,4,e,t)}function aa(e,t){return oa(516,4,e,t)}function la(e,t){return oa(4,2,e,t)}function ua(e,t){return"function"===typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function ca(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,oa(4,2,ua.bind(null,t,e),n)}function sa(){}function fa(e,t){return Yi().memoizedState=[e,void 0===t?null:t],e}function da(e,t){var n=Xi();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&qi(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function pa(e,t){var n=Xi();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&qi(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ha(e,t,n){var r=Ho();Wo(98>r?98:r,(function(){e(!0)})),Wo(97<r?97:r,(function(){var r=Vi.suspense;Vi.suspense=void 0===t?null:t;try{e(!1),n()}finally{Vi.suspense=r}}))}function va(e,t,n){var r=Kl(),o=pi.suspense;o={expirationTime:r=ql(r,e,o),suspenseConfig:o,action:n,eagerReducer:null,eagerState:null,next:null};var i=t.pending;if(null===i?o.next=o:(o.next=i.next,i.next=o),t.pending=o,i=e.alternate,e===Bi||null!==i&&i===Bi)$i=!0,o.expirationTime=Hi,Bi.expirationTime=Hi;else{if(0===e.expirationTime&&(null===i||0===i.expirationTime)&&null!==(i=t.lastRenderedReducer))try{var a=t.lastRenderedState,l=i(a,n);if(o.eagerReducer=i,o.eagerState=l,Fr(l,a))return}catch(u){}Gl(e,r)}}var ma={readContext:oi,useCallback:Ki,useContext:Ki,useEffect:Ki,useImperativeHandle:Ki,useLayoutEffect:Ki,useMemo:Ki,useReducer:Ki,useRef:Ki,useState:Ki,useDebugValue:Ki,useResponder:Ki,useDeferredValue:Ki,useTransition:Ki},ga={readContext:oi,useCallback:fa,useContext:oi,useEffect:ia,useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,ra(4,2,ua.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ra(4,2,e,t)},useMemo:function(e,t){var n=Yi();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Yi();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=va.bind(null,Bi,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Yi().memoizedState=e},useState:ea,useDebugValue:sa,useResponder:zi,useDeferredValue:function(e,t){var n=ea(e),r=n[0],o=n[1];return ia((function(){var n=Vi.suspense;Vi.suspense=void 0===t?null:t;try{o(e)}finally{Vi.suspense=n}}),[e,t]),r},useTransition:function(e){var t=ea(!1),n=t[0];return t=t[1],[fa(ha.bind(null,t,e),[t,e]),n]}},ya={readContext:oi,useCallback:da,useContext:oi,useEffect:aa,useImperativeHandle:ca,useLayoutEffect:la,useMemo:pa,useReducer:Zi,useRef:na,useState:function(){return Zi(Qi)},useDebugValue:sa,useResponder:zi,useDeferredValue:function(e,t){var n=Zi(Qi),r=n[0],o=n[1];return aa((function(){var n=Vi.suspense;Vi.suspense=void 0===t?null:t;try{o(e)}finally{Vi.suspense=n}}),[e,t]),r},useTransition:function(e){var t=Zi(Qi),n=t[0];return t=t[1],[da(ha.bind(null,t,e),[t,e]),n]}},ba={readContext:oi,useCallback:da,useContext:oi,useEffect:aa,useImperativeHandle:ca,useLayoutEffect:la,useMemo:pa,useReducer:Ji,useRef:na,useState:function(){return Ji(Qi)},useDebugValue:sa,useResponder:zi,useDeferredValue:function(e,t){var n=Ji(Qi),r=n[0],o=n[1];return aa((function(){var n=Vi.suspense;Vi.suspense=void 0===t?null:t;try{o(e)}finally{Vi.suspense=n}}),[e,t]),r},useTransition:function(e){var t=Ji(Qi),n=t[0];return t=t[1],[da(ha.bind(null,t,e),[t,e]),n]}},Sa=null,wa=null,Oa=!1;function Ca(e,t){var n=xu(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function xa(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);case 13:default:return!1}}function Ea(e){if(Oa){var t=wa;if(t){var n=t;if(!xa(e,t)){if(!(t=wn(n.nextSibling))||!xa(e,t))return e.effectTag=-1025&e.effectTag|2,Oa=!1,void(Sa=e);Ca(Sa,n)}Sa=e,wa=wn(t.firstChild)}else e.effectTag=-1025&e.effectTag|2,Oa=!1,Sa=e}}function ka(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;Sa=e}function _a(e){if(e!==Sa)return!1;if(!Oa)return ka(e),Oa=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!yn(t,e.memoizedProps))for(t=wa;t;)Ca(e,t),t=wn(t.nextSibling);if(ka(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(a(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){wa=wn(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}wa=null}}else wa=Sa?wn(e.stateNode.nextSibling):null;return!0}function Ta(){wa=Sa=null,Oa=!1}var ja=X.ReactCurrentOwner,Pa=!1;function Aa(e,t,n,r){t.child=null===e?ki(t,null,n,r):Ei(t,e.child,n,r)}function Ia(e,t,n,r,o){n=n.render;var i=t.ref;return ri(t,o),r=Gi(e,t,n,r,i,o),null===e||Pa?(t.effectTag|=1,Aa(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=o&&(e.expirationTime=0),Ga(e,t,o))}function Ma(e,t,n,r,o,i){if(null===e){var a=n.type;return"function"!==typeof a||Eu(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=_u(n.type,null,r,null,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,Da(e,t,a,r,o,i))}return a=e.child,o<i&&(o=a.memoizedProps,(n=null!==(n=n.compare)?n:Lr)(o,r)&&e.ref===t.ref)?Ga(e,t,i):(t.effectTag|=1,(e=ku(a,r)).ref=t.ref,e.return=t,t.child=e)}function Da(e,t,n,r,o,i){return null!==e&&Lr(e.memoizedProps,r)&&e.ref===t.ref&&(Pa=!1,o<i)?(t.expirationTime=e.expirationTime,Ga(e,t,i)):Na(e,t,n,r,i)}function Ra(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.effectTag|=128)}function Na(e,t,n,r,o){var i=mo(n)?ho:fo.current;return i=vo(t,i),ri(t,o),n=Gi(e,t,n,r,i,o),null===e||Pa?(t.effectTag|=1,Aa(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=o&&(e.expirationTime=0),Ga(e,t,o))}function Fa(e,t,n,r,o){if(mo(n)){var i=!0;So(t)}else i=!1;if(ri(t,o),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),yi(t,n,r),Si(t,n,r,o),r=!0;else if(null===e){var a=t.stateNode,l=t.memoizedProps;a.props=l;var u=a.context,c=n.contextType;"object"===typeof c&&null!==c?c=oi(c):c=vo(t,c=mo(n)?ho:fo.current);var s=n.getDerivedStateFromProps,f="function"===typeof s||"function"===typeof a.getSnapshotBeforeUpdate;f||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(l!==r||u!==c)&&bi(t,a,r,c),ii=!1;var d=t.memoizedState;a.state=d,fi(t,r,a,o),u=t.memoizedState,l!==r||d!==u||po.current||ii?("function"===typeof s&&(vi(t,n,s,r),u=t.memoizedState),(l=ii||gi(t,n,l,r,d,u,c))?(f||"function"!==typeof a.UNSAFE_componentWillMount&&"function"!==typeof a.componentWillMount||("function"===typeof a.componentWillMount&&a.componentWillMount(),"function"===typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"===typeof a.componentDidMount&&(t.effectTag|=4)):("function"===typeof a.componentDidMount&&(t.effectTag|=4),t.memoizedProps=r,t.memoizedState=u),a.props=r,a.state=u,a.context=c,r=l):("function"===typeof a.componentDidMount&&(t.effectTag|=4),r=!1)}else a=t.stateNode,li(e,t),l=t.memoizedProps,a.props=t.type===t.elementType?l:Yo(t.type,l),u=a.context,"object"===typeof(c=n.contextType)&&null!==c?c=oi(c):c=vo(t,c=mo(n)?ho:fo.current),(f="function"===typeof(s=n.getDerivedStateFromProps)||"function"===typeof a.getSnapshotBeforeUpdate)||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(l!==r||u!==c)&&bi(t,a,r,c),ii=!1,u=t.memoizedState,a.state=u,fi(t,r,a,o),d=t.memoizedState,l!==r||u!==d||po.current||ii?("function"===typeof s&&(vi(t,n,s,r),d=t.memoizedState),(s=ii||gi(t,n,l,r,u,d,c))?(f||"function"!==typeof a.UNSAFE_componentWillUpdate&&"function"!==typeof a.componentWillUpdate||("function"===typeof a.componentWillUpdate&&a.componentWillUpdate(r,d,c),"function"===typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,d,c)),"function"===typeof a.componentDidUpdate&&(t.effectTag|=4),"function"===typeof a.getSnapshotBeforeUpdate&&(t.effectTag|=256)):("function"!==typeof a.componentDidUpdate||l===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=4),"function"!==typeof a.getSnapshotBeforeUpdate||l===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=256),t.memoizedProps=r,t.memoizedState=d),a.props=r,a.state=d,a.context=c,r=s):("function"!==typeof a.componentDidUpdate||l===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=4),"function"!==typeof a.getSnapshotBeforeUpdate||l===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=256),r=!1);return za(e,t,n,r,i,o)}function za(e,t,n,r,o,i){Ra(e,t);var a=0!==(64&t.effectTag);if(!r&&!a)return o&&wo(t,n,!1),Ga(e,t,i);r=t.stateNode,ja.current=t;var l=a&&"function"!==typeof n.getDerivedStateFromError?null:r.render();return t.effectTag|=1,null!==e&&a?(t.child=Ei(t,e.child,null,i),t.child=Ei(t,null,l,i)):Aa(e,t,l,i),t.memoizedState=r.state,o&&wo(t,n,!0),t.child}function La(e){var t=e.stateNode;t.pendingContext?yo(0,t.pendingContext,t.pendingContext!==t.context):t.context&&yo(0,t.context,!1),Ii(e,t.containerInfo)}var Va,Ha,Ba,Wa={dehydrated:null,retryTime:0};function Ua(e,t,n){var r,o=t.mode,i=t.pendingProps,a=Ni.current,l=!1;if((r=0!==(64&t.effectTag))||(r=0!==(2&a)&&(null===e||null!==e.memoizedState)),r?(l=!0,t.effectTag&=-65):null!==e&&null===e.memoizedState||void 0===i.fallback||!0===i.unstable_avoidThisFallback||(a|=1),co(Ni,1&a),null===e){if(void 0!==i.fallback&&Ea(t),l){if(l=i.fallback,(i=Tu(null,o,0,null)).return=t,0===(2&t.mode))for(e=null!==t.memoizedState?t.child.child:t.child,i.child=e;null!==e;)e.return=i,e=e.sibling;return(n=Tu(l,o,n,null)).return=t,i.sibling=n,t.memoizedState=Wa,t.child=i,n}return o=i.children,t.memoizedState=null,t.child=ki(t,null,o,n)}if(null!==e.memoizedState){if(o=(e=e.child).sibling,l){if(i=i.fallback,(n=ku(e,e.pendingProps)).return=t,0===(2&t.mode)&&(l=null!==t.memoizedState?t.child.child:t.child)!==e.child)for(n.child=l;null!==l;)l.return=n,l=l.sibling;return(o=ku(o,i)).return=t,n.sibling=o,n.childExpirationTime=0,t.memoizedState=Wa,t.child=n,o}return n=Ei(t,e.child,i.children,n),t.memoizedState=null,t.child=n}if(e=e.child,l){if(l=i.fallback,(i=Tu(null,o,0,null)).return=t,i.child=e,null!==e&&(e.return=i),0===(2&t.mode))for(e=null!==t.memoizedState?t.child.child:t.child,i.child=e;null!==e;)e.return=i,e=e.sibling;return(n=Tu(l,o,n,null)).return=t,i.sibling=n,n.effectTag|=2,i.childExpirationTime=0,t.memoizedState=Wa,t.child=i,n}return t.memoizedState=null,t.child=Ei(t,e,i.children,n)}function $a(e,t){e.expirationTime<t&&(e.expirationTime=t);var n=e.alternate;null!==n&&n.expirationTime<t&&(n.expirationTime=t),ni(e.return,t)}function Ka(e,t,n,r,o,i){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailExpiration:0,tailMode:o,lastEffect:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailExpiration=0,a.tailMode=o,a.lastEffect=i)}function qa(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Aa(e,t,r.children,n),0!==(2&(r=Ni.current)))r=1&r|2,t.effectTag|=64;else{if(null!==e&&0!==(64&e.effectTag))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&$a(e,n);else if(19===e.tag)$a(e,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(co(Ni,r),0===(2&t.mode))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===Fi(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Ka(t,!1,o,n,i,t.lastEffect);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===Fi(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Ka(t,!0,n,null,i,t.lastEffect);break;case"together":Ka(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function Ga(e,t,n){null!==e&&(t.dependencies=e.dependencies);var r=t.expirationTime;if(0!==r&&au(r),t.childExpirationTime<n)return null;if(null!==e&&t.child!==e.child)throw Error(a(153));if(null!==t.child){for(n=ku(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=ku(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Ya(e,t){switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Xa(e,t,n){var r=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return mo(t.type)&&go(),null;case 3:return Mi(),uo(po),uo(fo),(n=t.stateNode).pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||!_a(t)||(t.effectTag|=4),null;case 5:Ri(t),n=Ai(Pi.current);var i=t.type;if(null!==e&&null!=t.stateNode)Ha(e,t,i,r,n),e.ref!==t.ref&&(t.effectTag|=128);else{if(!r){if(null===t.stateNode)throw Error(a(166));return null}if(e=Ai(Ti.current),_a(t)){r=t.stateNode,i=t.type;var l=t.memoizedProps;switch(r[xn]=t,r[En]=l,i){case"iframe":case"object":case"embed":qt("load",r);break;case"video":case"audio":for(e=0;e<Xe.length;e++)qt(Xe[e],r);break;case"source":qt("error",r);break;case"img":case"image":case"link":qt("error",r),qt("load",r);break;case"form":qt("reset",r),qt("submit",r);break;case"details":qt("toggle",r);break;case"input":Ce(r,l),qt("invalid",r),un(n,"onChange");break;case"select":r._wrapperState={wasMultiple:!!l.multiple},qt("invalid",r),un(n,"onChange");break;case"textarea":Ae(r,l),qt("invalid",r),un(n,"onChange")}for(var u in on(i,l),e=null,l)if(l.hasOwnProperty(u)){var c=l[u];"children"===u?"string"===typeof c?r.textContent!==c&&(e=["children",c]):"number"===typeof c&&r.textContent!==""+c&&(e=["children",""+c]):x.hasOwnProperty(u)&&null!=c&&un(n,u)}switch(i){case"input":Se(r),ke(r,l,!0);break;case"textarea":Se(r),Me(r);break;case"select":case"option":break;default:"function"===typeof l.onClick&&(r.onclick=cn)}n=e,t.updateQueue=n,null!==n&&(t.effectTag|=4)}else{switch(u=9===n.nodeType?n:n.ownerDocument,e===ln&&(e=Ne(i)),e===ln?"script"===i?((e=u.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"===typeof r.is?e=u.createElement(i,{is:r.is}):(e=u.createElement(i),"select"===i&&(u=e,r.multiple?u.multiple=!0:r.size&&(u.size=r.size))):e=u.createElementNS(e,i),e[xn]=t,e[En]=r,Va(e,t),t.stateNode=e,u=an(i,r),i){case"iframe":case"object":case"embed":qt("load",e),c=r;break;case"video":case"audio":for(c=0;c<Xe.length;c++)qt(Xe[c],e);c=r;break;case"source":qt("error",e),c=r;break;case"img":case"image":case"link":qt("error",e),qt("load",e),c=r;break;case"form":qt("reset",e),qt("submit",e),c=r;break;case"details":qt("toggle",e),c=r;break;case"input":Ce(e,r),c=Oe(e,r),qt("invalid",e),un(n,"onChange");break;case"option":c=Te(e,r);break;case"select":e._wrapperState={wasMultiple:!!r.multiple},c=o({},r,{value:void 0}),qt("invalid",e),un(n,"onChange");break;case"textarea":Ae(e,r),c=Pe(e,r),qt("invalid",e),un(n,"onChange");break;default:c=r}on(i,c);var s=c;for(l in s)if(s.hasOwnProperty(l)){var f=s[l];"style"===l?nn(e,f):"dangerouslySetInnerHTML"===l?null!=(f=f?f.__html:void 0)&&Le(e,f):"children"===l?"string"===typeof f?("textarea"!==i||""!==f)&&Ve(e,f):"number"===typeof f&&Ve(e,""+f):"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&"autoFocus"!==l&&(x.hasOwnProperty(l)?null!=f&&un(n,l):null!=f&&Q(e,l,f,u))}switch(i){case"input":Se(e),ke(e,r,!1);break;case"textarea":Se(e),Me(e);break;case"option":null!=r.value&&e.setAttribute("value",""+ye(r.value));break;case"select":e.multiple=!!r.multiple,null!=(n=r.value)?je(e,!!r.multiple,n,!1):null!=r.defaultValue&&je(e,!!r.multiple,r.defaultValue,!0);break;default:"function"===typeof c.onClick&&(e.onclick=cn)}gn(i,r)&&(t.effectTag|=4)}null!==t.ref&&(t.effectTag|=128)}return null;case 6:if(e&&null!=t.stateNode)Ba(0,t,e.memoizedProps,r);else{if("string"!==typeof r&&null===t.stateNode)throw Error(a(166));n=Ai(Pi.current),Ai(Ti.current),_a(t)?(n=t.stateNode,r=t.memoizedProps,n[xn]=t,n.nodeValue!==r&&(t.effectTag|=4)):((n=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[xn]=t,t.stateNode=n)}return null;case 13:return uo(Ni),r=t.memoizedState,0!==(64&t.effectTag)?(t.expirationTime=n,t):(n=null!==r,r=!1,null===e?void 0!==t.memoizedProps.fallback&&_a(t):(r=null!==(i=e.memoizedState),n||null===i||null!==(i=e.child.sibling)&&(null!==(l=t.firstEffect)?(t.firstEffect=i,i.nextEffect=l):(t.firstEffect=t.lastEffect=i,i.nextEffect=null),i.effectTag=8)),n&&!r&&0!==(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!==(1&Ni.current)?_l===Sl&&(_l=wl):(_l!==Sl&&_l!==wl||(_l=Ol),0!==Il&&null!==xl&&(Mu(xl,kl),Du(xl,Il)))),(n||r)&&(t.effectTag|=4),null);case 4:return Mi(),null;case 10:return ti(t),null;case 17:return mo(t.type)&&go(),null;case 19:if(uo(Ni),null===(r=t.memoizedState))return null;if(i=0!==(64&t.effectTag),null===(l=r.rendering)){if(i)Ya(r,!1);else if(_l!==Sl||null!==e&&0!==(64&e.effectTag))for(l=t.child;null!==l;){if(null!==(e=Fi(l))){for(t.effectTag|=64,Ya(r,!1),null!==(i=e.updateQueue)&&(t.updateQueue=i,t.effectTag|=4),null===r.lastEffect&&(t.firstEffect=null),t.lastEffect=r.lastEffect,r=t.child;null!==r;)l=n,(i=r).effectTag&=2,i.nextEffect=null,i.firstEffect=null,i.lastEffect=null,null===(e=i.alternate)?(i.childExpirationTime=0,i.expirationTime=l,i.child=null,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null):(i.childExpirationTime=e.childExpirationTime,i.expirationTime=e.expirationTime,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,l=e.dependencies,i.dependencies=null===l?null:{expirationTime:l.expirationTime,firstContext:l.firstContext,responders:l.responders}),r=r.sibling;return co(Ni,1&Ni.current|2),t.child}l=l.sibling}}else{if(!i)if(null!==(e=Fi(l))){if(t.effectTag|=64,i=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.effectTag|=4),Ya(r,!0),null===r.tail&&"hidden"===r.tailMode&&!l.alternate)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*Vo()-r.renderingStartTime>r.tailExpiration&&1<n&&(t.effectTag|=64,i=!0,Ya(r,!1),t.expirationTime=t.childExpirationTime=n-1);r.isBackwards?(l.sibling=t.child,t.child=l):(null!==(n=r.last)?n.sibling=l:t.child=l,r.last=l)}return null!==r.tail?(0===r.tailExpiration&&(r.tailExpiration=Vo()+500),n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=Vo(),n.sibling=null,t=Ni.current,co(Ni,i?1&t|2:1&t),n):null}throw Error(a(156,t.tag))}function Qa(e){switch(e.tag){case 1:mo(e.type)&&go();var t=e.effectTag;return 4096&t?(e.effectTag=-4097&t|64,e):null;case 3:if(Mi(),uo(po),uo(fo),0!==(64&(t=e.effectTag)))throw Error(a(285));return e.effectTag=-4097&t|64,e;case 5:return Ri(e),null;case 13:return uo(Ni),4096&(t=e.effectTag)?(e.effectTag=-4097&t|64,e):null;case 19:return uo(Ni),null;case 4:return Mi(),null;case 10:return ti(e),null;default:return null}}function Za(e,t){return{value:e,source:t,stack:ge(t)}}Va=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ha=function(e,t,n,r,i){var a=e.memoizedProps;if(a!==r){var l,u,c=t.stateNode;switch(Ai(Ti.current),e=null,n){case"input":a=Oe(c,a),r=Oe(c,r),e=[];break;case"option":a=Te(c,a),r=Te(c,r),e=[];break;case"select":a=o({},a,{value:void 0}),r=o({},r,{value:void 0}),e=[];break;case"textarea":a=Pe(c,a),r=Pe(c,r),e=[];break;default:"function"!==typeof a.onClick&&"function"===typeof r.onClick&&(c.onclick=cn)}for(l in on(n,r),n=null,a)if(!r.hasOwnProperty(l)&&a.hasOwnProperty(l)&&null!=a[l])if("style"===l)for(u in c=a[l])c.hasOwnProperty(u)&&(n||(n={}),n[u]="");else"dangerouslySetInnerHTML"!==l&&"children"!==l&&"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&"autoFocus"!==l&&(x.hasOwnProperty(l)?e||(e=[]):(e=e||[]).push(l,null));for(l in r){var s=r[l];if(c=null!=a?a[l]:void 0,r.hasOwnProperty(l)&&s!==c&&(null!=s||null!=c))if("style"===l)if(c){for(u in c)!c.hasOwnProperty(u)||s&&s.hasOwnProperty(u)||(n||(n={}),n[u]="");for(u in s)s.hasOwnProperty(u)&&c[u]!==s[u]&&(n||(n={}),n[u]=s[u])}else n||(e||(e=[]),e.push(l,n)),n=s;else"dangerouslySetInnerHTML"===l?(s=s?s.__html:void 0,c=c?c.__html:void 0,null!=s&&c!==s&&(e=e||[]).push(l,s)):"children"===l?c===s||"string"!==typeof s&&"number"!==typeof s||(e=e||[]).push(l,""+s):"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&(x.hasOwnProperty(l)?(null!=s&&un(i,l),e||c===s||(e=[])):(e=e||[]).push(l,s))}n&&(e=e||[]).push("style",n),i=e,(t.updateQueue=i)&&(t.effectTag|=4)}},Ba=function(e,t,n,r){n!==r&&(t.effectTag|=4)};var Ja="function"===typeof WeakSet?WeakSet:Set;function el(e,t){var n=t.source,r=t.stack;null===r&&null!==n&&(r=ge(n)),null!==n&&me(n.type),t=t.value,null!==e&&1===e.tag&&me(e.type);try{console.error(t)}catch(o){setTimeout((function(){throw o}))}}function tl(e){var t=e.ref;if(null!==t)if("function"===typeof t)try{t(null)}catch(n){yu(e,n)}else t.current=null}function nl(e,t){switch(t.tag){case 0:case 11:case 15:case 22:return;case 1:if(256&t.effectTag&&null!==e){var n=e.memoizedProps,r=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:Yo(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:case 5:case 6:case 4:case 17:return}throw Error(a(163))}function rl(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.destroy;n.destroy=void 0,void 0!==r&&r()}n=n.next}while(n!==t)}}function ol(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function il(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:return void ol(3,n);case 1:if(e=n.stateNode,4&n.effectTag)if(null===t)e.componentDidMount();else{var r=n.elementType===n.type?t.memoizedProps:Yo(n.type,t.memoizedProps);e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate)}return void(null!==(t=n.updateQueue)&&di(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}di(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.effectTag&&gn(n.type,n.memoizedProps)&&e.focus());case 6:case 4:case 12:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&Nt(n)))));case 19:case 17:case 20:case 21:return}throw Error(a(163))}function al(e,t,n){switch("function"===typeof Ou&&Ou(t),t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var r=e.next;Wo(97<n?97:n,(function(){var e=r;do{var n=e.destroy;if(void 0!==n){var o=t;try{n()}catch(i){yu(o,i)}}e=e.next}while(e!==r)}))}break;case 1:tl(t),"function"===typeof(n=t.stateNode).componentWillUnmount&&function(e,t){try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(n){yu(e,n)}}(t,n);break;case 5:tl(t);break;case 4:sl(e,t,n)}}function ll(e){var t=e.alternate;e.return=null,e.child=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.alternate=null,e.firstEffect=null,e.lastEffect=null,e.pendingProps=null,e.memoizedProps=null,e.stateNode=null,null!==t&&ll(t)}function ul(e){return 5===e.tag||3===e.tag||4===e.tag}function cl(e){e:{for(var t=e.return;null!==t;){if(ul(t)){var n=t;break e}t=t.return}throw Error(a(160))}switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:case 4:t=t.containerInfo,r=!0;break;default:throw Error(a(161))}16&n.effectTag&&(Ve(t,""),n.effectTag&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||ul(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.effectTag)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.effectTag)){n=n.stateNode;break e}}r?function e(t,n,r){var o=t.tag,i=5===o||6===o;if(i)t=i?t.stateNode:t.stateNode.instance,n?8===r.nodeType?r.parentNode.insertBefore(t,n):r.insertBefore(t,n):(8===r.nodeType?(n=r.parentNode).insertBefore(t,r):(n=r).appendChild(t),null!==(r=r._reactRootContainer)&&void 0!==r||null!==n.onclick||(n.onclick=cn));else if(4!==o&&null!==(t=t.child))for(e(t,n,r),t=t.sibling;null!==t;)e(t,n,r),t=t.sibling}(e,n,t):function e(t,n,r){var o=t.tag,i=5===o||6===o;if(i)t=i?t.stateNode:t.stateNode.instance,n?r.insertBefore(t,n):r.appendChild(t);else if(4!==o&&null!==(t=t.child))for(e(t,n,r),t=t.sibling;null!==t;)e(t,n,r),t=t.sibling}(e,n,t)}function sl(e,t,n){for(var r,o,i=t,l=!1;;){if(!l){l=i.return;e:for(;;){if(null===l)throw Error(a(160));switch(r=l.stateNode,l.tag){case 5:o=!1;break e;case 3:case 4:r=r.containerInfo,o=!0;break e}l=l.return}l=!0}if(5===i.tag||6===i.tag){e:for(var u=e,c=i,s=n,f=c;;)if(al(u,f,s),null!==f.child&&4!==f.tag)f.child.return=f,f=f.child;else{if(f===c)break e;for(;null===f.sibling;){if(null===f.return||f.return===c)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}o?(u=r,c=i.stateNode,8===u.nodeType?u.parentNode.removeChild(c):u.removeChild(c)):r.removeChild(i.stateNode)}else if(4===i.tag){if(null!==i.child){r=i.stateNode.containerInfo,o=!0,i.child.return=i,i=i.child;continue}}else if(al(e,i,n),null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;4===(i=i.return).tag&&(l=!1)}i.sibling.return=i.return,i=i.sibling}}function fl(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:return void rl(3,t);case 1:return;case 5:var n=t.stateNode;if(null!=n){var r=t.memoizedProps,o=null!==e?e.memoizedProps:r;e=t.type;var i=t.updateQueue;if(t.updateQueue=null,null!==i){for(n[En]=r,"input"===e&&"radio"===r.type&&null!=r.name&&xe(n,r),an(e,o),t=an(e,r),o=0;o<i.length;o+=2){var l=i[o],u=i[o+1];"style"===l?nn(n,u):"dangerouslySetInnerHTML"===l?Le(n,u):"children"===l?Ve(n,u):Q(n,l,u,t)}switch(e){case"input":Ee(n,r);break;case"textarea":Ie(n,r);break;case"select":t=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,null!=(e=r.value)?je(n,!!r.multiple,e,!1):t!==!!r.multiple&&(null!=r.defaultValue?je(n,!!r.multiple,r.defaultValue,!0):je(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(a(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((t=t.stateNode).hydrate&&(t.hydrate=!1,Nt(t.containerInfo)));case 12:return;case 13:if(n=t,null===t.memoizedState?r=!1:(r=!0,n=t.child,Dl=Vo()),null!==n)e:for(e=n;;){if(5===e.tag)i=e.stateNode,r?"function"===typeof(i=i.style).setProperty?i.setProperty("display","none","important"):i.display="none":(i=e.stateNode,o=void 0!==(o=e.memoizedProps.style)&&null!==o&&o.hasOwnProperty("display")?o.display:null,i.style.display=tn("display",o));else if(6===e.tag)e.stateNode.nodeValue=r?"":e.memoizedProps;else{if(13===e.tag&&null!==e.memoizedState&&null===e.memoizedState.dehydrated){(i=e.child.sibling).return=e,e=i;continue}if(null!==e.child){e.child.return=e,e=e.child;continue}}if(e===n)break;for(;null===e.sibling;){if(null===e.return||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}return void dl(t);case 19:return void dl(t);case 17:return}throw Error(a(163))}function dl(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Ja),t.forEach((function(t){var r=Su.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}var pl="function"===typeof WeakMap?WeakMap:Map;function hl(e,t,n){(n=ui(n,null)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Nl||(Nl=!0,Fl=r),el(e,t)},n}function vl(e,t,n){(n=ui(n,null)).tag=3;var r=e.type.getDerivedStateFromError;if("function"===typeof r){var o=t.value;n.payload=function(){return el(e,t),r(o)}}var i=e.stateNode;return null!==i&&"function"===typeof i.componentDidCatch&&(n.callback=function(){"function"!==typeof r&&(null===zl?zl=new Set([this]):zl.add(this),el(e,t));var n=t.stack;this.componentDidCatch(t.value,{componentStack:null!==n?n:""})}),n}var ml,gl=Math.ceil,yl=X.ReactCurrentDispatcher,bl=X.ReactCurrentOwner,Sl=0,wl=3,Ol=4,Cl=0,xl=null,El=null,kl=0,_l=Sl,Tl=null,jl=1073741823,Pl=1073741823,Al=null,Il=0,Ml=!1,Dl=0,Rl=null,Nl=!1,Fl=null,zl=null,Ll=!1,Vl=null,Hl=90,Bl=null,Wl=0,Ul=null,$l=0;function Kl(){return 0!==(48&Cl)?1073741821-(Vo()/10|0):0!==$l?$l:$l=1073741821-(Vo()/10|0)}function ql(e,t,n){if(0===(2&(t=t.mode)))return 1073741823;var r=Ho();if(0===(4&t))return 99===r?1073741823:1073741822;if(0!==(16&Cl))return kl;if(null!==n)e=Go(e,0|n.timeoutMs||5e3,250);else switch(r){case 99:e=1073741823;break;case 98:e=Go(e,150,100);break;case 97:case 96:e=Go(e,5e3,250);break;case 95:e=2;break;default:throw Error(a(326))}return null!==xl&&e===kl&&--e,e}function Gl(e,t){if(50<Wl)throw Wl=0,Ul=null,Error(a(185));if(null!==(e=Yl(e,t))){var n=Ho();1073741823===t?0!==(8&Cl)&&0===(48&Cl)?Jl(e):(Ql(e),0===Cl&&Ko()):Ql(e),0===(4&Cl)||98!==n&&99!==n||(null===Bl?Bl=new Map([[e,t]]):(void 0===(n=Bl.get(e))||n>t)&&Bl.set(e,t))}}function Yl(e,t){e.expirationTime<t&&(e.expirationTime=t);var n=e.alternate;null!==n&&n.expirationTime<t&&(n.expirationTime=t);var r=e.return,o=null;if(null===r&&3===e.tag)o=e.stateNode;else for(;null!==r;){if(n=r.alternate,r.childExpirationTime<t&&(r.childExpirationTime=t),null!==n&&n.childExpirationTime<t&&(n.childExpirationTime=t),null===r.return&&3===r.tag){o=r.stateNode;break}r=r.return}return null!==o&&(xl===o&&(au(t),_l===Ol&&Mu(o,kl)),Du(o,t)),o}function Xl(e){var t=e.lastExpiredTime;if(0!==t)return t;if(!Iu(e,t=e.firstPendingTime))return t;var n=e.lastPingedTime;return 2>=(e=n>(e=e.nextKnownPendingLevel)?n:e)&&t!==e?0:e}function Ql(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=$o(Jl.bind(null,e));else{var t=Xl(e),n=e.callbackNode;if(0===t)null!==n&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var r=Kl();if(1073741823===t?r=99:1===t||2===t?r=95:r=0>=(r=10*(1073741821-t)-10*(1073741821-r))?99:250>=r?98:5250>=r?97:95,null!==n){var o=e.callbackPriority;if(e.callbackExpirationTime===t&&o>=r)return;n!==Mo&&xo(n)}e.callbackExpirationTime=t,e.callbackPriority=r,t=1073741823===t?$o(Jl.bind(null,e)):Uo(r,Zl.bind(null,e),{timeout:10*(1073741821-t)-Vo()}),e.callbackNode=t}}}function Zl(e,t){if($l=0,t)return Ru(e,t=Kl()),Ql(e),null;var n=Xl(e);if(0!==n){if(t=e.callbackNode,0!==(48&Cl))throw Error(a(327));if(vu(),e===xl&&n===kl||nu(e,n),null!==El){var r=Cl;Cl|=16;for(var o=ou();;)try{uu();break}catch(u){ru(e,u)}if(ei(),Cl=r,yl.current=o,1===_l)throw t=Tl,nu(e,n),Mu(e,n),Ql(e),t;if(null===El)switch(o=e.finishedWork=e.current.alternate,e.finishedExpirationTime=n,r=_l,xl=null,r){case Sl:case 1:throw Error(a(345));case 2:Ru(e,2<n?2:n);break;case wl:if(Mu(e,n),n===(r=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=fu(o)),1073741823===jl&&10<(o=Dl+500-Vo())){if(Ml){var i=e.lastPingedTime;if(0===i||i>=n){e.lastPingedTime=n,nu(e,n);break}}if(0!==(i=Xl(e))&&i!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}e.timeoutHandle=bn(du.bind(null,e),o);break}du(e);break;case Ol:if(Mu(e,n),n===(r=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=fu(o)),Ml&&(0===(o=e.lastPingedTime)||o>=n)){e.lastPingedTime=n,nu(e,n);break}if(0!==(o=Xl(e))&&o!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}if(1073741823!==Pl?r=10*(1073741821-Pl)-Vo():1073741823===jl?r=0:(r=10*(1073741821-jl)-5e3,0>(r=(o=Vo())-r)&&(r=0),(n=10*(1073741821-n)-o)<(r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*gl(r/1960))-r)&&(r=n)),10<r){e.timeoutHandle=bn(du.bind(null,e),r);break}du(e);break;case 5:if(1073741823!==jl&&null!==Al){i=jl;var l=Al;if(0>=(r=0|l.busyMinDurationMs)?r=0:(o=0|l.busyDelayMs,r=(i=Vo()-(10*(1073741821-i)-(0|l.timeoutMs||5e3)))<=o?0:o+r-i),10<r){Mu(e,n),e.timeoutHandle=bn(du.bind(null,e),r);break}}du(e);break;default:throw Error(a(329))}if(Ql(e),e.callbackNode===t)return Zl.bind(null,e)}}return null}function Jl(e){var t=e.lastExpiredTime;if(t=0!==t?t:1073741823,0!==(48&Cl))throw Error(a(327));if(vu(),e===xl&&t===kl||nu(e,t),null!==El){var n=Cl;Cl|=16;for(var r=ou();;)try{lu();break}catch(o){ru(e,o)}if(ei(),Cl=n,yl.current=r,1===_l)throw n=Tl,nu(e,t),Mu(e,t),Ql(e),n;if(null!==El)throw Error(a(261));e.finishedWork=e.current.alternate,e.finishedExpirationTime=t,xl=null,du(e),Ql(e)}return null}function eu(e,t){var n=Cl;Cl|=1;try{return e(t)}finally{0===(Cl=n)&&Ko()}}function tu(e,t){var n=Cl;Cl&=-2,Cl|=8;try{return e(t)}finally{0===(Cl=n)&&Ko()}}function nu(e,t){e.finishedWork=null,e.finishedExpirationTime=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,Sn(n)),null!==El)for(n=El.return;null!==n;){var r=n;switch(r.tag){case 1:null!==(r=r.type.childContextTypes)&&void 0!==r&&go();break;case 3:Mi(),uo(po),uo(fo);break;case 5:Ri(r);break;case 4:Mi();break;case 13:case 19:uo(Ni);break;case 10:ti(r)}n=n.return}xl=e,El=ku(e.current,null),kl=t,_l=Sl,Tl=null,Pl=jl=1073741823,Al=null,Il=0,Ml=!1}function ru(e,t){for(;;){try{if(ei(),Li.current=ma,$i)for(var n=Bi.memoizedState;null!==n;){var r=n.queue;null!==r&&(r.pending=null),n=n.next}if(Hi=0,Ui=Wi=Bi=null,$i=!1,null===El||null===El.return)return _l=1,Tl=t,El=null;e:{var o=e,i=El.return,a=El,l=t;if(t=kl,a.effectTag|=2048,a.firstEffect=a.lastEffect=null,null!==l&&"object"===typeof l&&"function"===typeof l.then){var u=l;if(0===(2&a.mode)){var c=a.alternate;c?(a.updateQueue=c.updateQueue,a.memoizedState=c.memoizedState,a.expirationTime=c.expirationTime):(a.updateQueue=null,a.memoizedState=null)}var s=0!==(1&Ni.current),f=i;do{var d;if(d=13===f.tag){var p=f.memoizedState;if(null!==p)d=null!==p.dehydrated;else{var h=f.memoizedProps;d=void 0!==h.fallback&&(!0!==h.unstable_avoidThisFallback||!s)}}if(d){var v=f.updateQueue;if(null===v){var m=new Set;m.add(u),f.updateQueue=m}else v.add(u);if(0===(2&f.mode)){if(f.effectTag|=64,a.effectTag&=-2981,1===a.tag)if(null===a.alternate)a.tag=17;else{var g=ui(1073741823,null);g.tag=2,ci(a,g)}a.expirationTime=1073741823;break e}l=void 0,a=t;var y=o.pingCache;if(null===y?(y=o.pingCache=new pl,l=new Set,y.set(u,l)):void 0===(l=y.get(u))&&(l=new Set,y.set(u,l)),!l.has(a)){l.add(a);var b=bu.bind(null,o,u,a);u.then(b,b)}f.effectTag|=4096,f.expirationTime=t;break e}f=f.return}while(null!==f);l=Error((me(a.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display."+ge(a))}5!==_l&&(_l=2),l=Za(l,a),f=i;do{switch(f.tag){case 3:u=l,f.effectTag|=4096,f.expirationTime=t,si(f,hl(f,u,t));break e;case 1:u=l;var S=f.type,w=f.stateNode;if(0===(64&f.effectTag)&&("function"===typeof S.getDerivedStateFromError||null!==w&&"function"===typeof w.componentDidCatch&&(null===zl||!zl.has(w)))){f.effectTag|=4096,f.expirationTime=t,si(f,vl(f,u,t));break e}}f=f.return}while(null!==f)}El=su(El)}catch(O){t=O;continue}break}}function ou(){var e=yl.current;return yl.current=ma,null===e?ma:e}function iu(e,t){e<jl&&2<e&&(jl=e),null!==t&&e<Pl&&2<e&&(Pl=e,Al=t)}function au(e){e>Il&&(Il=e)}function lu(){for(;null!==El;)El=cu(El)}function uu(){for(;null!==El&&!Do();)El=cu(El)}function cu(e){var t=ml(e.alternate,e,kl);return e.memoizedProps=e.pendingProps,null===t&&(t=su(e)),bl.current=null,t}function su(e){El=e;do{var t=El.alternate;if(e=El.return,0===(2048&El.effectTag)){if(t=Xa(t,El,kl),1===kl||1!==El.childExpirationTime){for(var n=0,r=El.child;null!==r;){var o=r.expirationTime,i=r.childExpirationTime;o>n&&(n=o),i>n&&(n=i),r=r.sibling}El.childExpirationTime=n}if(null!==t)return t;null!==e&&0===(2048&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=El.firstEffect),null!==El.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=El.firstEffect),e.lastEffect=El.lastEffect),1<El.effectTag&&(null!==e.lastEffect?e.lastEffect.nextEffect=El:e.firstEffect=El,e.lastEffect=El))}else{if(null!==(t=Qa(El)))return t.effectTag&=2047,t;null!==e&&(e.firstEffect=e.lastEffect=null,e.effectTag|=2048)}if(null!==(t=El.sibling))return t;El=e}while(null!==El);return _l===Sl&&(_l=5),null}function fu(e){var t=e.expirationTime;return t>(e=e.childExpirationTime)?t:e}function du(e){var t=Ho();return Wo(99,pu.bind(null,e,t)),null}function pu(e,t){do{vu()}while(null!==Vl);if(0!==(48&Cl))throw Error(a(327));var n=e.finishedWork,r=e.finishedExpirationTime;if(null===n)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,n===e.current)throw Error(a(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var o=fu(n);if(e.firstPendingTime=o,r<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:r<=e.firstSuspendedTime&&(e.firstSuspendedTime=r-1),r<=e.lastPingedTime&&(e.lastPingedTime=0),r<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===xl&&(El=xl=null,kl=0),1<n.effectTag?null!==n.lastEffect?(n.lastEffect.nextEffect=n,o=n.firstEffect):o=n:o=n.firstEffect,null!==o){var i=Cl;Cl|=32,bl.current=null,vn=Kt;var l=pn();if(hn(l)){if("selectionStart"in l)var u={start:l.selectionStart,end:l.selectionEnd};else e:{var c=(u=(u=l.ownerDocument)&&u.defaultView||window).getSelection&&u.getSelection();if(c&&0!==c.rangeCount){u=c.anchorNode;var s=c.anchorOffset,f=c.focusNode;c=c.focusOffset;try{u.nodeType,f.nodeType}catch(k){u=null;break e}var d=0,p=-1,h=-1,v=0,m=0,g=l,y=null;t:for(;;){for(var b;g!==u||0!==s&&3!==g.nodeType||(p=d+s),g!==f||0!==c&&3!==g.nodeType||(h=d+c),3===g.nodeType&&(d+=g.nodeValue.length),null!==(b=g.firstChild);)y=g,g=b;for(;;){if(g===l)break t;if(y===u&&++v===s&&(p=d),y===f&&++m===c&&(h=d),null!==(b=g.nextSibling))break;y=(g=y).parentNode}g=b}u=-1===p||-1===h?null:{start:p,end:h}}else u=null}u=u||{start:0,end:0}}else u=null;mn={activeElementDetached:null,focusedElem:l,selectionRange:u},Kt=!1,Rl=o;do{try{hu()}catch(k){if(null===Rl)throw Error(a(330));yu(Rl,k),Rl=Rl.nextEffect}}while(null!==Rl);Rl=o;do{try{for(l=e,u=t;null!==Rl;){var S=Rl.effectTag;if(16&S&&Ve(Rl.stateNode,""),128&S){var w=Rl.alternate;if(null!==w){var O=w.ref;null!==O&&("function"===typeof O?O(null):O.current=null)}}switch(1038&S){case 2:cl(Rl),Rl.effectTag&=-3;break;case 6:cl(Rl),Rl.effectTag&=-3,fl(Rl.alternate,Rl);break;case 1024:Rl.effectTag&=-1025;break;case 1028:Rl.effectTag&=-1025,fl(Rl.alternate,Rl);break;case 4:fl(Rl.alternate,Rl);break;case 8:sl(l,s=Rl,u),ll(s)}Rl=Rl.nextEffect}}catch(k){if(null===Rl)throw Error(a(330));yu(Rl,k),Rl=Rl.nextEffect}}while(null!==Rl);if(O=mn,w=pn(),S=O.focusedElem,u=O.selectionRange,w!==S&&S&&S.ownerDocument&&function e(t,n){return!(!t||!n)&&(t===n||(!t||3!==t.nodeType)&&(n&&3===n.nodeType?e(t,n.parentNode):"contains"in t?t.contains(n):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(n))))}(S.ownerDocument.documentElement,S)){null!==u&&hn(S)&&(w=u.start,void 0===(O=u.end)&&(O=w),"selectionStart"in S?(S.selectionStart=w,S.selectionEnd=Math.min(O,S.value.length)):(O=(w=S.ownerDocument||document)&&w.defaultView||window).getSelection&&(O=O.getSelection(),s=S.textContent.length,l=Math.min(u.start,s),u=void 0===u.end?l:Math.min(u.end,s),!O.extend&&l>u&&(s=u,u=l,l=s),s=dn(S,l),f=dn(S,u),s&&f&&(1!==O.rangeCount||O.anchorNode!==s.node||O.anchorOffset!==s.offset||O.focusNode!==f.node||O.focusOffset!==f.offset)&&((w=w.createRange()).setStart(s.node,s.offset),O.removeAllRanges(),l>u?(O.addRange(w),O.extend(f.node,f.offset)):(w.setEnd(f.node,f.offset),O.addRange(w))))),w=[];for(O=S;O=O.parentNode;)1===O.nodeType&&w.push({element:O,left:O.scrollLeft,top:O.scrollTop});for("function"===typeof S.focus&&S.focus(),S=0;S<w.length;S++)(O=w[S]).element.scrollLeft=O.left,O.element.scrollTop=O.top}Kt=!!vn,mn=vn=null,e.current=n,Rl=o;do{try{for(S=e;null!==Rl;){var C=Rl.effectTag;if(36&C&&il(S,Rl.alternate,Rl),128&C){w=void 0;var x=Rl.ref;if(null!==x){var E=Rl.stateNode;switch(Rl.tag){case 5:w=E;break;default:w=E}"function"===typeof x?x(w):x.current=w}}Rl=Rl.nextEffect}}catch(k){if(null===Rl)throw Error(a(330));yu(Rl,k),Rl=Rl.nextEffect}}while(null!==Rl);Rl=null,Ro(),Cl=i}else e.current=n;if(Ll)Ll=!1,Vl=e,Hl=t;else for(Rl=o;null!==Rl;)t=Rl.nextEffect,Rl.nextEffect=null,Rl=t;if(0===(t=e.firstPendingTime)&&(zl=null),1073741823===t?e===Ul?Wl++:(Wl=0,Ul=e):Wl=0,"function"===typeof wu&&wu(n.stateNode,r),Ql(e),Nl)throw Nl=!1,e=Fl,Fl=null,e;return 0!==(8&Cl)||Ko(),null}function hu(){for(;null!==Rl;){var e=Rl.effectTag;0!==(256&e)&&nl(Rl.alternate,Rl),0===(512&e)||Ll||(Ll=!0,Uo(97,(function(){return vu(),null}))),Rl=Rl.nextEffect}}function vu(){if(90!==Hl){var e=97<Hl?97:Hl;return Hl=90,Wo(e,mu)}}function mu(){if(null===Vl)return!1;var e=Vl;if(Vl=null,0!==(48&Cl))throw Error(a(331));var t=Cl;for(Cl|=32,e=e.current.firstEffect;null!==e;){try{var n=e;if(0!==(512&n.effectTag))switch(n.tag){case 0:case 11:case 15:case 22:rl(5,n),ol(5,n)}}catch(r){if(null===e)throw Error(a(330));yu(e,r)}n=e.nextEffect,e.nextEffect=null,e=n}return Cl=t,Ko(),!0}function gu(e,t,n){ci(e,t=hl(e,t=Za(n,t),1073741823)),null!==(e=Yl(e,1073741823))&&Ql(e)}function yu(e,t){if(3===e.tag)gu(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){gu(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"===typeof n.type.getDerivedStateFromError||"function"===typeof r.componentDidCatch&&(null===zl||!zl.has(r))){ci(n,e=vl(n,e=Za(t,e),1073741823)),null!==(n=Yl(n,1073741823))&&Ql(n);break}}n=n.return}}function bu(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),xl===e&&kl===n?_l===Ol||_l===wl&&1073741823===jl&&Vo()-Dl<500?nu(e,kl):Ml=!0:Iu(e,n)&&(0!==(t=e.lastPingedTime)&&t<n||(e.lastPingedTime=n,Ql(e)))}function Su(e,t){var n=e.stateNode;null!==n&&n.delete(t),0===(t=0)&&(t=ql(t=Kl(),e,null)),null!==(e=Yl(e,t))&&Ql(e)}ml=function(e,t,n){var r=t.expirationTime;if(null!==e){var o=t.pendingProps;if(e.memoizedProps!==o||po.current)Pa=!0;else{if(r<n){switch(Pa=!1,t.tag){case 3:La(t),Ta();break;case 5:if(Di(t),4&t.mode&&1!==n&&o.hidden)return t.expirationTime=t.childExpirationTime=1,null;break;case 1:mo(t.type)&&So(t);break;case 4:Ii(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value,o=t.type._context,co(Xo,o._currentValue),o._currentValue=r;break;case 13:if(null!==t.memoizedState)return 0!==(r=t.child.childExpirationTime)&&r>=n?Ua(e,t,n):(co(Ni,1&Ni.current),null!==(t=Ga(e,t,n))?t.sibling:null);co(Ni,1&Ni.current);break;case 19:if(r=t.childExpirationTime>=n,0!==(64&e.effectTag)){if(r)return qa(e,t,n);t.effectTag|=64}if(null!==(o=t.memoizedState)&&(o.rendering=null,o.tail=null),co(Ni,Ni.current),!r)return null}return Ga(e,t,n)}Pa=!1}}else Pa=!1;switch(t.expirationTime=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,o=vo(t,fo.current),ri(t,n),o=Gi(null,t,r,e,o,n),t.effectTag|=1,"object"===typeof o&&null!==o&&"function"===typeof o.render&&void 0===o.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,mo(r)){var i=!0;So(t)}else i=!1;t.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,ai(t);var l=r.getDerivedStateFromProps;"function"===typeof l&&vi(t,r,l,e),o.updater=mi,t.stateNode=o,o._reactInternalFiber=t,Si(t,r,e,n),t=za(null,t,r,!0,i,n)}else t.tag=0,Aa(null,t,o,n),t=t.child;return t;case 16:e:{if(o=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,function(e){if(-1===e._status){e._status=0;var t=e._ctor;t=t(),e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}}(o),1!==o._status)throw o._result;switch(o=o._result,t.type=o,i=t.tag=function(e){if("function"===typeof e)return Eu(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===ue)return 11;if(e===fe)return 14}return 2}(o),e=Yo(o,e),i){case 0:t=Na(null,t,o,e,n);break e;case 1:t=Fa(null,t,o,e,n);break e;case 11:t=Ia(null,t,o,e,n);break e;case 14:t=Ma(null,t,o,Yo(o.type,e),r,n);break e}throw Error(a(306,o,""))}return t;case 0:return r=t.type,o=t.pendingProps,Na(e,t,r,o=t.elementType===r?o:Yo(r,o),n);case 1:return r=t.type,o=t.pendingProps,Fa(e,t,r,o=t.elementType===r?o:Yo(r,o),n);case 3:if(La(t),r=t.updateQueue,null===e||null===r)throw Error(a(282));if(r=t.pendingProps,o=null!==(o=t.memoizedState)?o.element:null,li(e,t),fi(t,r,null,n),(r=t.memoizedState.element)===o)Ta(),t=Ga(e,t,n);else{if((o=t.stateNode.hydrate)&&(wa=wn(t.stateNode.containerInfo.firstChild),Sa=t,o=Oa=!0),o)for(n=ki(t,null,r,n),t.child=n;n;)n.effectTag=-3&n.effectTag|1024,n=n.sibling;else Aa(e,t,r,n),Ta();t=t.child}return t;case 5:return Di(t),null===e&&Ea(t),r=t.type,o=t.pendingProps,i=null!==e?e.memoizedProps:null,l=o.children,yn(r,o)?l=null:null!==i&&yn(r,i)&&(t.effectTag|=16),Ra(e,t),4&t.mode&&1!==n&&o.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(Aa(e,t,l,n),t=t.child),t;case 6:return null===e&&Ea(t),null;case 13:return Ua(e,t,n);case 4:return Ii(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Ei(t,null,r,n):Aa(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,Ia(e,t,r,o=t.elementType===r?o:Yo(r,o),n);case 7:return Aa(e,t,t.pendingProps,n),t.child;case 8:case 12:return Aa(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,o=t.pendingProps,l=t.memoizedProps,i=o.value;var u=t.type._context;if(co(Xo,u._currentValue),u._currentValue=i,null!==l)if(u=l.value,0===(i=Fr(u,i)?0:0|("function"===typeof r._calculateChangedBits?r._calculateChangedBits(u,i):1073741823))){if(l.children===o.children&&!po.current){t=Ga(e,t,n);break e}}else for(null!==(u=t.child)&&(u.return=t);null!==u;){var c=u.dependencies;if(null!==c){l=u.child;for(var s=c.firstContext;null!==s;){if(s.context===r&&0!==(s.observedBits&i)){1===u.tag&&((s=ui(n,null)).tag=2,ci(u,s)),u.expirationTime<n&&(u.expirationTime=n),null!==(s=u.alternate)&&s.expirationTime<n&&(s.expirationTime=n),ni(u.return,n),c.expirationTime<n&&(c.expirationTime=n);break}s=s.next}}else l=10===u.tag&&u.type===t.type?null:u.child;if(null!==l)l.return=u;else for(l=u;null!==l;){if(l===t){l=null;break}if(null!==(u=l.sibling)){u.return=l.return,l=u;break}l=l.return}u=l}Aa(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=(i=t.pendingProps).children,ri(t,n),r=r(o=oi(o,i.unstable_observedBits)),t.effectTag|=1,Aa(e,t,r,n),t.child;case 14:return i=Yo(o=t.type,t.pendingProps),Ma(e,t,o,i=Yo(o.type,i),r,n);case 15:return Da(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Yo(r,o),null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),t.tag=1,mo(r)?(e=!0,So(t)):e=!1,ri(t,n),yi(t,r,o),Si(t,r,o,n),za(null,t,r,!0,e,n);case 19:return qa(e,t,n)}throw Error(a(156,t.tag))};var wu=null,Ou=null;function Cu(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childExpirationTime=this.expirationTime=0,this.alternate=null}function xu(e,t,n,r){return new Cu(e,t,n,r)}function Eu(e){return!(!(e=e.prototype)||!e.isReactComponent)}function ku(e,t){var n=e.alternate;return null===n?((n=xu(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.effectTag=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childExpirationTime=e.childExpirationTime,n.expirationTime=e.expirationTime,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{expirationTime:t.expirationTime,firstContext:t.firstContext,responders:t.responders},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function _u(e,t,n,r,o,i){var l=2;if(r=e,"function"===typeof e)Eu(e)&&(l=1);else if("string"===typeof e)l=5;else e:switch(e){case ne:return Tu(n.children,o,i,t);case le:l=8,o|=7;break;case re:l=8,o|=1;break;case oe:return(e=xu(12,n,t,8|o)).elementType=oe,e.type=oe,e.expirationTime=i,e;case ce:return(e=xu(13,n,t,o)).type=ce,e.elementType=ce,e.expirationTime=i,e;case se:return(e=xu(19,n,t,o)).elementType=se,e.expirationTime=i,e;default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case ie:l=10;break e;case ae:l=9;break e;case ue:l=11;break e;case fe:l=14;break e;case de:l=16,r=null;break e;case pe:l=22;break e}throw Error(a(130,null==e?e:typeof e,""))}return(t=xu(l,n,t,o)).elementType=e,t.type=r,t.expirationTime=i,t}function Tu(e,t,n,r){return(e=xu(7,e,r,t)).expirationTime=n,e}function ju(e,t,n){return(e=xu(6,e,null,t)).expirationTime=n,e}function Pu(e,t,n){return(t=xu(4,null!==e.children?e.children:[],e.key,t)).expirationTime=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Au(e,t,n){this.tag=t,this.current=null,this.containerInfo=e,this.pingCache=this.pendingChildren=null,this.finishedExpirationTime=0,this.finishedWork=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=90,this.lastExpiredTime=this.lastPingedTime=this.nextKnownPendingLevel=this.lastSuspendedTime=this.firstSuspendedTime=this.firstPendingTime=0}function Iu(e,t){var n=e.firstSuspendedTime;return e=e.lastSuspendedTime,0!==n&&n>=t&&e<=t}function Mu(e,t){var n=e.firstSuspendedTime,r=e.lastSuspendedTime;n<t&&(e.firstSuspendedTime=t),(r>t||0===n)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function Du(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var n=e.firstSuspendedTime;0!==n&&(t>=n?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function Ru(e,t){var n=e.lastExpiredTime;(0===n||n>t)&&(e.lastExpiredTime=t)}function Nu(e,t,n,r){var o=t.current,i=Kl(),l=pi.suspense;i=ql(i,o,l);e:if(n){t:{if(Je(n=n._reactInternalFiber)!==n||1!==n.tag)throw Error(a(170));var u=n;do{switch(u.tag){case 3:u=u.stateNode.context;break t;case 1:if(mo(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break t}}u=u.return}while(null!==u);throw Error(a(171))}if(1===n.tag){var c=n.type;if(mo(c)){n=bo(n,c,u);break e}}n=u}else n=so;return null===t.context?t.context=n:t.pendingContext=n,(t=ui(i,l)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),ci(o,t),Gl(o,i),i}function Fu(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function zu(e,t){null!==(e=e.memoizedState)&&null!==e.dehydrated&&e.retryTime<t&&(e.retryTime=t)}function Lu(e,t){zu(e,t),(e=e.alternate)&&zu(e,t)}function Vu(e,t,n){var r=new Au(e,t,n=null!=n&&!0===n.hydrate),o=xu(3,null,null,2===t?7:1===t?3:0);r.current=o,o.stateNode=r,ai(o),e[kn]=r.current,n&&0!==t&&function(e,t){var n=Ze(t);kt.forEach((function(e){ht(e,t,n)})),_t.forEach((function(e){ht(e,t,n)}))}(0,9===e.nodeType?e:e.ownerDocument),this._internalRoot=r}function Hu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Bu(e,t,n,r,o){var i=n._reactRootContainer;if(i){var a=i._internalRoot;if("function"===typeof o){var l=o;o=function(){var e=Fu(a);l.call(e)}}Nu(t,a,e,o)}else{if(i=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new Vu(e,0,t?{hydrate:!0}:void 0)}(n,r),a=i._internalRoot,"function"===typeof o){var u=o;o=function(){var e=Fu(a);u.call(e)}}tu((function(){Nu(t,a,e,o)}))}return Fu(a)}function Wu(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:te,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}function Uu(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Hu(t))throw Error(a(200));return Wu(e,t,null,n)}Vu.prototype.render=function(e){Nu(e,this._internalRoot,null,null)},Vu.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;Nu(null,e,null,(function(){t[kn]=null}))},vt=function(e){if(13===e.tag){var t=Go(Kl(),150,100);Gl(e,t),Lu(e,t)}},mt=function(e){13===e.tag&&(Gl(e,3),Lu(e,3))},gt=function(e){if(13===e.tag){var t=Kl();Gl(e,t=ql(t,e,null)),Lu(e,t)}},T=function(e,t,n){switch(t){case"input":if(Ee(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=Pn(r);if(!o)throw Error(a(90));we(r),Ee(r,o)}}}break;case"textarea":Ie(e,n);break;case"select":null!=(t=n.value)&&je(e,!!n.multiple,t,!1)}},D=eu,R=function(e,t,n,r,o){var i=Cl;Cl|=4;try{return Wo(98,e.bind(null,t,n,r,o))}finally{0===(Cl=i)&&Ko()}},N=function(){0===(49&Cl)&&(function(){if(null!==Bl){var e=Bl;Bl=null,e.forEach((function(e,t){Ru(t,e),Ql(t)})),Ko()}}(),vu())},F=function(e,t){var n=Cl;Cl|=2;try{return e(t)}finally{0===(Cl=n)&&Ko()}};var $u={Events:[Tn,jn,Pn,k,C,Fn,function(e){ot(e,Nn)},I,M,Qt,lt,vu,{current:!1}]};!function(e){var t=e.findFiberByHostInstance;(function(e){if("undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)return!0;try{var n=t.inject(e);wu=function(e){try{t.onCommitFiberRoot(n,e,void 0,64===(64&e.current.effectTag))}catch(r){}},Ou=function(e){try{t.onCommitFiberUnmount(n,e)}catch(r){}}}catch(r){}})(o({},e,{overrideHookState:null,overrideProps:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:X.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=nt(e))?null:e.stateNode},findFiberByHostInstance:function(e){return t?t(e):null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null}))}({findFiberByHostInstance:_n,bundleType:0,version:"16.13.1",rendererPackageName:"react-dom"}),t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$u,t.createPortal=Uu,t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternalFiber;if(void 0===t){if("function"===typeof e.render)throw Error(a(188));throw Error(a(268,Object.keys(e)))}return e=null===(e=nt(t))?null:e.stateNode},t.flushSync=function(e,t){if(0!==(48&Cl))throw Error(a(187));var n=Cl;Cl|=1;try{return Wo(99,e.bind(null,t))}finally{Cl=n,Ko()}},t.hydrate=function(e,t,n){if(!Hu(t))throw Error(a(200));return Bu(null,e,t,!0,n)},t.render=function(e,t,n){if(!Hu(t))throw Error(a(200));return Bu(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!Hu(e))throw Error(a(40));return!!e._reactRootContainer&&(tu((function(){Bu(null,null,e,!1,(function(){e._reactRootContainer=null,e[kn]=null}))})),!0)},t.unstable_batchedUpdates=eu,t.unstable_createPortal=function(e,t){return Uu(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Hu(n))throw Error(a(200));if(null==e||void 0===e._reactInternalFiber)throw Error(a(38));return Bu(e,t,n,!1,r)},t.version="16.13.1"},function(e,t,n){"use strict";e.exports=n(192)},function(e,t,n){"use strict";var r,o,i,a,l;if("undefined"===typeof window||"function"!==typeof MessageChannel){var u=null,c=null,s=function e(){if(null!==u)try{var n=t.unstable_now();u(!0,n),u=null}catch(r){throw setTimeout(e,0),r}},f=Date.now();t.unstable_now=function(){return Date.now()-f},r=function(e){null!==u?setTimeout(r,0,e):(u=e,setTimeout(s,0))},o=function(e,t){c=setTimeout(e,t)},i=function(){clearTimeout(c)},a=function(){return!1},l=t.unstable_forceFrameRate=function(){}}else{var d=window.performance,p=window.Date,h=window.setTimeout,v=window.clearTimeout;if("undefined"!==typeof console){var m=window.cancelAnimationFrame;"function"!==typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!==typeof m&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"===typeof d&&"function"===typeof d.now)t.unstable_now=function(){return d.now()};else{var g=p.now();t.unstable_now=function(){return p.now()-g}}var y=!1,b=null,S=-1,w=5,O=0;a=function(){return t.unstable_now()>=O},l=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):w=0<e?Math.floor(1e3/e):5};var C=new MessageChannel,x=C.port2;C.port1.onmessage=function(){if(null!==b){var e=t.unstable_now();O=e+w;try{b(!0,e)?x.postMessage(null):(y=!1,b=null)}catch(n){throw x.postMessage(null),n}}else y=!1},r=function(e){b=e,y||(y=!0,x.postMessage(null))},o=function(e,n){S=h((function(){e(t.unstable_now())}),n)},i=function(){v(S),S=-1}}function E(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,o=e[r];if(!(void 0!==o&&0<T(o,t)))break e;e[r]=t,e[n]=o,n=r}}function k(e){return void 0===(e=e[0])?null:e}function _(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length;r<o;){var i=2*(r+1)-1,a=e[i],l=i+1,u=e[l];if(void 0!==a&&0>T(a,n))void 0!==u&&0>T(u,a)?(e[r]=u,e[l]=n,r=l):(e[r]=a,e[i]=n,r=i);else{if(!(void 0!==u&&0>T(u,n)))break e;e[r]=u,e[l]=n,r=l}}}return t}return null}function T(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var j=[],P=[],A=1,I=null,M=3,D=!1,R=!1,N=!1;function F(e){for(var t=k(P);null!==t;){if(null===t.callback)_(P);else{if(!(t.startTime<=e))break;_(P),t.sortIndex=t.expirationTime,E(j,t)}t=k(P)}}function z(e){if(N=!1,F(e),!R)if(null!==k(j))R=!0,r(L);else{var t=k(P);null!==t&&o(z,t.startTime-e)}}function L(e,n){R=!1,N&&(N=!1,i()),D=!0;var r=M;try{for(F(n),I=k(j);null!==I&&(!(I.expirationTime>n)||e&&!a());){var l=I.callback;if(null!==l){I.callback=null,M=I.priorityLevel;var u=l(I.expirationTime<=n);n=t.unstable_now(),"function"===typeof u?I.callback=u:I===k(j)&&_(j),F(n)}else _(j);I=k(j)}if(null!==I)var c=!0;else{var s=k(P);null!==s&&o(z,s.startTime-n),c=!1}return c}finally{I=null,M=r,D=!1}}function V(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var H=l;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){R||D||(R=!0,r(L))},t.unstable_getCurrentPriorityLevel=function(){return M},t.unstable_getFirstCallbackNode=function(){return k(j)},t.unstable_next=function(e){switch(M){case 1:case 2:case 3:var t=3;break;default:t=M}var n=M;M=t;try{return e()}finally{M=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=H,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=M;M=e;try{return t()}finally{M=n}},t.unstable_scheduleCallback=function(e,n,a){var l=t.unstable_now();if("object"===typeof a&&null!==a){var u=a.delay;u="number"===typeof u&&0<u?l+u:l,a="number"===typeof a.timeout?a.timeout:V(e)}else a=V(e),u=l;return e={id:A++,callback:n,priorityLevel:e,startTime:u,expirationTime:a=u+a,sortIndex:-1},u>l?(e.sortIndex=u,E(P,e),null===k(j)&&e===k(P)&&(N?i():N=!0,o(z,u-l))):(e.sortIndex=a,E(j,e),R||D||(R=!0,r(L))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();F(e);var n=k(j);return n!==I&&null!==I&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime<I.expirationTime||a()},t.unstable_wrapCallback=function(e){var t=M;return function(){var n=M;M=t;try{return e.apply(this,arguments)}finally{M=n}}}},,function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,l=i.length;a<l;a++,o++)r[o]=i[a];return r},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FileBrowser=void 0;var a=i(n(0)),l=n(9),u=n(34),c=n(99),s=n(220),f=n(382);t.FileBrowser=a.default.forwardRef((function(e,t){var n=e.files,i=e.children,d=e.folderChain?e.folderChain:null,p=e.fileActions?e.fileActions:[],h=!!e.disableDefaultFileActions,v=c.useFileArrayValidation(n,d),m=v.cleanFiles,g=v.cleanFolderChain,y=v.errorMessages,b=c.useFileActionsValidation(p,u.DefaultFileActions,!h),S=b.cleanFileActions,w=b.errorMessages,O=o(y,w),C=r(r({},e),{files:m,folderChain:g,fileActions:S});return a.default.createElement(l.RecoilRoot,null,a.default.createElement(s.ChonkyBusinessLogic,r({ref:t},C)),a.default.createElement(f.ChonkyPresentationLayer,{validationErrors:O},i))}))},function(e,t,n){"use strict";var r=n(123),o=n(196),i=n(124),a=n(198),l=n(200),u=n(125),c=n(201),s=n(205),f=n(206),d=n(207),p=n(211),h=n(214),v=n(215),m=n(129);function g(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(t,"__esModule",{value:!0});var y=g(n(0)),b=g(n(10));function S(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var w=function e(t){m(this,e),S(this,"key",void 0),this.key=t},O=function(e){h(n,e);var t=v(n);function n(){return m(this,n),t.apply(this,arguments)}return n}(w),C=function(e){h(n,e);var t=v(n);function n(){return m(this,n),t.apply(this,arguments)}return n}(w),x={AbstractRecoilValue:w,RecoilState:O,RecoilValueReadOnly:C,isRecoilValue:function(e){return e instanceof O||e instanceof C}},E=x.AbstractRecoilValue,k=x.RecoilState,_=x.RecoilValueReadOnly,T=x.isRecoilValue;function j(e){return e&&e.default||e}var P=j(Object.freeze({__proto__:null,AbstractRecoilValue:E,RecoilState:k,RecoilValueReadOnly:_,isRecoilValue:T})),A=function e(){m(this,e)},I=new A,M=function(e){h(n,e);var t=v(n);function n(e){return m(this,n),t.call(this,"Tried to set the value of Recoil selector ".concat(e," using an updater function, but it is an async selector in a pending or error state; this is not supported."))}return n}(p(Error)),D=new Map,R=function(e){h(n,e);var t=v(n);function n(){return m(this,n),t.apply(this,arguments)}return n}(p(Error)),N={nodes:D,registerNode:function(e){return D.has(e.key)&&e.key,D.set(e.key,e),null==e.set?new P.RecoilValueReadOnly(e.key):new P.RecoilState(e.key)},getNode:function(e){var t=D.get(e);if(null==t)throw new R('Missing definition for RecoilValue: "'.concat(e,'""'));return t},NodeMissingError:R,DefaultValue:A,DEFAULT_VALUE:I,RecoilValueNotReady:M},F=function(e,t){t()},z=function(e,t){var n=new Set(e);return n.add(t),n},L=function(e,t){var n=new Set(e);return n.delete(t),n},V=function(e,t,n){var r=new Map(e);return r.set(t,n),r},H=function(e,t,n){var r=new Map(e);return r.set(t,n(r.get(t))),r},B=function(e,t){var n=new Map(e);return n.delete(t),n},W=function(e,t,n){return n()},U=function(e){return e},$=B,K=V,q=H,G=z,Y=N.getNode,X=Object.freeze(new Map),Q=Object.freeze(new Set),Z=function(e){h(n,e);var t=v(n);function n(){return m(this,n),t.apply(this,arguments)}return n}(p(Error));function J(e,t,n){return Y(n).get(e,t)}var ee=0,te=J,ne=function(e,t,n){return J(e,t,n)[1]},re=function(e,t,n,r){var o=Y(n);if(null==o.set)throw new Z("Attempt to set read-only RecoilValue: "+n);var i=o.set(e,t,r),a=d(i,2);return[a[0],a[1]]},oe=function(e,t,n){return f(f({},e),{},{atomValues:$(e.atomValues,t),nonvalidatedAtoms:K(e.nonvalidatedAtoms,t,n),dirtyAtoms:G(e.dirtyAtoms,t)})},ie=function(e,t,n){var r,o,i="enqueue"===n&&null!==(r=e.getState().nextTree)&&void 0!==r?r:e.getState().currentTree,a=function(e,t){for(var n=new Set,r=new Set,o=Array.from(t),i=o.pop();i;i=o.pop()){var a;n.add(i),r.add(i);var l,u=null!==(a=e.nodeToNodeSubscriptions.get(i))&&void 0!==a?a:Q,c=s(u);try{for(c.s();!(l=c.n()).done;){var f=l.value;r.has(f)||o.push(f)}}catch(d){c.e(d)}finally{c.f()}}return n}(i,t),l=s(a);try{for(l.s();!(o=l.n()).done;){var u,c=o.value;(null!==(u=i.nodeToComponentSubscriptions.get(c))&&void 0!==u?u:[]).forEach((function(t){var r=d(t,2),o=(r[0],r[1]);"enqueue"===n?e.getState().queuedComponentCallbacks.push(o):o(i)}))}}catch(f){l.e(f)}finally{l.f()}W("value became available, waking components",Array.from(t).join(", "),(function(){var t=e.getState().suspendedComponentResolvers;t.forEach((function(e){return e()})),t.clear()}))},ae=function(e,t){var n=new Map;return e.forEach((function(e,r){n.set(r,t(e,r))})),n},le=te,ue=ne,ce=re,se=oe,fe=function(e,t,n){var r=ee++;return[f(f({},e),{},{nodeToComponentSubscriptions:q(e.nodeToComponentSubscriptions,t,(function(e){return K(null!=e?e:X,r,["TODO debug name",n])}))}),function(e){return f(f({},e),{},{nodeToComponentSubscriptions:q(e.nodeToComponentSubscriptions,t,(function(e){return $(null!=e?e:X,r)}))})}]},de=N.RecoilValueNotReady,pe=P.AbstractRecoilValue,he=P.RecoilState,ve={RecoilValueReadOnly:P.RecoilValueReadOnly,AbstractRecoilValue:pe,RecoilState:he,valueFromValueOrUpdater:function(e,t,n){var r=t.key;if("function"==typeof n){var o,i=e.getState(),a=null!==(o=i.nextTree)&&void 0!==o?o:i.currentTree,l=ue(e,a,r);if("loading"===l.state)throw new de(r);if("hasError"===l.state)throw l.contents;return n(l.contents)}return n},getRecoilValueAsLoadable:function(e,t){var n,r=t.key;return W("get RecoilValue",r,(function(){return e.replaceState(U((function(t){var o=le(e,t,r),i=d(o,2),a=i[0],l=i[1];return n=l,a})))})),n},setRecoilValue:function(e,t,n){var r=t.key;W("set RecoilValue",r,(function(){return e.replaceState(U((function(t){var o=ce(e,t,r,n),i=d(o,2),a=i[0],l=i[1];return e.fireNodeSubscriptions(l,"enqueue"),a})))}))},setUnvalidatedRecoilValue:function(e,t,n){var r=t.key;W("set unvalidated persisted atom",r,(function(){return e.replaceState(U((function(t){var o=se(t,r,n);return e.fireNodeSubscriptions(new Set([r]),"enqueue"),o})))}))},subscribeToRecoilValue:function(e,t,n){var r,o,i=t.key;return W("subscribe component to RecoilValue",i,(function(){return e.replaceState(U((function(e){var t,a;return t=fe(e,i,n),a=d(t,2),r=a[0],o=a[1],r})))})),{release:function(e){return e.replaceState(o)}}}};function me(){return{transactionMetadata:{},atomValues:new Map,nonvalidatedAtoms:new Map,dirtyAtoms:new Set,nodeDeps:new Map,nodeToNodeSubscriptions:new Map,nodeToComponentSubscriptions:new Map}}function ge(e){return{currentTree:e,nextTree:null,transactionSubscriptions:new Map,queuedComponentCallbacks:[],suspendedComponentResolvers:new Set}}var ye=function(){return ge(me())},be=ge,Se=N.DEFAULT_VALUE,we=ve.getRecoilValueAsLoadable,Oe=ve.setRecoilValue,Ce=ve.valueFromValueOrUpdater,xe=me,Ee=be,ke=function(){function e(t){var n=this;m(this,e),S(this,"_store",void 0),S(this,"getLoadable",(function(e){return we(n._store,e)})),S(this,"getPromise",(function(e){return n.getLoadable(e).toPromise()})),S(this,"map",(function(e){var t=new je(n._store.getState().currentTree);return e(t),Te(t.getStore_INTERNAL().getState().currentTree)})),S(this,"asyncMap",function(){var e=l(a.mark((function e(t){var r;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new je(n._store.getState().currentTree),e.next=3,t(r);case 3:return e.abrupt("return",Te(r.getStore_INTERNAL().getState().currentTree));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),this._store=function(e){var t=Ee(e);return{getState:function(){return t},replaceState:function(e){t.currentTree=e(t.currentTree)},subscribeToTransactions:function(){throw new Error("Cannot subscribe to Snapshots")},addTransactionMetadata:function(){throw new Error("Cannot subscribe to Snapshots")},fireNodeSubscriptions:function(){}}}(t)}return u(e,[{key:"getStore_INTERNAL",value:function(){return this._store}}]),e}();function _e(e){return{transactionMetadata:f({},e.transactionMetadata),atomValues:new Map(e.atomValues),nonvalidatedAtoms:new Map(e.nonvalidatedAtoms),dirtyAtoms:new Set(e.dirtyAtoms),nodeDeps:new Map(e.nodeDeps),nodeToNodeSubscriptions:ae(e.nodeToNodeSubscriptions,(function(e){return new Set(e)})),nodeToComponentSubscriptions:new Map}}function Te(e){return new ke(_e(e))}var je=function(e){h(n,e);var t=v(n);function n(e){var r;return m(this,n),r=t.call(this,_e(e)),S(i(r),"set",(function(e,t){var n=r.getStore_INTERNAL(),o=Ce(n,e,t);Oe(n,e,o)})),S(i(r),"reset",(function(e){return Oe(r.getStore_INTERNAL(),e,Se)})),r}return n}(ke),Pe={Snapshot:ke,MutableSnapshot:je,freshSnapshot:function(){return new ke(xe())},cloneSnapshot:Te},Ae=Pe.Snapshot,Ie=Pe.MutableSnapshot,Me=Pe.freshSnapshot,De=Pe.cloneSnapshot,Re=function(e,t){if(null!=e)return e;throw new Error(null!=t?t:"Got unexpected null or undefined")},Ne=j(Object.freeze({__proto__:null,Snapshot:Ae,MutableSnapshot:Ie,freshSnapshot:Me,cloneSnapshot:De})),Fe=y.useContext,ze=y.useEffect,Le=y.useRef,Ve=y.useState,He=ie,Be=re,We=oe,Ue=Ne.freshSnapshot,$e=ye,Ke=be;function qe(){throw new Error("This component must be used inside a <RecoilRoot> component.")}var Ge=Object.freeze({getState:qe,replaceState:qe,subscribeToTransactions:qe,addTransactionMetadata:qe,fireNodeSubscriptions:qe});function Ye(e){null===e.nextTree&&(e.nextTree=f(f({},e.currentTree),{},{dirtyAtoms:new Set,transactionMetadata:{}}))}var Xe=y.createContext({current:Ge}),Qe=function(){return Fe(Xe)};function Ze(e){var t=Qe(),n=Ve([]),r=d(n,2),o=(r[0],r[1]);return e.setNotifyBatcherOfChange((function(){return o({})})),ze((function(){F("Batcher",(function(){var e=t.current.getState(),n=e.nextTree;null!==n&&(n.dirtyAtoms.size&&e.transactionSubscriptions.forEach((function(e){return e(t.current)})),e.queuedComponentCallbacks.forEach((function(e){return e(n)})),e.queuedComponentCallbacks.splice(0,e.queuedComponentCallbacks.length),e.currentTree=n,e.nextTree=null)}))})),null}var Je=0,et=Qe,tt=function(e){var t,n=e.initializeState_DEPRECATED,r=e.initializeState,o=e.children,i=Le(null),a={getState:function(){return t.current},replaceState:function(e){var t=l.current.getState();Ye(t);var n=Re(t.nextTree),r=e(n);r!==n&&(t.nextTree=r,Re(i.current)())},subscribeToTransactions:function(e){var t=Je++;return l.current.getState().transactionSubscriptions.set(t,e),{release:function(){l.current.getState().transactionSubscriptions.delete(t)}}},addTransactionMetadata:function(e){Ye(l.current.getState());for(var t=0,n=Object.keys(e);t<n.length;t++){var r=n[t];Re(l.current.getState().nextTree).transactionMetadata[r]=e[r]}},fireNodeSubscriptions:function(e,t){He(l.current,e,t)}},l=Le(a);return t=Le(null!=n?function(e,t){var n=$e();return t({set:function(t,r){n.currentTree=Be(e,n.currentTree,t.key,r)[0]},setUnvalidatedAtomValues:function(e){e.forEach((function(e,t){n.currentTree=We(n.currentTree,t,e)}))}}),n}(a,n):null!=r?function(e){var t=Ue().map(e);return Ke(t.getStore_INTERNAL().getState().currentTree)}(r):$e()),y.createElement(Xe.Provider,{value:l},y.createElement(Ze,{setNotifyBatcherOfChange:function(e){i.current=e}}),o)},nt=function(e){for(var t=new Set,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var i,a=s(e);try{e:for(a.s();!(i=a.n()).done;){var l,u=i.value,c=s(r);try{for(c.s();!(l=c.n()).done;){var f=l.value;if(f.has(u))continue e}}catch(d){c.e(d)}finally{c.f()}t.add(u)}}catch(d){a.e(d)}finally{a.f()}return t},rt=function(e,t){if(!e)throw new Error(t)},ot=y.useCallback,it=y.useEffect,at=y.useMemo,lt=y.useRef,ut=y.useState,ct=N.DEFAULT_VALUE,st=N.getNode,ft=N.nodes,dt=et,pt=ve.AbstractRecoilValue,ht=ve.getRecoilValueAsLoadable,vt=ve.setRecoilValue,mt=ve.setUnvalidatedRecoilValue,gt=ve.subscribeToRecoilValue,yt=ve.valueFromValueOrUpdater,bt=(Ne.Snapshot,Ne.cloneSnapshot),St=z;function wt(){var e=dt(),t=ut([]),n=d(t,2),r=(n[0],n[1]),o=lt(new Set);o.current=new Set;var i=lt(new Set),a=lt(new Map),l=ot((function(t){var n=a.current.get(t);n&&(n.release(e.current),a.current.delete(t))}),[e,a]);return it((function(){var t=e.current;function n(e,t){a.current.has(t)&&r([])}nt(o.current,i.current).forEach((function(e){if(!a.current.has(e)){var r=gt(t,new pt(e),(function(t){W("RecoilValue subscription fired",e,(function(){n(0,e)}))}));a.current.set(e,r),W("initial update on subscribing",e,(function(){n(t.getState(),e)}))}})),nt(i.current,o.current).forEach((function(e){l(e)})),i.current=o.current})),it((function(){var e=a.current;return function(){return e.forEach((function(e,t){return l(t)}))}}),[l]),at((function(){function t(t){return function(n){var r=yt(e.current,t,n);vt(e.current,t,r)}}function n(t){return o.current.has(t.key)||(o.current=St(o.current,t.key)),ht(e.current,t)}function r(t){return function(e,t,n){if("hasValue"===e.state)return e.contents;if("loading"===e.state)throw new Promise((function(e){n.current.getState().suspendedComponentResolvers.add(e)}));throw"hasError"===e.state?e.contents:new Error('Invalid value of loadable atom "'.concat(t.key,'"'))}(n(t),t,e)}return{getRecoilValue:r,getRecoilValueLoadable:n,getRecoilState:function(e){return[r(e),t(e)]},getRecoilStateLoadable:function(e){return[n(e),t(e)]},getSetRecoilState:t,getResetRecoilState:function(t){return function(){return vt(e.current,t,ct)}}}}),[o,e])}function Ot(e){var t=dt();it((function(){return t.current.subscribeToTransactions(e).release}),[e,t])}function Ct(e){var t=e.atomValues,n=ae(function(e,t){var n,r=new Map,o=s(e);try{for(o.s();!(n=o.n()).done;){var i=d(n.value,2),a=i[0],l=i[1];t(l,a)&&r.set(a,l)}}catch(u){o.e(u)}finally{o.f()}return r}(t,(function(e,t){var n,r=null===(n=st(t).options)||void 0===n?void 0:n.persistence_UNSTABLE;return null!=r&&"none"!==r.type&&"hasValue"===e.state})),(function(e){return e.contents}));return function(){for(var e=new Map,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(var o=0;o<n.length;o++)for(var i=n[o].keys(),a=void 0;!(a=i.next()).done;)e.set(a.value,n[o].get(a.value));return e}(e.nonvalidatedAtoms,n)}function xt(){var e=dt();return ot((function(t){b.unstable_batchedUpdates((function(){e.current.replaceState((function(n){for(var r=t.getStore_INTERNAL().getState().currentTree,o=new Set,i=0,a=[n.atomValues.keys(),r.atomValues.keys()];i<a.length;i++){var l,u=s(a[i]);try{for(u.s();!(l=u.n()).done;){var c,d,p=l.value;(null===(c=n.atomValues.get(p))||void 0===c?void 0:c.contents)!==(null===(d=r.atomValues.get(p))||void 0===d?void 0:d.contents)&&o.add(p)}}catch(h){u.e(h)}finally{u.f()}}return e.current.fireNodeSubscriptions(o,"enqueue"),f(f({},r),{},{nodeToComponentSubscriptions:n.nodeToComponentSubscriptions})}))}))}),[e])}var Et=function e(){m(this,e)},kt=new Et,_t=function(e,t){var n=dt(),r=xt();return ot((function(){for(var t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];var a=bt(n.current.getState().currentTree);function l(e,t){var r=yt(n.current,e,t);vt(n.current,e,r)}function u(e){vt(n.current,e,ct)}var c=kt;return b.unstable_batchedUpdates((function(){c=e({set:l,reset:u,snapshot:a,gotoSnapshot:r}).apply(void 0,o)})),c instanceof Et&&rt(!1),c}),null!=t?[].concat(c(t),[n]):void 0)},Tt=function(e){return wt().getRecoilValue(e)},jt=function(e){return wt().getRecoilValueLoadable(e)},Pt=function(e){var t=wt(),n=t.getRecoilState(e);return[d(n,1)[0],ot(t.getSetRecoilState(e),[e])]},At=function(e){var t=wt(),n=t.getRecoilStateLoadable(e);return[d(n,1)[0],ot(t.getSetRecoilState(e),[e])]},It=function(e){return ot(wt().getSetRecoilState(e),[e])},Mt=function(e){return ot(wt().getResetRecoilState(e),[e])},Dt=function(e){Ot(ot((function(t){var n=t.getState().currentTree,r=t.getState().nextTree;r||(r=t.getState().currentTree);var o=Ct(r),i=Ct(n),a=ae(ft,(function(e){var t,n,r,o,i,a;return{persistence_UNSTABLE:{type:null!==(t=null===(n=e.options)||void 0===n||null===(r=n.persistence_UNSTABLE)||void 0===r?void 0:r.type)&&void 0!==t?t:"none",backButton:null!==(o=null===(i=e.options)||void 0===i||null===(a=i.persistence_UNSTABLE)||void 0===a?void 0:a.backButton)&&void 0!==o&&o}}})),l=new Set(r.dirtyAtoms);e({atomValues:o,previousAtomValues:i,atomInfo:a,modifiedAtoms:l,transactionMetadata:f({},r.transactionMetadata)})}),[e]))},Rt=function(e){Ot(ot((function(t){var n=t.getState().currentTree,r=t.getState().nextTree;r||(r=n),e({snapshot:bt(r),previousSnapshot:bt(n)})}),[e]))},Nt=function(){var e=dt(),t=ut((function(){return bt(e.current.getState().currentTree)})),n=d(t,2),r=n[0],o=n[1];return Ot(ot((function(e){var t;return o(bt(null!==(t=e.getState().nextTree)&&void 0!==t?t:e.getState().currentTree))}),[])),r},Ft=xt,zt=function(){var e=dt();return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};b.unstable_batchedUpdates((function(){e.current.addTransactionMetadata(n),t.forEach((function(t,n){return mt(e.current,new pt(n),t)}))}))}},Lt=function(e){return!!e&&"function"==typeof e.then},Vt={getValue:function(){if("hasValue"!==this.state)throw this.contents;return this.contents},toPromise:function(){return"hasValue"===this.state?Promise.resolve(this.contents):"hasError"===this.state?Promise.reject(this.contents):this.contents},valueMaybe:function(){return"hasValue"===this.state?this.contents:void 0},valueOrThrow:function(){if("hasValue"!==this.state)throw new Error('Loadable expected value, but in "'.concat(this.state,'" state'));return this.contents},errorMaybe:function(){return"hasError"===this.state?this.contents:void 0},errorOrThrow:function(){if("hasError"!==this.state)throw new Error('Loadable expected error, but in "'.concat(this.state,'" state'));return this.contents},promiseMaybe:function(){return"loading"===this.state?this.contents:void 0},promiseOrThrow:function(){if("loading"!==this.state)throw new Error('Loadable expected promise, but in "'.concat(this.state,'" state'));return this.contents},map:function(e){var t=this;if("hasError"===this.state)return this;if("hasValue"===this.state)try{var n=e(this.contents);return Lt(n)?Wt(n):Ht(n)}catch(r){return Lt(r)?Wt(r.next((function(){return e(t.contents)}))):Bt(r)}if("loading"===this.state)return Wt(this.contents.then(e).catch((function(n){if(Lt(n))return n.then((function(){return e(t.contents)}));throw n})));throw new Error("Invalid Loadable state")}};function Ht(e){return Object.freeze(f({state:"hasValue",contents:e},Vt))}function Bt(e){return Object.freeze(f({state:"hasError",contents:e},Vt))}function Wt(e){return Object.freeze(f({state:"loading",contents:e},Vt))}var Ut=Ht,$t=Bt,Kt=Wt,qt=function e(t){if("object"==typeof t&&!function(e){if(null===e||"object"!=typeof e)return!0;switch(typeof e.$$typeof){case"symbol":case"number":return!0}return null!=e["@@__IMMUTABLE_ITERABLE__@@"]||null!=e["@@__IMMUTABLE_KEYED__@@"]||null!=e["@@__IMMUTABLE_INDEXED__@@"]||null!=e["@@__IMMUTABLE_ORDERED__@@"]||null!=e["@@__IMMUTABLE_RECORD__@@"]||!!function(e){var t,n;if("undefined"==typeof window)return!1;var r=null!==(n=(null!=e?null!==(t=e.ownerDocument)&&void 0!==t?t:e:document).defaultView)&&void 0!==n?n:window;return!(null==e||!("function"==typeof r.Node?e instanceof r.Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}(e)||!!Lt(e)}(t)){for(var n in Object.freeze(t),t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=t[n];"object"!=typeof r||null==r||Object.isFrozen(r)||e(r)}Object.seal(t)}},Gt=Symbol("ArrayKeyedMap"),Yt=new Map,Xt=function(){function e(t){if(m(this,e),this._base=new Map,t instanceof e){var n,r=s(t.entries());try{for(r.s();!(n=r.n()).done;){var o=d(n.value,2),i=o[0],a=o[1];this.set(i,a)}}catch(h){r.e(h)}finally{r.f()}}else if(t){var l,u=s(t);try{for(u.s();!(l=u.n()).done;){var c=d(l.value,2),f=c[0],p=c[1];this.set(f,p)}}catch(h){u.e(h)}finally{u.f()}}return this}return u(e,[{key:"get",value:function(e){var t=Array.isArray(e)?e:[e],n=this._base;return t.forEach((function(e){var t;n=null!==(t=n.get(e))&&void 0!==t?t:Yt})),void 0===n?void 0:n.get(Gt)}},{key:"set",value:function(e,t){var n=Array.isArray(e)?e:[e],r=this._base,o=r;return n.forEach((function(e){(o=r.get(e))||(o=new Map,r.set(e,o)),r=o})),o.set(Gt,t),this}},{key:"delete",value:function(e){var t=Array.isArray(e)?e:[e],n=this._base,r=n;return t.forEach((function(e){(r=n.get(e))||(r=new Map,n.set(e,r)),n=r})),r.delete(Gt),this}},{key:"entries",value:function(){var e=[];return function t(n,r){n.forEach((function(n,o){o===Gt?e.push([r,n]):t(n,r.concat(o))}))}(this._base,[]),e.values()}},{key:"toBuiltInMap",value:function(){return new Map(this.entries())}}]),e}(),Qt=function(){return new Xt},Zt=function(e,t,n){for(var r=e.entries(),o=r.next();!o.done;){var i=o.value;if(!t.call(n,i[1],i[0],e))return!1;o=r.next()}return!0};Object.freeze(new Set);var Jt=V,en=H,tn=z,nn=L,rn=te,on=re,an=$t,ln=Kt,un=Ut,cn=N.DEFAULT_VALUE,sn=N.RecoilValueNotReady,fn=N.registerNode,dn=function(e){return function(){return null}},pn=P.isRecoilValue,hn=Object.freeze(new Set);function vn(e){var t,n=[],r=s(Array.from(e.keys()).sort());try{for(r.s();!(t=r.n()).done;){var o=t.value,i=Re(e.get(o));n.push(o),n.push(i.contents)}}catch(a){r.e(a)}finally{r.f()}return n}var mn=function(e){var t=e.key,n=e.get,r=e.cacheImplementation_UNSTABLE,o=null!=e.set?e.set:void 0,i=null!=r?r:Qt();function a(r,o){var l,u=o,c=null!==(l=o.nodeDeps.get(t))&&void 0!==l?l:hn,p=vn(new Map(Array.from(c).sort().map((function(e){var t=rn(r,u,e),n=d(t,2),o=n[0],i=n[1];return u=o,[e,i]})))),h=i.get(p);if(null!=h)return[u,h];var v=function(e,r){var o,i,l,u=function(e,r){var o=dn(t),i=r,l=new Map;function u(t){var n,r,o,a=t.key;if(n=rn(e,i,a),r=d(n,2),i=r[0],o=r[1],l.set(a,o),"hasValue"===o.state)return o.contents;throw o.contents}try{var c=n({get:u}),s=pn(c)?u(c):c,f=Lt(s)?ln(s.finally(o)):(o(),un(s));return[i,f,l]}catch(h){var p=Lt(h)?ln(h.then((function(){var t=an(new Error("Internal Recoil Selector Error"));if(e.replaceState((function(n){var r,o,i;return r=a(e,n),i=(o=d(r,2))[0],t=o[1],i})),"hasError"===t.state)throw t.contents;return t.contents})).finally(o)):(o(),an(h));return[i,p,l]}}(e,r),c=d(u,3),p=c[0],h=c[1],v=c[2],m=p,g=null!==(o=r.nodeDeps.get(t))&&void 0!==o?o:hn,y=new Set(v.keys());l=y,m=(i=g).size===l.size&&Zt(i,(function(e){return l.has(e)}))?m:f(f({},m),{},{nodeDeps:Jt(m.nodeDeps,t,y)});var b,S=nt(y,g),w=nt(g,y),O=s(S);try{for(O.s();!(b=O.n()).done;){var C=b.value;m=f(f({},m),{},{nodeToNodeSubscriptions:en(m.nodeToNodeSubscriptions,C,(function(e){return tn(null!=e?e:hn,t)}))})}}catch(_){O.e(_)}finally{O.f()}var x,E=s(w);try{for(E.s();!(x=E.n()).done;){var k=x.value;m=f(f({},m),{},{nodeToNodeSubscriptions:en(m.nodeToNodeSubscriptions,k,(function(e){return nn(null!=e?e:hn,t)}))})}}catch(_){E.e(_)}finally{E.f()}return[m,h,v]}(r,u),m=d(v,3),g=m[0],y=m[1],b=m[2];u=g;var S=vn(b);return function(n,r,o){"loading"!==o.state?1==!e.dangerouslyAllowMutability&&qt(o.contents):o.contents.then((function(o){return 1==!e.dangerouslyAllowMutability&&qt(o),i=i.set(r,un(o)),n.fireNodeSubscriptions(new Set([t]),"now"),o})).catch((function(o){return Lt(o)||(1==!e.dangerouslyAllowMutability&&qt(o),i=i.set(r,an(o)),n.fireNodeSubscriptions(new Set([t]),"now")),o})),i=i.set(r,o)}(r,S,y),[u,y]}function l(e,t){return a(e,t)}return fn(null!=o?{key:t,options:e,get:l,set:function(e,t,n){var r=t,i=new Set;function a(t){var n=t.key,o=rn(e,r,n),i=d(o,2),a=i[0],l=i[1];if(r=a,"hasValue"===l.state)return l.contents;throw"loading"===l.state?new sn(n):l.contents}function l(t,n){var o,l,u="function"==typeof n?n(a(t)):n;o=on(e,r,t.key,u),l=d(o,2),r=l[0],l[1].forEach((function(e){return i.add(e)}))}return o({set:l,get:a,reset:function(e){l(e,cn)}},n),[r,i]}}:{key:t,options:e,get:l})},gn=Ut,yn=N.DEFAULT_VALUE,bn=N.DefaultValue,Sn=N.registerNode,wn=P.isRecoilValue,On=B,Cn=V,xn=z;var En=function e(t){var n=t.default,r=o(t,["default"]);return wn(n)||Lt(n)?function(t){var n=e(f(f({},t),{},{default:yn,persistence_UNSTABLE:void 0===t.persistence_UNSTABLE?void 0:f(f({},t.persistence_UNSTABLE),{},{validator:function(e){return e instanceof bn?e:Re(t.persistence_UNSTABLE).validator(e,yn)}})}));return mn({key:t.key+"__withFallback",get:function(e){var r=(0,e.get)(n);return r instanceof bn?t.default:r},set:function(e,t){return(0,e.set)(n,t)},dangerouslyAllowMutability:t.dangerouslyAllowMutability})}(f(f({},r),{},{default:n})):function(e){var t=e.key,n=e.persistence_UNSTABLE;return Sn({key:t,options:e,get:function(r,o){if(o.atomValues.has(t))return[o,Re(o.atomValues.get(t))];if(o.nonvalidatedAtoms.has(t)){if(null==n)return[o,gn(e.default)];var i=o.nonvalidatedAtoms.get(t),a=n.validator(i,yn);return a instanceof bn?[f(f({},o),{},{nonvalidatedAtoms:On(o.nonvalidatedAtoms,t)}),gn(e.default)]:[f(f({},o),{},{atomValues:Cn(o.atomValues,t,gn(a)),nonvalidatedAtoms:On(o.nonvalidatedAtoms,t)}),gn(a)]}return[o,gn(e.default)]},set:function(n,r,o){return!0!==e.dangerouslyAllowMutability&&qt(o),[f(f({},r),{},{dirtyAtoms:xn(r.dirtyAtoms,t),atomValues:o instanceof bn?On(r.atomValues,t):Cn(r.atomValues,t,gn(o)),nonvalidatedAtoms:On(r.nonvalidatedAtoms,t)}),new Set([t])]}})}(f(f({},r),{},{default:n}))},kn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{allowFunctions:!1};return function e(t,n,o){if("string"==typeof t&&!t.includes('"')&&!t.includes("\\"))return'"'.concat(t,'"');switch(typeof t){case"undefined":return"";case"boolean":return t?"true":"false";case"number":case"symbol":return String(t);case"string":return JSON.stringify(t);case"function":if(!0!==(null==n?void 0:n.allowFunctions))throw new Error("Attempt to serialize function in a Recoil cache key");return"__FUNCTION(".concat(t.name,")__")}return null===t?"null":"object"!=typeof t?null!==(i=JSON.stringify(t))&&void 0!==i?i:"":Lt(t)?"__PROMISE__":Array.isArray(t)?"[".concat(t.map((function(t,r){return e(t,n,r.toString())})),"]"):"function"==typeof t.toJSON?e(t.toJSON(o),n,o):t instanceof Map?e(Array.from(t).reduce((function(t,o){var i=d(o,2),a=i[0],l=i[1];return f(f({},t),{},r({},"string"==typeof a?a:e(a,n),l))}),{}),n,o):t instanceof Set?e(Array.from(t).sort((function(t,r){return e(t,n).localeCompare(e(r,n))})),n,o):null!=t[Symbol.iterator]&&"function"==typeof t[Symbol.iterator]?e(Array.from(t),n,o):"{".concat(Object.keys(t).filter((function(e){return void 0!==t[e]})).sort().map((function(r){return"".concat(e(r,n),":").concat(e(t[r],n,r))})).join(","),"}");var i}(e,t)},_n=function(){var e=new Map,t={get:function(t){return e.get(kn(t))},set:function(n,r){return e.set(kn(n),r),t},map:e};return t},Tn=0,jn=function(e){var t,n,r=null!==(t=null===(n=e.cacheImplementationForParams_UNSTABLE)||void 0===n?void 0:n.call(e))&&void 0!==t?t:_n();return function(t){var n,o,i=r.get(t);if(null!=i)return i;var a,l="".concat(e.key,"__selectorFamily/").concat(null!==(n=kn(t,{allowFunctions:!0}))&&void 0!==n?n:"void","/").concat(Tn++),u=function(n){return e.get(t)(n)},c=null===(o=e.cacheImplementation_UNSTABLE)||void 0===o?void 0:o.call(e);if(null!=e.set){var s=e.set;a=mn({key:l,get:u,set:function(e,n){return s(t)(e,n)},cacheImplementation_UNSTABLE:c,dangerouslyAllowMutability:e.dangerouslyAllowMutability})}else a=mn({key:l,get:u,cacheImplementation_UNSTABLE:c,dangerouslyAllowMutability:e.dangerouslyAllowMutability});return r=r.set(t,a),a}},Pn=j(Object.freeze({__proto__:null})),An=N.DEFAULT_VALUE,In=N.DefaultValue;function Mn(e,t){return Zt(t,(function(t){return e.has(t)}))}var Dn=function(e,t){return Array.from(t).reduce((function(t,n){return f(f({},t),{},r({},n,e[n]))}),{})};function Rn(e){if(null!=e){var t=Object.assign({},e);return f(f({},t),{},{validator:function(e){return e instanceof Pn?new Pn(e.value.filter((function(e){var t=d(e,2),n=t[0],r=t[1];return n instanceof Set&&r instanceof Map})).map((function(e){var n=d(e,2),r=n[0],o=n[1];return[r,Array.from(o.entries()).reduce((function(e,n){var r=d(n,2),o=r[0],i=r[1],a=t.validator(i,An);return a instanceof In||e.set(o,a),e}),new Map)]}))):t.validator(e,An)}})}}var Nn=jn({key:"__constant",get:function(e){return function(){return e}},cacheImplementationForParams_UNSTABLE:Qt}),Fn=jn({key:"__error",get:function(e){return function(){throw new Error(e)}},cacheImplementationForParams_UNSTABLE:Qt}),zn=$t,Ln=Kt,Vn=Ut;function Hn(e,t){var n,r=Array(t.length).fill(void 0),o=Array(t.length).fill(void 0),i=s(t.entries());try{for(i.s();!(n=i.n()).done;){var a=d(n.value,2),l=a[0],u=a[1];try{r[l]=e(u)}catch(c){o[l]=c}}}catch(f){i.e(f)}finally{i.f()}return[r,o]}function Bn(e){return null!=e&&!Lt(e)}function Wn(e){return Array.isArray(e)?e:Object.getOwnPropertyNames(e).map((function(t){return e[t]}))}function Un(e,t){return Array.isArray(e)?t:Object.getOwnPropertyNames(e).reduce((function(e,n,o){return f(f({},e),{},r({},n,t[o]))}),{})}function $n(e,t,n){return Un(e,n.map((function(e,n){return null==e?Vn(t[n]):Lt(e)?Ln(e):zn(e)})))}var Kn={waitForNone:jn({key:"__waitForNone",get:function(e){return function(t){var n=Hn(t.get,Wn(e)),r=d(n,2),o=r[0],i=r[1];return $n(e,o,i)}}}),waitForAny:jn({key:"__waitForAny",get:function(e){return function(t){var n=Hn(t.get,Wn(e)),r=d(n,2),o=r[0],i=r[1];if(i.some((function(e){return null==e})))return $n(e,o,i);if(i.every(Bn))throw i.find(Bn);throw new Promise((function(t,n){var r,a=s(i.entries());try{var l=function(){var a=d(r.value,2),l=a[0],u=a[1];Lt(u)&&u.then((function(n){o[l]=n,i[l]=null,t($n(e,o,i))})).catch((function(e){i[l]=e,i.every(Bn)&&n(i[0])}))};for(a.s();!(r=a.n()).done;)l()}catch(u){a.e(u)}finally{a.f()}}))}}}),waitForAll:jn({key:"__waitForAll",get:function(e){return function(t){var n=Hn(t.get,Wn(e)),r=d(n,2),o=r[0],i=r[1];if(i.every((function(e){return null==e})))return Un(e,o);var a=i.find(Bn);if(null!=a)throw a;throw Promise.all(i).then((function(t){return Un(e,t)}))}}}),noWait:jn({key:"__noWait",get:function(e){return function(t){var n=t.get;try{return Vn(n(e))}catch(r){return Lt(r)?Ln(r):zn(r)}}}})},qn=N.DefaultValue,Gn=tt,Yn=P.isRecoilValue,Xn={DefaultValue:qn,RecoilRoot:Gn,atom:En,selector:mn,atomFamily:function(e){var t,n=_n(),r={key:e.key,default:An,persistence_UNSTABLE:Rn(e.persistence_UNSTABLE)};t=En(r);var o=jn({key:e.key+"__atomFamily/Default",get:function(n){return function(r){var o=(0,r.get)("function"==typeof t?t(n):t);if(!(o instanceof In)){var i=function(e,t){if(!(e instanceof Pn))return e;if("object"!=typeof t||null==t||Array.isArray(t))return An;var n,r=e.value,o=new Set(Object.keys(t)),i=s(r);try{for(i.s();!(n=i.n()).done;){var a=d(n.value,2),l=a[0],u=a[1];if(Mn(o,l)){var c=o.size===l.size?t:Dn(t,l),f=u.get(kn(c));if(void 0!==f)return f}}}catch(p){i.e(p)}finally{i.f()}return An}(o,n);if(!(i instanceof In))return i}return"function"==typeof e.default?e.default(n):e.default}},dangerouslyAllowMutability:e.dangerouslyAllowMutability});return function(t){var r,i=n.get(t);if(null!=i)return i;var a=En({key:"".concat(e.key,"__").concat(null!==(r=kn(t))&&void 0!==r?r:"void"),default:o(t),persistence_UNSTABLE:e.persistence_UNSTABLE,dangerouslyAllowMutability:e.dangerouslyAllowMutability});return n=n.set(t,a),a}},selectorFamily:jn,constSelector:function(e){return Nn(e)},errorSelector:function(e){return Fn(e)},readOnlySelector:function(e){return e},useRecoilValue:Tt,useRecoilValueLoadable:jt,useRecoilState:Pt,useRecoilStateLoadable:At,useSetRecoilState:It,useResetRecoilState:Mt,useRecoilCallback:_t,useGotoRecoilSnapshot:Ft,useRecoilSnapshot:Nt,useRecoilTransactionObserver_UNSTABLE:Rt,useTransactionObservation_UNSTABLE:Dt,useSetUnvalidatedAtomValues_UNSTABLE:zt,noWait:Kn.noWait,waitForNone:Kn.waitForNone,waitForAny:Kn.waitForAny,waitForAll:Kn.waitForAll,isRecoilValue:Yn},Qn=Xn.DefaultValue,Zn=Xn.RecoilRoot,Jn=Xn.atom,er=Xn.selector,tr=Xn.atomFamily,nr=Xn.selectorFamily,rr=Xn.constSelector,or=Xn.errorSelector,ir=Xn.readOnlySelector,ar=Xn.useRecoilValue,lr=Xn.useRecoilValueLoadable,ur=Xn.useRecoilState,cr=Xn.useRecoilStateLoadable,sr=Xn.useSetRecoilState,fr=Xn.useResetRecoilState,dr=Xn.useRecoilCallback,pr=Xn.useGotoRecoilSnapshot,hr=Xn.useRecoilSnapshot,vr=Xn.useRecoilTransactionObserver_UNSTABLE,mr=Xn.useTransactionObservation_UNSTABLE,gr=Xn.useSetUnvalidatedAtomValues_UNSTABLE,yr=Xn.noWait,br=Xn.waitForNone,Sr=Xn.waitForAny,wr=Xn.waitForAll,Or=Xn.isRecoilValue;t.DefaultValue=Qn,t.RecoilRoot=Zn,t.atom=Jn,t.atomFamily=tr,t.constSelector=rr,t.default=Xn,t.errorSelector=or,t.isRecoilValue=Or,t.noWait=yr,t.readOnlySelector=ir,t.selector=er,t.selectorFamily=nr,t.useGotoRecoilSnapshot=pr,t.useRecoilCallback=dr,t.useRecoilSnapshot=hr,t.useRecoilState=ur,t.useRecoilStateLoadable=cr,t.useRecoilTransactionObserver_UNSTABLE=vr,t.useRecoilValue=ar,t.useRecoilValueLoadable=lr,t.useResetRecoilState=fr,t.useSetRecoilState=sr,t.useSetUnvalidatedAtomValues_UNSTABLE=gr,t.useTransactionObservation_UNSTABLE=mr,t.waitForAll=wr,t.waitForAny=Sr,t.waitForNone=br},function(e,t,n){var r=n(197);e.exports=function(e,t){if(null==e)return{};var n,o,i=r(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}},function(e,t,n){e.exports=n(199)},function(e,t,n){var r=function(e){"use strict";var t=Object.prototype,n=t.hasOwnProperty,r="function"===typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(k){l=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var o=t&&t.prototype instanceof f?t:f,i=Object.create(o.prototype),a=new C(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return E()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var l=S(a,n);if(l){if(l===s)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===s)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,a),i}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(k){return{type:"throw",arg:k}}}e.wrap=u;var s={};function f(){}function d(){}function p(){}var h={};h[o]=function(){return this};var v=Object.getPrototypeOf,m=v&&v(v(x([])));m&&m!==t&&n.call(m,o)&&(h=m);var g=p.prototype=f.prototype=Object.create(h);function y(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){var r;this._invoke=function(o,i){function a(){return new t((function(r,a){!function r(o,i,a,l){var u=c(e[o],e,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"===typeof f&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,l)}),(function(e){r("throw",e,a,l)})):t.resolve(f).then((function(e){s.value=e,a(s)}),(function(e){return r("throw",e,a,l)}))}l(u.arg)}(o,i,r,a)}))}return r=r?r.then(a,a):a()}}function S(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method))return s;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=c(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,s;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,s):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,s)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function x(e){if(e){var t=e[o];if(t)return t.call(e);if("function"===typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:E}}function E(){return{value:void 0,done:!0}}return d.prototype=g.constructor=p,p.constructor=d,d.displayName=l(p,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"===typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,a,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},y(b.prototype),b.prototype[i]=function(){return this},e.AsyncIterator=b,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new b(u(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},y(g),l(g,a,"Generator"),g[o]=function(){return this},g.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=x,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(l&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),s},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(n),s}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:x(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},e}(e.exports);try{regeneratorRuntime=r}catch(o){Function("r","regeneratorRuntime = r")(r)}},function(e,t){function n(e,t,n,r,o,i,a){try{var l=e[i](a),u=l.value}catch(c){return void n(c)}l.done?t(u):Promise.resolve(u).then(r,o)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(o,i){var a=e.apply(t,r);function l(e){n(a,o,i,l,u,"next",e)}function u(e){n(a,o,i,l,u,"throw",e)}l(void 0)}))}}},function(e,t,n){var r=n(202),o=n(203),i=n(97),a=n(204);e.exports=function(e){return r(e)||o(e)||i(e)||a()}},function(e,t,n){var r=n(126);e.exports=function(e){if(Array.isArray(e))return r(e)}},function(e,t){e.exports=function(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,n){var r=n(97);e.exports=function(e){if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=r(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i,a=!0,l=!1;return{s:function(){o=e[Symbol.iterator]()},n:function(){var e=o.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==o.return||o.return()}finally{if(l)throw i}}}}},function(e,t,n){var r=n(123);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}},function(e,t,n){var r=n(208),o=n(209),i=n(97),a=n(210);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||a()}},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(u){o=!0,i=u}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,n){var r=n(127),o=n(98),i=n(212),a=n(213);function l(t){var n="function"===typeof Map?new Map:void 0;return e.exports=l=function(e){if(null===e||!i(e))return e;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return a(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),o(t,e)},l(t)}e.exports=l},function(e,t){e.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}},function(e,t,n){var r=n(98),o=n(128);function i(t,n,a){return o()?e.exports=i=Reflect.construct:e.exports=i=function(e,t,n){var o=[null];o.push.apply(o,t);var i=new(Function.bind.apply(e,o));return n&&r(i,n.prototype),i},i.apply(null,arguments)}e.exports=i},function(e,t,n){var r=n(98);e.exports=function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},function(e,t,n){var r=n(127),o=n(128),i=n(216);e.exports=function(e){return function(){var t,n=r(e);if(o()){var a=r(this).constructor;t=Reflect.construct(n,arguments,a)}else t=n.apply(this,arguments);return i(this,t)}}},function(e,t,n){var r=n(217),o=n(124);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!==typeof t?o(e):t}},function(e,t){function n(t){return"function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t,n){var r;!function(o){"use strict";var i=function(){var e=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|"[^"]*"|'[^']*'/g,t=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,n=/[^-+\dA-Z]/g;return function(r,o,s,f){if(1!==arguments.length||"string"!==c(r)||/\d/.test(r)||(o=r,r=void 0),(r=r||new Date)instanceof Date||(r=new Date(r)),isNaN(r))throw TypeError("Invalid date");var d=(o=String(i.masks[o]||o||i.masks.default)).slice(0,4);"UTC:"!==d&&"GMT:"!==d||(o=o.slice(4),s=!0,"GMT:"===d&&(f=!0));var p=s?"getUTC":"get",h=r[p+"Date"](),v=r[p+"Day"](),m=r[p+"Month"](),g=r[p+"FullYear"](),y=r[p+"Hours"](),b=r[p+"Minutes"](),S=r[p+"Seconds"](),w=r[p+"Milliseconds"](),O=s?0:r.getTimezoneOffset(),C=l(r),x=u(r),E={d:h,dd:a(h),ddd:i.i18n.dayNames[v],dddd:i.i18n.dayNames[v+7],m:m+1,mm:a(m+1),mmm:i.i18n.monthNames[m],mmmm:i.i18n.monthNames[m+12],yy:String(g).slice(2),yyyy:g,h:y%12||12,hh:a(y%12||12),H:y,HH:a(y),M:b,MM:a(b),s:S,ss:a(S),l:a(w,3),L:a(Math.round(w/10)),t:y<12?i.i18n.timeNames[0]:i.i18n.timeNames[1],tt:y<12?i.i18n.timeNames[2]:i.i18n.timeNames[3],T:y<12?i.i18n.timeNames[4]:i.i18n.timeNames[5],TT:y<12?i.i18n.timeNames[6]:i.i18n.timeNames[7],Z:f?"GMT":s?"UTC":(String(r).match(t)||[""]).pop().replace(n,""),o:(O>0?"-":"+")+a(100*Math.floor(Math.abs(O)/60)+Math.abs(O)%60,4),S:["th","st","nd","rd"][h%10>3?0:(h%100-h%10!=10)*h%10],W:C,N:x};return o.replace(e,(function(e){return e in E?E[e]:e.slice(1,e.length-1)}))}}();function a(e,t){for(e=String(e),t=t||2;e.length<t;)e="0"+e;return e}function l(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate());t.setDate(t.getDate()-(t.getDay()+6)%7+3);var n=new Date(t.getFullYear(),0,4);n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=t.getTimezoneOffset()-n.getTimezoneOffset();t.setHours(t.getHours()-r);var o=(t-n)/6048e5;return 1+Math.floor(o)}function u(e){var t=e.getDay();return 0===t&&(t=7),t}function c(e){return null===e?"null":void 0===e?"undefined":"object"!==typeof e?typeof e:Array.isArray(e)?"array":{}.toString.call(e).slice(8,-1).toLowerCase()}i.masks={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},i.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]},void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r)}()},function(e,t,n){"use strict";(function(t){!function(t){var n=/^(b|B)$/,r={iec:{bits:["b","Kib","Mib","Gib","Tib","Pib","Eib","Zib","Yib"],bytes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},jedec:{bits:["b","Kb","Mb","Gb","Tb","Pb","Eb","Zb","Yb"],bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}},o={iec:["","kibi","mebi","gibi","tebi","pebi","exbi","zebi","yobi"],jedec:["","kilo","mega","giga","tera","peta","exa","zetta","yotta"]};function i(e){var t,i,a,l,u,c,s,f,d,p,h,v,m,g,y,b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},S=[],w=0,O=void 0,C=void 0;if(isNaN(e))throw new TypeError("Invalid number");return i=!0===b.bits,h=!0===b.unix,t=b.base||2,p=void 0!==b.round?b.round:h?1:2,c=void 0!==b.locale?b.locale:"",s=b.localeOptions||{},v=void 0!==b.separator?b.separator:"",m=void 0!==b.spacer?b.spacer:h?"":" ",y=b.symbols||{},g=2===t&&b.standard||"jedec",d=b.output||"string",l=!0===b.fullform,u=b.fullforms instanceof Array?b.fullforms:[],O=void 0!==b.exponent?b.exponent:-1,a=2<t?1e3:1024,(f=(C=Number(e))<0)&&(C=-C),(-1===O||isNaN(O))&&(O=Math.floor(Math.log(C)/Math.log(a)))<0&&(O=0),8<O&&(O=8),"exponent"===d?O:(0===C?(S[0]=0,S[1]=h?"":r[g][i?"bits":"bytes"][O]):(w=C/(2===t?Math.pow(2,10*O):Math.pow(1e3,O)),i&&a<=(w*=8)&&O<8&&(w/=a,O++),S[0]=Number(w.toFixed(0<O?p:0)),S[0]===a&&O<8&&void 0===b.exponent&&(S[0]=1,O++),S[1]=10===t&&1===O?i?"kb":"kB":r[g][i?"bits":"bytes"][O],h&&(S[1]="jedec"===g?S[1].charAt(0):0<O?S[1].replace(/B$/,""):S[1],n.test(S[1])&&(S[0]=Math.floor(S[0]),S[1]=""))),f&&(S[0]=-S[0]),S[1]=y[S[1]]||S[1],!0===c?S[0]=S[0].toLocaleString():0<c.length?S[0]=S[0].toLocaleString(c,s):0<v.length&&(S[0]=S[0].toString().replace(".",v)),"array"===d?S:(l&&(S[1]=u[O]?u[O]:o[g][O]+(i?"bit":"byte")+(1===S[0]?"":"s")),"object"===d?{value:S[0],symbol:S[1],exponent:O}:S.join(m)))}i.partial=function(e){return function(t){return i(t,e)}},e.exports=i}("undefined"!=typeof window&&window)}).call(this,n(35))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ChonkyBusinessLogic=void 0;var a=i(n(0)),l=n(9),u=n(100),c=n(24),s=n(130),f=n(39),d=n(38),p=n(150),h=n(110),v=n(376),m=n(377),g=n(378),y=n(102),b=n(379),S=n(381);t.ChonkyBusinessLogic=a.default.memo(a.default.forwardRef((function(e,t){var n=e.files,r=e.folderChain?e.folderChain:null,o=e.fileActions?e.fileActions:[],i=e.onFileAction?e.onFileAction:null,w=e.thumbnailGenerator?e.thumbnailGenerator:null,O="number"===typeof e.doubleClickDelay?e.doubleClickDelay:300,C=!!e.disableSelection,x=!!e.enableDragAndDrop,E=b.useFileSorting(n),k=y.useSelection(E,C),_=k.selection,T=k.selectionUtilRef,j=k.selectionModifiers,P=l.useSetRecoilState(d.selectionModifiersState);a.useEffect((function(){P(j)}),[j,P]),h.useFileActions(o,i);var A=m.useOptions(E),I=g.useFileSearch(A);S.useSpecialActionDispatcher(E,_,T.current,j),v.useFileBrowserHandle(t,j);var M=l.useSetRecoilState(f.filesState);a.useEffect((function(){M(I)}),[I,M]);var D=l.useSetRecoilState(f.folderChainState),R=l.useSetRecoilState(f.parentFolderState);a.useEffect((function(){var e=r&&r.length>1?r[(null===r||void 0===r?void 0:r.length)-2]:null;D(r),R(e)}),[r,D,R]);var N=l.useSetRecoilState(d.selectionState);a.useEffect((function(){N(_)}),[_,N]);var F=l.useSetRecoilState(p.thumbnailGeneratorState);a.useEffect((function(){F((function(){return w}))}),[w,F]);var z=l.useSetRecoilState(c.doubleClickDelayState);a.useEffect((function(){z(O)}),[O,z]);l.useRecoilState(s.fileEntrySizeState);var L=l.useSetRecoilState(u.enableDragAndDropState);return a.useEffect((function(){L(x)}),[x,L]),null})))},function(e,t,n){"use strict";var r=n(36);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"Grid",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"accessibilityOverscanIndicesGetter",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"defaultCellRangeRenderer",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"defaultOverscanIndicesGetter",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"bpfrpt_proptype_NoContentRenderer",{enumerable:!0,get:function(){return u.bpfrpt_proptype_NoContentRenderer}}),Object.defineProperty(t,"bpfrpt_proptype_Alignment",{enumerable:!0,get:function(){return u.bpfrpt_proptype_Alignment}}),Object.defineProperty(t,"bpfrpt_proptype_CellPosition",{enumerable:!0,get:function(){return u.bpfrpt_proptype_CellPosition}}),Object.defineProperty(t,"bpfrpt_proptype_CellSize",{enumerable:!0,get:function(){return u.bpfrpt_proptype_CellSize}}),Object.defineProperty(t,"bpfrpt_proptype_OverscanIndicesGetter",{enumerable:!0,get:function(){return u.bpfrpt_proptype_OverscanIndicesGetter}}),Object.defineProperty(t,"bpfrpt_proptype_RenderedSection",{enumerable:!0,get:function(){return u.bpfrpt_proptype_RenderedSection}}),Object.defineProperty(t,"bpfrpt_proptype_CellRendererParams",{enumerable:!0,get:function(){return u.bpfrpt_proptype_CellRendererParams}}),Object.defineProperty(t,"bpfrpt_proptype_Scroll",{enumerable:!0,get:function(){return u.bpfrpt_proptype_Scroll}});var o=r(n(222)),i=r(n(237)),a=r(n(137)),l=r(n(136)),u=n(40)},function(e,t,n){"use strict";var r=n(36),o=n(103);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.DEFAULT_SCROLLING_RESET_TIME_INTERVAL=void 0;var i,a,l=r(n(223)),u=r(n(75)),c=r(n(76)),s=r(n(133)),f=r(n(134)),d=r(n(104)),p=r(n(135)),h=r(n(77)),v=o(n(0)),m=r(n(4)),g=r(n(225)),y=r(n(105)),b=r(n(232)),S=o(n(136)),w=r(n(233)),O=r(n(137)),C=r(n(399)),x=n(234),E=n(235);n(40),r(n(3));function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(n,!0).forEach((function(t){(0,h.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.DEFAULT_SCROLLING_RESET_TIME_INTERVAL=150;var T="observed",j="requested",P=(a=i=function(e){function t(e){var n;(0,u.default)(this,t),n=(0,s.default)(this,(0,f.default)(t).call(this,e)),(0,h.default)((0,d.default)(n),"_onGridRenderedMemoizer",(0,b.default)()),(0,h.default)((0,d.default)(n),"_onScrollMemoizer",(0,b.default)(!1)),(0,h.default)((0,d.default)(n),"_deferredInvalidateColumnIndex",null),(0,h.default)((0,d.default)(n),"_deferredInvalidateRowIndex",null),(0,h.default)((0,d.default)(n),"_recomputeScrollLeftFlag",!1),(0,h.default)((0,d.default)(n),"_recomputeScrollTopFlag",!1),(0,h.default)((0,d.default)(n),"_horizontalScrollBarSize",0),(0,h.default)((0,d.default)(n),"_verticalScrollBarSize",0),(0,h.default)((0,d.default)(n),"_scrollbarPresenceChanged",!1),(0,h.default)((0,d.default)(n),"_scrollingContainer",void 0),(0,h.default)((0,d.default)(n),"_childrenToDisplay",void 0),(0,h.default)((0,d.default)(n),"_columnStartIndex",void 0),(0,h.default)((0,d.default)(n),"_columnStopIndex",void 0),(0,h.default)((0,d.default)(n),"_rowStartIndex",void 0),(0,h.default)((0,d.default)(n),"_rowStopIndex",void 0),(0,h.default)((0,d.default)(n),"_renderedColumnStartIndex",0),(0,h.default)((0,d.default)(n),"_renderedColumnStopIndex",0),(0,h.default)((0,d.default)(n),"_renderedRowStartIndex",0),(0,h.default)((0,d.default)(n),"_renderedRowStopIndex",0),(0,h.default)((0,d.default)(n),"_initialScrollTop",void 0),(0,h.default)((0,d.default)(n),"_initialScrollLeft",void 0),(0,h.default)((0,d.default)(n),"_disablePointerEventsTimeoutId",void 0),(0,h.default)((0,d.default)(n),"_styleCache",{}),(0,h.default)((0,d.default)(n),"_cellCache",{}),(0,h.default)((0,d.default)(n),"_debounceScrollEndedCallback",(function(){n._disablePointerEventsTimeoutId=null,n.setState({isScrolling:!1,needToResetStyleCache:!1})})),(0,h.default)((0,d.default)(n),"_invokeOnGridRenderedHelper",(function(){var e=n.props.onSectionRendered;n._onGridRenderedMemoizer({callback:e,indices:{columnOverscanStartIndex:n._columnStartIndex,columnOverscanStopIndex:n._columnStopIndex,columnStartIndex:n._renderedColumnStartIndex,columnStopIndex:n._renderedColumnStopIndex,rowOverscanStartIndex:n._rowStartIndex,rowOverscanStopIndex:n._rowStopIndex,rowStartIndex:n._renderedRowStartIndex,rowStopIndex:n._renderedRowStopIndex}})})),(0,h.default)((0,d.default)(n),"_setScrollingContainerRef",(function(e){n._scrollingContainer=e})),(0,h.default)((0,d.default)(n),"_onScroll",(function(e){e.target===n._scrollingContainer&&n.handleScrollEvent(e.target)}));var r=new y.default({cellCount:e.columnCount,cellSizeGetter:function(n){return t._wrapSizeGetter(e.columnWidth)(n)},estimatedCellSize:t._getEstimatedColumnSize(e)}),o=new y.default({cellCount:e.rowCount,cellSizeGetter:function(n){return t._wrapSizeGetter(e.rowHeight)(n)},estimatedCellSize:t._getEstimatedRowSize(e)});return n.state={instanceProps:{columnSizeAndPositionManager:r,rowSizeAndPositionManager:o,prevColumnWidth:e.columnWidth,prevRowHeight:e.rowHeight,prevColumnCount:e.columnCount,prevRowCount:e.rowCount,prevIsScrolling:!0===e.isScrolling,prevScrollToColumn:e.scrollToColumn,prevScrollToRow:e.scrollToRow,scrollbarSize:0,scrollbarSizeMeasured:!1},isScrolling:!1,scrollDirectionHorizontal:S.SCROLL_DIRECTION_FORWARD,scrollDirectionVertical:S.SCROLL_DIRECTION_FORWARD,scrollLeft:0,scrollTop:0,scrollPositionChangeReason:null,needToResetStyleCache:!1},e.scrollToRow>0&&(n._initialScrollTop=n._getCalculatedScrollTop(e,n.state)),e.scrollToColumn>0&&(n._initialScrollLeft=n._getCalculatedScrollLeft(e,n.state)),n}return(0,p.default)(t,e),(0,c.default)(t,[{key:"getOffsetForCell",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.alignment,n=void 0===t?this.props.scrollToAlignment:t,r=e.columnIndex,o=void 0===r?this.props.scrollToColumn:r,i=e.rowIndex,a=void 0===i?this.props.scrollToRow:i,l=_({},this.props,{scrollToAlignment:n,scrollToColumn:o,scrollToRow:a});return{scrollLeft:this._getCalculatedScrollLeft(l),scrollTop:this._getCalculatedScrollTop(l)}}},{key:"getTotalRowsHeight",value:function(){return this.state.instanceProps.rowSizeAndPositionManager.getTotalSize()}},{key:"getTotalColumnsWidth",value:function(){return this.state.instanceProps.columnSizeAndPositionManager.getTotalSize()}},{key:"handleScrollEvent",value:function(e){var t=e.scrollLeft,n=void 0===t?0:t,r=e.scrollTop,o=void 0===r?0:r;if(!(o<0)){this._debounceScrollEnded();var i=this.props,a=i.autoHeight,l=i.autoWidth,u=i.height,c=i.width,s=this.state.instanceProps,f=s.scrollbarSize,d=s.rowSizeAndPositionManager.getTotalSize(),p=s.columnSizeAndPositionManager.getTotalSize(),h=Math.min(Math.max(0,p-c+f),n),v=Math.min(Math.max(0,d-u+f),o);if(this.state.scrollLeft!==h||this.state.scrollTop!==v){var m={isScrolling:!0,scrollDirectionHorizontal:h!==this.state.scrollLeft?h>this.state.scrollLeft?S.SCROLL_DIRECTION_FORWARD:S.SCROLL_DIRECTION_BACKWARD:this.state.scrollDirectionHorizontal,scrollDirectionVertical:v!==this.state.scrollTop?v>this.state.scrollTop?S.SCROLL_DIRECTION_FORWARD:S.SCROLL_DIRECTION_BACKWARD:this.state.scrollDirectionVertical,scrollPositionChangeReason:T};a||(m.scrollTop=v),l||(m.scrollLeft=h),m.needToResetStyleCache=!1,this.setState(m)}this._invokeOnScrollMemoizer({scrollLeft:h,scrollTop:v,totalColumnsWidth:p,totalRowsHeight:d})}}},{key:"invalidateCellSizeAfterRender",value:function(e){var t=e.columnIndex,n=e.rowIndex;this._deferredInvalidateColumnIndex="number"===typeof this._deferredInvalidateColumnIndex?Math.min(this._deferredInvalidateColumnIndex,t):t,this._deferredInvalidateRowIndex="number"===typeof this._deferredInvalidateRowIndex?Math.min(this._deferredInvalidateRowIndex,n):n}},{key:"measureAllCells",value:function(){var e=this.props,t=e.columnCount,n=e.rowCount,r=this.state.instanceProps;r.columnSizeAndPositionManager.getSizeAndPositionOfCell(t-1),r.rowSizeAndPositionManager.getSizeAndPositionOfCell(n-1)}},{key:"recomputeGridSize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.columnIndex,n=void 0===t?0:t,r=e.rowIndex,o=void 0===r?0:r,i=this.props,a=i.scrollToColumn,l=i.scrollToRow,u=this.state.instanceProps;u.columnSizeAndPositionManager.resetCell(n),u.rowSizeAndPositionManager.resetCell(o),this._recomputeScrollLeftFlag=a>=0&&(this.state.scrollDirectionHorizontal===S.SCROLL_DIRECTION_FORWARD?n<=a:n>=a),this._recomputeScrollTopFlag=l>=0&&(this.state.scrollDirectionVertical===S.SCROLL_DIRECTION_FORWARD?o<=l:o>=l),this._styleCache={},this._cellCache={},this.forceUpdate()}},{key:"scrollToCell",value:function(e){var t=e.columnIndex,n=e.rowIndex,r=this.props.columnCount,o=this.props;r>1&&void 0!==t&&this._updateScrollLeftForScrollToColumn(_({},o,{scrollToColumn:t})),void 0!==n&&this._updateScrollTopForScrollToRow(_({},o,{scrollToRow:n}))}},{key:"componentDidMount",value:function(){var e=this.props,n=e.getScrollbarSize,r=e.height,o=e.scrollLeft,i=e.scrollToColumn,a=e.scrollTop,l=e.scrollToRow,u=e.width,c=this.state.instanceProps;if(this._initialScrollTop=0,this._initialScrollLeft=0,this._handleInvalidatedGridSize(),c.scrollbarSizeMeasured||this.setState((function(e){var t=_({},e,{needToResetStyleCache:!1});return t.instanceProps.scrollbarSize=n(),t.instanceProps.scrollbarSizeMeasured=!0,t})),"number"===typeof o&&o>=0||"number"===typeof a&&a>=0){var s=t._getScrollToPositionStateUpdate({prevState:this.state,scrollLeft:o,scrollTop:a});s&&(s.needToResetStyleCache=!1,this.setState(s))}this._scrollingContainer&&(this._scrollingContainer.scrollLeft!==this.state.scrollLeft&&(this._scrollingContainer.scrollLeft=this.state.scrollLeft),this._scrollingContainer.scrollTop!==this.state.scrollTop&&(this._scrollingContainer.scrollTop=this.state.scrollTop));var f=r>0&&u>0;i>=0&&f&&this._updateScrollLeftForScrollToColumn(),l>=0&&f&&this._updateScrollTopForScrollToRow(),this._invokeOnGridRenderedHelper(),this._invokeOnScrollMemoizer({scrollLeft:o||0,scrollTop:a||0,totalColumnsWidth:c.columnSizeAndPositionManager.getTotalSize(),totalRowsHeight:c.rowSizeAndPositionManager.getTotalSize()}),this._maybeCallOnScrollbarPresenceChange()}},{key:"componentDidUpdate",value:function(e,t){var n=this,r=this.props,o=r.autoHeight,i=r.autoWidth,a=r.columnCount,l=r.height,u=r.rowCount,c=r.scrollToAlignment,s=r.scrollToColumn,f=r.scrollToRow,d=r.width,p=this.state,h=p.scrollLeft,v=p.scrollPositionChangeReason,m=p.scrollTop,g=p.instanceProps;this._handleInvalidatedGridSize();var y=a>0&&0===e.columnCount||u>0&&0===e.rowCount;v===j&&(!i&&h>=0&&(h!==this._scrollingContainer.scrollLeft||y)&&(this._scrollingContainer.scrollLeft=h),!o&&m>=0&&(m!==this._scrollingContainer.scrollTop||y)&&(this._scrollingContainer.scrollTop=m));var b=(0===e.width||0===e.height)&&l>0&&d>0;if(this._recomputeScrollLeftFlag?(this._recomputeScrollLeftFlag=!1,this._updateScrollLeftForScrollToColumn(this.props)):(0,w.default)({cellSizeAndPositionManager:g.columnSizeAndPositionManager,previousCellsCount:e.columnCount,previousCellSize:e.columnWidth,previousScrollToAlignment:e.scrollToAlignment,previousScrollToIndex:e.scrollToColumn,previousSize:e.width,scrollOffset:h,scrollToAlignment:c,scrollToIndex:s,size:d,sizeJustIncreasedFromZero:b,updateScrollIndexCallback:function(){return n._updateScrollLeftForScrollToColumn(n.props)}}),this._recomputeScrollTopFlag?(this._recomputeScrollTopFlag=!1,this._updateScrollTopForScrollToRow(this.props)):(0,w.default)({cellSizeAndPositionManager:g.rowSizeAndPositionManager,previousCellsCount:e.rowCount,previousCellSize:e.rowHeight,previousScrollToAlignment:e.scrollToAlignment,previousScrollToIndex:e.scrollToRow,previousSize:e.height,scrollOffset:m,scrollToAlignment:c,scrollToIndex:f,size:l,sizeJustIncreasedFromZero:b,updateScrollIndexCallback:function(){return n._updateScrollTopForScrollToRow(n.props)}}),this._invokeOnGridRenderedHelper(),h!==t.scrollLeft||m!==t.scrollTop){var S=g.rowSizeAndPositionManager.getTotalSize(),O=g.columnSizeAndPositionManager.getTotalSize();this._invokeOnScrollMemoizer({scrollLeft:h,scrollTop:m,totalColumnsWidth:O,totalRowsHeight:S})}this._maybeCallOnScrollbarPresenceChange()}},{key:"componentWillUnmount",value:function(){this._disablePointerEventsTimeoutId&&(0,E.cancelAnimationTimeout)(this._disablePointerEventsTimeoutId)}},{key:"render",value:function(){var e=this.props,t=e.autoContainerWidth,n=e.autoHeight,r=e.autoWidth,o=e.className,i=e.containerProps,a=e.containerRole,u=e.containerStyle,c=e.height,s=e.id,f=e.noContentRenderer,d=e.role,p=e.style,h=e.tabIndex,g=e.width,y=this.state,b=y.instanceProps,S=y.needToResetStyleCache,w=this._isScrolling(),O={boxSizing:"border-box",direction:"ltr",height:n?"auto":c,position:"relative",width:r?"auto":g,WebkitOverflowScrolling:"touch",willChange:"transform"};S&&(this._styleCache={}),this.state.isScrolling||this._resetStyleCache(),this._calculateChildrenToRender(this.props,this.state);var C=b.columnSizeAndPositionManager.getTotalSize(),x=b.rowSizeAndPositionManager.getTotalSize(),E=x>c?b.scrollbarSize:0,k=C>g?b.scrollbarSize:0;k===this._horizontalScrollBarSize&&E===this._verticalScrollBarSize||(this._horizontalScrollBarSize=k,this._verticalScrollBarSize=E,this._scrollbarPresenceChanged=!0),O.overflowX=C+E<=g?"hidden":"auto",O.overflowY=x+k<=c?"hidden":"auto";var T=this._childrenToDisplay,j=0===T.length&&c>0&&g>0;return v.createElement("div",(0,l.default)({ref:this._setScrollingContainerRef},i,{"aria-label":this.props["aria-label"],"aria-readonly":this.props["aria-readonly"],className:(0,m.default)("ReactVirtualized__Grid",o),id:s,onScroll:this._onScroll,role:d,style:_({},O,{},p),tabIndex:h}),T.length>0&&v.createElement("div",{className:"ReactVirtualized__Grid__innerScrollContainer",role:a,style:_({width:t?"auto":C,height:x,maxWidth:C,maxHeight:x,overflow:"hidden",pointerEvents:w?"none":"",position:"relative"},u)},T),j&&f())}},{key:"_calculateChildrenToRender",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state,n=e.cellRenderer,r=e.cellRangeRenderer,o=e.columnCount,i=e.deferredMeasurementCache,a=e.height,l=e.overscanColumnCount,u=e.overscanIndicesGetter,c=e.overscanRowCount,s=e.rowCount,f=e.width,d=e.isScrollingOptOut,p=t.scrollDirectionHorizontal,h=t.scrollDirectionVertical,v=t.instanceProps,m=this._initialScrollTop>0?this._initialScrollTop:t.scrollTop,g=this._initialScrollLeft>0?this._initialScrollLeft:t.scrollLeft,y=this._isScrolling(e,t);if(this._childrenToDisplay=[],a>0&&f>0){var b=v.columnSizeAndPositionManager.getVisibleCellRange({containerSize:f,offset:g}),S=v.rowSizeAndPositionManager.getVisibleCellRange({containerSize:a,offset:m}),w=v.columnSizeAndPositionManager.getOffsetAdjustment({containerSize:f,offset:g}),O=v.rowSizeAndPositionManager.getOffsetAdjustment({containerSize:a,offset:m});this._renderedColumnStartIndex=b.start,this._renderedColumnStopIndex=b.stop,this._renderedRowStartIndex=S.start,this._renderedRowStopIndex=S.stop;var C=u({direction:"horizontal",cellCount:o,overscanCellsCount:l,scrollDirection:p,startIndex:"number"===typeof b.start?b.start:0,stopIndex:"number"===typeof b.stop?b.stop:-1}),x=u({direction:"vertical",cellCount:s,overscanCellsCount:c,scrollDirection:h,startIndex:"number"===typeof S.start?S.start:0,stopIndex:"number"===typeof S.stop?S.stop:-1}),E=C.overscanStartIndex,k=C.overscanStopIndex,_=x.overscanStartIndex,T=x.overscanStopIndex;if(i){if(!i.hasFixedHeight())for(var j=_;j<=T;j++)if(!i.has(j,0)){E=0,k=o-1;break}if(!i.hasFixedWidth())for(var P=E;P<=k;P++)if(!i.has(0,P)){_=0,T=s-1;break}}this._childrenToDisplay=r({cellCache:this._cellCache,cellRenderer:n,columnSizeAndPositionManager:v.columnSizeAndPositionManager,columnStartIndex:E,columnStopIndex:k,deferredMeasurementCache:i,horizontalOffsetAdjustment:w,isScrolling:y,isScrollingOptOut:d,parent:this,rowSizeAndPositionManager:v.rowSizeAndPositionManager,rowStartIndex:_,rowStopIndex:T,scrollLeft:g,scrollTop:m,styleCache:this._styleCache,verticalOffsetAdjustment:O,visibleColumnIndices:b,visibleRowIndices:S}),this._columnStartIndex=E,this._columnStopIndex=k,this._rowStartIndex=_,this._rowStopIndex=T}}},{key:"_debounceScrollEnded",value:function(){var e=this.props.scrollingResetTimeInterval;this._disablePointerEventsTimeoutId&&(0,E.cancelAnimationTimeout)(this._disablePointerEventsTimeoutId),this._disablePointerEventsTimeoutId=(0,E.requestAnimationTimeout)(this._debounceScrollEndedCallback,e)}},{key:"_handleInvalidatedGridSize",value:function(){if("number"===typeof this._deferredInvalidateColumnIndex&&"number"===typeof this._deferredInvalidateRowIndex){var e=this._deferredInvalidateColumnIndex,t=this._deferredInvalidateRowIndex;this._deferredInvalidateColumnIndex=null,this._deferredInvalidateRowIndex=null,this.recomputeGridSize({columnIndex:e,rowIndex:t})}}},{key:"_invokeOnScrollMemoizer",value:function(e){var t=this,n=e.scrollLeft,r=e.scrollTop,o=e.totalColumnsWidth,i=e.totalRowsHeight;this._onScrollMemoizer({callback:function(e){var n=e.scrollLeft,r=e.scrollTop,a=t.props,l=a.height;(0,a.onScroll)({clientHeight:l,clientWidth:a.width,scrollHeight:i,scrollLeft:n,scrollTop:r,scrollWidth:o})},indices:{scrollLeft:n,scrollTop:r}})}},{key:"_isScrolling",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state;return Object.hasOwnProperty.call(e,"isScrolling")?Boolean(e.isScrolling):Boolean(t.isScrolling)}},{key:"_maybeCallOnScrollbarPresenceChange",value:function(){if(this._scrollbarPresenceChanged){var e=this.props.onScrollbarPresenceChange;this._scrollbarPresenceChanged=!1,e({horizontal:this._horizontalScrollBarSize>0,size:this.state.instanceProps.scrollbarSize,vertical:this._verticalScrollBarSize>0})}}},{key:"scrollToPosition",value:function(e){var n=e.scrollLeft,r=e.scrollTop,o=t._getScrollToPositionStateUpdate({prevState:this.state,scrollLeft:n,scrollTop:r});o&&(o.needToResetStyleCache=!1,this.setState(o))}},{key:"_getCalculatedScrollLeft",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state;return t._getCalculatedScrollLeft(e,n)}},{key:"_updateScrollLeftForScrollToColumn",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state,r=t._getScrollLeftForScrollToColumnStateUpdate(e,n);r&&(r.needToResetStyleCache=!1,this.setState(r))}},{key:"_getCalculatedScrollTop",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state;return t._getCalculatedScrollTop(e,n)}},{key:"_resetStyleCache",value:function(){var e=this._styleCache,t=this._cellCache,n=this.props.isScrollingOptOut;this._cellCache={},this._styleCache={};for(var r=this._rowStartIndex;r<=this._rowStopIndex;r++)for(var o=this._columnStartIndex;o<=this._columnStopIndex;o++){var i="".concat(r,"-").concat(o);this._styleCache[i]=e[i],n&&(this._cellCache[i]=t[i])}}},{key:"_updateScrollTopForScrollToRow",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state,r=t._getScrollTopForScrollToRowStateUpdate(e,n);r&&(r.needToResetStyleCache=!1,this.setState(r))}}],[{key:"getDerivedStateFromProps",value:function(e,n){var r={};0===e.columnCount&&0!==n.scrollLeft||0===e.rowCount&&0!==n.scrollTop?(r.scrollLeft=0,r.scrollTop=0):(e.scrollLeft!==n.scrollLeft&&e.scrollToColumn<0||e.scrollTop!==n.scrollTop&&e.scrollToRow<0)&&Object.assign(r,t._getScrollToPositionStateUpdate({prevState:n,scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}));var o,i,a=n.instanceProps;return r.needToResetStyleCache=!1,e.columnWidth===a.prevColumnWidth&&e.rowHeight===a.prevRowHeight||(r.needToResetStyleCache=!0),a.columnSizeAndPositionManager.configure({cellCount:e.columnCount,estimatedCellSize:t._getEstimatedColumnSize(e),cellSizeGetter:t._wrapSizeGetter(e.columnWidth)}),a.rowSizeAndPositionManager.configure({cellCount:e.rowCount,estimatedCellSize:t._getEstimatedRowSize(e),cellSizeGetter:t._wrapSizeGetter(e.rowHeight)}),0!==a.prevColumnCount&&0!==a.prevRowCount||(a.prevColumnCount=0,a.prevRowCount=0),e.autoHeight&&!1===e.isScrolling&&!0===a.prevIsScrolling&&Object.assign(r,{isScrolling:!1}),(0,g.default)({cellCount:a.prevColumnCount,cellSize:"number"===typeof a.prevColumnWidth?a.prevColumnWidth:null,computeMetadataCallback:function(){return a.columnSizeAndPositionManager.resetCell(0)},computeMetadataCallbackProps:e,nextCellsCount:e.columnCount,nextCellSize:"number"===typeof e.columnWidth?e.columnWidth:null,nextScrollToIndex:e.scrollToColumn,scrollToIndex:a.prevScrollToColumn,updateScrollOffsetForScrollToIndex:function(){o=t._getScrollLeftForScrollToColumnStateUpdate(e,n)}}),(0,g.default)({cellCount:a.prevRowCount,cellSize:"number"===typeof a.prevRowHeight?a.prevRowHeight:null,computeMetadataCallback:function(){return a.rowSizeAndPositionManager.resetCell(0)},computeMetadataCallbackProps:e,nextCellsCount:e.rowCount,nextCellSize:"number"===typeof e.rowHeight?e.rowHeight:null,nextScrollToIndex:e.scrollToRow,scrollToIndex:a.prevScrollToRow,updateScrollOffsetForScrollToIndex:function(){i=t._getScrollTopForScrollToRowStateUpdate(e,n)}}),a.prevColumnCount=e.columnCount,a.prevColumnWidth=e.columnWidth,a.prevIsScrolling=!0===e.isScrolling,a.prevRowCount=e.rowCount,a.prevRowHeight=e.rowHeight,a.prevScrollToColumn=e.scrollToColumn,a.prevScrollToRow=e.scrollToRow,a.scrollbarSize=e.getScrollbarSize(),void 0===a.scrollbarSize?(a.scrollbarSizeMeasured=!1,a.scrollbarSize=0):a.scrollbarSizeMeasured=!0,r.instanceProps=a,_({},r,{},o,{},i)}},{key:"_getEstimatedColumnSize",value:function(e){return"number"===typeof e.columnWidth?e.columnWidth:e.estimatedColumnSize}},{key:"_getEstimatedRowSize",value:function(e){return"number"===typeof e.rowHeight?e.rowHeight:e.estimatedRowSize}},{key:"_getScrollToPositionStateUpdate",value:function(e){var t=e.prevState,n=e.scrollLeft,r=e.scrollTop,o={scrollPositionChangeReason:j};return"number"===typeof n&&n>=0&&(o.scrollDirectionHorizontal=n>t.scrollLeft?S.SCROLL_DIRECTION_FORWARD:S.SCROLL_DIRECTION_BACKWARD,o.scrollLeft=n),"number"===typeof r&&r>=0&&(o.scrollDirectionVertical=r>t.scrollTop?S.SCROLL_DIRECTION_FORWARD:S.SCROLL_DIRECTION_BACKWARD,o.scrollTop=r),"number"===typeof n&&n>=0&&n!==t.scrollLeft||"number"===typeof r&&r>=0&&r!==t.scrollTop?o:{}}},{key:"_wrapSizeGetter",value:function(e){return"function"===typeof e?e:function(){return e}}},{key:"_getCalculatedScrollLeft",value:function(e,t){var n=e.columnCount,r=e.height,o=e.scrollToAlignment,i=e.scrollToColumn,a=e.width,l=t.scrollLeft,u=t.instanceProps;if(n>0){var c=n-1,s=i<0?c:Math.min(c,i),f=u.rowSizeAndPositionManager.getTotalSize(),d=u.scrollbarSizeMeasured&&f>r?u.scrollbarSize:0;return u.columnSizeAndPositionManager.getUpdatedOffsetForIndex({align:o,containerSize:a-d,currentOffset:l,targetIndex:s})}return 0}},{key:"_getScrollLeftForScrollToColumnStateUpdate",value:function(e,n){var r=n.scrollLeft,o=t._getCalculatedScrollLeft(e,n);return"number"===typeof o&&o>=0&&r!==o?t._getScrollToPositionStateUpdate({prevState:n,scrollLeft:o,scrollTop:-1}):{}}},{key:"_getCalculatedScrollTop",value:function(e,t){var n=e.height,r=e.rowCount,o=e.scrollToAlignment,i=e.scrollToRow,a=e.width,l=t.scrollTop,u=t.instanceProps;if(r>0){var c=r-1,s=i<0?c:Math.min(c,i),f=u.columnSizeAndPositionManager.getTotalSize(),d=u.scrollbarSizeMeasured&&f>a?u.scrollbarSize:0;return u.rowSizeAndPositionManager.getUpdatedOffsetForIndex({align:o,containerSize:n-d,currentOffset:l,targetIndex:s})}return 0}},{key:"_getScrollTopForScrollToRowStateUpdate",value:function(e,n){var r=n.scrollTop,o=t._getCalculatedScrollTop(e,n);return"number"===typeof o&&o>=0&&r!==o?t._getScrollToPositionStateUpdate({prevState:n,scrollLeft:-1,scrollTop:o}):{}}}]),t}(v.PureComponent),(0,h.default)(i,"propTypes",null),a);(0,h.default)(P,"defaultProps",{"aria-label":"grid","aria-readonly":!0,autoContainerWidth:!1,autoHeight:!1,autoWidth:!1,cellRangeRenderer:O.default,containerRole:"rowgroup",containerStyle:{},estimatedColumnSize:100,estimatedRowSize:30,getScrollbarSize:C.default,noContentRenderer:function(){return null},onScroll:function(){},onScrollbarPresenceChange:function(){},onSectionRendered:function(){},overscanColumnCount:0,overscanIndicesGetter:S.default,overscanRowCount:10,role:"grid",scrollingResetTimeInterval:150,scrollToAlignment:"auto",scrollToColumn:-1,scrollToRow:-1,style:{},tabIndex:0,isScrollingOptOut:!1}),(0,x.polyfill)(P);var A=P;t.default=A},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n.apply(this,arguments)}e.exports=n},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.cellCount,n=e.cellSize,r=e.computeMetadataCallback,o=e.computeMetadataCallbackProps,i=e.nextCellsCount,a=e.nextCellSize,l=e.nextScrollToIndex,u=e.scrollToIndex,c=e.updateScrollOffsetForScrollToIndex;t===i&&("number"!==typeof n&&"number"!==typeof a||n===a)||(r(o),u>=0&&u===l&&c())}},function(e,t,n){var r=n(227);e.exports=function(e,t){if(null==e)return{};var n,o,i=r(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}},function(e,t,n){"use strict";var r=n(36);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(75)),i=r(n(76)),a=r(n(77)),l=(n(40),function(){function e(t){var n=t.cellCount,r=t.cellSizeGetter,i=t.estimatedCellSize;(0,o.default)(this,e),(0,a.default)(this,"_cellSizeAndPositionData",{}),(0,a.default)(this,"_lastMeasuredIndex",-1),(0,a.default)(this,"_lastBatchedIndex",-1),(0,a.default)(this,"_cellCount",void 0),(0,a.default)(this,"_cellSizeGetter",void 0),(0,a.default)(this,"_estimatedCellSize",void 0),this._cellSizeGetter=r,this._cellCount=n,this._estimatedCellSize=i}return(0,i.default)(e,[{key:"areOffsetsAdjusted",value:function(){return!1}},{key:"configure",value:function(e){var t=e.cellCount,n=e.estimatedCellSize,r=e.cellSizeGetter;this._cellCount=t,this._estimatedCellSize=n,this._cellSizeGetter=r}},{key:"getCellCount",value:function(){return this._cellCount}},{key:"getEstimatedCellSize",value:function(){return this._estimatedCellSize}},{key:"getLastMeasuredIndex",value:function(){return this._lastMeasuredIndex}},{key:"getOffsetAdjustment",value:function(){return 0}},{key:"getSizeAndPositionOfCell",value:function(e){if(e<0||e>=this._cellCount)throw Error("Requested index ".concat(e," is outside of range 0..").concat(this._cellCount));if(e>this._lastMeasuredIndex)for(var t=this.getSizeAndPositionOfLastMeasuredCell(),n=t.offset+t.size,r=this._lastMeasuredIndex+1;r<=e;r++){var o=this._cellSizeGetter({index:r});if(void 0===o||isNaN(o))throw Error("Invalid size returned for cell ".concat(r," of value ").concat(o));null===o?(this._cellSizeAndPositionData[r]={offset:n,size:0},this._lastBatchedIndex=e):(this._cellSizeAndPositionData[r]={offset:n,size:o},n+=o,this._lastMeasuredIndex=e)}return this._cellSizeAndPositionData[e]}},{key:"getSizeAndPositionOfLastMeasuredCell",value:function(){return this._lastMeasuredIndex>=0?this._cellSizeAndPositionData[this._lastMeasuredIndex]:{offset:0,size:0}}},{key:"getTotalSize",value:function(){var e=this.getSizeAndPositionOfLastMeasuredCell();return e.offset+e.size+(this._cellCount-this._lastMeasuredIndex-1)*this._estimatedCellSize}},{key:"getUpdatedOffsetForIndex",value:function(e){var t=e.align,n=void 0===t?"auto":t,r=e.containerSize,o=e.currentOffset,i=e.targetIndex;if(r<=0)return 0;var a,l=this.getSizeAndPositionOfCell(i),u=l.offset,c=u-r+l.size;switch(n){case"start":a=u;break;case"end":a=c;break;case"center":a=u-(r-l.size)/2;break;default:a=Math.max(c,Math.min(u,o))}var s=this.getTotalSize();return Math.max(0,Math.min(s-r,a))}},{key:"getVisibleCellRange",value:function(e){var t=e.containerSize,n=e.offset;if(0===this.getTotalSize())return{};var r=n+t,o=this._findNearestCell(n),i=this.getSizeAndPositionOfCell(o);n=i.offset+i.size;for(var a=o;n<r&&a<this._cellCount-1;)a++,n+=this.getSizeAndPositionOfCell(a).size;return{start:o,stop:a}}},{key:"resetCell",value:function(e){this._lastMeasuredIndex=Math.min(this._lastMeasuredIndex,e-1)}},{key:"_binarySearch",value:function(e,t,n){for(;t<=e;){var r=t+Math.floor((e-t)/2),o=this.getSizeAndPositionOfCell(r).offset;if(o===n)return r;o<n?t=r+1:o>n&&(e=r-1)}return t>0?t-1:0}},{key:"_exponentialSearch",value:function(e,t){for(var n=1;e<this._cellCount&&this.getSizeAndPositionOfCell(e).offset<t;)e+=n,n*=2;return this._binarySearch(Math.min(e,this._cellCount-1),Math.floor(e/2),t)}},{key:"_findNearestCell",value:function(e){if(isNaN(e))throw Error("Invalid offset ".concat(e," specified"));e=Math.max(0,e);var t=this.getSizeAndPositionOfLastMeasuredCell(),n=Math.max(0,this._lastMeasuredIndex);return t.offset>=e?this._binarySearch(n,0,e):this._exponentialSearch(n,e)}}]),e}());t.default=l},function(e,t,n){"use strict";var r=n(230);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMaxElementSize=void 0;t.getMaxElementSize=function(){return"undefined"!==typeof window&&window.chrome?16777100:15e5}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t={};return function(n){var r=n.callback,o=n.indices,i=Object.keys(o),a=!e||i.every((function(e){var t=o[e];return Array.isArray(t)?t.length>0:t>=0})),l=i.length!==Object.keys(t).length||i.some((function(e){var n=t[e],r=o[e];return Array.isArray(r)?n.join(",")!==r.join(","):n!==r}));t=o,a&&l&&r(o)}}},function(e,t,n){"use strict";var r=n(36);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.cellSize,n=e.cellSizeAndPositionManager,r=e.previousCellsCount,o=e.previousCellSize,i=e.previousScrollToAlignment,a=e.previousScrollToIndex,l=e.previousSize,u=e.scrollOffset,c=e.scrollToAlignment,s=e.scrollToIndex,f=e.size,d=e.sizeJustIncreasedFromZero,p=e.updateScrollIndexCallback,h=n.getCellCount(),v=s>=0&&s<h,m=f!==l||d||!o||"number"===typeof t&&t!==o;v&&(m||c!==i||s!==a)?p(s):!v&&h>0&&(f<l||h<r)&&u>n.getTotalSize()-f&&p(h-1)};r(n(105)),n(40)},function(e,t,n){"use strict";function r(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!==e&&void 0!==e&&this.setState(e)}function o(e){this.setState(function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!==n&&void 0!==n?n:null}.bind(this))}function i(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function a(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if("function"!==typeof e.getDerivedStateFromProps&&"function"!==typeof t.getSnapshotBeforeUpdate)return e;var n=null,a=null,l=null;if("function"===typeof t.componentWillMount?n="componentWillMount":"function"===typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"===typeof t.componentWillReceiveProps?a="componentWillReceiveProps":"function"===typeof t.UNSAFE_componentWillReceiveProps&&(a="UNSAFE_componentWillReceiveProps"),"function"===typeof t.componentWillUpdate?l="componentWillUpdate":"function"===typeof t.UNSAFE_componentWillUpdate&&(l="UNSAFE_componentWillUpdate"),null!==n||null!==a||null!==l){var u=e.displayName||e.name,c="function"===typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+u+" uses "+c+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==a?"\n "+a:"")+(null!==l?"\n "+l:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"===typeof e.getDerivedStateFromProps&&(t.componentWillMount=r,t.componentWillReceiveProps=o),"function"===typeof t.getSnapshotBeforeUpdate){if("function"!==typeof t.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=i;var s=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;s.call(this,e,t,r)}}return e}n.r(t),n.d(t,"polyfill",(function(){return a})),r.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0,i.__suppressDeprecationWarning=!0},function(e,t,n){"use strict";var r=n(36);Object.defineProperty(t,"__esModule",{value:!0}),t.bpfrpt_proptype_AnimationTimeoutId=t.requestAnimationTimeout=t.cancelAnimationTimeout=void 0;var o=n(236);r(n(3));t.bpfrpt_proptype_AnimationTimeoutId=null;t.cancelAnimationTimeout=function(e){return(0,o.caf)(e.id)};t.requestAnimationTimeout=function(e,t){var n;Promise.resolve().then((function(){n=Date.now()}));var r={id:(0,o.raf)((function i(){Date.now()-n>=t?e.call():r.id=(0,o.raf)(i)}))};return r}},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.caf=t.raf=void 0;var o=(r="undefined"!==typeof window?window:"undefined"!==typeof self?self:{}).requestAnimationFrame||r.webkitRequestAnimationFrame||r.mozRequestAnimationFrame||r.oRequestAnimationFrame||r.msRequestAnimationFrame||function(e){return r.setTimeout(e,1e3/60)},i=r.cancelAnimationFrame||r.webkitCancelAnimationFrame||r.mozCancelAnimationFrame||r.oCancelAnimationFrame||r.msCancelAnimationFrame||function(e){r.clearTimeout(e)},a=o;t.raf=a;var l=i;t.caf=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.cellCount,n=e.overscanCellsCount,r=e.scrollDirection,o=e.startIndex,i=e.stopIndex;return n=Math.max(1,n),1===r?{overscanStartIndex:Math.max(0,o-1),overscanStopIndex:Math.min(t-1,i+n)}:{overscanStartIndex:Math.max(0,o-n),overscanStopIndex:Math.min(t-1,i+1)}},t.SCROLL_DIRECTION_VERTICAL=t.SCROLL_DIRECTION_HORIZONTAL=t.SCROLL_DIRECTION_FORWARD=t.SCROLL_DIRECTION_BACKWARD=void 0;n(40);t.SCROLL_DIRECTION_BACKWARD=-1;t.SCROLL_DIRECTION_FORWARD=1;t.SCROLL_DIRECTION_HORIZONTAL="horizontal";t.SCROLL_DIRECTION_VERTICAL="vertical"},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SmartFileEntry=void 0;var i=o(n(0)),a=n(9),l=n(100),u=n(39),c=n(38),s=n(138),f=n(151);t.SmartFileEntry=i.default.memo((function(e){var t=e.fileId,n=e.displayIndex,o={file:a.useRecoilValue(u.fileDataState(t)),displayIndex:n,selected:a.useRecoilValue(c.fileSelectedState(t))};return a.useRecoilValue(l.enableDragAndDropState)?i.default.createElement(f.DnDFileEntry,r({},o)):i.default.createElement(s.ClickableFileEntry,r({},o))}))},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ClickableWrapper=void 0;var i=o(n(0)),a=n(240);t.ClickableWrapper=function(e){var t=e.children,n=e.wrapperTag,o=e.passthroughProps,l=e.onSingleClick,u=e.onDoubleClick,c=e.onKeyboardClick,s=a.useClickHandler(l,u),f=a.useKeyDownHandler(c),d={};(l||u||c)&&(d.onClick=s,d.onKeyDown=f,d.tabIndex=0);var p=r(r({},d),o);return i.default.createElement(n,r({},p),t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useKeyDownHandler=t.useClickHandler=void 0;var r=n(0),o=n(9),i=n(24);t.useClickHandler=function(e,t){var n=o.useRecoilValue(i.doubleClickDelayState),a=r.useRef({clickCount:0,clickTimeout:null});return r.useCallback((function(r){var o={altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey};a.current.clickCount++,1===a.current.clickCount?(e&&(r.preventDefault(),e(o)),a.current.clickCount=1,a.current.clickTimeout=setTimeout((function(){return a.current.clickCount=0}),n)):2===a.current.clickCount&&(t&&(r.preventDefault(),t(o)),"number"===typeof a.current.clickTimeout&&(clearTimeout(a.current.clickTimeout),a.current.clickTimeout=null,a.current.clickCount=0))}),[n,e,t,a])},t.useKeyDownHandler=function(e){return r.useCallback((function(t){if(e){var n={enterKey:"Enter"===t.nativeEvent.code,spaceKey:"Space"===t.nativeEvent.code,altKey:t.altKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey};(n.spaceKey||n.enterKey)&&(t.preventDefault(),t.stopPropagation(),e(n))}}),[e])}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseFileEntry=void 0;var l=a(n(50)),u=i(n(0)),c=n(22),s=n(28),f=n(242),d=n(42),p=n(368),h=n(369);t.BaseFileEntry=u.default.memo((function(e){var t=e.file,n=e.selected,r=e.style,o=e.dndIsDragging,i=e.dndIsOver,a=e.dndCanDrop,v=u.useState(null),m=v[0],g=v[1],y=u.useState(!1),b=y[0],S=y[1];h.useThumbnailUrl(t,g,S);var w=f.useIconData(t),O=m?f.ColorsDark[w.colorCode]:f.ColorsLight[w.colorCode],C=b||!t,x=b?c.ChonkyIconName.loading:w.icon,E=h.useDndIcon(n,o,i,a),k=h.useModifierIconComponents(t),_=h.useFileNameComponent(t),T=l.default({"chonky-file-entry":!0,"chonky-file-entry-directory":s.FileHelper.isDirectory(t),"chonky-file-entry-selected":n,"chonky-file-entry-dragging":o,"chonky-file-entry-drop-hovered":i&&a});return u.default.createElement("div",{className:T,style:r},u.default.createElement("div",{className:"chonky-file-entry-inside"},E&&u.default.createElement("div",{className:"chonky-file-entry-dnd-indicator"},u.default.createElement(d.ChonkyIconFA,{icon:E})),u.default.createElement("div",{className:"chonky-file-entry-preview"},u.default.createElement("div",{className:"chonky-file-details"},u.default.createElement("div",{className:"chonky-file-details-inside"},u.default.createElement("div",{className:"chonky-file-details-item"},s.FileHelper.getReadableDate(t)),u.default.createElement("div",{className:"chonky-file-details-item"},s.FileHelper.getReadableFileSize(t)))),u.default.createElement("div",{className:"chonky-file-icon"},s.FileHelper.isDirectory(t)&&u.default.createElement("div",{className:"chonky-file-icon-children-count"},s.FileHelper.getChildrenCount(t)),u.default.createElement("div",{className:"chonky-file-icon-inside"},u.default.createElement(d.ChonkyIconFA,{icon:x,spin:C}))),u.default.createElement("div",{className:"chonky-file-selection"}),u.default.createElement(p.FileThumbnail,{thumbnailUrl:m}),u.default.createElement("div",{className:"chonky-file-background",style:{backgroundColor:O}})),u.default.createElement("div",{className:"chonky-file-entry-description"},u.default.createElement("div",{className:"chonky-file-entry-description-title",title:t?t.name:void 0},k.length>0&&u.default.createElement("span",{className:"chonky-file-entry-description-title-modifiers"},k),_))))}))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ColorsDark=t.ColorsLight=t.AudioExtensions=t.ImageExtensions=t.VideoExtensions=t.useIconData=void 0;var o=r(n(243)),i=r(n(245)),a=n(0),l=n(22),u=i.default((function(){for(var e=0,n=[[l.ChonkyIconName.license,["license"]],[l.ChonkyIconName.config,["sfk","ini","yml","toml","iml"]],[l.ChonkyIconName.model,["3ds","obj","ply","fbx"]],[l.ChonkyIconName.database,["csv","json","sql","sqlite","sqlite3","npy","npz","rec","idx","hdf5"]],[l.ChonkyIconName.text,["txt","md"]],[l.ChonkyIconName.archive,["zip","rar","tar","tar.gz"]],[l.ChonkyIconName.image,t.ImageExtensions],[l.ChonkyIconName.video,t.VideoExtensions],[l.ChonkyIconName.code,["html","php","css","sass","scss","less","cpp","h","hpp","c","xml"]],[l.ChonkyIconName.info,["bib","readme","nfo"]],[l.ChonkyIconName.key,["pem","pub"]],[l.ChonkyIconName.lock,["lock","lock.json","shrinkwrap.json"]],[l.ChonkyIconName.music,t.AudioExtensions],[l.ChonkyIconName.terminal,["run","sh"]],[l.ChonkyIconName.trash,[".Trashes"]],[l.ChonkyIconName.users,["authors","contributors"]],[l.ChonkyIconName.linux,["AppImage"]],[l.ChonkyIconName.ubuntu,["deb"]],[l.ChonkyIconName.windows,["exe"]],[l.ChonkyIconName.rust,["rs","rlib"]],[l.ChonkyIconName.python,["py","ipynb"]],[l.ChonkyIconName.nodejs,["js","jsx","ts","tsx","d.ts"]],[l.ChonkyIconName.php,["php"]],[l.ChonkyIconName.git,[".gitignore"]],[l.ChonkyIconName.adobe,["psd"]],[l.ChonkyIconName.pdf,["pdf"]],[l.ChonkyIconName.excel,["xls","xlsx"]],[l.ChonkyIconName.word,["doc","docx","odt"]],[l.ChonkyIconName.flash,["swf"]]],r=new o.default({ignoreCase:!0}),i=0,a=n;i<a.length;i++)for(var u=a[i],c=u[0],s=u[1],f=0;f<s.length;++f){var d={icon:c,colorCode:(e+=5)%(t.ColorsLight.length-1)+1};r.put(s[f],d,!0)}return r}));t.useIconData=function(e){return a.useMemo((function(){if(!e)return{icon:l.ChonkyIconName.loading,colorCode:0};if(!0===e.isDir)return{icon:l.ChonkyIconName.folder,colorCode:0};var t=u().getWithCheckpoints(e.name,".",!0);return t||{icon:l.ChonkyIconName.file,colorCode:32}}),[e])},t.VideoExtensions=["3g2","3gp","3gpp","asf","asx","avi","dvb","f4v","fli","flv","fvt","h261","h263","h264","jpgm","jpgv","jpm","m1v","m2v","m4u","m4v","mj2","mjp2","mk3d","mks","mkv","mng","mov","movie","mp4","mp4v","mpe","mpeg","mpg","mpg4","mxu","ogv","pyv","qt","smv","ts","uvh","uvm","uvp","uvs","uvu","uvv","uvvh","uvvm","uvvp","uvvs","uvvu","uvvv","viv","vob","webm","wm","wmv","wmx","wvx"],t.ImageExtensions=["3ds","apng","azv","bmp","bmp","btif","cgm","cmx","djv","djvu","drle","dwg","dxf","emf","exr","fbs","fh","fh4","fh5","fh7","fhc","fits","fpx","fst","g3","gif","heic","heics","heif","heifs","ico","ico","ief","jls","jng","jp2","jpe","jpeg","jpf","jpg","jpg2","jpm","jpx","jxr","ktx","mdi","mmr","npx","pbm","pct","pcx","pcx","pgm","pic","png","pnm","ppm","psd","pti","ras","rgb","rlc","sgi","sid","sub","svg","svgz","t38","tap","tfx","tga","tif","tiff","uvg","uvi","uvvg","uvvi","vtf","wbmp","wdp","webp","wmf","xbm","xif","xpm","xwd"],t.AudioExtensions=["3gpp","aac","adp","aif","aifc","aiff","au","caf","dra","dts","dtshd","ecelp4800","ecelp7470","ecelp9600","eol","flac","kar","lvp","m2a","m3a","m3u","m4a","m4a","mid","midi","mka","mp2","mp2a","mp3","mp3","mp4a","mpga","oga","ogg","pya","ra","ra","ram","rip","rmi","rmp","s3m","sil","snd","spx","uva","uvva","wav","wav","wav","wax","weba","wma","xm"],t.ColorsLight=["#bbbbbb","#d65c5c","#d6665c","#d6705c","#d67a5c","#d6855c","#d68f5c","#d6995c","#d6a35c","#d6ad5c","#d6b85c","#d6c25c","#d6cc5c","#d6d65c","#ccd65c","#c2d65c","#b8d65c","#add65c","#a3d65c","#99d65c","#8fd65c","#85d65c","#7ad65c","#70d65c","#66d65c","#5cd65c","#5cd666","#5cd670","#5cd67a","#5cd685","#5cd68f","#5cd699","#5cd6a3","#5cd6ad","#5cd6b8","#5cd6c2","#5cd6cc","#5cd6d6","#5cccd6","#5cc2d6","#5cb8d6","#5cadd6","#5ca3d6","#5c99d6","#5c8fd6","#5c85d6","#5c7ad6","#5c70d6","#5c66d6","#5c5cd6","#665cd6","#705cd6","#7a5cd6","#855cd6","#8f5cd6","#995cd6","#a35cd6","#ad5cd6","#b85cd6","#c25cd6","#cc5cd6","#d65cd6","#d65ccc","#d65cc2","#d65cb8","#d65cad","#d65ca3","#d65c99","#d65c8f","#d65c85","#d65c7a","#d65c70","#d65c66"],t.ColorsDark=["#777","#8f3d3d","#8f443d","#8f4b3d","#8f523d","#8f583d","#8f5f3d","#8f663d","#8f6d3d","#8f743d","#8f7a3d","#8f813d","#8f883d","#8f8f3d","#888f3d","#818f3d","#7a8f3d","#748f3d","#6d8f3d","#668f3d","#5f8f3d","#588f3d","#528f3d","#4b8f3d","#448f3d","#3d8f3d","#3d8f44","#3d8f4b","#3d8f52","#3d8f58","#3d8f5f","#3d8f66","#3d8f6d","#3d8f74","#3d8f7a","#3d8f81","#3d8f88","#3d8f8f","#3d888f","#3d818f","#3d7a8f","#3d748f","#3d6d8f","#3d668f","#3d5f8f","#3d588f","#3d528f","#3d4b8f","#3d448f","#3d3d8f","#443d8f","#4b3d8f","#523d8f","#583d8f","#5f3d8f","#663d8f","#6d3d8f","#743d8f","#7a3d8f","#813d8f","#883d8f","#8f3d8f","#8f3d88","#8f3d81","#8f3d7a","#8f3d74","#8f3d6d","#8f3d66","#8f3d5f","#8f3d58","#8f3d52","#8f3d4b","#8f3d44"]},function(e,t,n){var r=n(244);e.exports=r},function(e,t,n){var r=n(129),o=n(125),i=function(){"use strict";function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(this,e),this.trie={},this.ignoreCase=void 0===t.ignoreCase||!!t.ignoreCase}return o(e,[{key:"put",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.ignoreCase&&(e=e.toLowerCase());var r=this.trie;if(n)for(var o=e.length-1;o>=0;--o){var i=e.charAt(o);r[i]||(r[i]={}),r=r[i]}else for(var a=0;a<e.length;++a){var l=e.charAt(a);r[l]||(r[l]={}),r=r[l]}return r.__=t,this}},{key:"putAll",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r="[object Array]"===toString.call(t),o=0;o<e.length;++o)this.put(e[o],r?t[o]:t,n);return this}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.ignoreCase&&(e=e.toLowerCase());var n=this.trie;if(t)for(var r=e.length-1;r>=0;--r){var o=e.charAt(r),i=n[o];if(!i)return;n=i}else for(var a=0;a<e.length;a++){var l=e.charAt(a),u=n[l];if(!u)return;n=u}return n.__}},{key:"getAll",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new Array(e.length),r=0;r<e.length;++r)n[r]=this.get(e[r],t);return n}},{key:"has",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return void 0!==this.get(e,t)}},{key:"hasAll",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new Array(e.length),r=0;r<e.length;++r)n[r]=this.has(e[r],t);return n}},{key:"getWithCheckpoints",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.ignoreCase&&(e=e.toLowerCase());var r=void 0,o=this.trie;if(n)for(var i=e.length-1;i>=0;--i){var a=e.charAt(i),l=o[a];if(!l)break;if(null===t||a===t){var u=o.__;u&&(r=u)}o=l}else for(var c=0;c<e.length;++c){var s=e.charAt(c),f=o[s];if(!f)break;if(s===t){var d=o.__;d&&(r=d)}o=f}var p=o.__;return p&&(r=p),r}},{key:"getAllWithCheckpoints",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=new Array(e.length),o=0;o<e.length;++o)r[o]=this.getWithCheckpoints(e[o],t,n);return r}},{key:"hasWithCheckpoints",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return void 0!==this.getWithCheckpoints(e,t,n)}},{key:"hasAllWithCheckpoints",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=new Array(e.length),o=0;o<e.length;++o)r[o]=this.hasWithCheckpoints(e[o],t,n);return r}}]),e}();e.exports=i},function(e,t,n){"use strict";var r=n(139),o=n(140),i=n(251);e.exports=function(e){var t,a=r(arguments[1]);return a.normalizer||0!==(t=a.length=o(a.length,e.length,a.async))&&(a.primitive?!1===t?a.normalizer=n(286):t>1&&(a.normalizer=n(287)(t)):a.normalizer=!1===t?n(288)():1===t?n(292)():n(293)(t)),a.async&&n(294),a.promise&&n(296),a.dispose&&n(302),a.maxAge&&n(303),a.max&&n(306),a.refCounter&&n(308),i(e,a)}},function(e,t,n){"use strict";e.exports=function(){}},function(e,t,n){"use strict";var r=n(248),o=Math.abs,i=Math.floor;e.exports=function(e){return isNaN(e)?0:0!==(e=Number(e))&&isFinite(e)?r(e)*i(o(e)):e}},function(e,t,n){"use strict";e.exports=n(249)()?Math.sign:n(250)},function(e,t,n){"use strict";e.exports=function(){var e=Math.sign;return"function"===typeof e&&(1===e(10)&&-1===e(-20))}},function(e,t,n){"use strict";e.exports=function(e){return e=Number(e),isNaN(e)||0===e?e:e>0?1:-1}},function(e,t,n){"use strict";var r=n(41),o=n(78),i=n(53),a=n(253),l=n(140);e.exports=function e(t){var n,u,c;if(r(t),(n=Object(arguments[1])).async&&n.promise)throw new Error("Options 'async' and 'promise' cannot be used together");return hasOwnProperty.call(t,"__memoized__")&&!n.force?t:(u=l(n.length,t.length,n.async&&i.async),c=a(t,u,n),o(i,(function(e,t){n[t]&&e(n[t],c,n)})),e.__profiler__&&e.__profiler__(c),c.updateEnv(),c.memoized)}},function(e,t,n){"use strict";var r=n(41),o=n(57),i=Function.prototype.bind,a=Function.prototype.call,l=Object.keys,u=Object.prototype.propertyIsEnumerable;e.exports=function(e,t){return function(n,c){var s,f=arguments[2],d=arguments[3];return n=Object(o(n)),r(c),s=l(n),d&&s.sort("function"===typeof d?i.call(d,n):void 0),"function"!==typeof e&&(e=s[e]),a.call(e,s,(function(e,r){return u.call(n,e)?a.call(c,f,n[e],e,n,r):t}))}}},function(e,t,n){"use strict";var r=n(254),o=n(142),i=n(54),a=n(268).methods,l=n(269),u=n(285),c=Function.prototype.apply,s=Function.prototype.call,f=Object.create,d=Object.defineProperties,p=a.on,h=a.emit;e.exports=function(e,t,n){var a,v,m,g,y,b,S,w,O,C,x,E,k,_,T,j=f(null);return v=!1!==t?t:isNaN(e.length)?1:e.length,n.normalizer&&(C=u(n.normalizer),m=C.get,g=C.set,y=C.delete,b=C.clear),null!=n.resolvers&&(T=l(n.resolvers)),_=m?o((function(t){var n,o,i=arguments;if(T&&(i=T(i)),null!==(n=m(i))&&hasOwnProperty.call(j,n))return x&&a.emit("get",n,i,this),j[n];if(o=1===i.length?s.call(e,this,i[0]):c.call(e,this,i),null===n){if(null!==(n=m(i)))throw r("Circular invocation","CIRCULAR_INVOCATION");n=g(i)}else if(hasOwnProperty.call(j,n))throw r("Circular invocation","CIRCULAR_INVOCATION");return j[n]=o,E&&a.emit("set",n,null,o),o}),v):0===t?function(){var t;if(hasOwnProperty.call(j,"data"))return x&&a.emit("get","data",arguments,this),j.data;if(t=arguments.length?c.call(e,this,arguments):s.call(e,this),hasOwnProperty.call(j,"data"))throw r("Circular invocation","CIRCULAR_INVOCATION");return j.data=t,E&&a.emit("set","data",null,t),t}:function(t){var n,o,i=arguments;if(T&&(i=T(arguments)),o=String(i[0]),hasOwnProperty.call(j,o))return x&&a.emit("get",o,i,this),j[o];if(n=1===i.length?s.call(e,this,i[0]):c.call(e,this,i),hasOwnProperty.call(j,o))throw r("Circular invocation","CIRCULAR_INVOCATION");return j[o]=n,E&&a.emit("set",o,null,n),n},a={original:e,memoized:_,profileName:n.profileName,get:function(e){return T&&(e=T(e)),m?m(e):String(e[0])},has:function(e){return hasOwnProperty.call(j,e)},delete:function(e){var t;hasOwnProperty.call(j,e)&&(y&&y(e),t=j[e],delete j[e],k&&a.emit("delete",e,t))},clear:function(){var e=j;b&&b(),j=f(null),a.emit("clear",e)},on:function(e,t){return"get"===e?x=!0:"set"===e?E=!0:"delete"===e&&(k=!0),p.call(this,e,t)},emit:h,updateEnv:function(){e=a.original}},S=m?o((function(e){var t,n=arguments;T&&(n=T(n)),null!==(t=m(n))&&a.delete(t)}),v):0===t?function(){return a.delete("data")}:function(e){return T&&(e=T(arguments)[0]),a.delete(e)},w=o((function(){var e,n=arguments;return 0===t?j.data:(T&&(n=T(n)),e=m?m(n):String(n[0]),j[e])})),O=o((function(){var e,n=arguments;return 0===t?a.has("data"):(T&&(n=T(n)),null!==(e=m?m(n):String(n[0]))&&a.has(e))})),d(_,{__memoized__:i(!0),delete:i(S),clear:i(a.clear),_get:i(w),_has:i(O)}),a}},function(e,t,n){"use strict";var r=n(141),o=n(260),i=n(51),a=Error.captureStackTrace;e.exports=function(t){var n=new Error(t),l=arguments[1],u=arguments[2];return i(u)||o(l)&&(u=l,l=null),i(u)&&r(n,u),i(l)&&(n.code=l),a&&a(n,e.exports),n}},function(e,t,n){"use strict";e.exports=function(){var e,t=Object.assign;return"function"===typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},function(e,t,n){"use strict";var r=n(257),o=n(57),i=Math.max;e.exports=function(e,t){var n,a,l,u=i(arguments.length,2);for(e=Object(o(e)),l=function(r){try{e[r]=t[r]}catch(o){n||(n=o)}},a=1;a<u;++a)r(t=arguments[a]).forEach(l);if(void 0!==n)throw n;return e}},function(e,t,n){"use strict";e.exports=n(258)()?Object.keys:n(259)},function(e,t,n){"use strict";e.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},function(e,t,n){"use strict";var r=n(51),o=Object.keys;e.exports=function(e){return o(r(e)?Object(e):e)}},function(e,t,n){"use strict";var r=n(51),o={function:!0,object:!0};e.exports=function(e){return r(e)&&o[typeof e]||!1}},function(e,t,n){"use strict";var r=n(262),o=/^\s*class[\s{/}]/,i=Function.prototype.toString;e.exports=function(e){return!!r(e)&&!o.test(i.call(e))}},function(e,t,n){"use strict";var r=n(263);e.exports=function(e){if("function"!==typeof e)return!1;if(!hasOwnProperty.call(e,"length"))return!1;try{if("number"!==typeof e.length)return!1;if("function"!==typeof e.call)return!1;if("function"!==typeof e.apply)return!1}catch(t){return!1}return!r(e)}},function(e,t,n){"use strict";var r=n(264);e.exports=function(e){if(!r(e))return!1;try{return!!e.constructor&&e.constructor.prototype===e}catch(t){return!1}}},function(e,t,n){"use strict";var r=n(144),o={object:!0,function:!0,undefined:!0};e.exports=function(e){return!!r(e)&&hasOwnProperty.call(o,typeof e)}},function(e,t,n){"use strict";e.exports=n(266)()?String.prototype.contains:n(267)},function(e,t,n){"use strict";var r="razdwatrzy";e.exports=function(){return"function"===typeof r.contains&&(!0===r.contains("dwa")&&!1===r.contains("foo"))}},function(e,t,n){"use strict";var r=String.prototype.indexOf;e.exports=function(e){return r.call(this,e,arguments[1])>-1}},function(e,t,n){"use strict";var r,o,i,a,l,u,c,s=n(54),f=n(41),d=Function.prototype.apply,p=Function.prototype.call,h=Object.create,v=Object.defineProperty,m=Object.defineProperties,g=Object.prototype.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0};o=function(e,t){var n,o;return f(t),o=this,r.call(this,e,n=function(){i.call(o,e,n),d.call(t,this,arguments)}),n.__eeOnceListener__=t,this},l={on:r=function(e,t){var n;return f(t),g.call(this,"__ee__")?n=this.__ee__:(n=y.value=h(null),v(this,"__ee__",y),y.value=null),n[e]?"object"===typeof n[e]?n[e].push(t):n[e]=[n[e],t]:n[e]=t,this},once:o,off:i=function(e,t){var n,r,o,i;if(f(t),!g.call(this,"__ee__"))return this;if(!(n=this.__ee__)[e])return this;if("object"===typeof(r=n[e]))for(i=0;o=r[i];++i)o!==t&&o.__eeOnceListener__!==t||(2===r.length?n[e]=r[i?0:1]:r.splice(i,1));else r!==t&&r.__eeOnceListener__!==t||delete n[e];return this},emit:a=function(e){var t,n,r,o,i;if(g.call(this,"__ee__")&&(o=this.__ee__[e]))if("object"===typeof o){for(n=arguments.length,i=new Array(n-1),t=1;t<n;++t)i[t-1]=arguments[t];for(o=o.slice(),t=0;r=o[t];++t)d.call(r,this,i)}else switch(arguments.length){case 1:p.call(o,this);break;case 2:p.call(o,this,arguments[1]);break;case 3:p.call(o,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,i=new Array(n-1),t=1;t<n;++t)i[t-1]=arguments[t];d.call(o,this,i)}}},u={on:s(r),once:s(o),off:s(i),emit:s(a)},c=m({},u),e.exports=t=function(e){return null==e?h(c):m(Object(e),u)},t.methods=l},function(e,t,n){"use strict";var r,o=n(270),i=n(51),a=n(41),l=Array.prototype.slice;r=function(e){return this.map((function(t,n){return t?t(e[n]):e[n]})).concat(l.call(e,this.length))},e.exports=function(e){return(e=o(e)).forEach((function(e){i(e)&&a(e)})),r.bind(e)}},function(e,t,n){"use strict";var r=n(106),o=Array.isArray;e.exports=function(e){return o(e)?e:r(e)}},function(e,t,n){"use strict";e.exports=function(){var e,t,n=Array.from;return"function"===typeof n&&(t=n(e=["raz","dwa"]),Boolean(t&&t!==e&&"dwa"===t[1]))}},function(e,t,n){"use strict";var r=n(273).iterator,o=n(282),i=n(283),a=n(52),l=n(41),u=n(57),c=n(51),s=n(284),f=Array.isArray,d=Function.prototype.call,p={configurable:!0,enumerable:!0,writable:!0,value:null},h=Object.defineProperty;e.exports=function(e){var t,n,v,m,g,y,b,S,w,O,C=arguments[1],x=arguments[2];if(e=Object(u(e)),c(C)&&l(C),this&&this!==Array&&i(this))t=this;else{if(!C){if(o(e))return 1!==(g=e.length)?Array.apply(null,e):((m=new Array(1))[0]=e[0],m);if(f(e)){for(m=new Array(g=e.length),n=0;n<g;++n)m[n]=e[n];return m}}m=[]}if(!f(e))if(void 0!==(w=e[r])){for(b=l(w).call(e),t&&(m=new t),S=b.next(),n=0;!S.done;)O=C?d.call(C,x,S.value,n):S.value,t?(p.value=O,h(m,n,p)):m[n]=O,S=b.next(),++n;g=n}else if(s(e)){for(g=e.length,t&&(m=new t),n=0,v=0;n<g;++n)O=e[n],n+1<g&&(y=O.charCodeAt(0))>=55296&&y<=56319&&(O+=e[++n]),O=C?d.call(C,x,O,v):O,t?(p.value=O,h(m,v,p)):m[v]=O,++v;g=v}if(void 0===g)for(g=a(e.length),t&&(m=new t(g)),n=0;n<g;++n)O=C?d.call(C,x,e[n],n):e[n],t?(p.value=O,h(m,n,p)):m[n]=O;return t&&(p.value=null,m.length=g),m}},function(e,t,n){"use strict";e.exports=n(274)()?n(79).Symbol:n(277)},function(e,t,n){"use strict";var r=n(79),o={object:!0,symbol:!0};e.exports=function(){var e,t=r.Symbol;if("function"!==typeof t)return!1;e=t("test symbol");try{String(e)}catch(n){return!1}return!!o[typeof t.iterator]&&(!!o[typeof t.toPrimitive]&&!!o[typeof t.toStringTag])}},function(e,t,n){"use strict";e.exports=function(){return"object"===typeof globalThis&&(!!globalThis&&globalThis.Array===Array)}},function(e,t){var n=function(){if("object"===typeof self&&self)return self;if("object"===typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(e){return n()}try{return __global__||n()}finally{delete Object.prototype.__global__}}()},function(e,t,n){"use strict";var r,o,i,a=n(54),l=n(145),u=n(79).Symbol,c=n(279),s=n(280),f=n(281),d=Object.create,p=Object.defineProperties,h=Object.defineProperty;if("function"===typeof u)try{String(u()),i=!0}catch(v){}else u=null;o=function(e){if(this instanceof o)throw new TypeError("Symbol is not a constructor");return r(e)},e.exports=r=function e(t){var n;if(this instanceof e)throw new TypeError("Symbol is not a constructor");return i?u(t):(n=d(o.prototype),t=void 0===t?"":String(t),p(n,{__description__:a("",t),__name__:a("",c(t))}))},s(r),f(r),p(o.prototype,{constructor:a(r),toString:a("",(function(){return this.__name__}))}),p(r.prototype,{toString:a((function(){return"Symbol ("+l(this).__description__+")"})),valueOf:a((function(){return l(this)}))}),h(r.prototype,r.toPrimitive,a("",(function(){var e=l(this);return"symbol"===typeof e?e:e.toString()}))),h(r.prototype,r.toStringTag,a("c","Symbol")),h(o.prototype,r.toStringTag,a("c",r.prototype[r.toStringTag])),h(o.prototype,r.toPrimitive,a("c",r.prototype[r.toPrimitive]))},function(e,t,n){"use strict";e.exports=function(e){return!!e&&("symbol"===typeof e||!!e.constructor&&("Symbol"===e.constructor.name&&"Symbol"===e[e.constructor.toStringTag]))}},function(e,t,n){"use strict";var r=n(54),o=Object.create,i=Object.defineProperty,a=Object.prototype,l=o(null);e.exports=function(e){for(var t,n,o=0;l[e+(o||"")];)++o;return l[e+=o||""]=!0,i(a,t="@@"+e,r.gs(null,(function(e){n||(n=!0,i(this,t,r(e)),n=!1)}))),t}},function(e,t,n){"use strict";var r=n(54),o=n(79).Symbol;e.exports=function(e){return Object.defineProperties(e,{hasInstance:r("",o&&o.hasInstance||e("hasInstance")),isConcatSpreadable:r("",o&&o.isConcatSpreadable||e("isConcatSpreadable")),iterator:r("",o&&o.iterator||e("iterator")),match:r("",o&&o.match||e("match")),replace:r("",o&&o.replace||e("replace")),search:r("",o&&o.search||e("search")),species:r("",o&&o.species||e("species")),split:r("",o&&o.split||e("split")),toPrimitive:r("",o&&o.toPrimitive||e("toPrimitive")),toStringTag:r("",o&&o.toStringTag||e("toStringTag")),unscopables:r("",o&&o.unscopables||e("unscopables"))})}},function(e,t,n){"use strict";var r=n(54),o=n(145),i=Object.create(null);e.exports=function(e){return Object.defineProperties(e,{for:r((function(t){return i[t]?i[t]:i[t]=e(String(t))})),keyFor:r((function(e){var t;for(t in o(e),i)if(i[t]===e)return t}))})}},function(e,t,n){"use strict";var r=Object.prototype.toString,o=r.call(function(){return arguments}());e.exports=function(e){return r.call(e)===o}},function(e,t,n){"use strict";var r=Object.prototype.toString,o=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);e.exports=function(e){return"function"===typeof e&&o(r.call(e))}},function(e,t,n){"use strict";var r=Object.prototype.toString,o=r.call("");e.exports=function(e){return"string"===typeof e||e&&"object"===typeof e&&(e instanceof String||r.call(e)===o)||!1}},function(e,t,n){"use strict";var r=n(41);e.exports=function(e){var t;return"function"===typeof e?{set:e,get:e}:(t={get:r(e.get)},void 0!==e.set?(t.set=r(e.set),e.delete&&(t.delete=r(e.delete)),e.clear&&(t.clear=r(e.clear)),t):(t.set=t.get,t))}},function(e,t,n){"use strict";e.exports=function(e){var t,n,r=e.length;if(!r)return"\x02";for(t=String(e[n=0]);--r;)t+="\x01"+e[++n];return t}},function(e,t,n){"use strict";e.exports=function(e){return e?function(t){for(var n=String(t[0]),r=0,o=e;--o;)n+="\x01"+t[++r];return n}:function(){return""}}},function(e,t,n){"use strict";var r=n(107),o=Object.create;e.exports=function(){var e=0,t=[],n=o(null);return{get:function(e){var n,o=0,i=t,a=e.length;if(0===a)return i[a]||null;if(i=i[a]){for(;o<a-1;){if(-1===(n=r.call(i[0],e[o])))return null;i=i[1][n],++o}return-1===(n=r.call(i[0],e[o]))?null:i[1][n]||null}return null},set:function(o){var i,a=0,l=t,u=o.length;if(0===u)l[u]=++e;else{for(l[u]||(l[u]=[[],[]]),l=l[u];a<u-1;)-1===(i=r.call(l[0],o[a]))&&(i=l[0].push(o[a])-1,l[1].push([[],[]])),l=l[1][i],++a;-1===(i=r.call(l[0],o[a]))&&(i=l[0].push(o[a])-1),l[1][i]=++e}return n[e]=o,e},delete:function(e){var o,i=0,a=t,l=n[e],u=l.length,c=[];if(0===u)delete a[u];else if(a=a[u]){for(;i<u-1;){if(-1===(o=r.call(a[0],l[i])))return;c.push(a,o),a=a[1][o],++i}if(-1===(o=r.call(a[0],l[i])))return;for(e=a[1][o],a[0].splice(o,1),a[1].splice(o,1);!a[0].length&&c.length;)o=c.pop(),(a=c.pop())[0].splice(o,1),a[1].splice(o,1)}delete n[e]},clear:function(){t=[],n=o(null)}}}},function(e,t,n){"use strict";e.exports=n(290)()?Number.isNaN:n(291)},function(e,t,n){"use strict";e.exports=function(){var e=Number.isNaN;return"function"===typeof e&&(!e({})&&e(NaN)&&!e(34))}},function(e,t,n){"use strict";e.exports=function(e){return e!==e}},function(e,t,n){"use strict";var r=n(107);e.exports=function(){var e=0,t=[],n=[];return{get:function(e){var o=r.call(t,e[0]);return-1===o?null:n[o]},set:function(r){return t.push(r[0]),n.push(++e),e},delete:function(e){var o=r.call(n,e);-1!==o&&(t.splice(o,1),n.splice(o,1))},clear:function(){t=[],n=[]}}}},function(e,t,n){"use strict";var r=n(107),o=Object.create;e.exports=function(e){var t=0,n=[[],[]],i=o(null);return{get:function(t){for(var o,i=0,a=n;i<e-1;){if(-1===(o=r.call(a[0],t[i])))return null;a=a[1][o],++i}return-1===(o=r.call(a[0],t[i]))?null:a[1][o]||null},set:function(o){for(var a,l=0,u=n;l<e-1;)-1===(a=r.call(u[0],o[l]))&&(a=u[0].push(o[l])-1,u[1].push([[],[]])),u=u[1][a],++l;return-1===(a=r.call(u[0],o[l]))&&(a=u[0].push(o[l])-1),u[1][a]=++t,i[t]=o,t},delete:function(t){for(var o,a=0,l=n,u=[],c=i[t];a<e-1;){if(-1===(o=r.call(l[0],c[a])))return;u.push(l,o),l=l[1][o],++a}if(-1!==(o=r.call(l[0],c[a]))){for(t=l[1][o],l[0].splice(o,1),l[1].splice(o,1);!l[0].length&&u.length;)o=u.pop(),(l=u.pop())[0].splice(o,1),l[1].splice(o,1);delete i[t]}},clear:function(){n=[[],[]],i=o(null)}}}},function(e,t,n){"use strict";var r=n(106),o=n(146),i=n(143),a=n(142),l=n(108),u=Array.prototype.slice,c=Function.prototype.apply,s=Object.create;n(53).async=function(e,t){var n,f,d,p=s(null),h=s(null),v=t.memoized,m=t.original;t.memoized=a((function(e){var t=arguments,r=t[t.length-1];return"function"===typeof r&&(n=r,t=u.call(t,0,-1)),v.apply(f=this,d=t)}),v);try{i(t.memoized,v)}catch(g){}t.on("get",(function(e){var r,o,i;if(n){if(p[e])return"function"===typeof p[e]?p[e]=[p[e],n]:p[e].push(n),void(n=null);r=n,o=f,i=d,n=f=d=null,l((function(){var a;hasOwnProperty.call(h,e)?(a=h[e],t.emit("getasync",e,i,o),c.call(r,a.context,a.args)):(n=r,f=o,d=i,v.apply(o,i))}))}})),t.original=function(){var e,o,i,a;return n?(e=r(arguments),o=function e(n){var o,i,u=e.id;if(null!=u){if(delete e.id,o=p[u],delete p[u],o)return i=r(arguments),t.has(u)&&(n?t.delete(u):(h[u]={context:this,args:i},t.emit("setasync",u,"function"===typeof o?1:o.length))),"function"===typeof o?a=c.call(o,this,i):o.forEach((function(e){a=c.call(e,this,i)}),this),a}else l(c.bind(e,this,arguments))},i=n,n=f=d=null,e.push(o),a=c.call(m,this,e),o.cb=i,n=o,a):c.call(m,this,arguments)},t.on("set",(function(e){n?(p[e]?"function"===typeof p[e]?p[e]=[p[e],n.cb]:p[e].push(n.cb):p[e]=n.cb,delete n.cb,n.id=e,n=null):t.delete(e)})),t.on("delete",(function(e){var n;hasOwnProperty.call(p,e)||h[e]&&(n=h[e],delete h[e],t.emit("deleteasync",e,u.call(n.args,1)))})),t.on("clear",(function(){var e=h;h=s(null),t.emit("clearasync",o(e,(function(e){return u.call(e.args,1)})))}))}},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o=1,i={},a=!1,l=e.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(e);u=u&&u.setTimeout?u:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){s(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?function(){var t="setImmediate$"+Math.random()+"$",n=function(n){n.source===e&&"string"===typeof n.data&&0===n.data.indexOf(t)&&s(+n.data.slice(t.length))};e.addEventListener?e.addEventListener("message",n,!1):e.attachEvent("onmessage",n),r=function(n){e.postMessage(t+n,"*")}}():e.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){s(e.data)},r=function(t){e.port2.postMessage(t)}}():l&&"onreadystatechange"in l.createElement("script")?function(){var e=l.documentElement;r=function(t){var n=l.createElement("script");n.onreadystatechange=function(){s(t),n.onreadystatechange=null,e.removeChild(n),n=null},e.appendChild(n)}}():r=function(e){setTimeout(s,0,e)},u.setImmediate=function(e){"function"!==typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var a={callback:e,args:t};return i[o]=a,r(o),o++},u.clearImmediate=c}function c(e){delete i[e]}function s(e){if(a)setTimeout(s,0,e);else{var t=i[e];if(t){a=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{c(e),a=!1}}}}}("undefined"===typeof self?"undefined"===typeof e?this:e:self)}).call(this,n(35),n(109))},function(e,t,n){"use strict";var r=n(146),o=n(297),i=n(298),a=n(300),l=n(149),u=n(108),c=Object.create,s=o("then","then:finally","done","done:finally");n(53).promise=function(e,t){var n=c(null),o=c(null),f=c(null);if(!0===e)e=null;else if(e=i(e),!s[e])throw new TypeError("'"+a(e)+"' is not valid promise mode");t.on("set",(function(r,i,a){var c=!1;if(!l(a))return o[r]=a,void t.emit("setasync",r,1);n[r]=1,f[r]=a;var s=function(e){var i=n[r];if(c)throw new Error("Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in 'done:finally' mode)\nConsider to rely on 'then' or 'done' mode instead.");i&&(delete n[r],o[r]=e,t.emit("setasync",r,i))},d=function(){c=!0,n[r]&&(delete n[r],delete f[r],t.delete(r))},p=e;if(p||(p="then"),"then"===p){var h=function(){u(d)};"function"===typeof(a=a.then((function(e){u(s.bind(this,e))}),h)).finally&&a.finally(h)}else if("done"===p){if("function"!==typeof a.done)throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");a.done(s,d)}else if("done:finally"===p){if("function"!==typeof a.done)throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if("function"!==typeof a.finally)throw new Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");a.done(s),a.finally(d)}})),t.on("get",(function(e,r,o){var i;if(n[e])++n[e];else{i=f[e];var a=function(){t.emit("getasync",e,r,o)};l(i)?"function"===typeof i.done?i.done(a):i.then((function(){u(a)})):a()}})),t.on("delete",(function(e){if(delete f[e],n[e])delete n[e];else if(hasOwnProperty.call(o,e)){var r=o[e];delete o[e],t.emit("deleteasync",e,[r])}})),t.on("clear",(function(){var e=o;o=c(null),n=c(null),f=c(null),t.emit("clearasync",r(e,(function(e){return[e]})))}))}},function(e,t,n){"use strict";var r=Array.prototype.forEach,o=Object.create;e.exports=function(e){var t=o(null);return r.call(arguments,(function(e){t[e]=!0})),t}},function(e,t,n){"use strict";var r=n(57),o=n(299);e.exports=function(e){return o(r(e))}},function(e,t,n){"use strict";var r=n(148);e.exports=function(e){try{return e&&r(e.toString)?e.toString():String(e)}catch(t){throw new TypeError("Passed argument cannot be stringifed")}}},function(e,t,n){"use strict";var r=n(301),o=/[\n\r\u2028\u2029]/g;e.exports=function(e){var t=r(e);return t.length>100&&(t=t.slice(0,99)+"\u2026"),t=t.replace(o,(function(e){return JSON.stringify(e).slice(1,-1)}))}},function(e,t,n){"use strict";var r=n(148);e.exports=function(e){try{return e&&r(e.toString)?e.toString():String(e)}catch(t){return"<Non-coercible to string value>"}}},function(e,t,n){"use strict";var r=n(41),o=n(78),i=n(53),a=Function.prototype.apply;i.dispose=function(e,t,n){var l;if(r(e),n.async&&i.async||n.promise&&i.promise)return t.on("deleteasync",l=function(t,n){a.call(e,null,n)}),void t.on("clearasync",(function(e){o(e,(function(e,t){l(t,e)}))}));t.on("delete",l=function(t,n){e(n)}),t.on("clear",(function(e){o(e,(function(e,t){l(t,e)}))}))}},function(e,t,n){"use strict";var r=n(106),o=n(78),i=n(108),a=n(149),l=n(304),u=n(53),c=Function.prototype,s=Math.max,f=Math.min,d=Object.create;u.maxAge=function(e,t,n){var p,h,v,m;(e=l(e))&&(p=d(null),h=n.async&&u.async||n.promise&&u.promise?"async":"",t.on("set"+h,(function(n){p[n]=setTimeout((function(){t.delete(n)}),e),"function"===typeof p[n].unref&&p[n].unref(),m&&(m[n]&&"nextTick"!==m[n]&&clearTimeout(m[n]),m[n]=setTimeout((function(){delete m[n]}),v),"function"===typeof m[n].unref&&m[n].unref())})),t.on("delete"+h,(function(e){clearTimeout(p[e]),delete p[e],m&&("nextTick"!==m[e]&&clearTimeout(m[e]),delete m[e])})),n.preFetch&&(v=!0===n.preFetch||isNaN(n.preFetch)?.333:s(f(Number(n.preFetch),1),0))&&(m={},v=(1-v)*e,t.on("get"+h,(function(e,o,l){m[e]||(m[e]="nextTick",i((function(){var i;"nextTick"===m[e]&&(delete m[e],t.delete(e),n.async&&(o=r(o)).push(c),i=t.memoized.apply(l,o),n.promise&&a(i)&&("function"===typeof i.done?i.done(c,c):i.then(c,c)))})))}))),t.on("clear"+h,(function(){o(p,(function(e){clearTimeout(e)})),p={},m&&(o(m,(function(e){"nextTick"!==e&&clearTimeout(e)})),m={})})))}},function(e,t,n){"use strict";var r=n(52),o=n(305);e.exports=function(e){if((e=r(e))>o)throw new TypeError(e+" exceeds maximum possible timeout");return e}},function(e,t,n){"use strict";e.exports=2147483647},function(e,t,n){"use strict";var r=n(52),o=n(307),i=n(53);i.max=function(e,t,n){var a,l,u;(e=r(e))&&(l=o(e),a=n.async&&i.async||n.promise&&i.promise?"async":"",t.on("set"+a,u=function(e){void 0!==(e=l.hit(e))&&t.delete(e)}),t.on("get"+a,u),t.on("delete"+a,l.delete),t.on("clear"+a,l.clear))}},function(e,t,n){"use strict";var r=n(52),o=Object.create,i=Object.prototype.hasOwnProperty;e.exports=function(e){var t,n=0,a=1,l=o(null),u=o(null),c=0;return e=r(e),{hit:function(r){var o=u[r],s=++c;if(l[s]=r,u[r]=s,!o){if(++n<=e)return;return r=l[a],t(r),r}if(delete l[o],a===o)for(;!i.call(l,++a););},delete:t=function(e){var t=u[e];if(t&&(delete l[t],delete u[e],--n,a===t)){if(!n)return c=0,void(a=1);for(;!i.call(l,++a););}},clear:function(){n=0,a=1,l=o(null),u=o(null),c=0}}}},function(e,t,n){"use strict";var r=n(54),o=n(53),i=Object.create,a=Object.defineProperties;o.refCounter=function(e,t,n){var l,u;l=i(null),u=n.async&&o.async||n.promise&&o.promise?"async":"",t.on("set"+u,(function(e,t){l[e]=t||1})),t.on("get"+u,(function(e){++l[e]})),t.on("delete"+u,(function(e){delete l[e]})),t.on("clear"+u,(function(){l={}})),a(t.memoized,{deleteRef:r((function(){var e=t.get(arguments);return null===e?null:l[e]?!--l[e]&&(t.delete(e),!0):null})),getRefCount:r((function(){var e=t.get(arguments);return null===e?0:l[e]?l[e]:0}))})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M315.5 64h170.9v384L315.5 64zm-119 0H25.6v384L196.5 64zM256 206.1L363.5 448h-73l-30.7-76.8h-78.7L256 206.1z";t.definition={prefix:"fab",iconName:"adobe",icon:[512,512,r,"f778",o]},t.faAdobe=t.definition,t.prefix="fab",t.iconName="adobe",t.width=512,t.height=512,t.ligatures=r,t.unicode="f778",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M439.55 236.05L244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z";t.definition={prefix:"fab",iconName:"git-alt",icon:[448,512,r,"f841",o]},t.faGitAlt=t.definition,t.prefix="fab",t.iconName="git-alt",t.width=448,t.height=512,t.ligatures=r,t.unicode="f841",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M220.8 123.3c1 .5 1.8 1.7 3 1.7 1.1 0 2.8-.4 2.9-1.5.2-1.4-1.9-2.3-3.2-2.9-1.7-.7-3.9-1-5.5-.1-.4.2-.8.7-.6 1.1.3 1.3 2.3 1.1 3.4 1.7zm-21.9 1.7c1.2 0 2-1.2 3-1.7 1.1-.6 3.1-.4 3.5-1.6.2-.4-.2-.9-.6-1.1-1.6-.9-3.8-.6-5.5.1-1.3.6-3.4 1.5-3.2 2.9.1 1 1.8 1.5 2.8 1.4zM420 403.8c-3.6-4-5.3-11.6-7.2-19.7-1.8-8.1-3.9-16.8-10.5-22.4-1.3-1.1-2.6-2.1-4-2.9-1.3-.8-2.7-1.5-4.1-2 9.2-27.3 5.6-54.5-3.7-79.1-11.4-30.1-31.3-56.4-46.5-74.4-17.1-21.5-33.7-41.9-33.4-72C311.1 85.4 315.7.1 234.8 0 132.4-.2 158 103.4 156.9 135.2c-1.7 23.4-6.4 41.8-22.5 64.7-18.9 22.5-45.5 58.8-58.1 96.7-6 17.9-8.8 36.1-6.2 53.3-6.5 5.8-11.4 14.7-16.6 20.2-4.2 4.3-10.3 5.9-17 8.3s-14 6-18.5 14.5c-2.1 3.9-2.8 8.1-2.8 12.4 0 3.9.6 7.9 1.2 11.8 1.2 8.1 2.5 15.7.8 20.8-5.2 14.4-5.9 24.4-2.2 31.7 3.8 7.3 11.4 10.5 20.1 12.3 17.3 3.6 40.8 2.7 59.3 12.5 19.8 10.4 39.9 14.1 55.9 10.4 11.6-2.6 21.1-9.6 25.9-20.2 12.5-.1 26.3-5.4 48.3-6.6 14.9-1.2 33.6 5.3 55.1 4.1.6 2.3 1.4 4.6 2.5 6.7v.1c8.3 16.7 23.8 24.3 40.3 23 16.6-1.3 34.1-11 48.3-27.9 13.6-16.4 36-23.2 50.9-32.2 7.4-4.5 13.4-10.1 13.9-18.3.4-8.2-4.4-17.3-15.5-29.7zM223.7 87.3c9.8-22.2 34.2-21.8 44-.4 6.5 14.2 3.6 30.9-4.3 40.4-1.6-.8-5.9-2.6-12.6-4.9 1.1-1.2 3.1-2.7 3.9-4.6 4.8-11.8-.2-27-9.1-27.3-7.3-.5-13.9 10.8-11.8 23-4.1-2-9.4-3.5-13-4.4-1-6.9-.3-14.6 2.9-21.8zM183 75.8c10.1 0 20.8 14.2 19.1 33.5-3.5 1-7.1 2.5-10.2 4.6 1.2-8.9-3.3-20.1-9.6-19.6-8.4.7-9.8 21.2-1.8 28.1 1 .8 1.9-.2-5.9 5.5-15.6-14.6-10.5-52.1 8.4-52.1zm-13.6 60.7c6.2-4.6 13.6-10 14.1-10.5 4.7-4.4 13.5-14.2 27.9-14.2 7.1 0 15.6 2.3 25.9 8.9 6.3 4.1 11.3 4.4 22.6 9.3 8.4 3.5 13.7 9.7 10.5 18.2-2.6 7.1-11 14.4-22.7 18.1-11.1 3.6-19.8 16-38.2 14.9-3.9-.2-7-1-9.6-2.1-8-3.5-12.2-10.4-20-15-8.6-4.8-13.2-10.4-14.7-15.3-1.4-4.9 0-9 4.2-12.3zm3.3 334c-2.7 35.1-43.9 34.4-75.3 18-29.9-15.8-68.6-6.5-76.5-21.9-2.4-4.7-2.4-12.7 2.6-26.4v-.2c2.4-7.6.6-16-.6-23.9-1.2-7.8-1.8-15 .9-20 3.5-6.7 8.5-9.1 14.8-11.3 10.3-3.7 11.8-3.4 19.6-9.9 5.5-5.7 9.5-12.9 14.3-18 5.1-5.5 10-8.1 17.7-6.9 8.1 1.2 15.1 6.8 21.9 16l19.6 35.6c9.5 19.9 43.1 48.4 41 68.9zm-1.4-25.9c-4.1-6.6-9.6-13.6-14.4-19.6 7.1 0 14.2-2.2 16.7-8.9 2.3-6.2 0-14.9-7.4-24.9-13.5-18.2-38.3-32.5-38.3-32.5-13.5-8.4-21.1-18.7-24.6-29.9s-3-23.3-.3-35.2c5.2-22.9 18.6-45.2 27.2-59.2 2.3-1.7.8 3.2-8.7 20.8-8.5 16.1-24.4 53.3-2.6 82.4.6-20.7 5.5-41.8 13.8-61.5 12-27.4 37.3-74.9 39.3-112.7 1.1.8 4.6 3.2 6.2 4.1 4.6 2.7 8.1 6.7 12.6 10.3 12.4 10 28.5 9.2 42.4 1.2 6.2-3.5 11.2-7.5 15.9-9 9.9-3.1 17.8-8.6 22.3-15 7.7 30.4 25.7 74.3 37.2 95.7 6.1 11.4 18.3 35.5 23.6 64.6 3.3-.1 7 .4 10.9 1.4 13.8-35.7-11.7-74.2-23.3-84.9-4.7-4.6-4.9-6.6-2.6-6.5 12.6 11.2 29.2 33.7 35.2 59 2.8 11.6 3.3 23.7.4 35.7 16.4 6.8 35.9 17.9 30.7 34.8-2.2-.1-3.2 0-4.2 0 3.2-10.1-3.9-17.6-22.8-26.1-19.6-8.6-36-8.6-38.3 12.5-12.1 4.2-18.3 14.7-21.4 27.3-2.8 11.2-3.6 24.7-4.4 39.9-.5 7.7-3.6 18-6.8 29-32.1 22.9-76.7 32.9-114.3 7.2zm257.4-11.5c-.9 16.8-41.2 19.9-63.2 46.5-13.2 15.7-29.4 24.4-43.6 25.5s-26.5-4.8-33.7-19.3c-4.7-11.1-2.4-23.1 1.1-36.3 3.7-14.2 9.2-28.8 9.9-40.6.8-15.2 1.7-28.5 4.2-38.7 2.6-10.3 6.6-17.2 13.7-21.1.3-.2.7-.3 1-.5.8 13.2 7.3 26.6 18.8 29.5 12.6 3.3 30.7-7.5 38.4-16.3 9-.3 15.7-.9 22.6 5.1 9.9 8.5 7.1 30.3 17.1 41.6 10.6 11.6 14 19.5 13.7 24.6zM173.3 148.7c2 1.9 4.7 4.5 8 7.1 6.6 5.2 15.8 10.6 27.3 10.6 11.6 0 22.5-5.9 31.8-10.8 4.9-2.6 10.9-7 14.8-10.4s5.9-6.3 3.1-6.6-2.6 2.6-6 5.1c-4.4 3.2-9.7 7.4-13.9 9.8-7.4 4.2-19.5 10.2-29.9 10.2s-18.7-4.8-24.9-9.7c-3.1-2.5-5.7-5-7.7-6.9-1.5-1.4-1.9-4.6-4.3-4.9-1.4-.1-1.8 3.7 1.7 6.5z";t.definition={prefix:"fab",iconName:"linux",icon:[448,512,r,"f17c",o]},t.faLinux=t.definition,t.prefix="fab",t.iconName="linux",t.width=448,t.height=512,t.ligatures=r,t.unicode="f17c",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M224 508c-6.7 0-13.5-1.8-19.4-5.2l-61.7-36.5c-9.2-5.2-4.7-7-1.7-8 12.3-4.3 14.8-5.2 27.9-12.7 1.4-.8 3.2-.5 4.6.4l47.4 28.1c1.7 1 4.1 1 5.7 0l184.7-106.6c1.7-1 2.8-3 2.8-5V149.3c0-2.1-1.1-4-2.9-5.1L226.8 37.7c-1.7-1-4-1-5.7 0L36.6 144.3c-1.8 1-2.9 3-2.9 5.1v213.1c0 2 1.1 4 2.9 4.9l50.6 29.2c27.5 13.7 44.3-2.4 44.3-18.7V167.5c0-3 2.4-5.3 5.4-5.3h23.4c2.9 0 5.4 2.3 5.4 5.3V378c0 36.6-20 57.6-54.7 57.6-10.7 0-19.1 0-42.5-11.6l-48.4-27.9C8.1 389.2.7 376.3.7 362.4V149.3c0-13.8 7.4-26.8 19.4-33.7L204.6 9c11.7-6.6 27.2-6.6 38.8 0l184.7 106.7c12 6.9 19.4 19.8 19.4 33.7v213.1c0 13.8-7.4 26.7-19.4 33.7L243.4 502.8c-5.9 3.4-12.6 5.2-19.4 5.2zm149.1-210.1c0-39.9-27-50.5-83.7-58-57.4-7.6-63.2-11.5-63.2-24.9 0-11.1 4.9-25.9 47.4-25.9 37.9 0 51.9 8.2 57.7 33.8.5 2.4 2.7 4.2 5.2 4.2h24c1.5 0 2.9-.6 3.9-1.7s1.5-2.6 1.4-4.1c-3.7-44.1-33-64.6-92.2-64.6-52.7 0-84.1 22.2-84.1 59.5 0 40.4 31.3 51.6 81.8 56.6 60.5 5.9 65.2 14.8 65.2 26.7 0 20.6-16.6 29.4-55.5 29.4-48.9 0-59.6-12.3-63.2-36.6-.4-2.6-2.6-4.5-5.3-4.5h-23.9c-3 0-5.3 2.4-5.3 5.3 0 31.1 16.9 68.2 97.8 68.2 58.4-.1 92-23.2 92-63.4z";t.definition={prefix:"fab",iconName:"node-js",icon:[448,512,r,"f3d3",o]},t.faNodeJs=t.definition,t.prefix="fab",t.iconName="node-js",t.width=448,t.height=512,t.ligatures=r,t.unicode="f3d3",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M320 104.5c171.4 0 303.2 72.2 303.2 151.5S491.3 407.5 320 407.5c-171.4 0-303.2-72.2-303.2-151.5S148.7 104.5 320 104.5m0-16.8C143.3 87.7 0 163 0 256s143.3 168.3 320 168.3S640 349 640 256 496.7 87.7 320 87.7zM218.2 242.5c-7.9 40.5-35.8 36.3-70.1 36.3l13.7-70.6c38 0 63.8-4.1 56.4 34.3zM97.4 350.3h36.7l8.7-44.8c41.1 0 66.6 3 90.2-19.1 26.1-24 32.9-66.7 14.3-88.1-9.7-11.2-25.3-16.7-46.5-16.7h-70.7L97.4 350.3zm185.7-213.6h36.5l-8.7 44.8c31.5 0 60.7-2.3 74.8 10.7 14.8 13.6 7.7 31-8.3 113.1h-37c15.4-79.4 18.3-86 12.7-92-5.4-5.8-17.7-4.6-47.4-4.6l-18.8 96.6h-36.5l32.7-168.6zM505 242.5c-8 41.1-36.7 36.3-70.1 36.3l13.7-70.6c38.2 0 63.8-4.1 56.4 34.3zM384.2 350.3H421l8.7-44.8c43.2 0 67.1 2.5 90.2-19.1 26.1-24 32.9-66.7 14.3-88.1-9.7-11.2-25.3-16.7-46.5-16.7H417l-32.8 168.7z";t.definition={prefix:"fab",iconName:"php",icon:[640,512,r,"f457",o]},t.faPhp=t.definition,t.prefix="fab",t.iconName="php",t.width=640,t.height=512,t.ligatures=r,t.unicode="f457",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z";t.definition={prefix:"fab",iconName:"python",icon:[448,512,r,"f3e2",o]},t.faPython=t.definition,t.prefix="fab",t.iconName="python",t.width=448,t.height=512,t.ligatures=r,t.unicode="f3e2",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M508.52,249.75,486.7,236.24c-.17-2-.34-3.93-.55-5.88l18.72-17.5a7.35,7.35,0,0,0-2.44-12.25l-24-9c-.54-1.88-1.08-3.78-1.67-5.64l15-20.83a7.35,7.35,0,0,0-4.79-11.54l-25.42-4.15c-.9-1.73-1.79-3.45-2.73-5.15l10.68-23.42a7.35,7.35,0,0,0-6.95-10.39l-25.82.91q-1.79-2.22-3.61-4.4L439,81.84A7.36,7.36,0,0,0,430.16,73L405,78.93q-2.17-1.83-4.4-3.61l.91-25.82a7.35,7.35,0,0,0-10.39-7L367.7,53.23c-1.7-.94-3.43-1.84-5.15-2.73L358.4,25.08a7.35,7.35,0,0,0-11.54-4.79L326,35.26c-1.86-.59-3.75-1.13-5.64-1.67l-9-24a7.35,7.35,0,0,0-12.25-2.44l-17.5,18.72c-1.95-.21-3.91-.38-5.88-.55L262.25,3.48a7.35,7.35,0,0,0-12.5,0L236.24,25.3c-2,.17-3.93.34-5.88.55L212.86,7.13a7.35,7.35,0,0,0-12.25,2.44l-9,24c-1.89.55-3.79,1.08-5.66,1.68l-20.82-15a7.35,7.35,0,0,0-11.54,4.79l-4.15,25.41c-1.73.9-3.45,1.79-5.16,2.73L120.88,42.55a7.35,7.35,0,0,0-10.39,7l.92,25.81c-1.49,1.19-3,2.39-4.42,3.61L81.84,73A7.36,7.36,0,0,0,73,81.84L78.93,107c-1.23,1.45-2.43,2.93-3.62,4.41l-25.81-.91a7.42,7.42,0,0,0-6.37,3.26,7.35,7.35,0,0,0-.57,7.13l10.66,23.41c-.94,1.7-1.83,3.43-2.73,5.16L25.08,153.6a7.35,7.35,0,0,0-4.79,11.54l15,20.82c-.59,1.87-1.13,3.77-1.68,5.66l-24,9a7.35,7.35,0,0,0-2.44,12.25l18.72,17.5c-.21,1.95-.38,3.91-.55,5.88L3.48,249.75a7.35,7.35,0,0,0,0,12.5L25.3,275.76c.17,2,.34,3.92.55,5.87L7.13,299.13a7.35,7.35,0,0,0,2.44,12.25l24,9c.55,1.89,1.08,3.78,1.68,5.65l-15,20.83a7.35,7.35,0,0,0,4.79,11.54l25.42,4.15c.9,1.72,1.79,3.45,2.73,5.14L42.56,391.12a7.35,7.35,0,0,0,.57,7.13,7.13,7.13,0,0,0,6.37,3.26l25.83-.91q1.77,2.22,3.6,4.4L73,430.16A7.36,7.36,0,0,0,81.84,439L107,433.07q2.18,1.83,4.41,3.61l-.92,25.82a7.35,7.35,0,0,0,10.39,6.95l23.43-10.68c1.69.94,3.42,1.83,5.14,2.73l4.15,25.42a7.34,7.34,0,0,0,11.54,4.78l20.83-15c1.86.6,3.76,1.13,5.65,1.68l9,24a7.36,7.36,0,0,0,12.25,2.44l17.5-18.72c1.95.21,3.92.38,5.88.55l13.51,21.82a7.35,7.35,0,0,0,12.5,0l13.51-21.82c2-.17,3.93-.34,5.88-.56l17.5,18.73a7.36,7.36,0,0,0,12.25-2.44l9-24c1.89-.55,3.78-1.08,5.65-1.68l20.82,15a7.34,7.34,0,0,0,11.54-4.78l4.15-25.42c1.72-.9,3.45-1.79,5.15-2.73l23.42,10.68a7.35,7.35,0,0,0,10.39-6.95l-.91-25.82q2.22-1.79,4.4-3.61L430.16,439a7.36,7.36,0,0,0,8.84-8.84L433.07,405q1.83-2.17,3.61-4.4l25.82.91a7.23,7.23,0,0,0,6.37-3.26,7.35,7.35,0,0,0,.58-7.13L458.77,367.7c.94-1.7,1.83-3.43,2.73-5.15l25.42-4.15a7.35,7.35,0,0,0,4.79-11.54l-15-20.83c.59-1.87,1.13-3.76,1.67-5.65l24-9a7.35,7.35,0,0,0,2.44-12.25l-18.72-17.5c.21-1.95.38-3.91.55-5.87l21.82-13.51a7.35,7.35,0,0,0,0-12.5Zm-151,129.08A13.91,13.91,0,0,0,341,389.51l-7.64,35.67A187.51,187.51,0,0,1,177,424.44l-7.64-35.66a13.87,13.87,0,0,0-16.46-10.68l-31.51,6.76a187.38,187.38,0,0,1-16.26-19.21H258.3c1.72,0,2.89-.29,2.89-1.91V309.55c0-1.57-1.17-1.91-2.89-1.91H213.47l.05-34.35H262c4.41,0,23.66,1.28,29.79,25.87,1.91,7.55,6.17,32.14,9.06,40,2.89,8.82,14.6,26.46,27.1,26.46H407a187.3,187.3,0,0,1-17.34,20.09Zm25.77,34.49A15.24,15.24,0,1,1,368,398.08h.44A15.23,15.23,0,0,1,383.24,413.32Zm-225.62-.68a15.24,15.24,0,1,1-15.25-15.25h.45A15.25,15.25,0,0,1,157.62,412.64ZM69.57,234.15l32.83-14.6a13.88,13.88,0,0,0,7.06-18.33L102.69,186h26.56V305.73H75.65A187.65,187.65,0,0,1,69.57,234.15ZM58.31,198.09a15.24,15.24,0,0,1,15.23-15.25H74a15.24,15.24,0,1,1-15.67,15.24Zm155.16,24.49.05-35.32h63.26c3.28,0,23.07,3.77,23.07,18.62,0,12.29-15.19,16.7-27.68,16.7ZM399,306.71c-9.8,1.13-20.63-4.12-22-10.09-5.78-32.49-15.39-39.4-30.57-51.4,18.86-11.95,38.46-29.64,38.46-53.26,0-25.52-17.49-41.59-29.4-49.48-16.76-11-35.28-13.23-40.27-13.23H116.32A187.49,187.49,0,0,1,221.21,70.06l23.47,24.6a13.82,13.82,0,0,0,19.6.44l26.26-25a187.51,187.51,0,0,1,128.37,91.43l-18,40.57A14,14,0,0,0,408,220.43l34.59,15.33a187.12,187.12,0,0,1,.4,32.54H423.71c-1.91,0-2.69,1.27-2.69,3.13v8.82C421,301,409.31,305.58,399,306.71ZM240,60.21A15.24,15.24,0,0,1,255.21,45h.45A15.24,15.24,0,1,1,240,60.21ZM436.84,214a15.24,15.24,0,1,1,0-30.48h.44a15.24,15.24,0,0,1-.44,30.48Z";t.definition={prefix:"fab",iconName:"rust",icon:[512,512,r,"e07a",o]},t.faRust=t.definition,t.prefix="fab",t.iconName="rust",t.width=512,t.height=512,t.ligatures=r,t.unicode="e07a",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm52.7 93c8.8-15.2 28.3-20.5 43.5-11.7 15.3 8.8 20.5 28.3 11.7 43.6-8.8 15.2-28.3 20.5-43.5 11.7-15.3-8.9-20.5-28.4-11.7-43.6zM87.4 287.9c-17.6 0-31.9-14.3-31.9-31.9 0-17.6 14.3-31.9 31.9-31.9 17.6 0 31.9 14.3 31.9 31.9 0 17.6-14.3 31.9-31.9 31.9zm28.1 3.1c22.3-17.9 22.4-51.9 0-69.9 8.6-32.8 29.1-60.7 56.5-79.1l23.7 39.6c-51.5 36.3-51.5 112.5 0 148.8L172 370c-27.4-18.3-47.8-46.3-56.5-79zm228.7 131.7c-15.3 8.8-34.7 3.6-43.5-11.7-8.8-15.3-3.6-34.8 11.7-43.6 15.2-8.8 34.7-3.6 43.5 11.7 8.8 15.3 3.6 34.8-11.7 43.6zm.3-69.5c-26.7-10.3-56.1 6.6-60.5 35-5.2 1.4-48.9 14.3-96.7-9.4l22.5-40.3c57 26.5 123.4-11.7 128.9-74.4l46.1.7c-2.3 34.5-17.3 65.5-40.3 88.4zm-5.9-105.3c-5.4-62-71.3-101.2-128.9-74.4l-22.5-40.3c47.9-23.7 91.5-10.8 96.7-9.4 4.4 28.3 33.8 45.3 60.5 35 23.1 22.9 38 53.9 40.2 88.5l-46 .6z";t.definition={prefix:"fab",iconName:"ubuntu",icon:[496,512,r,"f7df",o]},t.faUbuntu=t.definition,t.prefix="fab",t.iconName="ubuntu",t.width=496,t.height=512,t.ligatures=r,t.unicode="f7df",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M0 93.7l183.6-25.3v177.4H0V93.7zm0 324.6l183.6 25.3V268.4H0v149.9zm203.8 28L448 480V268.4H203.8v177.9zm0-380.6v180.1H448V32L203.8 65.7z";t.definition={prefix:"fab",iconName:"windows",icon:[448,512,r,"f17a",o]},t.faWindows=t.definition,t.prefix="fab",t.iconName="windows",t.width=448,t.height=512,t.ligatures=r,t.unicode="f17a",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M413.1 222.5l22.2 22.2c9.4 9.4 9.4 24.6 0 33.9L241 473c-9.4 9.4-24.6 9.4-33.9 0L12.7 278.6c-9.4-9.4-9.4-24.6 0-33.9l22.2-22.2c9.5-9.5 25-9.3 34.3.4L184 343.4V56c0-13.3 10.7-24 24-24h32c13.3 0 24 10.7 24 24v287.4l114.8-120.5c9.3-9.8 24.8-10 34.3-.4z";t.definition={prefix:"fas",iconName:"arrow-down",icon:[448,512,r,"f063",o]},t.faArrowDown=t.definition,t.prefix="fas",t.iconName="arrow-down",t.width=448,t.height=512,t.ligatures=r,t.unicode="f063",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M256 336h-.02c0-16.18 1.34-8.73-85.05-181.51-17.65-35.29-68.19-35.36-85.87 0C-2.06 328.75.02 320.33.02 336H0c0 44.18 57.31 80 128 80s128-35.82 128-80zM128 176l72 144H56l72-144zm511.98 160c0-16.18 1.34-8.73-85.05-181.51-17.65-35.29-68.19-35.36-85.87 0-87.12 174.26-85.04 165.84-85.04 181.51H384c0 44.18 57.31 80 128 80s128-35.82 128-80h-.02zM440 320l72-144 72 144H440zm88 128H352V153.25c23.51-10.29 41.16-31.48 46.39-57.25H528c8.84 0 16-7.16 16-16V48c0-8.84-7.16-16-16-16H383.64C369.04 12.68 346.09 0 320 0s-49.04 12.68-63.64 32H112c-8.84 0-16 7.16-16 16v32c0 8.84 7.16 16 16 16h129.61c5.23 25.76 22.87 46.96 46.39 57.25V448H112c-8.84 0-16 7.16-16 16v32c0 8.84 7.16 16 16 16h416c8.84 0 16-7.16 16-16v-32c0-8.84-7.16-16-16-16z";t.definition={prefix:"fas",iconName:"balance-scale",icon:[640,512,r,"f24e",o]},t.faBalanceScale=t.definition,t.prefix="fas",t.iconName="balance-scale",t.width=640,t.height=512,t.ligatures=r,t.unicode="f24e",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M425.7 256c-16.9 0-32.8-9-41.4-23.4L320 126l-64.2 106.6c-8.7 14.5-24.6 23.5-41.5 23.5-4.5 0-9-.6-13.3-1.9L64 215v178c0 14.7 10 27.5 24.2 31l216.2 54.1c10.2 2.5 20.9 2.5 31 0L551.8 424c14.2-3.6 24.2-16.4 24.2-31V215l-137 39.1c-4.3 1.3-8.8 1.9-13.3 1.9zm212.6-112.2L586.8 41c-3.1-6.2-9.8-9.8-16.7-8.9L320 64l91.7 152.1c3.8 6.3 11.4 9.3 18.5 7.3l197.9-56.5c9.9-2.9 14.7-13.9 10.2-23.1zM53.2 41L1.7 143.8c-4.6 9.2.3 20.2 10.1 23l197.9 56.5c7.1 2 14.7-1 18.5-7.3L320 64 69.8 32.1c-6.9-.8-13.5 2.7-16.6 8.9z";t.definition={prefix:"fas",iconName:"box-open",icon:[640,512,r,"f49e",o]},t.faBoxOpen=t.definition,t.prefix="fas",t.iconName="box-open",t.width=640,t.height=512,t.ligatures=r,t.unicode="f49e",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z";t.definition={prefix:"fas",iconName:"check-circle",icon:[512,512,r,"f058",o]},t.faCheckCircle=t.definition,t.prefix="fas",t.iconName="check-circle",t.width=512,t.height=512,t.ligatures=r,t.unicode="f058",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z";t.definition={prefix:"fas",iconName:"chevron-down",icon:[448,512,r,"f078",o]},t.faChevronDown=t.definition,t.prefix="fas",t.iconName="chevron-down",t.width=448,t.height=512,t.ligatures=r,t.unicode="f078",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z";t.definition={prefix:"fas",iconName:"chevron-right",icon:[320,512,r,"f054",o]},t.faChevronRight=t.definition,t.prefix="fas",t.iconName="chevron-right",t.width=320,t.height=512,t.ligatures=r,t.unicode="f054",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z";t.definition={prefix:"fas",iconName:"circle",icon:[512,512,r,"f111",o]},t.faCircle=t.definition,t.prefix="fas",t.iconName="circle",t.width=512,t.height=512,t.ligatures=r,t.unicode="f111",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M288 39.056v16.659c0 10.804 7.281 20.159 17.686 23.066C383.204 100.434 440 171.518 440 256c0 101.689-82.295 184-184 184-101.689 0-184-82.295-184-184 0-84.47 56.786-155.564 134.312-177.219C216.719 75.874 224 66.517 224 55.712V39.064c0-15.709-14.834-27.153-30.046-23.234C86.603 43.482 7.394 141.206 8.003 257.332c.72 137.052 111.477 246.956 248.531 246.667C393.255 503.711 504 392.788 504 256c0-115.633-79.14-212.779-186.211-240.236C302.678 11.889 288 23.456 288 39.056z";t.definition={prefix:"fas",iconName:"circle-notch",icon:[512,512,r,"f1ce",o]},t.faCircleNotch=t.definition,t.prefix="fas",t.iconName="circle-notch",t.width=512,t.height=512,t.ligatures=r,t.unicode="f1ce",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M512.1 191l-8.2 14.3c-3 5.3-9.4 7.5-15.1 5.4-11.8-4.4-22.6-10.7-32.1-18.6-4.6-3.8-5.8-10.5-2.8-15.7l8.2-14.3c-6.9-8-12.3-17.3-15.9-27.4h-16.5c-6 0-11.2-4.3-12.2-10.3-2-12-2.1-24.6 0-37.1 1-6 6.2-10.4 12.2-10.4h16.5c3.6-10.1 9-19.4 15.9-27.4l-8.2-14.3c-3-5.2-1.9-11.9 2.8-15.7 9.5-7.9 20.4-14.2 32.1-18.6 5.7-2.1 12.1.1 15.1 5.4l8.2 14.3c10.5-1.9 21.2-1.9 31.7 0L552 6.3c3-5.3 9.4-7.5 15.1-5.4 11.8 4.4 22.6 10.7 32.1 18.6 4.6 3.8 5.8 10.5 2.8 15.7l-8.2 14.3c6.9 8 12.3 17.3 15.9 27.4h16.5c6 0 11.2 4.3 12.2 10.3 2 12 2.1 24.6 0 37.1-1 6-6.2 10.4-12.2 10.4h-16.5c-3.6 10.1-9 19.4-15.9 27.4l8.2 14.3c3 5.2 1.9 11.9-2.8 15.7-9.5 7.9-20.4 14.2-32.1 18.6-5.7 2.1-12.1-.1-15.1-5.4l-8.2-14.3c-10.4 1.9-21.2 1.9-31.7 0zm-10.5-58.8c38.5 29.6 82.4-14.3 52.8-52.8-38.5-29.7-82.4 14.3-52.8 52.8zM386.3 286.1l33.7 16.8c10.1 5.8 14.5 18.1 10.5 29.1-8.9 24.2-26.4 46.4-42.6 65.8-7.4 8.9-20.2 11.1-30.3 5.3l-29.1-16.8c-16 13.7-34.6 24.6-54.9 31.7v33.6c0 11.6-8.3 21.6-19.7 23.6-24.6 4.2-50.4 4.4-75.9 0-11.5-2-20-11.9-20-23.6V418c-20.3-7.2-38.9-18-54.9-31.7L74 403c-10 5.8-22.9 3.6-30.3-5.3-16.2-19.4-33.3-41.6-42.2-65.7-4-10.9.4-23.2 10.5-29.1l33.3-16.8c-3.9-20.9-3.9-42.4 0-63.4L12 205.8c-10.1-5.8-14.6-18.1-10.5-29 8.9-24.2 26-46.4 42.2-65.8 7.4-8.9 20.2-11.1 30.3-5.3l29.1 16.8c16-13.7 34.6-24.6 54.9-31.7V57.1c0-11.5 8.2-21.5 19.6-23.5 24.6-4.2 50.5-4.4 76-.1 11.5 2 20 11.9 20 23.6v33.6c20.3 7.2 38.9 18 54.9 31.7l29.1-16.8c10-5.8 22.9-3.6 30.3 5.3 16.2 19.4 33.2 41.6 42.1 65.8 4 10.9.1 23.2-10 29.1l-33.7 16.8c3.9 21 3.9 42.5 0 63.5zm-117.6 21.1c59.2-77-28.7-164.9-105.7-105.7-59.2 77 28.7 164.9 105.7 105.7zm243.4 182.7l-8.2 14.3c-3 5.3-9.4 7.5-15.1 5.4-11.8-4.4-22.6-10.7-32.1-18.6-4.6-3.8-5.8-10.5-2.8-15.7l8.2-14.3c-6.9-8-12.3-17.3-15.9-27.4h-16.5c-6 0-11.2-4.3-12.2-10.3-2-12-2.1-24.6 0-37.1 1-6 6.2-10.4 12.2-10.4h16.5c3.6-10.1 9-19.4 15.9-27.4l-8.2-14.3c-3-5.2-1.9-11.9 2.8-15.7 9.5-7.9 20.4-14.2 32.1-18.6 5.7-2.1 12.1.1 15.1 5.4l8.2 14.3c10.5-1.9 21.2-1.9 31.7 0l8.2-14.3c3-5.3 9.4-7.5 15.1-5.4 11.8 4.4 22.6 10.7 32.1 18.6 4.6 3.8 5.8 10.5 2.8 15.7l-8.2 14.3c6.9 8 12.3 17.3 15.9 27.4h16.5c6 0 11.2 4.3 12.2 10.3 2 12 2.1 24.6 0 37.1-1 6-6.2 10.4-12.2 10.4h-16.5c-3.6 10.1-9 19.4-15.9 27.4l8.2 14.3c3 5.2 1.9 11.9-2.8 15.7-9.5 7.9-20.4 14.2-32.1 18.6-5.7 2.1-12.1-.1-15.1-5.4l-8.2-14.3c-10.4 1.9-21.2 1.9-31.7 0zM501.6 431c38.5 29.6 82.4-14.3 52.8-52.8-38.5-29.6-82.4 14.3-52.8 52.8z";t.definition={prefix:"fas",iconName:"cogs",icon:[640,512,r,"f085",o]},t.faCogs=t.definition,t.prefix="fas",t.iconName="cogs",t.width=640,t.height=512,t.ligatures=r,t.unicode="f085",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z";t.definition={prefix:"fas",iconName:"copy",icon:[448,512,r,"f0c5",o]},t.faCopy=t.definition,t.prefix="fas",t.iconName="copy",t.width=448,t.height=512,t.ligatures=r,t.unicode="f0c5",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M488.6 250.2L392 214V105.5c0-15-9.3-28.4-23.4-33.7l-100-37.5c-8.1-3.1-17.1-3.1-25.3 0l-100 37.5c-14.1 5.3-23.4 18.7-23.4 33.7V214l-96.6 36.2C9.3 255.5 0 268.9 0 283.9V394c0 13.6 7.7 26.1 19.9 32.2l100 50c10.1 5.1 22.1 5.1 32.2 0l103.9-52 103.9 52c10.1 5.1 22.1 5.1 32.2 0l100-50c12.2-6.1 19.9-18.6 19.9-32.2V283.9c0-15-9.3-28.4-23.4-33.7zM358 214.8l-85 31.9v-68.2l85-37v73.3zM154 104.1l102-38.2 102 38.2v.6l-102 41.4-102-41.4v-.6zm84 291.1l-85 42.5v-79.1l85-38.8v75.4zm0-112l-102 41.4-102-41.4v-.6l102-38.2 102 38.2v.6zm240 112l-85 42.5v-79.1l85-38.8v75.4zm0-112l-102 41.4-102-41.4v-.6l102-38.2 102 38.2v.6z";t.definition={prefix:"fas",iconName:"cubes",icon:[512,512,r,"f1b3",o]},t.faCubes=t.definition,t.prefix="fas",t.iconName="cubes",t.width=512,t.height=512,t.ligatures=r,t.unicode="f1b3",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M448 73.143v45.714C448 159.143 347.667 192 224 192S0 159.143 0 118.857V73.143C0 32.857 100.333 0 224 0s224 32.857 224 73.143zM448 176v102.857C448 319.143 347.667 352 224 352S0 319.143 0 278.857V176c48.125 33.143 136.208 48.572 224 48.572S399.874 209.143 448 176zm0 160v102.857C448 479.143 347.667 512 224 512S0 479.143 0 438.857V336c48.125 33.143 136.208 48.572 224 48.572S399.874 369.143 448 336z";t.definition={prefix:"fas",iconName:"database",icon:[448,512,r,"f1c0",o]},t.faDatabase=t.definition,t.prefix="fas",t.iconName="database",t.width=448,t.height=512,t.ligatures=r,t.unicode="f1c0",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z";t.definition={prefix:"fas",iconName:"download",icon:[512,512,r,"f019",o]},t.faDownload=t.definition,t.prefix="fas",t.iconName="download",t.width=512,t.height=512,t.ligatures=r,t.unicode="f019",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M497.941 273.941c18.745-18.745 18.745-49.137 0-67.882l-160-160c-18.745-18.745-49.136-18.746-67.883 0l-256 256c-18.745 18.745-18.745 49.137 0 67.882l96 96A48.004 48.004 0 0 0 144 480h356c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12H355.883l142.058-142.059zm-302.627-62.627l137.373 137.373L265.373 416H150.628l-80-80 124.686-124.686z";t.definition={prefix:"fas",iconName:"eraser",icon:[512,512,r,"f12d",o]},t.faEraser=t.definition,t.prefix="fas",t.iconName="eraser",t.width=512,t.height=512,t.ligatures=r,t.unicode="f12d",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z";t.definition={prefix:"fas",iconName:"exclamation-triangle",icon:[576,512,r,"f071",o]},t.faExclamationTriangle=t.definition,t.prefix="fas",t.iconName="exclamation-triangle",t.width=576,t.height=512,t.ligatures=r,t.unicode="f071",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M432,320H400a16,16,0,0,0-16,16V448H64V128H208a16,16,0,0,0,16-16V80a16,16,0,0,0-16-16H48A48,48,0,0,0,0,112V464a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V336A16,16,0,0,0,432,320ZM488,0h-128c-21.37,0-32.05,25.91-17,41l35.73,35.73L135,320.37a24,24,0,0,0,0,34L157.67,377a24,24,0,0,0,34,0L435.28,133.32,471,169c15,15,41,4.5,41-17V24A24,24,0,0,0,488,0Z";t.definition={prefix:"fas",iconName:"external-link-alt",icon:[512,512,r,"f35d",o]},t.faExternalLinkAlt=t.definition,t.prefix="fas",t.iconName="external-link-alt",t.width=512,t.height=512,t.ligatures=r,t.unicode="f35d",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z";t.definition={prefix:"fas",iconName:"eye-slash",icon:[640,512,r,"f070",o]},t.faEyeSlash=t.definition,t.prefix="fas",t.iconName="eye-slash",t.width=640,t.height=512,t.ligatures=r,t.unicode="f070",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm160-14.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z";t.definition={prefix:"fas",iconName:"file",icon:[384,512,r,"f15b",o]},t.faFile=t.definition,t.prefix="fas",t.iconName="file",t.width=384,t.height=512,t.ligatures=r,t.unicode="f15b",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm64 236c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12v8zm0-64c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12v8zm0-72v8c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12zm96-114.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z";t.definition={prefix:"fas",iconName:"file-alt",icon:[384,512,r,"f15c",o]},t.faFileAlt=t.definition,t.prefix="fas",t.iconName="file-alt",t.width=384,t.height=512,t.ligatures=r,t.unicode="f15c",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M377 105L279.1 7c-4.5-4.5-10.6-7-17-7H256v128h128v-6.1c0-6.3-2.5-12.4-7-16.9zM128.4 336c-17.9 0-32.4 12.1-32.4 27 0 15 14.6 27 32.5 27s32.4-12.1 32.4-27-14.6-27-32.5-27zM224 136V0h-63.6v32h-32V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zM95.9 32h32v32h-32zm32.3 384c-33.2 0-58-30.4-51.4-62.9L96.4 256v-32h32v-32h-32v-32h32v-32h-32V96h32V64h32v32h-32v32h32v32h-32v32h32v32h-32v32h22.1c5.7 0 10.7 4.1 11.8 9.7l17.3 87.7c6.4 32.4-18.4 62.6-51.4 62.6z";t.definition={prefix:"fas",iconName:"file-archive",icon:[384,512,r,"f1c6",o]},t.faFileArchive=t.definition,t.prefix="fas",t.iconName="file-archive",t.width=384,t.height=512,t.ligatures=r,t.unicode="f1c6",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M384 121.941V128H256V0h6.059c6.365 0 12.47 2.529 16.971 7.029l97.941 97.941A24.005 24.005 0 0 1 384 121.941zM248 160c-13.2 0-24-10.8-24-24V0H24C10.745 0 0 10.745 0 24v464c0 13.255 10.745 24 24 24h336c13.255 0 24-10.745 24-24V160H248zM123.206 400.505a5.4 5.4 0 0 1-7.633.246l-64.866-60.812a5.4 5.4 0 0 1 0-7.879l64.866-60.812a5.4 5.4 0 0 1 7.633.246l19.579 20.885a5.4 5.4 0 0 1-.372 7.747L101.65 336l40.763 35.874a5.4 5.4 0 0 1 .372 7.747l-19.579 20.884zm51.295 50.479l-27.453-7.97a5.402 5.402 0 0 1-3.681-6.692l61.44-211.626a5.402 5.402 0 0 1 6.692-3.681l27.452 7.97a5.4 5.4 0 0 1 3.68 6.692l-61.44 211.626a5.397 5.397 0 0 1-6.69 3.681zm160.792-111.045l-64.866 60.812a5.4 5.4 0 0 1-7.633-.246l-19.58-20.885a5.4 5.4 0 0 1 .372-7.747L284.35 336l-40.763-35.874a5.4 5.4 0 0 1-.372-7.747l19.58-20.885a5.4 5.4 0 0 1 7.633-.246l64.866 60.812a5.4 5.4 0 0 1-.001 7.879z";t.definition={prefix:"fas",iconName:"file-code",icon:[384,512,r,"f1c9",o]},t.faFileCode=t.definition,t.prefix="fas",t.iconName="file-code",t.width=384,t.height=512,t.ligatures=r,t.unicode="f1c9",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm60.1 106.5L224 336l60.1 93.5c5.1 8-.6 18.5-10.1 18.5h-34.9c-4.4 0-8.5-2.4-10.6-6.3C208.9 405.5 192 373 192 373c-6.4 14.8-10 20-36.6 68.8-2.1 3.9-6.1 6.3-10.5 6.3H110c-9.5 0-15.2-10.5-10.1-18.5l60.3-93.5-60.3-93.5c-5.2-8 .6-18.5 10.1-18.5h34.8c4.4 0 8.5 2.4 10.6 6.3 26.1 48.8 20 33.6 36.6 68.5 0 0 6.1-11.7 36.6-68.5 2.1-3.9 6.2-6.3 10.6-6.3H274c9.5-.1 15.2 10.4 10.1 18.4zM384 121.9v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z";t.definition={prefix:"fas",iconName:"file-excel",icon:[384,512,r,"f1c3",o]},t.faFileExcel=t.definition,t.prefix="fas",t.iconName="file-excel",t.width=384,t.height=512,t.ligatures=r,t.unicode="f1c3",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M384 121.941V128H256V0h6.059a24 24 0 0 1 16.97 7.029l97.941 97.941a24.002 24.002 0 0 1 7.03 16.971zM248 160c-13.2 0-24-10.8-24-24V0H24C10.745 0 0 10.745 0 24v464c0 13.255 10.745 24 24 24h336c13.255 0 24-10.745 24-24V160H248zm-135.455 16c26.51 0 48 21.49 48 48s-21.49 48-48 48-48-21.49-48-48 21.491-48 48-48zm208 240h-256l.485-48.485L104.545 328c4.686-4.686 11.799-4.201 16.485.485L160.545 368 264.06 264.485c4.686-4.686 12.284-4.686 16.971 0L320.545 304v112z";t.definition={prefix:"fas",iconName:"file-image",icon:[384,512,r,"f1c5",o]},t.faFileImage=t.definition,t.prefix="fas",t.iconName="file-image",t.width=384,t.height=512,t.ligatures=r,t.unicode="f1c5",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M181.9 256.1c-5-16-4.9-46.9-2-46.9 8.4 0 7.6 36.9 2 46.9zm-1.7 47.2c-7.7 20.2-17.3 43.3-28.4 62.7 18.3-7 39-17.2 62.9-21.9-12.7-9.6-24.9-23.4-34.5-40.8zM86.1 428.1c0 .8 13.2-5.4 34.9-40.2-6.7 6.3-29.1 24.5-34.9 40.2zM248 160h136v328c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V24C0 10.7 10.7 0 24 0h200v136c0 13.2 10.8 24 24 24zm-8 171.8c-20-12.2-33.3-29-42.7-53.8 4.5-18.5 11.6-46.6 6.2-64.2-4.7-29.4-42.4-26.5-47.8-6.8-5 18.3-.4 44.1 8.1 77-11.6 27.6-28.7 64.6-40.8 85.8-.1 0-.1.1-.2.1-27.1 13.9-73.6 44.5-54.5 68 5.6 6.9 16 10 21.5 10 17.9 0 35.7-18 61.1-61.8 25.8-8.5 54.1-19.1 79-23.2 21.7 11.8 47.1 19.5 64 19.5 29.2 0 31.2-32 19.7-43.4-13.9-13.6-54.3-9.7-73.6-7.2zM377 105L279 7c-4.5-4.5-10.6-7-17-7h-6v128h128v-6.1c0-6.3-2.5-12.4-7-16.9zm-74.1 255.3c4.1-2.7-2.5-11.9-42.8-9 37.1 15.8 42.8 9 42.8 9z";t.definition={prefix:"fas",iconName:"file-pdf",icon:[384,512,r,"f1c1",o]},t.faFilePdf=t.definition,t.prefix="fas",t.iconName="file-pdf",t.width=384,t.height=512,t.ligatures=r,t.unicode="f1c1",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm57.1 120H305c7.7 0 13.4 7.1 11.7 14.7l-38 168c-1.2 5.5-6.1 9.3-11.7 9.3h-38c-5.5 0-10.3-3.8-11.6-9.1-25.8-103.5-20.8-81.2-25.6-110.5h-.5c-1.1 14.3-2.4 17.4-25.6 110.5-1.3 5.3-6.1 9.1-11.6 9.1H117c-5.6 0-10.5-3.9-11.7-9.4l-37.8-168c-1.7-7.5 4-14.6 11.7-14.6h24.5c5.7 0 10.7 4 11.8 9.7 15.6 78 20.1 109.5 21 122.2 1.6-10.2 7.3-32.7 29.4-122.7 1.3-5.4 6.1-9.1 11.7-9.1h29.1c5.6 0 10.4 3.8 11.7 9.2 24 100.4 28.8 124 29.6 129.4-.2-11.2-2.6-17.8 21.6-129.2 1-5.6 5.9-9.5 11.5-9.5zM384 121.9v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z";t.definition={prefix:"fas",iconName:"file-word",icon:[384,512,r,"f1c2",o]},t.faFileWord=t.definition,t.prefix="fas",t.iconName="file-word",t.width=384,t.height=512,t.ligatures=r,t.unicode="f1c2",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M488 64h-8v20c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12V64H96v20c0 6.6-5.4 12-12 12H44c-6.6 0-12-5.4-12-12V64h-8C10.7 64 0 74.7 0 88v336c0 13.3 10.7 24 24 24h8v-20c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v20h320v-20c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v20h8c13.3 0 24-10.7 24-24V88c0-13.3-10.7-24-24-24zM96 372c0 6.6-5.4 12-12 12H44c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm0-96c0 6.6-5.4 12-12 12H44c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm0-96c0 6.6-5.4 12-12 12H44c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm272 208c0 6.6-5.4 12-12 12H156c-6.6 0-12-5.4-12-12v-96c0-6.6 5.4-12 12-12h200c6.6 0 12 5.4 12 12v96zm0-168c0 6.6-5.4 12-12 12H156c-6.6 0-12-5.4-12-12v-96c0-6.6 5.4-12 12-12h200c6.6 0 12 5.4 12 12v96zm112 152c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm0-96c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm0-96c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40z";t.definition={prefix:"fas",iconName:"film",icon:[512,512,r,"f008",o]},t.faFilm=t.definition,t.prefix="fas",t.iconName="film",t.width=512,t.height=512,t.ligatures=r,t.unicode="f008",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M255.98 160V16c0-8.84-7.16-16-16-16h-32c-8.84 0-16 7.16-16 16v146.93c5.02-1.78 10.34-2.93 15.97-2.93h48.03zm128 95.99c-.01-35.34-28.66-63.99-63.99-63.99H207.85c-8.78 0-15.9 7.07-15.9 15.85v.56c0 26.27 21.3 47.59 47.57 47.59h35.26c9.68 0 13.2 3.58 13.2 8v16.2c0 4.29-3.59 7.78-7.88 8-44.52 2.28-64.16 24.71-96.05 72.55l-6.31 9.47a7.994 7.994 0 0 1-11.09 2.22l-13.31-8.88a7.994 7.994 0 0 1-2.22-11.09l6.31-9.47c15.73-23.6 30.2-43.26 47.31-58.08-17.27-5.51-31.4-18.12-38.87-34.45-6.59 3.41-13.96 5.52-21.87 5.52h-32c-12.34 0-23.49-4.81-32-12.48C71.48 251.19 60.33 256 48 256H16c-5.64 0-10.97-1.15-16-2.95v77.93c0 33.95 13.48 66.5 37.49 90.51L63.99 448v64h255.98v-63.96l35.91-35.92A96.035 96.035 0 0 0 384 344.21l-.02-88.22zm-32.01-90.09V48c0-8.84-7.16-16-16-16h-32c-8.84 0-16 7.16-16 16v112h32c11.28 0 21.94 2.31 32 5.9zM16 224h32c8.84 0 16-7.16 16-16V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v128c0 8.84 7.16 16 16 16zm95.99 0h32c8.84 0 16-7.16 16-16V48c0-8.84-7.16-16-16-16h-32c-8.84 0-16 7.16-16 16v160c0 8.84 7.16 16 16 16z";t.definition={prefix:"fas",iconName:"fist-raised",icon:[384,512,r,"f6de",o]},t.faFistRaised=t.definition,t.prefix="fas",t.iconName="fist-raised",t.width=384,t.height=512,t.ligatures=r,t.unicode="f6de",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M464 128H272l-64-64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48z";t.definition={prefix:"fas",iconName:"folder",icon:[512,512,r,"f07b",o]},t.faFolder=t.definition,t.prefix="fas",t.iconName="folder",t.width=512,t.height=512,t.ligatures=r,t.unicode="f07b",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z";t.definition={prefix:"fas",iconName:"folder-open",icon:[576,512,r,"f07c",o]},t.faFolderOpen=t.definition,t.prefix="fas",t.iconName="folder-open",t.width=576,t.height=512,t.ligatures=r,t.unicode="f07c",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M464,128H272L208,64H48A48,48,0,0,0,0,112V400a48,48,0,0,0,48,48H464a48,48,0,0,0,48-48V176A48,48,0,0,0,464,128ZM359.5,296a16,16,0,0,1-16,16h-64v64a16,16,0,0,1-16,16h-16a16,16,0,0,1-16-16V312h-64a16,16,0,0,1-16-16V280a16,16,0,0,1,16-16h64V200a16,16,0,0,1,16-16h16a16,16,0,0,1,16,16v64h64a16,16,0,0,1,16,16Z";t.definition={prefix:"fas",iconName:"folder-plus",icon:[512,512,r,"f65e",o]},t.faFolderPlus=t.definition,t.prefix="fas",t.iconName="folder-plus",t.width=512,t.height=512,t.ligatures=r,t.unicode="f65e",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M144 176c44.1 0 80 35.9 80 80s-35.9 80-80 80-80-35.9-80-80 35.9-80 80-80m0-64C64.5 112 0 176.5 0 256s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144z";t.definition={prefix:"fas",iconName:"genderless",icon:[288,512,r,"f22d",o]},t.faGenderless=t.definition,t.prefix="fas",t.iconName="genderless",t.width=288,t.height=512,t.ligatures=r,t.unicode="f22d",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z";t.definition={prefix:"fas",iconName:"info-circle",icon:[512,512,r,"f05a",o]},t.faInfoCircle=t.definition,t.prefix="fas",t.iconName="info-circle",t.width=512,t.height=512,t.ligatures=r,t.unicode="f05a",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M512 176.001C512 273.203 433.202 352 336 352c-11.22 0-22.19-1.062-32.827-3.069l-24.012 27.014A23.999 23.999 0 0 1 261.223 384H224v40c0 13.255-10.745 24-24 24h-40v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24v-78.059c0-6.365 2.529-12.47 7.029-16.971l161.802-161.802C163.108 213.814 160 195.271 160 176 160 78.798 238.797.001 335.999 0 433.488-.001 512 78.511 512 176.001zM336 128c0 26.51 21.49 48 48 48s48-21.49 48-48-21.49-48-48-48-48 21.49-48 48z";t.definition={prefix:"fas",iconName:"key",icon:[512,512,r,"f084",o]},t.faKey=t.definition,t.prefix="fas",t.iconName="key",t.width=512,t.height=512,t.ligatures=r,t.unicode="f084",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M313.553 119.669L209.587 7.666c-9.485-10.214-25.676-10.229-35.174 0L70.438 119.669C56.232 134.969 67.062 160 88.025 160H152v272H68.024a11.996 11.996 0 0 0-8.485 3.515l-56 56C-4.021 499.074 1.333 512 12.024 512H208c13.255 0 24-10.745 24-24V160h63.966c20.878 0 31.851-24.969 17.587-40.331z";t.definition={prefix:"fas",iconName:"level-up-alt",icon:[320,512,r,"f3bf",o]},t.faLevelUpAlt=t.definition,t.prefix="fas",t.iconName="level-up-alt",t.width=320,t.height=512,t.ligatures=r,t.unicode="f3bf",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M80 368H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm0-320H16A16 16 0 0 0 0 64v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16zm0 160H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm416 176H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z";t.definition={prefix:"fas",iconName:"list",icon:[512,512,r,"f03a",o]},t.faList=t.definition,t.prefix="fas",t.iconName="list",t.width=512,t.height=512,t.ligatures=r,t.unicode="f03a",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z";t.definition={prefix:"fas",iconName:"lock",icon:[448,512,r,"f023",o]},t.faLock=t.definition,t.prefix="fas",t.iconName="lock",t.width=448,t.height=512,t.ligatures=r,t.unicode="f023",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M470.38 1.51L150.41 96A32 32 0 0 0 128 126.51v261.41A139 139 0 0 0 96 384c-53 0-96 28.66-96 64s43 64 96 64 96-28.66 96-64V214.32l256-75v184.61a138.4 138.4 0 0 0-32-3.93c-53 0-96 28.66-96 64s43 64 96 64 96-28.65 96-64V32a32 32 0 0 0-41.62-30.49z";t.definition={prefix:"fas",iconName:"music",icon:[512,512,r,"f001",o]},t.faMusic=t.definition,t.prefix="fas",t.iconName="music",t.width=512,t.height=512,t.ligatures=r,t.unicode="f001",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M480 128V96h20c6.627 0 12-5.373 12-12V44c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v20H64V44c0-6.627-5.373-12-12-12H12C5.373 32 0 37.373 0 44v40c0 6.627 5.373 12 12 12h20v320H12c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-20h384v20c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12h-20V128zM96 276V140c0-6.627 5.373-12 12-12h168c6.627 0 12 5.373 12 12v136c0 6.627-5.373 12-12 12H108c-6.627 0-12-5.373-12-12zm320 96c0 6.627-5.373 12-12 12H236c-6.627 0-12-5.373-12-12v-52h72c13.255 0 24-10.745 24-24v-72h84c6.627 0 12 5.373 12 12v136z";t.definition={prefix:"fas",iconName:"object-group",icon:[512,512,r,"f247",o]},t.faObjectGroup=t.definition,t.prefix="fas",t.iconName="object-group",t.width=512,t.height=512,t.ligatures=r,t.unicode="f247",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M272 96c26.51 0 48-21.49 48-48S298.51 0 272 0s-48 21.49-48 48 21.49 48 48 48zM113.69 317.47l-14.8 34.52H32c-17.67 0-32 14.33-32 32s14.33 32 32 32h77.45c19.25 0 36.58-11.44 44.11-29.09l8.79-20.52-10.67-6.3c-17.32-10.23-30.06-25.37-37.99-42.61zM384 223.99h-44.03l-26.06-53.25c-12.5-25.55-35.45-44.23-61.78-50.94l-71.08-21.14c-28.3-6.8-57.77-.55-80.84 17.14l-39.67 30.41c-14.03 10.75-16.69 30.83-5.92 44.86s30.84 16.66 44.86 5.92l39.69-30.41c7.67-5.89 17.44-8 25.27-6.14l14.7 4.37-37.46 87.39c-12.62 29.48-1.31 64.01 26.3 80.31l84.98 50.17-27.47 87.73c-5.28 16.86 4.11 34.81 20.97 40.09 3.19 1 6.41 1.48 9.58 1.48 13.61 0 26.23-8.77 30.52-22.45l31.64-101.06c5.91-20.77-2.89-43.08-21.64-54.39l-61.24-36.14 31.31-78.28 20.27 41.43c8 16.34 24.92 26.89 43.11 26.89H384c17.67 0 32-14.33 32-32s-14.33-31.99-32-31.99z";t.definition={prefix:"fas",iconName:"running",icon:[416,512,r,"f70c",o]},t.faRunning=t.definition,t.prefix="fas",t.iconName="running",t.width=416,t.height=512,t.ligatures=r,t.unicode="f70c",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z";t.definition={prefix:"fas",iconName:"search",icon:[512,512,r,"f002",o]},t.faSearch=t.definition,t.prefix="fas",t.iconName="search",t.width=512,t.height=512,t.ligatures=r,t.unicode="f002",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M240 96h64a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16h-64a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zm0 128h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16H240a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zm256 192H240a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h256a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm-256-64h192a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16H240a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zm-64 0h-48V48a16 16 0 0 0-16-16H80a16 16 0 0 0-16 16v304H16c-14.19 0-21.37 17.24-11.29 27.31l80 96a16 16 0 0 0 22.62 0l80-96C197.35 369.26 190.22 352 176 352z";t.definition={prefix:"fas",iconName:"sort-amount-down-alt",icon:[512,512,r,"f884",o]},t.faSortAmountDownAlt=t.definition,t.prefix="fas",t.iconName="sort-amount-down-alt",t.width=512,t.height=512,t.ligatures=r,t.unicode="f884",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M240 96h64a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16h-64a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zm0 128h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16H240a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zm256 192H240a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h256a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm-256-64h192a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16H240a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zM16 160h48v304a16 16 0 0 0 16 16h32a16 16 0 0 0 16-16V160h48c14.21 0 21.39-17.24 11.31-27.31l-80-96a16 16 0 0 0-22.62 0l-80 96C-5.35 142.74 1.78 160 16 160z";t.definition={prefix:"fas",iconName:"sort-amount-up-alt",icon:[512,512,r,"f885",o]},t.faSortAmountUpAlt=t.definition,t.prefix="fas",t.iconName="sort-amount-up-alt",t.width=512,t.height=512,t.ligatures=r,t.unicode="f885",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M257.981 272.971L63.638 467.314c-9.373 9.373-24.569 9.373-33.941 0L7.029 444.647c-9.357-9.357-9.375-24.522-.04-33.901L161.011 256 6.99 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L257.981 239.03c9.373 9.372 9.373 24.568 0 33.941zM640 456v-32c0-13.255-10.745-24-24-24H312c-13.255 0-24 10.745-24 24v32c0 13.255 10.745 24 24 24h304c13.255 0 24-10.745 24-24z";t.definition={prefix:"fas",iconName:"terminal",icon:[640,512,r,"f120",o]},t.faTerminal=t.definition,t.prefix="fas",t.iconName="terminal",t.width=640,t.height=512,t.ligatures=r,t.unicode="f120",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M149.333 56v80c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V56c0-13.255 10.745-24 24-24h101.333c13.255 0 24 10.745 24 24zm181.334 240v-80c0-13.255-10.745-24-24-24H205.333c-13.255 0-24 10.745-24 24v80c0 13.255 10.745 24 24 24h101.333c13.256 0 24.001-10.745 24.001-24zm32-240v80c0 13.255 10.745 24 24 24H488c13.255 0 24-10.745 24-24V56c0-13.255-10.745-24-24-24H386.667c-13.255 0-24 10.745-24 24zm-32 80V56c0-13.255-10.745-24-24-24H205.333c-13.255 0-24 10.745-24 24v80c0 13.255 10.745 24 24 24h101.333c13.256 0 24.001-10.745 24.001-24zm-205.334 56H24c-13.255 0-24 10.745-24 24v80c0 13.255 10.745 24 24 24h101.333c13.255 0 24-10.745 24-24v-80c0-13.255-10.745-24-24-24zM0 376v80c0 13.255 10.745 24 24 24h101.333c13.255 0 24-10.745 24-24v-80c0-13.255-10.745-24-24-24H24c-13.255 0-24 10.745-24 24zm386.667-56H488c13.255 0 24-10.745 24-24v-80c0-13.255-10.745-24-24-24H386.667c-13.255 0-24 10.745-24 24v80c0 13.255 10.745 24 24 24zm0 160H488c13.255 0 24-10.745 24-24v-80c0-13.255-10.745-24-24-24H386.667c-13.255 0-24 10.745-24 24v80c0 13.255 10.745 24 24 24zM181.333 376v80c0 13.255 10.745 24 24 24h101.333c13.255 0 24-10.745 24-24v-80c0-13.255-10.745-24-24-24H205.333c-13.255 0-24 10.745-24 24z";t.definition={prefix:"fas",iconName:"th",icon:[512,512,r,"f00a",o]},t.faTh=t.definition,t.prefix="fas",t.iconName="th",t.width=512,t.height=512,t.ligatures=r,t.unicode="f00a",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M296 32h192c13.255 0 24 10.745 24 24v160c0 13.255-10.745 24-24 24H296c-13.255 0-24-10.745-24-24V56c0-13.255 10.745-24 24-24zm-80 0H24C10.745 32 0 42.745 0 56v160c0 13.255 10.745 24 24 24h192c13.255 0 24-10.745 24-24V56c0-13.255-10.745-24-24-24zM0 296v160c0 13.255 10.745 24 24 24h192c13.255 0 24-10.745 24-24V296c0-13.255-10.745-24-24-24H24c-13.255 0-24 10.745-24 24zm296 184h192c13.255 0 24-10.745 24-24V296c0-13.255-10.745-24-24-24H296c-13.255 0-24 10.745-24 24v160c0 13.255 10.745 24 24 24z";t.definition={prefix:"fas",iconName:"th-large",icon:[512,512,r,"f009",o]},t.faThLarge=t.definition,t.prefix="fas",t.iconName="th-large",t.width=512,t.height=512,t.ligatures=r,t.unicode="f009",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z";t.definition={prefix:"fas",iconName:"times",icon:[352,512,r,"f00d",o]},t.faTimes=t.definition,t.prefix="fas",t.iconName="times",t.width=352,t.height=512,t.ligatures=r,t.unicode="f00d",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z";t.definition={prefix:"fas",iconName:"trash",icon:[448,512,r,"f1f8",o]},t.faTrash=t.definition,t.prefix="fas",t.iconName="trash",t.width=448,t.height=512,t.ligatures=r,t.unicode="f1f8",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M296 384h-80c-13.3 0-24-10.7-24-24V192h-87.7c-17.8 0-26.7-21.5-14.1-34.1L242.3 5.7c7.5-7.5 19.8-7.5 27.3 0l152.2 152.2c12.6 12.6 3.7 34.1-14.1 34.1H320v168c0 13.3-10.7 24-24 24zm216-8v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h136v8c0 30.9 25.1 56 56 56h80c30.9 0 56-25.1 56-56v-8h136c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z";t.definition={prefix:"fas",iconName:"upload",icon:[512,512,r,"f093",o]},t.faUpload=t.definition,t.prefix="fas",t.iconName="upload",t.width=512,t.height=512,t.ligatures=r,t.unicode="f093",t.svgPathData=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],o="M96 224c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm448 0c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm32 32h-64c-17.6 0-33.5 7.1-45.1 18.6 40.3 22.1 68.9 62 75.1 109.4h66c17.7 0 32-14.3 32-32v-32c0-35.3-28.7-64-64-64zm-256 0c61.9 0 112-50.1 112-112S381.9 32 320 32 208 82.1 208 144s50.1 112 112 112zm76.8 32h-8.3c-20.8 10-43.9 16-68.5 16s-47.6-6-68.5-16h-8.3C179.6 288 128 339.6 128 403.2V432c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-28.8c0-63.6-51.6-115.2-115.2-115.2zm-223.7-13.4C161.5 263.1 145.6 256 128 256H64c-35.3 0-64 28.7-64 64v32c0 17.7 14.3 32 32 32h65.9c6.3-47.4 34.9-87.3 75.2-109.4z";t.definition={prefix:"fas",iconName:"users",icon:[640,512,r,"f0c0",o]},t.faUsers=t.definition,t.prefix="fas",t.iconName="users",t.width=640,t.height=512,t.ligatures=r,t.unicode="f0c0",t.svgPathData=o},function(e,t,n){"use strict";n.r(t),n.d(t,"FontAwesomeIcon",(function(){return b}));var r=n(113),o=n(3),i=n.n(o),a=n(0),l=n.n(a);function u(e){return(u="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function p(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function h(e){return t=e,(t-=0)===t?e:(e=e.replace(/[\-_\s]+(.)?/g,(function(e,t){return t?t.toUpperCase():""}))).substr(0,1).toLowerCase()+e.substr(1);var t}function v(e){return e.split(";").map((function(e){return e.trim()})).filter((function(e){return e})).reduce((function(e,t){var n,r=t.indexOf(":"),o=h(t.slice(0,r)),i=t.slice(r+1).trim();return o.startsWith("webkit")?e[(n=o,n.charAt(0).toUpperCase()+n.slice(1))]=i:e[o]=i,e}),{})}var m=!1;try{m=!0}catch(w){}function g(e){return null===e?null:"object"===u(e)&&e.prefix&&e.iconName?e:Array.isArray(e)&&2===e.length?{prefix:e[0],iconName:e[1]}:"string"===typeof e?{prefix:"fas",iconName:e}:void 0}function y(e,t){return Array.isArray(t)&&t.length>0||!Array.isArray(t)&&t?c({},e,t):{}}function b(e){var t=e.forwardedRef,n=d(e,["forwardedRef"]),o=n.icon,i=n.mask,a=n.symbol,l=n.className,u=n.title,s=g(o),h=y("classes",[].concat(p(function(e){var t,n=e.spin,r=e.pulse,o=e.fixedWidth,i=e.inverse,a=e.border,l=e.listItem,u=e.flip,s=e.size,f=e.rotation,d=e.pull,p=(c(t={"fa-spin":n,"fa-pulse":r,"fa-fw":o,"fa-inverse":i,"fa-border":a,"fa-li":l,"fa-flip-horizontal":"horizontal"===u||"both"===u,"fa-flip-vertical":"vertical"===u||"both"===u},"fa-".concat(s),"undefined"!==typeof s&&null!==s),c(t,"fa-rotate-".concat(f),"undefined"!==typeof f&&null!==f&&0!==f),c(t,"fa-pull-".concat(d),"undefined"!==typeof d&&null!==d),c(t,"fa-swap-opacity",e.swapOpacity),t);return Object.keys(p).map((function(e){return p[e]?e:null})).filter((function(e){return e}))}(n)),p(l.split(" ")))),v=y("transform","string"===typeof n.transform?r.b.transform(n.transform):n.transform),w=y("mask",g(i)),O=Object(r.a)(s,f({},h,{},v,{},w,{symbol:a,title:u}));if(!O)return function(){var e;!m&&console&&"function"===typeof console.error&&(e=console).error.apply(e,arguments)}("Could not find icon",s),null;var C=O.abstract,x={ref:t};return Object.keys(n).forEach((function(e){b.defaultProps.hasOwnProperty(e)||(x[e]=n[e])})),S(C[0],x)}b.displayName="FontAwesomeIcon",b.propTypes={border:i.a.bool,className:i.a.string,mask:i.a.oneOfType([i.a.object,i.a.array,i.a.string]),fixedWidth:i.a.bool,inverse:i.a.bool,flip:i.a.oneOf(["horizontal","vertical","both"]),icon:i.a.oneOfType([i.a.object,i.a.array,i.a.string]),listItem:i.a.bool,pull:i.a.oneOf(["right","left"]),pulse:i.a.bool,rotation:i.a.oneOf([0,90,180,270]),size:i.a.oneOf(["lg","xs","sm","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"]),spin:i.a.bool,symbol:i.a.oneOfType([i.a.bool,i.a.string]),title:i.a.string,transform:i.a.oneOfType([i.a.string,i.a.object]),swapOpacity:i.a.bool},b.defaultProps={border:!1,className:"",mask:null,fixedWidth:!1,inverse:!1,flip:null,icon:null,listItem:!1,pull:null,pulse:!1,rotation:null,size:null,spin:!1,symbol:!1,title:"",transform:null,swapOpacity:!1};var S=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("string"===typeof n)return n;var o=(n.children||[]).map((function(n){return e(t,n)})),i=Object.keys(n.attributes||{}).reduce((function(e,t){var r=n.attributes[t];switch(t){case"class":e.attrs.className=r,delete n.attributes.class;break;case"style":e.attrs.style=v(r);break;default:0===t.indexOf("aria-")||0===t.indexOf("data-")?e.attrs[t.toLowerCase()]=r:e.attrs[h(t)]=r}return e}),{attrs:{}}),a=r.style,l=void 0===a?{}:a,u=d(r,["style"]);return i.attrs.style=f({},i.attrs.style,{},l),t.apply(void 0,[n.tag,f({},i.attrs,{},u)].concat(p(o)))}.bind(null,l.a.createElement)},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FileThumbnail=void 0;var o=r(n(50)),i=r(n(0));t.FileThumbnail=i.default.memo((function(e){var t=e.thumbnailUrl,n=t?{backgroundImage:"url('"+t+"')"}:{},r=o.default({"chonky-file-thumbnail":!0,"chonky-file-thumbnail-hidden":!t});return i.default.createElement("div",{className:r,style:n})}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useFileNameComponent=t.useModifierIconComponents=t.useThumbnailUrl=t.useDndIcon=void 0;var l=a(n(370)),u=i(n(0)),c=n(9),s=n(150),f=n(22),d=n(28),p=n(49),h=n(42),v=n(371);t.useDndIcon=function(e,t,n,r){return n?r&&!e?f.ChonkyIconName.dndCanDrop:f.ChonkyIconName.dndCannotDrop:t?f.ChonkyIconName.dndDragging:null},t.useThumbnailUrl=function(e,t,n){var r=c.useRecoilValue(s.thumbnailGeneratorState);u.useEffect((function(){var o=!1;return e&&(r?(n(!0),Promise.resolve().then((function(){return r(e)})).then((function(e){o||(n(!1),e&&"string"===typeof e&&t(e))})).catch((function(e){o||n(!1),p.Logger.error('User-defined "thumbnailGenerator" handler threw an error: '+e.message)}))):e.thumbnailUrl&&t(e.thumbnailUrl)),function(){o=!0}}),[e,t,n,r])},t.useModifierIconComponents=function(e){var t=u.useMemo((function(){var t=[];return d.FileHelper.isHidden(e)&&t.push(f.ChonkyIconName.hidden),d.FileHelper.isSymlink(e)&&t.push(f.ChonkyIconName.symlink),t}),[e]);return u.useMemo((function(){return t.map((function(e,t){return u.default.createElement(h.ChonkyIconFA,{key:"file-modifier-"+t,icon:e})}))}),[t])},t.useFileNameComponent=function(e){return u.useMemo((function(){var t,n,r;return e?(d.FileHelper.isDirectory(e)?(n=e.name,r="/"):(r=null!==(t=e.ext)&&void 0!==t?t:l.default.extname(e.name),n=e.name.substr(0,e.name.length-r.length)),u.default.createElement(u.default.Fragment,null,n,u.default.createElement("span",{className:"chonky-file-entry-description-title-extension"},r))):u.default.createElement(v.TextPlaceholder,{minLength:15,maxLength:20})}),[e])}},function(e,t,n){(function(e){function n(e,t){for(var n=0,r=e.length-1;r>=0;r--){var o=e[r];"."===o?e.splice(r,1):".."===o?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}t.resolve=function(){for(var t="",o=!1,i=arguments.length-1;i>=-1&&!o;i--){var a=i>=0?arguments[i]:e.cwd();if("string"!==typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,o="/"===a.charAt(0))}return(o?"/":"")+(t=n(r(t.split("/"),(function(e){return!!e})),!o).join("/"))||"."},t.normalize=function(e){var i=t.isAbsolute(e),a="/"===o(e,-1);return(e=n(r(e.split("/"),(function(e){return!!e})),!i).join("/"))||i||(e="."),e&&a&&(e+="/"),(i?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(r(e,(function(e,t){if("string"!==typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var o=r(e.split("/")),i=r(n.split("/")),a=Math.min(o.length,i.length),l=a,u=0;u<a;u++)if(o[u]!==i[u]){l=u;break}var c=[];for(u=l;u<o.length;u++)c.push("..");return(c=c.concat(i.slice(l))).join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){if("string"!==typeof e&&(e+=""),0===e.length)return".";for(var t=e.charCodeAt(0),n=47===t,r=-1,o=!0,i=e.length-1;i>=1;--i)if(47===(t=e.charCodeAt(i))){if(!o){r=i;break}}else o=!1;return-1===r?n?"/":".":n&&1===r?"/":e.slice(0,r)},t.basename=function(e,t){var n=function(e){"string"!==typeof e&&(e+="");var t,n=0,r=-1,o=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!o){n=t+1;break}}else-1===r&&(o=!1,r=t+1);return-1===r?"":e.slice(n,r)}(e);return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){"string"!==typeof e&&(e+="");for(var t=-1,n=0,r=-1,o=!0,i=0,a=e.length-1;a>=0;--a){var l=e.charCodeAt(a);if(47!==l)-1===r&&(o=!1,r=a+1),46===l?-1===t?t=a:1!==i&&(i=1):-1!==t&&(i=-1);else if(!o){n=a+1;break}}return-1===t||-1===r||0===i||1===i&&t===r-1&&t===n+1?"":e.slice(t,r)};var o="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)}}).call(this,n(109))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TextPlaceholder=void 0;var o=r(n(0));t.TextPlaceholder=o.default.memo((function(e){var t,n,r=e.minLength,i=e.maxLength,a=(n=i,(t=r)+Math.floor(Math.random()*Math.floor(n-t))),l=" ".repeat(a);return o.default.createElement("span",{className:"chonky-text-placeholder",dangerouslySetInnerHTML:{__html:l}})}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useFileClickHandlers=void 0;var r=n(0),o=n(9),i=n(66),a=n(48);t.useFileClickHandlers=function(e,t){var n=o.useRecoilValue(i.dispatchSpecialActionState),l=r.useCallback((function(r,o){e&&n({actionId:a.SpecialAction.MouseClickFile,clickType:o,file:e,fileDisplayIndex:t,altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey})}),[e,t,n]),u=r.useCallback((function(r){e&&n({actionId:a.SpecialAction.KeyboardClickFile,file:e,fileDisplayIndex:t,enterKey:r.enterKey,spaceKey:r.spaceKey,altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey})}),[e,t,n]);return{onSingleClick:r.useCallback((function(e){return l(e,"single")}),[l]),onDoubleClick:r.useCallback((function(e){return l(e,"double")}),[l]),onKeyboardClick:u}}},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){"use strict";var r="function"===typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,l=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,s=r?Symbol.for("react.context"):60110,f=r?Symbol.for("react.async_mode"):60111,d=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,h=r?Symbol.for("react.suspense"):60113,v=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,g=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,S=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function O(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case f:case d:case a:case u:case l:case h:return e;default:switch(e=e&&e.$$typeof){case s:case p:case g:case m:case c:return e;default:return t}}case i:return t}}}function C(e){return O(e)===d}t.AsyncMode=f,t.ConcurrentMode=d,t.ContextConsumer=s,t.ContextProvider=c,t.Element=o,t.ForwardRef=p,t.Fragment=a,t.Lazy=g,t.Memo=m,t.Portal=i,t.Profiler=u,t.StrictMode=l,t.Suspense=h,t.isAsyncMode=function(e){return C(e)||O(e)===f},t.isConcurrentMode=C,t.isContextConsumer=function(e){return O(e)===s},t.isContextProvider=function(e){return O(e)===c},t.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return O(e)===p},t.isFragment=function(e){return O(e)===a},t.isLazy=function(e){return O(e)===g},t.isMemo=function(e){return O(e)===m},t.isPortal=function(e){return O(e)===i},t.isProfiler=function(e){return O(e)===u},t.isStrictMode=function(e){return O(e)===l},t.isSuspense=function(e){return O(e)===h},t.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===a||e===d||e===u||e===l||e===h||e===v||"object"===typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===c||e.$$typeof===s||e.$$typeof===p||e.$$typeof===b||e.$$typeof===S||e.$$typeof===w||e.$$typeof===y)},t.typeOf=O},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.useInternalFileActionRequester=t.useInternalFileActionDispatcher=void 0;var o=n(0),i=n(9),a=n(24),l=n(39),u=n(80),c=n(38),s=n(111),f=n(66),d=n(81),p=n(48),h=n(55),v=n(49),m=n(102),g=n(99);t.useInternalFileActionDispatcher=function(e){var t=h.useInstanceVariable(e),n=h.useInstanceVariable(i.useRecoilValue(a.fileActionMapState));return o.useCallback((function(e){v.Logger.debug("FILE ACTION DISPATCH:",e);var r=e.actionId,o=n.current[r];o?g.isFunction(t.current)&&Promise.resolve(t.current(o,e)).catch((function(e){return v.Logger.error('User-defined "onAction" handler threw an error: '+e.message)})):v.Logger.error('Internal components dispatched a "'+r+'" file action, but such action was not registered.')}),[t,n])},t.useInternalFileActionRequester=function(){var e=h.useInstanceVariable(i.useRecoilValue(a.fileActionMapState)),t=h.useInstanceVariable(i.useSetRecoilState(s.sortConfigState)),n=h.useInstanceVariable(i.useSetRecoilState(u.optionMapState)),g=h.useInstanceVariable(i.useRecoilValue(a.dispatchFileActionState)),y=h.useInstanceVariable(i.useRecoilValue(f.dispatchSpecialActionState)),b=h.useInstanceVariable(i.useRecoilValue(l.filesState)),S=h.useInstanceVariable(i.useRecoilValue(c.selectionState));return o.useCallback((function(o){v.Logger.debug("FILE ACTION REQUEST:",o);var i=e.current[o];if(i){var a=i.requiresSelection?m.SelectionHelper.getSelectedFiles(b.current,S.current,i.fileFilter):void 0;if(!i.requiresSelection||a&&0!==a.length){var l={actionId:i.id,target:void 0,files:a};g.current(l);var u=i.sortKeySelector;u&&t.current((function(e){var t=d.SortOrder.Asc;return e.fileActionId===i.id&&(t=e.order===d.SortOrder.Asc?d.SortOrder.Desc:d.SortOrder.Asc),{fileActionId:i.id,sortKeySelector:u,order:t}}));var c=i.option;c&&n.current((function(e){var t=r({},e);return t[c.id]=!e[c.id],t}));var s=i.specialActionToDispatch;if(s)switch(s){case p.SpecialAction.OpenParentFolder:case p.SpecialAction.ToggleSearchBar:case p.SpecialAction.SelectAllFiles:case p.SpecialAction.ClearSelection:y.current({actionId:s});break;default:v.Logger.warn('File action "'+i.id+'" tried to dispatch a special action "'+s+'", but that special action was not marked as simple. File actions can only trigger simple special actions.')}}else v.Logger.warn('Internal components requested the "'+o+'" file action, but the selection for this action was empty. This might a bug in the code of the presentational components.')}else v.Logger.warn('Internal components requested the "'+o+'" file action, but such action was not registered.')}),[e,t,n,g,y,b,S])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useFileBrowserHandle=void 0;var r=n(0),o=n(9),i=n(38),a=n(55);t.useFileBrowserHandle=function(e,t){var n=a.useInstanceVariable(o.useRecoilValue(i.selectionState));r.useImperativeHandle(e,(function(){return{getFileSelection:function(){return new Set(n.current)},setFileSelection:function(e,n){return void 0===n&&(n=!0),t.selectFiles(Array.from(e),n)}}}),[t,n])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useOptions=void 0;var r=n(0),o=n(9),i=n(24),a=n(80),l=n(34);t.useOptions=function(e){var t=o.useRecoilValue(i.fileActionsState),n=o.useSetRecoilState(a.optionMapState);r.useEffect((function(){for(var e={},r=0,o=t;r<o.length;r++){var i=o[r];i.option&&(e[i.option.id]=i.option.defaultValue)}n(e)}),[t,n]);var u=o.useRecoilValue(a.optionState(l.ChonkyActions.ToggleHiddenFiles.option.id));return r.useMemo((function(){return!1!==u?e:e.filter((function(e){return!e||!e.isHidden}))}),[e,u])}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useFileSearch=void 0;var o=r(n(398)),i=n(0),a=n(9),l=n(68);t.useFileSearch=function(e){var t=a.useRecoilValue(l.searchFilterState);return i.useMemo((function(){return t?new o.default(e.filter((function(e){return!!e})),["name"],{caseSensitive:!1,sort:!0}).search(t):e}),[e,t])}},function(e,t,n){"use strict";var r=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,l=i.length;a<l;a++,o++)r[o]=i[a];return r},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useFileSorting=void 0;var i=o(n(380)),a=n(0),l=n(9),u=n(80),c=n(111),s=n(81),f=n(34),d=n(28);t.useFileSorting=function(e){var t=l.useRecoilValue(c.sortConfigState),n=l.useRecoilValue(u.optionState(f.ChonkyActions.ToggleShowFoldersFirst.option.id));return a.useMemo((function(){var o=[];return n&&o.push({desc:d.FileHelper.isDirectory}),t.order===s.SortOrder.Asc?o.push({asc:t.sortKeySelector}):o.push({desc:t.sortKeySelector}),o.push({asc:f.ChonkyActions.SortFilesByName.sortKeySelector}),i.default(r(e)).by(o)}),[e,t,n])}},function(e,t,n){"use strict";n.r(t);var r=function(e){return function(t,n,r){return e(t,n,r)*r}},o=function(e,t){if(e)throw Error("Invalid sort config: "+t)},i=function(e){var t=e||{},n=t.asc,i=t.desc,a=n?1:-1,l=n||i;return o(!l,"Expected `asc` or `desc` property"),o(n&&i,"Ambiguous object with `asc` and `desc` config properties"),{order:a,sortBy:l,comparer:e.comparer&&r(e.comparer)}};function a(e,t,n){if(void 0===e||!0===e)return function(e,r){return t(e,r,n)};if("string"===typeof e)return o(e.includes("."),"String syntax not allowed for nested properties."),function(r,o){return t(r[e],o[e],n)};if("function"===typeof e)return function(r,o){return t(e(r),e(o),n)};if(Array.isArray(e)){var r=(l=t,function e(t,n,r,o,a,u,c){var s,f;if("string"===typeof t)s=u[t],f=c[t];else{if("function"!==typeof t){var d=i(t);return e(d.sortBy,n,r,d.order,d.comparer||l,u,c)}s=t(u),f=t(c)}var p=a(s,f,o);return(0===p||null==s&&null==f)&&n.length>r?e(n[r],n,r+1,o,a,u,c):p});return function(o,i){return r(e[0],e,1,n,t,o,i)}}var l,u=i(e);return a(u.sortBy,u.comparer||t,u.order)}var l=function(e,t,n,r){return Array.isArray(t)?(Array.isArray(n)&&n.length<2&&(n=n[0]),t.sort(a(n,r,e))):t};function u(e){var t=r(e.comparer);return function(e){return{asc:function(n){return l(1,e,n,t)},desc:function(n){return l(-1,e,n,t)},by:function(n){return l(1,e,n,t)}}}}var c=u({comparer:function(e,t,n){return null==e?n:null==t?-n:e<t?-1:e===t?0:1}});c.createNewInstance=u,t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useSpecialFileActionHandlerMap=t.useSpecialActionDispatcher=void 0;var r=n(0),o=n(9),i=n(24),a=n(39),l=n(68),u=n(38),c=n(66),s=n(48),f=n(34),d=n(28),p=n(55),h=n(49);t.useSpecialActionDispatcher=function(e,n,i,a){var l=t.useSpecialFileActionHandlerMap(i,a),u=r.useCallback((function(e){h.Logger.debug("SPECIAL ACTION REQUEST:",e);var t=e.actionId,n=l[t];if(n)try{n(e)}catch(r){h.Logger.error('Handler for special action "'+t+'" threw an error.',r)}else h.Logger.error('Internal components dispatched a "'+t+'" special action, but no internal handler is available to process it.')}),[l]),s=o.useSetRecoilState(c.dispatchSpecialActionState);r.useEffect((function(){s((function(){return u}))}),[u,s])},t.useSpecialFileActionHandlerMap=function(e,t){var n=o.useRecoilValue(a.filesState),c=p.useInstanceVariable(n),v=p.useInstanceVariable(o.useRecoilValue(a.parentFolderState)),m=p.useInstanceVariable(o.useRecoilValue(u.selectedFilesState)),g=p.useInstanceVariable(o.useRecoilValue(i.dispatchFileActionState)),y=o.useSetRecoilState(l.searchBarVisibleState),b=r.useRef(null);return r.useEffect((function(){b.current=null}),[n]),r.useMemo((function(){var n;return(n={})[s.SpecialAction.MouseClickFile]=function(e){var n;if("double"===e.clickType)d.FileHelper.isOpenable(e.file)&&g.current({actionId:f.ChonkyActions.OpenFiles.id,target:e.file,files:[e.file]});else if(d.FileHelper.isSelectable(e.file))if(e.ctrlKey)t.toggleSelection(e.file.id,!1),b.current=e.fileDisplayIndex;else if(e.shiftKey)if("number"===typeof b.current){var r=b.current,o=e.fileDisplayIndex;r>o&&(r=(n=[o,r])[0],o=n[1]);var i=c.current.slice(r,o+1).filter((function(e){return d.FileHelper.isSelectable(e)})).map((function(e){return e.id}));t.selectFiles(i,!0)}else t.toggleSelection(e.file.id,!1),b.current=e.fileDisplayIndex;else t.toggleSelection(e.file.id,!0),b.current=e.fileDisplayIndex;else e.ctrlKey||t.clearSelection(),b.current=e.fileDisplayIndex},n[s.SpecialAction.KeyboardClickFile]=function(e){b.current=e.fileDisplayIndex,e.enterKey?0===m.current.length&&g.current({actionId:f.ChonkyActions.OpenFiles.id,target:e.file,files:[e.file]}):e.spaceKey&&d.FileHelper.isSelectable(e.file)&&t.toggleSelection(e.file.id,e.ctrlKey)},n[s.SpecialAction.OpenParentFolder]=function(){d.FileHelper.isOpenable(v.current)?g.current({actionId:f.ChonkyActions.OpenFiles.id,target:v.current,files:[v.current]}):h.Logger.warn('Special action "'+s.SpecialAction.OpenParentFolder+'" was dispatched even though the parent folder is not openable. This indicates a bug in presentation components.')},n[s.SpecialAction.OpenFolderChainFolder]=function(e){g.current({actionId:f.ChonkyActions.OpenFiles.id,target:e.file,files:[e.file]})},n[s.SpecialAction.ToggleSearchBar]=function(){y((function(e){return!e}))},n[s.SpecialAction.SelectAllFiles]=function(){var e=c.current.filter((function(e){return d.FileHelper.isSelectable(e)})).map((function(e){return e.id}));t.selectFiles(e,!0)},n[s.SpecialAction.ClearSelection]=function(){t.clearSelection()},n[s.SpecialAction.DragNDropStart]=function(n){var r=n.dragSource;e.isSelected(r)||(t.clearSelection(),d.FileHelper.isSelectable(r)&&t.selectFiles([r.id]))},n[s.SpecialAction.DragNDropEnd]=function(t){if(!e.isSelected(t.dropTarget)){var n=e.getSelectedFiles(d.FileHelper.isDraggable),r=n.length>0?n:[t.dragSource];g.current({actionId:"copy"===t.dropEffect?f.ChonkyActions.DuplicateFilesTo.id:f.ChonkyActions.MoveFilesTo.id,target:t.dropTarget,files:r})}},n}),[e,t,c,v,m,g,y])}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ChonkyPresentationLayer=void 0;var a=i(n(0)),l=n(9),u=n(100),c=n(24),s=n(38),f=n(55),d=n(383),p=n(162),h=n(384);t.ChonkyPresentationLayer=function(e){var t=e.validationErrors,n=e.children,r=l.useRecoilValue(c.fileActionsState),o=l.useRecoilValue(s.selectionModifiersState),i=l.useRecoilValue(u.enableDragAndDropState),v=f.useClickListener({onOutsideClick:function(e,t){return t?null:o.clearSelection()}}),m=a.useMemo((function(){return r.map((function(e){return a.default.createElement(h.HotkeyListener,{key:"file-action-listener-"+e.id,fileActionId:e.id})}))}),[r]),g=a.useMemo((function(){return t.map((function(e,t){return a.default.createElement(p.ErrorMessage,{key:"error-message-"+t,message:e.message,bullets:e.bullets})}))}),[t]);return a.default.createElement("div",{ref:v,className:"chonky-root chonky-no-select"},i&&a.default.createElement(d.DnDFileListDragLayer,null),m,g,n||null)}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DnDFileListDragLayer=void 0;var o=r(n(0)),i=n(152),a=n(9),l=n(38),u=n(151),c={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},s=function(e,t,n){if(!e||!t||!n)return{display:"none"};var r="translate("+(e.x+(n.x-t.x))+"px, "+(e.y+(n.y-t.y))+"px)";return{transform:r,WebkitTransform:r}};t.DnDFileListDragLayer=function(){var e=a.useRecoilValue(l.selectionSizeState),t=i.useDragLayer((function(e){return{item:e.getItem(),itemType:e.getItemType(),initialCursorOffset:e.getInitialClientOffset(),initialFileOffset:e.getInitialSourceClientOffset(),currentFileOffset:e.getSourceClientOffset(),isDragging:e.isDragging()}})),n=t.itemType,r=t.item,f=t.initialCursorOffset,d=t.initialFileOffset,p=t.currentFileOffset;return t.isDragging?o.default.createElement("div",{style:c},o.default.createElement("div",{style:s(f,d,p)},function(){if(r.file&&n===u.DnDFileEntryType)return o.default.createElement("div",{className:"chonky-file-drag-preview"},o.default.createElement("b",null,r.file.name),e>1&&o.default.createElement(o.default.Fragment,null," and ",o.default.createElement("strong",null,e-1," other file",e-1!==1?"s":"")))}())):null}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HotkeyListener=void 0;var l=a(n(385)),u=i(n(0)),c=n(9),s=n(24);t.HotkeyListener=u.default.memo((function(e){var t=e.fileActionId,n=c.useRecoilValue(s.fileActionDataState(t)),r=c.useRecoilValue(s.requestFileActionState);return u.useEffect((function(){if(n&&n.hotkeys&&0!==n.hotkeys.length){var e=n.hotkeys.join(","),t=function(e){e.preventDefault(),r(n.id)};return l.default(e,t),function(){return l.default.unbind(e,t)}}}),[n,r]),null}))},function(e,t,n){"use strict";n.r(t);var r="undefined"!==typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function o(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on".concat(t),(function(){n(window.event)}))}function i(e,t){for(var n=t.slice(0,t.length-1),r=0;r<n.length;r++)n[r]=e[n[r].toLowerCase()];return n}function a(e){"string"!==typeof e&&(e="");for(var t=(e=e.replace(/\s/g,"")).split(","),n=t.lastIndexOf("");n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}for(var l={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,"\u21ea":20,",":188,".":190,"/":191,"`":192,"-":r?173:189,"=":r?61:187,";":r?59:186,"'":222,"[":219,"]":221,"\\":220},u={"\u21e7":16,shift:16,"\u2325":18,alt:18,option:18,"\u2303":17,ctrl:17,control:17,"\u2318":91,cmd:91,command:91},c={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},s={16:!1,18:!1,17:!1,91:!1},f={},d=1;d<20;d++)l["f".concat(d)]=111+d;var p=[],h="all",v=[],m=function(e){return l[e.toLowerCase()]||u[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function g(e){h=e||"all"}function y(){return h||"all"}var b=function(e){var t=e.key,n=e.scope,r=e.method,o=e.splitKey,l=void 0===o?"+":o;a(t).forEach((function(e){var t=e.split(l),o=t.length,a=t[o-1],c="*"===a?"*":m(a);if(f[c]){n||(n=y());var s=o>1?i(u,t):[];f[c]=f[c].map((function(e){return(!r||e.method===r)&&e.scope===n&&function(e,t){for(var n=e.length>=t.length?e:t,r=e.length>=t.length?t:e,o=!0,i=0;i<n.length;i++)-1===r.indexOf(n[i])&&(o=!1);return o}(e.mods,s)?{}:e}))}}))};function S(e,t,n){var r;if(t.scope===n||"all"===t.scope){for(var o in r=t.mods.length>0,s)Object.prototype.hasOwnProperty.call(s,o)&&(!s[o]&&t.mods.indexOf(+o)>-1||s[o]&&-1===t.mods.indexOf(+o))&&(r=!1);(0!==t.mods.length||s[16]||s[18]||s[17]||s[91])&&!r&&"*"!==t.shortcut||!1===t.method(e,t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function w(e){var t=f["*"],n=e.keyCode||e.which||e.charCode;if(O.filter.call(this,e)){if(93!==n&&224!==n||(n=91),-1===p.indexOf(n)&&229!==n&&p.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(t){var n=c[t];e[t]&&-1===p.indexOf(n)?p.push(n):!e[t]&&p.indexOf(n)>-1?p.splice(p.indexOf(n),1):"metaKey"===t&&e[t]&&3===p.length&&(e.ctrlKey||e.shiftKey||e.altKey||(p=p.slice(p.indexOf(n))))})),n in s){for(var r in s[n]=!0,u)u[r]===n&&(O[r]=!0);if(!t)return}for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&(s[o]=e[c[o]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(-1===p.indexOf(17)&&p.push(17),-1===p.indexOf(18)&&p.push(18),s[17]=!0,s[18]=!0);var i=y();if(t)for(var a=0;a<t.length;a++)t[a].scope===i&&("keydown"===e.type&&t[a].keydown||"keyup"===e.type&&t[a].keyup)&&S(e,t[a],i);if(n in f)for(var l=0;l<f[n].length;l++)if(("keydown"===e.type&&f[n][l].keydown||"keyup"===e.type&&f[n][l].keyup)&&f[n][l].key){for(var d=f[n][l],h=d.splitKey,v=d.key.split(h),g=[],b=0;b<v.length;b++)g.push(m(v[b]));g.sort().join("")===p.sort().join("")&&S(e,d,i)}}}function O(e,t,n){p=[];var r=a(e),l=[],c="all",d=document,h=0,g=!1,y=!0,b="+";for(void 0===n&&"function"===typeof t&&(n=t),"[object Object]"===Object.prototype.toString.call(t)&&(t.scope&&(c=t.scope),t.element&&(d=t.element),t.keyup&&(g=t.keyup),void 0!==t.keydown&&(y=t.keydown),"string"===typeof t.splitKey&&(b=t.splitKey)),"string"===typeof t&&(c=t);h<r.length;h++)l=[],(e=r[h].split(b)).length>1&&(l=i(u,e)),(e="*"===(e=e[e.length-1])?"*":m(e))in f||(f[e]=[]),f[e].push({keyup:g,keydown:y,scope:c,mods:l,shortcut:r[h],method:n,key:r[h],splitKey:b});"undefined"!==typeof d&&!function(e){return v.indexOf(e)>-1}(d)&&window&&(v.push(d),o(d,"keydown",(function(e){w(e)})),o(window,"focus",(function(){p=[]})),o(d,"keyup",(function(e){w(e),function(e){var t=e.keyCode||e.which||e.charCode,n=p.indexOf(t);if(n>=0&&p.splice(n,1),e.key&&"meta"===e.key.toLowerCase()&&p.splice(0,p.length),93!==t&&224!==t||(t=91),t in s)for(var r in s[t]=!1,u)u[r]===t&&(O[r]=!1)}(e)})))}var C={setScope:g,getScope:y,deleteScope:function(e,t){var n,r;for(var o in e||(e=y()),f)if(Object.prototype.hasOwnProperty.call(f,o))for(n=f[o],r=0;r<n.length;)n[r].scope===e?n.splice(r,1):r++;y()===e&&g(t||"all")},getPressedKeyCodes:function(){return p.slice(0)},isPressed:function(e){return"string"===typeof e&&(e=m(e)),-1!==p.indexOf(e)},filter:function(e){var t=e.target||e.srcElement,n=t.tagName,r=!0;return!t.isContentEditable&&("INPUT"!==n&&"TEXTAREA"!==n&&"SELECT"!==n||t.readOnly)||(r=!1),r},unbind:function(e){if(e){if(Array.isArray(e))e.forEach((function(e){e.key&&b(e)}));else if("object"===typeof e)e.key&&b(e);else if("string"===typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=n[0],i=n[1];"function"===typeof o&&(i=o,o=""),b({key:e,scope:o,method:i,splitKey:"+"})}}else Object.keys(f).forEach((function(e){return delete f[e]}))}};for(var x in C)Object.prototype.hasOwnProperty.call(C,x)&&(O[x]=C[x]);if("undefined"!==typeof window){var E=window.hotkeys;O.noConflict=function(e){return e&&window.hotkeys===O&&(window.hotkeys=E),O},window.hotkeys=O}t.default=O},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FileToolbar=void 0;var o=r(n(3)),i=r(n(0)),a=n(9),l=n(68),u=n(387),c=n(388);t.FileToolbar=i.default.memo((function(){var e=a.useRecoilValue(l.searchBarEnabledState),t=u.useFolderChainComponent(),n=u.useActionGroups(),r=n.buttonGroups,o=n.openParentFolderButtonGroup,s=n.searchButtonGroup;return i.default.createElement("div",{className:"chonky-toolbar"},i.default.createElement("div",{className:"chonky-toolbar-side chonky-toolbar-side-left"},o&&i.default.createElement(c.ToolbarButtonGroup,{group:o}),t),i.default.createElement("div",{className:"chonky-toolbar-side chonky-toolbar-side-right"},r.map((function(e,t){return i.default.createElement(c.ToolbarButtonGroup,{key:"button-group-"+(e.name?e.name:t),group:e})})),e&&s&&i.default.createElement(c.ToolbarButtonGroup,{group:s})))})),t.FileToolbar.propTypes={folderChain:o.default.arrayOf(o.default.oneOfType([o.default.string.isRequired,o.default.oneOf([null]).isRequired]))}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useActionGroups=t.useFolderChainComponent=void 0;var u=l(n(50)),c=a(n(0)),s=n(9),f=n(24),d=n(39),p=n(66),h=n(22),v=n(48),m=n(34),g=n(28),y=n(42);t.useFolderChainComponent=function(){var e=s.useRecoilValue(d.folderChainState),t=s.useRecoilValue(p.dispatchSpecialActionState);return c.useMemo((function(){if(!e)return e;for(var n=new Array(Math.max(0,2*e.length-1)),o=function(o){var i=e[o],a=o===e.length-1,l=2*o,s={key:"folder-chain-entry-"+l,className:u.default({"chonky-folder-chain-entry":!0,"chonky-loading":!i})};g.FileHelper.isOpenable(i)&&!a&&(s.onClick=function(){t({actionId:v.SpecialAction.OpenFolderChainFolder,file:i})});var f=s.onClick?"button":"div";"button"===f&&(s.type="button"),n[l]=c.default.createElement(f,r({},s),0===l&&c.default.createElement("span",{className:"chonky-text-subtle-dark"},c.default.createElement(y.ChonkyIconFA,{icon:h.ChonkyIconName.folder}),"\xa0\xa0"),c.default.createElement("span",{className:"chonky-folder-chain-entry-name"},i?i.name:"Loading...")),a||(n[l+1]=c.default.createElement("div",{key:"folder-chain-separator-"+l,className:"chonky-folder-chain-separator"},c.default.createElement(y.ChonkyIconFA,{icon:h.ChonkyIconName.folderChainSeparator,size:"xs"})))},i=0;i<e.length;++i)o(i);return c.default.createElement("div",{className:"chonky-folder-chain"},n)}),[e,t])},t.useActionGroups=function(){var e=s.useRecoilValue(f.fileActionsState);return c.useMemo((function(){for(var t=[],n={},r=null,o=null,i=0,a=e;i<a.length;i++){var l=a[i];if(l.toolbarButton){var u=l.toolbarButton,c=void 0;u.group?n[u.group]?((c=n[u.group]).dropdown=c.dropdown||u.dropdown,c.fileActionIds.push(l.id)):(c={name:u.group,dropdown:u.dropdown,fileActionIds:[l.id]},t.push(c),n[c.name]=c):(c={name:u.group,dropdown:u.dropdown,fileActionIds:[l.id]},l.id===m.ChonkyActions.OpenParentFolder.id?r=c:l.id===m.ChonkyActions.ToggleSearch.id?o=c:t.push(c))}}return{buttonGroups:t,openParentFolderButtonGroup:r,searchButtonGroup:o}}),[e])}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ToolbarButtonGroup=void 0;var o=r(n(0)),i=n(389),a=n(163);t.ToolbarButtonGroup=o.default.memo((function(e){var t,n=e.group;return t=n.dropdown?o.default.createElement(i.Dropdown,{group:n}):n.fileActionIds.map((function(e){return o.default.createElement(a.SmartToolbarButton,{key:"action-button-"+e,fileActionId:e})})),o.default.createElement("div",{className:"chonky-toolbar-button-group"},t)}))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Dropdown=void 0;var a=i(n(0)),l=n(22),u=n(55),c=n(390),s=n(163);t.Dropdown=a.default.memo((function(e){var t=e.group,n=a.useState(!1),r=n[0],o=n[1],i=a.useCallback((function(){return o(!1)}),[o]),f=u.useClickListener({onOutsideClick:i}),d=a.useCallback((function(){o(!0)}),[o]);return a.default.createElement("div",{ref:f,className:"chonky-toolbar-dropdown"},a.default.createElement(s.ToolbarButton,{text:t.name,active:r,icon:l.ChonkyIconName.dropdown,iconOnRight:!0,onClick:d}),r&&a.default.createElement("div",{className:"chonky-toolbar-dropdown-content"},t.fileActionIds.map((function(e){return a.default.createElement(c.SmartDropdownButton,{key:"action-button-"+e,fileActionId:e})}))))}))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SmartDropdownButton=t.DropdownButton=void 0;var o=r(n(50)),i=r(n(0)),a=n(9),l=n(24),u=n(22),c=n(110),s=n(42);t.DropdownButton=i.default.memo((function(e){var t=e.text,n=e.tooltip,r=e.active,a=e.icon,l=e.onClick,c=e.disabled,f=o.default({"chonky-toolbar-dropdown-button":!0,"chonky-active":!!r});return i.default.createElement("button",{type:"button",className:f,onClick:l,title:n||t,disabled:!l||c},i.default.createElement("div",{className:"chonky-toolbar-dropdown-button-icon"},i.default.createElement(s.ChonkyIconFA,{icon:a||u.ChonkyIconName.circle,fixedWidth:!0})),i.default.createElement("div",{className:"chonky-toolbar-dropdown-button-text"},t))})),t.SmartDropdownButton=function(e){var n=e.fileActionId,r=a.useRecoilValue(l.fileActionDataState(n)),o=c.useFileActionTrigger(n),u=c.useFileActionProps(n),s=u.icon,f=u.active,d=u.disabled;if(!r)return null;var p=r.toolbarButton;return p?i.default.createElement(t.DropdownButton,{text:p.name,tooltip:p.tooltip,icon:s,onClick:o,active:f,disabled:d}):null}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FileSearch=void 0;var l=a(n(50)),u=i(n(0)),c=n(9),s=n(68),f=n(22),d=n(55),p=n(42);t.FileSearch=function(){var e=c.useSetRecoilState(s.searchBarEnabledState),t=c.useRecoilState(s.searchBarVisibleState),n=t[0],r=t[1],o=c.useRecoilState(s.searchFilterState),i=o[0],a=o[1];u.useEffect((function(){return e(!0),function(){return e(!1)}}),[e]);var h=u.useState(!1),v=h[0],m=h[1],g=u.useState(i),y=g[0],b=g[1],S=d.useDebounce(y,500),w=S[0],O=S[1];u.useEffect((function(){m(!1);var e=w.trim();a(e)}),[w,m,a]);var C=u.default.useRef(null);u.useEffect((function(){n?C.current&&C.current.focus():(m(!1),b(""),O(""))}),[C,n,m,b,O]);var x=u.useCallback((function(e){m(!0),b(e.target.value)}),[m,b]),E=u.useCallback((function(e){"Enter"===e.nativeEvent.code&&e.preventDefault(),"Escape"===e.nativeEvent.code&&r(!1)}),[r]),k=l.default({"chonky-file-search":!0,"chonky-file-search-hidden":!n});return u.default.createElement("div",{className:k},u.default.createElement("div",{className:"chonky-file-search-input-group"},u.default.createElement("label",{htmlFor:"chonky-file-search"},u.default.createElement(p.ChonkyIconFA,{icon:f.ChonkyIconName.search,fixedWidth:!0})),u.default.createElement("input",{ref:C,type:"text",id:"chonky-file-search",value:y,placeholder:"Type to search...",onChange:x,onKeyDown:E}),u.default.createElement("div",{className:"chonky-file-search-input-group-loading"},v&&u.default.createElement("span",{className:"chonky-file-search-input-group-loading-indicator"},u.default.createElement(p.ChonkyIconFA,{icon:f.ChonkyIconName.loading,spin:!0})))))}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.FileList=void 0;var a=i(n(0)),l=n(393),u=n(9),c=n(130),s=n(39),f=n(49),d=n(162),p=n(131);t.FileList=a.default.memo((function(){var e=u.useRecoilValue(s.filesState),n=u.useRecoilValue(c.fileEntrySizeState),r=p.useEntryRenderer(e),o=a.useRef(),i=p.useGridRenderer(e,n,r,o,!0);if(!e){var h=t.FileList.name+' cannot find the "files" array via React context. This happens when '+t.FileList.name+' is placed outside of "FileBrowser"component.';return f.Logger.error(h),a.default.createElement(d.ErrorMessage,{message:h})}return a.default.createElement("div",{className:"chonky-file-list",style:{minHeight:n.height}},a.default.createElement(l.AutoSizer,{disableHeight:!1},i))}))},function(e,t,n){"use strict";var r=n(36);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"AutoSizer",{enumerable:!0,get:function(){return o.default}});var o=r(n(394))},function(e,t,n){"use strict";var r=n(36),o=n(103);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,a,l=r(n(75)),u=r(n(76)),c=r(n(133)),s=r(n(134)),f=r(n(104)),d=r(n(135)),p=r(n(77)),h=o(n(0)),v=r(n(395));r(n(3));function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(n,!0).forEach((function(t){(0,p.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var y=(a=i=function(e){function t(){var e,n;(0,l.default)(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=(0,c.default)(this,(e=(0,s.default)(t)).call.apply(e,[this].concat(o))),(0,p.default)((0,f.default)(n),"state",{height:n.props.defaultHeight||0,width:n.props.defaultWidth||0}),(0,p.default)((0,f.default)(n),"_parentNode",void 0),(0,p.default)((0,f.default)(n),"_autoSizer",void 0),(0,p.default)((0,f.default)(n),"_window",void 0),(0,p.default)((0,f.default)(n),"_detectElementResize",void 0),(0,p.default)((0,f.default)(n),"_onResize",(function(){var e=n.props,t=e.disableHeight,r=e.disableWidth,o=e.onResize;if(n._parentNode){var i=n._parentNode.offsetHeight||0,a=n._parentNode.offsetWidth||0,l=(n._window||window).getComputedStyle(n._parentNode)||{},u=parseInt(l.paddingLeft,10)||0,c=parseInt(l.paddingRight,10)||0,s=parseInt(l.paddingTop,10)||0,f=parseInt(l.paddingBottom,10)||0,d=i-s-f,p=a-u-c;(!t&&n.state.height!==d||!r&&n.state.width!==p)&&(n.setState({height:i-s-f,width:a-u-c}),o({height:i,width:a}))}})),(0,p.default)((0,f.default)(n),"_setRef",(function(e){n._autoSizer=e})),n}return(0,d.default)(t,e),(0,u.default)(t,[{key:"componentDidMount",value:function(){var e=this.props.nonce;this._autoSizer&&this._autoSizer.parentNode&&this._autoSizer.parentNode.ownerDocument&&this._autoSizer.parentNode.ownerDocument.defaultView&&this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement&&(this._parentNode=this._autoSizer.parentNode,this._window=this._autoSizer.parentNode.ownerDocument.defaultView,this._detectElementResize=(0,v.default)(e,this._window),this._detectElementResize.addResizeListener(this._parentNode,this._onResize),this._onResize())}},{key:"componentWillUnmount",value:function(){this._detectElementResize&&this._parentNode&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=e.disableHeight,o=e.disableWidth,i=e.style,a=this.state,l=a.height,u=a.width,c={overflow:"visible"},s={};return r||(c.height=0,s.height=l),o||(c.width=0,s.width=u),h.createElement("div",{className:n,ref:this._setRef,style:g({},c,{},i)},t(s))}}]),t}(h.Component),(0,p.default)(i,"propTypes",null),a);t.default=y,(0,p.default)(y,"defaultProps",{onResize:function(){},disableHeight:!1,disableWidth:!1,style:{}})},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t,n){var r;r="undefined"!==typeof n?n:"undefined"!==typeof window?window:"undefined"!==typeof self?self:e;var o="undefined"!==typeof r.document&&r.document.attachEvent;if(!o){var i=function(){var e=r.requestAnimationFrame||r.mozRequestAnimationFrame||r.webkitRequestAnimationFrame||function(e){return r.setTimeout(e,20)};return function(t){return e(t)}}(),a=function(){var e=r.cancelAnimationFrame||r.mozCancelAnimationFrame||r.webkitCancelAnimationFrame||r.clearTimeout;return function(t){return e(t)}}(),l=function(e){var t=e.__resizeTriggers__,n=t.firstElementChild,r=t.lastElementChild,o=n.firstElementChild;r.scrollLeft=r.scrollWidth,r.scrollTop=r.scrollHeight,o.style.width=n.offsetWidth+1+"px",o.style.height=n.offsetHeight+1+"px",n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight},u=function(e){if(!(e.target.className&&"function"===typeof e.target.className.indexOf&&e.target.className.indexOf("contract-trigger")<0&&e.target.className.indexOf("expand-trigger")<0)){var t=this;l(this),this.__resizeRAF__&&a(this.__resizeRAF__),this.__resizeRAF__=i((function(){(function(e){return e.offsetWidth!=e.__resizeLast__.width||e.offsetHeight!=e.__resizeLast__.height})(t)&&(t.__resizeLast__.width=t.offsetWidth,t.__resizeLast__.height=t.offsetHeight,t.__resizeListeners__.forEach((function(n){n.call(t,e)})))}))}},c=!1,s="",f="animationstart",d="Webkit Moz O ms".split(" "),p="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),h="",v=r.document.createElement("fakeelement");if(void 0!==v.style.animationName&&(c=!0),!1===c)for(var m=0;m<d.length;m++)if(void 0!==v.style[d[m]+"AnimationName"]){h=d[m],s="-"+h.toLowerCase()+"-",f=p[m],c=!0;break}var g="resizeanim",y="@"+s+"keyframes "+g+" { from { opacity: 0; } to { opacity: 0; } } ",b=s+"animation: 1ms "+g+"; "}return{addResizeListener:function(e,n){if(o)e.attachEvent("onresize",n);else{if(!e.__resizeTriggers__){var i=e.ownerDocument,a=r.getComputedStyle(e);a&&"static"==a.position&&(e.style.position="relative"),function(e){if(!e.getElementById("detectElementResize")){var n=(y||"")+".resize-triggers { "+(b||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',r=e.head||e.getElementsByTagName("head")[0],o=e.createElement("style");o.id="detectElementResize",o.type="text/css",null!=t&&o.setAttribute("nonce",t),o.styleSheet?o.styleSheet.cssText=n:o.appendChild(e.createTextNode(n)),r.appendChild(o)}}(i),e.__resizeLast__={},e.__resizeListeners__=[],(e.__resizeTriggers__=i.createElement("div")).className="resize-triggers",e.__resizeTriggers__.innerHTML='<div class="expand-trigger"><div></div></div><div class="contract-trigger"></div>',e.appendChild(e.__resizeTriggers__),l(e),e.addEventListener("scroll",u,!0),f&&(e.__resizeTriggers__.__animationListener__=function(t){t.animationName==g&&l(e)},e.__resizeTriggers__.addEventListener(f,e.__resizeTriggers__.__animationListener__))}e.__resizeListeners__.push(n)}},removeResizeListener:function(e,t){if(o)e.detachEvent("onresize",t);else if(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),!e.__resizeListeners__.length){e.removeEventListener("scroll",u,!0),e.__resizeTriggers__.__animationListener__&&(e.__resizeTriggers__.removeEventListener(f,e.__resizeTriggers__.__animationListener__),e.__resizeTriggers__.__animationListener__=null);try{e.__resizeTriggers__=!e.removeChild(e.__resizeTriggers__)}catch(n){}}}}}}).call(this,n(35))},function(e,t,n){"use strict";n.r(t),n.d(t,"getEmptyImage",(function(){return I})),n.d(t,"NativeTypes",(function(){return r})),n.d(t,"HTML5Backend",(function(){return M}));var r={};function o(e){var t=null;return function(){return null==t&&(t=e()),t}}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(r),n.d(r,"FILE",(function(){return v})),n.d(r,"URL",(function(){return m})),n.d(r,"TEXT",(function(){return g}));var a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.entered=[],this.isNodeInDocument=t}var t,n,r;return t=e,(n=[{key:"enter",value:function(e){var t=this,n=this.entered.length;return this.entered=function(e,t){var n=new Set,r=function(e){return n.add(e)};e.forEach(r),t.forEach(r);var o=[];return n.forEach((function(e){return o.push(e)})),o}(this.entered.filter((function(n){return t.isNodeInDocument(n)&&(!n.contains||n.contains(e))})),[e]),0===n&&this.entered.length>0}},{key:"leave",value:function(e){var t,n,r=this.entered.length;return this.entered=(t=this.entered.filter(this.isNodeInDocument),n=e,t.filter((function(e){return e!==n}))),r>0&&0===this.entered.length}},{key:"reset",value:function(){this.entered=[]}}])&&i(t.prototype,n),r&&i(t,r),e}(),l=o((function(){return/firefox/i.test(navigator.userAgent)})),u=o((function(){return Boolean(window.safari)}));function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var s=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);for(var r=t.length,o=[],i=0;i<r;i++)o.push(i);o.sort((function(e,n){return t[e]<t[n]?-1:1}));for(var a,l,u=[],c=[],s=[],f=0;f<r-1;f++)a=t[f+1]-t[f],l=n[f+1]-n[f],c.push(a),u.push(l),s.push(l/a);for(var d=[s[0]],p=0;p<c.length-1;p++){var h=s[p],v=s[p+1];if(h*v<=0)d.push(0);else{a=c[p];var m=c[p+1],g=a+m;d.push(3*g/((g+m)/h+(g+a)/v))}}d.push(s[s.length-1]);for(var y,b=[],S=[],w=0;w<d.length-1;w++){y=s[w];var O=d[w],C=1/c[w],x=O+d[w+1]-y-y;b.push((y-O-x)*C),S.push(x*C*C)}this.xs=t,this.ys=n,this.c1s=d,this.c2s=b,this.c3s=S}var t,n,r;return t=e,(n=[{key:"interpolate",value:function(e){var t=this.xs,n=this.ys,r=this.c1s,o=this.c2s,i=this.c3s,a=t.length-1;if(e===t[a])return n[a];for(var l,u=0,c=i.length-1;u<=c;){var s=t[l=Math.floor(.5*(u+c))];if(s<e)u=l+1;else{if(!(s>e))return n[l];c=l-1}}var f=e-t[a=Math.max(0,c)],d=f*f;return n[a]+r[a]*f+o[a]*d+i[a]*f*d}}])&&c(t.prototype,n),r&&c(t,r),e}();function f(e){var t=1===e.nodeType?e:e.parentElement;if(!t)return null;var n=t.getBoundingClientRect(),r=n.top;return{x:n.left,y:r}}function d(e){return{x:e.clientX,y:e.clientY}}function p(e,t,n,r,o){var i=function(e){var t;return"IMG"===e.nodeName&&(l()||!(null===(t=document.documentElement)||void 0===t?void 0:t.contains(e)))}(t),a=f(i?e:t),c={x:n.x-a.x,y:n.y-a.y},d=e.offsetWidth,p=e.offsetHeight,h=r.anchorX,v=r.anchorY,m=function(e,t,n,r){var o=e?t.width:n,i=e?t.height:r;return u()&&e&&(i/=window.devicePixelRatio,o/=window.devicePixelRatio),{dragPreviewWidth:o,dragPreviewHeight:i}}(i,t,d,p),g=m.dragPreviewWidth,y=m.dragPreviewHeight,b=o.offsetX,S=o.offsetY,w=0===S||S;return{x:0===b||b?b:new s([0,.5,1],[c.x,c.x/d*g,c.x+g-d]).interpolate(h),y:w?S:function(){var e=new s([0,.5,1],[c.y,c.y/p*y,c.y+y-p]).interpolate(v);return u()&&i&&(e+=(window.devicePixelRatio-1)*y),e}()}}var h,v="__NATIVE_FILE__",m="__NATIVE_URL__",g="__NATIVE_TEXT__";function y(e,t,n){var r=t.reduce((function(t,n){return t||e.getData(n)}),"");return null!=r?r:n}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var S=(b(h={},v,{exposeProperties:{files:function(e){return Array.prototype.slice.call(e.files)},items:function(e){return e.items}},matchesTypes:["Files"]}),b(h,m,{exposeProperties:{urls:function(e,t){return y(e,t,"").split("\n")}},matchesTypes:["Url","text/uri-list"]}),b(h,g,{exposeProperties:{text:function(e,t){return y(e,t,"")}},matchesTypes:["Text","text/plain"]}),h);function w(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var O=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=t,this.item={},this.initializeExposedProperties()}var t,n,r;return t=e,(n=[{key:"initializeExposedProperties",value:function(){var e=this;Object.keys(this.config.exposeProperties).forEach((function(t){Object.defineProperty(e.item,t,{configurable:!0,enumerable:!0,get:function(){return console.warn("Browser doesn't allow reading \"".concat(t,'" until the drop event.')),null}})}))}},{key:"loadDataTransfer",value:function(e){var t=this;if(e){var n={};Object.keys(this.config.exposeProperties).forEach((function(r){n[r]={value:t.config.exposeProperties[r](e,t.config.matchesTypes),configurable:!0,enumerable:!0}})),Object.defineProperties(this.item,n)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(e,t){return t===e.getSourceId()}},{key:"endDrag",value:function(){}}])&&w(t.prototype,n),r&&w(t,r),e}();function C(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(S).filter((function(e){return S[e].matchesTypes.some((function(e){return t.indexOf(e)>-1}))}))[0]||null}function x(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var E=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.globalContext=t}var t,n,r;return t=e,(n=[{key:"window",get:function(){return this.globalContext?this.globalContext:"undefined"!==typeof window?window:void 0}},{key:"document",get:function(){if(this.window)return this.window.document}}])&&x(t.prototype,n),r&&x(t,r),e}();function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){T(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function T(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var P,A=function(){function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.getSourceClientOffset=function(e){var t=r.sourceNodes.get(e);return t&&f(t)||null},this.endDragNativeItem=function(){r.isDraggingNativeItem()&&(r.actions.endDrag(),r.currentNativeHandle&&r.registry.removeSource(r.currentNativeHandle),r.currentNativeHandle=null,r.currentNativeSource=null)},this.isNodeInDocument=function(e){return Boolean(e&&r.document&&r.document.body&&document.body.contains(e))},this.endDragIfSourceWasRemovedFromDOM=function(){var e=r.currentDragSourceNode;r.isNodeInDocument(e)||r.clearCurrentDragSourceNode()&&r.actions.endDrag()},this.handleTopDragStartCapture=function(){r.clearCurrentDragSourceNode(),r.dragStartSourceIds=[]},this.handleTopDragStart=function(e){if(!e.defaultPrevented){var t=r.dragStartSourceIds;r.dragStartSourceIds=null;var n=d(e);r.monitor.isDragging()&&r.actions.endDrag(),r.actions.beginDrag(t||[],{publishSource:!1,getSourceClientOffset:r.getSourceClientOffset,clientOffset:n});var o=e.dataTransfer,i=C(o);if(r.monitor.isDragging()){if(o&&"function"===typeof o.setDragImage){var a=r.monitor.getSourceId(),l=r.sourceNodes.get(a),u=r.sourcePreviewNodes.get(a)||l;if(u){var c=r.getCurrentSourcePreviewNodeOptions(),s=p(l,u,n,{anchorX:c.anchorX,anchorY:c.anchorY},{offsetX:c.offsetX,offsetY:c.offsetY});o.setDragImage(u,s.x,s.y)}}try{null===o||void 0===o||o.setData("application/json",{})}catch(f){}r.setCurrentDragSourceNode(e.target),r.getCurrentSourcePreviewNodeOptions().captureDraggingState?r.actions.publishDragSource():setTimeout((function(){return r.actions.publishDragSource()}),0)}else if(i)r.beginDragNativeItem(i);else{if(o&&!o.types&&(e.target&&!e.target.hasAttribute||!e.target.hasAttribute("draggable")))return;e.preventDefault()}}},this.handleTopDragEndCapture=function(){r.clearCurrentDragSourceNode()&&r.actions.endDrag()},this.handleTopDragEnterCapture=function(e){if(r.dragEnterTargetIds=[],r.enterLeaveCounter.enter(e.target)&&!r.monitor.isDragging()){var t=e.dataTransfer,n=C(t);n&&r.beginDragNativeItem(n,t)}},this.handleTopDragEnter=function(e){var t=r.dragEnterTargetIds;(r.dragEnterTargetIds=[],r.monitor.isDragging())&&(r.altKeyPressed=e.altKey,l()||r.actions.hover(t,{clientOffset:d(e)}),t.some((function(e){return r.monitor.canDropOnTarget(e)}))&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=r.getCurrentDropEffect())))},this.handleTopDragOverCapture=function(){r.dragOverTargetIds=[]},this.handleTopDragOver=function(e){var t=r.dragOverTargetIds;if(r.dragOverTargetIds=[],!r.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer&&(e.dataTransfer.dropEffect="none"));r.altKeyPressed=e.altKey,r.actions.hover(t||[],{clientOffset:d(e)}),(t||[]).some((function(e){return r.monitor.canDropOnTarget(e)}))?(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=r.getCurrentDropEffect())):r.isDraggingNativeItem()?e.preventDefault():(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=function(e){r.isDraggingNativeItem()&&e.preventDefault(),r.enterLeaveCounter.leave(e.target)&&r.isDraggingNativeItem()&&r.endDragNativeItem()},this.handleTopDropCapture=function(e){var t;(r.dropTargetIds=[],e.preventDefault(),r.isDraggingNativeItem())&&(null===(t=r.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer));r.enterLeaveCounter.reset()},this.handleTopDrop=function(e){var t=r.dropTargetIds;r.dropTargetIds=[],r.actions.hover(t,{clientOffset:d(e)}),r.actions.drop({dropEffect:r.getCurrentDropEffect()}),r.isDraggingNativeItem()?r.endDragNativeItem():r.endDragIfSourceWasRemovedFromDOM()},this.handleSelectStart=function(e){var t=e.target;"function"===typeof t.dragDrop&&("INPUT"===t.tagName||"SELECT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||(e.preventDefault(),t.dragDrop()))},this.options=new E(n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new a(this.isNodeInDocument)}var t,n,o;return t=e,(n=[{key:"profile",value:function(){var e,t;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:(null===(e=this.dragStartSourceIds)||void 0===e?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:(null===(t=this.dragOverTargetIds)||void 0===t?void 0:t.length)||0}}},{key:"setup",value:function(){if(void 0!==this.window){if(this.window.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");this.window.__isReactDndBackendSetUp=!0,this.addEventListeners(this.window)}}},{key:"teardown",value:function(){void 0!==this.window&&(this.window.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.window),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId&&this.window.cancelAnimationFrame(this.asyncEndDragFrameId))}},{key:"connectDragPreview",value:function(e,t,n){var r=this;return this.sourcePreviewNodeOptions.set(e,n),this.sourcePreviewNodes.set(e,t),function(){r.sourcePreviewNodes.delete(e),r.sourcePreviewNodeOptions.delete(e)}}},{key:"connectDragSource",value:function(e,t,n){var r=this;this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,n);var o=function(t){return r.handleDragStart(t,e)},i=function(e){return r.handleSelectStart(e)};return t.setAttribute("draggable","true"),t.addEventListener("dragstart",o),t.addEventListener("selectstart",i),function(){r.sourceNodes.delete(e),r.sourceNodeOptions.delete(e),t.removeEventListener("dragstart",o),t.removeEventListener("selectstart",i),t.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(e,t){var n=this,r=function(t){return n.handleDragEnter(t,e)},o=function(t){return n.handleDragOver(t,e)},i=function(t){return n.handleDrop(t,e)};return t.addEventListener("dragenter",r),t.addEventListener("dragover",o),t.addEventListener("drop",i),function(){t.removeEventListener("dragenter",r),t.removeEventListener("dragover",o),t.removeEventListener("drop",i)}}},{key:"addEventListeners",value:function(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var e=this.monitor.getSourceId(),t=this.sourceNodeOptions.get(e);return _({dropEffect:this.altKeyPressed?"copy":"move"},t||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var e=this.monitor.getSourceId();return _({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}},{key:"isDraggingNativeItem",value:function(){var e=this.monitor.getItemType();return Object.keys(r).some((function(t){return r[t]===e}))}},{key:"beginDragNativeItem",value:function(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=function(e,t){var n=new O(S[e]);return n.loadDataTransfer(t),n}(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(e){var t=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.mouseMoveTimeoutTimer=setTimeout((function(){return t.window&&t.window.addEventListener("mousemove",t.endDragIfSourceWasRemovedFromDOM,!0)}),1e3)}},{key:"clearCurrentDragSourceNode",value:function(){return!!this.currentDragSourceNode&&(this.currentDragSourceNode=null,this.window&&(this.window.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.window.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)),this.mouseMoveTimeoutTimer=null,!0)}},{key:"handleDragStart",value:function(e,t){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(t))}},{key:"handleDragEnter",value:function(e,t){this.dragEnterTargetIds.unshift(t)}},{key:"handleDragOver",value:function(e,t){null===this.dragOverTargetIds&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}},{key:"handleDrop",value:function(e,t){this.dropTargetIds.unshift(t)}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}}])&&j(t.prototype,n),o&&j(t,o),e}();function I(){return P||((P=new Image).src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),P}var M=function(e,t){return new A(e,t)}},,function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}n.r(t),n.d(t,"default",(function(){return l}));var a=function(){function e(){r(this,e)}return i(e,null,[{key:"getDescendantProperty",value:function(t,n){var r,o,i,a,l,u,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(n){if(-1===(i=n.indexOf("."))?r=n:(r=n.slice(0,i),o=n.slice(i+1)),null!==(a=t[r])&&"undefined"!==typeof a)if(o||"string"!==typeof a&&"number"!==typeof a)if("[object Array]"===Object.prototype.toString.call(a))for(l=0,u=a.length;l<u;l++)e.getDescendantProperty(a[l],o,c);else o&&e.getDescendantProperty(a,o,c);else c.push(a)}else c.push(t);return c}}]),e}(),l=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r(this,e),Array.isArray(n)||(o=n,n=[]),this.haystack=t,this.keys=n,this.options=Object.assign({caseSensitive:!1,sort:!1},o)}return i(e,[{key:"search",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(""===t)return this.haystack;for(var n=[],r=0;r<this.haystack.length;r++){var o=this.haystack[r];if(0===this.keys.length){var i=e.isMatch(o,t,this.options.caseSensitive);i&&n.push({item:o,score:i})}else for(var l=0;l<this.keys.length;l++){for(var u=a.getDescendantProperty(o,this.keys[l]),c=!1,s=0;s<u.length;s++){var f=e.isMatch(u[s],t,this.options.caseSensitive);if(f){c=!0,n.push({item:o,score:f});break}}if(c)break}}return this.options.sort&&n.sort((function(e,t){return e.score-t.score})),n.map((function(e){return e.item}))}}],[{key:"isMatch",value:function(t,n,r){t=String(t),n=String(n),r||(t=t.toLocaleLowerCase(),n=n.toLocaleLowerCase());var o=e.nearestIndexesFor(t,n);return!!o&&(t===n?1:o.length>1?o[o.length-1]-o[0]+2:2+o[0])}},{key:"nearestIndexesFor",value:function(t,n){var r=n.split(""),o=[];return e.indexesOfFirstLetter(t,n).forEach((function(e,n){var i=e+1;o[n]=[e];for(var a=1;a<r.length;a++){var l=r[a];if(-1===(i=t.indexOf(l,i))){o[n]=!1;break}o[n].push(i),i++}})),!!(o=o.filter((function(e){return!1!==e}))).length&&o.sort((function(e,t){return 1===e.length?e[0]-t[0]:(e=e[e.length-1]-e[0])-(t=t[t.length-1]-t[0])}))[0]}},{key:"indexesOfFirstLetter",value:function(e,t){var n=t[0];return e.split("").map((function(e,t){return e===n&&t})).filter((function(e){return!1!==e}))}}]),e}()},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return i}));var r,o=!("undefined"===typeof window||!window.document||!window.document.createElement);function i(e){if((!r&&0!==r||e)&&o){var t=document.createElement("div");t.style.position="absolute",t.style.top="-9999px",t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t),r=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return r}},function(e,t,n){"use strict";n.d(t,"a",(function(){return dn}));var r=n(2),o=n(1),i=n(0),a=n.n(i),l="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u="object"===("undefined"===typeof window?"undefined":l(window))&&"object"===("undefined"===typeof document?"undefined":l(document))&&9===document.nodeType;var c=n(64),s=n(32),f=n(21),d=n(30),p={}.constructor;function h(e){if(null==e||"object"!==typeof e)return e;if(Array.isArray(e))return e.map(h);if(e.constructor!==p)return e;var t={};for(var n in e)t[n]=h(e[n]);return t}function v(e,t,n){void 0===e&&(e="unnamed");var r=n.jss,o=h(t),i=r.plugins.onCreateRule(e,o,n);return i||(e[0],null)}var m=function(e,t){for(var n="",r=0;r<e.length&&"!important"!==e[r];r++)n&&(n+=t),n+=e[r];return n};function g(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))return e;var n="";if(Array.isArray(e[0]))for(var r=0;r<e.length&&"!important"!==e[r];r++)n&&(n+=", "),n+=m(e[r]," ");else n=m(e,", ");return t||"!important"!==e[e.length-1]||(n+=" !important"),n}function y(e,t){for(var n="",r=0;r<t;r++)n+=" ";return n+e}function b(e,t,n){void 0===n&&(n={});var r="";if(!t)return r;var o=n.indent,i=void 0===o?0:o,a=t.fallbacks;if(e&&i++,a)if(Array.isArray(a))for(var l=0;l<a.length;l++){var u=a[l];for(var c in u){var s=u[c];null!=s&&(r&&(r+="\n"),r+=""+y(c+": "+g(s)+";",i))}}else for(var f in a){var d=a[f];null!=d&&(r&&(r+="\n"),r+=""+y(f+": "+g(d)+";",i))}for(var p in t){var h=t[p];null!=h&&"fallbacks"!==p&&(r&&(r+="\n"),r+=""+y(p+": "+g(h)+";",i))}return(r||n.allowEmpty)&&e?(r&&(r="\n"+r+"\n"),y(e+" {"+r,--i)+y("}",i)):r}var S=/([[\].#*$><+~=|^:(),"'`\s])/g,w="undefined"!==typeof CSS&&CSS.escape,O=function(e){return w?w(e):e.replace(S,"\\$1")},C=function(){function e(e,t,n){this.type="style",this.key=void 0,this.isProcessed=!1,this.style=void 0,this.renderer=void 0,this.renderable=void 0,this.options=void 0;var r=n.sheet,o=n.Renderer;this.key=e,this.options=n,this.style=t,r?this.renderer=r.renderer:o&&(this.renderer=new o)}return e.prototype.prop=function(e,t,n){if(void 0===t)return this.style[e];var r=!!n&&n.force;if(!r&&this.style[e]===t)return this;var o=t;n&&!1===n.process||(o=this.options.jss.plugins.onChangeValue(t,e,this));var i=null==o||!1===o,a=e in this.style;if(i&&!a&&!r)return this;var l=i&&a;if(l?delete this.style[e]:this.style[e]=o,this.renderable&&this.renderer)return l?this.renderer.removeProperty(this.renderable,e):this.renderer.setProperty(this.renderable,e,o),this;var u=this.options.sheet;return u&&u.attached,this},e}(),x=function(e){function t(t,n,r){var o;(o=e.call(this,t,n,r)||this).selectorText=void 0,o.id=void 0,o.renderable=void 0;var i=r.selector,a=r.scoped,l=r.sheet,u=r.generateId;return i?o.selectorText=i:!1!==a&&(o.id=u(Object(f.a)(Object(f.a)(o)),l),o.selectorText="."+O(o.id)),o}Object(s.a)(t,e);var n=t.prototype;return n.applyTo=function(e){var t=this.renderer;if(t){var n=this.toJSON();for(var r in n)t.setProperty(e,r,n[r])}return this},n.toJSON=function(){var e={};for(var t in this.style){var n=this.style[t];"object"!==typeof n?e[t]=n:Array.isArray(n)&&(e[t]=g(n))}return e},n.toString=function(e){var t=this.options.sheet,n=!!t&&t.options.link?Object(o.a)({},e,{allowEmpty:!0}):e;return b(this.selectorText,this.style,n)},Object(c.a)(t,[{key:"selector",set:function(e){if(e!==this.selectorText){this.selectorText=e;var t=this.renderer,n=this.renderable;if(n&&t)t.setSelector(n,e)||t.replaceRule(n,this)}},get:function(){return this.selectorText}}]),t}(C),E={onCreateRule:function(e,t,n){return"@"===e[0]||n.parent&&"keyframes"===n.parent.type?null:new x(e,t,n)}},k={indent:1,children:!0},_=/@([\w-]+)/,T=function(){function e(e,t,n){this.type="conditional",this.at=void 0,this.key=void 0,this.query=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e,this.query=n.name;var r=e.match(_);for(var i in this.at=r?r[1]:"unknown",this.options=n,this.rules=new Q(Object(o.a)({},n,{parent:this})),t)this.rules.add(i,t[i]);this.rules.process()}var t=e.prototype;return t.getRule=function(e){return this.rules.get(e)},t.indexOf=function(e){return this.rules.indexOf(e)},t.addRule=function(e,t,n){var r=this.rules.add(e,t,n);return r?(this.options.jss.plugins.onProcessRule(r),r):null},t.toString=function(e){if(void 0===e&&(e=k),null==e.indent&&(e.indent=k.indent),null==e.children&&(e.children=k.children),!1===e.children)return this.query+" {}";var t=this.rules.toString(e);return t?this.query+" {\n"+t+"\n}":""},e}(),j=/@media|@supports\s+/,P={onCreateRule:function(e,t,n){return j.test(e)?new T(e,t,n):null}},A={indent:1,children:!0},I=/@keyframes\s+([\w-]+)/,M=function(){function e(e,t,n){this.type="keyframes",this.at="@keyframes",this.key=void 0,this.name=void 0,this.id=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0;var r=e.match(I);r&&r[1]?this.name=r[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=n;var i=n.scoped,a=n.sheet,l=n.generateId;for(var u in this.id=!1===i?this.name:O(l(this,a)),this.rules=new Q(Object(o.a)({},n,{parent:this})),t)this.rules.add(u,t[u],Object(o.a)({},n,{parent:this}));this.rules.process()}return e.prototype.toString=function(e){if(void 0===e&&(e=A),null==e.indent&&(e.indent=A.indent),null==e.children&&(e.children=A.children),!1===e.children)return this.at+" "+this.id+" {}";var t=this.rules.toString(e);return t&&(t="\n"+t+"\n"),this.at+" "+this.id+" {"+t+"}"},e}(),D=/@keyframes\s+/,R=/\$([\w-]+)/g,N=function(e,t){return"string"===typeof e?e.replace(R,(function(e,n){return n in t?t[n]:e})):e},F=function(e,t,n){var r=e[t],o=N(r,n);o!==r&&(e[t]=o)},z={onCreateRule:function(e,t,n){return"string"===typeof e&&D.test(e)?new M(e,t,n):null},onProcessStyle:function(e,t,n){return"style"===t.type&&n?("animation-name"in e&&F(e,"animation-name",n.keyframes),"animation"in e&&F(e,"animation",n.keyframes),e):e},onChangeValue:function(e,t,n){var r=n.options.sheet;if(!r)return e;switch(t){case"animation":case"animation-name":return N(e,r.keyframes);default:return e}}},L=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).renderable=void 0,t}return Object(s.a)(t,e),t.prototype.toString=function(e){var t=this.options.sheet,n=!!t&&t.options.link?Object(o.a)({},e,{allowEmpty:!0}):e;return b(this.key,this.style,n)},t}(C),V={onCreateRule:function(e,t,n){return n.parent&&"keyframes"===n.parent.type?new L(e,t,n):null}},H=function(){function e(e,t,n){this.type="font-face",this.at="@font-face",this.key=void 0,this.style=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e,this.style=t,this.options=n}return e.prototype.toString=function(e){if(Array.isArray(this.style)){for(var t="",n=0;n<this.style.length;n++)t+=b(this.at,this.style[n]),this.style[n+1]&&(t+="\n");return t}return b(this.at,this.style,e)},e}(),B=/@font-face/,W={onCreateRule:function(e,t,n){return B.test(e)?new H(e,t,n):null}},U=function(){function e(e,t,n){this.type="viewport",this.at="@viewport",this.key=void 0,this.style=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e,this.style=t,this.options=n}return e.prototype.toString=function(e){return b(this.key,this.style,e)},e}(),$={onCreateRule:function(e,t,n){return"@viewport"===e||"@-ms-viewport"===e?new U(e,t,n):null}},K=function(){function e(e,t,n){this.type="simple",this.key=void 0,this.value=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e,this.value=t,this.options=n}return e.prototype.toString=function(e){if(Array.isArray(this.value)){for(var t="",n=0;n<this.value.length;n++)t+=this.key+" "+this.value[n]+";",this.value[n+1]&&(t+="\n");return t}return this.key+" "+this.value+";"},e}(),q={"@charset":!0,"@import":!0,"@namespace":!0},G=[E,P,z,V,W,$,{onCreateRule:function(e,t,n){return e in q?new K(e,t,n):null}}],Y={process:!0},X={force:!0,process:!0},Q=function(){function e(e){this.map={},this.raw={},this.index=[],this.counter=0,this.options=void 0,this.classes=void 0,this.keyframes=void 0,this.options=e,this.classes=e.classes,this.keyframes=e.keyframes}var t=e.prototype;return t.add=function(e,t,n){var r=this.options,i=r.parent,a=r.sheet,l=r.jss,u=r.Renderer,c=r.generateId,s=r.scoped,f=Object(o.a)({classes:this.classes,parent:i,sheet:a,jss:l,Renderer:u,generateId:c,scoped:s,name:e,keyframes:this.keyframes,selector:void 0},n),d=e;e in this.raw&&(d=e+"-d"+this.counter++),this.raw[d]=t,d in this.classes&&(f.selector="."+O(this.classes[d]));var p=v(d,t,f);if(!p)return null;this.register(p);var h=void 0===f.index?this.index.length:f.index;return this.index.splice(h,0,p),p},t.get=function(e){return this.map[e]},t.remove=function(e){this.unregister(e),delete this.raw[e.key],this.index.splice(this.index.indexOf(e),1)},t.indexOf=function(e){return this.index.indexOf(e)},t.process=function(){var e=this.options.jss.plugins;this.index.slice(0).forEach(e.onProcessRule,e)},t.register=function(e){this.map[e.key]=e,e instanceof x?(this.map[e.selector]=e,e.id&&(this.classes[e.key]=e.id)):e instanceof M&&this.keyframes&&(this.keyframes[e.name]=e.id)},t.unregister=function(e){delete this.map[e.key],e instanceof x?(delete this.map[e.selector],delete this.classes[e.key]):e instanceof M&&delete this.keyframes[e.name]},t.update=function(){var e,t,n;if("string"===typeof(arguments.length<=0?void 0:arguments[0])?(e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],n=arguments.length<=2?void 0:arguments[2]):(t=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1],e=null),e)this.updateOne(this.map[e],t,n);else for(var r=0;r<this.index.length;r++)this.updateOne(this.index[r],t,n)},t.updateOne=function(t,n,r){void 0===r&&(r=Y);var o=this.options,i=o.jss.plugins,a=o.sheet;if(t.rules instanceof e)t.rules.update(n,r);else{var l=t,u=l.style;if(i.onUpdate(n,t,a,r),r.process&&u&&u!==l.style){for(var c in i.onProcessStyle(l.style,l,a),l.style){var s=l.style[c];s!==u[c]&&l.prop(c,s,X)}for(var f in u){var d=l.style[f],p=u[f];null==d&&d!==p&&l.prop(f,null,X)}}}},t.toString=function(e){for(var t="",n=this.options.sheet,r=!!n&&n.options.link,o=0;o<this.index.length;o++){var i=this.index[o].toString(e);(i||r)&&(t&&(t+="\n"),t+=i)}return t},e}(),Z=function(){function e(e,t){for(var n in this.options=void 0,this.deployed=void 0,this.attached=void 0,this.rules=void 0,this.renderer=void 0,this.classes=void 0,this.keyframes=void 0,this.queue=void 0,this.attached=!1,this.deployed=!1,this.classes={},this.keyframes={},this.options=Object(o.a)({},t,{sheet:this,parent:this,classes:this.classes,keyframes:this.keyframes}),t.Renderer&&(this.renderer=new t.Renderer(this)),this.rules=new Q(this.options),e)this.rules.add(n,e[n]);this.rules.process()}var t=e.prototype;return t.attach=function(){return this.attached||(this.renderer&&this.renderer.attach(),this.attached=!0,this.deployed||this.deploy()),this},t.detach=function(){return this.attached?(this.renderer&&this.renderer.detach(),this.attached=!1,this):this},t.addRule=function(e,t,n){var r=this.queue;this.attached&&!r&&(this.queue=[]);var o=this.rules.add(e,t,n);return o?(this.options.jss.plugins.onProcessRule(o),this.attached?this.deployed?(r?r.push(o):(this.insertRule(o),this.queue&&(this.queue.forEach(this.insertRule,this),this.queue=void 0)),o):o:(this.deployed=!1,o)):null},t.insertRule=function(e){this.renderer&&this.renderer.insertRule(e)},t.addRules=function(e,t){var n=[];for(var r in e){var o=this.addRule(r,e[r],t);o&&n.push(o)}return n},t.getRule=function(e){return this.rules.get(e)},t.deleteRule=function(e){var t="object"===typeof e?e:this.rules.get(e);return!!t&&(this.rules.remove(t),!(this.attached&&t.renderable&&this.renderer)||this.renderer.deleteRule(t.renderable))},t.indexOf=function(e){return this.rules.indexOf(e)},t.deploy=function(){return this.renderer&&this.renderer.deploy(),this.deployed=!0,this},t.update=function(){var e;return(e=this.rules).update.apply(e,arguments),this},t.updateOne=function(e,t,n){return this.rules.updateOne(e,t,n),this},t.toString=function(e){return this.rules.toString(e)},e}(),J=function(){function e(){this.plugins={internal:[],external:[]},this.registry=void 0}var t=e.prototype;return t.onCreateRule=function(e,t,n){for(var r=0;r<this.registry.onCreateRule.length;r++){var o=this.registry.onCreateRule[r](e,t,n);if(o)return o}return null},t.onProcessRule=function(e){if(!e.isProcessed){for(var t=e.options.sheet,n=0;n<this.registry.onProcessRule.length;n++)this.registry.onProcessRule[n](e,t);e.style&&this.onProcessStyle(e.style,e,t),e.isProcessed=!0}},t.onProcessStyle=function(e,t,n){for(var r=0;r<this.registry.onProcessStyle.length;r++)t.style=this.registry.onProcessStyle[r](t.style,t,n)},t.onProcessSheet=function(e){for(var t=0;t<this.registry.onProcessSheet.length;t++)this.registry.onProcessSheet[t](e)},t.onUpdate=function(e,t,n,r){for(var o=0;o<this.registry.onUpdate.length;o++)this.registry.onUpdate[o](e,t,n,r)},t.onChangeValue=function(e,t,n){for(var r=e,o=0;o<this.registry.onChangeValue.length;o++)r=this.registry.onChangeValue[o](r,t,n);return r},t.use=function(e,t){void 0===t&&(t={queue:"external"});var n=this.plugins[t.queue];-1===n.indexOf(e)&&(n.push(e),this.registry=[].concat(this.plugins.external,this.plugins.internal).reduce((function(e,t){for(var n in t)n in e&&e[n].push(t[n]);return e}),{onCreateRule:[],onProcessRule:[],onProcessStyle:[],onProcessSheet:[],onChangeValue:[],onUpdate:[]}))},e}(),ee=new(function(){function e(){this.registry=[]}var t=e.prototype;return t.add=function(e){var t=this.registry,n=e.options.index;if(-1===t.indexOf(e))if(0===t.length||n>=this.index)t.push(e);else for(var r=0;r<t.length;r++)if(t[r].options.index>n)return void t.splice(r,0,e)},t.reset=function(){this.registry=[]},t.remove=function(e){var t=this.registry.indexOf(e);this.registry.splice(t,1)},t.toString=function(e){for(var t=void 0===e?{}:e,n=t.attached,r=Object(d.a)(t,["attached"]),o="",i=0;i<this.registry.length;i++){var a=this.registry[i];null!=n&&a.attached!==n||(o&&(o+="\n"),o+=a.toString(r))}return o},Object(c.a)(e,[{key:"index",get:function(){return 0===this.registry.length?0:this.registry[this.registry.length-1].options.index}}]),e}()),te="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),ne="2f1acc6c3a606b082e5eef5e54414ffb";null==te[ne]&&(te[ne]=0);var re=te[ne]++,oe=function(e){void 0===e&&(e={});var t=0;return function(n,r){t+=1;var o="",i="";return r&&(r.options.classNamePrefix&&(i=r.options.classNamePrefix),null!=r.options.jss.id&&(o=String(r.options.jss.id))),e.minify?""+(i||"c")+re+o+t:i+n.key+"-"+re+(o?"-"+o:"")+"-"+t}},ie=function(e){var t;return function(){return t||(t=e()),t}};function ae(e,t){try{return e.attributeStyleMap?e.attributeStyleMap.get(t):e.style.getPropertyValue(t)}catch(n){return""}}function le(e,t,n){try{var r=n;if(Array.isArray(n)&&(r=g(n,!0),"!important"===n[n.length-1]))return e.style.setProperty(t,r,"important"),!0;e.attributeStyleMap?e.attributeStyleMap.set(t,r):e.style.setProperty(t,r)}catch(o){return!1}return!0}function ue(e,t){try{e.attributeStyleMap?e.attributeStyleMap.delete(t):e.style.removeProperty(t)}catch(n){}}function ce(e,t){return e.selectorText=t,e.selectorText===t}var se=ie((function(){return document.querySelector("head")}));function fe(e){var t=ee.registry;if(t.length>0){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.attached&&r.options.index>t.index&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if((n=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e))&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=e.insertionPoint;if(r&&"string"===typeof r){var o=function(e){for(var t=se(),n=0;n<t.childNodes.length;n++){var r=t.childNodes[n];if(8===r.nodeType&&r.nodeValue.trim()===e)return r}return null}(r);if(o)return{parent:o.parentNode,node:o.nextSibling}}return!1}var de=ie((function(){var e=document.querySelector('meta[property="csp-nonce"]');return e?e.getAttribute("content"):null})),pe=function(e,t,n){var r=e.cssRules.length;(void 0===n||n>r)&&(n=r);try{if("insertRule"in e)e.insertRule(t,n);else if("appendRule"in e){e.appendRule(t)}}catch(o){return!1}return e.cssRules[n]},he=function(){function e(e){this.getPropertyValue=ae,this.setProperty=le,this.removeProperty=ue,this.setSelector=ce,this.element=void 0,this.sheet=void 0,this.hasInsertedRules=!1,e&&ee.add(e),this.sheet=e;var t=this.sheet?this.sheet.options:{},n=t.media,r=t.meta,o=t.element;this.element=o||function(){var e=document.createElement("style");return e.textContent="\n",e}(),this.element.setAttribute("data-jss",""),n&&this.element.setAttribute("media",n),r&&this.element.setAttribute("data-meta",r);var i=de();i&&this.element.setAttribute("nonce",i)}var t=e.prototype;return t.attach=function(){if(!this.element.parentNode&&this.sheet){!function(e,t){var n=t.insertionPoint,r=fe(t);if(!1!==r&&r.parent)r.parent.insertBefore(e,r.node);else if(n&&"number"===typeof n.nodeType){var o=n,i=o.parentNode;i&&i.insertBefore(e,o.nextSibling)}else se().appendChild(e)}(this.element,this.sheet.options);var e=Boolean(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&e&&(this.hasInsertedRules=!1,this.deploy())}},t.detach=function(){var e=this.element.parentNode;e&&e.removeChild(this.element)},t.deploy=function(){var e=this.sheet;e&&(e.options.link?this.insertRules(e.rules):this.element.textContent="\n"+e.toString()+"\n")},t.insertRules=function(e,t){for(var n=0;n<e.index.length;n++)this.insertRule(e.index[n],n,t)},t.insertRule=function(e,t,n){if(void 0===n&&(n=this.element.sheet),e.rules){var r=e,o=n;return("conditional"!==e.type&&"keyframes"!==e.type||!1!==(o=pe(n,r.toString({children:!1}),t)))&&(this.insertRules(r.rules,o),o)}if(e.renderable&&e.renderable.parentStyleSheet===this.element.sheet)return e.renderable;var i=e.toString();if(!i)return!1;var a=pe(n,i,t);return!1!==a&&(this.hasInsertedRules=!0,e.renderable=a,a)},t.deleteRule=function(e){var t=this.element.sheet,n=this.indexOf(e);return-1!==n&&(t.deleteRule(n),!0)},t.indexOf=function(e){for(var t=this.element.sheet.cssRules,n=0;n<t.length;n++)if(e===t[n])return n;return-1},t.replaceRule=function(e,t){var n=this.indexOf(e);return-1!==n&&(this.element.sheet.deleteRule(n),this.insertRule(t,n))},t.getRules=function(){return this.element.sheet.cssRules},e}(),ve=0,me=function(){function e(e){this.id=ve++,this.version="10.4.0",this.plugins=new J,this.options={id:{minify:!1},createGenerateId:oe,Renderer:u?he:null,plugins:[]},this.generateId=oe({minify:!1});for(var t=0;t<G.length;t++)this.plugins.use(G[t],{queue:"internal"});this.setup(e)}var t=e.prototype;return t.setup=function(e){return void 0===e&&(e={}),e.createGenerateId&&(this.options.createGenerateId=e.createGenerateId),e.id&&(this.options.id=Object(o.a)({},this.options.id,e.id)),(e.createGenerateId||e.id)&&(this.generateId=this.options.createGenerateId(this.options.id)),null!=e.insertionPoint&&(this.options.insertionPoint=e.insertionPoint),"Renderer"in e&&(this.options.Renderer=e.Renderer),e.plugins&&this.use.apply(this,e.plugins),this},t.createStyleSheet=function(e,t){void 0===t&&(t={});var n=t.index;"number"!==typeof n&&(n=0===ee.index?0:ee.index+1);var r=new Z(e,Object(o.a)({},t,{jss:this,generateId:t.generateId||this.generateId,insertionPoint:this.options.insertionPoint,Renderer:this.options.Renderer,index:n}));return this.plugins.onProcessSheet(r),r},t.removeStyleSheet=function(e){return e.detach(),ee.remove(e),this},t.createRule=function(e,t,n){if(void 0===t&&(t={}),void 0===n&&(n={}),"object"===typeof e)return this.createRule(void 0,e,t);var r=Object(o.a)({},n,{name:e,jss:this,Renderer:this.options.Renderer});r.generateId||(r.generateId=this.generateId),r.classes||(r.classes={}),r.keyframes||(r.keyframes={});var i=v(e,t,r);return i&&this.plugins.onProcessRule(i),i},t.use=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return n.forEach((function(t){e.plugins.use(t)})),this},e}();var ge="undefined"!==typeof CSS&&CSS&&"number"in CSS,ye=function(e){return new me(e)},be=(ye(),n(433)),Se={set:function(e,t,n,r){var o=e.get(t);o||(o=new Map,e.set(t,o)),o.set(n,r)},get:function(e,t,n){var r=e.get(t);return r?r.get(n):void 0},delete:function(e,t,n){e.get(t).delete(n)}},we=n(401),Oe=(n(3),"function"===typeof Symbol&&Symbol.for?Symbol.for("mui.nested"):"__THEME_NESTED__"),Ce=["checked","disabled","error","focused","focusVisible","required","expanded","selected"];var xe=Date.now(),Ee="fnValues"+xe,ke="fnStyle"+ ++xe;var _e=function(){return{onCreateRule:function(e,t,n){if("function"!==typeof t)return null;var r=v(e,{},n);return r[ke]=t,r},onProcessStyle:function(e,t){if(Ee in t||ke in t)return e;var n={};for(var r in e){var o=e[r];"function"===typeof o&&(delete e[r],n[r]=o)}return t[Ee]=n,e},onUpdate:function(e,t,n,r){var o=t,i=o[ke];i&&(o.style=i(e)||{});var a=o[Ee];if(a)for(var l in a)o.prop(l,a[l](e),r)}}},Te="@global",je=function(){function e(e,t,n){for(var r in this.type="global",this.at=Te,this.rules=void 0,this.options=void 0,this.key=void 0,this.isProcessed=!1,this.key=e,this.options=n,this.rules=new Q(Object(o.a)({},n,{parent:this})),t)this.rules.add(r,t[r]);this.rules.process()}var t=e.prototype;return t.getRule=function(e){return this.rules.get(e)},t.addRule=function(e,t,n){var r=this.rules.add(e,t,n);return this.options.jss.plugins.onProcessRule(r),r},t.indexOf=function(e){return this.rules.indexOf(e)},t.toString=function(){return this.rules.toString()},e}(),Pe=function(){function e(e,t,n){this.type="global",this.at=Te,this.options=void 0,this.rule=void 0,this.isProcessed=!1,this.key=void 0,this.key=e,this.options=n;var r=e.substr("@global ".length);this.rule=n.jss.createRule(r,t,Object(o.a)({},n,{parent:this}))}return e.prototype.toString=function(e){return this.rule?this.rule.toString(e):""},e}(),Ae=/\s*,\s*/g;function Ie(e,t){for(var n=e.split(Ae),r="",o=0;o<n.length;o++)r+=t+" "+n[o].trim(),n[o+1]&&(r+=", ");return r}var Me=function(){return{onCreateRule:function(e,t,n){if(!e)return null;if(e===Te)return new je(e,t,n);if("@"===e[0]&&"@global "===e.substr(0,"@global ".length))return new Pe(e,t,n);var r=n.parent;return r&&("global"===r.type||r.options.parent&&"global"===r.options.parent.type)&&(n.scoped=!1),!1===n.scoped&&(n.selector=e),null},onProcessRule:function(e){"style"===e.type&&(function(e){var t=e.options,n=e.style,r=n?n[Te]:null;if(r){for(var i in r)t.sheet.addRule(i,r[i],Object(o.a)({},t,{selector:Ie(i,e.selector)}));delete n[Te]}}(e),function(e){var t=e.options,n=e.style;for(var r in n)if("@"===r[0]&&r.substr(0,Te.length)===Te){var i=Ie(r.substr(Te.length),e.selector);t.sheet.addRule(i,n[r],Object(o.a)({},t,{selector:i})),delete n[r]}}(e))}}},De=/\s*,\s*/g,Re=/&/g,Ne=/\$([\w-]+)/g;var Fe=function(){function e(e,t){return function(n,r){var o=e.getRule(r)||t&&t.getRule(r);return o?(o=o).selector:r}}function t(e,t){for(var n=t.split(De),r=e.split(De),o="",i=0;i<n.length;i++)for(var a=n[i],l=0;l<r.length;l++){var u=r[l];o&&(o+=", "),o+=-1!==u.indexOf("&")?u.replace(Re,a):a+" "+u}return o}function n(e,t,n){if(n)return Object(o.a)({},n,{index:n.index+1});var r=e.options.nestingLevel;r=void 0===r?1:r+1;var i=Object(o.a)({},e.options,{nestingLevel:r,index:t.indexOf(e)+1});return delete i.name,i}return{onProcessStyle:function(r,i,a){if("style"!==i.type)return r;var l,u,c=i,s=c.options.parent;for(var f in r){var d=-1!==f.indexOf("&"),p="@"===f[0];if(d||p){if(l=n(c,s,l),d){var h=t(f,c.selector);u||(u=e(s,a)),h=h.replace(Ne,u),s.addRule(h,r[f],Object(o.a)({},l,{selector:h}))}else p&&s.addRule(f,{},l).addRule(c.key,r[f],{selector:c.selector});delete r[f]}}return r}}},ze=/[A-Z]/g,Le=/^ms-/,Ve={};function He(e){return"-"+e.toLowerCase()}var Be=function(e){if(Ve.hasOwnProperty(e))return Ve[e];var t=e.replace(ze,He);return Ve[e]=Le.test(t)?"-"+t:t};function We(e){var t={};for(var n in e){t[0===n.indexOf("--")?n:Be(n)]=e[n]}return e.fallbacks&&(Array.isArray(e.fallbacks)?t.fallbacks=e.fallbacks.map(We):t.fallbacks=We(e.fallbacks)),t}var Ue=function(){return{onProcessStyle:function(e){if(Array.isArray(e)){for(var t=0;t<e.length;t++)e[t]=We(e[t]);return e}return We(e)},onChangeValue:function(e,t,n){if(0===t.indexOf("--"))return e;var r=Be(t);return t===r?e:(n.prop(r,e),null)}}},$e=ge&&CSS?CSS.px:"px",Ke=ge&&CSS?CSS.ms:"ms",qe=ge&&CSS?CSS.percent:"%";function Ge(e){var t=/(-[a-z])/g,n=function(e){return e[1].toUpperCase()},r={};for(var o in e)r[o]=e[o],r[o.replace(t,n)]=e[o];return r}var Ye=Ge({"animation-delay":Ke,"animation-duration":Ke,"background-position":$e,"background-position-x":$e,"background-position-y":$e,"background-size":$e,border:$e,"border-bottom":$e,"border-bottom-left-radius":$e,"border-bottom-right-radius":$e,"border-bottom-width":$e,"border-left":$e,"border-left-width":$e,"border-radius":$e,"border-right":$e,"border-right-width":$e,"border-top":$e,"border-top-left-radius":$e,"border-top-right-radius":$e,"border-top-width":$e,"border-width":$e,margin:$e,"margin-bottom":$e,"margin-left":$e,"margin-right":$e,"margin-top":$e,padding:$e,"padding-bottom":$e,"padding-left":$e,"padding-right":$e,"padding-top":$e,"mask-position-x":$e,"mask-position-y":$e,"mask-size":$e,height:$e,width:$e,"min-height":$e,"max-height":$e,"min-width":$e,"max-width":$e,bottom:$e,left:$e,top:$e,right:$e,"box-shadow":$e,"text-shadow":$e,"column-gap":$e,"column-rule":$e,"column-rule-width":$e,"column-width":$e,"font-size":$e,"font-size-delta":$e,"letter-spacing":$e,"text-indent":$e,"text-stroke":$e,"text-stroke-width":$e,"word-spacing":$e,motion:$e,"motion-offset":$e,outline:$e,"outline-offset":$e,"outline-width":$e,perspective:$e,"perspective-origin-x":qe,"perspective-origin-y":qe,"transform-origin":qe,"transform-origin-x":qe,"transform-origin-y":qe,"transform-origin-z":qe,"transition-delay":Ke,"transition-duration":Ke,"vertical-align":$e,"flex-basis":$e,"shape-margin":$e,size:$e,grid:$e,"grid-gap":$e,"grid-row-gap":$e,"grid-column-gap":$e,"grid-template-rows":$e,"grid-template-columns":$e,"grid-auto-rows":$e,"grid-auto-columns":$e,"box-shadow-x":$e,"box-shadow-y":$e,"box-shadow-blur":$e,"box-shadow-spread":$e,"font-line-height":$e,"text-shadow-x":$e,"text-shadow-y":$e,"text-shadow-blur":$e});function Xe(e,t,n){if(!t)return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)t[r]=Xe(e,t[r],n);else if("object"===typeof t)if("fallbacks"===e)for(var o in t)t[o]=Xe(o,t[o],n);else for(var i in t)t[i]=Xe(e+"-"+i,t[i],n);else if("number"===typeof t){var a=n[e]||Ye[e];return a?"function"===typeof a?a(t).toString():""+t+a:t.toString()}return t}var Qe=function(e){void 0===e&&(e={});var t=Ge(e);return{onProcessStyle:function(e,n){if("style"!==n.type)return e;for(var r in e)e[r]=Xe(r,e[r],t);return e},onChangeValue:function(e,n){return Xe(n,e,t)}}},Ze=n(44),Je="",et="",tt="",nt="",rt=u&&"ontouchstart"in document.documentElement;if(u){var ot={Moz:"-moz-",ms:"-ms-",O:"-o-",Webkit:"-webkit-"},it=document.createElement("p").style;for(var at in ot)if(at+"Transform"in it){Je=at,et=ot[at];break}"Webkit"===Je&&"msHyphens"in it&&(Je="ms",et=ot.ms,nt="edge"),"Webkit"===Je&&"-apple-trailing-word"in it&&(tt="apple")}var lt=Je,ut=et,ct=tt,st=nt,ft=rt;var dt={noPrefill:["appearance"],supportedProperty:function(e){return"appearance"===e&&("ms"===lt?"-webkit-"+e:ut+e)}},pt={noPrefill:["color-adjust"],supportedProperty:function(e){return"color-adjust"===e&&("Webkit"===lt?ut+"print-"+e:e)}},ht=/[-\s]+(.)?/g;function vt(e,t){return t?t.toUpperCase():""}function mt(e){return e.replace(ht,vt)}function gt(e){return mt("-"+e)}var yt,bt={noPrefill:["mask"],supportedProperty:function(e,t){if(!/^mask/.test(e))return!1;if("Webkit"===lt){if(mt("mask-image")in t)return e;if(lt+gt("mask-image")in t)return ut+e}return e}},St={noPrefill:["text-orientation"],supportedProperty:function(e){return"text-orientation"===e&&("apple"!==ct||ft?e:ut+e)}},wt={noPrefill:["transform"],supportedProperty:function(e,t,n){return"transform"===e&&(n.transform?e:ut+e)}},Ot={noPrefill:["transition"],supportedProperty:function(e,t,n){return"transition"===e&&(n.transition?e:ut+e)}},Ct={noPrefill:["writing-mode"],supportedProperty:function(e){return"writing-mode"===e&&("Webkit"===lt||"ms"===lt&&"edge"!==st?ut+e:e)}},xt={noPrefill:["user-select"],supportedProperty:function(e){return"user-select"===e&&("Moz"===lt||"ms"===lt||"apple"===ct?ut+e:e)}},Et={supportedProperty:function(e,t){return!!/^break-/.test(e)&&("Webkit"===lt?"WebkitColumn"+gt(e)in t&&ut+"column-"+e:"Moz"===lt&&("page"+gt(e)in t&&"page-"+e))}},kt={supportedProperty:function(e,t){if(!/^(border|margin|padding)-inline/.test(e))return!1;if("Moz"===lt)return e;var n=e.replace("-inline","");return lt+gt(n)in t&&ut+n}},_t={supportedProperty:function(e,t){return mt(e)in t&&e}},Tt={supportedProperty:function(e,t){var n=gt(e);return"-"===e[0]||"-"===e[0]&&"-"===e[1]?e:lt+n in t?ut+e:"Webkit"!==lt&&"Webkit"+n in t&&"-webkit-"+e}},jt={supportedProperty:function(e){return"scroll-snap"===e.substring(0,11)&&("ms"===lt?""+ut+e:e)}},Pt={supportedProperty:function(e){return"overscroll-behavior"===e&&("ms"===lt?ut+"scroll-chaining":e)}},At={"flex-grow":"flex-positive","flex-shrink":"flex-negative","flex-basis":"flex-preferred-size","justify-content":"flex-pack",order:"flex-order","align-items":"flex-align","align-content":"flex-line-pack"},It={supportedProperty:function(e,t){var n=At[e];return!!n&&(lt+gt(n)in t&&ut+n)}},Mt={flex:"box-flex","flex-grow":"box-flex","flex-direction":["box-orient","box-direction"],order:"box-ordinal-group","align-items":"box-align","flex-flow":["box-orient","box-direction"],"justify-content":"box-pack"},Dt=Object.keys(Mt),Rt=function(e){return ut+e},Nt=[dt,pt,bt,St,wt,Ot,Ct,xt,Et,kt,_t,Tt,jt,Pt,It,{supportedProperty:function(e,t,n){var r=n.multiple;if(Dt.indexOf(e)>-1){var o=Mt[e];if(!Array.isArray(o))return lt+gt(o)in t&&ut+o;if(!r)return!1;for(var i=0;i<o.length;i++)if(!(lt+gt(o[0])in t))return!1;return o.map(Rt)}return!1}}],Ft=Nt.filter((function(e){return e.supportedProperty})).map((function(e){return e.supportedProperty})),zt=Nt.filter((function(e){return e.noPrefill})).reduce((function(e,t){return e.push.apply(e,Object(Ze.a)(t.noPrefill)),e}),[]),Lt={};if(u){yt=document.createElement("p");var Vt=window.getComputedStyle(document.documentElement,"");for(var Ht in Vt)isNaN(Ht)||(Lt[Vt[Ht]]=Vt[Ht]);zt.forEach((function(e){return delete Lt[e]}))}function Bt(e,t){if(void 0===t&&(t={}),!yt)return e;if(null!=Lt[e])return Lt[e];"transition"!==e&&"transform"!==e||(t[e]=e in yt.style);for(var n=0;n<Ft.length&&(Lt[e]=Ft[n](e,yt.style,t),!Lt[e]);n++);try{yt.style[e]=""}catch(r){return!1}return Lt[e]}var Wt,Ut={},$t={transition:1,"transition-property":1,"-webkit-transition":1,"-webkit-transition-property":1},Kt=/(^\s*[\w-]+)|, (\s*[\w-]+)(?![^()]*\))/g;function qt(e,t,n){if("var"===t)return"var";if("all"===t)return"all";if("all"===n)return", all";var r=t?Bt(t):", "+Bt(n);return r||(t||n)}function Gt(e,t){var n=t;if(!Wt||"content"===e)return t;if("string"!==typeof n||!isNaN(parseInt(n,10)))return n;var r=e+n;if(null!=Ut[r])return Ut[r];try{Wt.style[e]=n}catch(o){return Ut[r]=!1,!1}if($t[e])n=n.replace(Kt,qt);else if(""===Wt.style[e]&&("-ms-flex"===(n=ut+n)&&(Wt.style[e]="-ms-flexbox"),Wt.style[e]=n,""===Wt.style[e]))return Ut[r]=!1,!1;return Wt.style[e]="",Ut[r]=n,Ut[r]}u&&(Wt=document.createElement("p"));var Yt=function(){function e(t){for(var n in t){var r=t[n];if("fallbacks"===n&&Array.isArray(r))t[n]=r.map(e);else{var o=!1,i=Bt(n);i&&i!==n&&(o=!0);var a=!1,l=Gt(i,g(r));l&&l!==r&&(a=!0),(o||a)&&(o&&delete t[n],t[i||n]=l||r)}}return t}return{onProcessRule:function(e){if("keyframes"===e.type){var t=e;t.at="-"===(n=t.at)[1]||"ms"===lt?n:"@"+ut+"keyframes"+n.substr(10)}var n},onProcessStyle:function(t,n){return"style"!==n.type?t:e(t)},onChangeValue:function(e,t){return Gt(t,g(e))||e}}};var Xt=function(){var e=function(e,t){return e.length===t.length?e>t?1:-1:e.length-t.length};return{onProcessStyle:function(t,n){if("style"!==n.type)return t;for(var r={},o=Object.keys(t).sort(e),i=0;i<o.length;i++)r[o[i]]=t[o[i]];return r}}};function Qt(){return{plugins:[_e(),Me(),Fe(),Ue(),Qe(),"undefined"===typeof window?null:Yt(),Xt()]}}var Zt=ye(Qt()),Jt={disableGeneration:!1,generateClassName:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.disableGlobal,n=void 0!==t&&t,r=e.productionPrefix,o=void 0===r?"jss":r,i=e.seed,a=void 0===i?"":i,l=""===a?"":"".concat(a,"-"),u=0,c=function(){return u+=1};return function(e,t){var r=t.options.name;if(r&&0===r.indexOf("Mui")&&!t.options.link&&!n){if(-1!==Ce.indexOf(e.key))return"Mui-".concat(e.key);var i="".concat(l).concat(r,"-").concat(e.key);return t.options.theme[Oe]&&""===a?"".concat(i,"-").concat(c()):i}return"".concat(l).concat(o).concat(c())}}(),jss:Zt,sheetsCache:null,sheetsManager:new Map,sheetsRegistry:null},en=a.a.createContext(Jt);var tn=-1e9;function nn(){return tn+=1}n(56);var rn=n(434);function on(e){var t="function"===typeof e;return{create:function(n,r){var i;try{i=t?e(n):e}catch(u){throw u}if(!r||!n.overrides||!n.overrides[r])return i;var a=n.overrides[r],l=Object(o.a)({},i);return Object.keys(a).forEach((function(e){l[e]=Object(rn.a)(l[e],a[e])})),l},options:{}}}var an={};function ln(e,t,n){var r=e.state;if(e.stylesOptions.disableGeneration)return t||{};r.cacheClasses||(r.cacheClasses={value:null,lastProp:null,lastJSS:{}});var o=!1;return r.classes!==r.cacheClasses.lastJSS&&(r.cacheClasses.lastJSS=r.classes,o=!0),t!==r.cacheClasses.lastProp&&(r.cacheClasses.lastProp=t,o=!0),o&&(r.cacheClasses.value=Object(be.a)({baseClasses:r.cacheClasses.lastJSS,newClasses:t,Component:n})),r.cacheClasses.value}function un(e,t){var n=e.state,r=e.theme,i=e.stylesOptions,a=e.stylesCreator,l=e.name;if(!i.disableGeneration){var u=Se.get(i.sheetsManager,a,r);u||(u={refs:0,staticSheet:null,dynamicStyles:null},Se.set(i.sheetsManager,a,r,u));var c=Object(o.a)(Object(o.a)(Object(o.a)({},a.options),i),{},{theme:r,flip:"boolean"===typeof i.flip?i.flip:"rtl"===r.direction});c.generateId=c.serverGenerateClassName||c.generateClassName;var s=i.sheetsRegistry;if(0===u.refs){var f;i.sheetsCache&&(f=Se.get(i.sheetsCache,a,r));var d=a.create(r,l);f||((f=i.jss.createStyleSheet(d,Object(o.a)({link:!1},c))).attach(),i.sheetsCache&&Se.set(i.sheetsCache,a,r,f)),s&&s.add(f),u.staticSheet=f,u.dynamicStyles=function e(t){var n=null;for(var r in t){var o=t[r],i=typeof o;if("function"===i)n||(n={}),n[r]=o;else if("object"===i&&null!==o&&!Array.isArray(o)){var a=e(o);a&&(n||(n={}),n[r]=a)}}return n}(d)}if(u.dynamicStyles){var p=i.jss.createStyleSheet(u.dynamicStyles,Object(o.a)({link:!0},c));p.update(t),p.attach(),n.dynamicSheet=p,n.classes=Object(be.a)({baseClasses:u.staticSheet.classes,newClasses:p.classes}),s&&s.add(p)}else n.classes=u.staticSheet.classes;u.refs+=1}}function cn(e,t){var n=e.state;n.dynamicSheet&&n.dynamicSheet.update(t)}function sn(e){var t=e.state,n=e.theme,r=e.stylesOptions,o=e.stylesCreator;if(!r.disableGeneration){var i=Se.get(r.sheetsManager,o,n);i.refs-=1;var a=r.sheetsRegistry;0===i.refs&&(Se.delete(r.sheetsManager,o,n),r.jss.removeStyleSheet(i.staticSheet),a&&a.remove(i.staticSheet)),t.dynamicSheet&&(r.jss.removeStyleSheet(t.dynamicSheet),a&&a.remove(t.dynamicSheet))}}function fn(e,t){var n,r=a.a.useRef([]),o=a.a.useMemo((function(){return{}}),t);r.current!==o&&(r.current=o,n=e()),a.a.useEffect((function(){return function(){n&&n()}}),[o])}function dn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.name,i=t.classNamePrefix,l=t.Component,u=t.defaultTheme,c=void 0===u?an:u,s=Object(r.a)(t,["name","classNamePrefix","Component","defaultTheme"]),f=on(e),d=n||i||"makeStyles";f.options={index:nn(),name:n,meta:d,classNamePrefix:d};var p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object(we.a)()||c,r=Object(o.a)(Object(o.a)({},a.a.useContext(en)),s),i=a.a.useRef(),u=a.a.useRef();fn((function(){var o={name:n,state:{},stylesCreator:f,stylesOptions:r,theme:t};return un(o,e),u.current=!1,i.current=o,function(){sn(o)}}),[t,f]),a.a.useEffect((function(){u.current&&cn(i.current,e),u.current=!0}));var d=ln(i.current,e.classes,l);return d};return p}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),o=n.n(r);var i=o.a.createContext(null);function a(){return o.a.useContext(i)}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=(n(3),n(4)),l=n(6),u=n(96),c=n(62),s=n(12),f=n(46),d=n(10),p="undefined"===typeof window?i.useEffect:i.useLayoutEffect,h=i.forwardRef((function(e,t){var n=e.alignItems,l=void 0===n?"center":n,h=e.autoFocus,v=void 0!==h&&h,m=e.button,g=void 0!==m&&m,y=e.children,b=e.classes,S=e.className,w=e.component,O=e.ContainerComponent,C=void 0===O?"li":O,x=e.ContainerProps,E=(x=void 0===x?{}:x).className,k=Object(o.a)(x,["className"]),_=e.dense,T=void 0!==_&&_,j=e.disabled,P=void 0!==j&&j,A=e.disableGutters,I=void 0!==A&&A,M=e.divider,D=void 0!==M&&M,R=e.focusVisibleClassName,N=e.selected,F=void 0!==N&&N,z=Object(o.a)(e,["alignItems","autoFocus","button","children","classes","className","component","ContainerComponent","ContainerProps","dense","disabled","disableGutters","divider","focusVisibleClassName","selected"]),L=i.useContext(f.a),V={dense:T||L.dense||!1,alignItems:l},H=i.useRef(null);p((function(){v&&H.current&&H.current.focus()}),[v]);var B=i.Children.toArray(y),W=B.length&&Object(c.a)(B[B.length-1],["ListItemSecondaryAction"]),U=i.useCallback((function(e){H.current=d.findDOMNode(e)}),[]),$=Object(s.a)(U,t),K=Object(r.a)({className:Object(a.default)(b.root,S,V.dense&&b.dense,!I&&b.gutters,D&&b.divider,P&&b.disabled,g&&b.button,"center"!==l&&b.alignItemsFlexStart,W&&b.secondaryAction,F&&b.selected),disabled:P},z),q=w||"li";return g&&(K.component=w||"div",K.focusVisibleClassName=Object(a.default)(b.focusVisible,R),q=u.a),W?(q=K.component||w?q:"div","li"===C&&("li"===q?q="div":"li"===K.component&&(K.component="div")),i.createElement(f.a.Provider,{value:V},i.createElement(C,Object(r.a)({className:Object(a.default)(b.container,E),ref:$},k),i.createElement(q,K,B),B.pop()))):i.createElement(f.a.Provider,{value:V},i.createElement(q,Object(r.a)({ref:$},K),B))}));t.a=Object(l.a)((function(e){return{root:{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,"&$focusVisible":{backgroundColor:e.palette.action.selected},"&$selected, &$selected:hover":{backgroundColor:e.palette.action.selected},"&$disabled":{opacity:.5}},container:{position:"relative"},focusVisible:{},dense:{paddingTop:4,paddingBottom:4},alignItemsFlexStart:{alignItems:"flex-start"},disabled:{},divider:{borderBottom:"1px solid ".concat(e.palette.divider),backgroundClip:"padding-box"},gutters:{paddingLeft:16,paddingRight:16},button:{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:e.palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}},secondaryAction:{paddingRight:48},selected:{}}}),{name:"MuiListItem"})(h)},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(1);function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.baseClasses,n=e.newClasses;e.Component;if(!n)return t;var o=Object(r.a)({},t);return Object.keys(n).forEach((function(e){n[e]&&(o[e]="".concat(t[e]," ").concat(n[e]))})),o}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(1),o=n(56);function i(e){return e&&"object"===Object(o.a)(e)&&e.constructor===Object}function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0},o=n.clone?Object(r.a)({},e):e;return i(e)&&i(t)&&Object.keys(t).forEach((function(r){"__proto__"!==r&&(i(t[r])&&r in e?o[r]=a(e[r],t[r],n):o[r]=t[r])})),o}},function(e,t,n){"use strict";function r(e){var t=e.theme,n=e.name,r=e.props;if(!t||!t.props||!t.props[n])return r;var o,i=t.props[n];for(o in i)void 0===r[o]&&(r[o]=i[o]);return r}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=(n(3),n(4)),l=n(6),u=n(94),c=n(46),s=i.forwardRef((function(e,t){var n=e.children,l=e.classes,s=e.className,f=e.disableTypography,d=void 0!==f&&f,p=e.inset,h=void 0!==p&&p,v=e.primary,m=e.primaryTypographyProps,g=e.secondary,y=e.secondaryTypographyProps,b=Object(o.a)(e,["children","classes","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"]),S=i.useContext(c.a).dense,w=null!=v?v:n;null==w||w.type===u.a||d||(w=i.createElement(u.a,Object(r.a)({variant:S?"body2":"body1",className:l.primary,component:"span",display:"block"},m),w));var O=g;return null==O||O.type===u.a||d||(O=i.createElement(u.a,Object(r.a)({variant:"body2",className:l.secondary,color:"textSecondary",display:"block"},y),O)),i.createElement("div",Object(r.a)({className:Object(a.default)(l.root,s,S&&l.dense,h&&l.inset,w&&O&&l.multiline),ref:t},b),w,O)}));t.a=Object(l.a)({root:{flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},multiline:{marginTop:6,marginBottom:6},dense:{},inset:{paddingLeft:56},primary:{},secondary:{}},{name:"MuiListItemText"})(s)},function(e,t,n){"use strict";var r=n(1),o=n(400),i=n(61);t.a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(o.a)(e,Object(r.a)({defaultTheme:i.a},t))}},function(e,t,n){"use strict";var r=n(2),o=n(1),i=n(0),a=(n(3),n(4)),l=n(6),u=n(15),c=n(96),s=n(7),f=i.forwardRef((function(e,t){var n=e.children,l=e.classes,u=e.className,f=e.color,d=void 0===f?"default":f,p=e.component,h=void 0===p?"button":p,v=e.disabled,m=void 0!==v&&v,g=e.disableElevation,y=void 0!==g&&g,b=e.disableFocusRipple,S=void 0!==b&&b,w=e.endIcon,O=e.focusVisibleClassName,C=e.fullWidth,x=void 0!==C&&C,E=e.size,k=void 0===E?"medium":E,_=e.startIcon,T=e.type,j=void 0===T?"button":T,P=e.variant,A=void 0===P?"text":P,I=Object(r.a)(e,["children","classes","className","color","component","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"]),M=_&&i.createElement("span",{className:Object(a.default)(l.startIcon,l["iconSize".concat(Object(s.a)(k))])},_),D=w&&i.createElement("span",{className:Object(a.default)(l.endIcon,l["iconSize".concat(Object(s.a)(k))])},w);return i.createElement(c.a,Object(o.a)({className:Object(a.default)(l.root,l[A],u,"inherit"===d?l.colorInherit:"default"!==d&&l["".concat(A).concat(Object(s.a)(d))],"medium"!==k&&[l["".concat(A,"Size").concat(Object(s.a)(k))],l["size".concat(Object(s.a)(k))]],y&&l.disableElevation,m&&l.disabled,x&&l.fullWidth),component:h,disabled:m,focusRipple:!S,focusVisibleClassName:Object(a.default)(l.focusVisible,O),ref:t,type:j},I),i.createElement("span",{className:l.label},M,n,D))}));t.a=Object(l.a)((function(e){return{root:Object(o.a)({},e.typography.button,{boxSizing:"border-box",minWidth:64,padding:"6px 16px",borderRadius:e.shape.borderRadius,color:e.palette.text.primary,transition:e.transitions.create(["background-color","box-shadow","border"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none",backgroundColor:Object(u.b)(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"},"&$disabled":{backgroundColor:"transparent"}},"&$disabled":{color:e.palette.action.disabled}}),label:{width:"100%",display:"inherit",alignItems:"inherit",justifyContent:"inherit"},text:{padding:"6px 8px"},textPrimary:{color:e.palette.primary.main,"&:hover":{backgroundColor:Object(u.b)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},textSecondary:{color:e.palette.secondary.main,"&:hover":{backgroundColor:Object(u.b)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},outlined:{padding:"5px 15px",border:"1px solid ".concat("light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"),"&$disabled":{border:"1px solid ".concat(e.palette.action.disabledBackground)}},outlinedPrimary:{color:e.palette.primary.main,border:"1px solid ".concat(Object(u.b)(e.palette.primary.main,.5)),"&:hover":{border:"1px solid ".concat(e.palette.primary.main),backgroundColor:Object(u.b)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},outlinedSecondary:{color:e.palette.secondary.main,border:"1px solid ".concat(Object(u.b)(e.palette.secondary.main,.5)),"&:hover":{border:"1px solid ".concat(e.palette.secondary.main),backgroundColor:Object(u.b)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"&$disabled":{border:"1px solid ".concat(e.palette.action.disabled)}},contained:{color:e.palette.getContrastText(e.palette.grey[300]),backgroundColor:e.palette.grey[300],boxShadow:e.shadows[2],"&:hover":{backgroundColor:e.palette.grey.A100,boxShadow:e.shadows[4],"@media (hover: none)":{boxShadow:e.shadows[2],backgroundColor:e.palette.grey[300]},"&$disabled":{backgroundColor:e.palette.action.disabledBackground}},"&$focusVisible":{boxShadow:e.shadows[6]},"&:active":{boxShadow:e.shadows[8]},"&$disabled":{color:e.palette.action.disabled,boxShadow:e.shadows[0],backgroundColor:e.palette.action.disabledBackground}},containedPrimary:{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.main,"&:hover":{backgroundColor:e.palette.primary.dark,"@media (hover: none)":{backgroundColor:e.palette.primary.main}}},containedSecondary:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.main,"&:hover":{backgroundColor:e.palette.secondary.dark,"@media (hover: none)":{backgroundColor:e.palette.secondary.main}}},disableElevation:{boxShadow:"none","&:hover":{boxShadow:"none"},"&$focusVisible":{boxShadow:"none"},"&:active":{boxShadow:"none"},"&$disabled":{boxShadow:"none"}},focusVisible:{},disabled:{},colorInherit:{color:"inherit",borderColor:"currentColor"},textSizeSmall:{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},textSizeLarge:{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},outlinedSizeSmall:{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},outlinedSizeLarge:{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},containedSizeSmall:{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},containedSizeLarge:{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},sizeSmall:{},sizeLarge:{},fullWidth:{width:"100%"},startIcon:{display:"inherit",marginRight:8,marginLeft:-4,"&$iconSizeSmall":{marginLeft:-2}},endIcon:{display:"inherit",marginRight:-4,marginLeft:8,"&$iconSizeSmall":{marginRight:-2}},iconSizeSmall:{"& > *:first-child":{fontSize:18}},iconSizeMedium:{"& > *:first-child":{fontSize:20}},iconSizeLarge:{"& > *:first-child":{fontSize:22}}}}),{name:"MuiButton"})(f)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=(n(3),n(4)),l=n(6),u=n(7),c=n(177),s=i.forwardRef((function(e,t){var n=e.classes,l=e.className,s=e.color,f=void 0===s?"primary":s,d=e.position,p=void 0===d?"fixed":d,h=Object(o.a)(e,["classes","className","color","position"]);return i.createElement(c.a,Object(r.a)({square:!0,component:"header",elevation:4,className:Object(a.default)(n.root,n["position".concat(Object(u.a)(p))],n["color".concat(Object(u.a)(f))],l,"fixed"===p&&"mui-fixed"),ref:t},h))}));t.a=Object(l.a)((function(e){var t="light"===e.palette.type?e.palette.grey[100]:e.palette.grey[900];return{root:{display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",zIndex:e.zIndex.appBar,flexShrink:0},positionFixed:{position:"fixed",top:0,left:"auto",right:0,"@media print":{position:"absolute"}},positionAbsolute:{position:"absolute",top:0,left:"auto",right:0},positionSticky:{position:"sticky",top:0,left:"auto",right:0},positionStatic:{position:"static"},positionRelative:{position:"relative"},colorDefault:{backgroundColor:t,color:e.palette.getContrastText(t)},colorPrimary:{backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText},colorSecondary:{backgroundColor:e.palette.secondary.main,color:e.palette.secondary.contrastText},colorInherit:{color:"inherit"},colorTransparent:{backgroundColor:"transparent",color:"inherit"}}}),{name:"MuiAppBar"})(s)},function(e,t,n){"use strict";var r=n(2),o=n(14),i=n(1),a=n(0),l=(n(3),n(4)),u=n(6),c=n(96),s=n(7),f=a.forwardRef((function(e,t){var n=e.classes,o=e.className,u=e.disabled,f=void 0!==u&&u,d=e.disableFocusRipple,p=void 0!==d&&d,h=e.fullWidth,v=e.icon,m=e.indicator,g=e.label,y=e.onChange,b=e.onClick,S=e.onFocus,w=e.selected,O=e.selectionFollowsFocus,C=e.textColor,x=void 0===C?"inherit":C,E=e.value,k=e.wrapped,_=void 0!==k&&k,T=Object(r.a)(e,["classes","className","disabled","disableFocusRipple","fullWidth","icon","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"]);return a.createElement(c.a,Object(i.a)({focusRipple:!p,className:Object(l.default)(n.root,n["textColor".concat(Object(s.a)(x))],o,f&&n.disabled,w&&n.selected,g&&v&&n.labelIcon,h&&n.fullWidth,_&&n.wrapped),ref:t,role:"tab","aria-selected":w,disabled:f,onClick:function(e){y&&y(e,E),b&&b(e)},onFocus:function(e){O&&!w&&y&&y(e,E),S&&S(e)},tabIndex:w?0:-1},T),a.createElement("span",{className:n.wrapper},v,g),m)}));t.a=Object(u.a)((function(e){var t;return{root:Object(i.a)({},e.typography.button,(t={maxWidth:264,minWidth:72,position:"relative",boxSizing:"border-box",minHeight:48,flexShrink:0,padding:"6px 12px"},Object(o.a)(t,e.breakpoints.up("sm"),{padding:"6px 24px"}),Object(o.a)(t,"overflow","hidden"),Object(o.a)(t,"whiteSpace","normal"),Object(o.a)(t,"textAlign","center"),Object(o.a)(t,e.breakpoints.up("sm"),{minWidth:160}),t)),labelIcon:{minHeight:72,paddingTop:9,"& $wrapper > *:first-child":{marginBottom:6}},textColorInherit:{color:"inherit",opacity:.7,"&$selected":{opacity:1},"&$disabled":{opacity:.5}},textColorPrimary:{color:e.palette.text.secondary,"&$selected":{color:e.palette.primary.main},"&$disabled":{color:e.palette.text.disabled}},textColorSecondary:{color:e.palette.text.secondary,"&$selected":{color:e.palette.secondary.main},"&$disabled":{color:e.palette.text.disabled}},selected:{},disabled:{},fullWidth:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},wrapped:{fontSize:e.typography.pxToRem(12),lineHeight:1.5},wrapper:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"100%",flexDirection:"column"}}}),{name:"MuiTab"})(f)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=(n(3),n(4)),l=n(6),u=n(116),c=i.forwardRef((function(e,t){var n=e.children,l=e.className,c=e.classes,s=e.value,f=Object(o.a)(e,["children","className","classes","value"]),d=Object(u.d)();if(null===d)throw new TypeError("No TabContext provided");var p=Object(u.b)(d,s),h=Object(u.c)(d,s);return i.createElement("div",Object(r.a)({"aria-labelledby":h,className:Object(a.default)(c.root,l),hidden:s!==d.value,id:p,ref:t,role:"tabpanel"},f),s===d.value&&n)}));t.a=Object(l.a)((function(e){return{root:{padding:e.spacing(3)}}}),{name:"MuiTabPanel"})(c)},function(e,t,n){"use strict";var r=n(0),o=n(10),i=(n(3),n(26)),a=n(12);var l="undefined"!==typeof window?r.useLayoutEffect:r.useEffect,u=r.forwardRef((function(e,t){var n=e.children,u=e.container,c=e.disablePortal,s=void 0!==c&&c,f=e.onRendered,d=r.useState(null),p=d[0],h=d[1],v=Object(a.a)(r.isValidElement(n)?n.ref:null,t);return l((function(){s||h(function(e){return e="function"===typeof e?e():e,o.findDOMNode(e)}(u)||document.body)}),[u,s]),l((function(){if(p&&!s)return Object(i.a)(t,p),function(){Object(i.a)(t,null)}}),[t,p,s]),l((function(){f&&(p||s)&&f()}),[f,p,s]),s?r.isValidElement(n)?r.cloneElement(n,{ref:v}):n:p?o.createPortal(n,p):p}));t.a=u},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=(n(3),n(4)),l=n(177),u=n(6),c=i.forwardRef((function(e,t){var n=e.classes,u=e.className,c=e.raised,s=void 0!==c&&c,f=Object(o.a)(e,["classes","className","raised"]);return i.createElement(l.a,Object(r.a)({className:Object(a.default)(n.root,u),elevation:s?8:1,ref:t},f))}));t.a=Object(u.a)({root:{overflow:"hidden"}},{name:"MuiCard"})(c)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=(n(3),n(4)),l=n(6),u=i.forwardRef((function(e,t){var n=e.classes,l=e.className,u=e.component,c=void 0===u?"div":u,s=Object(o.a)(e,["classes","className","component"]);return i.createElement(c,Object(r.a)({className:Object(a.default)(n.root,l),ref:t},s))}));t.a=Object(l.a)({root:{padding:16,"&:last-child":{paddingBottom:24}}},{name:"MuiCardContent"})(u)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=(n(3),n(4)),l=n(6),u=n(15),c=n(96),s=n(7),f=i.forwardRef((function(e,t){var n=e.edge,l=void 0!==n&&n,u=e.children,f=e.classes,d=e.className,p=e.color,h=void 0===p?"default":p,v=e.disabled,m=void 0!==v&&v,g=e.disableFocusRipple,y=void 0!==g&&g,b=e.size,S=void 0===b?"medium":b,w=Object(o.a)(e,["edge","children","classes","className","color","disabled","disableFocusRipple","size"]);return i.createElement(c.a,Object(r.a)({className:Object(a.default)(f.root,d,"default"!==h&&f["color".concat(Object(s.a)(h))],m&&f.disabled,"small"===S&&f["size".concat(Object(s.a)(S))],{start:f.edgeStart,end:f.edgeEnd}[l]),centerRipple:!0,focusRipple:!y,disabled:m,ref:t},w),i.createElement("span",{className:f.label},u))}));t.a=Object(l.a)((function(e){return{root:{textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:12,borderRadius:"50%",overflow:"visible",color:e.palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{backgroundColor:Object(u.b)(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"&$disabled":{backgroundColor:"transparent",color:e.palette.action.disabled}},edgeStart:{marginLeft:-12,"$sizeSmall&":{marginLeft:-3}},edgeEnd:{marginRight:-12,"$sizeSmall&":{marginRight:-3}},colorInherit:{color:"inherit"},colorPrimary:{color:e.palette.primary.main,"&:hover":{backgroundColor:Object(u.b)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},colorSecondary:{color:e.palette.secondary.main,"&:hover":{backgroundColor:Object(u.b)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},disabled:{},sizeSmall:{padding:3,fontSize:e.typography.pxToRem(18)},label:{width:"100%",display:"flex",alignItems:"inherit",justifyContent:"inherit"}}}),{name:"MuiIconButton"})(f)},function(e,t,n){"use strict";var r=n(0),o=n.n(r),i=n(25);t.a=Object(i.a)(o.a.createElement("path",{d:"M6 18l8.5-6L6 6v12zM16 6v12h2V6h-2z"}),"SkipNext")},function(e,t,n){"use strict";var r=n(0),o=n.n(r),i=n(25);t.a=Object(i.a)(o.a.createElement("path",{d:"M6 6h2v12H6zm3.5 6l8.5 6V6z"}),"SkipPrevious")},function(e,t,n){"use strict";var r=n(0),o=n.n(r),i=n(25);t.a=Object(i.a)(o.a.createElement("path",{d:"M8 5v14l11-7z"}),"PlayArrow")},function(e,t,n){"use strict";var r=n(0),o=n.n(r),i=n(25);t.a=Object(i.a)(o.a.createElement("path",{d:"M6 6h12v12H6z"}),"Stop")},function(e,t,n){"use strict";var r=n(0),o=n.n(r),i=n(25);t.a=Object(i.a)(o.a.createElement("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"}),"Pause")},function(e,t,n){"use strict";var r=n(0),o=n.n(r),i=n(25);t.a=Object(i.a)(o.a.createElement("path",{d:"M10.59 9.17L5.41 4 4 5.41l5.17 5.17 1.42-1.41zM14.5 4l2.04 2.04L4 18.59 5.41 20 17.96 7.46 20 9.5V4h-5.5zm.33 9.41l-1.41 1.41 3.13 3.13L14.5 20H20v-5.5l-2.04 2.04-3.13-3.13z"}),"Shuffle")},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=(n(3),n(4)),l=n(6),u=["video","audio","picture","iframe","img"],c=i.forwardRef((function(e,t){var n=e.children,l=e.classes,c=e.className,s=e.component,f=void 0===s?"div":s,d=e.image,p=e.src,h=e.style,v=Object(o.a)(e,["children","classes","className","component","image","src","style"]),m=-1!==u.indexOf(f),g=!m&&d?Object(r.a)({backgroundImage:'url("'.concat(d,'")')},h):h;return i.createElement(f,Object(r.a)({className:Object(a.default)(l.root,c,m&&l.media,-1!=="picture img".indexOf(f)&&l.img),ref:t,style:g,src:m?d||p:void 0},v),n)}));t.a=Object(l.a)({root:{display:"block",backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center"},media:{width:"100%"},img:{objectFit:"cover"}},{name:"MuiCardMedia"})(c)},function(e,t,n){"use strict";var r=n(1),o=n(2),i=n(0),a=(n(3),n(4)),l=n(176);function u(e){var t=e.props,n=e.states,r=e.muiFormControl;return n.reduce((function(e,n){return e[n]=t[n],r&&"undefined"===typeof t[n]&&(e[n]=r[n]),e}),{})}var c=i.createContext();var s=c,f=n(6),d=n(7),p=n(12),h=n(37);function v(e,t){return parseInt(e[t],10)||0}var m="undefined"!==typeof window?i.useLayoutEffect:i.useEffect,g={visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"},y=i.forwardRef((function(e,t){var n=e.onChange,a=e.rows,l=e.rowsMax,u=e.rowsMin,c=void 0===u?1:u,s=e.style,f=e.value,d=Object(o.a)(e,["onChange","rows","rowsMax","rowsMin","style","value"]),y=a||c,b=i.useRef(null!=f).current,S=i.useRef(null),w=Object(p.a)(t,S),O=i.useRef(null),C=i.useRef(0),x=i.useState({}),E=x[0],k=x[1],_=i.useCallback((function(){var t=S.current,n=window.getComputedStyle(t),r=O.current;r.style.width=n.width,r.value=t.value||e.placeholder||"x","\n"===r.value.slice(-1)&&(r.value+=" ");var o=n["box-sizing"],i=v(n,"padding-bottom")+v(n,"padding-top"),a=v(n,"border-bottom-width")+v(n,"border-top-width"),u=r.scrollHeight-i;r.value="x";var c=r.scrollHeight-i,s=u;y&&(s=Math.max(Number(y)*c,s)),l&&(s=Math.min(Number(l)*c,s));var f=(s=Math.max(s,c))+("border-box"===o?i+a:0),d=Math.abs(s-u)<=1;k((function(e){return C.current<20&&(f>0&&Math.abs((e.outerHeightStyle||0)-f)>1||e.overflow!==d)?(C.current+=1,{overflow:d,outerHeightStyle:f}):e}))}),[l,y,e.placeholder]);i.useEffect((function(){var e=Object(h.a)((function(){C.current=0,_()}));return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}),[_]),m((function(){_()})),i.useEffect((function(){C.current=0}),[f]);return i.createElement(i.Fragment,null,i.createElement("textarea",Object(r.a)({value:f,onChange:function(e){C.current=0,b||_(),n&&n(e)},ref:w,rows:y,style:Object(r.a)({height:E.outerHeightStyle,overflow:E.overflow?"hidden":null},s)},d)),i.createElement("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:O,tabIndex:-1,style:Object(r.a)({},g,s)}))}));function b(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function S(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&(b(e.value)&&""!==e.value||t&&b(e.defaultValue)&&""!==e.defaultValue)}var w="undefined"===typeof window?i.useEffect:i.useLayoutEffect,O=i.forwardRef((function(e,t){var n=e["aria-describedby"],f=e.autoComplete,h=e.autoFocus,v=e.classes,m=e.className,g=(e.color,e.defaultValue),b=e.disabled,O=e.endAdornment,C=(e.error,e.fullWidth),x=void 0!==C&&C,E=e.id,k=e.inputComponent,_=void 0===k?"input":k,T=e.inputProps,j=void 0===T?{}:T,P=e.inputRef,A=(e.margin,e.multiline),I=void 0!==A&&A,M=e.name,D=e.onBlur,R=e.onChange,N=e.onClick,F=e.onFocus,z=e.onKeyDown,L=e.onKeyUp,V=e.placeholder,H=e.readOnly,B=e.renderSuffix,W=e.rows,U=e.rowsMax,$=e.rowsMin,K=e.startAdornment,q=e.type,G=void 0===q?"text":q,Y=e.value,X=Object(o.a)(e,["aria-describedby","autoComplete","autoFocus","classes","className","color","defaultValue","disabled","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","rowsMax","rowsMin","startAdornment","type","value"]),Q=null!=j.value?j.value:Y,Z=i.useRef(null!=Q).current,J=i.useRef(),ee=i.useCallback((function(e){0}),[]),te=Object(p.a)(j.ref,ee),ne=Object(p.a)(P,te),re=Object(p.a)(J,ne),oe=i.useState(!1),ie=oe[0],ae=oe[1],le=i.useContext(c);var ue=u({props:e,muiFormControl:le,states:["color","disabled","error","hiddenLabel","margin","required","filled"]});ue.focused=le?le.focused:ie,i.useEffect((function(){!le&&b&&ie&&(ae(!1),D&&D())}),[le,b,ie,D]);var ce=le&&le.onFilled,se=le&&le.onEmpty,fe=i.useCallback((function(e){S(e)?ce&&ce():se&&se()}),[ce,se]);w((function(){Z&&fe({value:Q})}),[Q,fe,Z]);i.useEffect((function(){fe(J.current)}),[]);var de=_,pe=Object(r.a)({},j,{ref:re});"string"!==typeof de?pe=Object(r.a)({inputRef:re,type:G},pe,{ref:null}):I?!W||U||$?(pe=Object(r.a)({rows:W,rowsMax:U},pe),de=y):de="textarea":pe=Object(r.a)({type:G},pe);return i.useEffect((function(){le&&le.setAdornedStart(Boolean(K))}),[le,K]),i.createElement("div",Object(r.a)({className:Object(a.default)(v.root,v["color".concat(Object(d.a)(ue.color||"primary"))],m,ue.disabled&&v.disabled,ue.error&&v.error,x&&v.fullWidth,ue.focused&&v.focused,le&&v.formControl,I&&v.multiline,K&&v.adornedStart,O&&v.adornedEnd,"dense"===ue.margin&&v.marginDense),onClick:function(e){J.current&&e.currentTarget===e.target&&J.current.focus(),N&&N(e)},ref:t},X),K,i.createElement(s.Provider,{value:null},i.createElement(de,Object(r.a)({"aria-invalid":ue.error,"aria-describedby":n,autoComplete:f,autoFocus:h,defaultValue:g,disabled:ue.disabled,id:E,onAnimationStart:function(e){fe("mui-auto-fill-cancel"===e.animationName?J.current:{value:"x"})},name:M,placeholder:V,readOnly:H,required:ue.required,rows:W,value:Q,onKeyDown:z,onKeyUp:L},pe,{className:Object(a.default)(v.input,j.className,ue.disabled&&v.disabled,I&&v.inputMultiline,ue.hiddenLabel&&v.inputHiddenLabel,K&&v.inputAdornedStart,O&&v.inputAdornedEnd,"search"===G&&v.inputTypeSearch,"dense"===ue.margin&&v.inputMarginDense),onBlur:function(e){D&&D(e),j.onBlur&&j.onBlur(e),le&&le.onBlur?le.onBlur(e):ae(!1)},onChange:function(e){if(!Z){var t=e.target||J.current;if(null==t)throw new Error(Object(l.a)(1));fe({value:t.value})}for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];j.onChange&&j.onChange.apply(j,[e].concat(r)),R&&R.apply(void 0,[e].concat(r))},onFocus:function(e){ue.disabled?e.stopPropagation():(F&&F(e),j.onFocus&&j.onFocus(e),le&&le.onFocus?le.onFocus(e):ae(!0))}}))),O,B?B(Object(r.a)({},ue,{startAdornment:K})):null)})),C=Object(f.a)((function(e){var t="light"===e.palette.type,n={color:"currentColor",opacity:t?.42:.5,transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})},o={opacity:"0 !important"},i={opacity:t?.42:.5};return{"@global":{"@keyframes mui-auto-fill":{},"@keyframes mui-auto-fill-cancel":{}},root:Object(r.a)({},e.typography.body1,{color:e.palette.text.primary,lineHeight:"1.1876em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center","&$disabled":{color:e.palette.text.disabled,cursor:"default"}}),formControl:{},focused:{},disabled:{},adornedStart:{},adornedEnd:{},error:{},marginDense:{},multiline:{padding:"".concat(6,"px 0 ").concat(7,"px"),"&$marginDense":{paddingTop:3}},colorSecondary:{},fullWidth:{width:"100%"},input:{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"".concat(6,"px 0 ").concat(7,"px"),border:0,boxSizing:"content-box",background:"none",height:"1.1876em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&:-ms-input-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{"-webkit-appearance":"none"},"label[data-shrink=false] + $formControl &":{"&::-webkit-input-placeholder":o,"&::-moz-placeholder":o,"&:-ms-input-placeholder":o,"&::-ms-input-placeholder":o,"&:focus::-webkit-input-placeholder":i,"&:focus::-moz-placeholder":i,"&:focus:-ms-input-placeholder":i,"&:focus::-ms-input-placeholder":i},"&$disabled":{opacity:1},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},inputMarginDense:{paddingTop:3},inputMultiline:{height:"auto",resize:"none",padding:0},inputTypeSearch:{"-moz-appearance":"textfield","-webkit-appearance":"textfield"},inputAdornedStart:{},inputAdornedEnd:{},inputHiddenLabel:{}}}),{name:"MuiInputBase"})(O),x=i.forwardRef((function(e,t){var n=e.disableUnderline,l=e.classes,u=e.fullWidth,c=void 0!==u&&u,s=e.inputComponent,f=void 0===s?"input":s,d=e.multiline,p=void 0!==d&&d,h=e.type,v=void 0===h?"text":h,m=Object(o.a)(e,["disableUnderline","classes","fullWidth","inputComponent","multiline","type"]);return i.createElement(C,Object(r.a)({classes:Object(r.a)({},l,{root:Object(a.default)(l.root,!n&&l.underline),underline:null}),fullWidth:c,inputComponent:f,multiline:p,ref:t,type:v},m))}));x.muiName="Input";var E=Object(f.a)((function(e){var t="light"===e.palette.type?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return{root:{position:"relative"},formControl:{"label + &":{marginTop:16}},focused:{},disabled:{},colorSecondary:{"&$underline:after":{borderBottomColor:e.palette.secondary.main}},underline:{"&:after":{borderBottom:"2px solid ".concat(e.palette.primary.main),left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},"&$focused:after":{transform:"scaleX(1)"},"&$error:after":{borderBottomColor:e.palette.error.main,transform:"scaleX(1)"},"&:before":{borderBottom:"1px solid ".concat(t),left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},"&:hover:not($disabled):before":{borderBottom:"2px solid ".concat(e.palette.text.primary),"@media (hover: none)":{borderBottom:"1px solid ".concat(t)}},"&$disabled:before":{borderBottomStyle:"dotted"}},error:{},marginDense:{},multiline:{},fullWidth:{},input:{},inputMarginDense:{},inputMultiline:{},inputTypeSearch:{}}}),{name:"MuiInput"})(x),k=i.forwardRef((function(e,t){var n=e.disableUnderline,l=e.classes,u=e.fullWidth,c=void 0!==u&&u,s=e.inputComponent,f=void 0===s?"input":s,d=e.multiline,p=void 0!==d&&d,h=e.type,v=void 0===h?"text":h,m=Object(o.a)(e,["disableUnderline","classes","fullWidth","inputComponent","multiline","type"]);return i.createElement(C,Object(r.a)({classes:Object(r.a)({},l,{root:Object(a.default)(l.root,!n&&l.underline),underline:null}),fullWidth:c,inputComponent:f,multiline:p,ref:t,type:v},m))}));k.muiName="Input";var _=Object(f.a)((function(e){var t="light"===e.palette.type,n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.09)";return{root:{position:"relative",backgroundColor:r,borderTopLeftRadius:e.shape.borderRadius,borderTopRightRadius:e.shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:t?"rgba(0, 0, 0, 0.13)":"rgba(255, 255, 255, 0.13)","@media (hover: none)":{backgroundColor:r}},"&$focused":{backgroundColor:t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.09)"},"&$disabled":{backgroundColor:t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)"}},colorSecondary:{"&$underline:after":{borderBottomColor:e.palette.secondary.main}},underline:{"&:after":{borderBottom:"2px solid ".concat(e.palette.primary.main),left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},"&$focused:after":{transform:"scaleX(1)"},"&$error:after":{borderBottomColor:e.palette.error.main,transform:"scaleX(1)"},"&:before":{borderBottom:"1px solid ".concat(n),left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},"&:hover:before":{borderBottom:"1px solid ".concat(e.palette.text.primary)},"&$disabled:before":{borderBottomStyle:"dotted"}},focused:{},disabled:{},adornedStart:{paddingLeft:12},adornedEnd:{paddingRight:12},error:{},marginDense:{},multiline:{padding:"27px 12px 10px","&$marginDense":{paddingTop:23,paddingBottom:6}},input:{padding:"27px 12px 10px","&:-webkit-autofill":{WebkitBoxShadow:"light"===e.palette.type?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===e.palette.type?null:"#fff",caretColor:"light"===e.palette.type?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},inputMarginDense:{paddingTop:23,paddingBottom:6},inputHiddenLabel:{paddingTop:18,paddingBottom:19,"&$inputMarginDense":{paddingTop:10,paddingBottom:11}},inputMultiline:{padding:0},inputAdornedStart:{paddingLeft:0},inputAdornedEnd:{paddingRight:0}}}),{name:"MuiFilledInput"})(k),T=n(14),j=n(31),P=i.forwardRef((function(e,t){e.children;var n=e.classes,l=e.className,u=e.label,c=e.labelWidth,s=e.notched,f=e.style,p=Object(o.a)(e,["children","classes","className","label","labelWidth","notched","style"]),h="rtl"===Object(j.a)().direction?"right":"left";if(void 0!==u)return i.createElement("fieldset",Object(r.a)({"aria-hidden":!0,className:Object(a.default)(n.root,l),ref:t,style:f},p),i.createElement("legend",{className:Object(a.default)(n.legendLabelled,s&&n.legendNotched)},u?i.createElement("span",null,u):i.createElement("span",{dangerouslySetInnerHTML:{__html:"​"}})));var v=c>0?.75*c+8:.01;return i.createElement("fieldset",Object(r.a)({"aria-hidden":!0,style:Object(r.a)(Object(T.a)({},"padding".concat(Object(d.a)(h)),8),f),className:Object(a.default)(n.root,l),ref:t},p),i.createElement("legend",{className:n.legend,style:{width:s?v:.01}},i.createElement("span",{dangerouslySetInnerHTML:{__html:"​"}})))})),A=Object(f.a)((function(e){return{root:{position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden"},legend:{textAlign:"left",padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})},legendLabelled:{display:"block",width:"auto",textAlign:"left",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),"& > span":{paddingLeft:5,paddingRight:5,display:"inline-block"}},legendNotched:{maxWidth:1e3,transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}}),{name:"PrivateNotchedOutline"})(P),I=i.forwardRef((function(e,t){var n=e.classes,l=e.fullWidth,u=void 0!==l&&l,c=e.inputComponent,s=void 0===c?"input":c,f=e.label,d=e.labelWidth,p=void 0===d?0:d,h=e.multiline,v=void 0!==h&&h,m=e.notched,g=e.type,y=void 0===g?"text":g,b=Object(o.a)(e,["classes","fullWidth","inputComponent","label","labelWidth","multiline","notched","type"]);return i.createElement(C,Object(r.a)({renderSuffix:function(e){return i.createElement(A,{className:n.notchedOutline,label:f,labelWidth:p,notched:"undefined"!==typeof m?m:Boolean(e.startAdornment||e.filled||e.focused)})},classes:Object(r.a)({},n,{root:Object(a.default)(n.root,n.underline),notchedOutline:null}),fullWidth:u,inputComponent:s,multiline:v,ref:t,type:y},b))}));I.muiName="Input";var M=Object(f.a)((function(e){var t="light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{root:{position:"relative",borderRadius:e.shape.borderRadius,"&:hover $notchedOutline":{borderColor:e.palette.text.primary},"@media (hover: none)":{"&:hover $notchedOutline":{borderColor:t}},"&$focused $notchedOutline":{borderColor:e.palette.primary.main,borderWidth:2},"&$error $notchedOutline":{borderColor:e.palette.error.main},"&$disabled $notchedOutline":{borderColor:e.palette.action.disabled}},colorSecondary:{"&$focused $notchedOutline":{borderColor:e.palette.secondary.main}},focused:{},disabled:{},adornedStart:{paddingLeft:14},adornedEnd:{paddingRight:14},error:{},marginDense:{},multiline:{padding:"18.5px 14px","&$marginDense":{paddingTop:10.5,paddingBottom:10.5}},notchedOutline:{borderColor:t},input:{padding:"18.5px 14px","&:-webkit-autofill":{WebkitBoxShadow:"light"===e.palette.type?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===e.palette.type?null:"#fff",caretColor:"light"===e.palette.type?null:"#fff",borderRadius:"inherit"}},inputMarginDense:{paddingTop:10.5,paddingBottom:10.5},inputMultiline:{padding:0},inputAdornedStart:{paddingLeft:0},inputAdornedEnd:{paddingRight:0}}}),{name:"MuiOutlinedInput"})(I);function D(){return i.useContext(s)}var R=i.forwardRef((function(e,t){var n=e.children,l=e.classes,c=e.className,s=(e.color,e.component),f=void 0===s?"label":s,p=(e.disabled,e.error,e.filled,e.focused,e.required,Object(o.a)(e,["children","classes","className","color","component","disabled","error","filled","focused","required"])),h=u({props:e,muiFormControl:D(),states:["color","required","focused","disabled","error","filled"]});return i.createElement(f,Object(r.a)({className:Object(a.default)(l.root,l["color".concat(Object(d.a)(h.color||"primary"))],c,h.disabled&&l.disabled,h.error&&l.error,h.filled&&l.filled,h.focused&&l.focused,h.required&&l.required),ref:t},p),n,h.required&&i.createElement("span",{"aria-hidden":!0,className:Object(a.default)(l.asterisk,h.error&&l.error)},"\u2009","*"))})),N=Object(f.a)((function(e){return{root:Object(r.a)({color:e.palette.text.secondary},e.typography.body1,{lineHeight:1,padding:0,"&$focused":{color:e.palette.primary.main},"&$disabled":{color:e.palette.text.disabled},"&$error":{color:e.palette.error.main}}),colorSecondary:{"&$focused":{color:e.palette.secondary.main}},focused:{},disabled:{},error:{},filled:{},required:{},asterisk:{"&$error":{color:e.palette.error.main}}}}),{name:"MuiFormLabel"})(R),F=i.forwardRef((function(e,t){var n=e.classes,l=e.className,c=e.disableAnimation,s=void 0!==c&&c,f=(e.margin,e.shrink),d=(e.variant,Object(o.a)(e,["classes","className","disableAnimation","margin","shrink","variant"])),p=D(),h=f;"undefined"===typeof h&&p&&(h=p.filled||p.focused||p.adornedStart);var v=u({props:e,muiFormControl:p,states:["margin","variant"]});return i.createElement(N,Object(r.a)({"data-shrink":h,className:Object(a.default)(n.root,l,p&&n.formControl,!s&&n.animated,h&&n.shrink,"dense"===v.margin&&n.marginDense,{filled:n.filled,outlined:n.outlined}[v.variant]),classes:{focused:n.focused,disabled:n.disabled,error:n.error,required:n.required,asterisk:n.asterisk},ref:t},d))})),z=Object(f.a)((function(e){return{root:{display:"block",transformOrigin:"top left"},focused:{},disabled:{},error:{},required:{},asterisk:{},formControl:{position:"absolute",left:0,top:0,transform:"translate(0, 24px) scale(1)"},marginDense:{transform:"translate(0, 21px) scale(1)"},shrink:{transform:"translate(0, 1.5px) scale(0.75)",transformOrigin:"top left"},animated:{transition:e.transitions.create(["color","transform"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})},filled:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 20px) scale(1)","&$marginDense":{transform:"translate(12px, 17px) scale(1)"},"&$shrink":{transform:"translate(12px, 10px) scale(0.75)","&$marginDense":{transform:"translate(12px, 7px) scale(0.75)"}}},outlined:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 20px) scale(1)","&$marginDense":{transform:"translate(14px, 12px) scale(1)"},"&$shrink":{transform:"translate(14px, -6px) scale(0.75)"}}}}),{name:"MuiInputLabel"})(F),L=n(62),V=i.forwardRef((function(e,t){var n=e.children,l=e.classes,u=e.className,c=e.color,f=void 0===c?"primary":c,p=e.component,h=void 0===p?"div":p,v=e.disabled,m=void 0!==v&&v,g=e.error,y=void 0!==g&&g,b=e.fullWidth,w=void 0!==b&&b,O=e.focused,C=e.hiddenLabel,x=void 0!==C&&C,E=e.margin,k=void 0===E?"none":E,_=e.required,T=void 0!==_&&_,j=e.size,P=e.variant,A=void 0===P?"standard":P,I=Object(o.a)(e,["children","classes","className","color","component","disabled","error","fullWidth","focused","hiddenLabel","margin","required","size","variant"]),M=i.useState((function(){var e=!1;return n&&i.Children.forEach(n,(function(t){if(Object(L.a)(t,["Input","Select"])){var n=Object(L.a)(t,["Select"])?t.props.input:t;n&&n.props.startAdornment&&(e=!0)}})),e})),D=M[0],R=M[1],N=i.useState((function(){var e=!1;return n&&i.Children.forEach(n,(function(t){Object(L.a)(t,["Input","Select"])&&S(t.props,!0)&&(e=!0)})),e})),F=N[0],z=N[1],V=i.useState(!1),H=V[0],B=V[1],W=void 0!==O?O:H;m&&W&&B(!1);var U=i.useCallback((function(){z(!0)}),[]),$={adornedStart:D,setAdornedStart:R,color:f,disabled:m,error:y,filled:F,focused:W,fullWidth:w,hiddenLabel:x,margin:("small"===j?"dense":void 0)||k,onBlur:function(){B(!1)},onEmpty:i.useCallback((function(){z(!1)}),[]),onFilled:U,onFocus:function(){B(!0)},registerEffect:void 0,required:T,variant:A};return i.createElement(s.Provider,{value:$},i.createElement(h,Object(r.a)({className:Object(a.default)(l.root,u,"none"!==k&&l["margin".concat(Object(d.a)(k))],w&&l.fullWidth),ref:t},I),n))})),H=Object(f.a)({root:{display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},marginNormal:{marginTop:16,marginBottom:8},marginDense:{marginTop:8,marginBottom:4},fullWidth:{width:"100%"}},{name:"MuiFormControl"})(V),B=i.forwardRef((function(e,t){var n=e.children,l=e.classes,c=e.className,s=e.component,f=void 0===s?"p":s,d=(e.disabled,e.error,e.filled,e.focused,e.margin,e.required,e.variant,Object(o.a)(e,["children","classes","className","component","disabled","error","filled","focused","margin","required","variant"])),p=u({props:e,muiFormControl:D(),states:["variant","margin","disabled","error","filled","focused","required"]});return i.createElement(f,Object(r.a)({className:Object(a.default)(l.root,("filled"===p.variant||"outlined"===p.variant)&&l.contained,c,p.disabled&&l.disabled,p.error&&l.error,p.filled&&l.filled,p.focused&&l.focused,p.required&&l.required,"dense"===p.margin&&l.marginDense),ref:t},d)," "===n?i.createElement("span",{dangerouslySetInnerHTML:{__html:"​"}}):n)})),W=Object(f.a)((function(e){return{root:Object(r.a)({color:e.palette.text.secondary},e.typography.caption,{textAlign:"left",marginTop:3,margin:0,"&$disabled":{color:e.palette.text.disabled},"&$error":{color:e.palette.error.main}}),error:{},disabled:{},marginDense:{marginTop:4},contained:{marginLeft:14,marginRight:14},focused:{},filled:{},required:{}}}),{name:"MuiFormHelperText"})(B),U=n(433),$=n(45),K=n(56),q=(n(67),n(17)),G=n(10),Y=n(60),X=n(47),Q=n(401),Z=n(435),J=n(442),ee=n(20),te=n(90);var ne=n(64),re=n(44);function oe(){var e=document.createElement("div");e.style.width="99px",e.style.height="99px",e.style.position="absolute",e.style.top="-9999px",e.style.overflow="scroll",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}function ie(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function ae(e){return parseInt(window.getComputedStyle(e)["padding-right"],10)||0}function le(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4?arguments[4]:void 0,i=[t,n].concat(Object(re.a)(r)),a=["TEMPLATE","SCRIPT","STYLE"];[].forEach.call(e.children,(function(e){1===e.nodeType&&-1===i.indexOf(e)&&-1===a.indexOf(e.tagName)&&ie(e,o)}))}function ue(e,t){var n=-1;return e.some((function(e,r){return!!t(e)&&(n=r,!0)})),n}function ce(e,t){var n,r=[],o=[],i=e.container;if(!t.disableScrollLock){if(function(e){var t=Object(q.a)(e);return t.body===e?Object(Y.a)(t).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}(i)){var a=oe();r.push({value:i.style.paddingRight,key:"padding-right",el:i}),i.style["padding-right"]="".concat(ae(i)+a,"px"),n=Object(q.a)(i).querySelectorAll(".mui-fixed"),[].forEach.call(n,(function(e){o.push(e.style.paddingRight),e.style.paddingRight="".concat(ae(e)+a,"px")}))}var l=i.parentElement,u="HTML"===l.nodeName&&"scroll"===window.getComputedStyle(l)["overflow-y"]?l:i;r.push({value:u.style.overflow,key:"overflow",el:u}),u.style.overflow="hidden"}return function(){n&&[].forEach.call(n,(function(e,t){o[t]?e.style.paddingRight=o[t]:e.style.removeProperty("padding-right")})),r.forEach((function(e){var t=e.value,n=e.el,r=e.key;t?n.style.setProperty(r,t):n.style.removeProperty(r)}))}}var se=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.modals=[],this.containers=[]}return Object(ne.a)(e,[{key:"add",value:function(e,t){var n=this.modals.indexOf(e);if(-1!==n)return n;n=this.modals.length,this.modals.push(e),e.modalRef&&ie(e.modalRef,!1);var r=function(e){var t=[];return[].forEach.call(e.children,(function(e){e.getAttribute&&"true"===e.getAttribute("aria-hidden")&&t.push(e)})),t}(t);le(t,e.mountNode,e.modalRef,r,!0);var o=ue(this.containers,(function(e){return e.container===t}));return-1!==o?(this.containers[o].modals.push(e),n):(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblingNodes:r}),n)}},{key:"mount",value:function(e,t){var n=ue(this.containers,(function(t){return-1!==t.modals.indexOf(e)})),r=this.containers[n];r.restore||(r.restore=ce(r,t))}},{key:"remove",value:function(e){var t=this.modals.indexOf(e);if(-1===t)return t;var n=ue(this.containers,(function(t){return-1!==t.modals.indexOf(e)})),r=this.containers[n];if(r.modals.splice(r.modals.indexOf(e),1),this.modals.splice(t,1),0===r.modals.length)r.restore&&r.restore(),e.modalRef&&ie(e.modalRef,!0),le(r.container,e.mountNode,e.modalRef,r.hiddenSiblingNodes,!1),this.containers.splice(n,1);else{var o=r.modals[r.modals.length-1];o.modalRef&&ie(o.modalRef,!1)}return t}},{key:"isTopModal",value:function(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}]),e}();var fe=function(e){var t=e.children,n=e.disableAutoFocus,r=void 0!==n&&n,o=e.disableEnforceFocus,a=void 0!==o&&o,l=e.disableRestoreFocus,u=void 0!==l&&l,c=e.getDoc,s=e.isEnabled,f=e.open,d=i.useRef(),h=i.useRef(null),v=i.useRef(null),m=i.useRef(),g=i.useRef(null),y=i.useCallback((function(e){g.current=G.findDOMNode(e)}),[]),b=Object(p.a)(t.ref,y),S=i.useRef();return i.useEffect((function(){S.current=f}),[f]),!S.current&&f&&"undefined"!==typeof window&&(m.current=c().activeElement),i.useEffect((function(){if(f){var e=Object(q.a)(g.current);r||!g.current||g.current.contains(e.activeElement)||(g.current.hasAttribute("tabIndex")||g.current.setAttribute("tabIndex",-1),g.current.focus());var t=function(){e.hasFocus()&&!a&&s()&&!d.current?g.current&&!g.current.contains(e.activeElement)&&g.current.focus():d.current=!1},n=function(t){!a&&s()&&9===t.keyCode&&e.activeElement===g.current&&(d.current=!0,t.shiftKey?v.current.focus():h.current.focus())};e.addEventListener("focus",t,!0),e.addEventListener("keydown",n,!0);var o=setInterval((function(){t()}),50);return function(){clearInterval(o),e.removeEventListener("focus",t,!0),e.removeEventListener("keydown",n,!0),u||(m.current&&m.current.focus&&m.current.focus(),m.current=null)}}}),[r,a,u,s,f]),i.createElement(i.Fragment,null,i.createElement("div",{tabIndex:0,ref:h,"data-test":"sentinelStart"}),i.cloneElement(t,{ref:b}),i.createElement("div",{tabIndex:0,ref:v,"data-test":"sentinelEnd"}))},de={root:{zIndex:-1,position:"fixed",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},invisible:{backgroundColor:"transparent"}},pe=i.forwardRef((function(e,t){var n=e.invisible,a=void 0!==n&&n,l=e.open,u=Object(o.a)(e,["invisible","open"]);return l?i.createElement("div",Object(r.a)({"aria-hidden":!0,ref:t},u,{style:Object(r.a)({},de.root,a?de.invisible:{},u.style)})):null}));var he=new se,ve=i.forwardRef((function(e,t){var n=Object(Q.a)(),a=Object(Z.a)({name:"MuiModal",props:Object(r.a)({},e),theme:n}),l=a.BackdropComponent,u=void 0===l?pe:l,c=a.BackdropProps,s=a.children,f=a.closeAfterTransition,d=void 0!==f&&f,h=a.container,v=a.disableAutoFocus,m=void 0!==v&&v,g=a.disableBackdropClick,y=void 0!==g&&g,b=a.disableEnforceFocus,S=void 0!==b&&b,w=a.disableEscapeKeyDown,O=void 0!==w&&w,C=a.disablePortal,x=void 0!==C&&C,E=a.disableRestoreFocus,k=void 0!==E&&E,_=a.disableScrollLock,T=void 0!==_&&_,j=a.hideBackdrop,P=void 0!==j&&j,A=a.keepMounted,I=void 0!==A&&A,M=a.manager,D=void 0===M?he:M,R=a.onBackdropClick,N=a.onClose,F=a.onEscapeKeyDown,z=a.onRendered,L=a.open,V=Object(o.a)(a,["BackdropComponent","BackdropProps","children","closeAfterTransition","container","disableAutoFocus","disableBackdropClick","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","manager","onBackdropClick","onClose","onEscapeKeyDown","onRendered","open"]),H=i.useState(!0),B=H[0],W=H[1],U=i.useRef({}),$=i.useRef(null),K=i.useRef(null),Y=Object(p.a)(K,t),ne=function(e){return!!e.children&&e.children.props.hasOwnProperty("in")}(a),re=function(){return Object(q.a)($.current)},oe=function(){return U.current.modalRef=K.current,U.current.mountNode=$.current,U.current},ae=function(){D.mount(oe(),{disableScrollLock:T}),K.current.scrollTop=0},le=Object(ee.a)((function(){var e=function(e){return e="function"===typeof e?e():e,G.findDOMNode(e)}(h)||re().body;D.add(oe(),e),K.current&&ae()})),ue=i.useCallback((function(){return D.isTopModal(oe())}),[D]),ce=Object(ee.a)((function(e){$.current=e,e&&(z&&z(),L&&ue()?ae():ie(K.current,!0))})),se=i.useCallback((function(){D.remove(oe())}),[D]);if(i.useEffect((function(){return function(){se()}}),[se]),i.useEffect((function(){L?le():ne&&d||se()}),[L,se,ne,d,le]),!I&&!L&&(!ne||B))return null;var de=function(e){return{root:{position:"fixed",zIndex:e.zIndex.modal,right:0,bottom:0,top:0,left:0},hidden:{visibility:"hidden"}}}(n||{zIndex:te.a}),ve={};return void 0===s.props.tabIndex&&(ve.tabIndex=s.props.tabIndex||"-1"),ne&&(ve.onEnter=Object(X.a)((function(){W(!1)}),s.props.onEnter),ve.onExited=Object(X.a)((function(){W(!0),d&&se()}),s.props.onExited)),i.createElement(J.a,{ref:ce,container:h,disablePortal:x},i.createElement("div",Object(r.a)({ref:Y,onKeyDown:function(e){"Escape"===e.key&&ue()&&(F&&F(e),O||(e.stopPropagation(),N&&N(e,"escapeKeyDown")))},role:"presentation"},V,{style:Object(r.a)({},de.root,!L&&B?de.hidden:{},V.style)}),P?null:i.createElement(u,Object(r.a)({open:L,onClick:function(e){e.target===e.currentTarget&&(R&&R(e),!y&&N&&N(e,"backdropClick"))}},c)),i.createElement(fe,{disableEnforceFocus:S,disableAutoFocus:m,disableRestoreFocus:k,getDoc:re,isEnabled:ue,open:L},i.cloneElement(s,ve))))})),me=n(456),ge=n(177);function ye(e,t){var n=0;return"number"===typeof t?n=t:"center"===t?n=e.height/2:"bottom"===t&&(n=e.height),n}function be(e,t){var n=0;return"number"===typeof t?n=t:"center"===t?n=e.width/2:"right"===t&&(n=e.width),n}function Se(e){return[e.horizontal,e.vertical].map((function(e){return"number"===typeof e?"".concat(e,"px"):e})).join(" ")}function we(e){return"function"===typeof e?e():e}var Oe=i.forwardRef((function(e,t){var n=e.action,l=e.anchorEl,u=e.anchorOrigin,c=void 0===u?{vertical:"top",horizontal:"left"}:u,s=e.anchorPosition,f=e.anchorReference,d=void 0===f?"anchorEl":f,p=e.children,v=e.classes,m=e.className,g=e.container,y=e.elevation,b=void 0===y?8:y,S=e.getContentAnchorEl,w=e.marginThreshold,O=void 0===w?16:w,C=e.onEnter,x=e.onEntered,E=e.onEntering,k=e.onExit,_=e.onExited,T=e.onExiting,j=e.open,P=e.PaperProps,A=void 0===P?{}:P,I=e.transformOrigin,M=void 0===I?{vertical:"top",horizontal:"left"}:I,D=e.TransitionComponent,R=void 0===D?me.a:D,N=e.transitionDuration,F=void 0===N?"auto":N,z=e.TransitionProps,L=void 0===z?{}:z,V=Object(o.a)(e,["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","classes","className","container","elevation","getContentAnchorEl","marginThreshold","onEnter","onEntered","onEntering","onExit","onExited","onExiting","open","PaperProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps"]),H=i.useRef(),B=i.useCallback((function(e){if("anchorPosition"===d)return s;var t=we(l),n=(t&&1===t.nodeType?t:Object(q.a)(H.current).body).getBoundingClientRect(),r=0===e?c.vertical:"center";return{top:n.top+ye(n,r),left:n.left+be(n,c.horizontal)}}),[l,c.horizontal,c.vertical,s,d]),W=i.useCallback((function(e){var t=0;if(S&&"anchorEl"===d){var n=S(e);if(n&&e.contains(n)){var r=function(e,t){for(var n=t,r=0;n&&n!==e;)r+=(n=n.parentElement).scrollTop;return r}(e,n);t=n.offsetTop+n.clientHeight/2-r||0}0}return t}),[c.vertical,d,S]),U=i.useCallback((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{vertical:ye(e,M.vertical)+t,horizontal:be(e,M.horizontal)}}),[M.horizontal,M.vertical]),$=i.useCallback((function(e){var t=W(e),n={width:e.offsetWidth,height:e.offsetHeight},r=U(n,t);if("none"===d)return{top:null,left:null,transformOrigin:Se(r)};var o=B(t),i=o.top-r.vertical,a=o.left-r.horizontal,u=i+n.height,c=a+n.width,s=Object(Y.a)(we(l)),f=s.innerHeight-O,p=s.innerWidth-O;if(i<O){var h=i-O;i-=h,r.vertical+=h}else if(u>f){var v=u-f;i-=v,r.vertical+=v}if(a<O){var m=a-O;a-=m,r.horizontal+=m}else if(c>p){var g=c-p;a-=g,r.horizontal+=g}return{top:"".concat(Math.round(i),"px"),left:"".concat(Math.round(a),"px"),transformOrigin:Se(r)}}),[l,d,B,W,U,O]),K=i.useCallback((function(){var e=H.current;if(e){var t=$(e);null!==t.top&&(e.style.top=t.top),null!==t.left&&(e.style.left=t.left),e.style.transformOrigin=t.transformOrigin}}),[$]),Q=i.useCallback((function(e){H.current=G.findDOMNode(e)}),[]);i.useEffect((function(){j&&K()})),i.useImperativeHandle(n,(function(){return j?{updatePosition:function(){K()}}:null}),[j,K]),i.useEffect((function(){if(j){var e=Object(h.a)((function(){K()}));return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}}),[j,K]);var Z=F;"auto"!==F||R.muiSupportAuto||(Z=void 0);var J=g||(l?Object(q.a)(we(l)).body:void 0);return i.createElement(ve,Object(r.a)({container:J,open:j,ref:t,BackdropProps:{invisible:!0},className:Object(a.default)(v.root,m)},V),i.createElement(R,Object(r.a)({appear:!0,in:j,onEnter:C,onEntered:x,onExit:k,onExited:_,onExiting:T,timeout:Z},L,{onEntering:Object(X.a)((function(e,t){E&&E(e,t),K()}),L.onEntering)}),i.createElement(ge.a,Object(r.a)({elevation:b,ref:Q},A,{className:Object(a.default)(v.paper,A.className)}),p)))})),Ce=Object(f.a)({root:{},paper:{position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}},{name:"MuiPopover"})(Oe),xe=n(46),Ee=i.forwardRef((function(e,t){var n=e.children,l=e.classes,u=e.className,c=e.component,s=void 0===c?"ul":c,f=e.dense,d=void 0!==f&&f,p=e.disablePadding,h=void 0!==p&&p,v=e.subheader,m=Object(o.a)(e,["children","classes","className","component","dense","disablePadding","subheader"]),g=i.useMemo((function(){return{dense:d}}),[d]);return i.createElement(xe.a.Provider,{value:g},i.createElement(s,Object(r.a)({className:Object(a.default)(l.root,u,d&&l.dense,!h&&l.padding,v&&l.subheader),ref:t},m),v,n))})),ke=Object(f.a)({root:{listStyle:"none",margin:0,padding:0,position:"relative"},padding:{paddingTop:8,paddingBottom:8},dense:{},subheader:{paddingTop:0}},{name:"MuiList"})(Ee);function _e(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function Te(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function je(e,t){if(void 0===t)return!0;var n=e.innerText;return void 0===n&&(n=e.textContent),0!==(n=n.trim().toLowerCase()).length&&(t.repeating?n[0]===t.keys[0]:0===n.indexOf(t.keys.join("")))}function Pe(e,t,n,r,o,i){for(var a=!1,l=o(e,t,!!t&&n);l;){if(l===e.firstChild){if(a)return;a=!0}var u=!r&&(l.disabled||"true"===l.getAttribute("aria-disabled"));if(l.hasAttribute("tabindex")&&je(l,i)&&!u)return void l.focus();l=o(e,l,n)}}var Ae="undefined"===typeof window?i.useEffect:i.useLayoutEffect,Ie=i.forwardRef((function(e,t){var n=e.actions,a=e.autoFocus,l=void 0!==a&&a,u=e.autoFocusItem,c=void 0!==u&&u,s=e.children,f=e.className,d=e.disabledItemsFocusable,h=void 0!==d&&d,v=e.disableListWrap,m=void 0!==v&&v,g=e.onKeyDown,y=e.variant,b=void 0===y?"selectedMenu":y,S=Object(o.a)(e,["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"]),w=i.useRef(null),O=i.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Ae((function(){l&&w.current.focus()}),[l]),i.useImperativeHandle(n,(function(){return{adjustStyleForScrollbar:function(e,t){var n=!w.current.style.width;if(e.clientHeight<w.current.clientHeight&&n){var r="".concat(oe(),"px");w.current.style["rtl"===t.direction?"paddingLeft":"paddingRight"]=r,w.current.style.width="calc(100% + ".concat(r,")")}return w.current}}}),[]);var C=i.useCallback((function(e){w.current=G.findDOMNode(e)}),[]),x=Object(p.a)(C,t),E=-1;i.Children.forEach(s,(function(e,t){i.isValidElement(e)&&(e.props.disabled||("selectedMenu"===b&&e.props.selected||-1===E)&&(E=t))}));var k=i.Children.map(s,(function(e,t){if(t===E){var n={};return c&&(n.autoFocus=!0),void 0===e.props.tabIndex&&"selectedMenu"===b&&(n.tabIndex=0),i.cloneElement(e,n)}return e}));return i.createElement(ke,Object(r.a)({role:"menu",ref:x,className:f,onKeyDown:function(e){var t=w.current,n=e.key,r=Object(q.a)(t).activeElement;if("ArrowDown"===n)e.preventDefault(),Pe(t,r,m,h,_e);else if("ArrowUp"===n)e.preventDefault(),Pe(t,r,m,h,Te);else if("Home"===n)e.preventDefault(),Pe(t,null,m,h,_e);else if("End"===n)e.preventDefault(),Pe(t,null,m,h,Te);else if(1===n.length){var o=O.current,i=n.toLowerCase(),a=performance.now();o.keys.length>0&&(a-o.lastTime>500?(o.keys=[],o.repeating=!0,o.previousKeyMatched=!0):o.repeating&&i!==o.keys[0]&&(o.repeating=!1)),o.lastTime=a,o.keys.push(i);var l=r&&!o.repeating&&je(r,o);o.previousKeyMatched&&(l||Pe(t,r,!1,h,_e,o))?e.preventDefault():o.previousKeyMatched=!1}g&&g(e)},tabIndex:l?0:-1},S),k)})),Me=n(26),De={vertical:"top",horizontal:"right"},Re={vertical:"top",horizontal:"left"},Ne=i.forwardRef((function(e,t){var n=e.autoFocus,l=void 0===n||n,u=e.children,c=e.classes,s=e.disableAutoFocusItem,f=void 0!==s&&s,d=e.MenuListProps,p=void 0===d?{}:d,h=e.onClose,v=e.onEntering,m=e.open,g=e.PaperProps,y=void 0===g?{}:g,b=e.PopoverClasses,S=e.transitionDuration,w=void 0===S?"auto":S,O=e.variant,C=void 0===O?"selectedMenu":O,x=Object(o.a)(e,["autoFocus","children","classes","disableAutoFocusItem","MenuListProps","onClose","onEntering","open","PaperProps","PopoverClasses","transitionDuration","variant"]),E=Object(j.a)(),k=l&&!f&&m,_=i.useRef(null),T=i.useRef(null),P=-1;i.Children.map(u,(function(e,t){i.isValidElement(e)&&(e.props.disabled||("menu"!==C&&e.props.selected||-1===P)&&(P=t))}));var A=i.Children.map(u,(function(e,t){return t===P?i.cloneElement(e,{ref:function(t){T.current=G.findDOMNode(t),Object(Me.a)(e.ref,t)}}):e}));return i.createElement(Ce,Object(r.a)({getContentAnchorEl:function(){return T.current},classes:b,onClose:h,onEntering:function(e,t){_.current&&_.current.adjustStyleForScrollbar(e,E),v&&v(e,t)},anchorOrigin:"rtl"===E.direction?De:Re,transformOrigin:"rtl"===E.direction?De:Re,PaperProps:Object(r.a)({},y,{classes:Object(r.a)({},y.classes,{root:c.paper})}),open:m,ref:t,transitionDuration:w},x),i.createElement(Ie,Object(r.a)({onKeyDown:function(e){"Tab"===e.key&&(e.preventDefault(),h&&h(e,"tabKeyDown"))},actions:_,autoFocus:l&&(-1===P||f),autoFocusItem:k,variant:C},p,{className:Object(a.default)(c.list,p.className)}),A))})),Fe=Object(f.a)({paper:{maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"},list:{outline:0}},{name:"MuiMenu"})(Ne),ze=n(91);function Le(e,t){return"object"===Object(K.a)(t)&&null!==t?e===t:String(e)===String(t)}var Ve=i.forwardRef((function(e,t){var n=e["aria-label"],u=e.autoFocus,c=e.autoWidth,s=e.children,f=e.classes,h=e.className,v=e.defaultValue,m=e.disabled,g=e.displayEmpty,y=e.IconComponent,b=e.inputRef,w=e.labelId,O=e.MenuProps,C=void 0===O?{}:O,x=e.multiple,E=e.name,k=e.onBlur,_=e.onChange,T=e.onClose,j=e.onFocus,P=e.onOpen,A=e.open,I=e.readOnly,M=e.renderValue,D=e.SelectDisplayProps,R=void 0===D?{}:D,N=e.tabIndex,F=(e.type,e.value),z=e.variant,L=void 0===z?"standard":z,V=Object(o.a)(e,["aria-label","autoFocus","autoWidth","children","classes","className","defaultValue","disabled","displayEmpty","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"]),H=Object(ze.a)({controlled:F,default:v,name:"Select"}),B=Object($.a)(H,2),W=B[0],U=B[1],K=i.useRef(null),G=i.useState(null),Y=G[0],X=G[1],Q=i.useRef(null!=A).current,Z=i.useState(),J=Z[0],ee=Z[1],te=i.useState(!1),ne=te[0],re=te[1],oe=Object(p.a)(t,b);i.useImperativeHandle(oe,(function(){return{focus:function(){Y.focus()},node:K.current,value:W}}),[Y,W]),i.useEffect((function(){u&&Y&&Y.focus()}),[u,Y]),i.useEffect((function(){if(Y){var e=Object(q.a)(Y).getElementById(w);if(e){var t=function(){getSelection().isCollapsed&&Y.focus()};return e.addEventListener("click",t),function(){e.removeEventListener("click",t)}}}}),[w,Y]);var ie,ae,le=function(e,t){e?P&&P(t):T&&T(t),Q||(ee(c?null:Y.clientWidth),re(e))},ue=i.Children.toArray(s),ce=function(e){return function(t){var n;if(x||le(!1,t),x){n=Array.isArray(W)?W.slice():[];var r=W.indexOf(e.props.value);-1===r?n.push(e.props.value):n.splice(r,1)}else n=e.props.value;e.props.onClick&&e.props.onClick(t),W!==n&&(U(n),_&&(t.persist(),Object.defineProperty(t,"target",{writable:!0,value:{value:n,name:E}}),_(t,e)))}},se=null!==Y&&(Q?A:ne);delete V["aria-invalid"];var fe=[],de=!1;(S({value:W})||g)&&(M?ie=M(W):de=!0);var pe=ue.map((function(e){if(!i.isValidElement(e))return null;var t;if(x){if(!Array.isArray(W))throw new Error(Object(l.a)(2));(t=W.some((function(t){return Le(t,e.props.value)})))&&de&&fe.push(e.props.children)}else(t=Le(W,e.props.value))&&de&&(ae=e.props.children);return t&&!0,i.cloneElement(e,{"aria-selected":t?"true":void 0,onClick:ce(e),onKeyUp:function(t){" "===t.key&&t.preventDefault(),e.props.onKeyUp&&e.props.onKeyUp(t)},role:"option",selected:t,value:void 0,"data-value":e.props.value})}));de&&(ie=x?fe.join(", "):ae);var he,ve=J;!c&&Q&&Y&&(ve=Y.clientWidth),he="undefined"!==typeof N?N:m?null:0;var me=R.id||(E?"mui-component-select-".concat(E):void 0);return i.createElement(i.Fragment,null,i.createElement("div",Object(r.a)({className:Object(a.default)(f.root,f.select,f.selectMenu,f[L],h,m&&f.disabled),ref:X,tabIndex:he,role:"button","aria-disabled":m?"true":void 0,"aria-expanded":se?"true":void 0,"aria-haspopup":"listbox","aria-label":n,"aria-labelledby":[w,me].filter(Boolean).join(" ")||void 0,onKeyDown:function(e){if(!I){-1!==[" ","ArrowUp","ArrowDown","Enter"].indexOf(e.key)&&(e.preventDefault(),le(!0,e))}},onMouseDown:m||I?null:function(e){0===e.button&&(e.preventDefault(),Y.focus(),le(!0,e))},onBlur:function(e){!se&&k&&(e.persist(),Object.defineProperty(e,"target",{writable:!0,value:{value:W,name:E}}),k(e))},onFocus:j},R,{id:me}),function(e){return null==e||"string"===typeof e&&!e.trim()}(ie)?i.createElement("span",{dangerouslySetInnerHTML:{__html:"​"}}):ie),i.createElement("input",Object(r.a)({value:Array.isArray(W)?W.join(","):W,name:E,ref:K,"aria-hidden":!0,onChange:function(e){var t=ue.map((function(e){return e.props.value})).indexOf(e.target.value);if(-1!==t){var n=ue[t];U(n.props.value),_&&_(e,n)}},tabIndex:-1,className:f.nativeInput,autoFocus:u},V)),i.createElement(y,{className:Object(a.default)(f.icon,f["icon".concat(Object(d.a)(L))],se&&f.iconOpen,m&&f.disabled)}),i.createElement(Fe,Object(r.a)({id:"menu-".concat(E||""),anchorEl:Y,open:se,onClose:function(e){le(!1,e)}},C,{MenuListProps:Object(r.a)({"aria-labelledby":w,role:"listbox",disableListWrap:!0},C.MenuListProps),PaperProps:Object(r.a)({},C.PaperProps,{style:Object(r.a)({minWidth:ve},null!=C.PaperProps?C.PaperProps.style:null)})}),pe))})),He=n(59),Be=Object(He.a)(i.createElement("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),We=i.forwardRef((function(e,t){var n=e.classes,l=e.className,u=e.disabled,c=e.IconComponent,s=e.inputRef,f=e.variant,p=void 0===f?"standard":f,h=Object(o.a)(e,["classes","className","disabled","IconComponent","inputRef","variant"]);return i.createElement(i.Fragment,null,i.createElement("select",Object(r.a)({className:Object(a.default)(n.root,n.select,n[p],l,u&&n.disabled),disabled:u,ref:s||t},h)),e.multiple?null:i.createElement(c,{className:Object(a.default)(n.icon,n["icon".concat(Object(d.a)(p))],u&&n.disabled)}))})),Ue=function(e){return{root:{},select:{"-moz-appearance":"none","-webkit-appearance":"none",userSelect:"none",borderRadius:0,minWidth:16,cursor:"pointer","&:focus":{backgroundColor:"light"===e.palette.type?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)",borderRadius:0},"&::-ms-expand":{display:"none"},"&$disabled":{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:e.palette.background.paper},"&&":{paddingRight:24}},filled:{"&&":{paddingRight:32}},outlined:{borderRadius:e.shape.borderRadius,"&&":{paddingRight:32}},selectMenu:{height:"auto",minHeight:"1.1876em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},disabled:{},icon:{position:"absolute",right:0,top:"calc(50% - 12px)",pointerEvents:"none",color:e.palette.action.active,"&$disabled":{color:e.palette.action.disabled}},iconOpen:{transform:"rotate(180deg)"},iconFilled:{right:7},iconOutlined:{right:7},nativeInput:{bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%"}}},$e=i.createElement(E,null),Ke=i.forwardRef((function(e,t){var n=e.children,a=e.classes,l=e.IconComponent,c=void 0===l?Be:l,s=e.input,f=void 0===s?$e:s,d=e.inputProps,p=(e.variant,Object(o.a)(e,["children","classes","IconComponent","input","inputProps","variant"])),h=u({props:e,muiFormControl:D(),states:["variant"]});return i.cloneElement(f,Object(r.a)({inputComponent:We,inputProps:Object(r.a)({children:n,classes:a,IconComponent:c,variant:h.variant,type:void 0},d,f?f.props.inputProps:{}),ref:t},p))}));Ke.muiName="Select";Object(f.a)(Ue,{name:"MuiNativeSelect"})(Ke);var qe=Ue,Ge=i.createElement(E,null),Ye=i.createElement(_,null),Xe=i.forwardRef((function e(t,n){var a=t.autoWidth,l=void 0!==a&&a,c=t.children,s=t.classes,f=t.displayEmpty,d=void 0!==f&&f,p=t.IconComponent,h=void 0===p?Be:p,v=t.id,m=t.input,g=t.inputProps,y=t.label,b=t.labelId,S=t.labelWidth,w=void 0===S?0:S,O=t.MenuProps,C=t.multiple,x=void 0!==C&&C,E=t.native,k=void 0!==E&&E,_=t.onClose,T=t.onOpen,j=t.open,P=t.renderValue,A=t.SelectDisplayProps,I=t.variant,R=void 0===I?"standard":I,N=Object(o.a)(t,["autoWidth","children","classes","displayEmpty","IconComponent","id","input","inputProps","label","labelId","labelWidth","MenuProps","multiple","native","onClose","onOpen","open","renderValue","SelectDisplayProps","variant"]),F=k?We:Ve,z=u({props:t,muiFormControl:D(),states:["variant"]}).variant||R,L=m||{standard:Ge,outlined:i.createElement(M,{label:y,labelWidth:w}),filled:Ye}[z];return i.cloneElement(L,Object(r.a)({inputComponent:F,inputProps:Object(r.a)({children:c,IconComponent:h,variant:z,type:void 0,multiple:x},k?{id:v}:{autoWidth:l,displayEmpty:d,labelId:b,MenuProps:O,onClose:_,onOpen:T,open:j,renderValue:P,SelectDisplayProps:Object(r.a)({id:v},A)},g,{classes:g?Object(U.a)({baseClasses:s,newClasses:g.classes,Component:e}):s},m?m.props.inputProps:{}),ref:n},N))}));Xe.muiName="Select";var Qe=Object(f.a)(qe,{name:"MuiSelect"})(Xe),Ze={standard:E,filled:_,outlined:M},Je=i.forwardRef((function(e,t){var n=e.autoComplete,l=e.autoFocus,u=void 0!==l&&l,c=e.children,s=e.classes,f=e.className,d=e.color,p=void 0===d?"primary":d,h=e.defaultValue,v=e.disabled,m=void 0!==v&&v,g=e.error,y=void 0!==g&&g,b=e.FormHelperTextProps,S=e.fullWidth,w=void 0!==S&&S,O=e.helperText,C=e.hiddenLabel,x=e.id,E=e.InputLabelProps,k=e.inputProps,_=e.InputProps,T=e.inputRef,j=e.label,P=e.multiline,A=void 0!==P&&P,I=e.name,M=e.onBlur,D=e.onChange,R=e.onFocus,N=e.placeholder,F=e.required,L=void 0!==F&&F,V=e.rows,B=e.rowsMax,U=e.select,$=void 0!==U&&U,K=e.SelectProps,q=e.type,G=e.value,Y=e.variant,X=void 0===Y?"standard":Y,Q=Object(o.a)(e,["autoComplete","autoFocus","children","classes","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","hiddenLabel","id","InputLabelProps","inputProps","InputProps","inputRef","label","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","rowsMax","select","SelectProps","type","value","variant"]);var Z={};if("outlined"===X&&(E&&"undefined"!==typeof E.shrink&&(Z.notched=E.shrink),j)){var J,ee=null!==(J=null===E||void 0===E?void 0:E.required)&&void 0!==J?J:L;Z.label=i.createElement(i.Fragment,null,j,ee&&"\xa0*")}$&&(K&&K.native||(Z.id=void 0),Z["aria-describedby"]=void 0);var te=O&&x?"".concat(x,"-helper-text"):void 0,ne=j&&x?"".concat(x,"-label"):void 0,re=Ze[X],oe=i.createElement(re,Object(r.a)({"aria-describedby":te,autoComplete:n,autoFocus:u,defaultValue:h,fullWidth:w,multiline:A,name:I,rows:V,rowsMax:B,type:q,value:G,id:x,inputRef:T,onBlur:M,onChange:D,onFocus:R,placeholder:N,inputProps:k},Z,_));return i.createElement(H,Object(r.a)({className:Object(a.default)(s.root,f),disabled:m,error:y,fullWidth:w,hiddenLabel:C,ref:t,required:L,color:p,variant:X},Q),j&&i.createElement(z,Object(r.a)({htmlFor:x,id:ne},E),j),$?i.createElement(Qe,Object(r.a)({"aria-describedby":te,id:x,labelId:ne,value:G,input:oe},K),c):oe,O&&i.createElement(W,Object(r.a)({id:te},b),O))}));t.a=Object(f.a)({root:{}},{name:"MuiTextField"})(Je)},function(e,t,n){"use strict";var r,o=n(1),i=n(2),a=n(0),l=(n(3),n(14)),u=(n(67),n(4)),c=n(37),s=n(60);function f(){if(r)return r;var e=document.createElement("div");return e.appendChild(document.createTextNode("ABCD")),e.dir="rtl",e.style.fontSize="14px",e.style.width="4px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.overflow="scroll",document.body.appendChild(e),r="reverse",e.scrollLeft>0?r="default":(e.scrollLeft=1,0===e.scrollLeft&&(r="negative")),document.body.removeChild(e),r}function d(e,t){var n=e.scrollLeft;if("rtl"!==t)return n;switch(f()){case"negative":return e.scrollWidth-e.clientWidth+n;case"reverse":return e.scrollWidth-e.clientWidth-n;default:return n}}function p(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}var h={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function v(e){var t=e.onChange,n=Object(i.a)(e,["onChange"]),r=a.useRef(),l=a.useRef(null),u=function(){r.current=l.current.offsetHeight-l.current.clientHeight};return a.useEffect((function(){var e=Object(c.a)((function(){var e=r.current;u(),e!==r.current&&t(r.current)}));return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}),[t]),a.useEffect((function(){u(),t(r.current)}),[t]),a.createElement("div",Object(o.a)({style:h,ref:l},n))}var m=n(6),g=n(7),y=a.forwardRef((function(e,t){var n=e.classes,r=e.className,l=e.color,c=e.orientation,s=Object(i.a)(e,["classes","className","color","orientation"]);return a.createElement("span",Object(o.a)({className:Object(u.default)(n.root,n["color".concat(Object(g.a)(l))],r,"vertical"===c&&n.vertical),ref:t},s))})),b=Object(m.a)((function(e){return{root:{position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},colorPrimary:{backgroundColor:e.palette.primary.main},colorSecondary:{backgroundColor:e.palette.secondary.main},vertical:{height:"100%",width:2,right:0}}}),{name:"PrivateTabIndicator"})(y),S=n(59),w=Object(S.a)(a.createElement("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),O=Object(S.a)(a.createElement("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight"),C=n(96),x=a.createElement(w,{fontSize:"small"}),E=a.createElement(O,{fontSize:"small"}),k=a.forwardRef((function(e,t){var n=e.classes,r=e.className,l=e.direction,c=e.orientation,s=e.disabled,f=Object(i.a)(e,["classes","className","direction","orientation","disabled"]);return a.createElement(C.a,Object(o.a)({component:"div",className:Object(u.default)(n.root,r,s&&n.disabled,"vertical"===c&&n.vertical),ref:t,role:null,tabIndex:null},f),"left"===l?x:E)})),_=Object(m.a)({root:{width:40,flexShrink:0,opacity:.8,"&$disabled":{opacity:0}},vertical:{width:"100%",height:40,"& svg":{transform:"rotate(90deg)"}},disabled:{}},{name:"MuiTabScrollButton"})(k),T=n(20),j=n(31),P=a.forwardRef((function(e,t){var n=e["aria-label"],r=e["aria-labelledby"],h=e.action,m=e.centered,g=void 0!==m&&m,y=e.children,S=e.classes,w=e.className,O=e.component,C=void 0===O?"div":O,x=e.indicatorColor,E=void 0===x?"secondary":x,k=e.onChange,P=e.orientation,A=void 0===P?"horizontal":P,I=e.ScrollButtonComponent,M=void 0===I?_:I,D=e.scrollButtons,R=void 0===D?"auto":D,N=e.selectionFollowsFocus,F=e.TabIndicatorProps,z=void 0===F?{}:F,L=e.TabScrollButtonProps,V=e.textColor,H=void 0===V?"inherit":V,B=e.value,W=e.variant,U=void 0===W?"standard":W,$=Object(i.a)(e,["aria-label","aria-labelledby","action","centered","children","classes","className","component","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant"]),K=Object(j.a)(),q="scrollable"===U,G="rtl"===K.direction,Y="vertical"===A,X=Y?"scrollTop":"scrollLeft",Q=Y?"top":"left",Z=Y?"bottom":"right",J=Y?"clientHeight":"clientWidth",ee=Y?"height":"width";var te=a.useState(!1),ne=te[0],re=te[1],oe=a.useState({}),ie=oe[0],ae=oe[1],le=a.useState({start:!1,end:!1}),ue=le[0],ce=le[1],se=a.useState({overflow:"hidden",marginBottom:null}),fe=se[0],de=se[1],pe=new Map,he=a.useRef(null),ve=a.useRef(null),me=function(){var e,t,n=he.current;if(n){var r=n.getBoundingClientRect();e={clientWidth:n.clientWidth,scrollLeft:n.scrollLeft,scrollTop:n.scrollTop,scrollLeftNormalized:d(n,K.direction),scrollWidth:n.scrollWidth,top:r.top,bottom:r.bottom,left:r.left,right:r.right}}if(n&&!1!==B){var o=ve.current.children;if(o.length>0){var i=o[pe.get(B)];0,t=i?i.getBoundingClientRect():null}}return{tabsMeta:e,tabMeta:t}},ge=Object(T.a)((function(){var e,t=me(),n=t.tabsMeta,r=t.tabMeta,o=0;if(r&&n)if(Y)o=r.top-n.top+n.scrollTop;else{var i=G?n.scrollLeftNormalized+n.clientWidth-n.scrollWidth:n.scrollLeft;o=r.left-n.left+i}var a=(e={},Object(l.a)(e,Q,o),Object(l.a)(e,ee,r?r[ee]:0),e);if(isNaN(ie[Q])||isNaN(ie[ee]))ae(a);else{var u=Math.abs(ie[Q]-a[Q]),c=Math.abs(ie[ee]-a[ee]);(u>=1||c>=1)&&ae(a)}})),ye=function(e){!function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},i=r.ease,a=void 0===i?p:i,l=r.duration,u=void 0===l?300:l,c=null,s=t[e],f=!1,d=function(){f=!0},h=function r(i){if(f)o(new Error("Animation cancelled"));else{null===c&&(c=i);var l=Math.min(1,(i-c)/u);t[e]=a(l)*(n-s)+s,l>=1?requestAnimationFrame((function(){o(null)})):requestAnimationFrame(r)}};s===n?o(new Error("Element already at target position")):requestAnimationFrame(h)}(X,he.current,e)},be=function(e){var t=he.current[X];Y?t+=e:(t+=e*(G?-1:1),t*=G&&"reverse"===f()?-1:1),ye(t)},Se=function(){be(-he.current[J])},we=function(){be(he.current[J])},Oe=a.useCallback((function(e){de({overflow:null,marginBottom:-e})}),[]),Ce=Object(T.a)((function(){var e=me(),t=e.tabsMeta,n=e.tabMeta;if(n&&t)if(n[Q]<t[Q]){var r=t[X]+(n[Q]-t[Q]);ye(r)}else if(n[Z]>t[Z]){var o=t[X]+(n[Z]-t[Z]);ye(o)}})),xe=Object(T.a)((function(){if(q&&"off"!==R){var e,t,n=he.current,r=n.scrollTop,o=n.scrollHeight,i=n.clientHeight,a=n.scrollWidth,l=n.clientWidth;if(Y)e=r>1,t=r<o-i-1;else{var u=d(he.current,K.direction);e=G?u<a-l-1:u>1,t=G?u>1:u<a-l-1}e===ue.start&&t===ue.end||ce({start:e,end:t})}}));a.useEffect((function(){var e=Object(c.a)((function(){ge(),xe()})),t=Object(s.a)(he.current);return t.addEventListener("resize",e),function(){e.clear(),t.removeEventListener("resize",e)}}),[ge,xe]);var Ee=a.useCallback(Object(c.a)((function(){xe()})));a.useEffect((function(){return function(){Ee.clear()}}),[Ee]),a.useEffect((function(){re(!0)}),[]),a.useEffect((function(){ge(),xe()})),a.useEffect((function(){Ce()}),[Ce,ie]),a.useImperativeHandle(h,(function(){return{updateIndicator:ge,updateScrollButtons:xe}}),[ge,xe]);var ke=a.createElement(b,Object(o.a)({className:S.indicator,orientation:A,color:E},z,{style:Object(o.a)({},ie,z.style)})),_e=0,Te=a.Children.map(y,(function(e){if(!a.isValidElement(e))return null;var t=void 0===e.props.value?_e:e.props.value;pe.set(t,_e);var n=t===B;return _e+=1,a.cloneElement(e,{fullWidth:"fullWidth"===U,indicator:n&&!ne&&ke,selected:n,selectionFollowsFocus:N,onChange:k,textColor:H,value:t})})),je=function(){var e={};e.scrollbarSizeListener=q?a.createElement(v,{className:S.scrollable,onChange:Oe}):null;var t=ue.start||ue.end,n=q&&("auto"===R&&t||"desktop"===R||"on"===R);return e.scrollButtonStart=n?a.createElement(M,Object(o.a)({orientation:A,direction:G?"right":"left",onClick:Se,disabled:!ue.start,className:Object(u.default)(S.scrollButtons,"on"!==R&&S.scrollButtonsDesktop)},L)):null,e.scrollButtonEnd=n?a.createElement(M,Object(o.a)({orientation:A,direction:G?"left":"right",onClick:we,disabled:!ue.end,className:Object(u.default)(S.scrollButtons,"on"!==R&&S.scrollButtonsDesktop)},L)):null,e}();return a.createElement(C,Object(o.a)({className:Object(u.default)(S.root,w,Y&&S.vertical),ref:t},$),je.scrollButtonStart,je.scrollbarSizeListener,a.createElement("div",{className:Object(u.default)(S.scroller,q?S.scrollable:S.fixed),style:fe,ref:he,onScroll:Ee},a.createElement("div",{"aria-label":n,"aria-labelledby":r,className:Object(u.default)(S.flexContainer,Y&&S.flexContainerVertical,g&&!q&&S.centered),onKeyDown:function(e){var t=e.target;if("tab"===t.getAttribute("role")){var n=null,r="vertical"!==A?"ArrowLeft":"ArrowUp",o="vertical"!==A?"ArrowRight":"ArrowDown";switch("vertical"!==A&&"rtl"===K.direction&&(r="ArrowRight",o="ArrowLeft"),e.key){case r:n=t.previousElementSibling||ve.current.lastChild;break;case o:n=t.nextElementSibling||ve.current.firstChild;break;case"Home":n=ve.current.firstChild;break;case"End":n=ve.current.lastChild}null!==n&&(n.focus(),e.preventDefault())}},ref:ve,role:"tablist"},Te),ne&&ke),je.scrollButtonEnd)})),A=Object(m.a)((function(e){return{root:{overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},vertical:{flexDirection:"column"},flexContainer:{display:"flex"},flexContainerVertical:{flexDirection:"column"},centered:{justifyContent:"center"},scroller:{position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},fixed:{overflowX:"hidden",width:"100%"},scrollable:{overflowX:"scroll",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},scrollButtons:{},scrollButtonsDesktop:Object(l.a)({},e.breakpoints.down("xs"),{display:"none"}),indicator:{}}}),{name:"MuiTabs"})(P),I=n(116),M=a.forwardRef((function(e,t){var n=e.children,r=Object(i.a)(e,["children"]),l=Object(I.d)();if(null===l)throw new TypeError("No TabContext provided");var u=a.Children.map(n,(function(e){return a.cloneElement(e,{"aria-controls":Object(I.b)(l,e.props.value),id:Object(I.c)(l,e.props.value)})}));return a.createElement(A,Object(o.a)({},r,{ref:t,value:l.value}),u)}));t.a=M},function(e,t,n){"use strict";var r="undefined"!==typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!==typeof msCrypto&&"function"===typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),o=new Uint8Array(16);function i(){if(!r)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(o)}var a=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var l=function(e){return"string"===typeof e&&a.test(e)},u=[],c=0;c<256;++c)u.push((c+256).toString(16).substr(1));var s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(u[e[t+0]]+u[e[t+1]]+u[e[t+2]]+u[e[t+3]]+"-"+u[e[t+4]]+u[e[t+5]]+"-"+u[e[t+6]]+u[e[t+7]]+"-"+u[e[t+8]]+u[e[t+9]]+"-"+u[e[t+10]]+u[e[t+11]]+u[e[t+12]]+u[e[t+13]]+u[e[t+14]]+u[e[t+15]]).toLowerCase();if(!l(n))throw TypeError("Stringified UUID is invalid");return n};t.a=function(e,t,n){var r=(e=e||{}).random||(e.rng||i)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return s(r)}},function(e,t,n){"use strict";var r=n(1),o=n(45),i=n(2),a=n(0),l=n.n(a),u=(n(3),n(30)),c=n(32),s=n(10),f=n.n(s),d=!1,p=n(63),h=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var o,i=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?i?(o="exited",r.appearStatus="entering"):o="entered":o=t.unmountOnExit||t.mountOnEnter?"unmounted":"exited",r.state={status:o},r.nextCallback=null,r}Object(c.a)(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&"unmounted"===t.status?{status:"exited"}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?"entering"!==n&&"entered"!==n&&(t="entering"):"entering"!==n&&"entered"!==n||(t="exiting")}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!==typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),"entering"===t?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&"exited"===this.state.status&&this.setState({status:"unmounted"})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,o=this.props.nodeRef?[r]:[f.a.findDOMNode(this),r],i=o[0],a=o[1],l=this.getTimeouts(),u=r?l.appear:l.enter;!e&&!n||d?this.safeSetState({status:"entered"},(function(){t.props.onEntered(i)})):(this.props.onEnter(i,a),this.safeSetState({status:"entering"},(function(){t.props.onEntering(i,a),t.onTransitionEnd(u,(function(){t.safeSetState({status:"entered"},(function(){t.props.onEntered(i,a)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:f.a.findDOMNode(this);t&&!d?(this.props.onExit(r),this.safeSetState({status:"exiting"},(function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:"exited"},(function(){e.props.onExited(r)}))}))}))):this.safeSetState({status:"exited"},(function(){e.props.onExited(r)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:f.a.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],i=o[0],a=o[1];this.props.addEndListener(i,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if("unmounted"===e)return null;var t=this.props,n=t.children,r=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,Object(u.a)(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return l.a.createElement(p.a.Provider,{value:null},"function"===typeof n?n(e,r):l.a.cloneElement(l.a.Children.only(n),r))},t}(l.a.Component);function v(){}h.contextType=p.a,h.propTypes={},h.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:v,onEntering:v,onEntered:v,onExit:v,onExiting:v,onExited:v},h.UNMOUNTED="unmounted",h.EXITED="exited",h.ENTERING="entering",h.ENTERED="entered",h.EXITING="exiting";var m=h,g=n(31);function y(e,t){var n=e.timeout,r=e.style,o=void 0===r?{}:r;return{duration:o.transitionDuration||"number"===typeof n?n:n[t.mode]||0,delay:o.transitionDelay}}var b=n(12);function S(e){return"scale(".concat(e,", ").concat(Math.pow(e,2),")")}var w={entering:{opacity:1,transform:S(1)},entered:{opacity:1,transform:"none"}},O=a.forwardRef((function(e,t){var n=e.children,l=e.disableStrictModeCompat,u=void 0!==l&&l,c=e.in,s=e.onEnter,f=e.onEntered,d=e.onEntering,p=e.onExit,h=e.onExited,v=e.onExiting,O=e.style,C=e.timeout,x=void 0===C?"auto":C,E=e.TransitionComponent,k=void 0===E?m:E,_=Object(i.a)(e,["children","disableStrictModeCompat","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"]),T=a.useRef(),j=a.useRef(),P=Object(g.a)(),A=P.unstable_strictMode&&!u,I=a.useRef(null),M=Object(b.a)(n.ref,t),D=Object(b.a)(A?I:void 0,M),R=function(e){return function(t,n){if(e){var r=A?[I.current,t]:[t,n],i=Object(o.a)(r,2),a=i[0],l=i[1];void 0===l?e(a):e(a,l)}}},N=R(d),F=R((function(e,t){!function(e){e.scrollTop}(e);var n,r=y({style:O,timeout:x},{mode:"enter"}),o=r.duration,i=r.delay;"auto"===x?(n=P.transitions.getAutoHeightDuration(e.clientHeight),j.current=n):n=o,e.style.transition=[P.transitions.create("opacity",{duration:n,delay:i}),P.transitions.create("transform",{duration:.666*n,delay:i})].join(","),s&&s(e,t)})),z=R(f),L=R(v),V=R((function(e){var t,n=y({style:O,timeout:x},{mode:"exit"}),r=n.duration,o=n.delay;"auto"===x?(t=P.transitions.getAutoHeightDuration(e.clientHeight),j.current=t):t=r,e.style.transition=[P.transitions.create("opacity",{duration:t,delay:o}),P.transitions.create("transform",{duration:.666*t,delay:o||.333*t})].join(","),e.style.opacity="0",e.style.transform=S(.75),p&&p(e)})),H=R(h);return a.useEffect((function(){return function(){clearTimeout(T.current)}}),[]),a.createElement(k,Object(r.a)({appear:!0,in:c,nodeRef:A?I:void 0,onEnter:F,onEntered:z,onEntering:N,onExit:V,onExited:H,onExiting:L,addEndListener:function(e,t){var n=A?e:t;"auto"===x&&(T.current=setTimeout(n,j.current||0))},timeout:"auto"===x?null:x},_),(function(e,t){return a.cloneElement(n,Object(r.a)({style:Object(r.a)({opacity:0,transform:S(.75),visibility:"exited"!==e||c?void 0:"hidden"},w[e],O,n.props.style),ref:D},t))}))}));O.muiSupportAuto=!0;t.a=O},function(e,t,n){"use strict";var r=n(1),o=n(45),i=n(2),a=n(14),l=n(0),u=n(10),c=(n(3),n(4)),s=n(434),f=n(15),d=n(6),p=n(7),h=n(456),v=n(174),m=n(401),g=n(442),y=n(47),b=n(26),S=n(12);function w(e){return"function"===typeof e?e():e}var O="undefined"!==typeof window?l.useLayoutEffect:l.useEffect,C={},x=l.forwardRef((function(e,t){var n=e.anchorEl,o=e.children,a=e.container,u=e.disablePortal,c=void 0!==u&&u,s=e.keepMounted,f=void 0!==s&&s,d=e.modifiers,p=e.open,h=e.placement,x=void 0===h?"bottom":h,E=e.popperOptions,k=void 0===E?C:E,_=e.popperRef,T=e.style,j=e.transition,P=void 0!==j&&j,A=Object(i.a)(e,["anchorEl","children","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition"]),I=l.useRef(null),M=Object(S.a)(I,t),D=l.useRef(null),R=Object(S.a)(D,_),N=l.useRef(R);O((function(){N.current=R}),[R]),l.useImperativeHandle(_,(function(){return D.current}),[]);var F=l.useState(!0),z=F[0],L=F[1],V=function(e,t){if("ltr"===(t&&t.direction||"ltr"))return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}(x,Object(m.a)()),H=l.useState(V),B=H[0],W=H[1];l.useEffect((function(){D.current&&D.current.update()}));var U=l.useCallback((function(){if(I.current&&n&&p){D.current&&(D.current.destroy(),N.current(null));var e=function(e){W(e.placement)},t=(w(n),new v.a(w(n),I.current,Object(r.a)({placement:V},k,{modifiers:Object(r.a)({},c?{}:{preventOverflow:{boundariesElement:"window"}},d,k.modifiers),onCreate:Object(y.a)(e,k.onCreate),onUpdate:Object(y.a)(e,k.onUpdate)})));N.current(t)}}),[n,c,d,p,V,k]),$=l.useCallback((function(e){Object(b.a)(M,e),U()}),[M,U]),K=function(){D.current&&(D.current.destroy(),N.current(null))};if(l.useEffect((function(){return function(){K()}}),[]),l.useEffect((function(){p||P||K()}),[p,P]),!f&&!p&&(!P||z))return null;var q={placement:B};return P&&(q.TransitionProps={in:p,onEnter:function(){L(!1)},onExited:function(){L(!0),K()}}),l.createElement(g.a,{disablePortal:c,container:a},l.createElement("div",Object(r.a)({ref:$,role:"tooltip"},A,{style:Object(r.a)({position:"fixed",top:0,left:0,display:p||!f||P?null:"none"},T)}),"function"===typeof o?o(q):o))}));var E=n(88),k=n(91),_=n(31);function T(e){return Math.round(1e5*e)/1e5}var j=!1,P=null;var A=l.forwardRef((function(e,t){var n=e.arrow,a=void 0!==n&&n,f=e.children,d=e.classes,v=e.disableFocusListener,m=void 0!==v&&v,g=e.disableHoverListener,y=void 0!==g&&g,w=e.disableTouchListener,O=void 0!==w&&w,C=e.enterDelay,T=void 0===C?100:C,A=e.enterNextDelay,I=void 0===A?0:A,M=e.enterTouchDelay,D=void 0===M?700:M,R=e.id,N=e.interactive,F=void 0!==N&&N,z=e.leaveDelay,L=void 0===z?0:z,V=e.leaveTouchDelay,H=void 0===V?1500:V,B=e.onClose,W=e.onOpen,U=e.open,$=e.placement,K=void 0===$?"bottom":$,q=e.PopperComponent,G=void 0===q?x:q,Y=e.PopperProps,X=e.title,Q=e.TransitionComponent,Z=void 0===Q?h.a:Q,J=e.TransitionProps,ee=Object(i.a)(e,["arrow","children","classes","disableFocusListener","disableHoverListener","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","id","interactive","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","title","TransitionComponent","TransitionProps"]),te=Object(_.a)(),ne=l.useState(),re=ne[0],oe=ne[1],ie=l.useState(null),ae=ie[0],le=ie[1],ue=l.useRef(!1),ce=l.useRef(),se=l.useRef(),fe=l.useRef(),de=l.useRef(),pe=Object(k.a)({controlled:U,default:!1,name:"Tooltip",state:"open"}),he=Object(o.a)(pe,2),ve=he[0],me=he[1],ge=ve,ye=function(e){var t=l.useState(e),n=t[0],r=t[1],o=e||n;return l.useEffect((function(){null==n&&r("mui-".concat(Math.round(1e5*Math.random())))}),[n]),o}(R);l.useEffect((function(){return function(){clearTimeout(ce.current),clearTimeout(se.current),clearTimeout(fe.current),clearTimeout(de.current)}}),[]);var be=function(e){clearTimeout(P),j=!0,me(!0),W&&W(e)},Se=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(t){var n=f.props;"mouseover"===t.type&&n.onMouseOver&&e&&n.onMouseOver(t),ue.current&&"touchstart"!==t.type||(re&&re.removeAttribute("title"),clearTimeout(se.current),clearTimeout(fe.current),T||j&&I?(t.persist(),se.current=setTimeout((function(){be(t)}),j?I:T)):be(t))}},we=Object(E.a)(),Oe=we.isFocusVisible,Ce=we.onBlurVisible,xe=we.ref,Ee=l.useState(!1),ke=Ee[0],_e=Ee[1],Te=function(){ke&&(_e(!1),Ce())},je=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(t){re||oe(t.currentTarget),Oe(t)&&(_e(!0),Se()(t));var n=f.props;n.onFocus&&e&&n.onFocus(t)}},Pe=function(e){clearTimeout(P),P=setTimeout((function(){j=!1}),800+L),me(!1),B&&B(e),clearTimeout(ce.current),ce.current=setTimeout((function(){ue.current=!1}),te.transitions.duration.shortest)},Ae=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(t){var n=f.props;"blur"===t.type&&(n.onBlur&&e&&n.onBlur(t),Te()),"mouseleave"===t.type&&n.onMouseLeave&&t.currentTarget===re&&n.onMouseLeave(t),clearTimeout(se.current),clearTimeout(fe.current),t.persist(),fe.current=setTimeout((function(){Pe(t)}),L)}},Ie=function(e){ue.current=!0;var t=f.props;t.onTouchStart&&t.onTouchStart(e)},Me=Object(S.a)(oe,t),De=Object(S.a)(xe,Me),Re=l.useCallback((function(e){Object(b.a)(De,u.findDOMNode(e))}),[De]),Ne=Object(S.a)(f.ref,Re);""===X&&(ge=!1);var Fe=!ge&&!y,ze=Object(r.a)({"aria-describedby":ge?ye:null,title:Fe&&"string"===typeof X?X:null},ee,f.props,{className:Object(c.default)(ee.className,f.props.className),onTouchStart:Ie,ref:Ne}),Le={};O||(ze.onTouchStart=function(e){Ie(e),clearTimeout(fe.current),clearTimeout(ce.current),clearTimeout(de.current),e.persist(),de.current=setTimeout((function(){Se()(e)}),D)},ze.onTouchEnd=function(e){f.props.onTouchEnd&&f.props.onTouchEnd(e),clearTimeout(de.current),clearTimeout(fe.current),e.persist(),fe.current=setTimeout((function(){Pe(e)}),H)}),y||(ze.onMouseOver=Se(),ze.onMouseLeave=Ae(),F&&(Le.onMouseOver=Se(!1),Le.onMouseLeave=Ae(!1))),m||(ze.onFocus=je(),ze.onBlur=Ae(),F&&(Le.onFocus=je(!1),Le.onBlur=Ae(!1)));var Ve=l.useMemo((function(){return Object(s.a)({popperOptions:{modifiers:{arrow:{enabled:Boolean(ae),element:ae}}}},Y)}),[ae,Y]);return l.createElement(l.Fragment,null,l.cloneElement(f,ze),l.createElement(G,Object(r.a)({className:Object(c.default)(d.popper,F&&d.popperInteractive,a&&d.popperArrow),placement:K,anchorEl:re,open:!!re&&ge,id:ze["aria-describedby"],transition:!0},Le,Ve),(function(e){var t=e.placement,n=e.TransitionProps;return l.createElement(Z,Object(r.a)({timeout:te.transitions.duration.shorter},n,J),l.createElement("div",{className:Object(c.default)(d.tooltip,d["tooltipPlacement".concat(Object(p.a)(t.split("-")[0]))],ue.current&&d.touch,a&&d.tooltipArrow)},X,a?l.createElement("span",{className:d.arrow,ref:le}):null))})))}));t.a=Object(d.a)((function(e){return{popper:{zIndex:e.zIndex.tooltip,pointerEvents:"none"},popperInteractive:{pointerEvents:"auto"},popperArrow:{'&[x-placement*="bottom"] $arrow':{top:0,left:0,marginTop:"-0.71em",marginLeft:4,marginRight:4,"&::before":{transformOrigin:"0 100%"}},'&[x-placement*="top"] $arrow':{bottom:0,left:0,marginBottom:"-0.71em",marginLeft:4,marginRight:4,"&::before":{transformOrigin:"100% 0"}},'&[x-placement*="right"] $arrow':{left:0,marginLeft:"-0.71em",height:"1em",width:"0.71em",marginTop:4,marginBottom:4,"&::before":{transformOrigin:"100% 100%"}},'&[x-placement*="left"] $arrow':{right:0,marginRight:"-0.71em",height:"1em",width:"0.71em",marginTop:4,marginBottom:4,"&::before":{transformOrigin:"0 0"}}},tooltip:{backgroundColor:Object(f.b)(e.palette.grey[700],.9),borderRadius:e.shape.borderRadius,color:e.palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(10),lineHeight:"".concat(T(1.4),"em"),maxWidth:300,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium},tooltipArrow:{position:"relative",margin:"0"},arrow:{overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:Object(f.b)(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}},touch:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:"".concat(T(16/14),"em"),fontWeight:e.typography.fontWeightRegular},tooltipPlacementLeft:Object(a.a)({transformOrigin:"right center",margin:"0 24px "},e.breakpoints.up("sm"),{margin:"0 14px"}),tooltipPlacementRight:Object(a.a)({transformOrigin:"left center",margin:"0 24px"},e.breakpoints.up("sm"),{margin:"0 14px"}),tooltipPlacementTop:Object(a.a)({transformOrigin:"center bottom",margin:"24px 0"},e.breakpoints.up("sm"),{margin:"14px 0"}),tooltipPlacementBottom:Object(a.a)({transformOrigin:"center top",margin:"24px 0"},e.breakpoints.up("sm"),{margin:"14px 0"})}}),{name:"MuiTooltip",flip:!1})(A)}]]);
//# sourceMappingURL=2.661418fb.chunk.js.map |
$(document).ready(function() {
/*
$('.btn-add').click(function(event) {
var collectionHolder = $('#' + $(this).attr('data-target'));
var prototype = collectionHolder.attr('data-prototype');
var form = prototype.replace(/__name__/g, collectionHolder.children().length);
collectionHolder.append(form);
return false;
});*/
/*$('.btn-remove').live('click', function(event) {
var name = $(this).attr('data-related');
$('*[data-content="'+name+'"]').remove();
return false;
});
*/
function remplirSelect (dataAjax) {
$.ajax({
url: Routing.generate('changements_listbyprojet'),
type: "POST",
data : dataAjax,
dataType: "json",
success: function(reponse){
// Sur Succès de la réponse AJAX
var optionData = reponse;
var cer_arr=[];
for (key in optionData['chgmnt']) {
cer_arr.push(optionData['chgmnt'][key]);
}
// supprimer la precedente select list
$("#changements_idapplis> option").remove();
i = 0;
var selected_appli='';
console.log("arr cert:" + cer_arr);
var selectedItems = $("#changements_idapplis").select2("val");
for (key in optionData['applis']) {
// si appartient au changement
if(jQuery.inArray(+ key,cer_arr) != -1){
console.log("key in array: key=" + key);
selected_appli='selected="selected"';
/* console.log("in array: key=" + key);*/
selectedItems.push(key);
}
// on remplit les applis en f() de projet
$("#changements_idapplis").append( '<option label="'
+ optionData['applis'][key]
+ '"' + 'value="' + key + '"' + selected_appli + '>'
+ optionData['applis'][key]
+ '</option>');
i++;
selected_appli='';
/* console.log("Ajout : key=" + key);*/
/*$("#changements_idapplis").select2("val", "15");
$("#changements_idapplis").select2("val", "23");*/
}
$("#changements_idapplis").select2("val", selectedItems);
} //Eof:: success
}); //Eof:: ajax
} //Eof:: fucntion remplirSelect
function remplirSelectStandard (dataAjax) {
$.ajax({
url: Routing.generate('changements_listbyprojet'),
type: "POST",
data : dataAjax,
dataType: "json",
success: function(reponse){
// Sur Succès de la réponse AJAX
var optionData = reponse;
var values = {selected: [], unselected:[]};
$("#changements_idapplis > option").each(function(){
values[this.selected ? 'selected' : 'unselected'].push(this.value);
console.log("this.value=" + this.value);
});
var cer_arr=[];
for (key in optionData['chgmnt']) {
cer_arr.push(optionData['chgmnt'][key]);
}
$("#changements_idapplis> option").remove();
i = 0;
var selected_appli='';
console.log("arr cert:" + cer_arr);
for (key in optionData['applis']) {
if(jQuery.inArray(+ key,cer_arr) != -1){
console.log("key in array: key=" + key);
selected_appli='selected="selected"';
}
/* pour select2 fo effacer les champs non presents dans new projet*/
else {
$("#changements_idapplis option[value='" + key + "']").remove();
}
// on remplit les applis en f() de projet
$("#changements_idapplis").append( '<option label="'
+ optionData['applis'][key]
+ '"' + 'value="' + key + '"' + selected_appli + '>'
+ optionData['applis'][key]
+ '</option>');
i++;
selected_appli='';
}
} //Eof:: success
}); //Eof:: ajax
} //Eof:: fucntion remplirSelect
//Sur fin du chargement du document
// on charge la bonne liste
//Vid_cert = $("input#moncert_id").val();
Vid_projet = $("select#changements_idProjet").val();
Vid_chgmnt = $("div#divchmgt").html();
/*Vid_chgmt = $("form").attr('action');
var parts = Vid_chgmt.split('/');*/
console.log("id_projet=" + Vid_projet + "id_chgmnt=" + Vid_chgmnt);
var dataAjax = {
id_projet:Vid_projet,
id_changement: Vid_chgmnt
};
/* au chargement */
remplirSelect (dataAjax);
/* var myclone = "{{ is_clone|escape('js') }}";
if (typeof myclone != 'undefined') {
}
*/
/* $("#changements_idapplis").select2("val", ["15","23"]); */
// Sur changement de l'un des 'select'
// on recharge la bonne liste
$("select#changements_idProjet").change(function(){
Vid_projet = $("select#changements_idProjet").val();
/* Vid_chgmt = $("form").attr('action');*/
Vid_chgmnt = $("div#divchmgt").html();
//var parts = Vid_chgmt.split('/');
console.log("debug: id_projet=" + Vid_projet + " id_chgmnt=" + Vid_chgmnt);
var dataAjax = {
id_projet:Vid_projet,
id_changement: Vid_chgmnt
};
remplirSelect (dataAjax);
/* $("#changements_idapplis").select2("val", ["15","23"]); */
}); //Eof:: sur changement de l'un des 'select'
}); //Eof:: ready
|
from .shapenet import ShapeNet
from .modelnet import ModelNet
|
module.exports = function(config){
config.set({
basePath : './',
files : [
'app/bower_components/angular/angular.js',
'app/bower_components/angular-route/angular-route.js',
'app/bower_components/angular-mocks/angular-mocks.js',
'app/common/**/*.js',
'app/view*/**/*.js'
],
autoWatch : true,
frameworks: ['jasmine'],
browsers : ['Chrome'],
plugins : [
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-jasmine',
'karma-junit-reporter'
],
junitReporter : {
outputFile: 'test_out/unit.xml',
suite: 'unit'
}
});
};
|
function calcSpaceGridLAB(){
var numberOfSteps = 20;
var numberOfParticles = 20;
var radStep = 1.0/numberOfParticles;
var lightStep = 100/numberOfSteps;
var tmpLABColor = new classColor_LAB(0,0,0);
var tmpLABColorTest = new classColor_LAB(0,0,0);
positionsLAB=[];
labABMax = 0;
for (var i = 1; i < numberOfSteps; i++) {
var particelSet =[];
var currentLightPos = i*lightStep;
var distanceStep = 20;
var errorStep = 0.1;
tmpLABColor.set1Value(currentLightPos);
tmpLABColorTest.set1Value(currentLightPos);
for (var j = 0; j < numberOfParticles; j++) {
var tmpStepSize = distanceStep;
var currentRad = (j*radStep * Math.PI * 2) - Math.PI;
var currentDistance = 0;
var finishedSpreading = false;
tmpLABColor.set2Value(Math.cos(currentRad));
tmpLABColor.set3Value(Math.sin(currentRad));
if(tmpLABColor.checkRGBPossiblity()){
while (finishedSpreading == false) {
var tmpDistance = currentDistance+tmpStepSize;
tmpLABColor.set2Value(tmpDistance *Math.cos(currentRad));
tmpLABColor.set3Value(tmpDistance *Math.sin(currentRad));
tmpLABColorTest.set2Value((tmpDistance+errorStep) *Math.cos(currentRad));
tmpLABColorTest.set3Value((tmpDistance+errorStep) *Math.sin(currentRad));
if(tmpLABColor.checkRGBPossiblity()){
if(tmpLABColorTest.checkRGBPossiblity()){
// update current possition
currentDistance=tmpDistance;
}
else{
// finishedSpreading because plus errorStep would be out of the RGB possible Space
finishedSpreading=true;
labABMax = Math.max(labABMax,tmpLABColor.get2Value());
labABMax = Math.max(labABMax,tmpLABColor.get3Value());
particelSet.push(new classColor_LAB(tmpLABColor.get1Value(), tmpLABColor.get2Value(), tmpLABColor.get3Value()));
}
}
else {
tmpStepSize=tmpStepSize/2;
}
}
} // if (check if start color is possible)
else{
positionsLAB=[];
labABMax = 0;
return;
}
} // for particles
positionsLAB.push(particelSet);
} // for step
}
function calcSpaceGridDIN99(){
var numberOfSteps = 10;
var numberOfParticles = 20;
var radStep = 1.0/numberOfParticles;
var lightStep = 100/numberOfSteps;
var tmpDIN99Color = new classColorDIN99(0,0,0);
var tmpDIN99ColorTest = new classColorDIN99(0,0,0);
positionsDIN99=[];
din99ABMax = 0;
for (var i = 1; i < numberOfSteps; i++) {
var particelSet =[];
var currentLightPos = i*lightStep;
var distanceStep = 20;
var errorStep = 1;
tmpDIN99Color.set1Value(currentLightPos);
tmpDIN99ColorTest.set1Value(currentLightPos);
for (var j = 0; j < numberOfParticles; j++) {
var tmpStepSize = distanceStep;
var currentRad = (j*radStep * Math.PI * 2) - Math.PI;
var currentDistance = 0;
var finishedSpreading = false;
tmpDIN99Color.set2Value(Math.cos(currentRad));
tmpDIN99Color.set3Value(Math.sin(currentRad));
if(tmpDIN99Color.checkRGBPossiblity()){
while (finishedSpreading == false) {
var tmpDistance = currentDistance+tmpStepSize;
tmpDIN99Color.set2Value(tmpDistance *Math.cos(currentRad));
tmpDIN99Color.set3Value(tmpDistance *Math.sin(currentRad));
tmpDIN99ColorTest.set2Value((tmpDistance+errorStep) *Math.cos(currentRad));
tmpDIN99ColorTest.set3Value((tmpDistance+errorStep) *Math.sin(currentRad));
if(tmpDIN99Color.checkRGBPossiblity()){
if(tmpDIN99ColorTest.checkRGBPossiblity()){
// update current possition
currentDistance=tmpDistance;
}
else{
// finishedSpreading because plus errorStep would be out of the RGB possible Space
finishedSpreading=true;
din99ABMax = Math.max(din99ABMax,tmpDIN99Color.get2Value());
din99ABMax = Math.max(din99ABMax,tmpDIN99Color.get3Value());
particelSet.push(new classColorDIN99(tmpDIN99Color.get1Value(), tmpDIN99Color.get2Value(), tmpDIN99Color.get3Value()));
}
}
else {
tmpStepSize=tmpStepSize/2;
}
}
} // if (check if start color is possible)
else{
positionsDIN99=[];
din99ABMax = 0;
return;
}
} // for particles
positionsDIN99.push(particelSet);
} // for step
}
|
var classgui_1_1Element =
[
[ "Type", "classgui_1_1Element.html#a1d44588cdbf972bb9a472a09313342f1", [
[ "LABEL", "classgui_1_1Element.html#a1d44588cdbf972bb9a472a09313342f1a6f434c508ad901b8667ed22f713e52bb", null ],
[ "WINDOW", "classgui_1_1Element.html#a1d44588cdbf972bb9a472a09313342f1a70e2a9fa5d5ec49dc67453eab551251d", null ]
] ],
[ "Element", "classgui_1_1Element.html#af6a916f676e3d6669300879a3a801082", null ],
[ "~Element", "classgui_1_1Element.html#a39d74e6828303952581fa6f1a79ac8c0", null ],
[ "draw", "classgui_1_1Element.html#a05464315989d86de215cfdab3b48ac40", null ],
[ "getRect", "classgui_1_1Element.html#a893ef17afa7b51b360ef25adeb9deceb", null ],
[ "idle", "classgui_1_1Element.html#acb64f2251e5a9eb25ecc18ebc2962b1e", null ],
[ "isVisible", "classgui_1_1Element.html#a16fed9a749cf49b343a1852295e05e6b", null ],
[ "onEvent", "classgui_1_1Element.html#a6cbcbc34a03d72461867a83022bed265", null ],
[ "setParent", "classgui_1_1Element.html#af8b6d5d361e7b12d1df375bc37391eab", null ],
[ "type", "classgui_1_1Element.html#af86c2808abaeddeae1c4ffbf6d39689b", null ],
[ "parent", "classgui_1_1Element.html#a4f3c5498a04fd45032e4d3960c372441", null ],
[ "position", "classgui_1_1Element.html#a175c6f8df8e9c1e6d71a1dffd10b1a94", null ],
[ "relative", "classgui_1_1Element.html#ae862b5da48b1bd1aec8f3bc5f3c65246", null ]
]; |
define(["exports", "../../@polymer/polymer/polymer-element.js", "../hax-body-behaviors/lib/HAXWiring.js", "../lrn-vocab/lrn-vocab.js"], function (_exports, _polymerElement, _HAXWiring, _lrnVocab) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.GlossaryTerm = void 0;
function _templateObject_334c51c0cf4a11e9b8b15bd4e98e0211() {
var data = babelHelpers.taggedTemplateLiteral(["\n <style>\n :host {\n display: inline-block;\n }\n\n :host([hidden]) {\n display: none;\n }\n\n lrn-vocab {\n display: inline;\n }\n </style>\n <template is=\"dom-if\" if=\"[[!_fallback]]\">\n <lrn-vocab term=\"[[display]]\">\n <div>[[definition]]</div>\n </lrn-vocab>\n </template>\n <template is=\"dom-if\" if=\"[[_fallback]]\">\n <slot></slot>\n </template>\n "]);
_templateObject_334c51c0cf4a11e9b8b15bd4e98e0211 = function _templateObject_334c51c0cf4a11e9b8b15bd4e98e0211() {
return data;
};
return data;
}
/**
* `glossary-term`
* ``
*
* @microcopy - language worth noting:
* -
*
* @customElement
* @polymer
* @demo demo/index.html
*/
var GlossaryTerm =
/*#__PURE__*/
function (_PolymerElement) {
babelHelpers.inherits(GlossaryTerm, _PolymerElement);
babelHelpers.createClass(GlossaryTerm, null, [{
key: "template",
// render function
get: function get() {
return (0, _polymerElement.html)(_templateObject_334c51c0cf4a11e9b8b15bd4e98e0211());
} // haxProperty definition
}, {
key: "haxProperties",
get: function get() {
return {
canScale: true,
canPosition: true,
canEditSource: false,
gizmo: {
title: "Glossary term",
description: "",
icon: "icons:android",
color: "green",
groups: ["Term"],
handles: [{
type: "todo:read-the-docs-for-usage"
}],
meta: {
author: "heyMP",
owner: "PSU"
}
},
settings: {
quick: [],
configure: [{
property: "name",
description: "",
inputMethod: "textfield",
required: false,
icon: "icons:android"
}, {
property: "definition",
description: "",
inputMethod: "textfield",
required: false,
icon: "icons:android"
}, {
property: "display",
description: "",
inputMethod: "textfield",
required: false,
icon: "icons:android"
}],
advanced: []
}
};
} // properties available to the custom element for data binding
}, {
key: "properties",
get: function get() {
return {
name: {
name: "name",
type: String,
value: "",
reflectToAttribute: false
},
definition: {
name: "display",
type: String,
value: "",
reflectToAttribute: false
},
display: {
name: "display",
type: String,
value: "",
reflectToAttribute: false
},
serviceType: {
name: "serviceType",
type: String,
value: "file"
},
endpoint: {
name: "endpoint",
type: String,
value: ""
},
_fallback: {
name: "_fallback",
type: Boolean,
value: true,
reflectToAttribute: false,
observer: false
}
};
}
/**
* Store the tag name to make it easier to obtain directly.
* @notice function name must be here for tooling to operate correctly
*/
}, {
key: "tag",
get: function get() {
return "glossary-term";
}
}, {
key: "observers",
get: function get() {
return [// Observer method name, followed by a list of dependencies, in parenthesis
"__endpointMethodChanged(endpoint, serviceType)"];
}
/**
* life cycle, element is afixed to the DOM
*/
}]);
function GlossaryTerm() {
var _this;
babelHelpers.classCallCheck(this, GlossaryTerm);
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(GlossaryTerm).call(this));
_this.HAXWiring = new _HAXWiring.HAXWiring();
_this.HAXWiring.setup(GlossaryTerm.haxProperties, GlossaryTerm.tag, babelHelpers.assertThisInitialized(_this));
return _this;
}
babelHelpers.createClass(GlossaryTerm, [{
key: "__endpointMethodChanged",
value: function __endpointMethodChanged(endpoint, serviceType) {
var _this2 = this;
// fetch definition
if (endpoint) {
if (serviceType === "file") {
fetch(endpoint, {
method: "GET",
headers: {
"Content-Type": "application/json"
}
}).then(function (r) {
return r.json();
}).then(function (r) {
var foundterm = r.terms.find(function (i) {
return i.name === _this2.name;
});
if (foundterm) {
_this2.definition = foundterm.definition;
_this2._fallback = false;
} else {
_this2._fallback = true;
}
});
} else if (serviceType === "graphql") {
fetch(this.endpoint, {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
query: "{ term(name: \"".concat(this.name, "\") { name definition } }")
})
}).then(function (r) {
return r.json();
}).then(function (r) {
try {
_this2.definition = r.data.term.definition;
_this2._fallback = false;
} catch (error) {}
});
}
}
}
/**
* life cycle, element is removed from the DOM
*/
//disconnectedCallback() {}
}]);
return GlossaryTerm;
}(_polymerElement.PolymerElement);
_exports.GlossaryTerm = GlossaryTerm;
window.customElements.define(GlossaryTerm.tag, GlossaryTerm);
}); |
"""Views padrões para serem herdadas pelas apps que desejarem utilizar
as customizações implementadas.
"""
import logging
import secrets
import string
from datetime import date, datetime
from locale import normalize
import pytz
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.mixins import (LoginRequiredMixin,
PermissionRequiredMixin)
from django.contrib.auth.models import User
from django.contrib.auth.views import (LoginView, LogoutView)
from django.core.exceptions import (FieldDoesNotExist, FieldError,
ValidationError)
from django.core.mail import EmailMessage
from django.db.models import (ForeignKey, Q)
from django.db.models.fields import BooleanField as BooleanFieldModel
from django.db.models.fields.related_descriptors import ForwardManyToOneDescriptor, ManyToManyDescriptor
from django.db.models.query_utils import DeferredAttribute
from django.http import HttpResponse
from django.shortcuts import redirect
from django.urls import reverse
from django.utils.text import camel_case_to_spaces
from django.views import View
from django.views.generic import DetailView, ListView, TemplateView
from django.views.generic.edit import (CreateView, DeleteView, UpdateView)
from .forms import BaseForm
from .models import Base
from base.settings import SYSTEM_NAME
# Configurando o logger
logger = logging.getLogger(__name__)
def has_fk_attr(classe=None, attr=None):
try:
classe.objects.values(attr)
except Exception as e:
return False
return True
def get_breadcrumbs(url_str):
"""
Método para criar o Breadcrumbs a ser utilizado nos templastes
Arguments:
url_str {String} -- [Nome da app e do Models]
Returns:
[Lista] -- [Lista com o breadcrumb]
"""
breadcrumbs = []
breadcrumbs.append({'slug': "Inicio", 'url': "/", })
url = '/'
array_url = url_str.strip('/').split('/')
cont = 1
for slug in array_url:
breadcrumb = {}
if slug != '':
breadcrumb['slug'] = camel_case_to_spaces(slug).title()
if cont < len(array_url):
url = '%s%s/' % (url, slug.lower())
breadcrumb['url'] = url
breadcrumbs.append(breadcrumb)
cont += 1
return breadcrumbs
def get_apps(self):
"""Método para recuperar todas as apps
Returns:
List -- Lista com as apps que o usuário tem acesso
"""
from django.apps import apps
_apps = []
for app in apps.get_app_configs():
try:
if (app.name.lower().__contains__('django') or
app.name.lower().__contains__('rest_framework') or
app.name.lower().__contains__('core') or
app.name.lower().__contains__('ckeditor') or
app.name.lower().__contains__('drf') or
app.name.lower().__contains__('dj_rest_auth') or
app.name.lower().__contains__('debug') or
app.name.lower().__contains__('corsheaders')):
continue
_models = []
for model in app.get_models():
_models.append({'name_model': model._meta.verbose_name,
'url_list_model': '/{app}/{model}/'.format(
app=model._meta.app_label,
model=model._meta.model_name),
'path_url': '{app}:{model}-list'.format(
app=model._meta.app_label.lower(),
model=model._meta.model_name.lower()
),
'real_name_model': model._meta.model_name
})
# só adiciona a app caso o models tenha conteudo
if len(_models) > 0:
#Caso tenha o icone da app
if hasattr(app, 'icon'):
icon = app.icon
else:
icon = None
_apps.append({'name_app': '%s' % app.verbose_name,
'icon_app': icon,
'models_app': _models,
'index_url_app': '{}:{}-index'.format(model._meta.app_label,
model._meta.app_label),
'real_name_app': app.name,
'real_name_model': model._meta.model_name})
except Exception as error:
print(error)
continue
return _apps
class BaseTemplateView(TemplateView):
"""
Classe base que deve ser herdada caso o desenvolvedor queira reaproveitar
as funcionalidades já desenvolvidas TemplateView
Na classe que herdar dessa deve ser atribuido o valor template_name com o caminho até o template HTML a ser renderizado
Raises:
ValidationError -- Caso não seja atribuido o valor da variavel template_name ocorrerá uma excessão
"""
def __init__(self):
if self.template_name is None:
raise ValidationError(
message='Deve ser definido o caminho do template na variavel "template_name" em sua Views!')
super(BaseTemplateView, self).__init__()
def get_context_data(self, **kwargs):
context = super(BaseTemplateView, self).get_context_data(**kwargs)
context['user_ip'] = self.request.META.get('HTTP_X_FORWARDED_FOR') or self.request.META.get('REMOTE_ADDR')
context['system_name'] = SYSTEM_NAME
context['apps'] = get_apps(self)
return context
class IndexTemplate(LoginRequiredMixin, PermissionRequiredMixin, BaseTemplateView):
"""[summary]
Arguments:
BaseTemplateView {[type]} -- [description]
Returns:
[type] -- [description]
"""
template_name = "core/index.html"
context_object_name = 'core'
def has_permission(self):
"""
Verifica se tem alguma das permissões retornadas pelo
get_permission_required, caso tenha pelo menos uma ele
retorna True
"""
return not self.request.user is None and self.request.user.is_authenticated and self.request.user.is_active
class BaseListView(LoginRequiredMixin, PermissionRequiredMixin, ListView):
"""
Classe base que deve ser herdada caso o desenvolvedor queira reaproveitar
as funcionalidades já desenvolvidas ListView
Na classe que herdar dessa deve ser atribuido o valor template_name com o caminho até o template HTML a ser renderizado
Raises:
ValidationError -- Caso não seja atribuido o valor da variavel template_name ocorrerá uma excessão
"""
model = Base
list_filter = []
search_fields = []
list_display = list_filter + search_fields
query_params_q = ""
url_pagination = ""
query_params_filters = []
paginate_by = 1000
template_name_suffix = '_list'
def __init__(self):
if self.template_name is None:
raise ValidationError(
message='Deve ser definido o caminho do template na variável "template_name" em sua Views!')
super(BaseListView, self).__init__()
def get_permission_required(self):
"""
cria a lista de permissões que a view pode ter de acordo com cada model.
"""
return ('{app}.add_{model}'.format(app=self.model._meta.app_label, model=self.model._meta.model_name),
'{app}.delete_{model}'.format(app=self.model._meta.app_label, model=self.model._meta.model_name),
'{app}.change_{model}'.format(app=self.model._meta.app_label, model=self.model._meta.model_name))
def has_permission(self):
"""
Verifica se tem alguma das permissões retornadas pelo
get_permission_required, caso tenha pelo menos uma ele
retorna True
"""
perms = self.get_permission_required()
# o retorno usa a função any para retornar True caso tenha pelo menos uma das permissões na lista perms
return any(self.request.user.has_perm(perm) for perm in perms)
def get_queryset(self):
queryset = super(BaseListView, self).get_queryset()
if ((hasattr(self.model, '_meta') and hasattr(self.model._meta, 'ordering') and self.model._meta.ordering) or
((hasattr(self.model, 'Meta') and hasattr(self.model.Meta, 'ordering') and self.model.Meta.ordering))):
queryset = queryset.order_by(
*(self.model._meta.ordering or self.model.Meta.ordering))
try:
param_filter = self.request.GET.get('q')
query_dict = self.request.GET
query_params = Q()
for field in self.search_fields:
try:
queryset.filter(**{"%s__icontains" % field: param_filter})
query_params |= Q(**{"%s__icontains" % field: param_filter})
continue
except Exception as e:
pass
if hasattr(self.model, field) and field != '' and (
field in ['pk', 'id'] or (field.split('__')[-1] in ['pk', 'id'])):
# se for um atributo de relacionamento então olha se é numero pois pk só aceita numero.
if not param_filter or (param_filter and param_filter.isnumeric()):
query_params |= Q(**{field: param_filter})
# olha se é um atributo normal ou se é de relacionamento
elif (hasattr(self.model, field) and type(getattr(self.model, field)) == DeferredAttribute):
query_params |= Q(**{'%s__icontains' % field: param_filter})
# resolve a opção de buscar pelo name do model quando usa GenericForeignKey com o atributo content_type no modelo
elif ('content_type' == field.split('__')[0] and hasattr(self.model, 'content_type') and
type(getattr(self.model, 'content_type')) == ForwardManyToOneDescriptor and
hasattr(ContentType, field.replace('content_type__', ''))):
param_filter_content_type = param_filter
try:
param_filter_content_type = param_filter_content_type.replace(" ", '').lower()
param_filter_content_type = normalize('NFKD', param_filter_content_type).encode(
'ASCII', 'ignore').decode('ASCII')
except Exception as erro_tipo:
logger.error('Erro: %s; No Metodo: %s' % (erro_tipo, 'BaseListView.get_queryset()'))
pass
query_params |= Q(**{'%s__icontains' % field: param_filter_content_type})
elif ('content_object' == field.split('__')[0] and hasattr(self.model, 'content_object') and
type(getattr(self.model, 'content_object')) == GenericForeignKey):
try:
# lista de objetos genericos usados pelo model
list_object = queryset.values('content_type_id').distinct()
for obj in ContentType.objects.filter(id__in=list_object).all():
try:
# pega o campo do modelo a ser buscado
field_name = field.replace('content_object__', '')
# pega os ids dos objetos filtrados
list_id_object = obj.model_class().objects.filter(
**{field_name: param_filter}).values_list('id', flat=True)
if len(list_id_object) > 0:
query_params |= Q(content_type_id=obj.id, object_id__in=list_id_object)
except Exception as erro_content:
logger.error('Erro: %s; No Metodo: %s' % (erro_content, 'BaseListView.get_queryset()'))
pass
except Exception as e:
logger.error('Erro: %s; No Metodo: %s' % (e, 'BaseListView.get_queryset()'))
pass
else:
if hasattr(self.model, field) and type(getattr(self.model, field)) != ManyToManyDescriptor:
query_params |= Q(**{field: param_filter})
if param_filter:
queryset = queryset.filter(query_params)
for chave, valor in query_dict.items():
if valor is not None and valor != 'None' and valor != '':
if chave not in ['q', 'csrfmiddlewaretoken', 'page']:
not_exact = False
if "__not_exact" in chave:
not_exact = True
chave = "%s%s" % (chave.split("__")[0], "__exact")
try:
campo_date = DateTimeField().clean(valor)
if not_exact:
queryset = queryset.exclude(**{chave: campo_date})
else:
queryset = queryset.filter(**{chave: campo_date})
continue
except Exception as e_date:
logger.error('Erro: %s; No Metodo: %s' % (e_date, 'BaseListView.get_queryset()'))
pass
queryset = queryset.filter(**{chave: valor})
return queryset
except FieldError as fe:
if field:
# COLOQUE O extra_tags='danger' PARA CASO DE ERROS, POIS O DJANGO MANDA O NOME erro E NÃO danger QUE É PADRÃO DO BOOTSTRAP
messages.error(self.request, "Erro com o campo '%s'!" % field, extra_tags='danger')
logger.error('Erro: %s; No Metodo: %s' % (fe, 'BaseListView.get_queryset()'))
return queryset.none()
except Exception as e:
print(e)
messages.error(self.request, "Erro ao tentar filtrar!", extra_tags='danger')
logger.error('Erro: %s; No Metodo: %s' % (e, 'BaseListView.get_queryset()'))
return queryset.none()
def list_display_verbose_name(self):
list_display_verbose_name = []
for name in self.get_list_display():
try:
if name == '__str__':
if hasattr(self.model, name) and hasattr(self.model._meta, 'verbose_name'):
list_display_verbose_name.append(getattr(self.model._meta, 'verbose_name'))
elif '__' in name and name != '__str__' and has_fk_attr(self.model, name):
list_name = name.split('__')
list_name.reverse()
list_display_verbose_name.append(' '.join(list_name).title())
elif name != 'pk' and name != 'id':
# verifica se existe auguma função feita na view e usada no display
# verifica se é do tipo allow_tags
# e verifica se tem o short_description para usa-lo no cabeçario da tabela do list
if hasattr(self, name) and hasattr(getattr(self, name), 'allow_tags') \
and getattr(self, name).allow_tags and \
hasattr(getattr(self, name), 'short_description'):
list_display_verbose_name.append(
getattr(self, name).short_description)
elif hasattr(self.model, name):
field = self.model._meta.get_field(name)
if hasattr(field, 'verbose_name'):
verbose_name = field.verbose_name.title()
list_display_verbose_name.append(verbose_name)
else:
list_display_verbose_name.append(name)
else:
list_display_verbose_name.append(name)
else:
list_display_verbose_name.append(name)
except FieldDoesNotExist as e:
raise FieldDoesNotExist("%s não tem nenhum campo chamado '%s'" % (self.model._meta.model_name, name))
return list_display_verbose_name
def list_display_plural_verbose_name(self):
list_display_plural_verbose_name = []
for name in self.get_list_display():
try:
field = self.model._meta.get_field(name)
if name == '__str__':
if hasattr(self.model, name) and hasattr(self.model._meta, 'verbose_name_plural'):
list_display_plural_verbose_name.append(getattr(self.model._meta, 'verbose_name_plural'))
elif '__' in name and name != '__str__' and has_fk_attr(self.model, name):
list_name = name.split('__')
list_name.reverse()
list_display_plural_verbose_name.append(' '.join(list_name).title())
elif name != 'pk' and name != 'id':
# verifica se existe auguma função feita na view e usada no display
# verifica se é do tipo allow_tags
# e verifica se tem o short_description para usa-lo no cabeçario da tabela do list
if hasattr(self, name) and hasattr(getattr(self, name), 'allow_tags') \
and getattr(self, name).allow_tags and \
hasattr(getattr(self, name), 'short_description'):
list_display_plural_verbose_name.append(
getattr(self, name).short_description)
elif hasattr(self.model, name):
field = self.model._meta.get_field(name)
if hasattr(field, 'verbose_name_plural'):
verbose_name = self.model._meta.get_field(
name).verbose_name_plural.title()
list_display_plural_verbose_name.append(
verbose_name)
else:
list_display_plural_verbose_name.append(name)
else:
list_display_plural_verbose_name.append(name)
except FieldDoesNotExist as e:
raise FieldDoesNotExist("%s não tem nenhum campo chamado '%s'" % (
self.model._meta.model_name, name))
return list_display_plural_verbose_name
def get_list_display(self):
list_display = []
# define os campos padrões
if not self.list_display:
self.list_display = ['pk', '__str__']
# define os campos padrões
if self.list_display and 'pk' in self.list_display and len(self.list_display) <= 1 and hasattr(self.model,
'__str__'):
self.list_display += ['__str__']
# ordena para que o id sempre venha primeiro ou em segundo caso tenha o pk
if 'id' in self.list_display:
self.list_display.remove('id')
self.list_display = ['id'] + self.list_display
# ordena para que o pk sempre venha primeiro
if 'pk' in self.list_display:
self.list_display.remove('pk')
self.list_display = ['pk'] + self.list_display
else:
self.list_display = ['pk'] + self.list_display
# faz a checagem dos campos
for name in self.list_display:
# verifica casos onde pega campos dos filhos ex: pai__name
if '__' in name and name != '__str__' and not has_fk_attr(self.model, name):
messages.error(self.request, "%s ou a View não tem nenhum campo chamado '%s'" % (
self.model._meta.model_name, name),
extra_tags='danger')
elif not '__' in name and not hasattr(self.model, name) and not hasattr(self, name):
messages.error(self.request,
"%s ou a View não tem nenhum campo chamado '%s'" % (
self.model._meta.model_name, name),
extra_tags='danger')
continue
elif not '__' in name and not hasattr(self.model, name) and hasattr(self, name) and (
not hasattr(getattr(self, name), 'allow_tags') or
(hasattr(getattr(self, name), 'allow_tags') and not getattr(self, name).allow_tags)):
messages.error(self.request,
"%s não tem nenhum campo chamado '%s'" % (
self.model._meta.model_name, name),
extra_tags='danger')
continue
if not name in list_display:
list_display.append(name)
return list_display
def get_context_data(self, **kwargs):
try:
# se colocar o do super da erro de paginação
# context = super().get_context_data(**kwargs)
context = super(BaseListView, self).get_context_data(**kwargs)
context['user_ip'] = self.request.META.get(
'HTTP_X_FORWARDED_FOR') or self.request.META.get('REMOTE_ADDR')
context['display'] = self.list_display_verbose_name()
# processa os parametros para retorna-los ao template
query_params = dict(self.request.GET)
if query_params:
# retira o parametro page e add ele em outra variável, apensas dele
if query_params.get('page'):
query_params.pop('page')
# retira o csrf token caso exista
if query_params.get('csrfmiddlewaretoken'):
query_params.pop('csrfmiddlewaretoken')
# cria a url para add ao link de paginação para não perder os filtros
url_pagination = ''
for key, value in query_params.items():
url_pagination += "{}={}&".format(key,
value[0].replace(" ", "+"))
# add a url dos filtros e da pesquisa no context
context['url_pagination'] = url_pagination
# retira o parametro do campo de pesquisa e add ele em outra variável no context apensas dele
if query_params.get('q'):
context['query_params_q'] = query_params.pop('q')[0]
# O apps todas as verificações sobram os filtros que são add em outra variável no context apenas dele.
context['query_params_filters'] = query_params
# manipulo a lista para tratar de forma diferente
list_item = []
for obj in context['object_list']:
field_dict = {}
obj._meta.get_fields(include_parents=True)
# percorre os atributos setados no list_display
for field_display in self.get_list_display():
try:
if '__' in field_display and field_display != '__str__' and has_fk_attr(obj.__class__,
field_display):
lista_fk = context['object_list'].values(
'id', field_display)
for item_fk in lista_fk:
if item_fk['id'] == obj.id:
field_dict[field_display] = "{}".format(
item_fk[field_display])
elif hasattr(obj, field_display) and field_display != '__str__':
# verifica se o campo não é None se sim entra no if
if obj.__getattribute__(field_display) is not None:
# Verificando se o campo possui o metodo do CHOICE
str_metodo_choice = 'get_{nome}_display'.format(
nome=field_display)
if hasattr(obj, str_metodo_choice):
field_dict[field_display] = "{}".format(
getattr(obj, str_metodo_choice)().__str__())
else:
if type(getattr(obj, field_display)) == datetime:
campo_date_time = getattr(
obj, field_display)
tz = pytz.timezone(settings.TIME_ZONE)
date_tz = tz.normalize(campo_date_time)
field_dict[field_display] = "{}".format(
date_tz.strftime(settings.DATETIME_INPUT_FORMATS[0] or
"%d/%m/%Y %H:%M"))
elif type(getattr(obj, field_display)) == date:
field_dict[field_display] = "{}".format(
getattr(obj, field_display).strftime(settings.DATE_INPUT_FORMATS[0] or
"%d/%m/%Y"))
# verifica se é um ManyToMany
elif hasattr(getattr(obj, field_display), 'all'):
list_many = []
# pega uma string feita com o str de cada objeto da lista
for sub_obj in getattr(obj, field_display).all():
list_many.append(
'{}'.format(sub_obj))
field_dict[field_display] = ', '.join(
list_many)
else:
field_dict[field_display] = "{}".format(
getattr(obj, field_display).__str__())
else:
# no caso de campos None ele coloca para aparecer vasio
field_dict[field_display] = ""
elif field_display == '__str__':
field_dict[field_display] = "{}".format(
getattr(obj, field_display)())
elif hasattr(self, field_display) and self.__getattribute__(
field_display) and field_display != '__str__':
# elif verifica se existe auguma função feita na view e usada no display
# elif verifica se é do tipo allow_tags
# elif então usa o retorno da função para aparecer na lista
field_dict[field_display] = getattr(
self, field_display)(obj)
except Exception as e:
logger.error(e)
messages.error(self.request, "Erro com o campo '%s' no model '%s'!" % (field_display, str(obj)),
extra_tags='danger')
continue
list_item.append(field_dict)
# reinício da lista modificada para aproveitar a variavel page_list e retornar apenas um objeto, no template eu separo de novo
context['object_list'] = list_item
context['system_name'] = SYSTEM_NAME
object_filters = []
# Refatorar para não precisar pecorrer os itens duas vezes
for field in self.model._meta.fields:
if field.name in self.list_filter:
# o label do choices.
filter = {}
# variavel para ficar no label do campo
label_name = ' '.join(str(field.name).split('_')).title()
if hasattr(field, 'verbose_name') and field.verbose_name:
label_name = field.verbose_name
# Verificando se o campo e relacionamento
if isinstance(field, ForeignKey):
filter[field.name] = {'label': label_name, 'list': field.related_model.objects.distinct(),
'type_filter': 'ForeignKey'}
# Verificando se o campo eh booleano
elif isinstance(field, BooleanFieldModel):
filter[field.name] = {'label': label_name, 'list': ['True', 'False'],
'type_filter': 'BooleanFieldModel'}
elif isinstance(field, DateField) or isinstance(field, DateTimeField):
# cria um choice list com os operadores que poderá usar
choice_date_list = []
choice_date_list.append(
{'choice_id': '__exact', 'choice_label': 'Igual'})
choice_date_list.append(
{'choice_id': '__not_exact', 'choice_label': 'Diferente'})
choice_date_list.append(
{'choice_id': '__lt', 'choice_label': 'Menor que'})
choice_date_list.append(
{'choice_id': '__gt', 'choice_label': 'Maior que'})
choice_date_list.append(
{'choice_id': '__lte', 'choice_label': 'Menor Igual a'})
choice_date_list.append(
{'choice_id': '__gte', 'choice_label': 'Maior Igual a'})
filter[field.name] = {'label': label_name, 'list': choice_date_list,
'type_filter': str(type(field))[:-2].split('.')[-1]}
else:
# Verificando se o campo possui o atributo CHOICE
if hasattr(field, 'choices') and len(getattr(field, 'choices')) > 0 \
and hasattr(field, 'flatchoices') and len(getattr(field, 'flatchoices')) > 0:
choice_list = []
for choice in getattr(field, 'flatchoices'):
item = {
'choice_id': choice[0], 'choice_label': choice[1]}
choice_list.append(item)
filter[field.name] = {'label': label_name, 'list': choice_list,
'type_filter': 'ChoiceField'}
else:
# ele ja faz o distinct e ordena de acordo com o nome do campo
# add um dicionario com o nome do label, lista do filtro e o tipo de campo
filter[field.name] = {'label': label_name, 'list': self.get_queryset().
values_list(field.name, flat=True).order_by(
field.attname).distinct(field.attname),
'type_filter': str(type(field))[:-2].split('.')[-1]}
object_filters.append(filter)
context['filters'] = object_filters
context['url_create'] = '{app}:{model}-create'.format(app=self.model._meta.app_label,
model=self.model._meta.model_name)
context['url_update'] = '{app}:{model}-update'.format(app=self.model._meta.app_label,
model=self.model._meta.model_name)
context['url_detail'] = '{app}:{model}-detail'.format(app=self.model._meta.app_label,
model=self.model._meta.model_name)
context['url_delete'] = '{app}:{model}-delete'.format(app=self.model._meta.app_label,
model=self.model._meta.model_name)
context['url_list'] = '{app}:{model}-list'.format(app=self.model._meta.app_label,
model=self.model._meta.model_name)
url_str = reverse(context['url_list']) + ' Listar'
context['breadcrumbs'] = get_breadcrumbs(url_str)
context['model_name'] = '%s' % (
self.model._meta.verbose_name_plural or self.model._meta.object_name).title()
context['apps'] = get_apps(self)
context['has_add_permission'] = self.model(
).has_add_permission(self.request)
context['has_change_permission'] = self.model(
).has_change_permission(self.request)
context['has_delete_permission'] = self.model(
).has_delete_permission(self.request)
return context
except Exception as error:
pass
except Exception as e:
pass
class BaseDetailView(LoginRequiredMixin, PermissionRequiredMixin, DetailView):
"""
Classe base que deve ser herdada caso o desenvolvedor queira reaproveitar
as funcionalidades já desenvolvidas para DetailView
Na classe que herdar dessa deve ser atribuido o valor template_name com o caminho até o template HTML a ser renderizado
Raises:
ValidationError -- Caso não seja atribuido o valor da variavel template_name ocorrerá uma excessão
"""
model = Base
exclude = []
template_name_suffix = '_detail'
def get_template_names(self):
if self.template_name:
return [self.template_name, ]
return ['outside_template/base_detail.html', ]
def get_permission_required(self):
"""
cria a lista de permissões que a view pode ter de acordo com cada model.
"""
return ('{app}.add_{model}'.format(app=self.model._meta.app_label, model=self.model._meta.model_name),
'{app}.delete_{model}'.format(
app=self.model._meta.app_label, model=self.model._meta.model_name),
'{app}.change_{model}'.format(app=self.model._meta.app_label, model=self.model._meta.model_name))
def has_permission(self):
"""
Verifica se tem alguma das permissões retornadas pelo
get_permission_required, caso tenha pelo menos uma ele
retorna True
"""
perms = self.get_permission_required()
# o retorno usa a função any para retornar True caso tenha pelo menos uma das permissões na lista perms
return any(self.request.user.has_perm(perm) for perm in perms)
def get_context_data(self, **kwargs):
context = super(BaseDetailView, self).get_context_data(**kwargs)
object_list, many_fields = self.object.get_all_related_fields()
context['user_ip'] = self.request.META.get(
'HTTP_X_FORWARDED_FOR') or self.request.META.get('REMOTE_ADDR')
context['object_list'] = object_list
context['many_fields'] = many_fields
context['system_name'] = SYSTEM_NAME
context['url_create'] = '{app}:{model}-create'.format(app=self.model._meta.app_label,
model=self.model._meta.model_name)
context['url_update'] = '{app}:{model}-update'.format(app=self.model._meta.app_label,
model=self.model._meta.model_name)
context['url_detail'] = '{app}:{model}-detail'.format(app=self.model._meta.app_label,
model=self.model._meta.model_name)
context['url_delete'] = '{app}:{model}-delete'.format(app=self.model._meta.app_label,
model=self.model._meta.model_name)
context['url_list'] = '{app}:{model}-list'.format(app=self.model._meta.app_label,
model=self.model._meta.model_name)
url_str = reverse(context['url_list']) + \
' Detalhe {}'.format(context['object'].pk)
context['breadcrumbs'] = get_breadcrumbs(url_str)
context['model_name'] = '%s' % (
self.model._meta.verbose_name or self.model._meta.object_name or '').title()
context['apps'] = get_apps(self)
context['has_add_permission'] = self.model(
).has_add_permission(self.request)
context['has_change_permission'] = self.model(
).has_change_permission(self.request)
context['has_delete_permission'] = self.model(
).has_delete_permission(self.request)
return context
class BaseUpdateView(LoginRequiredMixin, PermissionRequiredMixin, UpdateView):
"""
Classe base que deve ser herdada caso o desenvolvedor queira reaproveitar
as funcionalidades já desenvolvidas para UpdateView
Na classe que herdar dessa deve ser atribuido o valor template_name com o caminho até o template HTML a ser renderizado
Raises:
ValidationError -- Caso não seja atribuido o valor da variavel template_name ocorrerá uma excessão
"""
model = Base
form_class = BaseForm
template_name_suffix = '_update'
inlines = []
def __init__(self):
super(BaseUpdateView, self).__init__()
def get_template_names(self):
if self.template_name:
return [self.template_name]
return ['outside_template/base_update.html']
def get_success_url(self):
if self.success_url and self.success_url != '':
return self.success_url
else:
url = reverse('{app}:{model}-detail'.format(
app=self.model._meta.app_label,
model=self.model._meta.model_name), kwargs={"pk": self.object.pk}
)
return url
def get_permission_required(self):
"""
cria a lista de permissões que a view pode ter de acordo com cada model.
"""
return ('{app}.change_{model}'.format(app=self.model._meta.app_label, model=self.model._meta.model_name),)
def get_context_data(self, **kwargs):
context = super(BaseUpdateView, self).get_context_data(**kwargs)
context['user_ip'] = self.request.META.get(
'HTTP_X_FORWARDED_FOR') or self.request.META.get('REMOTE_ADDR')
context['list_inlines'] = self.get_formset_inlines()
context['system_name'] = SYSTEM_NAME
context['url_create'] = '{app}:{model}-create'.format(app=self.model._meta.app_label,
model=self.model._meta.model_name)
context['url_update'] = '{app}:{model}-update'.format(app=self.model._meta.app_label,
model=self.model._meta.model_name)
context['url_detail'] = '{app}:{model}-detail'.format(app=self.model._meta.app_label,
model=self.model._meta.model_name)
context['url_delete'] = '{app}:{model}-delete'.format(app=self.model._meta.app_label,
model=self.model._meta.model_name)
context['url_list'] = '{app}:{model}-list'.format(app=self.model._meta.app_label,
model=self.model._meta.model_name)
url_str = reverse(context['url_list']) + \
' Atualizar {}'.format(context['object'].pk)
context['breadcrumbs'] = get_breadcrumbs(url_str)
context['model_name'] = '%s' % (
self.model._meta.verbose_name_plural or self.model._meta.object_name or '').title()
context['apps'] = get_apps(self)
context['has_add_permission'] = self.model(
).has_add_permission(self.request)
context['has_change_permission'] = self.model(
).has_change_permission(self.request)
context['has_delete_permission'] = self.model(
).has_delete_permission(self.request)
return context
def get_formset_inlines(self):
"""Metodo utilizado para instanciar os inlines.
Returns:
List -- Lista com os formulários inline do form principal
"""
formset_inlines = []
if hasattr(self, 'inlines') and self.inlines:
for item in self.inlines:
if item.model().has_change_permission(self.request):
if self.request.POST:
formset = item(self.request.POST, self.request.FILES, instance=self.object,
prefix=item.model._meta.model_name)
else:
formset = item(instance=self.object,
prefix=item.model._meta.model_name)
lista_instance_inline = formset.queryset.all() or []
# só seta True caso os valores definidos na permissão do usuario e o can_delete do inlineformset_factory seja True
formset.can_delete = item.model().has_delete_permission(
self.request) and item.can_delete
if not formset.can_delete:
# se não tem permisão de excluir, então seta o valor minimo para 0
formset.min_num = 0
if not item.model().has_add_permission(self.request):
# se não tem permisão de adcionar, então seta o valor minimo para 0
formset.max_num = 0
if hasattr(formset, 'prefix') and formset.prefix:
# pode ser colocado o user aqui para utilizar na validação do forms
formset.form.user = self.request.user
formset_inlines.append(formset)
return formset_inlines
def get_form_kwargs(self):
"""Método utilizado para adicionar o request
Returns:
Kwargs
"""
kwargs = super(BaseUpdateView, self).get_form_kwargs()
kwargs['request'] = self.request
return kwargs
def form_valid(self, form):
"""Método para verificar se o formulário submetido está válido
Arguments:
form {Form} -- Formulário com os valores enviado para processamento
Returns:
Url -- O retorno é o redirecionamento para a URL de sucesso configurada na Views da app
"""
formset_inlines = self.get_formset_inlines()
if form.is_valid():
for form_formset in formset_inlines:
if not form_formset.is_valid():
return self.render_to_response(
context=self.get_context_data(form=form, named_formsets=formset_inlines))
self.object = form.save()
# for every formset, attempt to find a specific formset save function
# otherwise, just save.
for formset in formset_inlines:
formset.instance = self.object
formset.save()
messages.success(request=self.request, message="'{}', Alterado com Sucesso!".format(self.object),
extra_tags='success')
else:
messages.error(
request=self.request, message="Ocorreu um erro, verifique os campos!", extra_tags='danger')
return form.errors
# salva e add outro novo_continue
if '_addanother' in form.data:
return redirect(reverse(self.get_context_data()['url_create']))
# salva e continua editando
elif '_continue' in form.data:
return redirect(reverse(self.get_context_data()['url_update'], kwargs={'pk': self.object.pk}))
# salva e redireciona pra lista
else:
return redirect(self.get_success_url())
class BaseCreateView(LoginRequiredMixin, PermissionRequiredMixin, CreateView):
"""
Classe base que deve ser herdada caso o desenvolvedor queira reaproveitar
as funcionalidades já desenvolvidas para CreateView
Na classe que herdar dessa deve ser atribuido o valor template_name com o
caminho até o template HTML a ser renderizado
Raises:
ValidationError -- Caso não seja atribuido o valor da variavel template_name ocorrerá uma excessão
"""
model = Base
template_name_suffix = '_create'
form_class = BaseForm
inlines = []
def __init__(self):
super(BaseCreateView, self).__init__()
def get_template_names(self):
if self.template_name:
return [self.template_name, ]
return ['outside_template/base_create.html', ]
def get_success_url(self):
if self.success_url and self.success_url != '':
return reverse(self.success_url)
else:
url = reverse('{app}:{model}-detail'.format(
app=self.model._meta.app_label,
model=self.model._meta.model_name), kwargs={"pk": self.object.pk}
)
return url
def get_permission_required(self):
"""
cria a lista de permissões que a view pode ter de acordo com cada model.
"""
return ('{app}.add_{model}'.format(app=self.model._meta.app_label, model=self.model._meta.model_name),)
def get_context_data(self, **kwargs):
context = super(BaseCreateView, self).get_context_data(**kwargs)
context['user_ip'] = self.request.META.get(
'HTTP_X_FORWARDED_FOR') or self.request.META.get('REMOTE_ADDR')
context['list_inlines'] = self.get_formset_inlines()
context['system_name'] = SYSTEM_NAME
context['url_create'] = '{app}:{model}-create'.format(app=self.model._meta.app_label,
model=self.model._meta.model_name)
context['url_update'] = '{app}:{model}-update'.format(app=self.model._meta.app_label,
model=self.model._meta.model_name)
context['url_detail'] = '{app}:{model}-detail'.format(app=self.model._meta.app_label,
model=self.model._meta.model_name)
context['url_delete'] = '{app}:{model}-delete'.format(app=self.model._meta.app_label,
model=self.model._meta.model_name)
context['url_list'] = '{app}:{model}-list'.format(app=self.model._meta.app_label,
model=self.model._meta.model_name)
url_str = reverse(context['url_list']) + ' Criar'
context['breadcrumbs'] = get_breadcrumbs(url_str)
context['model_name'] = '%s' % (
self.model._meta.verbose_name_plural or self.model._meta.object_name or '').title()
context['apps'] = get_apps(self)
context['has_add_permission'] = self.model(
).has_add_permission(self.request)
context['has_change_permission'] = self.model(
).has_change_permission(self.request)
context['has_delete_permission'] = self.model(
).has_delete_permission(self.request)
return context
def get_form_kwargs(self):
"""Método utilizado para adicionar o request
Returns:
Kwargs
"""
kwargs = super(BaseCreateView, self).get_form_kwargs()
kwargs['request'] = self.request
return kwargs
def get_formset_inlines(self):
"""Metodo utilizado para instanciar os inlines.
Returns:
List -- Lista com os formulários inline do form principal
"""
formset_inlines = []
if hasattr(self, 'inlines') and self.inlines:
for item in self.inlines:
if item.model().has_change_permission(self.request):
if self.request.POST:
formset = item(self.request.POST, self.request.FILES, instance=self.object,
prefix=item.model._meta.model_name)
else:
formset = item(instance=self.object,
prefix=item.model._meta.model_name)
lista_instance_inline = formset.queryset.all() or []
formset.can_delete = item.model().has_delete_permission(self.request)
if not formset.can_delete:
formset.min_num = len(lista_instance_inline)
if not item.model().has_add_permission(self.request):
formset.max_num = len(lista_instance_inline)
if hasattr(formset, 'prefix') and formset.prefix:
# pode ser colocado o user aqui para utilizar na validação do forms
formset.form.user = self.request.user
formset_inlines.append(formset)
return formset_inlines
def form_valid(self, form):
"""Método para verificar se o formulário submetido está válido
Arguments:
form {Form} -- Formulário com os valores enviado para processamento
Returns:
Url -- O retorno é o redirecionamento para a URL de sucesso configurada na Views da app
"""
formset_inlines = self.get_formset_inlines()
if form.is_valid():
for form_formset in formset_inlines:
if not form_formset.is_valid():
return self.render_to_response(self.get_context_data(form=form))
try:
self.object = form.save()
for formset in formset_inlines:
formset.instance = self.object
formset.save()
except:
pass
messages.success(request=self.request, message="'{}', Criado com Sucesso!".format(self.object),
extra_tags='success')
else:
messages.error(
request=self.request, message="Ocorreu um erro, verifique os campos!", extra_tags='danger')
return form.errors
# salva e add outro novo_continue
if '_addanother' in form.data:
return redirect(reverse(self.get_context_data()['url_create']))
# salva e continua editando
elif '_continue' in form.data:
return redirect(reverse(self.get_context_data()['url_update'], kwargs={'pk': self.object.pk}))
# salva e redireciona pra lista
else:
return redirect(self.get_success_url())
class BaseDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteView):
"""Classe para gerenciar a deleção dos itens do sistema
Raises:
ValidationError -- [Deve ser definido o caminho para o template]
"""
model = Base
template_name_suffix = '_confirm_delete'
def __init__(self):
super(BaseDeleteView, self).__init__()
def get_template_names(self):
if self.template_name:
return [self.template_name, ]
return ['outside_template/base_delete.html', ]
def get_success_url(self):
try:
if self.success_url and self.success_url != '':
return reverse(self.success_url)
else:
url = reverse('{app}:{model}-list'.format(app=self.model._meta.app_label,
model=self.model._meta.model_name)
)
return url
except:
url = reverse('{app}:{model}-list'.format(app=self.model._meta.app_label,
model=self.model._meta.model_name))
return url
def get_permission_required(self):
"""
cria a lista de permissões que a view pode ter de acordo com cada model.
"""
return ('{app}.delete_{model}'.format(app=self.model._meta.app_label, model=self.model._meta.model_name),)
def get_context_data(self, **kwargs):
context = super(BaseDeleteView, self).get_context_data(**kwargs)
context['user_ip'] = self.request.META.get(
'HTTP_X_FORWARDED_FOR') or self.request.META.get('REMOTE_ADDR')
object_list, many_fields = self.object.get_all_related_fields()
context['object_list'] = object_list
context['many_fields'] = many_fields
context['system_name'] = SYSTEM_NAME
context['url_create'] = '{app}:{model}-create'.format(app=self.model._meta.app_label,
model=self.model._meta.model_name)
context['url_update'] = '{app}:{model}-update'.format(app=self.model._meta.app_label,
model=self.model._meta.model_name)
context['url_detail'] = '{app}:{model}-detail'.format(app=self.model._meta.app_label,
model=self.model._meta.model_name)
context['url_delete'] = '{app}:{model}-delete'.format(app=self.model._meta.app_label,
model=self.model._meta.model_name)
context['url_list'] = '{app}:{model}-list'.format(app=self.model._meta.app_label,
model=self.model._meta.model_name)
url_str = reverse(context['url_list']) + ' Apagar {}'.format(context['object'].pk)
context['breadcrumbs'] = get_breadcrumbs(url_str)
context['model_name'] = '%s' % (
self.model._meta.verbose_name_plural or self.model._meta.object_name or '').title()
context['apps'] = get_apps(self)
context['has_add_permission'] = self.model().has_add_permission(self.request)
context['has_change_permission'] = self.model().has_change_permission(self.request)
context['has_delete_permission'] = self.model().has_delete_permission(self.request)
return context
class LoginView(LoginView):
redirect_authenticated_user = True
template_name = 'core/registration/login.html'
class LogoutView(LogoutView):
template_name = 'core/registration/login.html'
class ProfileView(BaseTemplateView):
template_name = 'core/registration/profile.html'
class SettingsView(BaseTemplateView):
template_name = 'core/settings.html'
class ProfileUpdateView(View):
"""Views para atualizar os dados do perfil do usuario
"""
def post(self, request, *args, **kwargs):
try:
data = request.POST
request.user.first_name = data.get('first_name')
request.user.last_name = data.get('last_name')
request.user.email = data.get('email')
request.user.save()
except Exception as error:
print(error)
return redirect('core:profile') # Redirect using name url parameter
class UpdatePassword(View):
def post(self, request, *args, **kwargs):
try:
data = request.POST
new_password = data.get('new-password')
check_password = data.get('confirm-password')
if (new_password == check_password):
request.user.set_password(new_password)
request.user.save()
return redirect('core:login')
except Exception as error:
messages.error(request, 'Your password was successfully updated!')
print('Error: {}'.format(error))
return redirect('core:profile')
class ResetPassword(View):
def get(self, request, *args, **kwargs):
try:
data = request.GET
username = data.get('username')
user = User.objects.get(username=username)
email = data.get('email')
alphabet = string.ascii_letters + string.digits
password = ''.join(secrets.choice(alphabet) for i in range(10))
user.set_password(password)
user.save()
print(password)
# Send new password to email
email = EmailMessage('Rercuperação de Senha', 'Aqui está sua nova senha\n{}'.format(password),
'[email protected]', [user.email, ], )
email.send()
except Exception as error:
print(error)
finally:
return HttpResponse('Finalizado')
class IndexAdminTemplateView(LoginRequiredMixin, PermissionRequiredMixin, BaseTemplateView):
"""Template View index"""
template_name = "core/home.html"
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['user_ip'] = self.request.META.get('HTTP_X_FORWARDED_FOR') or self.request.META.get('REMOTE_ADDR')
url_str = '/'
try:
url_str = reverse('core:index')
except:
url_str = '/core/'
if 'app_name' in context:
url_str += context['app_name']
context['breadcrumbs'] = get_breadcrumbs(url_str)
context['system_name'] = SYSTEM_NAME
return context
def has_permission(self):
"""
Verifica se tem alguma das permissões retornadas pelo
get_permission_required, caso tenha pelo menos uma ele
retorna True
"""
return not self.request.user is None and self.request.user.is_authenticated and self.request.user.is_active
|
const db = require("../dbConfig");
const yup = require("yup");
let userSchema = yup.object().shape({
name: yup.string().required(),
password: yup.string().required(),
email: yup.string().email(),
role: yup.string().required()
});
function getAllUsers() {
return db("users");
}
async function registerUser(creds) {
const [id] = await db("users")
.insert(creds)
.returning("id");
const query = await db("users")
.where({ id })
.first();
return query;
}
function findBy(filter) {
return db("users")
.where(filter)
.first();
}
async function loginUser(creds) {
const user = await db("users")
.where({ name: creds.name })
.first();
return user;
}
//for later if necessary
function findUserByRole(role) {
return db("users").where({ role });
}
function getUserById(id) {
return db("users")
.select("id", "name", "email", "role")
.where({ id })
.first();
}
async function updateUser(id, user) {
const result = await db("users")
.where({ id })
.update(user);
return result;
}
async function deleteUser(id) {
const result = await db("users")
.where({ id })
.del();
return result;
}
// check validity
// userSchema
// .isValid({
// name: "jimmy",
// password: 24,
// email: "[email protected]",
// role: "print"
// })
// .then(function(valid) {
// valid; // => true
// console.log(valid);
// });
module.exports = {
getAllUsers,
registerUser,
loginUser,
getUserById,
findBy,
updateUser,
deleteUser,
userSchema
};
|
from __future__ import unicode_literals
import os
import shutil
import tempfile
import unittest
import pykka
from mopidy import core
from mopidy.local import actor, json
from mopidy.models import Track, Album, Artist
from tests import path_to_data_dir
# TODO: update tests to only use backend, not core. we need a seperate
# core test that does this integration test.
class LocalLibraryProviderTest(unittest.TestCase):
artists = [
Artist(name='artist1'),
Artist(name='artist2'),
Artist(name='artist3'),
Artist(name='artist4'),
Artist(name='artist5'),
Artist(name='artist6'),
Artist(),
]
albums = [
Album(name='album1', artists=[artists[0]]),
Album(name='album2', artists=[artists[1]]),
Album(name='album3', artists=[artists[2]]),
Album(name='album4'),
Album(artists=[artists[-1]]),
]
tracks = [
Track(
uri='local:track:path1', name='track1',
artists=[artists[0]], album=albums[0],
date='2001-02-03', length=4000, track_no=1),
Track(
uri='local:track:path2', name='track2',
artists=[artists[1]], album=albums[1],
date='2002', length=4000, track_no=2),
Track(
uri='local:track:path3', name='track3',
artists=[artists[3]], album=albums[2],
date='2003', length=4000, track_no=3),
Track(
uri='local:track:path4', name='track4',
artists=[artists[2]], album=albums[3],
date='2004', length=60000, track_no=4,
comment='This is a fantastic track'),
Track(
uri='local:track:path5', name='track5', genre='genre1',
album=albums[3], length=4000, composers=[artists[4]]),
Track(
uri='local:track:path6', name='track6', genre='genre2',
album=albums[3], length=4000, performers=[artists[5]]),
Track(uri='local:track:nameless', album=albums[-1]),
]
config = {
'local': {
'media_dir': path_to_data_dir(''),
'data_dir': path_to_data_dir(''),
'playlists_dir': b'',
'library': 'json',
},
}
def setUp(self):
actor.LocalBackend.libraries = [json.JsonLibrary]
self.backend = actor.LocalBackend.start(
config=self.config, audio=None).proxy()
self.core = core.Core(backends=[self.backend])
self.library = self.core.library
def tearDown(self):
pykka.ActorRegistry.stop_all()
actor.LocalBackend.libraries = []
def test_refresh(self):
self.library.refresh()
@unittest.SkipTest
def test_refresh_uri(self):
pass
def test_refresh_missing_uri(self):
# Verifies that https://github.com/mopidy/mopidy/issues/500
# has been fixed.
tmpdir = tempfile.mkdtemp()
try:
tmplib = os.path.join(tmpdir, 'library.json.gz')
shutil.copy(path_to_data_dir('library.json.gz'), tmplib)
config = {'local': self.config['local'].copy()}
config['local']['data_dir'] = tmpdir
backend = actor.LocalBackend(config=config, audio=None)
# Sanity check that value is in the library
result = backend.library.lookup(self.tracks[0].uri)
self.assertEqual(result, self.tracks[0:1])
# Clear and refresh.
open(tmplib, 'w').close()
backend.library.refresh()
# Now it should be gone.
result = backend.library.lookup(self.tracks[0].uri)
self.assertEqual(result, [])
finally:
shutil.rmtree(tmpdir)
@unittest.SkipTest
def test_browse(self):
pass # TODO
def test_lookup(self):
tracks = self.library.lookup(self.tracks[0].uri)
self.assertEqual(tracks, self.tracks[0:1])
def test_lookup_unknown_track(self):
tracks = self.library.lookup('fake uri')
self.assertEqual(tracks, [])
# TODO: move to search_test module
def test_find_exact_no_hits(self):
result = self.library.find_exact(track_name=['unknown track'])
self.assertEqual(list(result[0].tracks), [])
result = self.library.find_exact(artist=['unknown artist'])
self.assertEqual(list(result[0].tracks), [])
result = self.library.find_exact(albumartist=['unknown albumartist'])
self.assertEqual(list(result[0].tracks), [])
result = self.library.find_exact(composer=['unknown composer'])
self.assertEqual(list(result[0].tracks), [])
result = self.library.find_exact(performer=['unknown performer'])
self.assertEqual(list(result[0].tracks), [])
result = self.library.find_exact(album=['unknown album'])
self.assertEqual(list(result[0].tracks), [])
result = self.library.find_exact(date=['1990'])
self.assertEqual(list(result[0].tracks), [])
result = self.library.find_exact(genre=['unknown genre'])
self.assertEqual(list(result[0].tracks), [])
result = self.library.find_exact(track_no=['9'])
self.assertEqual(list(result[0].tracks), [])
result = self.library.find_exact(track_no=['no_match'])
self.assertEqual(list(result[0].tracks), [])
result = self.library.find_exact(comment=['fake comment'])
self.assertEqual(list(result[0].tracks), [])
result = self.library.find_exact(uri=['fake uri'])
self.assertEqual(list(result[0].tracks), [])
result = self.library.find_exact(any=['unknown any'])
self.assertEqual(list(result[0].tracks), [])
def test_find_exact_uri(self):
track_1_uri = 'local:track:path1'
result = self.library.find_exact(uri=track_1_uri)
self.assertEqual(list(result[0].tracks), self.tracks[:1])
track_2_uri = 'local:track:path2'
result = self.library.find_exact(uri=track_2_uri)
self.assertEqual(list(result[0].tracks), self.tracks[1:2])
def test_find_exact_track_name(self):
result = self.library.find_exact(track_name=['track1'])
self.assertEqual(list(result[0].tracks), self.tracks[:1])
result = self.library.find_exact(track_name=['track2'])
self.assertEqual(list(result[0].tracks), self.tracks[1:2])
def test_find_exact_artist(self):
result = self.library.find_exact(artist=['artist1'])
self.assertEqual(list(result[0].tracks), self.tracks[:1])
result = self.library.find_exact(artist=['artist2'])
self.assertEqual(list(result[0].tracks), self.tracks[1:2])
result = self.library.find_exact(artist=['artist3'])
self.assertEqual(list(result[0].tracks), self.tracks[3:4])
def test_find_exact_composer(self):
result = self.library.find_exact(composer=['artist5'])
self.assertEqual(list(result[0].tracks), self.tracks[4:5])
result = self.library.find_exact(composer=['artist6'])
self.assertEqual(list(result[0].tracks), [])
def test_find_exact_performer(self):
result = self.library.find_exact(performer=['artist6'])
self.assertEqual(list(result[0].tracks), self.tracks[5:6])
result = self.library.find_exact(performer=['artist5'])
self.assertEqual(list(result[0].tracks), [])
def test_find_exact_album(self):
result = self.library.find_exact(album=['album1'])
self.assertEqual(list(result[0].tracks), self.tracks[:1])
result = self.library.find_exact(album=['album2'])
self.assertEqual(list(result[0].tracks), self.tracks[1:2])
def test_find_exact_albumartist(self):
# Artist is both track artist and album artist
result = self.library.find_exact(albumartist=['artist1'])
self.assertEqual(list(result[0].tracks), [self.tracks[0]])
# Artist is both track and album artist
result = self.library.find_exact(albumartist=['artist2'])
self.assertEqual(list(result[0].tracks), [self.tracks[1]])
# Artist is just album artist
result = self.library.find_exact(albumartist=['artist3'])
self.assertEqual(list(result[0].tracks), [self.tracks[2]])
def test_find_exact_track_no(self):
result = self.library.find_exact(track_no=['1'])
self.assertEqual(list(result[0].tracks), self.tracks[:1])
result = self.library.find_exact(track_no=['2'])
self.assertEqual(list(result[0].tracks), self.tracks[1:2])
def test_find_exact_genre(self):
result = self.library.find_exact(genre=['genre1'])
self.assertEqual(list(result[0].tracks), self.tracks[4:5])
result = self.library.find_exact(genre=['genre2'])
self.assertEqual(list(result[0].tracks), self.tracks[5:6])
def test_find_exact_date(self):
result = self.library.find_exact(date=['2001'])
self.assertEqual(list(result[0].tracks), [])
result = self.library.find_exact(date=['2001-02-03'])
self.assertEqual(list(result[0].tracks), self.tracks[:1])
result = self.library.find_exact(date=['2002'])
self.assertEqual(list(result[0].tracks), self.tracks[1:2])
def test_find_exact_comment(self):
result = self.library.find_exact(
comment=['This is a fantastic track'])
self.assertEqual(list(result[0].tracks), self.tracks[3:4])
result = self.library.find_exact(
comment=['This is a fantastic'])
self.assertEqual(list(result[0].tracks), [])
def test_find_exact_any(self):
# Matches on track artist
result = self.library.find_exact(any=['artist1'])
self.assertEqual(list(result[0].tracks), self.tracks[:1])
result = self.library.find_exact(any=['artist2'])
self.assertEqual(list(result[0].tracks), self.tracks[1:2])
# Matches on track name
result = self.library.find_exact(any=['track1'])
self.assertEqual(list(result[0].tracks), self.tracks[:1])
result = self.library.find_exact(any=['track2'])
self.assertEqual(list(result[0].tracks), self.tracks[1:2])
# Matches on track album
result = self.library.find_exact(any=['album1'])
self.assertEqual(list(result[0].tracks), self.tracks[:1])
# Matches on track album artists
result = self.library.find_exact(any=['artist3'])
self.assertEqual(
list(result[0].tracks), [self.tracks[3], self.tracks[2]])
# Matches on track composer
result = self.library.find_exact(any=['artist5'])
self.assertEqual(list(result[0].tracks), self.tracks[4:5])
# Matches on track performer
result = self.library.find_exact(any=['artist6'])
self.assertEqual(list(result[0].tracks), self.tracks[5:6])
# Matches on track genre
result = self.library.find_exact(any=['genre1'])
self.assertEqual(list(result[0].tracks), self.tracks[4:5])
result = self.library.find_exact(any=['genre2'])
self.assertEqual(list(result[0].tracks), self.tracks[5:6])
# Matches on track date
result = self.library.find_exact(any=['2002'])
self.assertEqual(list(result[0].tracks), self.tracks[1:2])
# Matches on track comment
result = self.library.find_exact(
any=['This is a fantastic track'])
self.assertEqual(list(result[0].tracks), self.tracks[3:4])
# Matches on URI
result = self.library.find_exact(any=['local:track:path1'])
self.assertEqual(list(result[0].tracks), self.tracks[:1])
def test_find_exact_wrong_type(self):
test = lambda: self.library.find_exact(wrong=['test'])
self.assertRaises(LookupError, test)
def test_find_exact_with_empty_query(self):
test = lambda: self.library.find_exact(artist=[''])
self.assertRaises(LookupError, test)
test = lambda: self.library.find_exact(albumartist=[''])
self.assertRaises(LookupError, test)
test = lambda: self.library.find_exact(track_name=[''])
self.assertRaises(LookupError, test)
test = lambda: self.library.find_exact(composer=[''])
self.assertRaises(LookupError, test)
test = lambda: self.library.find_exact(performer=[''])
self.assertRaises(LookupError, test)
test = lambda: self.library.find_exact(album=[''])
self.assertRaises(LookupError, test)
test = lambda: self.library.find_exact(track_no=[''])
self.assertRaises(LookupError, test)
test = lambda: self.library.find_exact(genre=[''])
self.assertRaises(LookupError, test)
test = lambda: self.library.find_exact(date=[''])
self.assertRaises(LookupError, test)
test = lambda: self.library.find_exact(comment=[''])
self.assertRaises(LookupError, test)
test = lambda: self.library.find_exact(any=[''])
self.assertRaises(LookupError, test)
def test_search_no_hits(self):
result = self.library.search(track_name=['unknown track'])
self.assertEqual(list(result[0].tracks), [])
result = self.library.search(artist=['unknown artist'])
self.assertEqual(list(result[0].tracks), [])
result = self.library.search(albumartist=['unknown albumartist'])
self.assertEqual(list(result[0].tracks), [])
result = self.library.search(composer=['unknown composer'])
self.assertEqual(list(result[0].tracks), [])
result = self.library.search(performer=['unknown performer'])
self.assertEqual(list(result[0].tracks), [])
result = self.library.search(album=['unknown album'])
self.assertEqual(list(result[0].tracks), [])
result = self.library.search(track_no=['9'])
self.assertEqual(list(result[0].tracks), [])
result = self.library.search(track_no=['no_match'])
self.assertEqual(list(result[0].tracks), [])
result = self.library.search(genre=['unknown genre'])
self.assertEqual(list(result[0].tracks), [])
result = self.library.search(date=['unknown date'])
self.assertEqual(list(result[0].tracks), [])
result = self.library.search(comment=['unknown comment'])
self.assertEqual(list(result[0].tracks), [])
result = self.library.search(uri=['unknown uri'])
self.assertEqual(list(result[0].tracks), [])
result = self.library.search(any=['unknown anything'])
self.assertEqual(list(result[0].tracks), [])
def test_search_uri(self):
result = self.library.search(uri=['TH1'])
self.assertEqual(list(result[0].tracks), self.tracks[:1])
result = self.library.search(uri=['TH2'])
self.assertEqual(list(result[0].tracks), self.tracks[1:2])
def test_search_track_name(self):
result = self.library.search(track_name=['Rack1'])
self.assertEqual(list(result[0].tracks), self.tracks[:1])
result = self.library.search(track_name=['Rack2'])
self.assertEqual(list(result[0].tracks), self.tracks[1:2])
def test_search_artist(self):
result = self.library.search(artist=['Tist1'])
self.assertEqual(list(result[0].tracks), self.tracks[:1])
result = self.library.search(artist=['Tist2'])
self.assertEqual(list(result[0].tracks), self.tracks[1:2])
def test_search_albumartist(self):
# Artist is both track artist and album artist
result = self.library.search(albumartist=['Tist1'])
self.assertEqual(list(result[0].tracks), [self.tracks[0]])
# Artist is both track artist and album artist
result = self.library.search(albumartist=['Tist2'])
self.assertEqual(list(result[0].tracks), [self.tracks[1]])
# Artist is just album artist
result = self.library.search(albumartist=['Tist3'])
self.assertEqual(list(result[0].tracks), [self.tracks[2]])
def test_search_composer(self):
result = self.library.search(composer=['Tist5'])
self.assertEqual(list(result[0].tracks), self.tracks[4:5])
def test_search_performer(self):
result = self.library.search(performer=['Tist6'])
self.assertEqual(list(result[0].tracks), self.tracks[5:6])
def test_search_album(self):
result = self.library.search(album=['Bum1'])
self.assertEqual(list(result[0].tracks), self.tracks[:1])
result = self.library.search(album=['Bum2'])
self.assertEqual(list(result[0].tracks), self.tracks[1:2])
def test_search_genre(self):
result = self.library.search(genre=['Enre1'])
self.assertEqual(list(result[0].tracks), self.tracks[4:5])
result = self.library.search(genre=['Enre2'])
self.assertEqual(list(result[0].tracks), self.tracks[5:6])
def test_search_date(self):
result = self.library.search(date=['2001'])
self.assertEqual(list(result[0].tracks), self.tracks[:1])
result = self.library.search(date=['2001-02-03'])
self.assertEqual(list(result[0].tracks), self.tracks[:1])
result = self.library.search(date=['2001-02-04'])
self.assertEqual(list(result[0].tracks), [])
result = self.library.search(date=['2002'])
self.assertEqual(list(result[0].tracks), self.tracks[1:2])
def test_search_track_no(self):
result = self.library.search(track_no=['1'])
self.assertEqual(list(result[0].tracks), self.tracks[:1])
result = self.library.search(track_no=['2'])
self.assertEqual(list(result[0].tracks), self.tracks[1:2])
def test_search_comment(self):
result = self.library.search(comment=['fantastic'])
self.assertEqual(list(result[0].tracks), self.tracks[3:4])
result = self.library.search(comment=['antasti'])
self.assertEqual(list(result[0].tracks), self.tracks[3:4])
def test_search_any(self):
# Matches on track artist
result = self.library.search(any=['Tist1'])
self.assertEqual(list(result[0].tracks), self.tracks[:1])
# Matches on track composer
result = self.library.search(any=['Tist5'])
self.assertEqual(list(result[0].tracks), self.tracks[4:5])
# Matches on track performer
result = self.library.search(any=['Tist6'])
self.assertEqual(list(result[0].tracks), self.tracks[5:6])
# Matches on track
result = self.library.search(any=['Rack1'])
self.assertEqual(list(result[0].tracks), self.tracks[:1])
result = self.library.search(any=['Rack2'])
self.assertEqual(list(result[0].tracks), self.tracks[1:2])
# Matches on track album
result = self.library.search(any=['Bum1'])
self.assertEqual(list(result[0].tracks), self.tracks[:1])
# Matches on track album artists
result = self.library.search(any=['Tist3'])
self.assertEqual(
list(result[0].tracks), [self.tracks[3], self.tracks[2]])
# Matches on track genre
result = self.library.search(any=['Enre1'])
self.assertEqual(list(result[0].tracks), self.tracks[4:5])
result = self.library.search(any=['Enre2'])
self.assertEqual(list(result[0].tracks), self.tracks[5:6])
# Matches on track comment
result = self.library.search(any=['fanta'])
self.assertEqual(list(result[0].tracks), self.tracks[3:4])
result = self.library.search(any=['is a fan'])
self.assertEqual(list(result[0].tracks), self.tracks[3:4])
# Matches on URI
result = self.library.search(any=['TH1'])
self.assertEqual(list(result[0].tracks), self.tracks[:1])
def test_search_wrong_type(self):
test = lambda: self.library.search(wrong=['test'])
self.assertRaises(LookupError, test)
def test_search_with_empty_query(self):
test = lambda: self.library.search(artist=[''])
self.assertRaises(LookupError, test)
test = lambda: self.library.search(albumartist=[''])
self.assertRaises(LookupError, test)
test = lambda: self.library.search(composer=[''])
self.assertRaises(LookupError, test)
test = lambda: self.library.search(performer=[''])
self.assertRaises(LookupError, test)
test = lambda: self.library.search(track_name=[''])
self.assertRaises(LookupError, test)
test = lambda: self.library.search(album=[''])
self.assertRaises(LookupError, test)
test = lambda: self.library.search(genre=[''])
self.assertRaises(LookupError, test)
test = lambda: self.library.search(date=[''])
self.assertRaises(LookupError, test)
test = lambda: self.library.search(comment=[''])
self.assertRaises(LookupError, test)
test = lambda: self.library.search(uri=[''])
self.assertRaises(LookupError, test)
test = lambda: self.library.search(any=[''])
self.assertRaises(LookupError, test)
|
import React, { Component } from 'react';
import { Collapse, Navbar, NavbarBrand, NavbarToggler, NavItem, NavLink } from 'reactstrap';
import { Link } from 'react-router-dom';
import './NavMenu.css';
export class NavMenu extends Component {
static displayName = NavMenu.name;
constructor(props) {
super(props);
this.toggleNavbar = this.toggleNavbar.bind(this);
this.state = {
collapsed: true
};
}
toggleNavbar() {
this.setState({
collapsed: !this.state.collapsed
});
}
render() {
return (
<header>
<Navbar
style={{ margin: "0px", marginBottom: "0px" }} className="navbar-expand-sm navbar-toggleable-sm ng-white border-bottom box-shadow" light>
<div style={{ display: "flex", margin: "0px", width: "100%", }} >
<NavbarBrand style={{ margin: "0px" }} tag={Link} to="/">Movie Library</NavbarBrand>
<NavbarToggler onClick={this.toggleNavbar} className="mr-2" />
<Collapse className="d-sm-inline-flex flex-sm-row-reverse" isOpen={!this.state.collapsed} navbar>
<ul className="navbar-nav flex-grow">
<NavItem>
<NavLink tag={Link} className="text-dark" to="/">Home</NavLink>
</NavItem>
<NavItem>
<NavLink tag={Link} className="text-dark" to="/">Overview</NavLink>
</NavItem>
<NavItem>
<NavLink tag={Link} to="/myServer/admin/">Admin page</NavLink>
</NavItem>
</ul>
</Collapse>
</div>
</Navbar>
</header>
);
}
} |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models as m
from django.utils.translation import ugettext_lazy as _
import hashlib
import json
from jsonfield import JSONField
from wechatpy.crypto import WeChatWxaCrypto
from wechatpy.exceptions import InvalidSignatureException
from . import WeChatModel, WeChatUser
class Session(WeChatModel):
class Type(object):
MINIPROGRAM = 1
user = m.ForeignKey(
WeChatUser, on_delete=m.CASCADE, related_name="sessions", null=False)
type = m.PositiveSmallIntegerField()
auth = JSONField(default={})
created_at = m.DateTimeField(_("created at"), auto_now_add=True)
updated_at = m.DateTimeField(_("updated at"), auto_now=True)
@property
def app(self):
return self.user.app
@property
def app_id(self):
return self.user.app_id
@property
def session_key(self):
return self.auth.get("session_key")
def decrypt_message(self, msg, iv):
"""
:raises: ValueError
"""
crypto = WeChatWxaCrypto(self.session_key, iv, self.app.appid)
return crypto.decrypt_message(msg)
def validate_message(self, msg, sign):
"""
:raises: wechatpy.exceptions.InvalidSignatureException
"""
str_to_sign = (msg + self.session_key).encode()
server_sign = hashlib.sha1(str_to_sign).hexdigest()
if server_sign != sign:
raise InvalidSignatureException()
return json.loads(msg)
def __str__(self):
return "session_key: {0}".format(self.session_key)
|
#!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Run regression test suite.
This module calls down into individual test cases via subprocess. It will
forward all unrecognized arguments onto the individual test scripts.
Functional tests are disabled on Windows by default. Use --force to run them anyway.
For a description of arguments recognized by test scripts, see
`test/functional/test_framework/test_framework.py:BitcoinTestFramework.main`.
"""
import argparse
from collections import deque
import configparser
import datetime
import os
import time
import shutil
import signal
import sys
import subprocess
import tempfile
import re
import logging
# Formatting. Default colors to empty strings.
BOLD, BLUE, RED, GREY = ("", ""), ("", ""), ("", ""), ("", "")
try:
# Make sure python thinks it can write unicode to its stdout
"\u2713".encode("utf_8").decode(sys.stdout.encoding)
TICK = "✓ "
CROSS = "✖ "
CIRCLE = "○ "
except UnicodeDecodeError:
TICK = "P "
CROSS = "x "
CIRCLE = "o "
if os.name == 'posix':
# primitive formatting on supported
# terminal via ANSI escape sequences:
BOLD = ('\033[0m', '\033[1m')
BLUE = ('\033[0m', '\033[0;34m')
RED = ('\033[0m', '\033[0;31m')
GREY = ('\033[0m', '\033[1;30m')
TEST_EXIT_PASSED = 0
TEST_EXIT_SKIPPED = 77
# 20 minutes represented in seconds
TRAVIS_TIMEOUT_DURATION = 20 * 60
BASE_SCRIPTS = [
# Scripts that are run by the travis build process.
# Longest test should go first, to favor running tests in parallel
'wallet_hd.py',
'wallet_backup.py',
# vv Tests less than 5m vv
'feature_block.py',
'rpc_fundrawtransaction.py',
'p2p_compactblocks.py',
'feature_segwit.py',
# vv Tests less than 2m vv
'wallet_basic.py',
'wallet_labels.py',
'p2p_segwit.py',
'wallet_dump.py',
'wallet_listtransactions.py',
# vv Tests less than 60s vv
'p2p_sendheaders.py',
'wallet_zapwallettxes.py',
'wallet_importmulti.py',
'mempool_limit.py',
'rpc_txoutproof.py',
'wallet_listreceivedby.py',
'wallet_abandonconflict.py',
'feature_csv_activation.py',
'rpc_rawtransaction.py',
'wallet_address_types.py',
'feature_reindex.py',
# vv Tests less than 30s vv
'wallet_keypool_topup.py',
'interface_zmq.py',
'interface_bitcoin_cli.py',
'mempool_resurrect.py',
'wallet_txn_doublespend.py --mineblock',
'wallet_txn_clone.py',
'wallet_txn_clone.py --segwit',
'rpc_getchaintips.py',
'interface_rest.py',
'mempool_spend_coinbase.py',
'mempool_reorg.py',
'mempool_persist.py',
'wallet_multiwallet.py',
'wallet_multiwallet.py --usecli',
'wallet_disableprivatekeys.py',
'wallet_disableprivatekeys.py --usecli',
'interface_http.py',
'rpc_psbt.py',
'rpc_users.py',
'feature_proxy.py',
'rpc_signrawtransaction.py',
'wallet_groups.py',
'p2p_disconnect_ban.py',
'rpc_decodescript.py',
'rpc_blockchain.py',
'rpc_deprecated.py',
'wallet_disable.py',
'rpc_net.py',
'wallet_keypool.py',
'p2p_mempool.py',
'mining_prioritisetransaction.py',
'p2p_invalid_locator.py',
'p2p_invalid_block.py',
'p2p_invalid_tx.py',
'rpc_createmultisig.py',
'feature_versionbits_warning.py',
'rpc_preciousblock.py',
'wallet_importprunedfunds.py',
'rpc_zmq.py',
'rpc_signmessage.py',
'wallet_balance.py',
'feature_nulldummy.py',
'mempool_accept.py',
'wallet_import_rescan.py',
'rpc_bind.py --ipv4',
'rpc_bind.py --ipv6',
'rpc_bind.py --nonloopback',
'mining_basic.py',
'wallet_bumpfee.py',
'rpc_named_arguments.py',
'wallet_listsinceblock.py',
'p2p_leak.py',
'wallet_encryption.py',
'wallet_scriptaddress2.py',
'feature_dersig.py',
'feature_cltv.py',
'rpc_uptime.py',
'wallet_resendwallettransactions.py',
'wallet_fallbackfee.py',
'feature_minchainwork.py',
'rpc_getblockstats.py',
'p2p_fingerprint.py',
'feature_uacomment.py',
'p2p_unrequested_blocks.py',
'feature_includeconf.py',
'rpc_scantxoutset.py',
'feature_logging.py',
'p2p_node_network_limited.py',
'feature_blocksdir.py',
'feature_config_args.py',
'rpc_help.py',
'feature_help.py',
# Don't append tests at the end to avoid merge conflicts
# Put them in a random line within the section that fits their approximate run-time
]
EXTENDED_SCRIPTS = [
# These tests are not run by the travis build process.
# Longest test should go first, to favor running tests in parallel
'feature_pruning.py',
# vv Tests less than 20m vv
'feature_fee_estimation.py',
# vv Tests less than 5m vv
'feature_maxuploadtarget.py',
'mempool_packages.py',
'feature_dbcrash.py',
# vv Tests less than 2m vv
'feature_bip68_sequence.py',
'mining_getblocktemplate_longpoll.py',
'p2p_timeouts.py',
# vv Tests less than 60s vv
'p2p_feefilter.py',
# vv Tests less than 30s vv
'feature_assumevalid.py',
'example_test.py',
'wallet_txn_doublespend.py',
'wallet_txn_clone.py --mineblock',
'feature_notifications.py',
'rpc_invalidateblock.py',
'feature_rbf.py',
]
# Place EXTENDED_SCRIPTS first since it has the 3 longest running tests
ALL_SCRIPTS = EXTENDED_SCRIPTS + BASE_SCRIPTS
NON_SCRIPTS = [
# These are python files that live in the functional tests directory, but are not test scripts.
"combine_logs.py",
"create_cache.py",
"test_runner.py",
]
def main():
# Parse arguments and pass through unrecognised args
parser = argparse.ArgumentParser(add_help=False,
usage='%(prog)s [test_runner.py options] [script options] [scripts]',
description=__doc__,
epilog='''
Help text and arguments for individual test script:''',
formatter_class=argparse.RawTextHelpFormatter)
parser.add_argument('--combinedlogslen', '-c', type=int, default=0, help='print a combined log (of length n lines) from all test nodes and test framework to the console on failure.')
parser.add_argument('--coverage', action='store_true', help='generate a basic coverage report for the RPC interface')
parser.add_argument('--exclude', '-x', help='specify a comma-separated-list of scripts to exclude.')
parser.add_argument('--extended', action='store_true', help='run the extended test suite in addition to the basic tests')
parser.add_argument('--force', '-f', action='store_true', help='run tests even on platforms where they are disabled by default (e.g. windows).')
parser.add_argument('--help', '-h', '-?', action='store_true', help='print help text and exit')
parser.add_argument('--jobs', '-j', type=int, default=4, help='how many test scripts to run in parallel. Default=4.')
parser.add_argument('--keepcache', '-k', action='store_true', help='the default behavior is to flush the cache directory on startup. --keepcache retains the cache from the previous testrun.')
parser.add_argument('--quiet', '-q', action='store_true', help='only print results summary and failure logs')
parser.add_argument('--tmpdirprefix', '-t', default=tempfile.gettempdir(), help="Root directory for datadirs")
parser.add_argument('--failfast', action='store_true', help='stop execution after the first test failure')
args, unknown_args = parser.parse_known_args()
# args to be passed on always start with two dashes; tests are the remaining unknown args
tests = [arg for arg in unknown_args if arg[:2] != "--"]
passon_args = [arg for arg in unknown_args if arg[:2] == "--"]
# Read config generated by configure.
config = configparser.ConfigParser()
configfile = os.path.abspath(os.path.dirname(__file__)) + "/../config.ini"
config.read_file(open(configfile, encoding="utf8"))
passon_args.append("--configfile=%s" % configfile)
# Set up logging
logging_level = logging.INFO if args.quiet else logging.DEBUG
logging.basicConfig(format='%(message)s', level=logging_level)
# Create base test directory
tmpdir = "%s/test_runner_Ł_🏃_%s" % (args.tmpdirprefix, datetime.datetime.now().strftime("%Y%m%d_%H%M%S"))
os.makedirs(tmpdir)
logging.debug("Temporary test directory at %s" % tmpdir)
enable_bitcoind = config["components"].getboolean("ENABLE_BITCOIND")
if config["environment"]["EXEEXT"] == ".exe" and not args.force:
# https://github.com/bitcoin/bitcoin/commit/d52802551752140cf41f0d9a225a43e84404d3e9
# https://github.com/bitcoin/bitcoin/pull/5677#issuecomment-136646964
print("Tests currently disabled on Windows by default. Use --force option to enable")
sys.exit(0)
if not enable_bitcoind:
print("No functional tests to run.")
print("Rerun ./configure with --with-daemon and then make")
sys.exit(0)
# Build list of tests
test_list = []
if tests:
# Individual tests have been specified. Run specified tests that exist
# in the ALL_SCRIPTS list. Accept the name with or without .py extension.
tests = [re.sub("\.py$", "", test) + ".py" for test in tests]
for test in tests:
if test in ALL_SCRIPTS:
test_list.append(test)
else:
print("{}WARNING!{} Test '{}' not found in full test list.".format(BOLD[1], BOLD[0], test))
elif args.extended:
# Include extended tests
test_list += ALL_SCRIPTS
else:
# Run base tests only
test_list += BASE_SCRIPTS
# Remove the test cases that the user has explicitly asked to exclude.
if args.exclude:
exclude_tests = [re.sub("\.py$", "", test) + ".py" for test in args.exclude.split(',')]
for exclude_test in exclude_tests:
if exclude_test in test_list:
test_list.remove(exclude_test)
else:
print("{}WARNING!{} Test '{}' not found in current test list.".format(BOLD[1], BOLD[0], exclude_test))
if not test_list:
print("No valid test scripts specified. Check that your test is in one "
"of the test lists in test_runner.py, or run test_runner.py with no arguments to run all tests")
sys.exit(0)
if args.help:
# Print help for test_runner.py, then print help of the first script (with args removed) and exit.
parser.print_help()
subprocess.check_call([sys.executable, os.path.join(config["environment"]["SRCDIR"], 'test', 'functional', test_list[0].split()[0]), '-h'])
sys.exit(0)
check_script_list(config["environment"]["SRCDIR"])
check_script_prefixes()
if not args.keepcache:
shutil.rmtree("%s/test/cache" % config["environment"]["BUILDDIR"], ignore_errors=True)
run_tests(
test_list,
config["environment"]["SRCDIR"],
config["environment"]["BUILDDIR"],
tmpdir,
jobs=args.jobs,
enable_coverage=args.coverage,
args=passon_args,
combined_logs_len=args.combinedlogslen,
failfast=args.failfast,
)
def run_tests(test_list, src_dir, build_dir, tmpdir, jobs=1, enable_coverage=False, args=None, combined_logs_len=0, failfast=False):
args = args or []
# Warn if bitcoind is already running (unix only)
try:
if subprocess.check_output(["pidof", "bluecoind"]) is not None:
print("%sWARNING!%s There is already a bluecoind process running on this system. Tests may fail unexpectedly due to resource contention!" % (BOLD[1], BOLD[0]))
except (OSError, subprocess.SubprocessError):
pass
# Warn if there is a cache directory
cache_dir = "%s/test/cache" % build_dir
if os.path.isdir(cache_dir):
print("%sWARNING!%s There is a cache directory here: %s. If tests fail unexpectedly, try deleting the cache directory." % (BOLD[1], BOLD[0], cache_dir))
tests_dir = src_dir + '/test/functional/'
flags = ['--cachedir={}'.format(cache_dir)] + args
if enable_coverage:
coverage = RPCCoverage()
flags.append(coverage.flag)
logging.debug("Initializing coverage directory at %s" % coverage.dir)
else:
coverage = None
if len(test_list) > 1 and jobs > 1:
# Populate cache
try:
subprocess.check_output([sys.executable, tests_dir + 'create_cache.py'] + flags + ["--tmpdir=%s/cache" % tmpdir])
except subprocess.CalledProcessError as e:
sys.stdout.buffer.write(e.output)
raise
#Run Tests
job_queue = TestHandler(jobs, tests_dir, tmpdir, test_list, flags)
start_time = time.time()
test_results = []
max_len_name = len(max(test_list, key=len))
for _ in range(len(test_list)):
test_result, testdir, stdout, stderr = job_queue.get_next()
test_results.append(test_result)
if test_result.status == "Passed":
logging.debug("\n%s%s%s passed, Duration: %s s" % (BOLD[1], test_result.name, BOLD[0], test_result.time))
elif test_result.status == "Skipped":
logging.debug("\n%s%s%s skipped" % (BOLD[1], test_result.name, BOLD[0]))
else:
print("\n%s%s%s failed, Duration: %s s\n" % (BOLD[1], test_result.name, BOLD[0], test_result.time))
print(BOLD[1] + 'stdout:\n' + BOLD[0] + stdout + '\n')
print(BOLD[1] + 'stderr:\n' + BOLD[0] + stderr + '\n')
if combined_logs_len and os.path.isdir(testdir):
# Print the final `combinedlogslen` lines of the combined logs
print('{}Combine the logs and print the last {} lines ...{}'.format(BOLD[1], combined_logs_len, BOLD[0]))
print('\n============')
print('{}Combined log for {}:{}'.format(BOLD[1], testdir, BOLD[0]))
print('============\n')
combined_logs, _ = subprocess.Popen([sys.executable, os.path.join(tests_dir, 'combine_logs.py'), '-c', testdir], universal_newlines=True, stdout=subprocess.PIPE).communicate()
print("\n".join(deque(combined_logs.splitlines(), combined_logs_len)))
if failfast:
logging.debug("Early exiting after test failure")
break
print_results(test_results, max_len_name, (int(time.time() - start_time)))
if coverage:
coverage.report_rpc_coverage()
logging.debug("Cleaning up coverage data")
coverage.cleanup()
# Clear up the temp directory if all subdirectories are gone
if not os.listdir(tmpdir):
os.rmdir(tmpdir)
all_passed = all(map(lambda test_result: test_result.was_successful, test_results))
# This will be a no-op unless failfast is True in which case there may be dangling
# processes which need to be killed.
job_queue.kill_and_join()
sys.exit(not all_passed)
def print_results(test_results, max_len_name, runtime):
results = "\n" + BOLD[1] + "%s | %s | %s\n\n" % ("TEST".ljust(max_len_name), "STATUS ", "DURATION") + BOLD[0]
test_results.sort(key=TestResult.sort_key)
all_passed = True
time_sum = 0
for test_result in test_results:
all_passed = all_passed and test_result.was_successful
time_sum += test_result.time
test_result.padding = max_len_name
results += str(test_result)
status = TICK + "Passed" if all_passed else CROSS + "Failed"
if not all_passed:
results += RED[1]
results += BOLD[1] + "\n%s | %s | %s s (accumulated) \n" % ("ALL".ljust(max_len_name), status.ljust(9), time_sum) + BOLD[0]
if not all_passed:
results += RED[0]
results += "Runtime: %s s\n" % (runtime)
print(results)
class TestHandler:
"""
Trigger the test scripts passed in via the list.
"""
def __init__(self, num_tests_parallel, tests_dir, tmpdir, test_list=None, flags=None):
assert(num_tests_parallel >= 1)
self.num_jobs = num_tests_parallel
self.tests_dir = tests_dir
self.tmpdir = tmpdir
self.test_list = test_list
self.flags = flags
self.num_running = 0
self.jobs = []
def get_next(self):
while self.num_running < self.num_jobs and self.test_list:
# Add tests
self.num_running += 1
test = self.test_list.pop(0)
portseed = len(self.test_list)
portseed_arg = ["--portseed={}".format(portseed)]
log_stdout = tempfile.SpooledTemporaryFile(max_size=2**16)
log_stderr = tempfile.SpooledTemporaryFile(max_size=2**16)
test_argv = test.split()
testdir = "{}/{}_{}".format(self.tmpdir, re.sub(".py$", "", test_argv[0]), portseed)
tmpdir_arg = ["--tmpdir={}".format(testdir)]
self.jobs.append((test,
time.time(),
subprocess.Popen([sys.executable, self.tests_dir + test_argv[0]] + test_argv[1:] + self.flags + portseed_arg + tmpdir_arg,
universal_newlines=True,
stdout=log_stdout,
stderr=log_stderr),
testdir,
log_stdout,
log_stderr))
if not self.jobs:
raise IndexError('pop from empty list')
while True:
# Return first proc that finishes
time.sleep(.5)
for job in self.jobs:
(name, start_time, proc, testdir, log_out, log_err) = job
if os.getenv('TRAVIS') == 'true' and int(time.time() - start_time) > TRAVIS_TIMEOUT_DURATION:
# In travis, timeout individual tests (to stop tests hanging and not providing useful output).
proc.send_signal(signal.SIGINT)
if proc.poll() is not None:
log_out.seek(0), log_err.seek(0)
[stdout, stderr] = [log_file.read().decode('utf-8') for log_file in (log_out, log_err)]
log_out.close(), log_err.close()
if proc.returncode == TEST_EXIT_PASSED and stderr == "":
status = "Passed"
elif proc.returncode == TEST_EXIT_SKIPPED:
status = "Skipped"
else:
status = "Failed"
self.num_running -= 1
self.jobs.remove(job)
return TestResult(name, status, int(time.time() - start_time)), testdir, stdout, stderr
print('.', end='', flush=True)
def kill_and_join(self):
"""Send SIGKILL to all jobs and block until all have ended."""
procs = [i[2] for i in self.jobs]
for proc in procs:
proc.kill()
for proc in procs:
proc.wait()
class TestResult():
def __init__(self, name, status, time):
self.name = name
self.status = status
self.time = time
self.padding = 0
def sort_key(self):
if self.status == "Passed":
return 0, self.name.lower()
elif self.status == "Failed":
return 2, self.name.lower()
elif self.status == "Skipped":
return 1, self.name.lower()
def __repr__(self):
if self.status == "Passed":
color = BLUE
glyph = TICK
elif self.status == "Failed":
color = RED
glyph = CROSS
elif self.status == "Skipped":
color = GREY
glyph = CIRCLE
return color[1] + "%s | %s%s | %s s\n" % (self.name.ljust(self.padding), glyph, self.status.ljust(7), self.time) + color[0]
@property
def was_successful(self):
return self.status != "Failed"
def check_script_prefixes():
"""Check that test scripts start with one of the allowed name prefixes."""
good_prefixes_re = re.compile("(example|feature|interface|mempool|mining|p2p|rpc|wallet)_")
bad_script_names = [script for script in ALL_SCRIPTS if good_prefixes_re.match(script) is None]
if bad_script_names:
print("%sERROR:%s %d tests not meeting naming conventions:" % (BOLD[1], BOLD[0], len(bad_script_names)))
print(" %s" % ("\n ".join(sorted(bad_script_names))))
raise AssertionError("Some tests are not following naming convention!")
def check_script_list(src_dir):
"""Check scripts directory.
Check that there are no scripts in the functional tests directory which are
not being run by pull-tester.py."""
script_dir = src_dir + '/test/functional/'
python_files = set([test_file for test_file in os.listdir(script_dir) if test_file.endswith(".py")])
missed_tests = list(python_files - set(map(lambda x: x.split()[0], ALL_SCRIPTS + NON_SCRIPTS)))
if len(missed_tests) != 0:
print("%sWARNING!%s The following scripts are not being run: %s. Check the test lists in test_runner.py." % (BOLD[1], BOLD[0], str(missed_tests)))
if os.getenv('TRAVIS') == 'true':
# On travis this warning is an error to prevent merging incomplete commits into master
sys.exit(1)
class RPCCoverage():
"""
Coverage reporting utilities for test_runner.
Coverage calculation works by having each test script subprocess write
coverage files into a particular directory. These files contain the RPC
commands invoked during testing, as well as a complete listing of RPC
commands per `bluecoin-cli help` (`rpc_interface.txt`).
After all tests complete, the commands run are combined and diff'd against
the complete list to calculate uncovered RPC commands.
See also: test/functional/test_framework/coverage.py
"""
def __init__(self):
self.dir = tempfile.mkdtemp(prefix="coverage")
self.flag = '--coveragedir=%s' % self.dir
def report_rpc_coverage(self):
"""
Print out RPC commands that were unexercised by tests.
"""
uncovered = self._get_uncovered_rpc_commands()
if uncovered:
print("Uncovered RPC commands:")
print("".join((" - %s\n" % command) for command in sorted(uncovered)))
else:
print("All RPC commands covered.")
def cleanup(self):
return shutil.rmtree(self.dir)
def _get_uncovered_rpc_commands(self):
"""
Return a set of currently untested RPC commands.
"""
# This is shared from `test/functional/test-framework/coverage.py`
reference_filename = 'rpc_interface.txt'
coverage_file_prefix = 'coverage.'
coverage_ref_filename = os.path.join(self.dir, reference_filename)
coverage_filenames = set()
all_cmds = set()
covered_cmds = set()
if not os.path.isfile(coverage_ref_filename):
raise RuntimeError("No coverage reference found")
with open(coverage_ref_filename, 'r', encoding="utf8") as coverage_ref_file:
all_cmds.update([line.strip() for line in coverage_ref_file.readlines()])
for root, dirs, files in os.walk(self.dir):
for filename in files:
if filename.startswith(coverage_file_prefix):
coverage_filenames.add(os.path.join(root, filename))
for filename in coverage_filenames:
with open(filename, 'r', encoding="utf8") as coverage_file:
covered_cmds.update([line.strip() for line in coverage_file.readlines()])
return all_cmds - covered_cmds
if __name__ == '__main__':
main()
|
const request = require("supertest");
const db = require("../data/db-config");
const server = require("../server.js");
const token =
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWJqZWN0Ijo3LCJ1c2VybmFtZSI6ImNoYW5nZWQiLCJpYXQiOjE1NjcwMTE3MzQsImV4cCI6MTU2NzQ0MzczNH0.6MakRCXd48-ToNWHRBDErLIQC5uxJK68a3QuYbWq2B0";
describe("Server Endpoint Tests", () => {
beforeAll(async () => {
// guarantees that the table is cleaned out before any of the tests run
await db("users").truncate();
});
it("tests are running with DB_ENV set to testing", () => {
expect(process.env.DB_ENV).toBe("testing");
});
describe("AUTH ROUTES", () => {
describe("Register, POST /api/auth/register", () => {
it("succeeds, resturns status 201 with correct credentials", () => {
return request(server)
.post("/api/auth/register")
.send({
username: "admin",
password: "password",
email: "[email protected]"
})
.then(res => {
expect(res.status).toBe(201);
});
});
it("fails. returns status 500 with incorrect credentials", () => {
return request(server)
.post("/api/auth/register")
.send({
//missing password, password is required to register
username: "admin1",
email: "[email protected]"
})
.then(res => {
expect(res.status).toBe(500);
});
});
it("fails, returns status 500 with missing credentials", () => {
return request(server)
.post("/api/auth/register")
.then(res => {
expect(res.status).toBe(500);
});
});
});
describe("Login, POST /api/auth/login", () => {
it("succeeds, returns status 200 with correct credentials", () => {
return request(server)
.post("/api/auth/login")
.send({
username: "admin",
password: "password"
})
.then(res => {
expect(res.status).toBe(200);
});
});
it("fails, returns status 401 with incorrect credentials", () => {
return request(server)
.post("/api/auth/login")
.send({
username: "notarealuser",
password: "notreal"
})
.then(res => {
expect(res.status).toBe(401);
});
});
it("fails, returns status 500 with missing credentials", () => {
return request(server)
.post("/api/auth/login")
.then(res => {
expect(res.status).toBe(500);
});
});
});
});
describe("USERS ROUTES", () => {
describe("Get all users, GET /api/users", () => {
it("succeeds, returns status 200 when token is present in header", () => {
return request(server)
.get("/api/users")
.set("Authorization", token)
.then(res => {
expect(res.status).toBe(200);
});
});
it("succeeds, returns array of users when token is present in header", () => {
return request(server)
.get("/api/users")
.set("Authorization", token)
.then(res => {
expect(Array.isArray(res.body)).toBe(true);
});
});
it("fails, returns status 400 without token in header", () => {
return request(server)
.get("/api/users")
.then(res => {
expect(res.status).toBe(400);
});
});
});
describe("Get a single user using ID, GET /api/users/:id", () => {
it("succeeds, returns status 200 when given an ID and token is present in header", () => {
return request(server)
.get("/api/users/1")
.set("Authorization", token)
.then(res => {
expect(res.status).toBe(200);
});
});
it("succeeds, returns the found user object as JSON when given an ID and token is present in header", () => {
return request(server)
.get("/api/users/1")
.set("Authorization", token)
.then(res => {
expect(res.type).toMatch(/json/);
});
});
it("fails, returns status 404 when gived an invalid user ID and token is present in header", () => {
return request(server)
.get("/api/users/999")
.set("Authorization", token)
.then(res => {
expect(res.status).toBe(404);
});
});
it("fails, returns status 400 without token in header", () => {
return request(server)
.get("/api/users/1")
.then(res => {
expect(res.status).toBe(400);
});
});
});
describe("Get a single user by using username, GET /api/users/search/:username", () => {
it("succeeds, returns status 200 when given a username and token is present in header", () => {
return request(server)
.get("/api/users/search/admin")
.set("Authorization", token)
.then(res => {
expect(res.status).toBe(200);
});
});
it("fails, returns status 400 when given a username without token in header", () => {
return request(server)
.get("/api/users/search/admin")
.then(res => {
expect(res.status).toBe(400);
});
});
});
describe("Update a user, PUT /api/users/:id", () => {
it("succeeds, returns status 200 when given an ID and changes and token is present in header", () => {
return request(server)
.put("/api/users/1")
.set("Authorization", token)
.send({
username: "changedAdmin",
password: "therealest"
})
.then(res => {
expect(res.status).toBe(200);
});
});
it("fails, returns status 400 when given an ID and changes without token in header", () => {
return request(server)
.put("/api/users/1")
.send({
username: "changedAdmin",
password: "therealest"
})
.then(res => {
expect(res.status).toBe(400);
});
});
it("fails, returns status 500 when given an ID and and token is included in header but no changes supplied", () => {
return request(server)
.put("/api/users/1")
.set("Authorization", token)
.then(res => {
expect(res.status).toBe(500);
});
});
it("fails, returns status 404 when given an invalid ID but supplied changes and token is included in header", () => {
return request(server)
.put("/api/users/999")
.set("Authorization", token)
.send({
username: "changedAdmin",
password: "therealest"
})
.then(res => {
expect(res.status).toBe(404);
});
});
});
describe("Delete a user, DELETE /api/users/:id", () => {
it("fails, returns status 404 when given an invalid ID and token is present in header", () => {
return request(server)
.delete("/api/users/999")
.set("Authorization", token)
.then(res => {
expect(res.status).toBe(404);
});
});
it("fails, returns status 400 when given a valid ID without token in header", () => {
return request(server)
.delete("/api/users/1")
.then(res => {
expect(res.status).toBe(400);
});
});
it("succeeds, returns status 200 when given a valid ID and token is present in header", () => {
return request(server)
.delete("/api/users/1")
.set("Authorization", token)
.then(res => {
expect(res.status).toBe(200);
});
});
});
});
});
|
// Protractor Jasmine end-to-end (e2e) test.
//
// See https://github.com/angular/protractor/blob/master/docs/getting-started.md
//
var EventsPage = require('./events_page').EventsPage;
var page = new EventsPage();
describe('event tabs', function () {
beforeEach(function () {
page.get();
});
it('activates the events tab by default', function () {
expect(page.tabs.events.getAttribute('class')).toContain('active');
expect(page.tabs.series.getAttribute('class')).not.toContain('active');
});
describe('navigating to series', function () {
beforeEach(function () {
page.tabs.series.click();
});
it('activates the series tab', function () {
expect(page.tabs.events.getAttribute('class')).not.toContain('active');
expect(page.tabs.series.getAttribute('class')).toContain('active');
});
});
});
|
const cTable = require('console.table');
const inquirer = require('inquirer');
const express = require('express');
const app = express();
// Express middleware
app.use(express.urlencoded({ extended: false }));
app.use(express.json());
const db = require('../../db/connection');
//view all roles, table with job title, role id,
//the department that role belongs to, and the salary for that role
const viewRoles = () => {
const sql = `SELECT roles.id AS Work_Id, roles.title AS Job_Title, roles.salary AS Salary, department.name AS Department_Name
FROM roles LEFT JOIN department ON roles.department_id = department.id `
db.query(sql, (err, rows) => {
if (err) {
console.log(err);
return;
}
console.table(rows);
mainMenu();
});
};
//add role, prompted to enter the name, salary, and department for the role and
//that role is added to the database
//show table with roles to show new role added to database
const addRoles = () => {
db.query('SELECT * FROM department', (err, res) => {
if (err) {
console.log(err);
return;
} else {
//returns current departments and id numbers in inquirer prompt
deptArr = Object.values(JSON.parse(JSON.stringify(res)));
deptArr = JSON.stringify(deptArr);
deptArr = deptArr.replace(/\{|\}/g, '', /\(|\)/g, '');
deptArr = deptArr.replace(/"name"/g, '');
deptArr = deptArr.replace(/"id"/g, '');
deptArr = deptArr.replace(/"/g, '');
deptArr = deptArr.replace(/:/g, ' ');
}
inquirer.prompt([
{
type: 'input',
message: 'What would you like the title of this new role to be?',
name: 'title',
validate: nameInput => {
if (nameInput) {
return true;
} else {
console.log('Please enter a new role title.');
return false;
}
}
},
{
type: 'number',
message: 'What will the new role salary amount be?',
name: 'salary',
validate: num => {
if (num) {
return true;
} else {
console.log('Please enter a valid salary.')
return false;
}
}
},
{
type: 'number',
message: 'Please enter the id number of a department for the new role. ' + deptArr,
name: 'department_id'
}
]).then(body => {
const sql = `INSERT INTO roles (title, salary, department_id)
VALUES (?,?,?)`;
const params = [body.title, body.salary, body.department_id];
db.query(sql, params, (err, res) => {
if (err) {
console.log(err);
return;
}
viewRoles();
mainMenu();
});
})
});
};
//update employee role, prompted to enter the employee’s first name,
//last name, role, and manager and that employee is added to the database
//update employees role
const updateRole = () => {
let employeeArr = [];
//database query to get employee id and name
db.query(`SELECT employee.id, CONCAT(employee.first_name, ' ',employee.last_name) AS 'Employee_Name' FROM employee;`,
(err, res) => {
if (err) {
console.log(err);
}
res = Object.values(JSON.parse(JSON.stringify(res)));
//push all employees to array
for (i = 0; i < res.length; i++) {
res[i].Employee_Name;
JSON.stringify(res[i].Employee_Name);
employeeArr.push(res[i].Employee_Name);
}
let employeeRoleArr = [];
db.query(`SELECT roles.id, roles.title FROM roles;`,
(err, ans) => {
if (err) {
console.log(err);
}
console.log(ans);
ans = Object.values(JSON.parse(JSON.stringify(ans)));
for (j = 0; j < ans.length; j++) {
ans[j].title;
JSON.stringify(ans[j].title);
employeeRoleArr.push(ans[j].title);
}
console.log(employeeRoleArr);
inquirer.prompt([
{
type: 'list',
message: 'Which employee`s role would you like to update?',
choices: employeeArr,
name: 'id',
validate: nameInput => {
if (nameInput) {
return true;
} else {
console.log('Please select an employee.');
return false;
}
}
},
{
type: 'list',
message: 'Please select a new role for the employee.',
name: 'roles_id',
choices: employeeRoleArr,
validate: nameInput => {
if (nameInput) {
return true;
} else {
console.log('Please select a role for the employee.');
return false;
}
}
}
]).then(body => {
for (j = 0; j < res.length; j++) {
if (body.id === res[j].Employee_Name) {
body.id = res[j].id;
}
}
for (k = 0; k < ans.length; k++) {
if (body.roles_id === ans[k].title) {
body.roles_id = ans[k].id;
}
}
const sql = `UPDATE employee
SET roles_id = ?
WHERE id = ?`;
const params = [body.roles_id, body.id];
db.query(sql, params, (err, results) => {
if (err) {
console.log(err);
return;
}
viewEmployees();
mainMenu();
});
})
})
})
}
module.exports = { viewRoles, addRoles, updateRole }; |
import copy
import hail
from hail.utils.java import escape_str, escape_id, dump_json, parsable_strings
from hail.expr.types import *
from hail.typecheck import *
from .base_ir import *
from .matrix_writer import MatrixWriter, MatrixNativeMultiWriter
def _env_bind(env, k, v):
env = env.copy()
env[k] = v
return env
class I32(IR):
@typecheck_method(x=int)
def __init__(self, x):
super().__init__()
self.x = x
def copy(self):
new_instance = self.__class__
return new_instance(self.x)
def render(self, r):
return '(I32 {})'.format(self.x)
def __eq__(self, other):
return isinstance(other, I32) and \
other.x == self.x
def _compute_type(self, env, agg_env):
self._type = tint32
class I64(IR):
@typecheck_method(x=int)
def __init__(self, x):
super().__init__()
self.x = x
def copy(self):
new_instance = self.__class__
return new_instance(self.x)
def render(self, r):
return '(I64 {})'.format(self.x)
def __eq__(self, other):
return isinstance(other, I64) and \
other.x == self.x
def _compute_type(self, env, agg_env):
self._type = tint64
class F32(IR):
@typecheck_method(x=numeric)
def __init__(self, x):
super().__init__()
self.x = x
def copy(self):
new_instance = self.__class__
return new_instance(self.x)
def render(self, r):
return '(F32 {})'.format(self.x)
def __eq__(self, other):
return isinstance(other, F32) and \
other.x == self.x
def _compute_type(self, env, agg_env):
self._type = tfloat32
class F64(IR):
@typecheck_method(x=numeric)
def __init__(self, x):
super().__init__()
self.x = x
def copy(self):
new_instance = self.__class__
return new_instance(self.x)
def render(self, r):
return '(F64 {})'.format(self.x)
def __eq__(self, other):
return isinstance(other, F64) and \
other.x == self.x
def _compute_type(self, env, agg_env):
self._type = tfloat64
class Str(IR):
@typecheck_method(x=str)
def __init__(self, x):
super().__init__()
self.x = x
def copy(self):
new_instance = self.__class__
return new_instance(self.x)
def render(self, r):
return '(Str "{}")'.format(escape_str(self.x))
def __eq__(self, other):
return isinstance(other, Str) and \
other.x == self.x
def _compute_type(self, env, agg_env):
self._type = tstr
class FalseIR(IR):
def __init__(self):
super().__init__()
def copy(self):
new_instance = self.__class__
return new_instance()
def render(self, r):
return '(False)'
def __eq__(self, other):
return isinstance(other, FalseIR)
def _compute_type(self, env, agg_env):
self._type = tbool
class TrueIR(IR):
def __init__(self):
super().__init__()
def copy(self):
new_instance = self.__class__
return new_instance()
def render(self, r):
return '(True)'
def __eq__(self, other):
return isinstance(other, TrueIR)
def _compute_type(self, env, agg_env):
self._type = tbool
class Void(IR):
def __init__(self):
super().__init__()
def copy(self):
new_instance = self.__class__
return new_instance()
def render(self, r):
return '(Void)'
def __eq__(self, other):
return isinstance(other, Void)
def _compute_type(self, env, agg_env):
self._type = tvoid
class Cast(IR):
@typecheck_method(v=IR, typ=hail_type)
def __init__(self, v, typ):
super().__init__(v)
self.v = v
self._typ = typ
@property
def typ(self):
return self._typ
@typecheck_method(v=IR)
def copy(self, v):
new_instance = self.__class__
return new_instance(v, self._typ)
def render(self, r):
return '(Cast {} {})'.format(self._typ._parsable_string(), r(self.v))
def __eq__(self, other):
return isinstance(other, Cast) and \
other.v == self.v and \
other._typ == self._typ
def _compute_type(self, env, agg_env):
self.v._compute_type(env, agg_env)
self._type = self._typ
class NA(IR):
@typecheck_method(typ=hail_type)
def __init__(self, typ):
super().__init__()
self._typ = typ
@property
def typ(self):
return self._typ
def copy(self):
new_instance = self.__class__
return new_instance(self._typ)
def render(self, r):
return '(NA {})'.format(self._typ._parsable_string())
def __eq__(self, other):
return isinstance(other, NA) and \
other._typ == self._typ
def _compute_type(self, env, agg_env):
self._type = self._typ
class IsNA(IR):
@typecheck_method(value=IR)
def __init__(self, value):
super().__init__(value)
self.value = value
@typecheck_method(value=IR)
def copy(self, value):
new_instance = self.__class__
return new_instance(value)
def render(self, r):
return '(IsNA {})'.format(r(self.value))
def __eq__(self, other):
return isinstance(other, IsNA) and \
other.value == self.value
def _compute_type(self, env, agg_env):
self.value._compute_type(env, agg_env)
self._type = tbool
class If(IR):
@typecheck_method(cond=IR, cnsq=IR, altr=IR)
def __init__(self, cond, cnsq, altr):
super().__init__(cond, cnsq, altr)
self.cond = cond
self.cnsq = cnsq
self.altr = altr
@typecheck_method(cond=IR, cnsq=IR, altr=IR)
def copy(self, cond, cnsq, altr):
new_instance = self.__class__
return new_instance(cond, cnsq, altr)
def render(self, r):
return '(If {} {} {})'.format(r(self.cond), r(self.cnsq), r(self.altr))
def __eq__(self, other):
return isinstance(other, If) and \
other.cond == self.cond and \
other.cnsq == self.cnsq and \
other.altr == self.altr
def _compute_type(self, env, agg_env):
self.cond._compute_type(env, agg_env)
self.cnsq._compute_type(env, agg_env)
self.altr._compute_type(env, agg_env)
assert(self.cnsq.typ == self.altr.typ)
self._type = self.cnsq.typ
class Let(IR):
@typecheck_method(name=str, value=IR, body=IR)
def __init__(self, name, value, body):
super().__init__(value, body)
self.name = name
self.value = value
self.body = body
@typecheck_method(value=IR, body=IR)
def copy(self, value, body):
new_instance = self.__class__
return new_instance(self.name, value, body)
def render(self, r):
return '(Let {} {} {})'.format(escape_id(self.name), r(self.value), r(self.body))
@property
def bound_variables(self):
return {self.name} | super().bound_variables
def __eq__(self, other):
return isinstance(other, Let) and \
other.name == self.name and \
other.value == self.value and \
other.body == self.body
def _compute_type(self, env, agg_env):
self.value._compute_type(env, agg_env)
self.body._compute_type(_env_bind(env, self.name, self.value._type), agg_env)
self._type = self.body._type
class Ref(IR):
@typecheck_method(name=str)
def __init__(self, name):
super().__init__()
self.name = name
def copy(self):
new_instance = self.__class__
return new_instance(self.name)
def render(self, r):
return '(Ref {})'.format(escape_id(self.name))
def __eq__(self, other):
return isinstance(other, Ref) and \
other.name == self.name
def _compute_type(self, env, agg_env):
self._type = env[self.name]
class TopLevelReference(Ref):
@typecheck_method(name=str)
def __init__(self, name):
super().__init__(name)
@property
def is_nested_field(self):
return True
def copy(self):
new_instance = self.__class__
return new_instance(self.name)
def __eq__(self, other):
return isinstance(other, TopLevelReference) and \
other.name == self.name
def _compute_type(self, env, agg_env):
assert self.name in env, f'{self.name} not found in {env}'
self._type = env[self.name]
class ApplyBinaryOp(IR):
@typecheck_method(op=str, l=IR, r=IR)
def __init__(self, op, l, r):
super().__init__(l, r)
self.op = op
self.l = l
self.r = r
@typecheck_method(l=IR, r=IR)
def copy(self, l, r):
new_instance = self.__class__
return new_instance(self.op, l, r)
def render(self, r):
return '(ApplyBinaryPrimOp {} {} {})'.format(escape_id(self.op), r(self.l), r(self.r))
def __eq__(self, other):
return isinstance(other, ApplyBinaryOp) and \
other.op == self.op and \
other.l == self.l and \
other.r == self.r
def _compute_type(self, env, agg_env):
self.l._compute_type(env, agg_env)
self.r._compute_type(env, agg_env)
if self.op == '/':
if self.l.typ == tfloat64:
self._type = tfloat64
else:
self._type = tfloat32
else:
self._type = self.l.typ
class ApplyUnaryOp(IR):
@typecheck_method(op=str, x=IR)
def __init__(self, op, x):
super().__init__(x)
self.op = op
self.x = x
@typecheck_method(x=IR)
def copy(self, x):
new_instance = self.__class__
return new_instance(self.op, x)
def render(self, r):
return '(ApplyUnaryPrimOp {} {})'.format(escape_id(self.op), r(self.x))
def __eq__(self, other):
return isinstance(other, ApplyUnaryOp) and \
other.op == self.op and \
other.x == self.x
def _compute_type(self, env, agg_env):
self.x._compute_type(env, agg_env)
self._type = self.x.typ
class ApplyComparisonOp(IR):
@typecheck_method(op=str, l=IR, r=IR)
def __init__(self, op, l, r):
super().__init__(l, r)
self.op = op
self.l = l
self.r = r
@typecheck_method(l=IR, r=IR)
def copy(self, l, r):
new_instance = self.__class__
return new_instance(self.op, l, r)
def render(self, r):
return '(ApplyComparisonOp {} {} {})'.format(escape_id(self.op), r(self.l), r(self.r))
def __eq__(self, other):
return isinstance(other, ApplyComparisonOp) and \
other.op == self.op and \
other.l == self.l and \
other.r == self.r
def _compute_type(self, env, agg_env):
self.l._compute_type(env, agg_env)
self.r._compute_type(env, agg_env)
self._type = tbool
class MakeArray(IR):
@typecheck_method(args=sequenceof(IR), type=nullable(hail_type))
def __init__(self, args, type):
super().__init__(*args)
self.args = args
self._type = type
def copy(self, *args):
new_instance = self.__class__
return new_instance(list(args), self._type)
def render(self, r):
return '(MakeArray {} {})'.format(
self._type._parsable_string() if self._type is not None else 'None',
' '.join([r(x) for x in self.args]))
def __eq__(self, other):
return isinstance(other, MakeArray) and \
other.args == self.args and \
other._type == self._type
def _compute_type(self, env, agg_env):
for a in self.args:
a._compute_type(env, agg_env)
if self._type is None:
self._type = tarray(self.args[0].typ)
class ArrayRef(IR):
@typecheck_method(a=IR, i=IR)
def __init__(self, a, i):
super().__init__(a, i)
self.a = a
self.i = i
@typecheck_method(a=IR, i=IR)
def copy(self, a, i):
new_instance = self.__class__
return new_instance(a, i)
def render(self, r):
return '(ArrayRef {} {})'.format(r(self.a), r(self.i))
def __eq__(self, other):
return isinstance(other, ArrayRef) and \
other.a == self.a and \
other.i == self.i
def _compute_type(self, env, agg_env):
self.a._compute_type(env, agg_env)
self.i._compute_type(env, agg_env)
self._type = self.a.typ.element_type
class ArrayLen(IR):
@typecheck_method(a=IR)
def __init__(self, a):
super().__init__(a)
self.a = a
@typecheck_method(a=IR)
def copy(self, a):
new_instance = self.__class__
return new_instance(a)
def render(self, r):
return '(ArrayLen {})'.format(r(self.a))
def __eq__(self, other):
return isinstance(other, ArrayLen) and \
other.a == self.a
def _compute_type(self, env, agg_env):
self.a._compute_type(env, agg_env)
self._type = tint32
class ArrayRange(IR):
@typecheck_method(start=IR, stop=IR, step=IR)
def __init__(self, start, stop, step):
super().__init__(start, stop, step)
self.start = start
self.stop = stop
self.step = step
@typecheck_method(start=IR, stop=IR, step=IR)
def copy(self, start, stop, step):
new_instance = self.__class__
return new_instance(start, stop, step)
def render(self, r):
return '(ArrayRange {} {} {})'.format(r(self.start), r(self.stop), r(self.step))
def __eq__(self, other):
return isinstance(other, ArrayRange) and \
other.start == self.start and \
other.stop == self.stop and \
other.step == self.step
def _compute_type(self, env, agg_env):
self.start._compute_type(env, agg_env)
self.stop._compute_type(env, agg_env)
self.step._compute_type(env, agg_env)
self._type = tarray(tint32)
class MakeNDArray(IR):
@typecheck_method(data=IR, shape=IR, row_major=IR)
def __init__(self, data, shape, row_major):
super().__init__(data, shape, row_major)
self.data = data
self.shape = shape
self.row_major = row_major
@typecheck_method(data=IR, shape=IR, row_major=IR)
def copy(self, data, shape, row_major):
new_instance = self.__class__
return new_instance(data, shape, row_major)
def render(self, r):
return '(MakeNDArray {} {} {})'.format(
r(self.data),
r(self.shape),
r(self.row_major))
def __eq__(self, other):
return isinstance(other, MakeNDArray) and \
other.data == self.data and \
other.shape == self.shape and \
other.row_major == self.row_major
def _compute_type(self, env, agg_env):
self.data._compute_type(env, agg_env)
self.shape._compute_type(env, agg_env)
self.row_major._compute_type(env, agg_env)
self._type = tndarray(self.data.typ.element_type)
class NDArrayRef(IR):
@typecheck_method(nd=IR, idxs=IR)
def __init__(self, nd, idxs):
super().__init__(nd, idxs)
self.nd = nd
self.idxs = idxs
@typecheck_method(nd=IR, idxs=IR)
def copy(self, nd, idxs):
new_instance = self.__class__
return new_instance(nd, idxs)
def render(self, r):
return '(NDArrayRef {} {})'.format(r(self.nd), r(self.idxs))
def __eq__(self, other):
return isinstance(other, NDArrayRef) and \
other.nd == self.nd and \
other.idxs == self.idxs
def _compute_type(self, env, agg_env):
self.nd._compute_type(env, agg_env)
self.idxs._compute_type(env, agg_env)
self._type = self.nd.typ.element_type
class ArraySort(IR):
@typecheck_method(a=IR, l_name=str, r_name=str, compare=IR)
def __init__(self, a, l_name, r_name, compare):
super().__init__(a, compare)
self.a = a
self.l_name = l_name
self.r_name = r_name
self.compare = compare
@typecheck_method(a=IR, compare=IR)
def copy(self, a, compare):
new_instance = self.__class__
return new_instance(a, self.l_name, self.r_name, compare)
def render(self, r):
return '(ArraySort {} {} {} {})'.format(self.l_name, self.r_name, r(self.a), r(self.compare))
@property
def bound_variables(self):
return {self.l_name, self.r_name} | super().bound_variables
def __eq__(self, other):
return isinstance(other, ArraySort) and \
other.a == self.a and \
other.compare == self.compare and \
other.l_name == self.l_name and other.r_name == self.r_name
def _compute_type(self, env, agg_env):
self.a._compute_type(env, agg_env)
self._type = self.a.typ
class ToSet(IR):
@typecheck_method(a=IR)
def __init__(self, a):
super().__init__(a)
self.a = a
@typecheck_method(a=IR)
def copy(self, a):
new_instance = self.__class__
return new_instance(a)
def render(self, r):
return '(ToSet {})'.format(r(self.a))
def __eq__(self, other):
return isinstance(other, ToSet) and \
other.a == self.a
def _compute_type(self, env, agg_env):
self.a._compute_type(env, agg_env)
self._type = tset(self.a.typ.element_type)
class ToDict(IR):
@typecheck_method(a=IR)
def __init__(self, a):
super().__init__(a)
self.a = a
@typecheck_method(a=IR)
def copy(self, a):
new_instance = self.__class__
return new_instance(a)
def render(self, r):
return '(ToDict {})'.format(r(self.a))
def __eq__(self, other):
return isinstance(other, ToDict) and \
other.a == self.a
def _compute_type(self, env, agg_env):
self.a._compute_type(env, agg_env)
self._type = tdict(self.a.typ['key'], self.a.typ['value'])
class ToArray(IR):
@typecheck_method(a=IR)
def __init__(self, a):
super().__init__(a)
self.a = a
@typecheck_method(a=IR)
def copy(self, a):
new_instance = self.__class__
return new_instance(a)
def render(self, r):
return '(ToArray {})'.format(r(self.a))
def __eq__(self, other):
return isinstance(other, ToArray) and \
other.a == self.a
def _compute_type(self, env, agg_env):
self.a._compute_type(env, agg_env)
self._type = tarray(self.a.typ.element_type)
class LowerBoundOnOrderedCollection(IR):
@typecheck_method(ordered_collection=IR, elem=IR, on_key=bool)
def __init__(self, ordered_collection, elem, on_key):
super().__init__(ordered_collection, elem)
self.ordered_collection = ordered_collection
self.elem = elem
self.on_key = on_key
@typecheck_method(ordered_collection=IR, elem=IR)
def copy(self, ordered_collection, elem):
new_instance = self.__class__
return new_instance(ordered_collection, elem, self.on_key)
def render(self, r):
return '(LowerBoundOnOrderedCollection {} {} {})'.format(self.on_key, r(self.ordered_collection), r(self.elem))
def __eq__(self, other):
return isinstance(other, LowerBoundOnOrderedCollection) and \
other.ordered_collection == self.ordered_collection and \
other.elem == self.elem and \
other.on_key == self.on_key
def _compute_type(self, env, agg_env):
self.a._compute_type(env, agg_env)
self.elem._compute_type(env, agg_env)
self._type = tint32
class GroupByKey(IR):
@typecheck_method(collection=IR)
def __init__(self, collection):
super().__init__(collection)
self.collection = collection
@typecheck_method(collection=IR)
def copy(self, collection):
new_instance = self.__class__
return new_instance(collection)
def render(self, r):
return '(GroupByKey {})'.format(r(self.collection))
def __eq__(self, other):
return isinstance(other, GroupByKey) and \
other.collection == self.collection
def _compute_type(self, env, agg_env):
self.collection._compute_type(env, agg_env)
self._type = tdict(self.collection.typ.element_type.types[0],
tarray(self.collection.typ.element_type.types[1]))
class ArrayMap(IR):
@typecheck_method(a=IR, name=str, body=IR)
def __init__(self, a, name, body):
super().__init__(a, body)
self.a = a
self.name = name
self.body = body
@typecheck_method(a=IR, body=IR)
def copy(self, a, body):
new_instance = self.__class__
return new_instance(a, self.name, body)
def render(self, r):
return '(ArrayMap {} {} {})'.format(escape_id(self.name), r(self.a), r(self.body))
@property
def bound_variables(self):
return {self.name} | super().bound_variables
def __eq__(self, other):
return isinstance(other, ArrayMap) and \
other.a == self.a and \
other.name == self.name and \
other.body == self.body
def _compute_type(self, env, agg_env):
self.a._compute_type(env, agg_env)
self.body._compute_type(_env_bind(env, self.name, self.a.typ.element_type), agg_env)
self._type = tarray(self.body.typ)
class ArrayFilter(IR):
@typecheck_method(a=IR, name=str, body=IR)
def __init__(self, a, name, body):
super().__init__(a, body)
self.a = a
self.name = name
self.body = body
@typecheck_method(a=IR, body=IR)
def copy(self, a, body):
new_instance = self.__class__
return new_instance(a, self.name, body)
def render(self, r):
return '(ArrayFilter {} {} {})'.format(escape_id(self.name), r(self.a), r(self.body))
@property
def bound_variables(self):
return {self.name} | super().bound_variables
def __eq__(self, other):
return isinstance(other, ArrayFilter) and \
other.a == self.a and \
other.name == self.name and \
other.body == self.body
def _compute_type(self, env, agg_env):
self.a._compute_type(env, agg_env)
self.body._compute_type(_env_bind(env, self.name, self.a.typ.element_type), agg_env)
self._type = self.a.typ
class ArrayFlatMap(IR):
@typecheck_method(a=IR, name=str, body=IR)
def __init__(self, a, name, body):
super().__init__(a, body)
self.a = a
self.name = name
self.body = body
@typecheck_method(a=IR, body=IR)
def copy(self, a, body):
new_instance = self.__class__
return new_instance(a, self.name, body)
def render(self, r):
return '(ArrayFlatMap {} {} {})'.format(escape_id(self.name), r(self.a), r(self.body))
@property
def bound_variables(self):
return {self.name} | super().bound_variables
def __eq__(self, other):
return isinstance(other, ArrayFlatMap) and \
other.a == self.a and \
other.name == self.name and \
other.body == self.body
def _compute_type(self, env, agg_env):
self.a._compute_type(env, agg_env)
self.body._compute_type(_env_bind(env, self.name, self.a.typ.element_type), agg_env)
self._type = tarray(self.body.typ.element_type)
class ArrayFold(IR):
@typecheck_method(a=IR, zero=IR, accum_name=str, value_name=str, body=IR)
def __init__(self, a, zero, accum_name, value_name, body):
super().__init__(a, zero, body)
self.a = a
self.zero = zero
self.accum_name = accum_name
self.value_name = value_name
self.body = body
@typecheck_method(a=IR, zero=IR, body=IR)
def copy(self, a, zero, body):
new_instance = self.__class__
return new_instance(a, zero, self.accum_name, self.value_name, body)
def render(self, r):
return '(ArrayFold {} {} {} {} {})'.format(
escape_id(self.accum_name), escape_id(self.value_name),
r(self.a), r(self.zero), r(self.body))
@property
def bound_variables(self):
return {self.accum_name, self.value_name} | super().bound_variables
def __eq__(self, other):
return isinstance(other, ArrayFold) and \
other.a == self.a and \
other.zero == self.zero and \
other.accum_name == self.accum_name and \
other.value_name == self.value_name and \
other.body == self.body
def _compute_type(self, env, agg_env):
self.a._compute_type(env, agg_env)
self.zero._compute_type(env, agg_env)
self.body._compute_type(
_env_bind(
_env_bind(env, self.value_name, self.a.typ.element_type),
self.accum_name, self.zero.typ),
agg_env)
self._type = self.zero.typ
class ArrayScan(IR):
@typecheck_method(a=IR, zero=IR, accum_name=str, value_name=str, body=IR)
def __init__(self, a, zero, accum_name, value_name, body):
super().__init__(a, zero, body)
self.a = a
self.zero = zero
self.accum_name = accum_name
self.value_name = value_name
self.body = body
@typecheck_method(a=IR, zero=IR, body=IR)
def copy(self, a, zero, body):
new_instance = self.__class__
return new_instance(a, zero, self.accum_name, self.value_name, body)
def render(self, r):
return '(ArrayScan {} {} {} {} {})'.format(
escape_id(self.accum_name), escape_id(self.value_name),
r(self.a), r(self.zero), r(self.body))
@property
def bound_variables(self):
return {self.accum_name, self.value_name} | super().bound_variables
def __eq__(self, other):
return isinstance(other, ArrayScan) and \
other.a == self.a and \
other.zero == self.zero and \
other.accum_name == self.accum_name and \
other.value_name == self.value_name and \
other.body == self.body
def _compute_type(self, env, agg_env):
self.a._compute_type(env, agg_env)
self.zero._compute_type(env, agg_env)
self.body._compute_type(
_env_bind(
_env_bind(env, self.value_name, self.a.typ.element_type),
self.accum_name, self.zero.typ),
agg_env)
self._type = tarray(self.body.typ)
class ArrayLeftJoinDistinct(IR):
@typecheck_method(left=IR, right=IR, l_name=str, r_name=str, compare=IR, join=IR)
def __init__(self, left, right, l_name, r_name, compare, join):
super().__init__(left, right, compare, join)
self.left = left
self.right = right
self.l_name = l_name
self.r_name = r_name
self.compare = compare
self.join = join
@typecheck_method(left=IR, right=IR, compare=IR, join=IR)
def copy(self, left, right, compare, join):
new_instance = self.__class__
return new_instance(left, right, self.l_name, self.r_name, compare, join)
def render(self, r):
return '(ArrayLeftJoinDistinct {} {} {} {} {} {})'.format(
escape_id(self.l_name), escape_id(self.r_name),
r(self.left), r(self.right), r(self.compare), r(self.join))
@property
def bound_variables(self):
return {self.l_name, self.r_name} | super().bound_variables
def __eq__(self, other):
return isinstance(other, ArrayLeftJoinDistinct) and \
other.left == self.left and \
other.right == self.right and \
other.l_name == self.l_name and \
other.r_name == self.r_name and \
other.compare == self.compare and \
other.join == self.join
class ArrayFor(IR):
@typecheck_method(a=IR, value_name=str, body=IR)
def __init__(self, a, value_name, body):
super().__init__(a, body)
self.a = a
self.value_name = value_name
self.body = body
@typecheck_method(a=IR, body=IR)
def copy(self, a, body):
new_instance = self.__class__
return new_instance(a, self.value_name, body)
def render(self, r):
return '(ArrayFor {} {} {})'.format(escape_id(self.value_name), r(self.a), r(self.body))
@property
def bound_variables(self):
return {self.value_name} | super().bound_variables
def __eq__(self, other):
return isinstance(other, ArrayFor) and \
other.a == self.a and \
other.value_name == self.value_name and \
other.body == self.body
def _compute_type(self, env, agg_env):
self.a._compute_type(env, agg_env)
self.body._compute_type(_env_bind(env, self.value_name, self.a.typ.element_type), agg_env)
self._type = tvoid
class AggFilter(IR):
@typecheck_method(cond=IR, agg_ir=IR)
def __init__(self, cond, agg_ir):
super().__init__(cond, agg_ir)
self.cond = cond
self.agg_ir = agg_ir
@typecheck_method(cond=IR, agg_ir=IR)
def copy(self, cond, agg_ir):
new_instance = self.__class__
return new_instance(cond, agg_ir)
def render(self, r):
return '(AggFilter {} {})'.format(r(self.cond), r(self.agg_ir))
def __eq__(self, other):
return isinstance(other, AggFilter) and \
other.cond == self.cond and \
other.agg_ir == self.agg_ir
def _compute_type(self, env, agg_env):
self.cond._compute_type(agg_env, None)
self.agg_ir._compute_type(env, agg_env)
self._type = self.agg_ir.typ
class AggExplode(IR):
@typecheck_method(array=IR, name=str, agg_body=IR)
def __init__(self, array, name, agg_body):
super().__init__(array, agg_body)
self.name = name
self.array = array
self.agg_body = agg_body
@typecheck_method(array=IR, agg_body=IR)
def copy(self, array, agg_body):
new_instance = self.__class__
return new_instance(array, self.name, agg_body)
def render(self, r):
return '(AggExplode {} {} {})'.format(escape_id(self.name), r(self.array), r(self.agg_body))
@property
def bound_variables(self):
return {self.name} | super().bound_variables
def __eq__(self, other):
return isinstance(other, AggExplode) and \
other.array == self.array and \
other.name == self.name and \
other.agg_body == self.agg_body
def _compute_type(self, env, agg_env):
self.array._compute_type(agg_env, None)
self.agg_body._compute_type(env, _env_bind(agg_env, self.name, self.array.typ.element_type))
self._type = self.agg_body.typ
class AggGroupBy(IR):
@typecheck_method(key=IR, agg_ir=IR)
def __init__(self, key, agg_ir):
super().__init__(key, agg_ir)
self.key = key
self.agg_ir = agg_ir
@typecheck_method(key=IR, agg_ir=IR)
def copy(self, key, agg_ir):
new_instance = self.__class__
return new_instance(key, agg_ir)
def render(self, r):
return '(AggGroupBy {} {})'.format(r(self.key), r(self.agg_ir))
def __eq__(self, other):
return isinstance(other, AggGroupBy) and \
other.key == self.key and \
other.agg_ir == self.agg_ir
def _compute_type(self, env, agg_env):
self.key._compute_type(agg_env, None)
self.agg_ir._compute_type(env, agg_env)
self._type = tdict(self.key.typ, self.agg_ir.typ)
class AggArrayPerElement(IR):
@typecheck_method(array=IR, name=str, agg_ir=IR)
def __init__(self, array, name, agg_ir):
super().__init__(array, agg_ir)
self.array = array
self.name = name
self.agg_ir = agg_ir
@typecheck_method(array=IR, agg_ir=IR)
def copy(self, array, agg_ir):
new_instance = self.__class__
return new_instance(array, self.name, agg_ir)
def render(self, r):
return '(AggArrayPerElement {} {} {})'.format(escape_id(self.name), r(self.array), r(self.agg_ir))
def __eq__(self, other):
return isinstance(other, AggArrayPerElement) and \
other.array == self.array and \
other.name == self.name and \
other.agg_ir == self.agg_ir
def _compute_type(self, env, agg_env):
self.array._compute_type(agg_env, None)
self.agg_ir._compute_type(env, _env_bind(agg_env, self.name, self.array.typ.element_type))
self._type = tarray(self.agg_ir.typ)
@property
def bound_variables(self):
return {self.name} | super().bound_variables
def _register(registry, name, f):
if name in registry:
registry[name].append(f)
else:
registry[name] = [f]
_aggregator_registry = {}
def register_aggregator(name, ctor_params, init_params, seq_params, ret_type):
_register(_aggregator_registry, name, (ctor_params, init_params, seq_params, ret_type))
def lookup_aggregator_return_type(name, ctor_args, init_args, seq_args):
if name in _aggregator_registry:
fns = _aggregator_registry[name]
for f in fns:
(ctor_params, init_params, seq_params, ret_type) = f
for p in ctor_params:
p.clear()
if init_params:
for p in init_params:
p.clear()
for p in seq_params:
p.clear()
if init_params:
init_match = all(p.unify(a) for p, a in zip(init_params, init_args))
else:
init_match = init_args is None
if (init_match
and all(p.unify(a) for p, a in zip(ctor_params, ctor_args))
and all(p.unify(a) for p, a in zip(seq_params, seq_args))):
return ret_type.subst()
raise KeyError(f'aggregator {name}({ ",".join([str(t) for t in seq_args]) }) not found')
class BaseApplyAggOp(IR):
@typecheck_method(agg_op=str,
constructor_args=sequenceof(IR),
init_op_args=nullable(sequenceof(IR)),
seq_op_args=sequenceof(IR))
def __init__(self, agg_op, constructor_args, init_op_args, seq_op_args):
init_op_children = [] if init_op_args is None else init_op_args
super().__init__(*constructor_args, *init_op_children, *seq_op_args)
self.agg_op = agg_op
self.constructor_args = constructor_args
self.init_op_args = init_op_args
self.seq_op_args = seq_op_args
def copy(self, *args):
new_instance = self.__class__
n_seq_op_args = len(self.seq_op_args)
n_constructor_args = len(self.constructor_args)
constr_args = args[:n_constructor_args]
init_op_args = args[n_constructor_args:-n_seq_op_args]
seq_op_args = args[-n_seq_op_args:]
return new_instance(self.agg_op, constr_args, init_op_args if len(init_op_args) != 0 else None, seq_op_args)
def render(self, r):
return '({} {} ({}) {} ({}))'.format(
self.__class__.__name__,
self.agg_op,
' '.join([r(x) for x in self.constructor_args]),
'(' + ' '.join([r(x) for x in self.init_op_args]) + ')' if self.init_op_args else 'None',
' '.join([r(x) for x in self.seq_op_args]))
@property
def aggregations(self):
assert all(map(lambda c: len(c.aggregations) == 0, self.children))
return [self]
def __eq__(self, other):
return isinstance(other, self.__class__) and \
other.agg_op == self.agg_op and \
other.constructor_args == self.constructor_args and \
other.init_op_args == self.init_op_args and \
other.seq_op_args == self.seq_op_args
def _compute_type(self, env, agg_env):
for a in self.constructor_args:
a._compute_type(env, agg_env)
if self.init_op_args:
for a in self.init_op_args:
a._compute_type(env, agg_env)
for a in self.seq_op_args:
a._compute_type(agg_env, None)
self._type = lookup_aggregator_return_type(
self.agg_op,
[a.typ for a in self.constructor_args],
[a.typ for a in self.init_op_args] if self.init_op_args else None,
[a.typ for a in self.seq_op_args])
class ApplyAggOp(BaseApplyAggOp):
@typecheck_method(agg_op=str,
constructor_args=sequenceof(IR),
init_op_args=nullable(sequenceof(IR)),
seq_op_args=sequenceof(IR))
def __init__(self, agg_op, constructor_args, init_op_args, seq_op_args):
super().__init__(agg_op, constructor_args, init_op_args, seq_op_args)
class ApplyScanOp(BaseApplyAggOp):
@typecheck_method(agg_op=str,
constructor_args=sequenceof(IR),
init_op_args=nullable(sequenceof(IR)),
seq_op_args=sequenceof(IR))
def __init__(self, agg_op, constructor_args, init_op_args, seq_op_args):
super().__init__(agg_op, constructor_args, init_op_args, seq_op_args)
class Begin(IR):
@typecheck_method(xs=sequenceof(IR))
def __init__(self, xs):
super().__init__(*xs)
self.xs = xs
def copy(self, *xs):
new_instance = self.__class__
return new_instance(list(xs))
def render(self, r):
return '(Begin {})'.format(' '.join([r(x) for x in self.xs]))
def __eq__(self, other):
return isinstance(other, Begin) \
and other.xs == self.xs
def _compute_type(self, env, agg_env):
for x in self.xs:
x._compute_type(env, agg_env)
self._type = tvoid
class MakeStruct(IR):
@typecheck_method(fields=sequenceof(sized_tupleof(str, IR)))
def __init__(self, fields):
super().__init__(*[ir for (n, ir) in fields])
self.fields = fields
def copy(self, *irs):
new_instance = self.__class__
assert len(irs) == len(self.fields)
return new_instance([(n, ir) for (n, _), ir in zip(self.fields, irs)])
def render(self, r):
return '(MakeStruct {})'.format(' '.join(['({} {})'.format(escape_id(f), r(x)) for (f, x) in self.fields]))
def __eq__(self, other):
return isinstance(other, MakeStruct) \
and other.fields == self.fields
def _compute_type(self, env, agg_env):
for f, x in self.fields:
x._compute_type(env, agg_env)
self._type = tstruct(**{f: x.typ for f, x in self.fields})
class SelectFields(IR):
@typecheck_method(old=IR, fields=sequenceof(str))
def __init__(self, old, fields):
super().__init__(old)
self.old = old
self.fields = fields
@typecheck_method(old=IR)
def copy(self, old):
new_instance = self.__class__
return new_instance(old, self.fields)
def render(self, r):
return '(SelectFields ({}) {})'.format(' '.join(map(escape_id, self.fields)), r(self.old))
def __eq__(self, other):
return isinstance(other, SelectFields) and \
other.old == self.old and \
other.fields == self.fields
def _compute_type(self, env, agg_env):
self.old._compute_type(env, agg_env)
self._type = self.old.typ._select_fields(self.fields)
class InsertFields(IR):
@typecheck_method(old=IR, fields=sequenceof(sized_tupleof(str, IR)), field_order=nullable(sequenceof(str)))
def __init__(self, old, fields, field_order):
super().__init__(old, *[ir for (f, ir) in fields])
self.old = old
self.fields = fields
self.field_order = field_order
def copy(self, *args):
new_instance = self.__class__
assert len(args) == len(self.fields) + 1
return new_instance(args[0], [(n, ir) for (n, _), ir in zip(self.fields, args[1:])], self.field_order)
def render(self, r):
return '(InsertFields {} {} {})'.format(
self.old,
'None' if self.field_order is None else parsable_strings(self.field_order),
' '.join(['({} {})'.format(escape_id(f), r(x)) for (f, x) in self.fields]))
def __eq__(self, other):
return isinstance(other, InsertFields) and \
other.old == self.old and \
other.fields == self.fields and \
other.field_order == self.field_order
def _compute_type(self, env, agg_env):
self.old._compute_type(env, agg_env)
for f, x in self.fields:
x._compute_type(env, agg_env)
self._type = self.old.typ._insert_fields(**{f: x.typ for f, x in self.fields})
if self.field_order:
self._type = tstruct(**{f: self._type[f] for f in self.field_order})
class GetField(IR):
@typecheck_method(o=IR, name=str)
def __init__(self, o, name):
super().__init__(o)
self.o = o
self.name = name
@typecheck_method(o=IR)
def copy(self, o):
new_instance = self.__class__
return new_instance(o, self.name)
def render(self, r):
return '(GetField {} {})'.format(escape_id(self.name), r(self.o))
@property
def is_nested_field(self):
return self.o.is_nested_field
def __eq__(self, other):
return isinstance(other, GetField) and \
other.o == self.o and \
other.name == self.name
def _compute_type(self, env, agg_env):
self.o._compute_type(env, agg_env)
self._type = self.o.typ[self.name]
class MakeTuple(IR):
@typecheck_method(elements=sequenceof(IR))
def __init__(self, elements):
super().__init__(*elements)
self.elements = elements
def copy(self, *args):
new_instance = self.__class__
return new_instance(list(args))
def render(self, r):
return '(MakeTuple {})'.format(' '.join([r(x) for x in self.elements]))
def __eq__(self, other):
return isinstance(other, MakeTuple) and \
other.elements == self.elements
def _compute_type(self, env, agg_env):
for x in self.elements:
x._compute_type(env, agg_env)
self._type = ttuple(*[x.typ for x in self.elements])
class GetTupleElement(IR):
@typecheck_method(o=IR, idx=int)
def __init__(self, o, idx):
super().__init__(o)
self.o = o
self.idx = idx
@typecheck_method(o=IR)
def copy(self, o):
new_instance = self.__class__
return new_instance(o, self.idx)
def render(self, r):
return '(GetTupleElement {} {})'.format(self.idx, r(self.o))
def __eq__(self, other):
return isinstance(other, GetTupleElement) and \
other.o == self.o and \
other.idx == self.idx
def _compute_type(self, env, agg_env):
self.o._compute_type(env, agg_env)
self._type = self.o.typ.types[self.idx]
class StringSlice(IR):
@typecheck_method(s=IR, start=IR, end=IR)
def __init__(self, s, start, end):
super().__init__(s, start, end)
self.s = s
self.start = start
self.end = end
@typecheck_method(s=IR, start=IR, end=IR)
def copy(self, s, start, end):
new_instance = self.__class__
return new_instance(s, start, end)
def render(self, r):
return '(StringSlice {} {} {})'.format(r(self.s), r(self.start), r(self.end))
def __eq__(self, other):
return isinstance(other, StringSlice) and \
other.s == self.s and \
other.start == self.start and \
other.end == self.end
def _compute_type(self, env, agg_env):
self.s._compute_type(env, agg_env)
self.start._compute_type(env, agg_env)
self.end._compute_type(env, agg_env)
self._type = tstr
class StringLength(IR):
@typecheck_method(s=IR)
def __init__(self, s):
super().__init__(s)
self.s = s
@typecheck_method(s=IR)
def copy(self, s):
new_instance = self.__class__
return new_instance(s)
def render(self, r):
return '(StringLength {})'.format(r(self.s))
def __eq__(self, other):
return isinstance(other, StringLength) and \
other.s == self.s
def _compute_type(self, env, agg_env):
self._type = tint32
class In(IR):
@typecheck_method(i=int, typ=hail_type)
def __init__(self, i, typ):
super().__init__()
self.i = i
self._typ = typ
@property
def typ(self):
return self._typ
def copy(self):
new_instance = self.__class__
return new_instance(self.i, self._typ)
def render(self, r):
return '(In {} {})'.format(self._typ._parsable_string(), self.i)
def __eq__(self, other):
return isinstance(other, In) and \
other.i == self.i and \
other._typ == self._typ
def _compute_type(self, env, agg_env):
self._type = self._typ
class Die(IR):
@typecheck_method(message=IR, typ=hail_type)
def __init__(self, message, typ):
super().__init__()
self.message = message
self._typ = typ
@property
def typ(self):
return self._typ
def copy(self):
new_instance = self.__class__
return new_instance(self.message, self._typ)
def render(self, r):
return '(Die {} {})'.format(self._typ._parsable_string(), r(self.message))
def __eq__(self, other):
return isinstance(other, Die) and \
other.message == self.message and \
other._typ == self._typ
def _compute_type(self, env, agg_env):
self._type = self._typ
_function_registry = {}
_seeded_function_registry = {}
def register_function(name, param_types, ret_type):
_register(_function_registry, name, (param_types, ret_type))
def register_seeded_function(name, param_types, ret_type):
_register(_seeded_function_registry, name, (param_types, ret_type))
def _lookup_function_return_type(registry, fkind, name, arg_types):
if name in registry:
fns = registry[name]
for f in fns:
(param_types, ret_type) = f
for p in param_types:
p.clear()
ret_type.clear()
if all(p.unify(a) for p, a in zip(param_types, arg_types)):
return ret_type.subst()
raise KeyError(f'{fkind} {name}({ ",".join([str(t) for t in arg_types]) }) not found')
def lookup_function_return_type(name, arg_types):
return _lookup_function_return_type(_function_registry, 'function', name, arg_types)
def lookup_seeded_function_return_type(name, arg_types):
return _lookup_function_return_type(_seeded_function_registry, 'seeded function', name, arg_types)
class Apply(IR):
@typecheck_method(function=str, args=IR)
def __init__(self, function, *args):
super().__init__(*args)
self.function = function
self.args = args
def copy(self, *args):
new_instance = self.__class__
return new_instance(self.function, *args)
def render(self, r):
return '(Apply {} {})'.format(escape_id(self.function), ' '.join([r(x) for x in self.args]))
def __eq__(self, other):
return isinstance(other, Apply) and \
other.function == self.function and \
other.args == self.args
def _compute_type(self, env, agg_env):
for arg in self.args:
arg._compute_type(env, agg_env)
self._type = lookup_function_return_type(self.function, [a.typ for a in self.args])
class ApplySeeded(IR):
@typecheck_method(function=str, seed=int, args=IR)
def __init__(self, function, seed, *args):
super().__init__(*args)
self.function = function
self.args = args
self.seed = seed
def copy(self, *args):
new_instance = self.__class__
return new_instance(self.function, self.seed, *args)
def render(self, r):
return '(ApplySeeded {} {} {})'.format(
escape_id(self.function),
self.seed,
' '.join([r(x) for x in self.args]))
def __eq__(self, other):
return isinstance(other, Apply) and \
other.function == self.function and \
other.args == self.args
def _compute_type(self, env, agg_env):
for arg in self.args:
arg._compute_type(env, agg_env)
self._type = lookup_seeded_function_return_type(self.function, [a.typ for a in self.args])
class Uniroot(IR):
@typecheck_method(argname=str, function=IR, min=IR, max=IR)
def __init__(self, argname, function, min, max):
super().__init__(function, min, max)
self.argname = argname
self.function = function
self.min = min
self.max = max
@typecheck_method(function=IR, min=IR, max=IR)
def copy(self, function, min, max):
new_instance = self.__class__
return new_instance(self.argname, function, min, max)
def render(self, r):
return '(Uniroot {} {} {} {})'.format(
escape_id(self.argname), r(self.function), r(self.min), r(self.max))
@property
def bound_variables(self):
return {self.argname} | super().bound_variables
def __eq__(self, other):
return isinstance(other, Uniroot) and \
other.argname == self.argname and \
other.function == self.function and \
other.min == self.min and \
other.max == self.max
def _compute_type(self, env, agg_env):
self.function._compute_type(_env_bind(env, self.argname, tfloat64), agg_env)
self.min._compute_type(env, agg_env)
self.max._compute_type(env, agg_env)
self._type = tfloat64
class TableCount(IR):
@typecheck_method(child=TableIR)
def __init__(self, child):
super().__init__(child)
self.child = child
@typecheck_method(child=TableIR)
def copy(self, child):
new_instance = self.__class__
return new_instance(child)
def render(self, r):
return '(TableCount {})'.format(r(self.child))
def __eq__(self, other):
return isinstance(other, TableCount) and \
other.child == self.child
def _compute_type(self, env, agg_env):
self.child._compute_type()
self._type = tint64
class TableGetGlobals(IR):
@typecheck_method(child=TableIR)
def __init__(self, child):
super().__init__(child)
self.child = child
@typecheck_method(child=TableIR)
def copy(self, child):
new_instance = self.__class__
return new_instance(child)
def render(self, r):
return '(TableGetGlobals {})'.format(r(self.child))
def __eq__(self, other):
return isinstance(other, TableGetGlobals) and \
other.child == self.child
def _compute_type(self, env, agg_env):
self.child._compute_type()
self._type = self.child.typ.global_type
class TableCollect(IR):
@typecheck_method(child=TableIR)
def __init__(self, child):
super().__init__(child)
self.child = child
@typecheck_method(child=TableIR)
def copy(self, child):
new_instance = self.__class__
return new_instance(child)
def render(self, r):
return '(TableCollect {})'.format(r(self.child))
def __eq__(self, other):
return isinstance(other, TableCollect) and \
other.child == self.child
def _compute_type(self, env, agg_env):
self.child._compute_type()
self._type = tstruct(**{'rows': tarray(self.child.typ.row_type),
'global': self.child.typ.global_type})
class TableAggregate(IR):
@typecheck_method(child=TableIR, query=IR)
def __init__(self, child, query):
super().__init__(child, query)
self.child = child
self.query = query
@typecheck_method(child=TableIR, query=IR)
def copy(self, child, query):
new_instance = self.__class__
return new_instance(child, query)
def render(self, r):
return '(TableAggregate {} {})'.format(r(self.child), r(self.query))
def __eq__(self, other):
return isinstance(other, TableAggregate) and \
other.child == self.child and \
other.query == self.query
def _compute_type(self, env, agg_env):
self.query._compute_type(self.child.typ.global_env(), self.child.typ.row_env())
self._type = self.query.typ
class MatrixAggregate(IR):
@typecheck_method(child=MatrixIR, query=IR)
def __init__(self, child, query):
super().__init__(child, query)
self.child = child
self.query = query
@typecheck_method(child=MatrixIR, query=IR)
def copy(self, child, query):
new_instance = self.__class__
return new_instance(child, query)
def render(self, r):
return '(MatrixAggregate {} {})'.format(r(self.child), r(self.query))
def __eq__(self, other):
return isinstance(other, MatrixAggregate) and \
other.child == self.child and \
other.query == self.query
def _compute_type(self, env, agg_env):
self.query._compute_type(self.child.typ.global_env(), self.child.typ.entry_env())
self._type = self.query.typ
class TableWrite(IR):
@typecheck_method(child=TableIR, path=str, overwrite=bool, stage_locally=bool, _codec_spec=nullable(str))
def __init__(self, child, path, overwrite, stage_locally, _codec_spec):
super().__init__(child)
self.child = child
self.path = path
self.overwrite = overwrite
self.stage_locally = stage_locally
self._codec_spec = _codec_spec
@typecheck_method(child=TableIR)
def copy(self, child):
new_instance = self.__class__
return new_instance(child, self.path, self.overwrite, self.stage_locally, self._codec_spec)
def render(self, r):
return '(TableWrite "{}" {} {} {} {})'.format(escape_str(self.path), self.overwrite, self.stage_locally,
"\"" + escape_str(self._codec_spec) + "\"" if self._codec_spec else "None",
r(self.child))
def __eq__(self, other):
return isinstance(other, TableWrite) and \
other.child == self.child and \
other.path == self.path and \
other.overwrite == self.overwrite and \
other.stage_locally == self.stage_locally and \
other._codec_spec == self._codec_spec
def _compute_type(self, env, agg_env):
self.child._compute_type()
self._type = tvoid
class TableExport(IR):
@typecheck_method(child=TableIR,
path=str,
types_file=nullable(str),
header=bool,
export_type=int,
delimiter=str)
def __init__(self, child, path, types_file, header, export_type, delimiter):
super().__init__(child)
self.child = child
self.path = path
self.types_file = types_file
self.header = header
self.export_type = export_type
self.delimiter = delimiter
@typecheck_method(child=TableIR)
def copy(self, child):
new_instance = self.__class__
return new_instance(child, self.path, self.types_file, self.header, self.export_type, self.delimiter)
def render(self, r):
return '(TableExport "{}" {} {} {} "{}" {})'.format(
escape_str(self.path),
f'"{escape_str(self.types_file)}"' if self.types_file else 'None',
self.header,
self.export_type,
escape_str(self.delimiter),
r(self.child)
)
def __eq__(self, other):
return isinstance(other, TableExport) and \
other.child == self.child and \
other.path == self.path and \
other.types_file == self.types_file and \
other.header == self.header and \
other.export_type == self.export_type and \
other.delimiter == self.delimiter
def _compute_type(self, env, agg_env):
self.child._compute_type()
self._type = tvoid
class MatrixWrite(IR):
@typecheck_method(child=MatrixIR, matrix_writer=MatrixWriter)
def __init__(self, child, matrix_writer):
super().__init__(child)
self.child = child
self.matrix_writer = matrix_writer
@typecheck_method(child=MatrixIR)
def copy(self, child):
new_instance = self.__class__
return new_instance(child, self.matrix_writer)
def render(self, r):
return '(MatrixWrite "{}" {})'.format(
r(self.matrix_writer),
r(self.child))
def __eq__(self, other):
return isinstance(other, MatrixWrite) and \
other.child == self.child and \
other.matrix_writer == self.matrix_writer
def _compute_type(self, env, agg_env):
self.child._compute_type()
self._type = tvoid
class MatrixMultiWrite(IR):
@typecheck_method(children=sequenceof(MatrixIR), writer=MatrixNativeMultiWriter)
def __init__(self, children, writer):
super().__init__(*children)
self.writer = writer
def copy(self, *children):
new_instance = self.__class__
return new_instance(list(children), self.writer)
def render(self, r):
return '(MatrixMultiWrite "{}" {})'.format(
r(self.writer),
' '.join(map(r, self.children)))
def __eq__(self, other):
return isinstance(other, MatrixMultiWrite) and \
other.children == self.children and \
other.writer == self.writer
class BlockMatrixWrite(IR):
@typecheck_method(child=BlockMatrixIR, path=str, overwrite=bool, force_row_major=bool, stage_locally=bool)
def __init__(self, child, path, overwrite, force_row_major, stage_locally):
super().__init__(child)
self.child = child
self.path = path
self.overwrite = overwrite
self.force_row_major = force_row_major
self.stage_locally = stage_locally
def copy(self, child):
new_instance = self.__class__
return new_instance(child, self.path, self.overwrite, self.force_row_major, self.stage_locally)
def render(self, r):
return '(BlockMatrixWrite "{}" {} {} {} {})'.format(
escape_str(self.path),
self.overwrite,
self.force_row_major,
self.stage_locally,
r(self.child))
def __eq__(self, other):
return isinstance(other, BlockMatrixWrite) and \
other.child == self.child and \
other.path == self.path and \
other.overwrite == self.overwrite and \
other.force_row_major == self.force_row_major and \
other.stage_locally == self.stage_locally
def _compute_type(self, env, agg_env):
self.child._compute_type()
self._type = tvoid
class TableToValueApply(IR):
def __init__(self, child, config):
super().__init__(child)
self.child = child
self.config = config
@typecheck_method(child=TableIR)
def copy(self, child):
new_instance = self.__class__
return new_instance(child, self.config)
def render(self, r):
return f'(TableToValueApply {dump_json(self.config)} {r(self.child)})'
def __eq__(self, other):
return isinstance(other, TableToValueApply) and other.child == self.child and other.config == self.config
def _compute_type(self, env, agg_env):
name = self.config['name']
assert name == 'ForceCountTable', name
self._type = tint64
class MatrixToValueApply(IR):
def __init__(self, child, config):
super().__init__(child)
self.child = child
self.config = config
@typecheck_method(child=MatrixIR)
def copy(self, child):
new_instance = self.__class__
return new_instance(child, self.config)
def render(self, r):
return f'(MatrixToValueApply {dump_json(self.config)} {r(self.child)})'
def __eq__(self, other):
return isinstance(other, MatrixToValueApply) and other.child == self.child and other.config == self.config
def _compute_type(self, env, agg_env):
name = self.config['name']
if name == 'ForceCountMatrixTable':
self._type = tint64
elif name == 'MatrixExportEntriesByCol':
self._type = tvoid
else:
assert name == 'MatrixWriteBlockMatrix', name
self._type = tvoid
class Literal(IR):
@typecheck_method(typ=hail_type,
value=anytype)
def __init__(self, typ, value):
super(Literal, self).__init__()
self._typ: 'hail.HailType' = typ
self.value = value
def copy(self):
return Literal(self._typ, self.value)
def render(self, r):
return f'(Literal {self._typ._parsable_string()} ' \
f'"{escape_str(self._typ._to_json(self.value))}")'
def __eq__(self, other):
return isinstance(other, Literal) and \
other._typ == self._typ and \
other.value == self.value
def _compute_type(self, env, agg_env):
self._type = self._typ
class Join(IR):
_idx = 0
@typecheck_method(virtual_ir=IR,
temp_vars=sequenceof(str),
join_exprs=sequenceof(anytype),
join_func=func_spec(1, anytype))
def __init__(self, virtual_ir, temp_vars, join_exprs, join_func):
super(Join, self).__init__(virtual_ir)
self.virtual_ir = virtual_ir
self.temp_vars = temp_vars
self.join_exprs = join_exprs
self.join_func = join_func
self.idx = Join._idx
Join._idx += 1
def copy(self, virtual_ir):
new_instance = self.__class__
new_instance = new_instance(virtual_ir,
self.temp_vars,
self.join_exprs,
self.join_func)
new_instance.idx = self.idx
return new_instance
def search(self, criteria):
matches = []
for e in self.join_exprs:
matches += e._ir.search(criteria)
matches += super(Join, self).search(criteria)
return matches
def render(self, r):
return r(self.virtual_ir)
def _compute_type(self, env, agg_env):
self.virtual_ir._compute_type(env, agg_env)
self._type = self.virtual_ir._type
class JavaIR(IR):
def __init__(self, jir):
super(JavaIR, self).__init__()
self._jir = jir
super().__init__()
def render(self, r):
return f'(JavaIR {r.add_jir(self._jir)})'
def subst(ir, env, agg_env):
def _subst(ir, env2=None, agg_env2=None):
return subst(ir, env2 if env2 else env, agg_env2 if agg_env2 else agg_env)
def delete(env, name):
new_env = copy.deepcopy(env)
if name in new_env:
del new_env[name]
return new_env
if isinstance(ir, Ref):
return env.get(ir.name, ir)
elif isinstance(ir, Let):
return Let(ir.name,
_subst(ir.value),
_subst(ir.body, env))
elif isinstance(ir, ArrayMap):
return ArrayMap(_subst(ir.a),
ir.name,
_subst(ir.body, delete(env, ir.name)))
elif isinstance(ir, ArrayFilter):
return ArrayFilter(_subst(ir.a),
ir.name,
_subst(ir.body, delete(env, ir.name)))
elif isinstance(ir, ArrayFlatMap):
return ArrayFlatMap(_subst(ir.a),
ir.name,
_subst(ir.body, delete(env, ir.name)))
elif isinstance(ir, ArrayFold):
return ArrayFold(_subst(ir.a),
_subst(ir.zero),
ir.accum_name,
ir.value_name,
_subst(ir.body, delete(delete(env, ir.accum_name), ir.value_name)))
elif isinstance(ir, ArrayScan):
return ArrayScan(_subst(ir.a),
_subst(ir.zero),
ir.accum_name,
ir.value_name,
_subst(ir.body, delete(delete(env, ir.accum_name), ir.value_name)))
elif isinstance(ir, ArrayFor):
return ArrayFor(_subst(ir.a),
ir.value_name,
_subst(ir.body, delete(env, ir.value_name)))
elif isinstance(ir, AggFilter):
return AggFilter(_subst(ir.cond, agg_env),
_subst(ir.agg_ir, agg_env))
elif isinstance(ir, AggExplode):
return AggExplode(_subst(ir.array, agg_env),
ir.name,
_subst(ir.agg_body, delete(agg_env, ir.name), delete(agg_env, ir.name)))
elif isinstance(ir, AggGroupBy):
return AggGroupBy(_subst(ir.key, agg_env),
_subst(ir.agg_ir, agg_env))
elif isinstance(ir, ApplyAggOp):
subst_constr_args = [x.map_ir(lambda x: _subst(x)) for x in ir.constructor_args]
subst_init_op_args = [x.map_ir(lambda x: _subst(x)) for x in ir.init_op_args] if ir.init_op_args else ir.init_op_args
subst_seq_op_args = [subst(x, agg_env, {}) for x in ir.seq_op_args]
return ApplyAggOp(ir.agg_op,
subst_constr_args,
subst_init_op_args,
subst_seq_op_args)
else:
assert isinstance(ir, IR)
return ir.map_ir(lambda x: _subst(x))
|
import pandas as pd
import sqlite3
chunksize = 50000
conn = sqlite3.connect('data/db.sqlite')
cols = list(pd.read_csv('data/friends.csv',
chunksize=10).get_chunk().columns)[1:]
tp = pd.read_csv('data/friends.csv', chunksize=chunksize,
usecols=cols, iterator=True)
print('Starting...')
ct = 0
for df in tp:
df.to_sql('friends', conn, index=None, if_exists='append')
ct += len(df.index)
print('Written', ct, 'rows')
conn.commit()
print('Finished!')
|
import React from "react"
import styles from "./auth.module.scss"
import AppStoreAction from "../common/app-store-action"
export default ({ children }) => {
return (
<div className={styles.AuthLayout}>
{children}
<AppStoreAction className={styles.AppStoreAction} />
</div>
)
}
|
# Make a movie
import os
import numpy as np
import h5py
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from mokas_colors import getPalette
from skimage import measure
class loadHdf5:
def __init__(self, fname, baseGroup, limits=None):
self.fname = fname
self.baseGroup = baseGroup
self.edge_trim_percent = 8
if limits is not None:
self.limits = limits
self.is_limits = True
def load_raw_images(self):
if self.is_limits:
r0,r1,c0,c1 = self.limits
with h5py.File(self.fname, 'r') as f:
grp0 = f[self.baseGroup]
if 'images' in grp0:
if self.is_limits:
images = grp0['images'][:,r0:r1+1,c0:c1+1]
else:
images = grp0['images'][...]
imageNumbers = grp0['imageNumbers'][...]
else:
print("No data available, please check")
images, imageNumbers = None, None
return images, imageNumbers
def load_2D(self):
with h5py.File(self.fname, 'r') as f:
grp0 = f[self.baseGroup]
if 'cluster2D_end' in grp0:
if self.is_limits:
r0,r1,c0,c1 = self.limits
cluster2D_end = grp0['cluster2D_end'][r0:r1+1,c0:c1+1]
cluster2D_start = grp0['cluster2D_start'][r0:r1+1,c0:c1+1]
switchTimes2D = grp0['switchTimes2D'][r0:r1+1,c0:c1+1]
else:
cluster2D_end = grp0['cluster2D_end'][...]
cluster2D_start = grp0['cluster2D_start'][...]
switchTimes2D = grp0['switchTimes2D'][...]
return cluster2D_start, cluster2D_end, switchTimes2D
else:
print("No data available, please check")
def _get_edges(self, im):
"""
Calculate the position of the edge
from the first row image
edge_trim_percent reduces the width of the wire
from both sides
"""
gray_profile = np.mean(im, 0)
L2 = len(gray_profile) / 2
p1 = np.argmin(gray_profile[:L2])
p2 = np.argmin(gray_profile[L2:]) + L2
distance = p2 - p1
p1 += distance * self.edge_trim_percent / 100
p2 -= distance * self.edge_trim_percent / 100
return p1, p2
mainDir = "/data/Meas/Creep/CoFeB/Film/SuperSlowCreep/NonIrr/Feb2018/"
current, set_n, n_exp = "0.146", "Set1", "03"
fname5 = "{0}A/{0}A.hdf5".format(current)
fname5 = os.path.join(mainDir, fname5)
baseGroup = "/%s/%sA/%s" % (set_n, current, n_exp)
outDir = "Movies/%sA/%s/n_exp%s" % (current, set_n, n_exp)
outDir = "Movies"
outDir = os.path.join(mainDir, outDir)
if not os.path.isdir(outDir):
os.mkdir(outDir)
#limits = (140,220,180,530)
limits = (180,260,180,530)
r0, r1, c0, c1 = limits
hdf5 = loadHdf5(fname5, baseGroup, limits)
images, imageNumbers = hdf5.load_raw_images()
cluster2D_start, cluster2D_end, switchTimes2D = hdf5.load_2D()
# n=1.45
# white = np.array([1,1,1])
# z0, z1 = 800, 1401
# images = images[:,z0:z1]
# cluster2D_start = cluster2D_start[z0:z1]
# cluster2D_end = cluster2D_end[z0:z1]
# cluster2D_start_switches = np.unique(cluster2D_start)[1:]
# cluster2D_end_switches = np.unique(cluster2D_end)[1:]
# # Initialize color map
# im0 = cluster2D_start > 0
# switchTimes2D = switchTimes2D[z0:z1]
# dimX, dimY = im0.shape
# q = np.zeros((dimX,dimY,3))
# q[im0] = white
# is_in_cluster = False
qq = cluster2D_start != -1
contours = measure.find_contours(qq, .5, 'low')
X, Y = contours[2][:,1], contours[2][:,0]
# fsize = (9.75,4.5)
fsize = (8.14, 4.25)
# fig, axs = plt.subplots(2, 1, sharex=True, sharey=True, figsize=fsize)
switches_start = np.unique(cluster2D_start)[1:]
switches = np.unique(switchTimes2D)[1:]
n = switches[-1]
#p = getPalette(n, 'random', 'lightgray')
p = getPalette(n, 'random', 'black')
cm = colors.ListedColormap(p, 'pColorMap')
bounds = np.append(switches, switches[-1]+1)-0.5
norm = colors.BoundaryNorm(bounds, len(bounds)-1)
for switch in switches[:]:
print(switch)
fig, axs = plt.subplots(2, 1, figsize=fsize)
axs[0].imshow(images[switch] - images[0], 'gray', interpolation='none')
#axs[0].plot(X, Y, 'k-', lw=2)
axs[1].plot(X, Y, 'w-', lw=1)
q = cluster2D_end > switch
out = np.copy(cluster2D_end)
out[q] = -1
axs[1].imshow(out, cmap=cm, norm=norm)
for ax in axs:
ax.axis((0, c1 - c0, r1 - r0, 0))
#ax.grid(True)
plt.tight_layout()
fname = "frame%04i.jpg" % switch
outFname = os.path.join(outDir, fname)
fig.savefig(outFname, facecolor='black', edgecolor='black')
plt.close(fig)
print(outFname)
# #plt.show() |
var tcpServer;
var commandWindow;
/**
* Listens for the app launching then creates the window
*
* @see http://developer.chrome.com/apps/app.runtime.html
* @see http://developer.chrome.com/apps/app.window.html
*/
chrome.app.runtime.onLaunched.addListener(function() {
if (commandWindow && !commandWindow.contentWindow.closed) {
commandWindow.focus();
} else {
chrome.app.window.create('index.html',
{id: "mainwin", bounds: {width: 500, height: 309, left: 0}},
function(w) {
commandWindow = w;
});
}
});
// event logger
var log = (function(){
var logLines = [];
var logListener = null;
var output=function(str) {
if (str.length>0 && str.charAt(str.length-1)!='\n') {
str+='\n'
}
logLines.push(str);
if (logListener) {
logListener(str);
}
};
var addListener=function(listener) {
logListener=listener;
// let's call the new listener with all the old log lines
for (var i=0; i<logLines.length; i++) {
logListener(logLines[i]);
}
};
return {output: output, addListener: addListener};
})();
function onAcceptCallback(tcpConnection, socketInfo) {
var info="["+socketInfo.peerAddress+":"+socketInfo.peerPort+"] Connection accepted!";
log.output(info);
console.log(socketInfo);
tcpConnection.addDataReceivedListener(function(data) {
var lines = data.split(/[\n\r]+/);
for (var i=0; i<lines.length; i++) {
var line=lines[i];
if (line.length>0) {
var info="["+socketInfo.peerAddress+":"+socketInfo.peerPort+"] "+line;
log.output(info);
var cmd=line.split(/\s+/);
try {
tcpConnection.sendMessage(Commands.run(cmd[0], cmd.slice(1)));
} catch (ex) {
tcpConnection.sendMessage(ex);
}
}
}
});
};
function startServer(addr, port) {
if (tcpServer) {
tcpServer.disconnect();
}
tcpServer = new TcpServer(addr, port);
tcpServer.listen(onAcceptCallback);
}
function stopServer() {
if (tcpServer) {
tcpServer.disconnect();
tcpServer=null;
}
}
function getServerState() {
if (tcpServer) {
return {isConnected: tcpServer.isConnected(),
addr: tcpServer.addr,
port: tcpServer.port};
} else {
return {isConnected: false};
}
}
|
import axios from "axios";
import React from "react";
import WaveSurfer from "wavesurfer.js";
import RegionsPlugin from "wavesurfer.js/dist/plugin/wavesurfer.regions.min.js";
import TimelinePlugin from "wavesurfer.js/dist/plugin/wavesurfer.timeline.min.js";
import { Helmet } from "react-helmet";
import { withRouter } from "react-router-dom";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import {
faSearchMinus,
faSearchPlus,
faBackward,
faForward,
faPlayCircle,
faArrowRight,
faArrowLeft,
faPauseCircle,
} from "@fortawesome/free-solid-svg-icons";
import Alert from "../components/alert";
import { IconButton, Button } from "../components/button";
import Loader from "../components/loader";
class Annotate extends React.Component {
constructor(props) {
super(props);
const projectId = Number(this.props.match.params.projectid);
const dataId = Number(this.props.match.params.dataid);
this.state = {
isPlaying: false,
projectId,
dataId,
afterId: -1,
beforeId: -1,
labels: {},
labelsUrl: `/api/projects/${projectId}/labels`,
dataUrl: `/api/projects/${projectId}/data/${dataId}`,
neighboursUrl: `/api/projects/${projectId}/neighbours/${dataId}`,
annotationUrl: `projects/${projectId}/data/${dataId}/annotate`,
segmentationUrl: `/api/projects/${projectId}/data/${dataId}/segmentations`,
isDataLoading: false,
wavesurfer: null,
zoom: 0,
referenceTranscription: null,
isMarkedForReview: false,
selectedSegment: null,
isSegmentDeleting: false,
errorMessage: null,
successMessage: null,
};
this.labelRef = {};
this.transcription = null;
}
componentDidMount() {
const { labelsUrl, dataUrl,neighboursUrl } = this.state;
this.setState({ isDataLoading: true });
const wavesurfer = WaveSurfer.create({
container: "#waveform",
barWidth: 2,
barHeight: 1,
barGap: null,
mediaControls: false,
plugins: [
RegionsPlugin.create(),
TimelinePlugin.create({ container: "#timeline" }),
],
});
this.showSegmentTranscription(null);
this.props.history.listen((location, action) => {
wavesurfer.stop();
});
wavesurfer.on("ready", () => {
wavesurfer.enableDragSelection({ color: "rgba(0, 102, 255, 0.3)" });
if(!wavesurfer.loaded) {
wavesurfer.loaded = true;
wavesurfer.play();
this.setState({
isPlaying: true});
}
});
wavesurfer.on("region-in", (region) => {
this.showSegmentTranscription(region);
});
wavesurfer.on("region-out", () => {
this.showSegmentTranscription(null);
});
wavesurfer.on("region-play", (r) => {
r.once("out", () => {
wavesurfer.play(r.start);
wavesurfer.pause();
});
});
wavesurfer.on("region-click", (r, e) => {
e.stopPropagation();
this.setState({
isPlaying: true,
selectedSegment: r,
});
r.play();
});
wavesurfer.on("pause", (r, e) => {
this.setState({ isPlaying: false });
});
axios
.all([axios.get(labelsUrl), axios.get(dataUrl),axios.get(neighboursUrl)])
.then((response) => {
this.setState({
isDataLoading: false,
labels: response[0].data,
afterId: response[2].data.after_id,
beforeId: response[2].data.before_id,
});
const {
reference_transcription,
is_marked_for_review,
segmentations,
filename,
} = response[1].data;
//console.log("This was the reponse from the thing: ", response[1].data)
const regions = segmentations.map((segmentation) => {
return {
start: segmentation.start_time,
end: segmentation.end_time,
data: {
segmentation_id: segmentation.segmentation_id,
transcription: segmentation.transcription,
annotations: segmentation.annotations,
},
};
});
this.setState({
isDataLoading: false,
referenceTranscription: reference_transcription,
isMarkedForReview: is_marked_for_review,
filename,
});
wavesurfer.load(`/audios/${filename}`);
wavesurfer.drawBuffer();
const { zoom } = this.state;
wavesurfer.zoom(zoom);
this.setState({ wavesurfer });
this.loadRegions(regions);
})
.catch((error) => {
console.log(error);
this.setState({
isDataLoading: false,
});
});
}
loadRegions(regions) {
const { wavesurfer } = this.state;
//console.log(regions);
if (regions.length>0){
regions.forEach((region) => {
wavesurfer.addRegion(region);
});
this.setState({ selectedSegment : regions[0]});
}
else{
wavesurfer.addRegion({
start: 0.01,
end: 120.99,
data: {
segmentation_id: null,
transcription: null,
annotations: null,
}
});
this.setState({
isPlaying: true,
selectedSegment: {
start: 0.01,
end: 120.99,
data: {
segmentation_id: null,
transcription: null,
annotations: null,
}
},
});
}
}
showSegmentTranscription(region) {
this.segmentTranscription.textContent =
(region && region.data.transcription) || "–";
}
handlePlay() {
const { wavesurfer } = this.state;
this.setState({ isPlaying: true });
wavesurfer.play();
}
handlePause() {
const { wavesurfer } = this.state;
this.setState({ isPlaying: false });
wavesurfer.pause();
}
handleForward() {
const { wavesurfer } = this.state;
wavesurfer.skipForward(5);
}
handleBackward() {
const { wavesurfer } = this.state;
wavesurfer.skipBackward(5);
}
handleNextAnnotation() {
const { history } = this.props;
const { projectId, afterId } = this.state;
const path = `/projects/${projectId}/data/${afterId}/annotate`;
history.replace({ pathname: "/empty" });
setTimeout(() => {
history.replace({ pathname: path });
});
}
handlePreviousAnnotation() {
const { history } = this.props;
const { projectId, beforeId } = this.state;
const path = `/projects/${projectId}/data/${beforeId}/annotate`;
history.replace({ pathname: "/empty" });
setTimeout(() => {
history.replace({ pathname: path });
});
}
handleZoom(e) {
const { wavesurfer } = this.state;
const zoom = Number(e.target.value);
wavesurfer.zoom(zoom);
this.setState({ zoom });
}
handleIsMarkedForReview(e) {
const { dataUrl } = this.state;
const isMarkedForReview = e.target.checked;
this.setState({ isDataLoading: true });
axios({
method: "patch",
url: dataUrl,
data: {
is_marked_for_review: isMarkedForReview,
},
})
.then((response) => {
this.setState({
isDataLoading: false,
isMarkedForReview: response.data.is_marked_for_review,
errorMessage: null,
successMessage: "Marked for review status changed",
});
})
.catch((error) => {
console.log(error);
this.setState({
isDataLoading: false,
errorMessage: "Error changing review status",
successMessage: null,
});
});
}
handleSegmentDelete() {
const { wavesurfer, selectedSegment, segmentationUrl } = this.state;
this.setState({ isSegmentDeleting: true });
if (selectedSegment.data.segmentation_id) {
axios({
method: "delete",
url: `${segmentationUrl}/${selectedSegment.data.segmentation_id}`,
})
.then((response) => {
//console.log(selectedSegment.id);
wavesurfer.regions.list[selectedSegment.id].remove();
this.setState({
selectedSegment: null,
isSegmentDeleting: false,
})
})
.catch((error) => {
console.log(error);
this.setState({
isSegmentDeleting: false,
});
});
} else {
wavesurfer.regions.list[selectedSegment.data.segmentation_id].remove();
this.setState({
selectedSegment: null,
isSegmentDeleting: false,
});
}
}
handleSegmentSave(e) {
const { selectedSegment, segmentationUrl } = this.state;
const { start, end } = selectedSegment;
const {
transcription,
annotations,
segmentation_id = null,
} = selectedSegment.data;
console.log(annotations);
this.setState({ isSegmentSaving: true });
if (segmentation_id === null) {
axios({
method: "post",
url: segmentationUrl,
data: {
start,
end,
transcription,
annotations,
},
})
.then((response) => {
const { segmentation_id } = response.data;
selectedSegment.data.segmentation_id = segmentation_id;
this.setState({
isSegmentSaving: false,
selectedSegment,
successMessage: "Segment saved",
errorMessage: null,
});
})
.catch((error) => {
console.log(error);
this.setState({
isSegmentSaving: false,
errorMessage: "Mandatory(*) fields not filled",
successMessage: null,
});
});
} else {
axios({
method: "put",
url: `${segmentationUrl}/${segmentation_id}`,
data: {
start,
end,
transcription,
annotations,
},
})
.then((response) => {
this.setState({
isSegmentSaving: false,
successMessage: "Segment saved",
errorMessage: null,
});
})
.catch((error) => {
console.log(error);
this.setState({
isSegmentSaving: false,
errorMessage: "Error saving segment",
successMessage: null,
});
});
}
}
handleTranscriptionChange(e) {
const { selectedSegment } = this.state;
selectedSegment.data.transcription = e.target.value;
this.setState({ selectedSegment });
}
handleLabelChange(key, e) {
const { selectedSegment, labels } = this.state;
selectedSegment.data.annotations = selectedSegment.data.annotations || {};
if (labels[key]["type"] === "multiselect") {
selectedSegment.data.annotations[key] = {
label_id: labels[key]["label_id"],
values: Array.from(e.target.selectedOptions, (option) => option.value),
};
} else {
selectedSegment.data.annotations[key] = {
label_id: labels[key]["label_id"],
values: e.target.value,
};
}
this.setState({ selectedSegment });
}
handleAlertDismiss(e) {
e.preventDefault();
this.setState({
successMessage: "",
errorMessage: "",
});
}
render() {
const {
zoom,
isPlaying,
labels,
isDataLoading,
isMarkedForReview,
referenceTranscription,
selectedSegment,
isSegmentDeleting,
isSegmentSaving,
errorMessage,
successMessage,
dataId,
} = this.state;
return (
<div>
<Helmet>
<title>Annotate</title>
</Helmet>
<div className="container h-100">
<div className="h-100 mt-5 text-center">
<h4>Annotation Id : {dataId}</h4>
{errorMessage ? (
<Alert
type="danger"
message={errorMessage}
onClose={(e) => this.handleAlertDismiss(e)}
/>
) : null}
{successMessage ? (
<Alert
type="success"
message={successMessage}
onClose={(e) => this.handleAlertDismiss(e)}
/>
) : null}
{isDataLoading ? <Loader /> : null}
<div className="row justify-content-md-center my-4">
<div ref={(el) => (this.segmentTranscription = el)}></div>
<div id="waveform"></div>
<div id="timeline"></div>
</div>
{!isDataLoading ? (
<div>
<div className="row justify-content-md-center my-4">
<div className="col-1">
<IconButton
icon={faArrowLeft}
color="#6DB65B"
size="2x"
title="Previous Annotation"
onClick={() => {
this.handlePreviousAnnotation();
}}
/>
</div>
<div className="col-1">
<IconButton
icon={faBackward}
size="2x"
title="Skip Backward"
onClick={() => {
this.handleBackward();
}}
/>
</div>
<div className="col-1">
{!isPlaying ? (
<IconButton
icon={faPlayCircle}
size="2x"
title="Play"
onClick={() => {
this.handlePlay();
}}
/>
) : null}
{isPlaying ? (
<IconButton
icon={faPauseCircle}
size="2x"
title="Pause"
onClick={() => {
this.handlePause();
}}
/>
) : null}
</div>
<div className="col-1">
<IconButton
icon={faForward}
size="2x"
title="Skip Forward"
onClick={() => {
this.handleForward();
}}
/>
</div>
<div className="col-1">
<IconButton
icon={faArrowRight}
color="#6DB65B"
size="2x"
title="Next Annotation"
onClick={() => {
this.handleNextAnnotation();
}}
/>
</div>
</div>
<div className="row justify-content-center my-4">
{referenceTranscription ? (
<div className="form-group">
<label className="font-weight-bold">
Reference Transcription
</label>
<textarea
className="form-control"
rows="3"
cols="50"
disabled={true}
value={referenceTranscription}
></textarea>
</div>
) : null}
</div>
<div>
<div className="row justify-content-center my-4">
{Object.entries(labels).map(([key, value], index) => {
if (!value["values"].length) {
return null;
}
return (
<div className="col-3 text-left" key={index}>
<label htmlFor={key} className="font-weight-bold">
{key}
</label> <span style={{color: "red"}}>*</span>
<select
className="form-control"
name={key}
multiple={
value["type"] === "multiselect" ? true : false
}
value={
(selectedSegment &&
selectedSegment.data.annotations &&
selectedSegment.data.annotations[key] &&
selectedSegment.data.annotations[key][
"values"
]) ||
(value["type"] === "multiselect" ? [] : "")
}
onChange={(e) => this.handleLabelChange(key, e)}
ref={(el) => (this.labelRef[key] = el)}
>
{value["type"] !== "multiselect" ? (
<option value="-1">Choose Label Type</option>
) : null}
{value["values"].map((val) => {
return (
<option
key={val["value_id"]}
value={`${val["value_id"]}`}
>
{val["value"]}
</option>
);
})}
</select>
</div>
);
})}
</div>
<div className="row justify-content-center my-4">
<div className="form-group">
<label className="font-weight-bold">
Annotator Feedback
</label>
<textarea
className="form-control"
rows="3"
cols="50"
value={
(selectedSegment &&
selectedSegment.data.transcription) ||
""
}
onChange={(e) => this.handleTranscriptionChange(e)}
ref={(el) => (this.transcription = el)}
></textarea>
</div>
</div>
<div className="row justify-content-center my-4">
<div className="col-2">
<Button
size="lg"
type="danger"
disabled={isSegmentDeleting}
isSubmitting={isSegmentDeleting}
onClick={(e) => this.handleSegmentDelete(e)}
text="Clear"
/>
</div>
<div className="col-2">
<Button
size="lg"
type="primary"
disabled={isSegmentSaving}
onClick={(e) => this.handleSegmentSave(e)}
isSubmitting={isSegmentSaving}
text="Save"
/>
</div>
</div>
</div>
<div className="row justify-content-center my-4">
<div className="form-check">
<input
className="form-check-input"
type="checkbox"
id="isMarkedForReview"
value={true}
checked={isMarkedForReview}
onChange={(e) => this.handleIsMarkedForReview(e)}
/>
<label
className="form-check-label"
htmlFor="isMarkedForReview"
>
Mark for review
</label>
</div>
</div>
</div>
) : null}
</div>
</div>
</div>
);
}
}
export default withRouter(Annotate);
|
define(["module","text"],function(module){"use strict";function preProcessTemplate(e,r,a){return r=r.replace(/<%=\s+rp\(['"]([^'"]*)["']\)\s+%>/g,function(r,a){var t=e[a];return t?STATIC_URL_PLACEHOLDER+"/static/hashed/"+t[0]:(console.warn("Unresolved rp: "+a),a)}),a&&(r=r.replace(/<!-+\s+DEBUG_ONLY\s+-+>((?!END_DEBUG_ONLY)[\s\S])*<!-+\s+END_DEBUG_ONLY\s+-+>/g,""),r=r.replace(/<!--(.|\s)*?-->/g,"")),r}function jsEscape(e){return e.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")}function makeWrapper(e){var r=jsEscape(e);return"(function () {\n var isDefault = window.location.hostname === 'www.humblebundle.com';\n var staticUrl = isDefault ? 'https://humblebundle-a.akamaihd.net' : '';\n return '"+r+"'.replace(/"+STATIC_URL_PLACEHOLDER+"/g, staticUrl)\n})();\n"}var STATIC_URL_PLACEHOLDER="xSTATIC_URLx",buildMap={},hbTemplate={load:function(name,req,onLoad,config){var filePath=req.toUrl(name);if(config.isBuild){var resource_manifest=JSON.parse(fs.readFileSync(req.toUrl("resource_manifest.json"))),template=fs.readFileSync(filePath,"utf8"),preProcessed=makeWrapper(hbTemplate.preProcess(resource_manifest,template,!0));buildMap[name]=preProcessed,onLoad(preProcessed)}else req(["text!resource_manifest","text!"+name],function(resource_manifest,template){resource_manifest=JSON.parse(resource_manifest);var withStaticUrl=eval(makeWrapper(hbTemplate.preProcess(resource_manifest,template,!1)));onLoad(withStaticUrl)})},write:function(e,r,a){if(r in buildMap){var t=buildMap[r];a("define('"+e+"!"+r+"', function() { return "+t+"});\n")}},preProcess:preProcessTemplate};return hbTemplate});
//# sourceMappingURL=hbTemplate.js.map |
export * from './math';
export * from './matrix';
export * from './classes';
|
"""
Adapted from: https://raw.githubusercontent.com/ilastik/ilastik/1.3.3-legacy/bin/train_headless.py
Note: This script does not make any attempt to be efficient with RAM usage.
(The entire label volume is loaded at once.) As a result, each image volume you
train with must be significantly smaller than the available RAM on your machine.
"""
from __future__ import print_function
from builtins import range
import os
import pandas as pd
import pathlib
def main():
# Cmd-line args to this script.
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("new_project_name")
parser.add_argument("fol_img_data")
parser.add_argument("fol_label_data")
parser.add_argument("fn_file_meta")
parser.add_argument("fn_feature_matrix")
parser.add_argument("glob_img")
parsed_args = parser.parse_args()
glob_img = parsed_args.glob_img
# Optional: Customize classifier settings
classifier_factory = None
# from lazyflow.classifiers import ParallelVigraRfLazyflowClassifierFactory
# classifier_factory = ParallelVigraRfLazyflowClassifierFactory(100)
# sklearn classifier:
# from lazyflow.classifiers import SklearnLazyflowClassifier
# classifier_factory = SklearnLazyflowClassifierFactory( AdaBoostClassifier, n_estimators=50 )
feature_matrix = pd.read_csv(parsed_args.fn_feature_matrix,
index_col=0)
print(feature_matrix)
fol_label_data = pathlib.Path(parsed_args.fol_label_data)
fol_img_data = pathlib.Path(parsed_args.fol_img_data)
dat_meta = pd.read_csv(parsed_args.fn_file_meta).query("use==1")
dat_meta['fn_labels'] = dat_meta['filename']
dat_meta['fn_img'] = dat_meta.apply(lambda r: glob_img.format(**dict(r)),
axis=1
)
# check if all input files are there:
fns_img = [fol_img_data / f for f in dat_meta.fn_img.values]
fns_labels = [fol_label_data / f for f in dat_meta.fn_labels.values]
missing = []
for f in fns_img:
if not f.exists():
missing.append(f)
assert len(missing) == 0, f'Following input imgs are missing: {missing}'
for f in fns_labels:
if not f.exists():
missing.append(f)
assert len(missing) == 0, f'Following input labels are missing: {missing}'
generate_trained_project_file(
parsed_args.new_project_name,
[str(f) for f in fns_img],
[str(f) for f in fns_labels],
feature_matrix,
classifier_factory,
)
print("DONE.")
# Don't touch these constants!
ScalesList = [0.3, 0.7, 1, 1.6, 3.5, 5.0, 10.0]
FeatureIds = [
"GaussianSmoothing",
"LaplacianOfGaussian",
"GaussianGradientMagnitude",
"DifferenceOfGaussians",
"StructureTensorEigenvalues",
"HessianOfGaussianEigenvalues",
]
def generate_trained_project_file(
new_project_path, raw_data_paths, label_data_paths, feature_selections, classifier_factory=None
):
"""
Create a new project file from scratch, add the given raw data files,
inject the corresponding labels, configure the given feature selections,
and (if provided) override the classifier type ('factory').
Finally, request the classifier object from the pipeline (which forces training),
and save the project.
new_project_path: Where to save the new project file
raw_data_paths: A list of paths to the raw data images to train with
label_data_paths: A list of paths to the label image data to train with
feature_selections: A matrix of bool, representing the selected features
classifier_factory: Override the classifier type. Must be a subclass of either:
- lazyflow.classifiers.LazyflowVectorwiseClassifierFactoryABC
- lazyflow.classifiers.LazyflowPixelwiseClassifierFactoryABC
"""
assert len(raw_data_paths) == len(label_data_paths), "Number of label images must match number of raw images."
import ilastik_main
from ilastik.workflows.pixelClassification import PixelClassificationWorkflow
from lazyflow.graph import Graph
from lazyflow.operators.ioOperators import OpInputDataReader
from lazyflow.roi import roiToSlice, roiFromShape
from ilastik.applets.dataSelection.opDataSelection import FilesystemDatasetInfo
##
## CREATE PROJECT
##
# Manually configure the arguments to ilastik, as if they were parsed from the command line.
# (Start with empty args and fill in below.)
ilastik_args = ilastik_main.parse_args([])
ilastik_args.new_project = new_project_path
ilastik_args.headless = True
ilastik_args.workflow = "Pixel Classification"
shell = ilastik_main.main(ilastik_args)
assert isinstance(shell.workflow, PixelClassificationWorkflow)
##
## CONFIGURE FILE PATHS
##
data_selection_applet = shell.workflow.dataSelectionApplet
input_infos = [FilesystemDatasetInfo(filePath=path) for path
in raw_data_paths]
opDataSelection = data_selection_applet.topLevelOperator
existing_lanes = len(opDataSelection.DatasetGroup)
opDataSelection.DatasetGroup.resize(max(len(input_infos), existing_lanes))
# Not sure if assuming role_index = 0 is allways valid
role_index = 0
for lane_index, info in enumerate(input_infos):
if info:
opDataSelection.DatasetGroup[lane_index][role_index].setValue(info)
##
## APPLY FEATURE MATRIX (from matrix above)
##
opFeatures = shell.workflow.featureSelectionApplet.topLevelOperator
opFeatures.Scales.setValue([float(s) for s in feature_selections.columns])
opFeatures.FeatureIds.setValue(list(feature_selections.index))
opFeatures.SelectionMatrix.setValue(feature_selections.values)
##
## CUSTOMIZE CLASSIFIER TYPE
##
opPixelClassification = shell.workflow.pcApplet.topLevelOperator
if classifier_factory is not None:
opPixelClassification.ClassifierFactory.setValue(classifier_factory)
##
## READ/APPLY LABEL VOLUMES
##
# Read each label volume and inject the label data into the appropriate training slot
cwd = os.getcwd()
max_label_class = 0
for lane, label_data_path in enumerate(label_data_paths):
graph = Graph()
opReader = OpInputDataReader(graph=graph)
try:
opReader.WorkingDirectory.setValue(cwd)
opReader.FilePath.setValue(label_data_path)
print("Reading label volume: {}".format(label_data_path))
label_volume = opReader.Output[:].wait()
finally:
opReader.cleanUp()
raw_shape = opPixelClassification.InputImages[lane].meta.shape
if label_volume.ndim != len(raw_shape):
# Append a singleton channel axis
assert label_volume.ndim == len(raw_shape) - 1
label_volume = label_volume[..., None]
# Auto-calculate the max label value
max_label_class = max(max_label_class, label_volume.max())
print("Applying label volume to lane #{}".format(lane))
entire_volume_slicing = roiToSlice(*roiFromShape(label_volume.shape))
opPixelClassification.LabelInputs[lane][entire_volume_slicing] = label_volume
assert max_label_class > 1, "Not enough label classes were found in your label data."
label_names = list(map(str, list(range(max_label_class))))
opPixelClassification.LabelNames.setValue(label_names)
##
## TRAIN CLASSIFIER
##
# Make sure the caches in the pipeline are not 'frozen'.
# (This is the equivalent of 'live update' mode in the GUI.)
opPixelClassification.FreezePredictions.setValue(False)
# Request the classifier object from the pipeline.
# This forces the pipeline to produce (train) the classifier.
_ = opPixelClassification.Classifier.value
##
## SAVE PROJECT
##
# save project file (includes the new classifier).
shell.projectManager.saveProject(force_all_save=False)
if __name__ == "__main__":
main()
|
$.do = {};
$.do.common = {};
$.do.config = {};
|
from django.utils.functional import Promise
from .couch import get_document_or_404
from .view_utils import reverse
def flatten_list(elements):
return [item for sublist in elements for item in sublist]
def flatten_non_iterable_list(elements):
# actually iterate over the list and ensure element to avoid conversion of strings to chars
# ['abc'] => ['a', 'b', 'c']
items = []
for element in elements:
if isinstance(element, list):
items.extend(flatten_non_iterable_list(element))
else:
items.append(element)
return items
def eval_lazy(value):
if isinstance(value, Promise):
value = value._proxy____cast()
return value
def cmp(a, b):
"""Comparison function for Python 3
https://stackoverflow.com/a/22490617/10840
"""
return (a > b) - (a < b)
|
/*
function diagonalDifference(a, b, c){
var mediaLtoR = a[0] + b[1] + c[2]
var mediaRtoL = a[2] + b[1] + c[0]
console.log(Math.abs(mediaLtoR - mediaRtoL))
}
diagonalDifference([11, 2, 4],[4, 5, 6],[10, 8, -12])
*/
// function diagonalDifference(matrix){
// const length = matrix.length
// let diagonal1 = 0,
// diagonal2 = 0
// for(var i = 0; i < length; i++){
// diagonal1 += matrix[i][i]
// diagonal2 += matrix[length -1 - i][i]
// }
// console.log(Math.abs(diagonal1 - diagonal2))
// }
// diagonalDifference([11, 2, 4],[4, 5, 6],[10, 8, -12])
function diagonalDifference(matrix) {
// length of input matrix.
const length = matrix.length;
let diagonal1 = 0, diagonal2 = 0;
// Looping through the array and summing the diagonals.
for(let i = 0; i < length; i++){
// Calculating the primary diagonal.
diagonal1 += matrix[i][i];
// Reversing the second dimension of array to calculate secondary diagonal.
diagonal2 += matrix[length -1 - i][i]
}
// return absolute difference value.
console.log(Math.abs(diagonal1 - diagonal2));
}
diagonalDifference([11, 2, 4],[4, 5, 6],[10, 8, -12])
|
import React from 'react';
import '../styles/grid-controller-page.css';
import GridControllerButton from './GridControllerButton';
// Since this component is simple and static, there's no parent container for it.
class GridControllerPanel extends React.Component {
constructor(props, context) {
super(props, context);
this.onButtonPress = this.onButtonPress.bind(this);
this.onButtonRelease = this.onButtonRelease.bind(this);
}
onButtonPress(index) {
this.props.buttonPress(index);
}
onButtonRelease(index) {
this.props.buttonRelease(index);
}
render() {
let rows = [];
for (let row_index = 0; row_index < 8; row_index++) {
let row = [];
for (let col_index = 0; col_index < 8; col_index++) {
let id = 8 * row_index + col_index + 1;
row.push((
<GridControllerButton
id={id}
key={id}
color={this.props.buttonsState[id].color}
onButtonPress={() => {
this.onButtonPress(id)
}}
onButtonRelease={() => {
this.onButtonRelease(id)
}}
label={id}
/>
));
}
rows.push((
<div key={row_index} className="button-row">
{row}
</div>
));
}
return (
<div className="button-grid">
{rows}
</div>
);
}
}
export default GridControllerPanel;
|
from debinterface import interfaces
from possum_common import *
class PossumNetwork(dbus.service.Object):
def __init__(self, bus_name):
dbus.service.Object.__init__(self, bus_name, '/network')
@dbus.service.method('possum.network')
@log_dbus_invoke
def echo_test(self, echo_dict):
for key in echo_dict:
print "\t\t", key, echo_dict[key]
return echo_dict
@dbus.service.method('possum.network')
@log_dbus_invoke
def get_ifaces(self):
# TODO: Get list of ifaces
print "Gonna return ifaces list"
res = []
# Export each interface adapter object to a dict
for iface in interfaces.Interfaces().adapters:
res.append(iface.export())
return dict2json(res)
@dbus.service.method('possum.network')
@log_dbus_invoke
def get_iface_info(self, iface_name):
# TODO: Get iface info
print "Gonna return iface info for", iface_name
return "lol"
# TODO: get info as jeson, dbus does not allow nested dict/lists
@dbus.service.method('possum.network')
@log_dbus_invoke
def set_iface_info(self, iface_info_dict):
print subprocess.check_output(strcmd.split())
return "Server Bus 1"
# interfaces = interfaces.Interfaces()
#
#
# interfaces.removeAdapterByName("eth0")
#
# opts = {}
# opts["name"] = "eth0"
# opts["allow-hotplug"] = True
# opts["address"] = "192.168.0.110"
# opts["netmask"] = "255.255.255.0"
# opts["source"] = "static"
# opts["addrFam"] = "inet"
# opts["gateway"] = "192.168.0.1"
# opts["dns-nameservers"] = "8.8.8.8"
#
#
# interfaces.addAdapter(opts, 0)
#
#
# adapters = interfaces.adapters
# for adapter in adapters:
# item = adapter.export()
# print(item)
# # print(adapter.display())
# # print adapter._ifAttributes
#
# interfaces.writeInterfaces()
# another possiuble candidate is
# https://github.com/rlisagor/pynetlinux
|
/**
* @fileoverview no variable named h
* @author yankang
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
var rule = require("../../../lib/rules/not-support-component"),
RuleTester = require("eslint").RuleTester;
//------------------------------------------------------------------------------
// Tests
//------------------------------------------------------------------------------
var ruleTester = new RuleTester({
parserOptions: {
sourceType: "module",
ecmaVersion: 6,
ecmaFeatures: {
jsx: true
}
},
});
ruleTester.run("not-support-component", rule, {
valid: [
"import {View} from 'react-native'",
"import {ToolbarAndroid} from 'h'"
],
invalid: [
{
code: "import {ToolbarAndroid} from 'react-native'",
errors: [{
messageId: "unexpectedImported",
data: {
name: "ToolbarAndroid"
}
}]
},
{
code: `const A = <ToolbarAndroid/>`,
errors: [{
messageId: "unexpectedUsed",
data: {
name: "ToolbarAndroid"
}
}]
}
]
});
|
import Observer from './Observer';
class Component extends Observer {
constructor(state, selector) {
super();
this.state = state;
this.stateData = state.getState();
this.selector = selector;
}
markup() {
return ``;
}
render() {
const markup = this.markup();
const target = document.getElementById(this.selector);
target.innerHTML = markup;
this.bindEvents();
}
update() {
this.render();
}
bindEvents() {}
}
export default Component;
|
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { createClassNames } from '../core/utils';
var cx = createClassNames('Hits');
var Hits = function Hits(_ref) {
var hits = _ref.hits,
className = _ref.className,
HitComponent = _ref.hitComponent;
return (
// Spread the hit on HitComponent instead of passing the full object. BC.
// ex: <HitComponent {...hit} key={hit.objectID} />
React.createElement(
'div',
{ className: classNames(cx(''), className) },
React.createElement(
'ul',
{ className: cx('list') },
hits.map(function (hit) {
return React.createElement(
'li',
{ className: cx('item'), key: hit.objectID },
React.createElement(HitComponent, { hit: hit })
);
})
)
)
);
};
Hits.propTypes = {
hits: PropTypes.arrayOf(PropTypes.object).isRequired,
className: PropTypes.string,
hitComponent: PropTypes.func
};
Hits.defaultProps = {
className: '',
hitComponent: function hitComponent(props) {
return React.createElement(
'div',
{
style: {
borderBottom: '1px solid #bbb',
paddingBottom: '5px',
marginBottom: '5px',
wordBreak: 'break-all'
}
},
JSON.stringify(props).slice(0, 100),
'...'
);
}
};
export default Hits; |
from solutions import square_circumference_and_area
import unittest
import random
class TestSquareCircumferenceAndArea(unittest.TestCase):
def test_1(self):
side = 1
expected = (4, 1)
actual = square_circumference_and_area(side)
self.assertEqual(expected, actual)
def test_random_int(self):
side = random.randint(0, 1000)
expected = (4 * side, side * side)
actual = square_circumference_and_area(side)
self.assertEqual(expected, actual)
def test_random_float(self):
side = random.random() * 1000 # random() returns a number from [0,1) which we multiply by 1000 to get a float from [0, 1000)
expected = (4 * side, side * side)
actual = square_circumference_and_area(side)
self.assertEqual(expected, actual)
if __name__ == '__main__':
unittest.main()
|
# import random
# def run_ransac(data, estimate, is_inlier, sample_size, goal_inliers, max_iterations, stop_at_goal=True):
# best_ic = 0
# best_model = None
# data = list(data)
# for i in range(max_iterations):
# s = random.sample(data, int(sample_size))
# m = estimate(s)
# ic = 0
# for j in range(len(data)):
# if is_inlier(m, data[j]):
# ic += 1
# if ic > best_ic:
# best_ic = ic
# best_model = m
# if ic > goal_inliers and stop_at_goal:
# break
# return best_model, best_ic
# def augment(xys):
# axy = np.ones((len(xys), 3))
# axy[:, :2] = xys
# return axy
# def estimate(xys):
# axy = augment(xys[:2])
# return np.linalg.svd(axy)[-1][-1, :]
# def is_inlier(coeffs, xy, threshold):
# return np.abs(coeffs.dot(augment([xy]).T)) < threshold
def ransac(image):
img = image.copy()
# import matplotlib
# import matplotlib.pyplot as plt
n = 100
max_iterations = 100
goal_inliers = n * 0.3
xys = np.random.random((n, 2)) * 10
xys[:50, 1:] = xys[:50, :1]
# plt.scatter(xys.T[0], xys.T[1])
m, b = run_ransac(xys, estimate, lambda x, y: is_inlier(
x, y, 0.01), goal_inliers, max_iterations, 20)
a, b, c = m
# plt.plot([0, 10], [-c/b, -(c+10*a)/b], color=(0, 1, 0))
# plt.show()
return rho, theta
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[99],{293:function(e,o,s){!function(e){"use strict";var o="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),s="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),a=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],n=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-us",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,a){return e?/-MMM-/.test(a)?s[e.month()]:o[e.month()]:o},monthsRegex:n,monthsShortRegex:n,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:a,longMonthsParse:a,shortMonthsParse:a,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:6}})}(s(257))}}]);
//# sourceMappingURL=calendar.99.ab8aca3c8d5cbc4d8ad2.js.map |
import KudosModel from '../models/kudos.model';
const kudosData = [
{
givenByUserId: 1,
receivedByUserId: 2,
comments: 'Good job on the last project! Thanks for the hard work.',
},
{
givenByUserId: 1,
receivedByUserId: 4,
comments: 'Handled the production issue very well last week.',
},
{
givenByUserId: 2,
receivedByUserId: 4,
comments: 'Great job.',
},
{
givenByUserId: 3,
receivedByUserId: 4,
},
{
givenByUserId: 4,
receivedByUserId: 1,
comments: 'Awesome coworker. Great mentor.',
},
{
givenByUserId: 6,
receivedByUserId: 9,
comments: 'Dedicated person.',
},
{
givenByUserId: 6,
receivedByUserId: 7,
},
{
givenByUserId: 6,
receivedByUserId: 8,
},
{
givenByUserId: 8,
receivedByUserId: 6,
},
{
givenByUserId: 9,
receivedByUserId: 6,
comments: 'Great coworker.',
},
];
const addKudosData = async () => {
await KudosModel.bulkCreate(kudosData);
};
export default addKudosData;
|
# Unit test check_input_predict
# ==============================================================================
import pytest
import numpy as np
import pandas as pd
from skforecast.utils import check_predict_input
def test_check_input_predict_exception_when_fitted_is_False():
'''
Test exception is raised when fitted is False.
'''
with pytest.raises(Exception):
check_predict_input(
steps = 5,
fitted = False,
included_exog = False,
index_type = None,
index_freq = None,
window_size = None,
last_window = None,
exog = None,
exog_type = None,
exog_col_names = None,
max_steps = None,
)
def test_check_input_predict_exception_when_steps_is_lower_than_1():
'''
Test exception is steps is a value lower than 1.
'''
with pytest.raises(Exception):
check_predict_input(
steps = -5,
fitted = True,
included_exog = False,
index_type = None,
index_freq = None,
window_size = None,
last_window = None,
exog = None,
exog_type = None,
exog_col_names = None,
max_steps = None,
)
def test_check_input_predict_exception_when_steps_is_greater_than_max_steps():
'''
'''
with pytest.raises(Exception):
check_predict_input(
steps = 20,
fitted = True,
included_exog = False,
index_type = None,
index_freq = None,
window_size = None,
last_window = None,
exog = None,
exog_type = None,
exog_col_names = None,
max_steps = 10,
)
def test_check_input_predict_exception_when_exog_is_not_none_and_included_exog_is_false():
'''
'''
with pytest.raises(Exception):
check_predict_input(
steps = 5,
fitted = True,
included_exog = False,
index_type = None,
index_freq = None,
window_size = None,
last_window = None,
exog = np.arange(10),
exog_type = None,
exog_col_names = None,
max_steps = None,
)
def test_check_input_predict_exception_when_exog_is_none_and_included_exog_is_true():
'''
'''
with pytest.raises(Exception):
check_predict_input(
steps = 5,
fitted = True,
included_exog = True,
index_type = None,
index_freq = None,
window_size = None,
last_window = None,
exog = None,
exog_type = None,
exog_col_names = None,
max_steps = None,
)
def test_check_input_predict_exception_when_len_exog_is_less_than_steps():
'''
'''
with pytest.raises(Exception):
check_predict_input(
steps = 10,
fitted = True,
included_exog = True,
index_type = None,
index_freq = None,
window_size = None,
last_window = None,
exog = np.arange(5),
exog_type = None,
exog_col_names = None,
max_steps = None,
)
def test_check_input_predict_exception_when_exog_is_not_pandas_series_or_dataframe():
'''
'''
with pytest.raises(Exception):
check_predict_input(
steps = 10,
fitted = True,
included_exog = True,
index_type = None,
index_freq = None,
window_size = 5,
last_window = None,
exog = np.arange(10),
exog_type = None,
exog_col_names = None,
max_steps = None,
)
def test_check_input_predict_exception_when_exog_has_missing_values():
'''
'''
with pytest.raises(Exception):
check_predict_input(
steps = 10,
fitted = True,
included_exog = True,
index_type = None,
index_freq = None,
window_size = 5,
last_window = None,
exog = pd.Series([1, 2, 3, np.nan]),
exog_type = None,
exog_col_names = None,
max_steps = None,
)
def test_check_input_predict_exception_when_exog_is_not_of_exog_type():
'''
'''
with pytest.raises(Exception):
check_predict_input(
steps = 10,
fitted = True,
included_exog = True,
index_type = None,
index_freq = None,
window_size = None,
last_window = None,
exog = np.arange(10),
exog_type = pd.Series,
exog_col_names = None,
max_steps = None,
)
def test_check_input_predict_exception_when_exog_is_dataframe_without_columns_in_exog_col_names():
'''
'''
with pytest.raises(Exception):
check_predict_input(
steps = 2,
fitted = True,
included_exog = True,
index_type = None,
index_freq = None,
window_size = None,
last_window = None,
exog = pd.DataFrame(np.arange(10).reshape(5,2), columns=['col1', 'col2']),
exog_type = pd.DataFrame,
exog_col_names = ['col1', 'col3'],
max_steps = None,
)
def test_check_input_predict_exception_when_exog_index_is_not_of_index_type():
'''
'''
with pytest.raises(Exception):
check_predict_input(
steps = 10,
fitted = True,
included_exog = True,
index_type = pd.DatetimeIndex,
index_freq = None,
window_size = None,
last_window = None,
exog = pd.Series(np.arange(10)),
exog_type = pd.Series,
exog_col_names = None,
max_steps = None,
)
def test_check_input_predict_exception_when_exog_index_frequency_is_not_index_freq():
'''
'''
with pytest.raises(Exception):
check_predict_input(
steps = 10,
fitted = True,
included_exog = True,
index_type = pd.DatetimeIndex,
index_freq = 'Y',
window_size = None,
last_window = None,
exog = pd.Series(np.arange(10), index=pd.date_range(start='1/1/2018', periods=10)),
exog_type = pd.Series,
exog_col_names = None,
max_steps = None,
)
def test_check_input_predict_exception_when_length_last_window_is_lower_than_window_size():
'''
'''
with pytest.raises(Exception):
check_predict_input(
steps = 10,
fitted = True,
included_exog = True,
index_type = pd.RangeIndex,
index_freq = None,
window_size = 10,
last_window = pd.Series(np.arange(5)),
exog = pd.Series(np.arange(10)),
exog_type = pd.Series,
exog_col_names = None,
max_steps = None,
)
def test_check_input_predict_exception_when_last_window_is_not_pandas_series():
'''
'''
with pytest.raises(Exception):
check_predict_input(
steps = 10,
fitted = True,
included_exog = True,
index_type = pd.RangeIndex,
index_freq = None,
window_size = 5,
last_window = np.arange(5),
exog = pd.Series(np.arange(10)),
exog_type = pd.Series,
exog_col_names = None,
max_steps = None,
)
def test_check_input_predict_exception_when_last_window_has_missing_values():
'''
'''
with pytest.raises(Exception):
check_predict_input(
steps = 10,
fitted = True,
included_exog = True,
index_type = pd.RangeIndex,
index_freq = None,
window_size = 5,
last_window = pd.Series([1, 2, 3, 4, 5, np.nan]),
exog = pd.Series(np.arange(10)),
exog_type = pd.Series,
exog_col_names = None,
max_steps = None,
) |
# Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
"""
This module provides a wrapper for Optax optimizers so that they can be used with
NumPyro inference algorithms.
"""
from typing import Tuple, TypeVar
import optax
from numpyro.optim import _NumPyroOptim
_Params = TypeVar("_Params")
_State = Tuple[_Params, optax.OptState]
def optax_to_numpyro(transformation: optax.GradientTransformation) -> _NumPyroOptim:
"""
This function produces a ``numpyro.optim._NumPyroOptim`` instance from an
``optax.GradientTransformation`` so that it can be used with
``numpyro.infer.svi.SVI``. It is a lightweight wrapper that recreates the
``(init_fn, update_fn, get_params_fn)`` interface defined by
:mod:`jax.example_libraries.optimizers`.
:param transformation: An ``optax.GradientTransformation`` instance to wrap.
:return: An instance of ``numpyro.optim._NumPyroOptim`` wrapping the supplied
Optax optimizer.
"""
def init_fn(params: _Params) -> _State:
opt_state = transformation.init(params)
return params, opt_state
def update_fn(step, grads: _Params, state: _State) -> _State:
params, opt_state = state
updates, opt_state = transformation.update(grads, opt_state, params)
updated_params = optax.apply_updates(params, updates)
return updated_params, opt_state
def get_params_fn(state: _State) -> _Params:
params, _ = state
return params
return _NumPyroOptim(lambda x, y, z: (x, y, z), init_fn, update_fn, get_params_fn)
|
'use strict';
import zaehlung from './birds.js'
let meinmarker;
let map = L.map('map').setView([52.4728, 13.404], 14.35);
let OpenStreetMap_DE = L.tileLayer('https://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png', {
maxZoom: 18,
attribution: '© <a href="https://www.openstreetmap.org/copyright ">OpenStreetMap</a> contributors'
}).addTo(map);
///// SET MARKERS /////
let marker1 = L.marker([52.46664960695899, 13.400390961321909]).addTo(map);
marker1.bindPopup("Aussichtsplattform ").openPopup();
let marker2 = L.marker([52.47405425600462, 13.41576773261861]).addTo(map);
marker2.bindPopup("Aussichtsplattform ").openPopup();
let marker3 = L.marker([52.472061562306195, 13.387803735400057]).addTo(map);
marker3.bindPopup("Aussichtsplattform ").openPopup();
///// LOCATE //////
function onLocationFound(e) {
// CUSTOM ICON //
const myCustomColour = 'white'
const markerHtmlStyles = `
background-color: ${myCustomColour};
width: 3rem;
height: 3rem;
display: block;
left: -1.5rem;
top: -1.8rem;
position: relative;
border-radius: 3rem 3rem 0;
transform: rotate(45deg);
border: 3px solid #FFFFFF`
const meinicon = L.divIcon({
className: "my-custom-pin",
iconAnchor: [0, 30],
labelAnchor: [-6, 0],
popupAnchor: [0, -20],
html: `<span style="${markerHtmlStyles}" />`
})
//
let radius = e.accuracy / 2;
let location = e.latlng
meinmarker = L.marker(location, {
draggable: true,
icon: meinicon,
});
meinmarker.bindPopup("<b>Hier bist du gerade</b><br>Wenn du die Vögel woanders gesichtet hast, verschiebe einfach den Marker.").openPopup();
meinmarker.addTo(map);
meinmarker.id = "standort";
let meincircle = L.circle(location, radius);
meincircle.addTo(map);
}
function onLocationError(e) {
alert(e.message);
}
function getLocationLeaflet() {
map.on('locationfound', onLocationFound);
map.on('locationerror', onLocationError);
map.locate({
setView: true,
maxZoom: 16
});
}
function init() {
console.log(zaehlung.birds)
document.querySelector('#btnaddbirds').addEventListener('click', getLocationLeaflet);
}
init()
//VOGELLISTE
let birdlist = document.createElement("div");
birdlist.id = "birdelements";
birdlist.innerHTML = "Welche Vögel siehst du?";
document.querySelector('#btnaddbirds').addEventListener
document.body.appendChild(birdlist);
//let indibird = document.createElement("div");
//indibird.innerHTML = zaehlung.birds.name[0];
//birdlist.appendChild(indibird);
/*
let removeauswahlButtons = document.getElementByClassName('.remove')
console.log(removeauswahlButtons)
for (let i = 0; i < removeauswahlButtons.length; i++)
let button = removeauswahlButtons[i]
button.addEventListener('click'),
function(event) {
let buttoClicked = event.target
buttonClicked.parentElement.parentElement.remove()
};
*/ |
import React, {Component, Fragment} from "react";
import { __ } from "../../layouts/utilities/i18n";
import { Button, ButtonGroup, Classes, Dialog, Intent } from "@blueprintjs/core";
import {withRouter} from "react-router";
import {compose} from "recompose";
import {Query, withApollo} from "react-apollo";
import gql from 'graphql-tag';
class EventParticipation extends Component
{
constructor(props)
{
super(props);
this.state = {
isOpen : false,
member_status: this.props.member_status
}
}
render()
{
console.log( this.props.time * 1000, Date.now() );
if(this.props.time * 1000 < Date.now())
{
return <div className="alert alert-warning request-event">
<div>
{__("Event archived")}
</div>
</div>
}
switch(this.state.member_status)
{
case 2:
return <div>
<div className="alert alert-warning request-event">
<div>
{__("you are invited")}
</div>
<div className="btn btn-warning btn-sm mt-5" onClick={this.onToggle}>
{__("Withdraw request")}
</div>
</div>
{this.getDialog()}
</div>
case 1:
return <div>
<div className="alert alert-warning request-event">
<div>
{__("your request is being processed")}
</div>
<div className="btn btn-warning btn-sm mt-5" onClick={this.onToggle}>
{__("Withdraw request")}
</div>
</div>
{this.getDialog()}
</div>
case 0:
default:
return <div>
<div className="btn btn-primary btn-lg add-event mt-4" onClick={this.onApply}>
{__("Apply for participation")}
</div>
</div>
}
}
onToggle =() =>
{
this.setState({ isOpen : !this.state.isOpen });
}
onWithdraw =() =>
{
//
const Withdraw_Request = gql`mutation Withdraw_Request ( $input: EventRequestInput )
{
Withdraw_Request(input : $input)
}`;
let pr = {};
pr.user = this.props.user.id;
pr.event = this.props.id;
this.props.client.mutate({
mutation: Withdraw_Request,
variables: {input:pr},
update: (store, { data: { Withdraw_Request } }) =>
{
console.log( Withdraw_Request );
this.setState({
isOpen : false,
member_status : Withdraw_Request ? 0 : this.state.member_status
});
}
});
}
onApply =() =>
{
const Apply_Request = gql`mutation Apply_Request ( $input: EventRequestInput )
{
Apply_Request(input : $input)
}`;
let pr = {};
pr.user = this.props.user.id;
pr.event = this.props.id;
this.props.client.mutate({
mutation: Apply_Request,
variables: {input:pr},
update: (store, { data: { Apply_Request } }) =>
{
console.log( Apply_Request );
this.setState({
isOpen : false,
member_status : Apply_Request ? 1 : this.state.member_status
});
}
});
}
getDialog()
{
return <Dialog
title={__("Withdraw request")}
isOpen={this.state.isOpen}
onClose={this.onToggle}
>
<div className="p-4">
<ButtonGroup>
<Button intent={Intent.SUCCESS} onClick={this.onWithdraw}>
{__("Withdraw request")}
</Button>
<Button intent={Intent.DANGER} onClick={this.onToggle}>
{__("Cancel")}
</Button>
</ButtonGroup>
</div>
</Dialog>;
}
}
export default compose(
withApollo
)(EventParticipation); |
function hideTabsContent(tabs, contents) {
for (let i = 0; i < tabs.length; i += 1) {
tabs[i].classList.remove('form-choice-button-selected');
}
for (let i = 0; i < contents.length; i += 1) {
contents[i].classList.remove('show');
contents[i].classList.add('hide');
}
}
function showTabContent(tabNumber, tabs, contents) {
if (contents[tabNumber].classList.contains('hide') || !contents[tabNumber].classList.contains('show')) {
hideTabsContent(tabs, contents);
tabs[tabNumber].classList.add('form-choice-button-selected');
contents[tabNumber].classList.remove('hide');
contents[tabNumber].classList.add('show');
}
}
window.onload = () => {
const signForms = document.getElementsByClassName('sign-form');
const signTabs = document.getElementsByClassName('form-choice-button');
showTabContent(0, signTabs, signForms);
};
document.getElementById('sign-choice').onclick = (event) => {
const { target } = event;
if (target.className === 'form-choice-button') {
const signForms = document.getElementsByClassName('sign-form');
const signTabs = document.getElementsByClassName('form-choice-button');
for (let i = 0; i < signTabs.length; i += 1) {
if (target === signTabs[i]) {
showTabContent(i, signTabs, signForms);
}
}
const resultText = document.getElementById('resultText');
if (!resultText.classList.contains('hide')) {
resultText.classList.add('hide');
}
}
};
|
// usage: run from http://localhost:8080/admin/test
// TODO: turn this script into a proper integration test and move it outside of the app
var followModel = require('../../../models/follow.js');
exports.makeTests = function (p) {
var testVars = {};
return [
[
'fetchUserSubscriptions',
function fetchSubscriptions(cb) {
//console.time("fetchUserSubscriptions");
followModel.fetchUserSubscriptions(p.loggedUser.id, function (
subscriptions
) {
testVars.uidList = [p.loggedUser.id];
for (let i in subscriptions.subscriptions)
if (subscriptions.subscriptions[i].id)
testVars.uidList.push(
('' + subscriptions.subscriptions[i].id).replace('/u/', '')
);
//console.timeEnd("fetchUserSubscriptions");
cb(true);
});
},
],
[
'fetchSubscriptionArray == fetchUserSubscriptions',
function fetchSubscriptions(cb) {
//console.time("fetchSubscriptionArray");
followModel.fetchSubscriptionArray(p.loggedUser.id, function (
subscriptions
) {
subscriptions.push(p.loggedUser.id);
//console.timeEnd("fetchSubscriptionArray");
cb(subscriptions.sort().join() === testVars.uidList.sort().join());
});
},
],
];
};
|
/*! jQuery v2.2.4 | (c) jQuery Foundation | jquery.org/license */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="2.2.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isPlainObject:function(a){var b;if("object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype||{},"isPrototypeOf"))return!1;for(b in a);return void 0===b||k.call(a,b)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=d.createElement("script"),b.text=a,d.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:h.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(d=e.call(arguments,2),f=function(){return a.apply(b||this,d.concat(e.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=la(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=ma(b);function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=R.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q," ")}),h=h.slice(c.length));for(g in d.filter)!(e=W[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return h.call(b,a)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?void 0!==c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?h.call(n(a),this[0]):h.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||n.uniqueSort(e),D.test(a)&&e.reverse()),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.removeEventListener("DOMContentLoaded",J),a.removeEventListener("load",J),n.ready()}n.ready.promise=function(b){return I||(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(n.ready):(d.addEventListener("DOMContentLoaded",J),a.addEventListener("load",J))),I.promise(b)},n.ready.promise();var K=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)K(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},L=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function M(){this.expando=n.expando+M.uid++}M.uid=1,M.prototype={register:function(a,b){var c=b||{};return a.nodeType?a[this.expando]=c:Object.defineProperty(a,this.expando,{value:c,writable:!0,configurable:!0}),a[this.expando]},cache:function(a){if(!L(a))return{};var b=a[this.expando];return b||(b={},L(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[b]=c;else for(d in b)e[d]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=a[this.expando];if(void 0!==f){if(void 0===b)this.register(a);else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in f?d=[b,e]:(d=e,d=d in f?[d]:d.match(G)||[])),c=d.length;while(c--)delete f[d[c]]}(void 0===b||n.isEmptyObject(f))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!n.isEmptyObject(b)}};var N=new M,O=new M,P=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function R(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Q,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:P.test(c)?n.parseJSON(c):c;
}catch(e){}O.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return O.hasData(a)||N.hasData(a)},data:function(a,b,c){return O.access(a,b,c)},removeData:function(a,b){O.remove(a,b)},_data:function(a,b,c){return N.access(a,b,c)},_removeData:function(a,b){N.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=O.get(f),1===f.nodeType&&!N.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),R(f,d,e[d])));N.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){O.set(this,a)}):K(this,function(b){var c,d;if(f&&void 0===b){if(c=O.get(f,a)||O.get(f,a.replace(Q,"-$&").toLowerCase()),void 0!==c)return c;if(d=n.camelCase(a),c=O.get(f,d),void 0!==c)return c;if(c=R(f,d,void 0),void 0!==c)return c}else d=n.camelCase(a),this.each(function(){var c=O.get(this,d);O.set(this,d,b),a.indexOf("-")>-1&&void 0!==c&&O.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){O.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=N.get(a,b),c&&(!d||n.isArray(c)?d=N.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return N.get(a,c)||N.access(a,c,{empty:n.Callbacks("once memory").add(function(){N.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=N.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),U=["Top","Right","Bottom","Left"],V=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function W(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&T.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var X=/^(?:checkbox|radio)$/i,Y=/<([\w:-]+)/,Z=/^$|\/(?:java|ecma)script/i,$={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};$.optgroup=$.option,$.tbody=$.tfoot=$.colgroup=$.caption=$.thead,$.th=$.td;function _(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function aa(a,b){for(var c=0,d=a.length;d>c;c++)N.set(a[c],"globalEval",!b||N.get(b[c],"globalEval"))}var ba=/<|&#?\w+;/;function ca(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],o=0,p=a.length;p>o;o++)if(f=a[o],f||0===f)if("object"===n.type(f))n.merge(m,f.nodeType?[f]:f);else if(ba.test(f)){g=g||l.appendChild(b.createElement("div")),h=(Y.exec(f)||["",""])[1].toLowerCase(),i=$[h]||$._default,g.innerHTML=i[1]+n.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;n.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",o=0;while(f=m[o++])if(d&&n.inArray(f,d)>-1)e&&e.push(f);else if(j=n.contains(f.ownerDocument,f),g=_(l.appendChild(f),"script"),j&&aa(g),c){k=0;while(f=g[k++])Z.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var da=/^key/,ea=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,fa=/^([^.]*)(?:\.(.+)|)/;function ga(){return!0}function ha(){return!1}function ia(){try{return d.activeElement}catch(a){}}function ja(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ja(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ha;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return"undefined"!=typeof n&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(G)||[""],j=b.length;while(j--)h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.hasData(a)&&N.get(a);if(r&&(i=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&N.remove(a,"handle events")}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(N.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,e,f,g=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||d,e=c.documentElement,f=c.body,a.pageX=b.clientX+(e&&e.scrollLeft||f&&f.scrollLeft||0)-(e&&e.clientLeft||f&&f.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||f&&f.scrollTop||0)-(e&&e.clientTop||f&&f.clientTop||0)),a.which||void 0===g||(a.which=1&g?1:2&g?3:4&g?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,e,f=a.type,g=a,h=this.fixHooks[f];h||(this.fixHooks[f]=h=ea.test(f)?this.mouseHooks:da.test(f)?this.keyHooks:{}),e=h.props?this.props.concat(h.props):this.props,a=new n.Event(g),b=e.length;while(b--)c=e[b],a[c]=g[c];return a.target||(a.target=d),3===a.target.nodeType&&(a.target=a.target.parentNode),h.filter?h.filter(a,g):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==ia()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===ia()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ga:ha):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={constructor:n.Event,isDefaultPrevented:ha,isPropagationStopped:ha,isImmediatePropagationStopped:ha,isSimulated:!1,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ga,a&&!this.isSimulated&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ga,a&&!this.isSimulated&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ga,a&&!this.isSimulated&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||n.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),n.fn.extend({on:function(a,b,c,d){return ja(this,a,b,c,d)},one:function(a,b,c,d){return ja(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=ha),this.each(function(){n.event.remove(this,a,c,b)})}});var ka=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,la=/<script|<style|<link/i,ma=/checked\s*(?:[^=]|=\s*.checked.)/i,na=/^true\/(.*)/,oa=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function pa(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function qa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function ra(a){var b=na.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function sa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(N.hasData(a)&&(f=N.access(a),g=N.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}O.hasData(a)&&(h=O.access(a),i=n.extend({},h),O.set(b,i))}}function ta(a,b){var c=b.nodeName.toLowerCase();"input"===c&&X.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function ua(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&ma.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),ua(f,b,c,d)});if(o&&(e=ca(b,a[0].ownerDocument,!1,a,d),g=e.firstChild,1===e.childNodes.length&&(e=g),g||d)){for(h=n.map(_(e,"script"),qa),i=h.length;o>m;m++)j=e,m!==p&&(j=n.clone(j,!0,!0),i&&n.merge(h,_(j,"script"))),c.call(a[m],j,m);if(i)for(k=h[h.length-1].ownerDocument,n.map(h,ra),m=0;i>m;m++)j=h[m],Z.test(j.type||"")&&!N.access(j,"globalEval")&&n.contains(k,j)&&(j.src?n._evalUrl&&n._evalUrl(j.src):n.globalEval(j.textContent.replace(oa,"")))}return a}function va(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(_(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&aa(_(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(ka,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=_(h),f=_(a),d=0,e=f.length;e>d;d++)ta(f[d],g[d]);if(b)if(c)for(f=f||_(a),g=g||_(h),d=0,e=f.length;e>d;d++)sa(f[d],g[d]);else sa(a,h);return g=_(h,"script"),g.length>0&&aa(g,!i&&_(a,"script")),h},cleanData:function(a){for(var b,c,d,e=n.event.special,f=0;void 0!==(c=a[f]);f++)if(L(c)){if(b=c[N.expando]){if(b.events)for(d in b.events)e[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);c[N.expando]=void 0}c[O.expando]&&(c[O.expando]=void 0)}}}),n.fn.extend({domManip:ua,detach:function(a){return va(this,a,!0)},remove:function(a){return va(this,a)},text:function(a){return K(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.appendChild(a)}})},prepend:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(_(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return K(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!la.test(a)&&!$[(Y.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(_(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return ua(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(_(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),f=e.length-1,h=0;f>=h;h++)c=h===f?this:this.clone(!0),n(e[h])[b](c),g.apply(d,c.get());return this.pushStack(d)}});var wa,xa={HTML:"block",BODY:"block"};function ya(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function za(a){var b=d,c=xa[a];return c||(c=ya(a,b),"none"!==c&&c||(wa=(wa||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=wa[0].contentDocument,b.write(),b.close(),c=ya(a,b),wa.detach()),xa[a]=c),c}var Aa=/^margin/,Ba=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ca=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)},Da=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e},Ea=d.documentElement;!function(){var b,c,e,f,g=d.createElement("div"),h=d.createElement("div");if(h.style){h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===h.style.backgroundClip,g.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",g.appendChild(h);function i(){h.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",h.innerHTML="",Ea.appendChild(g);var d=a.getComputedStyle(h);b="1%"!==d.top,f="2px"===d.marginLeft,c="4px"===d.width,h.style.marginRight="50%",e="4px"===d.marginRight,Ea.removeChild(g)}n.extend(l,{pixelPosition:function(){return i(),b},boxSizingReliable:function(){return null==c&&i(),c},pixelMarginRight:function(){return null==c&&i(),e},reliableMarginLeft:function(){return null==c&&i(),f},reliableMarginRight:function(){var b,c=h.appendChild(d.createElement("div"));return c.style.cssText=h.style.cssText="-webkit-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",h.style.width="1px",Ea.appendChild(g),b=!parseFloat(a.getComputedStyle(c).marginRight),Ea.removeChild(g),h.removeChild(c),b}})}}();function Fa(a,b,c){var d,e,f,g,h=a.style;return c=c||Ca(a),g=c?c.getPropertyValue(b)||c[b]:void 0,""!==g&&void 0!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),c&&!l.pixelMarginRight()&&Ba.test(g)&&Aa.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f),void 0!==g?g+"":g}function Ga(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Ha=/^(none|table(?!-c[ea]).+)/,Ia={position:"absolute",visibility:"hidden",display:"block"},Ja={letterSpacing:"0",fontWeight:"400"},Ka=["Webkit","O","Moz","ms"],La=d.createElement("div").style;function Ma(a){if(a in La)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ka.length;while(c--)if(a=Ka[c]+b,a in La)return a}function Na(a,b,c){var d=T.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Oa(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+U[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+U[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+U[f]+"Width",!0,e))):(g+=n.css(a,"padding"+U[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+U[f]+"Width",!0,e)));return g}function Pa(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ca(a),g="border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Fa(a,b,f),(0>e||null==e)&&(e=a.style[b]),Ba.test(e))return e;d=g&&(l.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Oa(a,b,c||(g?"border":"content"),d,f)+"px"}function Qa(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=N.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&V(d)&&(f[g]=N.access(d,"olddisplay",za(d.nodeName)))):(e=V(d),"none"===c&&e||N.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Fa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Ma(h)||h),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=T.exec(c))&&e[1]&&(c=W(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(n.cssNumber[h]?"":"px")),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Ma(h)||h),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Fa(a,b,d)),"normal"===e&&b in Ja&&(e=Ja[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?Ha.test(n.css(a,"display"))&&0===a.offsetWidth?Da(a,Ia,function(){return Pa(a,b,d)}):Pa(a,b,d):void 0},set:function(a,c,d){var e,f=d&&Ca(a),g=d&&Oa(a,b,d,"border-box"===n.css(a,"boxSizing",!1,f),f);return g&&(e=T.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=n.css(a,b)),Na(a,c,g)}}}),n.cssHooks.marginLeft=Ga(l.reliableMarginLeft,function(a,b){return b?(parseFloat(Fa(a,"marginLeft"))||a.getBoundingClientRect().left-Da(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px":void 0}),n.cssHooks.marginRight=Ga(l.reliableMarginRight,function(a,b){return b?Da(a,{display:"inline-block"},Fa,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+U[d]+b]=f[d]||f[d-2]||f[0];return e}},Aa.test(a)||(n.cssHooks[a+b].set=Na)}),n.fn.extend({css:function(a,b){return K(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ca(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Qa(this,!0)},hide:function(){return Qa(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){V(this)?n(this).show():n(this).hide()})}});function Ra(a,b,c,d,e){return new Ra.prototype.init(a,b,c,d,e)}n.Tween=Ra,Ra.prototype={constructor:Ra,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Ra.propHooks[this.prop];return a&&a.get?a.get(this):Ra.propHooks._default.get(this)},run:function(a){var b,c=Ra.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ra.propHooks._default.set(this),this}},Ra.prototype.init.prototype=Ra.prototype,Ra.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},Ra.propHooks.scrollTop=Ra.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},n.fx=Ra.prototype.init,n.fx.step={};var Sa,Ta,Ua=/^(?:toggle|show|hide)$/,Va=/queueHooks$/;function Wa(){return a.setTimeout(function(){Sa=void 0}),Sa=n.now()}function Xa(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=U[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ya(a,b,c){for(var d,e=(_a.tweeners[b]||[]).concat(_a.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Za(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&V(a),q=N.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?N.get(a,"olddisplay")||za(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Ua.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?za(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=N.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;N.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ya(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function $a(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function _a(a,b,c){var d,e,f=0,g=_a.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Sa||Wa(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:Sa||Wa(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for($a(k,j.opts.specialEasing);g>f;f++)if(d=_a.prefilters[f].call(j,a,k,j.opts))return n.isFunction(d.stop)&&(n._queueHooks(j.elem,j.opts.queue).stop=n.proxy(d.stop,d)),d;return n.map(k,Ya,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(_a,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return W(c.elem,a,T.exec(b),c),c}]},tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.match(G);for(var c,d=0,e=a.length;e>d;d++)c=a[d],_a.tweeners[c]=_a.tweeners[c]||[],_a.tweeners[c].unshift(b)},prefilters:[Za],prefilter:function(a,b){b?_a.prefilters.unshift(a):_a.prefilters.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,null!=d.queue&&d.queue!==!0||(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(V).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=_a(this,n.extend({},a),f);(e||N.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=N.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Va.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=N.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Xa(b,!0),a,d,e)}}),n.each({slideDown:Xa("show"),slideUp:Xa("hide"),slideToggle:Xa("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(Sa=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),Sa=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Ta||(Ta=a.setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){a.clearInterval(Ta),Ta=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(b,c){return b=n.fx?n.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",l.checkOn=""!==a.value,l.optSelected=c.selected,b.disabled=!0,l.optDisabled=!c.disabled,a=d.createElement("input"),a.value="t",a.type="radio",l.radioValue="t"===a.value}();var ab,bb=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return K(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?ab:void 0)),void 0!==c?null===c?void n.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(G);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)}}),ab={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=bb[b]||n.find.attr;bb[b]=function(a,b,d){var e,f;return d||(f=bb[b],bb[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,bb[b]=f),e}});var cb=/^(?:input|select|textarea|button)$/i,db=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return K(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b,e=n.propHooks[b]),
void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):cb.test(a.nodeName)||db.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var eb=/[\t\r\n\f]/g;function fb(a){return a.getAttribute&&a.getAttribute("class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,fb(this)))});if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,fb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,fb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=fb(this),b&&N.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":N.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+fb(c)+" ").replace(eb," ").indexOf(b)>-1)return!0;return!1}});var gb=/\r/g,hb=/[\x20\t\r\n\f]+/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(gb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a)).replace(hb," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-core"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&(l.optDisabled?!c.disabled:null===c.getAttribute("disabled"))&&(!c.parentNode.disabled||!n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(n.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var ib=/^(?:focusinfocus|focusoutblur)$/;n.extend(n.event,{trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!ib.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),l=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},f||!o.trigger||o.trigger.apply(e,c)!==!1)){if(!f&&!o.noBubble&&!n.isWindow(e)){for(j=o.delegateType||q,ib.test(j+q)||(h=h.parentNode);h;h=h.parentNode)p.push(h),i=h;i===(e.ownerDocument||d)&&p.push(i.defaultView||i.parentWindow||a)}g=0;while((h=p[g++])&&!b.isPropagationStopped())b.type=g>1?j:o.bindType||q,m=(N.get(h,"events")||{})[b.type]&&N.get(h,"handle"),m&&m.apply(h,c),m=l&&h[l],m&&m.apply&&L(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=q,f||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!L(e)||l&&n.isFunction(e[q])&&!n.isWindow(e)&&(i=e[l],i&&(e[l]=null),n.event.triggered=q,e[q](),n.event.triggered=void 0,i&&(e[l]=i)),b.result}},simulate:function(a,b,c){var d=n.extend(new n.Event,c,{type:a,isSimulated:!0});n.event.trigger(d,null,b)}}),n.fn.extend({trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),l.focusin="onfocusin"in a,l.focusin||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a))};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=N.access(d,b);e||d.addEventListener(a,c,!0),N.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=N.access(d,b)-1;e?N.access(d,b,e):(d.removeEventListener(a,c,!0),N.remove(d,b))}}});var jb=a.location,kb=n.now(),lb=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var mb=/#.*$/,nb=/([?&])_=[^&]*/,ob=/^(.*?):[ \t]*([^\r\n]*)$/gm,pb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,qb=/^(?:GET|HEAD)$/,rb=/^\/\//,sb={},tb={},ub="*/".concat("*"),vb=d.createElement("a");vb.href=jb.href;function wb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(G)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function xb(a,b,c,d){var e={},f=a===tb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function yb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function zb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Ab(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:jb.href,type:"GET",isLocal:pb.test(jb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":ub,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?yb(yb(a,n.ajaxSettings),b):yb(n.ajaxSettings,a)},ajaxPrefilter:wb(sb),ajaxTransport:wb(tb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m=n.ajaxSetup({},c),o=m.context||m,p=m.context&&(o.nodeType||o.jquery)?n(o):n.event,q=n.Deferred(),r=n.Callbacks("once memory"),s=m.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,getResponseHeader:function(a){var b;if(2===v){if(!h){h={};while(b=ob.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===v?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return v||(a=u[c]=u[c]||a,t[a]=b),this},overrideMimeType:function(a){return v||(m.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>v)for(b in a)s[b]=[s[b],a[b]];else x.always(a[x.status]);return this},abort:function(a){var b=a||w;return e&&e.abort(b),z(0,b),this}};if(q.promise(x).complete=r.add,x.success=x.done,x.error=x.fail,m.url=((b||m.url||jb.href)+"").replace(mb,"").replace(rb,jb.protocol+"//"),m.type=c.method||c.type||m.method||m.type,m.dataTypes=n.trim(m.dataType||"*").toLowerCase().match(G)||[""],null==m.crossDomain){j=d.createElement("a");try{j.href=m.url,j.href=j.href,m.crossDomain=vb.protocol+"//"+vb.host!=j.protocol+"//"+j.host}catch(y){m.crossDomain=!0}}if(m.data&&m.processData&&"string"!=typeof m.data&&(m.data=n.param(m.data,m.traditional)),xb(sb,m,c,x),2===v)return x;k=n.event&&m.global,k&&0===n.active++&&n.event.trigger("ajaxStart"),m.type=m.type.toUpperCase(),m.hasContent=!qb.test(m.type),f=m.url,m.hasContent||(m.data&&(f=m.url+=(lb.test(f)?"&":"?")+m.data,delete m.data),m.cache===!1&&(m.url=nb.test(f)?f.replace(nb,"$1_="+kb++):f+(lb.test(f)?"&":"?")+"_="+kb++)),m.ifModified&&(n.lastModified[f]&&x.setRequestHeader("If-Modified-Since",n.lastModified[f]),n.etag[f]&&x.setRequestHeader("If-None-Match",n.etag[f])),(m.data&&m.hasContent&&m.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",m.contentType),x.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+("*"!==m.dataTypes[0]?", "+ub+"; q=0.01":""):m.accepts["*"]);for(l in m.headers)x.setRequestHeader(l,m.headers[l]);if(m.beforeSend&&(m.beforeSend.call(o,x,m)===!1||2===v))return x.abort();w="abort";for(l in{success:1,error:1,complete:1})x[l](m[l]);if(e=xb(tb,m,c,x)){if(x.readyState=1,k&&p.trigger("ajaxSend",[x,m]),2===v)return x;m.async&&m.timeout>0&&(i=a.setTimeout(function(){x.abort("timeout")},m.timeout));try{v=1,e.send(t,z)}catch(y){if(!(2>v))throw y;z(-1,y)}}else z(-1,"No Transport");function z(b,c,d,h){var j,l,t,u,w,y=c;2!==v&&(v=2,i&&a.clearTimeout(i),e=void 0,g=h||"",x.readyState=b>0?4:0,j=b>=200&&300>b||304===b,d&&(u=zb(m,x,d)),u=Ab(m,u,x,j),j?(m.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(n.lastModified[f]=w),w=x.getResponseHeader("etag"),w&&(n.etag[f]=w)),204===b||"HEAD"===m.type?y="nocontent":304===b?y="notmodified":(y=u.state,l=u.data,t=u.error,j=!t)):(t=y,!b&&y||(y="error",0>b&&(b=0))),x.status=b,x.statusText=(c||y)+"",j?q.resolveWith(o,[l,y,x]):q.rejectWith(o,[x,y,t]),x.statusCode(s),s=void 0,k&&p.trigger(j?"ajaxSuccess":"ajaxError",[x,m,j?l:t]),r.fireWith(o,[x,y]),k&&(p.trigger("ajaxComplete",[x,m]),--n.active||n.event.trigger("ajaxStop")))}return x},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return!n.expr.filters.visible(a)},n.expr.filters.visible=function(a){return a.offsetWidth>0||a.offsetHeight>0||a.getClientRects().length>0};var Bb=/%20/g,Cb=/\[\]$/,Db=/\r?\n/g,Eb=/^(?:submit|button|image|reset|file)$/i,Fb=/^(?:input|select|textarea|keygen)/i;function Gb(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||Cb.test(a)?d(a,e):Gb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Gb(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Gb(c,a[c],b,e);return d.join("&").replace(Bb,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Fb.test(this.nodeName)&&!Eb.test(a)&&(this.checked||!X.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(Db,"\r\n")}}):{name:b.name,value:c.replace(Db,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Hb={0:200,1223:204},Ib=n.ajaxSettings.xhr();l.cors=!!Ib&&"withCredentials"in Ib,l.ajax=Ib=!!Ib,n.ajaxTransport(function(b){var c,d;return l.cors||Ib&&!b.crossDomain?{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Hb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=n("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Jb=[],Kb=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Jb.pop()||n.expando+"_"+kb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Kb.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Kb.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Kb,"$1"+e):b.jsonp!==!1&&(b.url+=(lb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Jb.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||d;var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ca([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var Lb=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Lb)return Lb.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};function Mb(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,n.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(e=d.getBoundingClientRect(),c=Mb(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Ea})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;n.fn[a]=function(d){return K(this,function(a,d,e){var f=Mb(a);return void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Ga(l.pixelPosition,function(a,c){return c?(c=Fa(a,b),Ba.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return K(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)},size:function(){return this.length}}),n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Nb=a.jQuery,Ob=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Ob),b&&a.jQuery===n&&(a.jQuery=Nb),n},b||(a.jQuery=a.$=n),n});
|
document.addEventListener("DOMContentLoaded", () => {
const SwalModal = (icon, title, html) => {
Swal.fire({
icon,
title,
html,
});
};
const SwalConfirm = (
icon,
title,
html,
confirmButtonText,
method,
params,
callback
) => {
Swal.fire({
icon,
title,
html,
showCancelButton: true,
confirmButtonColor: "#3085d6",
cancelButtonColor: "#d33",
confirmButtonText,
reverseButtons: true,
}).then((result) => {
console.log(method, params, callback);
if (result.value) {
if (params) {
return livewire.emit(method, params);
} else {
return livewire.emit(method);
}
}
if (callback) {
return livewire.emit(callback);
}
});
};
const SwalAlert = (icon, title, timeout = 7000) => {
const Toast = Swal.mixin({
toast: true,
position: "top-end",
showConfirmButton: false,
timer: timeout,
onOpen: (toast) => {
toast.addEventListener("mouseenter", Swal.stopTimer);
toast.addEventListener("mouseleave", Swal.resumeTimer);
},
});
Toast.fire({
icon,
title,
});
};
this.livewire.on("swal:modal", (data) => {
SwalModal(data.icon, data.title, data.text);
});
this.livewire.on("swal:confirm", (data) => {
SwalConfirm(
data.icon,
data.title,
data.text,
data.confirmText,
data.method,
data.params,
data.callback
);
});
this.livewire.on(
"swal:confirm-message",
(message, method, params = "", callback = "") => {
SwalConfirm(
"warning",
message,
"",
"Yes",
method,
params,
callback
);
}
);
Livewire.on("swal:deleteconfirm", (method, params = "", callback = "") => {
SwalConfirm(
"warning",
"Do you want to delete this?",
"You won't be able to revert this!",
"Yes, delete!",
method,
params,
callback
);
});
this.livewire.on("swal:alert", (data) => {
SwalAlert(data.icon, data.title, data.timeout);
});
this.livewire.on("modal:show", (modalId) => {
$(modalId).modal("show");
});
});
|
var base58 = require('./base58');
var Crypto = require('./crypto-js/crypto');
var conv = require('./convert');
var address_types = {
prod: 0,
testnet: 111
};
var p2sh_types = {
prod: 5,
testnet: 196
};
var Address = function (bytes) {
if (typeof bytes === 'string') {
bytes = Address.decodeString(bytes);
}
this.hash = bytes;
this.version = 0x00;
};
/**
* Serialize this object as a standard Bitcoin address.
*
* Returns the address as a base58-encoded string in the standardized format.
*/
Address.prototype.toString = function () {
// Get a copy of the hash
var hash = this.hash.slice(0);
// Version
hash.unshift(this.version);
var checksum = Crypto.SHA256(Crypto.SHA256(hash, {asBytes: true}), {asBytes: true});
var bytes = hash.concat(checksum.slice(0,4));
return base58.encode(bytes);
};
Address.prototype.getHashBase64 = function () {
return conv.bytesToBase64(this.hash);
};
// TODO(shtylman) isValid?
Address.validate = function(string, type) {
try {
var bytes = base58.decode(string);
} catch (e) {
return false;
}
var hash = bytes.slice(0, 21);
var checksum = Crypto.SHA256(Crypto.SHA256(hash, {asBytes: true}), {asBytes: true});
if (checksum[0] != bytes[21] ||
checksum[1] != bytes[22] ||
checksum[2] != bytes[23] ||
checksum[3] != bytes[24]) {
return false;
}
var version = hash[0];
if (type && version !== address_types[type] && version !== p2sh_types[type]) {
return false;
}
return true;
};
/**
* Parse a Bitcoin address contained in a string.
*/
Address.decodeString = function (string) {
var bytes = base58.decode(string);
var hash = bytes.slice(0, 21);
var checksum = Crypto.SHA256(Crypto.SHA256(hash, {asBytes: true}), {asBytes: true});
if (checksum[0] != bytes[21] ||
checksum[1] != bytes[22] ||
checksum[2] != bytes[23] ||
checksum[3] != bytes[24]) {
throw new Error('Address Checksum validation failed: ' + string);
}
var version = hash.shift();
// TODO(shtylman) allow for specific version decoding same as validate above
if (version != 0) {
throw new Error('Address version not supported: ' + string);
}
return hash;
};
module.exports = Address;
|
from __future__ import annotations
import multiprocessing as mp
import multiprocessing.synchronize
import threading
from contextlib import contextmanager
from functools import partial
from typing import Dict, List, Optional, Tuple
from pathlib import Path
import torch
from multiaddr import Multiaddr
import hivemind
from hivemind.dht import DHT
from hivemind.moe.server.expert_uid import UID_DELIMITER, generate_uids_from_pattern
from hivemind.moe.server.checkpoints import CheckpointSaver, load_experts, is_directory
from hivemind.moe.server.connection_handler import ConnectionHandler
from hivemind.moe.server.dht_handler import DHTHandlerThread, declare_experts, get_experts
from hivemind.moe.server.expert_backend import ExpertBackend
from hivemind.moe.server.layers import name_to_block, name_to_input, register_expert_class
from hivemind.moe.server.layers import add_custom_models_from_file, schedule_name_to_scheduler
from hivemind.moe.server.runtime import Runtime
from hivemind.utils import Endpoint, get_port, replace_port, find_open_port, get_logger, BatchTensorDescriptor
from hivemind.proto.runtime_pb2 import CompressionType
logger = get_logger(__name__)
class Server(threading.Thread):
"""
Server allows you to host "experts" - pytorch sub-networks used by Decentralized Mixture of Experts.
After creation, a server should be started: see Server.run or Server.run_in_background.
A working server does 3 things:
- processes incoming forward/backward requests via Runtime (created by the server)
- publishes updates to expert status every :update_period: seconds
- follows orders from HivemindController - if it exists
:type dht: DHT or None. Server with dht=None will NOT be visible from DHT,
but it will still support accessing experts directly with RemoteExpert(uid=UID, endpoint="IPADDR:PORT").
:param expert_backends: dict{expert uid (str) : ExpertBackend} for all expert hosted by this server.
:param listen_on: server's dht address that determines how it can be accessed. Address and (optional) port
:param num_connection_handlers: maximum number of simultaneous requests. Please note that the default value of 1
if too small for normal functioning, we recommend 4 handlers per expert backend.
:param update_period: how often will server attempt to publish its state (i.e. experts) to the DHT;
if dht is None, this parameter is ignored.
:param start: if True, the server will immediately start as a background thread and returns control after server
is ready (see .ready below)
"""
def __init__(
self,
dht: Optional[DHT],
expert_backends: Dict[str, ExpertBackend],
listen_on: Endpoint = "0.0.0.0:*",
num_connection_handlers: int = 1,
update_period: int = 30,
start=False,
checkpoint_dir=None,
**kwargs,
):
super().__init__()
self.dht, self.experts, self.update_period = dht, expert_backends, update_period
if get_port(listen_on) is None:
listen_on = replace_port(listen_on, new_port=find_open_port())
self.listen_on, self.port = listen_on, get_port(listen_on)
self.conn_handlers = [ConnectionHandler(listen_on, self.experts) for _ in range(num_connection_handlers)]
if checkpoint_dir is not None:
self.checkpoint_saver = CheckpointSaver(expert_backends, checkpoint_dir, update_period)
else:
self.checkpoint_saver = None
self.runtime = Runtime(self.experts, **kwargs)
if self.dht and self.experts:
self.dht_handler_thread = DHTHandlerThread(
experts=self.experts,
dht=self.dht,
endpoint=self.listen_on,
update_period=self.update_period,
daemon=True,
)
if start:
self.run_in_background(await_ready=True)
@classmethod
def create(
cls,
listen_on="0.0.0.0:*",
num_experts: int = None,
expert_uids: str = None,
expert_pattern: str = None,
expert_cls="ffn",
hidden_dim=1024,
optim_cls=torch.optim.Adam,
scheduler: str = "none",
num_warmup_steps=None,
num_total_steps=None,
clip_grad_norm=None,
num_handlers=None,
min_batch_size=1,
max_batch_size=4096,
device=None,
no_dht=False,
initial_peers=(),
checkpoint_dir: Optional[Path] = None,
compression=CompressionType.NONE,
stats_report_interval: Optional[int] = None,
custom_module_path=None,
*,
start: bool,
) -> Server:
"""
Instantiate a server with several identical experts. See argparse comments below for details
:param listen_on: network interface with address and (optional) port, e.g. "127.0.0.1:1337" or "[::]:80"
:param num_experts: run this many identical experts
:param expert_pattern: a string pattern or a list of expert uids, example: myprefix.[0:32].[0:256]\
means "sample random experts between myprefix.0.0 and myprefix.255.255;
:param expert_uids: spawn experts with these exact uids, overrides num_experts and expert_pattern
:param expert_cls: expert type from hivemind.moe.server.layers, e.g. 'ffn' or 'transformer';
:param hidden_dim: main dimension for expert_cls
:param num_handlers: server will use this many parallel processes to handle incoming requests
:param min_batch_size: total num examples in the same batch will be greater than this value
:param max_batch_size: total num examples in the same batch will not exceed this value
:param device: all experts will use this device in torch notation; default: cuda if available else cpu
:param optim_cls: uses this optimizer to train all experts
:param scheduler: if not `none`, the name of the expert LR scheduler
:param num_warmup_steps: the number of warmup steps for LR schedule
:param num_total_steps: the total number of steps for LR schedule
:param clip_grad_norm: maximum gradient norm used for clipping
:param no_dht: if specified, the server will not be attached to a dht
:param initial_peers: multiaddrs of one or more active DHT peers (if you want to join an existing DHT)
:param checkpoint_dir: directory to save and load expert checkpoints
:param compression: if specified, use this compression to pack all inputs, outputs and gradients by all experts
hosted on this server. For a more fine-grained compression, start server in python and specify compression
for each BatchTensorProto in ExpertBackend for the respective experts.
:param start: if True, starts server right away and returns when server is ready for requests
:param stats_report_interval: interval between two reports of batch processing performance statistics
"""
if custom_module_path is not None:
add_custom_models_from_file(custom_module_path)
assert expert_cls in name_to_block
if no_dht:
dht = None
else:
dht = hivemind.DHT(initial_peers=initial_peers, start=True)
visible_maddrs_str = [str(a) for a in dht.get_visible_maddrs()]
logger.info(f"Running DHT node on {visible_maddrs_str}, initial peers = {initial_peers}")
assert (expert_pattern is None and num_experts is None and expert_uids is not None) or (
num_experts is not None and expert_uids is None
), "Please provide either expert_uids *or* num_experts (possibly with expert_pattern), but not both"
if expert_uids is None:
if checkpoint_dir is not None:
assert is_directory(checkpoint_dir)
expert_uids = [
child.name for child in checkpoint_dir.iterdir() if (child / "checkpoint_last.pt").exists()
]
total_experts_in_checkpoint = len(expert_uids)
logger.info(f"Located {total_experts_in_checkpoint} checkpoints for experts {expert_uids}")
if total_experts_in_checkpoint > num_experts:
raise ValueError(
f"Found {total_experts_in_checkpoint} checkpoints, but num_experts is set to {num_experts}, "
f"which is smaller. Either increase num_experts or remove unneeded checkpoints."
)
else:
expert_uids = []
uids_to_generate = num_experts - len(expert_uids)
if uids_to_generate > 0:
logger.info(f"Generating {uids_to_generate} expert uids from pattern {expert_pattern}")
expert_uids.extend(generate_uids_from_pattern(uids_to_generate, expert_pattern, dht))
num_experts = len(expert_uids)
num_handlers = num_handlers if num_handlers is not None else num_experts * 8
optim_cls = optim_cls if optim_cls is not None else partial(torch.optim.SGD, lr=0.0)
device = device or ("cuda" if torch.cuda.is_available() else "cpu")
sample_input = name_to_input[expert_cls](3, hidden_dim)
if isinstance(sample_input, tuple):
args_schema = tuple(BatchTensorDescriptor.from_tensor(arg, compression) for arg in sample_input)
else:
args_schema = (BatchTensorDescriptor.from_tensor(sample_input, compression),)
scheduler = schedule_name_to_scheduler[scheduler]
# initialize experts
experts = {}
for expert_uid in expert_uids:
expert = name_to_block[expert_cls](hidden_dim)
experts[expert_uid] = hivemind.ExpertBackend(
name=expert_uid,
expert=expert,
args_schema=args_schema,
optimizer=optim_cls(expert.parameters()),
scheduler=scheduler,
num_warmup_steps=num_warmup_steps,
num_total_steps=num_total_steps,
clip_grad_norm=clip_grad_norm,
min_batch_size=min_batch_size,
max_batch_size=max_batch_size,
)
if checkpoint_dir is not None:
load_experts(experts, checkpoint_dir)
return cls(
dht,
experts,
listen_on=listen_on,
num_connection_handlers=num_handlers,
device=device,
checkpoint_dir=checkpoint_dir,
stats_report_interval=stats_report_interval,
start=start,
)
def run(self):
"""
Starts Server in the current thread. Initializes dht if necessary, starts connection handlers,
runs Runtime (self.runtime) to process incoming requests.
"""
logger.info(f"Server started at {self.listen_on}")
logger.info(f"Got {len(self.experts)} experts:")
for expert_name, backend in self.experts.items():
num_parameters = sum(p.numel() for p in backend.expert.parameters() if p.requires_grad)
logger.info(f"{expert_name}: {backend.expert.__class__.__name__}, {num_parameters} parameters")
if self.dht:
if not self.dht.is_alive():
self.dht.run_in_background(await_ready=True)
if self.experts:
self.dht_handler_thread.start()
if self.checkpoint_saver is not None:
self.checkpoint_saver.start()
for process in self.conn_handlers:
if not process.is_alive():
process.start()
process.ready.wait()
try:
self.runtime.run()
finally:
self.shutdown()
def run_in_background(self, await_ready=True, timeout=None):
"""
Starts Server in a background thread. if await_ready, this method will wait until background server
is ready to process incoming requests or for :timeout: seconds max.
"""
self.start()
if await_ready and not self.ready.wait(timeout=timeout):
raise TimeoutError("Server didn't notify .ready in {timeout} seconds")
@property
def ready(self) -> mp.synchronize.Event:
"""
An event (multiprocessing.Event) that is set when the server is ready to process requests.
Example
=======
>>> server.start()
>>> server.ready.wait(timeout=10)
>>> print("Server ready" if server.ready.is_set() else "Server didn't start in 10 seconds")
"""
return self.runtime.ready # mp.Event that is true if self is ready to process batches
def shutdown(self):
"""
Gracefully terminate the server, process-safe.
Please note that terminating server otherwise (e.g. by killing processes) may result in zombie processes.
If you did already cause a zombie outbreak, your only option is to kill them with -9 (SIGKILL).
"""
self.ready.clear()
for process in self.conn_handlers:
process.terminate()
process.join()
logger.debug("Connection handlers terminated")
if self.dht and self.experts:
self.dht_handler_thread.stop.set()
self.dht_handler_thread.join()
if self.checkpoint_saver is not None:
self.checkpoint_saver.stop.set()
self.checkpoint_saver.join()
if self.dht is not None:
self.dht.shutdown()
self.dht.join()
logger.debug(f"Shutting down runtime")
self.runtime.shutdown()
logger.info("Server shutdown succesfully")
@contextmanager
def background_server(*args, shutdown_timeout=5, **kwargs) -> Tuple[hivemind.Endpoint, List[Multiaddr]]:
"""A context manager that creates server in a background thread, awaits .ready on entry and shutdowns on exit"""
pipe, runners_pipe = mp.Pipe(duplex=True)
runner = mp.Process(target=_server_runner, args=(runners_pipe, *args), kwargs=kwargs)
try:
runner.start()
# once the server is ready, runner will send us
# either (False, exception) or (True, (server.listen_on, dht_maddrs))
start_ok, data = pipe.recv()
if start_ok:
yield data
pipe.send("SHUTDOWN") # on exit from context, send shutdown signal
else:
raise RuntimeError(f"Server failed to start: {data}")
finally:
runner.join(timeout=shutdown_timeout)
if runner.is_alive():
logger.info("Server failed to shutdown gracefully, terminating it the hard way...")
runner.kill()
logger.info("Server terminated.")
def _server_runner(pipe, *args, **kwargs):
try:
server = Server.create(*args, start=True, **kwargs)
except Exception as e:
logger.exception(f"Encountered an exception when starting a server: {e}")
pipe.send((False, f"{type(e).__name__} {e}"))
return
try:
dht_maddrs = server.dht.get_visible_maddrs() if server.dht is not None else None
pipe.send((True, (server.listen_on, dht_maddrs)))
pipe.recv() # wait for shutdown signal
finally:
logger.info("Shutting down server...")
server.shutdown()
server.join()
logger.info("Server shut down.")
|
const CustomError = require("../extensions/custom-error");
module.exports = function getSeason(date) {
if (!date){
return 'Unable to determine the time of year!';
} else if (date.toDateString() == "Invalid Date"){
throw Error;
}
let month = date.getMonth()
if (month == 0 || month == 1 || month == 11){
return "winter";
} else if (month == 2 || month == 3 || month == 4){
return "spring";
} else if (month == 5 || month == 6 || month == 7){
return "summer";
} else {
return "fall";
}
};
|
const CustomError = require("../extensions/custom-error");
module.exports = function repeater(str, options) {
str = String(str);
let addiction = String(options.addition);
let additionSeparator = options.additionSeparator ? options.additionSeparator : "|";
let separator = options.separator ? options.separator : "+";
let additionRepeatTimes = options.additionRepeatTimes ? options.additionRepeatTimes : 1;
let repeatTimes = options.repeatTimes ? options.repeatTimes : 1;
let res = [];
let addictionRes = [];
if (options.hasOwnProperty("addition")) {
for (let i = 0; i < additionRepeatTimes; i += 1) {
addictionRes.push(addiction);
}
for (let i = 0; i < repeatTimes; i += 1) {
res.push(`${str + addictionRes.join(additionSeparator)}`);
}
}
else {
for (let i = 0; i < repeatTimes; i += 1) {
res.push(str);
}
}
return res.join(`${separator}`)
}
|
from django import forms
from .models import GuitareModel
class GuitareForm(forms.ModelForm):
class Meta:
model = GuitareModel
fields = '__all__'
widgets = {
'nom_guitare': forms.TextInput(attrs={'class': 'form-control'}),
'type_guitare': forms.Select(attrs={'class': 'form-control'}),
'description_guitare': forms.Textarea(attrs={'class': 'form-control', 'rows': 4}),
'prix_guitare': forms.NumberInput(attrs={'class': 'form-control'}),
'photo_guitare': forms.ClearableFileInput(attrs={'class': 'custom-file'}),
'user_guitare': forms.Select(attrs={'class': 'custom-file'}),
}
labels = {
'nom_guitare': "Nom de la guitare",
'type_guitare': "Type de la guitare",
'description_guitare': "Description",
'prix_guitare': "Prix",
'photo_guitare': "Photo de la guitare",
'user_guitare': "Déteneur",
}
|
"""SQLAlchemy models and database architecture"""
from flask_sqlalchemy import SQLAlchemy
DB = SQLAlchemy()
# Creates a 'user' Table
class User(DB.Model):
# id primary key column for 'user'
id = DB.Column(DB.BigInteger, primary_key=True)
# username column for 'user'
username = DB.Column(DB.String, nullable=False)
# stores most recent tweet_id
newest_tweet_id = DB.Column(DB.BigInteger)
def __repr__(self):
return f"<User: {self.username}>"
# Creates a 'tweet' Table
class Tweet(DB.Model):
# id primary key column for 'tweet'
id = DB.Column(DB.BigInteger, primary_key=True)
# text column for 'tweet'
text = DB.Column(DB.Unicode(300))
# stores numbers that represents tweets
vect = DB.Column(DB.PickleType, nullable=False)
# user_id foreign key column for 'tweet'
user_id = DB.Column(DB.BigInteger, DB.ForeignKey(
'user.id'), nullable=False)
### TODO: STRETCH GOAL ###
user = DB.relationship('User', backref=DB.backref('tweets', lazy=True))
def __repr__(self):
return f"<Tweet: {self.text}>" |
'use strict';
const {
Model
} = require('sequelize');
module.exports = (sequelize, DataTypes) => {
class Product extends Model {
/**
* Helper method for defining associations.
* This method is not a part of Sequelize lifecycle.
* The `models/index` file will call this method automatically.
*/
static associate(models) {
// define association here
}
};
Product.init({
name: DataTypes.STRING,
description: DataTypes.STRING,
price: DataTypes.INTEGER
}, {
sequelize,
modelName: 'Product',
});
return Product;
}; |
const request = require('supertest')
const app = require('../config/app')
describe('CORS Middleware', () => {
test('Should enable CORS', async () => {
app.get('/test_cors', (req, res) => { res.send('') })
const res = await request(app).get('/test_cors')
expect(res.headers['access-control-allow-origin']).toBe('*')
expect(res.headers['access-control-allow-methods']).toBe('*')
expect(res.headers['access-control-allow-headers']).toBe('*')
})
})
|
#!/usr/bin/env python
import rospy
from std_msgs.msg import String
import sensor_msgs.msg
import csv
f = open('imu_data.csv', mode='w')
writer = csv.writer(f,delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
writer.writerow(['date','x','y','z','w'])
lastsec = 0
def callback(d):
global writer
global lastsec
if lastsec < d.header.stamp.secs:
thisquat = [d.header.stamp.secs, d.orientation.x, d.orientation.y, d.orientation.z, d.orientation.w]
writer.writerow(thisquat)
print(thisquat)
lastsec = d.header.stamp.secs
def listener():
rospy.init_node('imutest', anonymous=True)
rospy.Subscriber("imu/data", sensor_msgs.msg.Imu, callback)
rospy.spin()
if __name__ == '__main__':
listener()
|
/**
* Copyright(c) Microsoft Corporation.All rights reserved.
* Licensed under the MIT License.
*/
class LabelExampleResponse {
/**
* @property {string} UtteranceText
*/
/**
* @property {integer} ExampleId
*/
constructor({UtteranceText /* string */,ExampleId /* integer */} = {}) {
Object.assign(this, {UtteranceText /* string */,ExampleId /* integer */});
}
}
LabelExampleResponse.fromJSON = function(source) {
if (!source) {
return null;
}
if (Array.isArray(source)) {
return source.map(LabelExampleResponse.fromJSON);
}
const {UtteranceText /* string */,ExampleId /* integer */} = source;
return new LabelExampleResponse({UtteranceText /* string */,ExampleId /* integer */});
};
module.exports = LabelExampleResponse;
|
import os
import argparse
import json
import datetime
from google.cloud import pubsub_v1
import tkinter as tk
import tkinter.ttk as ttk
class GcpGui(tk.Frame):
"""Basic Message Visualizer gui"""
def __init__(self, project_id, subscription_id, master=None):
tk.Frame.__init__(self, master)
self.pack()
info_frame = tk.Frame(master)
info_frame.pack(fill='x', side='top')
info_frame.columnconfigure(1, weight=1)
tk.Label(info_frame, text='Project').grid(row=0)
tk.Label(info_frame, text='Registry').grid(row=1)
tk.Label(info_frame, text='Region').grid(row=2)
self.project = tk.StringVar()
project = tk.Entry(info_frame, width=50, textvariable=self.project)
project.grid(row=0, column=1, sticky=tk.E+tk.W)
self.registry = tk.StringVar()
registry = tk.Entry(info_frame, width=50, textvariable=self.registry)
registry.grid(row=1, column=1, sticky=tk.E+tk.W)
self.region = tk.StringVar()
region = tk.Entry(info_frame, width=50, textvariable=self.region)
region.grid(row=2, column=1, sticky=tk.E+tk.W)
data_frame = tk.Frame(master)
data_frame.pack(fill='both', side='bottom', expand=1)
self.tree = ttk.Treeview(data_frame, selectmode='browse')
self.tree.pack(side='left', fill='both', expand=1)
vsb = ttk.Scrollbar(data_frame, orient='vertical', command=self.tree.yview)
vsb.pack(side='right', fill='y')
self.tree.configure(yscrollcommand=vsb.set)
self.subscriber = pubsub_v1.SubscriberClient()
self.subscription_path = self.subscriber.subscription_path(project_id, subscription_id)
self.subscriber.subscribe(self.subscription_path, callback=self.subscription_callback)
def subscription_callback(self, message):
"""Receive messages from the subscription"""
data = json.loads(message.data)
self.project.set(message.attributes['projectId'])
self.registry.set(message.attributes['deviceRegistryId'])
self.region.set(message.attributes['deviceRegistryLocation'])
sample_values = [message.attributes['deviceId']] + \
['{}: {}'.format(k, v) for k, v in data.items() if k != 'timestamp']
"""sample_time = datetime.datetime.fromtimestamp(data['timestamp'])"""
sample_time = datetime.datetime.now()
self.tree.configure(columns=['' for _ in range(len(sample_values))])
self.tree.insert('', 'end', text=sample_time, values=sample_values)
self.tree.yview_moveto(1)
message.ack()
def gcp_gui(project_id, subscription_id):
"""Create a window with the visualizer gui"""
root = tk.Tk()
root.wm_title('Microchip GCP Example')
app = GcpGui(project_id, subscription_id, master=root)
app.mainloop()
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='GCP Example Gui')
parser.add_argument('subscription', help='Topic Subscription')
parser.add_argument('--creds', help='Credential Json File')
args = parser.parse_args()
if args.creds is not None:
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = args.creds
with open(os.environ["GOOGLE_APPLICATION_CREDENTIALS"]) as f:
credentials = json.load(f)
project = credentials['project_id']
gcp_gui(project, args.subscription) |
import time
import torch
import torch.nn as nn
from torch.utils.data import DataLoader, Dataset
class fbnet(nn.Module):
def __init__(self, in_channels, hidden_channels, output_channels):
super().__init__()
self.fc = nn.Sequential(nn.Linear(in_channels, hidden_channels),
nn.ReLU(),
# nn.Dropout(),
# nn.Linear(hidden_channels, hidden_channels),
# nn.ReLU(),
# nn.Dropout(),
nn.Linear(hidden_channels, output_channels),
nn.LogSoftmax(dim=1))
def forward(self, x):
return self.fc(x)
class fbdataset(Dataset):
def __init__(self, xs, ys):
self.xs = xs
self.ys = ys
assert len(self.xs) == len(self.ys)
def __getitem__(self, index):
return torch.FloatTensor(self.xs[index]), self.ys[index]
def __len__(self):
return len(self.xs)
def encode(num, digits=10):
return [num >> i & 1 for i in range(digits)][::-1]
def labelnum(num):
if (num % 3 == 0) and (num % 5 == 0):
return 3
if num % 5 == 0:
return 2
if num % 3 == 0:
return 1
return 0
model = fbnet(10, 1000, 4)
# model = model.cuda(0)
criterion = nn.NLLLoss()
optimizer = torch.optim.Adam(model.parameters(), lr=0.01)
training_range = range(101, 2**10)
trainx = [encode(i) for i in training_range]
trainy = [labelnum(i) for i in training_range]
traindataset = fbdataset(trainx, trainy)
trainloader = DataLoader(traindataset,
shuffle=True,
batch_size=128)
testing_range = range(1, 101)
testx = [encode(i) for i in testing_range]
testy = [labelnum(i) for i in testing_range]
testdataset = fbdataset(testx, testy)
testloader = DataLoader(testdataset,
batch_size=32)
for n in range(500):
model.train()
for data in trainloader:
optimizer.zero_grad()
datax, datay = data
# datax = datax.cuda(0)
# datay = datay.cuda(0)
out = model(datax)
loss = criterion(out, datay)
loss.backward()
optimizer.step()
model.eval()
equality = 0
with torch.no_grad():
for data in testloader:
datax, datay = data
# datax = datax.cuda(0)
# datay = datay.cuda(0)
out = model(datax)
probs = torch.exp(out)
pred = torch.argmax(probs, axis=1)
equality += (pred == datay).sum()
if n%10 == 0:
print('epoch %s ... ' %n)
acc = equality.cpu().numpy()/len(testdataset)
print('acc on test dataset ... %.f%%' %(acc*100))
|
const Engine = Matter.Engine;
const World = Matter.World;
const Bodies = Matter.Bodies;
const Constraint = Matter.Constraint;
var engine, world, backgroundImg;
var canvas, angle, tower, ground, cannon;
var CannonBall;
function preload() {
backgroundImg = loadImage("./assets/background.gif");
towerImage = loadImage("./assets/tower.png");
}
function setup() {
canvas = createCanvas(1200,600);
engine = Engine.create();
world = engine.world;
angleMode(DEGREES);
angle = 15;
ground = Bodies.rectangle(0,height - 1,width * 2,1, { isStatic: true});
World.add(world, ground);
tower = Bodies.rectangle(160,350,160,310, { isStatic: true});
World.add(world, tower);
cannon = new cannon(180,110,130,100,angle);
cannonBall = new cannonBall(cannon.x, cannon.y);
}
function draw() {
background(189);
image(backgroundImg, 0, 0, width, height);
Engine.update(engine);
push();
fill("brown");
rectMode(CENTER);
rect(ground.position.x, ground.position.y, width * 2, 1);
pop();
push();
imageMode(CENTER);
image(towerImage, tower.position.x, tower.position.y, 160, 310);
pop();
cannon.display();
cannonBall.display();
}
function keyReleased() {
if (keyCode === DOWN_ARROW) {
canonBall.shoot();
}
} |
import pymysql
import datetime
# data-share
db_dataShare = pymysql.connect("127.0.0.1", "root", "123456")
# 获取游标
dataShare_cursor = db_dataShare.cursor()
# 循环日期
start = '2018-12-25'
end = '2019-05-17'
date_start = datetime.datetime.strptime(start, '%Y-%m-%d')
date_end = datetime.datetime.strptime(end, '%Y-%m-%d')
# 循环处理数据
while date_start <= date_end:
day_date = date_start.strftime('%Y%m%d')
date_start += datetime.timedelta(1)
# 业务sql
sql = "INSERT INTO data_share.message_check_result (" \
" business_type, " \
" business_id, " \
" expanded, " \
" send_status, " \
" modify_time, " \
" create_time " \
" ) " \
" SELECT " \
" 19," \
" crd.crd_id," \
" '%s'," \
" 0," \
" NOW()," \
" NOW()" \
" FROM " \
" `jd-java`.clear_result_detail_%s crd" \
" LEFT JOIN data_share.message_record mr" \
" ON mr.business_id = crd.crd_id" \
" AND mr.business_type = 19" \
" WHERE mr.business_id IS NULL and" \
" crd.crd_clear_pay_status = 2 and crd.crd_red_pay_status = 2 " % (day_date, day_date)
# test sql
# sql = "insert into mybatis.user(userName, age) " \
# "select business_id, %s from lanhuigu.message_record"
dataShare_cursor.execute(sql)
effective_count = dataShare_cursor.rowcount
print("dayDate:", day_date, "effectiveCount:", effective_count)
# 每跑一天数据提交一次事务
db_dataShare.commit()
# 关闭游标
dataShare_cursor.close()
# 关闭连接
db_dataShare.close()
|
// @flow
//
// Copyright (c) 2019-present, GM Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.
import React, { useCallback } from "react";
import styled from "styled-components";
import { CommonPointSettings, CommonDecaySettings, type TopicSettingsEditorProps } from ".";
import { SLabel, SInput } from "./common";
import ColorPicker from "webviz-core/src/components/ColorPicker";
import Flex from "webviz-core/src/components/Flex";
import GradientPicker from "webviz-core/src/components/GradientPicker";
import Radio from "webviz-core/src/components/Radio";
import SegmentedControl from "webviz-core/src/components/SegmentedControl";
import { Select, Option } from "webviz-core/src/components/Select";
import type { PointCloud2 } from "webviz-core/src/types/Messages";
export type ColorMode =
| {| mode: "rgb" |}
| {| mode: "flat", flatColor: string |}
| {|
mode: "gradient",
colorField: string,
minColor: string,
maxColor: string,
minValue?: number,
maxValue?: number,
|}
| {|
mode: "rainbow",
colorField: string,
minValue?: number,
maxValue?: number,
|};
export const DEFAULT_FLAT_COLOR = "#ffffff";
export type PointCloudSettings = {|
pointSize?: ?number,
pointShape?: ?string,
decayTime?: ?number,
colorMode: ?ColorMode,
|};
const SValueRangeInput = styled(SInput).attrs({ type: "number", placeholder: "auto" })`
width: 0px;
margin-left: 8px;
flex: 1 1 auto;
`;
const RainbowText = React.memo(function RainbowText({ children: text }: { children: string }) {
const result = [];
for (let i = 0; i < text.length; i++) {
result.push(
// Rainbow gradient goes from magenta (300) to red (0)
<span key={i} style={{ color: `hsl(${300 - 300 * (i / (text.length - 1))}, 100%, 60%)` }}>
{text[i]}
</span>
);
}
return result;
});
export default function PointCloudSettingsEditor(props: TopicSettingsEditorProps<PointCloud2, PointCloudSettings>) {
const { message, settings = {}, onFieldChange, onSettingsChange } = props;
const onColorModeChange = useCallback(
(newValue: ?ColorMode | ((?ColorMode) => ?ColorMode)) => {
onSettingsChange((settings) => ({
...settings,
colorMode: typeof newValue === "function" ? newValue(settings.colorMode) : newValue,
}));
},
[onSettingsChange]
);
const hasRGB = message && message.fields && message.fields.some(({ name }) => name === "rgb");
const defaultColorField = message && message.fields && message.fields.find(({ name }) => name !== "rgb")?.name;
const colorMode: ColorMode = settings.colorMode
? settings.colorMode
: hasRGB
? { mode: "rgb" }
: { mode: "flat", flatColor: DEFAULT_FLAT_COLOR };
return (
<Flex col>
<CommonPointSettings settings={settings} defaultPointSize={2} onFieldChange={onFieldChange} />
<CommonDecaySettings settings={settings} onFieldChange={onFieldChange} />
<SLabel>Color by</SLabel>
<Flex row style={{ justifyContent: "space-between", marginBottom: "8px" }}>
<SegmentedControl
selectedId={colorMode.mode === "flat" ? "flat" : "data"}
onChange={(id) =>
onColorModeChange((colorMode) =>
id === "flat"
? {
mode: "flat",
flatColor: colorMode && colorMode.mode === "gradient" ? colorMode.minColor : DEFAULT_FLAT_COLOR,
}
: hasRGB
? { mode: "rgb" }
: defaultColorField
? { mode: "rainbow", colorField: defaultColorField }
: null
)
}
options={[{ id: "flat", label: "Flat" }, { id: "data", label: "Point data" }]}
/>
<Flex row style={{ margin: "2px 0 2px 12px", alignItems: "center" }}>
{colorMode.mode === "flat" ? (
// For flat mode, pick a single color
<ColorPicker
color={colorMode.flatColor}
onChange={(flatColor) => onColorModeChange({ mode: "flat", flatColor })}
/>
) : (
// Otherwise, choose a field from the point cloud to color by
<Select
text={colorMode.mode === "rgb" ? "rgb" : colorMode.colorField}
value={colorMode.mode === "rgb" ? "rgb" : colorMode.colorField}
onChange={(value) =>
onColorModeChange(
(colorMode): ColorMode => {
if (value === "rgb") {
return { mode: "rgb" };
}
if (colorMode && colorMode.mode === "gradient") {
return { ...colorMode, colorField: value };
}
if (colorMode && colorMode.mode === "rainbow") {
return { ...colorMode, colorField: value };
}
return { mode: "rainbow", colorField: value };
}
)
}>
{!message
? []
: message.fields.map(({ name }) => (
<Option key={name} value={name}>
{name}
</Option>
))}
</Select>
)}
</Flex>
</Flex>
{(colorMode.mode === "gradient" || colorMode.mode === "rainbow") && (
<Flex col style={{ marginBottom: "8px" }}>
<SLabel>Value range</SLabel>
<Flex row style={{ marginLeft: "8px" }}>
<Flex row style={{ flex: "1 1 100%", alignItems: "baseline", marginRight: "20px" }}>
Min
<SValueRangeInput
value={colorMode.minValue ?? ""}
onChange={({ target: { value } }) =>
onColorModeChange((colorMode: any) => ({
...colorMode,
minValue: value === "" ? null : value,
}))
}
/>
</Flex>
<Flex row style={{ flex: "1 1 100%", alignItems: "baseline" }}>
Max
<SValueRangeInput
value={colorMode.maxValue ?? ""}
onChange={({ target: { value } }) =>
onColorModeChange((colorMode: any) => ({
...colorMode,
maxValue: value === "" ? null : +value,
}))
}
/>
</Flex>
</Flex>
<Radio
selectedId={colorMode.mode}
onChange={(id) =>
onColorModeChange(({ colorField, minValue, maxValue }: any) =>
id === "rainbow"
? { mode: "rainbow", colorField, minValue, maxValue }
: { mode: "gradient", colorField, minValue, maxValue, minColor: "#0000ff", maxColor: "#ff0000" }
)
}
options={[
{
id: "rainbow",
label: colorMode.mode === "rainbow" ? <RainbowText>Rainbow</RainbowText> : "Rainbow",
},
{ id: "gradient", label: "Custom gradient" },
]}
/>
</Flex>
)}
{colorMode.mode === "gradient" && (
<div style={{ margin: "8px" }}>
<GradientPicker
minColor={colorMode.minColor}
maxColor={colorMode.maxColor}
onChange={({ minColor, maxColor }) =>
onColorModeChange((colorMode) => ({ mode: "gradient", ...colorMode, minColor, maxColor }))
}
/>
</div>
)}
</Flex>
);
}
|
/* eslint prefer-arrow-callback:0 */
import { Meteor } from "meteor/meteor";
import { expect } from "meteor/practicalmeteor:chai";
import { sinon } from "meteor/practicalmeteor:sinon";
import { ExampleApi, RISKY_TEST_CARD } from "./exampleapi";
const paymentMethod = {
processor: "Generic",
storedCard: "Visa 4242",
paymentPackageId: "vrXutd72c2m7Lenqw",
paymentSettingsKey: "example-paymentmethod",
status: "captured",
mode: "authorize",
createdAt: new Date()
};
describe("ExampleApi", function () {
let sandbox;
beforeEach(function () {
sandbox = sinon.sandbox.create();
});
afterEach(function () {
sandbox.restore();
});
it("should return data from ThirdPartyAPI authorize", function () {
const cardData = {
name: "Test User",
number: "4242424242424242",
expireMonth: "2",
expireYear: "2018",
cvv2: "123",
type: "visa"
};
const paymentData = {
currency: "USD",
total: "19.99"
};
const transactionType = "authorize";
const transaction = ExampleApi.methods.authorize.call({
transactionType,
cardData,
paymentData
});
expect(transaction).to.not.be.undefined;
});
it("should return risk status for flagged test card", function () {
const cardData = {
name: "Test User",
number: RISKY_TEST_CARD,
expireMonth: "2",
expireYear: "2018",
cvv2: "123",
type: "visa"
};
const paymentData = {
currency: "USD",
total: "19.99"
};
const transactionType = "authorize";
const transaction = ExampleApi.methods.authorize.call({
transactionType,
cardData,
paymentData
});
expect(transaction.riskStatus).to.be.defined;
});
it("should return data from ThirdPartAPI capture", function (done) {
const authorizationId = "abc123";
const amount = 19.99;
const results = ExampleApi.methods.capture.call({
authorizationId,
amount
});
expect(results).to.not.be.undefined;
done();
});
});
describe("Submit payment", function () {
let sandbox;
beforeEach(function () {
sandbox = sinon.sandbox.create();
});
afterEach(function () {
sandbox.restore();
});
it("should call Example API with card and payment data", function () {
// this is a ridiculous timeout for a test that should run in subseconds
// but a bug in the Meteor test runner (or something) seems to make this test stall
// it actually stalls after the entire test is completed
this.timeout(30000);
const cardData = {
name: "Test User",
number: "4242424242424242",
expireMonth: "2",
expireYear: "2018",
cvv2: "123",
type: "visa"
};
const paymentData = {
currency: "USD",
total: "19.99"
};
const authorizeResult = {
saved: true,
currency: "USD"
};
const authorizeStub = sandbox.stub(ExampleApi.methods.authorize, "call", () => authorizeResult);
const results = Meteor.call("exampleSubmit", "authorize", cardData, paymentData);
expect(authorizeStub).to.have.been.calledWith({
transactionType: "authorize",
cardData,
paymentData
});
expect(results.saved).to.be.true;
});
it("should throw an error if card data is not correct", function () {
const badCardData = {
name: "Test User",
cvv2: "123",
type: "visa"
};
const paymentData = {
currency: "USD",
total: "19.99"
};
// Notice how you need to wrap this call in another function
expect(function () {
Meteor.call("exampleSubmit", "authorize", badCardData, paymentData);
}).to.throw;
});
});
describe("Capture payment", function () {
let sandbox;
beforeEach(function () {
sandbox = sinon.sandbox.create();
});
afterEach(function () {
sandbox.restore();
});
it("should call ExampleApi with transaction ID", function () {
const captureResults = { success: true };
const authorizationId = "abc1234";
paymentMethod.transactionId = authorizationId;
paymentMethod.amount = 19.99;
const captureStub = sandbox.stub(ExampleApi.methods.capture, "call", () => captureResults);
const results = Meteor.call("example/payment/capture", paymentMethod);
expect(captureStub).to.have.been.calledWith({
authorizationId,
amount: 19.99
});
expect(results.saved).to.be.true;
});
it("should throw an error if transaction ID is not found", function () {
sandbox.stub(ExampleApi.methods, "capture", function () {
throw new Meteor.Error("not-found", "Not Found");
});
expect(function () {
Meteor.call("example/payment/capture", "abc123");
}).to.throw;
});
});
describe("Refund", function () {
let sandbox;
beforeEach(function () {
sandbox = sinon.sandbox.create();
});
afterEach(function () {
sandbox.restore();
});
it("should call ExampleApi with transaction ID", function () {
const refundResults = { success: true };
const transactionId = "abc1234";
const amount = 19.99;
paymentMethod.transactionId = transactionId;
const refundStub = sandbox.stub(ExampleApi.methods.refund, "call", () => refundResults);
Meteor.call("example/refund/create", paymentMethod, amount);
expect(refundStub).to.have.been.calledWith({
transactionId,
amount
});
});
it("should throw an error if transaction ID is not found", function () {
sandbox.stub(ExampleApi.methods.refund, "call", function () {
throw new Meteor.Error("not-found", "Not Found");
});
const transactionId = "abc1234";
paymentMethod.transactionId = transactionId;
expect(function () {
Meteor.call("example/refund/create", paymentMethod, 19.99);
}).to.throw(Meteor.Error, /Not Found/);
});
});
describe("List Refunds", function () {
let sandbox;
beforeEach(function () {
sandbox = sinon.sandbox.create();
});
afterEach(function () {
sandbox.restore();
});
it("should call ExampleApi with transaction ID", function () {
const refundResults = { refunds: [] };
const refundArgs = {
transactionId: "abc1234"
};
const refundStub = sandbox.stub(ExampleApi.methods.refunds, "call", () => refundResults);
Meteor.call("example/refund/list", paymentMethod);
expect(refundStub).to.have.been.calledWith(refundArgs);
});
it("should throw an error if transaction ID is not found", function () {
sandbox.stub(ExampleApi.methods, "refunds", function () {
throw new Meteor.Error("not-found", "Not Found");
});
expect(() => Meteor.call("example/refund/list", paymentMethod)).to.throw(Meteor.Error, /Not Found/);
});
});
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.