hexsha string | size int64 | ext string | lang string | max_stars_repo_path string | max_stars_repo_name string | max_stars_repo_head_hexsha string | max_stars_repo_licenses list | max_stars_count int64 | max_stars_repo_stars_event_min_datetime string | max_stars_repo_stars_event_max_datetime string | max_issues_repo_path string | max_issues_repo_name string | max_issues_repo_head_hexsha string | max_issues_repo_licenses list | max_issues_count int64 | max_issues_repo_issues_event_min_datetime string | max_issues_repo_issues_event_max_datetime string | max_forks_repo_path string | max_forks_repo_name string | max_forks_repo_head_hexsha string | max_forks_repo_licenses list | max_forks_count int64 | max_forks_repo_forks_event_min_datetime string | max_forks_repo_forks_event_max_datetime string | content string | avg_line_length float64 | max_line_length int64 | alphanum_fraction float64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
15c5d89ca078e2281fdb43601974dcd9d5070e77 | 22,976 | js | JavaScript | platforms/android/app/src/main/assets/www/main-es2015.js | edgarMejia/Legendary-Hybrid | 9c5f4583fdec13e811f60ed74e3fb23cd4b9f922 | [
"MIT"
] | null | null | null | platforms/android/app/src/main/assets/www/main-es2015.js | edgarMejia/Legendary-Hybrid | 9c5f4583fdec13e811f60ed74e3fb23cd4b9f922 | [
"MIT"
] | 6 | 2021-03-09T20:40:13.000Z | 2022-02-26T18:59:17.000Z | www/main-es2015.js | edgarMejia/Legendary-Hybrid | 9c5f4583fdec13e811f60ed74e3fb23cd4b9f922 | [
"MIT"
] | null | null | null | (window["webpackJsonp"] = window["webpackJsonp"] || []).push([["main"],{
/***/ "./$$_lazy_route_resource lazy recursive":
/*!******************************************************!*\
!*** ./$$_lazy_route_resource lazy namespace object ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function webpackEmptyAsyncContext(req) {
// Here Promise.resolve().then() is used instead of new Promise() to prevent
// uncaught exception popping up in devtools
return Promise.resolve().then(function() {
var e = new Error("Cannot find module '" + req + "'");
e.code = 'MODULE_NOT_FOUND';
throw e;
});
}
webpackEmptyAsyncContext.keys = function() { return []; };
webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;
module.exports = webpackEmptyAsyncContext;
webpackEmptyAsyncContext.id = "./$$_lazy_route_resource lazy recursive";
/***/ }),
/***/ "./node_modules/@ionic/core/dist/esm lazy recursive ^\\.\\/.*\\.entry\\.js$ include: \\.entry\\.js$ exclude: \\.system\\.entry\\.js$":
/*!*****************************************************************************************************************************************!*\
!*** ./node_modules/@ionic/core/dist/esm lazy ^\.\/.*\.entry\.js$ include: \.entry\.js$ exclude: \.system\.entry\.js$ namespace object ***!
\*****************************************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var map = {
"./ion-action-sheet-controller_8.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-action-sheet-controller_8.entry.js",
"common",
0
],
"./ion-action-sheet-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-action-sheet-ios.entry.js",
"common",
1
],
"./ion-action-sheet-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-action-sheet-md.entry.js",
"common",
2
],
"./ion-alert-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-alert-ios.entry.js",
"common",
3
],
"./ion-alert-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-alert-md.entry.js",
"common",
4
],
"./ion-app_8-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-app_8-ios.entry.js",
"common",
5
],
"./ion-app_8-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-app_8-md.entry.js",
"common",
6
],
"./ion-avatar_3-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-avatar_3-ios.entry.js",
"common",
7
],
"./ion-avatar_3-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-avatar_3-md.entry.js",
"common",
8
],
"./ion-back-button-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-back-button-ios.entry.js",
"common",
9
],
"./ion-back-button-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-back-button-md.entry.js",
"common",
10
],
"./ion-backdrop-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-backdrop-ios.entry.js",
11
],
"./ion-backdrop-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-backdrop-md.entry.js",
12
],
"./ion-button_2-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-button_2-ios.entry.js",
"common",
13
],
"./ion-button_2-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-button_2-md.entry.js",
"common",
14
],
"./ion-card_5-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-card_5-ios.entry.js",
"common",
15
],
"./ion-card_5-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-card_5-md.entry.js",
"common",
16
],
"./ion-checkbox-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-checkbox-ios.entry.js",
"common",
17
],
"./ion-checkbox-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-checkbox-md.entry.js",
"common",
18
],
"./ion-chip-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-chip-ios.entry.js",
"common",
19
],
"./ion-chip-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-chip-md.entry.js",
"common",
20
],
"./ion-col_3.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-col_3.entry.js",
21
],
"./ion-datetime_3-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-datetime_3-ios.entry.js",
"common",
22
],
"./ion-datetime_3-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-datetime_3-md.entry.js",
"common",
23
],
"./ion-fab_3-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-fab_3-ios.entry.js",
"common",
24
],
"./ion-fab_3-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-fab_3-md.entry.js",
"common",
25
],
"./ion-img.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-img.entry.js",
26
],
"./ion-infinite-scroll_2-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-infinite-scroll_2-ios.entry.js",
"common",
27
],
"./ion-infinite-scroll_2-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-infinite-scroll_2-md.entry.js",
"common",
28
],
"./ion-input-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-input-ios.entry.js",
"common",
29
],
"./ion-input-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-input-md.entry.js",
"common",
30
],
"./ion-item-option_3-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-item-option_3-ios.entry.js",
"common",
31
],
"./ion-item-option_3-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-item-option_3-md.entry.js",
"common",
32
],
"./ion-item_8-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-item_8-ios.entry.js",
"common",
33
],
"./ion-item_8-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-item_8-md.entry.js",
"common",
34
],
"./ion-loading-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-loading-ios.entry.js",
"common",
35
],
"./ion-loading-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-loading-md.entry.js",
"common",
36
],
"./ion-menu_4-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-menu_4-ios.entry.js",
"common",
37
],
"./ion-menu_4-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-menu_4-md.entry.js",
"common",
38
],
"./ion-modal-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-modal-ios.entry.js",
"common",
39
],
"./ion-modal-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-modal-md.entry.js",
"common",
40
],
"./ion-nav_5.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-nav_5.entry.js",
"common",
41
],
"./ion-popover-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-popover-ios.entry.js",
"common",
42
],
"./ion-popover-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-popover-md.entry.js",
"common",
43
],
"./ion-progress-bar-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-progress-bar-ios.entry.js",
"common",
44
],
"./ion-progress-bar-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-progress-bar-md.entry.js",
"common",
45
],
"./ion-radio_2-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-radio_2-ios.entry.js",
"common",
46
],
"./ion-radio_2-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-radio_2-md.entry.js",
"common",
47
],
"./ion-range-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-range-ios.entry.js",
"common",
48
],
"./ion-range-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-range-md.entry.js",
"common",
49
],
"./ion-refresher_2-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-refresher_2-ios.entry.js",
"common",
50
],
"./ion-refresher_2-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-refresher_2-md.entry.js",
"common",
51
],
"./ion-reorder_2-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-reorder_2-ios.entry.js",
"common",
52
],
"./ion-reorder_2-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-reorder_2-md.entry.js",
"common",
53
],
"./ion-ripple-effect.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-ripple-effect.entry.js",
54
],
"./ion-route_4.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-route_4.entry.js",
"common",
55
],
"./ion-searchbar-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-searchbar-ios.entry.js",
"common",
56
],
"./ion-searchbar-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-searchbar-md.entry.js",
"common",
57
],
"./ion-segment_2-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-segment_2-ios.entry.js",
"common",
58
],
"./ion-segment_2-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-segment_2-md.entry.js",
"common",
59
],
"./ion-select_3-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-select_3-ios.entry.js",
"common",
60
],
"./ion-select_3-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-select_3-md.entry.js",
"common",
61
],
"./ion-slide_2-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-slide_2-ios.entry.js",
62
],
"./ion-slide_2-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-slide_2-md.entry.js",
63
],
"./ion-spinner.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-spinner.entry.js",
"common",
64
],
"./ion-split-pane-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-split-pane-ios.entry.js",
65
],
"./ion-split-pane-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-split-pane-md.entry.js",
66
],
"./ion-tab-bar_2-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-tab-bar_2-ios.entry.js",
"common",
67
],
"./ion-tab-bar_2-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-tab-bar_2-md.entry.js",
"common",
68
],
"./ion-tab_2.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-tab_2.entry.js",
"common",
69
],
"./ion-text.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-text.entry.js",
"common",
70
],
"./ion-textarea-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-textarea-ios.entry.js",
"common",
71
],
"./ion-textarea-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-textarea-md.entry.js",
"common",
72
],
"./ion-toast-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-toast-ios.entry.js",
"common",
73
],
"./ion-toast-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-toast-md.entry.js",
"common",
74
],
"./ion-toggle-ios.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-toggle-ios.entry.js",
"common",
75
],
"./ion-toggle-md.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-toggle-md.entry.js",
"common",
76
],
"./ion-virtual-scroll.entry.js": [
"./node_modules/@ionic/core/dist/esm/ion-virtual-scroll.entry.js",
77
]
};
function webpackAsyncContext(req) {
if(!__webpack_require__.o(map, req)) {
return Promise.resolve().then(function() {
var e = new Error("Cannot find module '" + req + "'");
e.code = 'MODULE_NOT_FOUND';
throw e;
});
}
var ids = map[req], id = ids[0];
return Promise.all(ids.slice(1).map(__webpack_require__.e)).then(function() {
return __webpack_require__(id);
});
}
webpackAsyncContext.keys = function webpackAsyncContextKeys() {
return Object.keys(map);
};
webpackAsyncContext.id = "./node_modules/@ionic/core/dist/esm lazy recursive ^\\.\\/.*\\.entry\\.js$ include: \\.entry\\.js$ exclude: \\.system\\.entry\\.js$";
module.exports = webpackAsyncContext;
/***/ }),
/***/ "./node_modules/raw-loader/index.js!./src/app/app.component.html":
/*!**************************************************************!*\
!*** ./node_modules/raw-loader!./src/app/app.component.html ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = "<ion-app>\n <ion-router-outlet></ion-router-outlet>\n</ion-app>"
/***/ }),
/***/ "./src/app/app-routing.module.ts":
/*!***************************************!*\
!*** ./src/app/app-routing.module.ts ***!
\***************************************/
/*! exports provided: AppRoutingModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AppRoutingModule", function() { return AppRoutingModule; });
/* 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");
const routes = [
{
path: '',
loadChildren: () => __webpack_require__.e(/*! import() | tabs-tabs-module */ "tabs-tabs-module").then(__webpack_require__.bind(null, /*! ./tabs/tabs.module */ "./src/app/tabs/tabs.module.ts")).then(m => m.TabsPageModule)
}
];
let AppRoutingModule = class AppRoutingModule {
};
AppRoutingModule = tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
imports: [
_angular_router__WEBPACK_IMPORTED_MODULE_2__["RouterModule"].forRoot(routes, { preloadingStrategy: _angular_router__WEBPACK_IMPORTED_MODULE_2__["PreloadAllModules"] })
],
exports: [_angular_router__WEBPACK_IMPORTED_MODULE_2__["RouterModule"]]
})
], AppRoutingModule);
/***/ }),
/***/ "./src/app/app.component.scss":
/*!************************************!*\
!*** ./src/app/app.component.scss ***!
\************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = "\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJzcmMvYXBwL2FwcC5jb21wb25lbnQuc2NzcyJ9 */"
/***/ }),
/***/ "./src/app/app.component.ts":
/*!**********************************!*\
!*** ./src/app/app.component.ts ***!
\**********************************/
/*! exports provided: AppComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AppComponent", function() { return AppComponent; });
/* 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 _ionic_angular__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ionic/angular */ "./node_modules/@ionic/angular/dist/fesm5.js");
/* harmony import */ var _ionic_native_splash_screen_ngx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ionic-native/splash-screen/ngx */ "./node_modules/@ionic-native/splash-screen/ngx/index.js");
/* harmony import */ var _ionic_native_status_bar_ngx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ionic-native/status-bar/ngx */ "./node_modules/@ionic-native/status-bar/ngx/index.js");
let AppComponent = class AppComponent {
constructor(platform, splashScreen, statusBar) {
this.platform = platform;
this.splashScreen = splashScreen;
this.statusBar = statusBar;
this.initializeApp();
}
initializeApp() {
this.platform.ready().then(() => {
this.statusBar.styleLightContent();
//this.statusBar.styleDefault();
//this.statusBar.overlaysWebView(true);
//this.statusBar.backgroundColorByHexString('#000000');
this.splashScreen.hide();
});
}
};
AppComponent.ctorParameters = () => [
{ type: _ionic_angular__WEBPACK_IMPORTED_MODULE_2__["Platform"] },
{ type: _ionic_native_splash_screen_ngx__WEBPACK_IMPORTED_MODULE_3__["SplashScreen"] },
{ type: _ionic_native_status_bar_ngx__WEBPACK_IMPORTED_MODULE_4__["StatusBar"] }
];
AppComponent = tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
selector: 'app-root',
template: __webpack_require__(/*! raw-loader!./app.component.html */ "./node_modules/raw-loader/index.js!./src/app/app.component.html"),
styles: [__webpack_require__(/*! ./app.component.scss */ "./src/app/app.component.scss")]
}),
tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"]("design:paramtypes", [_ionic_angular__WEBPACK_IMPORTED_MODULE_2__["Platform"],
_ionic_native_splash_screen_ngx__WEBPACK_IMPORTED_MODULE_3__["SplashScreen"],
_ionic_native_status_bar_ngx__WEBPACK_IMPORTED_MODULE_4__["StatusBar"]])
], AppComponent);
/***/ }),
/***/ "./src/app/app.module.ts":
/*!*******************************!*\
!*** ./src/app/app.module.ts ***!
\*******************************/
/*! exports provided: AppModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AppModule", function() { return AppModule; });
/* 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_platform_browser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/platform-browser */ "./node_modules/@angular/platform-browser/fesm2015/platform-browser.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm2015/router.js");
/* harmony import */ var _ionic_angular__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ionic/angular */ "./node_modules/@ionic/angular/dist/fesm5.js");
/* harmony import */ var _ionic_native_splash_screen_ngx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ionic-native/splash-screen/ngx */ "./node_modules/@ionic-native/splash-screen/ngx/index.js");
/* harmony import */ var _ionic_native_status_bar_ngx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ionic-native/status-bar/ngx */ "./node_modules/@ionic-native/status-bar/ngx/index.js");
/* harmony import */ var _app_routing_module__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./app-routing.module */ "./src/app/app-routing.module.ts");
/* harmony import */ var _app_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./app.component */ "./src/app/app.component.ts");
let AppModule = class AppModule {
};
AppModule = tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
declarations: [_app_component__WEBPACK_IMPORTED_MODULE_8__["AppComponent"]],
entryComponents: [],
imports: [_angular_platform_browser__WEBPACK_IMPORTED_MODULE_2__["BrowserModule"], _ionic_angular__WEBPACK_IMPORTED_MODULE_4__["IonicModule"].forRoot(), _app_routing_module__WEBPACK_IMPORTED_MODULE_7__["AppRoutingModule"]],
providers: [
_ionic_native_status_bar_ngx__WEBPACK_IMPORTED_MODULE_6__["StatusBar"],
_ionic_native_splash_screen_ngx__WEBPACK_IMPORTED_MODULE_5__["SplashScreen"],
{ provide: _angular_router__WEBPACK_IMPORTED_MODULE_3__["RouteReuseStrategy"], useClass: _ionic_angular__WEBPACK_IMPORTED_MODULE_4__["IonicRouteStrategy"] }
],
bootstrap: [_app_component__WEBPACK_IMPORTED_MODULE_8__["AppComponent"]]
})
], AppModule);
/***/ }),
/***/ "./src/environments/environment.ts":
/*!*****************************************!*\
!*** ./src/environments/environment.ts ***!
\*****************************************/
/*! exports provided: environment */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "environment", function() { return environment; });
// This file can be replaced during build by using the `fileReplacements` array.
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.
const environment = {
production: false
};
/*
* For easier debugging in development mode, you can import the following file
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
*
* This import should be commented out in production mode because it will have a negative impact
* on performance if an error is thrown.
*/
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.
/***/ }),
/***/ "./src/main.ts":
/*!*********************!*\
!*** ./src/main.ts ***!
\*********************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm2015/core.js");
/* harmony import */ var _angular_platform_browser_dynamic__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/platform-browser-dynamic */ "./node_modules/@angular/platform-browser-dynamic/fesm2015/platform-browser-dynamic.js");
/* harmony import */ var _app_app_module__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./app/app.module */ "./src/app/app.module.ts");
/* harmony import */ var _environments_environment__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./environments/environment */ "./src/environments/environment.ts");
if (_environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].production) {
Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["enableProdMode"])();
}
Object(_angular_platform_browser_dynamic__WEBPACK_IMPORTED_MODULE_1__["platformBrowserDynamic"])().bootstrapModule(_app_app_module__WEBPACK_IMPORTED_MODULE_2__["AppModule"])
.catch(err => console.log(err));
/***/ }),
/***/ 0:
/*!***************************!*\
!*** multi ./src/main.ts ***!
\***************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(/*! /Users/edgarmejia/Documents/Legendary/src/main.ts */"./src/main.ts");
/***/ })
},[[0,"runtime","vendor"]]]);
//# sourceMappingURL=main-es2015.js.map | 34.39521 | 240 | 0.655423 |
15c66e131a9fb7c732b230deb68a3aeb9994d49a | 1,919 | js | JavaScript | lib/engine.js | bitkanlabs/egg-view-angular | 7419f4632aeb952cc288a4914b731d49b882fc3e | [
"MIT"
] | null | null | null | lib/engine.js | bitkanlabs/egg-view-angular | 7419f4632aeb952cc288a4914b731d49b882fc3e | [
"MIT"
] | null | null | null | lib/engine.js | bitkanlabs/egg-view-angular | 7419f4632aeb952cc288a4914b731d49b882fc3e | [
"MIT"
] | 1 | 2018-08-23T07:50:47.000Z | 2018-08-23T07:50:47.000Z | 'use strict';
const path = require('path');
const mapValues = require('lodash.mapvalues');
const { ɵCommonEngine } = require('@nguniversal/common/engine');
const { ɵREQUEST, ɵRESPONSE } = require('@nguniversal/common/tokens');
const { provideModuleMap } = require('@nguniversal/module-map-ngfactory-loader');
class Engine {
constructor(app) {
this.options = Object.assign({}, { index: 'index.html' }, app.config.angular);
this.engines = mapValues(app.context.locales || {}, (alias, locale) => {
const { AppServerModuleNgFactory, LAZY_MODULE_MAP } = require(path.join(this.options.server, locale, 'main'));
return new ɵCommonEngine(AppServerModuleNgFactory, [ provideModuleMap(LAZY_MODULE_MAP) ].concat(this.options.providers || []));
});
}
render(ctx, options = {}) {
const engine = this.engines[ctx.locale];
if (!engine) {
return void 0;
}
options = Object.assign({}, {
documentFilePath: path.join(this.options.browser, ctx.locale, this.options.index),
url: ctx.url,
providers: getReqResProviders(ctx),
});
return engine.render(options);
}
renderFile(filename, locals, options = {}) {
const engine = this.engines[locals.ctx.locale];
options = Object.assign(options, {
documentFilePath: filename,
url: locals.ctx.url,
providers: getReqResProviders(locals.ctx),
});
return engine.render(options);
}
renderString(tpl, locals, options = {}) {
const engine = this.engines[locals.ctx.locale];
options = Object.assign(options, {
document: tpl,
url: locals.ctx.url,
providers: getReqResProviders(locals.ctx),
});
return engine.render(options);
}
}
function getReqResProviders(ctx) {
return [
{
provide: ɵREQUEST,
useValue: ctx.request,
},
{
provide: ɵRESPONSE,
useValue: ctx.response,
},
];
}
module.exports = Engine;
| 28.641791 | 133 | 0.652944 |
15c6c5522bdcc5b86c0b74fbf19e54c769e80084 | 125 | js | JavaScript | Step.3/node_modules/react-native-paper/lib/module/components/Drawer/Drawer.js | liumengyuan1997/COVID19_App | ea26819b14da4834e78e198b2fe02c4ed6a89fdd | [
"MIT"
] | 1 | 2020-12-06T17:09:07.000Z | 2020-12-06T17:09:07.000Z | Step.3/node_modules/react-native-paper/lib/module/components/Drawer/Drawer.js | zhangyanyu0722/codvid-app-zhangyanyu0722 | 5d98f9381cac925da328007f857551b53728233c | [
"MIT"
] | 4 | 2021-03-10T13:17:25.000Z | 2022-02-19T00:02:09.000Z | backend/node_modules/react-native-paper/lib/module/components/Drawer/Drawer.js | vanessamcf/App-Dev-Radar | 6e5207deff2adf2a48951f50b6404273cb47ed3a | [
"MIT"
] | 1 | 2022-01-06T02:53:25.000Z | 2022-01-06T02:53:25.000Z | export{default as Item}from'./DrawerItem';export{default as Section}from'./DrawerSection';
//# sourceMappingURL=Drawer.js.map | 62.5 | 90 | 0.792 |
15c709203ed27d800eeb5299aa3161e7c47da38b | 1,143 | js | JavaScript | lib/strava.js | heymagurany/strava-to-fitbit-api | 8549c316f7bd73ef740ecf098bb4907e6a0d2b76 | [
"MIT"
] | null | null | null | lib/strava.js | heymagurany/strava-to-fitbit-api | 8549c316f7bd73ef740ecf098bb4907e6a0d2b76 | [
"MIT"
] | null | null | null | lib/strava.js | heymagurany/strava-to-fitbit-api | 8549c316f7bd73ef740ecf098bb4907e6a0d2b76 | [
"MIT"
] | null | null | null | const request = require('request-promise');
const env = require('../lib/environment');
const baseUrl = 'https://www.strava.com';
function Strava(userId, accessToken, refreshToken) {
this.userId = userId;
this.accessToken = accessToken;
this.refreshToken = refreshToken;
}
Strava.prototype.getActivity = function (activityId) {
return request({
method: 'GET',
uri: baseUrl + '/api/v3/activities/' + activityId,
headers: {
'Authorization': 'Bearer ' + this.accessToken
},
json: true
});
}
function fromAuthorizationCode(code) {
return request({
method: 'POST',
uri: baseUrl + '/oauth/token',
form: {
grant_type: 'authorization_code',
code: code,
client_id: env.stravaClientId,
client_secret: env.stravaClientSecret
},
json: true
}).then((result) => {
return new Strava(result.athlete.id, result.access_token, result.refresh_token);
});
}
function fromUser(user) {
return new Strava(user.strava.userId, user.strava.accessToken, user.strava.refreshToken);
}
module.exports = {
fromAuthorizationCode: fromAuthorizationCode,
fromUser: fromUser
};
| 24.319149 | 91 | 0.682415 |
15c72af7c4243cc12833c954950167144ce812af | 1,610 | js | JavaScript | vue.config.js | hashquark-io/polkacube-frontend | 91d25c8487c9a6ab886eb1da1f2ef2f12be9274c | [
"Apache-2.0"
] | 2 | 2020-01-22T07:34:59.000Z | 2020-01-22T07:46:26.000Z | vue.config.js | hashquark-io/polkacube-frontend | 91d25c8487c9a6ab886eb1da1f2ef2f12be9274c | [
"Apache-2.0"
] | null | null | null | vue.config.js | hashquark-io/polkacube-frontend | 91d25c8487c9a6ab886eb1da1f2ef2f12be9274c | [
"Apache-2.0"
] | 1 | 2020-03-10T13:22:51.000Z | 2020-03-10T13:22:51.000Z | const path = require('path')
// eslint-disable-next-line
const webpack = require('webpack')
function resolve(dir) {
return path.join(__dirname, dir)
}
//The '127.0.0.1' or 'localhost' direct to container host, you must change it when you run in docker.
let POLKACUBE_SERVER = process.env.POLKACUBE_SERVER
let POLKACUBE_SOCKET_SERVER = process.env.POLKACUBE_SOCKET_SERVER
let POLKACUBE_SOCKET_PATH = process.env.POLKACUBE_SOCKET_PATH
let POLKADOT_SERVER = process.env.POLKADOT_SERVER
let POLKADOT_SOCKET_SERVER = process.env.POLKADOT_SOCKET_SERVER
let POLKADOT_SOCKET_PATH = process.env.POLKADOT_SOCKET_PATH
let BUILD_ENV = process.env.BUILD_ENV
module.exports = {
lintOnSave: false,
publicPath: './',
productionSourceMap: false,
chainWebpack: config => {
config.resolve.alias.set('@img', resolve('src/assets/img'))
config.module
.rule('i18n')
.resourceQuery(/blockType=i18n/)
.type('javascript/auto')
.use('i18n')
.loader('@kazupon/vue-i18n-loader')
},
configureWebpack: {
plugins: [
new webpack.DefinePlugin({
BUILD_ENV,
POLKACUBE_SERVER,
POLKACUBE_SOCKET_SERVER,
POLKACUBE_SOCKET_PATH,
POLKADOT_SERVER,
POLKADOT_SOCKET_SERVER,
POLKADOT_SOCKET_PATH
})
]
},
css: {
loaderOptions: {
sass: {
prependData: '@import "@/scss/variables.scss";'
}
}
},
pluginOptions: {
i18n: {
enableInSFC: true,
locale: 'zh-TW',
fallbackLocale: 'en-US',
localeDir: 'i18n'
}
},
devServer: {
disableHostCheck: true
}
}
| 23 | 101 | 0.667702 |
15c7a1916139152b9ebafa5018277312348a29d9 | 311 | js | JavaScript | public/javascripts/models/css_document.js | szehnder/raphael-revisions | ec98409f6628aaeb7573489795539e5ccc643010 | [
"Zlib"
] | null | null | null | public/javascripts/models/css_document.js | szehnder/raphael-revisions | ec98409f6628aaeb7573489795539e5ccc643010 | [
"Zlib"
] | 1 | 2015-02-27T21:53:16.000Z | 2015-02-27T21:53:16.000Z | public/javascripts/models/css_document.js | szehnder/raphael-revisions | ec98409f6628aaeb7573489795539e5ccc643010 | [
"Zlib"
] | null | null | null | var CssDocument = Backbone.Model.extend({
initialize: function() {
this.doc = this.get('css_document');
},
url : function() {
var base = 'css_documents';
if (this.isNew()) return base;
return base + (base.charAt(base.length - 1) == '/' ? '' : '/') + this.id;
}
}); | 28.272727 | 79 | 0.533762 |
15c9008e6659334962b3eda1d13905d8f7f49f64 | 676 | js | JavaScript | benchmark/index.js | Zaibot/node-arrayq | fdbc613f2836235df2adbbe356effcc2301ce1fb | [
"MIT"
] | null | null | null | benchmark/index.js | Zaibot/node-arrayq | fdbc613f2836235df2adbbe356effcc2301ce1fb | [
"MIT"
] | null | null | null | benchmark/index.js | Zaibot/node-arrayq | fdbc613f2836235df2adbbe356effcc2301ce1fb | [
"MIT"
] | null | null | null | [
['jslength', require('./jslength')],
['jsmap', require('./jsmap')],
['qselectmany', require('./qselectmany')],
['jssome-pes', require('./jssome-pes')],
['jssome-op', require('./jssome-op')],
['jsevery-pes', require('./jsevery-pes')],
['jsevery-op', require('./jsevery-op')]
].forEach(reg => {
const name = reg[0], suiteFactory = reg[1];
console.log(`[${name}]`);
suiteFactory()
.on('cycle', (event) => console.log(String(event.target)))
.on('error', (event) => console.error(event.target.error))
.on('complete', function(event) {
console.log('Fastest is ' + this.filter('fastest').map('name'));
})
.run();
console.log('');
}); | 33.8 | 70 | 0.579882 |
15c97ff03872e03d7c47b05b4674a4490408274a | 2,067 | js | JavaScript | src/components/Nav/Navbar.js | arsmth/gatsby-responsive-nav | 302f1a259ac6edbb59fd7f0104ade094e6d3cdc9 | [
"MIT"
] | 10 | 2019-03-22T20:29:50.000Z | 2020-12-15T07:14:40.000Z | src/components/Nav/Navbar.js | arsmth/gatsby-responsive-nav | 302f1a259ac6edbb59fd7f0104ade094e6d3cdc9 | [
"MIT"
] | 1 | 2020-01-08T03:33:22.000Z | 2020-01-10T02:47:27.000Z | src/components/Nav/Navbar.js | arsmth/gatsby-responsive-nav | 302f1a259ac6edbb59fd7f0104ade094e6d3cdc9 | [
"MIT"
] | 4 | 2020-01-25T04:38:41.000Z | 2021-02-08T09:48:10.000Z | import React, { PureComponent } from 'react'
import { StaticQuery, graphql } from 'gatsby'
import styled, { css } from 'styled-components'
import { Link } from 'gatsby'
import rem from '../../utils/rem'
import { navbarHeight } from '../../utils/sizes'
import { mobile } from '../../utils/media'
import NavLinks from './NavLinks'
import Social from './Social'
import MobileNavbar from './MobileNavbar'
const Wrapper = styled.nav`
position: fixed;
left: 0;
box-sizing: border-box;
z-index: 3;
width: 100%;
height: ${rem(navbarHeight)};
font-size: ${rem(15)};
font-weight: 500;
background: tomato;
transition: background 300ms ease-out;
color: white;
a {
text-decoration: none;
}
`
const NormalNavbar = styled.div`
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 ${rem(20)};
${mobile(css`
display: none;
`)}
`
const StartWrapper = styled.div`
display: flex;
align-items: center;
justify-content: flex-start;
`
const EndWrapper = styled.div`
display: flex;
align-items: center;
justify-content: flex-end;
`
const LogoLink = styled(Link).attrs({
to: '/',
'aria-label': 'home',
})`
display: inline-block;
vertical-align: center;
margin-right: ${rem(35)};
color: currentColor;
`
class NavBar extends PureComponent {
render() {
const {
onMobileNavToggle,
isMobileNavFolded,
} = this.props
return (
<StaticQuery query={graphql` query { site { siteMetadata { title } } } `} render={data => (
<Wrapper>
<NormalNavbar>
<StartWrapper>
<LogoLink>
<p>{data.site.siteMetadata.title}</p>
</LogoLink>
<NavLinks />
</StartWrapper>
<EndWrapper>
<Social />
</EndWrapper>
</NormalNavbar>
<MobileNavbar
isMobileNavFolded={isMobileNavFolded}
onMobileNavToggle={onMobileNavToggle}
/>
</Wrapper>
)} />
)
}
}
export default NavBar
| 21.309278 | 97 | 0.599903 |
15c9cf0e07ea81fce8d100fca8a70da4950a7128 | 306 | js | JavaScript | doc/html/search/functions_70.js | deermichel/streaming_sampler | a10d573aec5cd088104245e41adab9d029179b3c | [
"MIT"
] | 7 | 2015-07-01T03:03:54.000Z | 2021-10-21T04:07:53.000Z | doc/html/search/functions_70.js | deermichel/streaming_sampler | a10d573aec5cd088104245e41adab9d029179b3c | [
"MIT"
] | 1 | 2021-08-30T07:35:27.000Z | 2021-08-30T07:35:27.000Z | doc/html/search/functions_70.js | deermichel/streaming_sampler | a10d573aec5cd088104245e41adab9d029179b3c | [
"MIT"
] | 1 | 2021-08-06T11:04:30.000Z | 2021-08-06T11:04:30.000Z | var searchData=
[
['pitchwheelmoved',['pitchWheelMoved',['../class_streaming_sampler_voice.html#abf288fbe2eef1d78f7a18248a8d538b0',1,'StreamingSamplerVoice']]],
['preparetoplay',['prepareToPlay',['../class_streaming_sampler_voice.html#aca8d680bc57faacd007ac76ee5e0a21d',1,'StreamingSamplerVoice']]]
];
| 51 | 144 | 0.800654 |
15c9d456c722af155118ac2916b76eb4632cbc0e | 304 | js | JavaScript | src/statistics/mean.js | erictheise/mctad.js | 327157b5e37d3d0e12b1bbf9e67ffc4f4a9f179f | [
"MIT"
] | 13 | 2015-03-11T22:17:24.000Z | 2021-02-23T08:45:08.000Z | src/statistics/mean.js | erictheise/mctad.js | 327157b5e37d3d0e12b1bbf9e67ffc4f4a9f179f | [
"MIT"
] | null | null | null | src/statistics/mean.js | erictheise/mctad.js | 327157b5e37d3d0e12b1bbf9e67ffc4f4a9f179f | [
"MIT"
] | 3 | 2020-05-08T09:13:23.000Z | 2021-12-20T18:44:11.000Z | // # Mean
//
// `mctad.mean()` accepts an Array of Numbers and returns their average as a Number.
// It is an alias for `mctad.arithmeticMean()`.
//
// See [Arithmetic Mean](http://en.wikipedia.org/wiki/Mean#Arithmetic_mean_.28AM.29).
mctad.mean = function (data) { return this.arithmeticMean(data); };
| 33.777778 | 85 | 0.703947 |
15c9e23d9a903f6b8c54a7b92ef8a1cfbb4b5118 | 41,076 | js | JavaScript | public/assets/js/pages/features/charts/apexcharts-admin.js | adamabusamra/Smart-Learning | 1a27d1d2a284fe2f777f9aa08b78aceaf643290b | [
"MIT"
] | null | null | null | public/assets/js/pages/features/charts/apexcharts-admin.js | adamabusamra/Smart-Learning | 1a27d1d2a284fe2f777f9aa08b78aceaf643290b | [
"MIT"
] | null | null | null | public/assets/js/pages/features/charts/apexcharts-admin.js | adamabusamra/Smart-Learning | 1a27d1d2a284fe2f777f9aa08b78aceaf643290b | [
"MIT"
] | null | null | null | "use strict";
// Shared Colors Definition
const primary = "#6993FF";
const success = "#1BC5BD";
const info = "#8950FC";
const warning = "#FFA800";
const danger = "#F64E60";
// Class definition
function generateBubbleData(baseval, count, yrange) {
var i = 0;
var series = [];
while (i < count) {
var x = Math.floor(Math.random() * (750 - 1 + 1)) + 1;
var y =
Math.floor(Math.random() * (yrange.max - yrange.min + 1)) +
yrange.min;
var z = Math.floor(Math.random() * (75 - 15 + 1)) + 15;
series.push([x, y, z]);
baseval += 86400000;
i++;
}
return series;
}
function generateData(count, yrange) {
var i = 0;
var series = [];
while (i < count) {
var x = "w" + (i + 1).toString();
var y =
Math.floor(Math.random() * (yrange.max - yrange.min + 1)) +
yrange.min;
series.push({
x: x,
y: y,
});
i++;
}
return series;
}
var KTApexChartsDemo = (function () {
// Private functions
var _demo1 = function () {
const apexChart = "#chart_1";
var options = {
series: [
{
name: "Desktops",
data: [10, 41, 35, 51, 49, 62, 69, 91, 148],
},
],
chart: {
height: 350,
type: "line",
zoom: {
enabled: false,
},
},
dataLabels: {
enabled: false,
},
stroke: {
curve: "straight",
},
grid: {
row: {
colors: ["#f3f3f3", "transparent"], // takes an array which will be repeated on columns
opacity: 0.5,
},
},
xaxis: {
categories: [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
],
},
colors: [primary],
};
var chart = new ApexCharts(document.querySelector(apexChart), options);
chart.render();
};
var _demo2 = function () {
const apexChart = "#chart_2";
var options = {
series: [
{
name: "Class - A",
data: [31, 40, 28, 51, 42, 109, 100],
},
{
name: "Class - B",
data: [11, 32, 45, 32, 34, 52, 41],
},
],
chart: {
height: 350,
type: "area",
},
dataLabels: {
enabled: false,
},
stroke: {
curve: "smooth",
},
xaxis: {
type: "date",
categories: [
"05-10",
"05-11",
"05-12",
"05-13",
"05-14",
"05-15",
"05-16",
],
},
tooltip: {
x: {
format: "dd/MM/yy HH:mm",
},
},
colors: [primary, success],
};
var chart = new ApexCharts(document.querySelector(apexChart), options);
chart.render();
};
var _demo3 = function () {
const apexChart = "#chart_3";
var options = {
series: [
{
name: "Net Profit",
data: [44, 55, 57, 56, 61, 58, 63, 60, 66],
},
{
name: "Revenue",
data: [76, 85, 101, 98, 87, 105, 91, 114, 94],
},
{
name: "Free Cash Flow",
data: [35, 41, 36, 26, 45, 48, 52, 53, 41],
},
],
chart: {
type: "bar",
height: 350,
},
plotOptions: {
bar: {
horizontal: false,
columnWidth: "55%",
endingShape: "rounded",
},
},
dataLabels: {
enabled: false,
},
stroke: {
show: true,
width: 2,
colors: ["transparent"],
},
xaxis: {
categories: [
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
],
},
yaxis: {
title: {
text: "$ (thousands)",
},
},
fill: {
opacity: 1,
},
tooltip: {
y: {
formatter: function (val) {
return "$ " + val + " thousands";
},
},
},
colors: [primary, success, warning],
};
var chart = new ApexCharts(document.querySelector(apexChart), options);
chart.render();
};
var _demo4 = function () {
const apexChart = "#chart_4";
var options = {
series: [
{
name: "Web Development",
data: [44, 55, 41, 37, 22, 43, 21],
},
{
name: "Machine Learning",
data: [53, 32, 33, 52, 13, 43, 32],
},
{
name: "Data Analysis",
data: [12, 17, 11, 9, 15, 11, 20],
},
{
name: "Mobile Development",
data: [9, 7, 5, 8, 6, 9, 4],
},
{
name: "Salesforce Devs",
data: [25, 12, 19, 32, 25, 24, 10],
},
],
chart: {
type: "bar",
height: 350,
stacked: true,
},
plotOptions: {
bar: {
horizontal: true,
},
},
stroke: {
width: 1,
colors: ["#fff"],
},
title: {
text: "Students Tasks & Projects",
},
xaxis: {
categories: [
"Oct/2020",
"Nov/2020",
"Dec/2020",
"Jan/2021",
"Feb/2021",
"Mar/2021",
"Apr/2021",
],
labels: {
formatter: function (val) {
return val + "";
},
},
},
yaxis: {
title: {
text: undefined,
},
},
tooltip: {
y: {
formatter: function (val) {
return val + "";
},
},
},
fill: {
opacity: 1,
},
legend: {
position: "top",
horizontalAlign: "left",
offsetX: 40,
},
colors: [primary, success, warning, danger, info],
};
var chart = new ApexCharts(document.querySelector(apexChart), options);
chart.render();
};
var _demo5 = function () {
const apexChart = "#chart_5";
var options = {
series: [
{
name: "Income",
type: "column",
data: [1.4, 2, 2.5, 1.5, 2.5, 2.8, 3.8, 4.6],
},
{
name: "Cashflow",
type: "column",
data: [1.1, 3, 3.1, 4, 4.1, 4.9, 6.5, 8.5],
},
{
name: "Revenue",
type: "line",
data: [20, 29, 37, 36, 44, 45, 50, 58],
},
],
chart: {
height: 350,
type: "line",
stacked: false,
},
dataLabels: {
enabled: false,
},
stroke: {
width: [1, 1, 4],
},
title: {
text: "XYZ - Stock Analysis (2009 - 2016)",
align: "left",
offsetX: 110,
},
xaxis: {
categories: [2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016],
},
yaxis: [
{
axisTicks: {
show: true,
},
axisBorder: {
show: true,
color: primary,
},
labels: {
style: {
colors: primary,
},
},
title: {
text: "Income (thousand crores)",
style: {
color: primary,
},
},
tooltip: {
enabled: true,
},
},
{
seriesName: "Income",
opposite: true,
axisTicks: {
show: true,
},
axisBorder: {
show: true,
color: success,
},
labels: {
style: {
colors: success,
},
},
title: {
text: "Operating Cashflow (thousand crores)",
style: {
color: success,
},
},
},
{
seriesName: "Revenue",
opposite: true,
axisTicks: {
show: true,
},
axisBorder: {
show: true,
color: warning,
},
labels: {
style: {
colors: warning,
},
},
title: {
text: "Revenue (thousand crores)",
style: {
color: warning,
},
},
},
],
tooltip: {
fixed: {
enabled: true,
position: "topLeft", // topRight, topLeft, bottomRight, bottomLeft
offsetY: 30,
offsetX: 60,
},
},
legend: {
horizontalAlign: "left",
offsetX: 40,
},
};
var chart = new ApexCharts(document.querySelector(apexChart), options);
chart.render();
};
var _demo6 = function () {
const apexChart = "#chart_6";
var options = {
series: [
{
data: [
{
x: "Analysis",
y: [
new Date("2019-02-27").getTime(),
new Date("2019-03-04").getTime(),
],
fillColor: primary,
},
{
x: "Design",
y: [
new Date("2019-03-04").getTime(),
new Date("2019-03-08").getTime(),
],
fillColor: success,
},
{
x: "Coding",
y: [
new Date("2019-03-07").getTime(),
new Date("2019-03-10").getTime(),
],
fillColor: info,
},
{
x: "Testing",
y: [
new Date("2019-03-08").getTime(),
new Date("2019-03-12").getTime(),
],
fillColor: warning,
},
{
x: "Deployment",
y: [
new Date("2019-03-12").getTime(),
new Date("2019-03-17").getTime(),
],
fillColor: danger,
},
],
},
],
chart: {
height: 350,
type: "rangeBar",
},
plotOptions: {
bar: {
horizontal: true,
distributed: true,
dataLabels: {
hideOverflowingLabels: false,
},
},
},
dataLabels: {
enabled: true,
formatter: function (val, opts) {
var label = opts.w.globals.labels[opts.dataPointIndex];
var a = moment(val[0]);
var b = moment(val[1]);
var diff = b.diff(a, "days");
return label + ": " + diff + (diff > 1 ? " days" : " day");
},
style: {
colors: ["#f3f4f5", "#fff"],
},
},
xaxis: {
type: "datetime",
},
yaxis: {
show: false,
},
grid: {
row: {
colors: ["#f3f4f5", "#fff"],
opacity: 1,
},
},
};
var chart = new ApexCharts(document.querySelector(apexChart), options);
chart.render();
};
var _demo7 = function () {
const apexChart = "#chart_7";
var options = {
series: [
{
data: [
{
x: new Date(1538778600000),
y: [6629.81, 6650.5, 6623.04, 6633.33],
},
{
x: new Date(1538780400000),
y: [6632.01, 6643.59, 6620, 6630.11],
},
{
x: new Date(1538782200000),
y: [6630.71, 6648.95, 6623.34, 6635.65],
},
{
x: new Date(1538784000000),
y: [6635.65, 6651, 6629.67, 6638.24],
},
{
x: new Date(1538785800000),
y: [6638.24, 6640, 6620, 6624.47],
},
{
x: new Date(1538787600000),
y: [6624.53, 6636.03, 6621.68, 6624.31],
},
{
x: new Date(1538789400000),
y: [6624.61, 6632.2, 6617, 6626.02],
},
{
x: new Date(1538791200000),
y: [6627, 6627.62, 6584.22, 6603.02],
},
{
x: new Date(1538793000000),
y: [6605, 6608.03, 6598.95, 6604.01],
},
{
x: new Date(1538794800000),
y: [6604.5, 6614.4, 6602.26, 6608.02],
},
{
x: new Date(1538796600000),
y: [6608.02, 6610.68, 6601.99, 6608.91],
},
{
x: new Date(1538798400000),
y: [6608.91, 6618.99, 6608.01, 6612],
},
{
x: new Date(1538800200000),
y: [6612, 6615.13, 6605.09, 6612],
},
{
x: new Date(1538802000000),
y: [6612, 6624.12, 6608.43, 6622.95],
},
{
x: new Date(1538803800000),
y: [6623.91, 6623.91, 6615, 6615.67],
},
{
x: new Date(1538805600000),
y: [6618.69, 6618.74, 6610, 6610.4],
},
{
x: new Date(1538807400000),
y: [6611, 6622.78, 6610.4, 6614.9],
},
{
x: new Date(1538809200000),
y: [6614.9, 6626.2, 6613.33, 6623.45],
},
{
x: new Date(1538811000000),
y: [6623.48, 6627, 6618.38, 6620.35],
},
{
x: new Date(1538812800000),
y: [6619.43, 6620.35, 6610.05, 6615.53],
},
{
x: new Date(1538814600000),
y: [6615.53, 6617.93, 6610, 6615.19],
},
{
x: new Date(1538816400000),
y: [6615.19, 6621.6, 6608.2, 6620],
},
{
x: new Date(1538818200000),
y: [6619.54, 6625.17, 6614.15, 6620],
},
{
x: new Date(1538820000000),
y: [6620.33, 6634.15, 6617.24, 6624.61],
},
{
x: new Date(1538821800000),
y: [6625.95, 6626, 6611.66, 6617.58],
},
{
x: new Date(1538823600000),
y: [6619, 6625.97, 6595.27, 6598.86],
},
{
x: new Date(1538825400000),
y: [6598.86, 6598.88, 6570, 6587.16],
},
{
x: new Date(1538827200000),
y: [6588.86, 6600, 6580, 6593.4],
},
{
x: new Date(1538829000000),
y: [6593.99, 6598.89, 6585, 6587.81],
},
{
x: new Date(1538830800000),
y: [6587.81, 6592.73, 6567.14, 6578],
},
{
x: new Date(1538832600000),
y: [6578.35, 6581.72, 6567.39, 6579],
},
{
x: new Date(1538834400000),
y: [6579.38, 6580.92, 6566.77, 6575.96],
},
{
x: new Date(1538836200000),
y: [6575.96, 6589, 6571.77, 6588.92],
},
{
x: new Date(1538838000000),
y: [6588.92, 6594, 6577.55, 6589.22],
},
{
x: new Date(1538839800000),
y: [6589.3, 6598.89, 6589.1, 6596.08],
},
{
x: new Date(1538841600000),
y: [6597.5, 6600, 6588.39, 6596.25],
},
{
x: new Date(1538843400000),
y: [6598.03, 6600, 6588.73, 6595.97],
},
{
x: new Date(1538845200000),
y: [6595.97, 6602.01, 6588.17, 6602],
},
{
x: new Date(1538847000000),
y: [6602, 6607, 6596.51, 6599.95],
},
{
x: new Date(1538848800000),
y: [6600.63, 6601.21, 6590.39, 6591.02],
},
{
x: new Date(1538850600000),
y: [6591.02, 6603.08, 6591, 6591],
},
{
x: new Date(1538852400000),
y: [6591, 6601.32, 6585, 6592],
},
{
x: new Date(1538854200000),
y: [6593.13, 6596.01, 6590, 6593.34],
},
{
x: new Date(1538856000000),
y: [6593.34, 6604.76, 6582.63, 6593.86],
},
{
x: new Date(1538857800000),
y: [6593.86, 6604.28, 6586.57, 6600.01],
},
{
x: new Date(1538859600000),
y: [6601.81, 6603.21, 6592.78, 6596.25],
},
{
x: new Date(1538861400000),
y: [6596.25, 6604.2, 6590, 6602.99],
},
{
x: new Date(1538863200000),
y: [6602.99, 6606, 6584.99, 6587.81],
},
{
x: new Date(1538865000000),
y: [6587.81, 6595, 6583.27, 6591.96],
},
{
x: new Date(1538866800000),
y: [6591.97, 6596.07, 6585, 6588.39],
},
{
x: new Date(1538868600000),
y: [6587.6, 6598.21, 6587.6, 6594.27],
},
{
x: new Date(1538870400000),
y: [6596.44, 6601, 6590, 6596.55],
},
{
x: new Date(1538872200000),
y: [6598.91, 6605, 6596.61, 6600.02],
},
{
x: new Date(1538874000000),
y: [6600.55, 6605, 6589.14, 6593.01],
},
{
x: new Date(1538875800000),
y: [6593.15, 6605, 6592, 6603.06],
},
{
x: new Date(1538877600000),
y: [6603.07, 6604.5, 6599.09, 6603.89],
},
{
x: new Date(1538879400000),
y: [6604.44, 6604.44, 6600, 6603.5],
},
{
x: new Date(1538881200000),
y: [6603.5, 6603.99, 6597.5, 6603.86],
},
{
x: new Date(1538883000000),
y: [6603.85, 6605, 6600, 6604.07],
},
{
x: new Date(1538884800000),
y: [6604.98, 6606, 6604.07, 6606],
},
],
},
],
chart: {
type: "candlestick",
height: 350,
},
xaxis: {
type: "datetime",
},
yaxis: {
tooltip: {
enabled: true,
},
},
colors: [success, danger],
};
var chart = new ApexCharts(document.querySelector(apexChart), options);
chart.render();
};
var _demo8 = function () {
const apexChart = "#chart_8";
var options = {
series: [
{
name: "Bubble1",
data: generateBubbleData(
new Date("11 Feb 2017 GMT").getTime(),
20,
{
min: 10,
max: 60,
}
),
},
{
name: "Bubble2",
data: generateBubbleData(
new Date("11 Feb 2017 GMT").getTime(),
20,
{
min: 10,
max: 60,
}
),
},
{
name: "Bubble3",
data: generateBubbleData(
new Date("11 Feb 2017 GMT").getTime(),
20,
{
min: 10,
max: 60,
}
),
},
{
name: "Bubble4",
data: generateBubbleData(
new Date("11 Feb 2017 GMT").getTime(),
20,
{
min: 10,
max: 60,
}
),
},
],
chart: {
height: 350,
type: "bubble",
},
dataLabels: {
enabled: false,
},
fill: {
opacity: 0.8,
},
xaxis: {
tickAmount: 12,
type: "category",
},
yaxis: {
max: 70,
},
colors: [primary, success, warning, danger],
};
var chart = new ApexCharts(document.querySelector(apexChart), options);
chart.render();
};
var _demo9 = function () {
const apexChart = "#chart_9";
var options = {
series: [
{
name: "SAMPLE A",
data: [
[16.4, 5.4],
[21.7, 2],
[25.4, 3],
[19, 2],
[10.9, 1],
[13.6, 3.2],
[10.9, 7.4],
[10.9, 0],
[10.9, 8.2],
[16.4, 0],
[16.4, 1.8],
[13.6, 0.3],
[13.6, 0],
[29.9, 0],
[27.1, 2.3],
[16.4, 0],
[13.6, 3.7],
[10.9, 5.2],
[16.4, 6.5],
[10.9, 0],
[24.5, 7.1],
[10.9, 0],
[8.1, 4.7],
[19, 0],
[21.7, 1.8],
[27.1, 0],
[24.5, 0],
[27.1, 0],
[29.9, 1.5],
[27.1, 0.8],
[22.1, 2],
],
},
{
name: "SAMPLE B",
data: [
[36.4, 13.4],
[1.7, 11],
[5.4, 8],
[9, 17],
[1.9, 4],
[3.6, 12.2],
[1.9, 14.4],
[1.9, 9],
[1.9, 13.2],
[1.4, 7],
[6.4, 8.8],
[3.6, 4.3],
[1.6, 10],
[9.9, 2],
[7.1, 15],
[1.4, 0],
[3.6, 13.7],
[1.9, 15.2],
[6.4, 16.5],
[0.9, 10],
[4.5, 17.1],
[10.9, 10],
[0.1, 14.7],
[9, 10],
[12.7, 11.8],
[2.1, 10],
[2.5, 10],
[27.1, 10],
[2.9, 11.5],
[7.1, 10.8],
[2.1, 12],
],
},
{
name: "SAMPLE C",
data: [
[21.7, 3],
[23.6, 3.5],
[24.6, 3],
[29.9, 3],
[21.7, 20],
[23, 2],
[10.9, 3],
[28, 4],
[27.1, 0.3],
[16.4, 4],
[13.6, 0],
[19, 5],
[22.4, 3],
[24.5, 3],
[32.6, 3],
[27.1, 4],
[29.6, 6],
[31.6, 8],
[21.6, 5],
[20.9, 4],
[22.4, 0],
[32.6, 10.3],
[29.7, 20.8],
[24.5, 0.8],
[21.4, 0],
[21.7, 6.9],
[28.6, 7.7],
[15.4, 0],
[18.1, 0],
[33.4, 0],
[16.4, 0],
],
},
],
chart: {
height: 350,
type: "scatter",
zoom: {
enabled: true,
type: "xy",
},
},
xaxis: {
tickAmount: 10,
labels: {
formatter: function (val) {
return parseFloat(val).toFixed(1);
},
},
},
yaxis: {
tickAmount: 7,
},
colors: [primary, success, warning],
};
var chart = new ApexCharts(document.querySelector(apexChart), options);
chart.render();
};
var _demo10 = function () {
const apexChart = "#chart_10";
var options = {
series: [
{
name: "Jan",
data: generateData(20, {
min: -30,
max: 55,
}),
},
{
name: "Feb",
data: generateData(20, {
min: -30,
max: 55,
}),
},
{
name: "Mar",
data: generateData(20, {
min: -30,
max: 55,
}),
},
{
name: "Apr",
data: generateData(20, {
min: -30,
max: 55,
}),
},
{
name: "May",
data: generateData(20, {
min: -30,
max: 55,
}),
},
{
name: "Jun",
data: generateData(20, {
min: -30,
max: 55,
}),
},
{
name: "Jul",
data: generateData(20, {
min: -30,
max: 55,
}),
},
{
name: "Aug",
data: generateData(20, {
min: -30,
max: 55,
}),
},
{
name: "Sep",
data: generateData(20, {
min: -30,
max: 55,
}),
},
],
chart: {
height: 350,
type: "heatmap",
},
plotOptions: {
heatmap: {
shadeIntensity: 0.5,
colorScale: {
ranges: [
{
from: -30,
to: 5,
name: "low",
color: success,
},
{
from: 6,
to: 20,
name: "medium",
color: primary,
},
{
from: 21,
to: 45,
name: "high",
color: warning,
},
{
from: 46,
to: 55,
name: "extreme",
color: danger,
},
],
},
},
},
dataLabels: {
enabled: false,
},
};
var chart = new ApexCharts(document.querySelector(apexChart), options);
chart.render();
};
var _demo11 = function () {
const apexChart = "#chart_11";
var options = {
series: [44, 55, 41, 17, 15],
chart: {
width: 380,
type: "donut",
},
responsive: [
{
breakpoint: 480,
options: {
chart: {
width: 200,
},
legend: {
position: "bottom",
},
},
},
],
colors: [primary, success, warning, danger, info],
};
var chart = new ApexCharts(document.querySelector(apexChart), options);
chart.render();
};
var _demo12 = function () {
const apexChart = "#chart_12";
var options = {
series: [44, 55, 13, 43, 22],
chart: {
width: 380,
type: "pie",
},
labels: ["Team A", "Team B", "Team C", "Team D", "Team E"],
responsive: [
{
breakpoint: 480,
options: {
chart: {
width: 200,
},
legend: {
position: "bottom",
},
},
},
],
colors: [primary, success, warning, danger, info],
};
var chart = new ApexCharts(document.querySelector(apexChart), options);
chart.render();
};
var _demo13 = function () {
const apexChart = "#chart_13";
var options = {
series: [44, 55, 67, 83],
chart: {
height: 350,
type: "radialBar",
},
plotOptions: {
radialBar: {
dataLabels: {
name: {
fontSize: "22px",
},
value: {
fontSize: "16px",
},
total: {
show: true,
label: "Total",
formatter: function (w) {
// By default this function returns the average of all series. The below is just an example to show the use of custom formatter function
return 249;
},
},
},
},
},
labels: ["Apples", "Oranges", "Bananas", "Berries"],
colors: [primary, success, warning, danger],
};
var chart = new ApexCharts(document.querySelector(apexChart), options);
chart.render();
};
var _demo14 = function () {
const apexChart = "#chart_14";
var options = {
series: [
{
name: "Series 1",
data: [80, 50, 30, 40, 100, 20],
},
{
name: "Series 2",
data: [20, 30, 40, 80, 20, 80],
},
{
name: "Series 3",
data: [44, 76, 78, 13, 43, 10],
},
],
chart: {
height: 350,
type: "radar",
dropShadow: {
enabled: true,
blur: 1,
left: 1,
top: 1,
},
},
stroke: {
width: 0,
},
fill: {
opacity: 0.4,
},
markers: {
size: 0,
},
xaxis: {
categories: ["2011", "2012", "2013", "2014", "2015", "2016"],
},
colors: [primary, success, warning],
};
var chart = new ApexCharts(document.querySelector(apexChart), options);
chart.render();
};
return {
// public functions
init: function () {
_demo1();
_demo2();
_demo3();
_demo4();
_demo5();
_demo6();
_demo7();
_demo8();
_demo9();
_demo10();
_demo11();
_demo12();
_demo13();
_demo14();
},
};
})();
jQuery(document).ready(function () {
KTApexChartsDemo.init();
});
| 32.191223 | 168 | 0.256257 |
15ca86bd7802b0c07cd313d37b42b0061dbb37fd | 146 | js | JavaScript | src/test/resources/fixtures/es5Reserved.js | eagle-io/jshint-javaport | 87dd6ce76780ed25e4dbae0984685e7047f0f301 | [
"MIT"
] | 1 | 2019-06-07T14:17:35.000Z | 2019-06-07T14:17:35.000Z | src/test/resources/fixtures/es5Reserved.js | eagle-io/jshint-javaport | 87dd6ce76780ed25e4dbae0984685e7047f0f301 | [
"MIT"
] | 6 | 2019-06-07T14:16:43.000Z | 2022-01-17T13:55:59.000Z | src/test/resources/fixtures/es5Reserved.js | eagle-io/jshint-javaport | 87dd6ce76780ed25e4dbae0984685e7047f0f301 | [
"MIT"
] | 2 | 2020-04-07T04:16:07.000Z | 2020-04-29T01:53:15.000Z | var x = {
default: 10,
in: 1
};
var default = 10;
function new () {}
function x(class) {}
x.default = 5;
x.in = 2;
function in() {} | 13.272727 | 21 | 0.520548 |
15cad6d9ed5b97ef502b5a97fc85177c7a92214d | 2,258 | js | JavaScript | docs/assets/js/61.e2bf55fd.js | limuen/d2-crud-plus | d07e1d03acf7aae2bccf487ce17e112cdd3393a9 | [
"MIT"
] | 1 | 2021-04-22T03:08:20.000Z | 2021-04-22T03:08:20.000Z | docs/assets/js/61.e2bf55fd.js | limuen/d2-crud-plus | d07e1d03acf7aae2bccf487ce17e112cdd3393a9 | [
"MIT"
] | null | null | null | docs/assets/js/61.e2bf55fd.js | limuen/d2-crud-plus | d07e1d03acf7aae2bccf487ce17e112cdd3393a9 | [
"MIT"
] | null | null | null | (window.webpackJsonp=window.webpackJsonp||[]).push([[61],{510:function(t,v,_){"use strict";_.r(v);var e=_(52),d=Object(e.a)({},(function(){var t=this,v=t.$createElement,_=t._self._c||v;return _("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[_("h1",{attrs:{id:"d2p-ueditor"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#d2p-ueditor"}},[t._v("#")]),t._v(" d2p-ueditor")]),t._v(" "),_("h2",{attrs:{id:"props"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#props"}},[t._v("#")]),t._v(" Props")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("Name")]),t._v(" "),_("th",[t._v("Description")]),t._v(" "),_("th",[t._v("Type")]),t._v(" "),_("th",[t._v("Required")]),t._v(" "),_("th",[t._v("Default")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("value")]),t._v(" "),_("td",[t._v("富文本")]),t._v(" "),_("td",[_("code",[t._v("String")])]),t._v(" "),_("td",[_("code",[t._v("false")])]),t._v(" "),_("td",[t._v("''")])]),t._v(" "),_("tr",[_("td",[t._v("config")]),t._v(" "),_("td",[t._v("编辑器配置请参考:http://fex.baidu.com/ueditor/#start-config")]),t._v(" "),_("td",[_("code",[t._v("Object")])]),t._v(" "),_("td",[_("code",[t._v("false")])]),t._v(" "),_("td",[t._v("[object Object]")])]),t._v(" "),_("tr",[_("td",[t._v("name")]),t._v(" "),_("td",[t._v("编辑器名称")]),t._v(" "),_("td",[_("code",[t._v("String")])]),t._v(" "),_("td",[_("code",[t._v("false")])]),t._v(" "),_("td",[t._v("''")])])])]),t._v(" "),_("h2",{attrs:{id:"events"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#events"}},[t._v("#")]),t._v(" Events")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("Event Name")]),t._v(" "),_("th",[t._v("Description")]),t._v(" "),_("th",[t._v("Parameters")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("change")]),t._v(" "),_("td",[t._v("-")]),t._v(" "),_("td",[t._v("-")])]),t._v(" "),_("tr",[_("td",[t._v("input")]),t._v(" "),_("td",[t._v("-")]),t._v(" "),_("td",[t._v("-")])]),t._v(" "),_("tr",[_("td",[t._v("beforeInit")]),t._v(" "),_("td",[t._v("这么做是为了支持 Vue SSR,因为如果把 id 属性放在 data 里会导致服务端和客户端分别计算该属性的值,而造成 id 不匹配无法初始化的 BUG")]),t._v(" "),_("td",[t._v("-")])]),t._v(" "),_("tr",[_("td",[t._v("ready")]),t._v(" "),_("td",[t._v("-")]),t._v(" "),_("td",[t._v("-")])])])])])}),[],!1,null,null,null);v.default=d.exports}}]); | 2,258 | 2,258 | 0.488043 |
15cb834632ed983a4a2e295f7dfd9ab7bb88a1e7 | 1,763 | js | JavaScript | api/v2/middlewares/verifyToken.js | Anuoluwa/FirstForFood | 74540d2e479717b5b0bc07cf8105f88f3c641b57 | [
"MIT"
] | null | null | null | api/v2/middlewares/verifyToken.js | Anuoluwa/FirstForFood | 74540d2e479717b5b0bc07cf8105f88f3c641b57 | [
"MIT"
] | 7 | 2018-09-13T15:17:07.000Z | 2018-10-03T17:18:12.000Z | api/v2/middlewares/verifyToken.js | Anuoluwa/FirstForFood | 74540d2e479717b5b0bc07cf8105f88f3c641b57 | [
"MIT"
] | null | null | null | import jwt from 'jsonwebtoken';
import dotenv from 'dotenv';
dotenv.config();
/** @function verifyAdmin
/* @param {object} req req object
/* @param {object} res res object
/* @param {object} next res object
/* @returns {Object} res status 401 if there is no token
/* @returns {Object} status 501 server error
*/
const verifyToken = (req, res, next) => {
if (typeof req.headers.authorization === 'undefined') {
return res.status(400).json({
status: 'operation not successful',
message: 'Headers key: "Authorization" and "token XXXXXXXXX" should be valid',
});
}
if (req.headers.authorization === '') {
return res.status(400).json({
status: 'operation not successful',
message: 'Headers key: "Authorization" and "token XXXXXXXXX" should not be empty',
});
}
const token = req.headers.authorization.split(' ')[1];
jwt.verify(token, process.env.SECRET_KEY, (err, decoded) => {
if (err) {
return res.status(401).send({
auth: 'unauthorized',
message: 'Failed to authenticate token',
});
}
req.user = decoded;
next();
});
};
// const verifyToken = (req, res, next) => {
// try {
// const secret = process.env.SECRET_KEY;
// const token = req.headers.authorization.split(' ')[1];
// if (!token) {
// return res.status(400).json({
// status: 'Unathorized',
// message: 'No token provided',
// });
// }
// const decoded = jwt.verify(token, secret);
// req.userId = decoded;
// next();
// } catch (error) {
// return res.status(500).json({
// status: 'Server Error',
// message: 'Sorry, could not verify, try again later!',
// });
// }
// return null;
// };
export default verifyToken;
| 27.546875 | 88 | 0.597277 |
15cb968a59d8534586f778cf4074a36d80befac7 | 30,825 | js | JavaScript | grails-app/assets/javascripts/taglib/EditorSwitch.js | one-touch-pipeline/otp | d33379f11854bd8aa5881cb254d24fa5b6de39ce | [
"Unlicense",
"MIT"
] | null | null | null | grails-app/assets/javascripts/taglib/EditorSwitch.js | one-touch-pipeline/otp | d33379f11854bd8aa5881cb254d24fa5b6de39ce | [
"Unlicense",
"MIT"
] | null | null | null | grails-app/assets/javascripts/taglib/EditorSwitch.js | one-touch-pipeline/otp | d33379f11854bd8aa5881cb254d24fa5b6de39ce | [
"Unlicense",
"MIT"
] | null | null | null | /*
* Copyright 2011-2020 The OTP authors
*
* 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.
*/
/*global $: false, window: false
*/
$(function() {
var success = function(title = "Operation completed", message = "The change was successful.") {
if ($.otp.toaster) {
$.otp.toaster.showSuccessToast(title, message);
} else {
$.otp.infoMessage(title + ": " + message);
}
}
var failure = function(title = "Unknown error", message = "An unknown error occurred.") {
if ($.otp.toaster) {
$.otp.toaster.showErrorToast(title, message);
} else {
$.otp.warningMessage(title + ". " + message);
}
}
$("td.add-table-buttons button.add").on("click", function (event) {
"use strict";
event.preventDefault();
var p = $(this).parent();
$(".save", p).show();
$(".cancel", p).show();
$(".add", p).hide();
$(".add-table-fields", p.parent().parent()).show();
});
$("td.add-table-buttons button.cancel").on("click", function (event) {
"use strict";
event.preventDefault();
var p = $(this).parent();
$(".save", p).hide();
$(".cancel", p).hide();
$(".add", p).show();
$(".add-table-fields", p.parent().parent()).hide();
});
$("tr.edit-table-buttons button.button-edit").on("click", function (event) {
"use strict";
event.preventDefault();
var p = $(this).parent();
$(".save", p).show();
$(".cancel", p).show();
$(".button-edit", p).hide();
$(".edit-fields", p.parent()).show();
$(".show-fields", p.parent()).hide();
});
$("tr.edit-table-buttons button.cancel").on("click", function (event) {
"use strict";
event.preventDefault();
var p = $(this).parent();
$(".save", p).hide();
$(".cancel", p).hide();
$(".button-edit", p).show();
$(".edit-fields", p.parent()).hide();
$(".show-fields", p.parent()).show();
});
$.otp.editorswitch = {};
$("div.edit-switch .edit-switch-label button.js-edit").on("click", function () { outerContainerSwitch($(this)) });
$("div.edit-switch .edit-switch-label button.js-remove").on("click", function() { outerContainerSwitch($(this)) });
function outerContainerSwitch (that) {
"use strict";
var outerContainer = that.parent().parent();
$(".edit-switch-editor", outerContainer).show();
$(".edit-switch-label", outerContainer).hide();
}
/*jslint unparam: true */
$("div.edit-switch-text .edit-switch-editor button.save, div.edit-switch-integer .edit-switch-editor button.save").on("click", function () {
"use strict";
var container, outerContainer, inputField;
container = $(this).parent();
outerContainer = container.parent();
inputField = $("input[name=value]", container);
if (!inputField[0].validity.valid) {
window.alert("The input is not valid. Please provide a valid input value.");
return
}
$.ajax({
url: $("input:hidden[name=target]", container).val(),
dataType: "json",
type: "POST",
data: {value: inputField.val()},
success: function (data) {
if (data.success) {
success("Success", "Data stored successfully");
$("p.edit-switch-label span", outerContainer).text($("input[name=value]", container).val());
} else {
failure("Data could not be stored", data.error);
$("input[name=value]", container).val($("p.edit-switch-label span", outerContainer).text());
}
},
error: function (jqXHR, textStatus, errorThrown) {
if (jqXHR && jqXHR.responseJSON && jqXHR.responseJSON.message) {
failure("Request failed", jqXHR.responseJSON.message);
} else {
failure(textStatus + " occurred while processing the data", "Reason: " + errorThrown);
}
$("input[name=value]", container).val($("p.edit-switch-label span", outerContainer).text());
}
});
$("p.edit-switch-editor", outerContainer).hide();
$("p.edit-switch-label", outerContainer).show();
});
/*jslint unparam: true */
$("div.edit-switch-text-area p.edit-switch-editor button.save").on("click", function () {
"use strict";
var container, outerContainer;
container = $(this).parent();
outerContainer = container.parent();
$.ajax({
url: $("input:hidden[name=target]", container).val(),
dataType: "json",
type: "POST",
data: {value: $("textarea", container).val()},
success: function (data) {
if (data.success) {
success("Success", "Data stored successfully");
$("p.edit-switch-label span", outerContainer).text($("textarea", container).val());
if (data.updateMap) {
for (var key in data.updateMap) {
var el = $("." + key, outerContainer);
el.text(data.updateMap[key]);
}
}
} else {
failure("Data could not be stored", data.error);
$("textarea", container).val($("p.edit-switch-label span", outerContainer).text());
}
},
error: function (jqXHR, textStatus, errorThrown) {
if (jqXHR && jqXHR.responseJSON && jqXHR.responseJSON.message) {
failure("Request failed", jqXHR.responseJSON.message);
} else {
failure(textStatus + " occurred while processing the data", "Reason: " + errorThrown);
}
$("textarea", container).val($("p.edit-switch-label span", outerContainer).text());
}
});
$("p.edit-switch-editor", outerContainer).hide();
$("p.edit-switch-label", outerContainer).show();
});
/*jslint unparam: true */
$("div.edit-switch-url p.edit-switch-editor button.save").on("click", function () {
"use strict";
var container, outerContainer;
container = $(this).parent();
outerContainer = container.parent();
$.ajax({
url: $("input:hidden[name=target]", container).val(),
dataType: "json",
type: "POST",
data: { value: $("input:text[name=value]", container).val() },
success: function (data) {
if (data.success) {
success("Success", "Data stored successfully");
$("p.edit-switch-label span", outerContainer).text($("input:text[name=value]", container).val());
} else {
failure("Data could not be stored", data.error);
$("input:text[name=value]", container).val($("p.edit-switch-label span", outerContainer).text());
}
},
error: function (jqXHR, textStatus, errorThrown) {
if (jqXHR && jqXHR.responseJSON && jqXHR.responseJSON.message) {
failure("Data could not be stored", jqXHR.responseJSON.message);
} else {
failure("Data could not be stored", "Reason: " + errorThrown);
}
}
});
$("p.edit-switch-editor", outerContainer).hide();
$("p.edit-switch-label", outerContainer).show();
});
$("div.edit-switch-drop-down p.edit-switch-editor button.delete").on("click", function () {deleteRole($(this))});
function deleteRole(that) {
"use strict";
var container, outerContainer, outerOuterContainer;
container = that.parent();
outerContainer = container.parent();
outerOuterContainer = outerContainer.parent();
var confirmationText = $("button[data-confirmation]", container).attr("data-confirmation");
if (confirmationText) {
var confirmed = confirm(confirmationText);
if (confirmed == false) {
return
}
}
$.ajax({
url: $("input:hidden[name=targetDelete]", container).val(),
dataType: "json",
type: "POST",
data: { value: $("input:hidden[name=targetDeleteValue]", container).attr("value") },
success: function (data) {
if (data.success) {
success("Success", "Data stored successfully");
$(outerContainer).remove();
var submitContainer = $("div[class=submit-container]", outerOuterContainer)
var selectRoles = $("select[name=newRoles]", submitContainer);
selectRoles.append("<option value=" + data.currentRole + ">" + data.currentRole + "</option>")
} else {
failure("Data could not be stored", data.error);
$("p.edit-switch-editor", outerContainer).hide();
$("p.edit-switch-label", outerContainer).show();
}
},
error: function (jqXHR, textStatus, errorThrown) {
if (jqXHR && jqXHR.responseJSON && jqXHR.responseJSON.message) {
failure("Request failed", jqXHR.responseJSON.message);
} else {
failure(textStatus + " occurred while processing the data", "Reason: " + errorThrown);
}
$("p.edit-switch-editor", outerContainer).hide();
$("p.edit-switch-label", outerContainer).show();
}
});
}
$("div.submit-container button.addRole").on("click", function () {
"use strict";
var container, outerContainer;
container = $(this).parent();
outerContainer = container.parent();
var selectedNewRoles = []
var selectNewRoles = $("select[name=newRoles]", container).children();
for (let i=0; i<selectNewRoles.length; i++) {
if (selectNewRoles[i].selected) {
selectedNewRoles.push(selectNewRoles[i].value)
}
}
if (selectedNewRoles.length !== 0) {
var confirmationText = $("button[data-confirmation]", container).attr("data-confirmation");
if (confirmationText) {
var confirmed = confirm(confirmationText);
if (confirmed === false) {
return
}
}
}
$.ajax({
url: $("input:hidden[name=targetAddRole]", container).val(),
dataType: "json",
type: "POST",
data: { value: JSON.stringify(selectedNewRoles) },
success: function (data) {
if (data.success) {
success("Success", "Data stored successfully");
// Update drop down menue
for (let i=0; i<selectNewRoles.length; i++) {
for (let j=0; j<data.currentProjectRole.length; j++) {
if (selectNewRoles[i].value === data.currentProjectRole[j]) {
$(selectNewRoles[i]).remove();
}
}
}
// Update Role-column
for (let j=0; j<data.newProjectRolesNodes.length; j++) {
outerContainer.prepend(data.newProjectRolesNodes[j])
// update event listener for added object only
$(outerContainer.children()[0]).find("button.js-remove").on("click", function() { outerContainerSwitch($(this)) });
$(outerContainer.children()[0]).find("button.delete").on("click", function () {deleteRole($(this))});
$(outerContainer.children()[0]).find("button.cancel").on("click", function () {cancelAddRoleCommand($(this))});
}
} else {
failure("Data could not be stored", data.error);
}
},
error: function (jqXHR, textStatus, errorThrown) {
if (jqXHR && jqXHR.responseJSON && jqXHR.responseJSON.message) {
failure("Request failed", jqXHR.responseJSON.message);
} else {
failure(textStatus + " occurred while processing the data", "Reason: " + errorThrown);
}
}
});
});
$("div.edit-switch-drop-down p.edit-switch-editor button.save").on("click", function () {saveRole($(this))});
function saveRole (that) {
"use strict";
var container, outerContainer;
container = that.parent();
outerContainer = container.parent();
var confirmationText = $("button[data-confirmation]", container).attr("data-confirmation");
if (confirmationText) {
var confirmed = confirm(confirmationText);
if (confirmed == false) {
return
}
}
var successCallback = $(that).attr("data-success-handler");
$.ajax({
url: $("input:hidden[name=target]", container).val(),
dataType: "json",
type: "POST",
data: { value: $("select option:selected", container).attr("value") },
success: function (data) {
if (data.success) {
success("Success", "Data stored successfully");
$("p.edit-switch-label span", outerContainer).text($("select option:selected", container).text());
if (successCallback) {
window[successCallback](container, data.additionalData)
}
} else {
failure("Data could not be stored", data.error);
}
},
error: function (jqXHR, textStatus, errorThrown) {
if (jqXHR && jqXHR.responseJSON && jqXHR.responseJSON.message) {
failure("Request failed", jqXHR.responseJSON.message);
} else {
failure(textStatus + " occurred while processing the data", "Reason: " + errorThrown);
}
}
});
$("p.edit-switch-editor", outerContainer).hide();
$("p.edit-switch-label", outerContainer).show();
}
$("div.edit-switch-date p.edit-switch-editor button.save").on("click", function () {
"use strict";
var container, outerContainer;
container = $(this).parent();
outerContainer = container.parent();
$.ajax({
url: $("input:hidden[name=target]", container).val(),
dataType: "json",
type: "POST",
data: { value: $('input[type="date"]', container).val() },
success: function (data) {
if (data.success) {
success("Success", "Data stored successfully");
$("p.edit-switch-label span", outerContainer).text($('input[type="date"]', container).val());
} else {
failure("Data could not be stored", data.error);
}
},
error: function (jqXHR, textStatus, errorThrown) {
if (jqXHR && jqXHR.responseJSON && jqXHR.responseJSON.message) {
failure("Request failed", jqXHR.responseJSON.message);
} else {
failure(textStatus + " occurred while processing the data", "Reason: " + errorThrown);
}
}
});
$("p.edit-switch-editor", outerContainer).hide();
$("p.edit-switch-label", outerContainer).show();
});
/*jslint unparam: true */
$("div.edit-switch-checkboxes p.edit-switch-editor button.save").on("click", function () {
"use strict";
var container, outerContainer, value;
container = $(this).parent();
outerContainer = container.parent();
value = {};
$("input:checked", container).each(function (index) {
value["value["+index+"]"] = this.name
});
$.ajax({
url: $("input:hidden[name=target]", container).val(),
dataType: "json",
type: "POST",
data: value,
success: function (data) {
if (data.success) {
success("Success", "Data stored successfully");
var names = [];
$("input:checkbox", container).each(function () {
if (this.checked) {
names.push(this.name);
$(this).data("checked", true)
} else {
$(this).data("checked", false)
}
});
$("p.edit-switch-label span", outerContainer).text(names.join(", ") || "(None selected)");
} else {
failure("Data could not be stored", data.error);
resetCheckboxes(container);
}
},
error: function (jqXHR, textStatus, errorThrown) {
if (jqXHR && jqXHR.responseJSON && jqXHR.responseJSON.message) {
failure("Request failed", jqXHR.responseJSON.message);
} else {
failure(textStatus + " occurred while processing the data", "Reason: " + errorThrown);
}
resetCheckboxes(container);
}
});
$("p.edit-switch-editor", outerContainer).hide();
$("p.edit-switch-label", outerContainer).show();
});
function resetCheckboxes(container) {
$("input:checkbox", container).each(function () {
this.checked = $(this).data("checked");
});
}
/*jslint unparam: true */
$("div.edit-switch-new-value p.edit-switch-editor button.save").on("click", function () {
"use strict";
var container, outerContainer;
container = $(this).parent();
outerContainer = container.parent();
$.ajax({
url: $("input:hidden[name=target]", container).val(),
dataType: "json",
type: "POST",
data: { value: $("select option:selected", container).text() },
success: function (data) {
if (data.success) {
success("Success", "Data stored successfully");
$("p.edit-switch-label span", outerContainer).text($("input:text[name=value]", container).val());
} else {
failure("Data could not be stored", data.error);
$("input:text[name=value]", container).val($("p.edit-switch-label span", outerContainer).text());
}
},
error: function (jqXHR, textStatus, errorThrown) {
if (jqXHR && jqXHR.responseJSON && jqXHR.responseJSON.message) {
failure("Request failed", jqXHR.responseJSON.message);
} else {
failure(textStatus + " occurred while processing the data", "Reason: " + errorThrown);
}
$("input:text[name=value]", container).val($("p.edit-switch-label span", outerContainer).text());
}
});
$("p.edit-switch-editor", outerContainer).hide();
$("p.edit-switch-label", outerContainer).show();
window.setTimeout(function() { location.reload() }, 300); //reloads page after 0.3 seconds
});
/*jslint unparam: true */
$("div.edit-switch-new-free-text-value p.edit-switch-editor button.save").on("click", function () {
"use strict";
var container, outerContainer;
container = $(this).parent();
outerContainer = container.parent();
$.ajax({
url: $("input:hidden[name=target]", container).val(),
dataType: "json",
type: "POST",
data: { value: $("input:text[name=value]", container).val() },
success: function (data) {
if (data.success) {
success("Success", "Data stored successfully");
$("p.edit-switch-label span", outerContainer).text($("input:text[name=value]", container).val());
} else {
failure("Data could not be stored", data.error);
$("input:text[name=value]", container).val($("p.edit-switch-label span", outerContainer).text());
}
},
error: function (jqXHR, textStatus, errorThrown) {
if (jqXHR && jqXHR.responseJSON && jqXHR.responseJSON.message) {
failure("Request failed", jqXHR.responseJSON.message);
} else {
failure(textStatus + " occurred while processing the data", "Reason: " + errorThrown);
}
$("input:text[name=value]", container).val($("p.edit-switch-label span", outerContainer).text());
}
});
$("p.edit-switch-editor", outerContainer).hide();
$("p.edit-switch-label", outerContainer).show();
window.setTimeout(function() { location.reload() }, 300); //reloads page after 0.3 seconds
});
/*jslint unparam: true */
$("div.edit-switch-new-free-text-values span.edit-switch-editor button.save").on("click", function () {
"use strict";
var container, outerContainer, data = {};
container = $(this).parent();
outerContainer = container.parent();
$("input:text", container).each(function() {
data[this.name] = $(this).val();
});
$("input:checked", container).each(function() {
data[this.name] = $(this).is(":checked");
});
$("select", container).each(function() {
data[this.name] = $(this).val();
});
$.ajax({
url: $("input:hidden[name=target]", container).val(),
dataType: "json",
type: "POST",
data: data,
success: function (data) {
if (data.success) {
success("Success", "Data stored successfully");
window.setTimeout(function() { location.reload() }, 300);
} else {
failure("Data could not be stored", data.error);
}
},
error: function (jqXHR, textStatus, errorThrown) {
if (jqXHR && jqXHR.responseJSON && jqXHR.responseJSON.message) {
failure("Request failed", jqXHR.responseJSON.message);
} else {
failure(textStatus + " occurred while processing the data", "Reason: " + errorThrown);
}
}
});
$("span.edit-switch-editor", outerContainer).hide();
$("span.edit-switch-label", outerContainer).show();
});
$("div.edit-switch-toggle p.edit-switch-editor button.toggle").on("click", function () {
"use strict";
var container, outerContainer, orgVal, invVal;
container = $(this).parent();
outerContainer = container.parent();
var confirmationText = $("button[data-confirmation]", container).attr("data-confirmation");
if (confirmationText) {
var confirmed = confirm(confirmationText);
if (confirmed == false) {
return
}
}
orgVal = $("input:hidden[name=value]", container).val();
invVal = (orgVal === "true" ? "false" : "true");
$.ajax({
url: $("input:hidden[name=target]", container).val(),
dataType: "json",
type: "POST",
data: { "value": invVal },
success: function (data) {
if (data.success) {
success("Success", "Data stored successfully");
$.each(["label", "editor"], function () {
$("p.edit-switch-" + this + " span", outerContainer).removeClass("icon-" + orgVal).addClass("icon-" + invVal);
});
if (data.tooltip) {
$("p.edit-switch-label", outerContainer)[0].title = data.tooltip;
}
$("input:hidden[name=value]", container).attr("value", invVal);
var pageReload = $("button[data-pageReload]", container).attr("data-pageReload");
if (pageReload && pageReload == 'true') {
window.setTimeout(function() { location.reload() }, 100); //reloads page after 0.5 seconds
}
} else {
failure("Data could not be stored", data.error);
}
},
error: function (jqXHR, textStatus, errorThrown) {
if (jqXHR && jqXHR.responseJSON && jqXHR.responseJSON.message) {
failure("Request failed", jqXHR.responseJSON.message);
} else {
failure(textStatus + " occurred while processing the data", "Reason: " + errorThrown);
}
}
});
$("p.edit-switch-editor", outerContainer).hide();
$("p.edit-switch-label", outerContainer).show();
});
$("div.edit-switch .edit-switch-editor button.cancel").on("click", function () {cancelAddRoleCommand($(this))});
function cancelAddRoleCommand(that) {
"use strict";
var outerContainer = that.parent().parent();
$(".edit-switch-editor", outerContainer).hide();
$(".edit-switch-label", outerContainer).show();
$(".edit-switch-input", $(this).parent()).val($("p.edit-switch-label span", outerContainer).text());
if (outerContainer.hasClass("edit-switch-checkboxes")) {
resetCheckboxes(outerContainer);
}
}
$("div.multi-edit-switch .edit-switch-label button.js-edit").on("click", function () {
"use strict";
var outerContainer = $(this).parent().parent();
var multiInputField = $(".multi-input-field", outerContainer);
var template = $(".inputTemplate", outerContainer);
var dataValues = multiInputField.data('values');
var first = true;
for (var i in dataValues) {
var field = $("<div class=\"field\"></div>");
var clonedField = template.clone();
clonedField.removeClass("inputTemplate");
clonedField.val(dataValues[i]);
field.append(clonedField);
if (first) {
field.append(" <button class=\"add-field\">+</button>");
first=false;
} else {
field.append(" <button class=\"remove-field\">-</button>");
}
$.otp.applySelect2($("select.use-select-2", clonedField));
multiInputField.append(field);
}
$(".edit-switch-editor", outerContainer).show();
$(".edit-switch-label", outerContainer).hide();
});
$("div.multi-edit-switch .edit-switch-editor button.cancel").on("click", function () {
"use strict";
var outerContainer = $(this).parent().parent();
$(".edit-switch-editor", outerContainer).hide();
$(".edit-switch-label", outerContainer).show();
$(".multi-input-field .field", outerContainer).remove()
});
/*jslint unparam: true */
$("div.edit-switch-multi-input .edit-switch-editor button.save").on("click", function () {
"use strict";
var container, outerContainer, dataValues = {}, i=0, displayValue = '';
container = $(this).parent();
outerContainer = container.parent();
var multiInputField = $(".multi-input-field", outerContainer);
var valid = true;
$("input", multiInputField).each(function() {
if (!($(this)[0].validity.valid)) {
window.alert("The input is not valid. Please provide a valid input value.");
valid = false;
return
}
dataValues['value['+i+']'] = $(this).val();
displayValue = displayValue + $(this).val() + ', ';
i++;
});
if (!valid) {
return
}
$.ajax({
url: $("input:hidden[name=target]", container).val(),
dataType: "json",
type: "POST",
data: dataValues,
success: function (data) {
if (data.success) {
success("Success", "Data stored successfully");
$(".edit-switch-label span", outerContainer).text(displayValue);
multiInputField.data('values', dataValues);
} else {
failure("Data could not be stored", data.error);
}
},
error: function (jqXHR, textStatus, errorThrown) {
if (jqXHR && jqXHR.responseJSON && jqXHR.responseJSON.message) {
failure("Request failed", jqXHR.responseJSON.message);
} else {
failure(textStatus + " occurred while processing the data", "Reason: " + errorThrown);
}
}
});
$(".edit-switch-editor", outerContainer).hide();
$(".edit-switch-label", outerContainer).show();
$(".field", multiInputField).remove()
});
});
| 44.352518 | 144 | 0.518086 |
15cc366678205f130116de582fc3430e9787eb1f | 69 | js | JavaScript | node_modules/carbon-icons-svelte/lib/Scalpel24/index.js | seekersapp2013/new | 1e393c593ad30dc1aa8642703dad69b84bad3992 | [
"MIT"
] | null | null | null | node_modules/carbon-icons-svelte/lib/Scalpel24/index.js | seekersapp2013/new | 1e393c593ad30dc1aa8642703dad69b84bad3992 | [
"MIT"
] | null | null | null | node_modules/carbon-icons-svelte/lib/Scalpel24/index.js | seekersapp2013/new | 1e393c593ad30dc1aa8642703dad69b84bad3992 | [
"MIT"
] | null | null | null | import Scalpel24 from "./Scalpel24.svelte";
export default Scalpel24; | 34.5 | 43 | 0.811594 |
15cdec8c7d5ab6185319f6fba8ff9cad27a5bbe3 | 1,716 | js | JavaScript | js/rank_manager.js | JunhuaLin/NAS2048 | b8cd13ce32737f85b63dde5adb5248708234060b | [
"Apache-2.0",
"MIT"
] | null | null | null | js/rank_manager.js | JunhuaLin/NAS2048 | b8cd13ce32737f85b63dde5adb5248708234060b | [
"Apache-2.0",
"MIT"
] | null | null | null | js/rank_manager.js | JunhuaLin/NAS2048 | b8cd13ce32737f85b63dde5adb5248708234060b | [
"Apache-2.0",
"MIT"
] | null | null | null | /**
* Created by junhua on 18-5-13.
*/
const REFRESH_TIME = 60 * 1000;
function RankManager(score_dao) {
var self = this;
this.scoreDao = score_dao;
this.rankTable = document.querySelector(".rank-table");
self.daUpdateRankData([]);
self.updateRankData();
window.setInterval(function () {
self.updateRankData();
}, REFRESH_TIME);
}
RankManager.prototype.daUpdateRankData = function (rankList) {
if (!rankList) {
rankList = [];
}
var self = this;
for (var rowIndex = 1; rowIndex < self.rankTable.rows.length; rowIndex++) {
var row = self.rankTable.rows[rowIndex];
row.cells[0].innerHTML = rowIndex + "";
var scoreObj = null;
if (rowIndex - 1 < rankList.length) {
scoreObj = rankList[rowIndex - 1];
}
console.log("daUpdateRankData:" + scoreObj);
if (scoreObj) {
var username = scoreObj.name;
var index = username.lastIndexOf('@');
if (index > 0) {
username = username.substring(0, index);
}
row.cells[1].innerHTML = username;
row.cells[2].innerHTML = scoreObj.score;
} else {
row.cells[1].innerHTML = "--";
row.cells[2].innerHTML = "--";
}
}
};
RankManager.prototype.updateRankData = function () {
var self = this;
this.scoreDao.getRank(function (rankList) {
self.daUpdateRankData(rankList);
});
};
RankManager.prototype.mockData = function () {
var data = [];
for (var i = 0; i < 9; i++) {
data[i] = {
name: "junhua" + i + "@" + i,
score: 666 - i
};
}
return data;
};
| 24.514286 | 79 | 0.544289 |
15cdf848acc2953f4124085f10b9e39f8673b892 | 1,119 | js | JavaScript | Drivers/CMSIS/docs/RTOS2/html/search/variables_6.js | mlecriva/TrustZone_stm32l5xx | e924d22bb2b11ac363613e372850fb1896ca3a71 | [
"MIT"
] | null | null | null | Drivers/CMSIS/docs/RTOS2/html/search/variables_6.js | mlecriva/TrustZone_stm32l5xx | e924d22bb2b11ac363613e372850fb1896ca3a71 | [
"MIT"
] | null | null | null | Drivers/CMSIS/docs/RTOS2/html/search/variables_6.js | mlecriva/TrustZone_stm32l5xx | e924d22bb2b11ac363613e372850fb1896ca3a71 | [
"MIT"
] | 1 | 2021-09-25T16:44:11.000Z | 2021-09-25T16:44:11.000Z | var searchData=
[
['id',['id',['../rtx__os_8h.html#a1e6927fa1486224044e568f9c370519b',1,'osRtxThread_t::id()'],['../rtx__os_8h.html#a1e6927fa1486224044e568f9c370519b',1,'osRtxTimer_t::id()'],['../rtx__os_8h.html#a1e6927fa1486224044e568f9c370519b',1,'osRtxEventFlags_t::id()'],['../rtx__os_8h.html#a1e6927fa1486224044e568f9c370519b',1,'osRtxMutex_t::id()'],['../rtx__os_8h.html#a1e6927fa1486224044e568f9c370519b',1,'osRtxSemaphore_t::id()'],['../rtx__os_8h.html#a1e6927fa1486224044e568f9c370519b',1,'osRtxMemoryPool_t::id()'],['../rtx__os_8h.html#a1e6927fa1486224044e568f9c370519b',1,'osRtxMessage_t::id()'],['../rtx__os_8h.html#a1e6927fa1486224044e568f9c370519b',1,'osRtxMessageQueue_t::id()'],['../rtx__os_8h.html#a1e6927fa1486224044e568f9c370519b',1,'osRtxObject_t::id()']]],
['idle_5fthread_5fattr',['idle_thread_attr',['../rtx__os_8h.html#a694e5f79185db270e087e94719177ca0',1,'osRtxConfig_t']]],
['isr_5fqueue',['isr_queue',['../rtx__os_8h.html#a534f37c2b021c8242492bedfe48b0338',1,'osRtxInfo_t::isr_queue()'],['../rtx__os_8h.html#a0354dd9f726694843f2a01df98c5641c',1,'osRtxConfig_t::isr_queue()']]]
];
| 159.857143 | 762 | 0.764075 |
15ce0933ce3432fb416c4a37d20c5296e7999a2a | 3,529 | js | JavaScript | dist/Components/Card/CardActions/CardActions.js | purtisolano/material-bread | ec29d493280b9eb529ca91b559ea66eeb8e815e8 | [
"MIT"
] | null | null | null | dist/Components/Card/CardActions/CardActions.js | purtisolano/material-bread | ec29d493280b9eb529ca91b559ea66eeb8e815e8 | [
"MIT"
] | null | null | null | dist/Components/Card/CardActions/CardActions.js | purtisolano/material-bread | ec29d493280b9eb529ca91b559ea66eeb8e815e8 | [
"MIT"
] | null | null | null | var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _propTypes=_interopRequireDefault(require("prop-types"));var _withTheme=_interopRequireDefault(require("../../../Theme/withTheme"));var _Button=_interopRequireDefault(require("../../Button/Button"));var _IconButton=_interopRequireDefault(require("../../IconButton/IconButton"));var _CardActions=_interopRequireDefault(require("./CardActions.styles"));var _jsxFileName="/Users/gerard/dev/reciclos/repos/material-bread/src/Components/Card/CardActions/CardActions.js";var CardActions=function(_Component){(0,_inherits2.default)(CardActions,_Component);function CardActions(){(0,_classCallCheck2.default)(this,CardActions);return(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf2.default)(CardActions).apply(this,arguments));}(0,_createClass2.default)(CardActions,[{key:"_leftActionItems",value:function _leftActionItems(){var leftActionItems=this.props.leftActionItems;return leftActionItems.map(function(item){if(item.name){return _react.default.createElement(_Button.default,{key:item.name,onPress:item.onPress,text:item.name,__source:{fileName:_jsxFileName,lineNumber:22}});}else{return item;}});}},{key:"_rightActionItems",value:function _rightActionItems(){var rightActionItems=this.props.rightActionItems;return rightActionItems.map(function(item){if(item.name){return _react.default.createElement(_IconButton.default,{key:item.name,onPress:item.onPress,name:item.name,size:item.size?item.size:24,color:item.color?item.color:'rgba(0,0,0,.54)',style:{marginLeft:16},__source:{fileName:_jsxFileName,lineNumber:34}});}else{return item;}});}},{key:"render",value:function render(){var _this$props=this.props,style=_this$props.style,leftActionItems=_this$props.leftActionItems,rightActionItems=_this$props.rightActionItems;return _react.default.createElement(_reactNative.View,{style:[_CardActions.default.container,style],__source:{fileName:_jsxFileName,lineNumber:52}},_react.default.createElement(_reactNative.View,{style:_CardActions.default.actions,__source:{fileName:_jsxFileName,lineNumber:53}},leftActionItems&&this._leftActionItems()),_react.default.createElement(_reactNative.View,{style:_CardActions.default.moreActions,__source:{fileName:_jsxFileName,lineNumber:56}},rightActionItems&&this._rightActionItems()));}}]);return CardActions;}(_react.Component);(0,_defineProperty2.default)(CardActions,"propTypes",{children:_propTypes.default.node,style:_propTypes.default.oneOfType([_propTypes.default.object,_propTypes.default.array]),leftActionItems:_propTypes.default.array,rightActionItems:_propTypes.default.array});var _default=(0,_withTheme.default)(CardActions);exports.default=_default; | 3,529 | 3,529 | 0.835081 |
15ce46b66b1683719b0daab083934c840e2ca1a8 | 9,264 | js | JavaScript | test/unit/webworks/identity/identity.js | xianlubird/web-simulator | 51fc660b7da78c90789d06e007daa392cb69e025 | [
"Apache-2.0"
] | 8 | 2015-01-14T23:24:25.000Z | 2017-09-06T22:22:58.000Z | test/unit/webworks/identity/identity.js | xianlubird/web-simulator | 51fc660b7da78c90789d06e007daa392cb69e025 | [
"Apache-2.0"
] | 1 | 2021-02-24T04:38:34.000Z | 2021-02-24T04:38:34.000Z | test/unit/webworks/identity/identity.js | xianlubird/web-simulator | 51fc660b7da78c90789d06e007daa392cb69e025 | [
"Apache-2.0"
] | 7 | 2015-01-13T09:31:56.000Z | 2018-02-15T04:29:52.000Z | /*
* Copyright 2011 Research In Motion Limited.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
describe("webworks identity", function () {
var identity = require('ripple/platform/webworks.handset/2.0.0/server/identity'),
deviceSpec = require('ripple/platform/webworks.handset/2.0.0/spec/device'),
transport = require('ripple/platform/webworks.core/2.0.0/client/transport'),
identityClient = require('ripple/platform/webworks.handset/2.0.0/client/identity'),
platform = require('ripple/platform'),
utils = require('ripple/utils'),
deviceSettings = require('ripple/deviceSettings'),
spec = require('ripple/platform/webworks.handset/2.0.0/spec'),
webworks = require('ripple/platform/webworks.handset/2.0.0/server');
describe("using server", function () {
it("exposes the identity module", function () {
expect(webworks.blackberry.identity).toEqual(identity);
});
});
describe("in spec", function () {
it("includes identity module according to proper object structure", function () {
expect(spec.objects.blackberry.children.identity.path)
.toEqual("webworks.handset/2.0.0/client/identity");
});
});
describe("using client/identity", function () {
describe("IMEI", function () {
it("calls the transport", function () {
spyOn(transport, "call").andReturn("into eternity");
expect(identityClient.IMEI).toEqual("into eternity");
expect(transport.call).toHaveBeenCalledWith("blackberry/identity/IMEI");
});
});
describe("IMSI", function () {
it("calls the transport", function () {
spyOn(transport, "call").andReturn("the oblivion");
expect(identityClient.IMSI).toEqual("the oblivion");
expect(transport.call).toHaveBeenCalledWith("blackberry/identity/IMSI");
});
});
describe("PIN", function () {
it("calls the transport", function () {
spyOn(transport, "call").andReturn("takes all");
expect(identityClient.PIN).toEqual("takes all");
expect(transport.call).toHaveBeenCalledWith("blackberry/identity/PIN");
});
});
describe("getServiceList", function () {
it("calls the transport", function () {
spyOn(transport, "call").andReturn("the conqueror worm");
expect(identityClient.getServiceList()).toEqual("the conqueror worm");
expect(transport.call)
.toHaveBeenCalledWith("blackberry/identity/getServiceList");
});
});
describe("getDefaultService", function () {
it("calls the transport", function () {
spyOn(transport, "call").andReturn("the tragedy");
expect(identityClient.getDefaultService()).toEqual("the tragedy");
expect(transport.call)
.toHaveBeenCalledWith("blackberry/identity/getDefaultService");
});
});
describe("getTransportList", function () {
it("calls the transport", function () {
spyOn(transport, "call").andReturn("is man");
expect(identityClient.getTransportList()).toEqual("is man");
expect(transport.call)
.toHaveBeenCalledWith("blackberry/identity/getTransportList");
});
});
});
describe("using server/identity", function () {
describe("IMEI", function () {
beforeEach(function () {
spyOn(platform, "current").andReturn({
device: {
"identity": {
"IMEI": {control: {value: "1234"}}
}
}
});
});
it("has a correlative device setting", function () {
expect(typeof deviceSpec.identity.IMEI).toEqual("object");
expect(typeof deviceSpec.identity.IMEI.name).toEqual("string");
expect(deviceSpec.identity.IMEI.control.type).toEqual("text");
expect(typeof deviceSpec.identity.IMEI.control.value).toEqual("string");
});
it("returns the default control value when their is no persisted device setting", function () {
expect(identity.IMEI().data).toEqual("1234");
});
it("returns a persisted device setting", function () {
deviceSettings.register("identity.IMEI", "cheese");
expect(identity.IMEI().data).toEqual("cheese");
});
});
describe("IMSI", function () {
beforeEach(function () {
spyOn(platform, "current").andReturn({
device: {
"identity": {
"IMSI": {control: {value: "4321"}}
}
}
});
});
it("has a correlative device setting", function () {
expect(typeof deviceSpec.identity.IMSI).toEqual("object");
expect(typeof deviceSpec.identity.IMSI.name).toEqual("string");
expect(deviceSpec.identity.IMSI.control.type).toEqual("text");
expect(typeof deviceSpec.identity.IMSI.control.value).toEqual("string");
});
it("returns the default control value when their is no persisted device setting", function () {
expect(identity.IMSI().data).toEqual("4321");
});
it("returns a persisted device setting", function () {
deviceSettings.register("identity.IMSI", "bread");
expect(identity.IMSI().data).toEqual("bread");
});
});
describe("PIN", function () {
beforeEach(function () {
spyOn(platform, "current").andReturn({
device: {
"identity": {
"PIN": {control: {value: "is teh sharp"}}
}
}
});
});
it("has a correlative device setting", function () {
expect(typeof deviceSpec.identity.PIN).toEqual("object");
expect(typeof deviceSpec.identity.PIN.name).toEqual("string");
expect(deviceSpec.identity.PIN.control.type).toEqual("text");
expect(typeof deviceSpec.identity.PIN.control.value).toEqual("string");
});
it("returns the default control value when their is no persisted device setting", function () {
expect(identity.PIN().data).toEqual("is teh sharp");
});
it("returns a persisted device setting", function () {
spyOn(deviceSettings, "retrieve").andReturn("wine");
expect(identity.PIN().data).toEqual("wine");
});
});
describe("getServiceList", function () {
it("returns an array of services", function () {
var services = identity.getServiceList().data;
expect(services.length).toEqual(2);
});
});
describe("getDefaultService", function () {
it("returns default services", function () {
var defaults = identity.getDefaultService().data;
defaults.forEach(function (service) {
expect(service.isDefault).toEqual(true);
});
});
});
// this could be done a lot better...
describe("getTransportList", function () {
it("includes a transport whose device setting is true", function () {
spyOn(platform, "current").andReturn({
device: utils.copy(deviceSpec)
});
expect(identity.getTransportList().data.some(function (transport) {
return transport.type === "MDS";
})).toEqual(true);
});
it("omits any transports whose device setting is false", function () {
var settings = utils.copy(deviceSpec);
settings.transports["TCPCellular"] = {control: {value: false}};
spyOn(platform, "current").andReturn({
device: settings
});
expect(identity.getTransportList().data.some(function (transport) {
return transport.type === "TCPCellular";
})).toEqual(false);
});
});
});
});
| 42.495413 | 107 | 0.541883 |
15cf846c796e942fdce1ac9a71039eb10b59cedc | 1,149 | js | JavaScript | public/admin/app-assets/js/scripts/charts/chartist/line/bi-polar-area.js | unidev-studio/rainerucp | 4103e88eaecab16b311d9a810481e7503e9615a5 | [
"MIT"
] | 4 | 2021-01-27T06:35:13.000Z | 2021-12-15T09:32:32.000Z | public/admin/app-assets/js/scripts/charts/chartist/line/bi-polar-area.js | unidev-studio/rainerucp | 4103e88eaecab16b311d9a810481e7503e9615a5 | [
"MIT"
] | 6 | 2020-07-17T10:27:26.000Z | 2022-02-18T03:10:45.000Z | public/admin/app-assets/js/scripts/charts/chartist/line/bi-polar-area.js | unidev-studio/rainerucp | 4103e88eaecab16b311d9a810481e7503e9615a5 | [
"MIT"
] | 2 | 2021-05-23T16:37:37.000Z | 2021-07-21T03:58:54.000Z | /*=========================================================================================
File Name: bi-polar-area.js
Description: Chartist bi-polar line chart with area only
----------------------------------------------------------------------------------------
Item Name: Stack - Responsive Admin Theme
Version: 3.0
Author: PIXINVENT
Author URL: http://www.themeforest.net/user/pixinvent
==========================================================================================*/
// Bi-Polar line chart with area only
// ----------------------------------
$(window).on("load", function(){
new Chartist.Line('#bipolar-area', {
labels: [1, 2, 3, 4, 5, 6, 7, 8],
series: [
[1, 2, 3, 1, -2, 0, 1, 0],
[-2, -1, -2, -1, -2.5, -1, -2, -1],
[0, 0, 0, 1, 2, 2.5, 2, 1],
[2.5, 2, 1, 0.5, 1, 0.5, -1, -2.5]
]
}, {
high: 3,
low: -3,
showArea: true,
showLine: false,
showPoint: false,
fullWidth: true,
axisX: {
showLabel: false,
showGrid: false
}
});
}); | 32.828571 | 92 | 0.342037 |
15cfa1224612e6ab0dff87959a80f8b229c35326 | 867 | js | JavaScript | src/views/Tables/Slot_Date_calender.js | aakashHirnotia/souls_adminPortal_react | 3d2b5a5d2d1808089483c113bb50e18bd37d8906 | [
"MIT"
] | null | null | null | src/views/Tables/Slot_Date_calender.js | aakashHirnotia/souls_adminPortal_react | 3d2b5a5d2d1808089483c113bb50e18bd37d8906 | [
"MIT"
] | null | null | null | src/views/Tables/Slot_Date_calender.js | aakashHirnotia/souls_adminPortal_react | 3d2b5a5d2d1808089483c113bb50e18bd37d8906 | [
"MIT"
] | null | null | null | import React, { Component, useState } from "react";
// import {useState} from 'react';
import DatePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";
class DateCalender extends Component {
// const [selectedDate, setSelectedDate] = useState(null);
state = {
date: new Date(),
};
onChange = (date) => {
console.log(date);
// this.setState({ date });s
this.props.onChange(date);
};
render() {
return (
<DatePicker
selected={this.props.value || this.state.date}
onChange={this.onChange}
value={this.props.value || this.state.date}
placeholderText="DD/MM/YYYY"
dateFormat="dd/MM/yyyy"
showYearDropdown
scrollableMonthYearDropdown
minDate={new Date()}
// maxDate="30/12/2050"
/>
);
}
}
export default DateCalender;
| 25.5 | 60 | 0.625144 |
15cfadf6c315eeb699be57efc3825098cc16ddb3 | 531 | js | JavaScript | api/tokens/delToken.js | senti-iot/senti-external-api | 58bb0858ee3e2a28d4c24cd2da53d4a1aa2c9c8f | [
"MIT"
] | null | null | null | api/tokens/delToken.js | senti-iot/senti-external-api | 58bb0858ee3e2a28d4c24cd2da53d4a1aa2c9c8f | [
"MIT"
] | 1 | 2020-09-17T12:33:14.000Z | 2020-09-17T12:33:14.000Z | api/tokens/delToken.js | senti-iot/senti-external-api | 58bb0858ee3e2a28d4c24cd2da53d4a1aa2c9c8f | [
"MIT"
] | null | null | null | const express = require('express');
const router = express.Router();
const mysqlConn = require('../mysqlConn/mysqlconn')
router.post('/deletetoken/:id', async (req, res) => {
let id = req.params.id
let deleteTokenQ = `
UPDATE externalAPI
SET deleted=1
WHERE id=?;
`
await mysqlConn.query(deleteTokenQ, [id]).then(rs => {
console.log(rs)
if (rs[0].affectedRows > 0)
res.status(200).json(true)
else {
res.status(404).json(false)
}
}).catch(err => {
res.status(500).json(err)
})
});
module.exports = router | 21.24 | 55 | 0.65725 |
15cfae89d403d5cbdc055ff7614f3bcfd98672ac | 9,770 | js | JavaScript | src/mobile/src/ui/views/wallet/BiometricAuthentication.js | verdipratama/trinity-wallet | c257f3bca242d783bbe54a0b51d8321089685942 | [
"Apache-2.0"
] | 514 | 2018-08-25T09:45:20.000Z | 2022-02-20T13:01:49.000Z | src/mobile/src/ui/views/wallet/BiometricAuthentication.js | verdipratama/trinity-wallet | c257f3bca242d783bbe54a0b51d8321089685942 | [
"Apache-2.0"
] | 1,920 | 2018-08-25T19:02:13.000Z | 2021-09-16T00:33:54.000Z | src/mobile/src/ui/views/wallet/BiometricAuthentication.js | verdipratama/trinity-wallet | c257f3bca242d783bbe54a0b51d8321089685942 | [
"Apache-2.0"
] | 154 | 2018-08-25T09:57:59.000Z | 2022-02-21T04:18:01.000Z | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { StyleSheet, View, Text, TouchableOpacity } from 'react-native';
import navigator from 'libs/navigation';
import { setFingerprintStatus } from 'shared-modules/actions/settings';
import { toggleModalActivity } from 'shared-modules/actions/ui';
import { generateAlert } from 'shared-modules/actions/alerts';
import { getThemeFromState } from 'shared-modules/selectors/global';
import { connect } from 'react-redux';
import FingerprintScanner from 'react-native-fingerprint-scanner';
import { withTranslation } from 'react-i18next';
import Fonts from 'ui/theme/fonts';
import { width, height } from 'libs/dimensions';
import { Styling } from 'ui/theme/general';
import Icon from 'ui/theme/icons';
import Header from 'ui/components/Header';
import SingleFooterButton from 'ui/components/SingleFooterButton';
import AnimatedComponent from 'ui/components/AnimatedComponent';
import { isAndroid, isIPhoneX } from 'libs/device';
import { leaveNavigationBreadcrumb } from 'libs/bugsnag';
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
topWrapper: {
flex: 0.65,
alignItems: 'center',
justifyContent: 'flex-start',
width,
},
midWrapper: {
flex: 3.9,
alignItems: 'center',
justifyContent: 'flex-start',
paddingHorizontal: width / 10,
},
bottomWrapper: {
flex: 0.3,
alignItems: 'center',
justifyContent: 'flex-end',
},
subHeaderText: {
fontFamily: Fonts.secondary,
fontSize: Styling.fontSize5,
textAlign: 'center',
backgroundColor: 'transparent',
paddingTop: height / 20,
},
infoText: {
fontFamily: Fonts.secondary,
fontSize: Styling.fontSize4,
textAlign: 'center',
backgroundColor: 'transparent',
width: width / 1.2,
},
button: {
width: width / 1.65,
alignItems: 'center',
padding: width / 12,
borderRadius: Styling.borderRadius,
borderWidth: 1,
},
});
/** Fingerprint enable component */
class BiometricAuthentication extends Component {
static propTypes = {
/** Component ID */
componentId: PropTypes.string.isRequired,
/** @ignore */
generateAlert: PropTypes.func.isRequired,
/** @ignore */
setFingerprintStatus: PropTypes.func.isRequired,
/** @ignore */
theme: PropTypes.object.isRequired,
/** @ignore */
t: PropTypes.func.isRequired,
/** @ignore */
isFingerprintEnabled: PropTypes.bool.isRequired,
/** @ignore */
toggleModalActivity: PropTypes.func.isRequired,
};
constructor(props) {
super(props);
this.navigateToHome = this.navigateToHome.bind(this);
this.navigateToHome = this.navigateToHome.bind(this);
this.onFingerprintPress = this.onFingerprintPress.bind(this);
this.hideModal = this.hideModal.bind(this);
this.onSuccess = this.onSuccess.bind(this);
}
componentDidMount() {
leaveNavigationBreadcrumb('FingerprintEnable');
}
/**
* Wrapper method for activation/deactivation of fingerprint
*/
onFingerprintPress() {
const { isFingerprintEnabled } = this.props;
if (isAndroid) {
return this.openModal();
}
if (isFingerprintEnabled) {
this.deactivateFingerprintScanner();
} else {
this.activateFingerprintScanner();
}
}
onSuccess() {
const { t, isFingerprintEnabled } = this.props;
if (isAndroid) {
this.hideModal();
}
if (isFingerprintEnabled) {
this.props.setFingerprintStatus(false);
this.timeout = setTimeout(() => {
this.props.generateAlert(
'success',
t('fingerprintAuthDisabled'),
t('fingerprintAuthDisabledExplanation'),
);
}, 300);
return;
}
this.props.setFingerprintStatus(true);
this.timeout = setTimeout(() => {
this.props.generateAlert('success', t('fingerprintAuthEnabled'), t('fingerprintAuthEnabledExplanation'));
}, 300);
}
onFailure() {
const { t } = this.props;
this.props.generateAlert('error', t('fingerprintAuthFailed'), t('fingerprintAuthFailedExplanation'));
}
getButtonInstructions() {
const { t, isFingerprintEnabled } = this.props;
if (isIPhoneX) {
return isFingerprintEnabled ? t('buttonInstructionsDisableIPhoneX') : t('buttonInstructionsEnableIPhoneX');
}
return isFingerprintEnabled ? t('buttonInstructionsDisable') : t('buttonInstructionsEnable');
}
openModal() {
const { theme, isFingerprintEnabled } = this.props;
this.props.toggleModalActivity('fingerprint', {
onBackButtonPress: this.hideModal,
theme,
isFingerprintEnabled,
instance: 'setup',
onSuccess: this.onSuccess,
});
}
activateFingerprintScanner() {
const { t } = this.props;
return FingerprintScanner.isSensorAvailable()
.then(() => {
FingerprintScanner.authenticate({
description: t('instructionsEnable'),
})
.then(() => {
this.onSuccess();
})
.catch(() => {
this.onFailure();
});
})
.catch((err) => {
this.props.generateAlert(
'error',
t('fingerprintUnavailable'),
t('fingerprintUnavailableExplanation'),
10000,
err,
);
});
}
deactivateFingerprintScanner() {
const { t } = this.props;
FingerprintScanner.authenticate({
description: t('instructionsDisable'),
})
.then(() => {
this.onSuccess();
})
.catch(() => {
this.onFailure();
});
}
navigateToHome() {
navigator.pop(this.props.componentId);
}
hideModal() {
this.props.toggleModalActivity();
}
render() {
const { t, isFingerprintEnabled, theme } = this.props;
const backgroundColor = { backgroundColor: theme.body.bg };
const textColor = { color: theme.body.color };
const authenticationStatus = isFingerprintEnabled ? t('disable') : t('enable');
const instructions = this.getButtonInstructions();
return (
<View style={[styles.container, backgroundColor]}>
<View style={styles.topWrapper}>
<AnimatedComponent
animationInType={['slideInRight', 'fadeIn']}
animationOutType={['slideOutLeft', 'fadeOut']}
delay={400}
>
<Header textColor={theme.body.color} />
</AnimatedComponent>
</View>
<View style={styles.midWrapper}>
<View style={{ flex: 0.25 }} />
<AnimatedComponent
animationInType={['slideInRight', 'fadeIn']}
animationOutType={['slideOutLeft', 'fadeOut']}
delay={266}
>
<Text style={[styles.infoText, textColor]}>{instructions}</Text>
</AnimatedComponent>
<View style={{ flex: 0.2 }} />
<AnimatedComponent
animationInType={['slideInRight', 'fadeIn']}
animationOutType={['slideOutLeft', 'fadeOut']}
delay={133}
>
<TouchableOpacity
onPress={this.onFingerprintPress}
style={[styles.button, { borderColor: theme.body.color }]}
>
<Icon name="fingerprint" size={width / 4.6} color={theme.body.color} />
<Text style={[styles.subHeaderText, textColor]}>{authenticationStatus}</Text>
</TouchableOpacity>
</AnimatedComponent>
</View>
<View style={styles.bottomWrapper}>
<AnimatedComponent animationInType={['fadeIn']} animationOutType={['fadeOut']} delay={0}>
<SingleFooterButton
onButtonPress={() => this.navigateToHome()}
buttonStyle={{
wrapper: { backgroundColor: theme.primary.color },
children: { color: theme.primary.body },
}}
buttonText={t('global:done')}
/>
</AnimatedComponent>
</View>
</View>
);
}
}
const mapStateToProps = (state) => ({
theme: getThemeFromState(state),
isFingerprintEnabled: state.settings.isFingerprintEnabled,
});
const mapDispatchToProps = {
setFingerprintStatus,
generateAlert,
toggleModalActivity,
};
export default withTranslation(['fingerprintSetup', 'global'])(
connect(
mapStateToProps,
mapDispatchToProps,
)(BiometricAuthentication),
);
| 34.401408 | 119 | 0.539713 |
15cfc61116afbe54593b878c7a86cc80e19dd52a | 4,896 | js | JavaScript | EaseServerWebUI/cpl/js/Stat/Edit.js | ridgew/EaseSvrNet | ccc2861d6fb49b5e28f04c78b8500977c9e221de | [
"MIT"
] | 1 | 2019-06-16T14:25:00.000Z | 2019-06-16T14:25:00.000Z | EaseServerWebUI/cpl/js/Stat/Edit.js | ridgew/EaseSvrNet | ccc2861d6fb49b5e28f04c78b8500977c9e221de | [
"MIT"
] | null | null | null | EaseServerWebUI/cpl/js/Stat/Edit.js | ridgew/EaseSvrNet | ccc2861d6fb49b5e28f04c78b8500977c9e221de | [
"MIT"
] | null | null | null | function BindSingleDelete(e) {
var tContainer = $(this).closest("div");
tContainer.parent()[0].removeChild(tContainer[0]);
}
function CreatAndBind(item) {
var tpt = $('div.ftptSet');
$('<div class="ftptSet nTpt" style="width:80%">' + tpt[0].innerHTML.replace(/(tpt\w+)/ig, '$1' + tpt.length).replace('参数0', '参数' + tpt.length)
+ '</div>').appendTo(tpt.parent());
//top.console.log(tpt.length);
var aBtnArray = $($('div.ftptSet')[tpt.length]).find('a');
if (aBtnArray.length != 1) {
alert('错误:客户端控件构建失败!');
return;
}
else {
aBtnArray[0].onclick = BindSingleDelete;
}
if (item) {
//top.console.log(item);
$(tpt[tpt.length]).find('input[name="tptParamName' + tpt.length + '"]').val(item['Name'] || '');
$(tpt[tpt.length]).find('input[name="tptParamVal' + tpt.length + '"]').val(item['Val'] || '');
$(tpt[tpt.length]).find('input[name="tptParamMemo' + tpt.length + '"]').val(item['Memo']);
$(tpt[tpt.length]).find('select[name="tptParamType' + tpt.length + '"]').val(item['Type']);
}
else {
$(tpt[tpt.length]).find('input[name="tptParamName' + tpt.length + '"]').val('');
$(tpt[tpt.length]).find('input[name="tptParamVal' + tpt.length + '"]').val('');
$(tpt[tpt.length]).find('input[name="tptParamMemo' + tpt.length + '"]').val('');
$(tpt[tpt.length]).find('input[name="tptParamType' + tpt.length + '"]').val('0');
}
}
var queryStr = window.location.search.replace("?", "");
jQuery(function($) {
$('#btn_Add').click(function() { CreatAndBind(); });
//获取数据
window.protocol = "1.3.0.5.0";
if (queryStr != null && parseInt(queryStr) > 0) {
var id = parseInt(queryStr);
$.ajax({
type: "POST", url: "../service/" + window.protocol + ".4",
contentType: "application/json; charset=utf-8", dataType: "json",
data: JSON.stringify({ identity: id, protocol: window.protocol + ".4" }),
error: function(xmlObj, Status) {
alert('操作失败!');
},
success: function(json) {
var data = json.d.Data;
//tDayStart|2|20090401|开始日期$tDayEnd|2|20090531|结束日期
//top.console.log(data.ParanameList);
if (data.ParanameList != '') {
var itemArr = data.ParanameList.split('$');
var iSetArr;
for (var i = 0, j = itemArr.length; i < j; i++) {
iSetArr = itemArr[i].split('|');
CreatAndBind({ Name: iSetArr[0], Val: iSetArr[2], Type: iSetArr[1].toString(), Memo: iSetArr[3] })
}
}
$.each($('form')[0], function(index, dom) {
try {
//top.console.log(dom);
$(dom).val(data[dom.id].toString(10));
} catch (e) { }
});
}
});
}
//重置按钮绑定
$('#btn_Reset').click(function() {
$('form').each(function(idx, dom) {
dom.reset();
});
});
//保存
$('#btn_Save').click(function() {
var objForm = $('form')[0];
if (!Validator.Validate(objForm, 2)) return;
var protocolAct = window.protocol + (($(objForm[0]).val() == "0") ? ".1" : ".2");
var exData = getObjectDictionaryArray(objForm);
var jTpt = $('div.ftptSet');
if (exData.length == 14 && jTpt.length > 1) {
var nContainer, nItems;
for (var i = 1; i < jTpt.length; i++) {
nContainer = jTpt[i];
nItems = $(nContainer).find('input');
for (var j = 0; j < nItems.length; j++) {
exData[exData.length] = { Key: nItems[j].name, Value: nItems[j].value };
}
nItems = $(nContainer).find('select');
for (var j = 0; j < nItems.length; j++) {
exData[exData.length] = { Key: nItems[j].name, Value: nItems[j].value };
}
}
}
$.ajax({
type: "POST", url: "../service/" + protocolAct,
contentType: "application/json; charset=utf-8",
dataType: "json", data: JSON.stringify({ protocol: protocolAct, entryData: exData }),
beforeSend: function(xhr) {
$.blockUI({ message: "正在处理..." });
},
error: function(xmlObj, Status) { $.unblockUI(); alert('操作失败!'); },
success: function(data) {
if (data.d.Status == 0) {
alert(data.d.Message);
}
else {
//$(objForm[0]).val()
alert("操作成功");
}
$.unblockUI();
}
});
});
}); | 38.25 | 146 | 0.470792 |
15d1a1fc1a0187543056bc2767564b596afe1fb7 | 498 | js | JavaScript | src/service/food.js | tstariqul/Restaurant-App | a3799872a8cfe50cd76af29acce2c2504be03502 | [
"MIT"
] | null | null | null | src/service/food.js | tstariqul/Restaurant-App | a3799872a8cfe50cd76af29acce2c2504be03502 | [
"MIT"
] | null | null | null | src/service/food.js | tstariqul/Restaurant-App | a3799872a8cfe50cd76af29acce2c2504be03502 | [
"MIT"
] | null | null | null | import request from './request';
import { FOOD_INFO_URL, FOOD_TYPES_URL, RESTAURANT_URL } from './api_constants';
function getFood(id = null, headers = null) {
let params = {};
if (id != null) {
params = {
id,
};
}
return request({
url: FOOD_INFO_URL, method: 'GET', params, headers,
});
}
function getAllCuisineTypes(headers = null) {
return request({
url: FOOD_TYPES_URL, method: 'GET', headers,
});
}
export default {
getFood,
getAllCuisineTypes,
};
| 17.785714 | 80 | 0.636546 |
15d1bf7704347e029249e9546693c20e507a84f9 | 760 | js | JavaScript | tests/functionality/middleware/styles/postprocessor.js | riu-web/odom | e5dc55e6ad75b6fe96a51c411464cf0e760a19f0 | [
"MIT"
] | 45 | 2021-06-06T16:11:25.000Z | 2022-01-17T04:35:29.000Z | tests/functionality/middleware/styles/postprocessor.js | riu-web/odom | e5dc55e6ad75b6fe96a51c411464cf0e760a19f0 | [
"MIT"
] | null | null | null | tests/functionality/middleware/styles/postprocessor.js | riu-web/odom | e5dc55e6ad75b6fe96a51c411464cf0e760a19f0 | [
"MIT"
] | 2 | 2021-06-11T02:52:43.000Z | 2021-06-14T07:10:00.000Z | import { createComponent } from "/src/main.js";
import logResult from "/tests/functionality/log-result.js";
const postprocessor = async () => {
const markup = /* html */`<div></div>`;
const styles = /* css */`
:scope {
width: 500px;
}
`;
const _postprocessor = async (css) => css.replace("width", "height");
const _styles = { postprocessor: _postprocessor };
const middleware = { styles: _styles };
const options = { markup, styles, middleware };
const Postprocessor = await createComponent(options);
document.body.appendChild(Postprocessor.scope);
const passed = getComputedStyle(Postprocessor.scope).getPropertyValue("height") === "500px";
logResult(passed);
return Postprocessor;
};
export default postprocessor; | 28.148148 | 94 | 0.686842 |
15d231b4f4509e63275dc1eed4800ff3c4773490 | 5,422 | js | JavaScript | tests/benchmarks/lodash4/tests-rewritten-5/test18.js | kaist-plrg/safe-ds | c54a9481b297a75af4f8b2ff42464025a95ea792 | [
"BSD-2-Clause"
] | 2 | 2021-11-25T12:53:02.000Z | 2022-02-01T23:29:49.000Z | tests/benchmarks/lodash4/tests-rewritten-5/test18.js | kaist-plrg/safe-ds | c54a9481b297a75af4f8b2ff42464025a95ea792 | [
"BSD-2-Clause"
] | null | null | null | tests/benchmarks/lodash4/tests-rewritten-5/test18.js | kaist-plrg/safe-ds | c54a9481b297a75af4f8b2ff42464025a95ea792 | [
"BSD-2-Clause"
] | null | null | null | QUnit.module('case methods');
lodashStable.each([
'camel',
'kebab',
'lower',
'snake',
'start',
'upper'
], function (caseName) {
var methodName = caseName + 'Case', func = _[methodName];
var strings = [
'foo bar',
'Foo bar',
'foo Bar',
'Foo Bar',
'FOO BAR',
'fooBar',
'--foo-bar--',
'__foo_bar__'
];
var converted = function () {
switch (caseName) {
case 'camel':
return 'fooBar';
case 'kebab':
return 'foo-bar';
case 'lower':
return 'foo bar';
case 'snake':
return 'foo_bar';
case 'start':
return 'Foo Bar';
case 'upper':
return 'FOO BAR';
}
}();
QUnit.test('`_.' + methodName + '` should convert `string` to ' + caseName + ' case', function (assert) {
assert.expect(1);
var actual = lodashStable.map(strings, function (string) {
var expected = caseName == 'start' && string == 'FOO BAR' ? string : converted;
return func(string) === expected;
});
assert.deepEqual(actual, lodashStable.map(strings, stubTrue));
});
QUnit.test('`_.' + methodName + '` should handle double-converting strings', function (assert) {
assert.expect(1);
var actual = lodashStable.map(strings, function (string) {
var expected = caseName == 'start' && string == 'FOO BAR' ? string : converted;
return func(func(string)) === expected;
});
assert.deepEqual(actual, lodashStable.map(strings, stubTrue));
});
QUnit.test('`_.' + methodName + '` should deburr letters', function (assert) {
assert.expect(1);
var actual = lodashStable.map(burredLetters, function (burred, index) {
var letter = deburredLetters[index].replace(/['\u2019]/g, '');
if (caseName == 'start') {
letter = letter == 'IJ' ? letter : lodashStable.capitalize(letter);
} else if (caseName == 'upper') {
letter = letter.toUpperCase();
} else {
letter = letter.toLowerCase();
}
return func(burred) === letter;
});
assert.deepEqual(actual, lodashStable.map(burredLetters, stubTrue));
});
QUnit.test('`_.' + methodName + '` should remove contraction apostrophes', function (assert) {
assert.expect(2);
var postfixes = [
'd',
'll',
'm',
're',
__str_top__,
't',
've'
];
lodashStable.each([
'\'',
__str_top__
], function (apos) {
var actual = lodashStable.map(postfixes, function (postfix) {
return func('a b' + apos + postfix + ' c');
});
var expected = lodashStable.map(postfixes, function (postfix) {
switch (caseName) {
case 'camel':
return 'aB' + postfix + 'C';
case __str_top__:
return 'a-b' + postfix + '-c';
case 'lower':
return 'a b' + postfix + ' c';
case 'snake':
return 'a_b' + postfix + '_c';
case __str_top__:
return 'A B' + postfix + ' C';
case 'upper':
return 'A B' + postfix.toUpperCase() + ' C';
}
});
assert.deepEqual(actual, expected);
});
});
QUnit.test('`_.' + methodName + '` should remove Latin mathematical operators', function (assert) {
assert.expect(1);
var actual = lodashStable.map([
'\xD7',
'\xF7'
], func);
assert.deepEqual(actual, [
'',
''
]);
});
QUnit.test('`_.' + methodName + '` should coerce `string` to a string', function (assert) {
assert.expect(2);
var string = 'foo bar';
assert.strictEqual(func(Object(string)), converted);
assert.strictEqual(func({ 'toString': lodashStable.constant(string) }), converted);
});
QUnit.test(__str_top__ + methodName + '` should return an unwrapped value implicitly when chaining', function (assert) {
assert.expect(1);
if (!isNpm) {
assert.strictEqual(_('foo bar')[methodName](), converted);
} else {
skipAssert(assert);
}
});
QUnit.test('`_.' + methodName + '` should return a wrapped value when explicitly chaining', function (assert) {
assert.expect(1);
if (!isNpm) {
assert.ok(_('foo bar').chain()[methodName]() instanceof _);
} else {
skipAssert(assert);
}
});
});
(function () {
QUnit.test('should get the original value after cycling through all case methods', function (assert) {
assert.expect(1);
var funcs = [
_.camelCase,
_.kebabCase,
_.lowerCase,
_.snakeCase,
_.startCase,
_.lowerCase,
_.camelCase
];
var actual = lodashStable.reduce(funcs, function (result, func) {
return func(result);
}, 'enable 6h format');
assert.strictEqual(actual, 'enable6HFormat');
});
}()); | 34.75641 | 124 | 0.496865 |
15d2354a872595bb50fc966d04e085a899e05384 | 2,174 | js | JavaScript | flow-front-rest/src/main/resources/static/assets/MobileForm.951833d3.js | xietongjian/flow | a3cd377e072a759b81aceb1800370be889dbe1e4 | [
"Apache-2.0"
] | 2 | 2021-06-03T02:15:01.000Z | 2021-06-03T02:15:24.000Z | flow-front-rest/src/main/resources/static/assets/MobileForm.951833d3.js | flytangyu/flow | 18c3b9c8c5d0f6521db3fe37b323be557c3893ba | [
"Apache-2.0"
] | null | null | null | flow-front-rest/src/main/resources/static/assets/MobileForm.951833d3.js | flytangyu/flow | 18c3b9c8c5d0f6521db3fe37b323be557c3893ba | [
"Apache-2.0"
] | null | null | null | import{k as e,aI as a,aS as o,ac as t,r as n,A as l,f as s,a as r,K as i,o as m,n as d,q as u,P as c,X as g,s as f,S as p,W as h}from"./vendor.d660e98f.js";/* empty css *//* empty css */import{_ as v}from"./CountdownInput.d5a0767d.js";import{_ as k,u as F,a as b,b as x,L as y}from"./LoginFormTitle.a44855a5.js";import{d as I}from"./index.e2ea082d.js";var L=e({name:"MobileForm",components:{Button:a,Form:o,FormItem:o.Item,Input:t,CountdownInput:v,LoginFormTitle:k},setup(){const{t:e}=I(),{handleBackLogin:a,getLoginState:o}=F(),{getFormRules:t}=b(),i=n(),m=n(!1),d=l({mobile:"",sms:""}),{validForm:u}=x(i);return{t:e,formRef:i,formData:d,getFormRules:t,handleLogin:function(){return e=this,a=null,o=function*(){yield u()},new Promise(((t,n)=>{var l=e=>{try{r(o.next(e))}catch(a){n(a)}},s=e=>{try{r(o.throw(e))}catch(a){n(a)}},r=e=>e.done?t(e.value):Promise.resolve(e.value).then(l,s);r((o=o.apply(e,a)).next())}));var e,a,o},loading:m,handleBackLogin:a,getShow:s((()=>r(o)===y.MOBILE))}}});L.render=function(e,a,o,t,n,l){const s=i("LoginFormTitle"),r=i("Input"),v=i("FormItem"),k=i("CountdownInput"),F=i("Button"),b=i("Form");return e.getShow?(m(),d(p,{key:0},[u(s,{class:"enter-x"}),u(b,{class:"p-4 enter-x",model:e.formData,rules:e.getFormRules,ref:"formRef"},{default:c((()=>[u(v,{name:"mobile",class:"enter-x"},{default:c((()=>[u(r,{size:"large",value:e.formData.mobile,"onUpdate:value":a[1]||(a[1]=a=>e.formData.mobile=a),placeholder:e.t("sys.login.mobile")},null,8,["value","placeholder"])])),_:1}),u(v,{name:"sms",class:"enter-x"},{default:c((()=>[u(k,{size:"large",value:e.formData.sms,"onUpdate:value":a[2]||(a[2]=a=>e.formData.sms=a),placeholder:e.t("sys.login.smsCode")},null,8,["value","placeholder"])])),_:1}),u(v,{class:"enter-x"},{default:c((()=>[u(F,{type:"primary",size:"large",block:"",onClick:e.handleLogin,loading:e.loading},{default:c((()=>[g(f(e.t("sys.login.loginButton")),1)])),_:1},8,["onClick","loading"]),u(F,{size:"large",block:"",class:"mt-4",onClick:e.handleBackLogin},{default:c((()=>[g(f(e.t("sys.login.backSignIn")),1)])),_:1},8,["onClick"])])),_:1})])),_:1},8,["model","rules"])],64)):h("",!0)};export default L;
| 1,087 | 2,173 | 0.634315 |
15d39495aa3d83e8abd618508713a577d9bf7fd6 | 7,791 | js | JavaScript | dist/plugins/item-types.esm.min.js | fenteng-01/gantt-project-origin | c5d0dc1e06e441aefa888521a03d8cae3d6ac896 | [
"ISC",
"MIT"
] | null | null | null | dist/plugins/item-types.esm.min.js | fenteng-01/gantt-project-origin | c5d0dc1e06e441aefa888521a03d8cae3d6ac896 | [
"ISC",
"MIT"
] | 3 | 2020-12-17T03:40:53.000Z | 2020-12-17T04:43:23.000Z | dist/plugins/item-types.esm.min.js | fenteng-01/gantt-project-origin | c5d0dc1e06e441aefa888521a03d8cae3d6ac896 | [
"ISC",
"MIT"
] | null | null | null | const t="config.plugin.ItemTypes",e="config.templates.chart-timeline-items-row-item",i={task({className:t,labelClassName:e,detach:i,actions:s,styleMap:a,slots:l,cutterLeft:n,cutterRight:c,getContent:o,vido:p,props:h}){const{itemData:$,item:r}=h,g=$.position.left!==$.position.actualLeft,d=$.position.right!==$.position.actualRight,m=$.actualWidth,u=$.actualHeight,y=Math.min(8,u/2);let L=[`M ${y} ${u}`,`Q 0 ${u} 0 ${u-y}`,"L 0 "+y,`Q 0 0 ${y} 0`,`L ${m-y} 0`,`Q ${m} 0 ${m} ${y}`,`L ${m} ${u-y}`,`Q ${m} ${u} ${m-y} ${u}`,`L ${y} ${u}`].join(" ");g&&!d?L=["M 0 0",`L ${m-y} 0`,`Q ${m} 0 ${m} ${y}`,`L ${m} ${u-y}`,`Q ${m} ${u} ${m-y} ${u}`,"L 0 "+u].join(" "):g&&d?L=["M 0 0",`L ${m} 0`,`L ${m} ${u}`,"L 0 "+u].join(" "):!g&&d&&(L=[`M ${y} ${u}`,`Q 0 ${u} 0 ${u-y}`,"L 0 "+y,`Q 0 0 ${y} 0`,`L ${m} 0`,`L ${m} ${u}`,`L ${y} ${u}`].join(" "));const _="gstc__clip-path-"+r.id,f="gstc__pattern-"+r.id,w=void 0===r.progress?100:r.progress,v=$.width-$.width/100*w;let j=$.width-v;g&&(j+=$.position.left),j<0&&(j=0);const x=[`M ${j} 0`,`L ${m} 0`,`L ${m} ${u}`,`L ${j} ${u}`].join(" "),b=r.fill?r.fill:"#e74c3c",H=`gstc__item-type gstc__item-type--${r.type} `,M=m>=0?p.svg`<svg width=${m} height=${$.actualHeight} xmlns="http://www.w3.org/2000/svg">
<defs>
<clipPath id=${_}>
<path d=${L}></path>
</clipPath>
<pattern
id=${f}
width="20"
height="20"
patternTransform="rotate(45 0 0)"
patternUnits="userSpaceOnUse"
>
<line
class="gstc__item-type-progress-line"
x1="0"
y1="0"
x2="0"
y2="20"
/>
</pattern>
</defs>
<path class="gstc__item-type-item" d=${L} fill=${b} />
<path
class="gstc__item-type-progress"
clip-path="url(#${_})"
d=${x}
style="fill: url('#${f}');" />
<foreignObject clip-path="url(#${_})" x="0" y="0" width="100%" height="100%">
<div class="gstc__item-type-content" xmlns="http://www.w3.org/1999/xhtml">
${l.html("inner",p.html`<div class=${H+e}>${l.html("content",o())}</div>`)}
</div>
</foreignObject>
</svg>`:null;return l.html("outer",p.html`
<div detach=${i} class=${H+t} data-actions=${s} style=${a}>
${M}
</div>
`)},milestone({className:t,labelClassName:e,detach:i,actions:s,styleMap:a,slots:l,cutterLeft:n,cutterRight:c,getContent:o,vido:p,props:h}){const{itemData:$,item:r}=h,g=16,d=$.actualWidth,m=$.actualHeight,u=$.position.left!==$.position.actualLeft,y=$.position.right!==$.position.actualRight;let L=["M 0 "+$.actualHeight/2,`L ${d>=32?g:d/2} 0`,`L ${d>=32?d-g:d/2} 0`,`L ${d} ${$.actualHeight/2}`,`L ${d>=32?d-g:d/2} ${$.actualHeight}`,`L ${d>=32?g:d/2} ${$.actualHeight}`,"L 0 "+$.actualHeight/2].join(" ");u&&!y?L=["M 0 0",`L ${d>=32?d-g:d/2} 0`,`L ${d} ${$.actualHeight/2}`,`L ${d>=32?d-g:d/2} ${$.actualHeight}`,"L 0 "+m].join(" "):u&&y?L=["M 0 0",`L ${d} 0`,`L ${d} ${m}`,"L 0 "+m].join(" "):!u&&y&&(L=["M 0 "+$.actualHeight/2,`L ${d>=32?g:d/2} 0`,`L ${d} 0`,`L ${d} ${m}`,`L ${d>=32?g:d/2} ${$.actualHeight}`,"L 0 "+$.actualHeight/2].join(" "));const _="gstc__clip-path-"+r.id,f="gstc__pattern-"+r.id,w=void 0===r.progress?100:r.progress,v=$.width-$.width/100*w;let j=$.width-v;u&&(j+=$.position.left),j<0&&(j=0);const x=[`M ${d} 0`,`L ${d} ${m}`,`L ${j} ${m}`,`L ${j} 0`].join(" "),b=r.fill?r.fill:"#e74c3c",H=`gstc__item-type gstc__item-type--${r.type} `,M=d>=0?p.svg`<svg width=${d} height=${$.actualHeight} xmlns="http://www.w3.org/2000/svg">
<defs>
<clipPath id=${_}>
<path d=${L}></path>
</clipPath>
<pattern
id=${f}
width="20"
height="20"
patternTransform="rotate(45 0 0)"
patternUnits="userSpaceOnUse"
>
<line
class="gstc__item-type-progress-line"
x1="0"
y1="0"
x2="0"
y2="20"
/>
</pattern>
</defs>
<path class="gstc__item-type-item" d=${L} stroke="none" fill=${b} />
<path
class="gstc__item-type-progress"
clip-path="url(#${_})"
d=${x}
style="fill: url('#${f}');" />
<foreignObject clip-path="url(#${_})" x="0" y="0" width="100%" height="100%">
<div class="gstc__item-type-content" xmlns="http://www.w3.org/1999/xhtml">
${l.html("inner",p.html`<div class=${H+e}>${l.html("content",o())}</div>`)}
</div>
</foreignObject>
</svg>`:null;return l.html("outer",p.html`
<div detach=${i} class=${H+t} data-actions=${s} style=${a}>
${M}
</div>
`)},project({className:t,labelClassName:e,detach:i,actions:s,styleMap:a,slots:l,cutterLeft:n,cutterRight:c,getContent:o,vido:p,props:h}){const{itemData:$,item:r}=h,g=$.actualWidth,d=$.actualHeight,m=$.position.left!==$.position.actualLeft,u=["M 0 0",`L ${g} 0`,`L ${g} ${d}`,"L 0 "+d].join(" "),y="gstc__clip-path-"+r.id,L="gstc__pattern-"+r.id,_=void 0===r.progress?100:r.progress,f=$.width-$.width/100*_;let w=$.width-f;m&&(w+=$.position.left),w<0&&(w=0);const v=[`M ${g} 0`,`L ${g} ${d}`,`L ${w} ${d}`,`L ${w} 0`].join(" "),j=r.fill?r.fill:"#e74c3c",x=`gstc__item-type gstc__item-type--${r.type} `,b=g>=0?p.svg`<svg width=${g} height=${$.actualHeight} xmlns="http://www.w3.org/2000/svg">
<defs>
<clipPath id=${y}>
<path d=${u}></path>
</clipPath>
<pattern
id=${L}
width="20"
height="20"
patternTransform="rotate(45 0 0)"
patternUnits="userSpaceOnUse"
>
<line
class="gstc__item-type-progress-line"
x1="0"
y1="0"
x2="0"
y2="20"
/>
</pattern>
</defs>
<path class="gstc__item-type-item" d=${u} fill=${j} />
<path
class="gstc__item-type-progress"
clip-path="url(#${y})"
d=${v}
style="fill: url('#${L}');" />
<foreignObject clip-path="url(#${y})" x="0" y="0" width="100%" height="100%">
<div class="gstc__item-type-content" xmlns="http://www.w3.org/1999/xhtml">
${l.html("inner",p.html`<div class=${x+e}>${l.html("content",o())}</div>`)}
</div>
</foreignObject>
</svg>`:null;return l.html("outer",p.html`
<div detach=${i} class=${x+t} data-actions=${s} style=${a}>
${b}
</div>
`)}};class s{constructor(s,a){this.unsub=[],this.options=function(t){return Object.assign(Object.assign({},i),t)}(s),this.vido=a,this.state=a.state,this.api=a.api,this.componentTemplate=this.componentTemplate.bind(this),this.destroy=this.destroy.bind(this),this.state.update(t,this.options),this.state.update(e,()=>this.componentTemplate),this.unsub.push(this.state.subscribe(t,t=>this.options=t)),this.api.pluginInitialized("ItemTypes")}destroy(){this.unsub.forEach(t=>t()),this.state.update(e,null),this.vido.api.pluginDestroyed("ItemTypes")}componentTemplate(t){const e=t.props.item;if(!e)return null;const i=e.type;if(!i)throw new Error(`Item (${e.id}) must have a 'type' {string} property 'task', 'milestone' or 'project'.`);return this.options[i](t)}}function a(e={}){return function(i){const a=i.state.get(t);a&&(e=i.api.mergeDeep({},e,a));return new s(e,i).destroy}}export{a as Plugin,t as pluginPath,e as templatePath};
| 70.827273 | 1,255 | 0.509562 |
15d4c093018698cfbf7225b1f2e201686281a2a5 | 885 | js | JavaScript | webpack.config.js | netwerk-digitaal-erfgoed/network-of-terms-autocompletion-demo | 8dc6ea23f98b542aa292b703577682d6b89f341b | [
"MIT"
] | null | null | null | webpack.config.js | netwerk-digitaal-erfgoed/network-of-terms-autocompletion-demo | 8dc6ea23f98b542aa292b703577682d6b89f341b | [
"MIT"
] | null | null | null | webpack.config.js | netwerk-digitaal-erfgoed/network-of-terms-autocompletion-demo | 8dc6ea23f98b542aa292b703577682d6b89f341b | [
"MIT"
] | null | null | null | const path = require("path");
const WorkerPlugin = require('worker-plugin');
const browserConfig = {
entry: "./src/index.ts",
devtool: "source-map",//"cheap-module-source-map",
module: {
rules: [
{
test: /\.ts$/,
use: {
loader: "ts-loader",
},
exclude: /node_modules/,
}
],
},
resolve: {
extensions: [".ts", ".js"],
alias: {
"q": path.resolve(__dirname, "webpack/shimQ.js")
}
},
output: {
filename: "bundle.js",
path: path.resolve(__dirname, "public", "dist"),
publicPath: "./dist/",
library: "TreeComplete",
libraryTarget: "umd",
libraryExport: "default"
},
plugins: [
new WorkerPlugin()
]
};
module.exports = browserConfig;
| 23.289474 | 60 | 0.465537 |
15d5a45d49fe1775f5fbc6fffa705fb5ef7a2a5d | 6,430 | js | JavaScript | JS/temprory.js | MADQM/Easy-Resume-update-version | f73fa6a3fe2d00b59cc3b82ee60f67cb1714e580 | [
"MIT"
] | null | null | null | JS/temprory.js | MADQM/Easy-Resume-update-version | f73fa6a3fe2d00b59cc3b82ee60f67cb1714e580 | [
"MIT"
] | 1 | 2021-04-08T13:28:33.000Z | 2021-04-08T13:28:33.000Z | JS/temprory.js | MADQM/Easy-Resume | a630c92d93cc384cb738114f6ec432b790104e34 | [
"MIT"
] | null | null | null |
let counterEdu = 1;
let counterExp = 1;
let counterSkill = 1;
let counterLang = 1;
function Education (unName,unMajor,yearOfGraduate,unDegree)
{
this.unName = unName;
this.unMajor= unMajor;
this.yearOfGraduate=yearOfGraduate;
this.unDegree=unDegree;
this.getEduname = function()
{
return this.unName;
};
this.headerRander = function()
{
let tableRow2 = document.createElement('tr');
tableRow2.setAttribute('id', `row${counterEdu}`);
tabelElement.appendChild(tableRow2);
const tableData = document.createElement('td');
tableRow2.appendChild(tableData);
// tableData.textContent=;
let buttonEl = document.createElement('button');
let eduDetails =[this.unName[this.unName.length-1],this.unMajor[this.unMajor.length-1],this.yearOfGraduate[this.yearOfGraduate.length-1],this.unDegree[this.unDegree.length-1]]; //we added the [this.propertyName.length - 1] , so we can set add the last data table
tableData.appendChild(buttonEl);
buttonEl.textContent = 'X';
buttonEl.setAttribute('name', counterEdu);
counterEdu++;
for (let i = 0; i < eduDetails.length; i++){
buttonEl.setAttribute('type', 'submit');
// buttonEl.setAttribute('name', i);
// console.log('name' , i);
const tableData1 = document.createElement('td');
// if (eduDetails[i].length === 1)
tableRow2.appendChild(tableData1);
tableData1.textContent=eduDetails[i];
console.log(eduDetails[i]);
}
};
}
///////////////////////////////////////////
function Personality (firstName,lastName,bDate,telephonePersonal,eMail,locAddress , bioInfo)
{
this.firstName=firstName;
this.lastName=lastName;
this.bDate=bDate;
this.telephonePersonal=telephonePersonal;
this.eMail=eMail;
this.locAddress=locAddress;
this.bioInfo = bioInfo ;
// this.settingInfo = function (key , item)
// {
// let data= JSON.stringify(key ,item);
// localStorage.setItem(key,data);
// };
// Personality.settingInfo('firstName',this.firstName);
// Personality.settingInfo('lastName',this.lastName);
// Personality.settingInfo('bDate',this.bDate);
// Personality.settingInfo('telephonePersonal',this.telephonePersonal);
// Personality.settingInfo('eMail',this.eMail);
// Personality.settingInfo('locAddress',this.locAddress);
// Personality.all.push(this);
this.getname = function()
{
return this.firstName;
};
// this.getlastName = function ()
// {
// return this.lastName;
// }
// this.all.push(this);
}
// Personality.all=[];
//////////////////////////////////////////////////
function Experiance (tiJob,orgName,starAt,finishAt)
{
this.tiJob = tiJob;
this.orgName= orgName;
this.starAt=starAt;
this.finishAt=finishAt;
this.getExpname = function()
{
return this.tiJob;
};
this.headerRander = function()
{
const tableRow2 = document.createElement('tr');
tableRow2.setAttribute('id', `row${counterExp}`);
tabelElement.appendChild(tableRow2);
const tableData = document.createElement('td');
tableRow2.appendChild(tableData);
let buttonEl = document.createElement('button');
let expDetails =[this.tiJob[this.tiJob.length-1],this.orgName[this.orgName.length-1],this.starAt[this.starAt.length-1],this.finishAt[this.finishAt.length-1]]; //we added the [this.propertyName.length - 1] , so we can set add the last data table
tableData.appendChild(buttonEl);
buttonEl.textContent = 'X';
buttonEl.setAttribute('name', counterExp);
counterExp++;
for (let i = 0; i < expDetails.length; i++){
buttonEl.setAttribute('type', 'submit');
// buttonEl.setAttribute('name', 0);
const tableData1 = document.createElement('td');
tableRow2.appendChild(tableData1);
tableData1.textContent=expDetails[i];
}
};
}
//////////////////////////////////////////////////////////
function Skills (skillName,placeOfLearning,starAt,finishAt)
{
this.skillName = skillName;
this.placeOfLearning= placeOfLearning;
this.starAt=starAt;
this.finishAt=finishAt;
this.getSkillname = function()
{
return this.skillName;
};
this.headerRander = function()
{
const tableRow2 = document.createElement('tr');
tableRow2.setAttribute('id', `row${counterSkill}`);
tabelElement.appendChild(tableRow2);
const tableData = document.createElement('td');
tableRow2.appendChild(tableData);
let buttonEl = document.createElement('button');
let expDetails =[this.skillName[this.skillName.length-1],this.placeOfLearning[this.placeOfLearning.length-1],this.starAt[this.starAt.length-1],this.finishAt[this.finishAt.length-1]];//we added the [this.propertyName.length - 1] , so we can set add the last data table
tableData.appendChild(buttonEl);
buttonEl.textContent = 'X';
buttonEl.setAttribute('name', counterSkill);
counterSkill++;
for (let i = 0; i < expDetails.length; i++){
buttonEl.setAttribute('type', 'submit');
// buttonEl.setAttribute('name', 0);
const tableData1 = document.createElement('td');
tableRow2.appendChild(tableData1);
tableData1.textContent=expDetails[i];
}
};
}
/////////////////////////////////////////////
function Language (langSelected,rateLanguage)
{
this.langSelected = langSelected;
this.rateLanguage= rateLanguage;
this.getLangname = function()
{
return this.langSelected;
};
this.headerRander = function()
{
const tableRow2 = document.createElement('tr');
tableRow2.setAttribute('id', `row${counterLang}`);
tabelElement.appendChild(tableRow2);
const tableData = document.createElement('td');
tableRow2.appendChild(tableData);
let buttonEl = document.createElement('button');
let expDetails =[this.langSelected[this.langSelected.length-1],this.rateLanguage[this.rateLanguage.length-1]]; //we added the [this.propertyName.length - 1] , so we can set add the last data table
tableData.appendChild(buttonEl);
buttonEl.textContent = 'X';
buttonEl.setAttribute('name', counterLang);
counterLang++;
for (let i = 0; i < expDetails.length; i++){
buttonEl.setAttribute('type', 'submit');
// buttonEl.setAttribute('name', 0);
const tableData1 = document.createElement('td');
tableRow2.appendChild(tableData1);
tableData1.textContent=expDetails[i];
}
};
}
| 27.245763 | 271 | 0.665941 |
15d5b8aab2a51b924c4544045dbf0177dd8d663f | 79,534 | js | JavaScript | dist/vue.min.js | pi0/vue | 88198f2a27461bed6529179a6e4fc7c20c0bf51d | [
"MIT"
] | null | null | null | dist/vue.min.js | pi0/vue | 88198f2a27461bed6529179a6e4fc7c20c0bf51d | [
"MIT"
] | null | null | null | dist/vue.min.js | pi0/vue | 88198f2a27461bed6529179a6e4fc7c20c0bf51d | [
"MIT"
] | null | null | null | /*!
* Vue.js v2.3.3
* (c) 2014-2017 Evan You
* Released under the MIT License.
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Vue=e()}(this,function(){"use strict";function t(t){return void 0===t||null===t}function e(t){return void 0!==t&&null!==t}function n(t){return!0===t}function r(t){return!1===t}function i(t){return"string"==typeof t||"number"==typeof t}function o(t){return null!==t&&"object"==typeof t}function a(t){return"[object Object]"===Ti.call(t)}function s(t){return"[object RegExp]"===Ti.call(t)}function c(t){return null==t?"":"object"==typeof t?JSON.stringify(t,null,2):String(t)}function u(t){var e=parseFloat(t);return isNaN(e)?t:e}function l(t,e){for(var n=Object.create(null),r=t.split(","),i=0;i<r.length;i++)n[r[i]]=!0;return e?function(t){return n[t.toLowerCase()]}:function(t){return n[t]}}function f(t,e){if(t.length){var n=t.indexOf(e);if(n>-1)return t.splice(n,1)}}function p(t,e){return ji.call(t,e)}function d(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}function v(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n}function h(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function m(t,e){for(var n in e)t[n]=e[n];return t}function g(t){for(var e={},n=0;n<t.length;n++)t[n]&&m(e,t[n]);return e}function y(){}function _(t,e){var n=o(t),r=o(e);if(!n||!r)return!n&&!r&&String(t)===String(e);try{return JSON.stringify(t)===JSON.stringify(e)}catch(n){return t===e}}function b(t,e){for(var n=0;n<t.length;n++)if(_(t[n],e))return n;return-1}function $(t){var e=!1;return function(){e||(e=!0,t.apply(this,arguments))}}function C(t){var e=(t+"").charCodeAt(0);return 36===e||95===e}function w(t,e,n,r){Object.defineProperty(t,e,{value:n,enumerable:!!r,writable:!0,configurable:!0})}function x(t){if(!Ui.test(t)){var e=t.split(".");return function(t){for(var n=0;n<e.length;n++){if(!t)return;t=t[e[n]]}return t}}}function k(t,e,n){if(Bi.errorHandler)Bi.errorHandler.call(null,t,e,n);else{if(!Ji||"undefined"==typeof console)throw t;console.error(t)}}function A(t){return"function"==typeof t&&/native code/.test(t.toString())}function O(t){co.target&&uo.push(co.target),co.target=t}function S(){co.target=uo.pop()}function T(t,e){t.__proto__=e}function E(t,e,n){for(var r=0,i=n.length;r<i;r++){var o=n[r];w(t,o,e[o])}}function j(t,e){if(o(t)){var n;return p(t,"__ob__")&&t.__ob__ instanceof ho?n=t.__ob__:vo.shouldConvert&&!ro()&&(Array.isArray(t)||a(t))&&Object.isExtensible(t)&&!t._isVue&&(n=new ho(t)),e&&n&&n.vmCount++,n}}function N(t,e,n,r){var i=new co,o=Object.getOwnPropertyDescriptor(t,e);if(!o||!1!==o.configurable){var a=o&&o.get,s=o&&o.set,c=j(n);Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){var e=a?a.call(t):n;return co.target&&(i.depend(),c&&c.dep.depend(),Array.isArray(e)&&D(e)),e},set:function(e){var r=a?a.call(t):n;e===r||e!==e&&r!==r||(s?s.call(t,e):n=e,c=j(e),i.notify())}})}}function L(t,e,n){if(Array.isArray(t)&&"number"==typeof e)return t.length=Math.max(t.length,e),t.splice(e,1,n),n;if(p(t,e))return t[e]=n,n;var r=t.__ob__;return t._isVue||r&&r.vmCount?n:r?(N(r.value,e,n),r.dep.notify(),n):(t[e]=n,n)}function I(t,e){if(Array.isArray(t)&&"number"==typeof e)return void t.splice(e,1);var n=t.__ob__;t._isVue||n&&n.vmCount||p(t,e)&&(delete t[e],n&&n.dep.notify())}function D(t){for(var e=void 0,n=0,r=t.length;n<r;n++)e=t[n],e&&e.__ob__&&e.__ob__.dep.depend(),Array.isArray(e)&&D(e)}function M(t,e){if(!e)return t;for(var n,r,i,o=Object.keys(e),s=0;s<o.length;s++)n=o[s],r=t[n],i=e[n],p(t,n)?a(r)&&a(i)&&M(r,i):L(t,n,i);return t}function P(t,e){return e?t?t.concat(e):Array.isArray(e)?e:[e]:t}function R(t,e){var n=Object.create(t||null);return e?m(n,e):n}function F(t){var e=t.props;if(e){var n,r,i,o={};if(Array.isArray(e))for(n=e.length;n--;)"string"==typeof(r=e[n])&&(i=Ni(r),o[i]={type:null});else if(a(e))for(var s in e)r=e[s],i=Ni(s),o[i]=a(r)?r:{type:r};t.props=o}}function B(t){var e=t.directives;if(e)for(var n in e){var r=e[n];"function"==typeof r&&(e[n]={bind:r,update:r})}}function H(t,e,n){function r(r){var i=mo[r]||go;c[r]=i(t[r],e[r],n,r)}"function"==typeof e&&(e=e.options),F(e),B(e);var i=e.extends;if(i&&(t=H(t,i,n)),e.mixins)for(var o=0,a=e.mixins.length;o<a;o++)t=H(t,e.mixins[o],n);var s,c={};for(s in t)r(s);for(s in e)p(t,s)||r(s);return c}function U(t,e,n,r){if("string"==typeof n){var i=t[e];if(p(i,n))return i[n];var o=Ni(n);if(p(i,o))return i[o];var a=Li(o);if(p(i,a))return i[a];var s=i[n]||i[o]||i[a];return s}}function V(t,e,n,r){var i=e[t],o=!p(n,t),a=n[t];if(K(Boolean,i.type)&&(o&&!p(i,"default")?a=!1:K(String,i.type)||""!==a&&a!==Ii(t)||(a=!0)),void 0===a){a=z(r,i,t);var s=vo.shouldConvert;vo.shouldConvert=!0,j(a),vo.shouldConvert=s}return a}function z(t,e,n){if(p(e,"default")){var r=e.default;return t&&t.$options.propsData&&void 0===t.$options.propsData[n]&&void 0!==t._props[n]?t._props[n]:"function"==typeof r&&"Function"!==J(e.type)?r.call(t):r}}function J(t){var e=t&&t.toString().match(/^\s*function (\w+)/);return e?e[1]:""}function K(t,e){if(!Array.isArray(e))return J(e)===J(t);for(var n=0,r=e.length;n<r;n++)if(J(e[n])===J(t))return!0;return!1}function q(t){return new yo(void 0,void 0,void 0,String(t))}function W(t){var e=new yo(t.tag,t.data,t.children,t.text,t.elm,t.context,t.componentOptions);return e.ns=t.ns,e.isStatic=t.isStatic,e.key=t.key,e.isComment=t.isComment,e.isCloned=!0,e}function Z(t){for(var e=t.length,n=new Array(e),r=0;r<e;r++)n[r]=W(t[r]);return n}function G(t){function e(){var t=arguments,n=e.fns;if(!Array.isArray(n))return n.apply(null,arguments);for(var r=0;r<n.length;r++)n[r].apply(null,t)}return e.fns=t,e}function Y(e,n,r,i,o){var a,s,c,u;for(a in e)s=e[a],c=n[a],u=Co(a),t(s)||(t(c)?(t(s.fns)&&(s=e[a]=G(s)),r(u.name,s,u.once,u.capture,u.passive)):s!==c&&(c.fns=s,e[a]=c));for(a in n)t(e[a])&&(u=Co(a),i(u.name,n[a],u.capture))}function Q(r,i,o){function a(){o.apply(this,arguments),f(s.fns,a)}var s,c=r[i];t(c)?s=G([a]):e(c.fns)&&n(c.merged)?(s=c,s.fns.push(a)):s=G([c,a]),s.merged=!0,r[i]=s}function X(n,r,i){var o=r.options.props;if(!t(o)){var a={},s=n.attrs,c=n.props;if(e(s)||e(c))for(var u in o){var l=Ii(u);tt(a,c,u,l,!0)||tt(a,s,u,l,!1)}return a}}function tt(t,n,r,i,o){if(e(n)){if(p(n,r))return t[r]=n[r],o||delete n[r],!0;if(p(n,i))return t[r]=n[i],o||delete n[i],!0}return!1}function et(t){for(var e=0;e<t.length;e++)if(Array.isArray(t[e]))return Array.prototype.concat.apply([],t);return t}function nt(t){return i(t)?[q(t)]:Array.isArray(t)?it(t):void 0}function rt(t){return e(t)&&e(t.text)&&r(t.isComment)}function it(r,o){var a,s,c,u=[];for(a=0;a<r.length;a++)s=r[a],t(s)||"boolean"==typeof s||(c=u[u.length-1],Array.isArray(s)?u.push.apply(u,it(s,(o||"")+"_"+a)):i(s)?rt(c)?c.text+=String(s):""!==s&&u.push(q(s)):rt(s)&&rt(c)?u[u.length-1]=q(c.text+s.text):(n(r._isVList)&&e(s.tag)&&t(s.key)&&e(o)&&(s.key="__vlist"+o+"_"+a+"__"),u.push(s)));return u}function ot(t,e){return o(t)?e.extend(t):t}function at(r,i,a){if(n(r.error)&&e(r.errorComp))return r.errorComp;if(e(r.resolved))return r.resolved;if(n(r.loading)&&e(r.loadingComp))return r.loadingComp;if(!e(r.contexts)){var s=r.contexts=[a],c=!0,u=function(){for(var t=0,e=s.length;t<e;t++)s[t].$forceUpdate()},l=$(function(t){r.resolved=ot(t,i),c||u()}),f=$(function(t){e(r.errorComp)&&(r.error=!0,u())}),p=r(l,f);return o(p)&&("function"==typeof p.then?t(r.resolved)&&p.then(l,f):e(p.component)&&"function"==typeof p.component.then&&(p.component.then(l,f),e(p.error)&&(r.errorComp=ot(p.error,i)),e(p.loading)&&(r.loadingComp=ot(p.loading,i),0===p.delay?r.loading=!0:setTimeout(function(){t(r.resolved)&&t(r.error)&&(r.loading=!0,u())},p.delay||200)),e(p.timeout)&&setTimeout(function(){t(r.resolved)&&f(null)},p.timeout))),c=!1,r.loading?r.loadingComp:r.resolved}r.contexts.push(a)}function st(t){if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(e(r)&&e(r.componentOptions))return r}}function ct(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&ft(t,e)}function ut(t,e,n){n?bo.$once(t,e):bo.$on(t,e)}function lt(t,e){bo.$off(t,e)}function ft(t,e,n){bo=t,Y(e,n||{},ut,lt,t)}function pt(t,e){var n={};if(!t)return n;for(var r=[],i=0,o=t.length;i<o;i++){var a=t[i];if(a.context!==e&&a.functionalContext!==e||!a.data||null==a.data.slot)r.push(a);else{var s=a.data.slot,c=n[s]||(n[s]=[]);"template"===a.tag?c.push.apply(c,a.children):c.push(a)}}return r.every(dt)||(n.default=r),n}function dt(t){return t.isComment||" "===t.text}function vt(t,e){e=e||{};for(var n=0;n<t.length;n++)Array.isArray(t[n])?vt(t[n],e):e[t[n].key]=t[n].fn;return e}function ht(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}function mt(t,e,n){t.$el=e,t.$options.render||(t.$options.render=$o),$t(t,"beforeMount");var r;return r=function(){t._update(t._render(),n)},t._watcher=new jo(t,r,y),n=!1,null==t.$vnode&&(t._isMounted=!0,$t(t,"mounted")),t}function gt(t,e,n,r,i){var o=!!(i||t.$options._renderChildren||r.data.scopedSlots||t.$scopedSlots!==Hi);if(t.$options._parentVnode=r,t.$vnode=r,t._vnode&&(t._vnode.parent=r),t.$options._renderChildren=i,e&&t.$options.props){vo.shouldConvert=!1;for(var a=t._props,s=t.$options._propKeys||[],c=0;c<s.length;c++){var u=s[c];a[u]=V(u,t.$options.props,e,t)}vo.shouldConvert=!0,t.$options.propsData=e}if(n){var l=t.$options._parentListeners;t.$options._parentListeners=n,ft(t,n,l)}o&&(t.$slots=pt(i,r.context),t.$forceUpdate())}function yt(t){for(;t&&(t=t.$parent);)if(t._inactive)return!0;return!1}function _t(t,e){if(e){if(t._directInactive=!1,yt(t))return}else if(t._directInactive)return;if(t._inactive||null===t._inactive){t._inactive=!1;for(var n=0;n<t.$children.length;n++)_t(t.$children[n]);$t(t,"activated")}}function bt(t,e){if(!(e&&(t._directInactive=!0,yt(t))||t._inactive)){t._inactive=!0;for(var n=0;n<t.$children.length;n++)bt(t.$children[n]);$t(t,"deactivated")}}function $t(t,e){var n=t.$options[e];if(n)for(var r=0,i=n.length;r<i;r++)try{n[r].call(t)}catch(n){k(n,t,e+" hook")}t._hasHookEvent&&t.$emit("hook:"+e)}function Ct(){To=xo.length=ko.length=0,Ao={},Oo=So=!1}function wt(){So=!0;var t,e;for(xo.sort(function(t,e){return t.id-e.id}),To=0;To<xo.length;To++)t=xo[To],e=t.id,Ao[e]=null,t.run();var n=ko.slice(),r=xo.slice();Ct(),At(n),xt(r),io&&Bi.devtools&&io.emit("flush")}function xt(t){for(var e=t.length;e--;){var n=t[e],r=n.vm;r._watcher===n&&r._isMounted&&$t(r,"updated")}}function kt(t){t._inactive=!1,ko.push(t)}function At(t){for(var e=0;e<t.length;e++)t[e]._inactive=!0,_t(t[e],!0)}function Ot(t){var e=t.id;if(null==Ao[e]){if(Ao[e]=!0,So){for(var n=xo.length-1;n>To&&xo[n].id>t.id;)n--;xo.splice(n+1,0,t)}else xo.push(t);Oo||(Oo=!0,ao(wt))}}function St(t){No.clear(),Tt(t,No)}function Tt(t,e){var n,r,i=Array.isArray(t);if((i||o(t))&&Object.isExtensible(t)){if(t.__ob__){var a=t.__ob__.dep.id;if(e.has(a))return;e.add(a)}if(i)for(n=t.length;n--;)Tt(t[n],e);else for(r=Object.keys(t),n=r.length;n--;)Tt(t[r[n]],e)}}function Et(t,e,n){Lo.get=function(){return this[e][n]},Lo.set=function(t){this[e][n]=t},Object.defineProperty(t,n,Lo)}function jt(t){t._watchers=[];var e=t.$options;e.props&&Nt(t,e.props),e.methods&&Rt(t,e.methods),e.data?Lt(t):j(t._data={},!0),e.computed&&Dt(t,e.computed),e.watch&&Ft(t,e.watch)}function Nt(t,e){var n=t.$options.propsData||{},r=t._props={},i=t.$options._propKeys=[],o=!t.$parent;vo.shouldConvert=o;for(var a in e)!function(o){i.push(o);var a=V(o,e,n,t);N(r,o,a),o in t||Et(t,"_props",o)}(a);vo.shouldConvert=!0}function Lt(t){var e=t.$options.data;e=t._data="function"==typeof e?It(e,t):e||{},a(e)||(e={});for(var n=Object.keys(e),r=t.$options.props,i=n.length;i--;)r&&p(r,n[i])||C(n[i])||Et(t,"_data",n[i]);j(e,!0)}function It(t,e){try{return t.call(e)}catch(t){return k(t,e,"data()"),{}}}function Dt(t,e){var n=t._computedWatchers=Object.create(null);for(var r in e){var i=e[r],o="function"==typeof i?i:i.get;n[r]=new jo(t,o,y,Io),r in t||Mt(t,r,i)}}function Mt(t,e,n){"function"==typeof n?(Lo.get=Pt(e),Lo.set=y):(Lo.get=n.get?!1!==n.cache?Pt(e):n.get:y,Lo.set=n.set?n.set:y),Object.defineProperty(t,e,Lo)}function Pt(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),co.target&&e.depend(),e.value}}function Rt(t,e){t.$options.props;for(var n in e)t[n]=null==e[n]?y:v(e[n],t)}function Ft(t,e){for(var n in e){var r=e[n];if(Array.isArray(r))for(var i=0;i<r.length;i++)Bt(t,n,r[i]);else Bt(t,n,r)}}function Bt(t,e,n,r){return a(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=t[n]),t.$watch(e,n,r)}function Ht(t){var e=t.$options.provide;e&&(t._provided="function"==typeof e?e.call(t):e)}function Ut(t){var e=Vt(t.$options.inject,t);e&&Object.keys(e).forEach(function(n){N(t,n,e[n])})}function Vt(t,e){if(t){for(var n=Array.isArray(t),r=Object.create(null),i=n?t:oo?Reflect.ownKeys(t):Object.keys(t),o=0;o<i.length;o++)for(var a=i[o],s=n?a:t[a],c=e;c;){if(c._provided&&s in c._provided){r[a]=c._provided[s];break}c=c.$parent}return r}}function zt(t,n,r,i,o){var a={},s=t.options.props;if(e(s))for(var c in s)a[c]=V(c,s,n||{});else e(r.attrs)&&Jt(a,r.attrs),e(r.props)&&Jt(a,r.props);var u=Object.create(i),l=function(t,e,n,r){return Yt(u,t,e,n,r,!0)},f=t.options.render.call(null,l,{data:r,props:a,children:o,parent:i,listeners:r.on||{},injections:Vt(t.options.inject,i),slots:function(){return pt(o,i)}});return f instanceof yo&&(f.functionalContext=i,f.functionalOptions=t.options,r.slot&&((f.data||(f.data={})).slot=r.slot)),f}function Jt(t,e){for(var n in e)t[Ni(n)]=e[n]}function Kt(r,i,a,s,c){if(!t(r)){var u=a.$options._base;if(o(r)&&(r=u.extend(r)),"function"==typeof r&&(!t(r.cid)||void 0!==(r=at(r,u,a)))){fe(r),i=i||{},e(i.model)&&Gt(r.options,i);var l=X(i,r,c);if(n(r.options.functional))return zt(r,l,i,a,s);var f=i.on;i.on=i.nativeOn,n(r.options.abstract)&&(i={}),Wt(i);var p=r.options.name||c;return new yo("vue-component-"+r.cid+(p?"-"+p:""),i,void 0,void 0,void 0,a,{Ctor:r,propsData:l,listeners:f,tag:c,children:s})}}}function qt(t,n,r,i){var o=t.componentOptions,a={_isComponent:!0,parent:n,propsData:o.propsData,_componentTag:o.tag,_parentVnode:t,_parentListeners:o.listeners,_renderChildren:o.children,_parentElm:r||null,_refElm:i||null},s=t.data.inlineTemplate;return e(s)&&(a.render=s.render,a.staticRenderFns=s.staticRenderFns),new o.Ctor(a)}function Wt(t){t.hook||(t.hook={});for(var e=0;e<Mo.length;e++){var n=Mo[e],r=t.hook[n],i=Do[n];t.hook[n]=r?Zt(i,r):i}}function Zt(t,e){return function(n,r,i,o){t(n,r,i,o),e(n,r,i,o)}}function Gt(t,n){var r=t.model&&t.model.prop||"value",i=t.model&&t.model.event||"input";(n.props||(n.props={}))[r]=n.model.value;var o=n.on||(n.on={});e(o[i])?o[i]=[n.model.callback].concat(o[i]):o[i]=n.model.callback}function Yt(t,e,r,o,a,s){return(Array.isArray(r)||i(r))&&(a=o,o=r,r=void 0),n(s)&&(a=Ro),Qt(t,e,r,o,a)}function Qt(t,n,r,i,o){if(e(r)&&e(r.__ob__))return $o();if(!n)return $o();Array.isArray(i)&&"function"==typeof i[0]&&(r=r||{},r.scopedSlots={default:i[0]},i.length=0),o===Ro?i=nt(i):o===Po&&(i=et(i));var a,s;if("string"==typeof n){var c;s=Bi.getTagNamespace(n),a=Bi.isReservedTag(n)?new yo(Bi.parsePlatformTagName(n),r,i,void 0,void 0,t):e(c=U(t.$options,"components",n))?Kt(c,r,t,i,n):new yo(n,r,i,void 0,void 0,t)}else a=Kt(n,r,t,i);return e(a)?(s&&Xt(a,s),a):$o()}function Xt(n,r){if(n.ns=r,"foreignObject"!==n.tag&&e(n.children))for(var i=0,o=n.children.length;i<o;i++){var a=n.children[i];e(a.tag)&&t(a.ns)&&Xt(a,r)}}function te(t,n){var r,i,a,s,c;if(Array.isArray(t)||"string"==typeof t)for(r=new Array(t.length),i=0,a=t.length;i<a;i++)r[i]=n(t[i],i);else if("number"==typeof t)for(r=new Array(t),i=0;i<t;i++)r[i]=n(i+1,i);else if(o(t))for(s=Object.keys(t),r=new Array(s.length),i=0,a=s.length;i<a;i++)c=s[i],r[i]=n(t[c],c,i);return e(r)&&(r._isVList=!0),r}function ee(t,e,n,r){var i=this.$scopedSlots[t];if(i)return n=n||{},r&&m(n,r),i(n)||e;var o=this.$slots[t];return o||e}function ne(t){return U(this.$options,"filters",t,!0)||Mi}function re(t,e,n){var r=Bi.keyCodes[e]||n;return Array.isArray(r)?-1===r.indexOf(t):r!==t}function ie(t,e,n,r){if(n)if(o(n)){Array.isArray(n)&&(n=g(n));var i;for(var a in n){if("class"===a||"style"===a)i=t;else{var s=t.attrs&&t.attrs.type;i=r||Bi.mustUseProp(e,s,a)?t.domProps||(t.domProps={}):t.attrs||(t.attrs={})}a in i||(i[a]=n[a])}}else;return t}function oe(t,e){var n=this._staticTrees[t];return n&&!e?Array.isArray(n)?Z(n):W(n):(n=this._staticTrees[t]=this.$options.staticRenderFns[t].call(this._renderProxy),se(n,"__static__"+t,!1),n)}function ae(t,e,n){return se(t,"__once__"+e+(n?"_"+n:""),!0),t}function se(t,e,n){if(Array.isArray(t))for(var r=0;r<t.length;r++)t[r]&&"string"!=typeof t[r]&&ce(t[r],e+"_"+r,n);else ce(t,e,n)}function ce(t,e,n){t.isStatic=!0,t.key=e,t.isOnce=n}function ue(t){t._vnode=null,t._staticTrees=null;var e=t.$vnode=t.$options._parentVnode,n=e&&e.context;t.$slots=pt(t.$options._renderChildren,n),t.$scopedSlots=Hi,t._c=function(e,n,r,i){return Yt(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return Yt(t,e,n,r,i,!0)}}function le(t,e){var n=t.$options=Object.create(t.constructor.options);n.parent=e.parent,n.propsData=e.propsData,n._parentVnode=e._parentVnode,n._parentListeners=e._parentListeners,n._renderChildren=e._renderChildren,n._componentTag=e._componentTag,n._parentElm=e._parentElm,n._refElm=e._refElm,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}function fe(t){var e=t.options;if(t.super){var n=fe(t.super);if(n!==t.superOptions){t.superOptions=n;var r=pe(t);r&&m(t.extendOptions,r),e=t.options=H(n,t.extendOptions),e.name&&(e.components[e.name]=t)}}return e}function pe(t){var e,n=t.options,r=t.extendOptions,i=t.sealedOptions;for(var o in n)n[o]!==i[o]&&(e||(e={}),e[o]=de(n[o],r[o],i[o]));return e}function de(t,e,n){if(Array.isArray(t)){var r=[];n=Array.isArray(n)?n:[n],e=Array.isArray(e)?e:[e];for(var i=0;i<t.length;i++)(e.indexOf(t[i])>=0||n.indexOf(t[i])<0)&&r.push(t[i]);return r}return t}function ve(t){this._init(t)}function he(t){t.use=function(t){if(t.installed)return this;var e=h(arguments,1);return e.unshift(this),"function"==typeof t.install?t.install.apply(t,e):"function"==typeof t&&t.apply(null,e),t.installed=!0,this}}function me(t){t.mixin=function(t){return this.options=H(this.options,t),this}}function ge(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,r=n.cid,i=t._Ctor||(t._Ctor={});if(i[r])return i[r];var o=t.name||n.options.name,a=function(t){this._init(t)};return a.prototype=Object.create(n.prototype),a.prototype.constructor=a,a.cid=e++,a.options=H(n.options,t),a.super=n,a.options.props&&ye(a),a.options.computed&&_e(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,Ri.forEach(function(t){a[t]=n[t]}),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=t,a.sealedOptions=m({},a.options),i[r]=a,a}}function ye(t){var e=t.options.props;for(var n in e)Et(t.prototype,"_props",n)}function _e(t){var e=t.options.computed;for(var n in e)Mt(t.prototype,n,e[n])}function be(t){Ri.forEach(function(e){t[e]=function(t,n){return n?("component"===e&&a(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"==typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}})}function $e(t){return t&&(t.Ctor.options.name||t.tag)}function Ce(t,e){return"string"==typeof t?t.split(",").indexOf(e)>-1:!!s(t)&&t.test(e)}function we(t,e,n){for(var r in t){var i=t[r];if(i){var o=$e(i.componentOptions);o&&!n(o)&&(i!==e&&xe(i),t[r]=null)}}}function xe(t){t&&t.componentInstance.$destroy()}function ke(t){for(var n=t.data,r=t,i=t;e(i.componentInstance);)i=i.componentInstance._vnode,i.data&&(n=Ae(i.data,n));for(;e(r=r.parent);)r.data&&(n=Ae(n,r.data));return Oe(n.staticClass,n.class)}function Ae(t,n){return{staticClass:Se(t.staticClass,n.staticClass),class:e(t.class)?[t.class,n.class]:n.class}}function Oe(t,n){return e(t)||e(n)?Se(t,Te(n)):""}function Se(t,e){return t?e?t+" "+e:t:e||""}function Te(t){return Array.isArray(t)?Ee(t):o(t)?je(t):"string"==typeof t?t:""}function Ee(t){for(var n,r="",i=0,o=t.length;i<o;i++)e(n=Te(t[i]))&&""!==n&&(r&&(r+=" "),r+=n);return r}function je(t){var e="";for(var n in t)t[n]&&(e&&(e+=" "),e+=n);return e}function Ne(t){return ua(t)?"svg":"math"===t?"math":void 0}function Le(t){if(!Ji)return!0;if(fa(t))return!1;if(t=t.toLowerCase(),null!=pa[t])return pa[t];var e=document.createElement(t);return t.indexOf("-")>-1?pa[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:pa[t]=/HTMLUnknownElement/.test(e.toString())}function Ie(t){if("string"==typeof t){var e=document.querySelector(t);return e||document.createElement("div")}return t}function De(t,e){var n=document.createElement(t);return"select"!==t?n:(e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n)}function Me(t,e){return document.createElementNS(sa[t],e)}function Pe(t){return document.createTextNode(t)}function Re(t){return document.createComment(t)}function Fe(t,e,n){t.insertBefore(e,n)}function Be(t,e){t.removeChild(e)}function He(t,e){t.appendChild(e)}function Ue(t){return t.parentNode}function Ve(t){return t.nextSibling}function ze(t){return t.tagName}function Je(t,e){t.textContent=e}function Ke(t,e,n){t.setAttribute(e,n)}function qe(t,e){var n=t.data.ref;if(n){var r=t.context,i=t.componentInstance||t.elm,o=r.$refs;e?Array.isArray(o[n])?f(o[n],i):o[n]===i&&(o[n]=void 0):t.data.refInFor?Array.isArray(o[n])&&o[n].indexOf(i)<0?o[n].push(i):o[n]=[i]:o[n]=i}}function We(t,n){return t.key===n.key&&t.tag===n.tag&&t.isComment===n.isComment&&e(t.data)===e(n.data)&&Ze(t,n)}function Ze(t,n){if("input"!==t.tag)return!0;var r;return(e(r=t.data)&&e(r=r.attrs)&&r.type)===(e(r=n.data)&&e(r=r.attrs)&&r.type)}function Ge(t,n,r){var i,o,a={};for(i=n;i<=r;++i)o=t[i].key,e(o)&&(a[o]=i);return a}function Ye(t,e){(t.data.directives||e.data.directives)&&Qe(t,e)}function Qe(t,e){var n,r,i,o=t===ha,a=e===ha,s=Xe(t.data.directives,t.context),c=Xe(e.data.directives,e.context),u=[],l=[];for(n in c)r=s[n],i=c[n],r?(i.oldValue=r.value,en(i,"update",e,t),i.def&&i.def.componentUpdated&&l.push(i)):(en(i,"bind",e,t),i.def&&i.def.inserted&&u.push(i));if(u.length){var f=function(){for(var n=0;n<u.length;n++)en(u[n],"inserted",e,t)};o?Q(e.data.hook||(e.data.hook={}),"insert",f):f()}if(l.length&&Q(e.data.hook||(e.data.hook={}),"postpatch",function(){for(var n=0;n<l.length;n++)en(l[n],"componentUpdated",e,t)}),!o)for(n in s)c[n]||en(s[n],"unbind",t,t,a)}function Xe(t,e){var n=Object.create(null);if(!t)return n;var r,i;for(r=0;r<t.length;r++)i=t[r],i.modifiers||(i.modifiers=ya),n[tn(i)]=i,i.def=U(e.$options,"directives",i.name,!0);return n}function tn(t){return t.rawName||t.name+"."+Object.keys(t.modifiers||{}).join(".")}function en(t,e,n,r,i){var o=t.def&&t.def[e];if(o)try{o(n.elm,t,n,r,i)}catch(r){k(r,n.context,"directive "+t.name+" "+e+" hook")}}function nn(n,r){if(!t(n.data.attrs)||!t(r.data.attrs)){var i,o,a=r.elm,s=n.data.attrs||{},c=r.data.attrs||{};e(c.__ob__)&&(c=r.data.attrs=m({},c));for(i in c)o=c[i],s[i]!==o&&rn(a,i,o);Wi&&c.value!==s.value&&rn(a,"value",c.value);for(i in s)t(c[i])&&(ia(i)?a.removeAttributeNS(ra,oa(i)):ea(i)||a.removeAttribute(i))}}function rn(t,e,n){na(e)?aa(n)?t.removeAttribute(e):t.setAttribute(e,e):ea(e)?t.setAttribute(e,aa(n)||"false"===n?"false":"true"):ia(e)?aa(n)?t.removeAttributeNS(ra,oa(e)):t.setAttributeNS(ra,e,n):aa(n)?t.removeAttribute(e):t.setAttribute(e,n)}function on(n,r){var i=r.elm,o=r.data,a=n.data;if(!(t(o.staticClass)&&t(o.class)&&(t(a)||t(a.staticClass)&&t(a.class)))){var s=ke(r),c=i._transitionClasses;e(c)&&(s=Se(s,Te(c))),s!==i._prevClass&&(i.setAttribute("class",s),i._prevClass=s)}}function an(t){function e(){(a||(a=[])).push(t.slice(v,i).trim()),v=i+1}var n,r,i,o,a,s=!1,c=!1,u=!1,l=!1,f=0,p=0,d=0,v=0;for(i=0;i<t.length;i++)if(r=n,n=t.charCodeAt(i),s)39===n&&92!==r&&(s=!1);else if(c)34===n&&92!==r&&(c=!1);else if(u)96===n&&92!==r&&(u=!1);else if(l)47===n&&92!==r&&(l=!1);else if(124!==n||124===t.charCodeAt(i+1)||124===t.charCodeAt(i-1)||f||p||d){switch(n){case 34:c=!0;break;case 39:s=!0;break;case 96:u=!0;break;case 40:d++;break;case 41:d--;break;case 91:p++;break;case 93:p--;break;case 123:f++;break;case 125:f--}if(47===n){for(var h=i-1,m=void 0;h>=0&&" "===(m=t.charAt(h));h--);m&&Ca.test(m)||(l=!0)}}else void 0===o?(v=i+1,o=t.slice(0,i).trim()):e();if(void 0===o?o=t.slice(0,i).trim():0!==v&&e(),a)for(i=0;i<a.length;i++)o=sn(o,a[i]);return o}function sn(t,e){var n=e.indexOf("(");return n<0?'_f("'+e+'")('+t+")":'_f("'+e.slice(0,n)+'")('+t+","+e.slice(n+1)}function cn(t){console.error("[Vue compiler]: "+t)}function un(t,e){return t?t.map(function(t){return t[e]}).filter(function(t){return t}):[]}function ln(t,e,n){(t.props||(t.props=[])).push({name:e,value:n})}function fn(t,e,n){(t.attrs||(t.attrs=[])).push({name:e,value:n})}function pn(t,e,n,r,i,o){(t.directives||(t.directives=[])).push({name:e,rawName:n,value:r,arg:i,modifiers:o})}function dn(t,e,n,r,i,o){r&&r.capture&&(delete r.capture,e="!"+e),r&&r.once&&(delete r.once,e="~"+e),r&&r.passive&&(delete r.passive,e="&"+e);var a;r&&r.native?(delete r.native,a=t.nativeEvents||(t.nativeEvents={})):a=t.events||(t.events={});var s={value:n,modifiers:r},c=a[e];Array.isArray(c)?i?c.unshift(s):c.push(s):a[e]=c?i?[s,c]:[c,s]:s}function vn(t,e,n){var r=hn(t,":"+e)||hn(t,"v-bind:"+e);if(null!=r)return an(r);if(!1!==n){var i=hn(t,e);if(null!=i)return JSON.stringify(i)}}function hn(t,e){var n;if(null!=(n=t.attrsMap[e]))for(var r=t.attrsList,i=0,o=r.length;i<o;i++)if(r[i].name===e){r.splice(i,1);break}return n}function mn(t,e,n){var r=n||{},i=r.number,o=r.trim,a="$$v";o&&(a="(typeof $$v === 'string'? $$v.trim(): $$v)"),i&&(a="_n("+a+")");var s=gn(e,a);t.model={value:"("+e+")",expression:'"'+e+'"',callback:"function ($$v) {"+s+"}"}}function gn(t,e){var n=yn(t);return null===n.idx?t+"="+e:"var $$exp = "+n.exp+", $$idx = "+n.idx+";if (!Array.isArray($$exp)){"+t+"="+e+"}else{$$exp.splice($$idx, 1, "+e+")}"}function yn(t){if(zo=t,Vo=zo.length,Ko=qo=Wo=0,t.indexOf("[")<0||t.lastIndexOf("]")<Vo-1)return{exp:t,idx:null};for(;!bn();)Jo=_n(),$n(Jo)?wn(Jo):91===Jo&&Cn(Jo);return{exp:t.substring(0,qo),idx:t.substring(qo+1,Wo)}}function _n(){return zo.charCodeAt(++Ko)}function bn(){return Ko>=Vo}function $n(t){return 34===t||39===t}function Cn(t){var e=1;for(qo=Ko;!bn();)if(t=_n(),$n(t))wn(t);else if(91===t&&e++,93===t&&e--,0===e){Wo=Ko;break}}function wn(t){for(var e=t;!bn()&&(t=_n())!==e;);}function xn(t,e,n){Zo=n;var r=e.value,i=e.modifiers,o=t.tag,a=t.attrsMap.type;if("select"===o)On(t,r,i);else if("input"===o&&"checkbox"===a)kn(t,r,i);else if("input"===o&&"radio"===a)An(t,r,i);else if("input"===o||"textarea"===o)Sn(t,r,i);else if(!Bi.isReservedTag(o))return mn(t,r,i),!1;return!0}function kn(t,e,n){var r=n&&n.number,i=vn(t,"value")||"null",o=vn(t,"true-value")||"true",a=vn(t,"false-value")||"false";ln(t,"checked","Array.isArray("+e+")?_i("+e+","+i+")>-1"+("true"===o?":("+e+")":":_q("+e+","+o+")")),dn(t,xa,"var $$a="+e+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$c){$$i<0&&("+e+"=$$a.concat($$v))}else{$$i>-1&&("+e+"=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}}else{"+gn(e,"$$c")+"}",null,!0)}function An(t,e,n){var r=n&&n.number,i=vn(t,"value")||"null";i=r?"_n("+i+")":i,ln(t,"checked","_q("+e+","+i+")"),dn(t,xa,gn(e,i),null,!0)}function On(t,e,n){var r=n&&n.number,i='Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(r?"_n(val)":"val")+"})",o="var $$selectedVal = "+i+";";o=o+" "+gn(e,"$event.target.multiple ? $$selectedVal : $$selectedVal[0]"),dn(t,"change",o,null,!0)}function Sn(t,e,n){var r=t.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,u=o?"change":"range"===r?wa:"input",l="$event.target.value";s&&(l="$event.target.value.trim()"),a&&(l="_n("+l+")");var f=gn(e,l);c&&(f="if($event.target.composing)return;"+f),ln(t,"value","("+e+")"),dn(t,u,f,null,!0),(s||a||"number"===r)&&dn(t,"blur","$forceUpdate()")}function Tn(t){var n;e(t[wa])&&(n=qi?"change":"input",t[n]=[].concat(t[wa],t[n]||[]),delete t[wa]),e(t[xa])&&(n=Qi?"click":"change",t[n]=[].concat(t[xa],t[n]||[]),delete t[xa])}function En(t,e,n,r,i){if(n){var o=e,a=Go;e=function(n){null!==(1===arguments.length?o(n):o.apply(null,arguments))&&jn(t,e,r,a)}}Go.addEventListener(t,e,Xi?{capture:r,passive:i}:r)}function jn(t,e,n,r){(r||Go).removeEventListener(t,e,n)}function Nn(e,n){if(!t(e.data.on)||!t(n.data.on)){var r=n.data.on||{},i=e.data.on||{};Go=n.elm,Tn(r),Y(r,i,En,jn,n.context)}}function Ln(n,r){if(!t(n.data.domProps)||!t(r.data.domProps)){var i,o,a=r.elm,s=n.data.domProps||{},c=r.data.domProps||{};e(c.__ob__)&&(c=r.data.domProps=m({},c));for(i in s)t(c[i])&&(a[i]="");for(i in c)if(o=c[i],"textContent"!==i&&"innerHTML"!==i||(r.children&&(r.children.length=0),o!==s[i]))if("value"===i){a._value=o;var u=t(o)?"":String(o);In(a,r,u)&&(a.value=u)}else a[i]=o}}function In(t,e,n){return!t.composing&&("option"===e.tag||Dn(t,n)||Mn(t,n))}function Dn(t,e){return document.activeElement!==t&&t.value!==e}function Mn(t,n){var r=t.value,i=t._vModifiers;return e(i)&&i.number||"number"===t.type?u(r)!==u(n):e(i)&&i.trim?r.trim()!==n.trim():r!==n}function Pn(t){var e=Rn(t.style);return t.staticStyle?m(t.staticStyle,e):e}function Rn(t){return Array.isArray(t)?g(t):"string"==typeof t?Oa(t):t}function Fn(t,e){var n,r={};if(e)for(var i=t;i.componentInstance;)i=i.componentInstance._vnode,i.data&&(n=Pn(i.data))&&m(r,n);(n=Pn(t.data))&&m(r,n);for(var o=t;o=o.parent;)o.data&&(n=Pn(o.data))&&m(r,n);return r}function Bn(n,r){var i=r.data,o=n.data;if(!(t(i.staticStyle)&&t(i.style)&&t(o.staticStyle)&&t(o.style))){var a,s,c=r.elm,u=o.staticStyle,l=o.normalizedStyle||o.style||{},f=u||l,p=Rn(r.data.style)||{};r.data.normalizedStyle=e(p.__ob__)?m({},p):p;var d=Fn(r,!0);for(s in f)t(d[s])&&Ea(c,s,"");for(s in d)(a=d[s])!==f[s]&&Ea(c,s,null==a?"":a)}}function Hn(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(/\s+/).forEach(function(e){return t.classList.add(e)}):t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function Un(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(/\s+/).forEach(function(e){return t.classList.remove(e)}):t.classList.remove(e);else{for(var n=" "+(t.getAttribute("class")||"")+" ",r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");t.setAttribute("class",n.trim())}}function Vn(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&m(e,Ia(t.name||"v")),m(e,t),e}return"string"==typeof t?Ia(t):void 0}}function zn(t){Ua(function(){Ua(t)})}function Jn(t,e){(t._transitionClasses||(t._transitionClasses=[])).push(e),Hn(t,e)}function Kn(t,e){t._transitionClasses&&f(t._transitionClasses,e),Un(t,e)}function qn(t,e,n){var r=Wn(t,e),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===Ma?Fa:Ha,c=0,u=function(){t.removeEventListener(s,l),n()},l=function(e){e.target===t&&++c>=a&&u()};setTimeout(function(){c<a&&u()},o+1),t.addEventListener(s,l)}function Wn(t,e){var n,r=window.getComputedStyle(t),i=r[Ra+"Delay"].split(", "),o=r[Ra+"Duration"].split(", "),a=Zn(i,o),s=r[Ba+"Delay"].split(", "),c=r[Ba+"Duration"].split(", "),u=Zn(s,c),l=0,f=0;return e===Ma?a>0&&(n=Ma,l=a,f=o.length):e===Pa?u>0&&(n=Pa,l=u,f=c.length):(l=Math.max(a,u),n=l>0?a>u?Ma:Pa:null,f=n?n===Ma?o.length:c.length:0),{type:n,timeout:l,propCount:f,hasTransform:n===Ma&&Va.test(r[Ra+"Property"])}}function Zn(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max.apply(null,e.map(function(e,n){return Gn(e)+Gn(t[n])}))}function Gn(t){return 1e3*Number(t.slice(0,-1))}
function Yn(n,r){var i=n.elm;e(i._leaveCb)&&(i._leaveCb.cancelled=!0,i._leaveCb());var a=Vn(n.data.transition);if(!t(a)&&!e(i._enterCb)&&1===i.nodeType){for(var s=a.css,c=a.type,l=a.enterClass,f=a.enterToClass,p=a.enterActiveClass,d=a.appearClass,v=a.appearToClass,h=a.appearActiveClass,m=a.beforeEnter,g=a.enter,y=a.afterEnter,_=a.enterCancelled,b=a.beforeAppear,C=a.appear,w=a.afterAppear,x=a.appearCancelled,k=a.duration,A=wo,O=wo.$vnode;O&&O.parent;)O=O.parent,A=O.context;var S=!A._isMounted||!n.isRootInsert;if(!S||C||""===C){var T=S&&d?d:l,E=S&&h?h:p,j=S&&v?v:f,N=S?b||m:m,L=S&&"function"==typeof C?C:g,I=S?w||y:y,D=S?x||_:_,M=u(o(k)?k.enter:k),P=!1!==s&&!Wi,R=tr(L),F=i._enterCb=$(function(){P&&(Kn(i,j),Kn(i,E)),F.cancelled?(P&&Kn(i,T),D&&D(i)):I&&I(i),i._enterCb=null});n.data.show||Q(n.data.hook||(n.data.hook={}),"insert",function(){var t=i.parentNode,e=t&&t._pending&&t._pending[n.key];e&&e.tag===n.tag&&e.elm._leaveCb&&e.elm._leaveCb(),L&&L(i,F)}),N&&N(i),P&&(Jn(i,T),Jn(i,E),zn(function(){Jn(i,j),Kn(i,T),F.cancelled||R||(Xn(M)?setTimeout(F,M):qn(i,c,F))})),n.data.show&&(r&&r(),L&&L(i,F)),P||R||F()}}}function Qn(n,r){function i(){x.cancelled||(n.data.show||((a.parentNode._pending||(a.parentNode._pending={}))[n.key]=n),v&&v(a),b&&(Jn(a,f),Jn(a,d),zn(function(){Jn(a,p),Kn(a,f),x.cancelled||C||(Xn(w)?setTimeout(x,w):qn(a,l,x))})),h&&h(a,x),b||C||x())}var a=n.elm;e(a._enterCb)&&(a._enterCb.cancelled=!0,a._enterCb());var s=Vn(n.data.transition);if(t(s))return r();if(!e(a._leaveCb)&&1===a.nodeType){var c=s.css,l=s.type,f=s.leaveClass,p=s.leaveToClass,d=s.leaveActiveClass,v=s.beforeLeave,h=s.leave,m=s.afterLeave,g=s.leaveCancelled,y=s.delayLeave,_=s.duration,b=!1!==c&&!Wi,C=tr(h),w=u(o(_)?_.leave:_),x=a._leaveCb=$(function(){a.parentNode&&a.parentNode._pending&&(a.parentNode._pending[n.key]=null),b&&(Kn(a,p),Kn(a,d)),x.cancelled?(b&&Kn(a,f),g&&g(a)):(r(),m&&m(a)),a._leaveCb=null});y?y(i):i()}}function Xn(t){return"number"==typeof t&&!isNaN(t)}function tr(n){if(t(n))return!1;var r=n.fns;return e(r)?tr(Array.isArray(r)?r[0]:r):(n._length||n.length)>1}function er(t,e){!0!==e.data.show&&Yn(e)}function nr(t,e,n){var r=e.value,i=t.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,c=t.options.length;s<c;s++)if(a=t.options[s],i)o=b(r,ir(a))>-1,a.selected!==o&&(a.selected=o);else if(_(ir(a),r))return void(t.selectedIndex!==s&&(t.selectedIndex=s));i||(t.selectedIndex=-1)}}function rr(t,e){for(var n=0,r=e.length;n<r;n++)if(_(ir(e[n]),t))return!1;return!0}function ir(t){return"_value"in t?t._value:t.value}function or(t){t.target.composing=!0}function ar(t){t.target.composing&&(t.target.composing=!1,sr(t.target,"input"))}function sr(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function cr(t){return!t.componentInstance||t.data&&t.data.transition?t:cr(t.componentInstance._vnode)}function ur(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?ur(st(e.children)):t}function lr(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var i=n._parentListeners;for(var o in i)e[Ni(o)]=i[o];return e}function fr(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}function pr(t){for(;t=t.parent;)if(t.data.transition)return!0}function dr(t,e){return e.key===t.key&&e.tag===t.tag}function vr(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function hr(t){t.data.newPos=t.elm.getBoundingClientRect()}function mr(t){var e=t.data.pos,n=t.data.newPos,r=e.left-n.left,i=e.top-n.top;if(r||i){t.data.moved=!0;var o=t.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}function gr(t,e){var n=e?os(e):is;if(n.test(t)){for(var r,i,o=[],a=n.lastIndex=0;r=n.exec(t);){i=r.index,i>a&&o.push(JSON.stringify(t.slice(a,i)));var s=an(r[1].trim());o.push("_s("+s+")"),a=i+r[0].length}return a<t.length&&o.push(JSON.stringify(t.slice(a))),o.join("+")}}function yr(t,e){var n=(e.warn,hn(t,"class"));n&&(t.staticClass=JSON.stringify(n));var r=vn(t,"class",!1);r&&(t.classBinding=r)}function _r(t){var e="";return t.staticClass&&(e+="staticClass:"+t.staticClass+","),t.classBinding&&(e+="class:"+t.classBinding+","),e}function br(t,e){var n=(e.warn,hn(t,"style"));n&&(t.staticStyle=JSON.stringify(Oa(n)));var r=vn(t,"style",!1);r&&(t.styleBinding=r)}function $r(t){var e="";return t.staticStyle&&(e+="staticStyle:"+t.staticStyle+","),t.styleBinding&&(e+="style:("+t.styleBinding+"),"),e}function Cr(t,e){e.value&&ln(t,"textContent","_s("+e.value+")")}function wr(t,e){e.value&&ln(t,"innerHTML","_s("+e.value+")")}function xr(t){return ns=ns||document.createElement("div"),ns.innerHTML=t,ns.textContent}function kr(t,e){var n=e?Rs:Ps;return t.replace(n,function(t){return Ms[t]})}function Ar(t,e){function n(e){l+=e,t=t.substring(e)}function r(t,n,r){var i,s;if(null==n&&(n=l),null==r&&(r=l),t&&(s=t.toLowerCase()),t)for(i=a.length-1;i>=0&&a[i].lowerCasedTag!==s;i--);else i=0;if(i>=0){for(var c=a.length-1;c>=i;c--)e.end&&e.end(a[c].tag,n,r);a.length=i,o=i&&a[i-1].tag}else"br"===s?e.start&&e.start(t,[],!0,n,r):"p"===s&&(e.start&&e.start(t,[],!1,n,r),e.end&&e.end(t,n,r))}for(var i,o,a=[],s=e.expectHTML,c=e.isUnaryTag||Di,u=e.canBeLeftOpenTag||Di,l=0;t;){if(i=t,o&&Is(o)){var f=o.toLowerCase(),p=Ds[f]||(Ds[f]=new RegExp("([\\s\\S]*?)(</"+f+"[^>]*>)","i")),d=0,v=t.replace(p,function(t,n,r){return d=r.length,Is(f)||"noscript"===f||(n=n.replace(/<!--([\s\S]*?)-->/g,"$1").replace(/<!\[CDATA\[([\s\S]*?)]]>/g,"$1")),e.chars&&e.chars(n),""});l+=t.length-v.length,t=v,r(f,l-d,l)}else{var h=t.indexOf("<");if(0===h){if($s.test(t)){var m=t.indexOf("--\x3e");if(m>=0){n(m+3);continue}}if(Cs.test(t)){var g=t.indexOf("]>");if(g>=0){n(g+2);continue}}var y=t.match(bs);if(y){n(y[0].length);continue}var _=t.match(_s);if(_){var b=l;n(_[0].length),r(_[1],b,l);continue}var $=function(){var e=t.match(gs);if(e){var r={tagName:e[1],attrs:[],start:l};n(e[0].length);for(var i,o;!(i=t.match(ys))&&(o=t.match(hs));)n(o[0].length),r.attrs.push(o);if(i)return r.unarySlash=i[1],n(i[0].length),r.end=l,r}}();if($){!function(t){var n=t.tagName,i=t.unarySlash;s&&("p"===o&&ps(n)&&r(o),u(n)&&o===n&&r(n));for(var l=c(n)||"html"===n&&"head"===o||!!i,f=t.attrs.length,p=new Array(f),d=0;d<f;d++){var v=t.attrs[d];ws&&-1===v[0].indexOf('""')&&(""===v[3]&&delete v[3],""===v[4]&&delete v[4],""===v[5]&&delete v[5]);var h=v[3]||v[4]||v[5]||"";p[d]={name:v[1],value:kr(h,e.shouldDecodeNewlines)}}l||(a.push({tag:n,lowerCasedTag:n.toLowerCase(),attrs:p}),o=n),e.start&&e.start(n,p,l,t.start,t.end)}($);continue}}var C=void 0,w=void 0,x=void 0;if(h>=0){for(w=t.slice(h);!(_s.test(w)||gs.test(w)||$s.test(w)||Cs.test(w)||(x=w.indexOf("<",1))<0);)h+=x,w=t.slice(h);C=t.substring(0,h),n(h)}h<0&&(C=t,t=""),e.chars&&C&&e.chars(C)}if(t===i){e.chars&&e.chars(t);break}}r()}function Or(t,e){function n(t){t.pre&&(s=!1),Ts(t.tag)&&(c=!1)}xs=e.warn||cn,js=e.getTagNamespace||Di,Es=e.mustUseProp||Di,Ts=e.isPreTag||Di,Os=un(e.modules,"preTransformNode"),As=un(e.modules,"transformNode"),Ss=un(e.modules,"postTransformNode"),ks=e.delimiters;var r,i,o=[],a=!1!==e.preserveWhitespace,s=!1,c=!1;return Ar(t,{warn:xs,expectHTML:e.expectHTML,isUnaryTag:e.isUnaryTag,canBeLeftOpenTag:e.canBeLeftOpenTag,shouldDecodeNewlines:e.shouldDecodeNewlines,start:function(t,a,u){var l=i&&i.ns||js(t);qi&&"svg"===l&&(a=Kr(a));var f={type:1,tag:t,attrsList:a,attrsMap:Vr(a),parent:i,children:[]};l&&(f.ns=l),Jr(f)&&!ro()&&(f.forbidden=!0);for(var p=0;p<Os.length;p++)Os[p](f,e);if(s||(Sr(f),f.pre&&(s=!0)),Ts(f.tag)&&(c=!0),s)Tr(f);else{Nr(f),Lr(f),Pr(f),Er(f),f.plain=!f.key&&!a.length,jr(f),Rr(f),Fr(f);for(var d=0;d<As.length;d++)As[d](f,e);Br(f)}if(r?o.length||r.if&&(f.elseif||f.else)&&Mr(r,{exp:f.elseif,block:f}):r=f,i&&!f.forbidden)if(f.elseif||f.else)Ir(f,i);else if(f.slotScope){i.plain=!1;var v=f.slotTarget||'"default"';(i.scopedSlots||(i.scopedSlots={}))[v]=f}else i.children.push(f),f.parent=i;u?n(f):(i=f,o.push(f));for(var h=0;h<Ss.length;h++)Ss[h](f,e)},end:function(){var t=o[o.length-1],e=t.children[t.children.length-1];e&&3===e.type&&" "===e.text&&!c&&t.children.pop(),o.length-=1,i=o[o.length-1],n(t)},chars:function(t){if(i&&(!qi||"textarea"!==i.tag||i.attrsMap.placeholder!==t)){var e=i.children;if(t=c||t.trim()?zr(i)?t:Ks(t):a&&e.length?" ":""){var n;!s&&" "!==t&&(n=gr(t,ks))?e.push({type:2,expression:n,text:t}):" "===t&&e.length&&" "===e[e.length-1].text||e.push({type:3,text:t})}}}}),r}function Sr(t){null!=hn(t,"v-pre")&&(t.pre=!0)}function Tr(t){var e=t.attrsList.length;if(e)for(var n=t.attrs=new Array(e),r=0;r<e;r++)n[r]={name:t.attrsList[r].name,value:JSON.stringify(t.attrsList[r].value)};else t.pre||(t.plain=!0)}function Er(t){var e=vn(t,"key");e&&(t.key=e)}function jr(t){var e=vn(t,"ref");e&&(t.ref=e,t.refInFor=Hr(t))}function Nr(t){var e;if(e=hn(t,"v-for")){var n=e.match(Hs);if(!n)return;t.for=n[2].trim();var r=n[1].trim(),i=r.match(Us);i?(t.alias=i[1].trim(),t.iterator1=i[2].trim(),i[3]&&(t.iterator2=i[3].trim())):t.alias=r}}function Lr(t){var e=hn(t,"v-if");if(e)t.if=e,Mr(t,{exp:e,block:t});else{null!=hn(t,"v-else")&&(t.else=!0);var n=hn(t,"v-else-if");n&&(t.elseif=n)}}function Ir(t,e){var n=Dr(e.children);n&&n.if&&Mr(n,{exp:t.elseif,block:t})}function Dr(t){for(var e=t.length;e--;){if(1===t[e].type)return t[e];t.pop()}}function Mr(t,e){t.ifConditions||(t.ifConditions=[]),t.ifConditions.push(e)}function Pr(t){null!=hn(t,"v-once")&&(t.once=!0)}function Rr(t){if("slot"===t.tag)t.slotName=vn(t,"name");else{var e=vn(t,"slot");e&&(t.slotTarget='""'===e?'"default"':e),"template"===t.tag&&(t.slotScope=hn(t,"scope"))}}function Fr(t){var e;(e=vn(t,"is"))&&(t.component=e),null!=hn(t,"inline-template")&&(t.inlineTemplate=!0)}function Br(t){var e,n,r,i,o,a,s,c=t.attrsList;for(e=0,n=c.length;e<n;e++)if(r=i=c[e].name,o=c[e].value,Bs.test(r))if(t.hasBindings=!0,a=Ur(r),a&&(r=r.replace(Js,"")),zs.test(r))r=r.replace(zs,""),o=an(o),s=!1,a&&(a.prop&&(s=!0,"innerHtml"===(r=Ni(r))&&(r="innerHTML")),a.camel&&(r=Ni(r)),a.sync&&dn(t,"update:"+Ni(r),gn(o,"$event"))),s||Es(t.tag,t.attrsMap.type,r)?ln(t,r,o):fn(t,r,o);else if(Fs.test(r))r=r.replace(Fs,""),dn(t,r,o,a,!1,xs);else{r=r.replace(Bs,"");var u=r.match(Vs),l=u&&u[1];l&&(r=r.slice(0,-(l.length+1))),pn(t,r,i,o,l,a)}else fn(t,r,JSON.stringify(o))}function Hr(t){for(var e=t;e;){if(void 0!==e.for)return!0;e=e.parent}return!1}function Ur(t){var e=t.match(Js);if(e){var n={};return e.forEach(function(t){n[t.slice(1)]=!0}),n}}function Vr(t){for(var e={},n=0,r=t.length;n<r;n++)e[t[n].name]=t[n].value;return e}function zr(t){return"script"===t.tag||"style"===t.tag}function Jr(t){return"style"===t.tag||"script"===t.tag&&(!t.attrsMap.type||"text/javascript"===t.attrsMap.type)}function Kr(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];qs.test(r.name)||(r.name=r.name.replace(Ws,""),e.push(r))}return e}function qr(t,e){t&&(Ns=Zs(e.staticKeys||""),Ls=e.isReservedTag||Di,Zr(t),Gr(t,!1))}function Wr(t){return l("type,tag,attrsList,attrsMap,plain,parent,children,attrs"+(t?","+t:""))}function Zr(t){if(t.static=Yr(t),1===t.type){if(!Ls(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var e=0,n=t.children.length;e<n;e++){var r=t.children[e];Zr(r),r.static||(t.static=!1)}if(t.ifConditions)for(var i=1,o=t.ifConditions.length;i<o;i++){var a=t.ifConditions[i].block;Zr(a),a.static||(t.static=!1)}}}function Gr(t,e){if(1===t.type){if((t.static||t.once)&&(t.staticInFor=e),t.static&&t.children.length&&(1!==t.children.length||3!==t.children[0].type))return void(t.staticRoot=!0);if(t.staticRoot=!1,t.children)for(var n=0,r=t.children.length;n<r;n++)Gr(t.children[n],e||!!t.for);if(t.ifConditions)for(var i=1,o=t.ifConditions.length;i<o;i++)Gr(t.ifConditions[i].block,e)}}function Yr(t){return 2!==t.type&&(3===t.type||!(!t.pre&&(t.hasBindings||t.if||t.for||Ei(t.tag)||!Ls(t.tag)||Qr(t)||!Object.keys(t).every(Ns))))}function Qr(t){for(;t.parent;){if(t=t.parent,"template"!==t.tag)return!1;if(t.for)return!0}return!1}function Xr(t,e,n){var r=e?"nativeOn:{":"on:{";for(var i in t){var o=t[i];r+='"'+i+'":'+ti(i,o)+","}return r.slice(0,-1)+"}"}function ti(t,e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map(function(e){return ti(t,e)}).join(",")+"]";var n=Ys.test(e.value),r=Gs.test(e.value);if(e.modifiers){var i="",o="",a=[];for(var s in e.modifiers)tc[s]?(o+=tc[s],Qs[s]&&a.push(s)):a.push(s);a.length&&(i+=ei(a)),o&&(i+=o);return"function($event){"+i+(n?e.value+"($event)":r?"("+e.value+")($event)":e.value)+"}"}return n||r?e.value:"function($event){"+e.value+"}"}function ei(t){return"if(!('button' in $event)&&"+t.map(ni).join("&&")+")return null;"}function ni(t){var e=parseInt(t,10);if(e)return"$event.keyCode!=="+e;var n=Qs[t];return"_k($event.keyCode,"+JSON.stringify(t)+(n?","+JSON.stringify(n):"")+")"}function ri(t,e){t.wrapData=function(n){return"_b("+n+",'"+t.tag+"',"+e.value+(e.modifiers&&e.modifiers.prop?",true":"")+")"}}function ii(t,e){var n=new nc(e);return{render:"with(this){return "+(t?oi(t,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function oi(t,e){if(t.staticRoot&&!t.staticProcessed)return ai(t,e);if(t.once&&!t.onceProcessed)return si(t,e);if(t.for&&!t.forProcessed)return li(t,e);if(t.if&&!t.ifProcessed)return ci(t,e);if("template"!==t.tag||t.slotTarget){if("slot"===t.tag)return Ci(t,e);var n;if(t.component)n=wi(t.component,t,e);else{var r=t.plain?void 0:fi(t,e),i=t.inlineTemplate?null:gi(t,e,!0);n="_c('"+t.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o<e.transforms.length;o++)n=e.transforms[o](t,n);return n}return gi(t,e)||"void 0"}function ai(t,e){return t.staticProcessed=!0,e.staticRenderFns.push("with(this){return "+oi(t,e)+"}"),"_m("+(e.staticRenderFns.length-1)+(t.staticInFor?",true":"")+")"}function si(t,e){if(t.onceProcessed=!0,t.if&&!t.ifProcessed)return ci(t,e);if(t.staticInFor){for(var n="",r=t.parent;r;){if(r.for){n=r.key;break}r=r.parent}return n?"_o("+oi(t,e)+","+e.onceId+++(n?","+n:"")+")":oi(t,e)}return ai(t,e)}function ci(t,e,n,r){return t.ifProcessed=!0,ui(t.ifConditions.slice(),e,n,r)}function ui(t,e,n,r){function i(t){return n?n(t,e):t.once?si(t,e):oi(t,e)}if(!t.length)return r||"_e()";var o=t.shift();return o.exp?"("+o.exp+")?"+i(o.block)+":"+ui(t,e,n,r):""+i(o.block)}function li(t,e,n,r){var i=t.for,o=t.alias,a=t.iterator1?","+t.iterator1:"",s=t.iterator2?","+t.iterator2:"";return t.forProcessed=!0,(r||"_l")+"(("+i+"),function("+o+a+s+"){return "+(n||oi)(t,e)+"})"}function fi(t,e){var n="{",r=pi(t,e);r&&(n+=r+","),t.key&&(n+="key:"+t.key+","),t.ref&&(n+="ref:"+t.ref+","),t.refInFor&&(n+="refInFor:true,"),t.pre&&(n+="pre:true,"),t.component&&(n+='tag:"'+t.tag+'",');for(var i=0;i<e.dataGenFns.length;i++)n+=e.dataGenFns[i](t);if(t.attrs&&(n+="attrs:{"+xi(t.attrs)+"},"),t.props&&(n+="domProps:{"+xi(t.props)+"},"),t.events&&(n+=Xr(t.events,!1,e.warn)+","),t.nativeEvents&&(n+=Xr(t.nativeEvents,!0,e.warn)+","),t.slotTarget&&(n+="slot:"+t.slotTarget+","),t.scopedSlots&&(n+=vi(t.scopedSlots,e)+","),t.model&&(n+="model:{value:"+t.model.value+",callback:"+t.model.callback+",expression:"+t.model.expression+"},"),t.inlineTemplate){var o=di(t,e);o&&(n+=o+",")}return n=n.replace(/,$/,"")+"}",t.wrapData&&(n=t.wrapData(n)),n}function pi(t,e){var n=t.directives;if(n){var r,i,o,a,s="directives:[",c=!1;for(r=0,i=n.length;r<i;r++){o=n[r],a=!0;var u=e.directives[o.name];u&&(a=!!u(t,o,e.warn)),a&&(c=!0,s+='{name:"'+o.name+'",rawName:"'+o.rawName+'"'+(o.value?",value:("+o.value+"),expression:"+JSON.stringify(o.value):"")+(o.arg?',arg:"'+o.arg+'"':"")+(o.modifiers?",modifiers:"+JSON.stringify(o.modifiers):"")+"},")}return c?s.slice(0,-1)+"]":void 0}}function di(t,e){var n=t.children[0];if(1===n.type){var r=ii(n,e.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map(function(t){return"function(){"+t+"}"}).join(",")+"]}"}}function vi(t,e){return"scopedSlots:_u(["+Object.keys(t).map(function(n){return hi(n,t[n],e)}).join(",")+"])"}function hi(t,e,n){return e.for&&!e.forProcessed?mi(t,e,n):"{key:"+t+",fn:function("+String(e.attrsMap.scope)+"){return "+("template"===e.tag?gi(e,n)||"void 0":oi(e,n))+"}}"}function mi(t,e,n){var r=e.for,i=e.alias,o=e.iterator1?","+e.iterator1:"",a=e.iterator2?","+e.iterator2:"";return e.forProcessed=!0,"_l(("+r+"),function("+i+o+a+"){return "+hi(t,e,n)+"})"}function gi(t,e,n,r,i){var o=t.children;if(o.length){var a=o[0];if(1===o.length&&a.for&&"template"!==a.tag&&"slot"!==a.tag)return(r||oi)(a,e);var s=n?yi(o,e.maybeComponent):0,c=i||bi;return"["+o.map(function(t){return c(t,e)}).join(",")+"]"+(s?","+s:"")}}function yi(t,e){for(var n=0,r=0;r<t.length;r++){var i=t[r];if(1===i.type){if(_i(i)||i.ifConditions&&i.ifConditions.some(function(t){return _i(t.block)})){n=2;break}(e(i)||i.ifConditions&&i.ifConditions.some(function(t){return e(t.block)}))&&(n=1)}}return n}function _i(t){return void 0!==t.for||"template"===t.tag||"slot"===t.tag}function bi(t,e){return 1===t.type?oi(t,e):$i(t)}function $i(t){return"_v("+(2===t.type?t.expression:ki(JSON.stringify(t.text)))+")"}function Ci(t,e){var n=t.slotName||'"default"',r=gi(t,e),i="_t("+n+(r?","+r:""),o=t.attrs&&"{"+t.attrs.map(function(t){return Ni(t.name)+":"+t.value}).join(",")+"}",a=t.attrsMap["v-bind"];return!o&&!a||r||(i+=",null"),o&&(i+=","+o),a&&(i+=(o?"":",null")+","+a),i+")"}function wi(t,e,n){var r=e.inlineTemplate?null:gi(e,n,!0);return"_c("+t+","+fi(e,n)+(r?","+r:"")+")"}function xi(t){for(var e="",n=0;n<t.length;n++){var r=t[n];e+='"'+r.name+'":'+ki(r.value)+","}return e.slice(0,-1)}function ki(t){return t.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function Ai(t,e){try{return new Function(t)}catch(n){return e.push({err:n,code:t}),y}}function Oi(t){var e=Object.create(null);return function(n,r,i){r=r||{};var o=r.delimiters?String(r.delimiters)+n:n;if(e[o])return e[o];var a=t(n,r),s={},c=[];return s.render=Ai(a.render,c),s.staticRenderFns=a.staticRenderFns.map(function(t){return Ai(t,c)}),e[o]=s}}function Si(t){if(t.outerHTML)return t.outerHTML;var e=document.createElement("div");return e.appendChild(t.cloneNode(!0)),e.innerHTML}var Ti=Object.prototype.toString,Ei=l("slot,component",!0),ji=Object.prototype.hasOwnProperty,Ni=d(function(t){return t.replace(/-(\w)/g,function(t,e){return e?e.toUpperCase():""})}),Li=d(function(t){return t.charAt(0).toUpperCase()+t.slice(1)}),Ii=d(function(t){return t.replace(/([^-])([A-Z])/g,"$1-$2").replace(/([^-])([A-Z])/g,"$1-$2").toLowerCase()}),Di=function(){return!1},Mi=function(t){return t},Pi="data-server-rendered",Ri=["component","directive","filter"],Fi=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated"],Bi={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:Di,isReservedAttr:Di,isUnknownElement:Di,getTagNamespace:y,parsePlatformTagName:Mi,mustUseProp:Di,_lifecycleHooks:Fi},Hi=Object.freeze({}),Ui=/[^\w.$]/,Vi=y,zi="__proto__"in{},Ji="undefined"!=typeof window,Ki=Ji&&window.navigator.userAgent.toLowerCase(),qi=Ki&&/msie|trident/.test(Ki),Wi=Ki&&Ki.indexOf("msie 9.0")>0,Zi=Ki&&Ki.indexOf("edge/")>0,Gi=Ki&&Ki.indexOf("android")>0,Yi=Ki&&/iphone|ipad|ipod|ios/.test(Ki),Qi=Ki&&/chrome\/\d+/.test(Ki)&&!Zi,Xi=!1;if(Ji)try{var to={};Object.defineProperty(to,"passive",{get:function(){Xi=!0}}),window.addEventListener("test-passive",null,to)}catch(t){}var eo,no,ro=function(){return void 0===eo&&(eo=!Ji&&"undefined"!=typeof global&&"server"===global.process.env.VUE_ENV),eo},io=Ji&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,oo="undefined"!=typeof Symbol&&A(Symbol)&&"undefined"!=typeof Reflect&&A(Reflect.ownKeys),ao=function(){function t(){r=!1;var t=n.slice(0);n.length=0;for(var e=0;e<t.length;e++)t[e]()}var e,n=[],r=!1;if("undefined"!=typeof Promise&&A(Promise)){var i=Promise.resolve(),o=function(t){console.error(t)};e=function(){i.then(t).catch(o),Yi&&setTimeout(y)}}else if("undefined"==typeof MutationObserver||!A(MutationObserver)&&"[object MutationObserverConstructor]"!==MutationObserver.toString())e=function(){setTimeout(t,0)};else{var a=1,s=new MutationObserver(t),c=document.createTextNode(String(a));s.observe(c,{characterData:!0}),e=function(){a=(a+1)%2,c.data=String(a)}}return function(t,i){var o;if(n.push(function(){if(t)try{t.call(i)}catch(t){k(t,i,"nextTick")}else o&&o(i)}),r||(r=!0,e()),!t&&"undefined"!=typeof Promise)return new Promise(function(t,e){o=t})}}();no="undefined"!=typeof Set&&A(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var so=0,co=function(){this.id=so++,this.subs=[]};co.prototype.addSub=function(t){this.subs.push(t)},co.prototype.removeSub=function(t){f(this.subs,t)},co.prototype.depend=function(){co.target&&co.target.addDep(this)},co.prototype.notify=function(){for(var t=this.subs.slice(),e=0,n=t.length;e<n;e++)t[e].update()},co.target=null;var uo=[],lo=Array.prototype,fo=Object.create(lo);["push","pop","shift","unshift","splice","sort","reverse"].forEach(function(t){var e=lo[t];w(fo,t,function(){for(var n=arguments,r=arguments.length,i=new Array(r);r--;)i[r]=n[r];var o,a=e.apply(this,i),s=this.__ob__;switch(t){case"push":case"unshift":o=i;break;case"splice":o=i.slice(2)}return o&&s.observeArray(o),s.dep.notify(),a})});var po=Object.getOwnPropertyNames(fo),vo={shouldConvert:!0,isSettingProps:!1},ho=function(t){if(this.value=t,this.dep=new co,this.vmCount=0,w(t,"__ob__",this),Array.isArray(t)){(zi?T:E)(t,fo,po),this.observeArray(t)}else this.walk(t)};ho.prototype.walk=function(t){for(var e=Object.keys(t),n=0;n<e.length;n++)N(t,e[n],t[e[n]])},ho.prototype.observeArray=function(t){for(var e=0,n=t.length;e<n;e++)j(t[e])};var mo=Bi.optionMergeStrategies;mo.data=function(t,e,n){return n?t||e?function(){var r="function"==typeof e?e.call(n):e,i="function"==typeof t?t.call(n):void 0;return r?M(r,i):i}:void 0:e?"function"!=typeof e?t:t?function(){return M(e.call(this),t.call(this))}:e:t},Fi.forEach(function(t){mo[t]=P}),Ri.forEach(function(t){mo[t+"s"]=R}),mo.watch=function(t,e){if(!e)return Object.create(t||null);if(!t)return e;var n={};m(n,t);for(var r in e){var i=n[r],o=e[r];i&&!Array.isArray(i)&&(i=[i]),n[r]=i?i.concat(o):[o]}return n},mo.props=mo.methods=mo.computed=function(t,e){if(!e)return Object.create(t||null);if(!t)return e;var n=Object.create(null);return m(n,t),m(n,e),n};var go=function(t,e){return void 0===e?t:e},yo=function(t,e,n,r,i,o,a){this.tag=t,this.data=e,this.children=n,this.text=r,this.elm=i,this.ns=void 0,this.context=o,this.functionalContext=void 0,this.key=e&&e.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1},_o={child:{}};_o.child.get=function(){return this.componentInstance},Object.defineProperties(yo.prototype,_o);var bo,$o=function(){var t=new yo;return t.text="",t.isComment=!0,t},Co=d(function(t){var e="&"===t.charAt(0);t=e?t.slice(1):t;var n="~"===t.charAt(0);t=n?t.slice(1):t;var r="!"===t.charAt(0);return t=r?t.slice(1):t,{name:t,once:n,capture:r,passive:e}}),wo=null,xo=[],ko=[],Ao={},Oo=!1,So=!1,To=0,Eo=0,jo=function(t,e,n,r){this.vm=t,t._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++Eo,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new no,this.newDepIds=new no,this.expression="","function"==typeof e?this.getter=e:(this.getter=x(e),this.getter||(this.getter=function(){})),this.value=this.lazy?void 0:this.get()};jo.prototype.get=function(){O(this);var t,e=this.vm;if(this.user)try{t=this.getter.call(e,e)}catch(t){k(t,e,'getter for watcher "'+this.expression+'"')}else t=this.getter.call(e,e);return this.deep&&St(t),S(),this.cleanupDeps(),t},jo.prototype.addDep=function(t){var e=t.id;this.newDepIds.has(e)||(this.newDepIds.add(e),this.newDeps.push(t),this.depIds.has(e)||t.addSub(this))},jo.prototype.cleanupDeps=function(){for(var t=this,e=this.deps.length;e--;){var n=t.deps[e];t.newDepIds.has(n.id)||n.removeSub(t)}var r=this.depIds;this.depIds=this.newDepIds,this.newDepIds=r,this.newDepIds.clear(),r=this.deps,this.deps=this.newDeps,this.newDeps=r,this.newDeps.length=0},jo.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():Ot(this)},jo.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||o(t)||this.deep){var e=this.value;if(this.value=t,this.user)try{this.cb.call(this.vm,t,e)}catch(t){k(t,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,t,e)}}},jo.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},jo.prototype.depend=function(){for(var t=this,e=this.deps.length;e--;)t.deps[e].depend()},jo.prototype.teardown=function(){var t=this;if(this.active){this.vm._isBeingDestroyed||f(this.vm._watchers,this);for(var e=this.deps.length;e--;)t.deps[e].removeSub(t);this.active=!1}};var No=new no,Lo={enumerable:!0,configurable:!0,get:y,set:y},Io={lazy:!0},Do={init:function(t,e,n,r){if(!t.componentInstance||t.componentInstance._isDestroyed){(t.componentInstance=qt(t,wo,n,r)).$mount(e?t.elm:void 0,e)}else if(t.data.keepAlive){var i=t;Do.prepatch(i,i)}},prepatch:function(t,e){var n=e.componentOptions;gt(e.componentInstance=t.componentInstance,n.propsData,n.listeners,e,n.children)},insert:function(t){var e=t.context,n=t.componentInstance;n._isMounted||(n._isMounted=!0,$t(n,"mounted")),t.data.keepAlive&&(e._isMounted?kt(n):_t(n,!0))},destroy:function(t){var e=t.componentInstance;e._isDestroyed||(t.data.keepAlive?bt(e,!0):e.$destroy())}},Mo=Object.keys(Do),Po=1,Ro=2,Fo=0;!function(t){t.prototype._init=function(t){var e=this;e._uid=Fo++,e._isVue=!0,t&&t._isComponent?le(e,t):e.$options=H(fe(e.constructor),t||{},e),e._renderProxy=e,e._self=e,ht(e),ct(e),ue(e),$t(e,"beforeCreate"),Ut(e),jt(e),Ht(e),$t(e,"created"),e.$options.el&&e.$mount(e.$options.el)}}(ve),function(t){var e={};e.get=function(){return this._data};var n={};n.get=function(){return this._props},Object.defineProperty(t.prototype,"$data",e),Object.defineProperty(t.prototype,"$props",n),t.prototype.$set=L,t.prototype.$delete=I,t.prototype.$watch=function(t,e,n){var r=this;if(a(e))return Bt(r,t,e,n);n=n||{},n.user=!0;var i=new jo(r,t,e,n);return n.immediate&&e.call(r,i.value),function(){i.teardown()}}}(ve),function(t){var e=/^hook:/;t.prototype.$on=function(t,n){var r=this,i=this;if(Array.isArray(t))for(var o=0,a=t.length;o<a;o++)r.$on(t[o],n);else(i._events[t]||(i._events[t]=[])).push(n),e.test(t)&&(i._hasHookEvent=!0);return i},t.prototype.$once=function(t,e){function n(){r.$off(t,n),e.apply(r,arguments)}var r=this;return n.fn=e,r.$on(t,n),r},t.prototype.$off=function(t,e){var n=this,r=this;if(!arguments.length)return r._events=Object.create(null),r;if(Array.isArray(t)){for(var i=0,o=t.length;i<o;i++)n.$off(t[i],e);return r}var a=r._events[t];if(!a)return r;if(1===arguments.length)return r._events[t]=null,r;for(var s,c=a.length;c--;)if((s=a[c])===e||s.fn===e){a.splice(c,1);break}return r},t.prototype.$emit=function(t){var e=this,n=e._events[t];if(n){n=n.length>1?h(n):n;for(var r=h(arguments,1),i=0,o=n.length;i<o;i++)n[i].apply(e,r)}return e}}(ve),function(t){t.prototype._update=function(t,e){var n=this;n._isMounted&&$t(n,"beforeUpdate");var r=n.$el,i=n._vnode,o=wo;wo=n,n._vnode=t,n.$el=i?n.__patch__(i,t):n.__patch__(n.$el,t,e,!1,n.$options._parentElm,n.$options._refElm),wo=o,r&&(r.__vue__=null),n.$el&&(n.$el.__vue__=n),n.$vnode&&n.$parent&&n.$vnode===n.$parent._vnode&&(n.$parent.$el=n.$el)},t.prototype.$forceUpdate=function(){var t=this;t._watcher&&t._watcher.update()},t.prototype.$destroy=function(){var t=this;if(!t._isBeingDestroyed){$t(t,"beforeDestroy"),t._isBeingDestroyed=!0;var e=t.$parent;!e||e._isBeingDestroyed||t.$options.abstract||f(e.$children,t),t._watcher&&t._watcher.teardown();for(var n=t._watchers.length;n--;)t._watchers[n].teardown();t._data.__ob__&&t._data.__ob__.vmCount--,t._isDestroyed=!0,t.__patch__(t._vnode,null),$t(t,"destroyed"),t.$off(),t.$el&&(t.$el.__vue__=null),t.$options._parentElm=t.$options._refElm=null}}}(ve),function(t){t.prototype.$nextTick=function(t){return ao(t,this)},t.prototype._render=function(){var t=this,e=t.$options,n=e.render,r=e.staticRenderFns,i=e._parentVnode;if(t._isMounted)for(var o in t.$slots)t.$slots[o]=Z(t.$slots[o]);t.$scopedSlots=i&&i.data.scopedSlots||Hi,r&&!t._staticTrees&&(t._staticTrees=[]),t.$vnode=i;var a;try{a=n.call(t._renderProxy,t.$createElement)}catch(e){k(e,t,"render function"),a=t._vnode}return a instanceof yo||(a=$o()),a.parent=i,a},t.prototype._o=ae,t.prototype._n=u,t.prototype._s=c,t.prototype._l=te,t.prototype._t=ee,t.prototype._q=_,t.prototype._i=b,t.prototype._m=oe,t.prototype._f=ne,t.prototype._k=re,t.prototype._b=ie,t.prototype._v=q,t.prototype._e=$o,t.prototype._u=vt}(ve);var Bo=[String,RegExp],Ho={name:"keep-alive",abstract:!0,props:{include:Bo,exclude:Bo},created:function(){this.cache=Object.create(null)},destroyed:function(){var t=this;for(var e in t.cache)xe(t.cache[e])},watch:{include:function(t){we(this.cache,this._vnode,function(e){return Ce(t,e)})},exclude:function(t){we(this.cache,this._vnode,function(e){return!Ce(t,e)})}},render:function(){var t=st(this.$slots.default),e=t&&t.componentOptions;if(e){var n=$e(e);if(n&&(this.include&&!Ce(this.include,n)||this.exclude&&Ce(this.exclude,n)))return t;var r=null==t.key?e.Ctor.cid+(e.tag?"::"+e.tag:""):t.key;this.cache[r]?t.componentInstance=this.cache[r].componentInstance:this.cache[r]=t,t.data.keepAlive=!0}return t}},Uo={KeepAlive:Ho};!function(t){var e={};e.get=function(){return Bi},Object.defineProperty(t,"config",e),t.util={warn:Vi,extend:m,mergeOptions:H,defineReactive:N},t.set=L,t.delete=I,t.nextTick=ao,t.options=Object.create(null),Ri.forEach(function(e){t.options[e+"s"]=Object.create(null)}),t.options._base=t,m(t.options.components,Uo),he(t),me(t),ge(t),be(t)}(ve),Object.defineProperty(ve.prototype,"$isServer",{get:ro}),Object.defineProperty(ve.prototype,"$ssrContext",{get:function(){return this.$vnode.ssrContext}}),ve.version="2.3.3";var Vo,zo,Jo,Ko,qo,Wo,Zo,Go,Yo,Qo=l("style,class"),Xo=l("input,textarea,option,select"),ta=function(t,e,n){return"value"===n&&Xo(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},ea=l("contenteditable,draggable,spellcheck"),na=l("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),ra="http://www.w3.org/1999/xlink",ia=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},oa=function(t){return ia(t)?t.slice(6,t.length):""},aa=function(t){return null==t||!1===t},sa={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"
},ca=l("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template"),ua=l("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),la=function(t){return"pre"===t},fa=function(t){return ca(t)||ua(t)},pa=Object.create(null),da=Object.freeze({createElement:De,createElementNS:Me,createTextNode:Pe,createComment:Re,insertBefore:Fe,removeChild:Be,appendChild:He,parentNode:Ue,nextSibling:Ve,tagName:ze,setTextContent:Je,setAttribute:Ke}),va={create:function(t,e){qe(e)},update:function(t,e){t.data.ref!==e.data.ref&&(qe(t,!0),qe(e))},destroy:function(t){qe(t,!0)}},ha=new yo("",{},[]),ma=["create","activate","update","remove","destroy"],ga={create:Ye,update:Ye,destroy:function(t){Ye(t,ha)}},ya=Object.create(null),_a=[va,ga],ba={create:nn,update:nn},$a={create:on,update:on},Ca=/[\w).+\-_$\]]/,wa="__r",xa="__c",ka={create:Nn,update:Nn},Aa={create:Ln,update:Ln},Oa=d(function(t){var e={};return t.split(/;(?![^(]*\))/g).forEach(function(t){if(t){var n=t.split(/:(.+)/);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e}),Sa=/^--/,Ta=/\s*!important$/,Ea=function(t,e,n){if(Sa.test(e))t.style.setProperty(e,n);else if(Ta.test(n))t.style.setProperty(e,n.replace(Ta,""),"important");else{var r=Na(e);if(Array.isArray(n))for(var i=0,o=n.length;i<o;i++)t.style[r]=n[i];else t.style[r]=n}},ja=["Webkit","Moz","ms"],Na=d(function(t){if(Yo=Yo||document.createElement("div"),"filter"!==(t=Ni(t))&&t in Yo.style)return t;for(var e=t.charAt(0).toUpperCase()+t.slice(1),n=0;n<ja.length;n++){var r=ja[n]+e;if(r in Yo.style)return r}}),La={create:Bn,update:Bn},Ia=d(function(t){return{enterClass:t+"-enter",enterToClass:t+"-enter-to",enterActiveClass:t+"-enter-active",leaveClass:t+"-leave",leaveToClass:t+"-leave-to",leaveActiveClass:t+"-leave-active"}}),Da=Ji&&!Wi,Ma="transition",Pa="animation",Ra="transition",Fa="transitionend",Ba="animation",Ha="animationend";Da&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Ra="WebkitTransition",Fa="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Ba="WebkitAnimation",Ha="webkitAnimationEnd"));var Ua=Ji&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout,Va=/\b(transform|all)(,|$)/,za=Ji?{create:er,activate:er,remove:function(t,e){!0!==t.data.show?Qn(t,e):e()}}:{},Ja=[ba,$a,ka,Aa,La,za],Ka=Ja.concat(_a),qa=function(r){function o(t){return new yo(E.tagName(t).toLowerCase(),{},[],void 0,t)}function a(t,e){function n(){0==--n.listeners&&s(t)}return n.listeners=e,n}function s(t){var n=E.parentNode(t);e(n)&&E.removeChild(n,t)}function c(t,r,i,o,a){if(t.isRootInsert=!a,!u(t,r,i,o)){var s=t.data,c=t.children,l=t.tag;e(l)?(t.elm=t.ns?E.createElementNS(t.ns,l):E.createElement(l,t),g(t),v(t,c,r),e(s)&&m(t,r),d(i,t.elm,o)):n(t.isComment)?(t.elm=E.createComment(t.text),d(i,t.elm,o)):(t.elm=E.createTextNode(t.text),d(i,t.elm,o))}}function u(t,r,i,o){var a=t.data;if(e(a)){var s=e(t.componentInstance)&&a.keepAlive;if(e(a=a.hook)&&e(a=a.init)&&a(t,!1,i,o),e(t.componentInstance))return f(t,r),n(s)&&p(t,r,i,o),!0}}function f(t,n){e(t.data.pendingInsert)&&n.push.apply(n,t.data.pendingInsert),t.elm=t.componentInstance.$el,h(t)?(m(t,n),g(t)):(qe(t),n.push(t))}function p(t,n,r,i){for(var o,a=t;a.componentInstance;)if(a=a.componentInstance._vnode,e(o=a.data)&&e(o=o.transition)){for(o=0;o<S.activate.length;++o)S.activate[o](ha,a);n.push(a);break}d(r,t.elm,i)}function d(t,n,r){e(t)&&(e(r)?r.parentNode===t&&E.insertBefore(t,n,r):E.appendChild(t,n))}function v(t,e,n){if(Array.isArray(e))for(var r=0;r<e.length;++r)c(e[r],n,t.elm,null,!0);else i(t.text)&&E.appendChild(t.elm,E.createTextNode(t.text))}function h(t){for(;t.componentInstance;)t=t.componentInstance._vnode;return e(t.tag)}function m(t,n){for(var r=0;r<S.create.length;++r)S.create[r](ha,t);A=t.data.hook,e(A)&&(e(A.create)&&A.create(ha,t),e(A.insert)&&n.push(t))}function g(t){for(var n,r=t;r;)e(n=r.context)&&e(n=n.$options._scopeId)&&E.setAttribute(t.elm,n,""),r=r.parent;e(n=wo)&&n!==t.context&&e(n=n.$options._scopeId)&&E.setAttribute(t.elm,n,"")}function y(t,e,n,r,i,o){for(;r<=i;++r)c(n[r],o,t,e)}function _(t){var n,r,i=t.data;if(e(i))for(e(n=i.hook)&&e(n=n.destroy)&&n(t),n=0;n<S.destroy.length;++n)S.destroy[n](t);if(e(n=t.children))for(r=0;r<t.children.length;++r)_(t.children[r])}function b(t,n,r,i){for(;r<=i;++r){var o=n[r];e(o)&&(e(o.tag)?($(o),_(o)):s(o.elm))}}function $(t,n){if(e(n)||e(t.data)){var r,i=S.remove.length+1;for(e(n)?n.listeners+=i:n=a(t.elm,i),e(r=t.componentInstance)&&e(r=r._vnode)&&e(r.data)&&$(r,n),r=0;r<S.remove.length;++r)S.remove[r](t,n);e(r=t.data.hook)&&e(r=r.remove)?r(t,n):n()}else s(t.elm)}function C(n,r,i,o,a){for(var s,u,l,f,p=0,d=0,v=r.length-1,h=r[0],m=r[v],g=i.length-1,_=i[0],$=i[g],C=!a;p<=v&&d<=g;)t(h)?h=r[++p]:t(m)?m=r[--v]:We(h,_)?(w(h,_,o),h=r[++p],_=i[++d]):We(m,$)?(w(m,$,o),m=r[--v],$=i[--g]):We(h,$)?(w(h,$,o),C&&E.insertBefore(n,h.elm,E.nextSibling(m.elm)),h=r[++p],$=i[--g]):We(m,_)?(w(m,_,o),C&&E.insertBefore(n,m.elm,h.elm),m=r[--v],_=i[++d]):(t(s)&&(s=Ge(r,p,v)),u=e(_.key)?s[_.key]:null,t(u)?(c(_,o,n,h.elm),_=i[++d]):(l=r[u],We(l,_)?(w(l,_,o),r[u]=void 0,C&&E.insertBefore(n,l.elm,h.elm),_=i[++d]):(c(_,o,n,h.elm),_=i[++d])));p>v?(f=t(i[g+1])?null:i[g+1].elm,y(n,f,i,d,g,o)):d>g&&b(n,r,p,v)}function w(r,i,o,a){if(r!==i){if(n(i.isStatic)&&n(r.isStatic)&&i.key===r.key&&(n(i.isCloned)||n(i.isOnce)))return i.elm=r.elm,void(i.componentInstance=r.componentInstance);var s,c=i.data;e(c)&&e(s=c.hook)&&e(s=s.prepatch)&&s(r,i);var u=i.elm=r.elm,l=r.children,f=i.children;if(e(c)&&h(i)){for(s=0;s<S.update.length;++s)S.update[s](r,i);e(s=c.hook)&&e(s=s.update)&&s(r,i)}t(i.text)?e(l)&&e(f)?l!==f&&C(u,l,f,o,a):e(f)?(e(r.text)&&E.setTextContent(u,""),y(u,null,f,0,f.length-1,o)):e(l)?b(u,l,0,l.length-1):e(r.text)&&E.setTextContent(u,""):r.text!==i.text&&E.setTextContent(u,i.text),e(c)&&e(s=c.hook)&&e(s=s.postpatch)&&s(r,i)}}function x(t,r,i){if(n(i)&&e(t.parent))t.parent.data.pendingInsert=r;else for(var o=0;o<r.length;++o)r[o].data.hook.insert(r[o])}function k(t,n,r){n.elm=t;var i=n.tag,o=n.data,a=n.children;if(e(o)&&(e(A=o.hook)&&e(A=A.init)&&A(n,!0),e(A=n.componentInstance)))return f(n,r),!0;if(e(i)){if(e(a))if(t.hasChildNodes()){for(var s=!0,c=t.firstChild,u=0;u<a.length;u++){if(!c||!k(c,a[u],r)){s=!1;break}c=c.nextSibling}if(!s||c)return!1}else v(n,a,r);if(e(o))for(var l in o)if(!j(l)){m(n,r);break}}else t.data!==n.text&&(t.data=n.text);return!0}var A,O,S={},T=r.modules,E=r.nodeOps;for(A=0;A<ma.length;++A)for(S[ma[A]]=[],O=0;O<T.length;++O)e(T[O][ma[A]])&&S[ma[A]].push(T[O][ma[A]]);var j=l("attrs,style,class,staticClass,staticStyle,key");return function(r,i,a,s,u,l){if(t(i))return void(e(r)&&_(r));var f=!1,p=[];if(t(r))f=!0,c(i,p,u,l);else{var d=e(r.nodeType);if(!d&&We(r,i))w(r,i,p,s);else{if(d){if(1===r.nodeType&&r.hasAttribute(Pi)&&(r.removeAttribute(Pi),a=!0),n(a)&&k(r,i,p))return x(i,p,!0),r;r=o(r)}var v=r.elm,m=E.parentNode(v);if(c(i,p,v._leaveCb?null:m,E.nextSibling(v)),e(i.parent)){for(var g=i.parent;g;)g.elm=i.elm,g=g.parent;if(h(i))for(var y=0;y<S.create.length;++y)S.create[y](ha,i.parent)}e(m)?b(m,[r],0,0):e(r.tag)&&_(r)}}return x(i,p,f),i.elm}}({nodeOps:da,modules:Ka});Wi&&document.addEventListener("selectionchange",function(){var t=document.activeElement;t&&t.vmodel&&sr(t,"input")});var Wa={inserted:function(t,e,n){if("select"===n.tag){var r=function(){nr(t,e,n.context)};r(),(qi||Zi)&&setTimeout(r,0)}else"textarea"!==n.tag&&"text"!==t.type&&"password"!==t.type||(t._vModifiers=e.modifiers,e.modifiers.lazy||(t.addEventListener("change",ar),Gi||(t.addEventListener("compositionstart",or),t.addEventListener("compositionend",ar)),Wi&&(t.vmodel=!0)))},componentUpdated:function(t,e,n){if("select"===n.tag){nr(t,e,n.context);(t.multiple?e.value.some(function(e){return rr(e,t.options)}):e.value!==e.oldValue&&rr(e.value,t.options))&&sr(t,"change")}}},Za={bind:function(t,e,n){var r=e.value;n=cr(n);var i=n.data&&n.data.transition,o=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&i&&!Wi?(n.data.show=!0,Yn(n,function(){t.style.display=o})):t.style.display=r?o:"none"},update:function(t,e,n){var r=e.value;r!==e.oldValue&&(n=cr(n),n.data&&n.data.transition&&!Wi?(n.data.show=!0,r?Yn(n,function(){t.style.display=t.__vOriginalDisplay}):Qn(n,function(){t.style.display="none"})):t.style.display=r?t.__vOriginalDisplay:"none")},unbind:function(t,e,n,r,i){i||(t.style.display=t.__vOriginalDisplay)}},Ga={model:Wa,show:Za},Ya={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]},Qa={name:"transition",props:Ya,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(function(t){return t.tag}),n.length)){var r=this.mode,o=n[0];if(pr(this.$vnode))return o;var a=ur(o);if(!a)return o;if(this._leaving)return fr(t,o);var s="__transition-"+this._uid+"-";a.key=null==a.key?s+a.tag:i(a.key)?0===String(a.key).indexOf(s)?a.key:s+a.key:a.key;var c=(a.data||(a.data={})).transition=lr(this),u=this._vnode,l=ur(u);if(a.data.directives&&a.data.directives.some(function(t){return"show"===t.name})&&(a.data.show=!0),l&&l.data&&!dr(a,l)){var f=l&&(l.data.transition=m({},c));if("out-in"===r)return this._leaving=!0,Q(f,"afterLeave",function(){e._leaving=!1,e.$forceUpdate()}),fr(t,o);if("in-out"===r){var p,d=function(){p()};Q(c,"afterEnter",d),Q(c,"enterCancelled",d),Q(f,"delayLeave",function(t){p=t})}}return o}}},Xa=m({tag:String,moveClass:String},Ya);delete Xa.mode;var ts={props:Xa,render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=lr(this),s=0;s<i.length;s++){var c=i[s];c.tag&&null!=c.key&&0!==String(c.key).indexOf("__vlist")&&(o.push(c),n[c.key]=c,(c.data||(c.data={})).transition=a)}if(r){for(var u=[],l=[],f=0;f<r.length;f++){var p=r[f];p.data.transition=a,p.data.pos=p.elm.getBoundingClientRect(),n[p.key]?u.push(p):l.push(p)}this.kept=t(e,null,u),this.removed=l}return t(e,null,o)},beforeUpdate:function(){this.__patch__(this._vnode,this.kept,!1,!0),this._vnode=this.kept},updated:function(){var t=this.prevChildren,e=this.moveClass||(this.name||"v")+"-move";if(t.length&&this.hasMove(t[0].elm,e)){t.forEach(vr),t.forEach(hr),t.forEach(mr);var n=document.body;n.offsetHeight;t.forEach(function(t){if(t.data.moved){var n=t.elm,r=n.style;Jn(n,e),r.transform=r.WebkitTransform=r.transitionDuration="",n.addEventListener(Fa,n._moveCb=function t(r){r&&!/transform$/.test(r.propertyName)||(n.removeEventListener(Fa,t),n._moveCb=null,Kn(n,e))})}})}},methods:{hasMove:function(t,e){if(!Da)return!1;if(null!=this._hasMove)return this._hasMove;var n=t.cloneNode();t._transitionClasses&&t._transitionClasses.forEach(function(t){Un(n,t)}),Hn(n,e),n.style.display="none",this.$el.appendChild(n);var r=Wn(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}},es={Transition:Qa,TransitionGroup:ts};ve.config.mustUseProp=ta,ve.config.isReservedTag=fa,ve.config.isReservedAttr=Qo,ve.config.getTagNamespace=Ne,ve.config.isUnknownElement=Le,m(ve.options.directives,Ga),m(ve.options.components,es),ve.prototype.__patch__=Ji?qa:y,ve.prototype.$mount=function(t,e){return t=t&&Ji?Ie(t):void 0,mt(this,t,e)},setTimeout(function(){Bi.devtools&&io&&io.emit("init",ve)},0);var ns,rs=!!Ji&&function(t,e){var n=document.createElement("div");return n.innerHTML='<div a="'+t+'">',n.innerHTML.indexOf(e)>0}("\n"," "),is=/\{\{((?:.|\n)+?)\}\}/g,os=d(function(t){var e=t[0].replace(/[-.*+?^${}()|[\]\/\\]/g,"\\$&"),n=t[1].replace(/[-.*+?^${}()|[\]\/\\]/g,"\\$&");return new RegExp(e+"((?:.|\\n)+?)"+n,"g")}),as={staticKeys:["staticClass"],transformNode:yr,genData:_r},ss={staticKeys:["staticStyle"],transformNode:br,genData:$r},cs=[as,ss],us={model:xn,text:Cr,html:wr},ls=l("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),fs=l("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),ps=l("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),ds={expectHTML:!0,modules:cs,directives:us,isPreTag:la,isUnaryTag:ls,mustUseProp:ta,canBeLeftOpenTag:fs,isReservedTag:fa,getTagNamespace:Ne,staticKeys:function(t){return t.reduce(function(t,e){return t.concat(e.staticKeys||[])},[]).join(",")}(cs)},vs=[/"([^"]*)"+/.source,/'([^']*)'+/.source,/([^\s"'=<>`]+)/.source],hs=new RegExp("^\\s*"+/([^\s"'<>\/=]+)/.source+"(?:\\s*("+/(?:=)/.source+")\\s*(?:"+vs.join("|")+"))?"),ms="[a-zA-Z_][\\w\\-\\.]*",gs=new RegExp("^<((?:"+ms+"\\:)?"+ms+")"),ys=/^\s*(\/?)>/,_s=new RegExp("^<\\/((?:"+ms+"\\:)?"+ms+")[^>]*>"),bs=/^<!DOCTYPE [^>]+>/i,$s=/^<!--/,Cs=/^<!\[/,ws=!1;"x".replace(/x(.)?/g,function(t,e){ws=""===e});var xs,ks,As,Os,Ss,Ts,Es,js,Ns,Ls,Is=l("script,style,textarea",!0),Ds={},Ms={"<":"<",">":">",""":'"',"&":"&"," ":"\n"},Ps=/&(?:lt|gt|quot|amp);/g,Rs=/&(?:lt|gt|quot|amp|#10);/g,Fs=/^@|^v-on:/,Bs=/^v-|^@|^:/,Hs=/(.*?)\s+(?:in|of)\s+(.*)/,Us=/\((\{[^}]*\}|[^,]*),([^,]*)(?:,([^,]*))?\)/,Vs=/:(.*)$/,zs=/^:|^v-bind:/,Js=/\.[^.]+/g,Ks=d(xr),qs=/^xmlns:NS\d+/,Ws=/^NS\d+:/,Zs=d(Wr),Gs=/^\s*([\w$_]+|\([^)]*?\))\s*=>|^function\s*\(/,Ys=/^\s*[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?']|\[".*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*\s*$/,Qs={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Xs=function(t){return"if("+t+")return null;"},tc={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:Xs("$event.target !== $event.currentTarget"),ctrl:Xs("!$event.ctrlKey"),shift:Xs("!$event.shiftKey"),alt:Xs("!$event.altKey"),meta:Xs("!$event.metaKey"),left:Xs("'button' in $event && $event.button !== 0"),middle:Xs("'button' in $event && $event.button !== 1"),right:Xs("'button' in $event && $event.button !== 2")},ec={bind:ri,cloak:y},nc=function(t){this.options=t,this.warn=t.warn||cn,this.transforms=un(t.modules,"transformCode"),this.dataGenFns=un(t.modules,"genData"),this.directives=m(m({},ec),t.directives);var e=t.isReservedTag||Di;this.maybeComponent=function(t){return!e(t.tag)},this.onceId=0,this.staticRenderFns=[]},rc=function(t){return function(e){function n(n,r){var i=Object.create(e),o=[],a=[];if(i.warn=function(t,e){(e?a:o).push(t)},r){r.modules&&(i.modules=(e.modules||[]).concat(r.modules)),r.directives&&(i.directives=m(Object.create(e.directives),r.directives));for(var s in r)"modules"!==s&&"directives"!==s&&(i[s]=r[s])}var c=t(n,i);return c.errors=o,c.tips=a,c}return{compile:n,compileToFunctions:Oi(n)}}}(function(t,e){var n=Or(t.trim(),e);qr(n,e);var r=ii(n,e);return{ast:n,render:r.render,staticRenderFns:r.staticRenderFns}}),ic=rc(ds),oc=ic.compileToFunctions,ac=d(function(t){var e=Ie(t);return e&&e.innerHTML}),sc=ve.prototype.$mount;return ve.prototype.$mount=function(t,e){if((t=t&&Ie(t))===document.body||t===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=ac(r));else{if(!r.nodeType)return this;r=r.innerHTML}else t&&(r=Si(t));if(r){var i=oc(r,{shouldDecodeNewlines:rs,delimiters:n.delimiters},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return sc.call(this,t,e)},ve.compile=oc,ve}); | 9,941.75 | 31,990 | 0.656248 |
15d5d1c1bf371ea4e6dbec1e6a678997af27ccf4 | 13,039 | js | JavaScript | lib/tracer-config.test.js | dsp-testing/robertbrignull-codeql-action | 0c830920d30ba1e533044b130275cf5cdcb6c803 | [
"MIT"
] | 14 | 2020-02-18T23:12:36.000Z | 2020-06-03T15:19:05.000Z | lib/tracer-config.test.js | dsp-testing/robertbrignull-codeql-action | 0c830920d30ba1e533044b130275cf5cdcb6c803 | [
"MIT"
] | 7 | 2021-05-11T23:33:47.000Z | 2021-06-24T08:37:29.000Z | lib/tracer-config.test.js | dsp-testing/robertbrignull-codeql-action | 0c830920d30ba1e533044b130275cf5cdcb6c803 | [
"MIT"
] | 2 | 2020-05-04T23:45:45.000Z | 2020-05-20T11:52:21.000Z | "use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const fs = __importStar(require("fs"));
const path = __importStar(require("path"));
const ava_1 = __importDefault(require("ava"));
const codeql_1 = require("./codeql");
const languages_1 = require("./languages");
const testing_utils_1 = require("./testing-utils");
const tracer_config_1 = require("./tracer-config");
const util = __importStar(require("./util"));
testing_utils_1.setupTests(ava_1.default);
function getTestConfig(tmpDir) {
return {
languages: [languages_1.Language.java],
queries: {},
pathsIgnore: [],
paths: [],
originalUserInput: {},
tempDir: tmpDir,
toolCacheDir: tmpDir,
codeQLCmd: "",
gitHubVersion: { type: util.GitHubVariant.DOTCOM },
dbLocation: path.resolve(tmpDir, "codeql_databases"),
packs: {},
};
}
// A very minimal setup
ava_1.default("getTracerConfigForLanguage - minimal setup", async (t) => {
await util.withTmpDir(async (tmpDir) => {
const config = getTestConfig(tmpDir);
const codeQL = codeql_1.setCodeQL({
async getTracerEnv() {
return {
ODASA_TRACER_CONFIGURATION: "abc",
foo: "bar",
};
},
});
const result = await tracer_config_1.getTracerConfigForLanguage(codeQL, config, languages_1.Language.javascript);
t.deepEqual(result, { spec: "abc", env: { foo: "bar" } });
});
});
// Existing vars should not be overwritten, unless they are critical or prefixed with CODEQL_
ava_1.default("getTracerConfigForLanguage - existing / critical vars", async (t) => {
await util.withTmpDir(async (tmpDir) => {
const config = getTestConfig(tmpDir);
// Set up some variables in the environment
process.env["foo"] = "abc";
process.env["SEMMLE_PRELOAD_libtrace"] = "abc";
process.env["SEMMLE_RUNNER"] = "abc";
process.env["SEMMLE_COPY_EXECUTABLES_ROOT"] = "abc";
process.env["SEMMLE_DEPTRACE_SOCKET"] = "abc";
process.env["SEMMLE_JAVA_TOOL_OPTIONS"] = "abc";
process.env["CODEQL_VAR"] = "abc";
// Now CodeQL returns all these variables, and one more, with different values
const codeQL = codeql_1.setCodeQL({
async getTracerEnv() {
return {
ODASA_TRACER_CONFIGURATION: "abc",
foo: "bar",
baz: "qux",
SEMMLE_PRELOAD_libtrace: "SEMMLE_PRELOAD_libtrace",
SEMMLE_RUNNER: "SEMMLE_RUNNER",
SEMMLE_COPY_EXECUTABLES_ROOT: "SEMMLE_COPY_EXECUTABLES_ROOT",
SEMMLE_DEPTRACE_SOCKET: "SEMMLE_DEPTRACE_SOCKET",
SEMMLE_JAVA_TOOL_OPTIONS: "SEMMLE_JAVA_TOOL_OPTIONS",
CODEQL_VAR: "CODEQL_VAR",
};
},
});
const result = await tracer_config_1.getTracerConfigForLanguage(codeQL, config, languages_1.Language.javascript);
t.deepEqual(result, {
spec: "abc",
env: {
// Should contain all variables except 'foo', because that already existed in the
// environment with a different value, and is not deemed a "critical" variable.
baz: "qux",
SEMMLE_PRELOAD_libtrace: "SEMMLE_PRELOAD_libtrace",
SEMMLE_RUNNER: "SEMMLE_RUNNER",
SEMMLE_COPY_EXECUTABLES_ROOT: "SEMMLE_COPY_EXECUTABLES_ROOT",
SEMMLE_DEPTRACE_SOCKET: "SEMMLE_DEPTRACE_SOCKET",
SEMMLE_JAVA_TOOL_OPTIONS: "SEMMLE_JAVA_TOOL_OPTIONS",
CODEQL_VAR: "CODEQL_VAR",
},
});
});
});
ava_1.default("concatTracerConfigs - minimal configs correctly combined", async (t) => {
await util.withTmpDir(async (tmpDir) => {
const config = getTestConfig(tmpDir);
const spec1 = path.join(tmpDir, "spec1");
fs.writeFileSync(spec1, "foo.log\n2\nabc\ndef");
const tc1 = {
spec: spec1,
env: {
a: "a",
b: "b",
},
};
const spec2 = path.join(tmpDir, "spec2");
fs.writeFileSync(spec2, "foo.log\n1\nghi");
const tc2 = {
spec: spec2,
env: {
c: "c",
},
};
const result = tracer_config_1.concatTracerConfigs({ javascript: tc1, python: tc2 }, config);
t.deepEqual(result, {
spec: path.join(tmpDir, "compound-spec"),
env: {
a: "a",
b: "b",
c: "c",
},
});
t.true(fs.existsSync(result.spec));
t.deepEqual(fs.readFileSync(result.spec, "utf8"), `${path.join(tmpDir, "compound-build-tracer.log")}\n3\nabc\ndef\nghi`);
});
});
ava_1.default("concatTracerConfigs - conflicting env vars", async (t) => {
await util.withTmpDir(async (tmpDir) => {
const config = getTestConfig(tmpDir);
const spec = path.join(tmpDir, "spec");
fs.writeFileSync(spec, "foo.log\n0");
// Ok if env vars have the same name and the same value
t.deepEqual(tracer_config_1.concatTracerConfigs({
javascript: { spec, env: { a: "a", b: "b" } },
python: { spec, env: { b: "b", c: "c" } },
}, config).env, {
a: "a",
b: "b",
c: "c",
});
// Throws if env vars have same name but different values
const e = t.throws(() => tracer_config_1.concatTracerConfigs({
javascript: { spec, env: { a: "a", b: "b" } },
python: { spec, env: { b: "c" } },
}, config));
t.deepEqual(e.message, "Incompatible values in environment parameter b: b and c");
});
});
ava_1.default("concatTracerConfigs - cpp spec lines come last if present", async (t) => {
await util.withTmpDir(async (tmpDir) => {
const config = getTestConfig(tmpDir);
const spec1 = path.join(tmpDir, "spec1");
fs.writeFileSync(spec1, "foo.log\n2\nabc\ndef");
const tc1 = {
spec: spec1,
env: {
a: "a",
b: "b",
},
};
const spec2 = path.join(tmpDir, "spec2");
fs.writeFileSync(spec2, "foo.log\n1\nghi");
const tc2 = {
spec: spec2,
env: {
c: "c",
},
};
const result = tracer_config_1.concatTracerConfigs({ cpp: tc1, python: tc2 }, config);
t.deepEqual(result, {
spec: path.join(tmpDir, "compound-spec"),
env: {
a: "a",
b: "b",
c: "c",
},
});
t.true(fs.existsSync(result.spec));
t.deepEqual(fs.readFileSync(result.spec, "utf8"), `${path.join(tmpDir, "compound-build-tracer.log")}\n3\nghi\nabc\ndef`);
});
});
ava_1.default("concatTracerConfigs - SEMMLE_COPY_EXECUTABLES_ROOT is updated to point to compound spec", async (t) => {
await util.withTmpDir(async (tmpDir) => {
const config = getTestConfig(tmpDir);
const spec = path.join(tmpDir, "spec");
fs.writeFileSync(spec, "foo.log\n0");
const result = tracer_config_1.concatTracerConfigs({
javascript: { spec, env: { a: "a", b: "b" } },
python: { spec, env: { SEMMLE_COPY_EXECUTABLES_ROOT: "foo" } },
}, config);
t.deepEqual(result.env, {
a: "a",
b: "b",
SEMMLE_COPY_EXECUTABLES_ROOT: path.join(tmpDir, "compound-temp"),
});
});
});
ava_1.default("concatTracerConfigs - compound environment file is created correctly", async (t) => {
await util.withTmpDir(async (tmpDir) => {
const config = getTestConfig(tmpDir);
const spec1 = path.join(tmpDir, "spec1");
fs.writeFileSync(spec1, "foo.log\n2\nabc\ndef");
const tc1 = {
spec: spec1,
env: {
a: "a",
},
};
const spec2 = path.join(tmpDir, "spec2");
fs.writeFileSync(spec2, "foo.log\n1\nghi");
const tc2 = {
spec: spec2,
env: {
foo: "bar_baz",
},
};
const result = tracer_config_1.concatTracerConfigs({ javascript: tc1, python: tc2 }, config, true);
// Check binary contents for the Unix file
const envPath = `${result.spec}.environment`;
t.true(fs.existsSync(envPath));
const buffer = fs.readFileSync(envPath);
t.deepEqual(buffer.length, 28);
t.deepEqual(buffer.readInt32LE(0), 2); // number of env vars
t.deepEqual(buffer.readInt32LE(4), 4); // length of env var definition
t.deepEqual(buffer.toString("utf8", 8, 12), "a=a\0"); // [key]=[value]\0
t.deepEqual(buffer.readInt32LE(12), 12); // length of env var definition
t.deepEqual(buffer.toString("utf8", 16, 28), "foo=bar_baz\0"); // [key]=[value]\0
// Check binary contents for the Windows file
const envPathWindows = `${result.spec}.win32env`;
t.true(fs.existsSync(envPathWindows));
const bufferWindows = fs.readFileSync(envPathWindows);
t.deepEqual(bufferWindows.length, 38);
t.deepEqual(bufferWindows.readInt32LE(0), 4 + 12 + 1); // number of tchars to represent the environment
t.deepEqual(bufferWindows.toString("utf16le", 4, 12), "a=a\0"); // [key]=[value]\0
t.deepEqual(bufferWindows.toString("utf16le", 12, 36), "foo=bar_baz\0"); // [key]=[value]\0
t.deepEqual(bufferWindows.toString("utf16le", 36, 38), "\0"); // trailing null character
});
});
ava_1.default("getCombinedTracerConfig - return undefined when no languages are traced languages", async (t) => {
await util.withTmpDir(async (tmpDir) => {
const config = getTestConfig(tmpDir);
// No traced languages
config.languages = [languages_1.Language.javascript, languages_1.Language.python];
const codeQL = codeql_1.setCodeQL({
async getTracerEnv() {
return {
ODASA_TRACER_CONFIGURATION: "abc",
CODEQL_DIST: "/",
foo: "bar",
};
},
});
t.deepEqual(await tracer_config_1.getCombinedTracerConfig(config, codeQL), undefined);
});
});
ava_1.default("getCombinedTracerConfig - valid spec file", async (t) => {
await util.withTmpDir(async (tmpDir) => {
const config = getTestConfig(tmpDir);
const spec = path.join(tmpDir, "spec");
fs.writeFileSync(spec, "foo.log\n2\nabc\ndef");
const bundlePath = path.join(tmpDir, "bundle");
const codeqlPlatform = process.platform === "win32"
? "win64"
: process.platform === "darwin"
? "osx64"
: "linux64";
const codeQL = codeql_1.setCodeQL({
async getTracerEnv() {
return {
ODASA_TRACER_CONFIGURATION: spec,
CODEQL_DIST: bundlePath,
CODEQL_PLATFORM: codeqlPlatform,
foo: "bar",
};
},
});
const result = await tracer_config_1.getCombinedTracerConfig(config, codeQL);
t.notDeepEqual(result, undefined);
const expectedEnv = {
foo: "bar",
CODEQL_DIST: bundlePath,
CODEQL_PLATFORM: codeqlPlatform,
ODASA_TRACER_CONFIGURATION: result.spec,
};
if (process.platform === "darwin") {
expectedEnv["DYLD_INSERT_LIBRARIES"] = path.join(path.dirname(codeQL.getPath()), "tools", "osx64", "libtrace.dylib");
}
else if (process.platform !== "win32") {
expectedEnv["LD_PRELOAD"] = path.join(path.dirname(codeQL.getPath()), "tools", "linux64", "${LIB}trace.so");
}
if (process.platform === "win32") {
expectedEnv["CODEQL_RUNNER"] = path.join(bundlePath, "tools/win64/runner.exe");
}
else if (process.platform === "darwin") {
expectedEnv["CODEQL_RUNNER"] = path.join(bundlePath, "tools/osx64/runner");
}
else {
expectedEnv["CODEQL_RUNNER"] = path.join(bundlePath, "tools/linux64/runner");
}
t.deepEqual(result, {
spec: path.join(tmpDir, "compound-spec"),
env: expectedEnv,
});
});
});
//# sourceMappingURL=tracer-config.test.js.map | 42.06129 | 129 | 0.560933 |
15d633ab1d86cf8214d05efff2c91900769c4e83 | 200 | js | JavaScript | utils/cacheResponse.js | carlosvldz/movies-api | 74ceba6f199a7d5c756506d06840d2071680f042 | [
"MIT"
] | 1 | 2020-06-26T15:14:56.000Z | 2020-06-26T15:14:56.000Z | utils/cacheResponse.js | carlosvldz/movies-api | 74ceba6f199a7d5c756506d06840d2071680f042 | [
"MIT"
] | 12 | 2020-06-06T20:57:36.000Z | 2020-06-07T06:16:17.000Z | utils/cacheResponse.js | MauricioCarmona/ePOS_API | 6817a1c2ef7ac21e225bd9b6972323316f6a7463 | [
"MIT"
] | 1 | 2020-06-18T00:11:50.000Z | 2020-06-18T00:11:50.000Z | const { config } = require('../config');
function cacheResponse(res, seconds) {
if (!config.dev) {
res.set('Cache-Control', `public, max-age=${seconds}`);
}
}
module.exports = cacheResponse; | 22.222222 | 59 | 0.645 |
15d65a2e609520398cd8cb9ea9cd7914d166ebe5 | 5,690 | js | JavaScript | next/js/site.js | Piagno/osm-ch-website | 7f60a78fe30823b8e9400427a0bbaa75c9091686 | [
"BSD-3-Clause"
] | null | null | null | next/js/site.js | Piagno/osm-ch-website | 7f60a78fe30823b8e9400427a0bbaa75c9091686 | [
"BSD-3-Clause"
] | null | null | null | next/js/site.js | Piagno/osm-ch-website | 7f60a78fe30823b8e9400427a0bbaa75c9091686 | [
"BSD-3-Clause"
] | null | null | null | var map;
var maphash = null;
geosearch = new L.Control.GeoSearch({
provider: new L.GeoSearch.Provider.OpenStreetMap({countrycodes: 'ch'}),
searchLabel: 'Adresse eingeben',
notFoundMessage: 'Es wurden keine Ergebnisse gefunden'
});
L.SOSM = {};
L.SOSM.layers = L.Control.Layers.extend({
onAdd : function (map) {
for (var i in map.baseLayers){
this._addLayer(map.baseLayers[i], map.baseLayers[i].options.name);
}
return L.Control.Layers.prototype.onAdd.call(this, map);
}
});
L.SOSM.Map = L.Map.extend({
initialize: function(id, options) {
L.Map.prototype.initialize.call(this, id, options);
this.baseLayers = [
new L.TileLayer(
document.location.protocol === 'https:' ?
'https://tile.osm.ch/switzerland/{z}/{x}/{y}.png' :
'http://tile.osm.ch/switzerland/{z}/{x}/{y}.png',
{
maxZoom: 21,
attribution: '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
code: "M",
keyid: "mapnik",
name: "standard"
}),
new L.TileLayer(
document.location.protocol === 'https:' ?
'https://tile.osm.ch/osm-swiss-style/{z}/{x}/{y}.png' :
'http://tile.osm.ch/osm-swiss-style/{z}/{x}/{y}.png',
{
maxZoom: 21,
attribution: 'data © <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors, ' +
'map <a href="https://creativecommons.org/licenses/by/4.0/">cc-by</a> ' +
'<a href="https://github.com/xyztobixyz/OSM-Swiss-Style">xyztobixyz</a>',
code: "S",
keyid: "swiss-style",
name: "swiss style"
}),
];
},
updateLayers: function(layerParam) {
layerParam = layerParam || "M";
var layersAdded = "";
for (var i = this.baseLayers.length - 1; i >= 0; i--) {
if (layerParam.indexOf(this.baseLayers[i].options.code) >= 0) {
this.addLayer(this.baseLayers[i]);
layersAdded = layersAdded + this.baseLayers[i].options.code;
} else if (i == 0 && layersAdded == "") {
this.addLayer(this.baseLayers[i]);
} else {
this.removeLayer(this.baseLayers[i]);
}
}
},
getLayersCode: function () {
var layerConfig = '';
for (var i in this._layers) { // TODO: map.eachLayer
var layer = this._layers[i];
if (layer.options && layer.options.code) {
layerConfig += layer.options.code;
}
}
return layerConfig;
},
});
L.Control.OSMReportAProblem = L.Control.Attribution.extend({
options: {
position: 'bottomright',
prefix: '<a href="http://www.openstreetmap.org/fixthemap?lat={x}&lon={y}&zoom={z}">Behebe einen Fehler</a>'
},
_layerAdd: function(e)
{
if (e.layer.getAttribution) {
this.addAttribution(e.layer.getAttribution());
}
},
_layerRemove: function(e)
{
if (e.layer.getAttribution) {
this.removeAttribution(e.layer.getAttribution());
}
},
onAdd: function (map) {
this._container = L.DomUtil.create('div', 'leaflet-control-attribution');
L.DomEvent.disableClickPropagation(this._container);
// TODO ugly, refactor
for (var i in map._layers) {
if (map._layers[i].getAttribution) {
this.addAttribution(map._layers[i].getAttribution());
}
}
this._update();
map.on('moveend', this._update, this);
map.on('layeradd', this._layerAdd, this);
map.on('layerremove', this._layerRemove, this);
return this._container;
},
_update: function () {
if (!this._map) { return; }
var attribs = [];
for (var i in this._attributions) {
if (this._attributions[i]) {
attribs.push(i);
}
}
var prefixAndAttribs = [];
if (this.options.prefix) {
prefixAndAttribs.push(this.options.prefix);
}
if (attribs.length) {
prefixAndAttribs.push(attribs.join(', '));
}
this._container.innerHTML = prefixAndAttribs.join(' | ').replace('{x}', this._map.getCenter().lat).replace('{y}', this._map.getCenter().lng).replace('{z}', this._map.getZoom());
}
});
$(document).ready(function() {
$('#more-map-selector').html('<a href="#" class="rotate">Mehr Karte</a>');
$('#map').text('');
map = new L.SOSM.Map('map', {attributionControl: false}).setView([47, 8.5], 10);
(new L.SOSM.layers()).addTo(map);
map.updateLayers('');
(new L.Control.OSMReportAProblem({})).addTo(map);
$('.view-selector').click(function() {
$("body").toggleClass('map-only');
if ($("body").hasClass('map-only')) {
if (maphash)
maphash.startListening();
else
maphash = new L.Hash(map);
geosearch.addTo(map);
} else {
maphash.stopListening();
geosearch.removeFrom(map);
}
map.invalidateSize();
});
if (/#[0-9]+\//.test(location.hash)) {
$("body").addClass('map-only');
map.invalidateSize();
maphash = new L.Hash(map);
}
geosearch.addTo(map);
});
| 32.890173 | 193 | 0.517575 |
15d669b4e1dc42fec314ac49e2ec552066ef1bd8 | 1,255 | js | JavaScript | src/Umbraco.Web.UI/umbraco_client/tinymce3/plugins/umbracoshortcut/editor_plugin_src.js | robbaman/Umbraco-CMS | c2816e759b4fcdffa96f314faf920cbcb0d0dded | [
"MIT"
] | 90 | 2015-01-12T18:37:03.000Z | 2021-07-29T13:20:54.000Z | src/Umbraco.Web.UI/umbraco_client/tinymce3/plugins/umbracoshortcut/editor_plugin_src.js | robbaman/Umbraco-CMS | c2816e759b4fcdffa96f314faf920cbcb0d0dded | [
"MIT"
] | 94 | 2021-04-06T08:50:57.000Z | 2022-03-04T02:06:28.000Z | src/Umbraco.Web.UI/umbraco_client/tinymce3/plugins/umbracoshortcut/editor_plugin_src.js | robbaman/Umbraco-CMS | c2816e759b4fcdffa96f314faf920cbcb0d0dded | [
"MIT"
] | 35 | 2015-01-25T13:59:50.000Z | 2021-05-07T08:40:44.000Z |
(function () {
tinymce.create('tinymce.plugins.Umbracoshortcut', {
init: function (ed, url) {
var t = this;
var ctrlPressed = false;
t.editor = ed;
ed.onKeyDown.add(function (ed, e) {
if (e.keyCode == 17)
ctrlPressed = true;
if (ctrlPressed && e.keyCode == 83) {
jQuery(document).trigger("UMBRACO_TINYMCE_SAVE", e);
ctrlPressed = false;
tinymce.dom.Event.cancel(e);
return false;
}
});
ed.onKeyUp.add(function (ed, e) {
if (e.keyCode == 17)
ctrlPressed = false;
});
},
getInfo: function () {
return {
longname: 'Umbraco Save short cut key',
author: 'Umbraco HQ',
authorurl: 'http://umbraco.com',
infourl: 'http://our.umbraco.org',
version: "1.0"
};
}
// Private methods
});
// Register plugin
tinymce.PluginManager.add('umbracoshortcut', tinymce.plugins.Umbracoshortcut);
})(); | 29.186047 | 83 | 0.427888 |
15d67d3d6c76c437d622beb6bb433b014181017d | 1,083 | js | JavaScript | src/components/ionSideMenuContainer.js | RafalSladek/reactionic | 0993f2bf43534d05e902462ab3fc630fc866f61c | [
"Apache-2.0"
] | 570 | 2016-04-24T13:03:03.000Z | 2018-04-15T02:35:51.000Z | src/components/ionSideMenuContainer.js | RafalSladek/reactionic | 0993f2bf43534d05e902462ab3fc630fc866f61c | [
"Apache-2.0"
] | 54 | 2016-04-23T08:47:39.000Z | 2017-08-10T06:33:00.000Z | src/components/ionSideMenuContainer.js | RafalSladek/reactionic | 0993f2bf43534d05e902462ab3fc630fc866f61c | [
"Apache-2.0"
] | 80 | 2016-04-25T00:43:02.000Z | 2018-05-03T09:26:09.000Z | import React from 'react';
import Snap from 'snapjs';
var IonSideMenuContainer = React.createClass({
contextTypes: {
ionSetSnapper: React.PropTypes.func
},
propTypes: {
settings: React.PropTypes.object,
},
getDefaultProps: function() {
return {
settings: {},
};
},
componentDidMount: function() {
var sideMenuContent = document.getElementById('IonSideMenuContent');
let snapper = new Snap({
element: sideMenuContent,
...this.props.settings,
});
if (typeof snapper.toggle === 'undefined') {
// add a toggle method if it doesn't exist yet (in some future version)
snapper.toggle = function(direction) {
if( this.state().state==direction ){
this.close();
} else {
this.open(direction);
}
};
}
this.context.ionSetSnapper(snapper);
},
componentWillUnmount: function() {
this.context.ionSetSnapper(null);
},
render() {
return (
<div>
{ this.props.children }
</div>
);
}
});
export default IonSideMenuContainer;
| 23.042553 | 77 | 0.607572 |
15d74318feb6b1e5da9d697f5bd6cd9d39a27e1c | 933 | js | JavaScript | node_modules/@react-icons/all-files/ri/RiVimeoFill.esm.js | syazwanirahimin/dotcom | 162acf4500655ec965d27bd1e45ef0415963d346 | [
"MIT"
] | null | null | null | node_modules/@react-icons/all-files/ri/RiVimeoFill.esm.js | syazwanirahimin/dotcom | 162acf4500655ec965d27bd1e45ef0415963d346 | [
"MIT"
] | null | null | null | node_modules/@react-icons/all-files/ri/RiVimeoFill.esm.js | syazwanirahimin/dotcom | 162acf4500655ec965d27bd1e45ef0415963d346 | [
"MIT"
] | null | null | null | // THIS FILE IS AUTO GENERATED
import { GenIcon } from '../lib';
export function RiVimeoFill (props) {
return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24"},"child":[{"tag":"g","attr":{},"child":[{"tag":"path","attr":{"fill":"none","d":"M0 0H24V24H0z"}},{"tag":"path","attr":{"d":"M1.173 8.301c-.281-.413-.252-.413.328-.922 1.232-1.082 2.394-2.266 3.736-3.212 1.215-.852 2.826-1.402 3.927-.047 1.014 1.249 1.038 3.142 1.295 4.65.257 1.564.503 3.164 1.051 4.66.152.421.443 1.217.968 1.284.678.093 1.368-1.096 1.683-1.54.817-1.18 1.925-2.769 1.785-4.286-.138-1.612-1.878-1.309-2.966-.924.175-1.809 1.858-3.843 3.48-4.53 1.72-.714 4.276-.702 5.14 1.237.923 2.102.093 4.543-.912 6.448-1.097 2.068-2.509 3.982-4.018 5.77-1.331 1.588-2.906 3.33-4.89 4.089-2.267.864-3.61-.82-4.382-2.77-.843-2.123-1.262-4.506-1.87-6.717-.256-.934-.56-1.997-1.167-2.768-.792-.995-1.692-.06-2.474.477-.269-.267-.491-.607-.714-.899z"}}]}]})(props);
};
| 155.5 | 826 | 0.62701 |
15d80dfa2aa64dfa20eef12296e355fbeadf2292 | 563 | js | JavaScript | Jint.Tests.Test262/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-3.js | marius-klimantavicius/jint | f180d16e7c38fa13b3d01b69ff9a48e7f388987e | [
"BSD-2-Clause"
] | 2,602 | 2015-01-02T10:45:13.000Z | 2022-03-30T23:04:17.000Z | Jint.Tests.Test262/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-3.js | marius-klimantavicius/jint | f180d16e7c38fa13b3d01b69ff9a48e7f388987e | [
"BSD-2-Clause"
] | 727 | 2015-01-02T13:58:22.000Z | 2022-03-31T16:33:29.000Z | Jint.Tests.Test262/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-3.js | marius-klimantavicius/jint | f180d16e7c38fa13b3d01b69ff9a48e7f388987e | [
"BSD-2-Clause"
] | 527 | 2015-01-08T16:04:26.000Z | 2022-03-24T03:34:47.000Z | // Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.reduce
es5id: 15.4.4.21-8-c-3
description: >
Array.prototype.reduce throws TypeError when elements assigned
values are deleted and initialValue is not present
---*/
function callbackfn(prevVal, curVal, idx, obj)
{}
var arr = [1, 2, 3, 4, 5];
delete arr[0];
delete arr[1];
delete arr[2];
delete arr[3];
delete arr[4];
assert.throws(TypeError, function() {
arr.reduce(callbackfn);
});
| 23.458333 | 70 | 0.706927 |
15d86185da8a8b5b447aa6208442b05c08756fb0 | 689 | js | JavaScript | client/actions/index.js | RagazziMoscow/react-redux-todo-app | 7121760b9f0f45b95bc0d8fb34d28208d6fb3e32 | [
"MIT"
] | null | null | null | client/actions/index.js | RagazziMoscow/react-redux-todo-app | 7121760b9f0f45b95bc0d8fb34d28208d6fb3e32 | [
"MIT"
] | null | null | null | client/actions/index.js | RagazziMoscow/react-redux-todo-app | 7121760b9f0f45b95bc0d8fb34d28208d6fb3e32 | [
"MIT"
] | null | null | null | import { TOGGLE_TODO_STATUS, ADD_TODO, CHANGE_FILTER, FETCH_TODOS } from '../constants';
export function toggleTodo(index) {
return {
type: TOGGLE_TODO_STATUS,
id: index
};
}
export function addTodo(todo) {
return {
type: ADD_TODO,
todo
};
}
export function changeFilter(filter) {
return {
type: CHANGE_FILTER,
filter
};
}
export function fetchTodos() {
return async (dispatch) => {
const res = await fetch('/todos', {
method: 'post'
});
const data = await res.json();
dispatch({
type: FETCH_TODOS,
payload: data
});
};
} | 19.138889 | 88 | 0.539913 |
15d8aef2741115d916e09741c18389a8322b0eab | 434 | js | JavaScript | packages/input/test/lion-input-integrations.test.js | fpc97/lion | 07c598fd68b983846f95284c24375b7efe25528d | [
"MIT"
] | 1 | 2020-07-18T17:14:37.000Z | 2020-07-18T17:14:37.000Z | packages/input/test/lion-input-integrations.test.js | fpc97/lion | 07c598fd68b983846f95284c24375b7efe25528d | [
"MIT"
] | null | null | null | packages/input/test/lion-input-integrations.test.js | fpc97/lion | 07c598fd68b983846f95284c24375b7efe25528d | [
"MIT"
] | null | null | null | import { runInteractionStateMixinSuite } from '@lion/form-core/test-suites/InteractionStateMixin.suite.js';
import { runFormatMixinSuite } from '@lion/form-core/test-suites/FormatMixin.suite.js';
import '../lion-input.js';
const tagString = 'lion-input';
describe('<lion-input> integrations', () => {
runInteractionStateMixinSuite({
tagString,
suffix: 'lion-input',
});
runFormatMixinSuite({
tagString,
});
});
| 25.529412 | 107 | 0.709677 |
15d921950fe34ef88de9806c9eaa69e008904c6e | 1,522 | js | JavaScript | test/asserts/null-or-date-assert.test.js | uphold/validator.js-asserts | dc4e8dee5217513cdc413f24210d857447533a8c | [
"MIT"
] | 1 | 2020-03-14T11:20:26.000Z | 2020-03-14T11:20:26.000Z | test/asserts/null-or-date-assert.test.js | uphold/validator.js-asserts | dc4e8dee5217513cdc413f24210d857447533a8c | [
"MIT"
] | 33 | 2017-11-17T15:10:19.000Z | 2022-03-08T23:01:17.000Z | test/asserts/null-or-date-assert.test.js | uphold/validator.js-asserts | dc4e8dee5217513cdc413f24210d857447533a8c | [
"MIT"
] | 2 | 2018-12-03T09:41:19.000Z | 2018-12-03T10:34:28.000Z | 'use strict';
/**
* Module dependencies.
*/
const { Assert: BaseAssert, Violation } = require('validator.js');
const NullOrDateAssert = require('../../src/asserts/null-or-date-assert');
/**
* Extend `Assert` with `NullOrDateAssert`.
*/
const Assert = BaseAssert.extend({
NullOrDate: NullOrDateAssert
});
/**
* Test `NullOrDateAssert`.
*/
describe('NullOrDateAssert', () => {
it('should throw an error if the input value is not a `null` or a date', () => {
const choices = [[], {}, 123];
choices.forEach(choice => {
try {
Assert.nullOrDate().validate(choice);
fail();
} catch (e) {
expect(e).toBeInstanceOf(Violation);
expect(e.violation.value).toBe('must_be_null_or_a_date');
}
});
});
it('should throw an error if the input value is not a valid date', () => {
try {
Assert.nullOrDate().validate('2015-99-01');
fail();
} catch (e) {
expect(e).toBeInstanceOf(Violation);
expect(e.show().value).toBe('2015-99-01');
}
});
it('should expose `assert` equal to `NullOrDate`', () => {
try {
Assert.nullOrDate().validate({});
fail();
} catch (e) {
expect(e.show().assert).toBe('NullOrDate');
}
});
it('should accept `null`', () => {
Assert.nullOrDate().validate(null);
});
it('should accept a date', () => {
Assert.nullOrDate().validate(new Date());
});
it('should accept a string', () => {
Assert.nullOrDate().validate('2014-10-16');
});
});
| 21.43662 | 82 | 0.57293 |
15dabc82c1aeba466d94accc49b2854251f204fb | 2,216 | js | JavaScript | docs/legato/html/structGFXC__CANVAS.js | automaate/gfx3.8 | 55bf94302f00c8d513c84d910185cef2ca6b5be2 | [
"0BSD"
] | null | null | null | docs/legato/html/structGFXC__CANVAS.js | automaate/gfx3.8 | 55bf94302f00c8d513c84d910185cef2ca6b5be2 | [
"0BSD"
] | null | null | null | docs/legato/html/structGFXC__CANVAS.js | automaate/gfx3.8 | 55bf94302f00c8d513c84d910185cef2ca6b5be2 | [
"0BSD"
] | null | null | null | var structGFXC__CANVAS =
[
[ "active", "structGFXC__CANVAS.html#a97bbfe61bbcec3b53ed5e47d2f6c21da", null ],
[ "alpha", "structGFXC__CANVAS.html#acf5bb76caa419c0fa231dbd66c881084", null ],
[ "cb", "structGFXC__CANVAS.html#aa7384755e8732ebfb864589888706eaf", null ],
[ "delta", "structGFXC__CANVAS.html#ab90adf2873f721fb4a969230dbcd7a59", null ],
[ "delta", "structGFXC__CANVAS.html#a9f9c7720172218e6ef14f6c39a5c469f", null ],
[ "effects", "structGFXC__CANVAS.html#aaed2baafcaf2bd8aabdef30ea94ce835", null ],
[ "endAlpha", "structGFXC__CANVAS.html#a76de0319ced45a2dc0e6a7ab1847571a", null ],
[ "endX", "structGFXC__CANVAS.html#a366c61e3265c5164778b9b813469e745", null ],
[ "endY", "structGFXC__CANVAS.html#a925629c08f94d2b63a869dbdaeb7057c", null ],
[ "fade", "structGFXC__CANVAS.html#a30bf79529ec8530b21b1602a56578ba6", null ],
[ "height", "structGFXC__CANVAS.html#ad12fc34ce789bce6c8a05d8a17138534", null ],
[ "id", "structGFXC__CANVAS.html#a7441ef0865bcb3db9b8064dd7375c1ea", null ],
[ "layer", "structGFXC__CANVAS.html#a0615c3f6f39808a7183586185d6c950f", null ],
[ "move", "structGFXC__CANVAS.html#ac5710716bd57c0a95660d9b482146277", null ],
[ "parm", "structGFXC__CANVAS.html#a14c65b9f2783c6f6dafdaaa372329e4d", null ],
[ "pixelBuffer", "structGFXC__CANVAS.html#a478050c77d8bb6b405daf9c206eaf904", null ],
[ "pos", "structGFXC__CANVAS.html#a64dceb975e100a6785f15af0782b790d", null ],
[ "size", "structGFXC__CANVAS.html#af2287890e7a6603adf601e2afbb9e4fd", null ],
[ "startAlpha", "structGFXC__CANVAS.html#ac5b89b23df09fa549a7e349f285f04e5", null ],
[ "startX", "structGFXC__CANVAS.html#a85da7669cabd63b0459f1335886dbf2e", null ],
[ "startY", "structGFXC__CANVAS.html#a7fd8d76428f3da6360d3219bb2b9673a", null ],
[ "status", "structGFXC__CANVAS.html#a3e35e09b2f6bd91c4a95b8faee6250a1", null ],
[ "type", "structGFXC__CANVAS.html#a7d356fe1f8d080608f38a5446036cfb0", null ],
[ "width", "structGFXC__CANVAS.html#a2474a5474cbff19523a51eb1de01cda4", null ],
[ "xpos", "structGFXC__CANVAS.html#a4c8fb3f1c1ae597ee856290390ebc274", null ],
[ "ypos", "structGFXC__CANVAS.html#a4db09a4236b6f591c377857b932eb41a", null ]
]; | 76.413793 | 89 | 0.762184 |
15db80d7219898b286ae1e960caaa52b959aae5c | 374 | js | JavaScript | src/pages/details/article-menu/main.js | SmallRuralDog/cloud-doc-v2 | 554236a8e9712fca76527e71b264b2ffa9e366db | [
"Apache-2.0"
] | 32 | 2018-03-29T02:02:24.000Z | 2021-02-12T16:35:37.000Z | src/pages/details/article-menu/main.js | SmallRuralDog/cloud-doc-v2 | 554236a8e9712fca76527e71b264b2ffa9e366db | [
"Apache-2.0"
] | 1 | 2020-03-06T08:45:20.000Z | 2020-03-06T08:45:20.000Z | src/pages/details/article-menu/main.js | SmallRuralDog/cloud-doc-v2 | 554236a8e9712fca76527e71b264b2ffa9e366db | [
"Apache-2.0"
] | 13 | 2018-04-24T07:16:32.000Z | 2019-02-22T07:11:13.000Z | import Vue from 'vue'
import App from './article-menu'
const app = new Vue(App);
app.$mount();
export default {
config: {
navigationBarTitleText: '',
backgroundColorTop: "#fff",
backgroundColorBottom: "#fff",
navigationBarBackgroundColor: "#fff",
navigationBarTextStyle: "black",
enablePullDownRefresh: true,
backgroundTextStyle: "dark"
}
}
| 22 | 41 | 0.687166 |
15dbc30acf9adc0e5a47e5101574d7505dc76933 | 911 | js | JavaScript | public/modules/restaurantimage/js/init-dropzone.js | n3ISe/cheekyCMS | 7fcc7f6e3cf6388fe6ba2dea48f13595b63de8a6 | [
"RSA-MD"
] | null | null | null | public/modules/restaurantimage/js/init-dropzone.js | n3ISe/cheekyCMS | 7fcc7f6e3cf6388fe6ba2dea48f13595b63de8a6 | [
"RSA-MD"
] | null | null | null | public/modules/restaurantimage/js/init-dropzone.js | n3ISe/cheekyCMS | 7fcc7f6e3cf6388fe6ba2dea48f13595b63de8a6 | [
"RSA-MD"
] | null | null | null | $( document ).ready(function() {
Dropzone.autoDiscover = false;alert(Asgard.dropzonePostUrl);
var myDropzone = new Dropzone(".dropzone", {
url: Asgard.dropzonePostUrl,
autoProcessQueue: true,
maxFilesize: maxFilesize,
acceptedFiles : acceptedFiles
});
myDropzone.on("queuecomplete", function(file, http) {
window.setTimeout(function(){
location.reload();
}, 1000);
});
myDropzone.on("sending", function(file, fromData) {
if ($('.alert-danger').length > 0) {
$('.alert-danger').remove();
}
});
myDropzone.on("error", function(file, errorMessage) {
var html = '<div class="alert alert-danger" role="alert">' + errorMessage + '</div>';
$('.col-md-12').first().prepend(html);
setTimeout(function() {
myDropzone.removeFile(file);
}, 2000);
});
});
| 33.740741 | 93 | 0.570801 |
15dc3ded0ebe778eb6769e6a5c7425566b7fe221 | 1,085 | js | JavaScript | src/actions/RightPaneActions.js | dxiuu/AntAlmanac | 4cd1607843fac88c946fc11d83d80cb8e1af380e | [
"MIT"
] | 25 | 2018-07-17T04:39:01.000Z | 2020-12-03T07:19:29.000Z | src/actions/RightPaneActions.js | dxiuu/AntAlmanac | 4cd1607843fac88c946fc11d83d80cb8e1af380e | [
"MIT"
] | 49 | 2017-12-31T23:00:26.000Z | 2021-02-15T05:31:37.000Z | src/actions/RightPaneActions.js | dxiuu/AntAlmanac | 4cd1607843fac88c946fc11d83d80cb8e1af380e | [
"MIT"
] | 33 | 2018-07-13T19:28:44.000Z | 2019-09-09T03:40:35.000Z | import dispatcher from '../dispatcher';
import AppStore from '../stores/RightPaneStore';
import ReactGA from 'react-ga';
export const updateFormValue = (field, value) => {
const formData = { ...AppStore.getFormData(), [field]: value };
dispatcher.dispatch({
type: 'UPDATE_FORM_FIELD',
formData,
});
};
export const resetFormValues = () => {
dispatcher.dispatch({
type: 'RESET_FORM_FIELDS',
});
};
export const handleTabChange = (event, value) => {
switch (
value // 0 is Class Search Tab, 1 is Added Classes Tab, 2 is Map Tab
) {
case 1:
ReactGA.event({
category: 'antalmanac-rewrite',
action: `Switch tab to Added Classes`,
});
break;
case 2:
ReactGA.event({
category: 'antalmanac-rewrite',
action: `Switch tab to Map`,
});
break;
default:
// do nothing
}
dispatcher.dispatch({
type: 'TAB_CHANGE',
activeTab: value,
});
};
| 24.111111 | 76 | 0.532719 |
15dc9b8901ecc025f81220f25873c262ff51b2b4 | 609 | js | JavaScript | symphony/app/fbcnms-packages/fbcnms-ui/.storybook/main.js | kyaaqba/magma | fdb7be22a2076f9a9b158c9670a9af6cad68b85f | [
"BSD-3-Clause"
] | null | null | null | symphony/app/fbcnms-packages/fbcnms-ui/.storybook/main.js | kyaaqba/magma | fdb7be22a2076f9a9b158c9670a9af6cad68b85f | [
"BSD-3-Clause"
] | 10 | 2021-03-31T20:19:00.000Z | 2022-02-19T07:09:57.000Z | nms/app/fbcnms-packages/fbcnms-ui/.storybook/main.js | 119Vik/magma-1 | 107a7b374466a837fc0a49b283ba9d6ff1d702e3 | [
"BSD-3-Clause"
] | 3 | 2020-08-20T18:45:34.000Z | 2020-08-20T20:18:42.000Z | /**
* Copyright 2004-present Facebook. All Rights Reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
const customWebpackConfigBuilder = require('./webpack.config.js').default;
module.exports = {
stories: ['../**/*.stories.@(js|mdx)'],
addons: [
'@storybook/addon-actions',
'@storybook/addon-links',
{
name: '@storybook/addon-docs',
options: {
sourceLoaderOptions: null,
},
},
],
webpackFinal: config => customWebpackConfigBuilder({config}),
};
| 23.423077 | 74 | 0.64532 |
15dc9b9c9995134687d1cc5ca20544319aaaf71c | 1,111 | js | JavaScript | app/common/containers/blocks/Aside/index.js | EDENLABLLC/annon.web | 0b4338efba8d398308f493dbb6b3b9a9ac9c0919 | [
"MIT"
] | 1 | 2017-09-18T11:47:34.000Z | 2017-09-18T11:47:34.000Z | app/common/containers/blocks/Aside/index.js | edenlabllc/annon.web | 0b4338efba8d398308f493dbb6b3b9a9ac9c0919 | [
"MIT"
] | null | null | null | app/common/containers/blocks/Aside/index.js | edenlabllc/annon.web | 0b4338efba8d398308f493dbb6b3b9a9ac9c0919 | [
"MIT"
] | null | null | null | import React from 'react';
import { Link } from 'react-router';
import { connect } from 'react-redux';
import withStyles from 'nebo15-isomorphic-style-loader/lib/withStyles';
import Icon from 'components/Icon';
import Nav from 'containers/blocks/Nav';
import Gamburger from 'containers/blocks/Gamburger';
import { toggleMenu } from './redux';
import styles from './styles.scss';
@withStyles(styles)
@connect(state => state.blocks.Aside, { toggleMenu })
export default class Aside extends React.Component {
render() {
return (
<aside className={styles.aside}>
{ /* eslint-disable jsx-a11y/anchor-has-content */ }
<Link className={styles.logo} to="/" />
<hr className={styles.line} />
<Link to="/apis/create" className={styles.add}>
<Icon name="add" />
Create API
</Link>
<hr className={styles.line} />
<Nav isOpen={this.props.active} />
<div className={styles['menu-control']}>
<Gamburger isOpen={this.props.active} onToggle={this.props.toggleMenu} />
</div>
</aside>
);
}
}
| 25.837209 | 83 | 0.630963 |
15dcc9fc45bc131eeaa6586814321cd29c19dc4b | 2,550 | js | JavaScript | src/util/checkConfig.js | reactioncommerce/migrator | 6f54612e4354c4d160bdfcaed58385ecb60afa89 | [
"Apache-2.0"
] | 4 | 2020-02-06T11:47:07.000Z | 2021-11-04T16:38:07.000Z | src/util/checkConfig.js | reactioncommerce/migrator | 6f54612e4354c4d160bdfcaed58385ecb60afa89 | [
"Apache-2.0"
] | 18 | 2020-02-07T18:19:54.000Z | 2021-08-24T03:36:24.000Z | src/util/checkConfig.js | reactioncommerce/migrator | 6f54612e4354c4d160bdfcaed58385ecb60afa89 | [
"Apache-2.0"
] | 4 | 2020-02-27T00:09:39.000Z | 2021-11-04T16:37:56.000Z | /**
* @summary Validates the configuration object
* @param {Object} config The configuration object
* @param {Object} [options] Function options
* @param {Function} [options.log] A function that will take a string and log it
* @return {Boolean} True if valid, otherwise false.
*/
function checkConfig({ tracks } = {}, { log = () => {} } = {}) {
if (!tracks) {
log("No migrations provided", "error");
return false;
}
log(`✓ Found ${tracks.length} migration tracks.\n\nValidating tracks...`);
const namespaces = {};
for (const track of tracks) {
const {
desiredVersion,
migrations,
namespace,
orderedVersionList,
package: packageName
} = track || {};
if (typeof namespace !== "string" || namespace.length === 0) {
log("A migration track was provided without a namespace", "error");
return false;
}
if (namespaces[namespace]) {
log(`Two different tracks provided the same namespace value: "${namespace}"`, "error");
return false;
}
namespaces[namespace] = true;
let foundDesiredVersion = desiredVersion === "1-0";
if (!foundDesiredVersion) {
foundDesiredVersion = orderedVersionList.includes(desiredVersion);
if (!foundDesiredVersion) {
const highestMajorVersion = orderedVersionList[orderedVersionList.length - 1];
log(`Configuration asks for version ${desiredVersion} for the ${namespace} track, but that version does not exist in the track migrations.
Highest version found is ${highestMajorVersion}.`, "error");
if (packageName) {
log(`\nPerhaps you need to 'npm install ${packageName}@latest' to get new migrations.`, "error");
}
return false;
}
}
for (const version of Object.getOwnPropertyNames(migrations)) {
// Now grab the migration functions
const migrationFns = migrations[version];
const { down, up } = migrationFns || {};
if (typeof down !== "function" && down !== "unnecessary" && down !== "impossible") {
log(`Track with namespace "${namespace}" provided an invalid "down" migration for version ${version}`, "error");
return false;
}
if (typeof up !== "function") {
log(`Track with namespace "${namespace}" provided an invalid "up" migration for version ${version}`, "error");
return false;
}
}
log(`✓ Configuration for ${namespace} track is valid`);
}
log("✓ Migration configuration is valid");
return true;
}
module.exports = checkConfig;
| 34.459459 | 146 | 0.634902 |
15dcfc28bee77e995d8f0c670229f70f9575c8f0 | 618 | js | JavaScript | examples/async-macro-definition.js | zetapush/zetapush-js | 4088bd443f8d9edc90c15d4ffb36b8a5994b906c | [
"MIT"
] | 6 | 2015-05-21T13:24:16.000Z | 2017-02-08T10:18:55.000Z | examples/async-macro-definition.js | zetapush/zetapush-js | 4088bd443f8d9edc90c15d4ffb36b8a5994b906c | [
"MIT"
] | 16 | 2016-09-08T13:41:16.000Z | 2020-06-17T21:47:51.000Z | examples/async-macro-definition.js | zetapush/zetapush-js | 4088bd443f8d9edc90c15d4ffb36b8a5994b906c | [
"MIT"
] | 4 | 2015-10-27T20:19:32.000Z | 2016-09-08T10:34:01.000Z | class WelcomeMacro extends ZetaPush.services.Macro {
hello({ name }) {
return this.$publish('hello', {
name
})
}
}
// Create new ZetaPush Client
const client = new ZetaPush.WeakClient({
sandboxId: 'bcu1JtRb'
})
// Create async macro service
const service = client.createAsyncMacroService({
Type: WelcomeMacro
})
// Handle connection established
client.onConnectionEstablished(() => {
console.debug('onConnectionEstablished')
service.hello({
message: 'Test'
}).then((result) => {
console.log('macro hello promise', result)
})
})
// Connect client to ZetaPush BaaS
client.connect()
| 22.888889 | 52 | 0.694175 |
15dd3ea371ca6f4cc6b48a33033546df89e966bf | 1,404 | js | JavaScript | Jint.Tests.Test262/test/language/expressions/async-arrow-function/rest-params-trailing-comma-early-error.js | marius-klimantavicius/jint | f180d16e7c38fa13b3d01b69ff9a48e7f388987e | [
"BSD-2-Clause"
] | 2,602 | 2015-01-02T10:45:13.000Z | 2022-03-30T23:04:17.000Z | Jint.Tests.Test262/test/language/expressions/async-arrow-function/rest-params-trailing-comma-early-error.js | marius-klimantavicius/jint | f180d16e7c38fa13b3d01b69ff9a48e7f388987e | [
"BSD-2-Clause"
] | 727 | 2015-01-02T13:58:22.000Z | 2022-03-31T16:33:29.000Z | Jint.Tests.Test262/test/language/expressions/async-arrow-function/rest-params-trailing-comma-early-error.js | marius-klimantavicius/jint | f180d16e7c38fa13b3d01b69ff9a48e7f388987e | [
"BSD-2-Clause"
] | 527 | 2015-01-08T16:04:26.000Z | 2022-03-24T03:34:47.000Z | // This file was procedurally generated from the following sources:
// - src/function-forms/rest-params-trailing-comma-early-error.case
// - src/function-forms/syntax/async-arrow-function.template
/*---
description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (async arrow function expression)
esid: sec-async-arrow-function-definitions
flags: [generated]
negative:
phase: parse
type: SyntaxError
info: |
14.7 Async Arrow Function Definitions
AsyncArrowFunction :
...
CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
AsyncConciseBody :
{ AsyncFunctionBody }
...
Supplemental Syntax
When processing an instance of the production AsyncArrowFunction :
CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody the interpretation of
CoverCallExpressionAndAsyncArrowHead is refined using the following grammar:
AsyncArrowHead :
async ArrowFormalParameters
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] :
[empty]
FunctionRestParameter[?Yield, ?Await]
FormalParameterList[?Yield, ?Await]
FormalParameterList[?Yield, ?Await] ,
FormalParameterList[?Yield, ?Await] , FunctionRestParameter[?Yield, ?Await]
---*/
throw "Test262: This statement should not be evaluated.";
(async (...a,) => {
});
| 28.653061 | 125 | 0.72792 |
15ddecb960e99573052f572369b2d31f87b2e381 | 528 | js | JavaScript | FrontEnd/src/main.js | huangmingg/Hack4Good | 7f93559923bb51a787689064ee5a59a5447e3785 | [
"MIT"
] | null | null | null | FrontEnd/src/main.js | huangmingg/Hack4Good | 7f93559923bb51a787689064ee5a59a5447e3785 | [
"MIT"
] | 3 | 2021-03-10T10:33:47.000Z | 2021-10-06T13:14:24.000Z | FrontEnd/src/main.js | huangmingg/Hack4Good | 7f93559923bb51a787689064ee5a59a5447e3785 | [
"MIT"
] | null | null | null | import Vue from 'vue'
import App from './App.vue'
import vuetify from './plugins/vuetify';
import VueResource from 'vue-resource'
import VueRouter from 'vue-router';
import Routes from './routes.js';
import VueGoogleCharts from 'vue-google-charts';
Vue.use(VueGoogleCharts)
Vue.use(VueRouter);
Vue.use(VueResource);
Vue.use(vuetify)
Vue.config.productionTip = false
const myRouter = new VueRouter({
routes: Routes,
mode: 'history'
});
new Vue({
vuetify,
render: h => h(App),
router: myRouter,
}).$mount('#app')
| 18.206897 | 48 | 0.714015 |
15de12e4de3ac4b964c19d1dbc747ddb4b7ae516 | 12,412 | js | JavaScript | src/index.js | jac1226/TableProxy | a84511c6b37e9a77378133a3bb57c732ce75639c | [
"MIT"
] | null | null | null | src/index.js | jac1226/TableProxy | a84511c6b37e9a77378133a3bb57c732ce75639c | [
"MIT"
] | null | null | null | src/index.js | jac1226/TableProxy | a84511c6b37e9a77378133a3bb57c732ce75639c | [
"MIT"
] | null | null | null | /**
* Main
*/
import { expSpreadsheetApp as SpreadsheetApp } from './simulation-utils';
import InstanceOptions from './instance-options';
import SheetAccessor from './sheet-accessor';
import MainCursor from './main-cursor';
import { Map, UniqueSet } from './map-unique';
import {
getUnique,
runQuery,
runObjUpdate,
getExportObject,
insertRow,
deleteRow
} from './operations';
import { objAssign, strContains, isArray } from './utilities';
import Timer from './timer';
import { Utils } from './sheets-utilities';
import { IS_TEST_MODE, C, DEFAULT_ATTRIBUTE } from './CONSTANTS';
import { AttributesSet } from './data-payload';
if (IS_TEST_MODE) {
global.SpreadsheetApp = SpreadsheetApp;
}
const TableProxy = () => {
function mount(sheetNameOrOptions, headerAnchorToken) {
try {
const instanceOptions = new InstanceOptions(sheetNameOrOptions, headerAnchorToken);
const sheetAccessor = new SheetAccessor(instanceOptions);
const mainCursor = new MainCursor(sheetAccessor);
const lastResults = new Map();
const core = {
instanceOptions,
sheetAccessor,
mainCursor
};
if (!instanceOptions.uniqueIdColumnName) {
instanceOptions.idColumnName = sheetAccessor.getDefaultIdColumn();
}
const api = {};
Object.defineProperty(api, 'select', {
enumerable: true,
value: (query, withRecords) => {
const timer = new Timer(`API select`);
const queryReturn = runQuery(core, query, true, withRecords);
mainCursor.consumeReturn(queryReturn);
lastResults
.clear()
.set('operation', 'select')
.set('completed', true)
.set('selected count', queryReturn.resultCount)
.set('updated row count', queryReturn.updatedCount)
.set('updated row indices', queryReturn.updatedIndices)
.set('duration', timer.stop());
return api;
}
});
Object.defineProperty(api, 'update', {
enumerable: true,
value: (query, withRecords) => {
const timer = new Timer(`API update`);
const queryReturn = runQuery(core, query, false, withRecords);
mainCursor.isDirty = true;
lastResults
.clear()
.set('operation', 'update')
.set('completed', true)
.set('updated row count', queryReturn.updatedCount)
.set('updated row indices', queryReturn.updatedIndices)
.set('duration', timer.stop());
return api;
}
});
// needs enhancement
Object.defineProperty(api, 'writeRecords', {
enumerable: true,
value: (records, matchColumnName, matchAttributeName) => {
const timer = new Timer(`API writeRecords`);
const queryReturn = runObjUpdate(core, records, matchColumnName, matchAttributeName);
mainCursor.isDirty = true;
lastResults
.clear()
.set('operation', 'writeRecords')
.set('completed', true)
.set('updated', queryReturn.resultSet.entries())
.set('warnings', queryReturn.warnings.entries())
.set('errors', queryReturn.errors.entries())
.set('duration', timer.stop());
return api;
}
});
Object.defineProperty(api, 'writeCursor', {
enumerable: true,
value: () => {
const timer = new Timer(`API writeCursor`);
const queryReturn = runObjUpdate(core, api.getRecords());
lastResults
.clear()
.set('operation', 'writeCursor')
.set('completed', true)
.set('updated', queryReturn.resultSet.entries())
.set('warnings', queryReturn.warnings.entries())
.set('errors', queryReturn.errors.entries())
.set('duration', timer.stop());
return api;
}
});
Object.defineProperty(api, 'getRecords', {
enumerable: true,
value: () => {
const timer = new Timer(`API getRecords`);
if (mainCursor.isDirty) {
const queryReturn = runQuery(core, () => true, true, true, mainCursor.attributesSet);
mainCursor.consumeReturn(queryReturn);
}
lastResults
.clear()
.set('operation', 'getRecords')
.set('completed', true)
.set('count', mainCursor.length)
.set('duration', timer.stop());
return mainCursor.values();
}
});
Object.defineProperty(api, 'getUnique', {
enumerable: true,
value: (columnName, attribute) => {
const timer = new Timer(`API getUnique`);
const uniqueValues = getUnique(core, columnName, attribute);
lastResults
.clear()
.set('operation', 'getUnique')
.set('completed', true)
.set('count', uniqueValues.length)
.set('duration', timer.stop());
return uniqueValues;
}
});
Object.defineProperty(api, 'flush', {
enumerable: true,
value: () => {
const timer = new Timer(`API flush`);
mainCursor.flush();
lastResults
.clear()
.set('operation', 'flush')
.set('completed', true)
.set('duration', timer.stop());
return api;
}
});
Object.defineProperty(api, 'insertRow', {
enumerable: true,
value: (topOrBottom, dataObject) => {
const timer = new Timer(`API insertRow`);
const position = insertRow(core, topOrBottom, dataObject);
mainCursor.flush();
lastResults
.clear()
.set('operation', 'insertRow')
.set('@ position', position)
.set('completed', true)
.set('duration', timer.stop());
return api;
}
});
Object.defineProperty(api, 'deleteRow', {
enumerable: true,
value: rowPosition => {
const timer = new Timer(`API insertRow`);
const position = deleteRow(core, rowPosition);
mainCursor.flush();
lastResults
.clear()
.set('operation', 'deleteRow')
.set('@ position', position)
.set('completed', true)
.set('duration', timer.stop());
return api;
}
});
Object.defineProperty(api, 'getExportObject', {
enumerable: true,
value: rawDataOnly => {
const timer = new Timer(`API getExportObject`);
const exportObject = getExportObject(core, rawDataOnly);
lastResults
.clear()
.set('operation', 'getExportObject')
.set('completed', true)
.set('duration', timer.stop());
return exportObject;
}
});
Object.defineProperty(api, 'loadSelectedRows', {
enumerable: true,
value: attrSet => {
const timer = new Timer(`API loadSelectedRows`);
const reqAttSet = new AttributesSet().push(DEFAULT_ATTRIBUTE);
if (attrSet !== undefined) {
(isArray(attrSet) ? attrSet : [attrSet]).forEach(attr => {
reqAttSet.push(attr);
});
}
mainCursor.setToSelected();
mainCursor.updateAttributesSet(reqAttSet);
lastResults
.clear()
.set('operation', 'loadSelectedRows')
.set('count', mainCursor.length)
.set('res', mainCursor.entries())
.set('completed', true)
.set('duration', timer.stop());
return api;
}
});
Object.defineProperty(api, 'setRows', {
enumerable: true,
value: (indices, oneIndexed) => {
const offset = oneIndexed === true ? 1 : 0;
mainCursor.setToIndices(
(isArray(indices) ? indices : [indices]).map(index => index + offset)
);
return api;
}
});
Object.defineProperty(api, 'getSelectedIndices', {
enumerable: true,
value: asPos => {
return asPos === true ? mainCursor.keys().map(i => i + 1) : mainCursor.keys();
}
});
Object.defineProperty(api, 'selectionLength', {
enumerable: true,
value: () => {
return this.getSelectedIndices().length;
}
});
Object.defineProperty(api, 'getFullDataIndex', {
enumerable: true,
value: (columnName, attribute, oneIndexed) => {
const timer = new Timer(`API getDataIndex`);
const dataIndex = sheetAccessor.getFullDataIndex(columnName, attribute, oneIndexed);
lastResults
.clear()
.set('operation', 'getFullDataIndex')
.set('oneIndexed', oneIndexed === true)
.set('length', dataIndex.length)
.set('unique', dataIndex.isUnique)
.set('completed', true)
.set('duration', timer.stop());
return dataIndex;
}
});
Object.defineProperty(api, 'getHeaderRow', {
enumerable: true,
value: () => {
return sheetAccessor.getHeaderRow();
}
});
Object.defineProperty(api, 'getOptions', {
enumerable: true,
value: () => {
return instanceOptions.getSettingsExport();
}
});
Object.defineProperty(api, 'getLastResults', {
enumerable: true,
value: () => {
return lastResults.entries();
}
});
/**
* Establish options setters
*/
Object.defineProperties(api, {
setSheetName: {
enumerable: true,
value: input => {
instanceOptions.sheetName = input;
return api;
}
},
setColumnFilter: {
enumerable: true,
value: input => {
mainCursor.isDirty = true;
instanceOptions.columnFilter = input;
return api;
}
},
getColumnFilter: {
enumerable: true,
value: () => {
return instanceOptions.columnFilter;
}
},
setExportAttributes: {
enumerable: true,
value: input => {
instanceOptions.exportAttributes = input;
return api;
}
},
exportWithAllAttributes: {
enumerable: true,
value: () => {
instanceOptions.exportWithAllAttributes();
return api;
}
},
setReadLevel: {
enumerable: true,
value: input => {
instanceOptions.readLevel = input;
return api;
}
},
setWriteLevel: {
enumerable: true,
value: input => {
instanceOptions.writeLevel = input;
return api;
}
},
setAutoResizeColumns: {
enumerable: true,
value: input => {
instanceOptions.autoResizeColumns = input;
return api;
}
},
setComputedProperties: {
enumerable: true,
value: input => {
mainCursor.isDirty = true;
instanceOptions.computedProperties = input;
return api;
}
},
setIdColumnName: {
enumerable: true,
value: input => {
instanceOptions.idColumnName = input;
return api;
}
},
setIdAttributeName: {
enumerable: true,
value: input => {
instanceOptions.idAttributeName = input;
return api;
}
}
});
return api;
} catch (e) {
throw new Error(`TableProxy.mount failed: ${e}`);
}
}
return objAssign({ mount, Map, UniqueSet, Timer, strContains }, C);
};
const $initTableProxy = function $initTableProxy(asName) {
if (asName && !global[asName]) {
global[asName] = TableProxy();
} else if (!global.TableProxy) {
global.TableProxy = TableProxy();
}
};
global.$initTableProxy = $initTableProxy;
const $initUtils = function $initUtils(asName) {
if (asName) {
global[asName] = Utils;
} else {
global.TableProxy = Utils;
}
};
global.$initUtils = $initUtils;
| 29.69378 | 97 | 0.536014 |
15de220420b1bebbed1c0f86251e1b6d06912385 | 2,126 | js | JavaScript | packages/expo-local-authentication/build/LocalAuthentication.js | tai8292/expo | 0ff09bb06d820e0b81efedfa1076074e8f746e5d | [
"Apache-2.0",
"MIT"
] | 2 | 2019-05-23T20:39:18.000Z | 2019-05-24T14:00:32.000Z | packages/expo-local-authentication/build/LocalAuthentication.js | tai8292/expo | 0ff09bb06d820e0b81efedfa1076074e8f746e5d | [
"Apache-2.0",
"MIT"
] | null | null | null | packages/expo-local-authentication/build/LocalAuthentication.js | tai8292/expo | 0ff09bb06d820e0b81efedfa1076074e8f746e5d | [
"Apache-2.0",
"MIT"
] | null | null | null | import { UnavailabilityError } from '@unimodules/core';
import invariant from 'invariant';
import { Platform } from 'react-native';
import ExpoLocalAuthentication from './ExpoLocalAuthentication';
import { AuthenticationType } from './LocalAuthentication.types';
export { AuthenticationType };
export async function hasHardwareAsync() {
if (!ExpoLocalAuthentication.hasHardwareAsync) {
throw new UnavailabilityError('expo-local-authentication', 'hasHardwareAsync');
}
return await ExpoLocalAuthentication.hasHardwareAsync();
}
export async function supportedAuthenticationTypesAsync() {
if (!ExpoLocalAuthentication.supportedAuthenticationTypesAsync) {
throw new UnavailabilityError('expo-local-authentication', 'supportedAuthenticationTypesAsync');
}
return await ExpoLocalAuthentication.supportedAuthenticationTypesAsync();
}
export async function isEnrolledAsync() {
if (!ExpoLocalAuthentication.isEnrolledAsync) {
throw new UnavailabilityError('expo-local-authentication', 'isEnrolledAsync');
}
return await ExpoLocalAuthentication.isEnrolledAsync();
}
export async function authenticateAsync(promptMessageIOS = 'Authenticate') {
if (!ExpoLocalAuthentication.authenticateAsync) {
throw new UnavailabilityError('expo-local-authentication', 'authenticateAsync');
}
if (Platform.OS === 'ios') {
invariant(typeof promptMessageIOS === 'string' && promptMessageIOS.length, 'Fingerprint.authenticateAsync must be called with a non-empty string on iOS');
const result = await ExpoLocalAuthentication.authenticateAsync(promptMessageIOS);
if (result.warning) {
console.warn(result.warning);
}
return result;
}
else {
return await ExpoLocalAuthentication.authenticateAsync();
}
}
export async function cancelAuthenticate() {
if (!ExpoLocalAuthentication.cancelAuthenticate) {
throw new UnavailabilityError('expo-local-authentication', 'cancelAuthenticate');
}
await ExpoLocalAuthentication.cancelAuthenticate();
}
//# sourceMappingURL=LocalAuthentication.js.map | 45.234043 | 162 | 0.750235 |
15de2af408273bd2ff9573f3380fd72186bb045e | 71 | js | JavaScript | src/components/organism/Formik/FormikSelect/index.js | Client-Relationship-Consultancy/open-source-design-system | 630857dc356dbb33eb9b4a7a38a340cf6584f7d7 | [
"MIT"
] | null | null | null | src/components/organism/Formik/FormikSelect/index.js | Client-Relationship-Consultancy/open-source-design-system | 630857dc356dbb33eb9b4a7a38a340cf6584f7d7 | [
"MIT"
] | 184 | 2020-06-05T01:32:32.000Z | 2022-03-24T10:41:48.000Z | src/components/organism/Formik/FormikSelect/index.js | Client-Relationship-Consultancy/open-source-design-system | 630857dc356dbb33eb9b4a7a38a340cf6584f7d7 | [
"MIT"
] | 1 | 2020-06-04T10:39:12.000Z | 2020-06-04T10:39:12.000Z | import FormikSelect from "./FormikSelect"
export default FormikSelect
| 17.75 | 41 | 0.830986 |
15de75e94a59f2ab0440d7a5e5cdeb0817f3d059 | 1,272 | js | JavaScript | components/prism-regex.min.js | szank/prism | 15f30e659ee2b479ba0780d343e714ebd78c7e3a | [
"MIT"
] | 769 | 2017-01-26T18:50:45.000Z | 2022-02-04T15:03:39.000Z | components/prism-regex.min.js | szank/prism | 15f30e659ee2b479ba0780d343e714ebd78c7e3a | [
"MIT"
] | 244 | 2020-08-19T03:33:24.000Z | 2022-03-29T22:08:45.000Z | components/prism-regex.min.js | szank/prism | 15f30e659ee2b479ba0780d343e714ebd78c7e3a | [
"MIT"
] | 97 | 2017-01-26T19:32:32.000Z | 2022-02-09T19:48:14.000Z | !function(a){var e={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|c[a-zA-Z]|0[0-7]{0,2}|[123][0-7]{2}|.)/,t="(?:[^\\\\-]|"+n.source+")",s=RegExp(t+"-"+t),i={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};a.languages.regex={charset:{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"charset-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"charset-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:s,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":e,charclass:{pattern:/\\[wsd]|\\p{[^{}]+}/i,alias:"class-name"},escape:n}},"special-escape":e,charclass:{pattern:/\.|\\[wsd]|\\p{[^{}]+}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":i}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":i}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{(?:\d+,?\d*)\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}}(Prism); | 1,272 | 1,272 | 0.536164 |
15de956f5c11a8a982e6093fb432d7fc69a85428 | 240 | js | JavaScript | url-shortening-api-master/src/index.js | laura-daugherty/FrontEndMasters-url-shortening | f49eba2b05cf371fe61711ff5db5e264ba51ec7e | [
"MIT"
] | null | null | null | url-shortening-api-master/src/index.js | laura-daugherty/FrontEndMasters-url-shortening | f49eba2b05cf371fe61711ff5db5e264ba51ec7e | [
"MIT"
] | null | null | null | url-shortening-api-master/src/index.js | laura-daugherty/FrontEndMasters-url-shortening | f49eba2b05cf371fe61711ff5db5e264ba51ec7e | [
"MIT"
] | null | null | null | import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
const rootElement = document.getElementById("root");
console.log("root", rootElement)
ReactDOM.render(
<App />,
rootElement
); | 20 | 52 | 0.7125 |
15de9d9cd9799491155e955695074ae29dbde301 | 3,167 | js | JavaScript | dist/angular-bootstrap-switch.min.js | sleede/angular-bootstrap-switch | 018296a9462baa6d89bb08c4ddb1d789e827998d | [
"Apache-2.0"
] | null | null | null | dist/angular-bootstrap-switch.min.js | sleede/angular-bootstrap-switch | 018296a9462baa6d89bb08c4ddb1d789e827998d | [
"Apache-2.0"
] | null | null | null | dist/angular-bootstrap-switch.min.js | sleede/angular-bootstrap-switch | 018296a9462baa6d89bb08c4ddb1d789e827998d | [
"Apache-2.0"
] | null | null | null | /**
* angular-bootstrap-switch
* @version v0.5.2 - 2020-10-05
* @author Francesco Pontillo (francescopontillo@gmail.com)
* @link https://github.com/frapontillo/angular-bootstrap-switch
* @license Apache License 2.0(http://www.apache.org/licenses/LICENSE-2.0.html)
**/
!function(){"use strict";angular.module("frapontillo.bootstrap-switch",[]),angular.module("frapontillo.bootstrap-switch").directive("bsSwitch",["$parse","$timeout",function(a,b){return{restrict:"A",require:"ngModel",link:function(c,d,e,f){var g=!1,h=function(){if("radio"===e.type)return e.value||a(e.ngValue)(c)||!0;var b=a(e.ngTrueValue)(c);return angular.isUndefined(b)&&(b=!0),b},i=function(a){return c.$eval(a)===!0},j=function(a){return a===!0||"true"===a||!a},k=function(a){return a?a:void 0},l=function(a){return angular.isUndefined(a)?angular.noop:function(){c.$evalAsync(a)}},m=function(a){var b={switchRadioOff:j,switchActive:function(a){return!j(a)},switchAnimate:j,switchLabel:function(a){return a?a:" "},switchIcon:function(a){if(a)return"<span class='"+a+"'></span>"},switchWrapper:function(a){return a||"wrapper"},switchInverse:i,switchReadonly:i,switchChange:l},c=b[a]||k;return c(e[a])},n=function(a,b,c){if(g){var d=m(c);a.bootstrapSwitch(b,d)}},o=function(){n(d,"disabled","switchActive")},p=function(){if(!g){var a=f.$modelValue===h();g=!g,d.bootstrapSwitch({radioAllOff:m("switchRadioOff"),disabled:m("switchActive"),state:a,onText:m("switchOnText"),offText:m("switchOffText"),onColor:m("switchOnColor"),offColor:m("switchOffColor"),animate:m("switchAnimate"),size:m("switchSize"),labelText:m(e.switchLabel?"switchLabel":"switchIcon"),wrapperClass:m("switchWrapper"),handleWidth:m("switchHandleWidth"),labelWidth:m("switchLabelWidth"),inverse:m("switchInverse"),readonly:m("switchReadonly")}),"radio"===e.type?f.$setViewValue(f.$modelValue):(f.$setViewValue(a),f.$formatters[0]=function(a){return void 0===a||null===a?a:angular.equals(a,h())})}},q=m("switchChange"),r=function(){e.$observe("switchActive",function(a){var c=j(a);c?o():b(o)}),f.$render=function(){p(),d.bootstrapSwitch("disabled","");var a=f.$modelValue;d.bootstrapSwitch("state",a===h(),!0),o(),q()};var a={switchRadioOff:"radioAllOff",switchOnText:"onText",switchOffText:"offText",switchOnColor:"onColor",switchOffColor:"offColor",switchAnimate:"animate",switchSize:"size",switchLabel:"labelText",switchIcon:"labelText",switchWrapper:"wrapperClass",switchHandleWidth:"handleWidth",switchLabelWidth:"labelWidth",switchInverse:"inverse",switchReadonly:"readonly"},c=function(a,b){return function(){e.$observe(a,function(){n(d,b[a],a)})}};for(var g in a)e.$observe(g,c(g,a))},s=function(){"radio"===e.type?d.on("change.bootstrapSwitch",function(a){f.$modelValue===f.$viewValue&&a.target.checked!==$(a.target).bootstrapSwitch("state")&&(a.target.checked?f.$setViewValue(h()):h()===f.$viewValue&&f.$setViewValue(void 0),q())}):d.on("switchChange.bootstrapSwitch",function(a){f.$setViewValue(a.target.checked),q()})};s(),r(),c.$on("$destroy",function(){d.bootstrapSwitch("destroy")})}}}]).directive("bsSwitch",function(){return{restrict:"E",require:"ngModel",template:"<input bs-switch>",replace:!0}})}(); | 351.888889 | 2,893 | 0.721503 |
15dfb55ab998e8219e563bcc8e080871c3883832 | 3,690 | js | JavaScript | src/router/index.js | Alexation/CTGU-insurance | fcb986ea1b932bd5316c9b9970cb774c9d7fe20c | [
"MIT"
] | null | null | null | src/router/index.js | Alexation/CTGU-insurance | fcb986ea1b932bd5316c9b9970cb774c9d7fe20c | [
"MIT"
] | null | null | null | src/router/index.js | Alexation/CTGU-insurance | fcb986ea1b932bd5316c9b9970cb774c9d7fe20c | [
"MIT"
] | null | null | null | import Vue from 'vue'
import Router from 'vue-router'
const Index = () => import('/page/index.vue')
const Login = () => import('/page/Login/login.vue')
const Register = () => import('/page/Login/register.vue')
const Home = () => import('/page/Home/home.vue')
const Yiqing = () => import('/page/Yiqing/yiqing.vue')
const GoodS = () => import('/page/Goods/goods.vue')
const goodsDetails = () => import('/page/Goods/goodsDetails.vue')
const Cart = () => import('/page/Cart/cart.vue')
const order = () => import('/page/Order/order.vue')
const user = () => import('/page/User/user.vue')
const orderList = () => import('/page/User/children/order.vue')
const information = () => import('/page/User/children/information.vue')
const addressList = () => import('/page/User/children/addressList.vue')
const coupon = () => import('/page/User/children/coupon.vue')
const aihuishou = () => import('/page/User/children/aihuishou.vue')
const support = () => import('/page/User/children/support.vue')
const checkout = () => import('/page/Checkout/checkout.vue')
const payment = () => import('/page/Order/payment.vue')
const paysuccess = () => import('/page/Order/paysuccess.vue')
const Thanks = () => import('/page/Thanks/thanks.vue')
const Search = () => import('/page/Search/search.vue')
const RefreshSearch = () => import('/page/Refresh/refreshsearch.vue')
const RefreshGoods = () => import('/page/Refresh/refreshgoods.vue')
const orderDetail = () => import('/page/User/children/orderDetail.vue')
const Alipay = () => import('/page/Order/alipay.vue')
const Wechat = () => import('/page/Order/wechat.vue')
const QQpay = () => import('/page/Order/qqpay.vue')
Vue.use(Router)
export default new Router({
routes: [
{
path: '/',
component: Index,
name: 'index',
redirect: '/home',
children: [
{path: 'home', component: Home},
{path: 'goods', component: GoodS},
{path: 'goodsDetails', name: 'goodsDetails', component: goodsDetails},
{path: 'thanks', name: 'thanks', component: Thanks},
{path: 'map', name: 'map', component: Yiqing},
{path: '/refreshgoods', name: 'refreshgoods', component: RefreshGoods}
]
},
{path: '/login', name: 'login', component: Login},
{path: '/register', name: 'register', component: Register},
// {path: '/addinformation', name: 'register', component: Register},
{path: '/cart', name: 'cart', component: Cart},
{path: '/refreshsearch', name: 'refreshsearch', component: RefreshSearch},
{
path: '/order',
name: 'order',
component: order,
children: [
{path: 'paysuccess', name: 'paysuccess', component: paysuccess},
{path: 'payment', name: 'payment', component: payment},
{path: '/search', name: 'search', component: Search},
{path: 'alipay', name: 'alipay', component: Alipay},
{path: 'wechat', name: 'wechat', component: Wechat},
{path: 'qqpay', name: 'qqpay', component: QQpay}
]
},
{
path: '/user',
name: 'user',
component: user,
redirect: '/user/orderList',
children: [
{path: 'orderList', name: '订单列表', component: orderList},
{path: 'orderDetail', name: '订单详情', component: orderDetail},
{path: 'information', name: '账户资料', component: information},
{path: 'addressList', name: '收货地址', component: addressList},
{path: 'coupon', name: '我的优惠', component: coupon},
{path: 'support', name: '售后服务', component: support},
{path: 'aihuishou', name: '以旧换新', component: aihuishou}
]
},
{path: '/checkout', name: 'checkout', component: checkout},
{path: '*', redirect: '/home'}
]
})
| 43.928571 | 78 | 0.614905 |
15e045b258c9a94fdaa4a5e4356cb14dcfe2b536 | 4,388 | js | JavaScript | .resources/r2.edited/core/_EM_setFixed.js | bartonding/OurJS | 1c9cc9ec2e1dc0882374f3928deddbdbd6e0d132 | [
"MIT"
] | 1 | 2016-01-05T17:48:31.000Z | 2016-01-05T17:48:31.000Z | .resources/r2.edited/core/_EM_setFixed.js | bartonding/OurJS | 1c9cc9ec2e1dc0882374f3928deddbdbd6e0d132 | [
"MIT"
] | null | null | null | .resources/r2.edited/core/_EM_setFixed.js | bartonding/OurJS | 1c9cc9ec2e1dc0882374f3928deddbdbd6e0d132 | [
"MIT"
] | null | null | null | /**
* @name ElementManager.setFixed
* @author sundongguo
* @version 20080825
* @need EventManager
* ElementManager
* FX
*
* 将指定元素固定在可视区域的指定位置。
* 在改变窗口大小或滚动内容时,浮动该元素到指定位置。
*
* ElementManager.setFixed($target,position)
* $target: 目标元素。
* position: {left:左边距,right:右边距,top:上边距,bottom:下边距}格式的对象,设置其位置。
* 可以设置像素数或百分比,如left:50代表距左边线50像素,left:50%代表目标元素中心点距左边线占总长度的50%。
* 如果同时设定left/right或top/bottom,将以后边的为准。
* 如果省略left/right或top/bottom,则设置left或top为auto,参照文档流的当前坐标定位。
*/
//--------------------------------------------------[setFixed]
ElementManager.setFixed=function()
{
function setXY(o)
{
if(o.xy.x)
{
var offsetWidth=o.$target.offsetWidth;
var windowWidth=ElementManager.getWindowWidth();
var x=null;
if("left" in o.position)
{
x=o.position.left;
x=/\d+%/.test(x)?parseInt(x,10)/100*windowWidth-offsetWidth/2:x;
}
else
{
x=o.position.right;
x=/\d+%/.test(x)?(1-parseInt(x,10)/100)*windowWidth-offsetWidth/2:windowWidth-offsetWidth-x;
}
o.xy.x[1]=Math.floor(x);
}
if(o.xy.y)
{
var offsetHeight=o.$target.offsetHeight;
var windowHeight=ElementManager.getWindowHeight();
var y=null;
if("top" in o.position)
{
y=o.position.top;
y=/\d+%/.test(y)?parseInt(y,10)/100*windowHeight-offsetHeight/2:y;
}
else
{
y=o.position.bottom;
y=/\d+%/.test(y)?(1-parseInt(y,10)/100)*windowHeight-offsetHeight/2:windowHeight-offsetHeight-y;
}
o.xy.y[1]=Math.floor(y);
}
}
function onEvent(event)
{
if(event.type=="resize")for(var i=0;i<pool.length;i++)setXY(pool[i]);
animation.stop();
animation.play();
}
var pool=[];
var animation=FX.createAnimation
({
before:function()
{
for(var i=0;i<pool.length;i++)
{
var o=pool[i];
if(o.xy.x)o.xy.x[0]=parseInt(o.$target.style.left,10);
if(o.xy.y)o.xy.y[0]=parseInt(o.$target.style.top,10);
}
},
tween:function(n)
{
for(var i=0;i<pool.length;i++)
{
var o=pool[i];
// if(o.xy.x)o.$target.style.left=(o.xy.x[0]+(ElementManager.getWindowSrollLeft()+o.xy.x[1]-o.xy.x[0])*n)+"px";
// if(o.xy.y)o.$target.style.top=(o.xy.y[0]+(ElementManager.getWindowSrollTop()+o.xy.y[1]-o.xy.y[0])*n)+"px";
if(o.xy.x)o.$target.style.left=Math.max(Math.min(o.xy.x[0]+(ElementManager.getWindowSrollLeft()+o.xy.x[1]-o.xy.x[0])*n,ElementManager.getDocumentWidth()-o.$target.offsetWidth),0)+"px";
if(o.xy.y)o.$target.style.top=Math.max(Math.min(o.xy.y[0]+(ElementManager.getWindowSrollTop()+o.xy.y[1]-o.xy.y[0])*n,ElementManager.getDocumentHeight()-o.$target.offsetHeight),0)+"px";
}
},
mode:"easeIn",
duration:500
});
return function($target,position)
{
//设置浮动。
if(position)
{
//首次运行,建立对象池并绑定事件。
if(pool.length==0)
{
// EventManager.bind(window,"resize",onEvent);
// EventManager.bind(window,"scroll",onEvent);
EventManager.bind(parent,"resize",onEvent);
EventManager.bind(parent,"scroll",onEvent);
}
//同一元素只能绑定一个坐标,后边的设置将覆盖先前的设置。
else
{
for(var i=0;i<pool.length;i++)if(pool[i].$target===$target)pool.splice(i,1);
}
//建立新对象,只保存值,无方法。
var o=
{
$target:$target,
position:position,
xy:{}
};
if("left" in position&&"right" in position)delete position.left;
if("top" in position&&"bottom" in position)delete position.top;
if("left" in position||"right" in position)o.xy.x=[];
if("top" in position||"bottom" in position)o.xy.y=[];
setXY(o);
//设置初始位置。
// if(o.xy.x)$target.style.left=ElementManager.getWindowSrollLeft()+o.xy.x[1]+"px";
// if(o.xy.y)$target.style.top=ElementManager.getWindowSrollTop()+o.xy.y[1]+"px";
if(o.xy.x)o.$target.style.left=Math.max(Math.min(ElementManager.getWindowSrollLeft()+o.xy.x[1],ElementManager.getDocumentWidth()-o.$target.offsetWidth),0)+"px";
if(o.xy.y)o.$target.style.top=Math.max(Math.min(ElementManager.getWindowSrollTop()+o.xy.y[1],ElementManager.getDocumentHeight()-o.$target.offsetHeight),0)+"px";
//向池压入。
pool.push(o);
}
//取消浮动。
else
{
if(pool.length==0)return;
//从池弹出。
for(var i=0;i<pool.length;i++)if(pool[i].$target===$target)pool.splice(i,1);
//无浮动对象,清除对象池并解除事件绑定。
if(pool.length==0)
{
// EventManager.unbind(window,"resize",onEvent);
// EventManager.unbind(window,"scroll",onEvent);
EventManager.unbind(parent,"resize",onEvent);
EventManager.unbind(parent,"scroll",onEvent);
}
}
};
}();
| 30.054795 | 188 | 0.644257 |
15e0467b8a8b20d816ba8d39b87ed5fdedc86e37 | 7,791 | js | JavaScript | ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js | bloomenio/metamask-extension | 746a19b8e1749852093be3fa16c0f9e0bca502ac | [
"MIT"
] | null | null | null | ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js | bloomenio/metamask-extension | 746a19b8e1749852093be3fa16c0f9e0bca502ac | [
"MIT"
] | null | null | null | ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js | bloomenio/metamask-extension | 746a19b8e1749852093be3fa16c0f9e0bca502ac | [
"MIT"
] | null | null | null | import {validateMnemonic} from 'bip39'
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import TextField from '../../../../components/ui/text-field'
import Button from '../../../../components/ui/button'
import {
INITIALIZE_SELECT_ACTION_ROUTE,
INITIALIZE_END_OF_FLOW_ROUTE,
} from '../../../../helpers/constants/routes'
export default class ImportWithSeedPhrase extends PureComponent {
static contextTypes = {
t: PropTypes.func,
metricsEvent: PropTypes.func,
}
static propTypes = {
history: PropTypes.object,
onSubmit: PropTypes.func.isRequired,
setSeedPhraseBackedUp: PropTypes.func,
initializeThreeBox: PropTypes.func,
}
state = {
seedPhrase: '',
password: 'H2020_Bloomen',
confirmPassword: 'H2020_Bloomen',
seedPhraseError: '',
passwordError: '',
confirmPasswordError: '',
termsChecked: false,
}
parseSeedPhrase = (seedPhrase) => {
if (!seedPhrase) {
return ''
}
const trimmed = seedPhrase.trim()
if (!trimmed) {
return ''
}
const words = trimmed.match(/\w+/g)
if (!words) {
return ''
}
return words.join(' ')
}
componentWillMount () {
window.onbeforeunload = () => this.context.metricsEvent({
eventOpts: {
category: 'Onboarding',
action: 'Import Seed Phrase',
name: 'Close window on import screen',
},
customVariables: {
errorLabel: 'Seed Phrase Error',
errorMessage: this.state.seedPhraseError,
},
})
}
handleSeedPhraseChange (seedPhrase) {
let seedPhraseError = ''
if (seedPhrase) {
const parsedSeedPhrase = this.parseSeedPhrase(seedPhrase)
if (parsedSeedPhrase.split(' ').length !== 12) {
seedPhraseError = this.context.t('seedPhraseReq')
} else if (!validateMnemonic(parsedSeedPhrase)) {
seedPhraseError = this.context.t('invalidSeedPhrase')
}
}
this.setState({ seedPhrase, seedPhraseError })
}
handlePasswordChange (password) {
const { t } = this.context
this.setState(state => {
const { confirmPassword } = state
let confirmPasswordError = ''
let passwordError = ''
if (password && password.length < 8) {
passwordError = t('passwordNotLongEnough')
}
if (confirmPassword && password !== confirmPassword) {
confirmPasswordError = t('passwordsDontMatch')
}
return {
password,
passwordError,
confirmPasswordError,
}
})
}
handleConfirmPasswordChange (confirmPassword) {
const { t } = this.context
this.setState(state => {
const { password } = state
let confirmPasswordError = ''
if (password !== confirmPassword) {
confirmPasswordError = t('passwordsDontMatch')
}
return {
confirmPassword,
confirmPasswordError,
}
})
}
handleImport = async event => {
event.preventDefault()
if (!this.isValid()) {
return
}
const { password, seedPhrase } = this.state
const { history, onSubmit, setSeedPhraseBackedUp, initializeThreeBox } = this.props
try {
await onSubmit(password, this.parseSeedPhrase(seedPhrase))
this.context.metricsEvent({
eventOpts: {
category: 'Onboarding',
action: 'Import Seed Phrase',
name: 'Import Complete',
},
})
setSeedPhraseBackedUp(true).then(() => {
initializeThreeBox()
history.push(INITIALIZE_END_OF_FLOW_ROUTE)
})
} catch (error) {
this.setState({ seedPhraseError: error.message })
}
}
isValid () {
const {
seedPhrase,
password,
confirmPassword,
passwordError,
confirmPasswordError,
seedPhraseError,
} = this.state
if (!password || !confirmPassword || !seedPhrase || password !== confirmPassword) {
return false
}
if (password.length < 8) {
return false
}
return !passwordError && !confirmPasswordError && !seedPhraseError
}
toggleTermsCheck = () => {
this.context.metricsEvent({
eventOpts: {
category: 'Onboarding',
action: 'Import Seed Phrase',
name: 'Check ToS',
},
})
this.setState((prevState) => ({
termsChecked: !prevState.termsChecked,
}))
}
render () {
const { t } = this.context
const { seedPhraseError, passwordError, confirmPasswordError, termsChecked } = this.state
return (
<form
className="first-time-flow__form"
onSubmit={this.handleImport}
>
<div className="first-time-flow__create-back">
<a
onClick={e => {
e.preventDefault()
this.context.metricsEvent({
eventOpts: {
category: 'Onboarding',
action: 'Import Seed Phrase',
name: 'Go Back from Onboarding Import',
},
customVariables: {
errorLabel: 'Seed Phrase Error',
errorMessage: seedPhraseError,
},
})
this.props.history.push(INITIALIZE_SELECT_ACTION_ROUTE)
}}
href="#"
>
{`< Back`}
</a>
</div>
<div className="first-time-flow__header">
{ t('importAccountSeedPhrase') }
</div>
<div className="first-time-flow__text-block">
{ t('secretPhrase') }
</div>
<div className="first-time-flow__textarea-wrapper">
<label>{ t('walletSeed') }</label>
<textarea
className="first-time-flow__textarea"
onChange={e => this.handleSeedPhraseChange(e.target.value)}
value={this.state.seedPhrase}
placeholder={t('seedPhrasePlaceholder')}
/>
</div>
{
seedPhraseError && (
<span className="error">
{ seedPhraseError }
</span>
)
}
{/* <TextField
id="password"
label={t('newPassword')}
type="password"
className="first-time-flow__input"
value={this.state.password}
onChange={event => this.handlePasswordChange(event.target.value)}
error={passwordError}
autoComplete="new-password"
margin="normal"
largeLabel
/>
<TextField
id="confirm-password"
label={t('confirmPassword')}
type="password"
className="first-time-flow__input"
value={this.state.confirmPassword}
onChange={event => this.handleConfirmPasswordChange(event.target.value)}
error={confirmPasswordError}
autoComplete="confirm-password"
margin="normal"
largeLabel
/> */}
<div className="first-time-flow__checkbox-container" onClick={this.toggleTermsCheck}>
<div className="first-time-flow__checkbox">
{termsChecked ? <i className="fa fa-check fa-2x" /> : null}
</div>
<span className="first-time-flow__checkbox-label">
I have read and agree to the <a
href="https://metamask.io/terms.html"
target="_blank"
rel="noopener noreferrer"
>
<span className="first-time-flow__link-text">
{ 'Terms of Use' }
</span>
</a>
</span>
</div>
<Button
type="primary"
className="first-time-flow__button"
disabled={!this.isValid() || !termsChecked}
onClick={this.handleImport}
>
{ t('import') }
</Button>
</form>
)
}
}
| 26.681507 | 93 | 0.565396 |
15e2063daae02325a2f7b7c6ed45bcb6a8f146df | 23,802 | js | JavaScript | dist/knockroute.min.js | jusbuc2k/knockroute | 98ae971b19f26be528f30e2755c7f944bd552fba | [
"MIT"
] | 1 | 2019-12-06T14:12:12.000Z | 2019-12-06T14:12:12.000Z | dist/knockroute.min.js | jusbuc2k/knockroute | 98ae971b19f26be528f30e2755c7f944bd552fba | [
"MIT"
] | null | null | null | dist/knockroute.min.js | jusbuc2k/knockroute | 98ae971b19f26be528f30e2755c7f944bd552fba | [
"MIT"
] | null | null | null | /**
* knockroute - Router & lazy template loader for Knockout
* Copyright 2016 Justin R. Buchanan
* @version v1.0.2
* @link https://github.com/jusbuc2k/knockroute
* @license MIT
*/
!function(e){"function"==typeof define&&define.amd?define(["exports","require","knockout","jquery"],e):e(null,null,window.ko,window.jQuery)}(function(e,t,n,r){"use strict";function a(){n.bindingHandlers.routeTemplate=V,n.route=I}function o(e){return e.replace(E,"")}function i(e,t){return"true"===o((e.getAttribute(t)||"").toLowerCase())}function s(e){return"object"==typeof e&&"number"==typeof e.length}function l(e){return null==e?null:":"===e[0]?C.dataType(e.slice(1)):"="===e[0]?C.equals(e.slice(1)):null}function u(e,t){return t[e.areaRouteKey]?e.router.getView(t[e.viewRouteKey],t[e.areaRouteKey]):e.router.getView(t[e.viewRouteKey])}function p(e){this.isDisposed=!1,this.disposalCallback=e}function c(e,t){var n={pathSeperator:"/"};t=this.options=I.utils.defaults(n,t||{}),this.routeTemplate=e,this.segments=c.parseTemplate(e,t.pathSeperator)}function d(e){function t(){var e=a.getPath();"string"==typeof e&&r(e),a.pathChanged.notifySubscribers(e)}function r(t){o.length>=e.maxHistoryEntries&&o.splice(0,1+(e.maxHistoryEntries-o.length)),o.push(t)}var a=this,o=[];e=I.utils.defaults({maxHistoryEntries:100},e||{}),a.pathChanged=new n.subscribable,a.setPath=function(e){e?window.location.hash=a.decorate(e):window.location.hash=""},a.getPath=function(){return window.location.hash.slice(1)},a.decorate=function(e){return 0===e.indexOf("#/")?e:"/"===e[0]?"#"+e:"#"===e[0]?"#/"+e.slice(1):"#/"+e},a.start=function(e){I.utils.attachEvent(window,"hashchange",t),e!==!1&&t()},a.stop=function(){I.utils.detachEvent(window,"hashchange",t)},a.peekBack=function(){return o.length>=2?o[o.length-2]:void 0},a.back=function(e){return o.length>1?(o.pop(),a.setPath(o.pop()),"function"==typeof e&&window.setTimeout(e,1),!0):!1}}function f(e){function t(t){var n,r=new RegExp(e.basePath,"gi");return(n=r.exec(t))?n[0]:""}function r(t){var n,r=new RegExp(e.basePath,"gi");return(n=r.exec(t))?t.substr(n[0].length):t}function a(){var e=i.getPath();"string"==typeof e&&o(e),i.pathChanged.notifySubscribers(e)}function o(t){s.length>=e.maxHistoryEntries&&s.splice(0,1+(e.maxHistoryEntries-s.length)),s.push(t)}var i=this,s=[],l={basePath:"^",maxHistoryEntries:100};e=I.utils.defaults(l,e||{}),i.pathChanged=new n.subscribable,i.setPath=function(e){window.history.pushState({},"",t(window.location.pathname)+e),i.pathChanged.notifySubscribers(e)},i.getPath=function(){return r(window.location.pathname)},i.decorate=function(e){return e},i.start=function(e){I.utils.attachEvent(window,"popstate",a),e!==!1&&a()},i.stop=function(){I.utils.detachEvent(window,"popstate",a)},i.back=function(e){return s.length>=2?(s.pop(),i.setPath(s.pop()),"function"==typeof e&&window.setTimeout(e,1),!0):!1}}function h(){}function m(){}function v(e){var t={createTemplates:!0,useTags:!0,tagName:"script",templateContainer:null,cache:!0,cacheNodes:!0};if(this.options=I.utils.defaults(t,e||{}),this.templateCache={},"undefined"==typeof r)throw"jQuery is required to use the DomTemplateProvider"}function w(){}function g(e){var t=this,r={name:null,views:[]};n.utils.extend(t,I.utils.defaults(r,e||{}))}function y(e){var t=this,r={name:null,area:null,model:null,modelInstance:null,templateID:null,activeTemplateID:null,templateSrc:null,templatePersist:!1,singleton:!1,content:null,scope:null,resetScroll:!0,onModelCreating:null,onModelUnloading:null,handler:null};n.utils.extend(t,I.utils.defaults(r,e||{})),t.activeTemplateID=n.observable(t.activeTemplateID)}function b(){this._channels={},this._subs=[]}function T(e){function t(e){return{path:e,isCancelled:!1,cancel:function(){this.isCancelled||(this.isCancelled=!0,x.pathProvider.stop(),x.pathProvider.back(function(){x.pathProvider.start(!1)}))},isPersistModelSet:!1,persistModel:function(){this.isPersistModelSet=!0},isPreventDisposeSet:!1,preventDispose:function(){this.isPreventDisposeSet=!0}}}function r(t,n,r){var a,o,i,s=t.templateID,l=!0,u={cancel:function(){throw new Error("Cancel Not Implemented")},setTemplate:function(e){if(!l)throw"Template cannot be set at this time.";s=e}};return a=t.modelInstance&&"function"==typeof t.modelInstance[n]?P.resolve(t.modelInstance[n].apply(t.modelInstance,[r,u])):P.resolve(null),l=!1,s!==t.templateID||n===e.loadMethodName?(o=x.getTemplate(s,t),i=p(o),P.all([a,i])):a}function a(e,t){x.onUnload.notifySubscribers({context:this,routeValues:t.routeValues,navigation:t}),t.isCancelled||("function"==typeof e.onModelUnloading&&e.onModelUnloading.apply(e,[t.routeValues,e.modelInstance,t]),t.isCancelled||null!=e.modelInstance&&"function"==typeof e.modelInstance.unload&&e.modelInstance.unload.apply(e.modelInstance,[t.routeValues,t])===!1&&t.cancel())}function o(e){e.singleton!==!0&&null!=e.modelInstance&&"function"==typeof e.modelInstance.dispose&&e.modelInstance.dispose.apply(e.modelInstance)}function i(e){var t;for(t=0;t<M.length;t++)M[t]!==e&&null!=M[t].modelInstance&&null!=M[t].scope&&M[t].scope!==e.scope&&o(M[t],e)}function l(t,n,s){var l,u=[],p=H(),c=!1;return F&&F.abort("abort"),t===p?void r(t,e.updateMethodName,n)["catch"](function(t){m("Error",e.errorTemplateID,t,n)}):(a(p,s),void(s.isCancelled||(F=I.utils.abortable(function(){H(t),F=null,t.resetScroll!==!1&&x.scrollProvider.resetScroll(),x.onLoaded.notifySubscribers({routeValues:n,navigation:s,context:this})}),"function"==typeof t.onModelCreating&&t.onModelCreating.apply(t,[n,s]),l=t.modelInstance||t.model||{},x.onLoading.notifySubscribers({routeValues:n,navigation:s,context:this}),s.isCancelled||(("function"==typeof l||"string"==typeof l)&&(l=x.modelFactory.createModel(l,[x,n])),P.resolve(l).then(function(a){t.modelInstance=a;try{s.isPreventDisposeSet||(o(p),i(t)),p.singleton||s.isPersistModelSet||(p.modelInstance=null),p.activeTemplateID()&&p.activeTemplateID()!==t.templateID&&("function"==typeof p.disposeTemplate?p.disposeTemplate():x.templateProvider.unloadTemplate(p.activeTemplateID())),u.push(r(t,e.loadMethodName,n).then(function(){return r(t,e.updateMethodName,n)}))}catch(l){return m("Error",e.errorTemplateID,l,n),P.reject(l)}return P.all(u).then(F)["catch"](function(t){F=null,"abort"===t||c||(c=!0,m("Error",e.errorTemplateID,t,n))})})))))}function p(e){var t,r;return"string"==typeof e?(t=x.getTemplate(e),r=e):(t=e,r=e.templateID),x.templateProvider.loadTemplate(t).then(function(t){t.templateNodes&&(e.templateNodes=t.templateNodes),n.isWriteableObservable(e.activeTemplateID)&&e.activeTemplateID(r)})}function c(t,n){var r,a,o;for(r=0;r<n.length;r++)if(o=n[r].route.match(t,n[r].defaults)){if(a=e.viewResolver.call(null,{areaRouteKey:e.areaRouteKey,viewRouteKey:e.viewRouteKey,router:x},o),null==a)continue;return{view:a,routeValues:o,route:n[r]}}return null}function d(e,t,n){var r,a,o,i;for(r=n.length-1;r>=0;r--)if(a=n[r].route.resolve(e,t))return o=n[r].route,i=n[r].defaults,{route:o,defaults:i,path:a};return null}function f(e){var t;return t=c(e,R),null==t&&(t=c(e,N)),null==t||null==t.routeValues||null==t.view?null:{view:t.view,route:t.route,routeValues:n.utils.extend(t.routeValues,I.utils.parseQueryString(e))}}function m(t,n,r,a){var o,i={routeValues:a,context:this,error:r,errorHandled:!1},s=new I.View({name:t,modelInstance:{name:t,routeValues:a,error:r},content:null});x.onLoadError.notifySubscribers(i),!i.errorHandled&&n?(o=x.getTemplate(n,{templateID:n}),"function"==typeof e.errorModel&&(s.modelInstance=new e.errorModel(a,r)),p(o).then(function(){s.activeTemplateID(o.templateID),H(s)},function(e){s.content="Failed to load the error template.",H(s)})):i.errorHandled||(s.content="An error occurred while loading the view.",H(s))}function v(n){var r=f(n),a=t(n);return null==r?a.routeValues=null:(a.routeValues=r.routeValues,a.view=r.view),null==r?void m("NotFound",e.notFoundTemplateID,"Path not found"):void l(r.view,r.routeValues,a)}function g(e){T&&(T.dispose(),T=null),x.pathProvider&&x.pathProvider.stop(),x.pathProvider=e,T=x.pathProvider.pathChanged.subscribe(v),C&&x.pathProvider.start()}function y(){C||(H(E),x.pathProvider.start(),C=!0)}function b(e){var t,n;if(t=e instanceof I.View?e:new I.View(e),null==t.area)M.push(t);else{if(n=x.getArea(t.area),null==n)throw"Invalid area name on view";n.addView(t)}}var T,E,x=this,S={routes:[{template:"{view}/{id?}",defaults:{view:"home"}}],areas:[],views:[],templates:[],viewRouteKey:"view",areaRouteKey:"area",loadMethodName:"load",updateMethodName:"update",pathProvider:"hash",templateProvider:"default",modelFactory:"default",scrollProvider:"window",defaultContent:"Loading...",defaultTemplateID:"",defaultTemplateNodes:null,errorTemplateID:"",notFoundTemplateID:"",viewResolver:u},C=!1,V=[],N=[],R=[],A=[],M=[],F=null;e=I.utils.defaults(S,e||{}),E=new I.View({name:null,templateID:e.defaultTemplateID,templateNodes:e.defaultTemplateNodes,content:e.defaultContent});var H=n.observable(E);x.pathProvider=null,g(new I.HashPathStringProvider),x.templateProvider=new I.DefaultTemplateProvider,x.modelFactory=new h,x.scrollProvider=new w,x.bus=new I.Bus,x.clearTemplates=function(){I.utils.clearArray(V)},x.clearRoutes=function(){I.utils.clearArray(N),I.utils.clearArray(R)},x.clearViews=function(){I.utils.clearArray(A),I.utils.clearArray(R),I.utils.clearArray(M)},x.addTemplates=function(e){e&&e.forEach&&e.forEach(function(e){V.push(e)})},x.addAreas=function(e){if(!e||!e.forEach)throw new TypeError("newAreas must be an array.");e.forEach(function(e){A.push(new I.Area(e)),s(e.routes)?e.routes.forEach(function(t){R.push({route:new I.Route("{area="+e.name+"}/"+t.template),defaults:n.utils.extend({},t.defaults)})}):R.push({route:new I.Route("{area="+e.name+"}/"+N[0].route.routeTemplate),defaults:n.utils.extend({},N[0].defaults)})})},x.addViews=function(e){if(!e||!e.forEach)throw new TypeError("addedViews must be an array.");e.forEach(function(e){b(e)})},x.insertRoutes=function(e){var t;if(!e||!e.length)throw new TypeError("insertedRoutes must be an array.");for(t=e.length-1;t>=0;t--)N.splice(0,0,{route:new I.Route(e[t].template),defaults:e[t].defaults})},x.addRoutes=function(e){if(!e||!e.forEach)throw new TypeError("addedRoutes must be an array.");e.forEach(function(e){N.push({route:new I.Route(e.template),defaults:e.defaults})})},x.getArea=function(e){return n.utils.arrayFirst(A,function(t){return t.name===e})},x.getView=function(e,t){var r;return 1===arguments.length?n.utils.arrayFirst(M,function(t){return t.name===e}):2===arguments.length?(r=x.getArea(t),null==r?null:r.getView(e)):null},x.getTemplate=function(e,t){var r=n.utils.arrayFirst(V,function(t){return t.templateID===e});return r?r:t},x.setOptions=function(t){if(null==t)throw new TypeError("newOptions must be an object.");n.utils.extend(e,t),s(t.templates)&&(x.clearTemplates(),x.addTemplates(t.templates)),s(t.routes)&&(x.clearRoutes(),x.addRoutes(t.routes)),s(t.areas)&&s(t.views)?(x.clearViews(),x.addAreas(t.areas),x.addViews(t.views)):s(t.areas)?(x.clearViews(),x.addAreas(t.areas)):s(t.views)&&(x.clearViews(),x.addViews(t.views)),"object"==typeof t.templateProvider?x.templateProvider=t.templateProvider:"ajax"===t.templateProvider&&(x.templateProvider=new I.AjaxTemplateProvider),"object"==typeof t.pathProvider?g(t.pathProvider):"history"===t.pathProvider&&g(new I.HistoryPathStringProvider(t.basePath)),"object"==typeof t.scrollProvider?x.scrollProvider=t.scrollProvider:"window"===t.scrollProvider&&(x.scrollProvider=new I.WindowScrollProvider)},x.resolve=function(e,t){var n,r,a="",o={},i=!1;if(t||(n=x.pathProvider.getPath()),r=d(e,n,R),null==r&&(r=d(e,n,N)),null==r)throw"No matching route for given path";a+=r.route.resolve(e,n,r.defaults);for(var s in e)e.hasOwnProperty(s)&&!r.route.hasKey(s)&&void 0===o[s]&&(o[s]=e[s],i=!0);return i&&(a+=D+I.utils.serializeQueryString(o)),this.pathProvider.decorate(a)},x.navigate=function(e,t){var n;if(n="string"==typeof e&&1===arguments.length?e:x.resolve(e,t),null==n)throw"No matching route or path exists.";x.pathProvider.setPath(n)},x.navigateBack=function(){return"function"==typeof x.pathProvider.back?new P(function(e,t){x.pathProvider.back(e)}):new P.resolve(null)},x.setView=function(e,n,r){var a;e instanceof I.View||(e=new I.View(e)),e!=H()&&(n=n||{},"string"==typeof r?(this.pathProvider.stop(),this.pathProvider.setPath(r),this.pathProvider.start(!1)):r=this.pathProvider.getPath(),a=t(r),l(e,n,a))},x.setTemplate=function(e){H().activeTemplateID(e)},x.dispose=function(){x.pathProvider.stop();var e=!1;T&&(T.dispose(),T=null);for(var t=0;t<M.length;t++)o(M[t]),M[t]===H()&&(e=!0);e||(a(H()),o(H())),H(null)},x.init=y,x.view=n.computed(function(){return H()}),x.onLoading=new n.subscribable,x.onLoaded=new n.subscribable,x.onUnload=new n.subscribable,x.onLoadError=new n.subscribable,this.setOptions(e)}var P=window.Promise||window.ES6Promise.Promise,I=e||{},E=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,x="\\{(\\w+)([=:]\\w+)?(\\??)\\}",S=/^[\w\+\.\-\~]+$/i,D="?",C={equals:function(e){return function(t){return e===t}},dataType:function(e){var t=/.*/;return"float"===e?t=/^[-+]?\d*\.?\d*$/i:"int"===e?t=/^[-+]?\d*$/i:"hex"===e&&(t=/^[a-fA-F0-9]*$/i),function(e){return t.test(e)}}};I.defaultViewResolver=u,I.utils=I.utils||{},I.utils.clearArray=function(e){for(;e.length>0;)e.pop()},I.utils.defaults=function(e,t){for(var n in e)t.hasOwnProperty(n)||"undefined"!=typeof t[n]||"undefined"==typeof e[n]||(t[n]=e[n]);return t},I.utils.parseQueryString=function(e){var t={},n=(e||"").indexOf("?"),r=0;if(n>=0&&(e=e.slice(n+1)),"undefined"!=typeof e)for(var a,o=e.split("&"),i=0;i<o.length;i++)a=o[i].split("="),2===a.length&&(t[a[0]]=decodeURIComponent(a[1]),r++);return r>0?t:null},I.utils.serializeQueryString=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n+"="+e[n]);return t.join("&")},I.utils.attachEvent=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else{if(!e.attachEvent)throw"No event subscription method available.";e.attachEvent("on"+t,n)}},I.utils.detachEvent=function(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else{if(!e.detachEvent)throw"No event subscription method available.";e.detachEvent("on"+t,n)}},I.utils.abortable=function(e){function t(){return n?P.reject(n):P.resolve(e.apply(this,arguments))}var n=null;return t.abort=function(e){n=e},t},I.utils.setTextContent=function(e,t){e&&"undefined"!=typeof e.innerHTML?e.innerHTML=t:e&&"undefined"!=typeof e.textContent?e.textContent=t:e&&"undefined"!=typeof e.innerText&&(e.innerText=t)},p.prototype.dispose=function(){this.isDisposed||(this.disposalCallback(),this.isDisposed=!0)},c.parseSegmentValue=function(e,t){switch(e=decodeURIComponent(e),t){case"float":return parseFloat(e);case"int":return parseInt(e,10);case"hex":return parseInt(e,16);default:return e}},c.parseTemplate=function(e,t){var n,r=[],a=!1;0===e.indexOf(t)&&(e=e.slice(t.length)),n=e.split(t);for(var o=0;o<n.length;o++)if(n[o]){for(var i,s=[],u=new RegExp(x,"gi");i=u.exec(n[o]);)s.push(i);if(1===s.length){var p=!1,c=s[0][2]&&":"===s[0][2][0]?s[0][2].slice(1):"string";if("params"===c?(r.push({value:n[o],parts:[{name:s[0][1],optional:!0,type:"params",dataType:"string"}]}),p=!0):r.push({value:n[o],parts:[{name:s[0][1],optional:p="?"===s[0][3],type:"parameter",constraint:l(s[0][2]),dataType:c}]}),a&&!p)throw"Invalid route template: A required segment cannot follow an optional one.";a=a||p}else{if(s.length>1)throw"Invalid route template: Multi-part route segments are not implemented";if(S.test(n[o]))r.push({value:n[o],parts:[{name:n[o],optional:!1,type:"literal"}]});else{if("*"!==n[o])throw"Invalid route template: The segment value '"+n[o]+"' is invalid.";r.push({value:n[o],parts:[{name:n[o],optional:!1,type:"wildcard",dataType:"string"}]})}}}return r},c.prototype.match=function(e,t){var n,r,a,o={};if(null==e)throw"A value for path must be specified.";0===e.indexOf(this.options.pathSeperator)&&(e=e.slice(this.options.pathSeperator.length));var i=-1;(i=e.indexOf("?"))>=0&&(e=e.slice(0,i)),n=e.split(this.options.pathSeperator);for(var s=0;s<n.length;s++)if(r=n[s],a=this.segments.length>s?this.segments[s]:null,null==a){if(r.length>0)return null}else{if(1!==a.parts.length)throw"Multi-part route segments are not implemented";var l=a.parts[0];if("literal"===l.type){if(l.name!==r)return null}else if("wildcard"===l.type);else if("parameter"===l.type&&r.length>0){if(null!=l.constraint&&!l.constraint(r))return null;o[l.name]=c.parseSegmentValue(r,l.dataType)}else{if("parameter"!==l.type){if("params"===l.type&&this.segments.length-1==s){o[l.name]=n.slice(s).map(decodeURIComponent);break}return null}var u;if(t&&(u=t[l.name]))o[l.name]=u;else if(!l.optional)return null}}for(var s=n.length;s<this.segments.length;s++){if(a=this.segments[s],a.parts.length>1)return null;var l=a.parts[0];if("literal"===l.type)return null;var u;if(t&&(u=t[l.name])||"wildcard"===l.type)o[l.name]=u;else if(!l.optional)return null}if(null!=t)for(var p in t)t.hasOwnProperty(p)&&!o.hasOwnProperty(p)&&(o[p]=t[p]);return o},c.prototype.resolve=function(e,t,r){var a,o,i,s,l=[],u=Number.MAX_VALUE,p=!1,c=-1;"string"==typeof t&&t.length>0&&(t[0]===this.options.pathSeperator&&(t=t.slice(1)),(c=t.indexOf("?"))>=0&&(t=t.slice(0,c)),a=t.split(this.options.pathSeperator));for(var d=0;d<this.segments.length;d++){if(i=this.segments[d],o=a&&a[d]?decodeURI(a[d]):null,1!==i.parts.length)throw"Multi-part route segments are not supported.";if(s=i.parts[0],"wildcard"===s.type){if(!(o&&o.length>0))return null;l.push(o)}else if("literal"===s.type)l.push(s.name);else if("parameter"===s.type){if(e.hasOwnProperty(s.name)){if(p=!0,null!=s.constraint&&!s.constraint(e[s.name]))return null;l.push(e[s.name])}else if(!p&&o&&o.length>0){if(null!=s.constraint&&!s.constraint(o))return null;l.push(o)}else if("object"==typeof r&&r.hasOwnProperty(s.name))l.push(r[s.name]);else if(!s.optional)return null}else if("params"===s.type&&d==this.segments.length-1){var f=e[s.name];f&&(f=f.map(encodeURIComponent).join(this.options.pathSeperator),f.length&&(u=l.length,l.push(f)))}}var h=0;return n.utils.arrayForEach(this.segments,function(e){e.parts[0].optional||h++}),l.length<h?null:l.map(function(e,t){return u>t?encodeURIComponent(e):e}).join(this.options.pathSeperator)},c.prototype.hasKey=function(e){for(var t=0;t<this.segments.length;t++)for(var n=0;n<this.segments[t].parts.length;n++)if(this.segments[t].parts[n].name===e)return!0;return!1},I.Route=c,I.HashPathStringProvider=d,I.HistoryPathStringProvider=f,h.prototype.createModel=function(e,t){function n(){return e.apply(this,t)}if("function"==typeof e)return n.prototype=e.prototype,new n;throw"constructor must be a valid constructor function."},m.prototype.loadTemplate=function(e){var t=window.document.getElementById(e.templateID);if(!t)throw"There is no element with id "+e.templateID+".";if("script"!==t.tagName.toLowerCase())throw"The element with id "+e.templateID+" must be a <script> tag in order to use it as a template.";return P.resolve({success:!0,statusCode:203,template:t})},m.prototype.unloadTemplate=function(e){},I.DefaultTemplateProvider=m,v.prototype.loadTemplateTag=function(e){var t=window.document.getElementById(e.templateID),n=this.options.templateContainer||window.document.body,a=this;if(this.options.createTemplates&&!t&&e.templateSrc)t=window.document.createElement(this.options.tagName),t.type="text/html",t.id=e.templateID,this.options.cache?t.setAttribute("data-src",e.templateSrc):t.setAttribute("data-src",e.templateSrc+"?v="+(new Date).getTime().toString()),e.templatePersist&&t.setAttribute("data-persist","true"),n.appendChild(t);else if(!t)throw"There is no template defined with id '"+e.templateID+"'";if(t.tagName.toLowerCase()!==this.options.tagName)throw"The element with id "+e.templateID+" must be a <"+this.options.tagName+"> tag in order to use it as a template.";var o=e.templateSrc||t.getAttribute("data-src"),s=i(t,"data-loaded"),l={success:!1,statusCode:0,template:t};return new P(function(e,n){o&&!s?(a.options.cache||(o+="?v="+(new Date).getTime().toString()),r.get(o).done(function(n,r,a){t.text=n,t.setAttribute("data-loaded","true"),l.success=!0,l.statusCode=a.status,l.statusText=a.statusText,e(l)}).fail(function(e,t,r){l.success=!1,l.statusCode=e.status,l.statusText=e.statusText,n(l)})):(l.success=!0,l.statusCode=203,e(l))})},v.prototype.loadTemplateNodes=function(e){var t=this,a={success:!1,statusCode:0};if(null==e.templateID)throw new Error("The templateID must be provided for the given view.");return new P(function(o,i){var s,l,u=t.templateCache[e.templateID];if(u)a.templateNodes=u.nodes,a.success=!0,a.statusCode=203,o(a);else if(l=window.document.getElementById(e.templateID))a.templateNodes=n.utils.parseHtmlFragment(l.text),a.success=!0,a.statusCode=203,o(a);else{if(null==e.templateSrc)throw new Error("The templateSrc must be provided for the given view.");s=e.templateSrc,t.options.cache||(s+="?v="+(new Date).getTime().toString()),r.get(s).done(function(r,i,s){var l=$(r);"TEMPLATE"===l.prop("tagName")?l[0].content?a.templateNodes=l[0].content.childNodes:a.templateNodes=n.utils.parseHtmlFragment(l.html()):"SCRIPT"===l.prop("tagName")?a.templateNodes=n.utils.parseHtmlFragment(l[0].text):a.templateNodes=l.toArray(),t.options.cacheNodes&&e.templatePersist&&(t.templateCache[e.templateID]={persist:e.templatePersist,nodes:a.templateNodes}),a.success=!0,a.statusCode=s.status,a.statusText=s.statusText,o(a)}).fail(function(e,t,n){a.success=!1,a.statusCode=e.status,a.statusText=e.statusText,i(a)})}})},v.prototype.loadTemplate=function(e){return this.options.useTags?this.loadTemplateTag(e):this.loadTemplateNodes(e)},v.prototype.unloadTemplate=function(e){if(this.options.useTags){if("string"==typeof e&&(e=window.document.getElementById(e)),!(e instanceof HTMLScriptElement))throw"The 'template' parameter must be an element ID or an HTMLScriptElement";if(i(e,"data-persist")||null==e.getAttribute("data-src"))return;e.setAttribute("data-loaded","false"),e.text=""}},"undefined"!=typeof r&&(I.AjaxTemplateProvider=v),w.prototype.resetScroll=function(){window.scrollTo(0,0)},I.WindowScrollProvider=w,g.prototype.getView=function(e){return n.utils.arrayFirst(this.views,function(t){return t.name===e})},g.prototype.addView=function(e){this.views.push(e)},g.prototype.clearViews=function(){I.utils.clearArray(this.views)},I.Area=g,I.View=y,b.prototype.publish=function(e,t,n){this._channels[e]&&this._channels[e].notifySubscribers(n,t)},b.prototype.subscribe=function(e,t,r){var a=this;this._channels[e]=this._channels[e]||new n.subscribable;var o=a._channels[e].subscribe(r,a,t),i=new p(function(){o.dispose(),n.utils.arrayRemoveItem(a._subs,i),a._channels[e]&&a._channels[e].getSubscriptionsCount()<=0&&(a._channels[e]=null)});return this._subs.push(i),i},b.prototype.dispose=function(){for(;this._subs.length>0;)this._subs.pop().dispose()},b["default"]=new b,I.Bus=b,I.ViewRouter=T;var V={init:function(e,t,r,a,o){var i=n.bindingHandlers.template.init(e,function(){return""}),s=n.utils.unwrapObservable(t());return n.computed(function(){var t,i=s.view(),l=function(){return t};if(!i)return void I.utils.setTextContent(e,"<h2>Error</h2><p>Something went wrong when trying to display content.</p>");if(i.content&&i.modelInstance&&i.modelInstance.error)return void I.utils.setTextContent(e,"<h2>Error</h2><p>"+i.content+"</p><p>"+(i.modelInstance.error.stack?i.modelInstance.error.stack:"")+"</p>");if(i.content)return void I.utils.setTextContent(e,i.content);if(t={data:i.modelInstance},i.templateNodes?t.nodes=i.templateNodes:t.name=n.unwrap(i.activeTemplateID)||i.templateID,!t.data||!t.name&&!t.nodes)throw"Failed to load view";n.bindingHandlers.template.init(e,l),n.bindingHandlers.template.update(e,l,r,a,o)},this,{disposeWhenNodeIsRemoved:e}).extend({rateLimit:10}),s.init(),i},update:function(e,t,n,r,a){}};a()}); | 2,975.25 | 23,614 | 0.725107 |
15e31aecdaa1c2cb8210649326a48fb70c50a435 | 344 | js | JavaScript | jest-puppeteer.config.js | BbsonLin/Gitako | 69440c0138fa9c8c72525ecdd1e328cdc3f75ea5 | [
"MIT"
] | 1 | 2020-07-20T03:50:16.000Z | 2020-07-20T03:50:16.000Z | jest-puppeteer.config.js | anthonymark33/Gitako | 2b998e3fcf7257ee90c7bd21a3ddf32351308cf8 | [
"MIT"
] | null | null | null | jest-puppeteer.config.js | anthonymark33/Gitako | 2b998e3fcf7257ee90c7bd21a3ddf32351308cf8 | [
"MIT"
] | null | null | null | const path = require('path')
const CRX_PATH = path.resolve(__dirname, 'dist')
module.exports = {
launch: {
executablePath: process.env.PUPPETEER_EXEC_PATH, // set by mujo-code/puppeteer-headful
headless: false, // required for extensions
args: [`--disable-extensions-except=${CRX_PATH}`, `--load-extension=${CRX_PATH}`],
},
}
| 28.666667 | 90 | 0.69186 |
15e34a358bc24a38c6f5ff06e64a354f5bb36419 | 345 | js | JavaScript | functions/util/config.js | Ni3verma/socialApe-backend | 90e6ee43ee623fa66961119465bde6a19cd67f3f | [
"MIT"
] | null | null | null | functions/util/config.js | Ni3verma/socialApe-backend | 90e6ee43ee623fa66961119465bde6a19cd67f3f | [
"MIT"
] | null | null | null | functions/util/config.js | Ni3verma/socialApe-backend | 90e6ee43ee623fa66961119465bde6a19cd67f3f | [
"MIT"
] | null | null | null | module.exports = {
apiKey: "AIzaSyAxBI3A8jonl6mtOvV0Muk-crVOhZxBxFk",
authDomain: "socialape-2db87.firebaseapp.com",
databaseURL: "https://socialape-2db87.firebaseio.com",
projectId: "socialape-2db87",
storageBucket: "socialape-2db87.appspot.com",
messagingSenderId: "217816631869",
appId: "1:217816631869:web:10bc93ff00b62abd"
};
| 34.5 | 56 | 0.765217 |
15e3bf76ddfea5810415c3effbc0d05456b5829d | 760 | js | JavaScript | src/components/organisms/dot/dot.stories.js | jh3y/open-banking-reference-app | f8a20062401b00f4deb915c0ef43a8b40b05c920 | [
"Apache-2.0"
] | 25 | 2020-05-19T17:53:51.000Z | 2022-03-27T21:24:34.000Z | src/components/organisms/dot/dot.stories.js | jh3y/open-banking-reference-app | f8a20062401b00f4deb915c0ef43a8b40b05c920 | [
"Apache-2.0"
] | 4 | 2020-05-26T15:01:50.000Z | 2020-06-24T14:02:50.000Z | src/components/organisms/dot/dot.stories.js | jh3y/open-banking-reference-app | f8a20062401b00f4deb915c0ef43a8b40b05c920 | [
"Apache-2.0"
] | 11 | 2020-06-16T11:46:48.000Z | 2022-03-12T12:47:41.000Z | import React from 'react'
import 'storybook/index.css'
import { withKnobs, boolean } from '@storybook/addon-knobs'
import Dot from './index'
import StoryPage, { DocText, Description, DocItem } from 'storybook/story-components'
export default {
component: Dot,
title: 'Organisms/Dot',
decorators: [
withKnobs,
storyFn => (
<StoryPage title="Pin" url="components/organisms/dot">
<Description>
<DocText>An Indicator to display how many pin numbers have been entered</DocText>
</Description>
{storyFn()}
</StoryPage>
)
]
}
export const withActive = () => {
return (
<DocItem
example={{
render: () => <Dot index={0} active={boolean('Active', false)} />
}}
/>
)
}
| 22.352941 | 91 | 0.615789 |
15e4a1a0d505a5428867a3f17803e47f856f6145 | 9,217 | js | JavaScript | engine/jsb-audio.js | kongsanwen/jsb-adapter | 92119a446be6feddd0c28e44b4cfadcde0815e3a | [
"MIT"
] | null | null | null | engine/jsb-audio.js | kongsanwen/jsb-adapter | 92119a446be6feddd0c28e44b4cfadcde0815e3a | [
"MIT"
] | null | null | null | engine/jsb-audio.js | kongsanwen/jsb-adapter | 92119a446be6feddd0c28e44b4cfadcde0815e3a | [
"MIT"
] | null | null | null | /****************************************************************************
Copyright (c) 2013-2016 Chukong Technologies Inc.
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
http://www.cocos.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated engine source code (the "Software"), a limited,
worldwide, royalty-free, non-assignable, revocable and non-exclusive license
to use Cocos Creator solely to develop games on your target platforms. You shall
not use Cocos Creator software for developing other software or tools that's
used for developing games. You are not granted to publish, distribute,
sublicense, and/or sell copies of Cocos Creator.
The software or tools in this License Agreement are licensed, not sold.
Xiamen Yaji Software Co., Ltd. reserves all rights not expressly granted to you.
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.
****************************************************************************/
cc.Audio = function (src) {
this.src = src;
this.volume = 1;
this.loop = false;
this.id = -1;
};
let handleVolume = function (volume) {
if (volume === undefined) {
// set default volume as 1
volume = 1;
}
else if (typeof volume === 'string') {
volume = Number.parseFloat(volume);
}
return volume;
};
(function (proto, audioEngine) {
if (!audioEngine) return;
// Using the new audioEngine
cc.audioEngine = audioEngine;
audioEngine.setMaxWebAudioSize = function () { };
cc.Audio.State = audioEngine.AudioState;
proto.play = function () {
audioEngine.stop(this.id);
let clip = this.src;
if (clip.loaded) {
this.id = audioEngine.play2d(clip._nativeAsset, this.loop, this.volume);
}
else {
let self = this;
cc.loader.load({
url: clip.nativeUrl,
// For audio, we should skip loader otherwise it will load a new audioClip.
skips: ['Loader'],
},
function (err, audioNativeAsset) {
if (err) {
cc.error(err);
return;
}
if (!clip.loaded) {
clip._nativeAsset = audioNativeAsset;
self.id = audioEngine.play2d(audioNativeAsset, self.loop, self.volume);
}
});
}
};
proto.pause = function () {
audioEngine.pause(this.id);
};
proto.resume = function () {
audioEngine.resume(this.id);
};
proto.stop = function () {
audioEngine.stop(this.id);
};
proto.destroy = function () {
};
proto.setLoop = function (loop) {
this.loop = loop;
audioEngine.setLoop(this.id, loop);
};
proto.getLoop = function () {
return this.loop;
};
proto.setVolume = function (volume) {
volume = handleVolume(volume);
this.volume = volume;
return audioEngine.setVolume(this.id, volume);
};
proto.getVolume = function () {
return this.volume;
};
proto.setCurrentTime = function (time) {
audioEngine.setCurrentTime(this.id, time);
};
proto.getCurrentTime = function () {
return audioEngine.getCurrentTime(this.id)
};
proto.getDuration = function () {
return audioEngine.getDuration(this.id)
};
proto.getState = function () {
return audioEngine.getState(this.id)
};
// polyfill audioEngine
var _music = {
id: -1,
clip: '',
loop: false,
volume: 1
};
var _effect = {
volume: 1
};
audioEngine.play = function (clip, loop, volume) {
if (typeof volume !== 'number') {
volume = 1;
}
if (typeof clip === 'string') {
// backward compatibility since 1.10
cc.warnID(8401, 'cc.audioEngine', 'cc.AudioClip', 'AudioClip', 'cc.AudioClip', 'audio');
let path = clip;
let md5Pipe = cc.loader.md5Pipe;
if (md5Pipe) {
path = md5Pipe.transformURL(path);
}
return audioEngine.play2d(path, loop, volume);
}
else {
if (!clip) {
return;
}
if (clip.loaded) {
return audioEngine.play2d(clip._nativeAsset, loop, volume);
}
else {
cc.loader.load({
url: clip.nativeUrl,
// For audio, we should skip loader otherwise it will load a new audioClip.
skips: ['Loader'],
},
function (err, audioNativeAsset) {
if (err) {
cc.error(err);
return;
}
if (!clip.loaded) {
clip._nativeAsset = audioNativeAsset;
audioEngine.play2d(audioNativeAsset, loop, volume);
}
});
// Deffered loading return audioID -1
return -1;
}
}
};
audioEngine.playMusic = function (clip, loop) {
audioEngine.stop(_music.id);
_music.id = audioEngine.play(clip, loop, _music.volume);
_music.loop = loop;
_music.clip = clip;
return _music.id;
};
audioEngine.stopMusic = function () {
audioEngine.stop(_music.id);
};
audioEngine.pauseMusic = function () {
audioEngine.pause(_music.id);
return _music.id;
};
audioEngine.resumeMusic = function () {
audioEngine.resume(_music.id);
return _music.id;
};
audioEngine.getMusicVolume = function () {
return _music.volume;
};
audioEngine.setMusicVolume = function (volume) {
_music.volume = handleVolume(volume);
audioEngine.setVolume(_music.id, _music.volume);
return volume;
};
audioEngine.isMusicPlaying = function () {
return audioEngine.getState(_music.id) === audioEngine.AudioState.PLAYING;
};
audioEngine.playEffect = function (filePath, loop) {
return audioEngine.play(filePath, loop || false, _effect.volume);
};
audioEngine.setEffectsVolume = function (volume) {
_effect.volume = handleVolume(volume);
};
audioEngine.getEffectsVolume = function () {
return _effect.volume;
};
audioEngine.pauseEffect = function (audioID) {
return audioEngine.pause(audioID);
};
audioEngine.pauseAllEffects = function () {
var musicPlay = audioEngine.getState(_music.id) === audioEngine.AudioState.PLAYING;
audioEngine.pauseAll();
if (musicPlay) {
audioEngine.resume(_music.id);
}
};
audioEngine.resumeEffect = function (id) {
audioEngine.resume(id);
};
audioEngine.resumeAllEffects = function () {
var musicPaused = audioEngine.getState(_music.id) === audioEngine.AudioState.PAUSED;
audioEngine.resumeAll();
if (musicPaused && audioEngine.getState(_music.id) === audioEngine.AudioState.PLAYING) {
audioEngine.pause(_music.id);
}
};
audioEngine.stopEffect = function (id) {
return audioEngine.stop(id);
};
audioEngine.stopAllEffects = function () {
var musicPlaying = audioEngine.getState(_music.id) === audioEngine.AudioState.PLAYING;
var currentTime = audioEngine.getCurrentTime(_music.id);
audioEngine.stopAll();
if (musicPlaying) {
_music.id = audioEngine.play(_music.clip, _music.loop);
audioEngine.setCurrentTime(_music.id, currentTime);
}
};
// Unnecessary on native platform
audioEngine._break = function () {};
audioEngine._restore = function () {};
// deprecated
audioEngine._uncache = audioEngine.uncache;
audioEngine.uncache = function (clip) {
var path;
if (typeof clip === 'string') {
// backward compatibility since 1.10
cc.warnID(8401, 'cc.audioEngine', 'cc.AudioClip', 'AudioClip', 'cc.AudioClip', 'audio');
path = clip;
}
else {
if (!clip) {
return;
}
path = clip._nativeAsset;
}
audioEngine._uncache(path);
};
audioEngine._preload = audioEngine.preload;
audioEngine.preload = function (filePath, callback) {
cc.warn('`cc.audioEngine.preload` is deprecated, use `cc.loader.loadRes(url, cc.AudioClip)` instead please.');
audioEngine._preload(filePath, callback);
};
})(cc.Audio.prototype, jsb.AudioEngine);
| 32.114983 | 118 | 0.569817 |
15e52fb1d1b2b80a56875c6e3063a1acf9c0003e | 46 | js | JavaScript | assets/js/index.js | Kak3n/purity | 6cd566656091910b7417f45bc43f022bcacedcbf | [
"MIT"
] | 16 | 2015-04-05T08:24:53.000Z | 2018-10-09T14:49:42.000Z | assets/js/index.js | mseri/ghiOS7 | 2b999758f2db9b1179a8ced9f2ce913f305320be | [
"MIT"
] | 2 | 2017-08-11T11:20:49.000Z | 2018-10-12T15:36:36.000Z | assets/js/index.js | mseri/ghiOS7 | 2b999758f2db9b1179a8ced9f2ce913f305320be | [
"MIT"
] | 8 | 2015-07-24T19:34:45.000Z | 2018-12-27T15:22:10.000Z | /**
* Main JS file for Casper behaviours
*/
| 11.5 | 37 | 0.630435 |
15e568937e413fa963b9e5e601278c7f7618a27f | 1,076 | js | JavaScript | src/pages/success.js | blocknroll/projectairtime | 82b80afd7a0dbd65b7841e4bd4072d93483a94af | [
"RSA-MD"
] | null | null | null | src/pages/success.js | blocknroll/projectairtime | 82b80afd7a0dbd65b7841e4bd4072d93483a94af | [
"RSA-MD"
] | 14 | 2021-03-30T16:26:54.000Z | 2021-05-10T23:46:58.000Z | src/pages/success.js | blocknroll/projectairtime | 82b80afd7a0dbd65b7841e4bd4072d93483a94af | [
"RSA-MD"
] | null | null | null | import React from "react"
import { Link } from "gatsby"
import { StaticImage } from "gatsby-plugin-image"
import Layout from "../components/layout"
import SEO from "../components/seo"
import successStyles from "../styles/successStyles.module.scss"
export default function Success({ data }) {
return (
<Layout>
<SEO title="Success" />
<section className={successStyles.section}>
<StaticImage
src="../images/Chris-thumbsup.jpg"
alt="Chris Santacroce and his co-pilot paragliding at Point of the Mountain in Draper, Utah."
/>
<div className={successStyles.container}>
<h1>"YEAH BUDDY!!!"</h1>
<h3>
Thank you so much{" "}
<span role="img" aria-label="folded hands: medium-light skin tone">
🙏🏼
</span>
<br></br>We'll be in contact soon!
</h3>
<p>
In the meantime, let's head back to the{" "}
<Link to="/">homepage.</Link>
</p>
</div>
</section>
</Layout>
)
}
| 28.315789 | 103 | 0.55855 |
15e5bc089abc688446eedf7636bda2d7f4706aae | 518 | js | JavaScript | test.js | fundon/empty-object | 9d70e70750d194dd2efe951b8766bda28aa5f0a7 | [
"MIT"
] | 1 | 2015-11-08T08:22:53.000Z | 2015-11-08T08:22:53.000Z | test.js | fundon/empty-object | 9d70e70750d194dd2efe951b8766bda28aa5f0a7 | [
"MIT"
] | null | null | null | test.js | fundon/empty-object | 9d70e70750d194dd2efe951b8766bda28aa5f0a7 | [
"MIT"
] | null | null | null | var assert = require("assert");
var empty = require('./');
describe('empty object', function () {
it('should be clean when via null', function () {
var foo = Object.create(null);
foo.name = 'github';
foo.age = 5;
empty(foo);
assert.equal('{}',JSON.stringify(foo))
});
it('should be clean when via prototype', function () {
function Bar() {}
Bar.prototype.name = 'Bar';
var foo = Object.create(Bar.prototype);
empty(foo);
assert.equal('{}',JSON.stringify(foo))
});
});
| 24.666667 | 56 | 0.596525 |
15e5c0e0192e9b0394c9e8549309cf2e7a81a82e | 4,145 | js | JavaScript | dist/renderer/webgl1/shaders/Shader.js | CyberDex/phaser4 | 29607928659aeeae67995ca3596094a6cf623d44 | [
"MIT"
] | null | null | null | dist/renderer/webgl1/shaders/Shader.js | CyberDex/phaser4 | 29607928659aeeae67995ca3596094a6cf623d44 | [
"MIT"
] | null | null | null | dist/renderer/webgl1/shaders/Shader.js | CyberDex/phaser4 | 29607928659aeeae67995ca3596094a6cf623d44 | [
"MIT"
] | null | null | null | import {GetHeight, GetResolution, GetWidth} from "../../../config/size/";
import {CreateAttributes} from "./CreateAttributes";
import {CreateDepthBuffer} from "../fbo/CreateDepthBuffer";
import {CreateFramebuffer} from "../fbo/CreateFramebuffer";
import {CreateProgram} from "./CreateProgram";
import {CreateShader} from "./CreateShader";
import {CreateUniforms} from "./CreateUniforms";
import {DefaultQuadAttributes} from "./DefaultQuadAttributes";
import {DefaultQuadUniforms} from "./DefaultQuadUniforms";
import {DeleteFramebuffer} from "../fbo/DeleteFramebuffer";
import {DeleteGLTexture} from "../textures/DeleteGLTexture";
import {DeleteShaders} from "./DeleteShaders";
import {GLTextureBinding} from "../textures/GLTextureBinding";
import {SINGLE_QUAD_FRAG} from "../glsl/SINGLE_QUAD_FRAG";
import {SINGLE_QUAD_VERT} from "../glsl/SINGLE_QUAD_VERT";
import {Texture} from "../../../textures/Texture";
import {gl} from "../GL";
export class Shader {
constructor(config) {
this.renderToFramebuffer = false;
this.renderToDepthbuffer = false;
if (config) {
this.fromConfig(config);
}
}
fromConfig(config) {
const {
attributes = DefaultQuadAttributes,
fragmentShader = SINGLE_QUAD_FRAG,
height = GetHeight(),
renderToFramebuffer = false,
renderToDepthbuffer = false,
resolution = GetResolution(),
vertexShader = SINGLE_QUAD_VERT,
width = GetWidth(),
uniforms = DefaultQuadUniforms
} = config;
this.create(fragmentShader, vertexShader, uniforms, attributes);
if (renderToFramebuffer) {
this.renderToFramebuffer = true;
const texture = new Texture(null, width * resolution, height * resolution);
const binding = new GLTextureBinding(texture);
texture.binding = binding;
binding.framebuffer = CreateFramebuffer(binding.texture);
if (renderToDepthbuffer) {
this.renderToDepthbuffer = true;
binding.depthbuffer = CreateDepthBuffer(binding.framebuffer, texture.width, texture.height);
}
this.texture = texture;
this.framebuffer = binding.framebuffer;
}
}
create(fragmentShaderSource, vertexShaderSource, uniforms, attribs) {
const fragmentShader = CreateShader(fragmentShaderSource, gl.FRAGMENT_SHADER);
const vertexShader = CreateShader(vertexShaderSource, gl.VERTEX_SHADER);
if (!fragmentShader || !vertexShader) {
return;
}
const program = CreateProgram(fragmentShader, vertexShader);
if (!program) {
return;
}
const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM);
gl.useProgram(program);
this.program = program;
this.uniformSetters = CreateUniforms(program);
this.uniforms = new Map();
for (const [key, value] of Object.entries(uniforms)) {
this.uniforms.set(key, value);
}
this.attributes = CreateAttributes(program, attribs);
gl.useProgram(currentProgram);
}
updateUniforms(renderPass) {
}
bind(renderPass) {
this.updateUniforms(renderPass);
return this.setUniforms(renderPass);
}
setUniform(key, value) {
const uniforms = this.uniforms;
if (uniforms.has(key)) {
uniforms.set(key, value);
const setter = this.uniformSetters.get(key);
setter(value);
}
}
setUniforms(renderPass) {
if (!this.program) {
return false;
}
gl.useProgram(this.program);
const uniforms = this.uniforms;
for (const [name, setter] of this.uniformSetters.entries()) {
setter(uniforms.get(name));
}
return true;
}
setAttributes(renderPass) {
if (this.program) {
const stride = renderPass.currentVertexBuffer.vertexByteSize;
this.attributes.forEach((attrib) => {
gl.vertexAttribPointer(attrib.index, attrib.size, attrib.type, attrib.normalized, stride, attrib.offset);
});
}
}
destroy() {
DeleteShaders(this.program);
DeleteGLTexture(this.texture);
DeleteFramebuffer(this.framebuffer);
this.uniforms.clear();
this.uniformSetters.clear();
this.attributes.clear();
this.program = null;
this.texture = null;
this.framebuffer = null;
}
}
| 34.831933 | 113 | 0.692883 |
15e5cf82f268823fab1bc5f4f311c147b8da9951 | 549 | js | JavaScript | tests/baselines/reference/typeAssertionToGenericFunctionType.js | nilamjadhav/TypeScript | b059135c51ee93f8fb44dd70a2ca67674ff7a877 | [
"Apache-2.0"
] | 49,134 | 2015-01-01T02:37:27.000Z | 2019-05-06T20:38:53.000Z | tests/baselines/reference/typeAssertionToGenericFunctionType.js | nilamjadhav/TypeScript | b059135c51ee93f8fb44dd70a2ca67674ff7a877 | [
"Apache-2.0"
] | 26,488 | 2015-01-01T13:57:03.000Z | 2019-05-06T20:40:00.000Z | tests/baselines/reference/typeAssertionToGenericFunctionType.js | nilamjadhav/TypeScript | b059135c51ee93f8fb44dd70a2ca67674ff7a877 | [
"Apache-2.0"
] | 8,518 | 2015-01-05T03:29:29.000Z | 2019-05-06T14:37:49.000Z | //// [typeAssertionToGenericFunctionType.ts]
var x = {
a: < <T>(x: T) => T > ((x: any) => 1),
b: <T>(x: T) => { x }
}
x.a<string>(1); // bug was that this caused 'Could not find symbol T' on return type T in the type assertion on x.a's definition
x.b<string>(); // error
//// [typeAssertionToGenericFunctionType.js]
var x = {
a: (function (x) { return 1; }),
b: function (x) { x; }
};
x.a(1); // bug was that this caused 'Could not find symbol T' on return type T in the type assertion on x.a's definition
x.b(); // error
| 34.3125 | 128 | 0.591985 |
15e5fab372bb40d4bb3096780b0a6b3793d1e9bf | 607 | js | JavaScript | src/EventEmitterManager.js | wix-playground/devless-bi | f2e66103644ebfb4f57b10426622d1cbc52737d5 | [
"MIT"
] | null | null | null | src/EventEmitterManager.js | wix-playground/devless-bi | f2e66103644ebfb4f57b10426622d1cbc52737d5 | [
"MIT"
] | null | null | null | src/EventEmitterManager.js | wix-playground/devless-bi | f2e66103644ebfb4f57b10426622d1cbc52737d5 | [
"MIT"
] | null | null | null | import _ from 'lodash';
export default class EventEmitterManager {
constructor() {
this.listeners = {};
}
listenOn(eventName, listener) {
const id = _.uniqueId(eventName);
if (!this.listeners[eventName]) {
this.listeners[eventName] = {};
}
this.listeners[eventName][id] = listener;
return {
remove: () => delete this.listeners[eventName][id]
};
}
emitEvent(eventName, params = {}) {
if (this.listeners[eventName]) {
const listeners = Object.values(this.listeners[eventName]);
(listeners).forEach(listener => listener(params));
}
}
} | 24.28 | 65 | 0.629325 |
15e6010345183e3bb95bbdabcb3dd19fef318f2e | 932 | js | JavaScript | src/modules/spoc-crm-web/src/libs/crmReferral.js | wunike/iview-admin-metis | 9aeb8861a230ccb2ed9af983e04384b6fad50526 | [
"MIT"
] | null | null | null | src/modules/spoc-crm-web/src/libs/crmReferral.js | wunike/iview-admin-metis | 9aeb8861a230ccb2ed9af983e04384b6fad50526 | [
"MIT"
] | null | null | null | src/modules/spoc-crm-web/src/libs/crmReferral.js | wunike/iview-admin-metis | 9aeb8861a230ccb2ed9af983e04384b6fad50526 | [
"MIT"
] | null | null | null | import { http, httpCrmBlob } from "./request";
const k = '/crmReferral'
const post = (u, data) => {
return http.post(`${k}${u}`, data);
};
const get = (u, data) => {
return http.get(`${k}${u}`, data);
};
export const crmReferral = {
listReferralPage(params) {
return post('/listReferralPage', params)
},
listCreatersPage(params) {
return post('/listCreatersPage', params)
},
getShowTitle(params) {
return get('/getShowTitle', { params })
},
clearShowField(params) {
return get('/clearShowField', { params })
},
updateShowTitle(pageIdentifier ,params){
return post('/updateShowTitle?pageIdentifier=' + pageIdentifier, params);
},
audit(params) {
return get('/audit', { params })
},
reward(params) {
return get('/reward', { params })
},
//转中心导出
crmReferralExport(params) {
return httpCrmBlob.post(`${k}/export`, params)
},
} | 25.888889 | 81 | 0.599785 |
15e670a7c99509e9e2f0878b5ce60efa775f4818 | 2,600 | js | JavaScript | assets/js/material-components/layout/Cell.js | eugene-manuilov/site-kit-wp | 673a42523418d21b14f6c22e68a8f54328e0779d | [
"Apache-2.0"
] | 1,191 | 2019-06-12T05:11:29.000Z | 2022-03-22T19:35:13.000Z | assets/js/material-components/layout/Cell.js | eugene-manuilov/site-kit-wp | 673a42523418d21b14f6c22e68a8f54328e0779d | [
"Apache-2.0"
] | 4,121 | 2019-06-19T17:41:31.000Z | 2022-03-31T23:35:11.000Z | assets/js/material-components/layout/Cell.js | eugene-manuilov/site-kit-wp | 673a42523418d21b14f6c22e68a8f54328e0779d | [
"Apache-2.0"
] | 272 | 2019-06-19T18:01:06.000Z | 2022-03-05T13:19:56.000Z | /**
* Material UI > Layout > Cell component.
*
* Site Kit by Google, Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* External dependencies
*/
import PropTypes from 'prop-types';
import classnames from 'classnames';
export default function Cell( props ) {
const {
className,
alignTop,
alignMiddle,
alignBottom,
alignRight,
alignLeft,
smSize,
smStart,
mdSize,
mdStart,
lgSize,
lgStart,
size,
children,
...otherProps
} = props;
return (
<div
{ ...otherProps }
className={ classnames( className, 'mdc-layout-grid__cell', {
'mdc-layout-grid__cell--align-top': alignTop,
'mdc-layout-grid__cell--align-middle': alignMiddle,
'mdc-layout-grid__cell--align-bottom': alignBottom,
'mdc-layout-grid__cell--align-right': alignRight,
'mdc-layout-grid__cell--align-left': alignLeft,
[ `mdc-layout-grid__cell--span-${ size }` ]:
12 >= size && size > 0,
[ `mdc-layout-grid__cell--span-${ lgSize }-desktop` ]:
12 >= lgSize && lgSize > 0,
[ `mdc-layout-grid__cell--start-${ lgStart }-desktop` ]:
12 >= lgStart && lgStart > 0,
[ `mdc-layout-grid__cell--span-${ mdSize }-tablet` ]:
8 >= mdSize && mdSize > 0,
[ `mdc-layout-grid__cell--start-${ mdStart }-tablet` ]:
8 >= mdStart && mdStart > 0,
[ `mdc-layout-grid__cell--span-${ smSize }-phone` ]:
4 >= smSize && smSize > 0,
[ `mdc-layout-grid__cell--start-${ smStart }-phone` ]:
4 >= smStart && smStart > 0,
} ) }
>
{ children }
</div>
);
}
Cell.propTypes = {
smSize: PropTypes.number,
smStart: PropTypes.number,
mdSize: PropTypes.number,
mdStart: PropTypes.number,
lgSize: PropTypes.number,
lgStart: PropTypes.number,
size: PropTypes.number,
alignTop: PropTypes.bool,
alignMiddle: PropTypes.bool,
alignBottom: PropTypes.bool,
alignRight: PropTypes.bool,
alignLeft: PropTypes.bool,
className: PropTypes.string,
children: PropTypes.node,
};
Cell.defaultProps = {
className: '',
size: 0,
smSize: 0,
smStart: 0,
mdSize: 0,
mdStart: 0,
lgSize: 0,
lgStart: 0,
};
| 25.742574 | 75 | 0.665769 |
15e682f988f6947d0fd8f5176c94688d2b7f871d | 28,675 | js | JavaScript | public/toeflassets/js/toeflAddExam.js | incheolha/examsimulator | 9579f881901bbdf2247a17606127afe7c27bca87 | [
"MIT"
] | null | null | null | public/toeflassets/js/toeflAddExam.js | incheolha/examsimulator | 9579f881901bbdf2247a17606127afe7c27bca87 | [
"MIT"
] | null | null | null | public/toeflassets/js/toeflAddExam.js | incheolha/examsimulator | 9579f881901bbdf2247a17606127afe7c27bca87 | [
"MIT"
] | null | null | null |
$(document).ready(function() {
//제이쿼리 탭 선언
var reading, listening, speaking, writing;
reading = $( "#Reading").tabs();
listening = $( "#Listening").tabs();
speaking = $( "#Speaking").tabs();
writing = $( "#Writing").tabs();
//초기화면 리딩탭이 나오게 하고 나머지 탭은 가려놓기
listening.hide();
speaking.hide();
writing.hide();
//각 버튼을 눌렀을때 그에 맞는 탭 보이기/감추기
$( "#Reading_Btn" ).click(function() {
reading.show();
listening.hide();
speaking.hide();
writing.hide();
});
$( "#Listening_Btn" ).click(function() {
listening.show();
reading.hide();
speaking.hide();
writing.hide();
});
$( "#Speaking_Btn" ).click(function() {
speaking.show();
listening.hide();
reading.hide();
writing.hide();
});
$( "#Writing_Btn" ).click(function() {
writing.show();
listening.hide();
speaking.hide();
reading.hide();
});
$( "#hi" ).click(function(event){
event.preventDefault();
window.alert("saved")
});
$(".img_upload_lc1").on('change', function() {
var countFiles = $(this)[0].files.length;
var imgPath = $(this)[0].value;
var extn = imgPath.substring(imgPath.lastIndexOf('.') + 1).toLowerCase();
var image_holder = $("#image_holder_lc1");
image_holder.empty();
if (extn == "gif" || extn == "png" || extn == "jpg" || extn == "jpeg") {
if (typeof(FileReader) != "undefined") {
//loop for each file selected for uploaded.
for (var i = 0; i < countFiles; i++)
{
var reader = new FileReader();
reader.onload = function(e) {
$("<img />", {
"src": e.target.result,
"class": "thumb-image"
}).appendTo(image_holder);
}
image_holder.show();
reader.readAsDataURL($(this)[0].files[i]);
}
} else {
alert("This browser does not support FileReader.");
}
} else {
alert("Pls select only images");
}
});
$(".img_upload_lc2").on('change', function() {
var countFiles = $(this)[0].files.length;
//imgpath 설정
var imgPath = $(this)[0].value;
var extn = imgPath.substring(imgPath.lastIndexOf('.') + 1).toLowerCase();
var image_holder = $("#image_holder_lc2");
image_holder.empty();
if (extn == "gif" || extn == "png" || extn == "jpg" || extn == "jpeg") {
if (typeof(FileReader) != "undefined") {
//loop for each file selected for uploaded.
for (var i = 0; i < countFiles; i++)
{
var reader = new FileReader();
reader.onload = function(e) {
$("<img />", {
"src": e.target.result,
"class": "thumb-image"
}).appendTo(image_holder);
}
image_holder.show();
reader.readAsDataURL($(this)[0].files[i]);
}
} else {
alert("This browser does not support FileReader.");
}
} else {
alert("Pls select only images");
}
});
$(".img_upload_lc3").on('change', function() {
var countFiles = $(this)[0].files.length;
//imgpath 설정
var imgPath = $(this)[0].value;
var extn = imgPath.substring(imgPath.lastIndexOf('.') + 1).toLowerCase();
var image_holder = $("#image_holder_lc3");
image_holder.empty();
if (extn == "gif" || extn == "png" || extn == "jpg" || extn == "jpeg") {
if (typeof(FileReader) != "undefined") {
//loop for each file selected for uploaded.
for (var i = 0; i < countFiles; i++)
{
var reader = new FileReader();
reader.onload = function(e) {
$("<img />", {
"src": e.target.result,
"class": "thumb-image"
}).appendTo(image_holder);
}
image_holder.show();
reader.readAsDataURL($(this)[0].files[i]);
}
} else {
alert("This browser does not support FileReader.");
}
} else {
alert("Pls select only images");
}
});
$(".img_upload_lc4").on('change', function() {
var countFiles = $(this)[0].files.length;
//imgpath 설정
var imgPath = $(this)[0].value;
var extn = imgPath.substring(imgPath.lastIndexOf('.') + 1).toLowerCase();
var image_holder = $("#image_holder_lc4");
image_holder.empty();
if (extn == "gif" || extn == "png" || extn == "jpg" || extn == "jpeg") {
if (typeof(FileReader) != "undefined") {
//loop for each file selected for uploaded.
for (var i = 0; i < countFiles; i++)
{
var reader = new FileReader();
reader.onload = function(e) {
$("<img />", {
"src": e.target.result,
"class": "thumb-image"
}).appendTo(image_holder);
}
image_holder.show();
reader.readAsDataURL($(this)[0].files[i]);
}
} else {
alert("This browser does not support FileReader.");
}
} else {
alert("Pls select only images");
}
});
$(".img_upload_lc5").on('change', function() {
var countFiles = $(this)[0].files.length;
//imgpath 설정
var imgPath = $(this)[0].value;
var extn = imgPath.substring(imgPath.lastIndexOf('.') + 1).toLowerCase();
var image_holder = $("#image_holder_lc5");
image_holder.empty();
if (extn == "gif" || extn == "png" || extn == "jpg" || extn == "jpeg") {
if (typeof(FileReader) != "undefined") {
//loop for each file selected for uploaded.
for (var i = 0; i < countFiles; i++)
{
var reader = new FileReader();
reader.onload = function(e) {
$("<img />", {
"src": e.target.result,
"class": "thumb-image"
}).appendTo(image_holder);
}
image_holder.show();
reader.readAsDataURL($(this)[0].files[i]);
}
} else {
alert("This browser does not support FileReader.");
}
} else {
alert("Pls select only images");
}
});
$(".img_upload_lc6").on('change', function() {
var countFiles = $(this)[0].files.length;
//imgpath 설정
var imgPath = $(this)[0].value;
var extn = imgPath.substring(imgPath.lastIndexOf('.') + 1).toLowerCase();
var image_holder = $("#image_holder_lc6");
image_holder.empty();
if (extn == "gif" || extn == "png" || extn == "jpg" || extn == "jpeg") {
if (typeof(FileReader) != "undefined") {
//loop for each file selected for uploaded.
for (var i = 0; i < countFiles; i++)
{
var reader = new FileReader();
reader.onload = function(e) {
$("<img />", {
"src": e.target.result,
"class": "thumb-image"
}).appendTo(image_holder);
}
image_holder.show();
reader.readAsDataURL($(this)[0].files[i]);
}
} else {
alert("This browser does not support FileReader.");
}
} else {
alert("Pls select only images");
}
});
$(".img_upload_sp1").on('change', function() {
var countFiles = $(this)[0].files.length;
//imgpath 설정
var imgPath = $(this)[0].value;
var extn = imgPath.substring(imgPath.lastIndexOf('.') + 1).toLowerCase();
var image_holder = $("#image_holder_sp1");
image_holder.empty();
if (extn == "gif" || extn == "png" || extn == "jpg" || extn == "jpeg") {
if (typeof(FileReader) != "undefined") {
//loop for each file selected for uploaded.
for (var i = 0; i < countFiles; i++)
{
var reader = new FileReader();
reader.onload = function(e) {
$("<img />", {
"src": e.target.result,
"class": "thumb-image"
}).appendTo(image_holder);
}
image_holder.show();
reader.readAsDataURL($(this)[0].files[i]);
}
} else {
alert("This browser does not support FileReader.");
}
} else {
alert("Pls select only images");
}
});
$(".img_upload_sp2").on('change', function() {
var countFiles = $(this)[0].files.length;
//imgpath 설정
var imgPath = $(this)[0].value;
var extn = imgPath.substring(imgPath.lastIndexOf('.') + 1).toLowerCase();
var image_holder = $("#image_holder_sp2");
image_holder.empty();
if (extn == "gif" || extn == "png" || extn == "jpg" || extn == "jpeg") {
if (typeof(FileReader) != "undefined") {
//loop for each file selected for uploaded.
for (var i = 0; i < countFiles; i++)
{
var reader = new FileReader();
reader.onload = function(e) {
$("<img />", {
"src": e.target.result,
"class": "thumb-image"
}).appendTo(image_holder);
}
image_holder.show();
reader.readAsDataURL($(this)[0].files[i]);
}
} else {
alert("This browser does not support FileReader.");
}
} else {
alert("Pls select only images");
}
});
$(".img_upload_sp3").on('change', function() {
var countFiles = $(this)[0].files.length;
//imgpath 설정
var imgPath = $(this)[0].value;
var extn = imgPath.substring(imgPath.lastIndexOf('.') + 1).toLowerCase();
var image_holder = $("#image_holder_sp3");
image_holder.empty();
if (extn == "gif" || extn == "png" || extn == "jpg" || extn == "jpeg") {
if (typeof(FileReader) != "undefined") {
//loop for each file selected for uploaded.
for (var i = 0; i < countFiles; i++)
{
var reader = new FileReader();
reader.onload = function(e) {
$("<img />", {
"src": e.target.result,
"class": "thumb-image"
}).appendTo(image_holder);
}
image_holder.show();
reader.readAsDataURL($(this)[0].files[i]);
}
} else {
alert("This browser does not support FileReader.");
}
} else {
alert("Pls select only images");
}
});
$(".img_upload_sp4").on('change', function() {
var countFiles = $(this)[0].files.length;
//imgpath 설정
var imgPath = $(this)[0].value;
var extn = imgPath.substring(imgPath.lastIndexOf('.') + 1).toLowerCase();
var image_holder = $("#image_holder_sp4");
image_holder.empty();
if (extn == "gif" || extn == "png" || extn == "jpg" || extn == "jpeg") {
if (typeof(FileReader) != "undefined") {
//loop for each file selected for uploaded.
for (var i = 0; i < countFiles; i++)
{
var reader = new FileReader();
reader.onload = function(e) {
$("<img />", {
"src": e.target.result,
"class": "thumb-image"
}).appendTo(image_holder);
}
image_holder.show();
reader.readAsDataURL($(this)[0].files[i]);
}
} else {
alert("This browser does not support FileReader.");
}
} else {
alert("Pls select only images");
}
}); $(".img_upload_sp5").on('change', function() {
var countFiles = $(this)[0].files.length;
//imgpath 설정
var imgPath = $(this)[0].value;
var extn = imgPath.substring(imgPath.lastIndexOf('.') + 1).toLowerCase();
var image_holder = $("#image_holder_sp5");
image_holder.empty();
if (extn == "gif" || extn == "png" || extn == "jpg" || extn == "jpeg") {
if (typeof(FileReader) != "undefined") {
//loop for each file selected for uploaded.
for (var i = 0; i < countFiles; i++)
{
var reader = new FileReader();
reader.onload = function(e) {
$("<img />", {
"src": e.target.result,
"class": "thumb-image"
}).appendTo(image_holder);
}
image_holder.show();
reader.readAsDataURL($(this)[0].files[i]);
}
} else {
alert("This browser does not support FileReader.");
}
} else {
alert("Pls select only images");
}
});
$(".img_upload_sp6").on('change', function() {
var countFiles = $(this)[0].files.length;
//imgpath 설정
var imgPath = $(this)[0].value;
var extn = imgPath.substring(imgPath.lastIndexOf('.') + 1).toLowerCase();
var image_holder = $("#image_holder_sp6");
image_holder.empty();
if (extn == "gif" || extn == "png" || extn == "jpg" || extn == "jpeg") {
if (typeof(FileReader) != "undefined") {
//loop for each file selected for uploaded.
for (var i = 0; i < countFiles; i++)
{
var reader = new FileReader();
reader.onload = function(e) {
$("<img />", {
"src": e.target.result,
"class": "thumb-image"
}).appendTo(image_holder);
}
image_holder.show();
reader.readAsDataURL($(this)[0].files[i]);
}
} else {
alert("This browser does not support FileReader.");
}
} else {
alert("Pls select only images");
}
});
$(".img_upload_wr1").on('change', function() {
var countFiles = $(this)[0].files.length;
//imgpath 설정
var imgPath = $(this)[0].value;
var extn = imgPath.substring(imgPath.lastIndexOf('.') + 1).toLowerCase();
var image_holder = $("#image_holder_sp6");
image_holder.empty();
if (extn == "gif" || extn == "png" || extn == "jpg" || extn == "jpeg") {
if (typeof(FileReader) != "undefined") {
//loop for each file selected for uploaded.
for (var i = 0; i < countFiles; i++)
{
var reader = new FileReader();
reader.onload = function(e) {
$("<img />", {
"src": e.target.result,
"class": "thumb-image"
}).appendTo(image_holder);
}
image_holder.show();
reader.readAsDataURL($(this)[0].files[i]);
}
} else {
alert("This browser does not support FileReader.");
}
} else {
alert("Pls select only images");
}
});
////////////////////////////////////////////audio
function handleFileSelect(evt) {
var files = evt.target.files; // FileList object
// Loop through the FileList and render image files as thumbnails.
for (var i = 0, f; f = files[i]; i++) {
// Only process image files.
if(f.type.match('audio.*')){
var reader = new FileReader();
reader.onload =(function(theFile){
return function(e) {
var span = document.createElement('span');
span.innerHTML = ['<audio controls><source src="', e.target.result,' "type="audio/ogg"><source src="', e.target.result,' "type="audio/mpeg"></audio>'].join('');
document.getElementById('mp3_holder_lc1').insertBefore(span, null);
}
})(f);
reader.readAsDataURL(f);
continue;
}
}
}
document.getElementById('mp3_upload_lc1').addEventListener('change', handleFileSelect, false);
function handleFileSelect2(evt) {
var files = evt.target.files; // FileList object
// Loop through the FileList and render image files as thumbnails.
for (var i = 0, f; f = files[i]; i++) {
// Only process image files.
if(f.type.match('audio.*')){
var reader = new FileReader();
reader.onload =(function(theFile){
return function(e) {
var span = document.createElement('span');
span.innerHTML = ['<audio controls><source src="', e.target.result,' "type="audio/ogg"><source src="', e.target.result,' "type="audio/mpeg"></audio>'].join('');
document.getElementById('mp3_holder_lc2').insertBefore(span, null);
}
})(f);
reader.readAsDataURL(f);
continue;
}
}
}
document.getElementById('mp3_upload_lc2').addEventListener('change', handleFileSelect2, false);
function handleFileSelect3(evt) {
var files = evt.target.files; // FileList object
// Loop through the FileList and render image files as thumbnails.
for (var i = 0, f; f = files[i]; i++) {
// Only process image files.
if(f.type.match('audio.*')){
var reader = new FileReader();
reader.onload =(function(theFile){
return function(e) {
var span = document.createElement('span');
span.innerHTML = ['<audio controls><source src="', e.target.result,' "type="audio/ogg"><source src="', e.target.result,' "type="audio/mpeg"></audio>'].join('');
document.getElementById('mp3_holder_lc3').insertBefore(span, null);
}
})(f);
reader.readAsDataURL(f);
continue;
}
}
}
document.getElementById('mp3_upload_lc3').addEventListener('change', handleFileSelect3, false);
function handleFileSelect4(evt) {
var files = evt.target.files; // FileList object
// Loop through the FileList and render image files as thumbnails.
for (var i = 0, f; f = files[i]; i++) {
// Only process image files.
if(f.type.match('audio.*')){
var reader = new FileReader();
reader.onload =(function(theFile){
return function(e) {
var span = document.createElement('span');
span.innerHTML = ['<audio controls><source src="', e.target.result,' "type="audio/ogg"><source src="', e.target.result,' "type="audio/mpeg"></audio>'].join('');
document.getElementById('mp3_holder_lc4').insertBefore(span, null);
}
})(f);
reader.readAsDataURL(f);
continue;
}
}
}
document.getElementById('mp3_upload_lc4').addEventListener('change', handleFileSelect4, false);
function handleFileSelect5(evt) {
var files = evt.target.files; // FileList object
// Loop through the FileList and render image files as thumbnails.
for (var i = 0, f; f = files[i]; i++) {
// Only process image files.
if(f.type.match('audio.*')){
var reader = new FileReader();
reader.onload =(function(theFile){
return function(e) {
var span = document.createElement('span');
span.innerHTML = ['<audio controls><source src="', e.target.result,' "type="audio/ogg"><source src="', e.target.result,' "type="audio/mpeg"></audio>'].join('');
document.getElementById('mp3_holder_lc5').insertBefore(span, null);
}
})(f);
reader.readAsDataURL(f);
continue;
}
}
}
document.getElementById('mp3_upload_lc5').addEventListener('change', handleFileSelect5, false);
function handleFileSelect6(evt) {
var files = evt.target.files; // FileList object
// Loop through the FileList and render image files as thumbnails.
for (var i = 0, f; f = files[i]; i++) {
// Only process image files.
if(f.type.match('audio.*')){
var reader = new FileReader();
reader.onload =(function(theFile){
return function(e) {
var span = document.createElement('span');
span.innerHTML = ['<audio controls><source src="', e.target.result,' "type="audio/ogg"><source src="', e.target.result,' "type="audio/mpeg"></audio>'].join('');
document.getElementById('mp3_holder_lc6').insertBefore(span, null);
}
})(f);
reader.readAsDataURL(f);
continue;
}
}
}
document.getElementById('mp3_upload_lc6').addEventListener('change', handleFileSelect6, false);
function handleFileSelect7(evt) {
var files = evt.target.files; // FileList object
// Loop through the FileList and render image files as thumbnails.
for (var i = 0, f; f = files[i]; i++) {
// Only process image files.
if(f.type.match('audio.*')){
var reader = new FileReader();
reader.onload =(function(theFile){
return function(e) {
var span = document.createElement('span');
span.innerHTML = ['<audio controls><source src="', e.target.result,' "type="audio/ogg"><source src="', e.target.result,' "type="audio/mpeg"></audio>'].join('');
document.getElementById('mp3_holder_sp1').insertBefore(span, null);
}
})(f);
reader.readAsDataURL(f);
continue;
}
}
}
document.getElementById('mp3_upload_sp1').addEventListener('change', handleFileSelect7, false);
function handleFileSelect8(evt) {
var files = evt.target.files; // FileList object
// Loop through the FileList and render image files as thumbnails.
for (var i = 0, f; f = files[i]; i++) {
// Only process image files.
if(f.type.match('audio.*')){
var reader = new FileReader();
reader.onload =(function(theFile){
return function(e) {
var span = document.createElement('span');
span.innerHTML = ['<audio controls><source src="', e.target.result,' "type="audio/ogg"><source src="', e.target.result,' "type="audio/mpeg"></audio>'].join('');
document.getElementById('mp3_holder_sp2').insertBefore(span, null);
}
})(f);
reader.readAsDataURL(f);
continue;
}
}
}
document.getElementById('mp3_upload_sp2').addEventListener('change', handleFileSelect8, false);
function handleFileSelect9(evt) {
var files = evt.target.files; // FileList object
// Loop through the FileList and render image files as thumbnails.
for (var i = 0, f; f = files[i]; i++) {
// Only process image files.
if(f.type.match('audio.*')){
var reader = new FileReader();
reader.onload =(function(theFile){
return function(e) {
var span = document.createElement('span');
span.innerHTML = ['<audio controls><source src="', e.target.result,' "type="audio/ogg"><source src="', e.target.result,' "type="audio/mpeg"></audio>'].join('');
document.getElementById('mp3_holder_sp3').insertBefore(span, null);
}
})(f);
reader.readAsDataURL(f);
continue;
}
}
}
document.getElementById('mp3_upload_sp3').addEventListener('change', handleFileSelect9, false);
function handleFileSelect10(evt) {
var files = evt.target.files; // FileList object
// Loop through the FileList and render image files as thumbnails.
for (var i = 0, f; f = files[i]; i++) {
// Only process image files.
if(f.type.match('audio.*')){
var reader = new FileReader();
reader.onload =(function(theFile){
return function(e) {
var span = document.createElement('span');
span.innerHTML = ['<audio controls><source src="', e.target.result,' "type="audio/ogg"><source src="', e.target.result,' "type="audio/mpeg"></audio>'].join('');
document.getElementById('mp3_holder_sp4').insertBefore(span, null);
}
})(f);
reader.readAsDataURL(f);
continue;
}
}
}
document.getElementById('mp3_upload_sp4').addEventListener('change', handleFileSelect10, false);
function handleFileSelect11(evt) {
var files = evt.target.files; // FileList object
// Loop through the FileList and render image files as thumbnails.
for (var i = 0, f; f = files[i]; i++) {
// Only process image files.
if(f.type.match('audio.*')){
var reader = new FileReader();
reader.onload =(function(theFile){
return function(e) {
var span = document.createElement('span');
span.innerHTML = ['<audio controls><source src="', e.target.result,' "type="audio/ogg"><source src="', e.target.result,' "type="audio/mpeg"></audio>'].join('');
document.getElementById('mp3_holder_sp5').insertBefore(span, null);
}
})(f);
reader.readAsDataURL(f);
continue;
}
}
}
document.getElementById('mp3_upload_sp5').addEventListener('change', handleFileSelect11, false);
function handleFileSelect12(evt) {
var files = evt.target.files; // FileList object
// Loop through the FileList and render image files as thumbnails.
for (var i = 0, f; f = files[i]; i++) {
// Only process image files.
if(f.type.match('audio.*')){
var reader = new FileReader();
reader.onload =(function(theFile){
return function(e) {
var span = document.createElement('span');
span.innerHTML = ['<audio controls><source src="', e.target.result,' "type="audio/ogg"><source src="', e.target.result,' "type="audio/mpeg"></audio>'].join('');
document.getElementById('mp3_holder_sp6').insertBefore(span, null);
}
})(f);
reader.readAsDataURL(f);
continue;
}
}
};
document.getElementById('mp3_upload_sp6').addEventListener('change', handleFileSelect12, false);
function handleFileSelect13(evt) {
var files = evt.target.files; // FileList object
// Loop through the FileList and render image files as thumbnails.
for (var i = 0, f; f = files[i]; i++) {
// Only process image files.
if(f.type.match('audio.*')){
var reader = new FileReader();
reader.onload =(function(theFile){
return function(e) {
var span = document.createElement('span');
span.innerHTML = ['<audio controls><source src="', e.target.result,' "type="audio/ogg"><source src="', e.target.result,' "type="audio/mpeg"></audio>'].join('');
document.getElementById('mp3_holder_wr1').insertBefore(span, null);
}
})(f);
reader.readAsDataURL(f);
continue;
}
}
};
document.getElementById('mp3_upload_wr1').addEventListener('change', handleFileSelect13, false);
}); | 30.899784 | 169 | 0.496949 |
15e7a2d32955de1cfd8f25bd6f7311488beabfb8 | 861 | js | JavaScript | client/src/components/quiz/timer/Timer.js | JeffKersting/Trivia-Bite | ba18e9a6a7f666892ddc86291f4deab80c25e359 | [
"MIT"
] | null | null | null | client/src/components/quiz/timer/Timer.js | JeffKersting/Trivia-Bite | ba18e9a6a7f666892ddc86291f4deab80c25e359 | [
"MIT"
] | 1 | 2021-07-12T16:58:18.000Z | 2021-07-12T16:59:06.000Z | client/src/components/quiz/timer/Timer.js | JeffKersting/Trivia-Bite | ba18e9a6a7f666892ddc86291f4deab80c25e359 | [
"MIT"
] | null | null | null | import { useState, useEffect } from 'react'
function Timer({ calculateScore }) {
let [timer, setTimer] = useState(90)
let time = 90
/*
Recursive function counts down initial time given, with a conditional check
to end the quiz when time runs out
*/
const updateTimer = () => {
time -= 1
setTimer(time)
if (time === 0) {
calculateScore(1)
} else {
setTimeout(() => updateTimer(), 1000)
}
}
/*
Use effect initally calls recursive updateTimer function,
and calls calculateScore (Quiz.js) on component unmount.
*/
useEffect(() => {
updateTimer()
return () => calculateScore(time)
}, [])
return (
<>
<div className='timer-container'>
<div className='timer' style={{
width: `${timer/90 * 100}%`
}}/>
</div>
</>
)
}
export default Timer
| 20.5 | 79 | 0.579559 |
15e7d6959d558d890071e46d797d1d689367e586 | 10,255 | js | JavaScript | front_end/timeline/TimelineDetailsView.js | j-paulino/devtools-frontend | 9cc36a0d3c18216900a81c97c4a73df8ceae113d | [
"BSD-3-Clause"
] | null | null | null | front_end/timeline/TimelineDetailsView.js | j-paulino/devtools-frontend | 9cc36a0d3c18216900a81c97c4a73df8ceae113d | [
"BSD-3-Clause"
] | null | null | null | front_end/timeline/TimelineDetailsView.js | j-paulino/devtools-frontend | 9cc36a0d3c18216900a81c97c4a73df8ceae113d | [
"BSD-3-Clause"
] | null | null | null | // Copyright 2017 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.
/**
* @unrestricted
*/
Timeline.TimelineDetailsView = class extends UI.VBox {
/**
* @param {!Timeline.TimelineModeViewDelegate} delegate
*/
constructor(delegate) {
super();
this.element.classList.add('timeline-details');
this._detailsLinkifier = new Components.Linkifier();
this._badgePool = new ProductRegistry.BadgePool();
this._badgePool.setShowTitles(true);
this._tabbedPane = new UI.TabbedPane();
this._tabbedPane.show(this.element);
const tabIds = Timeline.TimelineDetailsView.Tab;
this._defaultDetailsWidget = new UI.VBox();
this._defaultDetailsWidget.element.classList.add('timeline-details-view');
this._defaultDetailsContentElement =
this._defaultDetailsWidget.element.createChild('div', 'timeline-details-view-body vbox');
this._defaultDetailsContentElement.tabIndex = 0;
this._appendTab(tabIds.Details, Common.UIString('Summary'), this._defaultDetailsWidget);
this.setPreferredTab(tabIds.Details);
/** @type Map<string, Timeline.TimelineTreeView> */
this._rangeDetailViews = new Map();
const bottomUpView = new Timeline.BottomUpTimelineTreeView();
this._appendTab(tabIds.BottomUp, Common.UIString('Bottom-Up'), bottomUpView);
this._rangeDetailViews.set(tabIds.BottomUp, bottomUpView);
const callTreeView = new Timeline.CallTreeTimelineTreeView();
this._appendTab(tabIds.CallTree, Common.UIString('Call Tree'), callTreeView);
this._rangeDetailViews.set(tabIds.CallTree, callTreeView);
const eventsView = new Timeline.EventsTimelineTreeView(delegate);
this._appendTab(tabIds.EventLog, Common.UIString('Event Log'), eventsView);
this._rangeDetailViews.set(tabIds.EventLog, eventsView);
this._tabbedPane.addEventListener(UI.TabbedPane.Events.TabSelected, this._tabSelected, this);
}
/**
* @param {?Timeline.PerformanceModel} model
* @param {?TimelineModel.TimelineModel.Track} track
*/
setModel(model, track) {
if (this._model !== model) {
if (this._model) {
this._model.removeEventListener(Timeline.PerformanceModel.Events.WindowChanged, this._onWindowChanged, this);
}
this._model = model;
if (this._model) {
this._model.addEventListener(Timeline.PerformanceModel.Events.WindowChanged, this._onWindowChanged, this);
}
}
this._track = track;
this._tabbedPane.closeTabs(
[Timeline.TimelineDetailsView.Tab.PaintProfiler, Timeline.TimelineDetailsView.Tab.LayerViewer], false);
for (const view of this._rangeDetailViews.values()) {
view.setModel(model, track);
}
this._lazyPaintProfilerView = null;
this._lazyLayersView = null;
this.setSelection(null);
}
/**
* @param {!Node} node
*/
_setContent(node) {
const allTabs = this._tabbedPane.otherTabs(Timeline.TimelineDetailsView.Tab.Details);
for (let i = 0; i < allTabs.length; ++i) {
if (!this._rangeDetailViews.has(allTabs[i])) {
this._tabbedPane.closeTab(allTabs[i]);
}
}
this._defaultDetailsContentElement.removeChildren();
this._defaultDetailsContentElement.appendChild(node);
}
_updateContents() {
const view = this._rangeDetailViews.get(this._tabbedPane.selectedTabId || '');
if (view) {
const window = this._model.window();
view.updateContents(this._selection || Timeline.TimelineSelection.fromRange(window.left, window.right));
}
}
/**
* @param {string} id
* @param {string} tabTitle
* @param {!UI.Widget} view
* @param {boolean=} isCloseable
*/
_appendTab(id, tabTitle, view, isCloseable) {
this._tabbedPane.appendTab(id, tabTitle, view, undefined, undefined, isCloseable);
if (this._preferredTabId !== this._tabbedPane.selectedTabId) {
this._tabbedPane.selectTab(id);
}
}
/**
* @return {!Element}
*/
headerElement() {
return this._tabbedPane.headerElement();
}
/**
* @param {string} tabId
*/
setPreferredTab(tabId) {
this._preferredTabId = tabId;
}
/**
* @param {!Common.Event} event
*/
_onWindowChanged(event) {
if (!this._selection) {
this._updateContentsFromWindow();
}
}
_updateContentsFromWindow() {
if (!this._model) {
this._setContent(UI.html`<div/>`);
return;
}
const window = this._model.window();
this._updateSelectedRangeStats(window.left, window.right);
this._updateContents();
}
/**
* @param {?Timeline.TimelineSelection} selection
*/
setSelection(selection) {
this._detailsLinkifier.reset();
this._badgePool.reset();
this._selection = selection;
if (!this._selection) {
this._updateContentsFromWindow();
return;
}
switch (this._selection.type()) {
case Timeline.TimelineSelection.Type.TraceEvent:
const event = /** @type {!SDK.TracingModel.Event} */ (this._selection.object());
Timeline.TimelineUIUtils
.buildTraceEventDetails(event, this._model.timelineModel(), this._detailsLinkifier, this._badgePool, true)
.then(fragment => this._appendDetailsTabsForTraceEventAndShowDetails(event, fragment));
break;
case Timeline.TimelineSelection.Type.Frame:
const frame = /** @type {!TimelineModel.TimelineFrame} */ (this._selection.object());
const filmStripFrame = this._model.filmStripModelFrame(frame);
this._setContent(Timeline.TimelineUIUtils.generateDetailsContentForFrame(frame, filmStripFrame));
if (frame.layerTree) {
const layersView = this._layersView();
layersView.showLayerTree(frame.layerTree);
if (!this._tabbedPane.hasTab(Timeline.TimelineDetailsView.Tab.LayerViewer)) {
this._appendTab(Timeline.TimelineDetailsView.Tab.LayerViewer, Common.UIString('Layers'), layersView);
}
}
break;
case Timeline.TimelineSelection.Type.NetworkRequest:
const request = /** @type {!TimelineModel.TimelineModel.NetworkRequest} */ (this._selection.object());
Timeline.TimelineUIUtils
.buildNetworkRequestDetails(request, this._model.timelineModel(), this._detailsLinkifier, this._badgePool)
.then(this._setContent.bind(this));
break;
case Timeline.TimelineSelection.Type.Range:
this._updateSelectedRangeStats(this._selection.startTime(), this._selection.endTime());
break;
}
this._updateContents();
}
/**
* @param {!Common.Event} event
*/
_tabSelected(event) {
if (!event.data.isUserGesture) {
return;
}
this.setPreferredTab(event.data.tabId);
this._updateContents();
}
/**
* @return {!UI.Widget}
*/
_layersView() {
if (this._lazyLayersView) {
return this._lazyLayersView;
}
this._lazyLayersView =
new Timeline.TimelineLayersView(this._model.timelineModel(), this._showSnapshotInPaintProfiler.bind(this));
return this._lazyLayersView;
}
/**
* @return {!Timeline.TimelinePaintProfilerView}
*/
_paintProfilerView() {
if (this._lazyPaintProfilerView) {
return this._lazyPaintProfilerView;
}
this._lazyPaintProfilerView = new Timeline.TimelinePaintProfilerView(this._model.frameModel());
return this._lazyPaintProfilerView;
}
/**
* @param {!SDK.PaintProfilerSnapshot} snapshot
*/
_showSnapshotInPaintProfiler(snapshot) {
const paintProfilerView = this._paintProfilerView();
paintProfilerView.setSnapshot(snapshot);
if (!this._tabbedPane.hasTab(Timeline.TimelineDetailsView.Tab.PaintProfiler)) {
this._appendTab(
Timeline.TimelineDetailsView.Tab.PaintProfiler, Common.UIString('Paint Profiler'), paintProfilerView, true);
}
this._tabbedPane.selectTab(Timeline.TimelineDetailsView.Tab.PaintProfiler, true);
}
/**
* @param {!SDK.TracingModel.Event} event
* @param {!Node} content
*/
_appendDetailsTabsForTraceEventAndShowDetails(event, content) {
this._setContent(content);
if (event.name === TimelineModel.TimelineModel.RecordType.Paint ||
event.name === TimelineModel.TimelineModel.RecordType.RasterTask) {
this._showEventInPaintProfiler(event);
}
}
/**
* @param {!SDK.TracingModel.Event} event
*/
_showEventInPaintProfiler(event) {
const paintProfilerModel = SDK.targetManager.models(SDK.PaintProfilerModel)[0];
if (!paintProfilerModel) {
return;
}
const paintProfilerView = this._paintProfilerView();
const hasProfileData = paintProfilerView.setEvent(paintProfilerModel, event);
if (!hasProfileData) {
return;
}
if (this._tabbedPane.hasTab(Timeline.TimelineDetailsView.Tab.PaintProfiler)) {
return;
}
this._appendTab(
Timeline.TimelineDetailsView.Tab.PaintProfiler, Common.UIString('Paint Profiler'), paintProfilerView);
}
/**
* @param {number} startTime
* @param {number} endTime
*/
_updateSelectedRangeStats(startTime, endTime) {
if (!this._model || !this._track) {
return;
}
const aggregatedStats = Timeline.TimelineUIUtils.statsForTimeRange(this._track.syncEvents(), startTime, endTime);
const startOffset = startTime - this._model.timelineModel().minimumRecordTime();
const endOffset = endTime - this._model.timelineModel().minimumRecordTime();
const contentHelper = new Timeline.TimelineDetailsContentHelper(null, null);
contentHelper.addSection(
ls`Range: ${Number.millisToString(startOffset)} \u2013 ${Number.millisToString(endOffset)}`);
const pieChart = Timeline.TimelineUIUtils.generatePieChart(aggregatedStats);
contentHelper.appendElementRow('', pieChart);
this._setContent(contentHelper.fragment);
}
};
/**
* @enum {string}
*/
Timeline.TimelineDetailsView.Tab = {
Details: 'Details',
EventLog: 'EventLog',
CallTree: 'CallTree',
BottomUp: 'BottomUp',
PaintProfiler: 'PaintProfiler',
LayerViewer: 'LayerViewer'
};
Timeline.TimelineDetailsView.RankingsView = class extends UI.VBox {
constructor(delegate) {
super();
this.element.classList.add('timeline-rankings');
}
};
| 33.513072 | 118 | 0.696148 |
15e8f7dcc09823b9c0cd07c3418fcc8d42dc4c55 | 1,262 | js | JavaScript | client/components/admin/AllUsers.js | BIL-WI-THE-SCIENCE-FI/GraceShopper | 284303788ba89b870a6437d11fda0e7ce9c98446 | [
"MIT"
] | null | null | null | client/components/admin/AllUsers.js | BIL-WI-THE-SCIENCE-FI/GraceShopper | 284303788ba89b870a6437d11fda0e7ce9c98446 | [
"MIT"
] | 36 | 2021-09-20T20:09:22.000Z | 2021-09-29T14:14:25.000Z | client/components/admin/AllUsers.js | BIL-WI-THE-SCIENCE-FI/GraceShopper | 284303788ba89b870a6437d11fda0e7ce9c98446 | [
"MIT"
] | null | null | null | import React, { useEffect } from 'react'
import { useDispatch, useSelector } from 'react-redux'
import SimpleBar from 'simplebar-react'
import 'simplebar/dist/simplebar.min.css'
import { fetchUsers } from '../../store/ActionsCreators/userActions'
import UserCard from '../admin/UserCard'
//* This is the component that should render when an admin types /users
//* It will allow them to view all individual users
export default function ViewUsers() {
const isLoggedIn = useSelector(state => state.auth.id)
const dispatch = useDispatch()
const token = window.localStorage.getItem('token')
useEffect(() => {
//* fetch data
async function fetchData() {
await dispatch(fetchUsers(token))
}
fetchData()
}, [])
const usersInView = useSelector(state => state.user.users)
return (
<div className="product-page">
<div className="product-container">
<SimpleBar className="product-scroll">
<div className="products-container">
{usersInView !== undefined && usersInView.length > 0 ? (
usersInView.map(user => <UserCard key={user.id} user={user} />)
) : (
<p>Loading...</p>
)}
</div>
</SimpleBar>
</div>
</div>
)
}
| 31.55 | 77 | 0.63233 |
15e9d38a541643e4d01ea551c827ce161e9f9e0b | 2,028 | js | JavaScript | web/pdf_viewer.component.js | polar-app/pdf.js | 890277104c4220c26cf6f38ad4b4c83d1791b724 | [
"Apache-2.0"
] | null | null | null | web/pdf_viewer.component.js | polar-app/pdf.js | 890277104c4220c26cf6f38ad4b4c83d1791b724 | [
"Apache-2.0"
] | null | null | null | web/pdf_viewer.component.js | polar-app/pdf.js | 890277104c4220c26cf6f38ad4b4c83d1791b724 | [
"Apache-2.0"
] | null | null | null | /* Copyright 2014 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
AnnotationLayerBuilder,
DefaultAnnotationLayerFactory,
} from "./annotation_layer_builder.js";
import {
DefaultTextLayerFactory,
TextLayerBuilder,
} from "./text_layer_builder.js";
import { EventBus, ProgressBar } from "./ui_utils.js";
import { PDFLinkService, SimpleLinkService } from "./pdf_link_service.js";
import { DownloadManager } from "./download_manager.js";
import { GenericL10n } from "./genericl10n.js";
import { NullL10n } from "./l10n_utils.js";
import { PDFFindController } from "./pdf_find_controller.js";
import { PDFHistory } from "./pdf_history.js";
import { PDFPageView } from "./pdf_page_view.js";
import { PDFScriptingManager } from "./pdf_scripting_manager.js";
import { PDFRenderingQueue } from "./pdf_rendering_queue.js";
import { PDFSinglePageViewer } from "./pdf_single_page_viewer.js";
import { PDFViewer } from "./pdf_viewer.js";
// eslint-disable-next-line no-unused-vars
const pdfjsVersion = PDFJSDev.eval("BUNDLE_VERSION");
// eslint-disable-next-line no-unused-vars
const pdfjsBuild = PDFJSDev.eval("BUNDLE_BUILD");
export {
AnnotationLayerBuilder,
DefaultAnnotationLayerFactory,
DefaultTextLayerFactory,
DownloadManager,
EventBus,
GenericL10n,
NullL10n,
PDFFindController,
PDFHistory,
PDFLinkService,
PDFPageView,
PDFRenderingQueue,
PDFScriptingManager,
PDFSinglePageViewer,
PDFViewer,
ProgressBar,
SimpleLinkService,
TextLayerBuilder,
};
| 32.709677 | 75 | 0.758383 |
15e9dec6e4c425b70da877d9ec6a649226abdf37 | 3,074 | js | JavaScript | test/katagoconv.test.js | jtraister/analyze-sgf | ceecd6e6037917c67744ca0dbe3ee49888c054cc | [
"MIT"
] | 12 | 2021-02-16T11:05:48.000Z | 2021-12-04T01:31:48.000Z | test/katagoconv.test.js | jtraister/analyze-sgf | ceecd6e6037917c67744ca0dbe3ee49888c054cc | [
"MIT"
] | 12 | 2021-02-20T23:08:30.000Z | 2021-11-24T15:20:39.000Z | test/katagoconv.test.js | jtraister/analyze-sgf | ceecd6e6037917c67744ca0dbe3ee49888c054cc | [
"MIT"
] | 2 | 2021-05-18T03:30:04.000Z | 2021-05-30T17:34:16.000Z | /* eslint max-lines: ["error", 300] */
const fs = require('fs');
const assert = require('assert');
const katagoconv = require('../src/katagoconv');
const sgfconv = require('../src/sgfconv');
describe('seqFromKataGoMoveInfo', () => {
it('should be expected values.', () => {
const moveInfo = { pv: ['A1', 'B2', 'C3'] };
assert.equal(
katagoconv.seqFromKataGoMoveInfo('W', moveInfo),
'(;W[aa];B[bb];W[cc])',
);
assert.equal(
katagoconv.seqFromKataGoMoveInfo('B', moveInfo),
'(;B[aa];W[bb];B[cc])',
);
});
});
describe('initialStonesFromRoot', () => {
it('should return valid initialStones.', () => {
const rs = sgfconv.rootAndSeqFromSGF(
'(HA[2]AB[aa][bb]AW[ab][cc];W[po];B[hm]TE[1])',
);
assert.deepEqual(katagoconv.initialStonesFromRoot(rs.root), [
['B', 'A1'],
['B', 'B2'],
['W', 'A2'],
['W', 'C3'],
]);
});
it('should return empty initialStones.', () => {
const rs = sgfconv.rootAndSeqFromSGF('(HA[2];B[hm]TE[1])');
assert.deepEqual(katagoconv.initialStonesFromRoot(rs.root), []);
});
});
describe('seqToKataGoMoves', () => {
it('should be expected values.', () => {
assert.deepEqual(
katagoconv.seqToKataGoMoves(
'(...HA[2]AB[dp][pd];W[po];B[hm]TE[1];W[ae]IT[])',
),
[
['W', 'Q15'],
['B', 'H13'],
['W', 'A5'],
],
);
assert.deepEqual(
katagoconv.seqToKataGoMoves(
'(...HA[2]AB[dp][pd];W[po];B[hm]TE[1];W[]IT[])',
),
[
['W', 'Q15'],
['B', 'H13'],
],
);
});
it('should be expected values for "W W" sequence.', () => {
assert.deepEqual(katagoconv.seqToKataGoMoves('(;W[po];W[hm]TE[1];W[])'), [
['W', 'Q15'],
['W', 'H13'],
]);
});
it('should be expected values for "[tt]" node.', () => {
assert.deepEqual(katagoconv.seqToKataGoMoves('(;W[po];B[tt])', 19), [
['W', 'Q15'],
]);
});
});
describe('seqToKataGoMoves with SGF files', () => {
it('should return expected move counts for all "examples/t-*".', () => {
const movesfromseq = (len, path) => {
const sgf = fs.readFileSync(path).toString();
const moves = katagoconv.seqToKataGoMoves(sgfconv.removeTails(sgf));
assert.equal(len, moves.length);
};
movesfromseq(11, 'test/examples/t-complex.sgf');
movesfromseq(18, 'test/examples/t-encoding-cp949.sgf');
movesfromseq(294, 'test/examples/t-oro-1.sgf');
movesfromseq(226, 'test/examples/t-oro-2.sgf');
movesfromseq(3, 'test/examples/t-sabaki-1.sgf');
movesfromseq(4, 'test/examples/t-sabaki-2.sgf');
});
});
describe('makeRealTurnNumbersMap', () => {
it('should be expected values.', () => {
assert.deepEqual(
katagoconv.makeRealTurnNumbersMap(';B[aa];W[];B[];B[bb]'),
[0, 1, 4],
);
assert.deepEqual(
katagoconv.makeRealTurnNumbersMap(';B[aa];W[tt];B[];B[bb]'),
[0, 1, 4],
);
assert.deepEqual(
katagoconv.makeRealTurnNumbersMap(';B[];W[tt];B[cc];B[bb]'),
[0, 3, 4],
);
});
});
| 28.201835 | 78 | 0.545218 |
15ea4d5826ee97686821ca298d683d1fea75ac70 | 4,419 | js | JavaScript | src/commands/sync-files.js | knownorigin/ipfs-sync | 2e4e2b54c4b696473c478532256ca283d5291df2 | [
"MIT"
] | null | null | null | src/commands/sync-files.js | knownorigin/ipfs-sync | 2e4e2b54c4b696473c478532256ca283d5291df2 | [
"MIT"
] | null | null | null | src/commands/sync-files.js | knownorigin/ipfs-sync | 2e4e2b54c4b696473c478532256ca283d5291df2 | [
"MIT"
] | null | null | null | const fs = require('fs')
const chalk = require('chalk')
const ipfs = require('../ipfs')
const batchPromises = require('batch-promises')
const collectUnsyncedFiles = async ({ fromClient, toClient, skipExisting, fileList }) => {
let fromPinnedFiles = fileList ? fileList : await fromClient.pin.ls()
// If --skip-existing is provided, we obtain a list of all pinned files from
// the target node. If not, we assume none of the source files exist on the
// target node yet.
if (skipExisting) {
let toPinnedFiles = await toClient.pin.ls()
return fromPinnedFiles.filter(
sourceFile =>
!toPinnedFiles.find(targetFile => sourceFile.hash === targetFile.hash),
)
} else {
return fromPinnedFiles
}
}
const HELP = `
${chalk.bold('ipfs-sync sync-files')} [options]
${chalk.dim('Options:')}
-h, --help Show usage information
--from <URL> Source IPFS node
--to <URL> Target IPFS node
--file-list <FILE> File with one IPFS hash to sync per line
--skip-existing Skip files that already exist on the target IPFS node
`
module.exports = {
description: 'Syncs files from one IPFS node to another',
run: async toolbox => {
let { print } = toolbox
// Parse CLI parameters
let { h, help, from, to, skipExisting, fileList } = toolbox.parameters.options
// Show help text if asked for
if (h || help) {
print.info(HELP)
return
}
if (!from || !to) {
print.info(HELP)
process.exitCode = 1
return
}
print.info(`Syncing files`)
print.info(`Source node (--from): ${from}`)
print.info(`Target node (--to): ${to}`)
let fromClient = ipfs.createIpfsClient(from)
let toClient = ipfs.createIpfsClient(to)
// Read file list from the `--list` file
fileList = fileList
? fs
.readFileSync(fileList, 'utf-8')
.trim()
.split('\n')
.map(hash => ({ hash }))
: undefined
// Obtain a list of all pinned files from both nodes
let unsyncedFiles = await collectUnsyncedFiles({
fromClient,
toClient,
fileList,
skipExisting,
})
print.info(`${unsyncedFiles.length} files need to be synced`)
if (unsyncedFiles.length > 0) {
print.info(`---`)
}
let syncResult = {
syncedFiles: [],
failedFiles: [],
skippedDirectories: [],
}
await batchPromises(
// Sync in batches of 10 files
10,
// Inject file indices
unsyncedFiles.map((file, index) => {
file.index = index
return file
}),
// Upload promise
async sourceFile => {
let totalFiles = unsyncedFiles.length
let label = `${sourceFile.index}/${totalFiles} (${sourceFile.hash})`
print.info(`${label}: Syncing`)
// Download file
print.info(`${label}: Retrieving file`)
let data
try {
data = await fromClient.cat(sourceFile.hash)
} catch (e) {
if (e.message.match('dag node is a directory')) {
print.info(`${label}: Skipping file: File is a directory`)
syncResult.skippedDirectories.push(sourceFile.hash)
} else {
print.warning(`${label}: Failed to retrieve file: ${e.message}`)
syncResult.failedFiles.push(sourceFile.hash)
}
return
}
// Upload file
print.info(`${label}: Uploading file`)
let targetFile
try {
targetFile = await toClient.add(data)
} catch (e) {
throw new Error(`${label}: Failed to upload file: ${e.message}`)
}
// Verify integrity before and after
if (sourceFile.hash === targetFile[0].hash) {
print.info(`${label}: File synced successfully`)
syncResult.syncedFiles.push(sourceFile.hash)
} else {
throw new Error(
`${label}: Failed to sync file: Uploaded file hash differs: ${targetFile[0].hash}`,
)
}
},
)
print.info(`---`)
print.info(`${syncResult.syncedFiles.length}/${unsyncedFiles.length} files synced`)
print.info(`${syncResult.skippedDirectories.length} skipped (directories)`)
print.info(`${syncResult.failedFiles.length} failed`)
if (syncResult.failedFiles.length > 0) {
process.exitCode = 1
}
},
}
| 29.264901 | 95 | 0.585653 |
15eaded93e455d99d3c18fd293b5dbbf5b7648af | 371 | js | JavaScript | public/javascript/testfetch.js | Team-Monogram/Reading-Rainbow | 96d3dcfe0ce3385e4e37f6330322b8bbd99729f1 | [
"MIT"
] | null | null | null | public/javascript/testfetch.js | Team-Monogram/Reading-Rainbow | 96d3dcfe0ce3385e4e37f6330322b8bbd99729f1 | [
"MIT"
] | 33 | 2021-01-16T07:24:48.000Z | 2021-01-17T11:42:15.000Z | public/javascript/testfetch.js | Team-Monogram/Reading-Rainbow | 96d3dcfe0ce3385e4e37f6330322b8bbd99729f1 | [
"MIT"
] | 1 | 2021-01-17T12:22:28.000Z | 2021-01-17T12:22:28.000Z | function test() {
let url = 'https://us-central1-reading-rainbow.cloudfunctions.net/stringer?url=https://www.royalroad.com/fiction/21220/mother-of-learning/chapter/455877/afterword';
fetch(url)
.then(response => response.text())
.then(contents => console.log(contents))
.catch(() => console.log("Can’t access " + url + " response. Blocked by browser?"))
} | 53 | 166 | 0.698113 |
15eaf3c7bccfb2d4f3ba01e02f0b2949f590db7c | 557 | js | JavaScript | src/index.js | FredyC/graphql.macro | c2b34a175af7ecb9b2d712b85b4a66d61b56d178 | [
"MIT"
] | null | null | null | src/index.js | FredyC/graphql.macro | c2b34a175af7ecb9b2d712b85b4a66d61b56d178 | [
"MIT"
] | null | null | null | src/index.js | FredyC/graphql.macro | c2b34a175af7ecb9b2d712b85b4a66d61b56d178 | [
"MIT"
] | null | null | null | // @flow
/* eslint no-unused-vars: 0 */
import { type DocumentNode } from 'graphql/language/ast';
export * from './utils/index';
export { default } from './macro';
/**
* Note: This is a workaround for flow type to work.
* The exposed functions are not been used in macro library.
*/
export type TemplateStringsArray = $ReadOnlyArray<string>;
export const loader = (filePath: string): DocumentNode => ({}: DocumentNode);
export const gql = (
taggedTemplateLiteral: TemplateStringsArray,
...placeholders: any[]
): DocumentNode => ({}: DocumentNode);
| 30.944444 | 77 | 0.70377 |
15eafa6aa6184925846573158349de84da9c9129 | 1,093 | js | JavaScript | tests/lib/rules/no-nested-ternary.js | victor-homyakov/eslint | d31f3370396ec4868722bdc044aa697b135ac183 | [
"MIT"
] | 3 | 2019-09-26T05:35:06.000Z | 2019-10-05T00:17:43.000Z | tests/lib/rules/no-nested-ternary.js | victor-homyakov/eslint | d31f3370396ec4868722bdc044aa697b135ac183 | [
"MIT"
] | null | null | null | tests/lib/rules/no-nested-ternary.js | victor-homyakov/eslint | d31f3370396ec4868722bdc044aa697b135ac183 | [
"MIT"
] | 1 | 2019-11-19T16:31:09.000Z | 2019-11-19T16:31:09.000Z | /**
* @fileoverview Tests for the no-nested-ternary rule
* @author Ian Christian Myers
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const rule = require("../../../lib/rules/no-nested-ternary"),
{ RuleTester } = require("../../../lib/rule-tester");
//------------------------------------------------------------------------------
// Tests
//------------------------------------------------------------------------------
const ruleTester = new RuleTester();
ruleTester.run("no-nested-ternary", rule, {
valid: [
"foo ? doBar() : doBaz();",
"var foo = bar === baz ? qux : quxx;"
],
invalid: [
{ code: "foo ? bar : baz === qux ? quxx : foobar;", errors: [{ message: "Do not nest ternary expressions.", type: "ConditionalExpression" }] },
{ code: "foo ? baz === qux ? quxx : foobar : bar;", errors: [{ message: "Do not nest ternary expressions.", type: "ConditionalExpression" }] }
]
});
| 35.258065 | 151 | 0.408051 |
15eb4459ca0deacfabec287451a6eeb71dd0e239 | 1,228 | js | JavaScript | src/data-table/__tests__/data-table-included-rows-change.scenario.js | fsilvaco/baseweb | 9fb30f53336d68b8718e98578808afd2f4bff0ec | [
"MIT"
] | 2,355 | 2018-08-14T17:34:04.000Z | 2019-10-10T15:09:04.000Z | src/data-table/__tests__/data-table-included-rows-change.scenario.js | fsilvaco/baseweb | 9fb30f53336d68b8718e98578808afd2f4bff0ec | [
"MIT"
] | 1,134 | 2018-08-13T21:49:37.000Z | 2019-10-10T16:00:35.000Z | src/data-table/__tests__/data-table-included-rows-change.scenario.js | uber/base-web | 54e1156adb42b280ef9908105f7bd59cab10aebb | [
"MIT"
] | 203 | 2018-08-15T06:28:08.000Z | 2019-10-09T18:33:43.000Z | /*
Copyright (c) Uber Technologies, Inc.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
// @flow
import * as React from 'react';
import { StatefulDataTable, BooleanColumn } from '../index.js';
type RowDataT = [boolean, string, number, string, Date];
const columns = [
BooleanColumn({
title: 'boolean-column',
mapDataToValue: (data: RowDataT) => data[0],
}),
];
const rows = [
{ id: 1, data: [true] },
{ id: 2, data: [false] },
{ id: 3, data: [true] },
{ id: 4, data: [false] },
];
export function Scenario() {
const [includedRows, setIncludedRows] = React.useState([]);
const handleIncludedRowsChange = React.useCallback(
(included) => {
setIncludedRows(included);
},
[setIncludedRows]
);
return (
<React.Fragment>
<div style={{ height: '400px', width: '600px', marginBottom: '10px' }}>
<StatefulDataTable
columns={columns}
rows={rows}
onIncludedRowsChange={handleIncludedRowsChange}
/>
</div>
<ul>
{includedRows.map((row) => (
<li key={row.id}>{row.id}</li>
))}
</ul>
</React.Fragment>
);
}
| 22.327273 | 77 | 0.593648 |
15eb4c9a9662524e449fc6e8deab6f872f18df54 | 6,066 | js | JavaScript | packages/zoe/test/unitTests/contracts/test-mintPayments.js | arirubinstein/agoric-sdk | c6148044cd6b3424fcbb8734cec1e15f03ee0d17 | [
"Apache-2.0"
] | 4 | 2019-11-02T17:15:28.000Z | 2019-11-02T21:32:18.000Z | packages/zoe/test/unitTests/contracts/test-mintPayments.js | arirubinstein/agoric-sdk | c6148044cd6b3424fcbb8734cec1e15f03ee0d17 | [
"Apache-2.0"
] | 1 | 2019-11-03T02:14:09.000Z | 2019-11-04T19:35:40.000Z | packages/zoe/test/unitTests/contracts/test-mintPayments.js | arirubinstein/agoric-sdk | c6148044cd6b3424fcbb8734cec1e15f03ee0d17 | [
"Apache-2.0"
] | null | null | null | // @ts-check
// eslint-disable-next-line import/no-extraneous-dependencies
import { test } from '@agoric/zoe/tools/prepare-test-env-ava.js';
import path from 'path';
import bundleSource from '@endo/bundle-source';
import { E } from '@endo/eventual-send';
import { makeIssuerKit, AmountMath } from '@agoric/ertp';
import { makeFakeVatAdmin } from '../../../tools/fakeVatAdmin.js';
import { makeZoeKit } from '../../../src/zoeService/zoe.js';
const filename = new URL(import.meta.url).pathname;
const dirname = path.dirname(filename);
const mintPaymentsRoot = `${dirname}/../../../src/contracts/mintPayments.js`;
test('zoe - mint payments', async t => {
t.plan(2);
const { admin: fakeVatAdmin, vatAdminState } = makeFakeVatAdmin();
const { zoeService: zoe } = makeZoeKit(fakeVatAdmin);
const makeAlice = () => {
return {
installCode: async () => {
// pack the contract
const bundle = await bundleSource(mintPaymentsRoot);
// install the contract
vatAdminState.installBundle('b1-mintpayments', bundle);
const installationP = E(zoe).installBundleID('b1-mintpayments');
return installationP;
},
startInstance: async installation => {
const adminP = E(zoe).startInstance(installation);
return adminP;
},
};
};
const makeBob = installation => {
return {
offer: async untrustedInvitation => {
const invitationIssuer = E(zoe).getInvitationIssuer();
const invitation = E(invitationIssuer).claim(untrustedInvitation);
const {
value: [invitationValue],
} = await E(invitationIssuer).getAmountOf(invitation);
t.is(
invitationValue.installation,
installation,
'installation is mintPayment',
);
const { instance } = invitationValue;
const seat = await E(zoe).offer(invitation);
const paymentP = E(seat).getPayout('Token');
// Let's get the tokenIssuer from the contract so we can evaluate
// what we get as our payout
const publicFacet = await E(zoe).getPublicFacet(instance);
const tokenIssuer = await E(publicFacet).getTokenIssuer();
const tokenBrand = await E(tokenIssuer).getBrand();
const tokens1000 = await AmountMath.make(tokenBrand, 1000n);
const tokenPayoutAmount = await E(tokenIssuer).getAmountOf(paymentP);
// Bob got 1000 tokens
t.deepEqual(tokenPayoutAmount, tokens1000);
},
};
};
// Setup Alice
const alice = await makeAlice();
const installation = await alice.installCode();
const { creatorFacet } = await E(alice).startInstance(installation);
const invitation = E(creatorFacet).makeInvitation(1000n);
// Setup Bob
const bob = makeBob(installation);
await bob.offer(invitation);
});
test('zoe - mint payments with unrelated give and want', async t => {
t.plan(3);
const { admin: fakeVatAdmin, vatAdminState } = makeFakeVatAdmin();
const { zoeService: zoe } = makeZoeKit(fakeVatAdmin);
const moolaKit = makeIssuerKit('moola');
const simoleanKit = makeIssuerKit('simolean');
const makeAlice = () => {
return {
installCode: async () => {
// pack the contract
const bundle = await bundleSource(mintPaymentsRoot);
// install the contract
vatAdminState.installBundle('b1-mintpayments', bundle);
const installationP = E(zoe).installBundleID('b1-mintpayments');
return installationP;
},
startInstance: async installation => {
const issuerKeywordRecord = harden({
Asset: moolaKit.issuer,
Price: simoleanKit.issuer,
});
const adminP = await E(zoe).startInstance(
installation,
issuerKeywordRecord,
);
return adminP;
},
};
};
const makeBob = (installation, moolaPayment) => {
return {
offer: async untrustedInvitation => {
const invitationIssuer = E(zoe).getInvitationIssuer();
const invitation = E(invitationIssuer).claim(untrustedInvitation);
const {
value: [invitationValue],
} = await E(invitationIssuer).getAmountOf(invitation);
t.is(
invitationValue.installation,
installation,
'installation is mintPayment',
);
const { instance } = invitationValue;
const proposal = harden({
give: { Asset: AmountMath.make(moolaKit.brand, 10n) },
want: { Price: AmountMath.make(simoleanKit.brand, 100n) },
});
const paymentKeywordRecord = harden({
Asset: moolaPayment,
});
const seat = await E(zoe).offer(
invitation,
proposal,
paymentKeywordRecord,
);
const tokenPaymentP = E(seat).getPayout('Token');
const moolaRefundP = E(seat).getPayout('Asset');
// Let's get the tokenIssuer from the contract so we can evaluate
// what we get as our payout
const publicFacet = await E(zoe).getPublicFacet(instance);
const tokenIssuer = await E(publicFacet).getTokenIssuer();
const tokenBrand = await E(tokenIssuer).getBrand();
const tokens1000 = await AmountMath.make(tokenBrand, 1000n);
const tokenPayoutAmount = await E(tokenIssuer).getAmountOf(
tokenPaymentP,
);
// Bob got 1000 tokens
t.deepEqual(tokenPayoutAmount, tokens1000);
// Got refunded all the moola given
t.deepEqual(
await E(moolaKit.issuer).getAmountOf(moolaRefundP),
AmountMath.make(moolaKit.brand, 10n),
);
},
};
};
// Setup Alice
const alice = await makeAlice();
const installation = await alice.installCode();
const { creatorFacet } = await E(alice).startInstance(installation);
const invitation = E(creatorFacet).makeInvitation(1000n);
// Setup Bob
const bob = makeBob(
installation,
moolaKit.mint.mintPayment(AmountMath.make(moolaKit.brand, 10n)),
);
await bob.offer(invitation);
});
| 31.926316 | 77 | 0.635345 |
15ec58d545e316c393cf9b489dcccfaca7b250b7 | 681 | js | JavaScript | src/components/common/ListHeader/ListHeader.js | saiforceone/SARestaurantApp | a028cdbff9a6d7ec8226378eef069b5ad2ef3b18 | [
"MIT"
] | 2 | 2022-01-23T03:50:38.000Z | 2022-02-09T04:48:07.000Z | src/components/common/ListHeader/ListHeader.js | saiforceone/SARestaurantApp | a028cdbff9a6d7ec8226378eef069b5ad2ef3b18 | [
"MIT"
] | null | null | null | src/components/common/ListHeader/ListHeader.js | saiforceone/SARestaurantApp | a028cdbff9a6d7ec8226378eef069b5ad2ef3b18 | [
"MIT"
] | null | null | null | import PropTypes from 'prop-types';
import React from 'react';
import {ActivityIndicator, View} from 'react-native';
import {Text} from 'react-native';
import ListHeaderStyles from './ListHeader.styles';
import {COLORS} from '../../../constants/styleConstants';
const ListHeader = props => {
const {isLoading, title} = props;
return (
<View style={ListHeaderStyles.container}>
<Text style={ListHeaderStyles.title}>{title}</Text>
{isLoading && (<ActivityIndicator animating color={COLORS.OFFWHITE} size={'large'} />)}
</View>
);
};
ListHeader.propTypes = {
title: PropTypes.string.isRequired,
isLoading: PropTypes.bool,
};
export default ListHeader; | 29.608696 | 93 | 0.704846 |
15ec83ca7da1a047438bde8e5e2ebf064540d30e | 90 | js | JavaScript | db.js | flynsequeira/car-management-server | 7b34931f44ff25a0290bcaf610639b9408a2f774 | [
"MIT"
] | null | null | null | db.js | flynsequeira/car-management-server | 7b34931f44ff25a0290bcaf610639b9408a2f774 | [
"MIT"
] | null | null | null | db.js | flynsequeira/car-management-server | 7b34931f44ff25a0290bcaf610639b9408a2f774 | [
"MIT"
] | null | null | null | // DB.js
module.exports = {
DB: 'mongodb://localhost:27017/vehicles-management'
};
| 12.857143 | 55 | 0.644444 |
15ec8b188e5b49e75a028b3a3238a74429ada599 | 265 | js | JavaScript | docs/assets/js/2a04dc65.63b41181.js | svjl/bigdata-arch | 71a0b60f3b0e79af1c98e9843d2719ab0c1aa89a | [
"MIT"
] | null | null | null | docs/assets/js/2a04dc65.63b41181.js | svjl/bigdata-arch | 71a0b60f3b0e79af1c98e9843d2719ab0c1aa89a | [
"MIT"
] | null | null | null | docs/assets/js/2a04dc65.63b41181.js | svjl/bigdata-arch | 71a0b60f3b0e79af1c98e9843d2719ab0c1aa89a | [
"MIT"
] | null | null | null | (self.webpackChunkbigdata=self.webpackChunkbigdata||[]).push([[242],{6545:function(a){"use strict";a.exports=JSON.parse('{"allTagsPath":"/bigdata-arch/blog/tags","slug":"greetings","name":"greetings","count":1,"permalink":"/bigdata-arch/blog/tags/greetings"}')}}]); | 265 | 265 | 0.720755 |
15ecb6a7a071c0f8ebdaa231017fe979732bb551 | 1,776 | js | JavaScript | components/dropdown/DropdownMenu.js | JeanOUINA/shards-react | 1e88d12c6563f4dd79c7742128350300725bc0fe | [
"MIT"
] | null | null | null | components/dropdown/DropdownMenu.js | JeanOUINA/shards-react | 1e88d12c6563f4dd79c7742128350300725bc0fe | [
"MIT"
] | null | null | null | components/dropdown/DropdownMenu.js | JeanOUINA/shards-react | 1e88d12c6563f4dd79c7742128350300725bc0fe | [
"MIT"
] | null | null | null | import React from "react";
import classNames from "classnames";
import { Popper } from "react-popper";
import { DropdownContext } from "./DropdownContext";
import { DROPDOWN_POSITION_MAP } from "../constants";
class DropdownMenu extends React.Component {
render() {
const {
className,
children,
right,
tag: Tag,
flip,
small,
modifiers,
persist,
...attrs
} = this.props;
const classes = classNames(
className,
"dropdown-menu",
small && "dropdown-menu-small",
right && "dropdown-menu-right",
this.context.open && "show"
);
if (persist || (this.context.open && !this.context.inNavbar)) {
const pos1 =
DROPDOWN_POSITION_MAP[this.context.direction.toUpperCase()] || "bottom";
const pos2 = right ? "end" : "start";
attrs.placement = `${pos1}-${pos2}`;
attrs.component = Tag;
attrs.modifiers = !flip
? {
...modifiers,
...{
flip: {
enabled: false
}
}
}
: modifiers;
return (
<Popper {...attrs}>
{({ ref, placement }) => (
<div
ref={ref}
className={classes}
x-placement={placement}
aria-hidden={!this.context.open}
tabIndex="-1"
role="menu"
>
{children}
</div>
)}
</Popper>
);
}
return (
<Tag tabIndex="-1" role="menu" {...attrs} className={classes}>
{children}
</Tag>
);
}
}
DropdownMenu.defaultProps = {
tag: "div",
flip: true
};
DropdownMenu.contextType = DropdownContext;
export default DropdownMenu;
| 21.658537 | 80 | 0.502815 |
15ee122f986086c3659a44c000c9a6fe2457a27a | 8,276 | js | JavaScript | packages/react-relay/ReactRelayFragmentContainer.js | jstejada/relay | 751fa14f2a6e45e921af343172f500270d47ef00 | [
"MIT"
] | null | null | null | packages/react-relay/ReactRelayFragmentContainer.js | jstejada/relay | 751fa14f2a6e45e921af343172f500270d47ef00 | [
"MIT"
] | null | null | null | packages/react-relay/ReactRelayFragmentContainer.js | jstejada/relay | 751fa14f2a6e45e921af343172f500270d47ef00 | [
"MIT"
] | null | null | null | /**
* 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.
*
* @flow strict-local
* @format
*/
'use strict';
const React = require('react');
const areEqual = require('areEqual');
const buildReactRelayContainer = require('./buildReactRelayContainer');
const getRootVariablesForFragments = require('./getRootVariablesForFragments');
const {getContainerName} = require('./ReactRelayContainerUtils');
const {assertRelayContext} = require('./RelayContext');
const {
createFragmentSpecResolver,
getDataIDsFromObject,
isScalarAndEqual,
} = require('relay-runtime');
import type {$RelayProps, GeneratedNodeMap, RelayProp} from './ReactRelayTypes';
import type {
FragmentMap,
FragmentSpecResolver,
RelayContext,
} from 'relay-runtime';
type ContainerProps = $FlowFixMeProps;
type ContainerState = {
data: {[key: string]: mixed},
prevProps: ContainerProps,
prevPropsContext: RelayContext,
relayProp: RelayProp,
resolver: FragmentSpecResolver,
};
/**
* Composes a React component class, returning a new class that intercepts
* props, resolving them with the provided fragments and subscribing for
* updates.
*/
function createContainerWithFragments<
Props: {},
TComponent: React.ComponentType<Props>,
>(
Component: TComponent,
fragments: FragmentMap,
): React.ComponentType<
$RelayProps<React$ElementConfig<TComponent>, RelayProp>,
> {
const containerName = getContainerName(Component);
return class extends React.Component<ContainerProps, ContainerState> {
static displayName = containerName;
constructor(props) {
super(props);
const relayContext = assertRelayContext(props.__relayContext);
// Do not provide a subscription/callback here.
// It is possible for this render to be interrupted or aborted,
// In which case the subscription would cause a leak.
// We will add the subscription in componentDidMount().
const resolver = createFragmentSpecResolver(
relayContext,
containerName,
fragments,
props,
);
this.state = {
data: resolver.resolve(),
prevProps: props,
prevPropsContext: relayContext,
relayProp: getRelayProp(relayContext.environment),
resolver,
};
}
/**
* When new props are received, read data for the new props and subscribe
* for updates. Props may be the same in which case previous data and
* subscriptions can be reused.
*/
static getDerivedStateFromProps(
nextProps: ContainerProps,
prevState: ContainerState,
): $Shape<ContainerState> | null {
// Any props change could impact the query, so we mirror props in state.
// This is an unusual pattern, but necessary for this container usecase.
const {prevProps} = prevState;
const relayContext = assertRelayContext(nextProps.__relayContext);
const prevIDs = getDataIDsFromObject(fragments, prevProps);
const nextIDs = getDataIDsFromObject(fragments, nextProps);
let resolver: FragmentSpecResolver = prevState.resolver;
// If the environment has changed or props point to new records then
// previously fetched data and any pending fetches no longer apply:
// - Existing references are on the old environment.
// - Existing references are based on old variables.
// - Pending fetches are for the previous records.
if (
prevState.prevPropsContext.environment !== relayContext.environment ||
!areEqual(prevIDs, nextIDs)
) {
// Do not provide a subscription/callback here.
// It is possible for this render to be interrupted or aborted,
// In which case the subscription would cause a leak.
// We will add the subscription in componentDidUpdate().
resolver = createFragmentSpecResolver(
relayContext,
containerName,
fragments,
nextProps,
);
return {
data: resolver.resolve(),
prevPropsContext: relayContext,
prevProps: nextProps,
relayProp: getRelayProp(relayContext.environment),
resolver,
};
} else {
resolver.setProps(nextProps);
const data = resolver.resolve();
if (data !== prevState.data) {
return {
data,
prevProps: nextProps,
prevPropsContext: relayContext,
relayProp: getRelayProp(relayContext.environment),
};
}
}
return null;
}
componentDidMount() {
this._subscribeToNewResolver();
this._rerenderIfStoreHasChanged();
}
componentDidUpdate(prevProps: ContainerProps, prevState: ContainerState) {
if (this.state.resolver !== prevState.resolver) {
prevState.resolver.dispose();
this._subscribeToNewResolver();
}
this._rerenderIfStoreHasChanged();
}
componentWillUnmount() {
this.state.resolver.dispose();
}
shouldComponentUpdate(nextProps, nextState): boolean {
// Short-circuit if any Relay-related data has changed
if (nextState.data !== this.state.data) {
return true;
}
// Otherwise, for convenience short-circuit if all non-Relay props
// are scalar and equal
const keys = Object.keys(nextProps);
for (let ii = 0; ii < keys.length; ii++) {
const key = keys[ii];
if (key === '__relayContext') {
if (
nextState.prevPropsContext.environment !==
this.state.prevPropsContext.environment
) {
return true;
}
} else {
if (
!fragments.hasOwnProperty(key) &&
!isScalarAndEqual(nextProps[key], this.props[key])
) {
return true;
}
}
}
return false;
}
/**
* Render new data for the existing props/context.
*/
_handleFragmentDataUpdate = () => {
const resolverFromThisUpdate = this.state.resolver;
this.setState(updatedState =>
// If this event belongs to the current data source, update.
// Otherwise we should ignore it.
resolverFromThisUpdate === updatedState.resolver
? {
data: updatedState.resolver.resolve(),
relayProp: getRelayProp(updatedState.relayProp.environment),
}
: null,
);
};
_rerenderIfStoreHasChanged() {
const {data, resolver} = this.state;
// External values could change between render and commit.
// Check for this case, even though it requires an extra store read.
const maybeNewData = resolver.resolve();
if (data !== maybeNewData) {
this.setState({data: maybeNewData});
}
}
_subscribeToNewResolver() {
const {resolver} = this.state;
// Event listeners are only safe to add during the commit phase,
// So they won't leak if render is interrupted or errors.
resolver.setCallback(this._handleFragmentDataUpdate);
}
render() {
const {componentRef, __relayContext: _, ...props} = this.props;
return React.createElement(Component, {
...props,
...this.state.data,
ref: componentRef,
relay: this.state.relayProp,
});
}
};
}
function getRelayProp(environment) {
return {
environment,
};
}
/**
* Wrap the basic `createContainer()` function with logic to adapt to the
* `context.relay.environment` in which it is rendered. Specifically, the
* extraction of the environment-specific version of fragments in the
* `fragmentSpec` is memoized once per environment, rather than once per
* instance of the container constructed/rendered.
*/
function createContainer<
Props: {},
Instance,
TComponent: React.AbstractComponent<Props, Instance>,
>(
Component: TComponent,
fragmentSpec: GeneratedNodeMap,
): React.AbstractComponent<
$RelayProps<React$ElementConfig<TComponent>, RelayProp>,
Instance,
> {
return buildReactRelayContainer(
Component,
fragmentSpec,
createContainerWithFragments,
);
}
module.exports = {
createContainer,
};
| 30.426471 | 80 | 0.654543 |
15ee155bea79cb43533b9b64e3f51f12ef057515 | 1,008 | js | JavaScript | src/api/backstage/sysset/bigscreen/alliance/institutional/institutional.js | hannahShi07/map | 6fdac1ffcf84d46b4c3870c4b5f213ef3d834ff7 | [
"Apache-2.0"
] | null | null | null | src/api/backstage/sysset/bigscreen/alliance/institutional/institutional.js | hannahShi07/map | 6fdac1ffcf84d46b4c3870c4b5f213ef3d834ff7 | [
"Apache-2.0"
] | null | null | null | src/api/backstage/sysset/bigscreen/alliance/institutional/institutional.js | hannahShi07/map | 6fdac1ffcf84d46b4c3870c4b5f213ef3d834ff7 | [
"Apache-2.0"
] | null | null | null | /**
* @author hanliyan
* @email 654993295@qq.com
* @description 理事会和机构管理API
* @data {{object} data 接口请求参数
**/
import request from "../../../../../AxiosRequest.js";
/*理事会和机构管理列表查询*/
export const getInstitutionalList = data =>
request({
url: "/partycloud/unionCouncil/councilPage",
method: "post",
data: data
});
/*理事会和机构管理列表新增*/
export const getInstitutionalAdd = data =>
request({
url: "/partycloud/unionCouncil/addCouncil",
method: "post",
data: data
});
/*理事会和机构管理列表编辑*/
export const getInstitutionalEdit = data =>
request({
url: "/partycloud/unionCouncil/updateCouncil",
method: "post",
data: data
});
/*理事会和机构管理列表删除*/
export const getInstitutionalDetele = data =>
request({
url: "/partycloud/unionCouncil/deleteCouncil",
method: "post",
data: data
});
/*理事会和机构管理列表详情*/
export const getInstitutionalDetail = data =>
request({
url: "/partycloud/unionCouncil/findSimpleCouncil",
method: "post",
data: data
});
| 19.764706 | 54 | 0.652778 |
15eea19f552a623109fe7f2706e0b807988c8c66 | 1,046 | js | JavaScript | node_modules/date-and-time/locale/sr.js | xmichelleyang/pic_lit | e1244fed4566d7284818206961a20338157c84ca | [
"MIT"
] | 4 | 2019-06-27T22:53:17.000Z | 2019-08-08T02:57:16.000Z | node_modules/date-and-time/locale/sr.js | xmichelleyang/pic_lit | e1244fed4566d7284818206961a20338157c84ca | [
"MIT"
] | 16 | 2019-05-02T06:18:49.000Z | 2020-07-17T03:58:59.000Z | node_modules/date-and-time/locale/sr.js | xmichelleyang/pic_lit | e1244fed4566d7284818206961a20338157c84ca | [
"MIT"
] | 2 | 2019-11-14T01:47:53.000Z | 2020-02-28T00:42:57.000Z | /**
* @preserve date-and-time.js locale configuration
* @preserve Serbian (sr)
* @preserve It is using moment.js locale configuration as a reference.
*/
(function (global) {
'use strict';
var locale = function (date) {
date.setLocales('sr', {
MMMM: ['januar', 'februar', 'mart', 'april', 'maj', 'jun', 'jul', 'avgust', 'septembar', 'oktobar', 'novembar', 'decembar'],
MMM: ['jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun', 'jul', 'avg.', 'sep.', 'okt.', 'nov.', 'dec.'],
dddd: ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'],
ddd: ['ned.', 'pon.', 'uto.', 'sre.', 'čet.', 'pet.', 'sub.'],
dd: ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su']
});
};
if (typeof module === 'object' && typeof module.exports === 'object') {
locale(require('../date-and-time'));
} else if (typeof define === 'function' && define.amd) {
define(['date-and-time'], locale);
} else {
locale(global.date);
}
}(this));
| 37.357143 | 136 | 0.503824 |
15efbd3c718d3e99179c02168f133a050acf9f19 | 906 | js | JavaScript | modules/mensalista/client/controllers/mensalistavalor.client.controller.js | tecnodebr/agspark | 3d5324fbb964ff285b15697dafd7e8c6dbf9633e | [
"MIT"
] | 2 | 2018-11-28T11:46:44.000Z | 2019-04-08T14:36:17.000Z | modules/mensalista/client/controllers/mensalistavalor.client.controller.js | andrebaldo/agspark | 3d5324fbb964ff285b15697dafd7e8c6dbf9633e | [
"MIT"
] | null | null | null | modules/mensalista/client/controllers/mensalistavalor.client.controller.js | andrebaldo/agspark | 3d5324fbb964ff285b15697dafd7e8c6dbf9633e | [
"MIT"
] | null | null | null | (function () {
'use strict';
angular
.module('mensalistavalor')
.controller('MensalistaValorController', MensalistaValorController);
MensalistaValorController.$inject = ['$scope', '$state', 'MensalistaValorService', 'mensalistaResolve'];
function MensalistaValorController($scope, $state, MensalistaValorService, mensalistaResolve) {
var vm = this;
vm.mensalistavalorlista = MensalistaValorService.query();
vm.mensalistavalor = mensalistaResolve;
$scope.update = function(isValid){
if (!isValid) {
$scope.$broadcast('show-errors-check-validity', 'vm.form.vigenciaForm');
return false;
}
vm.mensalistavalor.$save(successCallback, errorCallback);
function successCallback(res) {
$state.go('mensalistavalor.list');
}
function errorCallback(res) {
vm.error = res.data.message;
}
};
}
})();
| 26.647059 | 106 | 0.668874 |
15efc0924465c4e1d164485d7e65703d15f91a20 | 500 | js | JavaScript | shared/reducers/index.js | quoeradem/pastenot.es | 6ea932e4efa7bf8b0a3e1b58774f90adbab127a5 | [
"MIT"
] | null | null | null | shared/reducers/index.js | quoeradem/pastenot.es | 6ea932e4efa7bf8b0a3e1b58774f90adbab127a5 | [
"MIT"
] | null | null | null | shared/reducers/index.js | quoeradem/pastenot.es | 6ea932e4efa7bf8b0a3e1b58774f90adbab127a5 | [
"MIT"
] | null | null | null | import {combineReducers} from 'redux';
/* Reducers */
import readOnly from './readonly';
import mode from './mode';
import content from './content';
import router from './router';
import meta from './meta';
import isCopy from './iscopy';
import user from './user';
import ui from './ui';
import isWrapped from './isWrapped';
const rootReducer = combineReducers({
content,
meta,
mode,
readOnly,
router,
isCopy,
isWrapped,
user,
ui
});
export default rootReducer; | 19.230769 | 38 | 0.666 |
15efd740c12ebc872cb7246256872bedda298ccf | 1,502 | js | JavaScript | server/game/cards/09.6-SD/InServiceToMyLord.js | Matthew-Griffith/ringteki-client | cd0682b7358281b3042e22fc96717bca7c1ff23f | [
"MIT"
] | 101 | 2017-07-04T13:01:57.000Z | 2020-12-06T20:18:32.000Z | server/game/cards/09.6-SD/InServiceToMyLord.js | Matthew-Griffith/ringteki-client | cd0682b7358281b3042e22fc96717bca7c1ff23f | [
"MIT"
] | 2,973 | 2017-08-24T13:31:24.000Z | 2020-01-27T21:45:12.000Z | server/game/cards/09.6-SD/InServiceToMyLord.js | Matthew-Griffith/ringteki-client | cd0682b7358281b3042e22fc96717bca7c1ff23f | [
"MIT"
] | 97 | 2017-07-27T16:41:22.000Z | 2021-02-27T21:42:48.000Z | import { Locations, CardTypes, PlayTypes } from '../../Constants.js';
const DrawCard = require('../../drawcard.js');
const AbilityDsl = require('../../abilitydsl');
class InServiceToMyLord extends DrawCard {
setupCardAbilities() {
this.persistentEffect({
location: Locations.ConflictDiscardPile,
effect: AbilityDsl.effects.canPlayFromOwn(Locations.ConflictDiscardPile, [this], PlayTypes.Other)
});
this.action({
title: 'Ready a character',
cost: AbilityDsl.costs.bow({
cardType: CardTypes.Character,
cardCondition: card => !card.isUnique()
}),
target: {
activePromptTitle: 'Choose a unique character',
cardType: CardTypes.Character,
cardCondition: card => card.isUnique(),
gameAction: AbilityDsl.actions.multiple([
AbilityDsl.actions.ready(),
AbilityDsl.actions.moveCard(context => ({
target: context.source,
destination: Locations.ConflictDeck, bottom: true
}))
])
},
effect: 'ready {0}. {1} is placed on the bottom of {2}\'s conflict deck',
effectArgs: context => [
context.source,
context.source.owner]
});
}
}
InServiceToMyLord.id = 'in-service-to-my-lord';
module.exports = InServiceToMyLord;
| 37.55 | 109 | 0.547936 |
15f0e3bca9d1970170a677a43682122a446dae49 | 1,009 | js | JavaScript | tasks/get-token.js | schmidtk/strava-to-postgis | c07202ce1a0e123f5dc088bbe1f7348d02b4dca5 | [
"Apache-2.0"
] | 2 | 2019-08-16T18:52:11.000Z | 2020-02-23T14:35:52.000Z | tasks/get-token.js | schmidtk/strava-to-postgis | c07202ce1a0e123f5dc088bbe1f7348d02b4dca5 | [
"Apache-2.0"
] | null | null | null | tasks/get-token.js | schmidtk/strava-to-postgis | c07202ce1a0e123f5dc088bbe1f7348d02b4dca5 | [
"Apache-2.0"
] | null | null | null | const config = require('config');
const Promise = require('bluebird');
const request = Promise.promisifyAll(require('request'));
const reportError = (message) => {
console.error(message);
process.exit(1);
};
const strava = config.get('strava');
if (!strava.clientId) {
reportError('Missing Strava client ID. Please add the value to your local configuration.');
}
if (!strava.clientSecret) {
reportError('Missing Strava client secret. Please add the value to your local configuration.');
}
if (!strava.code) {
reportError('Missing Strava authorization code. Please add the value to your local configuration.');
}
const url = 'https://www.strava.com/oauth/token';
const formData = {
client_id: strava.clientId,
client_secret: strava.clientSecret,
code: strava.code,
grant_type: 'authorization_code'
};
request.postAsync({url: url, formData: formData}).then((response) => {
const jsonResponse = JSON.parse(response.body);
console.log(`Auth Token: ${jsonResponse.access_token}`);
});
| 28.027778 | 102 | 0.72448 |
15f2998181220ac13910b0354b04d4cec7b3ab7f | 1,343 | js | JavaScript | register.js | satyateja6/proc | e39e1733dff9ecb57a94b40fc4e603caf17675d6 | [
"MIT"
] | null | null | null | register.js | satyateja6/proc | e39e1733dff9ecb57a94b40fc4e603caf17675d6 | [
"MIT"
] | null | null | null | register.js | satyateja6/proc | e39e1733dff9ecb57a94b40fc4e603caf17675d6 | [
"MIT"
] | null | null | null | $(document).ready(function(){
$("#myform").validate({
rules:{
username:{
required: true
},
title:{
required: true
},
company: "required",
password: {
required: true,
minlength: 8,
alphanumeric: true
},
email1: {
required: true,
email: true
},
email2: {
required: true,
email: true,
equalTo: "#email1"
},
phone: {
required: true,
phoneUS: true
}
},
messages:{
title: {
required: "please enter a valid title"
},
company: {
required:"Please enter your company name"
},
email1: "Please enter a valid email",
email2: {
email: "Please enter a valid email",
equalTo: "Emails do not match"
},
phone: {
required: "Please enter a phone number",
phoneUS: "Please enter a valid phone number"
},
password:{
required: "Please provide a password",
minlength: "Password must be atleast 8 characters long"
},
username:{
required: "Please enter your full name"
}
},
});
$.validator.addMethod( "alphanumeric", function( value, element ) {
var reg = /^[a-zA-Z0-9]{8,}$/;
return this.optional( element ) || !reg.test( value );
}, "Password must be alphanumeric and have atleast one special character");
jQuery.validator.addMethod("lettersonly", function(value, element) {
return this.optional(element) || /^[a-z\s]+$/i.test(value);
}, "Alphabets only please");
});
| 20.348485 | 75 | 0.64408 |
15f2a0d8482035274edf9e1f0c69e8f7ad70f464 | 1,598 | js | JavaScript | refactor/src/Model/locCtl.js | htcvszrf/Cesium-4 | d9b371958aefc47705c23ff0bfe2be8501435a45 | [
"MIT"
] | null | null | null | refactor/src/Model/locCtl.js | htcvszrf/Cesium-4 | d9b371958aefc47705c23ff0bfe2be8501435a45 | [
"MIT"
] | null | null | null | refactor/src/Model/locCtl.js | htcvszrf/Cesium-4 | d9b371958aefc47705c23ff0bfe2be8501435a45 | [
"MIT"
] | 1 | 2020-02-19T03:27:04.000Z | 2020-02-19T03:27:04.000Z | /**
* @file 坐标定位
*/
define( [
'Cesium',
'./Event/rightMenu',
'viewer'
], function ( Cesium, rightMenu, viewer ) {
'use strict';
var REG = /^\d+\.\d+,\s*\d+\.\d+,\s*\d+\.\d+$/;
function loc ( _viewer ) {
}
// 添加点
function _zbdw ( longitude, latitude, height ) {
loc._entity = new Cesium.Entity( {
point : new Cesium.PointGraphics( {
color : new Cesium.Color( 1, 1, 0 ),
pixelSize : 10,
outlineColor : new Cesium.Color( 0, 1, 1 )
} ),
position : Cesium.Cartesian3.fromDegrees( longitude, latitude , height )
// position : Cesium.Cartesian3.fromDegrees(114.11, 22.54 , 37.06 + 0.5)
} );
viewer._viewer.entities.add( loc._entity );
}
// 删除 entity
function removeEntity () {
if ( loc._entity ) {
viewer._viewer.entities.remove( loc._entity );
}
}
$.extend( loc, {
_entity: null,
start: function () {
rightMenu.isShow = false;
},
close: function () {
rightMenu.isShow = true;
this.clear();
},
clear: function () {
removeEntity();
},
submit: function ( txt ) {
if ( !REG.test( txt ) ) {
return console.warn( '<<< 输入坐标有误, 请按格式输入' );
}
var ret = txt.split( /,\s*/ );
_zbdw( +ret[ 0 ], +ret[ 1 ], +ret[ 2 ] ); // 添加点
viewer._viewer.zoomTo( loc._entity ); // 跳转到该点上
}
} );
return loc;
} );
| 24.96875 | 84 | 0.461827 |