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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6856a56c9fddb5fea8e50e4cb734f58873cc1b78 | 355 | js | JavaScript | assignments/js-types-variables-functions/ex-06-robustSum.js | TIY-Charleston-Front-End-Engineering/TIY-2016-Q3 | 31c13908b5c57dc78ecf304394db7055060cfb04 | [
"MIT"
] | 1 | 2020-05-02T12:56:46.000Z | 2020-05-02T12:56:46.000Z | assignments/js-types-variables-functions/ex-06-robustSum.js | TIY-Charleston-Front-End-Engineering/TIY-2016-Q3 | 31c13908b5c57dc78ecf304394db7055060cfb04 | [
"MIT"
] | null | null | null | assignments/js-types-variables-functions/ex-06-robustSum.js | TIY-Charleston-Front-End-Engineering/TIY-2016-Q3 | 31c13908b5c57dc78ecf304394db7055060cfb04 | [
"MIT"
] | 9 | 2016-09-13T13:38:29.000Z | 2017-05-31T15:30:50.000Z |
/**
* PART 06: robustSum()
*
* Modify your simpleSum function so that if either of its
* inputs is not a number, it will return the boolean `false`
*/
//*-*~*~*~*~*~ Don't Touch *~*~*~*~*~*~*~*
console.assert( robustSum(867, 5309) === 6176);
console.assert( robustSum('867', 5309) === false);
console.assert( robustSum(5, true) === false); | 25.357143 | 61 | 0.602817 |
6858164fd37aea364317aec9179ce4758eead3ae | 4,243 | js | JavaScript | docs/UsersGuide/api/c++/html/search/files_5.js | SSteve/fprime | 12c478bd79c2c4ba2d9f9e634e47f8b6557c54a8 | [
"Apache-2.0"
] | 2 | 2021-02-23T06:56:03.000Z | 2021-02-23T07:03:53.000Z | docs/UsersGuide/api/c++/html/search/files_5.js | SSteve/fprime | 12c478bd79c2c4ba2d9f9e634e47f8b6557c54a8 | [
"Apache-2.0"
] | 9 | 2021-02-21T07:27:44.000Z | 2021-02-21T07:27:58.000Z | docs/UsersGuide/api/c++/html/search/files_5.js | SSteve/fprime | 12c478bd79c2c4ba2d9f9e634e47f8b6557c54a8 | [
"Apache-2.0"
] | 1 | 2021-02-23T17:10:44.000Z | 2021-02-23T17:10:44.000Z | var searchData=
[
['fataleventportac_2ecpp_3357',['FatalEventPortAc.cpp',['../fatal_event_port_ac_8cpp.html',1,'']]],
['fataleventportac_2ehpp_3358',['FatalEventPortAc.hpp',['../fatal_event_port_ac_8hpp.html',1,'']]],
['fatalhandlercomponentac_2ecpp_3359',['FatalHandlerComponentAc.cpp',['../fatal_handler_component_ac_8cpp.html',1,'']]],
['fatalhandlercomponentac_2ehpp_3360',['FatalHandlerComponentAc.hpp',['../fatal_handler_component_ac_8hpp.html',1,'']]],
['fatalhandlercomponentbaremetalimpl_2ecpp_3361',['FatalHandlerComponentBaremetalImpl.cpp',['../fatal_handler_component_baremetal_impl_8cpp.html',1,'']]],
['fatalhandlercomponentcommonimpl_2ecpp_3362',['FatalHandlerComponentCommonImpl.cpp',['../fatal_handler_component_common_impl_8cpp.html',1,'']]],
['fatalhandlercomponentimpl_2ehpp_3363',['FatalHandlerComponentImpl.hpp',['../fatal_handler_component_impl_8hpp.html',1,'']]],
['fatalhandlercomponentlinuximpl_2ecpp_3364',['FatalHandlerComponentLinuxImpl.cpp',['../fatal_handler_component_linux_impl_8cpp.html',1,'']]],
['fatalhandlercomponentvxworksimpl_2ecpp_3365',['FatalHandlerComponentVxWorksImpl.cpp',['../fatal_handler_component_vx_works_impl_8cpp.html',1,'']]],
['feature_5ftests_2ec_3366',['feature_tests.c',['../feature__tests_8c.html',1,'']]],
['feature_5ftests_2ecxx_3367',['feature_tests.cxx',['../feature__tests_8cxx.html',1,'']]],
['fifobufferqueue_2ecpp_3368',['FIFOBufferQueue.cpp',['../f_i_f_o_buffer_queue_8cpp.html',1,'']]],
['file_2ecpp_3369',['File.cpp',['../os_2_baremetal_2_file_8cpp.html',1,'(Global Namespace)'],['../os_2_linux_2_file_8cpp.html',1,'(Global Namespace)'],['../svc_2_file_downlink_2_file_8cpp.html',1,'(Global Namespace)'],['../svc_2_file_uplink_2_file_8cpp.html',1,'(Global Namespace)']]],
['file_2ehpp_3370',['File.hpp',['../file_8hpp.html',1,'']]],
['filebuffer_2ecpp_3371',['FileBuffer.cpp',['../file_buffer_8cpp.html',1,'']]],
['filebuffer_2ehpp_3372',['FileBuffer.hpp',['../file_buffer_8hpp.html',1,'']]],
['filecommon_2ecpp_3373',['FileCommon.cpp',['../file_common_8cpp.html',1,'']]],
['filedownlink_2ecpp_3374',['FileDownlink.cpp',['../file_downlink_8cpp.html',1,'']]],
['filedownlink_2ehpp_3375',['FileDownlink.hpp',['../file_downlink_8hpp.html',1,'']]],
['filedownlinkcomponentac_2ecpp_3376',['FileDownlinkComponentAc.cpp',['../file_downlink_component_ac_8cpp.html',1,'']]],
['filedownlinkcomponentac_2ehpp_3377',['FileDownlinkComponentAc.hpp',['../file_downlink_component_ac_8hpp.html',1,'']]],
['filemanager_2ecpp_3378',['FileManager.cpp',['../file_manager_8cpp.html',1,'']]],
['filemanager_2ehpp_3379',['FileManager.hpp',['../file_manager_8hpp.html',1,'']]],
['filemanagercomponentac_2ecpp_3380',['FileManagerComponentAc.cpp',['../file_manager_component_ac_8cpp.html',1,'']]],
['filemanagercomponentac_2ehpp_3381',['FileManagerComponentAc.hpp',['../file_manager_component_ac_8hpp.html',1,'']]],
['filepacket_2ecpp_3382',['FilePacket.cpp',['../com_file_2_file_packet_8cpp.html',1,'(Global Namespace)'],['../file_packet_2_file_packet_8cpp.html',1,'(Global Namespace)']]],
['filepacket_2ehpp_3383',['FilePacket.hpp',['../com_file_2_file_packet_8hpp.html',1,'(Global Namespace)'],['../file_packet_2_file_packet_8hpp.html',1,'(Global Namespace)']]],
['filestub_2ecpp_3384',['FileStub.cpp',['../file_stub_8cpp.html',1,'']]],
['filestubs_2ehpp_3385',['FileStubs.hpp',['../file_stubs_8hpp.html',1,'']]],
['filesystem_2ecpp_3386',['FileSystem.cpp',['../baremetal_2_file_system_8cpp.html',1,'(Global Namespace)'],['../linux_2_file_system_8cpp.html',1,'(Global Namespace)']]],
['filesystem_2ehpp_3387',['FileSystem.hpp',['../file_system_8hpp.html',1,'']]],
['fileuplink_2ecpp_3388',['FileUplink.cpp',['../file_uplink_8cpp.html',1,'']]],
['fileuplink_2ehpp_3389',['FileUplink.hpp',['../file_uplink_8hpp.html',1,'']]],
['fileuplinkcomponentac_2ecpp_3390',['FileUplinkComponentAc.cpp',['../file_uplink_component_ac_8cpp.html',1,'']]],
['fileuplinkcomponentac_2ehpp_3391',['FileUplinkComponentAc.hpp',['../file_uplink_component_ac_8hpp.html',1,'']]],
['fpconfig_2ehpp_3392',['FpConfig.hpp',['../fp_config_8hpp.html',1,'']]],
['fprimesequence_2ecpp_3393',['FPrimeSequence.cpp',['../f_prime_sequence_8cpp.html',1,'']]]
];
| 103.487805 | 287 | 0.73745 |
6858cbc88c11b3de84d30d1ef83c0c2c4aa9c802 | 15,914 | js | JavaScript | node_modules/awesome-typescript-loader/dist/checker/runtime.js | meherwan/ProjectFirst | 45250565b926f9ed843b492eb386ef9fb60e9a71 | [
"MIT"
] | 1 | 2020-09-11T22:14:45.000Z | 2020-09-11T22:14:45.000Z | node_modules/awesome-typescript-loader/dist/checker/runtime.js | meherwan/ProjectFirst | 45250565b926f9ed843b492eb386ef9fb60e9a71 | [
"MIT"
] | null | null | null | node_modules/awesome-typescript-loader/dist/checker/runtime.js | meherwan/ProjectFirst | 45250565b926f9ed843b492eb386ef9fb60e9a71 | [
"MIT"
] | null | null | null | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
if (!module.parent) {
process.on('uncaughtException', function (err) {
console.log("UNCAUGHT EXCEPTION in awesome-typescript-loader");
console.log("[Inside 'uncaughtException' event] ", err.message, err.stack);
});
process.on('disconnect', function () {
process.exit();
});
process.on('exit', function () {
console.log('EXIT RUNTIME');
});
createChecker(process.on.bind(process, 'message'), process.send.bind(process));
}
else {
module.exports.run = function run() {
var send;
var receive = function (msg) { };
createChecker(function (receive) {
send = function (msg, cb) {
receive(msg);
if (cb) {
cb();
}
};
}, function (msg) { return receive(msg); });
return {
on: function (type, cb) {
if (type === 'message') {
receive = cb;
}
},
send: send,
kill: function () { }
};
};
}
var path = require("path");
var colors = require("colors");
var helpers_1 = require("../helpers");
var protocol_1 = require("./protocol");
function createChecker(receive, send) {
var projectVersion = 0;
var loaderConfig;
var compilerConfig;
var compilerOptions;
var webpackOptions;
var compiler;
var compilerInfo;
var files = {};
var host;
var service;
var ignoreDiagnostics = {};
var instanceName;
var context;
function ensureFile(fileName) {
if (!files[fileName]) {
var text = compiler.sys.readFile(fileName);
if (text) {
files[fileName] = {
text: text,
version: 0,
snapshot: compiler.ScriptSnapshot.fromString(text)
};
}
}
}
var FileDeps = (function () {
function FileDeps() {
this.files = {};
}
FileDeps.prototype.add = function (containingFile) {
var dep = [];
for (var _i = 1; _i < arguments.length; _i++) {
dep[_i - 1] = arguments[_i];
}
if (!this.files[containingFile]) {
this.files[containingFile] = Array.from(dep);
}
else {
var deps = this.files[containingFile];
deps.push.apply(deps, dep);
}
};
FileDeps.prototype.getDeps = function (containingFile) {
return this.files[containingFile] || [];
};
FileDeps.prototype.getAllDeps = function (containingFile, allDeps, initial) {
var _this = this;
if (allDeps === void 0) { allDeps = {}; }
if (initial === void 0) { initial = true; }
var deps = this.getDeps(containingFile);
deps.forEach(function (dep) {
if (!allDeps[dep]) {
allDeps[dep] = true;
_this.getAllDeps(dep, allDeps, false);
}
});
if (initial) {
return Object.keys(allDeps);
}
else {
return [];
}
};
return FileDeps;
}());
var fileDeps = new FileDeps();
var TS_AND_JS_FILES = /\.tsx?$|\.jsx?$/i;
var TS_FILES = /\.tsx?$/i;
var Host = (function () {
function Host(filesRegex) {
this.getCustomTransformers = loaderConfig.getCustomTransformers;
this.filesRegex = filesRegex;
}
Host.prototype.getProjectVersion = function () { return projectVersion.toString(); };
Host.prototype.getScriptFileNames = function () {
var _this = this;
return Object.keys(files).filter(function (filePath) { return _this.filesRegex.test(filePath); });
};
Host.prototype.getScriptVersion = function (fileName) {
ensureFile(fileName);
if (files[fileName]) {
return files[fileName].version.toString();
}
};
Host.prototype.getScriptSnapshot = function (fileName) {
ensureFile(fileName);
if (files[fileName]) {
return files[fileName].snapshot;
}
};
Host.prototype.getCurrentDirectory = function () {
return context;
};
Host.prototype.getScriptIsOpen = function () {
return true;
};
Host.prototype.getCompilationSettings = function () {
return compilerOptions;
};
Host.prototype.resolveTypeReferenceDirectives = function (typeDirectiveNames, containingFile) {
var resolved = typeDirectiveNames.map(function (directive) {
return compiler.resolveTypeReferenceDirective(directive, containingFile, compilerOptions, compiler.sys)
.resolvedTypeReferenceDirective;
});
resolved.forEach(function (res) {
if (res && res.resolvedFileName) {
fileDeps.add(containingFile, res.resolvedFileName);
}
});
return resolved;
};
Host.prototype.resolveModuleNames = function (moduleNames, containingFile) {
var resolved = moduleNames.map(function (module) {
return compiler.resolveModuleName(module, containingFile, compilerOptions, compiler.sys).resolvedModule;
});
resolved.forEach(function (res) {
if (res && res.resolvedFileName) {
fileDeps.add(containingFile, res.resolvedFileName);
}
});
return resolved;
};
Host.prototype.log = function (message) {
console.log(message);
};
Host.prototype.fileExists = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return compiler.sys.fileExists.apply(compiler.sys, args);
};
Host.prototype.readFile = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return compiler.sys.readFile.apply(compiler.sys, args);
};
Host.prototype.readDirectory = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return compiler.sys.readDirectory.apply(compiler.sys, args);
};
Host.prototype.getDefaultLibFileName = function (options) {
return compiler.getDefaultLibFilePath(options);
};
Host.prototype.useCaseSensitiveFileNames = function () {
return compiler.sys.useCaseSensitiveFileNames;
};
Host.prototype.getDirectories = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return compiler.sys.getDirectories.apply(compiler.sys, args);
};
Host.prototype.directoryExists = function (path) {
return compiler.sys.directoryExists(path);
};
return Host;
}());
function processInit(_a) {
var seq = _a.seq, payload = _a.payload;
compiler = require(payload.compilerInfo.compilerPath);
compilerInfo = payload.compilerInfo;
loaderConfig = payload.loaderConfig;
compilerConfig = payload.compilerConfig;
compilerOptions = compilerConfig.options;
webpackOptions = payload.webpackOptions;
context = payload.context;
instanceName = loaderConfig.instance || 'at-loader';
host = new Host(compilerOptions.allowJs
? TS_AND_JS_FILES
: TS_FILES);
service = compiler.createLanguageService(host);
compilerConfig.fileNames.forEach(function (fileName) {
var text = compiler.sys.readFile(fileName);
if (!text) {
return;
}
files[fileName] = {
text: text,
version: 0,
snapshot: compiler.ScriptSnapshot.fromString(text)
};
});
var program = service.getProgram();
program.getSourceFiles().forEach(function (file) {
files[file.fileName] = {
text: file.text,
version: 0,
snapshot: compiler.ScriptSnapshot.fromString(file.text)
};
});
if (loaderConfig.debug) {
console.log("[" + instanceName + "] @DEBUG Initial files", Object.keys(files));
}
if (loaderConfig.ignoreDiagnostics) {
loaderConfig.ignoreDiagnostics.forEach(function (diag) {
ignoreDiagnostics[diag] = true;
});
}
replyOk(seq, null);
}
function updateFile(fileName, text, ifExist) {
if (ifExist === void 0) { ifExist = false; }
var file = files[fileName];
if (file) {
if (file.text === text) {
return;
}
projectVersion++;
file.version++;
file.text = text;
file.snapshot = compiler.ScriptSnapshot.fromString(text);
}
else if (!ifExist) {
projectVersion++;
files[fileName] = {
text: text,
version: 0,
snapshot: compiler.ScriptSnapshot.fromString(text)
};
}
}
function removeFile(fileName) {
var file = files[fileName];
if (file) {
delete files[fileName];
}
}
function emit(fileName) {
if (loaderConfig.useTranspileModule || loaderConfig.transpileOnly) {
return fastEmit(fileName);
}
else {
var output = service.getEmitOutput(fileName, false);
if (output.outputFiles.length > 0) {
return helpers_1.findResultFor(fileName, output);
}
else {
return fastEmit(fileName);
}
}
}
function fastEmit(fileName) {
var trans = compiler.transpileModule(files[fileName].text, {
compilerOptions: compilerOptions,
fileName: fileName,
reportDiagnostics: false
});
return {
text: trans.outputText,
sourceMap: trans.sourceMapText
};
}
function processUpdate(_a) {
var seq = _a.seq, payload = _a.payload;
updateFile(payload.fileName, payload.text, payload.ifExist);
replyOk(seq, null);
}
function processRemove(_a) {
var seq = _a.seq, payload = _a.payload;
removeFile(payload.fileName);
replyOk(seq, null);
}
function processEmit(_a) {
var seq = _a.seq, payload = _a.payload;
updateFile(payload.fileName, payload.text);
var emitResult = emit(payload.fileName);
var deps = fileDeps.getAllDeps(payload.fileName);
replyOk(seq, { emitResult: emitResult, deps: deps });
}
function processFiles(_a) {
var seq = _a.seq;
replyOk(seq, {
files: service.getProgram().getSourceFiles().map(function (f) { return f.fileName; })
});
}
function processDiagnostics(_a) {
var seq = _a.seq;
var silent = !!loaderConfig.silent;
var timeStart = +new Date();
if (!silent) {
console.log(colors.cyan("\n[" + instanceName + "] Checking started in a separate process..."));
}
var program = service.getProgram();
var allDiagnostics = program
.getOptionsDiagnostics().concat(program.getGlobalDiagnostics());
var nativeGetter = program.getSourceFiles;
if (compilerConfig.options.skipLibCheck) {
program.getSourceFiles = function () { return nativeGetter().filter(function (file) {
return !file.isDeclarationFile;
}); };
}
allDiagnostics.push.apply(allDiagnostics, program.getSyntacticDiagnostics());
allDiagnostics.push.apply(allDiagnostics, program.getSemanticDiagnostics());
if (loaderConfig.debug) {
console.log("[" + instanceName + "] @DEBUG Typechecked files", program.getSourceFiles());
}
program.getSourceFiles = nativeGetter;
if (allDiagnostics.length) {
console.error(colors.red("\n[" + instanceName + "] Checking finished with " + allDiagnostics.length + " errors"));
}
else {
if (!silent) {
var timeEnd = +new Date();
console.log(colors.green("\n[" + instanceName + "] Ok, " + (timeEnd - timeStart) / 1000 + " sec."));
}
}
var processedDiagnostics = allDiagnostics
.filter(function (diag) { return !ignoreDiagnostics[diag.code]; })
.map(function (diagnostic) {
var message = compiler.flattenDiagnosticMessageText(diagnostic.messageText, '\n');
var fileName = diagnostic.file && path.relative(context, diagnostic.file.fileName);
if (fileName && fileName[0] !== '.') {
fileName = './' + helpers_1.toUnix(fileName);
}
var pretty = '';
var line = 0;
var character = 0;
var code = diagnostic.code;
if (diagnostic.file) {
var pos = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
line = pos.line;
character = pos.character;
pretty = ("[" + instanceName + "] " + colors.red(fileName) + ":" + (line + 1) + ":" + (character + 1) + " \n TS" + code + ": " + colors.red(message));
}
else {
pretty = (colors.red("[" + instanceName + "] TS" + code + ": " + message));
}
return {
category: diagnostic.category,
code: diagnostic.code,
fileName: fileName,
start: diagnostic.start,
message: message,
pretty: pretty,
line: line,
character: character
};
});
replyOk(seq, processedDiagnostics);
}
function replyOk(seq, payload) {
send({
seq: seq,
success: true,
payload: payload
});
}
function replyErr(seq, payload) {
send({
seq: seq,
success: false,
payload: payload
});
}
receive(function (req) {
try {
switch (req.type) {
case protocol_1.MessageType.Init:
processInit(req);
break;
case protocol_1.MessageType.UpdateFile:
processUpdate(req);
break;
case protocol_1.MessageType.EmitFile:
processEmit(req);
break;
case protocol_1.MessageType.Diagnostics:
processDiagnostics(req);
break;
case protocol_1.MessageType.Files:
processFiles(req);
break;
case protocol_1.MessageType.RemoveFile:
processRemove(req);
break;
}
}
catch (e) {
console.error("[" + instanceName + "]: Child process failed to process the request: ", e);
replyErr(req.seq, null);
}
});
}
//# sourceMappingURL=runtime.js.map | 36.668203 | 169 | 0.523313 |
685a107f55875330392a7fb142e55b5bbbdba5c9 | 31,917 | js | JavaScript | dist/main.js | bbcfive/BiliAudio | b16aede8da64b20f8c7b10b04cc4c9b67b29c3a8 | [
"MIT"
] | null | null | null | dist/main.js | bbcfive/BiliAudio | b16aede8da64b20f8c7b10b04cc4c9b67b29c3a8 | [
"MIT"
] | null | null | null | dist/main.js | bbcfive/BiliAudio | b16aede8da64b20f8c7b10b04cc4c9b67b29c3a8 | [
"MIT"
] | null | null | null | !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=15)}([function(e,t,r){"use strict";var n=r(3),o=Object.prototype.toString;function i(e){return"[object Array]"===o.call(e)}function a(e){return void 0===e}function s(e){return null!==e&&"object"==typeof e}function c(e){return"[object Function]"===o.call(e)}function u(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:i,isArrayBuffer:function(e){return"[object ArrayBuffer]"===o.call(e)},isBuffer:function(e){return null!==e&&!a(e)&&null!==e.constructor&&!a(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:s,isUndefined:a,isDate:function(e){return"[object Date]"===o.call(e)},isFile:function(e){return"[object File]"===o.call(e)},isBlob:function(e){return"[object Blob]"===o.call(e)},isFunction:c,isStream:function(e){return s(e)&&c(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:u,merge:function e(){var t={};function r(r,n){"object"==typeof t[n]&&"object"==typeof r?t[n]=e(t[n],r):t[n]=r}for(var n=0,o=arguments.length;n<o;n++)u(arguments[n],r);return t},deepMerge:function e(){var t={};function r(r,n){"object"==typeof t[n]&&"object"==typeof r?t[n]=e(t[n],r):t[n]="object"==typeof r?e({},r):r}for(var n=0,o=arguments.length;n<o;n++)u(arguments[n],r);return t},extend:function(e,t,r){return u(t,(function(t,o){e[o]=r&&"function"==typeof t?n(t,r):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(e,t,r){var n,o;void 0===(o="function"==typeof(n=function(){return function(){var e=arguments.length;if(0===e)throw new Error("resolveUrl requires at least one argument; got none.");var t=document.createElement("base");if(t.href=arguments[0],1===e)return t.href;var r=document.getElementsByTagName("head")[0];r.insertBefore(t,r.firstChild);for(var n,o=document.createElement("a"),i=1;i<e;i++)o.href=arguments[i],n=o.href,t.href=n;return r.removeChild(t),n}})?n.call(t,r,t,e):n)||(e.exports=o)},function(e,t,r){e.exports=r(16)},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},function(e,t,r){"use strict";var n=r(0);function o(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var i;if(r)i=r(t);else if(n.isURLSearchParams(t))i=t.toString();else{var a=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),a.push(o(t)+"="+o(e))})))})),i=a.join("&")}if(i){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},function(e,t,r){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,r){"use strict";(function(t){var n=r(0),o=r(21),i={"Content-Type":"application/x-www-form-urlencoded"};function a(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var s,c={adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t&&"[object process]"===Object.prototype.toString.call(t))&&(s=r(8)),s),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(a(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)?(a(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){c.headers[e]=n.merge(i)})),e.exports=c}).call(this,r(7))},function(e,t){var r,n,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var c,u=[],f=!1,l=-1;function p(){f&&c&&(f=!1,c.length?u=c.concat(u):l=-1,u.length&&d())}function d(){if(!f){var e=s(p);f=!0;for(var t=u.length;t;){for(c=u,u=[];++l<t;)c&&c[l].run();l=-1,t=u.length}c=null,f=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new h(e,t)),1!==u.length||f||s(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,r){"use strict";var n=r(0),o=r(22),i=r(4),a=r(24),s=r(27),c=r(28),u=r(9);e.exports=function(e){return new Promise((function(t,f){var l=e.data,p=e.headers;n.isFormData(l)&&delete p["Content-Type"];var d=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",m=e.auth.password||"";p.Authorization="Basic "+btoa(h+":"+m)}var g=a(e.baseURL,e.url);if(d.open(e.method.toUpperCase(),i(g,e.params,e.paramsSerializer),!0),d.timeout=e.timeout,d.onreadystatechange=function(){if(d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in d?s(d.getAllResponseHeaders()):null,n={data:e.responseType&&"text"!==e.responseType?d.response:d.responseText,status:d.status,statusText:d.statusText,headers:r,config:e,request:d};o(t,f,n),d=null}},d.onabort=function(){d&&(f(u("Request aborted",e,"ECONNABORTED",d)),d=null)},d.onerror=function(){f(u("Network Error",e,null,d)),d=null},d.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),f(u(t,e,"ECONNABORTED",d)),d=null},n.isStandardBrowserEnv()){var y=r(29),v=(e.withCredentials||c(g))&&e.xsrfCookieName?y.read(e.xsrfCookieName):void 0;v&&(p[e.xsrfHeaderName]=v)}if("setRequestHeader"in d&&n.forEach(p,(function(e,t){void 0===l&&"content-type"===t.toLowerCase()?delete p[t]:d.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(d.withCredentials=!!e.withCredentials),e.responseType)try{d.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&d.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){d&&(d.abort(),f(e),d=null)})),void 0===l&&(l=null),d.send(l)}))}},function(e,t,r){"use strict";var n=r(23);e.exports=function(e,t,r,o,i){var a=new Error(e);return n(a,t,r,o,i)}},function(e,t,r){"use strict";var n=r(0);e.exports=function(e,t){t=t||{};var r={},o=["url","method","params","data"],i=["headers","auth","proxy"],a=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];n.forEach(o,(function(e){void 0!==t[e]&&(r[e]=t[e])})),n.forEach(i,(function(o){n.isObject(t[o])?r[o]=n.deepMerge(e[o],t[o]):void 0!==t[o]?r[o]=t[o]:n.isObject(e[o])?r[o]=n.deepMerge(e[o]):void 0!==e[o]&&(r[o]=e[o])})),n.forEach(a,(function(n){void 0!==t[n]?r[n]=t[n]:void 0!==e[n]&&(r[n]=e[n])}));var s=o.concat(i).concat(a),c=Object.keys(t).filter((function(e){return-1===s.indexOf(e)}));return n.forEach(c,(function(n){void 0!==t[n]?r[n]=t[n]:void 0!==e[n]&&(r[n]=e[n])})),r}},function(e,t,r){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t){let r=!1,n=()=>{};e.exports={logging:r,setLogging:e=>{r=e},setCustomLogger:e=>{n=e},log:(e,t)=>{n({type:e,message:t}),r&&console.log(`[${e}] ${t}`)}}},function(e,t,r){const n=r(38),o=r(39),i=r(40);e.exports={defaultOptions:n,getCreateFFmpegCore:o,fetchFile:i}},function(e){e.exports=JSON.parse('{"_from":"@ffmpeg/ffmpeg","_id":"@ffmpeg/ffmpeg@0.9.7","_inBundle":false,"_integrity":"sha512-WpZkNnqYGoaMcMd1EpaDi7nxRyEd05OjOTAfItH/ZwvAKJpr7ksvHKTC/NjP0li6mFrTFLGudP81J1tG0babdg==","_location":"/@ffmpeg/ffmpeg","_phantomChildren":{},"_requested":{"type":"tag","registry":true,"raw":"@ffmpeg/ffmpeg","name":"@ffmpeg/ffmpeg","escapedName":"@ffmpeg%2fffmpeg","scope":"@ffmpeg","rawSpec":"","saveSpec":null,"fetchSpec":"latest"},"_requiredBy":["#USER","/"],"_resolved":"https://registry.npmjs.org/@ffmpeg/ffmpeg/-/ffmpeg-0.9.7.tgz","_shasum":"f309d689c59e35d345c049bf5e35f1ccde28c215","_spec":"@ffmpeg/ffmpeg","_where":"/Users/zhangsijing/Desktop/practice/covtension-master","author":{"name":"Jerome Wu","email":"jeromewus@gmail.com"},"browser":{"./src/node/index.js":"./src/browser/index.js"},"bugs":{"url":"https://github.com/ffmpegwasm/ffmpeg.wasm/issues"},"bundleDependencies":false,"dependencies":{"is-url":"^1.2.4","node-fetch":"^2.6.1","regenerator-runtime":"^0.13.7","resolve-url":"^0.2.1"},"deprecated":false,"description":"FFmpeg WebAssembly version","devDependencies":{"@babel/core":"^7.12.3","@babel/preset-env":"^7.12.1","@ffmpeg/core":"^0.8.5","@types/emscripten":"^1.39.4","babel-loader":"^8.1.0","chai":"^4.2.0","cors":"^2.8.5","eslint":"^7.12.1","eslint-config-airbnb-base":"^14.1.0","eslint-plugin-import":"^2.22.1","express":"^4.17.1","mocha":"^8.2.1","mocha-headless-chrome":"^2.0.3","npm-run-all":"^4.1.5","wait-on":"^5.2.0","webpack":"^5.3.2","webpack-cli":"^4.1.0","webpack-dev-middleware":"^4.0.0"},"directories":{"example":"examples"},"engines":{"node":">=12.16.1"},"homepage":"https://github.com/ffmpegwasm/ffmpeg.wasm#readme","keywords":["ffmpeg","WebAssembly","video"],"license":"MIT","main":"src/index.js","name":"@ffmpeg/ffmpeg","repository":{"type":"git","url":"git+https://github.com/ffmpegwasm/ffmpeg.wasm.git"},"scripts":{"build":"rimraf dist && webpack --config scripts/webpack.config.prod.js","lint":"eslint src","prepublishOnly":"npm run build","start":"node scripts/server.js","test":"npm-run-all -p -r start test:all","test:all":"npm-run-all wait test:browser:ffmpeg test:node:all","test:browser":"mocha-headless-chrome -a allow-file-access-from-files -a incognito -a no-sandbox -a disable-setuid-sandbox -a disable-logging -t 300000","test:browser:ffmpeg":"npm run test:browser -- -f ./tests/ffmpeg.test.html","test:node":"node --experimental-wasm-threads --experimental-wasm-bulk-memory node_modules/.bin/_mocha --exit --bail --require ./scripts/test-helper.js","test:node:all":"npm run test:node -- ./tests/*.test.js","wait":"rimraf dist && wait-on http://localhost:3000/dist/ffmpeg.dev.js"},"types":"src/index.d.ts","version":"0.9.7"}')},function(e,t,r){"use strict";r.r(t);var n=r(2),o=r.n(n),i=r(32),a=r.n(i),s=document.getElementById("biliVideoUrl"),c=document.getElementById("link"),u="";chrome.tabs.query({active:!0,currentWindow:!0},(function(e){var t=e[0].url.match(/(BV.*\?)/gi);null!==t&&t.length>0?(u=t[0].slice(0,t[0].length-1),s.value=u):s.value="Not found invalid bvid"})),document.getElementById("getLink").addEventListener("click",async()=>{var e=await o.a.get("https://api.bilibili.com/x/web-interface/view?bvid="+u),t=e.data.data.aid,r=e.data.data.cid;if(void 0!==t&&void 0!==r){var n=(await o.a.get(`https://api.bilibili.com/x/player/playurl?avid=${t}&cid=${r}`)).data.data.durl[0].url;c.innerHTML=n}});const f=document.getElementById("message"),{createFFmpeg:l,fetchFile:p}=a.a,d=l({log:!0,progress:({ratio:e})=>{f.innerHTML=`Complete: ${(100*e).toFixed(2)}%`}});document.getElementById("uploader").addEventListener("change",async({target:{files:e}})=>{console.log(e);const{name:t}=e[0];f.innerHTML="Loading ffmpeg-core.js",await d.load(),f.innerHTML="Start transcoding",d.FS("writeFile",t,await p(e[0])),await d.run("-i",t,"output.mp3"),f.innerHTML="Complete transcoding";const r=d.FS("readFile","output.mp3");document.getElementById("output-audio").src=URL.createObjectURL(new Blob([r.buffer],{type:"audio/mp3"}))})},function(e,t,r){"use strict";var n=r(0),o=r(3),i=r(17),a=r(10);function s(e){var t=new i(e),r=o(i.prototype.request,t);return n.extend(r,i.prototype,t),n.extend(r,t),r}var c=s(r(6));c.Axios=i,c.create=function(e){return s(a(c.defaults,e))},c.Cancel=r(11),c.CancelToken=r(30),c.isCancel=r(5),c.all=function(e){return Promise.all(e)},c.spread=r(31),e.exports=c,e.exports.default=c},function(e,t,r){"use strict";var n=r(0),o=r(4),i=r(18),a=r(19),s=r(10);function c(e){this.defaults=e,this.interceptors={request:new i,response:new i}}c.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=s(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[a,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)r=r.then(t.shift(),t.shift());return r},c.prototype.getUri=function(e){return e=s(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){c.prototype[e]=function(t,r){return this.request(n.merge(r||{},{method:e,url:t}))}})),n.forEach(["post","put","patch"],(function(e){c.prototype[e]=function(t,r,o){return this.request(n.merge(o||{},{method:e,url:t,data:r}))}})),e.exports=c},function(e,t,r){"use strict";var n=r(0);function o(){this.handlers=[]}o.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},function(e,t,r){"use strict";var n=r(0),o=r(20),i=r(5),a=r(6);function s(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return s(e),e.headers=e.headers||{},e.data=o(e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||a.adapter)(e).then((function(t){return s(e),t.data=o(t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(s(e),t&&t.response&&(t.response.data=o(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,r){"use strict";var n=r(0);e.exports=function(e,t,r){return n.forEach(r,(function(r){e=r(e,t)})),e}},function(e,t,r){"use strict";var n=r(0);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},function(e,t,r){"use strict";var n=r(9);e.exports=function(e,t,r){var o=r.config.validateStatus;!o||o(r.status)?e(r):t(n("Request failed with status code "+r.status,r.config,null,r.request,r))}},function(e,t,r){"use strict";e.exports=function(e,t,r,n,o){return e.config=t,r&&(e.code=r),e.request=n,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},function(e,t,r){"use strict";var n=r(25),o=r(26);e.exports=function(e,t){return e&&!n(t)?o(e,t):t}},function(e,t,r){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,r){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,r){"use strict";var n=r(0),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,i,a={};return e?(n.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=n.trim(e.substr(0,i)).toLowerCase(),r=n.trim(e.substr(i+1)),t){if(a[t]&&o.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([r]):a[t]?a[t]+", "+r:r}})),a):a}},function(e,t,r){"use strict";var n=r(0);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function o(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=o(window.location.href),function(t){var r=n.isString(t)?o(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){"use strict";var n=r(0);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,o,i,a){var s=[];s.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),n.isString(o)&&s.push("path="+o),n.isString(i)&&s.push("domain="+i),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,r){"use strict";var n=r(11);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){r(33);const n=r(34),{fetchFile:o}=r(13);e.exports={createFFmpeg:n,fetchFile:o}},function(e,t,r){var n=function(e){"use strict";var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=t&&t.prototype instanceof l?t:l,i=Object.create(o.prototype),a=new L(n||[]);return i._invoke=function(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return F()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=b(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(e,r,a),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var f={};function l(){}function p(){}function d(){}var h={};h[o]=function(){return this};var m=Object.getPrototypeOf,g=m&&m(m(j([])));g&&g!==t&&r.call(g,o)&&(h=g);var y=d.prototype=l.prototype=Object.create(h);function v(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){var n;this._invoke=function(o,i){function a(){return new t((function(n,a){!function n(o,i,a,s){var c=u(e[o],e,i);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==typeof l&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(l).then((function(e){f.value=e,a(f)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function b(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return f;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=u(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,f;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function j(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:F}}function F(){return{value:void 0,done:!0}}return p.prototype=y.constructor=d,d.constructor=p,p.displayName=s(d,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,s(e,a,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},v(w.prototype),w.prototype[i]=function(){return this},e.AsyncIterator=w,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new w(c(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},v(y),s(y,a,"Generator"),y[o]=function(){return this},y.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=j,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:j(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}(e.exports);try{regeneratorRuntime=n}catch(e){Function("r","regeneratorRuntime = r")(n)}},function(e,t,r){const{defaultArgs:n,baseOptions:o}=r(35),{setLogging:i,setCustomLogger:a,log:s}=r(12),c=r(36),u=r(37),{defaultOptions:f,getCreateFFmpegCore:l}=r(13),{version:p}=r(14),d=Error("ffmpeg.wasm is not ready, make sure you have completed load().");e.exports=(e={})=>{const{log:t,logger:r,progress:h,...m}={...o,...f,...e};let g=null,y=null,v=null,w=!1,b=h;const x=({type:e,message:t})=>{s(e,t),c(t,b),(e=>{"FFMPEG_END"===e&&null!==v&&(v(),v=null,w=!1)})(t)};return i(t),a(r),s("info","use ffmpeg.wasm v"+p),{setProgress:e=>{b=e},setLogger:e=>{a(e)},setLogging:i,load:async()=>{if(s("info","load ffmpeg-core"),null!==g)throw Error("ffmpeg.wasm was loaded, you should not load it again, use ffmpeg.isLoaded() to check next time.");{s("info","loading ffmpeg-core");const{createFFmpegCore:e,corePath:t,workerPath:r,wasmPath:n}=await l(m);g=await e({mainScriptUrlOrBlob:t,printErr:e=>x({type:"fferr",message:e}),print:e=>x({type:"ffout",message:e}),locateFile:(e,t)=>{if("undefined"!=typeof window){if(void 0!==n&&e.endsWith("ffmpeg-core.wasm"))return n;if(void 0!==r&&e.endsWith("ffmpeg-core.worker.js"))return r}return t+e}}),y=g.cwrap("proxy_main","number",["number","number"]),s("info","ffmpeg-core loaded")}},isLoaded:()=>null!==g,run:(...e)=>{if(s("info","run ffmpeg command: "+e.join(" ")),null===g)throw d;if(w)throw Error("ffmpeg.wasm can only run one command at a time");return w=!0,new Promise(t=>{const r=[...n,...e].filter(e=>0!==e.length);v=t,y(...u(g,r))})},FS:(e,...t)=>{if(s("info",`run FS.${e} ${t.map(e=>"string"==typeof e?e:`<${e.length} bytes binary file>`).join(" ")}`),null===g)throw d;{let r=null;try{r=g.FS[e](...t)}catch(r){throw"readdir"===e?Error(`ffmpeg.FS('readdir', '${t[0]}') error. Check if the path exists, ex: ffmpeg.FS('readdir', '/')`):"readFile"===e?Error(`ffmpeg.FS('readFile', '${t[0]}') error. Check if the path exists`):Error("Oops, something went wrong in FS operation.")}return r}}}}},function(e,t){e.exports={defaultArgs:["./ffmpeg","-nostdin","-y"],baseOptions:{log:!1,logger:()=>{},progress:()=>{},corePath:""}}},function(e,t){let r=0;const n=e=>{const[t,r,n]=e.split(":");return 60*parseFloat(t)*60+60*parseFloat(r)+parseFloat(n)};e.exports=(e,t)=>{if("string"==typeof e)if(e.startsWith(" Duration")){const t=e.split(", ")[0].split(": ")[1],o=n(t);(0===r||r>o)&&(r=o)}else if(e.startsWith("frame")||e.startsWith("size")){const o=e.split("time=")[1].split(" ")[0];t({ratio:n(o)/r})}else e.startsWith("video:")&&(t({ratio:1}),r=0)}},function(e,t){e.exports=(e,t)=>{const r=e._malloc(t.length*Uint32Array.BYTES_PER_ELEMENT);return t.forEach((t,n)=>{const o=e._malloc(t.length+1);e.writeAsciiToMemory(t,o),e.setValue(r+Uint32Array.BYTES_PER_ELEMENT*n,o,"i32")}),[t.length,r]}},function(e,t,r){(function(t){const n=r(1),{devDependencies:o}=r(14);e.exports={corePath:void 0!==t&&"development"===t.env.FFMPEG_ENV?n("/node_modules/@ffmpeg/core/dist/ffmpeg-core.js"):`https://unpkg.com/@ffmpeg/core@${o["@ffmpeg/core"].substring(1)}/dist/ffmpeg-core.js`}}).call(this,r(7))},function(e,t,r){const n=r(1),{log:o}=r(12),i=async(e,t)=>{o("info","fetch "+e);const r=await(await fetch(e)).arrayBuffer();o("info",`${e} file size = ${r.byteLength} bytes`);const n=new Blob([r],{type:t}),i=URL.createObjectURL(n);return o("info",`${e} blob URL = ${i}`),i};e.exports=async({corePath:e})=>{if("string"!=typeof e)throw Error("corePath should be a string!");const t=n(e),r=await i(t,"application/javascript"),a=await i(t.replace("ffmpeg-core.js","ffmpeg-core.wasm"),"application/wasm"),s=await i(t.replace("ffmpeg-core.js","ffmpeg-core.worker.js"),"application/javascript");return"undefined"==typeof createFFmpegCore?new Promise(e=>{const t=document.createElement("script"),n=()=>{t.removeEventListener("load",n),o("info","ffmpeg-core.js script loaded"),e({createFFmpegCore:createFFmpegCore,corePath:r,wasmPath:a,workerPath:s})};t.src=r,t.type="text/javascript",t.addEventListener("load",n),document.getElementsByTagName("head")[0].appendChild(t)}):(o("info","ffmpeg-core.js script is loaded already"),Promise.resolve({createFFmpegCore:createFFmpegCore,corePath:r,wasmPath:a,workerPath:s}))}},function(e,t,r){const n=r(1);e.exports=async e=>{let t=e;if(void 0===e)return new Uint8Array;if("string"==typeof e)if(/data:_data\/([a-zA-Z]*);base64,([^"]*)/.test(e))t=atob(e.split(",")[1]).split("").map(e=>e.charCodeAt(0));else{const r=await fetch(n(e));t=await r.arrayBuffer()}else(e instanceof File||e instanceof Blob)&&(t=await(r=e,new Promise((e,t)=>{const n=new FileReader;n.onload=()=>{e(n.result)},n.onerror=({target:{error:{code:e}}})=>{t(Error("File could not be read! Code="+e))},n.readAsArrayBuffer(r)})));var r;return new Uint8Array(t)}}]); | 31,917 | 31,917 | 0.689163 |
685ae7196846e9656d0e51f6613200c65252af86 | 182 | js | JavaScript | tests/fixtures/tests/2.test.js | augustinesaidimu/alcides | 91ab249f2ccd3750549613c18be129b6c9e4ce29 | [
"MIT"
] | null | null | null | tests/fixtures/tests/2.test.js | augustinesaidimu/alcides | 91ab249f2ccd3750549613c18be129b6c9e4ce29 | [
"MIT"
] | 1 | 2022-02-25T02:24:09.000Z | 2022-02-25T02:24:09.000Z | tests/fixtures/tests/2.test.js | asaidimu/alcides | 91ab249f2ccd3750549613c18be129b6c9e4ce29 | [
"MIT"
] | null | null | null | suite('TestSuite #2', () => {
setUp(() => ({ number: 123456789 }))
test('Test that number is 123456789', ({ number }) => {
assert.equal(number, 123456789)
})
})
| 22.75 | 59 | 0.527473 |
685b2a2a0c6ca26d418b72da5d85e061457b9bae | 796 | js | JavaScript | doc/html/search/all_8.js | TristanBilot/42sh | 9e956c59e2efdbd35ad17367fda30ae78c772abe | [
"MIT"
] | null | null | null | doc/html/search/all_8.js | TristanBilot/42sh | 9e956c59e2efdbd35ad17367fda30ae78c772abe | [
"MIT"
] | null | null | null | doc/html/search/all_8.js | TristanBilot/42sh | 9e956c59e2efdbd35ad17367fda30ae78c772abe | [
"MIT"
] | null | null | null | var searchData=
[
['hash_269',['hash',['../var__storage_8c.html#a1d95dd3ffd39252eccb4b968ea061ec3',1,'var_storage.c']]],
['hex_270',['HEX',['../_c_make_c_compiler_id_8c.html#a46d5d95daa1bef867bd0179594310ed5',1,'HEX(): CMakeCCompilerId.c'],['../_c_make_c_x_x_compiler_id_8cpp.html#a46d5d95daa1bef867bd0179594310ed5',1,'HEX(): CMakeCXXCompilerId.cpp']]],
['history_271',['history',['../structhistory.html',1,'']]],
['history_2ec_272',['history.c',['../history_8c.html',1,'']]],
['history_2eh_273',['history.h',['../history_8h.html',1,'']]],
['history_5fmax_274',['HISTORY_MAX',['../history_8h.html#a7e3f0570a912ca195171fd7fe85ad94d',1,'history.h']]],
['huge_5fbuffer_5fsize_275',['HUGE_BUFFER_SIZE',['../buffer_8h.html#a79b882bfeeea59dedb042cb1b470307a',1,'buffer.h']]]
];
| 72.363636 | 244 | 0.71608 |
685b39866c7fd9d5cf0d26ef6fb4e0cc01372d19 | 24,971 | js | JavaScript | public/general/present/1/plugins/bingmaps.js | quangND1998/holomia_true360 | 68267f20d6bcbcf468887198e9304e23e46f13d6 | [
"MIT"
] | null | null | null | public/general/present/1/plugins/bingmaps.js | quangND1998/holomia_true360 | 68267f20d6bcbcf468887198e9304e23e46f13d6 | [
"MIT"
] | null | null | null | public/general/present/1/plugins/bingmaps.js | quangND1998/holomia_true360 | 68267f20d6bcbcf468887198e9304e23e46f13d6 | [
"MIT"
] | null | null | null | /*
krpano 1.20.6 Bing Maps Plugin (build 2020-04-15)
https://krpano.com/plugins/bingmaps/
*/
"[[KENCPUZRci'@?OoWu[+(_mKv5+@hbV&vOsR-AEhSnlY'wove7kL>QDD5=7^fJB>/-Iu8*ejs]qX6U9Uk2gPIMD<i&_%r/o$xgQ^vX08JYIg(BaF.+mn=O.IH.FamAfLQsCs_f_R5M./n>lg=<?J8ZnAhGJCNAX`TVo,u<tiR7Q1tfK].0oDh1gXNG>R&X*]tCJP0PuU98:3OuuGJ.$9w8galig3)lG.?vE6e`Fcu+B<OfBubsR5hAow&L%&TKHKN5iu0IU&YiiZQ,ij28_Kk`G(F%pr#BQ#U[X9psW`.'M/0Et4^ZGj3O7<$sj<vlQ0knC8`Lv:pJu^U[i%ebA?`2h[>N%.o5/O[[[$l=FLV*[wUbEX,F-se^8sN#=Uh=*$`H-O<,(DxibI;UB7xKo5u8t,_r9(C<VsujJ04jgD9L*E%4I+9-lT@ux,Lp.e1qNvC6<3YkTDe3`/*8ELXw']Dfn8eE^7)I9E8ew;)cmHu,UkfUG>E9e;D#.:nVPD)Gvw^ZmcO'O5VOA`4LJ>(Y/B#Fjg/?1XI(B,efVp-u4X?#?0Ri:Nc#T&HP?AXa^?H&+Ufu@HL*,#Jg.VvJMI-0eY8W5]/.52]e%]xo,GnNM=%/@BF,]^i2CvSoHC-oQR'5IbN5V<k@j#,gm9:p0f'7)D:jk9_0)]6)saDEP)`4HO_<KZlx%@H+vr1l#XL:f?gV(=?_RATfOY<)u)@j<8.`*wAt_cHG+VS[QvVg1[7mArWdq6cJu2LBQDIW%ITX_3W=[,u1?_`?_-F.bBE)&BlYP0ULN@v4')&B.Z<D&h1u>B3>tWsM*lac3V=fx>lmWiiAhNI=g%+=Vhx)lE(DOYX2T4dRN_k+R?wPQF9>lHn41,j3]@*PsCNMpttAHj;Nc`EE;Y18/8nk0YMqv`SicxwtD<([S5D4/Ts<Esgq&,3wNEZn^'DP=7>e#*J)'AlLbV9mQ0H+;N3$@&)Y^,n8+]&SJ./3BDsO=i@S]`GE;VZ9N8d*0n'-VT8%=g$nielq+VbU`WTI^&btPEeleP,mohIP>)I^`K>42Z)d[hvGA(Rt+:Xm>RB$#]q7#F^`2cgh>@V%IIuh[>&'kq*/Ea%;/&%nPsx3GkhZVf*vkX<@b-:I0JS8kv4C`k^>_^W+-ske4[t]`Cv@'GgX0d?VL[j.060IA>WS[@/PuCL_-v/0mFufW6gWmd5,HCcreNOv*RSRTf]%ENjOeJXh;SF]_;m1VJ#J@4oCm`b7r-mx*Ap97Tkx5rh[>10Go[9dOe1tK3ZPP#a=Sh(M^3-%><+]D:t1H*46q8[`TD[f[&sqniZaUhU]Qbrif%aq]$`d`FXUFfDb/@3k)/*71q7pl(DDS@&?8/NX;v+b-@A4_-dG*ON[mQj*DK4;9ujJi8v^Cn?GibpU8q0D;k*),+F8283s&8cGg<@r#BT%G4TV>@Q8*P1I@g_;l%UAUQKq+qv'A4H`B=dmp#g.7SchT,m1NEU$0)_@lM(d-0hrG(oq=ro9WuSDuNL-M8U33]*R[5`P_PYGW')t$RJsD[WjSWkeR(3[7/=VLXHP@TbhpR9?Ar,$bMHnRPIxMBMC*+Oh;c:)n^5EqEE?AW:nw6#W:u4G84iDFo;HT;(d8mZ;?fGmRRW+5Q:0]GQshtuiSGf83WSOxKS>;l`>8#+>B9:5AL:Xo6.^aSv(wefjK)XINE57>cO1N#KcknCbJYPrtsXqYLS(K>q]J<w42=+%fN9mMakArf6,kRh:ufaW`nM8P9'4q06%I@ZU^*a,S'DTDaaG_s_EF2lg=RKaGhSk7]3:LM=T%GX5'nJ(^P=(53R;C681Q.=Ov_[l+UCQHW7sE>C<&(_?oHFs*x]b$Kox]^9<#W[c=<)_<xfeJ?l(M7HufiO5hJ@q7=J3<u'dn%M5*st7&raBiFs8^iVZVaFOb7r4Vr9mJ@FX]%w6'w3'`X.D@(V<&JvQd,@3SIljO/j/*,ee`$fH]@JYm/_Ki_<twT;K4]aS`?P/g7Xl8[>7s>5.+]v9If^k1J6fa?E0$@BJweEa`So_Q+?k4gl6xJcs]D_Bd8*1'Kd;a`Cf,^HMC_8^jsYrW;*=qqT9A:_'Uu4,m6rO1,Z:k$(0o,;0qKni97^PWPnX0#]AmuIIp;LUB6rtaK]o)f)Nh<$p+nrg:SoY_^Z%C]5b)+B46RQMXMNpjfiNla^TI>Q#k&7@<Q*vR[V4518?C?@q)HdI]T^IL3rlQLE;A@O)O36UbUrU8(;7[j`ml=OPAA98D(WPkAx2sj,Q3#d5VMIH]wDh[(X7(W,qdwg.0SAI0RS<6mtS2E$4faRvkYU<n:Q>/$d=XpiK_-)Z0qE[qBHn1&k;e,u2p]Lr5w@tKt^Jt_K2Efhx0xA,dHbr-OG>L_NeF_Y+/d=p70-*E4T3?,5&J/Kv3?nYj:`hO5s<$.E+s`G..h/)(oI(?[N7]TmAL7B?$j:%Ccv(isB?6u<YrNOHi:Lf<%AGJ-PkI6?rrk@^asF$_>Je+^5W:A]WK1M2T3IRr[dZ(s`m_UFS%Y(lTiBToVZWUeSi8x,73Hb8BE&F)0,7I*1#=+Q1pDU5)`s$x+,3)Z=A=QP>x`UbSs2%4KH8eWr-=;r-k<hwRT,I+vKEEe4mRC+@H>`Mk#r?Bt_;LZxS,7Bq/iec5Z^:umVBBWsSK*1.8PAoQ?s-H3-?fLDIXf#h?qZX)6RSqESf_0[/1Y+BKa,k3Le).xGHP'F-dj2%mpUP`n2MWsuXU>(L'GEMuD/FH<8NjTG%@KDa-]^(UJtS#hrB?#O@>[U-)]A`;V;TYT4=i8DRahbE4'O<&$Q(1Zs`sW7-jB(CZ@oNdY<.7;'Cx^/5x^[mUoXQ7MonL7%k:7s;mXpeo>NZL&aEEG.c.F)6?r>N@mA.jIZa%JfJ1_#@ou+<7%=pXrwAm]C;<H3QYTR?0Eo/CA^4w$jVPZu&;H:66JGGr<v^:h6Pno,%98j5_bG2/%BKW?k-'3O9O'<$`@TYI7RTri;56%iI<]=d=V<ElIUiJ$t*u'8=Co@;DLc6R#&_MkO:L3n$+@<J1GiG)adF<i2-Sv$MRf[&'h>JiEc6M1;#np64ab+@_ou8h0?Q;u6?qfHf^A3FbD&J*,4towSd1A<?AX9+]o[I?eP_I%4mCY:;7iiR?FUsNcuNtXk;.s1<K#T9W:qUkm7tEG&A&tNmq:rY;]l0)f'*+(:&FiAtxJsHa.=gg5`&dF3m$d0kSJ'k*sk=V23.m2Y<>NO:u/Wl.CIlq2LeC^K'.x38>pTAo<wu89VfQ=91G2ZI`A4KdLj'+%6P4M^K(eICNxg5E%2*>73Y.sbZ_<ou:,h%,ss0dX[Kto-M0TS9_Fcto<>2huui6#Bp,*j/^ea%O@Wx82kLTY/j*W22_IwEIIVl)1r1b4,M*.foaYS6tu0/[(.cTAogfas,@bWN>IX;O=WcRpM3TRx11;:o'I[29T_=p=<F?m(ij5+EpsuTlY)7KtEbg+NYMaT.lo5D7L][VnS<Ur$frYu0V<d@;0M2fSF3,nESC?:M'L7ALY#0K6tk#>*0,Qx;^0;W`#AG+-(LYbvM(N#kNEF$(M=,[P5^4EnMIX[m+UtlHAZwfHYF7U6WFdc-K#8GGc+iU>dg,TBm0v%lpr?tj=O9aw:8<q>=9idr`?=C.0qFi-.ILsjfL*T*rF7i+N7'*cPh7ldCxltd,9U?wOm,KJ@mS1_F.DvkDZD(41[QIn9@+,SfT76+G0[d@Y1C6MX+Nq3irW.P:eJN:R&.wEojL0KHxGs-fE,l5QiXJ;s=$1C.x[^:>4[gPJi]/W0Ab>Tbba2jARi8g)nVTk-oX)L<*/QcRCbkRa<x,wOeXqM]Egr<sjg2)u]:G?+@87`8_Nt,$/=G[ElN2[UK%.GL&;_Z]9E&^l(#*okxm,)J_O?K&eZoK1H@F,%ZncL;l>Np;5ure_bm=Ub5kf&FWL6nI*3kvN9/R5'cg;4b,rpH7>v,^b0C&>SDXo?[-$*nppO)p?oeO%4IP-e';HV3HTkQ&spHCNLo)L]OO#7e$MZHA$_]?u7TdNt=b$rPevhb.4i*i43:E:f2o@S.A%kK%T*cL7l<F_ud112GPkg+<3^>0prXE3@Rl8%CBvm]:P&<k.k=+MaVA&*WNkh/m<2L9?uixm2:MD%[1KpVl/[aFg23naZuboFB5*VO*UvbQwR^augl07i>UnRu/`U3PPtt+Uc*t2gd^jTVAIS'b5jH2ZY_.&Zgk8b[OXCq9iZFcaJF>K7oUDeTtQvMgBi>1=7*/8TxI_SHvVVRjM7q[SF6GB8`Hk]lN[/JUI#QnF.2,V=<V?WX(E*tDoqMO?3QAY@>>2Mkcn<[OVn;DED,3x=JBo$meF+'@/@(h0:$=EV52mxVWu*3iQ*;*Q_R5v1SC0g$Ndn06Jt7cb3hn1:)Y>'#d/6IouRkHs$VlwsPH_@E7O90uXd&E=.P5Se.744q+aCnW*QvIeD6_RBGkHx]jMo<^NH#p[@j2c+T[UC@OPMoolk2C=9j6K&t7Ll7WgKg*ZNXY2s1fSKq2tCd8)UpAH6Lb[`P*2+xA$Apid7d8TQLQ4KCmBwOjY,0DhAhxX&qVr./h,-lN:E)_t$^MKp96R<gVG<noW./M_X9HPN%9gnf-B^@#509<_.ZS4qj3#1l6sd`&j$RiaK?Zb#e__p64.P:%qoWMp+Zgv$iKTL@&a:D15)F3pJ6uQ*;n^Te:1@GSxGitFff%>Ch5^5/%5B+e:vfJ';FQ^2l2[e::=-<FQYV8.EG&'rB]NueV6Q8@u)o&E-BP:q5oDxL`l6oE&wAfn2SXB^ZseqlxLX,_IfoIgel6vh)^=m1rfpg9NXxw[,*R)n32Fp9[i/El>T*CdB[hdR3rZ;9FI.m)/?68NLv<n1Q,0Tl*Gr2?.h&L@82MY;?(;IZ1'k@F$h?CR:fC>qCXx80*t2obS%I%:aoq@-dvkni#P9Fh7ePbfH7Q9SRwHsKv*[n3OYA?CdeM<XLBja?KW1PCQ<]:.x3MiV3xPTERr#W_BR=.ODSHkR9)>HKmKUuikO@%b]VN&,KEAL6gZG]p^';HW:)LZQ2S<*>0-6P/It#>[<O<'kaOb,:g8ui&-)bnm?BrfcS??e9%mBqJQ>C$30^DFTic;XAc%ovc5C<n5l:I3icD6JSW-HGBAbq8e:nuk#0t4)E>MNvJ8#WTN`qHd85CbhUTqSE9v>5ldhI,0PbwdF;sSGf)69jLrCVAd.=T[762mXa4YmUkTt[N%;lH,4AJ;rPQP%V/1o(-NfgQOH;qYOp*^JAFhfAR8BCj$<e445loa(xI>$hpib5CF_6?ssNY^(;^/AuweBv`<K,bQCtKo@4r8Y]D9N$#=@Rb:OF)U8<S1?5K_+oAQCe4u^4_>l`hS/QkEewV^PtojLFJmYAI<,NT:&DF^m4m%?H2qC4bOk<YhWB<*@PLkg4bH-t=nv0RljFl@/h&u3M5[*<=53I72n%ih:>X?4d`oSc5P+FJ's9HTE.ljjIbuRYH&'`.@*7^A&6ib&Pg'8sg-3_>:QrtdmS&]uWQNVTm+gg/iLE&BpZ3RM0T1J)sIP1P9@FHqBRcpKGW?+L#d?tx^n`/^*DOFX+<2A;8h/62#c02?`L(:TY(h`$'qZ/LZ,uVv&n-8V^;WBNvDB-EV9LFTZ#jB+W[Y#n#hDWaoU5HJGU6b+#Wf,JwFNXDG5/Z*cA(83Qhl8jmlZm2H)Vd?YO6f]:G?#cSksLN/V(&E`(vthd:]_0-nT0k)svxrcme?-%K#1U/2ivR3bc9EZ0ZvUQBMu1I`%hvi84WuGRJft.URd9tbv<<lnnIxsp>]hQaOU^ou=Y-GHcvhj5_d=2B<P_0=5K3;=3oxJXi'<I0g]M[[$O*B6H>fd>B,ghqRj$.Da%W<=ohsNR<U;nIH&egJg?wk9HT>fjxP3s_.]wq)63C'of.`?@BUh*_iYRaTx2ULZM=E*6:;v)$lbu+B3^kG?O-RESLmdC65CD=g&nD7pqTdDV]*>1oGFB])$I5x9[6tM7=/a<Th?i,is9n9TJ`kQquaD*q2fek2qP+R_^#%Z7bDGD@[9/7,Djx;DWG_vfZUGuASN6Bt5a'UMsqD]Y)$&Q`TLNQ&lP-XQ=Q,@V*hvhN2`#SE2'u:@JLYe'P[e(T0x&6^DpRPlGo(9BUf^n0:4a:?H#AZ)GnC]IB=Z`#'1nEVB@GKG[pcZU^t(taEEa$r2)B_8&7vW4RtKec%E5c^TE`*N]YiTB*/M0Uc^=11ZIt?_J6QB(ie0:9fvOwSs[:$)m7^q;bA]5b$2R=?>_Mf&lGDTCm;.&=6=:.TMYq@0tgP4h/e+Os5fWtaKT+h1[sv'kH^Zb1c&3:]DCRp3,NEMA5l067[+b_9,bR03WS;w7UeaYclt%I?#RWAu4p1b,WOYLJ2is,t/q,igeRIQ@>%RZPK<RXK10A5gp?=r/V-03&D.H:ng$hJK*`%^SWt-&&&471-d-BQd<PfPQN:e(B:LQnli)T?cLWM0#t$mFT?K[]=)Ft8+nX^p6&nsB=sl@vVb:'$Barn4pBT>G/3(eqmw%(/fJC8tF2[d.r-@ZOZ/4=,[u`a;E<J8u[/2?v2Af1CS;r-mY>kmm.fI#iRxO%k@?q+l%[ciBmTh8X#,+oPnHp-,Y.Kjp$[#s/YhQU*[82qe)n->P&`xE$FQbRM)d2_TRl8[:nPU1:n(M>;H5T]Q)q_x<VK]:52mViFtLa2=+>-5W'0c1`;Ql5N+/p>j9GOPRj*Z^(e(7c9?a&^+E_r/I:_u0'N@0DWBvf%2$Jk#m'CPA,H6ug#N;vhh4%5OP'ECIjHc_m/7QF(33%P*QOAPAC.:h7RM/K1c;g^cS;s/CVDQO0,@R=F(#d%V?h_xJ.:&6)<fU,_HfW#&@kq5U,R7`J;QV+S/?i,Qrl)os=*wVN.MZn(])NGPh4Hcl3'CplLH9U+3Gd#V.+F9+`GaHO2MGPjfjC`JiFR2ER;Z5&OIH?%.02H.4RNXg,%j5DZRp..Q'4U^MPDDsfYf4Cf``v#dkd7^`?NGQ?jceJFCf$$,C5gwpE3eZwZaTWJu]^dcihaR3i/X0*:TSBjdpIvsb2W;L8H]mIeJ3,/#YTo($0QQM=6+dq'N.80BO@nJUQ2`c*l9'29<Q9chE^p8,<qZS^a411egnRjj//`w'YUvj^J`$No1ZfaSA6-pj-(e`8uVsuu=$mD]>78NKS0SArvx-;b(.gZ7<fQ$f]U,phu7-V,M]aRNl73P@7L>H8XsDVJu&n:d*u.w2b'q,UI)dN@MJ&0TkJ75(@U6h1<_dj.x$;i7$xh4]9?Q1.j3>ne^*T#Z5X-W[qi:&jkY]3a$)($?ss?7s9@%xH9riG`q,]37_Sl(e]2G9d(D6eg)=(2v9+W-QMuwv:dm;bhG]?QZQKlXtM>c5XX0Tmd`PQW/+nD@;&e?H-Ak8s^C>9oM2HKZY^xs>_Ql63@N;H0QTHnZG1#QOF%ew/,RvKS0%+9@kSoXi&#-U,s@V_2^U'>>oc-e.?<]IBa)/)Y$W=nc5NQ>*MU;X9I0xj/0G7Q/#A0f/;+Yuk)LgbbpuPmt)bFOoH3VM-Hr))v4oJ1fX_(lk,wkV)D(e,[>&@/MeT.tkga;2-j3P&LfM*j^Ed;Xk16QtSt7t%XN:[ahs:R=u)Q>2%T%r5^kiNuJ?Bl?b=,O0,M,'=oS4'ra0?k31v$O6E^=#[CA]8cw=5?T(OvnVkOHk@]+n[39PBuOcO0;)c,p2@cG::80t:lnPjpH8lqkhLCX:+kpe`*=&IH9TIC$l&@Afw,C5m*S9?1$K@+4XcSjemqJY?'*%BwvVNSuLixp/2](B<n]ge$vAJY4x=?.o_hC5_vunEI.)lud'7DBex6qsPeTM:ZYL#0u^gh[4QHOU),jx&2+Jk0Ff9F1N$J(_,He*Kh6`p9&=TvSOm]TC;MD`V%6k008m_/d7KTdlGjUgYMa@JR%TxKjKqU5E*XQ4;u9k6>bxe+(o[e;X.QN:KfO^-[q(bxPFmCoE->r&G;O'[6i_sGbj$<ouDf<l:8.sT*jma%[jkYT/4Vg2Yv-6W7<m6CgipNHQEwM/AGB`W?x5B+e3+@q0aQ<vZdaP_]F:fBLQt9@lrqg7nq$W]L3u1MJ*rr*-&snSL^&oCV(a8t_(6CIha@u9Kn:+[Ur:UHCPJ,*SV279gdW^jld6sh8dLB(K@ZF.YD7Tqo%[w*kA7YIXa-Nh*1v$T;,Xg++ce@2m1B8NQcnAFhM^sH&6DB%Ck4=WgLNXR$_wI='_e^)DoIKp;c2:,QX<_=VHV@jcD27mVs_;?7E9^rj-Q[>Wp'`^b1'DT(a6whc6F_fO3A$g#rGKP=G;;'3OSn/bf62<'GOsohIRJ'KE.pvtM/%;:M4eBqEdo1a$IT6<vsQ3UmXft,N1<PeDhR_Zuq35LS$Uv`Y2<A<&;WlF.DF%?lP?nWK>e)@`f-Cd(p3*s/E+TarG:D[Lmuo&iHcLOLHFL]Tubnb>lPDl/_o[BVuc<4-#GT$iA1g=p/sKs)c.NQo?XAWU'Uc$+3_mH/Zpa2>X%w2Blh3ZM[-Wg4fPw)&%YgGpc`xgLs?;8+QNBHGQ&^)wLmN@f[L_ah'Y*&>S'DXR5`6&*/(bu#r@`3U'_d9FjZXE4;/_>4MPU8O<*Wn+iQ]C<[Y%:$&.dZw&Y4Q0]V0S.O58M.g)g=c@P&ILg.9qUUHW`6x.wtq&pMkd4ttQQICO))VSBFg`#=]Dn_-pTJ(,u3M7Nc==.+dK,P9_iVes9Gj=Y0gdli6)kc7eEiZLbt9[hQx)K=<HR1Ej;[ksBK?2Fu[E#+H0wTQR^ombMsT]7;C#;VuCCd4%Cc&S,g.V2(Ai;9=d?$T7lB:lEc^`lcQ`[[4.a74KtqFk$+jI`4#NH;,;%Dv@?^58gDBiT0ECm#ECC+a@R0<CUK;L/NbR;IRIOBuaGns'3oq5CYRICa/j/@taKgc3Bd.&@L+=MGhvcgu=&@2HCf1eJJhd8&R?@HG#-_a,K<arI&p2t;s5ZF$n%T5p]`9Y50.iZAX`=ZU*]s2[5><cVThD#.,HQueKJ7.Jp?T[ZYsI?W(e$KBH=*B[l&St]%`A8`sM3+n..l>jMHtHO(O>nf]:g[rDWdkt0@Rg9R@`4m`4e_R0m37SBtD'QY9S<YHMRxc(#0kP+*M==ng+q)1T;FlE$Ui#4(&LD.?%F/4X/7o_M8BSqi5#@$u-ekkq%b35Zo1=6g205,IwxpK$UE=NGF28T6tWjWdRaBSTt0J,h9$<5RNja^[5k-0=tKa(s^mmI+WTx_fNF+A=*T3KpCpkpl4SCB?N$@dxGidsPfT4m@nq,5HrPOc/K-VmE@:dLU42^<dP^u5,Bi[BQi(?Q'Uv&'bo2P&Yj3$1'v@FJ^BDKpY<%o%LXjctD2mNd(%,[U4%KsA4HClo%iAUAu4r)au@Z?@;Gegf:([B&.sE^7rrZcj+LgaR-27<PjR[],pPgC8tJE5?Yi/2h$=$SXTx9FjeNkp+C8gS_NFP@sA9TuD(j)b(-FUt-LC2k(2pTu^OEalJVfJw_9Y<9=AH1xBmYKM.`6V7nsh&#^n64I?mZ4-BpNs?7a^7mbRDQk$kLmh0'hIiNt_n9MmIhq6(Bp8hm$uL<8x]ZW4+4x%0ld1;hGwsp3x2NC_:#e1pwj#pZm7(.KGV_UgLdNoZr*u:2oE15JUFo,@dq2_S->`+-0@V.Z'9YrvT3*Ko:L4Og&TZ#=w5[Wt0[BT'Guf_W9qxo)-M.Gf>dwP-O[O.hSU(6Sq1xNGS@4N3S]BN]ZX8aW<S'RF%-+j+]cXGD:V@@?id(Cac#.`d&05+AKK:j9*.ER2*Ya_&>'UB;d-(K^wwjJtLlXdP<415'#_`b#.GaXVn6W_550B3ANm//5P8#VU+m#NCWKDXdlp'(tWi<L.9&K`[7Y;=)2Y)0f<&j#5^AK`pJ9'?8n)EPJYRB/`X6Yd6r.'gw=3jN`+Bqo`A/QC)A&Y1k/`7PLW.(7%hNdQ-fXCIc.URv8ZE'mceO=1paXI`*d$BOg]6^^kOeelh0Gp)r97_6pUHgY]]'2905x*IP'/5frr-Bo7Mc?:UETmocx+<QHxQc`3[c<k`,`DU<Wbp;$=dG18^)8.@RScFGBc+nsPU+Z7%bjaSrU_Zx)A]h)wS]Eh[-=;c;k89^jB^tlFYO.L1FtV]kqVYf[w([QXe2$?wXp'nIa,eoU[KPkqkC2ink=t%?4C+#x*P-jGST:=:xB&vrA4uukk39b[Qdfl9m=/AYN+?#?+Dq+B>n9)NJ8(+8sh7%2TY<7b>Cj?37#R7X,1D<`/rXL5q:fSM#O%[=g7k@T=bM*@8(BBC<T=vp1FgSpC=gHVn'3XWx&;DBPkH&h.k%tH^He<*8g:HxILfm3,w^s,',]Z6vw%AP4x8Q@_H&uf$ap2:Q/+I&s/8Cplb@FDbY4S$XWjusi2r_WQ3oH/S'o+#Fdl$/f1R-:jH0A%[Ktk[Za%;gJ;8aKF1B&1u:N]PxNXX/mqjQsBfY%-Ncd;%'T2m(:,BZ<51huhv.K)wlRGO]mHnUd]*Z-;&w?8<kBJ=9cnJfT(>+uxt.9nvm&9nEkDXpPU.[GaotB(VGkf8bPkR+-ALo-WH_Dt=7ZF0.[fis-qJNs0c6*)&erZQGjcL&K@8t8N-jBK-5G_B5axU22&qJP*v3Ji=1Q23)JVhmdG.r%#x6=>0;Zd(&q,KI^_aXVwUf`LZiXB]8P_dnv)pa?@U(f4iEt>m/55Nf7A+;(sjp^jc&d1Ap@YIQPV0==j(nD`atk1Ma6H@pVL60XQ5B<kh:+/Ui<:gureosP%X[lBQ'FW*:$?PT.9V4mVnEHBk?ouRBg:_`/%Zn<u-E),2V*]ScI)]%+RFf7q<.`p8ouRKn2GIY]tPH(HCBD8:QQC^?+$[%=9)m0C^Kf@)Cu;@m>[E8Q&]4gqAs(iT%TLCR<K7mM-&Uu&ZWf+,1(`(YBCLWl<]fg6R<DO@eue:x.MqSS0CEqo8=_v`S=GP#>)oX)<nlWNj<:8&U#jI-7W<[5L2c?O[-_o@/:.F3f'?'B[tdcXLbP:<.(BwJ&5Zc6+Ir^Q#.+kW(AReP[sm1<uIKn>Y/+;bKZS(Z:Z$*PeTH]>$Uh20]Q;S[_Y9v/1>-oL)7?sfW+XHpK3VCx+ll0jwa3#ThrUVIUs<B_uQc'b2[SNku>%k'EE]&EU>o+C/O5rVfVg[=()iZCa(klMt-^sSjhdUP%7I6W'vn2;huZjUk&88ma@W/o[CY7;mx6_gA'']l7u>X4=x@xK%()X`u6LW`6'ZA__ct7.(*Q@B&.e)rJtVb6N@EV>erI.M.3mY6J-*9iCO%N-JZZMeo:D%A.7D<,em[,cNgF)eIGg$$I7o[V6M*xV6vp,qN2?J8@%rJikdmEpJJ1=KJjtDIt0[S5;6]1n>7,i;_f6XmJT/MtdnM69L5UZ*/cm[]THUb*;:ew<j&0e<K`h`bCxl?5Mw.?kVnK?*9A=Yd>^VsaWei=u9kfjewK/WtFOMwl$wbL9,xA++>65#r1jc</mY@v]vG1_lwse-ujm^XTWgCqX)Z9Qfim#$0TWu%pi$RMQMU4Q,p-N2iSY:FxwT=Zh8Hk'[,JS.c`^lI?Xv:=m(d5vd/`1)8[0&uVM+dZ_8:J*S8[9#8(-r?$5b%aMj)8Lr7pF56pDdKDGO]#(=qefFL,p0X2xMHf$F^X_UwQQN3JNOXS+)3Bc6(>r+(IuFex6kK,mANHFf[V;e^NBqAvMJ76N^$&I&p@SMchhfmQ@#W8/s:AtM1LI,MSL_TUD6.Vc<^Zn&J3=`]QtL#3&`nRZ8tCt'87wR[Hb4r=*x+OSiU&$PQ0H5usp;LY`J;;p'itE'j/+w<uQ?bN4wFS7-`:N%1E?4.foP'%*B4O5q3LOEAv1`09]>t]`Ba;%@OOi;Mgul[EAws&B29O]o4sT''JoGcn([Us0%ai?JT'fA*?`)3Z&7><>g'GL:PB`x.Vxvs(p&Q-jJntwK&n=P7Nn71+:x=;;OV&0LXUE(qU/$g0SMm/:o-Dn?Gw6j6.v-2NVnDRG]m,L#HC1bUajH,*v.-o)(N0'Yws/UFe&iMLoDCW2B/)W3(.]WH01L7?ikrLULS?3(a@'-:9aY=H<M:QJg'/6YjN3B.HPO)G[ldri/x0b9lR3rqv3aLPNt7*gnc(9X)Wg_4Ir$[jm2fmJ&/+AtuIljS@st:i6ok`?]SQ3-N1liC>*=l5?J+LLNkL5;@=5r,ZnC2O2+aT,3(u;1tbY$r7XJFQ%:LHtu+qTKt&tYi1(pm0gf+_<_cjSE;Q=aTNw8.&b<Zs_wE$N>_sQHuj-(.o3_:F]n-`ULZN?u9rRR]b#&rCoHW3`GONnEV*a=_$8UH/;$B#?H2(GH1MHJtm=]p3>hj3(H>9ajjP)^1>P3=3`$m54#ciJ;4;xgP1lV`Pfav+Z;Nt3e*(%Y3?CuaEV]VD8llSq].l#SMB/5G=gC[r/KK17nc?W,VP9:)%GM/^Msc#b^ToF,beJ9GPDN3ZQX[uC^RVeRL`W[)1K=rva&j63WP/RjvkA*ZPXwg,DF#;ws1Ws/Q=jMrwfCH+VY][&(7_U_l3t(NOd?L8T2)O')T[9knJn[;9@@vH]O*PMr3HD@;n%m^tKO+.skU_(B$:3Pp^^0jH&rq:MTuEcj3f[2*>]C_NilG>&&0Sklh=pZNRG*iX6-i$[5_pK8,SI'PHiifET[m5-t#-'+qYHUJI@lZ%:3Lv:IweGsqIqg@v)+[&]:Ph]<[7<WEf32h#WwS]KL[tJ[01?hlBPPi&`w$'L_`-#9=<+u_UYS.92:?Il?%AO>-tO=V>E,v/W5>hY<M%h_u8_Kj3a8$e1-@#t,w;r)0eb/uHm^]?d'Lk1k<9l%?/Xi=$)(k4Dfs[;O1pe,Ix+T7q<`OAh78mJTG>aO5#Lw84g_6Ev,7sOTBe<JPT`MZEcETo=-bI)GYDJCPsilIFOJpC#h3Cd_lCfjujU_%9EI)h@bYUKY6PDD#e8Q8oI;UX%glZNN1.cfOOh>Av#XfKS3f&5(6*u@P0P9b%bPqFwgZ+*ImcT+-gv;E<'L/deK]slxaO1UZtHoJbB;rbqR]l$9QO-;Dx[%3Ax1soQki(ql53[A3W?T7-T#;Sf,l+/B4l=+2q3&nA+]:X(Mm)t=kUQ&54k?HbH*'Te#0?OfKt:4=6Ai^YGb,c5BEcqsbj41oJ0(AfZ8lft:TWsr93GM:fY9cEssk?]`+7'N%+@n/v,mtnJ);IFD%Enlx0nMU_T<,r2pA*a*LdZutt)<[iK01@Gk;^GGp:q-WB@4]AlhXci[7&tNU2_Yl.'M19Kb4N5bxY%tAVia'q6adw'-6SU/jCoCkP#WQ(-e8P/Rii,'$sS>-pqK_l#[,e%-G-16gAPqdcpm3X+Es/vf=/.sUMVaA(,_JUL@>)Wl0w/d'12[dFrdiv_LGvBQcb2/sGLa^wf8of<;P0eZp?ct>asnO/+NwDr;56^i=c^JP/EFU_*'SfBXXqIq>nEm=F7,?aND$4>/'TWaUZw1d2w&m>I]:i)jOgM4TDRvZRH[gTS&[9WXv^p.bnM,xCM`ImtB-6gTY].A5)[1>U<fvefOWO@/`RE385<ewO<8mlO>pCD`kw5rWJNZX$R<#*1s1,6XLr-#FBKng_%DwF6FGPgrb[-.I&NAklAq7uN%@]N6X]r,OWmpY$g_'e#@r5PsM6-,M8@%'mJps;fqa^+ravHKB]@Ul2m(W-K%P/1r,?Vc;(G>:Z$n=u$tMUI`Gj2giNG,mfTM,iQhdK5l1UOi:W(pg(0&Qtd%Jx5h2iwXOjetX?aa]$*Lac`t3551dI[cETQvld]VR^W%JY.ef=WeNj:CWh;8UwTheQarLFo)T.J_G#3OU@;gsWpF:&7EL/v)Y)E85dccl[A-@uPXVjkWW;9E]Gp?<kda,kq40iZ*>uaGkLjjKH*,P?ITAa$hQ1livddfd6nuWLUYSXTRS2PEio$6IXG;go^71OtroYPeO>blDjC6D]mTB25Whw_CS7#5Q%R]e=R>(oC`Y6L]DA/'H5wsV9m7tjHSMw#oISp0)NeA%UwQEKEth%FugK36(fd@6VbA07M.ZXdO(KTeE(j]]9:IoJ=dcZ4BX[tC)n=M[fDmiJ&:uqdic]]2+$PKEtN6UD<=l0g(Lx]d:0U]p&Xh=6`rm6L,<PBFD&Klr9IW2,,']-T.w'U9F*5;3F.%'C`[#;36iSD,If=)I2JU,Inlps?gBH-XLopl+-5;@M6HSfh3&HF+-OJSikToH<o&-v]gc+)2I=il@V]p56A(6U9nZ=+(7,kAQUB/4e(+U'ip[Gc=Z$9_.q)9ll:)(SVk:<hfRAWm>hrZ<3HXCmrep#*1NBsO5eM/6%lhY$F@16XJ6m^v]emcUR5/6'53p`CWunSgD8L^gK)cQZ(3rhuv))mM%tm+s21HChbR*[,jSJ^&]([W<iL2dZQ#*OMQoOOgtv<?4)BY)oka2nneFRt'M#-HHkGYWnbdS_E5;%X>_)#]mbV4d.bjRe9k6?^GF:dq1KqZc:sQR&;.X$@_LUB?,NJ1c_oZs*4aZb/@mTd`h#*JEqTNL`+)M7<[=Kr]Te*;3/_P'bB@DZN?.ssw?%'uk#Uvhorg)BZBq8XpEbg?5xad3%=JuV;*^,<=_]]nBwonI(''P]bOK4s;3T$Y94E/n'*B=JJqn#iMEIhJ-M#P[1w'd4'M`E[,T8V^-eG$8KVpG6pEs)UHY'W[i5cPt7-:w@TWiWxppNq$]h@-Y_M*<q^S)19ljue>g_>MJ87O#oxiaAf?@S.*.Z/Q%F^6#`$&#m(v7mZ;Z)t,o.O,CAXk;SFM%X:_bl(AH*XhS8Ro0VH9:s(_w44s+:mMQW#b1vZW7iuTS'p:&R(T^%Nmm`RQa;0HV;<LrP0Z7ZLS0'Ai'4h*]tf:Dl9che-glmk(]JC*iHZbvs^p$8]3^7M$M*rY)N9Dtq@*7._u7c5.Ms:o%[C?N^=FX+%CWg'#I8SC9%+Mx4=fmqo9Gr-$STWRKGhHa5u5T6W_:9@7QmV]0FEGA-wOR^#<9EV:a'E+'<$xUm*,tufvopHY>47HbZX%6pd'KVb.+YQM'eRZm),^r=x-idC72I)U4/#sHHHCq6FM(x,O4`<;/f:<(6.Ms&LS#T;E6Uj$<-A=#/rsEH'&nbEGX?-7*]#]kZiF+b`XwjD95Q7Z.8Z8ZG#i12vixVs^5.4OJXkDVU_jkq[-b1M_(=]agLOt'<g(RShl717sXb@L;pE2CwrX<'/#s3c?4bKx3,0'SsIi8mOY-eunmo?Bn-G#.7>$[']:7)`j?C=F*gl3iA,95O(324kDNd0IP=A:m,kFh3i<Ixs*=Q20Rff4X@n+c^nb2XdIG&1>^45oMjkIM$bP>&p=hkZs[HaUdL'CKL(4KD6RTC6qvUr9p[`c6V-@rYI2jb,PK*8;8EWrPfgAL@fFCcpiF7GYe+&wPUh/35;QdnE@AoR;'o*Xj-G=PCdag1PiGg7sa/I'a3X*`iE6kV&HkE:D#jA/MAkc%+`jmCw8+'X`7@@'7(H3%Y`=d;H-A?)fBhb8eACS>32X+Ck0JuQ,@uBv@6+$;NceV6M#[CaBQ>7MNl2WZ,So9G7=4kK@l@r?$MARVZ4J>0#MScCbl5HDi>FtBd[t[G^1%]jM'R=ZYpZNcv%viubhE%Ob'Ie5k6hL3#Xtja7*+ZA7G89=Yd'll6vQ+-jC6O0[j@ZB7Wf$(Err,/xk/c@,,BC:T8L_E/K>ECN/40sq`6E%5+D.V&X]+<M_En_b=*]w2M[U&c_Fc'7s#NJH_hCZ*oA=qP0Ot&S_U;x<L_mJ:<O)(A/nliuMEb:g?MMtSnLB==4XIJF[tNxqb'ic[&@_p0+K^iM]muH>:(/$Y_RY*HlC$$^?7+'Lkjqe><drPCR6^[*-R/.^SfYBPcT15DZBPPvMtD:Zu;2:7X9>dl&EJ-Fw&;<i==[Dk<9/Hj:r(P7QsX-(<mR=$B29PeR;]vs%q'[chWFiSUfi?[.ZkE(6=9lux3+%N)[m?tW1iHOLAoj6alWR,5QYJ1.*GS0iV726cZ4%kcDOXfe[@WQDV#I$r(>7(a5Vv;?X5Z<1mQ/Ouu%O3B)$[BL:@+IR(f7f=Qti$;[:Fl?#?9-n?N;E`u%-lKk:Q-^M$#mm?)*jj[#ksa1O94wf?d3uQ$]+k^u>f@]ex)=aN_>>&r,pee[VE_G&2unsR)0LM'[g#:BiV[$#/f&mbH]6WYspCgL^l+0J;[[eow%lebnR.0?0S`h>1XDVh&xKGgwVK>aL&<^RjE^%6nYOj0%>p1lC:YE[sVl?9Lr?$9)R1/]XeXkU=rhwbcF9]sF1;QK[8xI5X0,`=^S`'e[^qg+K(A,sCqV6;mO$VZf8i<Cio6h^l#dL#:=(QiSkLm#UR1,)J*%CQRS`DpLjB.4AkRxhr2kr>.;LfUv>2YReiUF'6S2:nfSV+XW:.Q*STh]Ua5dN#^PEkO/:)N`<]t#t?J6Pf?YJ%g#8mT9([GEda=gG%&-5e>3x9oRR't4`IYks'%5.m$ib7D&mc#:*g$G/F@*U8rQ=>/t$@pI2sPZ&C4(E9ZEeU[ar[L4V914Ktk$R_TwNKVlw)QDg<KLSMfE'3^0wn4<bIjN:_286@5R@?^h)t,#<nlo,1^Rq%?`]$2_T$eipj,ePc_s60O3@BnMh&(?PZaTKJZ3sRsqCQUQP8x_iJ#nq+iovmnv?;AkLIZJ^QrIci+p/M6d--n^a7AhB_Sk%l4:CHaQxHi9?E,$mI<#sTOdr`:Xh]6m29=[.Jwra`'][KJkofF$Vd)l[erhUBSiX,PI):t`EtJ@dOqGLVYJ4.@6ppm2%(:V`F82o?dk'8t?AS#(?,*`c,46H8=%<3.Ul6oW@GPf9(>tr<#X8kp%PDI.brMAM6x+A4G:(d4k_%&;@=^@k1q^&`mKWR9`lnhf5XBT=]0-qPRH<B4;QDpK+ZNuu.7aCYr3IL`:%?BdI5c[m&sv[sH6vrm2[Cd1h1`j.%g+0tptTNulo2Y8an&n23wqURvv-PjwYTBW*&)FnbeDLWZ.?/VL0=9vHY)fOnW:+0p$^TFM*Oh<%70$VpdZ76A@rjF#-;^BIL@M%G3PUP5oH;]j4L3U+d4lXSw#X1-Q-*ZYJ9kVgk(m'^:eMbH3Y/hp%#KAvH6b&]5v-E>Q9qel5`RYo)%YgMHoGS>-L]R$+$Um/+?6kLa@qckro5X>SVr26QiC66hstCeL7d3<=hiwe$M#lNw8`GVSbgG;v(d.9ARHFF<=_bTIp`2sP*kf>1qAYZL'kPfhbCO?(B#4Vso6Z<R^D>Sxl4I0JJ;=uL)1O/6lSx%i(Q'w0ZJoDV61M6o_,XCQXPTR8mg>L:npwhTRf1wg*)^ava^NMj#[]6^k?D]q:+Q=q61Bdg+W2QH8LMpLii/suW*wr$r%%(>P=I(NDZU'dUMUi84)hA96%%Yo-nEPw,Ld&mv+Hk$4WP-n:+?HjOBJO)x<T(rUl%OZu8O0MptY:hr^iOoNV>7<>[&ssDukNui4xkJ5P)Fg+]/-f1bTw*>1e-[HBM>6'G&hnR2+f<hO#s0<+o,Rt[UID3`MpNtd>9hkq&4'pK'TWrlVR,P>K/o`oaMK+3f)P^Gq.t`k8dk%at8tH<O0niHaVV4SPMj;g*LYv1[r%W=s6?;o=QW.H`3JsnxQi+O1&FaKcYA%3;?uo+Ioqng]1mil>TYNeVdjoO:&RRlF;C2*;409QXBRtiNdY]beei>:pjvWpkTr+77&L4p,wphn7#:`u]m&P6[XwvH;)&VX$Vt.1glUuD`X/Y&9hr5I+DIY]%rLKYk6]vH*0<8tbsLsH6mCFWTA5i@T,L@K<h5p[tn)Khks>MR/=F?#5NteD@_NB>B';5PDr5-sO?ifW]Wb)8v3Qh]snVp1p@d,a.A8]9f/T3,Wq5I9:4u+R@82lKc[ib'G_kIFM?#>ZHJ(FP&+:vj(rYRbe0LHHcP^2&L'2Rbjw8'bIP-O5,r1&/f[gd,trE`B-KjZC`np`]O0O9c<Zu*&:R5D/(W?tK0FjEn6WYQtE4[:_f$EsaQtaNde$[n::sM/UjtT?t[q^61P$6D=^><Q0sIg0sLBZRI_l#+X:KJ>8;cEQI/kkU,[*Ci*>DP$sGWV,Nr;,TNjUKGWg=R-D'x/f7ll5D56).[$p'&s]S)fc#b?W;Mub+V*B7sk_/;2QkChIr3XHW-dc^OJ/d4'pd0o@afU%nUGi4:ccQFFWu3OKQt82OM4HcY:@ef;n(4_Cgk1rGAHHZ6?4sqeqC*MVE5tx,OdLec/JTaEoHA9mVLnOf'5C7@T47@xec.R1[N2C]#:AxrsGRf[df/vdg:EEZNT@%*IoHAJ]bW4-d_A7q`kW/egC1X]t4a`.Hf(l4)eFQY&PDw0:U<_Vaou2T?_><j$c7+t+OKVvEu5c8SuM-EJ1s$II'3t]xebhhV(<<>x'^&+q;-,(S%Y70J7;76*/mcT3h?Ku>?,i4^Fm=U5^<d(OT&(*naE'u<)Kw,;mDtehQ9o6U,WoEOX44@=9ho/'dfJ^WQ%/Ku*>@oB'gYf5VA0,03:<Qh.Um.VKc&;6aY]/E)`>JDGEj6q,2f&d>5w#3TkBuo*%?<]hK5;uI+Tn]d6w(&@VI`c1&'wncG5p+0KHBkergq.?N[fBFkDXwS+>B6)nXISMqQTxmie(tuVg8j+_B%KI+*eZlO'1;QV0b$IH<.=CPcO5&gT5+.0J*1:AZ@D?S0RK?oP8l%g^p%IQTTKKoe+Uca>cZP;lfi+*meTr$(Nk/`=;3a?Q,m>:Ye/t/%joXSOd]iwwE'Q54sC$GpOTTe;=0Pdn0iV=65crsZT=#sMXdlD$]xRrEd_N.i`p0?+'9=&=%oquJX^KRVCkSnw^)@cG$Gd*YZF?Un5SCc^-5Zffm243H'4Qw:EqqE2=-CP0pB6Q*<B&#apk8f'EIiZ,)$M0u-DC8Y'+dF1JVEYp[_M6x$*;oqeo4s=_/[WpRD0m/mVlJ7`BD8-RPk9?&SHWEfle/EcOm0GTR^GD<It[#/eY03o#4>Pc#e:;1gtMQBjuWNMTV<g_dlR::XIW4EGdl;8&/g<0m4ERgfFW6)RF$pvHBrZF33A)n's`*,j^g=$QX6]c6O7.#l[u2%bt)A5*Ewf(-_i^22Ct_^d7*WVfuLt'mDBLmA2_^D_&'W`1OEbTKp+b8V>dW.l`uTU%TSW8JIE#j24:']>H;GIl/^C%W`Gj5$:_-]maA4W8bHw;2c6rNjPJcA<jPPXE.#0kV+bFWoAmfojU=)huTL?F$m&<_[V(:p@Vq.pUinfs/#4e]a@N#iA03v]t=gNHlDD<8_&]Z:DXErw][tGk.8KgNsnrZ$q&>bW9a^946lI>c`Mwj7cGK&a:,$(&M,XC<:^b[1+[$*2(1NffJ8Ij-*9;xvF/F['Z@TrJMf,BL_[1)68me4>sL*-PHNh1#WWP]ZjXTEDYrwES%Jd5Ki.xqKGSa7Qwg_LtwuN=KnHtEa'T&%RJqFVh+$Q)C:;l*Yc=.,00'W'x4$g^9NHJ=(0I26O/1(faa8nj>d`tMhcS$M8WJFjC]8:lJE<NO1/UI9k^2`r-cdXi4c;%EBD#9N=Nb6A,dNgY09UV.*lc$%Ltqc`qA(&0Z%r.cNrdcTv87ox:a3Z/N?d(3oEj)H]5r_aO-0E^44:7$Y5UADVo@DDQ@J?7b9Eh#c];)P@JA@-v0OicMFCeI(NFba9w3Q6&lR7)-Zpxvt(1BqRe/na3[i7VO>SP%#AEJp7X#dOer4f$2XId0M^='n'b2F8&(=jw7G4R=a2Mm8;]siVTp/VKeXtbXvjn4PC/HUJL^GeT<-OT/F;*wL<w=+u[#190-Tar0sAj(<7_;obmpj0#:B[Le0Nfgkbx0J3^-UqA?A0m_TSDvkk,S0:<c'Ii*Bapaj<pS?>wapD<gGZQ;hc:IGr)>,%5oZFV[%5$bKr1HdKGRO>W3<*Qh-t';&N:$]5AFMOwf/L+MAb)SX3j]eMq6Pe,0.=Ei0qMVt3aRM>7,9evMOT[lcm*U>C&hZ.'KDK6#;4w0DVKjR-<gi1dk;^U8#b%[`>J;2485i_T7Q;o`=1woG/kC*qb?bH#thb6h]Vr;$,P*sVN'QW<vg[S>=o/nWBgYM?akw;3[2)>J&=x9H[:ch[`S#;hQ2u>C-Va<ltN8)jOU&UIFpZ&>2EC$ZUqN*[/$/X9]:woTe;aJDHWT(?`N@ciCY.p]a4WD*mn^_'=3#(`5&oZf.h4a4-s9553wNrEL=C=Yt/'q]aGP&'>fl&PwWCC-U:'h2N*KApS5&r=i#-;Y>HD,*/sLS'`M'%#.QW3Vha<;]V&[.-,@cxl,;-A<o*cNhIk*=H>4co,8b5FhKmSh-b<OwRkOrqY$Qhrlo^IuR6W37jV678sHY(L/ea25ZSM(:)nYKrv5<N2LD4M;ZZ60i2&5X_.j/;HO@KuBbp'G$V#v)//HgMYhs*?2L]FdITT2pSMPLcl@j'2,Y5wb+V-Y8[%K)*diJR_Rk(?gH]hq#rE;gX[sM]i$gMId>$SotH4_;ZtDc7Y)J<O`IgVMA?)7<RLt'<ZxQY2;'I[E_2peRCg&]s*XR7x+hmJ_<I$dr'k#RJ__[]<81Wx-Z0ho>-+^tHKx]=oF`]<Z(]T[Co37VP]Zrf5:-G<fr&?s.N5BRf:Ch&5jd<Wg9M9RTO4#MZRRI50oks+@L>EAF`+)(Dtc$'jU:IC('+Gq$3:0+5/%$:QJNeuq<6%>>U4lp3%s1aJ=``1GVj%;i1$Q[(cam`@/Usv4B'L-'c?&ZR)R,0mnc<^hN;qHX@`VhtcoYCk)V2pGsP/Lm-9hi-XAjkqcev,d##@</s=sLlY+iGc*3?>f0fZ`VkSNeX`TDhI(<TWehOZEpt<eRF$XgQl3v^+t<J$T?TIo,R.%Xo?Hb[.xv'fM[<-NexSSrRei2Kw[6.29luhZ1X=/^8^k=lf>La.2%PeZFna3sV2rH7UvX%ux-`KG8.fEMR7R(tqdL:U6:kvoK'0$X]*11eeAg+edNfIq@PHg]paX=.'n2YJwpI2YW_F>9H(ofM$LBI',#x`Xu#Q_baA[../T06GQ``q14IdKO1kDwH>cQV_:Vp@H,vptmNMgt.+,XlVY1KEVUQKQ)-.vC8uG)s?@Tk5/Iwfa$(xPM%AqJKc;'seoR+GQe$]UMXq]#'Acw'i-X)=)JeZ,un>Y5b#5j/1KwevhUSv/@_mtZ@OQ$a2=dP$kA4UNoEx1?V4<TuEif;ZWMRr3mm-fYQLY=2l:NMVF3fwr]CR:%VMZioU2k*+SHNsDA)aH(9;9CabiW>WWbWQNigS[f^fqt08n:5?@6Bw.^)d7G1(_3=V_c2#GYf:1x-pZjlnMc++u_C]7/U5E.S;9>&BdHh_Po8%6g4I_wo4:HvXSL`UY%(bN=N@[?][LZtroOf:%/#.^N`g&4PsUUi[tBfgf54Yi6XTO>QZ0uxv'[YZQ=ReaeWfm+GJQcheUd)l9t:eSd[iDH72IQNRgage?w2w^',I@Xr&aZ4>Ld,jY[v`s>B*2g@.'h?GPa5h&R(#]Ze&[=QSkKTc3/u9dm+TpWV*/cpvN)c/MOMU:Vb)x3]VR>4c9#Pn<s>ob6K=pEOsf4DG=S1*`%K7&vdlPhn@fwLBw,/+'R6(#hqX'=^G8[b5ejjkK-Dj9_q;q`qL=''N<g]t=d/T_n/3'>Q%t<4XC<Ou[V^aN(xf*KdN,a6(/GLZ[Xr3[i*'LQM/Oc/5[S@76']X*dsYtAh1M*Mus@+YOE^Zt&s^p8I:v&Iq<F8.I7[D?[8)gbhh=2oZ5jskeM<%<q_4[gr21`^6g8h&qPH*'SLs7Ql2BWC[rl4Klla*@JE>.52_Kpolio&:C-[@owPDSDdVD'7/X<hBIQkpGY*pf<25-EO$TNSVC:nete5DZ6V>>VbcJr.u>1Tm^1UaXL0uF-ZpvrOYJIHIcorh]j(uRMSXFQ:]2$:OJ:J)oF+PB_I0ruhR]V&7&[oV=tCou2=3<j02PDdjdM7WK2Kb#)Qs*cZq43O)+4m*&M;[#R3RU,2GbK*Wbq(-;l%.i>3%AhUdjN4n][ks9Jtd:4pL=tnonScGiC1ZQPcCOR$np2bAUbAX:KHLI#GsvAl:-j/^PlDs[v^;'Afn$5H$V^uHtPO%j[Z+4)n:$ZlwJnMet]XF^G3dQp#J[*[MPKG3Ug01F;$/R#kj$3?39pn3qb=,:dn?D8&dR`$#G$-lwoisMCWNtVrF2P.+_Qi@CwYn4]+(hR8.ZJ+%RtA@Mo-5;O,;8lHae&*WV.9-8rsK61J]aCfs]^Twe'o%A7#Mu]W:H:4/%rr'J,9@4wxlA-3[X@+gi,>HO;pKMACI-cK;D3.BJsqosN*2Ub28W>%,^VkvXx/-r$Gj_+q^7>YtN&nr#>GSKLXBa/AWCquKSQeKvqc2#&Jgg-hx5#&Y[<wh0_9crX20RP$t:pgx-K7&flVuu[K+g,L1OQ]LF'Li3],xZOMEN;exO]$vs:k2xH&@@=VVwL/ZPGmxdoW]EO@O/ZNlXV(a-aY0Y/wOn6,IBx)Gr<23acE%%bN?bw?-kDxC58=lE/[->3+V^,#&G2/o_:';-i>lwL.jT2k)?RlFJ]d@3iX0Kl+VbisS]P?6AZ8c8w+8ef`HqUi@:(a>h5xp.OHk8Zt_o^<0*.t:5LYGDh+cXP:`u25Ci3j64*+#iYL`g0#-nxfX8@<Z5E@H36fTL1_jl6--F3nqS42Gm(g0Fh^nH*5kCu0JDe>PH<pdrK5B1Ym%-e;%HQ6'$d4%f8mjKA5p@3J7Dv/]#FZo^MfOS*DQ@.]i2o0.^$B=KQn*+#-$ZVG]/jt>NS+.wisV86UbLV*.[xeI`05Wo#7:)qL5]mEPO.Z2gX=fd=BM<.9w`?cXOemh'3gi$X6H,%@p..b#]l14Q9OmAE<0QJrGvL,'k4DPj;pFl089ll8CoH6=&Jo2&h7EfG`uoo7L,?'[kWB5()x;Kd[Eb_OoHirBGZl[sWsdBT7TYU<*$aG<GZ<,X$=Cgnfe4:Z>][X<FSiF=_7OZ5R,NR82<D6gcJ/?4b4l.T:(cTa-m>3Zlc>$^kM3x'GU[&U9#nG*^imbF%*7Y8s>_+1`1WQV2RETdE$7aI160G6;qgi]@ao*.XP^O2P@L$B]:=aQ+u@%LLlA>2,<3t3&#%Xd%k>/@wuMrlEKVbY/]>nu%=Nkmt)fFAvN$/I_090v.Cx&M9cUK07hX39xTf76+x=qMqF]_v)'i(DrKBvW'pi<b^BgbS[h]2?F?$9?-?4VopZ4]d.-+u6M,LFtI%+,o3PoHp-[j'cr/Im`kuLZGuP6QpF3phY:s_pnAdl:6Pl[BWQmYTl*SgcSA.E:>QjLYf,Gpvra=wiE0@PRaFl-Tn>HFiCC18]Bsds2YGxWb<:HVZ>Vk0EqBGGm+F.G983I.c6@x;1plb$tkVsNBLD7c.<=,ZMS+7&nA@(btGA(d0$<P;><&t$w^[3/<Z#Jic8,f3TeCQ-md(%;Z3^t3i(?4E%d#&wbn5R.k-DP[gTY)pAS4qV7_l<o>cq3/^pE8hu&;<oG=[ZbpsRVOdbe(5x(i+#VdeY+V6TfKeo0tuI3;Wahr^#US*@whF7TR0YNA5<Nc9gNo;.;jL<acH0k&kqgmX,:D*t+YjHc40thPt_Ij[kQj#ODC-HoJJACQT324Ir/%=N1X5E04=_G%s)<sIN?'pOM=WS.1gSP#4cfBh1<H.f-h<IjpfO.?s8LbIdl(n5jc0lV3:#e_/pL_DbO<LwUx._a,?cU&4u@R3q?1I.FD[A220l6HD$V[im=3i>3Wde6?S#_A[?;05cH8DxI@ZtqZGL?`-0Wfr(BK$nxC3?>v[aK#5*xgr?'FXCN&e(Ypvn3VE6Elk3+lnBTVT^fL=w3vug*s@eHsm[SBhk,<4gIdnGq)Y1u+95+&1=eu#CUA)&a;;u'((8WgCT:-@%J4e(*O.NW=X60uR*144Z6osgOI?7+[6,f2fr3.#MtKaU(b0VKRS(M;k;(K_IQ?9jM$--BEJ'+q7n?b`-Ol*.S7Mikkj;KA5ciOp@sJEVwn*EG>S&j%YK:u4hs/o/pJFpj#m[^i*j_b[wiG#AWYq_>mfH&To;Gred5N(e2J0(]8<)RZ&es>r`#Qn3&[Ls*$=&q$,F@i5$?SSVY(X4]G:4,kAb71<T6M=nbPkN8]_1;RXOS),.:pR%'U,D@So=ROD)0S$G-G3g3.E(lg+7fogQHrE[Qx-==pE'qoe=[e#YiRFkQD*^[mM[Cx.H3hCh-([)1&G@vn2,R=+u1bEY6(W5(GhD_R8kTf0tMZRXR;8Idmmf]fu<nEIbfCV[6H4tNIjCQ%s,(EuAE56_1r[ncUv^Cf-E-AVY&N.ih[ET$sKMnlCsHc9&&I1fBk:%IseWRPi86,VE#'$Uf,fFCxK9?8&=XKH/#NmKixgES#qU+]xpfZcW;#-%Z4_Tr6;,Q;6;?w[aCDKff-Jw,wrix7f?1XM%8W+Dw.l5`V>U^YoT==P%rUP^uel-_FG??i9s^oX=<PV4^lieR5X:*#GlhN.S@)<ToExFJ[k)uoC3BR$bcT<+t-(LX&:Zlt?3vO%R:A0Y3&:qa8inHF]?[auK0CeXNb@3)j3Akjc@([ZTp$EffdUdq6ij+(ttAv$[pq>oRl7F3G,odEIJTUWg[m%qoj)+J[UK?v3s;kI+Wl7+eQ$-$$L5bDs5,r[h_d+;<mVk0=uL7&OG+j)6qi#<0`ottXdVJEH1MZRniJP44qJ)Tb.5+uLSpPle+%B[D7Rl%IkSvg4F]-c#J,tG+k6mac0c)Lao*obIb2:oP^)-rOiQ4gSVvw2`DjC$d06W^oo2M8.QXN`/gkMacu7of'q1bmh`CBki3]aQMuksZ$pMu`c7hC0JY<Ig+^bBLC/a]4IM13uW#&*B+(u/M7]sbUG2kKom#M87*:^6M1E$=Qn<s8UvpwM]@9Q/2xYU&G$$k9V)oO`%_UAp]]";
| 4,161.833333 | 24,875 | 0.709423 |
685c055af84dbfe98e7a2bbcb968444350c14129 | 11,903 | js | JavaScript | public/bower_components/jquery-ui/ui/minified/dialog.min.js | slycloud/flyboard | 6b0cf9cab9f443143da77b134cd79dc163eae04b | [
"MIT"
] | 289 | 2015-01-13T15:37:19.000Z | 2021-11-29T02:05:30.000Z | src/Datatheke/Bundle/FrontendBundle/Resources/public/vendor/jquery-ui/ui/minified/dialog.min.js | datatheke/datatheke | 6b519bb6d75191de7f3adb954065a6ca88257f11 | [
"MIT"
] | 46 | 2015-01-04T07:22:20.000Z | 2016-04-12T10:21:08.000Z | src/Datatheke/Bundle/FrontendBundle/Resources/public/vendor/jquery-ui/ui/minified/dialog.min.js | datatheke/datatheke | 6b519bb6d75191de7f3adb954065a6ca88257f11 | [
"MIT"
] | 90 | 2015-01-18T05:42:25.000Z | 2021-12-01T07:15:08.000Z | /*! jQuery UI - v1.11.0 - 2014-06-27
* http://jqueryui.com
* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
(function(e){"function"==typeof define&&define.amd?define(["jquery","./core","./widget","./button","./draggable","./mouse","./position","./resizable"],e):e(jQuery)})(function(e){return e.widget("ui.dialog",{version:"1.11.0",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"Close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var i=e(this).css(t).offset().top;0>i&&e(this).css("top",t.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var i,s=this;if(this._isOpen&&this._trigger("beforeClose",t)!==!1){if(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),!this.opener.filter(":focusable").focus().length)try{i=this.document[0].activeElement,i&&"body"!==i.nodeName.toLowerCase()&&e(i).blur()}catch(n){}this._hide(this.uiDialog,this.options.hide,function(){s._trigger("close",t)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,i){var s=!1,n=this.uiDialog.siblings(".ui-front:visible").map(function(){return+e(this).css("z-index")}).get(),a=Math.max.apply(null,n);return a>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",a+1),s=!0),s&&!i&&this._trigger("focus",t),s},open:function(){var t=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),void 0):(this._isOpen=!0,this.opener=e(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._trigger("open"),void 0)},_focusTabbable:function(){var e=this._focusedElement;e||(e=this.element.find("[autofocus]")),e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(t){function i(){var t=this.document[0].activeElement,i=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);i||this._focusTabbable()}t.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=e("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),this.close(t),void 0;if(t.keyCode===e.ui.keyCode.TAB&&!t.isDefaultPrevented()){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");t.target!==n[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==s[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){n.focus()}),t.preventDefault()):(this._delay(function(){s.focus()}),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=e("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(t),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title||e.html(" "),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var t=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(i)||e.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),void 0):(e.each(i,function(i,s){var n,a;s=e.isFunction(s)?{click:s,text:i}:s,s=e.extend({type:"button"},s),n=s.click,s.click=function(){n.apply(t.element[0],arguments)},a={icons:s.icons,text:s.showText},delete s.icons,delete s.showText,e("<button></button>",s).button(a).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),void 0)},_makeDraggable:function(){function t(e){return{position:e.position,offset:e.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){e(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,t(n))},drag:function(e,s){i._trigger("drag",e,t(s))},stop:function(n,a){var o=a.offset.left-i.document.scrollLeft(),r=a.offset.top-i.document.scrollTop();s.position={my:"left top",at:"left"+(o>=0?"+":"")+o+" "+"top"+(r>=0?"+":"")+r,of:i.window},e(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,t(a))}})},_makeResizable:function(){function t(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var i=this,s=this.options,n=s.resizable,a=this.uiDialog.css("position"),o="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:o,start:function(s,n){e(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,t(n))},resize:function(e,s){i._trigger("resize",e,t(s))},stop:function(n,a){var o=i.uiDialog.offset(),r=o.left-i.document.scrollLeft(),h=o.top-i.document.scrollTop();s.height=i.uiDialog.height(),s.width=i.uiDialog.width(),s.position={my:"left top",at:"left"+(r>=0?"+":"")+r+" "+"top"+(h>=0?"+":"")+h,of:i.window},e(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,t(a))}}).css("position",a)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._untrackInstance(),this._trackingInstances().unshift(this),this._focusedElement=e(t.target)}})},_untrackInstance:function(){var t=this._trackingInstances(),i=e.inArray(this,t);-1!==i&&t.splice(i,1)},_trackingInstances:function(){var e=this.document.data("ui-dialog-instances");return e||(e=[],this.document.data("ui-dialog-instances",e)),e},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(t){var i=this,s=!1,n={};e.each(t,function(e,t){i._setOption(e,t),e in i.sizeRelatedOptions&&(s=!0),e in i.resizableRelatedOptions&&(n[e]=t)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(e,t){var i,s,n=this.uiDialog;"dialogClass"===e&&n.removeClass(this.options.dialogClass).addClass(t),"disabled"!==e&&(this._super(e,t),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:""+t}),"draggable"===e&&(i=n.is(":data(ui-draggable)"),i&&!t&&n.draggable("destroy"),!i&&t&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(s=n.is(":data(ui-resizable)"),s&&!t&&n.resizable("destroy"),s&&"string"==typeof t&&n.resizable("option","handles",t),s||t===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),e=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),t=Math.max(0,s.minHeight-e),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-e):"none","auto"===s.height?this.element.css({minHeight:t,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return e(t.target).closest(".ui-dialog").length?!0:!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=!0;this._delay(function(){t=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(e){t||this._allowInteraction(e)||(e.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var e=this.document.data("ui-dialog-overlays")-1;e?this.document.data("ui-dialog-overlays",e):this.document.unbind("focusin").removeData("ui-dialog-overlays"),this.overlay.remove(),this.overlay=null}}})}); | 2,975.75 | 11,769 | 0.743678 |
685c1e897422780969f4cb1371429229929f1a20 | 728 | js | JavaScript | app/components/Header/BrandTitle.js | nmrf/sadata | d3f0c861f0f8786c914e8df0f03ea3719d7fe35f | [
"MIT"
] | null | null | null | app/components/Header/BrandTitle.js | nmrf/sadata | d3f0c861f0f8786c914e8df0f03ea3719d7fe35f | [
"MIT"
] | 52 | 2017-05-28T23:04:05.000Z | 2022-02-21T10:31:34.000Z | app/components/Header/BrandTitle.js | nmrf/sadata | d3f0c861f0f8786c914e8df0f03ea3719d7fe35f | [
"MIT"
] | null | null | null | import styled from 'styled-components';
import { palette } from 'styled-theme';
export default styled.h1`
margin: 0;
padding-left: 10px;
text-transform: uppercase;
font-family: ${(props) => props.theme.fonts.title};
font-size: ${(props) => props.theme.sizes.header.text.titleMobile};
line-height: ${(props) => props.theme.sizes.header.banner.heightMobile}px;
@media (min-width: ${(props) => props.theme.breakpoints.small}) {
padding: 0px 5px;
font-size: ${(props) => props.theme.sizes.header.text.title};
line-height: ${(props) => props.theme.sizes.header.text.title};
}
@media print {
font-size: ${(props) => props.theme.sizes.header.print.title};
color: ${palette('primary', 0)};
}
`;
| 34.666667 | 76 | 0.664835 |
685cb593be38f52ab256f3bc7bfccd7c59d8bc5a | 1,275 | js | JavaScript | src-back/logger.js | walkjivefly/block-dx | 513ebe9364f855ac0d10019e1589f49ee5986973 | [
"Unlicense",
"MIT"
] | 35 | 2019-05-05T06:26:31.000Z | 2022-03-07T20:25:31.000Z | src-back/logger.js | walkjivefly/block-dx | 513ebe9364f855ac0d10019e1589f49ee5986973 | [
"Unlicense",
"MIT"
] | 41 | 2019-06-10T15:33:24.000Z | 2022-03-09T22:02:52.000Z | src-back/logger.js | walkjivefly/block-dx | 513ebe9364f855ac0d10019e1589f49ee5986973 | [
"Unlicense",
"MIT"
] | 30 | 2019-06-21T05:04:31.000Z | 2021-12-30T11:20:21.000Z | const { ipcMain } = require('electron');
const path = require('path');
const { createLogger, format, transports } = require('winston');
const isString = require('lodash/isString');
const isDev = require('electron-is-dev');
class Logger {
constructor() {
this._logger = null;
}
/**
* @param dataDir {String}
*/
initialize(dataDir) {
this._logger = createLogger({
format: format.combine(
format.timestamp(),
format.json()
),
transports: [
new transports.File({
filename: path.join(dataDir, 'main.log'),
maxsize: 1000000,
maxFiles: 5,
tailable: true
}),
// new transports.Console()
]
});
ipcMain.on('LOGGER_INFO', (e, str) => {
this.info(str);
});
ipcMain.on('LOGGER_ERROR', (e, str) => {
this.error(str);
});
}
/**
* @param str {String}
*/
info(str) {
if(this._logger && isString(str)) {
this._logger.info('INFO: ' + str);
} else {
console.log(str);
}
}
/**
* @param str {String}
*/
error(str) {
if(this._logger && isString(str)) {
this._logger.error('ERROR: ' + str);
} else {
console.log(str);
}
}
}
module.exports.logger = new Logger;
| 19.615385 | 64 | 0.533333 |
993fa518d791291269ba3b968c00428f1ba0daf8 | 2,992 | js | JavaScript | packages/core/admin/admin/src/content-manager/components/NonRepeatableComponent/index.js | canh7antt8a/strapi | 11f3519710b77042fc58b787acd46288930b510e | [
"MIT"
] | 46,173 | 2016-08-12T11:50:57.000Z | 2022-03-31T22:36:15.000Z | packages/core/admin/admin/src/content-manager/components/NonRepeatableComponent/index.js | canh7antt8a/strapi | 11f3519710b77042fc58b787acd46288930b510e | [
"MIT"
] | 10,397 | 2016-08-12T10:05:15.000Z | 2022-03-31T22:24:00.000Z | packages/core/admin/admin/src/content-manager/components/NonRepeatableComponent/index.js | canh7antt8a/strapi | 11f3519710b77042fc58b787acd46288930b510e | [
"MIT"
] | 7,214 | 2016-08-29T12:14:54.000Z | 2022-03-31T18:46:21.000Z | /* eslint-disable react/no-array-index-key */
/* eslint-disable import/no-cycle */
import React, { useMemo } from 'react';
import PropTypes from 'prop-types';
import { Box } from '@strapi/design-system/Box';
import { Grid, GridItem } from '@strapi/design-system/Grid';
import { Stack } from '@strapi/design-system/Stack';
import { useContentTypeLayout } from '../../hooks';
import FieldComponent from '../FieldComponent';
import Inputs from '../Inputs';
const NonRepeatableComponent = ({ componentUid, isFromDynamicZone, isNested, name }) => {
const { getComponentLayout } = useContentTypeLayout();
const componentLayoutData = useMemo(() => getComponentLayout(componentUid), [
componentUid,
getComponentLayout,
]);
const fields = componentLayoutData.layouts.edit;
return (
<Box
background={isFromDynamicZone ? '' : 'neutral100'}
paddingLeft={6}
paddingRight={6}
paddingTop={6}
paddingBottom={6}
hasRadius={isNested}
borderColor={isNested ? 'neutral200' : ''}
>
<Stack size={6}>
{fields.map((fieldRow, key) => {
return (
<Grid gap={4} key={key}>
{fieldRow.map(({ name: fieldName, size, metadatas, fieldSchema, queryInfos }) => {
const isComponent = fieldSchema.type === 'component';
const keys = `${name}.${fieldName}`;
if (isComponent) {
const compoUid = fieldSchema.component;
return (
<GridItem col={size} s={12} xs={12} key={fieldName}>
<FieldComponent
componentUid={compoUid}
intlLabel={{
id: metadatas.label,
defaultMessage: metadatas.label,
}}
isNested
isRepeatable={fieldSchema.repeatable}
max={fieldSchema.max}
min={fieldSchema.min}
name={keys}
required={fieldSchema.required || false}
/>
</GridItem>
);
}
return (
<GridItem col={size} key={fieldName} s={12} xs={12}>
<Inputs
keys={keys}
fieldSchema={fieldSchema}
metadatas={metadatas}
queryInfos={queryInfos}
/>
</GridItem>
);
})}
</Grid>
);
})}
</Stack>
</Box>
);
};
NonRepeatableComponent.defaultProps = {
isFromDynamicZone: false,
isNested: false,
};
NonRepeatableComponent.propTypes = {
componentUid: PropTypes.string.isRequired,
isFromDynamicZone: PropTypes.bool,
isNested: PropTypes.bool,
name: PropTypes.string.isRequired,
};
export default NonRepeatableComponent;
| 32.172043 | 96 | 0.522059 |
993faaeb75f593371536335d07ef40cf65bbf4ce | 2,483 | js | JavaScript | assets/custom/js/robo.custom.js | thiagothaison/TaskRunner | a2145302b6f10de3efd9645c98deafdaa87d6013 | [
"MIT"
] | 9 | 2016-02-11T03:14:20.000Z | 2020-09-29T10:11:45.000Z | assets/custom/js/robo.custom.js | thiagothaison/TaskRunner | a2145302b6f10de3efd9645c98deafdaa87d6013 | [
"MIT"
] | null | null | null | assets/custom/js/robo.custom.js | thiagothaison/TaskRunner | a2145302b6f10de3efd9645c98deafdaa87d6013 | [
"MIT"
] | 8 | 2015-12-11T19:27:30.000Z | 2018-05-15T13:52:37.000Z | $(function() {
var check_server_status = function(){
$.ajax({
url : app_u + 'servidor-node/status',
dataType : 'json',
success : function(result){
if ( result ){
$('[role="server-status"]')
.removeClass('text-red')
.addClass('text-green')
.text('online');
$('[role="start-server"]').hide();
$('[role="stop-server"]').show();
}else{
$('[role="server-status"]')
.removeClass('text-green')
.addClass('text-red')
.text('offline');
$('[role="start-server"]').show();
$('[role="stop-server"]').hide();
}
},
beforeSend : null
});
};
/*Funções responsável por enviar o formulário por ajax*/
$('[role="ajax-form-servidor"]').submit(function(e) {
e.preventDefault();
ajaxSubmit(
$(this),
function() {}
);
return false;
});
/*Iniciar servidor*/
$('body').on('click','[role="start-server"]', function(){
$.ajax({
url : app_u + 'servidor-node/iniciar',
success : function(){
$('[role="server-status"]')
.removeClass('text-red')
.addClass('text-green')
.text('online');
$('[role="start-server"]').hide();
$('[role="stop-server"]').show();
}
});
});
/*Iniciar servidor*/
$('body').on('click','[role="stop-server"]', function(){
$.ajax({
url : app_u + 'servidor-node/parar',
success : function(){
$('[role="server-status"]')
.removeClass('text-green')
.addClass('text-red')
.text('offline');
$('[role="start-server"]').show();
$('[role="stop-server"]').hide();
}
});
});
/*Verificar o status do servidor*/
if ( $('[role="server-status"]').length > 0 ){
check_server_status();
window.setInterval(function(){
check_server_status();
}, 2000);
}
}); | 30.280488 | 61 | 0.384213 |
993fe94236b5a5fae610d25ffe16c2876f7a7504 | 931 | js | JavaScript | node_modules/nhentai-node-api/lib/search.js | DavOFC/DAVOFC | 71aaf2ad71839a9da2c8e92263a3a9ecc6954ccf | [
"MIT"
] | null | null | null | node_modules/nhentai-node-api/lib/search.js | DavOFC/DAVOFC | 71aaf2ad71839a9da2c8e92263a3a9ecc6954ccf | [
"MIT"
] | null | null | null | node_modules/nhentai-node-api/lib/search.js | DavOFC/DAVOFC | 71aaf2ad71839a9da2c8e92263a3a9ecc6954ccf | [
"MIT"
] | 1 | 2022-03-29T12:24:50.000Z | 2022-03-29T12:24:50.000Z | const req = require('./api/request'),
{ RequestError } = require('request-promise/errors'),
{ previewScraper } = require('./api/scraper')
module.exports = async (query, sort = 'popular', page = 1) => {
//checking args
if (!query) throw new Error('Query cannot be empty')
if (isNaN(page)) throw new TypeError('Page must be a number')
if (!Number.isInteger(parseFloat(page))) throw new TypeError('Page must be an integer')
page = parseInt(page)
if (page < 1) throw new Error('Page must be greater than or equal to 1')
sort = sort.toLowerCase()
if (!['popular', 'popular-week', 'popular-today', 'date'].includes(sort)) throw new Error('Invalid sorting. Must be either "popular" or "date".')
const $ = await req('https://nhentai.net/search/', { q: query, page, sort })
if (!$) throw new RequestError('Not found')
return previewScraper($, 'search')
} | 40.478261 | 150 | 0.629431 |
993fead94c1f422978aa5348a41a5b89209cc761 | 1,547 | js | JavaScript | ESTELLE/src/assets/js/main.js | anaschetouan/ECommerce | 88f3a16ea31ba4ca20d390dcc5f77f4b63af5ba8 | [
"MIT"
] | 1 | 2020-06-03T13:02:37.000Z | 2020-06-03T13:02:37.000Z | ESTELLE/src/assets/js/main.js | anaschetouan/ECommerce | 88f3a16ea31ba4ca20d390dcc5f77f4b63af5ba8 | [
"MIT"
] | null | null | null | ESTELLE/src/assets/js/main.js | anaschetouan/ECommerce | 88f3a16ea31ba4ca20d390dcc5f77f4b63af5ba8 | [
"MIT"
] | 1 | 2020-02-18T15:34:52.000Z | 2020-02-18T15:34:52.000Z | function mobileCheck(){
var winWidth=$(window).width();
if (winWidth<=768) {
$("#sidebar").after($("#body .pagination:first"))
} else {
$(".products-wrap").before($("#body .pagination:first"))
}
}
$(document).ready(function() {
$("input[type=checkbox]").crfi();
$("select").crfs();
$("#slider ul").bxSlider({
controls: false,
auto: true,
mode: 'fade',
preventDefaultSwipeX: false
});
$(".last-products .products").bxSlider({
pager: false,
minSlides: 1,
maxSlides: 5,
slideWidth: 235,
slideMargin: 0
});
$(".tabs .nav a").click(function() {
var container = $(this).parentsUntil(".tabs").parent();
if (!$(this).parent().hasClass("active")) {
container.find(".nav .active").removeClass("active")
$(this).parent().addClass("active")
container.find(".tab-content").hide()
$($(this).attr("href")).show();
};
return false;
});
$("#price-range").slider({
range: true,
min: 0,
max: 5000,
values: [ 500, 3500 ],
slide: function( event, ui ) {
$(".ui-slider-handle:first").html("<span>$" + ui.values[ 0 ] + "</span>");
$(".ui-slider-handle:last").html("<span>$" + ui.values[ 1 ] + "</span>");
}
});
$(".ui-slider-handle:first").html("<span>$" + $( "#price-range" ).slider( "values", 0 ) + "</span>");
$(".ui-slider-handle:last").html("<span>$" + $( "#price-range" ).slider( "values", 1 ) + "</span>");
$("#menu .trigger").click(function() {
$(this).toggleClass("active").next().toggleClass("active")
});
mobileCheck();
$(window).resize(function() {
mobileCheck();
});
}); | 27.625 | 102 | 0.579186 |
99403a15cce9df590237308ef1a1c5fc91970280 | 27,011 | js | JavaScript | scripts/text.js | Bozar/cursedSouls | aac2d6203f2a519d307b0df34ea62eb9834ceb8a | [
"MIT"
] | 47 | 2018-06-23T14:53:19.000Z | 2022-02-28T17:58:27.000Z | scripts/text.js | Bozar/cursedSouls | aac2d6203f2a519d307b0df34ea62eb9834ceb8a | [
"MIT"
] | null | null | null | scripts/text.js | Bozar/cursedSouls | aac2d6203f2a519d307b0df34ea62eb9834ceb8a | [
"MIT"
] | 2 | 2018-08-16T02:55:20.000Z | 2022-02-01T02:14:25.000Z | 'use strict';
Main.text = {};
// ==========================
// Store all text in one map.
// ==========================
Main.text.libraryMap = null;
Main.text.initialize = function () {
let text = new Map();
// Buildings or items in the dungeon
text.set('dungeon', new Map());
text.get('dungeon').set('downstairsIcon', '>');
text.get('dungeon').set('downstairs', 'Downstairs');
text.get('dungeon').set('level1', 'Churchyard');
text.get('dungeon').set('level2', 'Cellar');
text.get('dungeon').set('level3', 'Sanctum');
text.get('dungeon').set('fire', 'Fire');
text.get('dungeon').set('ice', 'Ice');
text.get('dungeon').set('slime', 'Slime');
// text.get('dungeon').set('candy', 'Candy');
// LSP: Yay, it's me, babe.
text.get('dungeon').set('lump', 'Lump');
text.get('dungeon').set('armor', 'Icy Armor');
text.get('dungeon').set('nuke', 'Nuke');
// UI elements outside the dungeon section
text.set('ui', new Map());
text.get('ui').set('wizard', 'Wiz|');
text.get('ui').set('help', 'Help:');
text.get('ui').set('studio', 'Red Tabby Studio');
text.get('ui').set('enhance', '*');
text.get('ui').set('curse', 'x');
text.get('ui').set('hp', 'HP: %%');
text.get('ui').set('dead', 'Dead');
text.get('ui').set('ground', '@');
text.get('ui').set('examine', 'Ex');
text.get('ui').set('aim', 'Aim');
text.get('ui').set('range', 'Range: %%');
// Prompt the player to do something. Report the reaction to PC or NPC's
// action.
text.set('action', new Map());
text.get('action').set('continue', 'Press Space to continue.');
text.get('action').set('exit', 'Press Esc to exit.');
text.get('action').set('range', 'Out of range!');
text.get('action').set('pick', 'You pick up the %% Orb.');
text.get('action').set('teleport', 'You teleport yourself.');
text.get('action').set('armor', 'You are protected with the Icy Armor.');
text.get('action').set('hit', 'You hit the %%.');
text.get('action').set('kill', 'You kill the %%.');
text.get('action').set('removeCurse', 'You are purged.');
text.get('action').set('unlockAchievement', 'Unlock: %%.');
text.get('action').set('breakTail',
'You chop off the Tower Gargoyle\'s tail!');
text.get('action').set('drop', 'The %1% drops %2% %3% Orb.');
text.get('action').set('npcHit', 'The %% hits you.');
text.get('action').set('npcCurse', 'The %% curses you.');
text.get('action').set('npcSummon', 'The %% summons its companion.');
text.get('action').set('gargoyleThrust',
'The Tower Gargoyle thrusts you with the halberd.');
text.get('action').set('gargoyleBreathe', 'The %% breathes fire.');
text.get('action').set('butcherPull', 'The Ravenous Butcher pulls you.');
text.get('action').set('butcherCleave',
'The Ravenous Butcher cleaves you.'
);
text.get('action').set('ghoulPunch', 'The Olympian Ghoul punches you.');
text.get('action').set('setBomb', 'The %% set bombs around you.');
text.get('action').set('bombExplode', 'The %% explodes.');
text.get('action').set('freezeTime', 'You are frozen in time.');
text.get('action').set('reviveGiovanni',
[
'You see sinners buried in the frozen lake.',
'The vision quickly fades away...',
'and it is time to begin the fight with Giovanni.'
]
);
text.get('action').set('save', 'Game saved.');
text.get('action').set('closeOrReload',
'Close the tab or press F5 to continue.'
);
text.get('action').set('useDownstairs',
Main.screens.colorfulText(
'[Interact with the donwstairs to proceed.]', 'green'
)
);
text.get('action').set('die', 'You die.');
text.get('action').set('end', '===The End===');
text.get('action').set('deathGeneral', 'Rest in peace, ashen one.');
text.get('action').set('deathBoss1',
'Ashen one, hearest thou my voice, still?'
);
text.get('action').set('deathBoss2', 'You eventually stop thinking.');
// The Divine Comedy, Purgatorio, V, Vintage classics
// ...and there saw I a pool growing on the ground from my veins.
text.get('action').set('deathBoss3',
'...a pool growing on the ground from your veins.'
);
// NPC's names
text.set('name', new Map());
text.get('name').set('dummy', 'Dummy');
text.get('name').set('rat', 'Rat');
text.get('name').set('dog', 'Zombie Dog');
text.get('name').set('raven', 'Raven');
text.get('name').set('zombie', 'Zombie');
text.get('name').set('archer', 'Skeleton Archer');
text.get('name').set('gargoyle', 'Tower Gargoyle');
text.get('name').set('juvenileGargoyle', 'Juvenile Tower Gargoyle');
text.get('name').set('wisp', 'Wisp');
text.get('name').set('ratMan', 'Rat Man');
text.get('name').set('cultist', 'Cultist');
text.get('name').set('butcher', 'Ravenous Butcher');
text.get('name').set('ghoul', 'Olympian Ghoul');
text.get('name').set('timeBomb', 'Time Bomb');
text.get('name').set('hpBomb', 'Remote Bomb');
text.get('name').set('cursedRat', 'Cursed Rat');
text.get('name').set('twinWisp', 'Twin Wisp');
text.get('name').set('giovanni', 'Wise Giovanni');
// Describe the NPC, item or building under the marker.
text.set('info', new Map());
// NPCs.
text.get('info').set('dummy', 'This is a dummy.'
+ ' It has 1 hit point.'
+ ' It drops 1 Slime Orb when killed.');
text.get('info').set('rat',
'These filthy little bastards eat whatever they can find.'
+ ' But they are not a real threat unless you get yourself cornered.');
text.get('info').set('dog',
'Zombie dogs are zombie\'s best friends.'
+ ' They are good at shadowing far away preys'
+ ' and they know nothing about pain.');
text.get('info').set('raven',
'Ravens are cunning and mischievous.'
+ ' They fly quickly.'
+ ' They like hiding among the allies and pecking the victim.');
text.get('info').set('zombie',
'Zombies are zombie dog\'s best friends.'
+ ' Their skin is extraordinarily tough.'
+ ' You can easily outrun a zombie,'
+ ' but be ware of their loyal companions.');
text.get('info').set('archer',
'The restless guard and merciless killer,'
+ ' who is summoned from his long death,'
+ ' eliminates far away intruders in a straight line with one shot.');
text.get('info').set('gargoyle',
'The Tower Gargoyle moves slowly,'
+ ' but it can reach the enemy with the halberd.'
+ ' It breathes fire in which few can survive heads on.'
+ ' %%'
);
text.get('info').set('juvenileGargoyle',
'The Juvenile Tower Gargoyle breathes fire'
+ ' in which few can survive head on.'
);
text.get('info').set('gargoyleHasTail', 'Its tail is a stone axe.');
text.get('info').set('gargoyleLoseTail', 'Its tail is chopped off.');
text.get('info').set('wisp',
'You can hear these pale white wisps mumble in your head.'
+ ' They are eager to approach any living creature'
+ ' and spread their last bless.'
);
text.get('info').set('ratMan',
'The Rat Man has not been accustomed to stand on two legs,'
+ ' but it has already leant to whip the rats around itself'
+ ' and farther away targets in the front.'
);
text.get('info').set('cultist',
'The Cultist is a skinny man with a bone wand in his hand'
+ ' to shoot necro bolts which can curse or hurt the intruders.'
);
text.get('info').set('butcher',
'The fatty\'s left hand is a hook'
+ ' which can be used to pull meat in a line.'
+ ' He helds the razor sharp cleaver in the right hand.'
+ ' Sometimes he needs to rest.'
);
text.get('info').set('ghoul',
'The Olympian Ghoul wears nothing but a loincloth.'
+ ' His body seems perfect to mortal eyes,'
+ ' but still is a pathetic faker of Dio.'
+ ' He punches at lightning speed.'
);
text.get('info').set('cursedRat',
'These cursed little bastards eat whatever they can find.'
+ ' But they are not a real threat unless you get yourself cornered.'
);
text.get('info').set('twinWisp',
'You can hear two voices mumble in your head.'
+ ' These pale white wisps are eager to approach any living creature'
+ ' and spread their last bless.'
);
text.get('info').set('giovanni',
'Wise Giovanni wears a purple robe and lives like a hermit.'
+ ' He clenches his left fist and raises the thumb.'
+ ' It seems he is about to press a button.'
);
text.get('info').set('timeBomb',
'The second form of the Bomb.'
+ ' It can affect the world in a bizarre way.'
);
text.get('info').set('hpBomb', 'The first form of the Bomb.');
// Orbs.
text.get('info').set('fire', 'Range 1, damage 1. 100% drop rate.');
text.get('info').set('ice',
'Protect yourself with at most 2 layers of the Icy Armor.'
+ ' 60% drop rate.');
text.get('info').set('slime', 'Range 2. Teleport yourself.');
text.get('info').set('lump', 'Range 2, damage 1. 60% drop rate.');
// Downstairs.
text.get('info').set('downstairs1',
'In the center of the dusty round pool, there stands a grotesque figure.'
+ ' His eyes fix on the ground,'
+ ' %%'
);
text.get('info').set('downstairs2',
'This is an opened coffin on the ground,'
+ ' which is covered by spider webs.'
+ ' %%'
);
text.get('info').set('downstairs1Inactive',
'and he carries an empty jar on the right shoulder.');
text.get('info').set('downstairs1Active',
'and blood is pouring out of the jar on his right shoulder.');
text.get('info').set('downstairs1Win',
'and the jar on his right shoulder is dripping blood.');
text.get('info').set('downstairs2Inactive',
'A dead body lies inside it.');
text.get('info').set('downstairs2Active',
'The coffin is empty and the web is intact.');
text.get('info').set('downstairs2Win',
'There are scratches around the coffin.');
text.get('info').set('downstairs3',
'Behind the ornate door there seems to be a study room.'
+ ' %%'
);
text.get('info').set('downstairs3Inactive',
'You can hear someone talking inside.'
);
text.get('info').set('downstairs3Active', '');
text.get('info').set('downstairs3Win', '');
// The help screen.
text.set('help', new Map());
text.get('help').set('keyBindings',
'Normal Mode:\n\n'
+ '* Move: '
+ Main.screens.colorfulText('Arrow keys', 'green') + ', '
+ Main.screens.colorfulText('hjkl', 'green') + '.\n'
+ '* Fast move: '
+ Main.screens.colorfulText('Shift + Movement keys', 'green') + '.\n'
+ '* Pick up an orb or interact with the downstairs: '
+ Main.screens.colorfulText('Space', 'green') + '.\n'
+ '* Wait 1 turn: '
+ Main.screens.colorfulText('z', 'green') + ', '
+ Main.screens.colorfulText('.(period)', 'green') + '.\n'
+ '* View achievements: '
+ Main.screens.colorfulText('a', 'green') + '.\n'
+ '* Help: '
+ Main.screens.colorfulText('?', 'green') + '.\n\n'
+ 'Examine Mode, Aim Mode:\n\n'
+ '* Enter the Examine Mode: '
+ Main.screens.colorfulText('x', 'green') + '.\n'
+ '* Enter the Aim Mode: '
+ Main.screens.colorfulText('Space', 'green') + '.\n'
+ '* Use the last orb (Aim Mode only): '
+ Main.screens.colorfulText('Space', 'green') + '.\n'
+ '* Lock the next target: '
+ Main.screens.colorfulText('PgDn', 'green') + ', '
+ Main.screens.colorfulText('n', 'green') + ', '
+ Main.screens.colorfulText('o', 'green') + '.\n'
+ '* Lock the previous target: '
+ Main.screens.colorfulText('PgUp', 'green') + ', '
+ Main.screens.colorfulText('p', 'green') + ', '
+ Main.screens.colorfulText('i', 'green') + '.\n'
+ '* Move the cursor: '
+ Main.screens.colorfulText('Arrow keys', 'green') + ', '
+ Main.screens.colorfulText('hjkl', 'green') + '.\n'
+ '* Exit to the Normal Mode: '
+ Main.screens.colorfulText('Esc', 'green') + '.\n\n\n'
+ 'Please read the '
+ Main.screens.colorfulText('README.md', 'green')
+ ' for more information.'
);
// The achievement screen.
text.set('achievementLeft', new Map());
text.get('achievementLeft').set('boss1Normal', 'Bounty: Tower Gargoyle');
text.get('achievementLeft').set('boss1Special', 'Gargoyle Tail Axe');
text.get('achievementLeft').set('boss2Normal', 'Bounty: Ravenous Butcher');
text.get('achievementLeft').set('boss3Normal', 'Bounty: Olympian Ghoul');
text.get('achievementLeft').set('boss3Special', 'Muda Muda Muda!');
text.get('achievementLeft').set('boss4Normal', 'Bounty: Wise Giovanni');
text.get('achievementLeft').set('boss4Special', 'Trinity');
text.get('achievementLeft').set('noExamine', 'Readme Is For Noobs');
text.get('achievementLeft').set('unlockAll', 'One Punch Man');
text.set('achievementRight', new Map());
text.get('achievementRight').set('locked', '[Locked]');
text.get('achievementRight').set('unlocked', '[Unlocked]');
text.get('achievementRight').set('boss1Normal', 'Beat Tower Gargoyle.');
text.get('achievementRight').set('boss1Special',
'Keep calm and don\'t roll back.'
);
text.get('achievementRight').set('boss2Normal', 'Beat Ravenous Butcher.');
text.get('achievementRight').set('boss3Normal', 'Beat Olympian Ghoul.');
text.get('achievementRight').set('boss3Special',
'Beat Olympian Ghoul with three bump attacks.'
);
text.get('achievementRight').set('boss4Normal', 'Beat Wise Giovanni.');
text.get('achievementRight').set('boss4Special',
'Perform the Symbol SHattering Nuke against Wise Giovanni, that is,'
+ ' three consecutive attacks with three different orbs:'
+ ' Icy Armor, Fire and Lump.'
);
// Hats off, gentlemen. Here before you stands a TRUE player.
// https://www.reddit.com/r/roguelikes/comments/3drjoz/rroguelikes_developer_ama_uunormal_and/ct8116x/
text.get('achievementRight').set('noExamine',
'You can beat Faster Than Light without pausing?'
+ ' Then surely you can pass one dungeon level'
+ ' without entering the Examine Mode.'
);
text.get('achievementRight').set('unlockAll', 'Unlock everything, Genos.');
// Cut-scenes.
text.set('cutScene', new Map());
text.get('cutScene').set('enterLevel1',
'You wake up in an open grave,'
+ ' like a nameless body in the morgue,'
+ ' who is unknown to death, nor known to life.'
+ ' Rats scatter as you climb out of the moist muddy bed.'
+ ' A raven that rests on the tombstone flies into the cloudy sky'
+ ' and circles around the bell tower.'
+ '\n\n'
+ 'Your skin withers and your throat burns like fire.'
+ ' You are certainly cursed. But by whom?'
+ ' Although you are alone in the churchyard,'
+ ' you can hear weeping and whisper in your mind.'
+ ' One of the voices is calling you: come down to me, ashen one.'
);
text.get('cutScene').set('beforeBossFight1',
'At first, you think it is the trick of the light'
+ ' - how can a statue change his position?'
+ ' Then you take another look and confirm that'
+ ' the grotesque stone figure is looking at you, with mouth wide open,'
+ ' as if crying in slience.'
+ ' Blood starts pouring out of the jar on his shoulder'
+ ' when the bell strikes.'
+ '\n\n'
+ 'You step back fearfully and raise your head'
+ ' to notice a giant beast swooping down from the bell tower.'
+ ' The Tower Gargoyle, holding the halberd in its right hand,'
+ ' lands heavily and lets out a thundering roar.'
+ ' Its skin has burnt scars and its tail,'
+ ' the end of which has the shape of an axe,'
+ ' nearly cuts you in half with a single whip.'
);
text.get('cutScene').set('enterLevel2',
'You follow the source of the voices and push open the church door.'
+ ' There is a swirling downstairs on the side,'
+ ' leading to the bottom which seems to be deeper than sea.'
+ ' Sharper than blade is the chilling wind cutting through your face.'
+ '\n\n'
+ 'Ghostly pale flames dance on the torches.'
+ ' Rats with lash scars run away from you without a sound.'
+ ' Judging from the stew pot in the kitchen,'
+ ' someone still lives in the cellar.'
);
text.get('cutScene').set('beforeBossFight2',
'The dungeon citizens are reluctant to get close to this place -'
+ ' an opened coffin covered with spider webs.'
+ ' Inside the coffin, there lies a dead man,'
+ ' who is tall, strong and handsome.'
+ ' You blink your eyes. At the next moment,'
+ ' the coffin is empty and the web remains unbroken.'
+ '\n\n'
+ 'Someone says behind you: "Even the evil needs an evil savior,'
+ ' so you are not allowed to bother our master."'
+ '\n\n'
+ 'You turn around and get bunched and fall on the ground.'
+ ' All these things happen at the exact same moment.'
);
text.get('cutScene').set('enterLevel3',
'You pull the lever in the coffin.'
+ ' It slides aside and reveals a stone downstairs.'
+ ' The bottom level of the church is, or rather, used to be a sanctum.'
+ '\n\n'
+ 'Specimens are kept in transparent jars along the wall -'
+ ' small mammals, organs, humans, inhumans,'
+ ' and some other THINGS you cannot describe.'
+ ' If you stay here for too long,'
+ ' you will certainly be dronwed in the cursed sea'
+ ' and become one of them.'
);
text.get('cutScene').set('beforeBossFight3',
'You hear a voice from behind the door.'
+ '\n\n'
+ '"Tutte quelle grida dolorose, che un\'orchestra meravigliosa."'
+ '\n'
+ '("All those painful cries, what a wonderful orchestra.")'
+ '\n\n'
+ '"Sii paziente, bellezza mia.'
+ ' Ecco che arriva il nostro ospite."'
+ '\n'
+ '("Be patient, my beauty. Here comes our guest.")'
+ '\n\n'
+ 'A man in purple robe walks out of the study.'
+ '\n\n'
+ ' "I just want to be a hermit. Is this too much to ask?"'
+ ' He stares at you and sighs. "Fear not, amico. It ends soon."'
);
text.get('cutScene').set('miniBoss1',
[
'You hear the sound of chopping from the corner.',
'There is a fatty who raises the cleaver into the air.',
'He pushes over the table upon seeing you.',
'"Nosferatu rats! You won\'t escape this time!"',
Main.screens.colorfulText('[Press Space to continue.]', 'green')
]
);
text.get('cutScene').set('miniBoss2',
'The Ravenous Butcher charges at you.'
);
text.get('cutScene').set('youWin',
'The study room is small and cozy.'
+ ' The walls were hung with blankets and candles burn bright.'
+ ' In addition to books, there is also a crystal skull on the shelf.'
+ ' Is it the other one that Giovanni was talking to?'
+ ' You cannot tell why but you feel that it is watching you.'
+ '\n\n'
+ ' On the desk there is an unfolded scroll,'
+ ' on which someone draws with black ink the two underground levels'
+ ' and a trap door leading to an even deeper tunnel system.'
+ '\n\n'
+ ' The dungeon is vast and infinite.'
+ '\n\n'
+ '\n\n'
+ '[You win. Thanks for playing the game.]'
);
// Error messages.
text.set('error', new Map());
text.get('error').set('browser',
'Your browser dose not support the Rot.js.'
+ '\n\n'
+ 'Please use the lastest Chrome or Firefox.'
);
text.get('error').set('storage',
'Please change your browser setting to save the game data locally.'
);
Main.text.libraryMap = text;
};
// =================================
// Get static text from the library.
// =================================
Main.text.staticTextList = [
'dungeon',
'ui',
'action',
'name',
'info',
'help',
'achievementLeft',
'achievementRight',
'cutScene',
'error'
];
Main.text.staticTextList.forEach((key) => {
Main.text[key] = function (id) {
return Main.text.libraryMap.get(key).get(id);
};
});
// ==========================
// Combine fragments of text.
// ==========================
Main.text.modeLine = function (mode) {
let check = ['examine', 'aim'];
let text = '';
let colorfulMode = '';
let outOfRange = '';
if (check.indexOf(mode) < 0) {
mode = check[0];
}
if (mode === 'aim') {
colorfulMode = Main.screens.colorfulText(Main.text.ui(mode), 'orange');
if (!Main.system.insideOrbRange()) {
outOfRange = `[${
Main.screens.colorfulText(
Main.text.action('range'), 'orange')
}]`;
}
} else {
colorfulMode = Main.text.ui(mode);
}
text = `[${colorfulMode}][${Main.text.ui('range')}]${outOfRange} `;
text = text.replace('%%', Main.system.getDistance(
Main.getEntity('pc'), Main.getEntity('marker')));
return text;
};
Main.text.npcBottomDescription = function (downstairs, npc, orb) {
let text = '';
text += '[' + Main.text.name(npc.getEntityName()) + ']';
text += '[' + Main.screens.colorfulText(
Main.text.dungeon(npc.Inventory.getInventory(0)), 'white')
//Main.text.dungeon(npcHere.Inventory.getInventory(0)), 'green')
+ ']';
text += '[' + Main.screens.colorfulText(
npc.HitPoint.getHitPoint(), 'white')
//npcHere.HitPoint.getHitPoint(), 'orange')
+ ']' + itemUnderTheFoot();
return text;
function itemUnderTheFoot() {
let entityHere = downstairs || orb || null;
if (entityHere) {
return '[@ ' + Main.screens.colorfulText(
Main.text.dungeon(entityHere.getEntityName()),
entityHere.Display.getColor()) + ']';
}
return '';
}
};
Main.text.orbTopDescription = function (orb) {
let text = '';
text += '[' + Main.text.dungeon(orb.getEntityName()) + '] '
+ Main.text.info(orb.getEntityName());
return text;
};
Main.text.pickUp = function (orb) {
let text = Main.text.action('pick');
text = text.replace('%%', Main.text.dungeon(orb));
return text;
};
Main.text.hitTarget = function (target) {
let text = Main.text.action('hit');
text = text.replace('%%', Main.text.name(target.getEntityName()));
return text;
};
Main.text.killTarget = function (target) {
let text = Main.text.action('kill');
text = text.replace('%%', Main.text.name(target.getEntityName()));
return text;
};
Main.text.targetDropOrb = function (target, orb) {
let text = Main.text.action('drop');
text = text.replace('%1%', Main.text.name(target.getEntityName()));
text = text.replace('%3%', Main.text.dungeon(orb.getEntityName()));
if (orb.getEntityName() === 'ice') {
text = text.replace('%2%', 'an');
} else {
text = text.replace('%2%', 'a');
}
return text;
};
Main.text.downstairs = function () {
// Dungeon level: 1 to 4.
let dungeonLevel = Main.getEntity('gameProgress').BossFight.getDungeonLevel();
// Progress: inactive, active, win.
let progress = Main.getEntity('gameProgress').BossFight.getBossFightStatus();
// Text: the string with the placeholder '%%'.
let text = Main.text.info('downstairs' + dungeonLevel);
progress = progress.charAt(0).toUpperCase() + progress.slice(1);
text = text.replace('%%', Main.text.info(
'downstairs' + dungeonLevel + progress
));
return text;
};
Main.text.npcHit = function (attacker) {
let text = Main.text.action('npcHit');
text = text.replace('%%', Main.text.name(attacker.getEntityName()));
return text;
};
Main.text.npcCurse = function (attacker) {
let text = Main.text.action('npcCurse');
text = text.replace('%%', Main.text.name(attacker.getEntityName()));
return text;
};
Main.text.npcSummon = function (actor) {
let text = Main.text.action('npcSummon');
text = text.replace('%%', Main.text.name(actor.getEntityName()));
return text;
};
Main.text.lastWords = function () {
let text = '';
if (Main.getEntity('gameProgress').BossFight.getBossFightStatus()
!== 'inactive') {
text = Main.text.action('deathBoss'
+ Main.getEntity('gameProgress').BossFight.getDungeonLevel());
} else {
text = Main.text.action('deathGeneral');
}
return text;
};
Main.text.uiHitPoint = function () {
let hp = Main.getEntity('pc').Inventory.getLength();
let text = Main.text.ui('hp');
let dead = Main.screens.colorfulText(Main.text.ui('dead'), 'grey');
if (hp < 4) {
hp = Main.screens.colorfulText(hp, 'orange');
}
if (Main.getEntity('pc').Inventory.getIsDead()) {
text = text.replace('%%', dead);
} else {
text = text.replace('%%', hp);
}
return text;
};
Main.text.gargoyleBreathe = function (actor) {
let text = Main.text.action('gargoyleBreathe');
text = text.replace('%%', Main.text.name(actor.getEntityName()));
return text;
};
Main.text.gargoyleDescription = function (actor) {
let text = Main.text.info('gargoyle');
if (actor.CombatRole.getRole('hasTail')) {
text = text.replace('%%', Main.text.info('gargoyleHasTail'));
} else {
text = text.replace('%%', Main.text.info('gargoyleLoseTail'));
}
return text;
};
Main.text.unlockAchievement = function (achievement) {
let text = Main.text.action('unlockAchievement');
text = text.replace('%%', Main.screens.colorfulText(achievement, 'green'));
return text;
};
Main.text.bombExplode = function (actor) {
let text = Main.text.action('bombExplode');
text = text.replace('%%', Main.text.name(actor.getEntityName()));
return text;
};
Main.text.setBomb = function (actor) {
let text = Main.text.action('setBomb');
text = text.replace('%%', Main.text.name(actor.getEntityName()));
return text;
};
| 36.159304 | 106 | 0.586058 |
994058cc632cc1124c0e214ae90319bf4ee0114f | 941 | js | JavaScript | incident-application-form/lib/session/address.country.spec.js | FSA-Foundry4/fsa-incident-application-form | e4898e002ffe9534bc7258c8bf0b68d095a8f7a7 | [
"MIT"
] | null | null | null | incident-application-form/lib/session/address.country.spec.js | FSA-Foundry4/fsa-incident-application-form | e4898e002ffe9534bc7258c8bf0b68d095a8f7a7 | [
"MIT"
] | 4 | 2020-10-12T17:20:16.000Z | 2020-10-19T07:32:13.000Z | incident-application-form/lib/session/address.country.spec.js | foundry4/fsa-incident-application-form | f8413046b7c3381267aa918561e2ff8b75577270 | [
"MIT"
] | null | null | null | const { getSelectedAddressCountryFromSession } = require("./address.country");
describe(`lib/session/address.country`, () => {
beforeEach(() => {
jest.clearAllMocks();
});
describe("getSelectedAddressCountryFromSession", () => {
const testCases = [
["undefined", undefined, 0],
["missing yourDetails", {}, 0],
["missing yourDetails.address", { yourDetails: {} }, 0],
[
"missing yourDetails.address.country",
{ yourDetails: { address: {} } },
0,
],
[
"missing yourDetails.address.country.value",
{ yourDetails: { address: { country: {} } } },
0,
],
[
"happy path",
{ yourDetails: { address: { country: { value: 22 } } } },
22,
],
];
test.each(testCases)(`%s`, (description, given, expected) => {
expect(getSelectedAddressCountryFromSession(given)).toEqual(expected);
});
});
});
| 26.885714 | 78 | 0.54729 |
9941f0c85c478ec192df7a0892431144bd5056e4 | 1,891 | js | JavaScript | third_party/blink/web_tests/http/tests/inspector-protocol/network/request-interception-referer.js | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 14,668 | 2015-01-01T01:57:10.000Z | 2022-03-31T23:33:32.000Z | third_party/blink/web_tests/http/tests/inspector-protocol/network/request-interception-referer.js | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 113 | 2015-05-04T09:58:14.000Z | 2022-01-31T19:35:03.000Z | third_party/blink/web_tests/http/tests/inspector-protocol/network/request-interception-referer.js | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 5,941 | 2015-01-02T11:32:21.000Z | 2022-03-31T16:35:46.000Z | (async function(testRunner) {
var {page, session, dp} = await testRunner.startBlank(
`Tests the overriden referer headers are properly reported and applied with interception`);
session.protocol.Network.enable();
session.protocol.Page.enable();
await dp.Network.setExtraHTTPHeaders({headers: {'ReFeReR': 'https://127.0.0.1:8000/'}});
await session.protocol.Network.setRequestInterception({patterns: [{urlPattern: "*"}]});
testRunner.log('*Not* overriding referer in interception handler:');
var {interceptionId, bodyPromise} = await sendRequestAndIntercept();
session.protocol.Network.continueInterceptedRequest({interceptionId: interceptionId});
testRunner.log(`response: ${await bodyPromise}`);
testRunner.log('Overriding referer in interception handler:');
var {interceptionId, bodyPromise} = await sendRequestAndIntercept();
session.protocol.Network.continueInterceptedRequest({interceptionId: interceptionId, headers: {'ReFeReR': 'http://localhost:8000/'}});
testRunner.log(`response: ${await bodyPromise}`);
testRunner.completeTest();
async function sendRequestAndIntercept() {
const requestPromise = session.protocol.Network.onceRequestWillBeSent();
const evalPromise = session.evaluateAsync(`(async function() {
var url = '${testRunner.url('./resources/echo-headers.php?headers=HTTP_REFERER')}';
var response = await fetch(new Request(url));
return response.text();
})()`);
const interceptedRequest = (await session.protocol.Network.onceRequestIntercepted()).params;
const request = (await requestPromise).params;
testRunner.log(`referer in requestWillBeSent: ${request.request.headers['Referer']}`);
testRunner.log(`referer in requestIntercepted: ${interceptedRequest.request.headers['Referer']}`);
return {interceptionId: interceptedRequest.interceptionId, bodyPromise: evalPromise};
}
})
| 52.527778 | 136 | 0.747224 |
9943b745484e1b21fbd581c1e77492cba93f3753 | 1,053 | js | JavaScript | components/Link/ReportLink.js | mgamini/harm-report | 2e02468b43b3748f419a34e827e014b2bdceb0fe | [
"MIT"
] | null | null | null | components/Link/ReportLink.js | mgamini/harm-report | 2e02468b43b3748f419a34e827e014b2bdceb0fe | [
"MIT"
] | null | null | null | components/Link/ReportLink.js | mgamini/harm-report | 2e02468b43b3748f419a34e827e014b2bdceb0fe | [
"MIT"
] | null | null | null | import React, { PropTypes } from 'react';
import history from '../../core/history';
import s from './ReportLink.css';
import Link from './Link.js';
import HarmIcon from '../Button/HarmIcon.js';
const moment = require('moment');
class ReportLink extends React.Component {
static propTypes = {
featured: PropTypes.bool,
report: PropTypes.object
};
render() {
let featured = this.props.featured ? s.featured : s.normal;
return (
<article className={`${s['report-entry']} ${featured}`} >
<div className={s.harms}>
{this.props.report.harms.map((harm) =>
<HarmIcon
id={`${this.props.report.id}-${harm.id}`}
slug={harm.id}
name={harm.group}
featured={this.props.featured}
key={`${this.props.report.id}-${harm.id}`}
className={s['harm-icon']} />
)}
</div>
<div className={s.report}>
<Link className={s['report-link']} to={`/r/${this.props.report.id}`}>
<p>{this.props.report.title}</p>
</Link>
</div>
</article>
)
}
}
export default ReportLink; | 25.682927 | 74 | 0.606838 |
9943cc6f6453c07ce2719467b2fb05edb501b9e3 | 1,541 | js | JavaScript | resources/js/bioquimica.js | JesusQuishpe/PrefecturaElOro | e1c1d89c7d0439fac70e71b34192cfab87665c95 | [
"MIT"
] | null | null | null | resources/js/bioquimica.js | JesusQuishpe/PrefecturaElOro | e1c1d89c7d0439fac70e71b34192cfab87665c95 | [
"MIT"
] | null | null | null | resources/js/bioquimica.js | JesusQuishpe/PrefecturaElOro | e1c1d89c7d0439fac70e71b34192cfab87665c95 | [
"MIT"
] | null | null | null | import { URL_PUBLIC } from "./conf.js";
import { postFormData } from "./utils.js";
function buscarUltimaCita(cedula) {
let data = new FormData();
let token = document.querySelector("input[name=_token]").value;
data.append('cedula', cedula);
postFormData(URL_PUBLIC + `laboratorio/bioquimica/ultimaCita`, data,token)
.then(res => {
if (res.ok) {
res.json()
.then(json => {
console.log(json);
addInformacionPersonal(json);
})
.catch(err => console.error(err));
}
})
.catch(err => console.error(err));
}
function addInformacionPersonal(data) {
document.getElementById('nombres').textContent=data.nombres;
document.getElementById('apellidos').textContent=data.apellidos;
document.getElementById('cedula').textContent=data.cedula;
document.getElementById('sexo').textContent=data.sexo;
}
document.getElementById("btn-buscar").addEventListener("click", e => {
let cedula = document.getElementById("input-buscar").value;
let alert = document.getElementById('alert');
let spinner=document.getElementById('spinner');
if (cedula === "") {
alert.classList.add("alert");
alert.classList.add("alert-error");
alert.textContent = "Debe proporcionar el número de cedula o apellidos";
return;
}
spinner.style.display="flex";
buscarUltimaCita(cedula);
spinner.style.display="none";
}); | 34.244444 | 80 | 0.615185 |
9944099d2df153472f320b979312ed0f0e36cf78 | 148 | js | JavaScript | web/assets/js/controller/BlankController.js | hugo-clems/mi-siteweb | a9f1a842e80d0e37180eec3223ccef5096e9353d | [
"MIT"
] | null | null | null | web/assets/js/controller/BlankController.js | hugo-clems/mi-siteweb | a9f1a842e80d0e37180eec3223ccef5096e9353d | [
"MIT"
] | null | null | null | web/assets/js/controller/BlankController.js | hugo-clems/mi-siteweb | a9f1a842e80d0e37180eec3223ccef5096e9353d | [
"MIT"
] | null | null | null | var myApp = angular.module('RareApp',[]);
myApp.controller('BlankController', ['$scope', function($scope) {
$scope.pageTitle = 'Blank Page';
}]); | 29.6 | 65 | 0.668919 |
99447ac280ecef0c668f12f8a0c1a379b37336f9 | 481 | js | JavaScript | frontend/actions/mobile_menu_actions.js | imWildCat/tzyz | dfd39e3028251e532f055689e7b8a617cb427336 | [
"MIT"
] | 8 | 2021-09-19T04:43:32.000Z | 2022-02-24T08:00:19.000Z | frontend/actions/mobile_menu_actions.js | imWildCat/tzyz | dfd39e3028251e532f055689e7b8a617cb427336 | [
"MIT"
] | 2 | 2015-04-06T09:01:17.000Z | 2021-01-11T03:50:26.000Z | frontend/actions/mobile_menu_actions.js | imWildCat/tzyz | dfd39e3028251e532f055689e7b8a617cb427336 | [
"MIT"
] | null | null | null | /**
* Created by wildcat, all rights reserved.
*/
"use strict";
var Reflux = require('reflux');
var MainBlurContainerActions = require('./blur_containers/main');
var MobileMenuActions = Reflux.createActions([
'showMenu',
'hideMenu'
]);
module.exports = MobileMenuActions;
MobileMenuActions.showMenu.listen(function () {
MainBlurContainerActions.performBlur();
});
MobileMenuActions.hideMenu.listen(function () {
MainBlurContainerActions.dismissBlur();
});
| 19.24 | 65 | 0.727651 |
9944e620fd97416f8ae974fc9a5cbc8b30000981 | 1,320 | js | JavaScript | docs/search/all_1.js | Maxime999/MetroCollect | 5f6c74ee29a0b489de38bff0674c17adb099a8e1 | [
"Apache-2.0"
] | 1 | 2018-10-16T10:53:39.000Z | 2018-10-16T10:53:39.000Z | docs/search/all_1.js | Maxime999/MetroCollect | 5f6c74ee29a0b489de38bff0674c17adb099a8e1 | [
"Apache-2.0"
] | null | null | null | docs/search/all_1.js | Maxime999/MetroCollect | 5f6c74ee29a0b489de38bff0674c17adb099a8e1 | [
"Apache-2.0"
] | null | null | null | var searchData=
[
['back',['back',['../classCircularArray_1_1CircularArray.html#a7bbeef621fd90b493cca4e78deaeb741',1,'CircularArray::CircularArray::back()'],['../classCircularArray_1_1CircularArray.html#a03e63a6abe5cf4f713dbe0ed19d9b1d8',1,'CircularArray::CircularArray::back() const']]],
['begin',['begin',['../classMetroCollect_1_1MetricsArray.html#abe050ea5c5abbb0ee9c649d850853569',1,'MetroCollect::MetricsArray::begin() noexcept'],['../classMetroCollect_1_1MetricsArray.html#a8faa70fcd70bb5f561aff98fc6ecbfcf',1,'MetroCollect::MetricsArray::begin() const noexcept']]],
['begin_5f',['begin_',['../classCircularArray_1_1CircularArray.html#acd5d3c19c9fa001876e0a9cdb83a3310',1,'CircularArray::CircularArray']]],
['buffer_5f',['buffer_',['../classMetroCollect_1_1MetricsSource_1_1SourceProcMeminfo.html#af85e89d9e31c7122a945ae5bfb888640',1,'MetroCollect::MetricsSource::SourceProcMeminfo::buffer_()'],['../classMetroCollect_1_1MetricsSource_1_1SourceProcNetDev.html#a170d8d68cf7724a8550acb00f3cdb6e2',1,'MetroCollect::MetricsSource::SourceProcNetDev::buffer_()'],['../classMetroCollect_1_1MetricsSource_1_1SourceProcStat.html#a267ef4338744bc1e09b7128efa105a87',1,'MetroCollect::MetricsSource::SourceProcStat::buffer_()']]],
['build_20dependencies',['Build dependencies',['../DEPENDENCIES_8md.html',1,'']]]
];
| 146.666667 | 512 | 0.809091 |
994506a42d8de98312e2eef941afda5b713c3a47 | 388 | js | JavaScript | deleteInternet.user.js | S0S-90/userscripts | 90cbc096683ed4ddb234c80ad7ff46d2a6397d51 | [
"MIT"
] | 1 | 2020-07-20T18:37:18.000Z | 2020-07-20T18:37:18.000Z | deleteInternet.user.js | S0S-90/userscripts | 90cbc096683ed4ddb234c80ad7ff46d2a6397d51 | [
"MIT"
] | 1 | 2020-01-30T08:43:45.000Z | 2020-03-08T06:31:25.000Z | deleteInternet.user.js | S0S-90/userscripts | 90cbc096683ed4ddb234c80ad7ff46d2a6397d51 | [
"MIT"
] | null | null | null | // ==UserScript==
// @name DeleteInternet
// @namespace http://tampermonkey.net/
// @version 1.0
// @description delete the internet
// @author You
// @match http*://*
// ==/UserScript==
(function() {
'use strict';
var element = document.getElementsByTagName("body")[0];
element.innerHTML = "Entschuldigung, das Internet wurde gelöscht.";
})(); | 25.866667 | 71 | 0.60567 |
99456796a6422f41c4c5fed8a7a8b47583439bfb | 1,570 | js | JavaScript | examples/website/pointcloud/file-index.js | nreese/loaders.gl | 88bec59eb3f3b06bce3dd873af47f945868c81a6 | [
"Apache-2.0"
] | 128 | 2018-12-11T20:04:46.000Z | 2020-04-14T09:08:55.000Z | examples/website/pointcloud/file-index.js | nreese/loaders.gl | 88bec59eb3f3b06bce3dd873af47f945868c81a6 | [
"Apache-2.0"
] | 592 | 2018-12-08T01:09:15.000Z | 2020-04-13T21:14:18.000Z | examples/website/pointcloud/file-index.js | nreese/loaders.gl | 88bec59eb3f3b06bce3dd873af47f945868c81a6 | [
"Apache-2.0"
] | 48 | 2019-01-25T10:23:57.000Z | 2020-04-09T17:24:05.000Z | const DECK_DATA_URI = 'https://raw.githubusercontent.com/visgl/deck.gl-data/master';
const LOADERS_URI = 'https://raw.githubusercontent.com/visgl/loaders.gl/master';
export default {
PLY: {
'Lucy 800K': {
uri: `${DECK_DATA_URI}/examples/point-cloud-ply/lucy800k.ply`
},
'Lucy 100K': {
uri: `${DECK_DATA_URI}/examples/point-cloud-ply/lucy100k.ply`
},
Bunny: {
uri: `${LOADERS_URI}/modules/ply/test/data/bunny.ply`
},
'Bun Zipper (Text)': {
uri: `${LOADERS_URI}/modules/ply/test/data/bun_zipper.ply`
},
'Richmond Azaelias': {
uri: `${LOADERS_URI}/modules/ply/test/data/richmond-azaelias.ply`
}
},
LAZ: {
// Data source: kaarta.com
'Indoor Scan 800K': {
uri: `${DECK_DATA_URI}/examples/point-cloud-laz/indoor.0.1.laz`
}
// TODO need fix
// 'Indoor Scan 8M': {
// uri: `${DECK_DATA_URI}/examples/point-cloud-laz/indoor.laz`
// }
},
Draco: {
Bunny: {
uri: `${LOADERS_URI}/modules/draco/test/data/bunny.drc`
}
},
// TODO need fix
// PCD: {
// Zaghetto: {
// uri: `${LOADERS_URI}/modules/pcd/test/data/Zaghetto.pcd`
// },
// 'Simple (Text)': {
// uri: `${LOADERS_URI}/modules/pcd/test/data/simple-ascii.pcd`
// }
// },
OBJ: {
Magnolia: {
uri: `${LOADERS_URI}/modules/obj/test/data/magnolia.obj`
},
Bunny: {
uri: `${LOADERS_URI}/modules/obj/test/data/bunny.obj`
}
// TODO need fix
// Cube: {
// uri: `${LOADERS_URI}/modules/obj/test/data/cube.obj`
// }
}
};
| 25.322581 | 84 | 0.578344 |
994568253c76bd3523db6f0c07bf94fb1d414d3f | 3,624 | js | JavaScript | test/spec/search.js | arcanis/algoliasearch-helper-js | f4dab89dcce68d46596d5b8a5e88f18f28b13330 | [
"MIT"
] | null | null | null | test/spec/search.js | arcanis/algoliasearch-helper-js | f4dab89dcce68d46596d5b8a5e88f18f28b13330 | [
"MIT"
] | null | null | null | test/spec/search.js | arcanis/algoliasearch-helper-js | f4dab89dcce68d46596d5b8a5e88f18f28b13330 | [
"MIT"
] | null | null | null | 'use strict';
var algoliasearchHelper = require('../../index');
test('Search should call the algolia client according to the number of refinements', function(done) {
var testData = require('../datasets/SearchParameters/search.dataset')();
var client = {
search: jest.fn().mockImplementationOnce(function() {
return Promise.resolve(testData.response);
})
};
var helper = algoliasearchHelper(client, 'test_hotels-node', {
disjunctiveFacets: ['city']
});
helper.addDisjunctiveRefine('city', 'Paris', true);
helper.addDisjunctiveRefine('city', 'New York', true);
helper.on('result', function(data) {
// shame deepclone, to remove any associated methods coming from the results
expect(JSON.parse(JSON.stringify(data))).toEqual(JSON.parse(JSON.stringify(testData.responseHelper)));
var cityValues = data.getFacetValues('city');
var expectedCityValues = [
{name: 'Paris', count: 3, isRefined: true},
{name: 'New York', count: 1, isRefined: true},
{name: 'San Francisco', count: 1, isRefined: false}
];
expect(cityValues).toEqual(expectedCityValues);
var cityValuesCustom = data.getFacetValues('city', {sortBy: ['count:asc', 'name:asc']});
var expectedCityValuesCustom = [
{name: 'New York', count: 1, isRefined: true},
{name: 'San Francisco', count: 1, isRefined: false},
{name: 'Paris', count: 3, isRefined: true}
];
expect(cityValuesCustom).toEqual(expectedCityValuesCustom);
var cityValuesFn = data.getFacetValues('city', {sortBy: function(a, b) { return a.count - b.count; }});
var expectedCityValuesFn = [
{name: 'New York', count: 1, isRefined: true},
{name: 'San Francisco', count: 1, isRefined: false},
{name: 'Paris', count: 3, isRefined: true}
];
expect(cityValuesFn).toEqual(expectedCityValuesFn);
expect(client.search).toHaveBeenCalledTimes(1);
var queries = client.search.mock.calls[0][0];
for (var i = 0; i < queries.length; i++) {
var query = queries[i];
expect(query.query).toBe(undefined);
expect(query.params.query).toBe('');
}
done();
});
helper.search('');
});
test('Search should not mutate the original client response', function(done) {
var testData = require('../datasets/SearchParameters/search.dataset')();
var client = {
search: jest.fn().mockImplementationOnce(function() {
return Promise.resolve(testData.response);
})
};
var helper = algoliasearchHelper(client, 'test_hotels-node');
var originalResponseLength = testData.response.results.length;
helper.on('result', function() {
var currentResponseLength = testData.response.results.length;
expect(currentResponseLength).toBe(originalResponseLength);
done();
});
helper.search('');
});
test('no mutating methods should trigger a search', function() {
var client = {
search: jest.fn().mockImplementationOnce(function() {
return new Promise(function() {});
})
};
var helper = algoliasearchHelper(client, 'Index', {
disjunctiveFacets: ['city'],
facets: ['tower']
});
helper.setQuery('');
helper.clearRefinements();
helper.addDisjunctiveRefine('city', 'Paris');
helper.removeDisjunctiveRefine('city', 'Paris');
helper.addExclude('tower', 'Empire State Building');
helper.removeExclude('tower', 'Empire State Building');
helper.addRefine('tower', 'Empire State Building');
helper.removeRefine('tower', 'Empire State Building');
expect(client.search).toHaveBeenCalledTimes(0);
helper.search();
expect(client.search).toHaveBeenCalledTimes(1);
});
| 30.453782 | 107 | 0.673565 |
9945aba71f77eef11f10c4429f895f446b56cd31 | 1,722 | js | JavaScript | demo/dist/scripts/motion-ui.js | RedCastor/rc-gallery | 811d302c742b343c0458a9021353e300c3e89784 | [
"MIT"
] | 1 | 2017-02-15T21:53:25.000Z | 2017-02-15T21:53:25.000Z | demo/dist/scripts/motion-ui.js | RedCastor/rc-gallery | 811d302c742b343c0458a9021353e300c3e89784 | [
"MIT"
] | null | null | null | demo/dist/scripts/motion-ui.js | RedCastor/rc-gallery | 811d302c742b343c0458a9021353e300c3e89784 | [
"MIT"
] | 2 | 2019-09-16T02:06:20.000Z | 2020-03-14T21:34:47.000Z | !function(n,i){"function"==typeof define&&define.amd?define(["jquery"],i):"object"==typeof exports?module.exports=i(require("jquery")):n.MotionUI=i(n.jQuery)}(this,function(u){"use strict";!function(){Date.now||(Date.now=function(){return(new Date).getTime()});for(var n=["webkit","moz"],i=0;i<n.length&&!window.requestAnimationFrame;++i){var e=n[i];window.requestAnimationFrame=window[e+"RequestAnimationFrame"],window.cancelAnimationFrame=window[e+"CancelAnimationFrame"]||window[e+"CancelRequestAnimationFrame"]}if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){var t=0;window.requestAnimationFrame=function(n){var i=Date.now(),e=Math.max(t+16,i);return setTimeout(function(){n(t=e)},e-i)},window.cancelAnimationFrame=clearTimeout}}();var s=["mui-enter","mui-leave"],m=["mui-enter-active","mui-leave-active"],d=function(){var n={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend"},i=window.document.createElement("div");for(var e in n)if(void 0!==i.style[e])return n[e];return null}();function t(n,i,e,t){if((i=u(i).eq(0)).length){if(null===d)return n?i.show():i.hide(),void t();var o=n?s[0]:s[1],a=n?m[0]:m[1];r(),i.addClass(e),i.css("transition","none"),requestAnimationFrame(function(){i.addClass(o),n&&i.show()}),requestAnimationFrame(function(){i[0].offsetWidth,i.css("transition",""),i.addClass(a)}),i.one("transitionend",function(){n||i.hide();r(),t&&t.apply(i)})}function r(){i[0].style.transitionDuration=0,i.removeClass(o+" "+a+" "+e)}}return{animateIn:function(n,i,e){t(!0,n,i,e)},animateOut:function(n,i,e){t(!1,n,i,e)}}});
//# sourceMappingURL=motion-ui.js.map
| 574 | 1,683 | 0.724158 |
9945cf93c019f3f180e0553e3e3c47a398eb4fb2 | 663 | js | JavaScript | ping-coming-soon-page/src/components/Footer/Footer.js | adechan/Frontend-Mentor-Challenges | c7f768b942b5d943d3d6c72bff22cb5549423d66 | [
"MIT"
] | 4 | 2020-08-01T19:00:34.000Z | 2020-10-21T14:36:14.000Z | ping-coming-soon-page/src/components/Footer/Footer.js | adechan/Frontend-Mentor-Challenges | c7f768b942b5d943d3d6c72bff22cb5549423d66 | [
"MIT"
] | null | null | null | ping-coming-soon-page/src/components/Footer/Footer.js | adechan/Frontend-Mentor-Challenges | c7f768b942b5d943d3d6c72bff22cb5549423d66 | [
"MIT"
] | 2 | 2020-08-04T23:49:43.000Z | 2020-08-24T05:33:01.000Z | import React from "react";
import "./Footer.css";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faFacebookF } from "@fortawesome/free-brands-svg-icons";
import { faTwitter } from "@fortawesome/free-brands-svg-icons";
import { faInstagram } from "@fortawesome/free-brands-svg-icons";
function Footer() {
return (
<div className="footer">
<div className="footer__icons">
<FontAwesomeIcon icon={faFacebookF} />
<FontAwesomeIcon icon={faTwitter} />
<FontAwesomeIcon icon={faInstagram} />
</div>
<p>© Copyright Ping. All rights reserved.</p>
</div>
);
}
export default Footer;
| 28.826087 | 65 | 0.674208 |
9945e694906ca4a545b8c8b423c1067b29e2404c | 2,200 | js | JavaScript | src/components/createChannel.js | Wh1teZz/comp9447 | 024c4ab547b1f29623ae31c12a4a7892309183ff | [
"MIT"
] | null | null | null | src/components/createChannel.js | Wh1teZz/comp9447 | 024c4ab547b1f29623ae31c12a4a7892309183ff | [
"MIT"
] | null | null | null | src/components/createChannel.js | Wh1teZz/comp9447 | 024c4ab547b1f29623ae31c12a4a7892309183ff | [
"MIT"
] | null | null | null | import React from "react"
import axios from 'axios';
import { Link } from "gatsby"
class CreateChannel extends React.Component {
state = {
currentChannelName:"",
username:"",
userToken:""
}
componentDidMount() {
this.setState({username:window.sessionStorage.getItem('username')});
this.setState({userToken:window.sessionStorage.getItem('userToken')});
}
onNameChange = (event) => {
this.setState({ currentChannelName: event.target.value });
};
//token = window.sessionStorage.getItem('userToken');
submitChannel = async (event, title=this.state.currentChannelName) => {
const token = window.sessionStorage.getItem('userToken');
// Quick Validation
if (!title) return;
const res = await axios.post(`https://9il287rnf8.execute-api.us-east-1.amazonaws.com/mvp/channel/create/`,
JSON.stringify(
{
token,
title
}
)
)
if (res.data.statusCode === 200) {
console.log("success", res.data.channelID)
window.location.href='/channels';
}
};
// action='/'
render() {
if (this.state.username === null){
return (
<div>
<p>You are not logged in</p>
<Link to='/login'> Click here to login </Link>
</div>)
}
return (
<div>
<h1>
Make a new channel. Title: {this.state.currentChannelName}
</h1>
<input type="text"
variant="outlined"
margin="normal"
required
type="text"
value={this.state.currentChannelName}
onChange={this.onNameChange}
/>
<br />
<button onClick={this.submitChannel}>
create new channel
</button>
<br />
<Link to="/">Home</Link>
</div>
)
}
}
export default CreateChannel; | 27.5 | 114 | 0.479545 |
994677415d28b003205d36e10b891809d925491a | 686 | js | JavaScript | JSCore/JSFundamentals/08.StringsAndRegExLab/_03CountOccurrences.js | yangra/SoftUni | 2fe8ac059fe398f8bf229200c5406840f026fb88 | [
"MIT"
] | null | null | null | JSCore/JSFundamentals/08.StringsAndRegExLab/_03CountOccurrences.js | yangra/SoftUni | 2fe8ac059fe398f8bf229200c5406840f026fb88 | [
"MIT"
] | null | null | null | JSCore/JSFundamentals/08.StringsAndRegExLab/_03CountOccurrences.js | yangra/SoftUni | 2fe8ac059fe398f8bf229200c5406840f026fb88 | [
"MIT"
] | null | null | null | function countOccurrences(str, text) {
//let words = text.split('/\W+/').filter(w => w !== '');
let counter = 0;
while(true){
let startIndex = text.indexOf(str);
if(startIndex < 0){
break;
}
counter++;
text = text.substr(startIndex+1);
}
console.log(counter);
}
countOccurrences('the', 'The quick brown fox jumps over the lay dog.')
countOccurrences('ma', 'Marine mammal training is the training and caring for marine life such as, dolphins, killer whales, sea lions, walruses, and other marine mammals. It is also a duty of the trainer to do mental and physical exercises to keep the animal healthy and happy.'); | 42.875 | 280 | 0.648688 |
9946e6af8cd568ae85503297207694d077323d8c | 2,391 | js | JavaScript | src/components/SecretsModal/Annotations.js | mnuttall/dashboard | 5f54de5780afb2a17bed84efee977d5c962be13a | [
"Apache-2.0"
] | null | null | null | src/components/SecretsModal/Annotations.js | mnuttall/dashboard | 5f54de5780afb2a17bed84efee977d5c962be13a | [
"Apache-2.0"
] | 1 | 2019-05-28T14:04:03.000Z | 2019-05-28T14:04:03.000Z | src/components/SecretsModal/Annotations.js | mnuttall/dashboard | 5f54de5780afb2a17bed84efee977d5c962be13a | [
"Apache-2.0"
] | null | null | null | /*
Copyright 2019 The Tekton Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT 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 React from 'react';
import { TextInput } from 'carbon-components-react';
import Add from '@carbon/icons-react/lib/add--alt/16';
import Remove from '@carbon/icons-react/lib/close--outline/16';
import './SecretsModal.scss';
const Annotations = props => {
const {
annotations,
handleChange,
handleAdd,
handleRemove,
invalidFields,
disabled
} = props;
const annotationFields = [];
for (let i = 0; i < annotations.length; i += 2) {
annotationFields.push(
<div className="annotationRow" key={i}>
<TextInput
id={`annotation${i}`}
data-testid={`annotation${i}`}
labelText=""
key={`annotation${i}`}
value={annotations[i]}
placeholder=""
onChange={handleChange}
invalid={invalidFields.indexOf(`annotation${i}`) > -1}
autoComplete="off"
disabled={disabled}
/>
<div key={`colon${i}`} className="colon">
:
</div>
<TextInput
id={`annotation${i + 1}`}
data-testid={`annotation${i + 1}`}
labelText=""
key={`annotation${i + 1}`}
value={annotations[i + 1]}
placeholder=""
onChange={handleChange}
invalid={invalidFields.indexOf(`annotation${i + 1}`) > -1}
autoComplete="off"
disabled={disabled}
/>
</div>
);
}
return (
<div className="annotations">
<>
<div className="labelAndButtons">
<p className="label">Server URL:</p>
<Remove className="removeIcon" onClick={handleRemove} />
<Add className="addIcon" onClick={handleAdd} />
</div>
{annotationFields}
<br />
</>
</div>
);
};
Annotations.defaultProps = {};
export default Annotations;
| 28.807229 | 72 | 0.604768 |
9947010fb79d283c99fbcf0007fffe2ea4ff2adb | 593 | js | JavaScript | src/layouts/Products/ProductsClass.js | ErikStain/react_practice | bd46e2cec7036e24c3600ac3104f8187f842d6dd | [
"MIT"
] | null | null | null | src/layouts/Products/ProductsClass.js | ErikStain/react_practice | bd46e2cec7036e24c3600ac3104f8187f842d6dd | [
"MIT"
] | null | null | null | src/layouts/Products/ProductsClass.js | ErikStain/react_practice | bd46e2cec7036e24c3600ac3104f8187f842d6dd | [
"MIT"
] | null | null | null | import { Component } from 'react'
class ProductsClass extends Component {
state = {}
componentDidMount() {}
render() {
return (
<section>
<div>
<button
onClick={() => {
return setCounter(counter - 1)
}}
>
Click less
</button>
<p>{counter}</p>
<button
onClick={() => {
return setCounter(counter + 1)
}}
>
Click more
</button>
</div>
</section>
)
}
}
export default ProductsClass | 19.129032 | 44 | 0.423272 |
994701f45806dba639d468472289836717879103 | 1,079 | js | JavaScript | services/api/src/index.js | miran248/text-twister | 5df227be450c21838dcb2bbad02e4985f4d2c37c | [
"MIT"
] | null | null | null | services/api/src/index.js | miran248/text-twister | 5df227be450c21838dcb2bbad02e4985f4d2c37c | [
"MIT"
] | null | null | null | services/api/src/index.js | miran248/text-twister | 5df227be450c21838dcb2bbad02e4985f4d2c37c | [
"MIT"
] | null | null | null | import Koa from "koa";
import cors from "@koa/cors";
import rawBody from "raw-body";
import Router from "koa-router";
import { encodeSessions, decodeSession } from "./encoder";
import * as sessions from "./sessions";
const app = new Koa;
const router = new Router;
router.get("/sessions", async (context, next) => {
try {
const items = await sessions.list();
context.type = "application/x-protobuf";
context.body = encodeSessions(items);
} catch(e) {
console.log("get", e);
context.throw(400, `Encoding failed with error: ${e.message}`);
}
});
router.post("/sessions", async (context, next) => {
const { req, request } = context;
try {
const body = await rawBody(req, {
length: request.length,
});
const session = decodeSession(body);
await sessions.add(session);
context.status = 200;
} catch(e) {
console.log("post", e);
context.throw(400, `Decoding failed with error: ${e.message}`);
}
});
app
.use(cors({
allowMethods: [ "GET", "POST" ],
}))
.use(router.routes());
app.listen(8080);
| 20.358491 | 67 | 0.626506 |
99472e98cdb61ab0e0416d16d5b892da3e35f142 | 733 | js | JavaScript | src/helpers/scroll.js | christRescues/portfolio | 91632bd408d1a4406e4b98cc4c1eaa6d5afc0a57 | [
"MIT"
] | 1 | 2017-07-28T00:04:34.000Z | 2017-07-28T00:04:34.000Z | src/helpers/scroll.js | christRescues/portfolio | 91632bd408d1a4406e4b98cc4c1eaa6d5afc0a57 | [
"MIT"
] | 2 | 2018-09-08T19:59:08.000Z | 2019-01-05T19:54:43.000Z | src/helpers/scroll.js | protoEvangelion/MERN-Portfolio | 91632bd408d1a4406e4b98cc4c1eaa6d5afc0a57 | [
"MIT"
] | null | null | null | export default function smoothScroll(target) {
var scrollContainer = target
do {
//find scroll container
scrollContainer = scrollContainer.parentNode
if (!scrollContainer) return
scrollContainer.scrollTop += 1
} while (scrollContainer.scrollTop == 0)
var targetY = 0
do {
//find the top of target relatively to the container
if (target == scrollContainer) break
targetY += target.offsetTop
} while ((target = target.offsetParent))
scroll = function(c, a, b, i) {
i++
if (i > 30) return
c.scrollTop = a + (b - a) / 30 * i
setTimeout(function() {
scroll(c, a, b, i)
}, 20)
}
// start scrolling
scroll(scrollContainer, scrollContainer.scrollTop, targetY, 0)
}
| 26.178571 | 64 | 0.653479 |
99474582a2eee32995ae47b65ce7fc05c81e8266 | 2,118 | js | JavaScript | app/routes/public/index.js | AmitAronovitch/open-event-frontend | 9f3091169a76fb4981563f509a44d37eeb1bf673 | [
"Apache-2.0"
] | null | null | null | app/routes/public/index.js | AmitAronovitch/open-event-frontend | 9f3091169a76fb4981563f509a44d37eeb1bf673 | [
"Apache-2.0"
] | null | null | null | app/routes/public/index.js | AmitAronovitch/open-event-frontend | 9f3091169a76fb4981563f509a44d37eeb1bf673 | [
"Apache-2.0"
] | null | null | null | import Route from '@ember/routing/route';
import moment from 'moment';
import { set } from '@ember/object';
import { inject as service } from '@ember/service';
import ENV from 'open-event-frontend/config/environment';
export default Route.extend({
headData: service(),
async model() {
const eventDetails = this.modelFor('public');
return {
event : eventDetails,
tickets : await eventDetails.query('tickets', {
reload: true,
filter: [
{
and: [
{
name : 'sales-starts-at',
op : 'le',
val : moment().toISOString()
},
{
name : 'sales-ends-at',
op : 'ge',
val : moment().toISOString()
}
]
}
]
}),
speakers: await eventDetails.query('speakers', {
filter: [
{
or: [
{
name : 'sessions',
op : 'any',
val : {
name : 'state',
op : 'eq',
val : 'confirmed'
}
},
{
name : 'sessions',
op : 'any',
val : {
name : 'state',
op : 'eq',
val : 'accepted'
}
}
]
}
],
'page[size]': 0
}),
sponsors : await eventDetails.get('sponsors'),
tax : await eventDetails.get('tax'),
order : this.store.createRecord('order', {
event : eventDetails,
user : this.get('authManager.currentUser'),
tickets : []
}),
attendees: [],
mapConfig: ENV.APP.mapConfig
};
},
afterModel(model) {
set(this, 'headData.description', model.event.description);
},
resetController(controller) {
this._super(...arguments);
const model = controller.get('model.order');
if (!model.id) {
model.unloadRecord();
}
}
});
| 24.917647 | 63 | 0.423041 |
994839044074de189ee6f7bb98247bf610c3db39 | 346 | js | JavaScript | Mysql/storage/ndb/mcc/frontend/dojo/dojox/editor/plugins/nls/ro/Breadcrumb.js | clockzhong/WrapLAMP | fa7ad07da3f1759e74966a554befa47bbbbb8dd5 | [
"Apache-2.0"
] | 1 | 2015-12-24T16:44:50.000Z | 2015-12-24T16:44:50.000Z | Mysql/storage/ndb/mcc/frontend/dojo/dojox/editor/plugins/nls/ro/Breadcrumb.js | clockzhong/WrapLAMP | fa7ad07da3f1759e74966a554befa47bbbbb8dd5 | [
"Apache-2.0"
] | 1 | 2015-12-24T18:23:56.000Z | 2015-12-24T18:24:26.000Z | Mysql/storage/ndb/mcc/frontend/dojo/dojox/editor/plugins/nls/ro/Breadcrumb.js | clockzhong/WrapLAMP | fa7ad07da3f1759e74966a554befa47bbbbb8dd5 | [
"Apache-2.0"
] | null | null | null | //>>built
define(
//begin v1.x content
({
"nodeActions": "Acţiuni ${nodeName}",
"selectContents": "Selectare conţinut",
"selectElement": "Selectare element",
"deleteElement": "Ştergere element",
"deleteContents": "Ştergere conţinut",
"moveStart": "Mutare cursor la început",
"moveEnd": "Mutare cursor la sfârşit"
})
//end v1.x content
);
| 21.625 | 41 | 0.696532 |
994893578762401f4a490a9f0164fde1f6171a05 | 935 | js | JavaScript | week-4/filtering.js | VisionsICStudios/web-231 | 4fa8ffd0ee0a048bf83beb49c9c48579d9c3f158 | [
"MIT"
] | 1 | 2020-07-01T03:58:21.000Z | 2020-07-01T03:58:21.000Z | week-4/filtering.js | VisionsICStudios/web-231 | 4fa8ffd0ee0a048bf83beb49c9c48579d9c3f158 | [
"MIT"
] | null | null | null | week-4/filtering.js | VisionsICStudios/web-231 | 4fa8ffd0ee0a048bf83beb49c9c48579d9c3f158 | [
"MIT"
] | null | null | null | /*
============================================
; Title: filtering.js
; Author: Professor Krasso
; Date: 25 June 2017
; Description: Demonstrates how to filter values in an array
;===========================================
*/
// array of string values
const names = ['Steve', 'John', 'Chris', 'Adam', 'Jerry']
// output
console.log("-- DISPLAYING NAMES --");
for (let j = 0; j < names.length; j++) {
console.log(names[j]);
}
// new line
console.log("\n");
// output
console.log(" -- SELECTED VALUE --");
console.log(getName(names, "John"));
// new line
console.log("\n");
// output
console.log(" -- SELECTED VALUE --");
console.log(getName(names, "Adam"));
/**
* Params: array, filterValue
* Response: array element
* Description: Returns a filtered value from an array
*/
function getName(arr, filterValue) {
for (let k = 0; k < arr.length; k++) {
if (arr[k] === filterValue) {
return arr[k];
}
}
}
| 20.777778 | 60 | 0.562567 |
9948d90e7c96a2a3e04eeb261387e8cae73ffd81 | 8,153 | js | JavaScript | _nuxt/3e27567e09c7a67ed9ba.js | BMoreToken/bmoretoken-website | 90bef74d034f5744775d1e0e7e3ce9555884290f | [
"MIT"
] | 1 | 2021-06-08T21:19:38.000Z | 2021-06-08T21:19:38.000Z | _nuxt/3e27567e09c7a67ed9ba.js | insidenothing/BMoreToken | 90bef74d034f5744775d1e0e7e3ce9555884290f | [
"MIT"
] | 4 | 2021-06-14T14:29:53.000Z | 2021-06-19T11:15:47.000Z | _nuxt/3e27567e09c7a67ed9ba.js | insidenothing/BMoreToken | 90bef74d034f5744775d1e0e7e3ce9555884290f | [
"MIT"
] | null | null | null | (window.webpackJsonp=window.webpackJsonp||[]).push([[59],{402:function(t,e,n){"use strict";
var r=n(15),o=n(737),h=n(106),c=n(16).Buffer,f=n(403),l=n(314),d=n(315),y=c.alloc(128);
function m(t,e){h.call(this,"digest"),"string"==typeof e&&(e=c.from(e));
var n="sha512"===t||"sha384"===t?128:64;
(this._alg=t,this._key=e,e.length>n)?e=("rmd160"===t?new l:d(t)).update(e).digest():e.length<n&&(e=c.concat([e,y],n));
for(var r=this._ipad=c.allocUnsafe(n),o=this._opad=c.allocUnsafe(n),i=0;
i<n;
i++)r[i]=54^e[i],o[i]=92^e[i];
this._hash="rmd160"===t?new l:d(t),this._hash.update(r)}r(m,h),m.prototype._update=function(data){this._hash.update(data)},m.prototype._final=function(){var t=this._hash.digest();
return("rmd160"===this._alg?new l:d(this._alg)).update(this._opad).update(t).digest()},t.exports=function(t,e){return"rmd160"===(t=t.toLowerCase())||"ripemd160"===t?new m("rmd160",e):"md5"===t?new o(f,e):new m(t,e)}},403:function(t,e,n){var r=n(311);
t.exports=function(t){return(new r).update(t).digest()}},716:function(t,e){!function(){"use strict";
function t(e,path,n,script){return this instanceof t?(this.domain=e||void 0,this.path=path||"/",this.secure=!!n,this.script=!!script,this):new t(e,path,n,script)}function n(t,e,r){return t instanceof n?t:this instanceof n?(this.name=null,this.value=null,this.expiration_date=1/0,this.path=String(r||"/"),this.explicit_path=!1,this.domain=e||null,this.explicit_domain=!1,this.secure=!1,this.noscript=!1,t&&this.parse(t,e,r),this):new n(t,e,r)}t.All=Object.freeze(Object.create(null)),e.CookieAccessInfo=t,e.Cookie=n,n.prototype.toString=function(){var t=[this.name+"="+this.value];
return this.expiration_date!==1/0&&t.push("expires="+new Date(this.expiration_date).toGMTString()),this.domain&&t.push("domain="+this.domain),this.path&&t.push("path="+this.path),this.secure&&t.push("secure"),this.noscript&&t.push("httponly"),t.join(";
")},n.prototype.toValueString=function(){return this.name+"="+this.value};
var r=/[:](?=\s*[a-zA-Z0-9_\-]+\s*[=])/g;
function o(){var t,e;
return this instanceof o?(t=Object.create(null),this.setCookie=function(r,o,h){var c,i;
if(c=(r=new n(r,o,h)).expiration_date<=Date.now(),void 0!==t[r.name]){for(e=t[r.name],i=0;
i<e.length;
i+=1)if(e[i].collidesWith(r))return c?(e.splice(i,1),0===e.length&&delete t[r.name],!1):(e[i]=r,r);
return!c&&(e.push(r),r)}return!c&&(t[r.name]=[r],t[r.name])},this.getCookie=function(n,r){var o,i;
if(e=t[n])for(i=0;
i<e.length;
i+=1)if((o=e[i]).expiration_date<=Date.now())0===e.length&&delete t[o.name];
else if(o.matches(r))return o},this.getCookies=function(e){var n,r,o=[];
for(n in t)(r=this.getCookie(n,e))&&o.push(r);
return o.toString=function(){return o.join(":")},o.toValueString=function(){return o.map((function(t){return t.toValueString()})).join(";
")},o},this):new o}n.prototype.parse=function(t,e,r){if(this instanceof n){var i,o=t.split(";
").filter((function(t){return!!t})),h=o[0].match(/([^=]+)=([\s\S]*)/);
if(!h)return void console.warn("Invalid cookie header encountered. Header: '"+t+"'");
var c=h[1],f=h[2];
if("string"!=typeof c||0===c.length||"string"!=typeof f)return void console.warn("Unable to extract values from cookie header. Cookie: '"+t+"'");
for(this.name=c,this.value=f,i=1;
i<o.length;
i+=1)switch(c=(h=o[i].match(/([^=]+)(?:=([\s\S]*))?/))[1].trim().toLowerCase(),f=h[2],c){case"httponly":this.noscript=!0;
break;
case"expires":this.expiration_date=f?Number(Date.parse(f)):1/0;
break;
case"path":this.path=f?f.trim():"",this.explicit_path=!0;
break;
case"domain":this.domain=f?f.trim():"",this.explicit_domain=!!this.domain;
break;
case"secure":this.secure=!0}return this.explicit_path||(this.path=r||"/"),this.explicit_domain||(this.domain=e),this}return(new n).parse(t,e,r)},n.prototype.matches=function(e){return e===t.All||!(this.noscript&&e.script||this.secure&&!e.secure||!this.collidesWith(e))},n.prototype.collidesWith=function(t){if(this.path&&!t.path||this.domain&&!t.domain)return!1;
if(this.path&&0!==t.path.indexOf(this.path))return!1;
if(this.explicit_path&&0!==t.path.indexOf(this.path))return!1;
var e=t.domain&&t.domain.replace(/^[\.]/,""),n=this.domain&&this.domain.replace(/^[\.]/,"");
if(n===e)return!0;
if(n){if(!this.explicit_domain)return!1;
var r=e.indexOf(n);
return-1!==r&&r===e.length-n.length}return!0},e.CookieJar=o,o.prototype.setCookies=function(t,e,o){var i,h,c=[];
for(t=(t=Array.isArray(t)?t:t.split(r)).map((function(t){return new n(t,e,o)})),i=0;
i<t.length;
i+=1)h=t[i],this.setCookie(h,e,o)&&c.push(h);
return c}}()},737:function(t,e,n){"use strict";
var r=n(15),o=n(16).Buffer,h=n(106),c=o.alloc(128);
function f(t,e){h.call(this,"digest"),"string"==typeof e&&(e=o.from(e)),this._alg=t,this._key=e,e.length>64?e=t(e):e.length<64&&(e=o.concat([e,c],64));
for(var n=this._ipad=o.allocUnsafe(64),r=this._opad=o.allocUnsafe(64),i=0;
i<64;
i++)n[i]=54^e[i],r[i]=92^e[i];
this._hash=[n]}r(f,h),f.prototype._update=function(data){this._hash.push(data)},f.prototype._final=function(){var t=this._alg(o.concat(this._hash));
return this._alg(o.concat([this._opad,t]))},t.exports=f},795:function(t,e,n){(function(e){var r=n(183),o=n(20);
t.exports=function(t){return new c(t)};
var h={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};
function c(t){this.curveType=h[t],this.curveType||(this.curveType={name:t}),this.curve=new r.ec(this.curveType.name),this.keys=void 0}function f(t,n,r){Array.isArray(t)||(t=t.toArray());
var o=new e(t);
if(r&&o.length<r){var h=new e(r-o.length);
h.fill(0),o=e.concat([h,o])}return n?o.toString(n):o}h.p224=h.secp224r1,h.p256=h.secp256r1=h.prime256v1,h.p192=h.secp192r1=h.prime192v1,h.p384=h.secp384r1,h.p521=h.secp521r1,c.prototype.generateKeys=function(t,e){return this.keys=this.curve.genKeyPair(),this.getPublicKey(t,e)},c.prototype.computeSecret=function(t,n,r){return n=n||"utf8",e.isBuffer(t)||(t=new e(t,n)),f(this.curve.keyFromPublic(t).getPublic().mul(this.keys.getPrivate()).getX(),r,this.curveType.byteLength)},c.prototype.getPublicKey=function(t,e){var n=this.keys.getPublic("compressed"===e,!0);
return"hybrid"===e&&(n[n.length-1]%2?n[0]=7:n[0]=6),f(n,t)},c.prototype.getPrivateKey=function(t){return f(this.keys.getPrivate(),t)},c.prototype.setPublicKey=function(t,n){return n=n||"utf8",e.isBuffer(t)||(t=new e(t,n)),this.keys._importPublic(t),this},c.prototype.setPrivateKey=function(t,n){n=n||"utf8",e.isBuffer(t)||(t=new e(t,n));
var r=new o(t);
return r=r.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(r),this}}).call(this,n(11).Buffer)},80:function(t,e,n){(function(t){function n(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===n(t)},e.isBoolean=function(t){return"boolean"==typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return"number"==typeof t},e.isString=function(t){return"string"==typeof t},e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return"[object RegExp]"===n(t)},e.isObject=function(t){return"object"==typeof t&&null!==t},e.isDate=function(t){return"[object Date]"===n(t)},e.isError=function(t){return"[object Error]"===n(t)||t instanceof Error},e.isFunction=function(t){return"function"==typeof t},e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=t.isBuffer}).call(this,n(11).Buffer)},96:function(t,e,n){"use strict";
var r=n(15),o=n(311),h=n(314),c=n(315),f=n(106);
function l(t){f.call(this,"digest"),this._hash=t}r(l,f),l.prototype._update=function(data){this._hash.update(data)},l.prototype._final=function(){return this._hash.digest()},t.exports=function(t){return"md5"===(t=t.toLowerCase())?new o:"rmd160"===t||"ripemd160"===t?new h:new l(c(t))}}}]);
| 111.684932 | 1,129 | 0.684411 |
9949653f9221ed8b27292a81e37c1a2c4a33d77b | 2,446 | js | JavaScript | src/events/messageReactionAdd.js | paolosasso/Discord-Bot | c7b97dd218ec45fd16d3fa772a054ca710c06bd2 | [
"Apache-2.0"
] | null | null | null | src/events/messageReactionAdd.js | paolosasso/Discord-Bot | c7b97dd218ec45fd16d3fa772a054ca710c06bd2 | [
"Apache-2.0"
] | null | null | null | src/events/messageReactionAdd.js | paolosasso/Discord-Bot | c7b97dd218ec45fd16d3fa772a054ca710c06bd2 | [
"Apache-2.0"
] | null | null | null | // Dependencies
const { MessageEmbed } = require('discord.js'),
{ ReactionRoleSchema } = require('../database/models'),
Event = require('../structures/Event');
module.exports = class messageReactionAdd extends Event {
async run(bot, reaction, user) {
// For debugging
if (bot.config.debug) bot.logger.debug(`Message reaction added${!reaction.message.guild ? '' : ` in guild: ${reaction.message.guild.id}`}`);
// Make sure it's not a BOT and in a guild
if (user.bot) return;
if (!reaction.message.guild) return;
// If reaction needs to be fetched
if (reaction.message.partial) await reaction.message.fetch();
if (reaction.partial) await reaction.fetch();
// Get server settings / if no settings then return
const settings = reaction.message.guild.settings;
if (Object.keys(settings).length == 0) return;
// Check if event messageReactionAdd is for logging
if (settings.ModLogEvents.includes('MESSAGEREACTIONADD') && settings.ModLog) {
const embed = new MessageEmbed()
.setDescription(`**${user.toString()} reacted with ${reaction.emoji.toString()} to [this message](${reaction.message.url})** `)
.setColor(3066993)
.setFooter(`User: ${user.id} | Message: ${reaction.message.id} `)
.setAuthor(user.tag, user.displayAvatarURL())
.setTimestamp();
// Find channel and send message
const modChannel = await bot.channels.fetch(settings.ModLogChannel);
if (modChannel && modChannel.guild.id == reaction.message.guild.id) bot.addEmbed(modChannel.id, embed);
}
const { guild } = reaction.message;
const member = guild.members.cache.get(user.id);
if (!member) return;
// fetch database
const dbReaction = await ReactionRoleSchema.findOne({
guildID: guild.id,
messageID: reaction.message.id,
});
// Get role to add/remove to user
if (!dbReaction) return;
const rreaction = dbReaction.reactions.find(r => r.emoji === reaction.emoji.toString());
if (!rreaction) return;
// Add or remove role depending if they have it or not
try {
if (!member.roles.cache.has(rreaction.roleID)) {
await member.roles.add(rreaction.roleID);
} else {
await member.roles.remove(rreaction.roleID);
}
} catch (err) {
const channel = guild.channels.cache.get(dbReaction.channelID);
if (channel) channel.send(`I am missing permission to give ${member} the role: ${guild.roles.cache.get(rreaction.roleID)}`).then(m => m.delete({ timeout: 5000 }));
}
}
};
| 37.630769 | 166 | 0.695421 |
994966c2278395edf130716868182d89cc309735 | 323 | js | JavaScript | src/main/js/action/alert.js | quinscape/exceed | 39e73e74193921540556beb9862f4fd0b5a4a4aa | [
"Apache-2.0"
] | 3 | 2017-11-09T15:36:05.000Z | 2017-12-29T13:27:10.000Z | src/main/js/action/alert.js | quinscape/exceed | 39e73e74193921540556beb9862f4fd0b5a4a4aa | [
"Apache-2.0"
] | null | null | null | src/main/js/action/alert.js | quinscape/exceed | 39e73e74193921540556beb9862f4fd0b5a4a4aa | [
"Apache-2.0"
] | null | null | null |
import Dialog from "../util/dialog"
import DataCursor from "../domain/cursor"
export default function (text)
{
if (text instanceof DataCursor)
{
text = text.get();
}
if (typeof text === "object")
{
text = JSON.stringify(text, null, 4);
}
return Dialog.alert(String(text));
}
| 17 | 45 | 0.591331 |
9949d4bf408bb31d715ab8c74c888517bd9eb6cf | 8,230 | js | JavaScript | tests/specs/register-resolve-error-specs.js | losandes/hilaryjs | 29b61b6705e82c4427b762e635adb2e943f4a8ae | [
"MIT"
] | 2 | 2016-04-06T18:20:45.000Z | 2018-06-07T13:37:15.000Z | tests/specs/register-resolve-error-specs.js | losandes/hilaryjs | 29b61b6705e82c4427b762e635adb2e943f4a8ae | [
"MIT"
] | null | null | null | tests/specs/register-resolve-error-specs.js | losandes/hilaryjs | 29b61b6705e82c4427b762e635adb2e943f4a8ae | [
"MIT"
] | null | null | null | (function (register) {
'use strict';
register({
name: 'register-resolve-error-specs',
Spec: Spec
});
function Spec (hilary, expect, id) {
return {
'when attempting to register a module,': {
'and the first argument is NOT an object or array': {
'it should return an exception': registerInvalidFirstArg
},
'and the registration is missing required properties': {
'it should return an exception': registrationMissingProperties
}
},
'when attempting to resolve a module,': {
'and the name is not a string': {
'it should return an exception': resolveWithInvalidName
},
'and the module is not found': {
'it should return an exception': resolveNotFound
},
'and the module\'s dependencies were not found': {
'it should return an exception': resolveMissingDependencies
}
},
'when resolving a module that depends on a broken module': {
'it should log an exception': resolveDependsOnBrokenModule
},
'when resolving a module that depends on a module that depends on a broken module': {
'it should log an exception (1)': resolveDependsOnModuleThatDependsOnABrokenModule,
'it should log an exception (2)': resolveDependsOnModuleThatDependsOnABrokenModule2
}
};
function registerInvalidFirstArg () {
// given
var scope = hilary.scope(id.createUid(8), { logging: { log: function () {}}});
// when
var actual = scope.register(0);
// then
expect(actual.isException).to.equal(true);
expect(actual.type).to.equal('InvalidArgument');
}
function registrationMissingProperties () {
// given
var scope = hilary.scope(id.createUid(8), { logging: { log: function () {}}});
// when
var actual = scope.register({});
// then
expect(actual.isException).to.equal(true);
expect(actual.type).to.equal('InvalidRegistration');
}
function resolveWithInvalidName () {
// given
var scope = hilary.scope(id.createUid(8), { logging: { log: function () {}}});
// when
var actual = scope.resolve(0);
// then
expect(actual.isException).to.equal(true);
expect(actual.type).to.equal('InvalidArgument');
}
function resolveNotFound () {
// given
var scope = hilary.scope(id.createUid(8), { logging: { log: function () {}}});
// when
var actual = scope.resolve(id.createUid(8));
// then
expect(actual.isException).to.equal(true);
expect(actual.type).to.equal('ModuleNotFound');
}
function resolveMissingDependencies () {
// given
var scope = hilary.scope(id.createUid(8), { logging: { log: function () {}}}),
actual;
scope.register({
name: 'regfunc1',
factory: function () {
this.foo = 'bar';
}
});
scope.register({
name: 'regfunc4',
dependencies: ['regfunc1', 'regfunc2', 'regfunc3'],
factory: function (f1, f2, f3) {
this.f1 = f1;
this.f2 = f2;
this.f3 = f3;
}
});
// when
actual = scope.resolve('regfunc4');
// then
expect(actual.isException).to.equal(true);
expect(actual.type).to.equal('ModuleNotFound');
}
function resolveDependsOnBrokenModule () {
var scope = hilary.scope(id.createUid(8), { logging: { log: function () {}}}),
actual;
scope.register({ name: 't1', factory: () => { return { foo: 'bar1' }; }});
scope.register({ name: 't2', factory: () => { return { foo: 'bar2' }; }});
scope.register({ name: 't3', factory: () => { throw new Error('BOOM!'); }});
scope.register({ name: 't4', factory: () => { return { foo: 'bar4' }; }});
scope.register({ name: 't5', factory: () => { return { foo: 'bar5' }; }});
scope.register({ name: 'sut', factory: (t1, t2, t3, t4, t5) => {
return {
t1: t1,
t2: t2,
t3: t3,
t4: t4,
t5: t5
};
}});
// when
actual = scope.resolve('sut');
// then
expect(actual.isException).to.equal(true);
expect(actual.type).to.equal('ModuleNotResolved');
}
function resolveDependsOnModuleThatDependsOnABrokenModule () {
var scope = hilary.scope(id.createUid(8), { logging: { log: function () {}}}),
actual;
scope.register({ name: 't1', factory: () => { return { foo: 'bar1' }; }});
scope.register({ name: 't2', factory: () => { return { foo: 'bar2' }; }});
scope.register({ name: 't3', factory: () => { throw new Error('BOOM!'); }});
scope.register({ name: 't4', factory: () => { return { foo: 'bar4' }; }});
scope.register({ name: 't5', factory: () => { return { foo: 'bar5' }; }});
scope.register({ name: 't6', factory: (t1, t2, t3, t4, t5) => {
return {
t1: t1,
t2: t2,
t3: t3,
t4: t4,
t5: t5
};
}});
scope.register({ name: 'sut', factory: (t1, t6, t2, t3) => {
return {
t1: t1,
t2: t2,
t3: t3,
t6: t6
};
}});
// when
actual = scope.resolve('sut');
// then
expect(actual.isException).to.equal(true);
expect(actual.type).to.equal('ModuleNotResolved');
}
function resolveDependsOnModuleThatDependsOnABrokenModule2 () {
var scope = hilary.scope(id.createUid(8), { logging: { log: function () {}}}),
actual;
scope.register({ name: 't1', factory: () => { return { foo: 'bar1' }; }});
scope.register({ name: 't2', factory: () => { return { foo: 'bar2' }; }});
scope.register({ name: 't3', factory: (t2) => { t2.bar(); /*should throw*/ }});
scope.register({ name: 't4', factory: () => { return { foo: 'bar4' }; }});
scope.register({ name: 't5', factory: () => { return { foo: 'bar5' }; }});
scope.register({ name: 't6', factory: (t1, t2, t3, t4, t5) => {
return {
t1: t1,
t2: t2,
t3: t3,
t4: t4,
t5: t5
};
}});
scope.register({ name: 'sut', factory: (t1, t6, t2, t3) => {
return {
t1: t1,
t2: t2,
t3: t3,
t6: t6
};
}});
// when
actual = scope.resolve('sut');
// then
expect(actual.isException).to.equal(true);
expect(actual.type).to.equal('ModuleNotResolved');
}
} // /Spec
}(function (registration) {
'use strict';
if (typeof module !== 'undefined' && module.exports) {
module.exports = registration.Spec;
} else if (typeof window !== 'undefined') {
window.fixtures = window.fixtures || {};
window.fixtures[registration.name] = registration.Spec;
} else {
throw new Error('[HILARY-TESTS] Unkown runtime environment');
}
}));
| 36.096491 | 99 | 0.456987 |
9949d8fb9e72e73ba383bbdff652e92a12b9e552 | 9,643 | js | JavaScript | node_modules/esbuild/install.js | Noisycools/warungin | 1149b03a3e8849c4bdc7142c85347abe34893a2f | [
"MIT"
] | 1 | 2021-11-30T04:44:14.000Z | 2021-11-30T04:44:14.000Z | node_modules/esbuild/install.js | Noisycools/warungin | 1149b03a3e8849c4bdc7142c85347abe34893a2f | [
"MIT"
] | null | null | null | node_modules/esbuild/install.js | Noisycools/warungin | 1149b03a3e8849c4bdc7142c85347abe34893a2f | [
"MIT"
] | 1 | 2021-10-05T10:29:50.000Z | 2021-10-05T10:29:50.000Z | var __create = Object.create;
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
var __reExport = (target, module2, copyDefault, desc) => {
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
for (let key of __getOwnPropNames(module2))
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
}
return target;
};
var __toESM = (module2, isNodeMode) => {
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
};
// lib/npm/node-platform.ts
var fs = require("fs");
var os = require("os");
var path = require("path");
var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH;
var knownWindowsPackages = {
"win32 arm64 LE": "esbuild-windows-arm64",
"win32 ia32 LE": "esbuild-windows-32",
"win32 x64 LE": "esbuild-windows-64"
};
var knownUnixlikePackages = {
"android arm64 LE": "esbuild-android-arm64",
"darwin arm64 LE": "esbuild-darwin-arm64",
"darwin x64 LE": "esbuild-darwin-64",
"freebsd arm64 LE": "esbuild-freebsd-arm64",
"freebsd x64 LE": "esbuild-freebsd-64",
"linux arm LE": "esbuild-linux-arm",
"linux arm64 LE": "esbuild-linux-arm64",
"linux ia32 LE": "esbuild-linux-32",
"linux mips64el LE": "esbuild-linux-mips64le",
"linux ppc64 LE": "esbuild-linux-ppc64le",
"linux riscv64 LE": "esbuild-linux-riscv64",
"linux s390x BE": "esbuild-linux-s390x",
"linux x64 LE": "esbuild-linux-64",
"netbsd x64 LE": "esbuild-netbsd-64",
"openbsd x64 LE": "esbuild-openbsd-64",
"sunos x64 LE": "esbuild-sunos-64"
};
var knownWebAssemblyFallbackPackages = {
"android x64 LE": "esbuild-android-64"
};
function pkgAndSubpathForCurrentPlatform() {
let pkg;
let subpath;
let isWASM = false;
let platformKey = `${process.platform} ${os.arch()} ${os.endianness()}`;
if (platformKey in knownWindowsPackages) {
pkg = knownWindowsPackages[platformKey];
subpath = "esbuild.exe";
} else if (platformKey in knownUnixlikePackages) {
pkg = knownUnixlikePackages[platformKey];
subpath = "bin/esbuild";
} else if (platformKey in knownWebAssemblyFallbackPackages) {
pkg = knownWebAssemblyFallbackPackages[platformKey];
subpath = "bin/esbuild";
isWASM = true;
} else {
throw new Error(`Unsupported platform: ${platformKey}`);
}
return { pkg, subpath, isWASM };
}
function downloadedBinPath(pkg, subpath) {
const esbuildLibDir = path.dirname(require.resolve("esbuild"));
return path.join(esbuildLibDir, `downloaded-${pkg}-${path.basename(subpath)}`);
}
// lib/npm/node-install.ts
var fs2 = require("fs");
var os2 = require("os");
var path2 = require("path");
var zlib = require("zlib");
var https = require("https");
var child_process = require("child_process");
var toPath = path2.join(__dirname, "bin", "esbuild");
var isToPathJS = true;
function validateBinaryVersion(...command) {
command.push("--version");
const stdout = child_process.execFileSync(command.shift(), command, {
stdio: "pipe"
}).toString().trim();
if (stdout !== "0.14.24") {
throw new Error(`Expected ${JSON.stringify("0.14.24")} but got ${JSON.stringify(stdout)}`);
}
}
function isYarn() {
const { npm_config_user_agent } = process.env;
if (npm_config_user_agent) {
return /\byarn\//.test(npm_config_user_agent);
}
return false;
}
function fetch(url) {
return new Promise((resolve, reject) => {
https.get(url, (res) => {
if ((res.statusCode === 301 || res.statusCode === 302) && res.headers.location)
return fetch(res.headers.location).then(resolve, reject);
if (res.statusCode !== 200)
return reject(new Error(`Server responded with ${res.statusCode}`));
let chunks = [];
res.on("data", (chunk) => chunks.push(chunk));
res.on("end", () => resolve(Buffer.concat(chunks)));
}).on("error", reject);
});
}
function extractFileFromTarGzip(buffer, subpath) {
try {
buffer = zlib.unzipSync(buffer);
} catch (err) {
throw new Error(`Invalid gzip data in archive: ${err && err.message || err}`);
}
let str = (i, n) => String.fromCharCode(...buffer.subarray(i, i + n)).replace(/\0.*$/, "");
let offset = 0;
subpath = `package/${subpath}`;
while (offset < buffer.length) {
let name = str(offset, 100);
let size = parseInt(str(offset + 124, 12), 8);
offset += 512;
if (!isNaN(size)) {
if (name === subpath)
return buffer.subarray(offset, offset + size);
offset += size + 511 & ~511;
}
}
throw new Error(`Could not find ${JSON.stringify(subpath)} in archive`);
}
function installUsingNPM(pkg, subpath, binPath) {
const env = __spreadProps(__spreadValues({}, process.env), { npm_config_global: void 0 });
const esbuildLibDir = path2.dirname(require.resolve("esbuild"));
const installDir = path2.join(esbuildLibDir, "npm-install");
fs2.mkdirSync(installDir);
try {
fs2.writeFileSync(path2.join(installDir, "package.json"), "{}");
child_process.execSync(`npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.14.24"}`, { cwd: installDir, stdio: "pipe", env });
const installedBinPath = path2.join(installDir, "node_modules", pkg, subpath);
fs2.renameSync(installedBinPath, binPath);
} finally {
try {
removeRecursive(installDir);
} catch {
}
}
}
function removeRecursive(dir) {
for (const entry of fs2.readdirSync(dir)) {
const entryPath = path2.join(dir, entry);
let stats;
try {
stats = fs2.lstatSync(entryPath);
} catch {
continue;
}
if (stats.isDirectory())
removeRecursive(entryPath);
else
fs2.unlinkSync(entryPath);
}
fs2.rmdirSync(dir);
}
function applyManualBinaryPathOverride(overridePath) {
const pathString = JSON.stringify(overridePath);
fs2.writeFileSync(toPath, `#!/usr/bin/env node
require('child_process').execFileSync(${pathString}, process.argv.slice(2), { stdio: 'inherit' });
`);
const libMain = path2.join(__dirname, "lib", "main.js");
const code = fs2.readFileSync(libMain, "utf8");
fs2.writeFileSync(libMain, `var ESBUILD_BINARY_PATH = ${pathString};
${code}`);
}
function maybeOptimizePackage(binPath) {
if (os2.platform() !== "win32" && !isYarn()) {
const tempPath = path2.join(__dirname, "bin-esbuild");
try {
fs2.linkSync(binPath, tempPath);
fs2.renameSync(tempPath, toPath);
isToPathJS = false;
fs2.unlinkSync(tempPath);
} catch {
}
}
}
async function downloadDirectlyFromNPM(pkg, subpath, binPath) {
const url = `https://registry.npmjs.org/${pkg}/-/${pkg}-${"0.14.24"}.tgz`;
console.error(`[esbuild] Trying to download ${JSON.stringify(url)}`);
try {
fs2.writeFileSync(binPath, extractFileFromTarGzip(await fetch(url), subpath));
fs2.chmodSync(binPath, 493);
} catch (e) {
console.error(`[esbuild] Failed to download ${JSON.stringify(url)}: ${e && e.message || e}`);
throw e;
}
}
async function checkAndPreparePackage() {
if (ESBUILD_BINARY_PATH) {
applyManualBinaryPathOverride(ESBUILD_BINARY_PATH);
return;
}
const { pkg, subpath } = pkgAndSubpathForCurrentPlatform();
let binPath;
try {
binPath = require.resolve(`${pkg}/${subpath}`);
} catch (e) {
console.error(`[esbuild] Failed to find package "${pkg}" on the file system
This can happen if you use the "--no-optional" flag. The "optionalDependencies"
package.json feature is used by esbuild to install the correct binary executable
for your current platform. This install script will now attempt to work around
this. If that fails, you need to remove the "--no-optional" flag to use esbuild.
`);
binPath = downloadedBinPath(pkg, subpath);
try {
console.error(`[esbuild] Trying to install package "${pkg}" using npm`);
installUsingNPM(pkg, subpath, binPath);
} catch (e2) {
console.error(`[esbuild] Failed to install package "${pkg}" using npm: ${e2 && e2.message || e2}`);
try {
await downloadDirectlyFromNPM(pkg, subpath, binPath);
} catch (e3) {
throw new Error(`Failed to install package "${pkg}"`);
}
}
}
maybeOptimizePackage(binPath);
}
checkAndPreparePackage().then(() => {
if (isToPathJS) {
validateBinaryVersion("node", toPath);
} else {
validateBinaryVersion(toPath);
}
});
| 37.521401 | 259 | 0.672405 |
994a09d6318b6850d112ee8ec59c200ba651f800 | 617 | js | JavaScript | script/preloader.js | irwantods/PWA_DISCUSS | 9ee7222c977512d265a8ce30240178dd7077cf54 | [
"MIT"
] | null | null | null | script/preloader.js | irwantods/PWA_DISCUSS | 9ee7222c977512d265a8ce30240178dd7077cf54 | [
"MIT"
] | null | null | null | script/preloader.js | irwantods/PWA_DISCUSS | 9ee7222c977512d265a8ce30240178dd7077cf54 | [
"MIT"
] | null | null | null | function showPreloader() {
document.querySelector('.preloader-background').innerHTML =
`
<div class="preloader-wrapper big active">
<div class="spinner-layer">
<div class="circle-clipper left">
<div class="circle"></div>
</div>
<div class="gap-patch">
<div class="circle"></div>
</div>
<div class="circle-clipper right">
<div class="circle"></div>
</div>
</div>
</div>
`
} | 34.277778 | 68 | 0.414911 |
994a3c860f762fa570af1a53571fac9a15dc96dc | 19,847 | js | JavaScript | background.js | joeyespo/inbox-by-gmail-checker | 28ef4330961fda21688283fd3e4f7c3f32fcce32 | [
"MIT"
] | 75 | 2015-01-01T12:13:19.000Z | 2020-07-26T19:44:35.000Z | background.js | joeyespo/inbox-by-gmail-checker | 28ef4330961fda21688283fd3e4f7c3f32fcce32 | [
"MIT"
] | 38 | 2015-07-18T02:32:33.000Z | 2018-07-01T16:10:41.000Z | background.js | joeyespo/inbox-by-gmail-checker | 28ef4330961fda21688283fd3e4f7c3f32fcce32 | [
"MIT"
] | 31 | 2015-08-06T16:03:49.000Z | 2021-11-15T13:18:38.000Z | // Copyright (c) 2012 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.
// Derivative work by Joe Esposito
// Configuration
var animationFrames = 36;
var animationSpeed = 10; // ms
var canvas = document.getElementById('canvas');
var loggedInImage = document.getElementById('logged_in');
var canvasContext = canvas.getContext('2d');
var pollIntervalDefault = 3; // 3 seconds
var pollIntervalMax = 3600; // 1 hour
var requestTimeout = 1000 * 2; // 2 seconds
var tryAgainTime = 1000 * 5; // 5 seconds
var rotation = 0;
var loadingAnimation = new LoadingAnimation();
var openedLoginPage = false;
var distractionFreeMode = false;
var distractionFreeModeTimerId = null;
var options = {
defaultUser: 0,
pollInterval: 0,
quietHours: [],
distractionFreeMinutes: 30,
useSnoozeColor: true,
useDesktopNotifications: true,
showPageMenu: true,
focusExistingInboxTab: false,
openInEmptyTab: false
};
// Legacy support for pre-event-pages
var oldChromeVersion = !chrome.runtime;
var requestTimerId;
function isQuietTime() {
if (distractionFreeMode) {
return true;
}
var time = new Date();
return options.quietHours && options.quietHours.indexOf(time.getHours()) !== -1;
}
function getUser() {
// Appends the /u/ route when default user is set and not equal to 0
return options.defaultUser ? ('u/' + options.defaultUser + '/') : '';
}
function getGmailBaseUrl() {
return 'https://mail.google.com/';
}
function getGmailUrl() {
return getGmailBaseUrl() + 'mail/' + getUser();
}
function getInboxBaseUrl() {
return 'https://inbox.google.com/';
}
function getInboxUrl() {
return getInboxBaseUrl() + getUser();
}
// Identifier used to debug the possibility of multiple instances of the
// extension making requests on behalf of a single user.
function getInstanceId() {
if (!localStorage.hasOwnProperty('instanceId'))
localStorage.instanceId = 'gmc' + parseInt(Date.now() * Math.random(), 10);
return localStorage.instanceId;
}
function getFeedUrl() {
// "zx" is a Gmail query parameter that is expected to contain a random
// string and may be ignored/stripped.
return getGmailUrl() + 'feed/atom?zx=' + encodeURIComponent(getInstanceId());
}
function isInboxUrl(url) {
// Return whether the URL starts with the Inbox prefix.
return url.indexOf(getInboxBaseUrl()) === 0 ||
url.indexOf(getGmailBaseUrl()) === 0;
}
// A "loading" animation displayed while we wait for the first response from
// Gmail. This animates the badge text with a dot that cycles from left to
// right.
function LoadingAnimation() {
this.timerId_ = 0;
this.maxCount_ = 8; // Total number of states in animation
this.current_ = 0; // Current state
this.maxDot_ = 4; // Max number of dots in animation
}
LoadingAnimation.prototype.paintFrame = function () {
var text = '';
for (var i = 0; i < this.maxDot_; i++) {
text += (i == this.current_) ? '.' : ' ';
}
if (this.current_ >= this.maxDot_)
text += '';
chrome.browserAction.setBadgeBackgroundColor({ color: [0, 56, 206, 255] });
chrome.browserAction.setBadgeText({ text: text });
this.current_++;
if (this.current_ == this.maxCount_)
this.current_ = 0;
}
LoadingAnimation.prototype.start = function () {
if (this.timerId_)
return;
var self = this;
this.timerId_ = window.setInterval(function () {
self.paintFrame();
}, 100);
}
LoadingAnimation.prototype.stop = function () {
if (!this.timerId_)
return;
window.clearInterval(this.timerId_);
this.timerId_ = 0;
}
function updateIcon() {
if (!localStorage.hasOwnProperty('unreadCount')) {
chrome.browserAction.setIcon({
path: {
'19': 'media/inbox_not_logged_in.png',
'38': 'media/inbox_not_logged_in_retina.png'
}
});
chrome.browserAction.setBadgeBackgroundColor({ color: [190, 190, 190, 230] });
chrome.browserAction.setBadgeText({ text: '?' });
} else {
var quiet = isQuietTime();
var unreadCount = localStorage.unreadCount != '0' ? localStorage.unreadCount : '';
chrome.browserAction.setIcon({
path: {
'19': quiet && options.useSnoozeColor ? 'media/inbox_quiet.png' : 'media/inbox_logged_in.png',
'38': quiet && options.useSnoozeColor ? 'media/inbox_quiet_retina.png' : 'media/inbox_logged_in_retina.png'
}
});
chrome.browserAction.setBadgeBackgroundColor({ color: [0, 56, 206, 255] });
chrome.browserAction.setBadgeText({
text: (quiet ? '' : unreadCount)
});
}
}
function scheduleRequest() {
console.log('scheduleRequest');
var pollInterval = options.pollInterval || pollIntervalDefault;
var multiplier = Math.pow(2, localStorage.requestFailureCount || 0);
// Use different logic for smaller poll intervals
if (pollInterval < 1) {
pollInterval *= multiplier;
} else {
var randomness = Math.random() * 2;
var fuzzyMultiplier = Math.max(randomness * multiplier, 1);
pollInterval = Math.round(fuzzyMultiplier * pollInterval);
}
var delay = Math.min(pollInterval, pollIntervalMax);
console.log('Scheduling for: ' + delay + ' seconds');
if (oldChromeVersion) {
if (requestTimerId) {
window.clearTimeout(requestTimerId);
}
requestTimerId = window.setTimeout(onAlarm, delay * 1000);
} else {
console.log('Creating alarm');
// Use a repeating alarm so that it fires again if there was a problem
// setting the next alarm.
chrome.alarms.create('refresh', {periodInMinutes: delay / 60.0});
}
}
// ajax stuff
function startRequest(params) {
// Schedule request immediately. We want to be sure to reschedule, even in the
// case where the extension process shuts down while this request is
// outstanding.
if (params && params.scheduleRequest) scheduleRequest();
function stopLoadingAnimation() {
if (params && params.showLoadingAnimation) loadingAnimation.stop();
}
if (params && params.showLoadingAnimation)
loadingAnimation.start();
getInboxCount(
function (count) {
stopLoadingAnimation();
updateUnreadCount(count);
openedLoginPage = false;
},
function () {
stopLoadingAnimation();
delete localStorage.unreadCount;
updateIcon();
}
);
}
function getInboxCount(onSuccess, onError) {
var xhr = new XMLHttpRequest();
var abortTimerId = window.setTimeout(function () {
if (xhr) {
xhr.abort(); // synchronously calls onreadystatechange
}
cleanup();
}, requestTimeout);
function cleanup() {
window.clearTimeout(abortTimerId);
xhr.onreadystatechange = null;
xhr = null;
}
function handleSuccess(count) {
cleanup();
localStorage.requestFailureCount = 0;
if (onSuccess) {
onSuccess(count);
}
}
var invokedErrorCallback = false;
function handleError() {
console.error('handleError() called');
cleanup();
++localStorage.requestFailureCount;
if (onError && !invokedErrorCallback) {
onError();
}
invokedErrorCallback = true;
}
try {
xhr.onreadystatechange = function () {
if (this.readyState != 4) {
return;
}
// Check for edge case where mail.google.com has not yet been visited and try again
if (this.status === 401) {
console.log('Got error 401 while getting inbox count');
if (openedLoginPage) {
console.log('Login page already opened - waiting for user to authenticate');
} else {
// Visit regular gmail to authorize feed access
openedLoginPage = true;
console.log('Opening', getGmailUrl());
chrome.tabs.create({ url: getGmailUrl() });
}
} else if (this.responseXML) {
var xmlDoc = this.responseXML;
var fullCountSet = xmlDoc.evaluate('/gmail:feed/gmail:fullcount', xmlDoc, gmailNSResolver, XPathResult.ANY_TYPE, null);
var fullCountNode = fullCountSet.iterateNext();
if (fullCountNode) {
handleSuccess(fullCountNode.textContent);
return;
} else {
console.error(chrome.i18n.getMessage('gmailcheck_node_error'));
}
}
handleError();
};
xhr.onerror = function (error) {
handleError();
};
xhr.open('GET', getFeedUrl(), true);
xhr.send(null);
} catch(e) {
console.error(chrome.i18n.getMessage('gmailcheck_exception', e));
handleError();
}
}
function gmailNSResolver(prefix) {
if(prefix == 'gmail') {
return 'http://purl.org/atom/ns#';
}
}
function updateUnreadCount(count) {
var quietTime = isQuietTime();
var changed = localStorage.unreadCount != count || String(localStorage.quietTime) != String(quietTime);
if (changed) {
notify(count);
}
localStorage.unreadCount = count;
localStorage.quietTime = quietTime;
updateIcon();
if (changed) {
animateFlip();
}
}
function ease(x) {
return (1-Math.sin(Math.PI/2+x*Math.PI))/2;
}
function animateFlip() {
rotation += 1/animationFrames;
drawIconAtRotation();
if (rotation <= 1) {
setTimeout(animateFlip, animationSpeed);
} else {
rotation = 0;
updateIcon();
}
}
function drawIconAtRotation() {
canvasContext.save();
canvasContext.clearRect(0, 0, canvas.width, canvas.height);
canvasContext.translate(
Math.ceil(canvas.width/2),
Math.ceil(canvas.height/2));
canvasContext.rotate(2*Math.PI*ease(rotation));
canvasContext.drawImage(loggedInImage,
-Math.ceil(canvas.width/2),
-Math.ceil(canvas.height/2));
canvasContext.restore();
chrome.browserAction.setIcon({
imageData: canvasContext.getImageData(0, 0, canvas.width,canvas.height)
});
}
function goToNewInbox() {
// Navigate the empty tab if preferred, or create a new Inbox tab
if (options.openInEmptyTab) {
console.log('Navigating empty tab to Inbox...');
// Check if current tab is the empty tab
chrome.tabs.query({ currentWindow: true, active: true }, function (tabs) {
var tab = tabs[0]
if (tab && tab.url === 'chrome://newtab/') {
chrome.tabs.update({ url: getInboxUrl() });
} else {
chrome.tabs.create({ url: getInboxUrl() });
}
});
} else {
console.log('Creating new Inbox tab...');
chrome.tabs.create({ url: getInboxUrl() });
}
}
function goToExistingInbox() {
console.log('Going to inbox...');
chrome.tabs.query({ url: '*://inbox.google.com/*', currentWindow: true }, function (tabs) {
var tab = tabs[0];
if (tab) {
console.log('Found Inbox tab: ' + tab.url + '. Focusing and refreshing count...');
chrome.tabs.update(tab.id, { selected: true, highlighted: true });
startRequest({ scheduleRequest: false, showLoadingAnimation: false });
} else {
console.log('Could not find Inbox tab. Creating one...');
goToNewInbox();
}
});
}
function goToInbox() {
chrome.tabs.query({ url: '*://inbox.google.com/*', active: true, currentWindow: true }, function (tabs) {
var tab = tabs[0];
// Do nothing if current tab is Inbox
var inboxUrl = getInboxUrl();
if (tab && tab.url && tab.url.substr(0, inboxUrl.length) === inboxUrl) {
return;
}
// Go to existing Inbox tab or create a new one
if (options.focusExistingInboxTab) {
goToExistingInbox();
} else {
goToNewInbox();
}
});
// Clear notifications
if (chrome.notifications && chrome.notifications.clear) {
chrome.notifications.clear('inboxUpdate');
}
}
function onInit() {
console.log('onInit');
localStorage.requestFailureCount = 0; // used for exponential backoff
startRequest({ scheduleRequest: true, showLoadingAnimation: true });
if (!oldChromeVersion) {
// TODO(mpcomplete): We should be able to remove this now, but leaving it
// for a little while just to be sure the refresh alarm is working nicely.
chrome.alarms.create('watchdog', { periodInMinutes: 5 });
}
}
function onAlarm(alarm) {
console.log('Got alarm', alarm);
// |alarm| can be undefined because onAlarm also gets called from
// window.setTimeout on old chrome versions.
if (alarm && alarm.name == 'watchdog') {
onWatchdog();
} else {
startRequest({ scheduleRequest: true, showLoadingAnimation: false });
}
}
function onWatchdog() {
chrome.alarms.get('refresh', function (alarm) {
if (alarm) {
console.log('Refresh alarm exists. Yay.');
} else {
console.log('Refresh alarm doesn\'t exist!? ' +
'Refreshing now and rescheduling.');
startRequest({ scheduleRequest: true, showLoadingAnimation: false });
}
});
}
function onNavigate(details) {
if (details.url && isInboxUrl(details.url)) {
console.log('Recognized Inbox navigation to: ' + details.url + '. Refreshing count...');
startRequest({ scheduleRequest: false, showLoadingAnimation: false });
}
}
function onShareToInbox(info, tab) {
chrome.tabs.create({
url: getInboxUrl() + '?&subject=' + encodeURIComponent(tab.title) + '&body=' + encodeURIComponent(tab.url)
});
}
function resetDistractionFreeMode() {
// Turn off distraction-free mode, reflect this in the context menu, and clear any outstanding timers
distractionFreeMode = false;
chrome.contextMenus.update('distractionFreeInbox', { title: 'Go distraction-free for ' + options.distractionFreeMinutes + ' min' });
if (distractionFreeModeTimerId) {
window.clearTimeout(distractionFreeModeTimerId);
distractionFreeModeTimerId = null;
}
}
function onDistractionFreeMode(info, tab) {
// Update distraction-free mode and reflect this in the context menu
if (!distractionFreeMode) {
console.log('Ending distraction-free mode in ' + options.distractionFreeMinutes + ' minutes');
resetDistractionFreeMode();
distractionFreeMode = true;
chrome.contextMenus.update('distractionFreeInbox', { title: 'Leave distraction-free mode' });
distractionFreeModeTimerId = window.setTimeout(resetDistractionFreeMode, options.distractionFreeMinutes * 60 * 1000);
} else {
console.log('Distraction-free mode ended');
resetDistractionFreeMode()
}
refresh();
}
function onOptionsLoaded() {
// Update distraction-free mode minutes
if (!distractionFreeMode) {
chrome.contextMenus.update('distractionFreeInbox', { title: 'Go distraction-free for ' + options.distractionFreeMinutes + ' min' });
}
// Update context menu
var contexts = ['browser_action']
if (options.showPageMenu) {
contexts.push('page');
}
chrome.contextMenus.update('shareToInbox', { contexts: contexts });
refresh();
}
function loadHoursList(s) {
if (!s) {
return [];
}
var hourStrings = s.split(',');
var hours = [];
for (var i = 0; i < hourStrings.length; i++) {
var hour = parseInt(hourStrings[i], 10);
if (!isNaN(hour) && hour >= 0 && hour < 24) {
hours.push(hour);
}
}
return hours;
}
function loadOptions(callback) {
// Do nothing if storage is not permitted
if (!chrome || !chrome.storage || !chrome.storage.sync) {
callback(false);
return;
}
// Load options from storage (with fallbacks)
chrome.storage.sync.get({
defaultUser: 0,
pollInterval: 0,
quietHours: '',
distractionFreeMinutes: 30,
useSnoozeColor: true,
useDesktopNotifications: true,
showPageMenu: true,
focusExistingInboxTab: false,
openInEmptyTab: false
}, function (items) {
options.defaultUser = items.defaultUser;
options.pollInterval = parseInt(items.pollInterval, 10) || 0;
options.quietHours = loadHoursList(items.quietHours);
options.distractionFreeMinutes = parseInt(items.distractionFreeMinutes, 10) || 30;
options.useSnoozeColor = !!items.useSnoozeColor;
options.focusExistingInboxTab = !!items.focusExistingInboxTab;
options.showPageMenu = !!items.showPageMenu;
options.useDesktopNotifications = !!items.useDesktopNotifications;
options.openInEmptyTab = !!items.openInEmptyTab;
callback(true);
});
}
function refresh() {
startRequest({ scheduleRequest: true, showLoadingAnimation: false });
}
function notify(count) {
var newMessagesCount = count - localStorage.unreadCount;
if (options.useDesktopNotifications && !isQuietTime() && newMessagesCount > 0) {
chrome.notifications.create('inboxUpdate', {
type: 'basic',
iconUrl: 'media/icon_256.png',
title: 'Inbox by Gmail Checker',
isClickable: true,
contextMessage: 'Click to open Inbox',
message: 'You have ' + (newMessagesCount === 1 ? 'a': newMessagesCount) +' new message' + (newMessagesCount === 1 ? '' : 's') + '.'
});
}
}
function main() {
if (oldChromeVersion) {
updateIcon();
onInit();
} else {
chrome.runtime.onInstalled.addListener(onInit);
chrome.alarms.onAlarm.addListener(onAlarm);
}
// Update mail count when Inbox is visited without clicking the app icon
if (chrome.webNavigation && chrome.webNavigation.onDOMContentLoaded && chrome.webNavigation.onReferenceFragmentUpdated) {
// NOTE: Keep this "webNavigation" code in here in case the permission is ever added back in
// e.g. "webNavigation" no longer shows a "Read your browsing history" permission warning, "tabs" is required
// again by this project, or certain "webNavigation" actions become workable without the permission
// TODO(aa): Cannot use urlPrefix because all the url fields lack the protocol part (see crbug.com/140238)
var filters = { url: [{ urlContains: getInboxBaseUrl().replace(/^https?\:\/\//, '') }] };
chrome.webNavigation.onDOMContentLoaded.addListener(onNavigate, filters);
chrome.webNavigation.onReferenceFragmentUpdated.addListener(onNavigate, filters);
} else {
chrome.tabs.onUpdated.addListener(function (_, details) {
onNavigate(details);
});
}
// Handle main click action
chrome.browserAction.onClicked.addListener(goToInbox);
// Handle notification clicks, if notifications are supported
if (chrome.notifications && chrome.notifications.onClicked) {
chrome.notifications.onClicked.addListener(goToInbox);
}
// Create context menu items
if (chrome.contextMenus && chrome.contextMenus.create && chrome.contextMenus.onClicked) {
chrome.contextMenus.create({ id: 'distractionFreeInbox', title: 'Go distraction-free', contexts: ['browser_action'] });
chrome.contextMenus.create({ id: 'shareToInbox', title: 'Share page via email', contexts: ['browser_action', 'page'] });
chrome.contextMenus.onClicked.addListener(function (info, tab) {
if (info.menuItemId === 'shareToInbox') {
onShareToInbox(info, tab);
} else if (info.menuItemId === 'distractionFreeInbox') {
onDistractionFreeMode(info, tab);
}
});
}
if (chrome.runtime && chrome.runtime.onStartup) {
chrome.runtime.onStartup.addListener(function () {
console.log('Starting browser... updating icon.');
startRequest({ scheduleRequest: false, showLoadingAnimation: false });
updateIcon();
});
} else {
// This hack is needed because Chrome 22 does not persist browserAction icon
// state, and also doesn't expose onStartup. So the icon always starts out in
// wrong state. We don't actually use onStartup except as a clue that we're
// in a version of Chrome that has this problem.
chrome.windows.onCreated.addListener(function () {
console.log('Window created... updating icon.');
startRequest({ scheduleRequest: false, showLoadingAnimation: false });
updateIcon();
});
}
// Load options and re-load them when they're changed
loadOptions(function () {
onOptionsLoaded();
chrome.storage.onChanged.addListener(function (changes, namespace) {
loadOptions(function () {
onOptionsLoaded();
});
});
});
}
main();
| 31.453249 | 137 | 0.67456 |
994a71682eb69f0a8b45a443ae0dbf4414da630e | 231 | js | JavaScript | src/helpers/retrieve-namespaced-property.js | Twikito/easy-toggle-state | df603ab49660a81a9443e6e0bd43e9607ede3020 | [
"MIT"
] | 272 | 2018-03-09T00:02:12.000Z | 2022-03-18T13:15:37.000Z | src/helpers/retrieve-namespaced-property.js | GalinhaLX/easy-toggle-state | df603ab49660a81a9443e6e0bd43e9607ede3020 | [
"MIT"
] | 94 | 2018-04-25T14:17:39.000Z | 2022-01-31T13:47:12.000Z | src/helpers/retrieve-namespaced-property.js | GalinhaLX/easy-toggle-state | df603ab49660a81a9443e6e0bd43e9607ede3020 | [
"MIT"
] | 43 | 2018-03-12T19:10:49.000Z | 2022-03-22T05:31:15.000Z | /**
* Add a namespace for element properties.
* @param {string} property - The property aadded on any element
* @returns {string} - The property with the namespace
*/
export default (property) => `easyToggleState_${property}`;
| 33 | 64 | 0.718615 |
994b640f0dfe7137011ef7b03979a3bf8609773b | 3,488 | js | JavaScript | docs/doc/sp_finality_grandpa/sidebar-items.js | AtlDragoon/Fennel-Protocol | f5f1a87d1564543484f27b4819a7a196fe91994f | [
"Unlicense"
] | null | null | null | docs/doc/sp_finality_grandpa/sidebar-items.js | AtlDragoon/Fennel-Protocol | f5f1a87d1564543484f27b4819a7a196fe91994f | [
"Unlicense"
] | null | null | null | docs/doc/sp_finality_grandpa/sidebar-items.js | AtlDragoon/Fennel-Protocol | f5f1a87d1564543484f27b4819a7a196fe91994f | [
"Unlicense"
] | null | null | null | initSidebarItems({"constant":[["AUTHORITIES_CALL","WASM function call to get current GRANDPA authorities."],["GRANDPA_AUTHORITIES_KEY","The storage key for the current set of weighted Grandpa authorities. The value stored is an encoded VersionedAuthorityList."],["GRANDPA_ENGINE_ID","The `ConsensusEngineId` of GRANDPA."],["KEY_TYPE","Key type for GRANDPA module."],["PENDING_CHANGE_CALL","WASM function call to check for pending changes."]],"enum":[["ConsensusLog","An consensus log item for GRANDPA."],["Equivocation","Wrapper object for GRANDPA equivocation proofs, useful for unifying prevote and precommit equivocations under a common type."]],"fn":[["check_equivocation_proof","Verifies the equivocation proof by making sure that both votes target different blocks and that its signatures are valid."],["check_message_signature","Check a message signature by encoding the message as a localized payload and verifying the provided signature using the expected authority id."],["check_message_signature_with_buffer","Check a message signature by encoding the message as a localized payload and verifying the provided signature using the expected authority id. The encoding necessary to verify the signature will be done using the given buffer, the original content of the buffer will be cleared."],["localized_payload","Encode round message localized to a given round and set id."],["localized_payload_with_buffer","Encode round message localized to a given round and set id using the given buffer. The given buffer will be cleared and the resulting encoded payload will always be written to the start of the buffer."],["sign_message","Localizes the message to the given set and round and signs the payload."]],"struct":[["EquivocationProof","Proof of voter misbehavior on a given set id. Misbehavior/equivocation in GRANDPA happens when a voter votes on the same round (either at prevote or precommit stage) for different blocks. Proving is achieved by collecting the signed messages of conflicting votes."],["OpaqueKeyOwnershipProof","An opaque type used to represent the key ownership proof at the runtime API boundary. The inner value is an encoded representation of the actual key ownership proof which will be parameterized when defining the runtime. At the runtime API boundary this type is unknown and as such we keep this opaque representation, implementors of the runtime API will have to make sure that all usages of `OpaqueKeyOwnershipProof` refer to the same type."],["ScheduledChange","A scheduled change of authority set."],["VersionedAuthorityList","An AuthorityList that is encoded with a version specifier. The encoding version is updated any time the AuthorityList type changes. This ensures that encodings of different versions of an AuthorityList are differentiable. Attempting to decode an authority list with an unknown version will fail."]],"trait":[["GrandpaApi","APIs for integrating the GRANDPA finality gadget into runtimes. This should be implemented on the runtime side."]],"type":[["AuthorityId","Identity of a Grandpa authority."],["AuthorityIndex","The index of an authority."],["AuthorityList","A list of Grandpa authorities with associated weights."],["AuthorityPair","The grandpa crypto scheme defined via the keypair type."],["AuthoritySignature","Signature for a Grandpa authority."],["AuthorityWeight","The weight of an authority."],["RoundNumber","The round indicator."],["SetId","The monotonic identifier of a GRANDPA set of authorities."]]}); | 3,488 | 3,488 | 0.797878 |
994c239dee5556a57f5b384a77fa9576016c42db | 256 | js | JavaScript | LDAPLibraryDocumentation/class_l_d_a_p___library___unit_test_1_1_logger_unit_tests_1_1_fake_logger_unit_test.js | JosephTsui/LDAP-Library | 096149ba862ba598dc1a86b83c9ba1d98f57f144 | [
"MIT"
] | 2 | 2018-05-05T16:39:42.000Z | 2018-05-05T16:39:45.000Z | LDAPLibraryDocumentation/class_l_d_a_p___library___unit_test_1_1_logger_unit_tests_1_1_fake_logger_unit_test.js | yesnomore/LDAP-Library | e2da92206af2a62beda8ff93ef305f1d8a6f6630 | [
"MIT"
] | null | null | null | LDAPLibraryDocumentation/class_l_d_a_p___library___unit_test_1_1_logger_unit_tests_1_1_fake_logger_unit_test.js | yesnomore/LDAP-Library | e2da92206af2a62beda8ff93ef305f1d8a6f6630 | [
"MIT"
] | null | null | null | var class_l_d_a_p___library___unit_test_1_1_logger_unit_tests_1_1_fake_logger_unit_test =
[
[ "TestFakeLoggerWrite", "class_l_d_a_p___library___unit_test_1_1_logger_unit_tests_1_1_fake_logger_unit_test.html#aa6597827a235413100b590acd64d506f", null ]
]; | 64 | 161 | 0.894531 |
994c4b7a5f9e150979af84f0a28c1d683c2d5d9a | 800 | js | JavaScript | tests/benchmarks/lodash4/tests-rewritten-5/test301.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/test301.js | kaist-plrg/safe-ds | c54a9481b297a75af4f8b2ff42464025a95ea792 | [
"BSD-2-Clause"
] | null | null | null | tests/benchmarks/lodash4/tests-rewritten-5/test301.js | kaist-plrg/safe-ds | c54a9481b297a75af4f8b2ff42464025a95ea792 | [
"BSD-2-Clause"
] | null | null | null | QUnit.module('lodash(...) methods that return the wrapped modified array');
(function () {
var funcs = [
'push',
__str_top__,
__str_top__,
__str_top__
];
lodashStable.each(funcs, function (methodName) {
QUnit.test(__str_top__ + methodName + '` should return a new wrapper', function (assert) {
assert.expect(2);
if (!isNpm) {
var array = [
1,
__num_top__,
3
], wrapped = _(array), actual = wrapped[methodName]();
assert.ok(actual instanceof _);
assert.notStrictEqual(actual, wrapped);
} else {
skipAssert(assert, 2);
}
});
});
}()); | 32 | 98 | 0.465 |
994c773c9a026606d0c88660d79b5ac6b9437b1c | 219 | js | JavaScript | src/objects/LineLoop.js | jockyuiz/three.js | 1cef56c6143d2d5ab34157c60f4610a5e82d8890 | [
"MIT"
] | null | null | null | src/objects/LineLoop.js | jockyuiz/three.js | 1cef56c6143d2d5ab34157c60f4610a5e82d8890 | [
"MIT"
] | null | null | null | src/objects/LineLoop.js | jockyuiz/three.js | 1cef56c6143d2d5ab34157c60f4610a5e82d8890 | [
"MIT"
] | null | null | null | import { Line } from './Line.js';
class LineLoop extends Line {
constructor( geometry, material ) {
super( geometry, material );
this.type = 'LineLoop';
this.isLineLoop = true;
}
}
export { LineLoop };
| 11.526316 | 36 | 0.639269 |
994cb417c7322d3654b273c556664c077cea3bca | 2,044 | js | JavaScript | src/common/assets/css/style.js | matilda1740/unifaires | c945570a03089524f170b7e4d3ffe13b20ce78d7 | [
"MIT"
] | null | null | null | src/common/assets/css/style.js | matilda1740/unifaires | c945570a03089524f170b7e4d3ffe13b20ce78d7 | [
"MIT"
] | null | null | null | src/common/assets/css/style.js | matilda1740/unifaires | c945570a03089524f170b7e4d3ffe13b20ce78d7 | [
"MIT"
] | null | null | null | import { createGlobalStyle } from 'styled-components';
const ResetCSS = createGlobalStyle`
::selection {
background: #333333;
color: #ffffff;
}
html {
box-sizing: border-box;
-ms-overflow-style: scrollbar;
}
*,
*::before,
*::after {
box-sizing: inherit;
}
* {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
*:focus {
outline: none;
}
html,
html a,
h1,
h2,
h3,
h4,
h5,
h6,
a,
p,
li,
dl,
th,
dt,
input,
textarea,
span,
div {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
}
body {
margin: 0;
padding: 0;
overflow-x: hidden;
-webkit-tap-highlight-color: transparent;
}
ul {
margin: 0;
padding: 0;
}
li {
list-style-type: none;
}
a {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
.reuseModalHolder {
padding: 0 !important;
&.demo_switcher_modal {
border: 0 !important;
background-color: rgba(16, 30, 77, 0.9) !important;
.innerRndComponent {
border-radius: 8px !important;
}
}
}
button.modalCloseBtn {
position: fixed !important;
z-index: 999991 !important;
background-color: transparent !important;
top: 10px !important;
right: 10px !important;
min-width: 34px !important;
min-height: 34px !important;
padding: 0 !important;
span.btn-icon {
font-size: 22px !important;
transform: rotate(45deg) !important;
}
&.alt {
border-radius: 50% !important;
z-index: 999999 !important;
padding: 0 !important;
transition: all 0.3s ease !important;
top: 25px !important;
right: 30px !important;
min-width: 40px !important;
min-height: 40px !important;
span.btn-icon {
font-size: 20px !important;
}
&:hover {
opacity: 0.88 !important;
}
}
}
`;
export default ResetCSS;
| 16.892562 | 57 | 0.580235 |
994d335bf934a4bf727765315d0bc45e5bde9055 | 4,736 | js | JavaScript | salesforce-lightning-design-system-2.12.2/__internal/chunked/showcase/ui/components/radio-button-group/base/example.jsx.js | ADMIRAL-SF/bpnousclaim-contentblock | f11ca89996e968c250a32f3900363ac02e67affe | [
"BSD-3-Clause"
] | null | null | null | salesforce-lightning-design-system-2.12.2/__internal/chunked/showcase/ui/components/radio-button-group/base/example.jsx.js | ADMIRAL-SF/bpnousclaim-contentblock | f11ca89996e968c250a32f3900363ac02e67affe | [
"BSD-3-Clause"
] | null | null | null | salesforce-lightning-design-system-2.12.2/__internal/chunked/showcase/ui/components/radio-button-group/base/example.jsx.js | ADMIRAL-SF/bpnousclaim-contentblock | f11ca89996e968c250a32f3900363ac02e67affe | [
"BSD-3-Clause"
] | null | null | null | var SLDS="object"==typeof SLDS?SLDS:{};SLDS["__internal/chunked/showcase/ui/components/radio-button-group/base/example.jsx.js"]=function(e){function t(t){for(var n,l,i=t[0],u=t[1],s=t[2],d=0,f=[];d<i.length;d++)l=i[d],Object.prototype.hasOwnProperty.call(a,l)&&a[l]&&f.push(a[l][0]),a[l]=0;for(n in u)Object.prototype.hasOwnProperty.call(u,n)&&(e[n]=u[n]);for(c&&c(t);f.length;)f.shift()();return o.push.apply(o,s||[]),r()}function r(){for(var e,t=0;t<o.length;t++){for(var r=o[t],n=!0,i=1;i<r.length;i++){var u=r[i];0!==a[u]&&(n=!1)}n&&(o.splice(t--,1),e=l(l.s=r[0]))}return e}var n={},a={132:0,6:0,13:0,14:0,22:0,24:0,26:0,36:0,37:0,56:0,72:0,73:0,79:0,80:0,93:0,94:0,96:0,97:0,98:0,103:0,104:0,112:0,117:0,118:0,122:0,124:0,127:0,131:0,133:0,135:0,136:0,137:0,140:0,142:0,145:0,146:0,147:0,150:0,154:0,157:0},o=[];function l(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,l),r.l=!0,r.exports}l.m=e,l.c=n,l.d=function(e,t,r){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(l.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)l.d(r,n,function(t){return e[t]}.bind(null,n));return r},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="/assets/scripts/bundle/";var i=this.webpackJsonpSLDS___internal_chunked_showcase=this.webpackJsonpSLDS___internal_chunked_showcase||[],u=i.push.bind(i);i.push=t,i=i.slice();for(var s=0;s<i.length;s++)t(i[s]);var c=u;return o.push([213,0]),r()}({0:function(e,t){e.exports=React},16:function(e,t){e.exports=ReactDOM},213:function(e,t,r){"use strict";r.r(t),r.d(t,"RadioButtonGroup",(function(){return d})),r.d(t,"RadioButton",(function(){return f})),r.d(t,"states",(function(){return b}));var n=r(0),a=r.n(n),o=r(2),l=r.n(o),i=r(81),u=r.n(i),s=r(5),c=r(28),d=function(e){return a.a.createElement("div",{className:l()("slds-radio_button-group",e.className)},e.children)},f=function(e){var t=u()("example-unique-id-");return a.a.createElement("span",{className:l()("slds-button slds-radio_button",e.className)},a.a.createElement("input",{name:e.name,type:"radio",id:t,value:e.id,disabled:e.disabled,"aria-describedby":e.errorId,defaultChecked:e.checked}),a.a.createElement("label",{className:"slds-radio_button__label",htmlFor:t},a.a.createElement("span",{className:"slds-radio_faux"},e.children)))},m=function(e){var t=e.legend,r=e.modifier,n=e.disabled,o=e.required,l=e.hasError,i=u()("example-unique-name-"),m=u()("example-unique-id");return a.a.createElement(c.Fieldset,{className:l&&"slds-has-error"},a.a.createElement(c.Legend,null,o&&a.a.createElement("abbr",{className:"slds-required",title:"required"},"*"),!t&&"Radio Group Label"),a.a.createElement(s.c,null,a.a.createElement(d,{className:r},a.a.createElement(f,{id:"monday",name:i,disabled:n},"Mon"),a.a.createElement(f,{id:"tuesday",name:i,disabled:n},"Tue"),a.a.createElement(f,{id:"wednesday",name:i,disabled:n},"Wed"),a.a.createElement(f,{id:"thursday",name:i,disabled:n},"Thu"),a.a.createElement(f,{id:"friday",name:i,disabled:n},"Fri")),l&&a.a.createElement("div",{id:m,className:"slds-form-element__help"},"This field is required")))};t.default=a.a.createElement(m,null);var b=[{id:"disabled",label:"Disabled",element:a.a.createElement(m,{disabled:!0})},{id:"required",label:"Required",element:a.a.createElement(m,{required:!0})},{id:"error",label:"Has error",element:a.a.createElement(m,{required:!0,hasError:!0})}]},81:function(e,t,r){(function(t){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var n="object"==(void 0===t?"undefined":r(t))&&t&&t.Object===Object&&t,a="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,o=n||a||Function("return this")(),l=Object.prototype,i=0,u=l.toString,s=o.Symbol,c=s?s.prototype:void 0,d=c?c.toString:void 0;function f(e){if("string"==typeof e)return e;if(function(e){return"symbol"==r(e)||function(e){return!!e&&"object"==r(e)}(e)&&"[object Symbol]"==u.call(e)}(e))return d?d.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}e.exports=function(e){var t,r=++i;return(null==(t=e)?"":f(t))+r}}).call(this,r(69))}}); | 4,736 | 4,736 | 0.6875 |
994d8c9721fffb79cb360e826ed5075fd47a84b1 | 1,511 | js | JavaScript | static/js/cube.js | hkpeterpeter/hkpeterpeter.github.io | 194f9a0b9b08ecf58ff675c40a8dfa9f91982b87 | [
"MIT"
] | 4 | 2018-09-03T04:11:53.000Z | 2022-01-10T00:35:00.000Z | static/js/cube.js | hkpeterpeter/hkpeterpeter.github.io | 194f9a0b9b08ecf58ff675c40a8dfa9f91982b87 | [
"MIT"
] | null | null | null | static/js/cube.js | hkpeterpeter/hkpeterpeter.github.io | 194f9a0b9b08ecf58ff675c40a8dfa9f91982b87 | [
"MIT"
] | null | null | null | var cube = document.querySelector('.cube');
var currentClass = "";
function changeSide(side) {
var showClass = 'show-' + side;
if ( currentClass ) {
cube.classList.remove( currentClass );
}
cube.classList.add( showClass );
currentClass = showClass;
}
document.getElementById('icon-fb').addEventListener('click', function() { changeSide("right"); ; });
document.getElementById('icon-ig').addEventListener('click', function() { changeSide("back"); });
document.getElementById('icon-linkedin').addEventListener('click', function() { changeSide("left"); });
document.getElementById('icon-whatsapp').addEventListener('click', function() { changeSide("top"); });
document.getElementById('icon-wechat').addEventListener('click', function() { changeSide("bottom"); });
document.getElementById('cube').addEventListener('click', function() { changeSide("front"); });
document.getElementById('icon-fb').addEventListener('mouseover', function() { changeSide("right"); ; });
document.getElementById('icon-ig').addEventListener('mouseover', function() { changeSide("back"); });
document.getElementById('icon-linkedin').addEventListener('mouseover', function() { changeSide("left"); });
document.getElementById('icon-whatsapp').addEventListener('mouseover', function() { changeSide("top"); });
document.getElementById('icon-wechat').addEventListener('mouseover', function() { changeSide("bottom"); });
document.getElementById('cube').addEventListener('mouseover', function() { changeSide("front"); }); | 60.44 | 107 | 0.721377 |
994ea9a36b5c53d7d621fb35ef0b416a8be64695 | 874 | js | JavaScript | sort/bubbleSort.js | sinkhaha/dataStructureAndAlgorithm | 8c5e781fd148c6c286cb9344ea9c63f856968406 | [
"MIT"
] | 16 | 2021-06-02T03:09:25.000Z | 2022-02-08T01:53:06.000Z | sort/bubbleSort.js | sinkhaha/dataStructureAndAlgorithm | 8c5e781fd148c6c286cb9344ea9c63f856968406 | [
"MIT"
] | null | null | null | sort/bubbleSort.js | sinkhaha/dataStructureAndAlgorithm | 8c5e781fd148c6c286cb9344ea9c63f856968406 | [
"MIT"
] | 5 | 2021-06-03T02:23:16.000Z | 2021-07-16T10:15:44.000Z | /**
* 冒泡排序
*
* 时间复杂度: 最好O(n)、平均O(n^2)、最差O(n^2)
* 空间复杂度: O(1)
*
* 稳定排序/原地排序
*
* @param {Array} arr
* @returns {Array}
*/
function bubbleSort(arr) {
const len = arr.length;
for (let i = 0; i < len; i++) {
// 引入后面序列是否有序标志
let isSorted = true;
for (let j = 0; j < len - i; j++) {
if (arr[j] > arr[j + 1]) {
// 交换
let temp = arr[j];
arr[j] = arr[j + 1];
arr[j + 1] = temp;
// js交换两个数也可以用以下简洁语句
// [arr[j], arr[j + 1]] = [arr[j + 1], arr[j]];
// 有数据交换,说明后面序列无序
isSorted = false;
}
}
// 后面序列已是有序,则不执行后面的循环
if (isSorted) {
break;
}
}
return arr;
}
const arr = [5, 3, 4, 2, 32, 15, 2, 45, 15, 57];
console.log(bubbleSort(arr));
| 20.325581 | 63 | 0.394737 |
994edca66640c3bf9d9403b047c625803cc82ed0 | 7,185 | js | JavaScript | src/wide-eastasian.js | hustcc/word-width | 533ffd2f13cd64c138461e68abe1112fa0654fa9 | [
"MIT"
] | 7 | 2017-06-05T01:01:10.000Z | 2022-01-03T10:26:59.000Z | src/wide-eastasian.js | hustcc/word-width | 533ffd2f13cd64c138461e68abe1112fa0654fa9 | [
"MIT"
] | null | null | null | src/wide-eastasian.js | hustcc/word-width | 533ffd2f13cd64c138461e68abe1112fa0654fa9 | [
"MIT"
] | 4 | 2016-10-14T06:23:39.000Z | 2020-07-10T06:51:58.000Z | // from https://github.com/jquast/wcwidth/blob/master/wcwidth/table_wide.py
// Generated: 2016-07-02T04:20:28.048222
// Source: EastAsianWidth-9.0.0.txt
// Date: 2016-05-27, 17:00:00 GMT [KW, LI]
module.exports = [
[0x1100, 0x115f], // Hangul Choseong Kiyeok ..Hangul Choseong Filler
[0x231a, 0x231b], // Watch ..Hourglass
[0x2329, 0x232a], // Left-pointing Angle Brac..Right-pointing Angle Bra
[0x23e9, 0x23ec], // Black Right-pointing Dou..Black Down-pointing Doub
[0x23f0, 0x23f0], // Alarm Clock ..Alarm Clock
[0x23f3, 0x23f3], // Hourglass With Flowing S..Hourglass With Flowing S
[0x25fd, 0x25fe], // White Medium Small Squar..Black Medium Small Squar
[0x2614, 0x2615], // Umbrella With Rain Drops..Hot Beverage
[0x2648, 0x2653], // Aries ..Pisces
[0x267f, 0x267f], // Wheelchair Symbol ..Wheelchair Symbol
[0x2693, 0x2693], // Anchor ..Anchor
[0x26a1, 0x26a1], // High Voltage Sign ..High Voltage Sign
[0x26aa, 0x26ab], // Medium White Circle ..Medium Black Circle
[0x26bd, 0x26be], // Soccer Ball ..Baseball
[0x26c4, 0x26c5], // Snowman Without Snow ..Sun Behind Cloud
[0x26ce, 0x26ce], // Ophiuchus ..Ophiuchus
[0x26d4, 0x26d4], // No Entry ..No Entry
[0x26ea, 0x26ea], // Church ..Church
[0x26f2, 0x26f3], // Fountain ..Flag In Hole
[0x26f5, 0x26f5], // Sailboat ..Sailboat
[0x26fa, 0x26fa], // Tent ..Tent
[0x26fd, 0x26fd], // Fuel Pump ..Fuel Pump
[0x2705, 0x2705], // White Heavy Check Mark ..White Heavy Check Mark
[0x270a, 0x270b], // Raised Fist ..Raised Hand
[0x2728, 0x2728], // Sparkles ..Sparkles
[0x274c, 0x274c], // Cross Mark ..Cross Mark
[0x274e, 0x274e], // Negative Squared Cross M..Negative Squared Cross M
[0x2753, 0x2755], // Black Question Mark Orna..White Exclamation Mark O
[0x2757, 0x2757], // Heavy Exclamation Mark S..Heavy Exclamation Mark S
[0x2795, 0x2797], // Heavy Plus Sign ..Heavy Division Sign
[0x27b0, 0x27b0], // Curly Loop ..Curly Loop
[0x27bf, 0x27bf], // Double Curly Loop ..Double Curly Loop
[0x2b1b, 0x2b1c], // Black Large Square ..White Large Square
[0x2b50, 0x2b50], // White Medium Star ..White Medium Star
[0x2b55, 0x2b55], // Heavy Large Circle ..Heavy Large Circle
[0x2e80, 0x2e99], // Cjk Radical Repeat ..Cjk Radical Rap
[0x2e9b, 0x2ef3], // Cjk Radical Choke ..Cjk Radical C-simplified
[0x2f00, 0x2fd5], // Kangxi Radical One ..Kangxi Radical Flute
[0x2ff0, 0x2ffb], // Ideographic Description ..Ideographic Description
[0x3000, 0x303e], // Ideographic Space ..Ideographic Variation In
[0x3041, 0x3096], // Hiragana Letter Small A ..Hiragana Letter Small Ke
[0x3099, 0x30ff], // Combining Katakana-hirag..Katakana Digraph Koto
[0x3105, 0x312d], // Bopomofo Letter B ..Bopomofo Letter Ih
[0x3131, 0x318e], // Hangul Letter Kiyeok ..Hangul Letter Araeae
[0x3190, 0x31ba], // Ideographic Annotation L..Bopomofo Letter Zy
[0x31c0, 0x31e3], // Cjk Stroke T ..Cjk Stroke Q
[0x31f0, 0x321e], // Katakana Letter Small Ku..Parenthesized Korean Cha
[0x3220, 0x3247], // Parenthesized Ideograph ..Circled Ideograph Koto
[0x3250, 0x32fe], // Partnership Sign ..Circled Katakana Wo
[0x3300, 0x4dbf], // Square Apaato ..
[0x4e00, 0xa48c], // Cjk Unified Ideograph-4e..Yi Syllable Yyr
[0xa490, 0xa4c6], // Yi Radical Qot ..Yi Radical Ke
[0xa960, 0xa97c], // Hangul Choseong Tikeut-m..Hangul Choseong Ssangyeo
[0xac00, 0xd7a3], // Hangul Syllable Ga ..Hangul Syllable Hih
[0xf900, 0xfaff], // Cjk Compatibility Ideogr..
[0xfe10, 0xfe19], // Presentation Form For Ve..Presentation Form For Ve
[0xfe30, 0xfe52], // Presentation Form For Ve..Small Full Stop
[0xfe54, 0xfe66], // Small Semicolon ..Small Equals Sign
[0xfe68, 0xfe6b], // Small Reverse Solidus ..Small Commercial At
[0xff01, 0xff60], // Fullwidth Exclamation Ma..Fullwidth Right White Pa
[0xffe0, 0xffe6], // Fullwidth Cent Sign ..Fullwidth Won Sign
[0x16fe0, 0x16fe0], // (nil) ..
[0x17000, 0x187ec], // (nil) ..
[0x18800, 0x18af2], // (nil) ..
[0x1b000, 0x1b001], // Katakana Letter Archaic ..Hiragana Letter Archaic
[0x1f004, 0x1f004], // Mahjong Tile Red Dragon ..Mahjong Tile Red Dragon
[0x1f0cf, 0x1f0cf], // Playing Card Black Joker..Playing Card Black Joker
[0x1f18e, 0x1f18e], // Negative Squared Ab ..Negative Squared Ab
[0x1f191, 0x1f19a], // Squared Cl ..Squared Vs
[0x1f200, 0x1f202], // Square Hiragana Hoka ..Squared Katakana Sa
[0x1f210, 0x1f23b], // Squared Cjk Unified Ideo..
[0x1f240, 0x1f248], // Tortoise Shell Bracketed..Tortoise Shell Bracketed
[0x1f250, 0x1f251], // Circled Ideograph Advant..Circled Ideograph Accept
[0x1f300, 0x1f320], // Cyclone ..Shooting Star
[0x1f32d, 0x1f335], // Hot Dog ..Cactus
[0x1f337, 0x1f37c], // Tulip ..Baby Bottle
[0x1f37e, 0x1f393], // Bottle With Popping Cork..Graduation Cap
[0x1f3a0, 0x1f3ca], // Carousel Horse ..Swimmer
[0x1f3cf, 0x1f3d3], // Cricket Bat And Ball ..Table Tennis Paddle And
[0x1f3e0, 0x1f3f0], // House Building ..European Castle
[0x1f3f4, 0x1f3f4], // Waving Black Flag ..Waving Black Flag
[0x1f3f8, 0x1f43e], // Badminton Racquet And Sh..Paw Prints
[0x1f440, 0x1f440], // Eyes ..Eyes
[0x1f442, 0x1f4fc], // Ear ..Videocassette
[0x1f4ff, 0x1f53d], // Prayer Beads ..Down-pointing Small Red
[0x1f54b, 0x1f54e], // Kaaba ..Menorah With Nine Branch
[0x1f550, 0x1f567], // Clock Face One Oclock ..Clock Face Twelve-thirty
[0x1f57a, 0x1f57a], // (nil) ..
[0x1f595, 0x1f596], // Reversed Hand With Middl..Raised Hand With Part Be
[0x1f5a4, 0x1f5a4], // (nil) ..
[0x1f5fb, 0x1f64f], // Mount Fuji ..Person With Folded Hands
[0x1f680, 0x1f6c5], // Rocket ..Left Luggage
[0x1f6cc, 0x1f6cc], // Sleeping Accommodation ..Sleeping Accommodation
[0x1f6d0, 0x1f6d2], // Place Of Worship ..
[0x1f6eb, 0x1f6ec], // Airplane Departure ..Airplane Arriving
[0x1f6f4, 0x1f6f6], // (nil) ..
[0x1f910, 0x1f91e], // Zipper-mouth Face ..
[0x1f920, 0x1f927], // (nil) ..
[0x1f930, 0x1f930], // (nil) ..
[0x1f933, 0x1f93e], // (nil) ..
[0x1f940, 0x1f94b], // (nil) ..
[0x1f950, 0x1f95e], // (nil) ..
[0x1f980, 0x1f991], // Crab ..
[0x1f9c0, 0x1f9c0], // Cheese Wedge ..Cheese Wedge
[0x20000, 0x2fffd], // Cjk Unified Ideograph-20..
[0x30000, 0x3fffd] // (nil) ..
];
| 63.584071 | 76 | 0.595546 |
994f6cfb0b1c69f0b48d8950bb1918333b73bb9b | 487 | js | JavaScript | js/components/Viewport.react.js | stacywebb/valcomalert-location-server | cf3a71e2095a931bdaae678de743249a577eabe3 | [
"MIT"
] | null | null | null | js/components/Viewport.react.js | stacywebb/valcomalert-location-server | cf3a71e2095a931bdaae678de743249a577eabe3 | [
"MIT"
] | null | null | null | js/components/Viewport.react.js | stacywebb/valcomalert-location-server | cf3a71e2095a931bdaae678de743249a577eabe3 | [
"MIT"
] | null | null | null | var React = require('react');
import View from "react-flexbox";
var Header = require('./Header.react');
var Map = require('./Map.react');
var Viewport = React.createClass({
className: "viewport",
render: function() {
return (
<View column height="100vh">
<View column auto>
<View height="70px"><Header height="70px" /></View>
</View>
<View><Map flux={this.props.flux} /></View>
</View>
);
}
});
module.exports = Viewport; | 20.291667 | 61 | 0.583162 |
994fcb8a1f40b8ef96884208dd868aedac3b41ff | 4,434 | js | JavaScript | assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ca.js | GugaLiz/guligugaliz.github.io | e1d464c1099b6031e1b10faf5252e5c8d4b57a99 | [
"MIT"
] | 119 | 2015-01-04T00:02:21.000Z | 2016-10-14T11:15:26.000Z | assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ca.js | GugaLiz/guligugaliz.github.io | e1d464c1099b6031e1b10faf5252e5c8d4b57a99 | [
"MIT"
] | 182 | 2017-03-01T18:11:02.000Z | 2022-03-13T19:31:02.000Z | assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ca.js | GugaLiz/guligugaliz.github.io | e1d464c1099b6031e1b10faf5252e5c8d4b57a99 | [
"MIT"
] | 93 | 2017-02-23T19:53:08.000Z | 2022-03-20T03:05:15.000Z | /*
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang("a11yhelp","ca",{title:"Instruccions d'Accessibilitat",contents:"Continguts de l'Ajuda. Per tancar aquest quadre de diàleg premi ESC.",legend:[{name:"General",items:[{name:"Editor de barra d'eines",legend:"Premi ${toolbarFocus} per desplaçar-se per la barra d'eines. Vagi en el següent i anterior grup de barra d'eines amb TAB i SHIFT-TAB. Vagi en el següent i anterior botó de la barra d'eines amb RIGHT ARROW i LEFT ARROW. Premi SPACE o ENTER per activar el botó de la barra d'eines."},
{name:"Editor de quadre de diàleg",legend:"Dins d'un quadre de diàleg, premi la tecla TAB per desplaçar-se al següent camp del quadre de diàleg, premi SHIFT + TAB per desplaçar-se a l'anterior camp, premi ENTER per acceptar el quadre de diàleg, premi ESC per cancel·lar el quadre de diàleg. Per els quadres de diàleg que tenen diverses pestanyes, premi ALT + F10 per anar a la llista de pestanyes. Després podrà desplaçar-se a la següent pestanya amb TAB o RIGHT ARROW. Anar a la pestanya anterior amb SHIFT + TAB o LEFT ARROW. Premi SPACE o ENTER per seleccionar la pestanya."},
{name:"Editor de menú contextual",legend:"Premi ${contextMenu} o APPLICATION KEY per obrir el menú contextual. Després desplacis a la següent opció del menú amb TAB o DOWN ARROW. Desplacis a l'anterior opció amb SHIFT+TAB o UP ARROW. Premi SPACE o ENTER per seleccionar l'opció del menú. Obri el submenú de l'actual opció utilitzant SPACE o ENTER o RIGHT ARROW. Pot tornar a l'opció del menú pare amb ESC o LEFT ARROW. Tanqui el menú contextual amb ESC."},{name:"Editor de caixa de llista",legend:"Dins d'un quadre de llista, desplacis al següent element de la llista amb TAB o DOWN ARROW. Desplacis a l'anterior element de la llista amb SHIFT + TAB o UP ARROW. Premi SPACE o ENTER per seleccionar l'opció de la llista. Premi ESC per tancar el quadre de llista."},
{name:"Editor de barra de ruta de l'element",legend:"Premi ${elementsPathFocus} per anar als elements de la barra de ruta. Desplacis al botó de l'element següent amb TAB o RIGHT ARROW. Desplacis a l'anterior botó amb SHIFT+TAB o LEFT ARROW. Premi SPACE o ENTER per seleccionar l'element a l'editor."}]},{name:"Ordres",items:[{name:"Desfer ordre",legend:"Premi ${undo}"},{name:"Refer ordre",legend:"Premi ${redo}"},{name:"Ordre negreta",legend:"Premi ${bold}"},{name:"Ordre cursiva",legend:"Premi ${italic}"},
{name:"Ordre subratllat",legend:"Premi ${underline}"},{name:"Ordre enllaç",legend:"Premi ${link}"},{name:"Ordre amagar barra d'eines",legend:"Premi ${toolbarCollapse}"},{name:"Ordre per accedir a l'anterior espai enfocat",legend:"Premi ${accessPreviousSpace} per accedir a l'enfocament d'espai més proper inabastable abans del símbol d'intercalació, per exemple: dos elements HR adjacents. Repetiu la combinació de tecles per arribar a enfocaments d'espais distants."},{name:"Ordre per accedir al següent espai enfocat",
legend:"Premi ${accessNextSpace} per accedir a l'enfocament d'espai més proper inabastable després del símbol d'intercalació, per exemple: dos elements HR adjacents. Repetiu la combinació de tecles per arribar a enfocaments d'espais distants."},{name:"Ajuda d'accessibilitat",legend:"Premi ${a11yHelp}"}]}],backspace:"Backspace",tab:"Tab",enter:"Enter",shift:"Shift",ctrl:"Ctrl",alt:"Alt",pause:"Pause",capslock:"Caps Lock",escape:"Escape",pageUp:"Page Up",pageDown:"Page Down",end:"End",home:"Home",leftArrow:"Left Arrow",
upArrow:"Up Arrow",rightArrow:"Right Arrow",downArrow:"Down Arrow",insert:"Insert","delete":"Delete",leftWindowKey:"Left Windows key",rightWindowKey:"Right Windows key",selectKey:"Select key",numpad0:"Numpad 0",numpad1:"Numpad 1",numpad2:"Numpad 2",numpad3:"Numpad 3",numpad4:"Numpad 4",numpad5:"Numpad 5",numpad6:"Numpad 6",numpad7:"Numpad 7",numpad8:"Numpad 8",numpad9:"Numpad 9",multiply:"Multiply",add:"Add",subtract:"Subtract",decimalPoint:"Decimal Point",divide:"Divide",f1:"F1",f2:"F2",f3:"F3",
f4:"F4",f5:"F5",f6:"F6",f7:"F7",f8:"F8",f9:"F9",f10:"F10",f11:"F11",f12:"F12",numLock:"Num Lock",scrollLock:"Scroll Lock",semiColon:"Semicolon",equalSign:"Equal Sign",comma:"Comma",dash:"Dash",period:"Period",forwardSlash:"Forward Slash",graveAccent:"Grave Accent",openBracket:"Open Bracket",backSlash:"Backslash",closeBracket:"Close Bracket",singleQuote:"Single Quote"}); | 369.5 | 764 | 0.759811 |
9951185bf5faa9d13e3526edf1f25beb505b804c | 131 | js | JavaScript | Tools/auto-test/jest-test/start/sum/sum.test.js | haiweilian/laboratory | e648452c2407b750d632a5afe8647de011b88e1b | [
"MIT"
] | 10 | 2020-06-07T08:20:58.000Z | 2022-03-01T04:36:23.000Z | Tools/auto-test/jest-test/start/sum/sum.test.js | haiweilian/laboratory | e648452c2407b750d632a5afe8647de011b88e1b | [
"MIT"
] | 14 | 2020-06-07T14:05:29.000Z | 2021-07-03T08:38:46.000Z | Tools/auto-test/jest-test/start/sum/sum.test.js | haiweilian/laboratory | e648452c2407b750d632a5afe8647de011b88e1b | [
"MIT"
] | 2 | 2021-02-26T12:51:29.000Z | 2022-03-01T04:37:11.000Z | const sum = require('./sum')
// test
test('should adds 1 + 2 to equal 3', () => {
// expect 匹配器
expect(sum(1, 2)).toBe(3)
});
| 16.375 | 44 | 0.541985 |
9951cf805cb85bd500629310fff676d72ff2f446 | 35 | js | JavaScript | src/ui/public/crypto/index.js | IBMResearch/kibana-bluemix | a07267965791f2582a978e8c7190a2af8d43e159 | [
"Apache-2.0"
] | 546 | 2015-09-14T17:51:46.000Z | 2021-11-02T00:48:01.000Z | src/ui/public/crypto/index.js | IBMResearch/kibana-bluemix | a07267965791f2582a978e8c7190a2af8d43e159 | [
"Apache-2.0"
] | 102 | 2015-09-28T14:14:32.000Z | 2020-07-21T21:23:20.000Z | src/ui/public/crypto/index.js | IBMResearch/kibana-bluemix | a07267965791f2582a978e8c7190a2af8d43e159 | [
"Apache-2.0"
] | 144 | 2015-09-13T16:41:41.000Z | 2020-06-26T20:32:33.000Z | export { Sha256 } from './sha256';
| 17.5 | 34 | 0.628571 |
9952a790ecaec2f14df3463db5374738b15fc275 | 255 | js | JavaScript | api/src/controllers/usuario.js | cordeiromoura01/praticasweb | 66cf438cc417e9ff96ece193dc981303cf189bf3 | [
"MIT"
] | null | null | null | api/src/controllers/usuario.js | cordeiromoura01/praticasweb | 66cf438cc417e9ff96ece193dc981303cf189bf3 | [
"MIT"
] | null | null | null | api/src/controllers/usuario.js | cordeiromoura01/praticasweb | 66cf438cc417e9ff96ece193dc981303cf189bf3 | [
"MIT"
] | null | null | null | module.exports = app => {
app.get('/usuario', (req, res) =>
res.send('Get novo Agendamento Fujioka')
)
app.post('/usuario', (req, res) => {
console.log(req.body);
res.send('Post novo Agendamento Fujioka')
})
}
| 19.615385 | 47 | 0.537255 |
9952b94996473eb647007692932a1b6c6154c139 | 274 | js | JavaScript | src/link-os/latest/xamarin/content/search/namespaces_0.js | developer-zebra/developer-zebra-site | 8b3ecb3fafc41d1bc9aa0e52ad07d66ae359902d | [
"Fair",
"Unlicense"
] | 2 | 2016-03-21T11:00:57.000Z | 2016-04-27T06:46:52.000Z | src/link-os/latest/xamarin/content/search/namespaces_0.js | developer-zebra/developer-zebra-site | 8b3ecb3fafc41d1bc9aa0e52ad07d66ae359902d | [
"Fair",
"Unlicense"
] | 7 | 2016-03-17T20:28:36.000Z | 2020-07-07T19:02:59.000Z | src/link-os/latest/xamarin/content/search/namespaces_0.js | developer-zebra/developer-zebra-site | 8b3ecb3fafc41d1bc9aa0e52ad07d66ae359902d | [
"Fair",
"Unlicense"
] | 8 | 2016-10-25T10:29:49.000Z | 2021-06-04T03:34:40.000Z | var searchData=
[
['abstractions',['Abstractions',['../namespace_link_o_s_1_1_plugin_1_1_abstractions.html',1,'LinkOS::Plugin']]],
['linkos',['LinkOS',['../namespace_link_o_s.html',1,'']]],
['plugin',['Plugin',['../namespace_link_o_s_1_1_plugin.html',1,'LinkOS']]]
];
| 39.142857 | 114 | 0.682482 |
99530a9cf8840b1304b60eb37ce967787431248a | 2,883 | js | JavaScript | src/components/auth/RegisterScreen.js | raulgomez83/DiarioDeViajes-React-Redux-Firebase | 8f8efee9793f2b59441449918c4244c445e63358 | [
"MIT"
] | null | null | null | src/components/auth/RegisterScreen.js | raulgomez83/DiarioDeViajes-React-Redux-Firebase | 8f8efee9793f2b59441449918c4244c445e63358 | [
"MIT"
] | null | null | null | src/components/auth/RegisterScreen.js | raulgomez83/DiarioDeViajes-React-Redux-Firebase | 8f8efee9793f2b59441449918c4244c445e63358 | [
"MIT"
] | null | null | null | import React from "react";
import { useDispatch, useSelector } from "react-redux";
import { Link } from "react-router-dom";
import validator from "validator";
import { startRegister } from "../../actions/auth";
import { removeError, setError } from "../../actions/ui";
import { useForm } from "../../hooks/useForm";
export const RegisterScreen = () => {
const dispatch = useDispatch();
const { msgError, loading } = useSelector((state) => state.ui);
const [formValues, handleInputChange] = useForm({
name: "Perico",
email: "eldelospalotes@gmail.com",
password: "123456",
confirnPassword: "123456",
});
const { name, email, password, confirmPassword } = formValues;
const handleRegister = (e) => {
e.preventDefault();
const isFormValid = () => {
if (name.trim().length === 0) {
dispatch(setError("Name is required"));
return false;
} else if (!validator.isEmail(email)) {
dispatch(setError("Email is not valid"));
return false;
} else if (password !== confirmPassword || password.length < 5) {
dispatch(
setError(
"Password should be at least 6 characters and match each other"
)
);
return false;
}
dispatch(removeError());
return true;
};
if (isFormValid()) {
dispatch(startRegister(email, password, name));
}
};
return (
<div>
<h3 className="auth__title mb-5 ">Register</h3>
<form
onSubmit={handleRegister}
className="animate__animated animate__fadeIn animate__faster"
>
{msgError && <div className="auth__alert-error">{msgError}</div>}
<input
className="auth__input"
type="text"
placeholder="Name"
name="name"
autoComplete="off"
value={name}
onChange={handleInputChange}
/>
<input
className="auth__input"
type="text"
placeholder="Email"
name="email"
autoComplete="off"
value={email}
onChange={handleInputChange}
/>
<input
className="auth__input"
type="password"
placeholder="Password"
name="password"
value={password}
onChange={handleInputChange}
/>
<input
className="auth__input"
type="password"
placeholder="Confirm password"
name="confirmPassword"
value={confirmPassword}
onChange={handleInputChange}
/>
<button
className="btn btn-primary btn-block mt-1 mb-5"
type="submit"
disabled={loading}
>
Register
</button>
<Link className="link " to="/auth/login">
Already registered? Login
</Link>
</form>
</div>
);
};
| 26.209091 | 75 | 0.558446 |
99534df6c567e1096f3c82fcc0582588554ba784 | 2,640 | js | JavaScript | gulpfile.js | wac0013/pw | 9cd7ff5e63243b533786c2de701b5c6593cd8c69 | [
"MIT"
] | null | null | null | gulpfile.js | wac0013/pw | 9cd7ff5e63243b533786c2de701b5c6593cd8c69 | [
"MIT"
] | 2 | 2018-05-15T03:13:32.000Z | 2018-07-06T04:15:04.000Z | gulpfile.js | wac0013/pw | 9cd7ff5e63243b533786c2de701b5c6593cd8c69 | [
"MIT"
] | null | null | null | const gulp = require('gulp-v4'),
path = require('path'),
nodemon = require('gulp-nodemon'),
gutil = require('gulp-util'),
del = require('del'),
config = require('./config'),
webpack = require('webpack'),
WebpackDevServer = require('webpack-dev-server')
//
gulp.task('copiar-public', () => {
return gulp.src(['./client/static/**/*.*'])
.pipe(gulp.dest('./dist/public/'))
})
//
gulp.task('copiar-conf', () => {
return gulp.src(['./server/src/config/*.*'])
.pipe(gulp.dest('./dist/server/config'))
})
//
gulp.task('limpar', () => {
return del.sync(['./dist/**']);
})
//
gulp.task('copiar', gulp.parallel('limpar', 'copiar-public', 'copiar-conf'))
//
gulp.task('app-dev', (cb) => {
const webpackConfig = require('./webpack.config');
const compiler = require('webpack')(webpackConfig);
webpackConfig.entry.unshift('webpack-dev-server/client?http://' + config().host + ':' + config().porta_cliente + '/', 'webpack/hot/dev-server');
new WebpackDevServer(compiler, {
publicPath: webpackConfig.output.publicPath,
contentBase: path.join(__dirname, 'dist/public'),
stats: {
colors: true
},
hot: true,
open: true,
historyApiFallback: true,
clientLogLevel: 'info',
quiet: true
}).listen(config().porta_cliente, config().host, function(err) {
if (err) throw new gutil.PluginError('webpack-dev-server', err);
gutil.log('> Iniciando aplicação em modo desenvolvimento...');
gutil.log('[webpack-dev-server]', 'http://' + config().host + ':' + config().porta_cliente + '/webpack-dev-server/index.html');
})
cb()
})
//
gulp.task('monitorar-public', (done) => {
gulp.watch(['client/static/*.*', 'client/static/**/*.*'], gulp.series('copiar-public'));
done();
})
//
gulp.task('dev-servidor', () => {
var stream = nodemon({
script: 'server/bin/www',
exec: 'node --inspect-brk=9229',
ext: 'js',
watch: [
'server/*',
'webpack.config.js'
],
delay: 3000
});
stream
.on('restart', function() {
console.log('Reiniciando!')
})
.on('crash', function() {
console.error('Aplicação parou de funcionar! Reiniciando em 5 segundos\n')
stream.emit('restart', 100) // restart the server in 5 seconds
})
});
//
gulp.task('webpack', function() {
return gulp.src('client/src/main.js')
.pipe(webpack(require('./webpack.config.js')))
.pipe(gulp.dest('dist/public/'));
});
//
gulp.task('dev', gulp.series('copiar-public', 'dev-servidor', gulp.parallel('monitorar-public')))
//
gulp.task('public', gulp.series('copiar-public', 'monitorar-public'));
| 30.344828 | 146 | 0.604167 |
9953a8958390874f1aa5ca6cc0615bbaf1de7d3a | 6,015 | js | JavaScript | src/accessories/WyzeMeshLight.js | Chew/homebridge-wyze-connected-home | f42303ee261c479d702c3d7acfedfb95590014e4 | [
"MIT"
] | 1 | 2021-12-02T03:58:03.000Z | 2021-12-02T03:58:03.000Z | src/accessories/WyzeMeshLight.js | Chew/homebridge-wyze-connected-home | f42303ee261c479d702c3d7acfedfb95590014e4 | [
"MIT"
] | null | null | null | src/accessories/WyzeMeshLight.js | Chew/homebridge-wyze-connected-home | f42303ee261c479d702c3d7acfedfb95590014e4 | [
"MIT"
] | 3 | 2021-05-12T19:13:24.000Z | 2021-05-20T13:40:07.000Z | const colorsys = require('colorsys')
const { Service, Characteristic } = require('../types');
const WyzeAccessory = require('./WyzeAccessory');
const WYZE_API_POWER_PROPERTY = 'P3';
const WYZE_API_BRIGHTNESS_PROPERTY = 'P1501';
const WYZE_API_COLOR_TEMP_PROPERTY = 'P1502';
const WYZE_API_COLOR_PROPERTY = 'P1507';
const WYZE_COLOR_TEMP_MIN = 1800;
const WYZE_COLOR_TEMP_MAX = 6500;
const HOMEKIT_COLOR_TEMP_MIN = 500;
const HOMEKIT_COLOR_TEMP_MAX = 140;
module.exports = class WyzeMeshLight extends WyzeAccessory {
constructor(plugin, homeKitAccessory) {
super(plugin, homeKitAccessory);
this.getCharacteristic(Characteristic.On).on('set', this.setOn.bind(this));
this.getCharacteristic(Characteristic.Brightness).on('set', this.setBrightness.bind(this));
this.getCharacteristic(Characteristic.ColorTemperature).on('set', this.setColorTemperature.bind(this));
this.getCharacteristic(Characteristic.Hue).on('set', this.setHue.bind(this));
this.getCharacteristic(Characteristic.Saturation).on('set', this.setSaturation.bind(this));
// Local caching of HSV color space handling separate Hue & Saturation on HomeKit
// Caching idea for handling HSV colors from:
// https://github.com/QuickSander/homebridge-http-rgb-push/blob/master/index.js
this.cache = {};
this.cacheUpdated = false;
}
async updateCharacteristics(device) {
this.getCharacteristic(Characteristic.On).updateValue(device.device_params.switch_state);
let propertyList = await this.getPropertyList();
for (let property of propertyList.data.property_list) {
switch (property.pid) {
case WYZE_API_BRIGHTNESS_PROPERTY:
this.updateBrightness(property.value);
break;
case WYZE_API_COLOR_TEMP_PROPERTY:
this.updateColorTemp(property.value);
break;
case WYZE_API_COLOR_PROPERTY:
this.updateColor(property.value);
break;
}
}
}
updateBrightness(value) {
this.getCharacteristic(Characteristic.Brightness).updateValue(value);
}
updateColorTemp(value) {
let floatValue = this._rangeToFloat(value, WYZE_COLOR_TEMP_MIN, WYZE_COLOR_TEMP_MAX);
let homeKitValue = this._floatToRange(floatValue, HOMEKIT_COLOR_TEMP_MIN, HOMEKIT_COLOR_TEMP_MAX);
this.getCharacteristic(Characteristic.ColorTemperature).updateValue(homeKitValue);
}
updateColor(value) {
// Convert a Hex color from Wyze into the HSL values recognized by HomeKit.
let hslValue = colorsys.hex2Hsv(value);
this.plugin.log.debug(`Updating color record for ${this.homeKitAccessory.context.mac} to ${value}: ${JSON.stringify(hslValue)}`)
// Update Hue
this.updateHue(hslValue.h);
this.cache.hue = hslValue.h;
// Update Saturation
this.updateSaturation(hslValue.s);
this.cache.saturation = hslValue.s;
}
updateHue(value) {
this.getCharacteristic(Characteristic.Hue).updateValue(value);
}
updateSaturation(value) {
this.getCharacteristic(Characteristic.Saturation).updateValue(value);
}
getService() {
let service = this.homeKitAccessory.getService(Service.Lightbulb);
if (!service) {
service = this.homeKitAccessory.addService(Service.Lightbulb);
}
return service;
}
getCharacteristic(characteristic) {
return this.getService().getCharacteristic(characteristic);
}
async setOn(value, callback) {
this.plugin.log.info(`Setting power for ${this.homeKitAccessory.context.mac} to ${value}`);
try {
await this.runActionList(WYZE_API_POWER_PROPERTY, (value) ? '1' : '0');
callback();
} catch (e) {
callback(e);
}
}
async setBrightness(value, callback) {
this.plugin.log.info(`Setting brightness for ${this.homeKitAccessory.context.mac} to ${value}`);
try {
await this.runActionList(WYZE_API_BRIGHTNESS_PROPERTY, value);
callback();
} catch (e) {
callback(e);
}
}
async setColorTemperature(value, callback) {
let floatValue = this._rangeToFloat(value, HOMEKIT_COLOR_TEMP_MIN, HOMEKIT_COLOR_TEMP_MAX);
let wyzeValue = this._floatToRange(floatValue, WYZE_COLOR_TEMP_MIN, WYZE_COLOR_TEMP_MAX);
this.plugin.log.info(`Setting color temperature for ${this.homeKitAccessory.context.mac} to ${value} (${wyzeValue})`);
try {
await this.runActionList(WYZE_API_COLOR_TEMP_PROPERTY, wyzeValue);
callback();
} catch (e) {
callback(e);
}
}
async setHue(value, callback) {
this.plugin.log.info(`Setting hue (color) for ${this.homeKitAccessory.context.mac} to ${value}`);
this.plugin.log.debug(`(H)S Values: ${value}, ${this.cache.saturation}`);
try {
this.cache.hue = value;
if (this.cacheUpdated) {
let hexValue = colorsys.hsv2Hex(this.cache.hue, this.cache.saturation, 100);
hexValue = hexValue.replace("#", "");
this.plugin.log.info(hexValue);
await this.runActionList(WYZE_API_COLOR_PROPERTY, hexValue);
this.cacheUpdated = false;
} else {
this.cacheUpdated = true;
}
callback();
} catch (e) {
callback(e);
}
}
async setSaturation(value, callback) {
this.plugin.log.info(`Setting saturation (color) for ${this.homeKitAccessory.context.mac} to ${value}`);
this.plugin.log.debug(`H(S) Values: ${this.cache.saturation}, ${value}`);
try {
this.cache.saturation = value;
if (this.cacheUpdated) {
let hexValue = colorsys.hsv2Hex(this.cache.hue, this.cache.saturation, 100);
hexValue = hexValue.replace("#", "");
this.plugin.log.info(hexValue);
await this.runActionList(WYZE_API_COLOR_PROPERTY, hexValue);
this.cacheUpdated = false;
} else {
this.cacheUpdated = true;
}
callback();
} catch (e) {
callback(e);
}
}
_rangeToFloat(value, min, max) {
return (value - min) / (max - min);
}
_floatToRange(value, min, max) {
return Math.round((value * (max - min)) + min);
}
};
| 32.165775 | 132 | 0.687448 |
9954504de8d478de7b4dad70a1c8d9551cc8e4bf | 1,169 | js | JavaScript | public/elasticsearch-1.4.4/plugins/marvel/_site/kibana/app/lib/fakeState.js | TRoy888/wat_elastic | d807fb5d61fbedcd623cbfa7b7dbdf81b4131e7d | [
"MIT"
] | 1 | 2015-03-07T11:11:03.000Z | 2015-03-07T11:11:03.000Z | public/elasticsearch-1.4.4/plugins/marvel/_site/kibana/app/lib/fakeState.js | TRoy888/wat_elastic | d807fb5d61fbedcd623cbfa7b7dbdf81b4131e7d | [
"MIT"
] | null | null | null | public/elasticsearch-1.4.4/plugins/marvel/_site/kibana/app/lib/fakeState.js | TRoy888/wat_elastic | d807fb5d61fbedcd623cbfa7b7dbdf81b4131e7d | [
"MIT"
] | null | null | null | /*! kibana - v3.1.0 - 2014-12-17
* Copyright (c) 2014 Rashid Khan; Licensed Apache License */
define(["require","lodash","moment"],function(a){var b=a("lodash"),c=a("moment");return function(a){a=b.defaults(a||{},{indices:20,nodes:1,shards:5,replicas:1});var d={_id:(new Date).getTime()+Math.random(),cluster_name:"elasticsearch",version:1,nodes:{},routing_nodes:{unassigned:[],nodes:{}}};b.times(a.nodes,function(a){var b="node_"+(a+1);d.nodes[b]={name:"Node "+(a+1),transport_address:"inet[localhost/127.0.0.1:"+(9300+a)+"]",attributes:{}},d.routing_nodes.nodes[b]=[]});var e=b.keys(d.nodes);d.master_node=e[0];var f=0,g=function(){var b=e[f];return a.nodes>1&&(f<a.nodes-1?f++:f=0),b};return b.times(a.indices,function(e){var f=c().subtract("days",e).format("[logstash-]YYYY.MM.DD");b.times(a.shards,function(c){var e=g();d.routing_nodes.nodes[e].push({state:"STARTED",primary:!0,node:e,relocating_node:null,shard:c,index:f}),b.times(a.replicas,function(){var b=a.nodes<2?"UNASSIGNED":"STARTED",e=a.nodes<2?null:g(),h=a.nodes<2?d.routing_nodes.unassigned:d.routing_nodes.nodes[e];h.push({state:b,primary:!1,node:e,relocating_node:null,shard:c,index:f})})})}),d}}); | 292.25 | 1,073 | 0.694611 |
99554da3c82e235c3a6f4d30345e7cb925c0b552 | 62 | js | JavaScript | index.js | manufosela/animation-raincss | 1eb1db6099a3f6ec45862033a09ee332ffab6871 | [
"MIT"
] | null | null | null | index.js | manufosela/animation-raincss | 1eb1db6099a3f6ec45862033a09ee332ffab6871 | [
"MIT"
] | null | null | null | index.js | manufosela/animation-raincss | 1eb1db6099a3f6ec45862033a09ee332ffab6871 | [
"MIT"
] | null | null | null | export { AnimationRaincss } from './src/AnimationRaincss.js';
| 31 | 61 | 0.758065 |
9955a91f93adc79aefd32e9912fbf2adb0f45be5 | 138,029 | js | JavaScript | dist/index-352b102f.js | Samin100/eslint4b | 8945ef57f075f2560d596772176f7979e8f5e3c9 | [
"MIT"
] | null | null | null | dist/index-352b102f.js | Samin100/eslint4b | 8945ef57f075f2560d596772176f7979e8f5e3c9 | [
"MIT"
] | null | null | null | dist/index-352b102f.js | Samin100/eslint4b | 8945ef57f075f2560d596772176f7979e8f5e3c9 | [
"MIT"
] | null | null | null | 'use strict';
var path = require('path');
var eslintScope = require('eslint-scope');
var eslintVisitorKeys = require('eslint-visitor-keys');
var espree = require('espree');
var lodash = require('lodash.merge');
var environments = require('@eslint/eslintrc/conf/environments');
var _commonjsHelpers = require('./_commonjsHelpers-c47342e6.js');
var configOps = require('@eslint/eslintrc/lib/shared/config-ops');
var configValidator = require('@eslint/eslintrc/lib/shared/config-validator');
var eslintUtils = require('eslint-utils');
var assert = require('assert');
var debug$4 = require('debug');
var levn = require('levn');
var esquery = require('esquery');
function _interopDefaultLegacy(e) {
return e && typeof e === 'object' && 'default' in e ? e : {
'default': e
};
}
var path__default = _interopDefaultLegacy(path);
var eslintScope__default = _interopDefaultLegacy(eslintScope);
var eslintVisitorKeys__default = _interopDefaultLegacy(eslintVisitorKeys);
var espree__default = _interopDefaultLegacy(espree);
var lodash__default = _interopDefaultLegacy(lodash);
var environments__default = _interopDefaultLegacy(environments);
var configOps__default = _interopDefaultLegacy(configOps);
var configValidator__default = _interopDefaultLegacy(configValidator);
var eslintUtils__default = _interopDefaultLegacy(eslintUtils);
var assert__default = _interopDefaultLegacy(assert);
var debug__default = _interopDefaultLegacy(debug$4);
var levn__default = _interopDefaultLegacy(levn);
var esquery__default = _interopDefaultLegacy(esquery);
const name = "eslint";
const version = "7.32.0";
const author = "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>";
const description = "An AST-based pattern checker for JavaScript.";
const bin = {
eslint: "./bin/eslint.js"
};
const main = "./lib/api.js";
const scripts = {
test: "node Makefile.js test",
"test:cli": "mocha",
lint: "node Makefile.js lint",
fix: "node Makefile.js lint -- fix",
fuzz: "node Makefile.js fuzz",
"generate-release": "node Makefile.js generateRelease",
"generate-alpharelease": "node Makefile.js generatePrerelease -- alpha",
"generate-betarelease": "node Makefile.js generatePrerelease -- beta",
"generate-rcrelease": "node Makefile.js generatePrerelease -- rc",
"publish-release": "node Makefile.js publishRelease",
docs: "node Makefile.js docs",
gensite: "node Makefile.js gensite",
webpack: "node Makefile.js webpack",
perf: "node Makefile.js perf"
};
const gitHooks = {
"pre-commit": "lint-staged"
};
const files = ["LICENSE", "README.md", "bin", "conf", "lib", "messages"];
const repository = "eslint/eslint";
const funding = "https://opencollective.com/eslint";
const homepage = "https://eslint.org";
const bugs = "https://github.com/eslint/eslint/issues/";
const dependencies = {
"@babel/code-frame": "7.12.11",
"@eslint/eslintrc": "^0.4.3",
"@humanwhocodes/config-array": "^0.5.0",
ajv: "^6.10.0",
chalk: "^4.0.0",
"cross-spawn": "^7.0.2",
debug: "^4.0.1",
doctrine: "^3.0.0",
enquirer: "^2.3.5",
"escape-string-regexp": "^4.0.0",
"eslint-scope": "^5.1.1",
"eslint-utils": "^2.1.0",
"eslint-visitor-keys": "^2.0.0",
espree: "^7.3.1",
esquery: "^1.4.0",
esutils: "^2.0.2",
"fast-deep-equal": "^3.1.3",
"file-entry-cache": "^6.0.1",
"functional-red-black-tree": "^1.0.1",
"glob-parent": "^5.1.2",
globals: "^13.6.0",
ignore: "^4.0.6",
"import-fresh": "^3.0.0",
imurmurhash: "^0.1.4",
"is-glob": "^4.0.0",
"js-yaml": "^3.13.1",
"json-stable-stringify-without-jsonify": "^1.0.1",
levn: "^0.4.1",
"lodash.merge": "^4.6.2",
minimatch: "^3.0.4",
"natural-compare": "^1.4.0",
optionator: "^0.9.1",
progress: "^2.0.0",
regexpp: "^3.1.0",
semver: "^7.2.1",
"strip-ansi": "^6.0.0",
"strip-json-comments": "^3.1.0",
table: "^6.0.9",
"text-table": "^0.2.0",
"v8-compile-cache": "^2.0.3"
};
const devDependencies = {
"@babel/core": "^7.4.3",
"@babel/preset-env": "^7.4.3",
"babel-loader": "^8.0.5",
chai: "^4.0.1",
cheerio: "^0.22.0",
"common-tags": "^1.8.0",
"core-js": "^3.1.3",
dateformat: "^3.0.3",
ejs: "^3.0.2",
eslint: "file:.",
"eslint-config-eslint": "file:packages/eslint-config-eslint",
"eslint-plugin-eslint-plugin": "^3.5.3",
"eslint-plugin-internal-rules": "file:tools/internal-rules",
"eslint-plugin-jsdoc": "^25.4.3",
"eslint-plugin-node": "^11.1.0",
"eslint-release": "^2.0.0",
eslump: "^3.0.0",
esprima: "^4.0.1",
"fs-teardown": "0.1.1",
glob: "^7.1.6",
jsdoc: "^3.5.5",
karma: "^6.1.1",
"karma-chrome-launcher": "^3.1.0",
"karma-mocha": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
"karma-webpack": "^5.0.0",
"lint-staged": "^10.1.2",
"load-perf": "^0.2.0",
markdownlint: "^0.19.0",
"markdownlint-cli": "^0.22.0",
memfs: "^3.0.1",
mocha: "^8.3.2",
"mocha-junit-reporter": "^2.0.0",
"node-polyfill-webpack-plugin": "^1.0.3",
"npm-license": "^0.3.3",
nyc: "^15.0.1",
proxyquire: "^2.0.1",
puppeteer: "^7.1.0",
recast: "^0.19.0",
"regenerator-runtime": "^0.13.2",
shelljs: "^0.8.2",
sinon: "^9.0.1",
temp: "^0.9.0",
webpack: "^5.23.0",
"webpack-cli": "^4.5.0",
yorkie: "^2.0.0"
};
const keywords = ["ast", "lint", "javascript", "ecmascript", "espree"];
const license = "MIT";
const engines = {
node: "^10.12.0 || >=12.0.0"
};
var _package = {
name: "eslint",
version: "7.32.0",
author: "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
description: "An AST-based pattern checker for JavaScript.",
bin: bin,
main: "./lib/api.js",
scripts: scripts,
gitHooks: gitHooks,
"lint-staged": {
"*.js": "eslint --fix",
"*.md": "markdownlint"
},
files: files,
repository: "eslint/eslint",
funding: "https://opencollective.com/eslint",
homepage: "https://eslint.org",
bugs: "https://github.com/eslint/eslint/issues/",
dependencies: dependencies,
devDependencies: devDependencies,
keywords: keywords,
license: "MIT",
engines: engines
};
var _package$1 = Object.freeze({
__proto__: null,
name: "eslint",
version: "7.32.0",
author: "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
description: "An AST-based pattern checker for JavaScript.",
bin: bin,
main: "./lib/api.js",
scripts: scripts,
gitHooks: gitHooks,
files: files,
repository: "eslint/eslint",
funding: "https://opencollective.com/eslint",
homepage: "https://eslint.org",
bugs: "https://github.com/eslint/eslint/issues/",
dependencies: dependencies,
devDependencies: devDependencies,
keywords: keywords,
license: "MIT",
engines: engines,
'default': _package
});
var cursor = class {
constructor() {
this.current = null;
}
getOneToken() {
return this.moveNext() ? this.current : null;
}
getAllTokens() {
const tokens = [];
while (this.moveNext()) {
tokens.push(this.current);
}
return tokens;
}
moveNext() {
throw new Error("Not implemented.");
}
};
function getStartLocation(token) {
return token.range[0];
}
var search = function (tokens, location) {
const index = tokens.findIndex(el => location <= getStartLocation(el));
return index === -1 ? tokens.length : index;
};
var getFirstIndex = function (tokens, indexMap, startLoc) {
if (startLoc in indexMap) {
return indexMap[startLoc];
}
if (startLoc - 1 in indexMap) {
const index = indexMap[startLoc - 1];
const token = index >= 0 && index < tokens.length ? tokens[index] : null;
if (token && token.range[0] >= startLoc) {
return index;
}
return index + 1;
}
return 0;
};
var getLastIndex = function (tokens, indexMap, endLoc) {
if (endLoc in indexMap) {
return indexMap[endLoc] - 1;
}
if (endLoc - 1 in indexMap) {
const index = indexMap[endLoc - 1];
const token = index >= 0 && index < tokens.length ? tokens[index] : null;
if (token && token.range[1] > endLoc) {
return index - 1;
}
return index;
}
return tokens.length - 1;
};
var utils = {
search: search,
getFirstIndex: getFirstIndex,
getLastIndex: getLastIndex
};
var backwardTokenCommentCursor = class extends cursor {
constructor(tokens, comments, indexMap, startLoc, endLoc) {
super();
this.tokens = tokens;
this.comments = comments;
this.tokenIndex = utils.getLastIndex(tokens, indexMap, endLoc);
this.commentIndex = utils.search(comments, endLoc) - 1;
this.border = startLoc;
}
moveNext() {
const token = this.tokenIndex >= 0 ? this.tokens[this.tokenIndex] : null;
const comment = this.commentIndex >= 0 ? this.comments[this.commentIndex] : null;
if (token && (!comment || token.range[1] > comment.range[1])) {
this.current = token;
this.tokenIndex -= 1;
} else if (comment) {
this.current = comment;
this.commentIndex -= 1;
} else {
this.current = null;
}
return Boolean(this.current) && (this.border === -1 || this.current.range[0] >= this.border);
}
};
var backwardTokenCursor = class extends cursor {
constructor(tokens, comments, indexMap, startLoc, endLoc) {
super();
this.tokens = tokens;
this.index = utils.getLastIndex(tokens, indexMap, endLoc);
this.indexEnd = utils.getFirstIndex(tokens, indexMap, startLoc);
}
moveNext() {
if (this.index >= this.indexEnd) {
this.current = this.tokens[this.index];
this.index -= 1;
return true;
}
return false;
}
getOneToken() {
return this.index >= this.indexEnd ? this.tokens[this.index] : null;
}
};
var decorativeCursor = class extends cursor {
constructor(cursor) {
super();
this.cursor = cursor;
}
moveNext() {
const retv = this.cursor.moveNext();
this.current = this.cursor.current;
return retv;
}
};
var filterCursor = class extends decorativeCursor {
constructor(cursor, predicate) {
super(cursor);
this.predicate = predicate;
}
moveNext() {
const predicate = this.predicate;
while (super.moveNext()) {
if (predicate(this.current)) {
return true;
}
}
return false;
}
};
var forwardTokenCommentCursor = class extends cursor {
constructor(tokens, comments, indexMap, startLoc, endLoc) {
super();
this.tokens = tokens;
this.comments = comments;
this.tokenIndex = utils.getFirstIndex(tokens, indexMap, startLoc);
this.commentIndex = utils.search(comments, startLoc);
this.border = endLoc;
}
moveNext() {
const token = this.tokenIndex < this.tokens.length ? this.tokens[this.tokenIndex] : null;
const comment = this.commentIndex < this.comments.length ? this.comments[this.commentIndex] : null;
if (token && (!comment || token.range[0] < comment.range[0])) {
this.current = token;
this.tokenIndex += 1;
} else if (comment) {
this.current = comment;
this.commentIndex += 1;
} else {
this.current = null;
}
return Boolean(this.current) && (this.border === -1 || this.current.range[1] <= this.border);
}
};
var forwardTokenCursor = class extends cursor {
constructor(tokens, comments, indexMap, startLoc, endLoc) {
super();
this.tokens = tokens;
this.index = utils.getFirstIndex(tokens, indexMap, startLoc);
this.indexEnd = utils.getLastIndex(tokens, indexMap, endLoc);
}
moveNext() {
if (this.index <= this.indexEnd) {
this.current = this.tokens[this.index];
this.index += 1;
return true;
}
return false;
}
getOneToken() {
return this.index <= this.indexEnd ? this.tokens[this.index] : null;
}
getAllTokens() {
return this.tokens.slice(this.index, this.indexEnd + 1);
}
};
var limitCursor = class extends decorativeCursor {
constructor(cursor, count) {
super(cursor);
this.count = count;
}
moveNext() {
if (this.count > 0) {
this.count -= 1;
return super.moveNext();
}
return false;
}
};
var skipCursor = class extends decorativeCursor {
constructor(cursor, count) {
super(cursor);
this.count = count;
}
moveNext() {
while (this.count > 0) {
this.count -= 1;
if (!super.moveNext()) {
return false;
}
}
return super.moveNext();
}
};
class CursorFactory {
constructor(TokenCursor, TokenCommentCursor) {
this.TokenCursor = TokenCursor;
this.TokenCommentCursor = TokenCommentCursor;
}
createBaseCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments) {
const Cursor = includeComments ? this.TokenCommentCursor : this.TokenCursor;
return new Cursor(tokens, comments, indexMap, startLoc, endLoc);
}
createCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments, filter, skip, count) {
let cursor = this.createBaseCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments);
if (filter) {
cursor = new filterCursor(cursor, filter);
}
if (skip >= 1) {
cursor = new skipCursor(cursor, skip);
}
if (count >= 0) {
cursor = new limitCursor(cursor, count);
}
return cursor;
}
}
var forward = new CursorFactory(forwardTokenCursor, forwardTokenCommentCursor);
var backward = new CursorFactory(backwardTokenCursor, backwardTokenCommentCursor);
var cursors = {
forward: forward,
backward: backward
};
var paddedTokenCursor = class extends forwardTokenCursor {
constructor(tokens, comments, indexMap, startLoc, endLoc, beforeCount, afterCount) {
super(tokens, comments, indexMap, startLoc, endLoc);
this.index = Math.max(0, this.index - beforeCount);
this.indexEnd = Math.min(tokens.length - 1, this.indexEnd + afterCount);
}
};
const {
isCommentToken: isCommentToken$1
} = eslintUtils__default["default"];
const TOKENS = Symbol("tokens");
const COMMENTS = Symbol("comments");
const INDEX_MAP = Symbol("indexMap");
function createIndexMap(tokens, comments) {
const map = Object.create(null);
let tokenIndex = 0;
let commentIndex = 0;
let nextStart = 0;
let range = null;
while (tokenIndex < tokens.length || commentIndex < comments.length) {
nextStart = commentIndex < comments.length ? comments[commentIndex].range[0] : Number.MAX_SAFE_INTEGER;
while (tokenIndex < tokens.length && (range = tokens[tokenIndex].range)[0] < nextStart) {
map[range[0]] = tokenIndex;
map[range[1] - 1] = tokenIndex;
tokenIndex += 1;
}
nextStart = tokenIndex < tokens.length ? tokens[tokenIndex].range[0] : Number.MAX_SAFE_INTEGER;
while (commentIndex < comments.length && (range = comments[commentIndex].range)[0] < nextStart) {
map[range[0]] = tokenIndex;
map[range[1] - 1] = tokenIndex;
commentIndex += 1;
}
}
return map;
}
function createCursorWithSkip(factory, tokens, comments, indexMap, startLoc, endLoc, opts) {
let includeComments = false;
let skip = 0;
let filter = null;
if (typeof opts === "number") {
skip = opts | 0;
} else if (typeof opts === "function") {
filter = opts;
} else if (opts) {
includeComments = !!opts.includeComments;
skip = opts.skip | 0;
filter = opts.filter || null;
}
assert__default["default"](skip >= 0, "options.skip should be zero or a positive integer.");
assert__default["default"](!filter || typeof filter === "function", "options.filter should be a function.");
return factory.createCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments, filter, skip, -1);
}
function createCursorWithCount(factory, tokens, comments, indexMap, startLoc, endLoc, opts) {
let includeComments = false;
let count = 0;
let countExists = false;
let filter = null;
if (typeof opts === "number") {
count = opts | 0;
countExists = true;
} else if (typeof opts === "function") {
filter = opts;
} else if (opts) {
includeComments = !!opts.includeComments;
count = opts.count | 0;
countExists = typeof opts.count === "number";
filter = opts.filter || null;
}
assert__default["default"](count >= 0, "options.count should be zero or a positive integer.");
assert__default["default"](!filter || typeof filter === "function", "options.filter should be a function.");
return factory.createCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments, filter, 0, countExists ? count : -1);
}
function createCursorWithPadding(tokens, comments, indexMap, startLoc, endLoc, beforeCount, afterCount) {
if (typeof beforeCount === "undefined" && typeof afterCount === "undefined") {
return new forwardTokenCursor(tokens, comments, indexMap, startLoc, endLoc);
}
if (typeof beforeCount === "number" || typeof beforeCount === "undefined") {
return new paddedTokenCursor(tokens, comments, indexMap, startLoc, endLoc, beforeCount | 0, afterCount | 0);
}
return createCursorWithCount(cursors.forward, tokens, comments, indexMap, startLoc, endLoc, beforeCount);
}
function getAdjacentCommentTokensFromCursor(cursor) {
const tokens = [];
let currentToken = cursor.getOneToken();
while (currentToken && isCommentToken$1(currentToken)) {
tokens.push(currentToken);
currentToken = cursor.getOneToken();
}
return tokens;
}
var tokenStore = class {
constructor(tokens, comments) {
this[TOKENS] = tokens;
this[COMMENTS] = comments;
this[INDEX_MAP] = createIndexMap(tokens, comments);
}
getTokenByRangeStart(offset, options) {
const includeComments = options && options.includeComments;
const token = cursors.forward.createBaseCursor(this[TOKENS], this[COMMENTS], this[INDEX_MAP], offset, -1, includeComments).getOneToken();
if (token && token.range[0] === offset) {
return token;
}
return null;
}
getFirstToken(node, options) {
return createCursorWithSkip(cursors.forward, this[TOKENS], this[COMMENTS], this[INDEX_MAP], node.range[0], node.range[1], options).getOneToken();
}
getLastToken(node, options) {
return createCursorWithSkip(cursors.backward, this[TOKENS], this[COMMENTS], this[INDEX_MAP], node.range[0], node.range[1], options).getOneToken();
}
getTokenBefore(node, options) {
return createCursorWithSkip(cursors.backward, this[TOKENS], this[COMMENTS], this[INDEX_MAP], -1, node.range[0], options).getOneToken();
}
getTokenAfter(node, options) {
return createCursorWithSkip(cursors.forward, this[TOKENS], this[COMMENTS], this[INDEX_MAP], node.range[1], -1, options).getOneToken();
}
getFirstTokenBetween(left, right, options) {
return createCursorWithSkip(cursors.forward, this[TOKENS], this[COMMENTS], this[INDEX_MAP], left.range[1], right.range[0], options).getOneToken();
}
getLastTokenBetween(left, right, options) {
return createCursorWithSkip(cursors.backward, this[TOKENS], this[COMMENTS], this[INDEX_MAP], left.range[1], right.range[0], options).getOneToken();
}
getTokenOrCommentBefore(node, skip) {
return this.getTokenBefore(node, {
includeComments: true,
skip
});
}
getTokenOrCommentAfter(node, skip) {
return this.getTokenAfter(node, {
includeComments: true,
skip
});
}
getFirstTokens(node, options) {
return createCursorWithCount(cursors.forward, this[TOKENS], this[COMMENTS], this[INDEX_MAP], node.range[0], node.range[1], options).getAllTokens();
}
getLastTokens(node, options) {
return createCursorWithCount(cursors.backward, this[TOKENS], this[COMMENTS], this[INDEX_MAP], node.range[0], node.range[1], options).getAllTokens().reverse();
}
getTokensBefore(node, options) {
return createCursorWithCount(cursors.backward, this[TOKENS], this[COMMENTS], this[INDEX_MAP], -1, node.range[0], options).getAllTokens().reverse();
}
getTokensAfter(node, options) {
return createCursorWithCount(cursors.forward, this[TOKENS], this[COMMENTS], this[INDEX_MAP], node.range[1], -1, options).getAllTokens();
}
getFirstTokensBetween(left, right, options) {
return createCursorWithCount(cursors.forward, this[TOKENS], this[COMMENTS], this[INDEX_MAP], left.range[1], right.range[0], options).getAllTokens();
}
getLastTokensBetween(left, right, options) {
return createCursorWithCount(cursors.backward, this[TOKENS], this[COMMENTS], this[INDEX_MAP], left.range[1], right.range[0], options).getAllTokens().reverse();
}
getTokens(node, beforeCount, afterCount) {
return createCursorWithPadding(this[TOKENS], this[COMMENTS], this[INDEX_MAP], node.range[0], node.range[1], beforeCount, afterCount).getAllTokens();
}
getTokensBetween(left, right, padding) {
return createCursorWithPadding(this[TOKENS], this[COMMENTS], this[INDEX_MAP], left.range[1], right.range[0], padding, padding).getAllTokens();
}
commentsExistBetween(left, right) {
const index = utils.search(this[COMMENTS], left.range[1]);
return index < this[COMMENTS].length && this[COMMENTS][index].range[1] <= right.range[0];
}
getCommentsBefore(nodeOrToken) {
const cursor = createCursorWithCount(cursors.backward, this[TOKENS], this[COMMENTS], this[INDEX_MAP], -1, nodeOrToken.range[0], {
includeComments: true
});
return getAdjacentCommentTokensFromCursor(cursor).reverse();
}
getCommentsAfter(nodeOrToken) {
const cursor = createCursorWithCount(cursors.forward, this[TOKENS], this[COMMENTS], this[INDEX_MAP], nodeOrToken.range[1], -1, {
includeComments: true
});
return getAdjacentCommentTokensFromCursor(cursor);
}
getCommentsInside(node) {
return this.getTokens(node, {
includeComments: true,
filter: isCommentToken$1
});
}
};
const {
isCommentToken
} = eslintUtils__default["default"];
function validate(ast) {
if (!ast.tokens) {
throw new Error("AST is missing the tokens array.");
}
if (!ast.comments) {
throw new Error("AST is missing the comments array.");
}
if (!ast.loc) {
throw new Error("AST is missing location information.");
}
if (!ast.range) {
throw new Error("AST is missing range information");
}
}
function looksLikeExport(astNode) {
return astNode.type === "ExportDefaultDeclaration" || astNode.type === "ExportNamedDeclaration" || astNode.type === "ExportAllDeclaration" || astNode.type === "ExportSpecifier";
}
function sortedMerge(tokens, comments) {
const result = [];
let tokenIndex = 0;
let commentIndex = 0;
while (tokenIndex < tokens.length || commentIndex < comments.length) {
if (commentIndex >= comments.length || tokenIndex < tokens.length && tokens[tokenIndex].range[0] < comments[commentIndex].range[0]) {
result.push(tokens[tokenIndex++]);
} else {
result.push(comments[commentIndex++]);
}
}
return result;
}
function nodesOrTokensOverlap(first, second) {
return first.range[0] <= second.range[0] && first.range[1] >= second.range[0] || second.range[0] <= first.range[0] && second.range[1] >= first.range[0];
}
function isSpaceBetween(sourceCode, first, second, checkInsideOfJSXText) {
if (nodesOrTokensOverlap(first, second)) {
return false;
}
const [startingNodeOrToken, endingNodeOrToken] = first.range[1] <= second.range[0] ? [first, second] : [second, first];
const firstToken = sourceCode.getLastToken(startingNodeOrToken) || startingNodeOrToken;
const finalToken = sourceCode.getFirstToken(endingNodeOrToken) || endingNodeOrToken;
let currentToken = firstToken;
while (currentToken !== finalToken) {
const nextToken = sourceCode.getTokenAfter(currentToken, {
includeComments: true
});
if (currentToken.range[1] !== nextToken.range[0] || checkInsideOfJSXText && nextToken !== finalToken && nextToken.type === "JSXText" && /\s/u.test(nextToken.value)) {
return true;
}
currentToken = nextToken;
}
return false;
}
class SourceCode$1 extends tokenStore {
constructor(textOrConfig, astIfNoConfig) {
let text, ast, parserServices, scopeManager, visitorKeys;
if (typeof textOrConfig === "string") {
text = textOrConfig;
ast = astIfNoConfig;
} else if (typeof textOrConfig === "object" && textOrConfig !== null) {
text = textOrConfig.text;
ast = textOrConfig.ast;
parserServices = textOrConfig.parserServices;
scopeManager = textOrConfig.scopeManager;
visitorKeys = textOrConfig.visitorKeys;
}
validate(ast);
super(ast.tokens, ast.comments);
this.hasBOM = text.charCodeAt(0) === 0xFEFF;
this.text = this.hasBOM ? text.slice(1) : text;
this.ast = ast;
this.parserServices = parserServices || {};
this.scopeManager = scopeManager || null;
this.visitorKeys = visitorKeys || _commonjsHelpers.traverser.DEFAULT_VISITOR_KEYS;
const shebangMatched = this.text.match(_commonjsHelpers.astUtils.shebangPattern);
const hasShebang = shebangMatched && ast.comments.length && ast.comments[0].value === shebangMatched[1];
if (hasShebang) {
ast.comments[0].type = "Shebang";
}
this.tokensAndComments = sortedMerge(ast.tokens, ast.comments);
this.lines = [];
this.lineStartIndices = [0];
const lineEndingPattern = _commonjsHelpers.astUtils.createGlobalLinebreakMatcher();
let match;
while (match = lineEndingPattern.exec(this.text)) {
this.lines.push(this.text.slice(this.lineStartIndices[this.lineStartIndices.length - 1], match.index));
this.lineStartIndices.push(match.index + match[0].length);
}
this.lines.push(this.text.slice(this.lineStartIndices[this.lineStartIndices.length - 1]));
this._commentCache = new WeakMap();
Object.freeze(this);
Object.freeze(this.lines);
}
static splitLines(text) {
return text.split(_commonjsHelpers.astUtils.createGlobalLinebreakMatcher());
}
getText(node, beforeCount, afterCount) {
if (node) {
return this.text.slice(Math.max(node.range[0] - (beforeCount || 0), 0), node.range[1] + (afterCount || 0));
}
return this.text;
}
getLines() {
return this.lines;
}
getAllComments() {
return this.ast.comments;
}
getComments(node) {
if (this._commentCache.has(node)) {
return this._commentCache.get(node);
}
const comments = {
leading: [],
trailing: []
};
if (node.type === "Program") {
if (node.body.length === 0) {
comments.leading = node.comments;
}
} else {
if ((node.type === "BlockStatement" || node.type === "ClassBody") && node.body.length === 0 || node.type === "ObjectExpression" && node.properties.length === 0 || node.type === "ArrayExpression" && node.elements.length === 0 || node.type === "SwitchStatement" && node.cases.length === 0) {
comments.trailing = this.getTokens(node, {
includeComments: true,
filter: isCommentToken
});
}
let currentToken = this.getTokenBefore(node, {
includeComments: true
});
while (currentToken && isCommentToken(currentToken)) {
if (node.parent && node.parent.type !== "Program" && currentToken.start < node.parent.start) {
break;
}
comments.leading.push(currentToken);
currentToken = this.getTokenBefore(currentToken, {
includeComments: true
});
}
comments.leading.reverse();
currentToken = this.getTokenAfter(node, {
includeComments: true
});
while (currentToken && isCommentToken(currentToken)) {
if (node.parent && node.parent.type !== "Program" && currentToken.end > node.parent.end) {
break;
}
comments.trailing.push(currentToken);
currentToken = this.getTokenAfter(currentToken, {
includeComments: true
});
}
}
this._commentCache.set(node, comments);
return comments;
}
getJSDocComment(node) {
const findJSDocComment = astNode => {
const tokenBefore = this.getTokenBefore(astNode, {
includeComments: true
});
if (tokenBefore && isCommentToken(tokenBefore) && tokenBefore.type === "Block" && tokenBefore.value.charAt(0) === "*" && astNode.loc.start.line - tokenBefore.loc.end.line <= 1) {
return tokenBefore;
}
return null;
};
let parent = node.parent;
switch (node.type) {
case "ClassDeclaration":
case "FunctionDeclaration":
return findJSDocComment(looksLikeExport(parent) ? parent : node);
case "ClassExpression":
return findJSDocComment(parent.parent);
case "ArrowFunctionExpression":
case "FunctionExpression":
if (parent.type !== "CallExpression" && parent.type !== "NewExpression") {
while (!this.getCommentsBefore(parent).length && !/Function/u.test(parent.type) && parent.type !== "MethodDefinition" && parent.type !== "Property") {
parent = parent.parent;
if (!parent) {
break;
}
}
if (parent && parent.type !== "FunctionDeclaration" && parent.type !== "Program") {
return findJSDocComment(parent);
}
}
return findJSDocComment(node);
default:
return null;
}
}
getNodeByRangeIndex(index) {
let result = null;
_commonjsHelpers.traverser.traverse(this.ast, {
visitorKeys: this.visitorKeys,
enter(node) {
if (node.range[0] <= index && index < node.range[1]) {
result = node;
} else {
this.skip();
}
},
leave(node) {
if (node === result) {
this.break();
}
}
});
return result;
}
isSpaceBetween(first, second) {
return isSpaceBetween(this, first, second, false);
}
isSpaceBetweenTokens(first, second) {
return isSpaceBetween(this, first, second, true);
}
getLocFromIndex(index) {
if (typeof index !== "number") {
throw new TypeError("Expected `index` to be a number.");
}
if (index < 0 || index > this.text.length) {
throw new RangeError(`Index out of range (requested index ${index}, but source text has length ${this.text.length}).`);
}
if (index === this.text.length) {
return {
line: this.lines.length,
column: this.lines[this.lines.length - 1].length
};
}
const lineNumber = index >= this.lineStartIndices[this.lineStartIndices.length - 1] ? this.lineStartIndices.length : this.lineStartIndices.findIndex(el => index < el);
return {
line: lineNumber,
column: index - this.lineStartIndices[lineNumber - 1]
};
}
getIndexFromLoc(loc) {
if (typeof loc !== "object" || typeof loc.line !== "number" || typeof loc.column !== "number") {
throw new TypeError("Expected `loc` to be an object with numeric `line` and `column` properties.");
}
if (loc.line <= 0) {
throw new RangeError(`Line number out of range (line ${loc.line} requested). Line numbers should be 1-based.`);
}
if (loc.line > this.lineStartIndices.length) {
throw new RangeError(`Line number out of range (line ${loc.line} requested, but only ${this.lineStartIndices.length} lines present).`);
}
const lineStartIndex = this.lineStartIndices[loc.line - 1];
const lineEndIndex = loc.line === this.lineStartIndices.length ? this.text.length : this.lineStartIndices[loc.line];
const positionIndex = lineStartIndex + loc.column;
if (loc.line === this.lineStartIndices.length && positionIndex > lineEndIndex || loc.line < this.lineStartIndices.length && positionIndex >= lineEndIndex) {
throw new RangeError(`Column number out of range (column ${loc.column} requested, but the length of line ${loc.line} is ${lineEndIndex - lineStartIndex}).`);
}
return positionIndex;
}
}
var sourceCode$1 = SourceCode$1;
var sourceCode = {
SourceCode: sourceCode$1
};
const debug$3 = debug__default["default"]("eslint:code-path");
function getId(segment) {
return segment.id + (segment.reachable ? "" : "!");
}
function nodeToString(node, label) {
const suffix = label ? `:${label}` : "";
switch (node.type) {
case "Identifier":
return `${node.type}${suffix} (${node.name})`;
case "Literal":
return `${node.type}${suffix} (${node.value})`;
default:
return `${node.type}${suffix}`;
}
}
var debugHelpers = {
enabled: debug$3.enabled,
dump: debug$3,
dumpState: !debug$3.enabled ? debug$3 : function (node, state, leaving) {
for (let i = 0; i < state.currentSegments.length; ++i) {
const segInternal = state.currentSegments[i].internal;
if (leaving) {
const last = segInternal.nodes.length - 1;
if (last >= 0 && segInternal.nodes[last] === nodeToString(node, "enter")) {
segInternal.nodes[last] = nodeToString(node, void 0);
} else {
segInternal.nodes.push(nodeToString(node, "exit"));
}
} else {
segInternal.nodes.push(nodeToString(node, "enter"));
}
}
debug$3([`${state.currentSegments.map(getId).join(",")})`, `${node.type}${leaving ? ":exit" : ""}`].join(" "));
},
dumpDot: !debug$3.enabled ? debug$3 : function (codePath) {
let text = "\ndigraph {\nnode[shape=box,style=\"rounded,filled\",fillcolor=white];\ninitial[label=\"\",shape=circle,style=filled,fillcolor=black,width=0.25,height=0.25];\n";
if (codePath.returnedSegments.length > 0) {
text += "final[label=\"\",shape=doublecircle,style=filled,fillcolor=black,width=0.25,height=0.25];\n";
}
if (codePath.thrownSegments.length > 0) {
text += "thrown[label=\"✘\",shape=circle,width=0.3,height=0.3,fixedsize];\n";
}
const traceMap = Object.create(null);
const arrows = this.makeDotArrows(codePath, traceMap);
for (const id in traceMap) {
const segment = traceMap[id];
text += `${id}[`;
if (segment.reachable) {
text += "label=\"";
} else {
text += "style=\"rounded,dashed,filled\",fillcolor=\"#FF9800\",label=\"<<unreachable>>\\n";
}
if (segment.internal.nodes.length > 0) {
text += segment.internal.nodes.join("\\n");
} else {
text += "????";
}
text += "\"];\n";
}
text += `${arrows}\n`;
text += "}";
debug$3("DOT", text);
},
makeDotArrows(codePath, traceMap) {
const stack = [[codePath.initialSegment, 0]];
const done = traceMap || Object.create(null);
let lastId = codePath.initialSegment.id;
let text = `initial->${codePath.initialSegment.id}`;
while (stack.length > 0) {
const item = stack.pop();
const segment = item[0];
const index = item[1];
if (done[segment.id] && index === 0) {
continue;
}
done[segment.id] = segment;
const nextSegment = segment.allNextSegments[index];
if (!nextSegment) {
continue;
}
if (lastId === segment.id) {
text += `->${nextSegment.id}`;
} else {
text += `;\n${segment.id}->${nextSegment.id}`;
}
lastId = nextSegment.id;
stack.unshift([segment, 1 + index]);
stack.push([nextSegment, 0]);
}
codePath.returnedSegments.forEach(finalSegment => {
if (lastId === finalSegment.id) {
text += "->final";
} else {
text += `;\n${finalSegment.id}->final`;
}
lastId = null;
});
codePath.thrownSegments.forEach(finalSegment => {
if (lastId === finalSegment.id) {
text += "->thrown";
} else {
text += `;\n${finalSegment.id}->thrown`;
}
lastId = null;
});
return `${text};`;
}
};
debugHelpers.enabled;
debugHelpers.dump;
debugHelpers.dumpState;
debugHelpers.dumpDot;
debugHelpers.makeDotArrows;
function isReachable$1(segment) {
return segment.reachable;
}
class CodePathSegment {
constructor(id, allPrevSegments, reachable) {
this.id = id;
this.nextSegments = [];
this.prevSegments = allPrevSegments.filter(isReachable$1);
this.allNextSegments = [];
this.allPrevSegments = allPrevSegments;
this.reachable = reachable;
Object.defineProperty(this, "internal", {
value: {
used: false,
loopedPrevSegments: []
}
});
if (debugHelpers.enabled) {
this.internal.nodes = [];
}
}
isLoopedPrevSegment(segment) {
return this.internal.loopedPrevSegments.indexOf(segment) !== -1;
}
static newRoot(id) {
return new CodePathSegment(id, [], true);
}
static newNext(id, allPrevSegments) {
return new CodePathSegment(id, CodePathSegment.flattenUnusedSegments(allPrevSegments), allPrevSegments.some(isReachable$1));
}
static newUnreachable(id, allPrevSegments) {
const segment = new CodePathSegment(id, CodePathSegment.flattenUnusedSegments(allPrevSegments), false);
CodePathSegment.markUsed(segment);
return segment;
}
static newDisconnected(id, allPrevSegments) {
return new CodePathSegment(id, [], allPrevSegments.some(isReachable$1));
}
static markUsed(segment) {
if (segment.internal.used) {
return;
}
segment.internal.used = true;
let i;
if (segment.reachable) {
for (i = 0; i < segment.allPrevSegments.length; ++i) {
const prevSegment = segment.allPrevSegments[i];
prevSegment.allNextSegments.push(segment);
prevSegment.nextSegments.push(segment);
}
} else {
for (i = 0; i < segment.allPrevSegments.length; ++i) {
segment.allPrevSegments[i].allNextSegments.push(segment);
}
}
}
static markPrevSegmentAsLooped(segment, prevSegment) {
segment.internal.loopedPrevSegments.push(prevSegment);
}
static flattenUnusedSegments(segments) {
const done = Object.create(null);
const retv = [];
for (let i = 0; i < segments.length; ++i) {
const segment = segments[i];
if (done[segment.id]) {
continue;
}
if (!segment.internal.used) {
for (let j = 0; j < segment.allPrevSegments.length; ++j) {
const prevSegment = segment.allPrevSegments[j];
if (!done[prevSegment.id]) {
done[prevSegment.id] = true;
retv.push(prevSegment);
}
}
} else {
done[segment.id] = true;
retv.push(segment);
}
}
return retv;
}
}
var codePathSegment = CodePathSegment;
function isReachable(segment) {
return segment.reachable;
}
function makeSegments(context, begin, end, create) {
const list = context.segmentsList;
const normalizedBegin = begin >= 0 ? begin : list.length + begin;
const normalizedEnd = end >= 0 ? end : list.length + end;
const segments = [];
for (let i = 0; i < context.count; ++i) {
const allPrevSegments = [];
for (let j = normalizedBegin; j <= normalizedEnd; ++j) {
allPrevSegments.push(list[j][i]);
}
segments.push(create(context.idGenerator.next(), allPrevSegments));
}
return segments;
}
function mergeExtraSegments(context, segments) {
let currentSegments = segments;
while (currentSegments.length > context.count) {
const merged = [];
for (let i = 0, length = currentSegments.length / 2 | 0; i < length; ++i) {
merged.push(codePathSegment.newNext(context.idGenerator.next(), [currentSegments[i], currentSegments[i + length]]));
}
currentSegments = merged;
}
return currentSegments;
}
class ForkContext {
constructor(idGenerator, upper, count) {
this.idGenerator = idGenerator;
this.upper = upper;
this.count = count;
this.segmentsList = [];
}
get head() {
const list = this.segmentsList;
return list.length === 0 ? [] : list[list.length - 1];
}
get empty() {
return this.segmentsList.length === 0;
}
get reachable() {
const segments = this.head;
return segments.length > 0 && segments.some(isReachable);
}
makeNext(begin, end) {
return makeSegments(this, begin, end, codePathSegment.newNext);
}
makeUnreachable(begin, end) {
return makeSegments(this, begin, end, codePathSegment.newUnreachable);
}
makeDisconnected(begin, end) {
return makeSegments(this, begin, end, codePathSegment.newDisconnected);
}
add(segments) {
assert__default["default"](segments.length >= this.count, `${segments.length} >= ${this.count}`);
this.segmentsList.push(mergeExtraSegments(this, segments));
}
replaceHead(segments) {
assert__default["default"](segments.length >= this.count, `${segments.length} >= ${this.count}`);
this.segmentsList.splice(-1, 1, mergeExtraSegments(this, segments));
}
addAll(context) {
assert__default["default"](context.count === this.count);
const source = context.segmentsList;
for (let i = 0; i < source.length; ++i) {
this.segmentsList.push(source[i]);
}
}
clear() {
this.segmentsList = [];
}
static newRoot(idGenerator) {
const context = new ForkContext(idGenerator, null, 1);
context.add([codePathSegment.newRoot(idGenerator.next())]);
return context;
}
static newEmpty(parentContext, forkLeavingPath) {
return new ForkContext(parentContext.idGenerator, parentContext, (forkLeavingPath ? 2 : 1) * parentContext.count);
}
}
var forkContext = ForkContext;
function addToReturnedOrThrown(dest, others, all, segments) {
for (let i = 0; i < segments.length; ++i) {
const segment = segments[i];
dest.push(segment);
if (others.indexOf(segment) === -1) {
all.push(segment);
}
}
}
function getContinueContext(state, label) {
if (!label) {
return state.loopContext;
}
let context = state.loopContext;
while (context) {
if (context.label === label) {
return context;
}
context = context.upper;
}
return null;
}
function getBreakContext(state, label) {
let context = state.breakContext;
while (context) {
if (label ? context.label === label : context.breakable) {
return context;
}
context = context.upper;
}
return null;
}
function getReturnContext(state) {
let context = state.tryContext;
while (context) {
if (context.hasFinalizer && context.position !== "finally") {
return context;
}
context = context.upper;
}
return state;
}
function getThrowContext(state) {
let context = state.tryContext;
while (context) {
if (context.position === "try" || context.hasFinalizer && context.position === "catch") {
return context;
}
context = context.upper;
}
return state;
}
function remove(xs, x) {
xs.splice(xs.indexOf(x), 1);
}
function removeConnection(prevSegments, nextSegments) {
for (let i = 0; i < prevSegments.length; ++i) {
const prevSegment = prevSegments[i];
const nextSegment = nextSegments[i];
remove(prevSegment.nextSegments, nextSegment);
remove(prevSegment.allNextSegments, nextSegment);
remove(nextSegment.prevSegments, prevSegment);
remove(nextSegment.allPrevSegments, prevSegment);
}
}
function makeLooped(state, unflattenedFromSegments, unflattenedToSegments) {
const fromSegments = codePathSegment.flattenUnusedSegments(unflattenedFromSegments);
const toSegments = codePathSegment.flattenUnusedSegments(unflattenedToSegments);
const end = Math.min(fromSegments.length, toSegments.length);
for (let i = 0; i < end; ++i) {
const fromSegment = fromSegments[i];
const toSegment = toSegments[i];
if (toSegment.reachable) {
fromSegment.nextSegments.push(toSegment);
}
if (fromSegment.reachable) {
toSegment.prevSegments.push(fromSegment);
}
fromSegment.allNextSegments.push(toSegment);
toSegment.allPrevSegments.push(fromSegment);
if (toSegment.allPrevSegments.length >= 2) {
codePathSegment.markPrevSegmentAsLooped(toSegment, fromSegment);
}
state.notifyLooped(fromSegment, toSegment);
}
}
function finalizeTestSegmentsOfFor(context, choiceContext, head) {
if (!choiceContext.processed) {
choiceContext.trueForkContext.add(head);
choiceContext.falseForkContext.add(head);
choiceContext.qqForkContext.add(head);
}
if (context.test !== true) {
context.brokenForkContext.addAll(choiceContext.falseForkContext);
}
context.endOfTestSegments = choiceContext.trueForkContext.makeNext(0, -1);
}
class CodePathState {
constructor(idGenerator, onLooped) {
this.idGenerator = idGenerator;
this.notifyLooped = onLooped;
this.forkContext = forkContext.newRoot(idGenerator);
this.choiceContext = null;
this.switchContext = null;
this.tryContext = null;
this.loopContext = null;
this.breakContext = null;
this.chainContext = null;
this.currentSegments = [];
this.initialSegment = this.forkContext.head[0];
const final = this.finalSegments = [];
const returned = this.returnedForkContext = [];
const thrown = this.thrownForkContext = [];
returned.add = addToReturnedOrThrown.bind(null, returned, thrown, final);
thrown.add = addToReturnedOrThrown.bind(null, thrown, returned, final);
}
get headSegments() {
return this.forkContext.head;
}
get parentForkContext() {
const current = this.forkContext;
return current && current.upper;
}
pushForkContext(forkLeavingPath) {
this.forkContext = forkContext.newEmpty(this.forkContext, forkLeavingPath);
return this.forkContext;
}
popForkContext() {
const lastContext = this.forkContext;
this.forkContext = lastContext.upper;
this.forkContext.replaceHead(lastContext.makeNext(0, -1));
return lastContext;
}
forkPath() {
this.forkContext.add(this.parentForkContext.makeNext(-1, -1));
}
forkBypassPath() {
this.forkContext.add(this.parentForkContext.head);
}
pushChoiceContext(kind, isForkingAsResult) {
this.choiceContext = {
upper: this.choiceContext,
kind,
isForkingAsResult,
trueForkContext: forkContext.newEmpty(this.forkContext),
falseForkContext: forkContext.newEmpty(this.forkContext),
qqForkContext: forkContext.newEmpty(this.forkContext),
processed: false
};
}
popChoiceContext() {
const context = this.choiceContext;
this.choiceContext = context.upper;
const forkContext = this.forkContext;
const headSegments = forkContext.head;
switch (context.kind) {
case "&&":
case "||":
case "??":
if (!context.processed) {
context.trueForkContext.add(headSegments);
context.falseForkContext.add(headSegments);
context.qqForkContext.add(headSegments);
}
if (context.isForkingAsResult) {
const parentContext = this.choiceContext;
parentContext.trueForkContext.addAll(context.trueForkContext);
parentContext.falseForkContext.addAll(context.falseForkContext);
parentContext.qqForkContext.addAll(context.qqForkContext);
parentContext.processed = true;
return context;
}
break;
case "test":
if (!context.processed) {
context.trueForkContext.clear();
context.trueForkContext.add(headSegments);
} else {
context.falseForkContext.clear();
context.falseForkContext.add(headSegments);
}
break;
case "loop":
return context;
default:
throw new Error("unreachable");
}
const prevForkContext = context.trueForkContext;
prevForkContext.addAll(context.falseForkContext);
forkContext.replaceHead(prevForkContext.makeNext(0, -1));
return context;
}
makeLogicalRight() {
const context = this.choiceContext;
const forkContext = this.forkContext;
if (context.processed) {
let prevForkContext;
switch (context.kind) {
case "&&":
prevForkContext = context.trueForkContext;
break;
case "||":
prevForkContext = context.falseForkContext;
break;
case "??":
prevForkContext = context.qqForkContext;
break;
default:
throw new Error("unreachable");
}
forkContext.replaceHead(prevForkContext.makeNext(0, -1));
prevForkContext.clear();
context.processed = false;
} else {
switch (context.kind) {
case "&&":
context.falseForkContext.add(forkContext.head);
break;
case "||":
context.trueForkContext.add(forkContext.head);
break;
case "??":
context.trueForkContext.add(forkContext.head);
context.falseForkContext.add(forkContext.head);
break;
default:
throw new Error("unreachable");
}
forkContext.replaceHead(forkContext.makeNext(-1, -1));
}
}
makeIfConsequent() {
const context = this.choiceContext;
const forkContext = this.forkContext;
if (!context.processed) {
context.trueForkContext.add(forkContext.head);
context.falseForkContext.add(forkContext.head);
context.qqForkContext.add(forkContext.head);
}
context.processed = false;
forkContext.replaceHead(context.trueForkContext.makeNext(0, -1));
}
makeIfAlternate() {
const context = this.choiceContext;
const forkContext = this.forkContext;
context.trueForkContext.clear();
context.trueForkContext.add(forkContext.head);
context.processed = true;
forkContext.replaceHead(context.falseForkContext.makeNext(0, -1));
}
pushChainContext() {
this.chainContext = {
upper: this.chainContext,
countChoiceContexts: 0
};
}
popChainContext() {
const context = this.chainContext;
this.chainContext = context.upper;
for (let i = context.countChoiceContexts; i > 0; --i) {
this.popChoiceContext();
}
}
makeOptionalNode() {
if (this.chainContext) {
this.chainContext.countChoiceContexts += 1;
this.pushChoiceContext("??", false);
}
}
makeOptionalRight() {
if (this.chainContext) {
this.makeLogicalRight();
}
}
pushSwitchContext(hasCase, label) {
this.switchContext = {
upper: this.switchContext,
hasCase,
defaultSegments: null,
defaultBodySegments: null,
foundDefault: false,
lastIsDefault: false,
countForks: 0
};
this.pushBreakContext(true, label);
}
popSwitchContext() {
const context = this.switchContext;
this.switchContext = context.upper;
const forkContext = this.forkContext;
const brokenForkContext = this.popBreakContext().brokenForkContext;
if (context.countForks === 0) {
if (!brokenForkContext.empty) {
brokenForkContext.add(forkContext.makeNext(-1, -1));
forkContext.replaceHead(brokenForkContext.makeNext(0, -1));
}
return;
}
const lastSegments = forkContext.head;
this.forkBypassPath();
const lastCaseSegments = forkContext.head;
brokenForkContext.add(lastSegments);
if (!context.lastIsDefault) {
if (context.defaultBodySegments) {
removeConnection(context.defaultSegments, context.defaultBodySegments);
makeLooped(this, lastCaseSegments, context.defaultBodySegments);
} else {
brokenForkContext.add(lastCaseSegments);
}
}
for (let i = 0; i < context.countForks; ++i) {
this.forkContext = this.forkContext.upper;
}
this.forkContext.replaceHead(brokenForkContext.makeNext(0, -1));
}
makeSwitchCaseBody(isEmpty, isDefault) {
const context = this.switchContext;
if (!context.hasCase) {
return;
}
const parentForkContext = this.forkContext;
const forkContext = this.pushForkContext();
forkContext.add(parentForkContext.makeNext(0, -1));
if (isDefault) {
context.defaultSegments = parentForkContext.head;
if (isEmpty) {
context.foundDefault = true;
} else {
context.defaultBodySegments = forkContext.head;
}
} else {
if (!isEmpty && context.foundDefault) {
context.foundDefault = false;
context.defaultBodySegments = forkContext.head;
}
}
context.lastIsDefault = isDefault;
context.countForks += 1;
}
pushTryContext(hasFinalizer) {
this.tryContext = {
upper: this.tryContext,
position: "try",
hasFinalizer,
returnedForkContext: hasFinalizer ? forkContext.newEmpty(this.forkContext) : null,
thrownForkContext: forkContext.newEmpty(this.forkContext),
lastOfTryIsReachable: false,
lastOfCatchIsReachable: false
};
}
popTryContext() {
const context = this.tryContext;
this.tryContext = context.upper;
if (context.position === "catch") {
this.popForkContext();
return;
}
const returned = context.returnedForkContext;
const thrown = context.thrownForkContext;
if (returned.empty && thrown.empty) {
return;
}
const headSegments = this.forkContext.head;
this.forkContext = this.forkContext.upper;
const normalSegments = headSegments.slice(0, headSegments.length / 2 | 0);
const leavingSegments = headSegments.slice(headSegments.length / 2 | 0);
if (!returned.empty) {
getReturnContext(this).returnedForkContext.add(leavingSegments);
}
if (!thrown.empty) {
getThrowContext(this).thrownForkContext.add(leavingSegments);
}
this.forkContext.replaceHead(normalSegments);
if (!context.lastOfTryIsReachable && !context.lastOfCatchIsReachable) {
this.forkContext.makeUnreachable();
}
}
makeCatchBlock() {
const context = this.tryContext;
const forkContext$1 = this.forkContext;
const thrown = context.thrownForkContext;
context.position = "catch";
context.thrownForkContext = forkContext.newEmpty(forkContext$1);
context.lastOfTryIsReachable = forkContext$1.reachable;
thrown.add(forkContext$1.head);
const thrownSegments = thrown.makeNext(0, -1);
this.pushForkContext();
this.forkBypassPath();
this.forkContext.add(thrownSegments);
}
makeFinallyBlock() {
const context = this.tryContext;
let forkContext = this.forkContext;
const returned = context.returnedForkContext;
const thrown = context.thrownForkContext;
const headOfLeavingSegments = forkContext.head;
if (context.position === "catch") {
this.popForkContext();
forkContext = this.forkContext;
context.lastOfCatchIsReachable = forkContext.reachable;
} else {
context.lastOfTryIsReachable = forkContext.reachable;
}
context.position = "finally";
if (returned.empty && thrown.empty) {
return;
}
const segments = forkContext.makeNext(-1, -1);
for (let i = 0; i < forkContext.count; ++i) {
const prevSegsOfLeavingSegment = [headOfLeavingSegments[i]];
for (let j = 0; j < returned.segmentsList.length; ++j) {
prevSegsOfLeavingSegment.push(returned.segmentsList[j][i]);
}
for (let j = 0; j < thrown.segmentsList.length; ++j) {
prevSegsOfLeavingSegment.push(thrown.segmentsList[j][i]);
}
segments.push(codePathSegment.newNext(this.idGenerator.next(), prevSegsOfLeavingSegment));
}
this.pushForkContext(true);
this.forkContext.add(segments);
}
makeFirstThrowablePathInTryBlock() {
const forkContext = this.forkContext;
if (!forkContext.reachable) {
return;
}
const context = getThrowContext(this);
if (context === this || context.position !== "try" || !context.thrownForkContext.empty) {
return;
}
context.thrownForkContext.add(forkContext.head);
forkContext.replaceHead(forkContext.makeNext(-1, -1));
}
pushLoopContext(type, label) {
const forkContext$1 = this.forkContext;
const breakContext = this.pushBreakContext(true, label);
switch (type) {
case "WhileStatement":
this.pushChoiceContext("loop", false);
this.loopContext = {
upper: this.loopContext,
type,
label,
test: void 0,
continueDestSegments: null,
brokenForkContext: breakContext.brokenForkContext
};
break;
case "DoWhileStatement":
this.pushChoiceContext("loop", false);
this.loopContext = {
upper: this.loopContext,
type,
label,
test: void 0,
entrySegments: null,
continueForkContext: forkContext.newEmpty(forkContext$1),
brokenForkContext: breakContext.brokenForkContext
};
break;
case "ForStatement":
this.pushChoiceContext("loop", false);
this.loopContext = {
upper: this.loopContext,
type,
label,
test: void 0,
endOfInitSegments: null,
testSegments: null,
endOfTestSegments: null,
updateSegments: null,
endOfUpdateSegments: null,
continueDestSegments: null,
brokenForkContext: breakContext.brokenForkContext
};
break;
case "ForInStatement":
case "ForOfStatement":
this.loopContext = {
upper: this.loopContext,
type,
label,
prevSegments: null,
leftSegments: null,
endOfLeftSegments: null,
continueDestSegments: null,
brokenForkContext: breakContext.brokenForkContext
};
break;
default:
throw new Error(`unknown type: "${type}"`);
}
}
popLoopContext() {
const context = this.loopContext;
this.loopContext = context.upper;
const forkContext = this.forkContext;
const brokenForkContext = this.popBreakContext().brokenForkContext;
switch (context.type) {
case "WhileStatement":
case "ForStatement":
this.popChoiceContext();
makeLooped(this, forkContext.head, context.continueDestSegments);
break;
case "DoWhileStatement":
{
const choiceContext = this.popChoiceContext();
if (!choiceContext.processed) {
choiceContext.trueForkContext.add(forkContext.head);
choiceContext.falseForkContext.add(forkContext.head);
}
if (context.test !== true) {
brokenForkContext.addAll(choiceContext.falseForkContext);
}
const segmentsList = choiceContext.trueForkContext.segmentsList;
for (let i = 0; i < segmentsList.length; ++i) {
makeLooped(this, segmentsList[i], context.entrySegments);
}
break;
}
case "ForInStatement":
case "ForOfStatement":
brokenForkContext.add(forkContext.head);
makeLooped(this, forkContext.head, context.leftSegments);
break;
default:
throw new Error("unreachable");
}
if (brokenForkContext.empty) {
forkContext.replaceHead(forkContext.makeUnreachable(-1, -1));
} else {
forkContext.replaceHead(brokenForkContext.makeNext(0, -1));
}
}
makeWhileTest(test) {
const context = this.loopContext;
const forkContext = this.forkContext;
const testSegments = forkContext.makeNext(0, -1);
context.test = test;
context.continueDestSegments = testSegments;
forkContext.replaceHead(testSegments);
}
makeWhileBody() {
const context = this.loopContext;
const choiceContext = this.choiceContext;
const forkContext = this.forkContext;
if (!choiceContext.processed) {
choiceContext.trueForkContext.add(forkContext.head);
choiceContext.falseForkContext.add(forkContext.head);
}
if (context.test !== true) {
context.brokenForkContext.addAll(choiceContext.falseForkContext);
}
forkContext.replaceHead(choiceContext.trueForkContext.makeNext(0, -1));
}
makeDoWhileBody() {
const context = this.loopContext;
const forkContext = this.forkContext;
const bodySegments = forkContext.makeNext(-1, -1);
context.entrySegments = bodySegments;
forkContext.replaceHead(bodySegments);
}
makeDoWhileTest(test) {
const context = this.loopContext;
const forkContext = this.forkContext;
context.test = test;
if (!context.continueForkContext.empty) {
context.continueForkContext.add(forkContext.head);
const testSegments = context.continueForkContext.makeNext(0, -1);
forkContext.replaceHead(testSegments);
}
}
makeForTest(test) {
const context = this.loopContext;
const forkContext = this.forkContext;
const endOfInitSegments = forkContext.head;
const testSegments = forkContext.makeNext(-1, -1);
context.test = test;
context.endOfInitSegments = endOfInitSegments;
context.continueDestSegments = context.testSegments = testSegments;
forkContext.replaceHead(testSegments);
}
makeForUpdate() {
const context = this.loopContext;
const choiceContext = this.choiceContext;
const forkContext = this.forkContext;
if (context.testSegments) {
finalizeTestSegmentsOfFor(context, choiceContext, forkContext.head);
} else {
context.endOfInitSegments = forkContext.head;
}
const updateSegments = forkContext.makeDisconnected(-1, -1);
context.continueDestSegments = context.updateSegments = updateSegments;
forkContext.replaceHead(updateSegments);
}
makeForBody() {
const context = this.loopContext;
const choiceContext = this.choiceContext;
const forkContext$1 = this.forkContext;
if (context.updateSegments) {
context.endOfUpdateSegments = forkContext$1.head;
if (context.testSegments) {
makeLooped(this, context.endOfUpdateSegments, context.testSegments);
}
} else if (context.testSegments) {
finalizeTestSegmentsOfFor(context, choiceContext, forkContext$1.head);
} else {
context.endOfInitSegments = forkContext$1.head;
}
let bodySegments = context.endOfTestSegments;
if (!bodySegments) {
const prevForkContext = forkContext.newEmpty(forkContext$1);
prevForkContext.add(context.endOfInitSegments);
if (context.endOfUpdateSegments) {
prevForkContext.add(context.endOfUpdateSegments);
}
bodySegments = prevForkContext.makeNext(0, -1);
}
context.continueDestSegments = context.continueDestSegments || bodySegments;
forkContext$1.replaceHead(bodySegments);
}
makeForInOfLeft() {
const context = this.loopContext;
const forkContext = this.forkContext;
const leftSegments = forkContext.makeDisconnected(-1, -1);
context.prevSegments = forkContext.head;
context.leftSegments = context.continueDestSegments = leftSegments;
forkContext.replaceHead(leftSegments);
}
makeForInOfRight() {
const context = this.loopContext;
const forkContext$1 = this.forkContext;
const temp = forkContext.newEmpty(forkContext$1);
temp.add(context.prevSegments);
const rightSegments = temp.makeNext(-1, -1);
context.endOfLeftSegments = forkContext$1.head;
forkContext$1.replaceHead(rightSegments);
}
makeForInOfBody() {
const context = this.loopContext;
const forkContext$1 = this.forkContext;
const temp = forkContext.newEmpty(forkContext$1);
temp.add(context.endOfLeftSegments);
const bodySegments = temp.makeNext(-1, -1);
makeLooped(this, forkContext$1.head, context.leftSegments);
context.brokenForkContext.add(forkContext$1.head);
forkContext$1.replaceHead(bodySegments);
}
pushBreakContext(breakable, label) {
this.breakContext = {
upper: this.breakContext,
breakable,
label,
brokenForkContext: forkContext.newEmpty(this.forkContext)
};
return this.breakContext;
}
popBreakContext() {
const context = this.breakContext;
const forkContext = this.forkContext;
this.breakContext = context.upper;
if (!context.breakable) {
const brokenForkContext = context.brokenForkContext;
if (!brokenForkContext.empty) {
brokenForkContext.add(forkContext.head);
forkContext.replaceHead(brokenForkContext.makeNext(0, -1));
}
}
return context;
}
makeBreak(label) {
const forkContext = this.forkContext;
if (!forkContext.reachable) {
return;
}
const context = getBreakContext(this, label);
if (context) {
context.brokenForkContext.add(forkContext.head);
}
forkContext.replaceHead(forkContext.makeUnreachable(-1, -1));
}
makeContinue(label) {
const forkContext = this.forkContext;
if (!forkContext.reachable) {
return;
}
const context = getContinueContext(this, label);
if (context) {
if (context.continueDestSegments) {
makeLooped(this, forkContext.head, context.continueDestSegments);
if (context.type === "ForInStatement" || context.type === "ForOfStatement") {
context.brokenForkContext.add(forkContext.head);
}
} else {
context.continueForkContext.add(forkContext.head);
}
}
forkContext.replaceHead(forkContext.makeUnreachable(-1, -1));
}
makeReturn() {
const forkContext = this.forkContext;
if (forkContext.reachable) {
getReturnContext(this).returnedForkContext.add(forkContext.head);
forkContext.replaceHead(forkContext.makeUnreachable(-1, -1));
}
}
makeThrow() {
const forkContext = this.forkContext;
if (forkContext.reachable) {
getThrowContext(this).thrownForkContext.add(forkContext.head);
forkContext.replaceHead(forkContext.makeUnreachable(-1, -1));
}
}
makeFinal() {
const segments = this.currentSegments;
if (segments.length > 0 && segments[0].reachable) {
this.returnedForkContext.add(segments);
}
}
}
var codePathState = CodePathState;
class IdGenerator {
constructor(prefix) {
this.prefix = String(prefix);
this.n = 0;
}
next() {
this.n = 1 + this.n | 0;
if (this.n < 0) {
this.n = 1;
}
return this.prefix + this.n;
}
}
var idGenerator = IdGenerator;
class CodePath {
constructor(id, upper, onLooped) {
this.id = id;
this.upper = upper;
this.childCodePaths = [];
Object.defineProperty(this, "internal", {
value: new codePathState(new idGenerator(`${id}_`), onLooped)
});
if (upper) {
upper.childCodePaths.push(this);
}
}
static getState(codePath) {
return codePath.internal;
}
get initialSegment() {
return this.internal.initialSegment;
}
get finalSegments() {
return this.internal.finalSegments;
}
get returnedSegments() {
return this.internal.returnedForkContext;
}
get thrownSegments() {
return this.internal.thrownForkContext;
}
get currentSegments() {
return this.internal.currentSegments;
}
traverseSegments(options, callback) {
let resolvedOptions;
let resolvedCallback;
if (typeof options === "function") {
resolvedCallback = options;
resolvedOptions = {};
} else {
resolvedOptions = options || {};
resolvedCallback = callback;
}
const startSegment = resolvedOptions.first || this.internal.initialSegment;
const lastSegment = resolvedOptions.last;
let item = null;
let index = 0;
let end = 0;
let segment = null;
const visited = Object.create(null);
const stack = [[startSegment, 0]];
let skippedSegment = null;
let broken = false;
const controller = {
skip() {
if (stack.length <= 1) {
broken = true;
} else {
skippedSegment = stack[stack.length - 2][0];
}
},
break() {
broken = true;
}
};
function isVisited(prevSegment) {
return visited[prevSegment.id] || segment.isLoopedPrevSegment(prevSegment);
}
while (stack.length > 0) {
item = stack[stack.length - 1];
segment = item[0];
index = item[1];
if (index === 0) {
if (visited[segment.id]) {
stack.pop();
continue;
}
if (segment !== startSegment && segment.prevSegments.length > 0 && !segment.prevSegments.every(isVisited)) {
stack.pop();
continue;
}
if (skippedSegment && segment.prevSegments.indexOf(skippedSegment) !== -1) {
skippedSegment = null;
}
visited[segment.id] = true;
if (!skippedSegment) {
resolvedCallback.call(this, segment, controller);
if (segment === lastSegment) {
controller.skip();
}
if (broken) {
break;
}
}
}
end = segment.nextSegments.length - 1;
if (index < end) {
item[1] += 1;
stack.push([segment.nextSegments[index], 0]);
} else if (index === end) {
item[0] = segment.nextSegments[index];
item[1] = 0;
} else {
stack.pop();
}
}
}
}
var codePath = CodePath;
const {
breakableTypePattern
} = _commonjsHelpers.astUtils;
function isCaseNode(node) {
return Boolean(node.test);
}
function isHandledLogicalOperator(operator) {
return operator === "&&" || operator === "||" || operator === "??";
}
function isLogicalAssignmentOperator(operator) {
return operator === "&&=" || operator === "||=" || operator === "??=";
}
function getLabel(node) {
if (node.parent.type === "LabeledStatement") {
return node.parent.label.name;
}
return null;
}
function isForkingByTrueOrFalse(node) {
const parent = node.parent;
switch (parent.type) {
case "ConditionalExpression":
case "IfStatement":
case "WhileStatement":
case "DoWhileStatement":
case "ForStatement":
return parent.test === node;
case "LogicalExpression":
return isHandledLogicalOperator(parent.operator);
case "AssignmentExpression":
return isLogicalAssignmentOperator(parent.operator);
default:
return false;
}
}
function getBooleanValueIfSimpleConstant(node) {
if (node.type === "Literal") {
return Boolean(node.value);
}
return void 0;
}
function isIdentifierReference(node) {
const parent = node.parent;
switch (parent.type) {
case "LabeledStatement":
case "BreakStatement":
case "ContinueStatement":
case "ArrayPattern":
case "RestElement":
case "ImportSpecifier":
case "ImportDefaultSpecifier":
case "ImportNamespaceSpecifier":
case "CatchClause":
return false;
case "FunctionDeclaration":
case "FunctionExpression":
case "ArrowFunctionExpression":
case "ClassDeclaration":
case "ClassExpression":
case "VariableDeclarator":
return parent.id !== node;
case "Property":
case "MethodDefinition":
return parent.key !== node || parent.computed || parent.shorthand;
case "AssignmentPattern":
return parent.key !== node;
default:
return true;
}
}
function forwardCurrentToHead(analyzer, node) {
const codePath$1 = analyzer.codePath;
const state = codePath.getState(codePath$1);
const currentSegments = state.currentSegments;
const headSegments = state.headSegments;
const end = Math.max(currentSegments.length, headSegments.length);
let i, currentSegment, headSegment;
for (i = 0; i < end; ++i) {
currentSegment = currentSegments[i];
headSegment = headSegments[i];
if (currentSegment !== headSegment && currentSegment) {
debugHelpers.dump(`onCodePathSegmentEnd ${currentSegment.id}`);
if (currentSegment.reachable) {
analyzer.emitter.emit("onCodePathSegmentEnd", currentSegment, node);
}
}
}
state.currentSegments = headSegments;
for (i = 0; i < end; ++i) {
currentSegment = currentSegments[i];
headSegment = headSegments[i];
if (currentSegment !== headSegment && headSegment) {
debugHelpers.dump(`onCodePathSegmentStart ${headSegment.id}`);
codePathSegment.markUsed(headSegment);
if (headSegment.reachable) {
analyzer.emitter.emit("onCodePathSegmentStart", headSegment, node);
}
}
}
}
function leaveFromCurrentSegment(analyzer, node) {
const state = codePath.getState(analyzer.codePath);
const currentSegments = state.currentSegments;
for (let i = 0; i < currentSegments.length; ++i) {
const currentSegment = currentSegments[i];
debugHelpers.dump(`onCodePathSegmentEnd ${currentSegment.id}`);
if (currentSegment.reachable) {
analyzer.emitter.emit("onCodePathSegmentEnd", currentSegment, node);
}
}
state.currentSegments = [];
}
function preprocess(analyzer, node) {
const codePath$1 = analyzer.codePath;
const state = codePath.getState(codePath$1);
const parent = node.parent;
switch (parent.type) {
case "CallExpression":
if (parent.optional === true && parent.arguments.length >= 1 && parent.arguments[0] === node) {
state.makeOptionalRight();
}
break;
case "MemberExpression":
if (parent.optional === true && parent.property === node) {
state.makeOptionalRight();
}
break;
case "LogicalExpression":
if (parent.right === node && isHandledLogicalOperator(parent.operator)) {
state.makeLogicalRight();
}
break;
case "AssignmentExpression":
if (parent.right === node && isLogicalAssignmentOperator(parent.operator)) {
state.makeLogicalRight();
}
break;
case "ConditionalExpression":
case "IfStatement":
if (parent.consequent === node) {
state.makeIfConsequent();
} else if (parent.alternate === node) {
state.makeIfAlternate();
}
break;
case "SwitchCase":
if (parent.consequent[0] === node) {
state.makeSwitchCaseBody(false, !parent.test);
}
break;
case "TryStatement":
if (parent.handler === node) {
state.makeCatchBlock();
} else if (parent.finalizer === node) {
state.makeFinallyBlock();
}
break;
case "WhileStatement":
if (parent.test === node) {
state.makeWhileTest(getBooleanValueIfSimpleConstant(node));
} else {
assert__default["default"](parent.body === node);
state.makeWhileBody();
}
break;
case "DoWhileStatement":
if (parent.body === node) {
state.makeDoWhileBody();
} else {
assert__default["default"](parent.test === node);
state.makeDoWhileTest(getBooleanValueIfSimpleConstant(node));
}
break;
case "ForStatement":
if (parent.test === node) {
state.makeForTest(getBooleanValueIfSimpleConstant(node));
} else if (parent.update === node) {
state.makeForUpdate();
} else if (parent.body === node) {
state.makeForBody();
}
break;
case "ForInStatement":
case "ForOfStatement":
if (parent.left === node) {
state.makeForInOfLeft();
} else if (parent.right === node) {
state.makeForInOfRight();
} else {
assert__default["default"](parent.body === node);
state.makeForInOfBody();
}
break;
case "AssignmentPattern":
if (parent.right === node) {
state.pushForkContext();
state.forkBypassPath();
state.forkPath();
}
break;
}
}
function processCodePathToEnter(analyzer, node) {
let codePath$1 = analyzer.codePath;
let state = codePath$1 && codePath.getState(codePath$1);
const parent = node.parent;
switch (node.type) {
case "Program":
case "FunctionDeclaration":
case "FunctionExpression":
case "ArrowFunctionExpression":
if (codePath$1) {
forwardCurrentToHead(analyzer, node);
debugHelpers.dumpState(node, state, false);
}
codePath$1 = analyzer.codePath = new codePath(analyzer.idGenerator.next(), codePath$1, analyzer.onLooped);
state = codePath.getState(codePath$1);
debugHelpers.dump(`onCodePathStart ${codePath$1.id}`);
analyzer.emitter.emit("onCodePathStart", codePath$1, node);
break;
case "ChainExpression":
state.pushChainContext();
break;
case "CallExpression":
if (node.optional === true) {
state.makeOptionalNode();
}
break;
case "MemberExpression":
if (node.optional === true) {
state.makeOptionalNode();
}
break;
case "LogicalExpression":
if (isHandledLogicalOperator(node.operator)) {
state.pushChoiceContext(node.operator, isForkingByTrueOrFalse(node));
}
break;
case "AssignmentExpression":
if (isLogicalAssignmentOperator(node.operator)) {
state.pushChoiceContext(node.operator.slice(0, -1), isForkingByTrueOrFalse(node));
}
break;
case "ConditionalExpression":
case "IfStatement":
state.pushChoiceContext("test", false);
break;
case "SwitchStatement":
state.pushSwitchContext(node.cases.some(isCaseNode), getLabel(node));
break;
case "TryStatement":
state.pushTryContext(Boolean(node.finalizer));
break;
case "SwitchCase":
if (parent.discriminant !== node && parent.cases[0] !== node) {
state.forkPath();
}
break;
case "WhileStatement":
case "DoWhileStatement":
case "ForStatement":
case "ForInStatement":
case "ForOfStatement":
state.pushLoopContext(node.type, getLabel(node));
break;
case "LabeledStatement":
if (!breakableTypePattern.test(node.body.type)) {
state.pushBreakContext(false, node.label.name);
}
break;
}
forwardCurrentToHead(analyzer, node);
debugHelpers.dumpState(node, state, false);
}
function processCodePathToExit(analyzer, node) {
const codePath$1 = analyzer.codePath;
const state = codePath.getState(codePath$1);
let dontForward = false;
switch (node.type) {
case "ChainExpression":
state.popChainContext();
break;
case "IfStatement":
case "ConditionalExpression":
state.popChoiceContext();
break;
case "LogicalExpression":
if (isHandledLogicalOperator(node.operator)) {
state.popChoiceContext();
}
break;
case "AssignmentExpression":
if (isLogicalAssignmentOperator(node.operator)) {
state.popChoiceContext();
}
break;
case "SwitchStatement":
state.popSwitchContext();
break;
case "SwitchCase":
if (node.consequent.length === 0) {
state.makeSwitchCaseBody(true, !node.test);
}
if (state.forkContext.reachable) {
dontForward = true;
}
break;
case "TryStatement":
state.popTryContext();
break;
case "BreakStatement":
forwardCurrentToHead(analyzer, node);
state.makeBreak(node.label && node.label.name);
dontForward = true;
break;
case "ContinueStatement":
forwardCurrentToHead(analyzer, node);
state.makeContinue(node.label && node.label.name);
dontForward = true;
break;
case "ReturnStatement":
forwardCurrentToHead(analyzer, node);
state.makeReturn();
dontForward = true;
break;
case "ThrowStatement":
forwardCurrentToHead(analyzer, node);
state.makeThrow();
dontForward = true;
break;
case "Identifier":
if (isIdentifierReference(node)) {
state.makeFirstThrowablePathInTryBlock();
dontForward = true;
}
break;
case "CallExpression":
case "ImportExpression":
case "MemberExpression":
case "NewExpression":
case "YieldExpression":
state.makeFirstThrowablePathInTryBlock();
break;
case "WhileStatement":
case "DoWhileStatement":
case "ForStatement":
case "ForInStatement":
case "ForOfStatement":
state.popLoopContext();
break;
case "AssignmentPattern":
state.popForkContext();
break;
case "LabeledStatement":
if (!breakableTypePattern.test(node.body.type)) {
state.popBreakContext();
}
break;
}
if (!dontForward) {
forwardCurrentToHead(analyzer, node);
}
debugHelpers.dumpState(node, state, true);
}
function postprocess(analyzer, node) {
switch (node.type) {
case "Program":
case "FunctionDeclaration":
case "FunctionExpression":
case "ArrowFunctionExpression":
{
let codePath$1 = analyzer.codePath;
codePath.getState(codePath$1).makeFinal();
leaveFromCurrentSegment(analyzer, node);
debugHelpers.dump(`onCodePathEnd ${codePath$1.id}`);
analyzer.emitter.emit("onCodePathEnd", codePath$1, node);
debugHelpers.dumpDot(codePath$1);
codePath$1 = analyzer.codePath = analyzer.codePath.upper;
if (codePath$1) {
debugHelpers.dumpState(node, codePath.getState(codePath$1), true);
}
break;
}
case "CallExpression":
if (node.optional === true && node.arguments.length === 0) {
codePath.getState(analyzer.codePath).makeOptionalRight();
}
break;
}
}
class CodePathAnalyzer {
constructor(eventGenerator) {
this.original = eventGenerator;
this.emitter = eventGenerator.emitter;
this.codePath = null;
this.idGenerator = new idGenerator("s");
this.currentNode = null;
this.onLooped = this.onLooped.bind(this);
}
enterNode(node) {
this.currentNode = node;
if (node.parent) {
preprocess(this, node);
}
processCodePathToEnter(this, node);
this.original.enterNode(node);
this.currentNode = null;
}
leaveNode(node) {
this.currentNode = node;
processCodePathToExit(this, node);
this.original.leaveNode(node);
postprocess(this, node);
this.currentNode = null;
}
onLooped(fromSegment, toSegment) {
if (fromSegment.reachable && toSegment.reachable) {
debugHelpers.dump(`onCodePathSegmentLoop ${fromSegment.id} -> ${toSegment.id}`);
this.emitter.emit("onCodePathSegmentLoop", fromSegment, toSegment, this.currentNode);
}
}
}
var codePathAnalyzer = CodePathAnalyzer;
function compareLocations(itemA, itemB) {
return itemA.line - itemB.line || itemA.column - itemB.column;
}
function applyDirectives(options) {
const problems = [];
let nextDirectiveIndex = 0;
let currentGlobalDisableDirective = null;
const disabledRuleMap = new Map();
const enabledRules = new Set();
const usedDisableDirectives = new Set();
for (const problem of options.problems) {
while (nextDirectiveIndex < options.directives.length && compareLocations(options.directives[nextDirectiveIndex], problem) <= 0) {
const directive = options.directives[nextDirectiveIndex++];
switch (directive.type) {
case "disable":
if (directive.ruleId === null) {
currentGlobalDisableDirective = directive;
disabledRuleMap.clear();
enabledRules.clear();
} else if (currentGlobalDisableDirective) {
enabledRules.delete(directive.ruleId);
disabledRuleMap.set(directive.ruleId, directive);
} else {
disabledRuleMap.set(directive.ruleId, directive);
}
break;
case "enable":
if (directive.ruleId === null) {
currentGlobalDisableDirective = null;
disabledRuleMap.clear();
} else if (currentGlobalDisableDirective) {
enabledRules.add(directive.ruleId);
disabledRuleMap.delete(directive.ruleId);
} else {
disabledRuleMap.delete(directive.ruleId);
}
break;
}
}
if (disabledRuleMap.has(problem.ruleId)) {
usedDisableDirectives.add(disabledRuleMap.get(problem.ruleId));
} else if (currentGlobalDisableDirective && !enabledRules.has(problem.ruleId)) {
usedDisableDirectives.add(currentGlobalDisableDirective);
} else {
problems.push(problem);
}
}
const unusedDisableDirectives = options.directives.filter(directive => directive.type === "disable" && !usedDisableDirectives.has(directive)).map(directive => ({
ruleId: null,
message: directive.ruleId ? `Unused eslint-disable directive (no problems were reported from '${directive.ruleId}').` : "Unused eslint-disable directive (no problems were reported).",
line: directive.unprocessedDirective.line,
column: directive.unprocessedDirective.column,
severity: options.reportUnusedDisableDirectives === "warn" ? 1 : 2,
nodeType: null
}));
return {
problems,
unusedDisableDirectives
};
}
var applyDisableDirectives = ({
directives,
problems,
reportUnusedDisableDirectives = "off"
}) => {
const blockDirectives = directives.filter(directive => directive.type === "disable" || directive.type === "enable").map(directive => Object.assign({}, directive, {
unprocessedDirective: directive
})).sort(compareLocations);
const lineDirectives = function (array, fn) {
const mapped = array.map(fn);
const flattened = [].concat(...mapped);
return flattened;
}(directives, directive => {
switch (directive.type) {
case "disable":
case "enable":
return [];
case "disable-line":
return [{
type: "disable",
line: directive.line,
column: 1,
ruleId: directive.ruleId,
unprocessedDirective: directive
}, {
type: "enable",
line: directive.line + 1,
column: 0,
ruleId: directive.ruleId,
unprocessedDirective: directive
}];
case "disable-next-line":
return [{
type: "disable",
line: directive.line + 1,
column: 1,
ruleId: directive.ruleId,
unprocessedDirective: directive
}, {
type: "enable",
line: directive.line + 2,
column: 0,
ruleId: directive.ruleId,
unprocessedDirective: directive
}];
default:
throw new TypeError(`Unrecognized directive type '${directive.type}'`);
}
}).sort(compareLocations);
const blockDirectivesResult = applyDirectives({
problems,
directives: blockDirectives,
reportUnusedDisableDirectives
});
const lineDirectivesResult = applyDirectives({
problems: blockDirectivesResult.problems,
directives: lineDirectives,
reportUnusedDisableDirectives
});
return reportUnusedDisableDirectives !== "off" ? lineDirectivesResult.problems.concat(blockDirectivesResult.unusedDisableDirectives).concat(lineDirectivesResult.unusedDisableDirectives).sort(compareLocations) : lineDirectivesResult.problems;
};
const debug$2 = debug__default["default"]("eslint:config-comment-parser");
var configCommentParser = class {
parseStringConfig(string, comment) {
debug$2("Parsing String config");
const items = {};
const trimmedString = string.replace(/\s*([:,])\s*/gu, "$1");
trimmedString.split(/\s|,+/u).forEach(name => {
if (!name) {
return;
}
const [key, value = null] = name.split(":");
items[key] = {
value,
comment
};
});
return items;
}
parseJsonConfig(string, location) {
debug$2("Parsing JSON config");
let items = {};
try {
items = levn__default["default"].parse("Object", string) || {};
if (configOps__default["default"].isEverySeverityValid(items)) {
return {
success: true,
config: items
};
}
} catch {
debug$2("Levn parsing failed; falling back to manual parsing.");
}
items = {};
const normalizedString = string.replace(/([-a-zA-Z0-9/]+):/gu, "\"$1\":").replace(/(\]|[0-9])\s+(?=")/u, "$1,");
try {
items = JSON.parse(`{${normalizedString}}`);
} catch (ex) {
debug$2("Manual parsing failed.");
return {
success: false,
error: {
ruleId: null,
fatal: true,
severity: 2,
message: `Failed to parse JSON from '${normalizedString}': ${ex.message}`,
line: location.start.line,
column: location.start.column + 1
}
};
}
return {
success: true,
config: items
};
}
parseListConfig(string) {
debug$2("Parsing list config");
const items = {};
string.replace(/\s*,\s*/gu, ",").split(/,+/u).forEach(name => {
const trimmedName = name.trim();
if (trimmedName) {
items[trimmedName] = true;
}
});
return items;
}
};
function union(...arrays) {
return [...new Set([].concat(...arrays))];
}
function intersection(...arrays) {
if (arrays.length === 0) {
return [];
}
let result = [...new Set(arrays[0])];
for (const array of arrays.slice(1)) {
result = result.filter(x => array.includes(x));
}
return result;
}
function getPossibleTypes(parsedSelector) {
switch (parsedSelector.type) {
case "identifier":
return [parsedSelector.value];
case "matches":
{
const typesForComponents = parsedSelector.selectors.map(getPossibleTypes);
if (typesForComponents.every(Boolean)) {
return union(...typesForComponents);
}
return null;
}
case "compound":
{
const typesForComponents = parsedSelector.selectors.map(getPossibleTypes).filter(typesForComponent => typesForComponent);
if (!typesForComponents.length) {
return null;
}
return intersection(...typesForComponents);
}
case "child":
case "descendant":
case "sibling":
case "adjacent":
return getPossibleTypes(parsedSelector.right);
default:
return null;
}
}
function countClassAttributes(parsedSelector) {
switch (parsedSelector.type) {
case "child":
case "descendant":
case "sibling":
case "adjacent":
return countClassAttributes(parsedSelector.left) + countClassAttributes(parsedSelector.right);
case "compound":
case "not":
case "matches":
return parsedSelector.selectors.reduce((sum, childSelector) => sum + countClassAttributes(childSelector), 0);
case "attribute":
case "field":
case "nth-child":
case "nth-last-child":
return 1;
default:
return 0;
}
}
function countIdentifiers(parsedSelector) {
switch (parsedSelector.type) {
case "child":
case "descendant":
case "sibling":
case "adjacent":
return countIdentifiers(parsedSelector.left) + countIdentifiers(parsedSelector.right);
case "compound":
case "not":
case "matches":
return parsedSelector.selectors.reduce((sum, childSelector) => sum + countIdentifiers(childSelector), 0);
case "identifier":
return 1;
default:
return 0;
}
}
function compareSpecificity(selectorA, selectorB) {
return selectorA.attributeCount - selectorB.attributeCount || selectorA.identifierCount - selectorB.identifierCount || (selectorA.rawSelector <= selectorB.rawSelector ? -1 : 1);
}
function tryParseSelector(rawSelector) {
try {
return esquery__default["default"].parse(rawSelector.replace(/:exit$/u, ""));
} catch (err) {
if (err.location && err.location.start && typeof err.location.start.offset === "number") {
throw new SyntaxError(`Syntax error in selector "${rawSelector}" at position ${err.location.start.offset}: ${err.message}`);
}
throw err;
}
}
const selectorCache = new Map();
function parseSelector(rawSelector) {
if (selectorCache.has(rawSelector)) {
return selectorCache.get(rawSelector);
}
const parsedSelector = tryParseSelector(rawSelector);
const result = {
rawSelector,
isExit: rawSelector.endsWith(":exit"),
parsedSelector,
listenerTypes: getPossibleTypes(parsedSelector),
attributeCount: countClassAttributes(parsedSelector),
identifierCount: countIdentifiers(parsedSelector)
};
selectorCache.set(rawSelector, result);
return result;
}
class NodeEventGenerator {
constructor(emitter, esqueryOptions) {
this.emitter = emitter;
this.esqueryOptions = esqueryOptions;
this.currentAncestry = [];
this.enterSelectorsByNodeType = new Map();
this.exitSelectorsByNodeType = new Map();
this.anyTypeEnterSelectors = [];
this.anyTypeExitSelectors = [];
emitter.eventNames().forEach(rawSelector => {
const selector = parseSelector(rawSelector);
if (selector.listenerTypes) {
const typeMap = selector.isExit ? this.exitSelectorsByNodeType : this.enterSelectorsByNodeType;
selector.listenerTypes.forEach(nodeType => {
if (!typeMap.has(nodeType)) {
typeMap.set(nodeType, []);
}
typeMap.get(nodeType).push(selector);
});
return;
}
const selectors = selector.isExit ? this.anyTypeExitSelectors : this.anyTypeEnterSelectors;
selectors.push(selector);
});
this.anyTypeEnterSelectors.sort(compareSpecificity);
this.anyTypeExitSelectors.sort(compareSpecificity);
this.enterSelectorsByNodeType.forEach(selectorList => selectorList.sort(compareSpecificity));
this.exitSelectorsByNodeType.forEach(selectorList => selectorList.sort(compareSpecificity));
}
applySelector(node, selector) {
if (esquery__default["default"].matches(node, selector.parsedSelector, this.currentAncestry, this.esqueryOptions)) {
this.emitter.emit(selector.rawSelector, node);
}
}
applySelectors(node, isExit) {
const selectorsByNodeType = (isExit ? this.exitSelectorsByNodeType : this.enterSelectorsByNodeType).get(node.type) || [];
const anyTypeSelectors = isExit ? this.anyTypeExitSelectors : this.anyTypeEnterSelectors;
let selectorsByTypeIndex = 0;
let anyTypeSelectorsIndex = 0;
while (selectorsByTypeIndex < selectorsByNodeType.length || anyTypeSelectorsIndex < anyTypeSelectors.length) {
if (selectorsByTypeIndex >= selectorsByNodeType.length || anyTypeSelectorsIndex < anyTypeSelectors.length && compareSpecificity(anyTypeSelectors[anyTypeSelectorsIndex], selectorsByNodeType[selectorsByTypeIndex]) < 0) {
this.applySelector(node, anyTypeSelectors[anyTypeSelectorsIndex++]);
} else {
this.applySelector(node, selectorsByNodeType[selectorsByTypeIndex++]);
}
}
}
enterNode(node) {
if (node.parent) {
this.currentAncestry.unshift(node.parent);
}
this.applySelectors(node, false);
}
leaveNode(node) {
this.applySelectors(node, true);
this.currentAncestry.shift();
}
}
var nodeEventGenerator = NodeEventGenerator;
function insertTextAt(index, text) {
return {
range: [index, index],
text
};
}
const ruleFixer = Object.freeze({
insertTextAfter(nodeOrToken, text) {
return this.insertTextAfterRange(nodeOrToken.range, text);
},
insertTextAfterRange(range, text) {
return insertTextAt(range[1], text);
},
insertTextBefore(nodeOrToken, text) {
return this.insertTextBeforeRange(nodeOrToken.range, text);
},
insertTextBeforeRange(range, text) {
return insertTextAt(range[0], text);
},
replaceText(nodeOrToken, text) {
return this.replaceTextRange(nodeOrToken.range, text);
},
replaceTextRange(range, text) {
return {
range,
text
};
},
remove(nodeOrToken) {
return this.removeRange(nodeOrToken.range);
},
removeRange(range) {
return {
range,
text: ""
};
}
});
var ruleFixer_1 = ruleFixer;
var interpolate = (text, data) => {
if (!data) {
return text;
}
return text.replace(/\{\{([^{}]+?)\}\}/gu, (fullMatch, termWithWhitespace) => {
const term = termWithWhitespace.trim();
if (term in data) {
return data[term];
}
return fullMatch;
});
};
function normalizeMultiArgReportCall(...args) {
if (args.length === 1) {
return Object.assign({}, args[0]);
}
if (typeof args[1] === "string") {
return {
node: args[0],
message: args[1],
data: args[2],
fix: args[3]
};
}
return {
node: args[0],
loc: args[1],
message: args[2],
data: args[3],
fix: args[4]
};
}
function assertValidNodeInfo(descriptor) {
if (descriptor.node) {
assert__default["default"](typeof descriptor.node === "object", "Node must be an object");
} else {
assert__default["default"](descriptor.loc, "Node must be provided when reporting error if location is not provided");
}
}
function normalizeReportLoc(descriptor) {
if (descriptor.loc) {
if (descriptor.loc.start) {
return descriptor.loc;
}
return {
start: descriptor.loc,
end: null
};
}
return descriptor.node.loc;
}
function assertValidFix(fix) {
if (fix) {
assert__default["default"](fix.range && typeof fix.range[0] === "number" && typeof fix.range[1] === "number", `Fix has invalid range: ${JSON.stringify(fix, null, 2)}`);
}
}
function compareFixesByRange(a, b) {
return a.range[0] - b.range[0] || a.range[1] - b.range[1];
}
function mergeFixes(fixes, sourceCode) {
for (const fix of fixes) {
assertValidFix(fix);
}
if (fixes.length === 0) {
return null;
}
if (fixes.length === 1) {
return fixes[0];
}
fixes.sort(compareFixesByRange);
const originalText = sourceCode.text;
const start = fixes[0].range[0];
const end = fixes[fixes.length - 1].range[1];
let text = "";
let lastPos = Number.MIN_SAFE_INTEGER;
for (const fix of fixes) {
assert__default["default"](fix.range[0] >= lastPos, "Fix objects must not be overlapped in a report.");
if (fix.range[0] >= 0) {
text += originalText.slice(Math.max(0, start, lastPos), fix.range[0]);
}
text += fix.text;
lastPos = fix.range[1];
}
text += originalText.slice(Math.max(0, start, lastPos), end);
return {
range: [start, end],
text
};
}
function normalizeFixes(descriptor, sourceCode) {
if (typeof descriptor.fix !== "function") {
return null;
}
const fix = descriptor.fix(ruleFixer_1);
if (fix && Symbol.iterator in fix) {
return mergeFixes(Array.from(fix), sourceCode);
}
assertValidFix(fix);
return fix;
}
function mapSuggestions(descriptor, sourceCode, messages) {
if (!descriptor.suggest || !Array.isArray(descriptor.suggest)) {
return [];
}
return descriptor.suggest.map(suggestInfo => {
const computedDesc = suggestInfo.desc || messages[suggestInfo.messageId];
return { ...suggestInfo,
desc: interpolate(computedDesc, suggestInfo.data),
fix: normalizeFixes(suggestInfo, sourceCode)
};
}).filter(({
fix
}) => fix);
}
function createProblem(options) {
const problem = {
ruleId: options.ruleId,
severity: options.severity,
message: options.message,
line: options.loc.start.line,
column: options.loc.start.column + 1,
nodeType: options.node && options.node.type || null
};
if (options.messageId) {
problem.messageId = options.messageId;
}
if (options.loc.end) {
problem.endLine = options.loc.end.line;
problem.endColumn = options.loc.end.column + 1;
}
if (options.fix) {
problem.fix = options.fix;
}
if (options.suggestions && options.suggestions.length > 0) {
problem.suggestions = options.suggestions;
}
return problem;
}
function validateSuggestions(suggest, messages) {
if (suggest && Array.isArray(suggest)) {
suggest.forEach(suggestion => {
if (suggestion.messageId) {
const {
messageId
} = suggestion;
if (!messages) {
throw new TypeError(`context.report() called with a suggest option with a messageId '${messageId}', but no messages were present in the rule metadata.`);
}
if (!messages[messageId]) {
throw new TypeError(`context.report() called with a suggest option with a messageId '${messageId}' which is not present in the 'messages' config: ${JSON.stringify(messages, null, 2)}`);
}
if (suggestion.desc) {
throw new TypeError("context.report() called with a suggest option that defines both a 'messageId' and an 'desc'. Please only pass one.");
}
} else if (!suggestion.desc) {
throw new TypeError("context.report() called with a suggest option that doesn't have either a `desc` or `messageId`");
}
if (typeof suggestion.fix !== "function") {
throw new TypeError(`context.report() called with a suggest option without a fix function. See: ${suggestion}`);
}
});
}
}
var reportTranslator = function (metadata) {
return (...args) => {
const descriptor = normalizeMultiArgReportCall(...args);
const messages = metadata.messageIds;
assertValidNodeInfo(descriptor);
let computedMessage;
if (descriptor.messageId) {
if (!messages) {
throw new TypeError("context.report() called with a messageId, but no messages were present in the rule metadata.");
}
const id = descriptor.messageId;
if (descriptor.message) {
throw new TypeError("context.report() called with a message and a messageId. Please only pass one.");
}
if (!messages || !Object.prototype.hasOwnProperty.call(messages, id)) {
throw new TypeError(`context.report() called with a messageId of '${id}' which is not present in the 'messages' config: ${JSON.stringify(messages, null, 2)}`);
}
computedMessage = messages[id];
} else if (descriptor.message) {
computedMessage = descriptor.message;
} else {
throw new TypeError("Missing `message` property in report() call; add a message that describes the linting problem.");
}
validateSuggestions(descriptor.suggest, messages);
return createProblem({
ruleId: metadata.ruleId,
severity: metadata.severity,
node: descriptor.node,
message: interpolate(computedMessage, descriptor.data),
messageId: descriptor.messageId,
loc: normalizeReportLoc(descriptor),
fix: metadata.disableFixes ? null : normalizeFixes(descriptor, metadata.sourceCode),
suggestions: metadata.disableFixes ? [] : mapSuggestions(descriptor, metadata.sourceCode, messages)
});
};
};
var rulesIndex = new Map();
function normalizeRule(rule) {
return typeof rule === "function" ? Object.assign({
create: rule
}, rule) : rule;
}
class Rules {
constructor() {
this._rules = Object.create(null);
}
define(ruleId, ruleModule) {
this._rules[ruleId] = normalizeRule(ruleModule);
}
get(ruleId) {
if (typeof this._rules[ruleId] === "string") {
this.define(ruleId, null);
}
if (this._rules[ruleId]) {
return this._rules[ruleId];
}
if (rulesIndex.has(ruleId)) {
return rulesIndex.get(ruleId);
}
return null;
}
*[Symbol.iterator]() {
yield* rulesIndex;
for (const ruleId of Object.keys(this._rules)) {
yield [ruleId, this.get(ruleId)];
}
}
}
var rules$1 = Rules;
var safeEmitter = () => {
const listeners = Object.create(null);
return Object.freeze({
on(eventName, listener) {
if (eventName in listeners) {
listeners[eventName].push(listener);
} else {
listeners[eventName] = [listener];
}
},
emit(eventName, ...args) {
if (eventName in listeners) {
listeners[eventName].forEach(listener => listener(...args));
}
},
eventNames() {
return Object.keys(listeners);
}
});
};
const debug$1 = debug__default["default"]("eslint:source-code-fixer");
const BOM = "\uFEFF";
function compareMessagesByFixRange(a, b) {
return a.fix.range[0] - b.fix.range[0] || a.fix.range[1] - b.fix.range[1];
}
function compareMessagesByLocation(a, b) {
return a.line - b.line || a.column - b.column;
}
function SourceCodeFixer() {
Object.freeze(this);
}
SourceCodeFixer.applyFixes = function (sourceText, messages, shouldFix) {
debug$1("Applying fixes");
if (shouldFix === false) {
debug$1("shouldFix parameter was false, not attempting fixes");
return {
fixed: false,
messages,
output: sourceText
};
}
const remainingMessages = [],
fixes = [],
bom = sourceText.startsWith(BOM) ? BOM : "",
text = bom ? sourceText.slice(1) : sourceText;
let lastPos = Number.NEGATIVE_INFINITY,
output = bom;
function attemptFix(problem) {
const fix = problem.fix;
const start = fix.range[0];
const end = fix.range[1];
if (lastPos >= start || start > end) {
remainingMessages.push(problem);
return false;
}
if (start < 0 && end >= 0 || start === 0 && fix.text.startsWith(BOM)) {
output = "";
}
output += text.slice(Math.max(0, lastPos), Math.max(0, start));
output += fix.text;
lastPos = end;
return true;
}
messages.forEach(problem => {
if (Object.prototype.hasOwnProperty.call(problem, "fix")) {
fixes.push(problem);
} else {
remainingMessages.push(problem);
}
});
if (fixes.length) {
debug$1("Found fixes to apply");
let fixesWereApplied = false;
for (const problem of fixes.sort(compareMessagesByFixRange)) {
if (typeof shouldFix !== "function" || shouldFix(problem)) {
attemptFix(problem);
fixesWereApplied = true;
} else {
remainingMessages.push(problem);
}
}
output += text.slice(Math.max(0, lastPos));
return {
fixed: fixesWereApplied,
messages: remainingMessages.sort(compareMessagesByLocation),
output
};
}
debug$1("No fixes to apply");
return {
fixed: false,
messages,
output: bom + text
};
};
var sourceCodeFixer = SourceCodeFixer;
function alignLeft(str, len, ch) {
return str + new Array(len - str.length + 1).join(ch || " ");
}
function alignRight(str, len, ch) {
return new Array(len - str.length + 1).join(ch || " ") + str;
}
const enabled = false;
const HEADERS = ["Rule", "Time (ms)", "Relative"];
const ALIGN = [alignLeft, alignRight, alignRight];
function getListSize() {
const TIMING_ENV_VAR_AS_INTEGER = Number.parseInt("", 10);
return 10;
}
function display(data) {
let total = 0;
const rows = Object.keys(data).map(key => {
const time = data[key];
total += time;
return [key, time];
}).sort((a, b) => b[1] - a[1]).slice(0, getListSize());
rows.forEach(row => {
row.push(`${(row[1] * 100 / total).toFixed(1)}%`);
row[1] = row[1].toFixed(3);
});
rows.unshift(HEADERS);
const widths = [];
rows.forEach(row => {
const len = row.length;
for (let i = 0; i < len; i++) {
const n = row[i].length;
if (!widths[i] || n > widths[i]) {
widths[i] = n;
}
}
});
const table = rows.map(row => row.map((cell, index) => ALIGN[index](cell, widths[index])).join(" | "));
table.splice(1, 0, widths.map((width, index) => {
const extraAlignment = index !== 0 && index !== widths.length - 1 ? 2 : 1;
return ALIGN[index](":", width + extraAlignment, "-");
}).join("|"));
console.log(table.join("\n"));
}
var timing = function () {
const data = Object.create(null);
if (enabled) {
process.on("exit", () => {
display(data);
});
}
return {
time: function (key, fn) {
if (typeof data[key] === "undefined") {
data[key] = 0;
}
return function (...args) {
let t = process.hrtime();
fn(...args);
t = process.hrtime(t);
data[key] += t[0] * 1e3 + t[1] / 1e6;
};
},
enabled,
getListSize
};
}();
const rules = {
"generator-star": ["generator-star-spacing"],
"global-strict": ["strict"],
"no-arrow-condition": ["no-confusing-arrow", "no-constant-condition"],
"no-comma-dangle": ["comma-dangle"],
"no-empty-class": ["no-empty-character-class"],
"no-empty-label": ["no-labels"],
"no-extra-strict": ["strict"],
"no-reserved-keys": ["quote-props"],
"no-space-before-semi": ["semi-spacing"],
"no-wrap-func": ["no-extra-parens"],
"space-after-function-name": ["space-before-function-paren"],
"space-after-keywords": ["keyword-spacing"],
"space-before-function-parentheses": ["space-before-function-paren"],
"space-before-keywords": ["keyword-spacing"],
"space-in-brackets": ["object-curly-spacing", "array-bracket-spacing", "computed-property-spacing"],
"space-return-throw-case": ["keyword-spacing"],
"space-unary-word-ops": ["space-unary-ops"],
"spaced-line-comment": ["spaced-comment"]
};
var replacements = {
rules: rules
};
var replacements$1 = Object.freeze({
__proto__: null,
rules: rules,
'default': replacements
});
var pkg = _commonjsHelpers.getCjsExportFromNamespace(_package$1);
var ruleReplacements = _commonjsHelpers.getCjsExportFromNamespace(replacements$1);
const {
SourceCode
} = sourceCode;
const debug = debug__default["default"]("eslint:linter");
const MAX_AUTOFIX_PASSES = 10;
const DEFAULT_PARSER_NAME = "espree";
const DEFAULT_ECMA_VERSION = 5;
const commentParser = new configCommentParser();
const DEFAULT_ERROR_LOC = {
start: {
line: 1,
column: 0
},
end: {
line: 1,
column: 1
}
};
const parserSymbol = Symbol.for("eslint.RuleTester.parser");
function addDeclaredGlobals(globalScope, configGlobals, {
exportedVariables,
enabledGlobals
}) {
for (const id of new Set([...Object.keys(configGlobals), ...Object.keys(enabledGlobals)])) {
const configValue = configGlobals[id] === void 0 ? void 0 : configOps__default["default"].normalizeConfigGlobal(configGlobals[id]);
const commentValue = enabledGlobals[id] && enabledGlobals[id].value;
const value = commentValue || configValue;
const sourceComments = enabledGlobals[id] && enabledGlobals[id].comments;
if (value === "off") {
continue;
}
let variable = globalScope.set.get(id);
if (!variable) {
variable = new eslintScope__default["default"].Variable(id, globalScope);
globalScope.variables.push(variable);
globalScope.set.set(id, variable);
}
variable.eslintImplicitGlobalSetting = configValue;
variable.eslintExplicitGlobal = sourceComments !== void 0;
variable.eslintExplicitGlobalComments = sourceComments;
variable.writeable = value === "writable";
}
Object.keys(exportedVariables).forEach(name => {
const variable = globalScope.set.get(name);
if (variable) {
variable.eslintUsed = true;
}
});
globalScope.through = globalScope.through.filter(reference => {
const name = reference.identifier.name;
const variable = globalScope.set.get(name);
if (variable) {
reference.resolved = variable;
variable.references.push(reference);
return false;
}
return true;
});
}
function createMissingRuleMessage(ruleId) {
return Object.prototype.hasOwnProperty.call(ruleReplacements.rules, ruleId) ? `Rule '${ruleId}' was removed and replaced by: ${ruleReplacements.rules[ruleId].join(", ")}` : `Definition for rule '${ruleId}' was not found.`;
}
function createLintingProblem(options) {
const {
ruleId = null,
loc = DEFAULT_ERROR_LOC,
message = createMissingRuleMessage(options.ruleId),
severity = 2
} = options;
return {
ruleId,
message,
line: loc.start.line,
column: loc.start.column + 1,
endLine: loc.end.line,
endColumn: loc.end.column + 1,
severity,
nodeType: null
};
}
function createDisableDirectives(options) {
const {
type,
loc,
value,
ruleMapper
} = options;
const ruleIds = Object.keys(commentParser.parseListConfig(value));
const directiveRules = ruleIds.length ? ruleIds : [null];
const result = {
directives: [],
directiveProblems: []
};
for (const ruleId of directiveRules) {
if (ruleId === null || ruleMapper(ruleId) !== null) {
result.directives.push({
type,
line: loc.start.line,
column: loc.start.column + 1,
ruleId
});
} else {
result.directiveProblems.push(createLintingProblem({
ruleId,
loc
}));
}
}
return result;
}
function stripDirectiveComment(value) {
return value.split(/\s-{2,}\s/u)[0].trim();
}
function getDirectiveComments(filename, ast, ruleMapper, warnInlineConfig) {
const configuredRules = {};
const enabledGlobals = Object.create(null);
const exportedVariables = {};
const problems = [];
const disableDirectives = [];
const validator = new configValidator__default["default"]({
builtInRules: rules$1
});
ast.comments.filter(token => token.type !== "Shebang").forEach(comment => {
const trimmedCommentText = stripDirectiveComment(comment.value);
const match = /^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u.exec(trimmedCommentText);
if (!match) {
return;
}
const directiveText = match[1];
const lineCommentSupported = /^eslint-disable-(next-)?line$/u.test(directiveText);
if (comment.type === "Line" && !lineCommentSupported) {
return;
}
if (warnInlineConfig) {
const kind = comment.type === "Block" ? `/*${directiveText}*/` : `//${directiveText}`;
problems.push(createLintingProblem({
ruleId: null,
message: `'${kind}' has no effect because you have 'noInlineConfig' setting in ${warnInlineConfig}.`,
loc: comment.loc,
severity: 1
}));
return;
}
if (lineCommentSupported && comment.loc.start.line !== comment.loc.end.line) {
problems.push(createLintingProblem({
ruleId: null,
message: `${directiveText} comment should not span multiple lines.`,
loc: comment.loc
}));
return;
}
const directiveValue = trimmedCommentText.slice(match.index + directiveText.length);
switch (directiveText) {
case "eslint-disable":
case "eslint-enable":
case "eslint-disable-next-line":
case "eslint-disable-line":
{
const directiveType = directiveText.slice(7);
const options = {
type: directiveType,
loc: comment.loc,
value: directiveValue,
ruleMapper
};
const {
directives,
directiveProblems
} = createDisableDirectives(options);
disableDirectives.push(...directives);
problems.push(...directiveProblems);
break;
}
case "exported":
Object.assign(exportedVariables, commentParser.parseStringConfig(directiveValue, comment));
break;
case "globals":
case "global":
for (const [id, {
value
}] of Object.entries(commentParser.parseStringConfig(directiveValue, comment))) {
let normalizedValue;
try {
normalizedValue = configOps__default["default"].normalizeConfigGlobal(value);
} catch (err) {
problems.push(createLintingProblem({
ruleId: null,
loc: comment.loc,
message: err.message
}));
continue;
}
if (enabledGlobals[id]) {
enabledGlobals[id].comments.push(comment);
enabledGlobals[id].value = normalizedValue;
} else {
enabledGlobals[id] = {
comments: [comment],
value: normalizedValue
};
}
}
break;
case "eslint":
{
const parseResult = commentParser.parseJsonConfig(directiveValue, comment.loc);
if (parseResult.success) {
Object.keys(parseResult.config).forEach(name => {
const rule = ruleMapper(name);
const ruleValue = parseResult.config[name];
if (rule === null) {
problems.push(createLintingProblem({
ruleId: name,
loc: comment.loc
}));
return;
}
try {
validator.validateRuleOptions(rule, name, ruleValue);
} catch (err) {
problems.push(createLintingProblem({
ruleId: name,
message: err.message,
loc: comment.loc
}));
return;
}
configuredRules[name] = ruleValue;
});
} else {
problems.push(parseResult.error);
}
break;
}
}
});
return {
configuredRules,
enabledGlobals,
exportedVariables,
problems,
disableDirectives
};
}
function normalizeEcmaVersion(parser, ecmaVersion) {
if ((parser[parserSymbol] || parser) === espree__default["default"]) {
if (ecmaVersion === "latest") {
return espree__default["default"].latestEcmaVersion;
}
}
return ecmaVersion >= 2015 ? ecmaVersion - 2009 : ecmaVersion;
}
const eslintEnvPattern = /\/\*\s*eslint-env\s(.+?)\*\//gsu;
function findEslintEnv(text) {
let match, retv;
eslintEnvPattern.lastIndex = 0;
while ((match = eslintEnvPattern.exec(text)) !== null) {
retv = Object.assign(retv || {}, commentParser.parseListConfig(stripDirectiveComment(match[1])));
}
return retv;
}
function normalizeFilename(filename) {
const parts = filename.split(path__default["default"].sep);
const index = parts.lastIndexOf("<text>");
return index === -1 ? filename : parts.slice(index).join(path__default["default"].sep);
}
function normalizeVerifyOptions(providedOptions, config) {
const disableInlineConfig = config.noInlineConfig === true;
const ignoreInlineConfig = providedOptions.allowInlineConfig === false;
const configNameOfNoInlineConfig = config.configNameOfNoInlineConfig ? ` (${config.configNameOfNoInlineConfig})` : "";
let reportUnusedDisableDirectives = providedOptions.reportUnusedDisableDirectives;
if (typeof reportUnusedDisableDirectives === "boolean") {
reportUnusedDisableDirectives = reportUnusedDisableDirectives ? "error" : "off";
}
if (typeof reportUnusedDisableDirectives !== "string") {
reportUnusedDisableDirectives = config.reportUnusedDisableDirectives ? "warn" : "off";
}
return {
filename: normalizeFilename(providedOptions.filename || "<input>"),
allowInlineConfig: !ignoreInlineConfig,
warnInlineConfig: disableInlineConfig && !ignoreInlineConfig ? `your config${configNameOfNoInlineConfig}` : null,
reportUnusedDisableDirectives,
disableFixes: Boolean(providedOptions.disableFixes)
};
}
function resolveParserOptions(parser, providedOptions, enabledEnvironments) {
const parserOptionsFromEnv = enabledEnvironments.filter(env => env.parserOptions).reduce((parserOptions, env) => lodash__default["default"](parserOptions, env.parserOptions), {});
const mergedParserOptions = lodash__default["default"](parserOptionsFromEnv, providedOptions || {});
const isModule = mergedParserOptions.sourceType === "module";
if (isModule) {
mergedParserOptions.ecmaFeatures = Object.assign({}, mergedParserOptions.ecmaFeatures, {
globalReturn: false
});
}
mergedParserOptions.ecmaVersion = normalizeEcmaVersion(parser, mergedParserOptions.ecmaVersion);
return mergedParserOptions;
}
function resolveGlobals(providedGlobals, enabledEnvironments) {
return Object.assign({}, ...enabledEnvironments.filter(env => env.globals).map(env => env.globals), providedGlobals);
}
function stripUnicodeBOM(text) {
if (text.charCodeAt(0) === 0xFEFF) {
return text.slice(1);
}
return text;
}
function getRuleOptions(ruleConfig) {
if (Array.isArray(ruleConfig)) {
return ruleConfig.slice(1);
}
return [];
}
function analyzeScope(ast, parserOptions, visitorKeys) {
const ecmaFeatures = parserOptions.ecmaFeatures || {};
const ecmaVersion = parserOptions.ecmaVersion || DEFAULT_ECMA_VERSION;
return eslintScope__default["default"].analyze(ast, {
ignoreEval: true,
nodejsScope: ecmaFeatures.globalReturn,
impliedStrict: ecmaFeatures.impliedStrict,
ecmaVersion,
sourceType: parserOptions.sourceType || "script",
childVisitorKeys: visitorKeys || eslintVisitorKeys__default["default"].KEYS,
fallback: _commonjsHelpers.traverser.getKeys
});
}
function parse(text, parser, providedParserOptions, filePath) {
const textToParse = stripUnicodeBOM(text).replace(_commonjsHelpers.astUtils.shebangPattern, (match, captured) => `//${captured}`);
const parserOptions = Object.assign({}, providedParserOptions, {
loc: true,
range: true,
raw: true,
tokens: true,
comment: true,
eslintVisitorKeys: true,
eslintScopeManager: true,
filePath
});
try {
const parseResult = typeof parser.parseForESLint === "function" ? parser.parseForESLint(textToParse, parserOptions) : {
ast: parser.parse(textToParse, parserOptions)
};
const ast = parseResult.ast;
const parserServices = parseResult.services || {};
const visitorKeys = parseResult.visitorKeys || eslintVisitorKeys__default["default"].KEYS;
const scopeManager = parseResult.scopeManager || analyzeScope(ast, parserOptions, visitorKeys);
return {
success: true,
sourceCode: new SourceCode({
text,
ast,
parserServices,
scopeManager,
visitorKeys
})
};
} catch (ex) {
const message = `Parsing error: ${ex.message.replace(/^line \d+:/iu, "").trim()}`;
debug("%s\n%s", message, ex.stack);
return {
success: false,
error: {
ruleId: null,
fatal: true,
severity: 2,
message,
line: ex.lineNumber,
column: ex.column
}
};
}
}
function getScope(scopeManager, currentNode) {
const inner = currentNode.type !== "Program";
for (let node = currentNode; node; node = node.parent) {
const scope = scopeManager.acquire(node, inner);
if (scope) {
if (scope.type === "function-expression-name") {
return scope.childScopes[0];
}
return scope;
}
}
return scopeManager.scopes[0];
}
function markVariableAsUsed(scopeManager, currentNode, parserOptions, name) {
const hasGlobalReturn = parserOptions.ecmaFeatures && parserOptions.ecmaFeatures.globalReturn;
const specialScope = hasGlobalReturn || parserOptions.sourceType === "module";
const currentScope = getScope(scopeManager, currentNode);
const initialScope = currentScope.type === "global" && specialScope ? currentScope.childScopes[0] : currentScope;
for (let scope = initialScope; scope; scope = scope.upper) {
const variable = scope.variables.find(scopeVar => scopeVar.name === name);
if (variable) {
variable.eslintUsed = true;
return true;
}
}
return false;
}
function createRuleListeners(rule, ruleContext) {
try {
return rule.create(ruleContext);
} catch (ex) {
ex.message = `Error while loading rule '${ruleContext.id}': ${ex.message}`;
throw ex;
}
}
function getAncestors(node) {
const ancestorsStartingAtParent = [];
for (let ancestor = node.parent; ancestor; ancestor = ancestor.parent) {
ancestorsStartingAtParent.push(ancestor);
}
return ancestorsStartingAtParent.reverse();
}
const DEPRECATED_SOURCECODE_PASSTHROUGHS = {
getSource: "getText",
getSourceLines: "getLines",
getAllComments: "getAllComments",
getNodeByRangeIndex: "getNodeByRangeIndex",
getComments: "getComments",
getCommentsBefore: "getCommentsBefore",
getCommentsAfter: "getCommentsAfter",
getCommentsInside: "getCommentsInside",
getJSDocComment: "getJSDocComment",
getFirstToken: "getFirstToken",
getFirstTokens: "getFirstTokens",
getLastToken: "getLastToken",
getLastTokens: "getLastTokens",
getTokenAfter: "getTokenAfter",
getTokenBefore: "getTokenBefore",
getTokenByRangeStart: "getTokenByRangeStart",
getTokens: "getTokens",
getTokensAfter: "getTokensAfter",
getTokensBefore: "getTokensBefore",
getTokensBetween: "getTokensBetween"
};
const BASE_TRAVERSAL_CONTEXT = Object.freeze(Object.keys(DEPRECATED_SOURCECODE_PASSTHROUGHS).reduce((contextInfo, methodName) => Object.assign(contextInfo, {
[methodName](...args) {
return this.getSourceCode()[DEPRECATED_SOURCECODE_PASSTHROUGHS[methodName]](...args);
}
}), {}));
function runRules(sourceCode, configuredRules, ruleMapper, parserOptions, parserName, settings, filename, disableFixes, cwd, physicalFilename) {
const emitter = safeEmitter();
const nodeQueue = [];
let currentNode = sourceCode.ast;
_commonjsHelpers.traverser.traverse(sourceCode.ast, {
enter(node, parent) {
node.parent = parent;
nodeQueue.push({
isEntering: true,
node
});
},
leave(node) {
nodeQueue.push({
isEntering: false,
node
});
},
visitorKeys: sourceCode.visitorKeys
});
const sharedTraversalContext = Object.freeze(Object.assign(Object.create(BASE_TRAVERSAL_CONTEXT), {
getAncestors: () => getAncestors(currentNode),
getDeclaredVariables: sourceCode.scopeManager.getDeclaredVariables.bind(sourceCode.scopeManager),
getCwd: () => cwd,
getFilename: () => filename,
getPhysicalFilename: () => physicalFilename || filename,
getScope: () => getScope(sourceCode.scopeManager, currentNode),
getSourceCode: () => sourceCode,
markVariableAsUsed: name => markVariableAsUsed(sourceCode.scopeManager, currentNode, parserOptions, name),
parserOptions,
parserPath: parserName,
parserServices: sourceCode.parserServices,
settings
}));
const lintingProblems = [];
Object.keys(configuredRules).forEach(ruleId => {
const severity = configOps__default["default"].getRuleSeverity(configuredRules[ruleId]);
if (severity === 0) {
return;
}
const rule = ruleMapper(ruleId);
if (rule === null) {
lintingProblems.push(createLintingProblem({
ruleId
}));
return;
}
const messageIds = rule.meta && rule.meta.messages;
let reportTranslator$1 = null;
const ruleContext = Object.freeze(Object.assign(Object.create(sharedTraversalContext), {
id: ruleId,
options: getRuleOptions(configuredRules[ruleId]),
report(...args) {
if (reportTranslator$1 === null) {
reportTranslator$1 = reportTranslator({
ruleId,
severity,
sourceCode,
messageIds,
disableFixes
});
}
const problem = reportTranslator$1(...args);
if (problem.fix && rule.meta && !rule.meta.fixable) {
throw new Error("Fixable rules should export a `meta.fixable` property.");
}
lintingProblems.push(problem);
}
}));
const ruleListeners = createRuleListeners(rule, ruleContext);
Object.keys(ruleListeners).forEach(selector => {
emitter.on(selector, timing.enabled ? timing.time(ruleId, ruleListeners[selector]) : ruleListeners[selector]);
});
});
const eventGenerator = nodeQueue[0].node.type === "Program" ? new codePathAnalyzer(new nodeEventGenerator(emitter, {
visitorKeys: sourceCode.visitorKeys,
fallback: _commonjsHelpers.traverser.getKeys
})) : new nodeEventGenerator(emitter, {
visitorKeys: sourceCode.visitorKeys,
fallback: _commonjsHelpers.traverser.getKeys
});
nodeQueue.forEach(traversalInfo => {
currentNode = traversalInfo.node;
try {
if (traversalInfo.isEntering) {
eventGenerator.enterNode(currentNode);
} else {
eventGenerator.leaveNode(currentNode);
}
} catch (err) {
err.currentNode = currentNode;
throw err;
}
});
return lintingProblems;
}
function ensureText(textOrSourceCode) {
if (typeof textOrSourceCode === "object") {
const {
hasBOM,
text
} = textOrSourceCode;
const bom = hasBOM ? "\uFEFF" : "";
return bom + text;
}
return String(textOrSourceCode);
}
function getEnv(slots, envId) {
return slots.lastConfigArray && slots.lastConfigArray.pluginEnvironments.get(envId) || environments__default["default"].get(envId) || null;
}
function getRule(slots, ruleId) {
return slots.lastConfigArray && slots.lastConfigArray.pluginRules.get(ruleId) || slots.ruleMap.get(ruleId);
}
function normalizeCwd(cwd) {
if (cwd) {
return cwd;
}
if (typeof process === "object") {
return process.cwd();
}
return undefined;
}
const internalSlotsMap = new WeakMap();
class Linter$1 {
constructor({
cwd
} = {}) {
internalSlotsMap.set(this, {
cwd: normalizeCwd(cwd),
lastConfigArray: null,
lastSourceCode: null,
parserMap: new Map([["espree", espree__default["default"]]]),
ruleMap: new rules$1()
});
this.version = pkg.version;
}
static get version() {
return pkg.version;
}
_verifyWithoutProcessors(textOrSourceCode, providedConfig, providedOptions) {
const slots = internalSlotsMap.get(this);
const config = providedConfig || {};
const options = normalizeVerifyOptions(providedOptions, config);
let text;
if (typeof textOrSourceCode === "string") {
slots.lastSourceCode = null;
text = textOrSourceCode;
} else {
slots.lastSourceCode = textOrSourceCode;
text = textOrSourceCode.text;
}
let parserName = DEFAULT_PARSER_NAME;
let parser = espree__default["default"];
if (typeof config.parser === "object" && config.parser !== null) {
parserName = config.parser.filePath;
parser = config.parser.definition;
} else if (typeof config.parser === "string") {
if (!slots.parserMap.has(config.parser)) {
return [{
ruleId: null,
fatal: true,
severity: 2,
message: `Configured parser '${config.parser}' was not found.`,
line: 0,
column: 0
}];
}
parserName = config.parser;
parser = slots.parserMap.get(config.parser);
}
const envInFile = options.allowInlineConfig && !options.warnInlineConfig ? findEslintEnv(text) : {};
const resolvedEnvConfig = Object.assign({
builtin: true
}, config.env, envInFile);
const enabledEnvs = Object.keys(resolvedEnvConfig).filter(envName => resolvedEnvConfig[envName]).map(envName => getEnv(slots, envName)).filter(env => env);
const parserOptions = resolveParserOptions(parser, config.parserOptions || {}, enabledEnvs);
const configuredGlobals = resolveGlobals(config.globals || {}, enabledEnvs);
const settings = config.settings || {};
if (!slots.lastSourceCode) {
const parseResult = parse(text, parser, parserOptions, options.filename);
if (!parseResult.success) {
return [parseResult.error];
}
slots.lastSourceCode = parseResult.sourceCode;
} else {
if (!slots.lastSourceCode.scopeManager) {
slots.lastSourceCode = new SourceCode({
text: slots.lastSourceCode.text,
ast: slots.lastSourceCode.ast,
parserServices: slots.lastSourceCode.parserServices,
visitorKeys: slots.lastSourceCode.visitorKeys,
scopeManager: analyzeScope(slots.lastSourceCode.ast, parserOptions)
});
}
}
const sourceCode = slots.lastSourceCode;
const commentDirectives = options.allowInlineConfig ? getDirectiveComments(options.filename, sourceCode.ast, ruleId => getRule(slots, ruleId), options.warnInlineConfig) : {
configuredRules: {},
enabledGlobals: {},
exportedVariables: {},
problems: [],
disableDirectives: []
};
addDeclaredGlobals(sourceCode.scopeManager.scopes[0], configuredGlobals, {
exportedVariables: commentDirectives.exportedVariables,
enabledGlobals: commentDirectives.enabledGlobals
});
const configuredRules = Object.assign({}, config.rules, commentDirectives.configuredRules);
let lintingProblems;
try {
lintingProblems = runRules(sourceCode, configuredRules, ruleId => getRule(slots, ruleId), parserOptions, parserName, settings, options.filename, options.disableFixes, slots.cwd, providedOptions.physicalFilename);
} catch (err) {
err.message += `\nOccurred while linting ${options.filename}`;
debug("An error occurred while traversing");
debug("Filename:", options.filename);
if (err.currentNode) {
const {
line
} = err.currentNode.loc.start;
debug("Line:", line);
err.message += `:${line}`;
}
debug("Parser Options:", parserOptions);
debug("Parser Path:", parserName);
debug("Settings:", settings);
throw err;
}
return applyDisableDirectives({
directives: commentDirectives.disableDirectives,
problems: lintingProblems.concat(commentDirectives.problems).sort((problemA, problemB) => problemA.line - problemB.line || problemA.column - problemB.column),
reportUnusedDisableDirectives: options.reportUnusedDisableDirectives
});
}
verify(textOrSourceCode, config, filenameOrOptions) {
debug("Verify");
const options = typeof filenameOrOptions === "string" ? {
filename: filenameOrOptions
} : filenameOrOptions || {};
if (config && typeof config.extractConfig === "function") {
return this._verifyWithConfigArray(textOrSourceCode, config, options);
}
if (options.preprocess || options.postprocess) {
return this._verifyWithProcessor(textOrSourceCode, config, options);
}
return this._verifyWithoutProcessors(textOrSourceCode, config, options);
}
_verifyWithConfigArray(textOrSourceCode, configArray, options) {
debug("With ConfigArray: %s", options.filename);
internalSlotsMap.get(this).lastConfigArray = configArray;
const config = configArray.extractConfig(options.filename);
const processor = config.processor && configArray.pluginProcessors.get(config.processor);
if (processor) {
debug("Apply the processor: %o", config.processor);
const {
preprocess,
postprocess,
supportsAutofix
} = processor;
const disableFixes = options.disableFixes || !supportsAutofix;
return this._verifyWithProcessor(textOrSourceCode, config, { ...options,
disableFixes,
postprocess,
preprocess
}, configArray);
}
return this._verifyWithoutProcessors(textOrSourceCode, config, options);
}
_verifyWithProcessor(textOrSourceCode, config, options, configForRecursive) {
const filename = options.filename || "<input>";
const filenameToExpose = normalizeFilename(filename);
const physicalFilename = options.physicalFilename || filenameToExpose;
const text = ensureText(textOrSourceCode);
const preprocess = options.preprocess || (rawText => [rawText]);
const postprocess = options.postprocess || (array => [].concat(...array));
const filterCodeBlock = options.filterCodeBlock || (blockFilename => blockFilename.endsWith(".js"));
const originalExtname = path__default["default"].extname(filename);
const messageLists = preprocess(text, filenameToExpose).map((block, i) => {
debug("A code block was found: %o", block.filename || "(unnamed)");
if (typeof block === "string") {
return this._verifyWithoutProcessors(block, config, options);
}
const blockText = block.text;
const blockName = path__default["default"].join(filename, `${i}_${block.filename}`);
if (!filterCodeBlock(blockName, blockText)) {
debug("This code block was skipped.");
return [];
}
if (configForRecursive && (text !== blockText || path__default["default"].extname(blockName) !== originalExtname)) {
debug("Resolving configuration again because the file content or extension was changed.");
return this._verifyWithConfigArray(blockText, configForRecursive, { ...options,
filename: blockName,
physicalFilename
});
}
return this._verifyWithoutProcessors(blockText, config, { ...options,
filename: blockName,
physicalFilename
});
});
return postprocess(messageLists, filenameToExpose);
}
getSourceCode() {
return internalSlotsMap.get(this).lastSourceCode;
}
defineRule(ruleId, ruleModule) {
internalSlotsMap.get(this).ruleMap.define(ruleId, ruleModule);
}
defineRules(rulesToDefine) {
Object.getOwnPropertyNames(rulesToDefine).forEach(ruleId => {
this.defineRule(ruleId, rulesToDefine[ruleId]);
});
}
getRules() {
const {
lastConfigArray,
ruleMap
} = internalSlotsMap.get(this);
return new Map(function* () {
yield* ruleMap;
if (lastConfigArray) {
yield* lastConfigArray.pluginRules;
}
}());
}
defineParser(parserId, parserModule) {
internalSlotsMap.get(this).parserMap.set(parserId, parserModule);
}
verifyAndFix(text, config, options) {
let messages = [],
fixedResult,
fixed = false,
passNumber = 0,
currentText = text;
const debugTextDescription = options && options.filename || `${text.slice(0, 10)}...`;
const shouldFix = options && typeof options.fix !== "undefined" ? options.fix : true;
do {
passNumber++;
debug(`Linting code for ${debugTextDescription} (pass ${passNumber})`);
messages = this.verify(currentText, config, options);
debug(`Generating fixed text for ${debugTextDescription} (pass ${passNumber})`);
fixedResult = sourceCodeFixer.applyFixes(currentText, messages, shouldFix);
if (messages.length === 1 && messages[0].fatal) {
break;
}
fixed = fixed || fixedResult.fixed;
currentText = fixedResult.output;
} while (fixedResult.fixed && passNumber < MAX_AUTOFIX_PASSES);
if (fixedResult.fixed) {
fixedResult.messages = this.verify(currentText, config, options);
}
fixedResult.fixed = fixed;
fixedResult.output = currentText;
return fixedResult;
}
}
var linter$1 = {
Linter: Linter$1,
getLinterInternalSlots(instance) {
return internalSlotsMap.get(instance);
}
};
const {
Linter
} = linter$1;
var linter = {
Linter,
SourceCodeFixer: sourceCodeFixer,
interpolate
};
var linter_1 = linter.Linter;
exports.linter_1 = linter_1;
//# sourceMappingURL=index-352b102f.js.map | 27.828427 | 295 | 0.64882 |
9955e9c34f66c116a9863eef0eaa73a73bf21d59 | 942 | js | JavaScript | src/common/actions/userNovels.js | fengzhongye/pxview | db70dfe3c52898d3d4cc51f2feb46dc64dbbfa63 | [
"MIT"
] | 650 | 2017-07-10T07:22:20.000Z | 2022-03-28T12:30:27.000Z | src/common/actions/userNovels.js | fengzhongye/pxview | db70dfe3c52898d3d4cc51f2feb46dc64dbbfa63 | [
"MIT"
] | 78 | 2017-09-20T15:47:24.000Z | 2022-03-01T23:41:13.000Z | src/common/actions/userNovels.js | fengzhongye/pxview | db70dfe3c52898d3d4cc51f2feb46dc64dbbfa63 | [
"MIT"
] | 100 | 2017-07-26T15:40:22.000Z | 2022-03-13T05:22:07.000Z | import qs from 'qs';
import { USER_NOVELS } from '../constants/actionTypes';
export function fetchUserNovelsSuccess(entities, items, userId, nextUrl) {
return {
type: USER_NOVELS.SUCCESS,
payload: {
userId,
entities,
items,
nextUrl,
timestamp: Date.now(),
},
};
}
export function fetchUserNovelsFailure(userId) {
return {
type: USER_NOVELS.FAILURE,
payload: {
userId,
},
};
}
export function fetchUserNovels(userId, nextUrl, refreshing = false) {
const params = qs.parse(nextUrl);
const offset = params.offset || '0';
return {
type: USER_NOVELS.REQUEST,
payload: {
userId,
offset,
nextUrl,
refreshing,
},
};
}
export function clearUserNovels(userId) {
return {
type: USER_NOVELS.CLEAR,
payload: {
userId,
},
};
}
export function clearAllUserNovels() {
return {
type: USER_NOVELS.CLEAR_ALL,
};
}
| 17.444444 | 74 | 0.618896 |
9956105d86ee14c1eb8744af2ff977acb22f3431 | 1,150 | js | JavaScript | src/components/Table.js | Spring3/repeat | 35772ce3aa2399983c2ce5dd4ef05ea52a4ae786 | [
"MIT"
] | null | null | null | src/components/Table.js | Spring3/repeat | 35772ce3aa2399983c2ce5dd4ef05ea52a4ae786 | [
"MIT"
] | 7 | 2020-06-15T01:25:44.000Z | 2022-02-27T04:33:33.000Z | src/components/Table.js | Spring3/repeat | 35772ce3aa2399983c2ce5dd4ef05ea52a4ae786 | [
"MIT"
] | null | null | null | import React from 'react';
import PropTypes from 'prop-types';
import styled from '@emotion/styled';
import { css } from '@emotion/core';
const TableOfWords = styled.table`
td, th {
padding: .5rem 1rem;
border: 2px solid #eeeeee;
background: white;
}
${props => props.height && css`
display: block;
overflow-y: scroll;
th {
position: sticky;
top: 0;
}
`}
`;
const Table = ({ entries, height, width }) => {
return (
<TableOfWords width={width} height={height}>
<thead>
<tr>
<th>Word</th>
<th>Meaning</th>
</tr>
</thead>
<tbody>
{ entries.map((entry, i) => (
<tr key={i}>
<td><strong>{entry.word}</strong></td>
<td>{entry.meaning}</td>
</tr>
))}
</tbody>
</TableOfWords>
)
}
Table.propTypes = {
entries: PropTypes.arrayOf(PropTypes.shape({
word: PropTypes.string.isRequired,
meaning: PropTypes.string.isRequired
})),
height: PropTypes.string,
width: PropTypes.string
}
Table.defaultProps = {
entries: [],
width: '100%'
}
export {
Table
};
| 18.548387 | 50 | 0.550435 |
9956372609e3d3f9ab61b858a970e7d526460d16 | 1,446 | js | JavaScript | front/src/Informacion.js | rcardenas11/Parcial1-DesarrolloConTecnologiasWeb | 959272d823ffc3805b6992848669336676b3e67c | [
"MIT"
] | null | null | null | front/src/Informacion.js | rcardenas11/Parcial1-DesarrolloConTecnologiasWeb | 959272d823ffc3805b6992848669336676b3e67c | [
"MIT"
] | null | null | null | front/src/Informacion.js | rcardenas11/Parcial1-DesarrolloConTecnologiasWeb | 959272d823ffc3805b6992848669336676b3e67c | [
"MIT"
] | null | null | null | import React, { Component } from 'react'
import vegaEmbed from 'vega-embed';
class Informacion extends Component {
constructor (props) {
super(props)
this.state = {
nombre: '',
datos: [{"a":"A","b":28},{"a":"B","b":55},{"a":"C","b":43},{"a":"D","b":91},{"a":"E","b":81},{"a":"F","b":53},{"a":"G","b":19},{"a":"H","b":87},{"a":"I","b":52},{"a":"J","b":52},{"a":"K","b":52},{"a":"L","b":52},{"a":"M","b":52}],
spec: {"$schema":"https://vega.github.io/schema/vega-lite/v2.json","description":"A simple bar chart with embedded data.","data":{"name":"datos"},"mark":"bar","encoding":{"y":{"field":"a","type":"ordinal"},"x":{"field":"b","type":"quantitative"}}}
}
}
componentDidMount() {
try {
const view = vegaEmbed(this.divGrafica, this.state.spec)
.catch(error => console.log(error))
.then((res) => res.view.insert('datos', this.state.datos).run());
} catch (e) {
}
}
render () {
return (
<div>
<br />
<div class="panel-group">
<div class="panel panel-primary">
<div class="panel-heading">
Nombre: {this.props.nombre}
</div>
<div class="panel-body">
Grafica:
<div ref={(div) => this.divGrafica = div}>
</div>
</div>
</div>
</div>
</div>
);
}
}
export default Informacion; | 29.510204 | 253 | 0.476487 |
9956ad1df79a5aca8d106572b59a17eefd236ad2 | 41,059 | js | JavaScript | assets/js/study/study.js | zhao365845726/ML.LearningPlatformFront | 646f02346bc671e02ec445fecbd0e56cf13ad38b | [
"Apache-2.0"
] | null | null | null | assets/js/study/study.js | zhao365845726/ML.LearningPlatformFront | 646f02346bc671e02ec445fecbd0e56cf13ad38b | [
"Apache-2.0"
] | null | null | null | assets/js/study/study.js | zhao365845726/ML.LearningPlatformFront | 646f02346bc671e02ec445fecbd0e56cf13ad38b | [
"Apache-2.0"
] | null | null | null | var jQuery = $ || {};
(function(window, $, undefined) {
$(document).ready(function() {
var favorite_courseUrl = favoritecourseUrl(),//ajax请求地址
course_Url = courseUrl(),
exam_Url = examUrl(),
ajax_url = ajaxUrl(),
firstPage = true,//第一次初始分页
navTitle = '',//左侧导航的值
currPages = 1,//分页
html_con = '',//总内容
zoomUrl = '',
monitorexamBtnType = "1";//模拟练习题库的标准(1按顺序,2随机,3错题,4分类)
var title = decodeURI(window.location.search.split('=')[2]);//获取?后面的参数,并防止乱码
var urlId = window.location.search.substr(1).split('&')[0].split('=')[1];
var param = {
navid : urlId,
PageIndex : 1,
pagesize : 8
};
//是否登录
var isLogin = function(){
//var falg = $.cookie('userId');
//debugger
BreadCrumbs();
sildeNav();
// if(falg){
// $.ajax({
// type: "POST",
// data: {userId:falg},
// dataType: 'json',
// url: isLoginUrl(),
// crossDomain: true == !(document.all),
// success: function(data, type) {
// debugger
// if(data.status_code == 200){
// BreadCrumbs();
// sildeNav();
// }else{
// if(title == '在线学习'){
// window.location.href = '/index.html';
// }else{
// window.location.href = '/index.html?title='+title;
// }
// }
// }
// })
// }else{
// if(title == '在线学习'){
// window.location.href = '/index.html';
// }else{
// window.location.href = '/index.html?title='+title;
// }
// }
}
//面包屑
var BreadCrumbs = function(){
var mydata = eval('(' + $.cookie("myData") + ')');
if(mydata.Photograph){
$(".person_img").attr('src',mydata.Photograph);
}
$(".person_Company").html(mydata.CompanyName);
$(".person_Dept").html(mydata.DeptName);
$(".person_Account").html(mydata.Account);
$(".person_Name").html(mydata.RealName);
$(".person_Gender").html(mydata.Gender);
$(".person_IDCard").html(mydata.IDCard);
$(".person_Mobile").html(mydata.Mobile);
}
//左侧导航及右侧内容
var sildeNav = function() {
var html_l = '',isActive = '';
var url = "getnavcategorylist";
var leftName = '';
if(title == '在线学习' || title == '我的课程'){
leftName = '我的课程';
}else{
leftName = title;
}
$.ajax({
type: 'POST',
data: param,
url: ajax_url + url,
dataType: 'json',
crossDomain: true == !(document.all),
success: function(data, type) {
/*左侧*/
html_l ='<li class="displayNone mycards"><a href="/compoents/study/personalinfo.html">我的资料</a></li>';
$.each(data.data.lst_viewnavcategory, function(index, item) {
isActive = item.Name == leftName ? 'active' : '';
html_l += '<li class="'+isActive+' " data-id="'+item.CourseId+'"><a href="javascript:;">'+item.Name+'</a></li>';
});
$('.sideBar_l').html(html_l);
/*右侧--我的课程*/
handle(leftName);
/*初始左侧导航点击事件*/
sildeNavClick();
/*初始课件园地的按条件查询事件*/
StudyOptionClick();
/*初始模拟练习的分类*/
simulationPracticeClassification();
/*初始模拟练习的按条件查询事件*/
monitorexamClick();
}
});
};
var sildeNavClick = function() {
var ele = $('.sideBar_l li');
ele && ele.length > 0 && $.each(ele, function(index, item) {
var _t = this;
$(_t).on('click', function() {
$(_t).addClass('active').siblings().removeClass('active');
currPages = 1;
navTitle = $(_t).find('a').html();
$(".myCAISearch").hide();
$(".simulationExerciseSearch").hide();
$(".specialPractice").hide();
handle(navTitle);
});
});
};
//调动事件
var handle = function(navTitle){
if (!IsPC()) {
$(".studyTitle").html(navTitle);
$(".sideBar_l").hide();
}
$('.myCourse').html('');
$('.errorCenterQuestion').html('');
html_con = '';
switch (navTitle){
case '我的课程':
var url = 'minecourselist';
zoomUrl = favorite_courseUrl + url;
param = {
UserId : $.cookie("userId"),
PageIndex : 1,
PageSize : 8
};
minecourselist();
break;
case '我的考试':
var url = 'formalexamlist';
zoomUrl = exam_Url + url;
param = {
UserId : $.cookie("userId"),
PageIndex : 1,
PageSize : 8
};
formalexamlist();
break;
case '模拟练习':
url = 'monitorexamlist';
zoomUrl = exam_Url + url;
param = {
UserId : $.cookie("userId"),
PageIndex : 1,
PageSize : 8
};
$(".simulationExerciseSearch #selectSystem").val('');
$(".simulationExerciseSearch #selectSystem").attr('data-num','');
$(".simulationExerciseSearch").show();
monitorexamlist();
break;
case '每日一题':
var url = 'mineeverydayquestionlist';
zoomUrl = favorite_courseUrl + url;
param = {
UserId : $.cookie("userId"),
PageIndex : 1,
PageSize : 8
};
everydayquestionlist();
break;
case '课件园地':
var url = 'getcourselist';
zoomUrl = course_Url+url;
param = {
ClassifyId:'',
StudyOption:'',
tag:1,
PageIndex:1,
PageSize:8
};
$(".myCAISearch #selectSystem").val('');
$(".myCAISearch #selectSystem").attr('data-num','');
$(".myCAISearch").show();
countcourselist();
break;
case '我的证件':
url = 'minecertificateslist';
zoomUrl = favorite_courseUrl + url;
param = {
UserId : $.cookie("userId"),
PageIndex : 1,
PageSize : 8
};
minecertificateslist();
break;
case '查看成绩':
var url = 'lookresult';
zoomUrl = exam_Url + url;
param = {
UserId : $.cookie("userId"),
PageIndex : 1,
PageSize : 8
};
lookexamlist();
break;
case '专项练习':
var url = 'speciallist';
zoomUrl = practiseUrl() + url;
param = {
"CategoryName": "",
PageIndex : 1,
PageSize : 20
};
$(".specialPractice").show();
specialPracticelist();
break;
default :
break;
}
}
//我的课程
var minecourselist = function(){
html_con = '<li class="course_title"><span class="courselist1"><i></i>课件名称</span><span class="courselist2">课件体系</span><span class="courselist3">进修选项</span><span class="courselist4">上传时间</span><span class="courselist5">开始学习</span></li>';
$.ajax({
type: 'POST',
data: param,
url: zoomUrl,
dataType: 'json',
crossDomain: true == !(document.all),
success: function(data, type) {
if(data.data.lst_favoritecourse) {
$.each(data.data.lst_favoritecourse, function (index, item) {
if(item.Name && item.ClassifyName && item.CreateTime){
var state = '<a href="/compoents/study/course_show.html?id=' + item.CourseId + '">开始学习</a>';
var typeCon = '';
switch (Number(item.Type)){
case 1:
typeCon = '必修';
break;
case 4:
typeCon = '选修';
break;
default :
break;
}
html_con += '<li><span class="courselist1"><i></i>' + item.Name + '</span><span class="courselist2">' + item.ClassifyName + '</span><span class="courselist3">'+typeCon+'</span><span class="courselist4">' + item.CreateTime + '</span><span class="courselist5">' + state + '</span></li>';
}
})
}
$('.myCourse').html(html_con);
if(firstPage){
/*初始页码*/
page(Math.ceil(data.data.favoritecoursecount/8));
firstPage = false;
}else{
/*页码*/
$("#pageBar").whjPaging("setPage", currPages, Math.ceil(data.data.favoritecoursecount / 8));
}
}
})
}
//我的考试
var formalexamlist = function(){
html_con = '<li class="course_title"><span class="mytest1"><i></i>试卷名称</span><span class="mytest5">考试开始时间</span><span class="mytest5">考试结束时间</span><span class="mytest6">用时</span><span class="mytest2">成绩</span><span class="mytest4">考试状态</span></li>';
$.ajax({
type: 'POST',
data: param,
url: zoomUrl,
dataType: 'json',
crossDomain: true == !(document.all),
success: function(data, type) {
var curDate1 = new Date(Date.parse(data.obj.CurrentTime.replace(/-/g,"/"))); //当前时间
if(data.data) {
$.each(data.data, function (index, item) {
if(item.Name && item.ExamDuration && item.NumberOfTopics) {
var state = '';
var yclass = '';
var IsFingerprintLogin = '';
if(item.IsFingerprintLogin){
IsFingerprintLogin = "1";
}else{
IsFingerprintLogin = "0";
}
if(item.TestState == 2){
state = '<a href="/compoents/study/testLook.html?UserTPLibId=' + item.Id + '" class="test_href" target="_blank">查看试卷</a>';
}else{
var statusTest = true;//开始考试时间大于现在时间,或者开考时间没值
if(item.StartTestTime){
var StartTestTime1 = new Date(Date.parse(item.StartTestTime.replace(/-/g,"/")));
if(StartTestTime1 > curDate1){
state = '考试未开始';
statusTest = false;
}
}
if(statusTest){
var statusV = statusVal(item.TestState);
if(item.StopTestTime){
var stopTestTime = new Date(Date.parse(item.StopTestTime.replace(/-/g,"/")));
if(stopTestTime > curDate1){
state = '<a href="javascript:;" data-href="/compoents/study/test_show.html?UserTPLibId=' + item.Id + '&title='+statusV.title+'&testType=2" class="test_href" data-Finger="' + IsFingerprintLogin + '" onclick="isFinger(this);">'+statusV.name+'</a>';
}else{
state = '考试过期';
}
}else{
state = '<a href="javascript:;" data-href="/compoents/study/test_show.html?UserTPLibId=' + item.Id + '&title='+statusV.title+'&testType=2" class="test_href" data-Finger="' + IsFingerprintLogin + '" onclick="isFinger(this);">'+statusV.name+'</a>';
}
}
}
var StartTestTimeP = '--';
var StopTestTimeP = '--';
if(item.StartTestTime){
StartTestTimeP = item.StartTestTime;
}
if(item.StopTestTime){
StopTestTimeP = item.StopTestTime;
}
var whentime = 0;
if(item.ExamDuration*60 <= item.TimeConsuming){
whentime = item.ExamDuration+'分0秒';
}else{
var timeM = parseInt(item.TimeConsuming / 60);
var timeS = item.TimeConsuming % 60;
whentime = timeM+'分'+timeS+'秒';
}
html_con += '<li><span class="js-mytooltip mytest1" data-mytooltip-custom-class="align-center" data-mytooltip-offs et="-20" data-mytooltip-direction="right" data-mytooltip-template="' + item.Name + '"><i></i>' + item.Name + '</span><span class="mytest5">' + StartTestTimeP + '</span><span class="mytest5">' + StopTestTimeP + '</span><span class="mytest6">'+whentime+'</span><span class="mytest2">'+item.SumScore+'</span><span class="mytest4">' + state + '</span></li>';
}
})
}
$('.myCourse').html(html_con);
$('.js-mytooltip').myTooltip();
if(firstPage){
/*初始页码*/
page(Math.ceil(data.data.TotalCount/8));
firstPage = false;
}else{
/*页码*/
$("#pageBar").whjPaging("setPage", currPages, Math.ceil(data.obj.TotalCount / 8));
}
}
})
}
var statusVal = function(status){
var str = {'name':'','title':0};
switch(status){
case 0:
str.name = '进入考试';
str.title = 1;
return str;
break;
case 1:
str.name = '继续考试';
str.title = 0;
return str;
break;
}
}
//模拟练习[按顺序]
var monitorexamlist = function(){
html_con = '<li class="course_title"><span class="monitest1"><i></i>试卷名称</span><span class="monitest2">时长</span><span class="monitest3">题量</span><span class="monitest4">次数</span><span class="monitest6">考试开始时间</span><span class="monitest6">考试结束时间</span><span class="monitest7">用时</span><span class="monitest2">成绩</span><span class="monitest5">考试状态</span></li>';
$.ajax({
type: 'POST',
data: param,
url: zoomUrl,
dataType: 'json',
crossDomain: true == !(document.all),
success: function(data, type) {
var curDate1 = new Date(Date.parse(data.obj.CurrentTime.replace(/-/g,"/"))); //当前时间
if(data.data) {
$.each(data.data, function (index, item) {
if(item.Name && item.ExamDuration && item.NumberOfTopics && item.AttemptNumber) {
var state = '';
var yclass = '';
var IsFingerprintLogin = '';
if(item.IsFingerprintLogin){
IsFingerprintLogin = "1";
}else{
IsFingerprintLogin = "0";
}
if(item.TestState == 2){
state = '<a href="/compoents/study/testLook.html?UserTPLibId=' + item.Id + '" class="test_href" target="_blank">查看试卷</a>';
}else{
var statusTest = true;//开始考试时间大于现在时间,或者开考时间没值
if(item.StartTestTime){
var StartTestTime1 = new Date(Date.parse(item.StartTestTime.replace(/-/g,"/")));
if(StartTestTime1 > curDate1){
state = '考试未开始';
statusTest = false;
}
}
if(statusTest){
var statusV = statusVal(item.TestState);
if(item.StopTestTime){
var stopTestTime = new Date(Date.parse(item.StopTestTime.replace(/-/g,"/")));
if(stopTestTime > curDate1){
state = '<a href="javascript:;" data-href="/compoents/study/test_show.html?UserTPLibId=' + item.Id + '&title='+statusV.title+'&testType=1" onclick="isFinger(this);">'+statusV.name+'</a>';
}else{
state = '考试过期';
}
}else{
state = '<a href="javascript:;" data-href="/compoents/study/test_show.html?UserTPLibId=' + item.Id + '&title='+statusV.title+'&testType=1" onclick="isFinger(this);">'+statusV.name+'</a>';
}
}
}
var StartTestTimeP = '--';
var StopTestTimeP = '--';
if(item.StartTestTime){
StartTestTimeP = item.StartTestTime;
}
if(item.StopTestTime){
StopTestTimeP = item.StopTestTime;
}
var whentime = 0;
if(item.ExamDuration*60 <= item.TimeConsuming){
whentime = item.ExamDuration+'分0秒';
}else{
var timeM = parseInt(item.TimeConsuming / 60);
var timeS = item.TimeConsuming % 60;
whentime = timeM+'分'+timeS+'秒';
}
html_con += '<li><span class="monitest1"><i></i>' + item.Name + '</span><span class="monitest2">' + item.ExamDuration + '分</span><span class="monitest3">' + item.NumberOfTopics + '</span><span class="monitest4">' + item.AttemptNumber + '</span><span class="monitest6">' + StartTestTimeP + '</span><span class="monitest6">' + StopTestTimeP + '</span><span class="monitest7">'+whentime+'</span><span class="monitest2">'+item.SumScore+'</span><span class="monitest5">' + state + '</span></li>';
}
})
}
$('.myCourse').html(html_con);
if(firstPage){
/*初始页码*/
page(Math.ceil(data.data.TotalCount/8));
firstPage = false;
}else{
/*页码*/
$("#pageBar").whjPaging("setPage", currPages, Math.ceil(data.obj.TotalCount / 8));
}
}
})
}
//模拟练习[随机]
var monitorexamRandomlist = function(){
html_con = '<li class="course_title"><span class="monitest1"><i></i>试卷名称</span><span class="monitest2">时长</span><span class="monitest3">题量</span><span class="monitest4">次数</span><span class="monitest6">考试开始时间</span><span class="monitest6">考试结束时间</span><span class="monitest7">用时</span><span class="monitest2">成绩</span><span class="monitest5">考试状态</span></li>';
$.ajax({
type: 'POST',
data: param,
url: zoomUrl,
dataType: 'json',
crossDomain: true == !(document.all),
success: function(data, type) {
var curDate1 = new Date(Date.parse(data.obj.CurrentTime.replace(/-/g,"/"))); //当前时间
if(data.data) {
$.each(data.data, function (index, item) {
if(item.Name && item.ExamDuration && item.NumberOfTopics && item.AttemptNumber) {
var state = '';
var yclass = '';
var IsFingerprintLogin = '';
if(item.IsFingerprintLogin){
IsFingerprintLogin = "1";
}else{
IsFingerprintLogin = "0";
}
if(item.TestState == 2){
state = '<a href="/compoents/study/testLook.html?UserTPLibId=' + item.Id + '" class="test_href" target="_blank">查看试卷</a>';
}else{
var statusTest = true;//开始考试时间大于现在时间,或者开考时间没值
if(item.StartTestTime){
var StartTestTime1 = new Date(Date.parse(item.StartTestTime.replace(/-/g,"/")));
if(StartTestTime1 > curDate1){
state = '考试未开始';
statusTest = false;
}
}
if(statusTest){
var statusV = statusVal(item.TestState);
if(item.StopTestTime){
var stopTestTime = new Date(Date.parse(item.StopTestTime.replace(/-/g,"/")));
if(stopTestTime > curDate1){
state = '<a href="javascript:;" data-href="/compoents/study/test_show.html?UserTPLibId=' + item.Id + '&title='+statusV.title+'&testType=1" onclick="isFinger(this);">'+statusV.name+'</a>';
}else{
state = '考试过期';
}
}else{
state = '<a href="javascript:;" data-href="/compoents/study/test_show.html?UserTPLibId=' + item.Id + '&title='+statusV.title+'&testType=1" onclick="isFinger(this);">'+statusV.name+'</a>';
}
}
}
var StartTestTimeP = '--';
var StopTestTimeP = '--';
if(item.StartTestTime){
StartTestTimeP = item.StartTestTime;
}
if(item.StopTestTime){
StopTestTimeP = item.StopTestTime;
}
var whentime = 0;
if(item.ExamDuration*60 <= item.TimeConsuming){
whentime = item.ExamDuration+'分0秒';
}else{
var timeM = parseInt(item.TimeConsuming / 60);
var timeS = item.TimeConsuming % 60;
whentime = timeM+'分'+timeS+'秒';
}
html_con += '<li><span class="monitest1"><i></i>' + item.Name + '</span><span class="monitest2">' + item.ExamDuration + '分</span><span class="monitest3">' + item.NumberOfTopics + '</span><span class="monitest4">' + item.AttemptNumber + '</span><span class="monitest6">' + StartTestTimeP + '</span><span class="monitest6">' + StopTestTimeP + '</span><span class="monitest7">'+whentime+'</span><span class="monitest2">'+item.SumScore+'</span><span class="monitest5">' + state + '</span></li>';
}
})
}
$('.myCourse').html(html_con);
if(firstPage){
/*初始页码*/
page(Math.ceil(data.data.TotalCount/8));
firstPage = false;
}else{
/*页码*/
$("#pageBar").whjPaging("setPage", currPages, Math.ceil(data.obj.TotalCount / 8));
}
}
})
}
//模拟练习按钮
var monitorexamClick = function(){
var ele = $('.monitorexamClick');
ele && ele.length > 0 && $.each(ele, function(index, item) {
var _t = this,url = '';
$(_t).on('click', function() {
$(_t).addClass('active').siblings().removeClass('active');
currPages = 1;
html_con = '';
var typeBtn = $(_t).attr('data-num');
switch(typeBtn){
case "1":
monitorexamBtnType = "1";
url = 'monitorexamlist';
zoomUrl = exam_Url + url;
$('.myCourse').html('');
$('.errorCenterQuestion').html('');
monitorexamlist();
break;
case "2":
monitorexamBtnType = "2";
url = 'monitorexamrandomlist';
zoomUrl = exam_Url + url;
$('.myCourse').html('');
$('.errorCenterQuestion').html('');
monitorexamRandomlist();
break;
case "3":
monitorexamBtnType = "3";
url = 'errorquestionlist';
zoomUrl = ajax_url + url;
$('.myCourse').html('');
$('.errorCenterQuestion').html('');
$("#pageBar").whjPaging("setPage", 0, 0);
errorcenterlist();
break;
case "4":
if($(".classifyQuestionBank #selectSystem").val()){
monitorexamBtnType = "4";
url = 'paperclassificationlist';
zoomUrl = exam_Url + url;
$('.myCourse').html('');
$('.errorCenterQuestion').html('');
param.Id = $(".classifyQuestionBank #selectSystem").val();
simulationPracticeClassificationList();
}
break;
}
});
});
}
//模拟练习分类
var simulationPracticeClassification = function(){
var html = '';
html = '<option value="">==请选择==</option>';
$.ajax({
type: 'POST',
data: {},
url: exam_Url + 'paperclassification',
dataType: 'json',
crossDomain: true == !(document.all),
success: function(data, type) {
if(data) {
$.each(data, function (index, item) {
html += '<option value="' + item.Id + '">' + item.Name + '</option>';
})
}
$(".classifyQuestionBank #selectSystem").html(html);
}
})
}
//模拟练习分类列表
var simulationPracticeClassificationList = function(){
html_con = '<li class="course_title"><span class="monitest1"><i></i>试卷名称</span><span class="monitest2">时长</span><span class="monitest3">题量</span><span class="monitest4">次数</span><span class="monitest6">考试开始时间</span><span class="monitest6">考试结束时间</span><span class="monitest7">用时</span><span class="monitest2">成绩</span><span class="monitest5">考试状态</span></li>';
$.ajax({
type: 'POST',
data: param,
url: zoomUrl,
dataType: 'json',
crossDomain: true == !(document.all),
success: function(data, type) {
var curDate1 = new Date(Date.parse(data.obj.CurrentTime.replace(/-/g,"/"))); //当前时间
if(data.data) {
$.each(data.data, function (index, item) {
if(item.Name && item.ExamDuration && item.NumberOfTopics && item.AttemptNumber) {
var state = '';
var yclass = '';
var IsFingerprintLogin = '';
if(item.IsFingerprintLogin){
IsFingerprintLogin = "1";
}else{
IsFingerprintLogin = "0";
}
if(item.TestState == 2){
state = '<a href="/compoents/study/testLook.html?UserTPLibId=' + item.Id + '" class="test_href" target="_blank">查看试卷</a>';
}else{
var statusTest = true;//开始考试时间大于现在时间,或者开考时间没值
if(item.StartTestTime){
var StartTestTime1 = new Date(Date.parse(item.StartTestTime.replace(/-/g,"/")));
if(StartTestTime1 > curDate1){
state = '考试未开始';
statusTest = false;
}
}
if(statusTest){
var statusV = statusVal(item.TestState);
if(item.StopTestTime){
var stopTestTime = new Date(Date.parse(item.StopTestTime.replace(/-/g,"/")));
if(stopTestTime > curDate1){
state = '<a href="javascript:;" data-href="/compoents/study/test_show.html?UserTPLibId=' + item.Id + '&title='+statusV.title+'&testType=1" onclick="isFinger(this);">'+statusV.name+'</a>';
}else{
state = '考试过期';
}
}else{
state = '<a href="javascript:;" data-href="/compoents/study/test_show.html?UserTPLibId=' + item.Id + '&title='+statusV.title+'&testType=1" onclick="isFinger(this);">'+statusV.name+'</a>';
}
}
}
var StartTestTimeP = '--';
var StopTestTimeP = '--';
if(item.StartTestTime){
StartTestTimeP = item.StartTestTime;
}
if(item.StopTestTime){
StopTestTimeP = item.StopTestTime;
}
var whentime = 0;
if(item.ExamDuration*60 <= item.TimeConsuming){
whentime = item.ExamDuration+'分0秒';
}else{
var timeM = parseInt(item.TimeConsuming / 60);
var timeS = item.TimeConsuming % 60;
whentime = timeM+'分'+timeS+'秒';
}
html_con += '<li><span class="monitest1"><i></i>' + item.Name + '</span><span class="monitest2">' + item.ExamDuration + '分</span><span class="monitest3">' + item.NumberOfTopics + '</span><span class="monitest4">' + item.AttemptNumber + '</span><span class="monitest6">' + StartTestTimeP + '</span><span class="monitest6">' + StopTestTimeP + '</span><span class="monitest7">'+whentime+'</span><span class="monitest2">'+item.SumScore+'</span><span class="monitest5">' + state + '</span></li>';
}
})
}
$('.myCourse').html(html_con);
if(firstPage){
/*初始页码*/
page(Math.ceil(data.data.TotalCount/8));
firstPage = false;
}else{
/*页码*/
$("#pageBar").whjPaging("setPage", currPages, Math.ceil(data.obj.TotalCount / 8));
}
}
})
}
//错误中心
var errorcenterlist= function(){
$.ajax({
type: 'POST',
data: {UserId: $.cookie('userId')},
url: zoomUrl,
dataType: 'json',
crossDomain: true == !(document.all),
success: function(data, type) {
if(data.data) {
errorCenterQuestions.init(data);
}
}
})
}
//每日一题
var everydayquestionlist = function(){
html_con = '<li class="course_title"><span class="everydaytest1"><i></i>日期</span><span class="everydaytest2">完成状况</span><span class="everydaytest3">试卷状态</span></li>';
$.ajax({
type: 'POST',
data: param,
url: zoomUrl,
dataType: 'json',
crossDomain: true == !(document.all),
success: function(data, type) {
if(data.data.lst_everydayquestion) {
$.each(data.data.lst_everydayquestion, function (index, item) {
if(item.QuestionTime) {
var state = '';
var stateType = '';
if (!Number(item.IsAnswer)) {
state = '<a href="/compoents/study/day_show.html?EverydayQuestionId=' + item.Id + '&title=0">进入答题</a>';
stateType = '未完成';
} else {
state = '<a href="/compoents/study/day_show.html?EverydayQuestionId=' + item.Id + '&title=1">查看结果</a>';
stateType = '已完成';
}
html_con += '<li><span class="everydaytest1"><i></i>' + item.QuestionTime + '</span><span class="everydaytest2">' + stateType + '</span><span class="everydaytest3">' + state + '</span></li>';
}
})
}
$('.myCourse').html(html_con);
if(firstPage){
/*初始页码*/
page(Math.ceil(data.data.everydayquestioncount/8));
firstPage = false;
}else{
/*页码*/
$("#pageBar").whjPaging("setPage", currPages, Math.ceil(data.data.everydayquestioncount / 8));
}
}
})
}
//课件园地
var countcourselist = function(){
html_con = '<li class="course_title"><span class="coursecount1"><i></i>课件名称</span><span class="coursecount2">课程量</span><span class="coursecount3">进修项</span><span class="coursecount4">下载</span><span class="coursecount5">开始学习</span></li>';
$.ajax({
type: 'POST',
data: param,
url: zoomUrl,
dataType: 'json',
crossDomain: true == !(document.all),
success: function(data, type) {
if(data.data.lst_course) {
$.each(data.data.lst_course, function (index, item) {
if(item.Name && item.CourseCount && item.StudyOption) {
var state = '<a href="/compoents/study/course_show.html?id=' + item.Id + '">开始学习</a>';
var StudyOption = '';
if (item.StudyOption == 1) {
StudyOption = '必修';
} else {
StudyOption = '选修';
}
var isLoad = '';
if (item.IsSupportDownload == 1) {
isLoad = '<div class="yesLoad cursor blue" data-id="'+item.Id+'">下载</div>';
} else {
isLoad = '未提供';
}
html_con += '<li><span class="coursecount1"><i></i>' + item.Name + '</span><span class="coursecount2">' + item.CourseCount + '</span><span class="coursecount3">' + StudyOption + '</span><span class="coursecount4">' + isLoad + '</span><span class="coursecount5">' + state + '</span></li>';
}
})
}
$('.myCourse').html(html_con);
/*下载*/
yesLoadCourse();
if(firstPage){
/*初始页码*/
page(Math.ceil(data.data.coursecount/8));
firstPage = false;
}else{
/*页码*/
$("#pageBar").whjPaging("setPage", currPages, Math.ceil(data.data.coursecount/ 8));
}
}
})
}
//课件园地(进修选项)
var StudyOptionClick = function(){
$("#CAIBtn").click(function() {
var StudyOptionNum = $.trim($(".myCAISearch #selectSystem").val());
var dataNum = $.trim($(".myCAISearch #selectSystem").attr('data-num'));
if (StudyOptionNum !== dataNum) {
param.StudyOption = Number(StudyOptionNum);
currPages = 1;
$(".myCAISearch #selectSystem").attr('data-num', StudyOptionNum);
countcourselist();
}
})
}
//课程下载
var yesLoadCourse = function(){
var ele = $('.yesLoad');
ele && ele.length > 0 && $.each(ele, function(index, item) {
var _t = this;
$(_t).on('click', function() {
var id = $(_t).attr('data-id');
var loadParam = {
"Id": id
};
var url = 'coursedownloadtozip';
$.ajax({
type: "POST",
data: loadParam,
dataType: 'json',
url: course_Url + url,
crossDomain: true == !(document.all),
success: function(data, type) {
if (data.status_code == 200) {
var loadhref = data.data;
$("#downloadtozip").attr('href',loadhref);
document.getElementById("downloadtozip").click();
}
}
})
});
});
}
//我的证件
var minecertificateslist = function(){
html_con += '<li class="course_title"><span class="cates1"><i></i>日期</span><span class="cates2">证件名称</span><span class="cates3">查看</span></li>';
$.ajax({
type: 'POST',
data: param,
url: zoomUrl,
dataType: 'json',
crossDomain: true == !(document.all),
success: function(data, type) {
if(data.data.lst_certificates) {
$.each(data.data.lst_certificates, function (index, item) {
if(item.IssuingDate && item.CertificationWork) {
var state = '<a href="/compoents/study/care_show.html?id=' + item.Id + '">查看</a>';
html_con += '<li><span class="cates1"><i></i>' + item.IssuingDate + '</span><span class="cates2">' + item.CertificationWork + '</span><span class="cates3">' + state + '</span></li>';
}
})
}
$('.myCourse').html(html_con);
if(firstPage){
/*初始页码*/
page(Math.ceil(data.data.certificatescount/8));
firstPage = false;
}else{
/*页码*/
$("#pageBar").whjPaging("setPage", currPages, Math.ceil(data.data.certificatescount / 8));
}
}
})
}
//查看成绩
var lookexamlist = function(){
html_con = '<li class="course_title"><span class="mytests1"><i></i>试卷名称</span><span class="mytests2">考试类型</span><span class="mytests3">开始考试时间</span><span class="mytests4">结束考试时间</span><span class="mytests2">分数</span><span class="mytests2">用时</span><span class="mytests5">查看试卷</span></li>';
$.ajax({
type: 'POST',
data: param,
url: zoomUrl,
dataType: 'json',
crossDomain: true == !(document.all),
success: function(data, type) {
if(data.data) {
$.each(data.data, function (index, item) {
if(item.Name && item.StartTestTime && item.StopTestTime) {
var examType = item.ExamType;
if(examType == 2){
examType = '正式考试';
}else{
examType = '模拟考试';
}
var state = '<a href="/compoents/study/testLook.html?UserTPLibId=' + item.Id + '" target="_blank">查看试卷</a>';
var whentime = 0;
if(item.ExamDuration*60 <= item.TestTime){
whentime = item.ExamDuration+'分0秒';
}else{
var timeM = parseInt(item.TestTime / 60);
var timeS = item.TestTime % 60;
whentime = timeM+'分'+timeS+'秒';
}
html_con += '<li><span class="mytests1"><i></i>' + item.Name + '</span><span class="mytests2">'+examType+'</span><span class="mytests3">' + item.StartTestTime + '</span><span class="mytests4">' + item.StopTestTime + '</span><span class="mytests2">' + item.SumScore + '</span><span class="mytests2">'+whentime+'</span><span class="mytests5">' + state + '</span></li>';
}
})
}
$('.myCourse').html(html_con);
if(firstPage){
/*初始页码*/
page(Math.ceil(data.obj.TotalCount / 8));
firstPage = false;
}else{
/*页码*/
$("#pageBar").whjPaging("setPage", currPages, Math.ceil(data.obj.TotalCount / 8));
}
}
})
}
//专项练习
var specialPracticelist = function(){
html_con = '';
$.ajax({
type: 'POST',
data: param,
url: zoomUrl,
dataType: 'json',
crossDomain: true == !(document.all),
success: function(data, type) {
console.log(data.data);
if(data.data) {
$.each(data.data, function (index, item) {
html_con += '<div class="specialPracticelist"><a href="/compoents/study/practice_show.html?CategoryId=' + item.CategoryId + '&num='+item.Total+'">'+item.Name+'('+item.Total+')</a></div>';
})
}
$('.myCourse').html(html_con);
if(firstPage){
/*初始页码*/
page(Math.ceil(data.obj.TotalCount/20));
firstPage = false;
}else{
/*页码*/
$("#pageBar").whjPaging("setPage", currPages, Math.ceil(data.obj.TotalCount / 20));
}
}
})
}
//课件园地(进修选项)
var StudyOptionClick = function(){
$("#specialPracticeButton").click(function() {
var specialPracticeInput = $.trim($("#specialPracticeInput").val());
if (specialPracticeInput !== undefined) {
currPages = 1;
param.CategoryName = specialPracticeInput
specialPracticelist();
}
})
}
//分页逻辑
var page = function(i) {
$('#pageBar').whjPaging({
totalPage: i,
showPageNum: 4,
isShowFL: true,//首末页面
isShowPageSizeOpt: false,
isShowSkip: false,
isShowRefresh: false,
isShowTotalPage: false,
isResetPage: true,
callBack: function (currPage, pageSize) {
param.PageIndex = currPage;
currPages = currPage;
switch (navTitle){
case '我的考试':
formalexamlist();
break;
case '模拟练习':
switch(monitorexamBtnType){
case "1":
monitorexamlist();
break;
case "2":
monitorexamRandomlist();
break;
case "3":
break;
case "4":
simulationPracticeClassificationList();
break;
}
break;
case '每日一题':
everydayquestionlist();
break;
case '课件园地':
countcourselist();
break;
case '我的证件':
minecertificateslist();
break;
case '查看成绩':
lookexamlist();
break;
case '专项练习':
specialPracticelist();
break;
default :
minecourselist(); //我的课程
break;
}
}
});
};
//导航渲染
var navDom = function(data) {
var html='',url = '',isActive,className = '',num = '';
$.each(data, function(index, item) {
switch (item.Name) {
case '首页':
url = '/index.html';
break;
case '机构简介':
className = 'nav_intro';
num = item.Id;
url = '/compoents/file/introduction.html?id=' + item.Id + '&title=' + item.Name;
break;
case '文件制度':
className = 'nav_file';
num = item.Id;
url = '/compoents/file/file.html?id=' + item.Id + '&title=' + item.Name;
break;
case '安全培训':
className = 'nav_safety';
num = item.Id;
url = '/compoents/file/file.html?id=' + item.Id + '&title=' + item.Name;
break;
case "素质提升":
className = 'nav_quality';
num = item.Id;
url = '/compoents/file/file.html?id=' + item.Id + '&title=' + item.Name;
break;
case '在线学习':
className = 'nav_study';
num = item.Id;
url = '/compoents/study/study.html?id=' + item.Id + '&title=' + item.Name;
break;
case "讲师基地":
className = 'nav_teacher';
num = item.Id;
url = '/compoents/lecturer/lecturer.html?title=讲师风采';
break;
case "调查评估":
className = 'nav_investigation';
num = item.Id;
url = '/compoents/survey/survey.html?id=' + item.Id + '&title=' + item.Name;
break;
case "大师工作室":
className = 'nav_work';
num = item.Id;
url = '/compoents/file/file.html?id=' + item.Id + '&title=' + item.Name;
break;
case "联系我们":
className = 'nav_contact';
num = item.Id;
url = '/compoents/contact/contact.html?title=' + item.Name;
break;
default :
break;
}
isActive = item.Name == '在线学习' ? 'active' : '';
/*拼接dom*/
html +='<li class="'+isActive+' '+className+'" id_num="'+num+'"><a href="'+url+'">' + item.Name + '</a></li>';
});
$('.nav').html(html);
$(".mobileNavLists").html(html);
}
//初始数据请求
var init = function() {
var url = "homenavigation";
$.ajax({
type: "POST",
data: "",
dataType: 'json',
url: ajax_url + url,
crossDomain: true == !(document.all),
success: function(data, type) {
if (data.status_code == 200) {
navDom(data.data);
init_second();
}
}
})
};
var init_second = function(){
isLogin();
seachFun();
seachMobileFun();
$('.footer').load('/compoents/common/footer.html');
Friendlink();
};
init();
})
})(window, jQuery);
//正式考试指纹登录
function isFinger(obj){
if(IsPC()){
var href = $(obj).attr('data-href');
var locationStr = href.split('?')[1].split('&');
var status = locationStr[1].split('=')[1];
var isMockExamination = locationStr[2].split('=')[1];
if(status == 1){
var UserTPLibId = locationStr[0].split('=')[1];
window.localStorage.removeItem("saveAnswers"+$.cookie('userId')+UserTPLibId);
}
if(Number(isMockExamination) == 1){ //模拟考试
window.location.href = href;
return true;
}
var isFingerParam = $(obj).attr('data-finger');
$(".myCourse li .test_href").removeClass('isFinger');
if(isFingerParam == "1"){
var param = href.split("?")[1];
window.location.href = '/compoents/study/testLogin.html?' + param;
return false;
}
window.location.href = href;
}
} | 37.428441 | 499 | 0.515478 |
9956ffd81066f1c21b9b49e1a50e0ae587a757f3 | 8,986 | js | JavaScript | App/Lib/apisauce/dist/apisauce.js | HyphenateInc/hyphenate-react-native | 71e24b8f8766602521a6d760063173d0993075c1 | [
"MIT"
] | 13 | 2017-03-16T01:52:45.000Z | 2021-07-27T10:18:09.000Z | App/Lib/apisauce/dist/apisauce.js | HyphenateInc/hyphenate-react-native | 71e24b8f8766602521a6d760063173d0993075c1 | [
"MIT"
] | 5 | 2017-05-22T14:46:46.000Z | 2022-02-10T12:44:05.000Z | App/Lib/apisauce/dist/apisauce.js | HyphenateInc/hyphenate-react-native | 71e24b8f8766602521a6d760063173d0993075c1 | [
"MIT"
] | 2 | 2018-06-16T21:31:43.000Z | 2019-07-29T07:15:53.000Z | 'use strict';
Object.defineProperty(exports, '__esModule', {value: true});
function _interopDefault(ex) {
return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex;
}
var axios = _interopDefault(require('../../axios'));
var R = _interopDefault(require('ramda'));
var RS = _interopDefault(require('ramdasauce'));
var _extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
// check for an invalid config
var isInvalidConfig = R.anyPass([R.isNil, R.isEmpty, R.complement(R.has('baseURL')), R.complement(R.propIs(String, 'baseURL')), R.propSatisfies(R.isEmpty, 'baseURL')]);
// the default headers given to axios
var DEFAULT_HEADERS = {
'Accept': 'application/json',
'Content-Type': 'application/json'
};
// the default configuration for axios, default headers will also be merged in
var DEFAULT_CONFIG = {
timeout: 0
};
var NONE = null;
var CLIENT_ERROR = 'CLIENT_ERROR';
var SERVER_ERROR = 'SERVER_ERROR';
var TIMEOUT_ERROR = 'TIMEOUT_ERROR';
var CONNECTION_ERROR = 'CONNECTION_ERROR';
var NETWORK_ERROR = 'NETWORK_ERROR';
var UNKNOWN_ERROR = 'UNKNOWN_ERROR';
var TIMEOUT_ERROR_CODES = ['ECONNABORTED'];
var NODEJS_CONNECTION_ERROR_CODES = ['ENOTFOUND', 'ECONNREFUSED', 'ECONNRESET'];
var in200s = RS.isWithin(200, 299);
var in400s = RS.isWithin(400, 499);
var in500s = RS.isWithin(500, 599);
/**
Creates a instance of our API using the configuration.
*/
var create = function create(config) {
// quick sanity check
if (isInvalidConfig(config)) throw new Error('config must have a baseURL');
// combine the user's defaults with ours
var headers = R.merge(DEFAULT_HEADERS, config.headers || {});
var combinedConfig = R.merge(DEFAULT_CONFIG, R.dissoc('headers', config));
// create the axios instance
var instance = axios.create(combinedConfig);
var monitors = [];
var addMonitor = function addMonitor(monitor) {
monitors.push(monitor);
};
var requestTransforms = [];
var responseTransforms = [];
var addRequestTransform = function addRequestTransform(transform) {
return requestTransforms.push(transform);
};
var addResponseTransform = function addResponseTransform(transform) {
return responseTransforms.push(transform);
};
// convenience for setting new request headers
var setHeader = function setHeader(name, value) {
headers[name] = value;
return instance;
};
// sets headers in bulk
var setHeaders = function setHeaders(headers) {
var keys = R.keys(headers);
R.forEach(function (header) {
return setHeader(header, headers[header]);
}, keys);
return instance;
};
/**
Make the request for GET, HEAD, DELETE
*/
var doRequestWithoutBody = function doRequestWithoutBody(method, url) {
var params = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
var axiosConfig = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3];
return doRequest(R.merge({url: url, params: params, method: method}, axiosConfig));
};
/**
Make the request for POST, PUT, PATCH
*/
var doRequestWithBody = function doRequestWithBody(method, url) {
var data = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2];
var axiosConfig = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3];
return doRequest(R.merge({url: url, method: method, data: data}, axiosConfig));
};
/**
Make the request with this config!
*/
var doRequest = function doRequest(axiosRequestConfig) {
var startedAt = RS.toNumber(new Date());
axiosRequestConfig.headers = _extends({}, headers, axiosRequestConfig.headers);
// add the request transforms
if (requestTransforms.length > 0) {
(function () {
// create an object to feed through the request transforms
var request = R.pick(['url', 'method', 'data', 'headers', 'params'], axiosRequestConfig);
// go go go!
R.forEach(function (transform) {
return transform(request);
}, requestTransforms);
// overwrite our axios request with whatever our object looks like now
axiosRequestConfig = R.merge(axiosRequestConfig, request);
})();
}
// first convert the axios response, then execute our callback
var chain = R.pipe(R.partial(convertResponse, [startedAt]), runMonitors);
// Make the request and execute the identical pipeline for both promise paths.
return instance.request(axiosRequestConfig).then(chain).catch(chain);
};
/**
Fires after we convert from axios' response into our response. Exceptions
raised for each monitor will be ignored.
*/
var runMonitors = function runMonitors(ourResponse) {
monitors.forEach(function (fn) {
try {
fn(ourResponse);
} catch (error) {
// all monitor complaints will be ignored
}
});
return ourResponse;
};
/**
Converts an axios response/error into our response.
*/
var convertResponse = function convertResponse(startedAt, axiosResponse) {
var end = RS.toNumber(new Date());
var duration = end - startedAt;
// new in Axios 0.13 -- some data could be buried 1 level now
var isError = axiosResponse instanceof Error;
var response = isError ? axiosResponse.response : axiosResponse;
var status = response && response.status || null;
var problem = isError ? getProblemFromError(axiosResponse) : getProblemFromStatus(status);
var ok = in200s(status);
var config = axiosResponse.config || null;
var headers = response && response.headers || null;
var data = response && response.data || null;
// give an opportunity for anything to the response transforms to change stuff along the way
if (responseTransforms.length > 0) {
R.forEach(function (transform) {
transform({
duration: duration,
problem: problem,
ok: ok,
status: status,
headers: headers,
config: config,
data: data
});
}, responseTransforms);
}
return {duration: duration, problem: problem, ok: ok, status: status, headers: headers, config: config, data: data};
};
/**
What's the problem for this response?
TODO: We're losing some error granularity, but i'm cool with that
until someone cares.
*/
var getProblemFromError = function getProblemFromError(error) {
// first check if the error message is Network Error (set by axios at 0.12) on platforms other than NodeJS.
if (error.message === 'Network Error') return NETWORK_ERROR;
// then check the specific error code
return R.cond([
// if we don't have an error code, we have a response status
[R.isNil, function () {
return getProblemFromStatus(error.response.status);
}], [R.contains(R.__, TIMEOUT_ERROR_CODES), R.always(TIMEOUT_ERROR)], [R.contains(R.__, NODEJS_CONNECTION_ERROR_CODES), R.always(CONNECTION_ERROR)], [R.T, R.always(UNKNOWN_ERROR)]])(error.code);
};
/**
* Given a HTTP status code, return back the appropriate problem enum.
*/
var getProblemFromStatus = function getProblemFromStatus(status) {
return R.cond([[R.isNil, R.always(UNKNOWN_ERROR)], [in200s, R.always(NONE)], [in400s, R.always(CLIENT_ERROR)], [in500s, R.always(SERVER_ERROR)], [R.T, R.always(UNKNOWN_ERROR)]])(status);
};
// create the base object
var sauce = {
axiosInstance: instance,
monitors: monitors,
addMonitor: addMonitor,
requestTransforms: requestTransforms,
responseTransforms: responseTransforms,
addRequestTransform: addRequestTransform,
addResponseTransform: addResponseTransform,
setHeader: setHeader,
setHeaders: setHeaders,
headers: headers,
get: R.partial(doRequestWithoutBody, ['get']),
delete: R.partial(doRequestWithoutBody, ['delete']),
head: R.partial(doRequestWithoutBody, ['head']),
post: R.partial(doRequestWithBody, ['post']),
put: R.partial(doRequestWithBody, ['put']),
patch: R.partial(doRequestWithBody, ['patch'])
};
// send back the sauce
return sauce;
};
var apisauce = {
DEFAULT_HEADERS: DEFAULT_HEADERS,
NONE: NONE,
CLIENT_ERROR: CLIENT_ERROR,
SERVER_ERROR: SERVER_ERROR,
TIMEOUT_ERROR: TIMEOUT_ERROR,
CONNECTION_ERROR: CONNECTION_ERROR,
NETWORK_ERROR: NETWORK_ERROR,
UNKNOWN_ERROR: UNKNOWN_ERROR,
create: create
};
exports.DEFAULT_HEADERS = DEFAULT_HEADERS;
exports.NONE = NONE;
exports.CLIENT_ERROR = CLIENT_ERROR;
exports.SERVER_ERROR = SERVER_ERROR;
exports.TIMEOUT_ERROR = TIMEOUT_ERROR;
exports.CONNECTION_ERROR = CONNECTION_ERROR;
exports.NETWORK_ERROR = NETWORK_ERROR;
exports.UNKNOWN_ERROR = UNKNOWN_ERROR;
exports.create = create;
exports['default'] = apisauce;
| 33.655431 | 200 | 0.684175 |
995756eae7dcb165fc496a9374ae3dd4c40627cc | 1,055 | js | JavaScript | src/store/actions/index.js | DamianMullins/coinage | 62a19d372a912ec50d2790f60b9f6577fe95b618 | [
"MIT"
] | null | null | null | src/store/actions/index.js | DamianMullins/coinage | 62a19d372a912ec50d2790f60b9f6577fe95b618 | [
"MIT"
] | 3 | 2019-01-03T14:19:01.000Z | 2021-01-25T14:16:46.000Z | src/store/actions/index.js | DamianMullins/coinage | 62a19d372a912ec50d2790f60b9f6577fe95b618 | [
"MIT"
] | 2 | 2019-06-05T08:34:30.000Z | 2021-01-31T04:29:22.000Z | import qs from 'qs';
import coinApi from '../../lib/coinApi';
import coinHelper from '../../lib/coinHelper';
import { isLoading } from './loading';
import {
addAllDenominations,
setStatus,
setDenomination,
applyFilters
} from './filters';
import { addAllCoins } from './coins';
import { addUserDetails } from './user';
export const setInitialState = user => async (dispatch, getState) => {
dispatch(isLoading(true));
const coins = await coinApi.getCoins(user.uid);
const denominations = coinHelper.getDenominations(coins);
const state = getState();
const { search } = state.router.location;
const { statuses } = state.coins;
const qsFilters = qs.parse(search.slice(1));
const { denomination = denominations[0], status = statuses[0] } = qsFilters;
dispatch(addUserDetails(user));
dispatch(addAllCoins(coins));
dispatch(addAllDenominations(denominations));
dispatch(setStatus(status));
dispatch(setDenomination(denomination));
dispatch(applyFilters());
dispatch(isLoading(false));
};
| 31.969697 | 79 | 0.694787 |
995758c2691eba1501d57131f4b8dd15d88564cd | 2,586 | js | JavaScript | Frontend/src/coursedashboard/grid.js | ThaiQ/Canvas-Redesign | db18a48cced485627d7d14a3aac7e2e17e174832 | [
"MIT-0"
] | null | null | null | Frontend/src/coursedashboard/grid.js | ThaiQ/Canvas-Redesign | db18a48cced485627d7d14a3aac7e2e17e174832 | [
"MIT-0"
] | 3 | 2020-11-14T05:46:27.000Z | 2020-12-12T03:01:34.000Z | Frontend/src/coursedashboard/grid.js | ThaiQ/Canvas-Redesign | db18a48cced485627d7d14a3aac7e2e17e174832 | [
"MIT-0"
] | null | null | null | import React, { useEffect, useState } from 'react';
import { checkLogin } from '../util/auth'
import { makeStyles } from '@material-ui/core/styles';
import Grid from '@material-ui/core/Grid';
import Graph from './graph'
import Card from '../components/card'
import './dashboard.css'
import Todo from './todo/todo'
import AbuCard from './card/collection'
import General from './general/general'
const useStyles = makeStyles((theme) => ({
root: {
flexGrow: 1,
},
paper: {
padding: theme.spacing(1),
textAlign: 'center',
color: theme.palette.text.secondary,
},
}));
export default function NestedGrid(props) {
const classes = useStyles();
//Making sure that user is login
const [user, setUser] = useState(localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : '');
useEffect(() => {
checkLogin(user) //redirect user to homepage if not login
}, [])
const [panel, setPanel] = useState(true)
const [panelStyle, setPanelStyle] = useState({
width: '60vw',
transition: '0.3s'
})
return (
<div id='dashboard-app'>
<Grid container spacing={4}>
<Grid container item xs={12} spacing={5}>
<Grid item xs={6}>
<h2 id='dashbc-sub'>{`Performance`}</h2>
<Card content={Graph} />
</Grid>
<Grid item xs={panel?3:4} spacing={10}>
<div style={{
display: 'flex',
flexDirection: 'row',
flexWrap: 'wrap'
}}>
<h3 id='dashbc-sub' style={panel?{
textDecoration: 'underline',
}:{textDecoration: 'none'}} className='gt cb-general' onClick={()=>{setPanel(true)}}>General</h3>
<h3 id='dashbc-sub' style={panel?{textDecoration: 'none'}:{
textDecoration: 'underline',
}} className='gt cb-todo' onClick={()=>{setPanel(false)}}>Todo List</h3>
</div>
{
panel? <General style={panelStyle} courseID={props.courseID}></General> : <Todo style={panelStyle}></Todo>
}
</Grid>
</Grid>
<Grid container item xs={12} spacing={0}>
<AbuCard></AbuCard>
</Grid>
</Grid>
</div >
);
}
| 33.153846 | 130 | 0.491879 |
9958e3a1d3a15a59ed80f489dca6ac67fccdf85f | 4,085 | js | JavaScript | src/components/indicator/index.js | Jurpp/react-native-indicators | ec56b3f601671eb355e6e101c76bc453b8e3ab6b | [
"BSD-3-Clause"
] | null | null | null | src/components/indicator/index.js | Jurpp/react-native-indicators | ec56b3f601671eb355e6e101c76bc453b8e3ab6b | [
"BSD-3-Clause"
] | null | null | null | src/components/indicator/index.js | Jurpp/react-native-indicators | ec56b3f601671eb355e6e101c76bc453b8e3ab6b | [
"BSD-3-Clause"
] | null | null | null | import PropTypes from 'prop-types';
import React, { PureComponent } from 'react';
import { Animated, Easing } from 'react-native';
export default class Indicator extends PureComponent {
static defaultProps = {
animationEasing: Easing.linear,
animationDuration: 1200,
hideAnimationDuration: 200,
animating: true,
interaction: true,
hidesWhenStopped: true,
count: 1,
};
static propTypes = {
animationEasing: PropTypes.func,
animationDuration: PropTypes.number,
hideAnimationDuration: PropTypes.number,
animating: PropTypes.bool,
interaction: PropTypes.bool,
hidesWhenStopped: PropTypes.bool,
renderComponent: PropTypes.func,
count: PropTypes.number,
};
constructor(props) {
super(props);
/*
* 0 -> 1
* | startAnimation
* | resumeAnimation
*
* 1 -> -1
* | stopAnimation
*
* -1 -> 0
* | saveAnimation
*/
this.animationState = 0;
this.savedValue = 0;
let { animating } = this.props;
this.state = {
progress: new Animated.Value(0),
hideAnimation: new Animated.Value(animating? 1 : 0),
};
}
componentDidMount() {
let { animating } = this.props;
if (animating) {
this.startAnimation();
}
}
componentDidUpdate(prevProps) {
let { animating } = this.props;
if (animating && !prevProps.animating) {
this.resumeAnimation();
}
if (!animating && prevProps.animating) {
this.stopAnimation();
}
if (animating ^ prevProps.animating) {
let { hideAnimation } = this.state;
let { hideAnimationDuration: duration } = this.props;
Animated.timing(hideAnimation, {
duration,
toValue: animating ? 1 : 0,
useNativeDriver: true,
}).start();
}
}
startAnimation() {
let { progress } = this.state;
let { interaction, animationEasing, animationDuration } = this.props;
if (0 !== this.animationState) {
return;
}
let animation = Animated
.timing(progress, {
duration: animationDuration,
easing: animationEasing,
useNativeDriver: true,
isInteraction: interaction,
toValue: 1,
});
Animated
.loop(animation)
.start();
this.animationState = 1;
}
stopAnimation() {
let { progress } = this.state;
if (1 !== this.animationState) {
return;
}
let listener = progress
.addListener(({ value }) => {
progress.removeListener(listener);
progress.stopAnimation(() => this.saveAnimation(value));
});
this.animationState = -1;
}
saveAnimation(value) {
let { animating } = this.props;
this.savedValue = value;
this.animationState = 0;
if (animating) {
this.resumeAnimation();
}
}
resumeAnimation() {
let { progress } = this.state;
let { interaction, animationDuration } = this.props;
if (0 !== this.animationState) {
return;
}
Animated
.timing(progress, {
useNativeDriver: true,
isInteraction: interaction,
duration: (1 - this.savedValue) * animationDuration,
toValue: 1,
})
.start(({ finished }) => {
if (finished) {
progress.setValue(0);
this.animationState = 0;
this.startAnimation();
}
});
this.savedValue = 0;
this.animationState = 1;
}
renderComponent(item, index) {
let { progress } = this.state;
let { renderComponent, count } = this.props;
if ('function' === typeof renderComponent) {
return renderComponent({ index, count, progress });
}
return null;
}
render() {
let { hideAnimation } = this.state;
let { count, hidesWhenStopped, ...props } = this.props;
if (hidesWhenStopped) {
props.style = []
.concat(props.style || [], { opacity: hideAnimation });
}
return (
<Animated.View {...props}>
{Array.from(new Array(count), this.renderComponent, this)}
</Animated.View>
);
}
}
| 21.165803 | 73 | 0.587271 |
9958e449ce56723eb1787e3ccc994eae0a9c0bc7 | 1,161 | js | JavaScript | node_modules/relay-runtime/lib/store/normalizeRelayPayload.js | zoe619/horse-nft | 82684a2a83bb109d9460f61c3f0463b8007b38df | [
"MIT"
] | 14 | 2022-01-13T05:11:54.000Z | 2022-03-23T03:27:28.000Z | node_modules/relay-runtime/lib/store/normalizeRelayPayload.js | zoe619/horse-nft | 82684a2a83bb109d9460f61c3f0463b8007b38df | [
"MIT"
] | 2 | 2022-02-11T03:32:35.000Z | 2022-03-02T04:36:51.000Z | node_modules/relay-runtime/lib/store/normalizeRelayPayload.js | zoe619/horse-nft | 82684a2a83bb109d9460f61c3f0463b8007b38df | [
"MIT"
] | 10 | 2022-02-09T15:14:52.000Z | 2022-03-21T18:43:12.000Z | /**
* 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.
*
*
* @format
*/
// flowlint ambiguous-object-type:error
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var RelayModernRecord = require('./RelayModernRecord');
var RelayRecordSource = require('./RelayRecordSource');
var RelayResponseNormalizer = require('./RelayResponseNormalizer');
var _require = require('./RelayStoreUtils'),
ROOT_TYPE = _require.ROOT_TYPE;
function normalizeRelayPayload(selector, payload, errors, options) {
var source = RelayRecordSource.create();
source.set(selector.dataID, RelayModernRecord.create(selector.dataID, ROOT_TYPE));
var relayPayload = RelayResponseNormalizer.normalize(source, selector, payload, options);
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, relayPayload), {}, {
errors: errors
});
}
module.exports = normalizeRelayPayload; | 33.171429 | 95 | 0.753661 |
99591143b92b55a5eb2ee380751f3e79598becef | 1,787 | js | JavaScript | client/actions/microphone.js | toomastahves/twilio-playground | f5501d8718e6d4cb2e49d0e5a2d987c4e02bf442 | [
"MIT"
] | 1 | 2022-03-08T10:53:03.000Z | 2022-03-08T10:53:03.000Z | client/actions/microphone.js | toomastahves/twilio-playground | f5501d8718e6d4cb2e49d0e5a2d987c4e02bf442 | [
"MIT"
] | 2 | 2016-06-07T09:39:27.000Z | 2016-06-15T03:27:54.000Z | client/actions/microphone.js | toomastahves/twilio-playground | f5501d8718e6d4cb2e49d0e5a2d987c4e02bf442 | [
"MIT"
] | 1 | 2016-06-06T15:18:54.000Z | 2016-06-06T15:18:54.000Z | import { START_MICROPHONE, STOP_MICROPHONE, TEXT_RESULT } from '../constants/index';
import Microphone from '../utils/Microphone';
import store from '../store/';
const micOptions = {
bufferSize: 8192
};
const mic = new Microphone(micOptions);
const textResult = (result) => {
return {
type: TEXT_RESULT,
result
};
};
export const startMicrophone = () => {
let listening = false;
const token = store.getState().tokenReducer.token;
const message = {
'action': 'start',
'content-type': 'audio/l16;rate=16000',
'interim_results': true,
'continuous': true,
'word_confidence': true,
'timestamps': true,
'max_alternatives': 3,
'inactivity_timeout': 600
};
const url = `wss://stream.watsonplatform.net/speech-to-text/api/v1/recognize?watson-token='${token}'&model=en-US_BroadbandModel`;
const socket = new WebSocket(url);
socket.onopen = () => {
listening = false;
socket.send(JSON.stringify(message));
mic.record();
};
socket.onmessage = function(evt) {
const msg = JSON.parse(evt.data);
if (msg.state === 'listening') {
if (!listening) {
mic.onAudio = function(blob) {
if (socket.readyState < 2) {
socket.send(blob);
}
};
listening = true;
} else {
console.log('MICROPHONE: Closing socket.');
socket.close();
}
}
if (msg.results) {
if(msg.results[0].final) {
store.dispatch(textResult(msg.results[0].alternatives[0].transcript));
}
}
};
socket.onclose = function(evt) {
mic.stop();
console.log('closing socket', evt);
};
return {
type: START_MICROPHONE
};
};
export const stopMicrophone = () => {
mic.stop();
return {
type: STOP_MICROPHONE
};
};
| 22.910256 | 131 | 0.604924 |
99593869b8ef8a10e3edd55dcb9b2a50e15bc9cb | 8,812 | js | JavaScript | src/views/common/api.js | ParaSLee/yixiumanager | 4aed5daf64b0b34088f89c86e8ca3b37b6e859bd | [
"MIT"
] | null | null | null | src/views/common/api.js | ParaSLee/yixiumanager | 4aed5daf64b0b34088f89c86e8ca3b37b6e859bd | [
"MIT"
] | null | null | null | src/views/common/api.js | ParaSLee/yixiumanager | 4aed5daf64b0b34088f89c86e8ca3b37b6e859bd | [
"MIT"
] | null | null | null | import ajaxLib from '../../lib/ajax';
const ajax = ajaxLib.ajax;
const url = 'https://m.yixiutech.com';
// const url = "https://yixiu.natappvip.cc";
//根据筛选条件获取商家列表
export function getShopListSort(data) {
return new Promise((resolve, reject) => {
ajax.post(`${url}/shop/filter`, data).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
})
})
}
//获取商家总数
export function getShopListAllNumber() {
return new Promise((resolve, reject) => {
ajax.get(`${url}/shop/count`).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
})
})
}
//通过商家ID获取商家详情
export function getShopData(shopId) {
return new Promise((resolve, reject) => {
ajax.get(`${url}/shop/${shopId}`).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
})
})
}
//更改商户信息
export function changeState(data) {
return new Promise((resolve, reject) => {
ajax.post(`${url}/shop/update`,data).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
})
})
}
//根据筛选条件获取订单列表
export function getOrderListData(data) {
return new Promise((resolve, reject) => {
ajax.post(`${url}/order/service/filter`, data).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
})
})
}
//根据筛选条件获取订单列表 全系统级别
export function getAllOrderListData(data) {
return new Promise((resolve, reject) => {
ajax.post(`${url}/order/filter`, data).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
})
})
}
// 管理员登录
export function managerlogin(data) {
return new Promise((resolve, reject) => {
ajax.post(`${url}/user/login/sys`, data).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
})
})
}
// 根据筛选条件获取问题详情
export function getQuestionList(data){
return new Promise((resolve, reject) => {
ajax.post(`${url}/question/filter`,data).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
});
});
}
// 修改问题信息
export function updateQuestion(data){
return new Promise((resolve, reject) => {
ajax.post(`${url}/question/update`,data).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
});
});
}
// 获取手机品牌
export function getPhoneBrand(){
return new Promise((resolve, reject) => {
ajax.get(`${url}/phone/manufacturer`).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
});
});
}
// 删除手机品牌
export function delPhoneBrand(data){
return new Promise((resolve, reject) => {
ajax.post(`${url}/phone/manufacturer/delete`,data).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
});
});
}
// 更新手机品牌
export function updataPhoneBrand(data){
return new Promise((resolve, reject) => {
ajax.post(`${url}/phone/manufacturer/update`,data).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
});
});
}
// 添加手机品牌
export function addPhoneBrand(data){
return new Promise((resolve, reject) => {
ajax.post(`${url}/phone/manufacturer`,data).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
});
});
}
// 根据手机品牌ID查询手机型号
export function getPhoneModelById(id){
return new Promise((resolve, reject) => {
ajax.get(`${url}/phone/model/${id}`).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
});
});
}
// 删除手机型号
export function delPhoneModel(data){
return new Promise((resolve, reject) => {
ajax.post(`${url}/phone/model/delete`,data).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
});
});
}
// 更新手机型号
export function updataPhoneModel(data){
return new Promise((resolve, reject) => {
ajax.post(`${url}/phone/model/update`,data).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
});
});
}
// 添加手机型号
export function addPhoneModel(data){
return new Promise((resolve, reject) => {
ajax.post(`${url}/phone/model`,data).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
});
});
}
// 获取服务分类
export function getServiceCategory(){
return new Promise((resolve, reject) => {
ajax.get(`${url}/category/phoneRepair`).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
});
});
}
// 删除服务分类
export function delServiceCategory(id){
return new Promise((resolve, reject) => {
ajax.post(`${url}/category/delete`,id).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
});
});
}
// 更新服务分类
export function updataServiceCategory(data){
return new Promise((resolve, reject) => {
ajax.post(`${url}/category/update`,data).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
});
});
}
// 添加服务分类
export function addServiceCategory(data){
return new Promise((resolve, reject) => {
ajax.post(`${url}/category`,data).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
});
});
}
// 根据服务分类ID查询服务
export function getServiceById(id){
return new Promise((resolve, reject) => {
ajax.post(`${url}/service/shop`,id).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
});
});
}
// 删除服务
export function delService(data){
return new Promise((resolve, reject) => {
ajax.post(`${url}/service/delete`,data).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
});
});
}
// 更新服务
export function updataService(data){
return new Promise((resolve, reject) => {
ajax.post(`${url}/service/update`,data).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
});
});
}
// 添加服务
export function addService(data){
return new Promise((resolve, reject) => {
ajax.post(`${url}/service`,data).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
});
});
}
// 查询所有类型
export function getALL(){
return new Promise((resolve, reject) => {
ajax.get(`${url}/category/sys?type=all`).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
});
});
}
// 获取店铺统计信息
export function getshopAllData(data){
return new Promise((resolve, reject) => {
ajax.post(`${url}/stats/shop`,data).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
});
});
}
export function getshopareaData(data){
return new Promise((resolve, reject) => {
ajax.post(`${url}/stats/area`,data).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
});
});
}
// 视频查询
export function getVideoData(data){
return new Promise((resolve, reject) => {
ajax.post(`${url}/sql/find`,data).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
});
});
}
// 视频添加
export function addVideoData(data){
return new Promise((resolve, reject) => {
ajax.post(`${url}/sql/add`,data).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
});
});
}
// 删除培训
export function delVideoData(data){
return new Promise((resolve, reject) => {
ajax.post(`${url}/sql/remove`,data).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
});
});
}
// 更新培训
export function upVideoData(data){
return new Promise((resolve, reject) => {
ajax.post(`${url}/sql/update`,data).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
});
});
}
// 发生验证短信
export function sendmessage(data){
return new Promise((resolve, reject) => {
ajax.post(`${url}/sms/send`,data).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
});
});
}
// 注册
export function useRegin(data){
return new Promise((resolve, reject) => {
ajax.post(`${url}/reg`,data).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
});
});
}
// 登录
export function useLogin(data){
return new Promise((resolve, reject) => {
ajax.post(`${url}/login`,data).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
});
});
}
// 修改密码
export function useChange(data){
return new Promise((resolve, reject) => {
ajax.post(`${url}/user/update/password`,data).then((res) => {
resolve(res);
}).then((err) => {
reject(err);
});
});
}
| 21.182692 | 71 | 0.525306 |
99593eb2b9811b295af3a373cf323a0e0fe3321e | 553 | js | JavaScript | src/commands/Animal/bird.js | Muphet/Senpai | d93a88f2cbbc9d64a0b4e8cc4cb5ca7a71e983f9 | [
"Apache-2.0"
] | 5 | 2019-04-19T22:19:50.000Z | 2020-12-26T02:16:29.000Z | src/commands/Animal/bird.js | d2grubby/YukinoBot2 | d9c29fa03c4f6c3e10c2b6028d90b3e08862ab47 | [
"Apache-2.0"
] | null | null | null | src/commands/Animal/bird.js | d2grubby/YukinoBot2 | d9c29fa03c4f6c3e10c2b6028d90b3e08862ab47 | [
"Apache-2.0"
] | 3 | 2019-05-15T06:45:27.000Z | 2020-01-07T07:40:24.000Z | const { Command } = require('klasa');
const { searchImages } = require('pixabay-api');
module.exports = class BirdCommand extends Command {
constructor(...args) {
super(...args, {
aliases: ['birb'],
botPerms: ['EMBED_MESSAGE'],
description: 'Shows a random bird'
});
}
async run(msg) {
const result = await searchImages(this.client.config.tokens.pixabay, 'bird');
const { webformatURL } = result.hits[Math.floor(Math.random() * result.hits.length)];
return msg.send(new this.client.methods.Embed().setImage(webformatURL));
}
};
| 29.105263 | 87 | 0.679928 |
9959fd75ff97994deed923fead5f504a8498158e | 7,642 | js | JavaScript | bin/fillTestData/Tribes.js | 0-stove-0/trustroots | d9e3ec05788c250f8b481e2ef872889368df7d8c | [
"MIT"
] | null | null | null | bin/fillTestData/Tribes.js | 0-stove-0/trustroots | d9e3ec05788c250f8b481e2ef872889368df7d8c | [
"MIT"
] | null | null | null | bin/fillTestData/Tribes.js | 0-stove-0/trustroots | d9e3ec05788c250f8b481e2ef872889368df7d8c | [
"MIT"
] | null | null | null | /**
* Required dependencies
*/
const _ = require('lodash');
const path = require('path');
const mongooseService = require(path.resolve('./config/lib/mongoose'));
const chalk = require('chalk');
const yargs = require('yargs');
const faker = require('faker');
const mongoose = require('mongoose');
const config = require(path.resolve('./config/config'));
/**
* Configure the script usage using yargs to obtain parameters and enforce usage.
*/
const argv = yargs.usage(
'$0 <numberOfTribes>',
'Seed database with number of tribes',
yargs => {
return yargs
.positional('numberOfTribes', {
describe: 'Number of tribes to add',
type: 'number',
})
.boolean('debug')
.boolean('limit')
.describe('debug', 'Enable extra database output (default=false)')
.describe(
'limit',
'If tribes already exist in the database, only add up to the number of tribes (default=false)',
)
.example(
'node $0 1000',
'Adds 1000 randomly seeded tribes to the database',
)
.example(
'node $0 100 --debug',
'Adds 100 randomly seeded tribes to the database with debug database output',
)
.example(
'node $0 100 --limit',
'Adds up to 100 randomly seeded tribes to the database (eg. If 20 tribes already exist, 80 tribes will be added)',
)
.check(function (argv) {
if (argv.numberOfTribes < 1) {
throw new Error('Error: Number of tribes should be greater than 0');
}
return true;
})
.strict().yargs;
},
).argv;
/**
* Hardcoded tribe image ids stored on the CDN used for seeding. These were
* last updated 2018-10-20
*/
const tribeImageUUIDs = [
'171433b0-853b-4d19-a8b4-44def956696d',
'22028fde-5302-4172-954d-f54949afd7e4',
'e69eb05f-773f-423c-9246-43629b5a8baf',
'3c8bb9f1-e313-4baa-bf4c-1d8994fd6c6c',
'd5563f29-669f-4f18-9802-d1924ff31364',
'4ff6463d-c482-4be6-9a49-294fc8712d83',
'e4466aa6-46f1-460f-94ef-8cec882d7103',
'12a2c124-a38a-4df8-8987-e01ee3741727',
'e23060e2-393d-4b4a-b469-450053538f8a',
'6274fd88-9178-4cea-8bb4-60f22e4cc904',
'fb2b6d50-9d51-4755-9b44-1395fae4cf5d',
'656e4872-15a4-4be4-8059-6e7c39b07c5d',
'e060263a-9684-4065-85f3-460e9fffbd40',
'ad2062d0-aadd-475d-bf85-2cd2e30a9d38',
'bfaf468a-2c48-4798-b1bb-bffd0c6b716b',
'0fd49df4-88e7-4380-b38a-3625e4b02dde',
'cef34c15-b527-4f89-a7a5-456f62ff9ce2',
'c84f93f1-421d-4339-a61f-a5efc2d24297',
'd4a04ce4-3aeb-43a4-882b-43b1974d86e0',
'310f68af-3e77-451e-96a7-09132d26fdb4',
'dcb0ed04-cdd6-45ea-b773-e09320a4f759',
'434018c8-4f4f-4054-9bd2-6618e9d5a77f',
'0ce0abdf-6898-4191-9a86-4f03807291b5',
'0ebcabec-2bc5-4eee-ab17-991b9dd52eae',
'4f7805e7-b5e6-4b40-bb32-3aafbe1bbc74',
'69a500a4-a16e-4c4d-9981-84fbe310d531',
];
/**
* Seeds an individual tribe with fake data. Tribe names are appended with tribeIndex
* to guarantee uniqueness.
*
* @param {object} tribe The tribe to seed.
* @param {number} tribeIndex - index to add to the tribe label
* @returns {object} Returns the seeded tribe object
*/
function seedTribe(tribe, tribeIndex) {
tribe.label = faker.lorem.word() + '_' + tribeIndex;
tribe.labelHistory = faker.random.words();
tribe.slugHistory = faker.random.words();
tribe.synonyms = faker.random.words();
tribe.color = faker.internet.color().slice(1);
tribe.count = 0;
tribe.created = Date.now();
tribe.modified = Date.now();
tribe.public = true;
tribe.image_UUID = _.sample(tribeImageUUIDs);
tribe.attribution = faker.name.findName();
tribe.attribution_url = faker.internet.url();
tribe.description = faker.lorem.sentences();
return tribe;
} // seedTribe()
/**
* This the the main method that seeds all the tribes. Based on the limit
* parameter it determines how many tribes to add. It adds the new tribes
* and prints status accordingly.
*/
function seedTribes() {
let index = 0;
const max = argv.numberOfTribes;
const debug = argv.debug === true;
const limit = argv.limit === true;
// Display number of tribes to add
console.log('Generating ' + max + ' tribes...');
if (max > 2000) {
console.log('...this might really take a while... go grab some coffee!');
}
console.log(chalk.white('--'));
console.log(chalk.green('Trustroots test tribes data'));
console.log(chalk.white('--'));
// Override debug mode to use the option set by the user
config.db.debug = debug;
// Bootstrap db connection
mongooseService.connect(() => {
mongooseService.loadModels(async () => {
const Tribe = mongoose.model('Tribe');
/**
* Adds the number of tribes using the values and options specified
* by the user
*
* @param {number} initialTribeCount - The number of tribes prior to adding
* any new tribes
* @returns {Promise} Promise that completes when all tribes have
* successfully been added.
*/
function addTribes(initialTribeCount) {
return new Promise(resolve => {
let savedTribes = 0;
// handle the limit option
if (limit) {
index = initialTribeCount;
}
// if we already hit the limit
if (index >= max) {
console.log(
chalk.green(
initialTribeCount + ' tribes already exist. No tribes created!',
),
);
console.log(chalk.white('')); // Reset to white
resolve();
}
// Add tribes until we reach the total
while (index < max) {
const tribe = new Tribe();
// seed the tribe data
seedTribe(tribe, initialTribeCount + index);
// save the newly created tribe
tribe.save(err => {
if (err != null) {
console.log(err);
} else {
// Tribe was saved successfully
process.stdout.write('.');
savedTribes += 1;
// If all tribes have been saved print a summary and
// resolve the promise.
if (
(limit && savedTribes + initialTribeCount >= max) ||
(!limit && savedTribes >= max)
) {
console.log('');
console.log(
chalk.green(
initialTribeCount + ' tribes existed in the database.',
),
);
console.log(
chalk.green(savedTribes + ' tribes successfully added.'),
);
console.log(
chalk.green(
'Database now contains ' +
(initialTribeCount + savedTribes) +
' tribes.',
),
);
console.log(chalk.white('')); // Reset to white
resolve();
}
}
});
index += 1;
}
}); // Promise
} // addAllTribes()
// This is the main sequence to add the tribes.
// * First get the current number of tribes from the database
// * Then seed all the new tribes
try {
const tribeCount = await Tribe.countDocuments();
await addTribes(tribeCount);
} catch (err) {
console.log(err);
}
// Disconnect from the database
mongooseService.disconnect();
}); // monggooseService.loadModels
}); // mongooseService.connect
} // seedTribes
seedTribes();
| 32.519149 | 122 | 0.591206 |
995a0e3bddd7fb365a07d5bbdf8d814dd953de42 | 13,863 | js | JavaScript | dist/app.bundle.js | Blocktron-Project/blocktron-cli | a110f197b9637b2d95fa803b50d50de427c9ce5e | [
"MIT"
] | null | null | null | dist/app.bundle.js | Blocktron-Project/blocktron-cli | a110f197b9637b2d95fa803b50d50de427c9ce5e | [
"MIT"
] | null | null | null | dist/app.bundle.js | Blocktron-Project/blocktron-cli | a110f197b9637b2d95fa803b50d50de427c9ce5e | [
"MIT"
] | null | null | null | #!/usr/bin/env node
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
__webpack_require__(1);
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Blocktron CLI
* A CLI tool to generate a blocktron instance.
* Written by: Sandeep Vattapparambil
* Email: sandeepv68@gmail.com
* Website: www.sandeepv.in
*/
/**
* Use strict mode
*/
var _blocktron = __webpack_require__(2);
var _blocktron2 = _interopRequireDefault(_blocktron);
var _repoUrls = __webpack_require__(3);
var _repoUrls2 = _interopRequireDefault(_repoUrls);
var _async = __webpack_require__(4);
var _async2 = _interopRequireDefault(_async);
var _figlet = __webpack_require__(5);
var _figlet2 = _interopRequireDefault(_figlet);
var _figlet3 = __webpack_require__(6);
var _figlet4 = _interopRequireDefault(_figlet3);
var _chalk = __webpack_require__(7);
var _chalk2 = _interopRequireDefault(_chalk);
var _replaceInFile = __webpack_require__(8);
var _replaceInFile2 = _interopRequireDefault(_replaceInFile);
var _child_process = __webpack_require__(9);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A helper function to augment console.log with chalk
* @name log
* @param {String} message - The message string
* @param {String} level - The type of message
*/
/**
* Replace-in-file - replace strings in files
*/
/**
* Figlet configuration
*/
/**
* async - utilities library for async operations
*/
var log = function log() {
var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
switch (level) {
case 'default':
console.log(_chalk2.default.white(message));
break;
case 'info':
console.log(_chalk2.default.blue(message));
break;
case 'success':
console.log(_chalk2.default.green(message));
break;
case 'warn':
console.log(_chalk2.default.yellow.bold(message));
break;
case 'error':
console.log(_chalk2.default.red.bold(message));
break;
default:
console.log(message);
}
return;
};
/**
* @name isWindows
* Helper function to check the current platform for Windows/Unix-ish.
* @returns {Boolean} - Returns true if Windows, else false.
*/
/**
* Exec command from child_process
* Function to Spawns a shell then executes the command within that shell, buffering any generated output.
* The command string passed to the exec function is processed directly by the shell and special
* characters (vary based on shell) need to be dealt with accordingly.
* Note: Never pass unsanitized user input to this function.
* Any input containing shell metacharacters may be used to trigger arbitrary command execution.
*/
/**
* Chalk - colorful terminal logs
*/
/**
* Figlet - render ASCII graphics in terminal
*/
var isWindows = function isWindows() {
if (/^win/i.test(process.platform)) {
return true;
} else {
return false;
}
};
/**
* @name run
* A Promise factory to execute an arbitrary shell command.
* @param {String} script - The arbitrary shell command to execute.
* @returns {<Promise>} - The promise object containing the stdout/stderr.
*/
var run = function run(script) {
return new Promise(function (resolve, reject) {
/**
* If a callback function is provided, it is called with the arguments (error, stdout, stderr).
* On success, error will be null. On error, error will be an instance of Error.
* The error.code property will be the exit code of the child process while error.signal
* will be set to the signal that terminated the process.
* Any exit code other than 0 is considered to be an error.
* The stdout and stderr arguments passed to the callback will contain the stdout and stderr
* output of the child process. By default, Node.js will decode the output as UTF-8 and pass
* strings to the callback. The encoding option can be used to specify the character encoding
* used to decode the stdout and stderr output. If encoding is 'buffer', or an unrecognized
* character encoding, Buffer objects will be passed to the callback instead.
*/
(0, _child_process.exec)(script, function (error, stdout, stderr) {
if (stderr) {
//reject promise with error
reject(stderr);
} else {
//resolve promise with success
resolve(stdout);
}
});
});
};
if (process.argv[2] && process.argv[2].length !== 0) {
var option = process.argv[2];
if (option === 'help') {
log('Help', 'info');
} else if (option === 'version') {
log('v' + _blocktron2.default.version, 'info');
} else if (option.length < 3 || !option.match(/^(\w+\.?)*\w+$/g)) {
log('Error: Please provide a valid name with minimum 3 char length', 'error');
} else {
var projectName = option;
log('Building project -> ' + projectName + '..................[START]', 'info');
/**
* Check whether git is installed or not and continue.
*/
var checkGit = 'git';
(0, _child_process.exec)(checkGit, function (data) {
if (!data) {
log(_chalk2.default.red.bold('\nError: Git is not installed'));
process.exit();
}
/**
* Clone repo
*/
var gitCommand = 'git clone ' + _repoUrls2.default.blocktronNode + ' ' + projectName;
log('Cloning repo...............................[START]', 'info');
var clone = (0, _child_process.exec)(gitCommand, function (err) {
if (err) {
log(_chalk2.default.red.bold(err));
process.exit();
}
});
clone.on('close', function () {
log('Cloning repo...............................[DONE]', 'info');
/**
* Cleanups
*/
if (isWindows) {
/**
* Cleanup project folder in WINDOWS.
*/
//remove circle ci folder
var removeCircleCI = 'rmdir ' + projectName + '\\.circleci /s /q';
//remove .github folder
var removeGithubFolder = 'rmdir ' + projectName + '\\.github /s /q';
//remove CODE_OF_CONDUCT.md
var removeCoC = 'del ' + projectName + '\\CODE_OF_CONDUCT.md /s /q';
//remove PULL_REQUEST_TEMPLATE.md
var removePullReqTemp = 'del ' + projectName + '\\PULL_REQUEST_TEMPLATE.md /s /q';
//remove CONTRIBUTING.md
var removeContrib = 'del ' + projectName + '\\CONTRIBUTING.md /s /q';
//remove LICENSE
var removeLicense = 'del ' + projectName + '\\LICENSE /s /q';
//remove travis
var removeTravis = 'del ' + projectName + '\\.travis.yml /s /q';
//remove .git
var removeGitFolder = 'rmdir ' + projectName + '\\.git /s /q';
/**
* Promisify and execute remove commands.
*/
log('Cleaning project...........................[START]', 'info');
run(removeCircleCI).then(function (command1) {
return run(removeGithubFolder);
}).then(function (command2) {
return run(removeCoC);
}).then(function (command3) {
return run(removePullReqTemp);
}).then(function (command4) {
return run(removeContrib);
}).then(function (command5) {
return run(removeLicense);
}).then(function (command6) {
return run(removeTravis);
}).then(function (command7) {
return run(removeGitFolder);
}).catch(function (error) {
log(_chalk2.default.red.bold('\nError cleaning up the project: , ' + error));
});
}
});
});
}
} else {
/**
* Bootstrap the cli after rendering the logo
*/
(0, _figlet2.default)(_blocktron2.default.name, _figlet4.default, function (err, data) {
if (err) {
log('logo rendering failed!: ' + err, 'error');
}
/**
* render the logo in bold yellow and version in blue
*/
log(data, 'warn');
log('v' + _blocktron2.default.version, 'info');
log('\nUsage:', 'info');
log('blocktron [commands]', 'info');
log('\nAvailable Commands:', 'info');
log(' help show cli help', 'info');
log(' version get cli version', 'info');
log(' . generate a new blocktron-node instance in the current directory', 'info');
log(' <project-name> generate a new blocktron-node instance in the <project-name> directory', 'info');
});
}
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
/**
* Application configuration object
*/
var _BtConfig = {
name: 'Blocktron cli',
version: '1.0.0'
};
exports.default = _BtConfig;
/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var URL_SCHEMA = {
blocktronExplorer: 'https://github.com/Blocktron-Project/blocktron-explorer.git',
blocktronNode: 'https://github.com/Blocktron-Project/blocktron-node.git'
};
exports.default = URL_SCHEMA;
/***/ }),
/* 4 */
/***/ (function(module, exports) {
module.exports = require("async");
/***/ }),
/* 5 */
/***/ (function(module, exports) {
module.exports = require("figlet");
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
/**
* Figlet configuration object
* @see {@link https://www.npmjs.com/package/figlet#font-options | Figlet-NPM}
*/
var figletConfig = {
font: 'Big',
horizontalLayout: 'fitted',
verticalLayout: 'default'
};
exports.default = figletConfig;
/***/ }),
/* 7 */
/***/ (function(module, exports) {
module.exports = require("chalk");
/***/ }),
/* 8 */
/***/ (function(module, exports) {
module.exports = require("replace-in-file");
/***/ }),
/* 9 */
/***/ (function(module, exports) {
module.exports = require("child_process");
/***/ })
/******/ ]);
//# sourceMappingURL=app.bundle.js.map | 29.558635 | 159 | 0.594172 |
995a245253cecd4f586005b5f93a1b89f8742fdf | 4,755 | js | JavaScript | montadora/js/PrintLabel.js | claytonnunes/algoritech | e3f961455c5bf2f87a5e2b5eacdf7d1acd6776c0 | [
"MIT"
] | null | null | null | montadora/js/PrintLabel.js | claytonnunes/algoritech | e3f961455c5bf2f87a5e2b5eacdf7d1acd6776c0 | [
"MIT"
] | null | null | null | montadora/js/PrintLabel.js | claytonnunes/algoritech | e3f961455c5bf2f87a5e2b5eacdf7d1acd6776c0 | [
"MIT"
] | null | null | null | (function()
{
// called when the document completly loaded
function onload()
{
var textTextArea = document.getElementById('textTextArea');
var barCode = document.getElementById('barCode');
var printButton = document.getElementById('printButton');
// prints the label
printButton.onclick = function()
{
try
{
// open label
var labelXml = '<?xml version="1.0" encoding="utf-8"?>\
<DieCutLabel Version="8.0" Units="twips">\
<PaperOrientation>Landscape</PaperOrientation>\
<Id>Text</Id>\
<PaperName>30252 Address</PaperName>\
<DrawCommands/>\
<ObjectInfo>\
<TextObject>\
<Name>Text</Name>\
<ForeColor Alpha="255" Red="0" Green="0" Blue="0" />\
<BackColor Alpha="0" Red="255" Green="255" Blue="255" />\
<LinkedObjectName></LinkedObjectName>\
<Rotation>Rotation0</Rotation>\
<IsMirrored>False</IsMirrored>\
<IsVariable>True</IsVariable>\
<HorizontalAlignment>Left</HorizontalAlignment>\
<VerticalAlignment>Middle</VerticalAlignment>\
<TextFitMode>ShrinkToFit</TextFitMode>\
<UseFullFontHeight>True</UseFullFontHeight>\
<Verticalized>False</Verticalized>\
<StyledText/>\
</TextObject>\
<Bounds X="332" Y="150" Width="4455" Height="1260" />\
</ObjectInfo>\
<ObjectInfo>\
<BarcodeObject>\
<Name>Barcode</Name>\
<ForeColor Alpha="255" Red="0" Green="0" Blue="0" />\
<BackColor Alpha="0" Red="255" Green="255" Blue="255" />\
<LinkedObjectName>BarcodeText</LinkedObjectName>\
<Rotation>Rotation0</Rotation>\
<IsMirrored>False</IsMirrored>\
<IsVariable>True</IsVariable>\
<Text>barCode</Text>\
<Type>Code128Auto</Type>\
<Size>Medium</Size>\
<TextPosition>Bottom</TextPosition>\
<TextFont Family="Arial" Size="8" Bold="False" Italic="False" Underline="False" Strikeout="False" />\
<CheckSumFont Family="Arial" Size="8" Bold="False" Italic="False" Underline="False" Strikeout="False" />\
<TextEmbedding>None</TextEmbedding>\
<ECLevel>0</ECLevel>\
<HorizontalAlignment>Center</HorizontalAlignment>\
<QuietZonesPadding Left="0" Top="0" Right="2" Bottom="0" />\
</BarcodeObject>\
<Bounds X="324" Y="950" Width="3150" Height="520" />\
</ObjectInfo>\
</DieCutLabel>';
var label = dymo.label.framework.openLabelXml(labelXml);
// set label text
label.setObjectText("Text", textTextArea.value);
label.setObjectText('Barcode', barCode.value);
// select printer to print on
// for simplicity sake just use the first LabelWriter printer
var printers = dymo.label.framework.getPrinters();
if (printers.length == 0)
throw "No DYMO printers are installed. Install DYMO printers.";
var printerName = "";
for (var i = 0; i < printers.length; ++i)
{
var printer = printers[i];
if (printer.printerType == "LabelWriterPrinter")
{
printerName = printer.name;
break;
}
}
if (printerName == "")
throw "No LabelWriter printers found. Install LabelWriter printer";
// finally print the label
label.print(printerName);
}
catch(e)
{
alert(e.message || e);
}
}
};
// register onload event
if (window.addEventListener)
window.addEventListener("load", onload, false);
else if (window.attachEvent)
window.attachEvent("onload", onload);
else
window.onload = onload;
} ()); | 44.858491 | 123 | 0.465615 |
995a81bd01b32160eec2596b1fa4a131d260cef9 | 408 | js | JavaScript | src/helper/cloudinary.js | sammychinedu2ky/missYou | d695c97f469972aad8417847da8c2763f7dc7712 | [
"MIT"
] | 2 | 2020-07-20T18:59:39.000Z | 2020-09-24T16:49:14.000Z | src/helper/cloudinary.js | sammychinedu2ky/missYou | d695c97f469972aad8417847da8c2763f7dc7712 | [
"MIT"
] | 9 | 2020-07-27T10:32:33.000Z | 2020-08-09T02:42:31.000Z | src/helper/cloudinary.js | sammychinedu2ky/missYou | d695c97f469972aad8417847da8c2763f7dc7712 | [
"MIT"
] | 1 | 2020-10-31T16:06:38.000Z | 2020-10-31T16:06:38.000Z | const multer = require('multer');
const cloudinary = require('cloudinary').v2;
const cloudinaryStorage = require('multer-storage-cloudinary');
const storage = cloudinaryStorage.createCloudinaryStorage({
cloudinary,
folder: 'memorial',
allowedFormats: ['jpg', 'png'],
transformation: [{ width: 1000, crop: 'fill' }],
});
function parser() {
return multer({ storage });
}
module.exports = parser;
| 24 | 63 | 0.708333 |
995afb57a71a9e126637776f43110d3343e67442 | 23,254 | js | JavaScript | lib/messages.js | jmul-dev/aodb | 27593d7d82cdea6ecbed4a6134512375077980b3 | [
"MIT"
] | null | null | null | lib/messages.js | jmul-dev/aodb | 27593d7d82cdea6ecbed4a6134512375077980b3 | [
"MIT"
] | 2 | 2020-07-17T19:59:16.000Z | 2021-05-10T02:59:13.000Z | lib/messages.js | jmul-dev/aodb | 27593d7d82cdea6ecbed4a6134512375077980b3 | [
"MIT"
] | null | null | null | // This file is auto generated by the protocol-buffers compiler
/* eslint-disable quotes */
/* eslint-disable indent */
/* eslint-disable no-redeclare */
/* eslint-disable camelcase */
// Remember to `npm install --save protocol-buffers-encodings`
var encodings = require('protocol-buffers-encodings')
var varint = encodings.varint
var skip = encodings.skip
var Entry = exports.Entry = {
buffer: true,
encodingLength: null,
encode: null,
decode: null
}
var InflatedEntry = exports.InflatedEntry = {
buffer: true,
encodingLength: null,
encode: null,
decode: null
}
var Header = exports.Header = {
buffer: true,
encodingLength: null,
encode: null,
decode: null
}
defineEntry()
defineInflatedEntry()
defineHeader()
function defineEntry () {
var enc = [
encodings.string,
encodings.bytes,
encodings.bool,
encodings.varint
]
Entry.encodingLength = encodingLength
Entry.encode = encode
Entry.decode = decode
function encodingLength (obj) {
var length = 0
if (!defined(obj.key)) throw new Error("key is required")
var len = enc[0].encodingLength(obj.key)
length += 1 + len
if (defined(obj.pointerKey)) {
var len = enc[0].encodingLength(obj.pointerKey)
length += 1 + len
}
if (defined(obj.schemaKey)) {
var len = enc[0].encodingLength(obj.schemaKey)
length += 1 + len
}
if (defined(obj.value)) {
var len = enc[1].encodingLength(obj.value)
length += 1 + len
}
if (defined(obj.deleted)) {
var len = enc[2].encodingLength(obj.deleted)
length += 1 + len
}
if (defined(obj.pointer)) {
var len = enc[2].encodingLength(obj.pointer)
length += 1 + len
}
if (defined(obj.noUpdate)) {
var len = enc[2].encodingLength(obj.noUpdate)
length += 1 + len
}
if (defined(obj.isSchema)) {
var len = enc[2].encodingLength(obj.isSchema)
length += 1 + len
}
if (defined(obj.isWildStringSchema)) {
var len = enc[2].encodingLength(obj.isWildStringSchema)
length += 1 + len
}
if (!defined(obj.trie)) throw new Error("trie is required")
var len = enc[1].encodingLength(obj.trie)
length += 1 + len
if (defined(obj.clock)) {
for (var i = 0; i < obj.clock.length; i++) {
if (!defined(obj.clock[i])) continue
var len = enc[3].encodingLength(obj.clock[i])
length += 1 + len
}
}
if (defined(obj.inflate)) {
var len = enc[3].encodingLength(obj.inflate)
length += 1 + len
}
if (!defined(obj.writerSignature)) throw new Error("writerSignature is required")
var len = enc[0].encodingLength(obj.writerSignature)
length += 1 + len
if (!defined(obj.writerAddress)) throw new Error("writerAddress is required")
var len = enc[0].encodingLength(obj.writerAddress)
length += 1 + len
if (defined(obj.proofSignature)) {
var len = enc[0].encodingLength(obj.proofSignature)
length += 1 + len
}
if (defined(obj.proofPayload)) {
var len = enc[1].encodingLength(obj.proofPayload)
length += 2 + len
}
if (defined(obj.rootHash)) {
var len = enc[0].encodingLength(obj.rootHash)
length += 2 + len
}
return length
}
function encode (obj, buf, offset) {
if (!offset) offset = 0
if (!buf) buf = Buffer.allocUnsafe(encodingLength(obj))
var oldOffset = offset
if (!defined(obj.key)) throw new Error("key is required")
buf[offset++] = 10
enc[0].encode(obj.key, buf, offset)
offset += enc[0].encode.bytes
if (defined(obj.pointerKey)) {
buf[offset++] = 18
enc[0].encode(obj.pointerKey, buf, offset)
offset += enc[0].encode.bytes
}
if (defined(obj.schemaKey)) {
buf[offset++] = 26
enc[0].encode(obj.schemaKey, buf, offset)
offset += enc[0].encode.bytes
}
if (defined(obj.value)) {
buf[offset++] = 34
enc[1].encode(obj.value, buf, offset)
offset += enc[1].encode.bytes
}
if (defined(obj.deleted)) {
buf[offset++] = 40
enc[2].encode(obj.deleted, buf, offset)
offset += enc[2].encode.bytes
}
if (defined(obj.pointer)) {
buf[offset++] = 48
enc[2].encode(obj.pointer, buf, offset)
offset += enc[2].encode.bytes
}
if (defined(obj.noUpdate)) {
buf[offset++] = 56
enc[2].encode(obj.noUpdate, buf, offset)
offset += enc[2].encode.bytes
}
if (defined(obj.isSchema)) {
buf[offset++] = 64
enc[2].encode(obj.isSchema, buf, offset)
offset += enc[2].encode.bytes
}
if (defined(obj.isWildStringSchema)) {
buf[offset++] = 72
enc[2].encode(obj.isWildStringSchema, buf, offset)
offset += enc[2].encode.bytes
}
if (!defined(obj.trie)) throw new Error("trie is required")
buf[offset++] = 82
enc[1].encode(obj.trie, buf, offset)
offset += enc[1].encode.bytes
if (defined(obj.clock)) {
for (var i = 0; i < obj.clock.length; i++) {
if (!defined(obj.clock[i])) continue
buf[offset++] = 88
enc[3].encode(obj.clock[i], buf, offset)
offset += enc[3].encode.bytes
}
}
if (defined(obj.inflate)) {
buf[offset++] = 96
enc[3].encode(obj.inflate, buf, offset)
offset += enc[3].encode.bytes
}
if (!defined(obj.writerSignature)) throw new Error("writerSignature is required")
buf[offset++] = 106
enc[0].encode(obj.writerSignature, buf, offset)
offset += enc[0].encode.bytes
if (!defined(obj.writerAddress)) throw new Error("writerAddress is required")
buf[offset++] = 114
enc[0].encode(obj.writerAddress, buf, offset)
offset += enc[0].encode.bytes
if (defined(obj.proofSignature)) {
buf[offset++] = 122
enc[0].encode(obj.proofSignature, buf, offset)
offset += enc[0].encode.bytes
}
if (defined(obj.proofPayload)) {
buf[offset++] = 130
buf[offset++] = 1
enc[1].encode(obj.proofPayload, buf, offset)
offset += enc[1].encode.bytes
}
if (defined(obj.rootHash)) {
buf[offset++] = 138
buf[offset++] = 1
enc[0].encode(obj.rootHash, buf, offset)
offset += enc[0].encode.bytes
}
encode.bytes = offset - oldOffset
return buf
}
function decode (buf, offset, end) {
if (!offset) offset = 0
if (!end) end = buf.length
if (!(end <= buf.length && offset <= buf.length)) throw new Error("Decoded message is not valid")
var oldOffset = offset
var obj = {
key: "",
pointerKey: "",
schemaKey: "",
value: null,
deleted: false,
pointer: false,
noUpdate: false,
isSchema: false,
isWildStringSchema: false,
trie: null,
clock: [],
inflate: 0,
writerSignature: "",
writerAddress: "",
proofSignature: "",
proofPayload: null,
rootHash: ""
}
var found0 = false
var found9 = false
var found12 = false
var found13 = false
while (true) {
if (end <= offset) {
if (!found0 || !found9 || !found12 || !found13) throw new Error("Decoded message is not valid")
decode.bytes = offset - oldOffset
return obj
}
var prefix = varint.decode(buf, offset)
offset += varint.decode.bytes
var tag = prefix >> 3
switch (tag) {
case 1:
obj.key = enc[0].decode(buf, offset)
offset += enc[0].decode.bytes
found0 = true
break
case 2:
obj.pointerKey = enc[0].decode(buf, offset)
offset += enc[0].decode.bytes
break
case 3:
obj.schemaKey = enc[0].decode(buf, offset)
offset += enc[0].decode.bytes
break
case 4:
obj.value = enc[1].decode(buf, offset)
offset += enc[1].decode.bytes
break
case 5:
obj.deleted = enc[2].decode(buf, offset)
offset += enc[2].decode.bytes
break
case 6:
obj.pointer = enc[2].decode(buf, offset)
offset += enc[2].decode.bytes
break
case 7:
obj.noUpdate = enc[2].decode(buf, offset)
offset += enc[2].decode.bytes
break
case 8:
obj.isSchema = enc[2].decode(buf, offset)
offset += enc[2].decode.bytes
break
case 9:
obj.isWildStringSchema = enc[2].decode(buf, offset)
offset += enc[2].decode.bytes
break
case 10:
obj.trie = enc[1].decode(buf, offset)
offset += enc[1].decode.bytes
found9 = true
break
case 11:
obj.clock.push(enc[3].decode(buf, offset))
offset += enc[3].decode.bytes
break
case 12:
obj.inflate = enc[3].decode(buf, offset)
offset += enc[3].decode.bytes
break
case 13:
obj.writerSignature = enc[0].decode(buf, offset)
offset += enc[0].decode.bytes
found12 = true
break
case 14:
obj.writerAddress = enc[0].decode(buf, offset)
offset += enc[0].decode.bytes
found13 = true
break
case 15:
obj.proofSignature = enc[0].decode(buf, offset)
offset += enc[0].decode.bytes
break
case 16:
obj.proofPayload = enc[1].decode(buf, offset)
offset += enc[1].decode.bytes
break
case 17:
obj.rootHash = enc[0].decode(buf, offset)
offset += enc[0].decode.bytes
break
default:
offset = skip(prefix & 7, buf, offset)
}
}
}
}
function defineInflatedEntry () {
var Feed = InflatedEntry.Feed = {
buffer: true,
encodingLength: null,
encode: null,
decode: null
}
defineFeed()
function defineFeed () {
var enc = [
encodings.bytes
]
Feed.encodingLength = encodingLength
Feed.encode = encode
Feed.decode = decode
function encodingLength (obj) {
var length = 0
if (!defined(obj.key)) throw new Error("key is required")
var len = enc[0].encodingLength(obj.key)
length += 1 + len
return length
}
function encode (obj, buf, offset) {
if (!offset) offset = 0
if (!buf) buf = Buffer.allocUnsafe(encodingLength(obj))
var oldOffset = offset
if (!defined(obj.key)) throw new Error("key is required")
buf[offset++] = 10
enc[0].encode(obj.key, buf, offset)
offset += enc[0].encode.bytes
encode.bytes = offset - oldOffset
return buf
}
function decode (buf, offset, end) {
if (!offset) offset = 0
if (!end) end = buf.length
if (!(end <= buf.length && offset <= buf.length)) throw new Error("Decoded message is not valid")
var oldOffset = offset
var obj = {
key: null
}
var found0 = false
while (true) {
if (end <= offset) {
if (!found0) throw new Error("Decoded message is not valid")
decode.bytes = offset - oldOffset
return obj
}
var prefix = varint.decode(buf, offset)
offset += varint.decode.bytes
var tag = prefix >> 3
switch (tag) {
case 1:
obj.key = enc[0].decode(buf, offset)
offset += enc[0].decode.bytes
found0 = true
break
default:
offset = skip(prefix & 7, buf, offset)
}
}
}
}
var enc = [
encodings.string,
encodings.bytes,
encodings.bool,
encodings.varint,
Feed
]
InflatedEntry.encodingLength = encodingLength
InflatedEntry.encode = encode
InflatedEntry.decode = decode
function encodingLength (obj) {
var length = 0
if (!defined(obj.key)) throw new Error("key is required")
var len = enc[0].encodingLength(obj.key)
length += 1 + len
if (defined(obj.pointerKey)) {
var len = enc[0].encodingLength(obj.pointerKey)
length += 1 + len
}
if (defined(obj.schemaKey)) {
var len = enc[0].encodingLength(obj.schemaKey)
length += 1 + len
}
if (defined(obj.value)) {
var len = enc[1].encodingLength(obj.value)
length += 1 + len
}
if (defined(obj.deleted)) {
var len = enc[2].encodingLength(obj.deleted)
length += 1 + len
}
if (defined(obj.pointer)) {
var len = enc[2].encodingLength(obj.pointer)
length += 1 + len
}
if (defined(obj.noUpdate)) {
var len = enc[2].encodingLength(obj.noUpdate)
length += 1 + len
}
if (defined(obj.isSchema)) {
var len = enc[2].encodingLength(obj.isSchema)
length += 1 + len
}
if (defined(obj.isWildStringSchema)) {
var len = enc[2].encodingLength(obj.isWildStringSchema)
length += 1 + len
}
if (!defined(obj.trie)) throw new Error("trie is required")
var len = enc[1].encodingLength(obj.trie)
length += 1 + len
if (defined(obj.clock)) {
for (var i = 0; i < obj.clock.length; i++) {
if (!defined(obj.clock[i])) continue
var len = enc[3].encodingLength(obj.clock[i])
length += 1 + len
}
}
if (defined(obj.inflate)) {
var len = enc[3].encodingLength(obj.inflate)
length += 1 + len
}
if (!defined(obj.writerSignature)) throw new Error("writerSignature is required")
var len = enc[0].encodingLength(obj.writerSignature)
length += 1 + len
if (!defined(obj.writerAddress)) throw new Error("writerAddress is required")
var len = enc[0].encodingLength(obj.writerAddress)
length += 1 + len
if (defined(obj.proofSignature)) {
var len = enc[0].encodingLength(obj.proofSignature)
length += 1 + len
}
if (defined(obj.proofPayload)) {
var len = enc[1].encodingLength(obj.proofPayload)
length += 2 + len
}
if (defined(obj.rootHash)) {
var len = enc[0].encodingLength(obj.rootHash)
length += 2 + len
}
if (defined(obj.feeds)) {
for (var i = 0; i < obj.feeds.length; i++) {
if (!defined(obj.feeds[i])) continue
var len = enc[4].encodingLength(obj.feeds[i])
length += varint.encodingLength(len)
length += 2 + len
}
}
if (defined(obj.contentFeed)) {
var len = enc[1].encodingLength(obj.contentFeed)
length += 2 + len
}
return length
}
function encode (obj, buf, offset) {
if (!offset) offset = 0
if (!buf) buf = Buffer.allocUnsafe(encodingLength(obj))
var oldOffset = offset
if (!defined(obj.key)) throw new Error("key is required")
buf[offset++] = 10
enc[0].encode(obj.key, buf, offset)
offset += enc[0].encode.bytes
if (defined(obj.pointerKey)) {
buf[offset++] = 18
enc[0].encode(obj.pointerKey, buf, offset)
offset += enc[0].encode.bytes
}
if (defined(obj.schemaKey)) {
buf[offset++] = 26
enc[0].encode(obj.schemaKey, buf, offset)
offset += enc[0].encode.bytes
}
if (defined(obj.value)) {
buf[offset++] = 34
enc[1].encode(obj.value, buf, offset)
offset += enc[1].encode.bytes
}
if (defined(obj.deleted)) {
buf[offset++] = 40
enc[2].encode(obj.deleted, buf, offset)
offset += enc[2].encode.bytes
}
if (defined(obj.pointer)) {
buf[offset++] = 48
enc[2].encode(obj.pointer, buf, offset)
offset += enc[2].encode.bytes
}
if (defined(obj.noUpdate)) {
buf[offset++] = 56
enc[2].encode(obj.noUpdate, buf, offset)
offset += enc[2].encode.bytes
}
if (defined(obj.isSchema)) {
buf[offset++] = 64
enc[2].encode(obj.isSchema, buf, offset)
offset += enc[2].encode.bytes
}
if (defined(obj.isWildStringSchema)) {
buf[offset++] = 72
enc[2].encode(obj.isWildStringSchema, buf, offset)
offset += enc[2].encode.bytes
}
if (!defined(obj.trie)) throw new Error("trie is required")
buf[offset++] = 82
enc[1].encode(obj.trie, buf, offset)
offset += enc[1].encode.bytes
if (defined(obj.clock)) {
for (var i = 0; i < obj.clock.length; i++) {
if (!defined(obj.clock[i])) continue
buf[offset++] = 88
enc[3].encode(obj.clock[i], buf, offset)
offset += enc[3].encode.bytes
}
}
if (defined(obj.inflate)) {
buf[offset++] = 96
enc[3].encode(obj.inflate, buf, offset)
offset += enc[3].encode.bytes
}
if (!defined(obj.writerSignature)) throw new Error("writerSignature is required")
buf[offset++] = 106
enc[0].encode(obj.writerSignature, buf, offset)
offset += enc[0].encode.bytes
if (!defined(obj.writerAddress)) throw new Error("writerAddress is required")
buf[offset++] = 114
enc[0].encode(obj.writerAddress, buf, offset)
offset += enc[0].encode.bytes
if (defined(obj.proofSignature)) {
buf[offset++] = 122
enc[0].encode(obj.proofSignature, buf, offset)
offset += enc[0].encode.bytes
}
if (defined(obj.proofPayload)) {
buf[offset++] = 130
buf[offset++] = 1
enc[1].encode(obj.proofPayload, buf, offset)
offset += enc[1].encode.bytes
}
if (defined(obj.rootHash)) {
buf[offset++] = 138
buf[offset++] = 1
enc[0].encode(obj.rootHash, buf, offset)
offset += enc[0].encode.bytes
}
if (defined(obj.feeds)) {
for (var i = 0; i < obj.feeds.length; i++) {
if (!defined(obj.feeds[i])) continue
buf[offset++] = 146
buf[offset++] = 1
varint.encode(enc[4].encodingLength(obj.feeds[i]), buf, offset)
offset += varint.encode.bytes
enc[4].encode(obj.feeds[i], buf, offset)
offset += enc[4].encode.bytes
}
}
if (defined(obj.contentFeed)) {
buf[offset++] = 154
buf[offset++] = 1
enc[1].encode(obj.contentFeed, buf, offset)
offset += enc[1].encode.bytes
}
encode.bytes = offset - oldOffset
return buf
}
function decode (buf, offset, end) {
if (!offset) offset = 0
if (!end) end = buf.length
if (!(end <= buf.length && offset <= buf.length)) throw new Error("Decoded message is not valid")
var oldOffset = offset
var obj = {
key: "",
pointerKey: "",
schemaKey: "",
value: null,
deleted: false,
pointer: false,
noUpdate: false,
isSchema: false,
isWildStringSchema: false,
trie: null,
clock: [],
inflate: 0,
writerSignature: "",
writerAddress: "",
proofSignature: "",
proofPayload: null,
rootHash: "",
feeds: [],
contentFeed: null
}
var found0 = false
var found9 = false
var found12 = false
var found13 = false
while (true) {
if (end <= offset) {
if (!found0 || !found9 || !found12 || !found13) throw new Error("Decoded message is not valid")
decode.bytes = offset - oldOffset
return obj
}
var prefix = varint.decode(buf, offset)
offset += varint.decode.bytes
var tag = prefix >> 3
switch (tag) {
case 1:
obj.key = enc[0].decode(buf, offset)
offset += enc[0].decode.bytes
found0 = true
break
case 2:
obj.pointerKey = enc[0].decode(buf, offset)
offset += enc[0].decode.bytes
break
case 3:
obj.schemaKey = enc[0].decode(buf, offset)
offset += enc[0].decode.bytes
break
case 4:
obj.value = enc[1].decode(buf, offset)
offset += enc[1].decode.bytes
break
case 5:
obj.deleted = enc[2].decode(buf, offset)
offset += enc[2].decode.bytes
break
case 6:
obj.pointer = enc[2].decode(buf, offset)
offset += enc[2].decode.bytes
break
case 7:
obj.noUpdate = enc[2].decode(buf, offset)
offset += enc[2].decode.bytes
break
case 8:
obj.isSchema = enc[2].decode(buf, offset)
offset += enc[2].decode.bytes
break
case 9:
obj.isWildStringSchema = enc[2].decode(buf, offset)
offset += enc[2].decode.bytes
break
case 10:
obj.trie = enc[1].decode(buf, offset)
offset += enc[1].decode.bytes
found9 = true
break
case 11:
obj.clock.push(enc[3].decode(buf, offset))
offset += enc[3].decode.bytes
break
case 12:
obj.inflate = enc[3].decode(buf, offset)
offset += enc[3].decode.bytes
break
case 13:
obj.writerSignature = enc[0].decode(buf, offset)
offset += enc[0].decode.bytes
found12 = true
break
case 14:
obj.writerAddress = enc[0].decode(buf, offset)
offset += enc[0].decode.bytes
found13 = true
break
case 15:
obj.proofSignature = enc[0].decode(buf, offset)
offset += enc[0].decode.bytes
break
case 16:
obj.proofPayload = enc[1].decode(buf, offset)
offset += enc[1].decode.bytes
break
case 17:
obj.rootHash = enc[0].decode(buf, offset)
offset += enc[0].decode.bytes
break
case 18:
var len = varint.decode(buf, offset)
offset += varint.decode.bytes
obj.feeds.push(enc[4].decode(buf, offset, offset + len))
offset += enc[4].decode.bytes
break
case 19:
obj.contentFeed = enc[1].decode(buf, offset)
offset += enc[1].decode.bytes
break
default:
offset = skip(prefix & 7, buf, offset)
}
}
}
}
function defineHeader () {
var enc = [
encodings.string
]
Header.encodingLength = encodingLength
Header.encode = encode
Header.decode = decode
function encodingLength (obj) {
var length = 0
if (!defined(obj.protocol)) throw new Error("protocol is required")
var len = enc[0].encodingLength(obj.protocol)
length += 1 + len
return length
}
function encode (obj, buf, offset) {
if (!offset) offset = 0
if (!buf) buf = Buffer.allocUnsafe(encodingLength(obj))
var oldOffset = offset
if (!defined(obj.protocol)) throw new Error("protocol is required")
buf[offset++] = 10
enc[0].encode(obj.protocol, buf, offset)
offset += enc[0].encode.bytes
encode.bytes = offset - oldOffset
return buf
}
function decode (buf, offset, end) {
if (!offset) offset = 0
if (!end) end = buf.length
if (!(end <= buf.length && offset <= buf.length)) throw new Error("Decoded message is not valid")
var oldOffset = offset
var obj = {
protocol: ""
}
var found0 = false
while (true) {
if (end <= offset) {
if (!found0) throw new Error("Decoded message is not valid")
decode.bytes = offset - oldOffset
return obj
}
var prefix = varint.decode(buf, offset)
offset += varint.decode.bytes
var tag = prefix >> 3
switch (tag) {
case 1:
obj.protocol = enc[0].decode(buf, offset)
offset += enc[0].decode.bytes
found0 = true
break
default:
offset = skip(prefix & 7, buf, offset)
}
}
}
}
function defined (val) {
return val !== null && val !== undefined && (typeof val !== 'number' || !isNaN(val))
}
| 28.995012 | 103 | 0.573149 |
995b0e31aea9e08e1bef3073a97ebadc68118454 | 230 | js | JavaScript | app/libs/apis/survey/survey-admin.api.js | HuyCongJr/SPM-frontend | a28a3915d65b7c984a08fcf92df7ee32dd38a423 | [
"MIT"
] | null | null | null | app/libs/apis/survey/survey-admin.api.js | HuyCongJr/SPM-frontend | a28a3915d65b7c984a08fcf92df7ee32dd38a423 | [
"MIT"
] | 6 | 2020-12-16T08:26:57.000Z | 2022-03-30T17:39:16.000Z | app/libs/apis/survey/survey-admin.api.js | yocto-erp/yocto-erp-web | 47dc6bb79faf5736ab9438825aeb6be859188714 | [
"MIT"
] | null | null | null | import { createCRUDApi } from '../fetch';
import { API_URL } from '../../../constants';
const API_ENDPOINT_URL = `${API_URL}/survey-admin`;
const surveyAdminApi = createCRUDApi(API_ENDPOINT_URL);
export default surveyAdminApi;
| 25.555556 | 55 | 0.730435 |
995bb3f319900f0d2f42ccc7674eec51d57b08ba | 1,008 | js | JavaScript | lib/shared/addon/mixins/endpoint-ports.js | jannylund/ui | e5564d48e693a95c260ecb6919d4a30fa4baa43d | [
"Apache-2.0"
] | null | null | null | lib/shared/addon/mixins/endpoint-ports.js | jannylund/ui | e5564d48e693a95c260ecb6919d4a30fa4baa43d | [
"Apache-2.0"
] | null | null | null | lib/shared/addon/mixins/endpoint-ports.js | jannylund/ui | e5564d48e693a95c260ecb6919d4a30fa4baa43d | [
"Apache-2.0"
] | null | null | null | import { get } from '@ember/object';
import Mixin from '@ember/object/mixin';
import Util from 'ui/utils/util';
export default Mixin.create({
displayEndpoints: function () {
let parts = [];
const endpoints = (get(this, 'publicEndpoints') || []).sort(Util.compareDisplayEndpoint);
endpoints.forEach((endpoint) => {
if ( !get(endpoint, 'isReady') ){
return;
}
if (get(endpoint, 'isTcpish')) {
parts.push('<span>' +
'<a target="_blank" rel="noreferrer nofollow noopener" href="' + Util.escapeHtml(get(endpoint, 'linkEndpoint')) + '">' +
Util.escapeHtml(get(endpoint, 'displayEndpoint')) +
'</a>' +
'</span>');
} else {
parts.push('<span>' + Util.escapeHtml(get(endpoint, 'displayEndpoint')) + '</span>');
}
});
let pub = parts.join(', ');
if (pub) {
return pub.htmlSafe();
}
else {
return '';
}
}.property('publicEndpoints.@each.{address,port,protocol}'),
});
| 28 | 130 | 0.563492 |
995c0c6636c82c7b3855567f224c878eca98e2c4 | 354 | js | JavaScript | src/components/search/search.js | nayaabh/dev-command-center | f68a691e63da9dda156339e689745cd1410bb2f7 | [
"MIT"
] | null | null | null | src/components/search/search.js | nayaabh/dev-command-center | f68a691e63da9dda156339e689745cd1410bb2f7 | [
"MIT"
] | null | null | null | src/components/search/search.js | nayaabh/dev-command-center | f68a691e63da9dda156339e689745cd1410bb2f7 | [
"MIT"
] | null | null | null | import { Component } from 'react'
import { GoRocket } from 'react-icons/lib/go'
export class Search extends Component {
render() {
return (
<div className="search-container">
<input type="text" placeholder="> Type a command" />
<GoRocket size="35" />
</div>
)
}
} | 29.5 | 69 | 0.514124 |
995c6e1b62d0981c081f1d521caa11a57035b691 | 1,750 | js | JavaScript | babel.config.js | seekplum/leetcode-chrome-extension | c1d9a7ab34269915d345ecca38b23b1924fbff68 | [
"MIT"
] | null | null | null | babel.config.js | seekplum/leetcode-chrome-extension | c1d9a7ab34269915d345ecca38b23b1924fbff68 | [
"MIT"
] | null | null | null | babel.config.js | seekplum/leetcode-chrome-extension | c1d9a7ab34269915d345ecca38b23b1924fbff68 | [
"MIT"
] | null | null | null | /* eslint-disable camelcase, import/no-dynamic-require, global-require, @typescript-eslint/no-var-requires */
module.exports = (api) => {
const isProd = api.env('production');
const { minimum_chrome_version } = require(`./src/manifest.${isProd ? 'prod' : 'dev'}.json`);
const envPreset = [
'@babel/env',
{
modules: false,
targets: minimum_chrome_version
? `Chrome > ${minimum_chrome_version}`
: 'last 2 Chrome versions',
useBuiltIns: 'usage',
corejs: 3,
},
];
const importPlugin = [
'import',
{
libraryName: 'antd',
libraryDirectory: 'es',
style: true,
},
];
return {
presets: ['@babel/preset-typescript', envPreset],
plugins: [
'@babel/plugin-transform-runtime',
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-proposal-optional-chaining',
['@babel/plugin-proposal-class-properties'],
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }],
'lodash',
importPlugin,
],
env: {
development: {
presets: [['@babel/preset-react', { runtime: 'automatic', development: true }]],
plugins: ['react-hot-loader/babel'],
},
production: {
presets: ['@babel/preset-react'],
plugins: [
'babel-plugin-dev-expression',
'@babel/plugin-transform-react-constant-elements',
'@babel/plugin-transform-react-inline-elements',
],
},
},
};
};
| 33.018868 | 109 | 0.500571 |
995d122d66b5c673c3f042612f5db5ab922ec55a | 4,367 | js | JavaScript | src/navigators/bottom-bar-navigator.js | mirocosic/xtrack-mobile | 1ca2ebb3b61570abf17749466c44ed891121d9a9 | [
"MIT"
] | 5 | 2018-11-10T17:52:33.000Z | 2021-12-09T20:22:40.000Z | src/navigators/bottom-bar-navigator.js | mirocosic/xtrack-mobile | 1ca2ebb3b61570abf17749466c44ed891121d9a9 | [
"MIT"
] | 29 | 2019-04-11T00:13:49.000Z | 2021-11-24T20:25:34.000Z | src/navigators/bottom-bar-navigator.js | mirocosic/xtrack-mobile | 1ca2ebb3b61570abf17749466c44ed891121d9a9 | [
"MIT"
] | null | null | null | import React from "react"
import { View } from "react-native"
import ReactNativeHapticFeedback from "react-native-haptic-feedback"
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs"
import { useDarkMode } from "react-native-dark-mode"
import { RectButton, TouchableHighlight, TouchableOpacity } from "react-native-gesture-handler"
import LinearGradient from "react-native-linear-gradient"
import { Dashboard, Overview, Settings, Transactions, DashboardFL } from "../screens"
import Icon from "../components/icon"
import palette from "../utils/palette"
import { font } from "../components/typography"
import { safePaddingBottom, useDarkTheme } from "../utils/ui-utils"
import __ from "../utils/translations"
const AddRedirector = ({ navigation }) => {
React.useEffect(() => {
const unsubscribe = navigation.addListener("tabPress", (e) => {
ReactNativeHapticFeedback.trigger("impactLight");
e.preventDefault()
navigation.navigate("TransactionForm", { clearForm: true })
});
return unsubscribe
}, [navigation])
return null
}
const Tab = createBottomTabNavigator()
export default () => (
<Tab.Navigator
lazy={false}
tabBarOptions={{
activeTintColor: "#2059f4",
inactiveTintColor: useDarkTheme() ? palette.white : palette.black,
showIcon: true,
upperCaseLabel: false,
indicatorStyle: { backgroundColor: palette.secondary, fontFamily: font },
labelStyle: { fontSize: 12},
style: {
justifyContent: "space-around",
backgroundColor: useDarkTheme() ? palette.darkGray : "#ffffff",
height: safePaddingBottom(70),
paddingBottom: safePaddingBottom(10),
},
}}
>
{/* <Tab.Screen
name={__("Dashboard")}
component={Dashboard}
options={{
tabBarIcon: ({ color }) => (
<Icon style={{ backgroundColor: useDarkTheme() ? palette.darkGray : "white" }} textStyle={{ fontSize: 26, color }} type="tasks" />
),
}}
/> */}
<Tab.Screen
name={__("Dashboard")}
component={DashboardFL}
options={{
tabBarIcon: ({ color }) => (
<Icon style={{ backgroundColor: useDarkTheme() ? palette.darkGray : "white" }} textStyle={{ fontSize: 26, color }} type="tasks" />
),
}}
/>
<Tab.Screen
name={__("Overview")}
component={Overview}
options={{
tabBarIcon: ({ color }) => (
<Icon style={{ backgroundColor: useDarkTheme() ? palette.darkGray : "white" }} textStyle={{ fontSize: 26, color }} type="tachometer-alt" />
),
}}
/>
<Tab.Screen
name={__("Add")}
component={AddRedirector}
options={{
tabBarIcon: () => (
<TouchableOpacity
activeOpacity={0.8}
style={{
marginBottom: 40,
width: 60,
height: 60,
alignItems: "center",
borderRadius: 40,
shadowColor: "#000",
shadowOffset: {
width: 0,
height: 5,
},
shadowOpacity: 0.25,
shadowRadius: 3.84,
elevation: 5,
}}>
<LinearGradient
colors={["#2292f4", "#2031f4"]}
style={[{
height: 60,
width: 60,
borderRadius: 30,
alignItems: "center",
justifyContent: "center",
}]}>
<Icon
textStyle={{ fontSize: 30, color: "white" }}
type="plus" />
</LinearGradient>
</TouchableOpacity>
),
}}
/>
<Tab.Screen
name={__("Transactions")}
component={Transactions}
options={{
tabBarIcon: ({ color }) => (
<Icon style={{ backgroundColor: useDarkTheme() ? palette.darkGray : "white" }} textStyle={{ fontSize: 26, color }} type="exchangeAlt" />
),
}} />
<Tab.Screen
name={__("Settings")}
component={Settings}
options={{
tabBarIcon: ({ color }) => (
<Icon style={{ backgroundColor: useDarkTheme() ? palette.darkGray : "white" }} textStyle={{ fontSize: 26, color }} type="cog" />
),
}} />
</Tab.Navigator>
)
| 31.875912 | 149 | 0.547973 |
995db99cb4c7faae19e710fa4b050c01e8e73eef | 2,212 | js | JavaScript | assets/src/edit-story/constants/index.js | sgmelayu/web-stories-wp | 0d70be9d9bf78eb48c894035f78e280bb214df8f | [
"Apache-2.0"
] | null | null | null | assets/src/edit-story/constants/index.js | sgmelayu/web-stories-wp | 0d70be9d9bf78eb48c894035f78e280bb214df8f | [
"Apache-2.0"
] | 130 | 2020-10-02T13:48:18.000Z | 2022-03-28T19:35:12.000Z | assets/src/edit-story/constants/index.js | sgmelayu/web-stories-wp | 0d70be9d9bf78eb48c894035f78e280bb214df8f | [
"Apache-2.0"
] | null | null | null | /*
* 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.
*/
export { MULTIPLE_VALUE, MULTIPLE_DISPLAY_VALUE } from './multipleValue';
export const ADMIN_TOOLBAR_HEIGHT = 32;
export const HEADER_HEIGHT = 64;
export const CANVAS_MIN_WIDTH = 570;
export const LIBRARY_MIN_WIDTH = 220;
export const LIBRARY_MAX_WIDTH = 360;
export const INSPECTOR_MIN_WIDTH = 220;
export const INSPECTOR_MAX_WIDTH = 308;
export const PAGE_NAV_PADDING = 60;
export const PAGE_NAV_BUTTON_SIZE = 40;
export const PAGE_NAV_WIDTH = PAGE_NAV_PADDING + PAGE_NAV_BUTTON_SIZE;
export const PAGE_RATIO = 2 / 3;
export const PAGE_WIDTH = 412;
export const PAGE_HEIGHT = 618;
export const ALLOWED_EDITOR_PAGE_WIDTHS = [412, 268, 223];
export const FULLBLEED_RATIO = 9 / 16;
export const DESIGN_SPACE_MARGIN = 48;
export const COLOR_PRESETS_PER_ROW = 6;
export const STYLE_PRESETS_PER_ROW = 2;
export const TEXT_SET_SIZE = 150;
// Default device pixel ratio.
export const DEFAULT_DPR = 0.5;
// Default 1em value for font size.
export const DEFAULT_EM = PAGE_HEIGHT * 0.02186;
export const DEFAULT_ATTRIBUTES_FOR_MEDIA = {
scale: 100,
focalX: 50,
focalY: 50,
};
export const LAYER_DIRECTIONS = {
FRONT: 'FRONT',
BACK: 'BACK',
FORWARD: 'FORWARD',
BACKWARD: 'BACKWARD',
};
export const Z_INDEX_CANVAS = {
MOVABLE: 10,
FLOAT_PANEL: 11,
};
export const BACKGROUND_TEXT_MODE = {
NONE: 'NONE',
FILL: 'FILL',
HIGHLIGHT: 'HIGHLIGHT',
};
export const FONT_WEIGHT = {
NORMAL: 400,
MEDIUM: 500,
BOLD: 700,
};
export const HIDDEN_PADDING = {
horizontal: 8,
vertical: 4,
};
export const SAVED_COLOR_SIZE = 32;
export const SAVED_STYLE_HEIGHT = 64;
export * from './media';
| 24.577778 | 75 | 0.740506 |
995ed1cd38aed69ad341b2ae960719578c3df525 | 1,419 | js | JavaScript | gatsby-node.js | CMessinides/v1-cmessinides.com | d3132f5de5254d37cd597a7ed0b8e11c132ffc1b | [
"MIT"
] | null | null | null | gatsby-node.js | CMessinides/v1-cmessinides.com | d3132f5de5254d37cd597a7ed0b8e11c132ffc1b | [
"MIT"
] | 9 | 2020-09-04T16:04:52.000Z | 2022-02-17T20:10:31.000Z | gatsby-node.js | CMessinides/v1-cmessinides.com | d3132f5de5254d37cd597a7ed0b8e11c132ffc1b | [
"MIT"
] | null | null | null | /**
* Implement Gatsby's Node APIs in this file.
*
* See: https://www.gatsbyjs.org/docs/node-apis/
*/
// You can delete this file if you're not using it
exports.createPages = async function({ actions, graphql }) {
const { data } = await graphql(`
query CaseStudies {
thumbnails: allFile(
filter: {
sourceInstanceName: { eq: "images" }
relativeDirectory: { eq: "thumbnails" }
}
) {
edges {
node {
name
absolutePath
}
}
}
projects: allProjectsYaml {
edges {
node {
name
slug
blurb
themeColor
textColor
}
}
}
}
`);
const thumbnailMap = data.thumbnails.edges.reduce((map, edge) => {
const { name, absolutePath } = edge.node;
map[name] = absolutePath;
return map;
}, {});
data.projects.edges.forEach((edge, i, edges) => {
const project = edge.node;
const nextProject =
i === edges.length - 1 ? edges[0].node : edges[i + 1].node;
const thumbnailPath = thumbnailMap[project.slug];
actions.createPage({
path: `/work/${project.slug}`,
component: require.resolve(
`./src/components/case-studies/${project.slug}.jsx`
),
context: {
thumbnailPath,
project,
nextProject
}
});
});
};
| 22.52381 | 68 | 0.521494 |
995f2af5863fd78ffc2075df0d64cbe72c6684a0 | 104 | js | JavaScript | __test__/start-server.js | teeeemoji/join-mock | a172737ebd7bec8f9ac2ae18e3baabc899acaba1 | [
"MIT"
] | null | null | null | __test__/start-server.js | teeeemoji/join-mock | a172737ebd7bec8f9ac2ae18e3baabc899acaba1 | [
"MIT"
] | null | null | null | __test__/start-server.js | teeeemoji/join-mock | a172737ebd7bec8f9ac2ae18e3baabc899acaba1 | [
"MIT"
] | 1 | 2020-08-31T16:30:19.000Z | 2020-08-31T16:30:19.000Z | const mockClient = require('../index')
mockClient().then(() => {
console.log('test server start')
})
| 17.333333 | 38 | 0.634615 |
99608ee4ba41c55c20e058bc43ba65b81d9b33c6 | 31,016 | js | JavaScript | tinymce/modules/tinymce/Gruntfile.js | koku5566/SGC_Eshop | b886f0bfdb88f3884b024765febc579784e9cb96 | [
"MIT"
] | null | null | null | tinymce/modules/tinymce/Gruntfile.js | koku5566/SGC_Eshop | b886f0bfdb88f3884b024765febc579784e9cb96 | [
"MIT"
] | null | null | null | tinymce/modules/tinymce/Gruntfile.js | koku5566/SGC_Eshop | b886f0bfdb88f3884b024765febc579784e9cb96 | [
"MIT"
] | 2 | 2022-03-04T03:00:16.000Z | 2022-03-27T15:53:55.000Z | /*eslint-env node */
const { string: PluginString } = require('rollup-plugin-string');
const FilesAsStrings = PluginString({
include: '**/*.svg'
});
let zipUtils = require('./tools/modules/zip-helper');
let gruntUtils = require('./tools/modules/grunt-utils');
let gruntWebPack = require('./tools/modules/grunt-webpack');
let swag = require('@ephox/swag');
let plugins = [
'advlist', 'anchor', 'autolink', 'autoresize', 'autosave', 'charmap', 'code', 'codesample',
'directionality', 'emoticons', 'help', 'fullscreen', 'image', 'importcss', 'insertdatetime',
'link', 'lists', 'media', 'nonbreaking', 'pagebreak', 'preview', 'save', 'searchreplace',
'table', 'template', 'visualblocks', 'visualchars', 'wordcount', 'quickbars'
];
let themes = [
'silver'
];
let models = [
'dom',
];
let oxideUiSkinMap = {
'dark': 'oxide-dark',
'default': 'oxide',
'tinymce-5': 'tinymce-5',
'tinymce-5-dark': 'tinymce-5-dark'
};
const stripSourceMaps = function (data) {
const sourcemap = data.lastIndexOf('/*# sourceMappingURL=');
return sourcemap > -1 ? data.slice(0, sourcemap) : data;
};
module.exports = function (grunt) {
const packageData = grunt.file.readJSON('package.json');
const BUILD_VERSION = packageData.version + (process.env.BUILD_NUMBER ? '-' + process.env.BUILD_NUMBER : '');
// Determine the release date
const dateRe = new RegExp('^##\\s+' + packageData.version.toString().replace(/\./g, '\\.') + '\\s+\\-\\s+([\\d-]+)$', 'm');
const changelog = grunt.file.read('CHANGELOG.md').toString();
const dateMatch = dateRe.exec(changelog);
if (dateMatch !== null) {
packageData.date = dateMatch[1];
} else {
packageData.date = 'TBD';
}
grunt.initConfig({
pkg: packageData,
shell: {
prismjs: { command: 'node ./bin/build-prism.js', cwd: '../../' },
tsc: { command: 'tsc -b' },
moxiedoc: { command: 'moxiedoc "src/core/main/ts" -t tinymcenext --fail-on-warning --dry' }
},
eslint: {
target: [ 'src/**/*.ts' ]
},
globals: {
options: {
configFile: 'src/core/main/json/globals.json',
outputDir: 'lib/globals',
templateFile: 'src/core/main/js/GlobalsTemplate.js'
}
},
rollup: Object.assign(
{
core: {
options: {
treeshake: true,
format: 'iife',
onwarn: swag.onwarn,
plugins: [
FilesAsStrings,
swag.nodeResolve({
basedir: __dirname,
prefixes: {
'tinymce/core': 'lib/core/main/ts'
}
}),
swag.remapImports()
]
},
files:[
{
src: 'lib/core/main/ts/api/Main.js',
dest: 'js/tinymce/tinymce.js'
}
]
},
'core-types': {
options: {
treeshake: true,
format: 'es',
onwarn: (warning) => {
// Ignore circular deps in types
if (warning.code !== 'CIRCULAR_DEPENDENCY') {
swag.onwarn(warning)
}
},
plugins: [
FilesAsStrings,
swag.dts({
respectExternal: true,
keepVariables: [ 'tinymce' ],
keepComments: false
})
]
},
files: [
{
src: 'lib/core/main/ts/api/PublicApi.d.ts',
dest: 'js/tinymce/tinymce.d.ts'
}
]
}
},
gruntUtils.generate(plugins, 'plugin', (name) => {
return {
options: {
treeshake: true,
format: 'iife',
onwarn: swag.onwarn,
plugins: [
FilesAsStrings,
swag.nodeResolve({
basedir: __dirname,
prefixes: gruntUtils.prefixes({
'tinymce/core': 'lib/globals/tinymce/core'
}, [
[`tinymce/plugins/${name}`, `lib/plugins/${name}/main/ts`]
]),
mappers: [
swag.mappers.replaceDir('./lib/core/main/ts/api', './lib/globals/tinymce/core/api'),
swag.mappers.invalidDir('./lib/core/main/ts')
]
}),
swag.remapImports()
]
},
files:[ { src: `lib/plugins/${name}/main/ts/Main.js`, dest: `js/tinymce/plugins/${name}/plugin.js` } ]
};
}),
gruntUtils.generate(themes, 'theme', (name) => {
return {
options: {
treeshake: true,
format: 'iife',
onwarn: swag.onwarn,
plugins: [
FilesAsStrings,
swag.nodeResolve({
basedir: __dirname,
prefixes: gruntUtils.prefixes({
'tinymce/core': 'lib/globals/tinymce/core'
}, [
[`tinymce/themes/${name}/resources`, `src/themes/${name}/main/resources`],
[`tinymce/themes/${name}`, `lib/themes/${name}/main/ts`]
]),
mappers: [
swag.mappers.replaceDir('./lib/core/main/ts/api', './lib/globals/tinymce/core/api'),
swag.mappers.invalidDir('./lib/core/main/ts')
]
}),
swag.remapImports()
]
},
files:[
{
src: `lib/themes/${name}/main/ts/Main.js`,
dest: `js/tinymce/themes/${name}/theme.js`
}
]
};
}),
gruntUtils.generate(models, 'model', (name) => {
return {
options: {
treeshake: true,
format: 'iife',
onwarn: swag.onwarn,
plugins: [
FilesAsStrings,
swag.nodeResolve({
basedir: __dirname,
prefixes: gruntUtils.prefixes({
'tinymce/core': 'lib/globals/tinymce/core'
}, [
[`tinymce/models/${name}`, `lib/models/${name}/main/ts`]
]),
mappers: [
swag.mappers.replaceDir('./lib/core/main/ts/api', './lib/globals/tinymce/core/api'),
swag.mappers.invalidDir('./lib/core/main/ts')
]
}),
swag.remapImports()
]
},
files:[
{
src: `lib/models/${name}/main/ts/Main.js`,
dest: `js/tinymce/models/${name}/model.js`
}
]
};
})
),
emojis: {
twemoji: {
base: '',
ext: '.png'
}
},
terser: Object.assign(
{
options: {
ecma: 2018,
output: {
comments: 'all',
ascii_only: true
},
compress: {
passes: 2
}
},
core: {
files: [
{ src: 'js/tinymce/tinymce.js', dest: 'js/tinymce/tinymce.min.js' },
{ src: 'js/tinymce/icons/default/icons.js', dest: 'js/tinymce/icons/default/icons.min.js' },
]
},
// very similar to the emoticons plugin, except mangle is off
'emoticons-raw': {
options: {
mangle: false,
compress: false,
output: {
indent_level: 2
}
},
files: [
{ src: 'src/plugins/emoticons/main/js/emojis.js', dest: 'js/tinymce/plugins/emoticons/js/emojis.js' },
{ src: 'src/plugins/emoticons/main/js/emojiimages.js', dest: 'js/tinymce/plugins/emoticons/js/emojiimages.js' }
]
}
},
gruntUtils.generate(plugins, 'plugin', (name) => {
var pluginExtras = {
emoticons: [
{ src: 'src/plugins/emoticons/main/js/emojis.js', dest: 'js/tinymce/plugins/emoticons/js/emojis.min.js' },
{ src: 'src/plugins/emoticons/main/js/emojiimages.js', dest: 'js/tinymce/plugins/emoticons/js/emojiimages.min.js' }
]
};
return {
files: [
{ src: `js/tinymce/plugins/${name}/plugin.js`, dest: `js/tinymce/plugins/${name}/plugin.min.js` }
].concat(pluginExtras.hasOwnProperty(name) ? pluginExtras[name] : [])
};
}),
gruntUtils.generate(themes, 'theme', (name) => {
return {
files: [ { src: `js/tinymce/themes/${name}/theme.js`, dest: `js/tinymce/themes/${name}/theme.min.js` } ]
};
}),
gruntUtils.generate(models, 'model', (name) => {
return {
files: [ { src: `js/tinymce/models/${name}/model.js`, dest: `js/tinymce/models/${name}/model.min.js` } ]
};
})
),
webpack: Object.assign(
{core: () => {
gruntWebPack.create('src/core/demo/ts/demo/Demos.ts', 'tsconfig.json', 'scratch/demos/core', 'demo.js');
gruntWebPack.create('src/core/demo/ts/demo/ContentSecurityPolicyDemo.ts', 'tsconfig.json', 'scratch/demos/core', 'cspdemo.js');
}},
{plugins: () => gruntWebPack.allPluginDemos(plugins)},
{themes: () => {
gruntWebPack.allThemeDemos(themes);
}},
{models: () => gruntWebPack.allModelDemos(models)},
gruntUtils.generate(plugins, 'plugin', (name) => () => gruntWebPack.createPlugin(name) ),
gruntUtils.generate(themes, 'theme', (name) => () => gruntWebPack.createTheme(name) ),
gruntUtils.generate(models, 'model', (name) => () => gruntWebPack.createModel(name) )
),
'webpack-dev-server': {
options: {
webpack: gruntWebPack.all(plugins, themes, models),
publicPath: '/',
inline: false,
port: grunt.option('webpack-port') !== undefined ? grunt.option('webpack-port') : 3000,
host: '0.0.0.0',
disableHostCheck: true,
before: app => gruntWebPack.generateDemoIndex(grunt, app, plugins, themes, models)
},
start: { }
},
concat: Object.assign({
options: {
process: function(content) {
return content.
replace(/@@version@@/g, packageData.version).
replace(/@@releaseDate@@/g, packageData.date);
}
},
core: {
src: [
'src/core/text/build-header.js',
'js/tinymce/tinymce.js'
],
dest: 'js/tinymce/tinymce.js'
}
},
gruntUtils.generate(plugins, 'plugin', function (name) {
return {
src: [
'src/core/text/build-header.js',
`js/tinymce/plugins/${name}/plugin.js`
],
dest: `js/tinymce/plugins/${name}/plugin.js`
};
}),
gruntUtils.generate(themes, 'theme', function (name) {
return {
src: [
'src/core/text/build-header.js',
`js/tinymce/themes/${name}/theme.js`
],
dest: `js/tinymce/themes/${name}/theme.js`
};
}),
gruntUtils.generate(models, 'model', function (name) {
return {
src: [
'src/core/text/build-header.js',
`js/tinymce/models/${name}/model.js`
],
dest: `js/tinymce/models/${name}/model.js`
};
})
),
copy: {
core: {
options: {
process: function (content) {
return content.
replace('@@majorVersion@@', packageData.version.split('.')[0]).
replace('@@minorVersion@@', packageData.version.split('.').slice(1).join('.')).
replace('@@releaseDate@@', packageData.date);
}
},
files: [
{
src: 'js/tinymce/tinymce.js',
dest: 'js/tinymce/tinymce.js'
},
{
src: 'js/tinymce/tinymce.min.js',
dest: 'js/tinymce/tinymce.min.js'
},
{
src: 'src/core/main/text/readme_lang.md',
dest: 'js/tinymce/langs/README.md'
},
{
src: '../../LICENSE.TXT',
dest: 'js/tinymce/license.txt'
},
{
src: '../../README.md',
dest: 'js/tinymce/README.md'
}
]
},
'default-icons': {
files: [
{
expand: true,
cwd: '../oxide-icons-default/dist/icons/default',
src: '**',
dest: 'js/tinymce/icons/default'
}
]
},
'ui-skins': {
files: gruntUtils.flatMap(oxideUiSkinMap, function (name, mappedName) {
return [
{
expand: true,
cwd: '../oxide/build/skins/ui/' + name,
src: '**',
dest: 'js/tinymce/skins/ui/' + mappedName
}
];
})
},
'content-skins': {
files: [
{
expand: true,
cwd: '../oxide/build/skins/content',
src: '**',
dest: 'js/tinymce/skins/content'
},
]
},
'visualblocks-plugin': {
files: [
{ src: 'src/plugins/visualblocks/main/css/visualblocks.css', dest: 'js/tinymce/plugins/visualblocks/css/visualblocks.css' }
]
}
},
moxiezip: {
production: {
options: {
baseDir: 'tinymce',
excludes: [
'js/**/plugin.js',
'js/**/theme.js',
'js/**/model.js',
'js/**/icons.js',
'js/**/*.map',
'js/tinymce/tinymce.full.min.js',
'js/tinymce/plugins/moxiemanager',
'js/tinymce/plugins/visualblocks/img',
'js/tinymce/README.md',
'README.md'
],
to: 'dist/tinymce_<%= pkg.version %>.zip',
dataFilter: (args) => {
if (args.filePath.endsWith('.min.css')) {
args.data = stripSourceMaps(args.data);
}
}
},
src: [
'js/tinymce/langs',
'js/tinymce/plugins',
'js/tinymce/skins/**/*.min.css',
'js/tinymce/skins/**/*.woff',
'js/tinymce/icons',
'js/tinymce/themes',
'js/tinymce/models',
'js/tinymce/tinymce.d.ts',
'js/tinymce/tinymce.min.js',
'js/tinymce/license.txt',
'CHANGELOG.md',
'LICENSE.TXT',
'README.md'
]
},
development: {
options: {
baseDir: 'tinymce',
excludes: [
'../../modules/*/dist',
'../../modules/*/build',
'../../modules/*/scratch',
'../../modules/*/lib',
'../../modules/*/tmp',
'../../modules/tinymce/js/tinymce/tinymce.full.min.js',
'../../scratch',
'../../node_modules'
],
to: 'dist/tinymce_<%= pkg.version %>_dev.zip'
},
files: [
{
expand: true,
cwd: '../../',
src: [
'modules/*/src',
'modules/*/CHANGELOG.md',
'modules/*/Gruntfile.js',
'modules/*/gulpfile.js',
'modules/*/README.md',
'modules/*/README.md',
'modules/*/package.json',
'modules/*/tsconfig*.json',
'modules/*/.eslint*.json',
'modules/*/webpack.config.js',
'modules/*/.stylelintignore',
'modules/*/.stylelintrc',
'modules/tinymce/tools',
'modules/tinymce/copyright-header.js',
'.yarnrc',
'LICENSE.TXT',
'README.md',
'lerna.json',
'package.json',
'tsconfig*.json',
'.eslint*.json',
'yarn.lock'
]
},
{
expand: true,
cwd: '../../',
src: 'modules/tinymce/js',
dest: '/',
flatten: true
}
]
},
cdn: {
options: {
onBeforeSave: function (zip) {
zip.addData('dist/version.txt', packageData.version);
},
pathFilter: function (zipFilePath) {
return zipFilePath.replace('js/tinymce/', 'dist/');
},
dataFilter: (args) => {
if (args.filePath.endsWith('.min.css')) {
args.data = stripSourceMaps(args.data);
}
},
onBeforeConcat: function (destPath, chunks) {
// Strip the license from each file and prepend the license, so it only appears once
var license = grunt.file.read('src/core/text/build-header.js').replace(/@@version@@/g, packageData.version).replace(/@@releaseDate@@/g, packageData.date);
return [license].concat(chunks.map(function (chunk) {
return chunk.replace(license, '').trim();
}));
},
excludes: [
'js/**/config',
'js/**/scratch',
'js/**/classes',
'js/**/lib',
'js/**/dependency',
'js/**/src',
'js/**/*.less',
'js/**/*.dev.js',
'js/**/*.dev.svg',
'js/**/*.map',
'js/tinymce/tinymce.full.min.js',
'js/tinymce/plugins/moxiemanager',
'js/tinymce/plugins/visualblocks/img',
'js/tinymce/README.md',
'README.md',
'js/tests/.jshintrc'
],
concat: [
{
src: [
'js/tinymce/tinymce.d.ts',
'js/tinymce/tinymce.min.js',
'js/tinymce/themes/*/theme.min.js',
'js/tinymce/models/*/model.min.js',
'js/tinymce/plugins/*/plugin.min.js',
'!js/tinymce/plugins/example/plugin.min.js',
'!js/tinymce/plugins/example_dependency/plugin.min.js'
],
dest: [
'js/tinymce/tinymce.min.js'
]
},
],
to: 'dist/tinymce_<%= pkg.version %>_cdn.zip'
},
src: [
'js/tinymce/tinymce.js',
'js/tinymce/langs',
'js/tinymce/plugins',
'js/tinymce/skins',
'js/tinymce/icons',
'js/tinymce/themes',
'js/tinymce/models',
'js/tinymce/license.txt'
]
},
component: {
options: {
excludes: [
'js/**/config',
'js/**/scratch',
'js/**/classes',
'js/**/lib',
'js/**/dependency',
'js/**/src',
'js/**/*.less',
'js/**/*.dev.svg',
'js/**/*.dev.js',
'js/**/*.map',
'js/tinymce/tinymce.full.min.js',
'js/tinymce/plugins/moxiemanager',
'js/tinymce/plugins/example',
'js/tinymce/plugins/example_dependency',
'js/tinymce/plugins/visualblocks/img'
],
pathFilter: function (zipFilePath) {
if (zipFilePath.indexOf('js/tinymce/') === 0) {
return zipFilePath.substr('js/tinymce/'.length);
}
return zipFilePath;
},
onBeforeSave: function (zip) {
function jsonToBuffer(json) {
return new Buffer(JSON.stringify(json, null, '\t'));
}
const keywords = ['wysiwyg', 'tinymce', 'richtext', 'javascript', 'html', 'text', 'rich editor', 'rich text editor', 'rte', 'rich text', 'contenteditable', 'editing']
zip.addData('bower.json', jsonToBuffer({
'name': 'tinymce',
'description': 'Web based JavaScript HTML WYSIWYG editor control.',
'license': 'MIT',
'keywords': keywords,
'homepage': 'https://www.tiny.cloud/',
'ignore': ['README.md', 'composer.json', 'package.json', '.npmignore', 'CHANGELOG.md']
}));
zip.addData('package.json', jsonToBuffer({
'name': 'tinymce',
'version': packageData.version,
'repository': {
'type': 'git',
'url': 'https://github.com/tinymce/tinymce.git',
'directory': 'modules/tinymce'
},
'description': 'Web based JavaScript HTML WYSIWYG editor control.',
'author': 'Ephox Corporation DBA Tiny Technologies, Inc',
'main': 'tinymce.js',
'types': 'tinymce.d.ts',
'license': 'MIT',
'keywords': keywords,
'homepage': 'https://www.tiny.cloud/',
'bugs': { 'url': 'https://github.com/tinymce/tinymce/issues' }
}));
zip.addData('composer.json', jsonToBuffer({
'name': 'tinymce/tinymce',
'version': packageData.version,
'description': 'Web based JavaScript HTML WYSIWYG editor control.',
'license': ['MIT-only'],
'keywords': keywords,
'homepage': 'https://www.tiny.cloud/',
'type': 'component',
'extra': {
'component': {
'scripts': [
'tinymce.js',
'plugins/*/plugin.js',
'themes/*/theme.js',
'models/*/model.js',
'icons/*/icons.js',
],
'files': [
'tinymce.min.js',
'plugins/*/plugin.min.js',
'themes/*/theme.min.js',
'models/*/model.min.js',
'skins/**',
'icons/*/icons.min.js'
]
}
},
'archive': {
'exclude': ['README.md', 'bower.js', 'package.json', '.npmignore', 'CHANGELOG.md']
}
}));
var getDirs = zipUtils.getDirectories(grunt, this.excludes);
zipUtils.addIndexFiles(
zip,
getDirs('js/tinymce/plugins'),
zipUtils.generateIndex('plugins', 'plugin')
);
zipUtils.addIndexFiles(
zip,
getDirs('js/tinymce/themes'),
zipUtils.generateIndex('themes', 'theme')
);
zipUtils.addIndexFiles(
zip,
getDirs('js/tinymce/models'),
zipUtils.generateIndex('models', 'model')
);
zipUtils.addIndexFiles(
zip,
getDirs('js/tinymce/icons'),
zipUtils.generateIndex('icons', 'icons')
);
},
to: 'dist/tinymce_<%= pkg.version %>_component.zip',
dataFilter: (args) => {
if (args.filePath.endsWith('.min.css')) {
args.data = stripSourceMaps(args.data);
}
}
},
src: [
'js/tinymce/skins',
'js/tinymce/icons',
'js/tinymce/plugins',
'js/tinymce/themes',
'js/tinymce/models',
'js/tinymce/tinymce.js',
'js/tinymce/tinymce.d.ts',
'js/tinymce/tinymce.min.js',
'js/tinymce/license.txt',
'CHANGELOG.md',
'js/tinymce/README.md'
]
}
},
nugetpack: {
main: {
options: {
id: 'TinyMCE',
version: packageData.version,
authors: 'Ephox Corporation DBA Tiny Technologies, Inc',
owners: 'Ephox Corporation DBA Tiny Technologies, Inc',
description: 'The best WYSIWYG editor! TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor ' +
'control released as Open Source under MIT by Tiny Technologies, Inc. TinyMCE has the ability to convert HTML ' +
'TEXTAREA fields or other HTML elements to editor instances. TinyMCE is very easy to integrate ' +
'into other Content Management Systems.',
releaseNotes: 'Release notes for my package.',
summary: 'TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor ' +
'control released as Open Source under MIT by Tiny Technologies, Inc.',
projectUrl: 'https://www.tiny.cloud/',
iconUrl: 'https://www.tiny.cloud/favicon-32x32.png',
licenseUrl: 'https://www.tiny.cloud/license',
requireLicenseAcceptance: true,
tags: 'Editor TinyMCE HTML HTMLEditor',
excludes: [
'js/**/config',
'js/**/scratch',
'js/**/classes',
'js/**/lib',
'js/**/dependency',
'js/**/src',
'js/**/*.less',
'js/**/*.dev.svg',
'js/**/*.dev.js',
'js/**/*.map',
'js/tinymce/tinymce.full.min.js'
],
outputDir: 'dist'
},
files: [
{ src: 'js/tinymce/langs', dest: '/content/scripts/tinymce/langs' },
{ src: 'js/tinymce/plugins', dest: '/content/scripts/tinymce/plugins' },
{ src: 'js/tinymce/themes', dest: '/content/scripts/tinymce/themes' },
{ src: 'js/tinymce/models', dest: '/content/scripts/tinymce/models' },
{ src: 'js/tinymce/skins', dest: '/content/scripts/tinymce/skins' },
{ src: 'js/tinymce/icons', dest: '/content/scripts/tinymce/icons' },
{ src: 'js/tinymce/tinymce.js', dest: '/content/scripts/tinymce/tinymce.js' },
{ src: 'js/tinymce/tinymce.d.ts', dest: '/content/scripts/tinymce/tinymce.d.ts' },
{ src: 'js/tinymce/tinymce.min.js', dest: '/content/scripts/tinymce/tinymce.min.js' },
{ src: 'js/tinymce/license.txt', dest: '/content/scripts/tinymce/license.txt' }
]
},
},
bundle: {
minified: {
options: {
themesDir: 'js/tinymce/themes',
modelsDir: 'js/tinymce/models',
pluginsDir: 'js/tinymce/plugins',
iconsDir: 'js/tinymce/icons',
pluginFileName: 'plugin.min.js',
themeFileName: 'theme.min.js',
modelFileName: 'model.min.js',
iconsFileName: 'icons.min.js',
outputPath: 'js/tinymce/tinymce.full.min.js'
},
src: [
'js/tinymce/tinymce.min.js'
]
},
source: {
options: {
themesDir: 'js/tinymce/themes',
modelsDir: 'js/tinymce/models',
pluginsDir: 'js/tinymce/plugins',
iconsDir: 'js/tinymce/icons',
pluginFileName: 'plugin.js',
themeFileName: 'theme.js',
modelFileName: 'model.js',
iconsFileName: 'icons.js',
outputPath: 'js/tinymce/tinymce.full.js'
},
src: [
'js/tinymce/tinymce.js'
]
}
},
symlink: {
options: {
overwrite: true,
force: true
},
dist: {
src: 'dist',
dest: '../../dist'
},
js: {
src: 'js',
dest: '../../js'
}
},
clean: {
dist: ['js'],
lib: ['lib'],
scratch: ['scratch'],
release: ['dist']
},
'bedrock-manual': {
core: {
config: 'tsconfig.json',
projectdir: '.',
stopOnFailure: true,
testfiles: [
'src/**/test/ts/atomic/**/*Test.ts',
'src/**/test/ts/browser/**/*Test.ts',
'src/**/test/ts/phantom/**/*Test.ts'
],
customRoutes: 'src/core/test/json/routes.json'
},
atomic: {
config: 'tsconfig.json',
projectdir: '.',
stopOnFailure: true,
testfiles: [
'src/**/test/ts/atomic/**/*Test.ts',
],
customRoutes: 'src/core/test/json/routes.json'
},
silver: {
config: 'tsconfig.json',
testfiles: ['src/themes/silver/test/ts/phantom/**/*Test.ts', 'src/themes/silver/test/ts/browser/**/*Test.ts'],
stopOnFailure: true,
overallTimeout: 600000,
singleTimeout: 300000,
customRoutes: 'src/core/test/json/routes.json',
name: 'silver-tests'
}
},
'bedrock-auto': {
standard: {
browser: grunt.option('bedrock-browser') !== undefined ? grunt.option('bedrock-browser') : 'chrome-headless',
config: 'tsconfig.json',
testfiles: ['src/**/test/ts/**/*Test.ts'],
overallTimeout: 900000,
singleTimeout: 30000,
retries: 3,
customRoutes: 'src/core/test/json/routes.json',
name: grunt.option('bedrock-browser') !== undefined ? grunt.option('bedrock-browser') : 'chrome-headless'
},
silver: {
browser: 'phantomjs',
config: 'tsconfig.json',
testfiles: ['src/themes/silver/test/ts/phantom/**/*Test.ts', 'src/themes/silver/test/ts/browser/**/*Test.ts', 'src/themes/silver/test/ts/webdriver/*/*Test.ts'],
stopOnFailure: true,
overallTimeout: 600000,
singleTimeout: 300000,
customRoutes: 'src/core/test/json/routes.json',
name: 'silver-tests'
}
}
});
grunt.registerTask('symlink-dist', 'Links built dist content to the root directory', function () {
// Windows doesn't support symlinks, so copy instead of linking
if (process.platform === "win32") {
if (grunt.file.exists('../../dist')) grunt.file.delete('../../dist', { force: true });
if (grunt.file.exists('../../js')) grunt.file.delete('../../js', { force: true });
grunt.file.copy('dist', '../../dist');
grunt.file.copy('js', '../../js');
grunt.log.write('Copied 2 directories');
} else {
grunt.task.run('symlink');
}
});
grunt.registerTask('version', 'Creates a version file', function () {
grunt.file.write('dist/version.txt', BUILD_VERSION);
});
require('load-grunt-tasks')(grunt, {
requireResolution: true,
config: "../../package.json",
pattern: ['grunt-*', '@ephox/bedrock', '@ephox/swag']
});
grunt.loadTasks('tools/tasks');
grunt.registerTask('emoji', ['emojis', 'terser:emoticons-raw']);
grunt.registerTask('prodBuild', [
'shell:prismjs',
'shell:tsc',
'eslint',
'globals',
'emoji',
'rollup',
'concat',
'copy',
'terser'
]);
grunt.registerTask('prod', [
'prodBuild',
'clean:release',
'moxiezip',
'nugetpack',
'symlink-dist',
'version'
]);
grunt.registerTask('dev', [
'shell:prismjs',
'globals',
'emoji',
// TODO: Make webpack use the oxide CSS directly
// as well as making development easier, then we can update 'yarn dev' to run 'oxide-build' in parallel with 'tinymce-grunt dev'
// that will save 2-3 seconds on incremental builds
'copy:ui-skins',
'copy:content-skins',
'copy:default-icons'
]);
grunt.registerTask('start', ['webpack-dev-server']);
grunt.registerTask('default', ['clean:dist', 'prod']);
grunt.registerTask('test', ['bedrock-auto:standard']);
};
| 32.409613 | 178 | 0.482912 |
99609ffa87cf0d857285f8144383f872845d40ca | 53,929 | js | JavaScript | chives-blockchain-gui/packages/wallet/src/locales/sq-AL/messages.js | HiveProject2021/chives-light-wallet | 0c7c36bfc703b26ce3c938027de643dc90e4191f | [
"Apache-2.0"
] | 7 | 2021-12-26T11:05:19.000Z | 2022-02-24T10:42:45.000Z | chives-blockchain-gui/packages/wallet/src/locales/sq-AL/messages.js | HiveProject2021/chives-light-wallet | 0c7c36bfc703b26ce3c938027de643dc90e4191f | [
"Apache-2.0"
] | 8 | 2021-12-14T17:27:29.000Z | 2022-03-29T18:18:22.000Z | chives-blockchain-gui/packages/wallet/src/locales/sq-AL/messages.js | HiveProject2021/chives-light-wallet | 0c7c36bfc703b26ce3c938027de643dc90e4191f | [
"Apache-2.0"
] | 1 | 2021-12-09T23:51:12.000Z | 2021-12-09T23:51:12.000Z | /*eslint-disable*/module.exports={messages:{"(Optional)":"(Opsionale)","*Want to explore Chives’s blocks further? Check out <0>Chives Explorer</0> built by an open source developer.":"Dëshiron të mësosh më shumë rreth Chives's? Kliko në <0> Chives Explorer</0> e ndërtuar nga një programues open source.","+":"+","+ Add New Plot NFT":"+ Shto një plot të ri NFT","+ Add Token":"+ Add Token","+ Add Wallet":"+ Shto Kuletë","-":"-","0 automatically chooses bucket count":"0 automatically chooses bucket count","128 buckets is recommended":"Rekomandohen 128 copëza","A harvester is a service running on a machine where plot(s) are actually stored. A farmer and harvester talk to a full node to see the state of the chain. View your network of connected harvesters below Learn more":"Korrësi eshte nje shërbim i cili është i integruar në pajisjen ku Plot(s) janë ruajtur. Një fermer dhe një korrës komunikojnë me një nyje që të shikojnë gjëndjen e zinxhirit. Shiko rrjetin e korrësave të lidhur më posht Mëso më shumë","About Chives Blockchain":"Rreth zinxhirit Chives","About Chives Wallet":"About Chives Wallet","Accept":"Prano","Accepted at time:":"Të pranuara gjatë kohës:","Action":"Veprim","Actions":"Veprimet","Add":"Shto","Add Backup ID":"Add Backup ID","Add Custom Token":"Add Custom Token","Add Plot Directory":"Shto një direktori për Plotet","Add Plot to Queue":"Shto Plote ne radhë","Add Token":"Add Token","Add Wallet":"Add Wallet","Add a Plot":"Shto nje Plot","Add a Plot NFT":"Shto nje Plot NFT","Add a plot":"Shto një Plot","Add plot directory":"Shto një direktori për Plotet","Add {currencyCode} from the Faucet":["Shtoni ",["currencyCode"]," nga Rubineti"],"Adding {0} token":["Adding ",["0"]," token"],"Address":"Adresa","Address / Puzzle hash":"Adresa / Kodimi numerik","All":"All","Amount":"Sasia","Amount ({cc_unit})":["Sasia (",["cc_unit"],")"],"Amount For Initial Coin":"Sasia për monedhën fillestare","Amount must be an even amount.":"Amount must be an even amount.","Are you sure you want to delete the plot? The plot cannot be recovered.":"Je i sigurt që do ta fshish këtë Plot? Pasi nuk mund ta riktheni.","Are you sure you want to delete unconfirmed transactions?":"Je i sigurt që dëshiron të fshish transaksione të pakonfirmuara?","Are you sure you want to disconnect?":"Je i sigurt që deshiron të shkëputesh?","Are you sure you want to quit?":"Are you sure you want to quit?","Are you sure you want to quit? GUI Plotting and farming will stop.":"Je i sigurt që dëshiron të dalësh? Ndërfaqja për Plotting dhe Fermerin do të ndërpritet.","Are you sure you want to use k={plotSize}":["Are you sure you want to use k=",["plotSize"]],"Are you sure you want to use k={plotSize}?":["Je i sigurt që dëshiron të përdoresh k=",["plotSize"],"?"],"Asset Id":"Asset Id","Atomic Swap Wallet":"Atomic Swap Wallet","Attempt {attempt}":["Attempt ",["attempt"]],"Authorized Payee Wallet":"Authorized Payee Wallet","Autogenerated name from pool contract address":"Emri i gjeneruar automatikisht nga adresa e kontratës së pollit","Back":"Kthe","Backup file is used to restore smart wallets.":"Skedari Reservë shërben për të rikthyer kuletat smart.","Balance":"Shuma","Base Farmer Reward Amount":"Shuma e Shpërblimit për Fermerin kryesor","Below are the current block challenges. You may or may not have a proof of space for these challenges. These blocks do not currently contain a proof of time.":"Më poshtë janë sfidat aktuale per zinxhirin. Ti mundet ose jo të kesh nje prove hapsire për këto sfida. Këto Blloqe nuk përmbajne aktualisht provën e hapsirës.","Best estimate over last 24 hours":"Llogaritja më e mire gjatë 24 orëve të fundit","Best estimate over last 5 hours":"Best estimate over last 5 hours","Block":"Blloku","Block Test":"Kontrolli i Bllokut","Block VDF Iterations":"Përsëritjet e Bllokut VDF","Block at height {0} in the Chives blockchain":["Blloku ne lartësin ",["0"]," ne Zinxhirin Chives"],"Block hash":"Block hash","Block with hash {headerHash}":["Blloku me kodimin ",["headerHash"]],"Block with hash {headerHash} does not exist.":["Blloku me kodimin ",["headerHash"]," nuk ekziston."],"Blocks":"Blloqet","Both values are empty. This is ok if you are, for example, sending your rewards to an offline wallet.":"Both values are empty. This is ok if you are, for example, sending your rewards to an offline wallet.","Browse":"Shfleto","But you are currently farming <0/>":"Ju jeni duke vjelë<0/>","Buy":"Bli","Token Wallet":"Token Wallet","CC Wallet":"CC Wallet","CCListItems.title":"CCListItems.title","Can be backed up to mnemonic seed":"Mund të ruhet ne bërthamen mnemonic","Cancel":"Anuloje","Cancel and Spend":"Anullo dhe Dhuroji","Cannot send chives to coloured address. Please enter a chives address.":"Cannot send chives to coloured address. Please enter a chives address.","Caution, deleting these plots will delete them forever. Check that the storage devices are properly connected.":"Kujdes, fshirja e ketyre Ploteve do ti fshij ata pergjithëmon. Kontrollo që pajisjet ku ruhen këto Plote janë të lidhura saktësisht.","Challenge":"Sfidë","Challenge Hash":"Kodimi i Sfidës","Change":"Ndrysho","Change Pool":"Ndrysho Pollin","Chat on KeyBase":"Shkruaj në KeyBase","Chives":"Chives","Chives Asset Token":"Chives Asset Token","Chives Blockchain Wiki":"Zinxhiri Chives Wiki","Chives Wallet":"Kuleta Chives","Choose Number of Plots":"Zgjidh numrin e Ploteve","Choose Plot Size":"Zgjill madhesinë e plotit","Claim Rewards":"Merr Shpërblimet","Close":"Mbyll","Closing down node and server":"Po mbyllim nodën dhe serverin","Coin Name":"Coin Name","Coins:":"Monedha:","Colour":"Ngjyra","Colour Info":"Inofo e ngjyrave","Colour String":"Vargu i ngjyrave","Colour:":"Ngjyra:","Coloured Coin":"Monella me ngjyre","Coloured Coin Options":"Opsioni i ngjyrave te monedhes","Confirm":"Konfirmo","Confirm Disconnect":"Konfirmo shkëputjen","Confirmation":"Konfirmimi","Confirmed":"Confirmed","Confirmed at Height":"Confirmed at Height","Confirmed at block:":"Konfirmuar ne bllokun:","Confirmed at height {0}":["Konfirmuar në lartesinë ",["0"]],"Connect":"Lidhu","Connect to other peers":"Lidhu me te tjerët","Connect to pool":"Lidhu me pollin","Connected":"Lidhur","Connecting do daemon":"Connecting do daemon","Connecting to daemon":"Connecting to daemon","Connecting to wallet":"Po lidhet me portofolin","Connection Status":"Gjëndja Lidhjes","Connection Status:":"Gjëndja Lidhjes:","Connection type":"Tipi i Lidhjes","Connections":"Lidhjet","Contribute on GitHub":"Kontribo në GitHub","Copied":"Kopjuar","Copy":"Kopjo","Copy to Clipboard":"Kopjo në klipbord","Create":"Krijo","Create An Attestation Packet":"Create an Attestation Packet","Create Chives Asset Token Wallet":"Create Chives Asset Token Wallet","Create Chives Asset Token Wallet from Existing TAIL":"Create Chives Asset Token Wallet from Existing TAIL","Create DID wallet":"Create DID wallet","Create Distributed Identity Wallet":"Create Distributed Identity Wallet","Create New Chives Asset Token Wallet":"Create New Chives Asset Token Wallet","Create New Wallet":"Create New Wallet","Create Offer":"Krijo oferte","Create Plot":"Create Plot","Create Rate Limited Admin Wallet":"Krijo vlerso portofolin e adminit","Create Rate Limited User Wallet":"Krijo vlerso portofolin e perdoruesit","Create Token":"Create Token","Create Trade":"Create Trade","Create Trade Offer":"Krijo oferte burse","Create Transaction":"Të krijohet transaksion","Create a Backup":"Krijo kopje rezervë","Create a Plot NFT":"Krijoni një plot NFT","Create a new private key":"Krijo një çelës privat","Create admin wallet":"Krijo portofol të ri","Create custom Token Wallet":"Create custom Token Wallet","Create from Existing":"Create from Existing","Create new coloured coin":"Krijo një monedhë me ngjyrë","Create user wallet":"Krijo portofol të ri","Create wallet for colour":"Krijo portofol për ngjyrat","Create wallet for existing colour":"Krijo portofol për ngjyrat egzistuese","CreateWallet.addWallet":"CreateWallet.addWallet","Created At:":"Krijuar në:","Created by us:":"Krijuar nga ne:","Creating Plot NFT and Joining the Pool":"Krijimi i Plotit NFT dhe Lidhja me Pollet","Creating Plot NFT for Self Pooling":"Krijimi i plotit NFT për Vetë-Grumbullim","Currency code is not defined":"Kodi i valutës nuk është përcaktuar","Current Difficulty":"Vështirësia aktuale","Current Points Balance":"Bilanci aktual i pikëve","Current trade status":"Statusi aktual i burses","Custody Wallet":"Custody Wallet","Custom":"Custom","DANGER: permanently delete private key":"KUJDES: Fshije përgjithmonë çelësin privat","DID Wallet":"DID Wallet","DIDListItems.title":"DIDListItems.title","Date":"Datë","Delay":"Vonesa","Delete":"Fshij","Delete Plot":"Fshij plotin","Delete Unconfirmed Transactions":"Fshi transaksionet e pakonfirmuara","Delete all keys":"Fshij të gjithë Celsat","Delete key":"Delete key","Delete key {fingerprint}":["Fshij çelësin ",["fingerprint"]],"Deleting all keys will permanently remove the keys from your computer, make sure you have backups. Are you sure you want to continue?":"Fshirja e të gjithë celsave do të fshij përgjithëmon Celsat nga kompjuteri jotë, sigurohuni që keni një kopje të ruajtur. Jeni i sigurt që doni të vashdoni?","Deleting the key will permanently remove the key from your computer, make sure you have backups. Are you sure you want to continue?":"Fshirja e të gjithë celsave do të fshij përgjithëmon Celsat nga kompjuteri jotë, sigurohuni që keni një kopje të ruajtur. Jeni i sigurt që doni të vashdoni?","Developer":"Programuesi","Developer Tools":"Veglat e Programuesit","Difficulty":"Vështirësia","Disable bifield plotting when your temporary directory is on fast storage like SSD or you need lower per process RAM requirements. Plotting with bitfield enabled has about 20% less overall writes.":"Disable bifield plotting when your temporary directory is on fast storage like SSD or you need lower per process RAM requirements. Plotting with bitfield enabled has about 20% less overall writes.","Disable bitfield plotting":"Çaktivizo Plotting Bitfield","Discard":"Mos e ruaj","Disconnect":"Shkëput Lidhjen","Distributed Identity":"Distributed Identity","Distributed Identity Options":"Distributed Identity Options","Do you have existing plots on this machine? <0>Add Plot Directory</0>":"Keni plote ekzistuese në këtë pajisje?<0>Shto Direktorin ku ndodhen Plotet</0>","Does your machine support parallel plotting?":"A përballon pajisja juaj Ploting paralel?","Drag and drop attestation packet(s)":"Drag and drop attestation packet(s)","Drag and drop offer file":"Terhiq dhe zgjidh skedarin","Drag and drop your backup file":"Terhiq dhe zgjidh skedarin e ruajtur","Drag and drop your recovery backup file":"Drag and drop your recovery backup file","Edit":"Modifiko","Edit Payout Instructions":"Ndryshoni udhëzimet e pagesës","Enter the 24 word mnemonic that you have saved in order to restore your Chives wallet.":"Shkruaj 24 fjalët mnemonic që ke ruajtur pëer të rikthyer Kuletën tende Chives.","Error":"Gabim","Error the entered address appears to be for a different colour.":"Error the entered address appears to be for a different colour.","Error: Cannot send chives to coloured address. Please enter a chives address.":"Gabim: Nuk mund te dergojmë Chives në Adresën e dhënë. Ju lutemi vendosni një adresë Chives.","Estimated Network Space":"Madhësia e Hapsirës së rrjetit","Estimated Time to Win":"Koha e parashikuar për të fituar","Estimated network space":"Estimated network space","Estimated sum of all the plotted disk space of all farmers in the network":"Madhësia e hapsirës së ruajtur së të gjithë Ploteve të të gjithë fermerve në rrjet","Exclude final directory":"Veco direktorin finale","Expected Time to Win":"Expected Time to Win","Failed to open (invalid plots)":"Nuk u arrit të përpunohesh (Plote të pasakta)","Farm":"Ferma","Farmer Public Key":"Çelësi publik i fermerit","Farmer Puzzle Hash":"Kodi i kombinuar i Fermës","Farmer Reward Address":"Adresa e perfitimeve e fermerit","Farmer Reward Address is not properly formatted.":"Adresa e Shpërblimit të Fermerit nuk është e formatuar siç duhet.","Farmer Reward Address is not properly formatted. Using 'paste' is recommended.":"Farmer Reward Address is not properly formatted. Using 'paste' is recommended.","Farmer Reward Address must not be empty.":"Adresa e Shpërblimit të Fermerit nuk duhet të jetë bosh.","Farmer is not connected":"Fermeri nuk është i lidhur","Farmer is not running":"Ferma nuk është në gjendje pune","Farmer public key:":"Çelësi publik i fermerit:","Farmers earn block rewards and transaction fees by committing spare space to the network to help secure transactions. This is where your farm will be once you add a plot. <0>Learn more</0>":"Fermerët fitojnë shpërblime blloku dhe tarifa transaksionesh duke ofruar hapësirën e lirë në rrjet dhe për të ndihmuar transaksionet e sigurta. Kjo do të jetë ferma juaj sapo ju të shtoni një Plot. <0> Mësoni më shumë </0>","Farming":"Farming","Farming Status":"Statusi i Farming","Fee":"Tarifa","Fee (TXCC)":"Fee (TXCC)","Fee ({0})":["Fee (",["0"],")"],"Fee ({currencyCode})":["Tarifa(",["currencyCode"],")"],"Fees Amount":"Shuma e tarifës","Fees Puzzle Hash":"Fees Puzzle Hash","File":"Skedari","Filename":"Emri i skedarit","Final folder location":"Vëndi i vendosjes së Skedarit","Finished":"Përfundoi","Follow on Twitter":"Na ndiqni në Twitter","Frequently Asked Questions":"Pyetjet më të shpeshta","Full Node":"Nyja e plotë","Full Node Overview":"Pasqyrë e plotë e nyjes","Full Node Status":"Full Node Status","Full Screen":"Ekran i plotë","Generate New Colour":"Gjenero një ngjyrë tjetër","Get Pool Login Link":"Get Pool Login Link","Grid view":"Pamje si tabelë","HD or Hierarchical Deterministic keys are a type of public key/private key scheme where one private key can have a nearly infinite number of different public keys (and therefor wallet receive addresses) that will all ultimately come back to and be spendable by a single private key.":"Çelësat HD ose celsat Hierarchical Deterministic janë një lloj skeme çelësi publik / çelës privat ku një çelës privat mund të ketë një numër gati të pafund të çelësave të ndryshëm publik (dhe për këtë portofoli mer adresa të shumëta) që të gjithë do të kthehen përsëri dhe do të shpenzohen nga një Celës privat i vetëm.","Harvester ID":"Harvester ID","Harvester Plots":"Parcela korrëse","Header Hash":"Koka e kodit","Header hash":"Koka e kodit","Height":"Lartësia","Help":"Ndihmë","Help translate":"Ndihmo në përkthim","Hide Advanced Options":"Fshih opsionet e avancuara","History":"Historia","Host Name":"Emri i hostit","IP address":"Adresa IP","IP address / host":"Adresa IP / Hosti","If none selected, then it will default to the temporary directory.":"Nëse asnjë nuk është zgjedhur, atëherë do të vendoset në direktorinë e përkohshme.","Import Wallet from Mnemonics":"Importo Portofolin nga Mnemonics","Import from Mnemonics (24 words)":"Import nga Mnemonics (24 fjalë)","In Progress":"Në progres","Incoming":"Hyrës","Incorrect value":"Vlera e pasaktë","Index":"Indeksi","Indicated if this offer was created by us":"Treguar nëse kjo ofertë është krijuar nga ne","Indicated what time this offer was accepted":"Treguar në cilën orë është pranuar kjo ofertë","Info Packet":"Paketa e informacionit","Initial Amount":"Shuma fillestare","Initialize a Rate Limited User Wallet:":"Inicializoni një Portofol me Përdorues të Kufizuar të Vlerësimit:","Interval":"Intervali","Invalid state":"Gjendje e pavlefshme","It is a one-time login link that can be used to log in to a pool's website. It contains a signature using the farmer's key from the plot NFT. Not all pools support this feature.":"Shtë një lidhje identifikimi një herë që mund të përdoret për t'u identifikuar në faqen e internetit të një poll. Ai përmban një nënshkrim duke përdorur çelësin e fermerit nga parcela NFT. Jo të gjitha pollet e mbështesin këtë veçori.","Join Pool":"Bashkohu me Pollin","Join a Pool":"Bashkohu me një poll","Join a pool and get consistent XCC farming rewards. The average returns are the same, but it is much less volatile.":"Anëtarësohuni në një pishinë dhe merrni shpërblime të qëndrueshme XCC. Kthimi mesatar është i njëjtë, por është shumë më pak i paqëndrueshëm.","Join a pool and get consistent XCC farming rewards. The average returns are the same, but it is much less volatile. Assign plots to a plot NFT. You can easily switch pools without having to re-plot.":"Anëtarësohuni në një poll dhe merrni shpërblime të qëndrueshme në XCC. Kthimi mesatar është i njëjtë, por është shumë më pak i paqëndrueshëm. Caktoni një komplot NFT. Ju lehtë mund të ndërroni pollet pa pasur nevojë të ri-plotoni.","Join a pool and get more consistent XCC farming rewards. Create a plot NFT and assign your new plots to a group.":"Bashkohuni me një poll dhe merrni shpërblime më të qëndrueshme XCC. Krijoni një plot NFT dhe caktoni plotet tuaja të reja në një grup.","K-Size":"Madhësia K","Keys":"Çelësi","KiB Up/Down":"KiB Lart / Poshtë","Last Attempted Proof":"Provë e fundit e provuar","Last Height Farmed":"Lartësia e Fundit e Fermuar","Latest Block Challenges":"Sfidat e fundit të bllokut","Launcher Id":"Id e lëshuesit","Learn More":"Mëso më shumë","Leaving Pool":"Largimi nga polli","List of connections is empty":"List of connections is empty","List view":"Pamje si listë","Loading Plot NFTs":"Po ngarkon plotet e NFT","Loading configuration":"Loading configuration","Loading list of the keys":"Loading list of the keys","Loading list of wallets":"Lista në ngarkim e kuletave","Loading...":"Po ngarkohet...","Local Harvester Plots":"Local Harvester Plots","Log Out":"Log Out","Logging in":"Duke u loguar","MainWalletList.colouredCoin":"MainWalletList.colouredCoin","MainWalletList.createAdminWallet":"MainWalletList.createAdminWallet","MainWalletList.createDIDWallet":"MainWalletList.createDIDWallet","MainWalletList.createNewColouredCoin":"MainWalletList.createNewColouredCoin","MainWalletList.createUserWallet":"MainWalletList.createUserWallet","MainWalletList.createWalletForExistingColour":"MainWalletList.createWalletForExistingColour","MainWalletList.distributedIdentity":"MainWalletList.distributedIdentity","MainWalletList.rateLimited":"MainWalletList.rateLimited","MainWalletList.recoverDIDWallet":"MainWalletList.recoverDIDWallet","MainWalletList.title":"MainWalletList.title","Manage Farming Rewards":"Menaxhoni shpërblimet e fermerit","Manage Recovery DIDs":"Manage Recovery DIDs","Manage Your Farming Rewards Target Addresses":"Menaxhoni adresat tuaja të synuara për shpërblimet tuaja të fermerit","Memo":"Memo","Memos":"Memos","MiB Up/Down":"MiB Lart / Poshtë","Minimum Difficulty":"Vështirësia minimale","Minutes":"Minuta","More memory slightly increases speed":"Më shumë memorie rrit pak shpejtësinë","Multi Sig Wallet":"Multi Sig Wallet","My DID Wallet":"My DID Wallet","My Pubkey":"Pubkey im","Name":"Name","Network Name":"Emër Rrjeti","Network has not yet been launched, once it launches full node will start automatically.":"Network has not yet been launched, once it launches full node will start automatically.","Network not launched yet, waiting for genesis challenge!":"Network not launched yet, waiting for genesis challenge!","New Address":"Adresë e re","New Wallet":"Kuletë e re","Next":"Tjetër","Nickname":"Pseudonimi","No":"Jo","No 24 word seed, since this key is imported.":"Nuk ka farë 24 fjalësh, pasi që ky çelës importohet.","No blocks farmed yet":"Ende nuk ka blloqe të kultivuara","No previous transactions":"Nuk ka transaksione të mëparshme","No private keys for one or both addresses. Safe only if you are sending rewards to another wallet.":"Nuk ka çelësa privatë për një ose për të dy adresat. Sigurohu vetëm nëse jeni duke dërguar shpërblime në një portofol tjetër.","Node ID":"ID e nyjes","Node Id":"Id e nyjes","None":"Asnjë","None of your plots have passed the plot filter yet.":"Asnjë nga plotet tuaja nuk e ka kaluar filtrin akoma.","Not Available":"Jo i disponueshëm","Not Synced":"Jo i sinkronizuar","Not accepted yet":"Nuk pranohet akoma","Not confirmed yet":"Nuk është konfirmuar ende","Not connected":"Nuk është lidhur","Not found Plots":"Nuk gjenden Plotet","Note that this does not change your pooling payout addresses. This only affects old format plots, and the 0.25XCC reward for pooling plots.":"Vini re se kjo nuk ndryshon adresat tuaja të grumbullimit të pagesave. Kjo ndikon vetëm në komplotet e formatit të vjetër dhe në shpërblimin 0.25XCC për komplotet e bashkimit.","Number of Plots":"Numri i ploteve","Number of buckets":"Numri i pjesëzave","Number of threads":"Numri i thredsave","OK":"Ok","Offer":"Ofertë","Offers Created":"Oferta e krijuar","On average there is one minute between each transaction block. Unless there is congestion you can expect your transaction to be included in less than a minute.":"Mesatarisht ka një minutë midis çdo transaksion blloku. Nëse nuk ka bllokim, ju mund të prisni që transaksioni juaj të përfshihet në më pak se një minutë.","Only one backup file is allowed.":"Only one backup file is allowed.","Only one backup file is allowed. To add a new backup file, please delete any previously uploaded files and try again.":"Only one backup file is allowed. To add a new backup file, please delete any previously uploaded files and try again.","Outgoing":"Dalëse","Payout Address":"Adresa e pagesës","Peak Height":"Lartësia e majës","Peak Sub-block Height":"Peak Sub-block Height","Peak Time":"Koha e pikut","Pending":"Në pritje","Pending Balance":"Bilanci në pritje","Pending Change":"Bilanci në pritje të ndryshimit","Pending Total Balance":"Në pritje të balancit total","Please Confirm":"Të lutem konfirmo","Please add a trade pair":"Ju lutemi shtoni një palë tregtare","Please enter 0 fee. Positive fees not supported yet for RL.":"Ju lutemi vendosni 0 tarifë. Tarifat pozitive nuk mbështeten ende për RL.","Please enter a coin":"Please enter a coin","Please enter a filename":"Please enter a filename","Please enter a pubkey":"Please enter a pubkey","Please enter a puzzlehash":"Please enter a puzzlehash","Please enter a valid CAT name":"Please enter a valid CAT name","Please enter a valid TAIL":"Please enter a valid TAIL","Please enter a valid initial coin amount":"Ju lutemi shkruani një shumë fillestare të vlefshme","Please enter a valid integer of 0 or greater for the number of Backup IDs needed for recovery.":"Please enter an integer value of 0 or greater for the number of Backup IDs needed for recovery.","Please enter a valid numeric amount":"Ju lutemi shkruani një numer të vlefshem","Please enter a valid numeric amount.":"Please enter a numeric amount.","Please enter a valid numeric fee":"Ju lutemi vendosni një tarifë të vlefshme numerike","Please enter a valid numeric interval length":"Ju lutemi shkruani një gjatësi të vlefshme të intervalit numerik","Please enter a valid numeric spendable amount":"Ju lutemi shkruani një shumë të vlefshme të harxhueshme numerike","Please enter a valid pubkey":"Ju lutemi shkruani një pubkey të vlefshëm","Please enter a valid token name":"Please enter a valid token name","Please enter valid wallet name":"Please enter valid wallet name","Please finish syncing before making a transaction":"Ju lutemi mbaroni sinkronizimin përpara se të bëni një transaksion","Please select amount":"Ju lutemi zgjidhni shumën","Please select backup file first":"Please select the backup file first","Please select buy or sell":"Ju lutemi zgjidhni bleni ose shisni","Please select coin colour":"Ju lutemi zgjidhni ngjyrën e monedhës","Please select coin type":"Please select coin type","Please specify final directory":"Ju lutemi specifikoni direktorinë përfundimtare","Please specify temporary directory":"Ju lutemi specifikoni një direktori të përkohshme","Please wait for synchronization":"Ju lutemi të prisni për sinkronizimin","Please wait for wallet synchronization":"Ju lutemi të prisni për sinkronizimin e portofolit","Plot":"Plot","Plot Count":"Numri i ploteve","Plot Id":"Id e plotit","Plot Key":"Çelësi i plotit","Plot NFT":"Ploti NFT","Plot NFT with p2_singleton_puzzle_hash {plotNFTId} does not exists":["Plot NFT me p2_singleton_puzzle_hash ",["plotNFTId"]," nuk ekziston"],"Plot Name":"Plot Name","Plot Public Key":"Çelësi publik i plotit","Plot Seed":"Plot Seed","Plot Size":"Madhësia e plotit","Plot in Parallel":"Plot në paralel","Plot is duplicate of {0}":["Ploti është dublikatë e ",["0"]],"PlotNFT is transitioning to (target state)":"PlotNFT is transitioning to (target state)","PlotNFT is transitioning to (target state). This can take a while. Please do not close the application until this is finalized.":"Ploti Nft po kalon në (gjendjen e synuar). Kjo mund të zgjasë pak. Ju lutemi mos e mbyllni aplikacionin derisa të finalizohet kjo.","Plots":"Plotet","Plots Passed Filter":"Plotet e kaluan filtërin","Plots are allocated space on your hard drive used to farm and earn Chives. <0>Learn more</0>":"Ploteve u është dhënë hapësirë në hard diskun tuaj që përdoret për të fermuar dhe fituar Chives. <0> Mësoni më shumë </0>","Plotting":"Po ploton","Plotting in parallel can save time. Otherwise, add plot(s) to the queue.":"Plotimi në paralel mund të kursejë kohë. Përndryshe, shtoni komplotin (et) në rradhë.","Plotting with bitfield enabled has about 30% less overall writes and is now almost always faster. You may see reduced memory requirements with bitfield plotting disabled. If your CPU design is from before 2010 you may have to disable bitfield plotting.":"Plotimi me bitfield të aktivizuar ka rreth 30% më pak shkrime të përgjithshme dhe tani është pothuajse gjithmonë më i shpejtë. Ju mund të shihni kërkesa të reduktuara të kujtesës me skemën e bitfield të çaktivizuar. Nëse dizajni juaj i CPU-së është para vitit 2010, mund t'ju duhet të çaktivizoni skicimin e bitfield-it.","Plotting with bitfield enabled has about 30% less overall writes and is now almost always faster. You may see reduced memory requirements with bitfield plotting disabled. If your CPU design is from before 2010 you may have to disbale bitfield plotting.":"Plotting with bitfield enabled has about 30% less overall writes and is now almost always faster. You may see reduced memory requirements with bitfield plotting disabled. If your CPU design is from before 2010 you may have to disbale bitfield plotting.","Points Found Since Start":"Pikët e Gjetura Që nga Fillimi","Points Found in Last 24 Hours":"Pikët që gjenden në 24 orët e fundit","Points Successful in Last 24 Hours":"Pikët e Suksesshme në 24 Orët e Fundit","Pool":"Polli","Pool Contract Address":"Adresa e Kontratës së Pollit","Pool Key":"Çelësi i pollit","Pool Login Link":"Lidhja e hyrjes në poll","Pool Payout Instructions":"Udhëzimet e Pagimit të Pollit","Pool Public Key":"Çelësi publik i pollit","Pool Puzzle Hash":"Pazell e pollit","Pool Reward Address":"Adresa e perfitimeve të fermerit","Pool Reward Address is not properly formatted.":"Adresa e Shpërblimit të Pollit nuk është e formatuar siç duhet.","Pool Reward Address is not properly formatted. Using 'paste' is recommended.":"Pool Reward Address is not properly formatted. Using 'paste' is recommended.","Pool Reward Address must not be empty.":"Adresa e Shpërblimit të Pollit nuk duhet të jetë bosh.","Pool Reward Amount":"Shuma e Shpërblimit të Pollit","Pool does not provide relative_lock_height.":"Polli nuk ofron relative_lock_height.","Pool does not provide target_puzzle_hash.":"Polli nuk ofron target_puzzle_hash.","Pool public key:":"Çelësi publik i pollit:","Pool:":"Polli:","Pooling":"Lidhur","Pooling Wallet":"Pooling Wallet","Port":"Porta","Preparing Plot NFT":"Përgatitja e plotit NFT","Preparing standard wallet":"Përgatitja e portofolit standard","Previous":"Paraprak","Previous Block Hash":"Previous Block Hash","Previous Header Hash":"Headeri i mëparshëm Hash","Previous Sub Block Hash":"Previous Sub Block Hash","Private key with public fingerprint {fingerprint}":["Çelës privat me gjurmë gishtash publike ",["fingerprint"]],"Private key {0}":["Çelësi privat ",["0"]],"Private key {fingerprint}":["Private key ",["fingerprint"]],"Private key:":"Çelësi privat:","Proof of Space Size":"Prova e Madhësisë së Hapësirës","Proofs Found":"Dëshmitë e gjetura","Protocol Version":"Versioni i Protokollit","Pubkey":"Pubkey","Public key:":"Çelësi publik:","Puzzlehash":"Puzzlehash","Queue Name":"Emri i radhës","Queue name":"Emri i radhës","Queued":"Në rradhë","Quit":"Quit","RAM max usage":"Përdorimi maksimal i RAM-it","RL Wallet":"RL Wallet","RLListItems.title":"RLListItems.title","Rate Limited":"Shpejtësi e kufizuar","Rate Limited Info":"Vlerësoni informacionin e kufizuar","Rate Limited Options":"Vlerësoni informacionin opsional","Rate Limited User Wallet Setup":"Vlerësoni Konfigurimin e Kuletë të Përdoruesit të Kufizuar","Receive Address":"Adresë për Marrje","Recipient address is not a coloured wallet address. Please enter a coloured wallet address":"Recipient address is not a coloured wallet address. Please enter a coloured wallet address","Recover":"Recover","Recover DID Wallet":"Recover DID Wallet","Recover DID wallet":"Recover DID wallet","Recover Distributed Identity Wallet":"Recover Distributed Identity Wallet","Recover Wallet":"Recover Wallet","Recoverable Wallet":"Recoverable Wallet","Recovery Wallet":"Recovery Wallet","Refresh Plots":"Rifresko plotet","Relative Lock Height":"Lartësia relative e bllokimit","Release Notes":"Shënimet e Lirimit","Removing":"Po hiqet","Rename":"Riemërto","Rename Wallet":"Rename Wallet","Report an Issue...":"Raportoni një çështje...","Restore Metadata for Coloured Coins and other Smart Wallets from Backup":"Rivendosni të dhënat meta për monedhat me ngjyrë dhe kuletat e tjera inteligjente nga rezervimi","Restore Smart Wallets From Backup":"Restore Smart Wallets From Backup","Retire":"Retire","SB Height":"SB Height","Safe To Skip":"I sigurt për të kapërcyer","Save":"Ruaj","Search":"Search","Search block by header hash":"Blloku i kërkimit sipas kokës hash","Second temporary folder location":"Vendndodhja e përkohshme e dosjes së dytë","See private key":"Shiko çelësin privat","Seed:":"Fara:","Select 2nd Temporary Directory":"Zgjidhni Direktorinë e 2-të të Përkohshme","Select Final Directory":"Zgjidhni Drejtorinë Finale","Select Key":"Zgjidhni çelësin","Select Offer":"Zgjidhni Ofertën","Select Temporary Directory":"Zgjidhni Direktorinë e Përkohshme","Select Wallet":"Select Wallet","Select Wallet Type":"Zgjidhni Llojin e Portofolit","Select the final destination for the folder where you would like the plot to be stored. We recommend you use a large slow hard drive (like external HDD).":"Zgjidhni destinacionin përfundimtar për dosjen ku dëshironi të ruhet ploti. Ne ju rekomandojmë të përdorni një hard disk të ngadaltë (si HDD i jashtëm).","Select the temporary destination for the folder where you would like the plot to be stored. We recommend you use a fast SSD.":"Select the temporary destination for the folder where you would like the plot to be stored. We recommend you use a fast SSD.","Select the temporary destination for the folder where you would like the plot to be stored. We recommend you use a fast drive.":"Zgjidhni destinacionin e përkohshëm për dosjen ku dëshironi të ruhet ploti. Ne ju rekomandojmë të përdorni një Ssd të shpejtë.","Select your Plot NFT":"Zgjidhni plotin tuaj NFT","Select your Plot NFT from the dropdown or create a new one.":"Zgjidhni Plot tuaj NFT nga lista, ose krijoni një të ri.","Selected":"Zgjidhur","Selected recovery file:":"Selected recovery file:","Self Pooling":"Vetë grumbullimi","Self pool. When you win a block you will earn XCC rewards.":"Vetë grumbullimi. Kur të fitoni një bllok, do të fitoni shpërblime XCC.","Sell":"Shes","Send":"Dërgo","Send this info packet to your Rate Limited Wallet user who must use it to complete setup of their wallet:":"Dërgoni këtë paketë informacioni përdoruesit tuaj të Vlerësimit të Kufizuar të Portofolit, i cili duhet ta përdorë atë për të përfunduar konfigurimin e portofolit të tyre:","Send your pubkey to your Rate Limited Wallet admin:":"Dërgoni pubkey-in tuaj tek administratori juaj qe te vlerësojë Kuletën e Kufizuar:","Show Advanced Options":"Shfaq opsionet e avancuara","Show Asset Id":"Show Asset Id","Show Token and Asset Issuance Limitations":"Show Token and Asset Issuance Limitations","Show app":"Show app","Side":"Ana","Sign In":"Identifikohu","Skip":"Skip","Skips adding [final dir] to harvester for farming":"Skips adding [final dir] to harvester for farming","Skips adding a final directory to harvester for farming":"Kalon duke shtuar një direktori përfundimtare","Smooth out your XCC farming rewards by joining a pool.":"Z'busni shpërblimet tuaja XCC duke u bashkuar me një poll.","Something went wrong":"Dicka shkoi keq","Speech":"Të folurit","Spendable Amount":"Shuma e shpenzueshme","Spendable Amount Per Interval":"Shuma e shpenzueshme për interval","Spendable Balance":"Bilanci i harxhueshëm","Spending Interval (number of blocks): {interval}":["Intervali i shpenzimeve (numri i blloqeve): ",["interval"]],"Spending Interval Length (number of blocks)":"Gjatësia e intervalit të shpenzimeve (numri i blloqeve)","Spending Limit (chives per interval): {0}":["Kufiri i shpenzimeve (chives për interval): ",["0"]],"Standard Wallet":"Standard Wallet","Starting service {0}":["Starting service ",["0"]],"State":"Krahina","Status":"Statusi","Status:":"Statusi:","StatusCard.connections":"StatusCard.connections","StatusCard.height":"StatusCard.height","StatusCard.status":"StatusCard.status","StatusCard.title":"StatusCard.title","Stripe Size":"Stripe Size","Sub Block Height":"Sub Block Height","Sub Block at height {0} in the Chives blockchain":["Sub Block at height ",["0"]," in the Chives blockchain"],"Submit":"Paraqit","Success":"Success","Synced":"Sinkronizuar","Syncing":"Sinkronizimi","Syncing <0/>/<1/>":"Sinkronizimi <0/>/<1/>","Syncing {progress}/{tip}":["Syncing ",["progress"],"/",["tip"]],"TXCC Block Rewards":"TXCC Block Rewards","TXCC Farming Rewards":"TXCC Farming Rewards","TXCC Fees Collected":"TXCC Fees Collected","TXCC User Fees":"TXCC User Fees","TXCC User Transaction Fees":"TXCC User Transaction Fees","Target Puzzle Hash":"Synoni Puzzle Hash","Temporary files are created during the plotting process which exceeds the size of the final plot files. Make sure you have enough space. <0>Learn more</0>":"Temporary files are created during the plotting process which exceeds the size of the final plot files. Make sure you have enough space. <0>Learn more</0>","Temporary folder location":"Vendndodhja e përkohshme e dosjes","The application will stop working at block height 193536.":"Aplikimi do të ndalojë së punuari në lartësinë e bllokut 193536.","The full node that your farmer is connected to is below. <0>Learn more</0>":"Nyja e plotë me të cilën është lidhur fermeri juaj është më poshtë. <0> Mësoni më shumë </0>","The minimum required size for mainnet is k=32":"Madhësia minimale e kërkuar për rrjetin kryesor është k=32","The node is not synced":"Nyja nuk sinkronizohet","The node is syncing, which means it is downloading blocks from other nodes, to reach the latest block in the chain":"Nyja po sinkronizohet, që do të thotë se po shkarkon blloqe nga nyjet e tjera, për të arritur bllokun më të fundit në zinxhir","The number of Backup IDs needed for recovery cannot exceed the number of Backup IDs added.":"The number of Backup IDs needed for recovery cannot exceed the number of Backup IDs added.","The pool URL \"{normalizedUrl}\" is not working. Is it pool? Error: {0}":["URL-ja e pollit \"",["normalizedUrl"],"\" nuk po punon. Është poll? Gabim: ",["0"]],"The pool URL is not valid. {normalizedUrl}":["URL-ja e pollit nuk është e vlefshme. ",["normalizedUrl"]],"The pool URL needs to use protocol https. {normalizedUrl}":["URL-ja e pollit duhet të përdorë protokollin https. ",["normalizedUrl"]],"The pool URL speciefied is not valid. {normalizedUrl}":["The specified pool URL is not valid. ",["normalizedUrl"]],"The pool URL speciefied is not valid. {poolUrl}":["The pool URL specified is not valid. ",["poolUrl"]],"The pool switching operation was cancelled, please try again by changing pool, or self pooling":"Operacioni i ndërrimit të pollit u anulua, ju lutemi provoni përsëri duke ndryshuar pollin ose vetë-bashkuar","The seed used to create the plot. This depends on the pool pk and plot pk.":"Fara e përdorur për të krijuar komplotin. Kjo varet nga komploti pk i pollit.","The total number of VDF (verifiable delay function) or proof of time iterations on the whole chain up to this sub block.":"Numri i përgjithshëm i VDF (funksioni i verifikimit të vonesës) ose prova e përsëritjeve të kohës në të gjithë zinxhirin deri në këtë nën bllok.","The total number of VDF (verifiable delay function) or proof of time iterations on this block.":"Numri i përgjithshëm i VDF (funksioni i verifikimit të vonesës) ose prova e përsëritjeve të kohës në këtë bllok.","The total transactions fees in this block. Rewarded to the farmer.":"Tarifat totale të transaksioneve në këtë bllok. Shpërblyer për fermerin.","These are the instructions for how the farmer wants to get paid. By default this will be an XCC address, but it can be set to any string with a size of less than 1024 characters, so it can represent another blockchain or payment system identifier.":"Këto janë udhëzimet se si fermeri dëshiron të paguhet. Si parazgjedhje kjo do të jetë një adresë XCC, por mund të vendoset në çdo varg me madhësi më të vogël se 1024 karaktere, kështu që mund të përfaqësojë një tjetër identifikues të bllokut ose sistemit të pagesave.","These plots are invalid, you might want to delete them.":"Këto plote janë të pavlefshme, ju mund t'i fshini ato.","This access token is verified":"This access token is verified","This access token is whitelisted":"This access token is whitelisted","This allows you to add a directory that has plots in it. If you have not created any plots, go to the plotting screen.":"Kjo ju lejon të shtoni një direktori që ka plote në të. Nëse nuk keni krijuar ndonjë plot, shkoni në ekranin e krijomit të ploteve.","This difficulty is an artifically lower difficulty than on the real network, and is used when farming, in order to find more proofs and send them to the pool. The more plots you have, the higher difficulty you will have. However, the difficulty does not affect rewards.":"Kjo vështirësi është një vështirësi artificialisht më e ulët sesa në rrjetin real, dhe përdoret gjatë bujqësisë, në mënyrë që të gjeni më shumë prova dhe t'i dërgoni ato në poll. Sa më shumë plote të keni, aq më e vështirë do të keni. Sidoqoftë, vështirësia nuk ndikon në shpërblimet.","This feature is available only from the GUI.":"Kjo veçori është në dispozicion vetëm nga GUI.","This is the amount of Chives that you can currently use to make transactions. It does not include pending farming rewards, pending incoming transactions, and Chives that you have just spent but is not yet in the blockchain.":"Kjo është shuma e Chives që mund të përdorni aktualisht për të bërë transaksione. Nuk përfshin shpërblime në pritje të, transaksione në hyrje dhe Chives që sapo keni shpenzuar, por që nuk është ende në blockchain.","This is the pending change, which are change coins which you have sent to yourself, but have not been confirmed yet.":"Ky është ndryshimi në pritje, të cilat janë monedha ndryshimi që i keni dërguar vetes, por nuk janë konfirmuar ende.","This is the sum of the incoming and outgoing pending transactions (not yet included into the blockchain). This does not include farming rewards.":"Kjo është shuma e transaksioneve hyrëse dhe dalëse në pritje (nuk janë përfshirë ende në blockchain). Kjo nuk përfshin shpërblimet fermerit.","This is the time of the latest peak sub block.":"Kjo është koha e nën bllokut të pikut të fundit.","This is the time the block was created by the farmer, which is before it is finalized with a proof of time":"Kjo është koha kur blloku është krijuar nga fermeri, e cila është para se të finalizohet me një provë të kohës","This is the total amount of chives in the blockchain at the current peak sub block that is controlled by your private keys. It includes frozen farming rewards, but not pending incoming and outgoing transactions.":"Kjo është sasia totale e chives në blockchain në nën bllok bllokun aktual që kontrollohet nga çelësat tuaj privatë. Ai përfshin shpërblime të ngrira, por jo në pritje të transaksioneve hyrëse dhe dalëse.","This is the total balance + pending balance: it is what your balance will be after all pending transactions are confirmed.":"Ky është bilanci i përgjithshëm + bilanci në pritje: është ai që do të jetë bilanci juaj pasi të jenë konfirmuar të gjitha transaksionet në pritje.","This is the total number of points this plotNFT has with this pool, since the last payout. The pool will reset the points after making a payout.":"Ky është numri i përgjithshëm i pikëve që ka kjo plotNFT me këtë grup, që nga pagesa e fundit. Polli do të rivendosë pikët pasi të ketë bërë një pagesë.","This is the total number of points your farmer has found for this plot NFT. Each k32 plot will get around 10 points per day, so if you have 10TiB, should should expect around 1000 points per day, or 41 points per hour.":"Ky është numri i përgjithshëm i pikëve që fermeri juaj ka gjetur për këtë plot NFT. Çdo plot i k32 do të marrë rreth 10 pikë në ditë, kështu që nëse keni 10TiB, duhet të prisni rreth 1000 pikë në ditë, ose 41 pikë në orë.","This node is fully caught up and validating the network":"Kjo nyje është kapur plotësisht dhe po vërteton rrjetin","This plot NFT is assigned to a different key. You can still create plots for this plot NFT, but you can not make changes.":"Kjo plot NFT i është caktuar një çelësi tjetër. Ju ende mund të krijoni komplot për këtë plot NFT, por nuk mund të bëni ndryshime.","This plot NFT is not connected to pool":"Ky plot NFT nuk është i lidhur me pollin","This table shows you the last time your farm attempted to win a block challenge.":"This table shows you the last time your farm attempted to win a block challenge.","This table shows you the last time your farm attempted to win a block challenge. <0>Learn more</0>":"Kjo tabelë ju tregon hera e fundit që ferma juaj u përpoq të fitonte një sfidë blloku. <0> Mësoni më shumë </0>","This trade was created at this time":"Kjo tregti është krijuar në këtë kohë","This trade was included on blockchain at this block height":"Kjo tregti u përfshi në bllokimin në këtë lartësi të bllokut","This version of Chives is no longer compatible with the blockchain and can not safely farm.":"Ky version i Chives nuk është më i pajtueshëm me blockchain dhe nuk mund të fermojë në mënyrë të sigurt.","Time Created":"Koha qe u Kriua","Time this trade was created at this time":"Time this trade was created at this time","Timestamp":"Vula kohore","To":"Për","Token and Asset Issuance Limitations":"Token and Asset Issuance Limitations","Token has empty name":"Token has empty name","Token has empty tail":"Token has empty tail","Total Balance":"Totali i balances","Total Chives Farmed":"Total Chives Farmed","Total Iterations":"Përsëritjet totale","Total Network Space":"Hapësira totale e rrjetit","Total Plot Size:":"Madhësia totale e Ploteve:","Total Size of Plots":"Madhësia totale e ploteve","Total VDF Iterations":"Përsëritjet totale të VDF-së","Total iterations since the start of the blockchain":"Përsëritjet totale që nga fillimi i blockchain","Trade":"Trade","Trade Details":"Detajet e Tregtisë","Trade ID":"ID e tregtisë","Trade ID:":"ID e tregtisë:","Trade Overview":"Pasqyrë e Tregtisë","Trades will show up here":"Tregtitë do të shfaqen këtu","Trading":"Tregtimi","Trading History":"Historia e Tregtisë","Transaction has not been sent to node yet":"Transaction has not been sent to node yet","Transaction has sent to a full node and is pending inclusion into the mempool. {0}":["Transaction has sent to a full node and is pending inclusion into the mempool. ",["0"]],"Transaction has successfully been sent to a full node and included in the mempool.":"Transaction has successfully been sent to a full node and included in the mempool.","Transactions":"Transactions","Transactions Filter Hash":"Filteri I Transaksioneve","Try Again":"Try Again","Type":"Tipi","Unable to create plot NFT":"Në pamundësi për të krijuar plotin NFT","Unable to load the list of the keys":"Unable to load the list of the keys","Unclaimed Rewards":"Shpërblime të pakërkuara","Unfinished":"E papërfunduar","Unique identifier":"Identifikues unik","Unknown":"I panjohur","Unsaved Changes":"Ndryshimet e pa ruajtura","User Pubkey":"Përdoruesi Pubkey","VDF Sub Slot Iterations":"Përsëritjet e VDF Nën Slot","Value is too high":"Value is too high","Value seems high":"Vlera duket e lartë","Verify Pool Details":"Verifikoni detajet e pollit","View":"Shiko","View Log":"Shikoni regjistrin","View Offer":"Shiko Ofertën","View Payout Instructions":"View Payout Instructions","View Pool Login Link":"Shikoni lidhjen e hyrjes në poll","View pending balances":"Shikoni bilancet në pritje","View pending balances...":"Shikoni bilancet në pritje...","Wait for synchronization":"Prisni për sinkronizim","Waiting for launch":"Waiting for launch","Waiting for network to launch":"Waiting for network to launch","Waiting for the transaction to be confirmed":"Në pritje të konfirmimit të transaksionit","Wallet Status:":"Statusi i Portofolit:","Wallet does not exists":"Wallet does not exist","Wallet id is not defined":"Wallet id is not defined","WalletItem.ccWallet":"WalletItem.ccWallet","WalletItem.chivesWallet":"WalletItem.chivesWallet","WalletItem.didWallet":"WalletItem.didWallet","WalletItem.rlWallet":"WalletItem.rlWallet","WalletStatusCard.not_synced":"WalletStatusCard.not_synced","WalletStatusCard.synced":"WalletStatusCard.synced","WalletStatusCard.syncing":"WalletStatusCard.syncing","Wallets":"Kuletat","Wallets.title":"Wallets.title","Want to Join a Pool? Create a Plot NFT":"Dëshironi të bashkoheni në një poll? Krijoni një plot NFT","Want to earn more Chives? Add more plots to your farm.":"Dëshironi të fitoni më shumë Chives? Shtoni më shumë plote në fermën tuaj.","Want to have a delay before the next plot starts?":"Dëshironi të keni një vonesë para se të fillojë ploti tjetër?","Warning: This key is used for a wallet that may have a non-zero balance. By deleting this key you may lose access to this wallet":"Paralajmërim: Ky çelës përdoret për një portofol që mund të ketë një bilanc jo-zero. Duke fshirë këtë çelës mund të humbni qasjen në këtë portofol","Warning: This key is used for your farming rewards address. By deleting this key you may lose access to any future farming rewards":"Paralajmërim: Ky çelës përdoret për adresën tuaj të shpërblimeve. Duke fshirë këtë çelës, ju mund të humbni qasjen në çdo shpërblim të ardhshëm","Warning: This key is used for your pool rewards address. By deleting this key you may lose access to any future pool rewards":"Paralajmërim: Ky çelës përdoret për adresën tuaj të shpërblimeve në poll. Duke fshirë këtë çelës, mund të humbni qasjen në çdo shpërblim të ardhshëm të pollit","Weight":"Pesha","Weight is the total added difficulty of all sub blocks up to and including this one":"Pesha është vështirësia totale e shtuar e të gjitha nën blloqeve deri dhe duke përfshirë këtë","Welcome to Chives. Please log in with an existing key, or create a new key.":"Mirësevini në Chives. Ju lutemi identifikohuni me një çelës ekzistues, ose krijoni një çelës të ri.","Welcome! The following words are used for your wallet backup. Without them, you will lose access to your wallet, keep them safe! Write down each word along with the order number next to them. (Order is important)":"Mirëseardhje! Fjalët e mëposhtme përdoren për rezervimin e portofolit tuaj. Pa to, ju do të humbni hyrjen në portofolin tuaj, mbajini të sigurta! Shkruani secilën fjalë së bashku me numrin e rendit pranë tyre. (Renditja është e rëndësishme)","When you receive the setup info packet from your admin, enter it below to complete your Rate Limited Wallet setup:":"Kur të merrni paketën e informacionit të konfigurimit nga administratori juaj, futeni atë më poshtë për të përfunduar konfigurimin e Portofolit të Kufizuar të Vlerësimit:","Window":"Dritare","Without fees":"Pa tarifa","Yes":"Po","You are in pending state. Please wait for confirmation":"Ju jeni në gjendje pritje. Ju lutemi të prisni për konfirmim","You are not self pooling":"Ju nuk po beni poll vetëm","You can still create plots for this plot NFT, but you can not make changes until sync is complete.":"Ende mund të krijoni plote për këtë plot NFT, por nuk mund të bëni ndryshime derisa të përfundojë sinkronizimi.","You do not need to be synced or connected to plot. Temporary files are created during the plotting process which exceed the size of the final plot files. Make sure you have enough space. <0>Learn more</0>":"You do not need to be synced or connected to plot. Temporary files are created during the plotting process which exceed the size of the final plot files. Make sure you have enough space. <0>Learn more</0>","You do not need to be synched or connected to Plot. Temporary files are created during the plotting process which exceed the size of the final plot files. Make sure you have enough space. <0>Learn more</0>":"You do not need to be synched or connected to Plot. Temporary files are created during the plotting process which exceed the size of the final plot files. Make sure you have enough space. <0>Learn more</0>","You do not need to be synched or connected to plot. Temporary files are created during the plotting process which exceed the size of the final plot files. Make sure you have enough space. <0>Learn more</0>":"Ju nuk keni nevojë të sinkronizoheni ose të lidheni me plotin. Skedarët e përkohshëm krijohen gjatë procesit të plotimit që tejkalojnë madhësinë e skedarëve përfundimtarë të skemës. Sigurohuni që të keni hapësirë të mjaftueshme. <0> Mësoni më shumë </0>","You have made changes. Do you want to discard them?":"Ju keni bërë ndryshime. A doni t'i hidhni ato?","You have {0}% of the space on the network, so farming a block will take {expectedTimeToWin} in expectation.":["You have ",["0"],"% of the space on the network, so farming a block will take ",["expectedTimeToWin"]," in expectation."],"You have {0}% of the space on the network, so farming a block will take {expectedTimeToWin} in expectation. Actual results may take 3 to 4 times longer than this estimate.":["Ju keni ",["0"],"% të hapësirës në rrjet, kështu që prodhimi i një blloku do të marrë ",["expectedTimeToWin"],". Rezultatet aktuale mund të zgjasin 3 deri në 4 herë më shumë se sa ky vlerësim."],"You have {0}% of the space on the network, so farming a block will take {expectedTimeToWin} in expectation. Actual results may take 3-4 times longer - actual results may be 3x this estimate.<0>Learn about Expected Value</0>":["You have ",["0"],"% of the space on the network, so farming a block will take ",["expectedTimeToWin"]," in expectation. Actual results may take 3-4 times longer - actual results may be 3x this estimate.<0>Learn about Expected Value</0>"],"You have {0}% of the space on the network, so farming a block will take {expectedTimeToWin} in expectation. Actual results may take 3-4 times longer this estimate. <0>Learn about Expected Value</0>":["You have ",["0"],"% of the space on the network, so farming a block will take ",["expectedTimeToWin"]," in expectation. Actual results may take 3-4 times longer this estimate. <0>Learn about Expected Value</0>"],"You need to claim your rewards first":"Së pari duhet të kërkoni shpërblimet tuaja","You need to upgrade the Chives application as this version will stop working soon!":"You need to upgrade the Chives application as this version will stop working soon!","You need {currencyCode} to join a pool.":["Ju duhet ",["currencyCode"]," për t'u bashkuar me një poll."],"You will recieve <0/> to {0}":["Ju do të merrni <0/> te ",["0"]],"You will recieve <0/> to {address}":["Ju do të merrni <0/> te ",["address"]],"Your DID requires at least {dids_num_req} attestation file{0} for recovery. Please upload additional files.":["Your DID requires at least ",["dids_num_req"]," attestation file",["0"]," for recovery. Please upload additional files."],"Your Farm Overview":"Pasqyra juaj e Fermës","Your Full Node Connection":"Lidhja juaj e plotë e nyjes","Your Harvester Network":"Rrjeti juaj Harvester","Your Pool Overview":"Përmbledhja juaj e pollit","[Error 13] Permission denied. You are trying to access a file/directory without having the necessary permissions. Most likely one of the plot folders in your config.yaml has an issue.":"[Gabimi 13] Leja u refuzua. Ju po përpiqeni të përdorni një skedar / direktori pa pasur lejet e nevojshme. Ka shumë të ngjarë që një nga dosjet e skemave në konfigurimin.yaml ka një problem.","[Error 22] File not found. Most likely one of the plot folders in your config.yaml has an issue.":"[Gabimi 22] Skedari nuk u gjet. Ka shumë të ngjarë që një nga dosjet e skemave në konfigurimin.yaml ka një problem.","connections:":"lidhje:","height:":"lartësia:","not synced":"i pa sinkronizuar","p2_singleton_puzzle_hash is not defined":"p2_singleton_puzzle_hash nuk është përcaktuar","status:":"statusi:","synced":"sinkronizuar","syncing":"po sinkronizohet","{0} Block Rewards":[["0"]," Block Rewards"],"{0} User Transaction Fees":[["0"]," User Transaction Fees"],"{0} points {1} - {2} hours ago":[["0"]," pikë ",["1"]," - ",["2"]," orë më parë"],"{currencyCode} Block Rewards":[["currencyCode"]," Shpërblimet e bllokut"],"{currencyCode} Total Chives Farmed":[["currencyCode"]," Totali i Chives"],"{currencyCode} User Transaction Fees":[["currencyCode"]," Tarifat e Transaksionit të Përdoruesit"],"{mojo, plural, one {mojo} other {mojos}}":[["mojo","plural",{one:"mojo",other:"mojos"}]]}}; | 53,929 | 53,929 | 0.767899 |
99618ef7a59a0d757961622d077c69281ff81259 | 5,952 | js | JavaScript | src/server/index.js | fatec-taquaritinga/organiser | 115b0adf95bae9a47218f2d3afc1b729189eeb61 | [
"MIT"
] | 56 | 2017-10-19T05:57:47.000Z | 2022-02-09T18:24:53.000Z | src/server/index.js | fatec-taquaritinga/organiser | 115b0adf95bae9a47218f2d3afc1b729189eeb61 | [
"MIT"
] | 1 | 2017-10-19T22:58:01.000Z | 2017-10-19T22:58:39.000Z | src/server/index.js | fatec-taquaritinga/organiser | 115b0adf95bae9a47218f2d3afc1b729189eeb61 | [
"MIT"
] | 4 | 2017-10-25T14:46:27.000Z | 2020-01-16T14:03:14.000Z | import http from 'http'
import https from 'https'
import debug from '../debug'
import defaultOptions from './defaultOptions'
import Router from './router'
import { EventBus, EventType } from '../events'
import Exceptions from '../exceptions'
export const ServerStatus = {
SERVER_CLOSE: 'SERVER_CLOSE',
SERVER_OPEN: 'SERVER_OPEN',
SERVER_BOOT: 'SERVER_BOOT',
SERVER_SHUTDOWN: 'SERVER_SHUTDOWN'
}
export class Server {
constructor (options) {
this._start = process.hrtime()
this.options = isNaN(options) ? options : { port: options }
this._eventBus = new EventBus(this)
this._router = new Router(this)
this._status = ServerStatus.SERVER_CLOSE
this._nodeServer = this._options.https ? https.createServer(this._options.https) : http.createServer()
this._nodeServer.on('request', (req, res) => {
const a = this
const b = process.hrtime()
this._router.resolveRoute({
set instance (instance) {
throw new Exceptions.OPERATION_NOT_ALLOWED('You can\'t change the server instance of a request.')
},
get instance () {
return a
},
set request (request) {
throw new Exceptions.OPERATION_NOT_ALLOWED('You can\'t change the request object.')
},
get request () {
return req
},
set response (response) {
throw new Exceptions.OPERATION_NOT_ALLOWED('You can\'t change the response object.')
},
get response () {
return res
},
set timing (timing) {
throw new Exceptions.OPERATION_NOT_ALLOWED('This is not a DeLorean, Doc...')
},
get timing () {
return b
}
})
})
}
get status () {
return this._status
}
get options () {
return this._options
}
set options (options) {
this._options = Object.assign(defaultOptions, options || {})
}
modules (...modules) {
return this._router.modules(modules)
}
routes (...routes) {
routes = routes.length > 0 ? this._router.register(routes) : null
const router = this._router
return {
after (...modules) {
const len = modules.length
if (routes) {
for (let route of routes) {
if (len === 2 && !isNaN(routes[0])) {
route.modules.after.register(routes[0], routes[1])
} else {
for (let mod of modules) route.modules.after.register(mod)
}
}
} else {
if (len === 2 && !isNaN(routes[0])) {
router._modules.after.register(routes[0], routes[1])
} else {
for (let mod of modules) router._modules.after.register(mod)
}
}
return this
},
before (...modules) {
const len = modules.length
if (routes) {
for (let route of routes) {
if (len === 2 && !isNaN(routes[0])) {
route.modules.before.register(routes[0], routes[1])
} else {
let index = len
while (--index >= 0) {
route.modules.before.register(0, modules[index])
}
}
}
} else {
if (len === 2 && !isNaN(routes[0])) {
router._modules.before.register(routes[0], routes[1])
} else {
let index = len
while (--index >= 0) {
router._modules.before.register(0, modules[index])
}
}
}
return this
}
}
}
set isRunning (isRunning) {
if (isRunning) {
if (this.isRunning) {
this.reboot()
} else {
this.boot()
}
} else {
this.close()
}
}
get isRunning () {
return (this._nodeServer && this._nodeServer.listening) || false
}
registerListener (eventType, listener) {
this._eventBus.registerListener(eventType, listener)
}
removeListener (eventType, listener) {
this._eventBus.removeListener(eventType, listener)
}
emitEvent (eventType, e) {
this._eventBus.emit(eventType, e)
}
boot () {
return new Promise((resolve, reject) => {
const bootEvent = EventType.SERVER_STATUS_UPDATE_EVENT(ServerStatus.SERVER_BOOT)
this.emitEvent(bootEvent)
if (bootEvent.isCancelled()) {
resolve(this._status)
process.exit()
} else {
this._nodeServer.listen(this._options.port, this._options.host, (err) => {
if (err) {
reject(err)
return
}
const diff = process.hrtime(this._start)
const e = EventType.SERVER_STATUS_UPDATE_EVENT(ServerStatus.SERVER_OPEN, `(${((diff[0] * 1000000000) + diff[1]) / 1000000000}s) ${this._options.name} is up and running at ${this._options.host}:${this._options.port}.`)
this.emitEvent(e)
if (e.isCancelled()) {
this.close().then((serverStatus) => resolve(serverStatus))
} else {
if (e.message) debug.log.success(e.message)
resolve((this._status = e.status))
}
})
}
})
}
close () {
return new Promise((resolve, reject) => {
const shutdownEvent = EventType.SERVER_STATUS_UPDATE_EVENT(ServerStatus.SERVER_SHUTDOWN)
this.emitEvent(shutdownEvent)
if (shutdownEvent.isCancelled()) {
resolve(this._status)
} else {
this._nodeServer.close((err) => {
if (err) {
reject(err)
return
}
const e = EventType.SERVER_STATUS_UPDATE_EVENT(ServerStatus.SERVER_SHUTDOWN, `${this._options.name} is now closed.`)
this.emitEvent(e)
if (e.isCancelled()) {
resolve(this._status)
} else {
if (e.message) debug.log.warning(e.message)
resolve((this._status = e.status))
}
})
}
})
}
reboot () {
this.close().then(this.boot)
}
}
| 28.615385 | 227 | 0.558636 |
9961f613e70297fc4fc1d8e406c4bb15797ee9ea | 5,777 | js | JavaScript | src/number-prop.test.js | flybondi/ramda-land | 00222bc10d23c02fa55f3fdfbd0b64ce9f5c7903 | [
"MIT"
] | 5 | 2020-02-06T11:39:40.000Z | 2021-09-13T21:29:27.000Z | src/number-prop.test.js | flybondi/ramda-land | 00222bc10d23c02fa55f3fdfbd0b64ce9f5c7903 | [
"MIT"
] | 33 | 2020-02-03T15:26:14.000Z | 2022-02-23T12:23:12.000Z | src/number-prop.test.js | flybondi/ramda-land | 00222bc10d23c02fa55f3fdfbd0b64ce9f5c7903 | [
"MIT"
] | 1 | 2020-07-01T03:51:31.000Z | 2020-07-01T03:51:31.000Z | import { numberProp, numberPath, numberPathOr, numberPropOr } from './number-prop';
describe('the `numberProp` function', () => {
test('should return a number from numerical string property', () => {
expect(numberProp('provincesCount', { provincesCount: '23' })).toEqual(23);
});
test('should return a number from a number property', () => {
expect(numberProp('provincesCount', { provincesCount: 23 })).toEqual(23);
});
test('should return `undefined` when extracted property does not exist', () => {
expect(numberProp('provincesCount', {})).toBeUndefined();
});
test('should return `undefined` when extracted property is `undefined`', () => {
expect(numberProp('provincesCount', { provincesCount: undefined })).toBeUndefined();
});
test('should return `null` when extracted property is `null`', () => {
expect(numberProp('provincesCount', { provincesCount: null })).toBeNull();
});
test('should return `NaN` when extracted property is not a numerical string', () => {
expect(numberProp('provincesCount', { provincesCount: 'foo' })).toBeNaN();
});
test('should return `NaN` when extracted property is not an empty string', () => {
expect(numberProp('provincesCount', { provincesCount: '' })).toBeNaN();
});
});
describe('the `numberPath` function', () => {
test('should return a number from a nested numerical string property', () => {
expect(numberPath(['data', 'count'], { data: { count: '23' } })).toEqual(23);
});
test('should return a number from a nested number property', () => {
expect(numberPath(['data', 'count'], { data: { count: 23 } })).toEqual(23);
});
test('should return `undefined` when extracted property does not exist', () => {
expect(numberPath(['data', 'count'], { data: {} })).toBeUndefined();
});
test('should return `undefined` when extracted property is `undefined`', () => {
expect(numberPath(['data', 'count'], { data: { count: undefined } })).toBeUndefined();
});
test('should return `null` when extracted property is `null`', () => {
expect(numberPath(['data', 'count'], { data: { count: null } })).toBeNull();
});
test('should return `NaN` when extracted property is not a numerical string', () => {
expect(numberPath(['data', 'count'], { data: { count: 'foo' } })).toBeNaN();
});
test('should return `NaN` when extracted property is not an empty string', () => {
expect(numberPath(['data', 'count'], { data: { count: '' } })).toBeNaN();
});
test('should support a single string as property path', () => {
expect(numberPath('count', { count: 23 })).toEqual(23);
});
});
describe('the `numberPropOr` function', () => {
test('should return a number from a numerical string property', () => {
expect(numberPropOr(42, 'provincesCount', { provincesCount: '23' })).toEqual(23);
});
test('should return a number from a number property', () => {
expect(numberPropOr(42, 'provincesCount', { provincesCount: 23 })).toEqual(23);
});
test('should return the given default value when extracted property does not exist', () => {
expect(numberPropOr(42, 'provincesCount', {})).toEqual(42);
});
test('should return the given default value when extracted property is `null`', () => {
expect(numberPropOr(42, 'provincesCount', { provincesCount: null })).toEqual(42);
});
test('should return the given default value when extracted property is `undefined`', () => {
expect(numberPropOr(42, 'provincesCount', { provincesCount: undefined })).toEqual(42);
});
test('should return the given default value when extracted property is not a numerical string', () => {
expect(numberPropOr(42, 'provincesCount', { provincesCount: 'foo' })).toEqual(42);
});
test('should return the given default value when extracted property is an empty string', () => {
expect(numberPropOr(42, 'provincesCount', { provincesCount: '' })).toEqual(42);
});
test('should return the given default value when extracted property is an object', () => {
expect(numberPropOr(42, 'provincesCount', { provincesCount: {} })).toEqual(42);
});
});
describe('the `numberPathOr` function', () => {
test('should return a number from a nested numerical string property', () => {
expect(numberPathOr(42, ['data', 'count'], { data: { count: '23' } })).toEqual(23);
});
test('should return a number from a number property', () => {
expect(numberPathOr(42, ['data', 'count'], { data: { count: 23 } })).toEqual(23);
});
test('should return the given default value when extracted property does not exist', () => {
expect(numberPathOr(42, ['data', 'count'], {})).toEqual(42);
});
test('should return the given default value when extracted property is `null`', () => {
expect(numberPathOr(42, ['data', 'count'], { data: { count: null } })).toEqual(42);
});
test('should return the given default value when extracted property is `undefined`', () => {
expect(numberPathOr(42, ['data', 'count'], { data: { count: undefined } })).toEqual(42);
});
test('should return the given default value when extracted property is not a numerical string', () => {
expect(numberPathOr(42, ['data', 'count'], { data: { count: 'foo' } })).toEqual(42);
});
test('should return the given default value when extracted property is an empty string', () => {
expect(numberPathOr(42, ['data', 'count'], { data: { count: '' } })).toEqual(42);
});
test('should return the given default value when extracted property is an object', () => {
expect(numberPathOr(42, ['data', 'count'], { data: { count: {} } })).toEqual(42);
});
test('should support a single string as property path', () => {
expect(numberPathOr(42, 'count', { count: 23 })).toEqual(23);
});
});
| 41.862319 | 105 | 0.637528 |
99621f6b9a14680f3b97deee2917ef046e146a15 | 1,699 | js | JavaScript | challenge_1/app.js | AmiraVomir/mini-apps-1 | e6461819b23586430994cf4cbec19e696a377999 | [
"MIT"
] | null | null | null | challenge_1/app.js | AmiraVomir/mini-apps-1 | e6461819b23586430994cf4cbec19e696a377999 | [
"MIT"
] | 1 | 2021-05-11T17:33:12.000Z | 2021-05-11T17:33:12.000Z | challenge_1/app.js | hieuhho/mini-apps-1 | e6461819b23586430994cf4cbec19e696a377999 | [
"MIT"
] | null | null | null | let start = 1;
let moves = [];
let winner = false;
let piece = function() {
let piece = 'X';
if (start % 2 === 0) {
piece = 'O';
}
start += 1;
return piece;
}
let winConditions = [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9],
[1, 4, 7],
[2, 5, 8],
[3, 6, 9],
[1, 5, 9],
[3, 5, 7] ];
document.addEventListener('click', function() {
if (event.target.id !== 'reset' && event.target.id) {
if (!moves.includes(event.target.id)) {
document.getElementById(event.target.id).innerHTML = piece()
moves.push(event.target.id);
checkWinner(Number(event.target.id));
} else {
console.log('Illegal Move');
}
if (moves.length === 9 && !winner) {
setTimeout(() => { alert('NOBODY WINS') }, 200)
}
}
else if (event.target.id === 'reset') {
start = 1;
moves = [];
let winner = false;
winConditions = [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9],
[1, 4, 7],
[2, 5, 8],
[3, 6, 9],
[1, 5, 9],
[3, 5, 7] ];
let obj = document.getElementsByClassName('square');
for (var i = 0; i < obj.length; i++) {
if (obj.item(i)) {
obj.item(i).innerHTML = '';
}
}
}
});
let checkWinner = function(id) {
let player;
if (start % 2 === 0) {
player = 'X'
} else {
player = 'O'
}
winConditions.forEach((arr) => {
for (var i = 0; i < arr.length; i++) {
if (arr[i] === id) {
arr.splice(i, 1, player)
}
}
let winning = (typeof arr[0] !== 'number') && (arr[0] === arr[1]) && (arr[1] === arr[2]);
if (winning) {
winner = true;
setTimeout(() => {
alert(`${player} wins`)}, 200)
}
})
};
| 19.755814 | 93 | 0.464979 |
996247ad12427541cec050284707070b12ab74fd | 692 | js | JavaScript | 7-kyu/Flatten/index.js | ayessetova/codeW | fa5479162a19b863047ea318ad728c86946a3f46 | [
"MIT"
] | 314 | 2017-12-08T16:51:31.000Z | 2022-03-30T01:59:49.000Z | 7-kyu/Flatten/index.js | ayessetova/codeW | fa5479162a19b863047ea318ad728c86946a3f46 | [
"MIT"
] | 4 | 2018-04-27T03:54:20.000Z | 2020-12-06T20:13:40.000Z | 7-kyu/Flatten/index.js | ayessetova/codeW | fa5479162a19b863047ea318ad728c86946a3f46 | [
"MIT"
] | 141 | 2017-12-18T18:19:13.000Z | 2022-03-29T12:16:38.000Z | /*
Title:
Flatten
Description:
Write a function that flattens an Array of Array objects into a flat Array.
Your function must only do one level of flattening.
Examples:
flatten([1,2,3])
// => [1,2,3]
flatten([[1,2,3],["a","b","c"],[1,2,3]])
// => [1,2,3,"a","b","c",1,2,3]
flatten([[[1,2,3]]])
// => [[1,2,3]]
Kata Link:
https://www.codewars.com/kata/flatten-1
Discuss Link:
https://www.codewars.com/kata/flatten-1/discuss
Solutions Link:
https://www.codewars.com/kata/flatten-1/solutions
*/
// Short Solution
const flatten = array => array.reduce((a, v) => a.concat(v), [])
// Function Export
module.exports = flatten
| 21.625 | 79 | 0.593931 |
99628c206d25cbc6f02c147414467364d86c3538 | 84,860 | js | JavaScript | minifed/crxOop.strict.min.js | EyeAndTea/CrxOop | 0c5b07db3d86447cd481a7d7f6d5160a86e9edc9 | [
"MIT"
] | 2 | 2018-08-18T17:37:42.000Z | 2018-11-11T23:10:02.000Z | minifed/crxOop.strict.min.js | EyeAndTea/CrxOop | 0c5b07db3d86447cd481a7d7f6d5160a86e9edc9 | [
"MIT"
] | null | null | null | minifed/crxOop.strict.min.js | EyeAndTea/CrxOop | 0c5b07db3d86447cd481a7d7f6d5160a86e9edc9 | [
"MIT"
] | null | null | null | //version: 2.6.7
/*
The MIT License (MIT)
Copyright (c) 2016 ObIb
ObIb: Ob are the first two letters of my first name, and Ib are the first two letters
of my father's father's (grandfather's) first name. I was the senior developer at Creatrix Design
Group (website: creatrix.ca. address:2764 Richmond Rd, Ottawa Ontario Canada K2B6S2), during
but not limited to the year 2014. This information is part of the license and uniquely identifies
me, the license holder.
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.
*/
(function(){"use strict";var g=((typeof(window)!=="undefined")&&(typeof(window.document)!=="undefined"));var ao=null;var E=null;if(bD()){return;}var a9=true;var ar=(function(){"use strict";return !this;})();var J=(ar?(function(){return !this;})():((E&&E.CRXNS_NON_STRICT_MODE)?false:true));var bb=function(){};var Z=1;var K=2;var b5=3;var bu=4;var aH=5;var aw=1;var a1=2;var cz=1;var W=2;var bG=4;var cB=8;var bM=16;var b2=32;var ah=1;var aX=true;var cs=null;var a2=null;var o=(Object.seal&&a9?Object.seal:function(){});var cc=(Object.freeze?Object.freeze:function(){});var cd=false;var bB=false;var av=false;var aV=false;var h=false;var d=false;var cp=null;var S={};var ac={};var aC={};var bv={};var bn={};var bW=1;var aT={};var C={};var bX={};var aM={};var bo={};var O={};var aL={};var P={};var L={};var ad={};var bI=false;var bZ={};var bc={};var a0={};var bp={};var aF={};var D=1;var co={};var bS={};var r={};var by={};var ca={};var at={};var bT={};var Y=1;var cv={};var bE={};var cA={};var bQ={};var X={};var q={};var n={};var bU=function(cD,cC){au("CrxOop ==> "+cD,cC);};var au=function(cD,cC){var cE=(E||global);if(cE&&cE.console&&cE.console.log){cE.console.log(cD);}};var bw={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regexp","[object Object]":"object","[object Error]":"error"};var aI=[null,null];var I=[];var ck={};var bK=[];var aj={};var G={};var ct=null;var s=null;var bP=null;var ce=null;var bl=false;function bD(){var cE=false;if(g){if(window.crx_registerClass){cE=true;}else{ao={};E=window;}}else{var cD=Symbol["for"]("225e78bc-206d-4319-aff0-68bb2796b931");var cC=Object.getOwnPropertySymbols(global);if(cC.indexOf(cD)>-1){cE=true;module.exports=global[cD];}else{ao={};global[cD]=ao;module.exports=ao;if(typeof(global["window"])!=="undefined"){E=global.window;}}}return cE;}if(!Object.create){a2=function(cC){function cD(){}cD.prototype=cC;return new cD();};}else{a2=Object.create;}if(Object.defineProperty){var am={};try{Object.defineProperty(am,"s",{value:"d",writable:false});cd=true;bB=true;av=true;}catch(aO){}}function H(){if(!G.x){J=true;}}function i(){return(i.caller===H);}if(cd&&!J){Object.defineProperty(G,"x",{get:i,set:function(){},enumerable:true});H();}if(!cd&&!J&&!aX){x("CURRENT BROWSER IS NOT SUPPORTED IN NON STRICT MODE");}if(a9&&!cd){bI=true;}function ak(cC){if(cC==null){return(cC+"");}return(((typeof(cC)==="object")||(typeof(cC)==="function"))?(bw[Object.prototype.toString.call(cC)]||"object"):(typeof(cC)));}if(g&&window.TraceKit&&window.TraceKit.report&&window.TraceKit.report.subscribe){s=function(cF){if((cF.message==="CrxOop::start")||(cF.message==="CrxOop::end")){var cC=null;if(cF.stack&&(ak(cF.stack)==="array")&&cF.stack.length>0){cC={"fileName":(cF.stack[0].url?cF.stack[0].url.toLowerCase():null),"line":(cF.stack[0].line?cF.stack[0].line:-1),"column":(cF.stack[0].column?cF.stack[0].column:-1)};}else{cC={};}if((cF.message==="CrxOop::start")&&(bP===null)){bP=cC;}else{if((cF.message==="CrxOop::end")&&(ce===null)){ce=cC;bl=true;}}}else{var cD="";if(cF.message){au(cF.message,0);}if(cF.stack&&(ak(cF.stack)==="array")){cD="CrxOop: Stack Trace \n";for(var cE=0;cE<cF.stack.length;cE++){if(!bJ((cF.stack[cE].url?cF.stack[cE].url:null),(cF.stack[cE].line?cF.stack[cE].line:null),(cF.stack[cE].column?cF.stack[cE].column:null))){cD+=cF.stack[cE].url+" :: ln<"+cF.stack[cE].line+(cF.stack[cE].column?":"+cF.stack[cE].column:"")+">";if(cF.stack[cE].func&&(cF.stack[cE].func!=="?")){cD+=" => "+cF.stack[cE].func;}cD+="\n";}}}window.TraceKit.report.unsubscribe(s);au(cD,0);}};ct=function(cE){var cC=null;window.TraceKit.report.subscribe(s);try{window.TraceKit.report(cE);}catch(cD){cC=cD;}};}else{if(g&&window.StackTrace&&window.StackTrace.get&&window.StackTrace.fromError){ct=function(cD,cC){if((cD.message==="CrxOop::start")||(cD.message==="CrxOop::end")){window.StackTrace.fromError(cD).then(function(cF){var cE=null;if(cF.length>0){cE={"fileName":(cF[0].fileName?cF[0].fileName.toLowerCase():null),"line":(cF[0].lineNumber?cF[0].lineNumber:-1),"column":(cF[0].columnNumber?cF[0].columnNumber:-1)};}if((cD.message==="CrxOop::start")&&(bP===null)){bP=cE;}else{if((cD.message==="CrxOop::end")&&(ce===null)){ce=cE;bl=true;}}})["catch"](function(cE){});}else{window.StackTrace.fromError(cD).then(function(cG){var cE=cC+"\n"+"CrxOop: Stack Trace \n";for(var cF=0;cF<cG.length;cF++){if(!bJ((cG[cF].fileName?cG[cF].fileName:null),(cG[cF].lineNumber?cG[cF].lineNumber:null),(cG[cF].columnNumber?cG[cF].columnNumber:null))){cE+=cG[cF].fileName+" :: ln<"+cG[cF].lineNumber+(cG[cF].columnNumber?":"+cG[cF].columnNumber:"")+">\t";if(cG[cF].functionName){cE+=" => "+cG[cF].functionName;}cE+="\n";}}au(cE,0);})["catch"](function(cE){});}};}else{ct=function(cJ,cG){var cK=new RegExp(".*?[\\(\\[\\s\\:](\\d+)([:]+(\\d*))?.*");var cH=new RegExp(".+[\\/\\\\]([^\\/\\\\]+\\.js)[^a-zA-Z\\\"\\']*");if((cJ.message==="CrxOop::start")||(cJ.message==="CrxOop::end")){var cE=null;var cD=""+cJ.stack||cJ.stacktrace;var cI=[];if(cD.length>0){cI=cD.split("\n");}if(cI.length>0){var cC=cK.exec(cI[0]);var cF=cH.exec(cI[0]);if(!cC&&!cF&&(cI.length>1)&&((cI[0].indexOf("CrxOop::start")>=0)||(cI[0].indexOf("CrxOop::end")>=0))){cC=cK.exec(cI[1]);cF=cH.exec(cI[1]);}cE={"fileName":((cF&&cF[1])?cF[1].toLowerCase():null),"line":((cC&&cC[1])?parseInt(cC[1]):-1),"column":((cC&&cC[3])?parseInt(cC[3]):-1)};cE["line"]=(cE["line"]?cE["line"]:-1);cE["column"]=(cE["column"]?cE["column"]:-1);}if((cJ.message==="CrxOop::start")&&(bP===null)){bP=cE;}else{if((cJ.message==="CrxOop::end")&&(ce===null)){ce=cE;bl=true;}}}else{if(g){setTimeout(function(){a3(cJ,cG,cK,cH);},1);}else{return a3(cJ,cG,cK,cH);}}};}}try{throw new Error("CrxOop::start");}catch(aO){ct(aO);}function a3(cL,cH,cJ,cE){var cD=""+(cL.stack||cL.stacktrace||"");if(cD.length>0){var cK=cD.split("\n");cD="";for(var cF=0;cF<cK.length;cF++){if(cK[cF]&&(cK[cF].toLowerCase().indexOf("crxoop.")>=0)){continue;}var cI=false;var cC=cJ.exec(cK[cF]);var cG=cE.exec(cK[cF]);if(!bJ(((cG&&cG[1])?cG[1]:null),((cC&&cC[1])?cC[1]:null),((cC&&cC[3])?cC[3]:null))){cD+=cK[cF]+"\n";}}au("\n"+cH+"\n"+"CrxOop: Stack Trace \n"+cD,0);return"\n"+cH+"\n"+"CrxOop: Stack Trace \n"+cD;}else{return"\n"+cH+"\n";}}function bJ(cD,cF,cC){var cE=false;if(bP&&ce){if(cD){if(bP.fileName===cD.toLowerCase()){if((bP.line!==-1)&&(ce.line!==-1)&&cF){if((cF>=bP.line)&&(cF<=ce.line)){if((bP.line===ce.line)&&(bP.column!==-1)&&(ce.column!==-1)&&cC){if((cC>=bP.column)&&(cC<=ce.column)){cE=true;}}else{cE=true;}}}else{cE=true;}}}}else{if(cD){if(cD.toLowerCase().indexOf("crxoop.")>=0){cE=true;}}}return cE;}function y(cD,cC){if(d){return;}aV=true;if(S.hasOwnProperty(cD)||aF.hasOwnProperty(cD)||by.hasOwnProperty(cD)){x("Interface or Class or Structure with name '"+cD+"' already declared",-1);}if(!cC.CRX_CLASS_ID){cC.CRX_DEFINITION=true;cC.CRX_CLASS_ID=bW;cC.CRX_CLASS_NAME=cD;if((cC.CRX_DEFINITION!==true)||(cC.CRX_CLASS_ID!==cC.CRX_CLASS_ID)||(cC.CRX_CLASS_NAME!==cD)||(cC.CRX_INTERFACE_ID!==void (0))){x("UNKNOWN ERROR IN DEFINITION OF CLASS '"+cD+"'",-1);}cc(cC);aQ(cC);bW=bW+1;}S[cD]=cC.CRX_CLASS_ID;}function bg(cD,cC){if(d){return;}if(typeof(cD)==="string"){if(!S[cD]){return null;}else{return(ac[S[cD]]||null);}}else{if((cD===null)||(typeof(cD)!=="object")||(cD.CRX_INTERFACE_ID!==void (0))||(cD.CRX_STRUCTURE_ID!==void (0))){return null;}else{if(!cD.CRX_CLASS_ID&&!cC){cD.CRX_DEFINITION=true;cD.CRX_CLASS_ID=bW;if((cD.CRX_DEFINITION!==true)||(cD.CRX_CLASS_ID!==cD.CRX_CLASS_ID)){x("UNKNOWN ERROR IN DEFINITION OF CLASS '$C"+bW+"'");}cc(cD);aQ(cD);bW=bW+1;}return ac[cD.CRX_CLASS_ID];}}}function al(cC){if(d){return;}if(typeof(cC)==="string"){return(S[cC]||null);}return(cC.CRX_CLASS_ID||null);}function aZ(cC){if(cC.CRX_CLASS_NAME){return cC.CRX_CLASS_NAME;}if(cC.CRX_CLASS_ID){return"$C"+cC.CRX_CLASS_ID;}return null;}function bi(cC,cD){if(d){return;}aV=true;if(S.hasOwnProperty(cC)||aF.hasOwnProperty(cC)||by.hasOwnProperty(cC)){x("Interface or Class or Structure with name '"+cC+"' already declared",-1);}if(!cD.CRX_INTERFACE_ID){cD.CRX_DEFINITION=true;cD.CRX_INTERFACE_ID=D;cD.CRX_INTERFACE_NAME=cC;if((cD.CRX_DEFINITION!==true)||(cD.CRX_INTERFACE_ID!==D)||(cD.CRX_INTERFACE_NAME!==cC)||(cD.CRX_CLASS_ID!==void (0))){x("UNKNOWN ERROR IN DEFINITION OF INTERFACE '"+cC+"'",-1);}cc(cD);co[D]=cD;D=D+1;}aF[cC]=cD.CRX_INTERFACE_ID;}function bL(cC){if(d){return;}if(typeof(cC)==="string"){if(!aF[cC]){return null;}else{return(co[aF[cC]]||null);}}else{if((cC===null)||(typeof(cC)!=="object")||(cC.CRX_CLASS_ID!==void (0))||(cC.CRX_STRUCTURE_ID!==void (0))){return null;}else{if(!cC.CRX_INTERFACE_ID){cC.CRX_DEFINITION=true;cC.CRX_INTERFACE_ID=D;if((cC.CRX_DEFINITION!==true)||(cC.CRX_INTERFACE_ID!==D)){x("UNKNOWN ERROR IN DEFINITION OF INTERFACE '$I"+D+"'",-1);}cc(cC);co[D]=cC;D=D+1;}return co[cC.CRX_INTERFACE_ID];}}}function z(cC){if(d){return;}if(typeof(cC)==="string"){return(aF[cC]||null);}return(cC.CRX_INTERFACE_ID||null);}function aJ(cC){if(cC.CRX_INTERFACE_NAME){return cC.CRX_INTERFACE_NAME;}if(cC.CRX_INTERFACE_ID){return"$I"+cC.CRX_INTERFACE_ID;}return null;}function bz(cD,cC){if(d){return;}aV=true;if(S.hasOwnProperty(cD)||aF.hasOwnProperty(cD)||by.hasOwnProperty(cD)){x("Interface or Class or Structure with name '"+cD+"' already declared",-1);}if(!cC.CRX_STRUCTURE_ID){cC.CRX_DEFINITION=true;cC.CRX_STRUCTURE_ID=Y;cC.CRX_STRUCTURE_NAME=cD;if((cC.CRX_DEFINITION!==true)||(cC.CRX_STRUCTURE_ID!==Y)||(cC.CRX_STRUCTURE_NAME!==cD)||(cC.CRX_CLASS_ID!==void (0))||(cC.CRX_INTERFACE_ID!==void (0))){x("UNKNOWN ERROR IN DEFINITION OF STRUCTRE '"+cD+"'",-1);}cc(cC);ca[Y]=cC;Y=Y+1;}by[cD]=cC.CRX_STRUCTURE_ID;}function aR(cD,cC){if(d){return;}if(typeof(cD)==="string"){if(!by[cD]){return null;}else{return(ca[by[cD]]||null);}}else{if((cD===null)||(typeof(cD)!=="object")||(cD.CRX_CLASS_ID!==void (0))||(cD.CRX_INTERFACE_ID!==void (0))){return null;}else{if(!cD.CRX_STRUCTURE_ID&&!cC){cD.CRX_DEFINITION=true;cD.CRX_STRUCTURE_ID=Y;if((cD.CRX_DEFINITION!==true)||(cD.CRX_STRUCTURE_ID!==Y)){x("UNKNOWN ERROR IN DEFINITION OF INTERFACE '$I"+Y+"'");}cc(cD);ca[Y]=cD;Y=Y+1;}return ca[cD.CRX_STRUCTURE_ID];}}}function M(cC){if(d){return;}if(typeof(cC)==="string"){return(by[cC]||null);}return(cC.CRX_STRUCTURE_ID||null);}function bR(cC){if(cC.CRX_STRUCTURE_NAME){return cC.CRX_STRUCTURE_NAME;}if(cC.CRX_STRUCTURE_ID){return"$S"+cC.CRX_STRUCTURE_ID;}return null;}function t(cN,cM,cL){if(d){return;}var cU=false;var cF=null;var cR=null;var cD=[];var cH=-1;var cQ=null;var cK=null;var cO=ak(cM);var cS=0;aV=true;if(typeof(cN)==="number"){cU=true;cH=Math.abs(cN);if((cO!=="array")&&(cO!=="function")){cK=cM;cF=bg(cM);if(cF===null){cR=aR(cM);}cQ=Array.prototype.slice.call(arguments,2);}else{if((cO==="array")&&(cM.length<1)){return null;}cK=cL;cF=bg(cL);if(cF===null){cR=aR(cL);}cQ=cM;}}else{cK=cN;cF=bg(cN);if(cF===null){cR=aR(cN);}cH=1;cQ=Array.prototype.slice.call(arguments,1);}if((cF===null)&&(cR===null)){x('UNABLE TO RESOLVE CLASS/STRUCTURE "'+cK+'"DURING CALL TO crx_new',-1);}if(cR===null){var cP=[];I.push(ck);ck={};for(cS=0;cS<cH;cS++){cP[cS]={};}cf(cF);if(d){return null;}if(r[cF.CRX_CLASS_ID].remainingAbstractVirtuals.length>0){var cJ="";var cT=false;for(cI in r[cF.CRX_CLASS_ID].remainingAbstractVirtuals.p){if(!r[cF.CRX_CLASS_ID].remainingAbstractVirtuals.p.hasOwnProperty(cI)){continue;}cJ+=(cT?', "':'"')+cI+'()"';cT=true;}x('CAN NOT CREATE INSTANCE OF ABSTRACT CLASS "'+aZ(cF)+'". MISSING IMPLEMENTATIONS FOR FUNCTIONS '+cJ,-1);}cD=bx(bv[cF.CRX_CLASS_ID],cP,cH);if(cD.length===0){x("UNKNOWN ERROR DURING CALL TO crx_new",-1);}for(var cI in C[cF.CRX_CLASS_ID]){if(!C[cF.CRX_CLASS_ID].hasOwnProperty(cI)){continue;}for(cS=0;cS<cH;cS++){an(cP[cS].CRX_OBJECT_SEGMENTS[bX[cF.CRX_CLASS_ID][cI]],cI,a6(cF.CRX_CLASS_ID,"puv",cI));}}if(cD[0].CONSTRUCT){try{if(!cU){cD[0].CONSTRUCT.apply(cD[0],cQ);ck[cD[0].CRX_CLASS_ID]=false;delete (cD[0].CONSTRUCT);}else{if(cO==="function"){for(cS=0;cS<cH;cS++){cD[cS].CONSTRUCT.apply(cD[cS],cQ(cS));ck[cD[0].CRX_CLASS_ID]=false;}}else{if(cO==="array"){var cE=cQ.length;for(cS=0;cS<cH;cS++){if(cS<cE){cD[cS].CONSTRUCT.apply(cD[cS],cQ[cS]);}else{cD[cS].CONSTRUCT.apply(cD[cS],cQ[cE-1]);}ck[cD[0].CRX_CLASS_ID]=false;}}else{for(cS=0;cS<cH;cS++){cD[cS].CONSTRUCT.apply(cD[cS],cQ);ck[cD[0].CRX_CLASS_ID]=false;}}}for(cS=0;cS<cH;cS++){delete (cD[cS].CONSTRUCT);}ck[cD[0].CRX_CLASS_ID]=false;}}catch(cC){x('CONSTRUCTION OF CLASS "'+aZ(cF)+'" THREW AN EXCEPTION: '+cC,cC);}}for(cS=0;cS<cH;cS++){cP[cS].CRX_CLASS_ID=cF.CRX_CLASS_ID;}if(a9){for(var cI in cP[0].CRX_OBJECT_SEGMENTS){if(!cP[0].CRX_OBJECT_SEGMENTS.hasOwnProperty(cI)){continue;}for(cS=0;cS<cH;cS++){o(cP[cS].CRX_OBJECT_SEGMENTS[cI]);}}}ck=I.pop();if(!cU){return cD[0];}else{return cD;}}else{var cG=[];bK.push(aj);aj={};for(cS=0;cS<cH;cS++){cG[cS]={};}bV(cR);if(d){return null;}cD=U(bT[cR.CRX_STRUCTURE_ID],cG,cH);if(cD.length===0){x("UNKNOWN ERROR DURING CALL TO crx_new",-1);}if(bT[cR.CRX_STRUCTURE_ID].PUBLIC&&bT[cR.CRX_STRUCTURE_ID].PUBLIC_CONSTRUCT){try{if(!cU){bT[cR.CRX_STRUCTURE_ID].PUBLIC_CONSTRUCT.apply(cD[0],cQ);aj[cR.CRX_STRUCTURE_ID]=false;delete (cG[0].CRX_SHARED_SEGMENT.CONSTRUCT);}else{if(cO==="function"){for(cS=0;cS<cH;cS++){bT[cR.CRX_STRUCTURE_ID].PUBLIC_CONSTRUCT.apply(cD[cS],cQ(cS));aj[cR.CRX_STRUCTURE_ID]=false;}}else{if(cO==="array"){var cE=cQ.length;for(cS=0;cS<cH;cS++){if(cS<cE){bT[cR.CRX_STRUCTURE_ID].PUBLIC_CONSTRUCT.apply(cD[cS],cQ[cS]);}else{bT[cR.CRX_STRUCTURE_ID].PUBLIC_CONSTRUCT.apply(cD[cS],cQ[cE-1]);}aj[cR.CRX_STRUCTURE_ID]=false;}}else{for(cS=0;cS<cH;cS++){bT[cR.CRX_STRUCTURE_ID].PUBLIC_CONSTRUCT.apply(cD[cS],cQ);aj[cR.CRX_STRUCTURE_ID]=false;}}}for(cS=0;cS<cH;cS++){delete (cG[cS].CRX_SHARED_SEGMENT.CONSTRUCT);}aj[cR.CRX_STRUCTURE_ID]=false;}}catch(cC){x('CONSTRUCTION OF STRUCTURE "'+bR(cR)+'" THREW AN EXCEPTION: '+cC,cC);}}if(a9){if(cG[0].CRX_SHARED_SEGMENT===cG[0].CRX_SHARED_PRIVATE_SEGMENT){for(cS=0;cS<cH;cS++){o(cG[cS].CRX_SHARED_SEGMENT);}}else{for(cS=0;cS<cH;cS++){o(cG[cS].CRX_SHARED_SEGMENT);o(cG[cS].CRX_SHARED_PRIVATE_SEGMENT);}}}aj=bK.pop();if(!cU){return cD[0];}else{return cD;}}}function bx(cJ,cL,cC){var cD=[];var cK=[];var cH=false;var cF=null;var cE=0;var cG=0;if(cJ.EXTENDS!==null){cI=bx(cJ.EXTENDS,cL,cC);for(cE=0;cE<cC;cE++){cD[cE]=a2(cI[cE]);an(cD[cE],"PARENT",cI[cE]["THIS"]);}if(cD[0]===null){return null;}}else{for(cE=0;cE<cC;cE++){cD[cE]={};cL[cE].CRX_OBJECT_SEGMENTS={};cL[cE].CRX_PRIVATE_OBJECT_SEGMENTS={};cL[cE].CRX_IS_ANNULED=false;an(cD[cE],"CRX_CLASS_INFO",bd(cL[cE]));}ax(cD,"CAST",bq);ax(cD,"SR",f);for(cE=0;cE<cC;cE++){cD[cE]=a2(cD[cE]);}}for(cE=0;cE<cC;cE++){cK[cE]=a2(cD[cE]);cL[cE].CRX_PRIVATE_OBJECT_SEGMENTS[cJ.CRX_CLASS_ID]=cK[cE];an(cK[cE],"O",be(cK[cE]));an(cK[cE],"ANNUL",N);}if(cJ.PRIVATE){for(cE=cJ.PRIVATE_VARS.length-1;cE>-1;cE--){aP(cK,cJ.PRIVATE_VARS[cE][0],cJ.PRIVATE_VARS[cE][1]);if(!J&&!aX){bx.o1.get=cJ.PRIVATE_VARS[cE][2];bx.o1.set=cJ.PRIVATE_VARS[cE][3];for(cG=0;cG<cC;cG++){Object.defineProperty(cD[cG],cJ.PRIVATE_VARS[cE][0],bx.o1);}}}for(cE=cJ.PRIVATE_FUNCTIONS.length-1;cE>-1;cE--){ax(cK,cJ.PRIVATE_FUNCTIONS[cE][0],cn(cJ.CRX_CLASS_ID,"pr",cJ.PRIVATE_FUNCTIONS[cE][0],cJ.PRIVATE_FUNCTIONS[cE][1],false));if(!J&&!aX){bx.o3.get=cJ.PRIVATE_FUNCTIONS[cE][2];bx.o3.set=cJ.PRIVATE_FUNCTIONS[cE][3];for(cG=0;cG<cC;cG++){Object.defineProperty(cD[cG],cJ.PRIVATE_FUNCTIONS[cE][0],bx.o3);}}}}if(L[cJ.CRX_CLASS_ID]){if(bI&&((cJ.PRIVATE_CONSTS.length>0)||(cJ.PUBLIC&&(cJ.PUBLIC_CONSTS.length>0)))){for(cE=0;cE<cC;cE++){cF=a2(L[cJ.CRX_CLASS_ID]);for(cG=cJ.PRIVATE_CONSTS.length-1;cG>-1;cG--){ba(cF,cJ.PRIVATE_CONSTS[cG][0],cJ.PRIVATE_CONSTS[cG][1]);}if(cJ.PUBLIC){for(cG=cJ.PUBLIC_CONSTS.length-1;cG>-1;cG--){ba(cF,cJ.PUBLIC_CONSTS[cG][0],cJ.PUBLIC_CONSTS[cG][1]);}}an(cK[cE],"STATIC",cF);}}else{ax(cK,"STATIC",L[cJ.CRX_CLASS_ID]);}}for(cE=0;cE<cC;cE++){an(cD[cE],"THIS",cD[cE]);}if(cJ.PUBLIC||cJ.PROTECTED){var cI=[];for(cE=0;cE<cC;cE++){cI[cE]=(cK[cE]?cK[cE]:cD[cE]);}if(cJ.PUBLIC){for(cE=cJ.PUBLIC_VARS.length-1;cE>-1;cE--){bx.o1.get=cJ.PUBLIC_VARS[cE][2];bx.o1.set=cJ.PUBLIC_VARS[cE][3];bx.o2.value=cJ.PUBLIC_VARS[cE][1];for(cG=0;cG<cC;cG++){Object.defineProperty(cK[cG],cJ.PUBLIC_VARS[cE][0],bx.o2);Object.defineProperty(cD[cG],cJ.PUBLIC_VARS[cE][0],bx.o1);}}for(cE=cJ.PUBLIC_FUNCTIONS.length-1;cE>-1;cE--){ax(cD,cJ.PUBLIC_FUNCTIONS[cE][0],cn(cJ.CRX_CLASS_ID,"pu",cJ.PUBLIC_FUNCTIONS[cE][0],cJ.PUBLIC_FUNCTIONS[cE][1],false));}if(cJ.PUBLIC_CONSTRUCT!==null){cH=true;if(cJ.EXTENDS&&cD[0].PARENT.CONSTRUCT){for(cE=0;cE<cC;cE++){cD[cE]["CONSTRUCT"]=bF(cJ.CRX_CLASS_ID,cI[cE],cD[cE],cJ.PUBLIC_CONSTRUCT);}}else{for(cE=0;cE<cC;cE++){cD[cE]["CONSTRUCT"]=bF(cJ.CRX_CLASS_ID,cI[cE],cD[cE],cJ.PUBLIC_CONSTRUCT);}}}if(P[cJ.CRX_CLASS_ID]){if(bI&&(cJ.PUBLIC_CONSTS.length>0)){for(cE=0;cE<cC;cE++){cF=a2(P[cJ.CRX_CLASS_ID]);for(cG=cJ.PUBLIC_CONSTS.length-1;cG>-1;cG--){cF[cJ.PUBLIC_CONSTS[cG][0]]=cJ.PUBLIC_CONSTS[cG][1];}an(cD[cE],"STATIC",cF);}}else{ax(cD,"STATIC",P[cJ.CRX_CLASS_ID]);}}else{ax(cD,"STATIC",null);}}if(cJ.PROTECTED){for(cE=cJ.PROTECTED_FUNCTIONS.length-1;cE>-1;cE--){ax(cD,cJ.PROTECTED_FUNCTIONS[cE][0],cn(cJ.CRX_CLASS_ID,"pro",cJ.PROTECTED_FUNCTIONS[cE][0],cJ.PROTECTED_FUNCTIONS[cE][1],true));}}for(cE=0;cE<cC;cE++){cL[cE].CRX_PRIVATE_OBJECT_SEGMENTS[cJ.CRX_CLASS_ID]=cI[cE];}}if(!cH){if(cJ.EXTENDS&&cD[0].PARENT.CONSTRUCT){if(cK[0]){for(cE=0;cE<cC;cE++){cD[cE].CONSTRUCT=bF(cJ.CRX_CLASS_ID,cK[cE],cD[cE]);}}else{for(cE=0;cE<cC;cE++){cD[cE].CONSTRUCT=bF(cJ.CRX_CLASS_ID,cD[cE],cD[cE]);}}}}for(cE=0;cE<cC;cE++){cL[cE].CRX_OBJECT_SEGMENTS[cJ.CRX_CLASS_ID]=cD[cE];}ax(cD,"CRX_CLASS_ID",cJ.CRX_CLASS_ID);return cD;}bx.o1={"get":null,"set":null,"enumerable":true};bx.o2={"value":null,"writable":true,"enumerable":true};bx.o3={"get":null,"set":null,"enumerable":false};function bF(cF,cE,cD,cC){return bF.usingFTables(cF,cE,cD,cC);}bF.usingFTables=function(cF,cE,cD,cC){if(aT[cF]&&aT[cF]["pub"]&&aT[cF]["pub"]["CONSTRUCT"]){return aT[cF]["pub"]["CONSTRUCT"];}else{if(!aT[cF]){aT[cF]={};}if(!aT[cF]["pub"]){aT[cF]["pub"]={};}if(cC){aT[cF]["pub"]["CONSTRUCT"]=(function(cH,cG){return function(){if(d){return;}var cI=bC(this);if(ck[cH]){x("SECOND CALL TO CONSTRUCTOR");}ck[cH]=true;if(bv[cH].EXTENDS){if(ck[bv[cH].EXTENDS.CRX_CLASS_ID]){x("UNKNOWN CONSTRUCTION ERROR");}cG.apply(cI.CRX_PRIVATE_OBJECT_SEGMENTS[cH],arguments);if(!ck[bv[cH].EXTENDS.CRX_CLASS_ID]){cI.CRX_OBJECT_SEGMENTS[bv[cH].EXTENDS.CRX_CLASS_ID].CONSTRUCT();}if(!ck[bv[cH].EXTENDS.CRX_CLASS_ID]){x("UNKNOWN CONSTRUCTION ERROR");}ck[bv[cH].EXTENDS.CRX_CLASS_ID]=false;delete (cI.CRX_OBJECT_SEGMENTS[bv[cH].EXTENDS.CRX_CLASS_ID].CONSTRUCT);}else{cG.apply(cI.CRX_PRIVATE_OBJECT_SEGMENTS[cH],arguments);}};})(cF,cC);b9(cC,cF);}else{aT[cF]["pub"]["CONSTRUCT"]=(function(cG){return function(){if(d){return;}var cH=bC(this);if(ck[cG]){x("SECOND CALL TO CONSTRUCTOR");}ck[cG]=true;if(ck[bv[cG].EXTENDS.CRX_CLASS_ID]){x("UNKNOWN CONSTRUCTION ERROR");}cH.CRX_OBJECT_SEGMENTS[bv[cG].EXTENDS.CRX_CLASS_ID].CONSTRUCT();if(!ck[bv[cG].EXTENDS.CRX_CLASS_ID]){x("UNKNOWN CONSTRUCTION ERROR");}ck[bv[cG].EXTENDS.CRX_CLASS_ID]=false;delete (cH.CRX_OBJECT_SEGMENTS[bv[cG].EXTENDS.CRX_CLASS_ID].CONSTRUCT);};})(cF);b9(aT[cF]["pub"]["CONSTRUCT"],cF);}return aT[cF]["pub"]["CONSTRUCT"];}};function cn(cF,cE,cD,cC,cG){if(aT[cF]&&aT[cF][cE]&&aT[cF][cE][cD]){return aT[cF][cE][cD];}else{if(!aT[cF]){aT[cF]={};}if(!aT[cF][cE]){aT[cF][cE]={};}if(cG){aT[cF][cE][cD]=(function(cI,cH){return function(){if(d){return;}return cH.apply(k(this,cI,cD,((J||aX)?null:aT[cI][cE][cD].caller)),arguments);};})(cF,cC);}else{aT[cF][cE][cD]=(function(cI,cH){return function(){if(d){return;}return cH.apply(bC(this).CRX_PRIVATE_OBJECT_SEGMENTS[cI],arguments);};})(cF,cC);}}return aT[cF][cE][cD];}function k(cI,cF,cD,cH){var cE=bC(cI);var cC=bO(cI.THIS,cE);if(cC!==null){var cG=null;if(cE.CRX_PRIVATE_OBJECT_SEGMENTS[cC]===cI){cG=cI;}else{if(!J&&!aX&&(cE.CRX_OBJECT_SEGMENTS[cC]===cI)&&bk(cH,cC,true)){cG=cE.CRX_PRIVATE_OBJECT_SEGMENTS[cC];}}if(cG!==null){if(bv[cF].DEPTH<=bv[cC].DEPTH){return cE.CRX_PRIVATE_OBJECT_SEGMENTS[cF];}}}x("ILLEGAL ACCESS TO PROTECTED METHOD '"+aZ(ac[cF])+"::"+cD+"()'",-1);}function a6(cE,cD,cC){if(aT[cE]&&aT[cE][cD]&&aT[cE][cD][cC]){return aT[cE][cD][cC];}else{if(!aT[cE]){aT[cE]={};}if(!aT[cE][cD]){aT[cE][cD]={};}aT[cE][cD][cC]=(function(cG,cF){return function(){if(d){return;}return C[cG][cF].apply(bN(this,cG,cF,((J||aX)?null:aT[cG][cD][cF].caller)),arguments);};})(cE,cC);}return aT[cE][cD][cC];}function bN(cJ,cH,cF,cI){var cG=bC(cJ);var cE=bO(cJ.THIS,cG);var cD=aM[cE][cF];if(O[cD][cF]===Z){var cC=true;if(!((cD===cE)&&((cG.CRX_PRIVATE_OBJECT_SEGMENTS[cE]===cJ)||(!J&&!aX&&bk(cI,cE,true))))){x("ILLEGAL ACCESS TO PRIVATE VIRTUAL METHOD '"+aZ(ac[cD])+"::"+cF+"()'",-1);}}else{if(O[cD][cF]===aH){var cC=true;if((cG.CRX_PRIVATE_OBJECT_SEGMENTS[cE]===cJ)||(!J&&!aX&&bk(cI,cE,true))){if(bv[cD].DEPTH<=bv[cE].DEPTH){cC=false;}}if(cC){x("ILLEGAL ACCESS TO PROTECTED VIRTUAL METHOD '"+aZ(ac[cD])+"::"+cF+"()'",-1);}}}return cG.CRX_PRIVATE_OBJECT_SEGMENTS[aM[cH][cF]];}function cx(cD,cC){function cE(){return b(this,cD,cC,cE.caller);}return[cE,cx.emptyFunction];}cx.emptyFunction=function(){};function b(cH,cF,cD,cG){var cE=bC(cH);if(cH===cE.CRX_OBJECT_SEGMENTS[cF]){if(bk(cG,cF,true)){return cE.CRX_PRIVATE_OBJECT_SEGMENTS[cF][cD];}}else{if((cH!==cE.CRX_PRIVATE_OBJECT_SEGMENTS[cF])&&cE.CRX_OBJECT_SEGMENTS[cF].PARENT&&cD in cE.CRX_OBJECT_SEGMENTS[cF].PARENT){var cC=cE.CRX_OBJECT_SEGMENTS[cF].PARENT;while(cC){if(aL[cC.CRX_CLASS_ID]){if(O[cC.CRX_CLASS_ID][cD]!==Z){if(aL[cC.CRX_CLASS_ID].FUNCTIONS[cD]||aL[cC.CRX_CLASS_ID].VARS[cD]){return cC[cD];}}else{if(cC.PARENT&&!(cD in cC.PARENT)){break;}}cC=cC.PARENT;}else{break;}}return void (0);}else{return void (0);}}}function ag(cD,cC){if(aX){return function(){if(d){return;}return cC.apply(ad[cD],arguments);};}var cE=[null,null];var cF=function(){if(d){return;}return cC.apply(null,arguments);};return cF;}function ai(cE,cC){if(J||aX){return;}function cF(){return b(this,cE,cC,cF.caller);}function cD(cG){aS(this,cE,cC,cD.caller,cG);}return[cF,cD];}function aS(cI,cG,cE,cH,cD){var cF=bC(cI);if(cI===cF.CRX_OBJECT_SEGMENTS[cG]){if(bk(cH,cG,true)){cF.CRX_PRIVATE_OBJECT_SEGMENTS[cG][cE]=cD;}}else{if(cI!==cF.CRX_PRIVATE_OBJECT_SEGMENTS[cG]){var cC=cF.CRX_OBJECT_SEGMENTS[cG].PARENT;while(cC){if(aL[cC.CRX_CLASS_ID]){if(O[cC.CRX_CLASS_ID][cE]!==Z){if(aL[cC.CRX_CLASS_ID].FUNCTIONS[cE]||aL[cC.CRX_CLASS_ID].VARS[cE]){cC[cE]=cD;}}else{if(cC.PARENT&&!(cE in cC.PARENT)){break;}}cC=cC.PARENT;}else{break;}}}}}function bC(cE,cC){var cD=null;cE.CRX_CLASS_INFO();cD=cs;cs=null;if(cD===null){x("SECURITY ERROR, ACCESS VIOLATION");}else{if(cD.CRX_IS_ANNULED&&!cC){if(cE.CRX_CLASS_ID){x('INSTANCE OF CLASS "'+aZ(ac[cE.CRX_CLASS_ID])+'" IS ANNUL',-1);}x("UNKNOWN ERROR");}}return cD;}function aW(cC){return((cC.CRX_CLASS_ID&&(cC===bC(cC).CRX_OBJECT_SEGMENTS[cC.CRX_CLASS_ID]))?cC.CRX_CLASS_ID:null);}function bO(cD,cC){return((cD.CRX_CLASS_ID&&cC&&(cD===cC.CRX_OBJECT_SEGMENTS[cD.CRX_CLASS_ID]))?cD.CRX_CLASS_ID:null);}function bA(cC){return(cC.CRX_CLASS_ID?cC.CRX_CLASS_ID:null);}function j(cD){var cC=null;cD.CRX_STATIC_INFO();cC=cs;cs=null;if(cC===null){x("SECURITY ERROR, ACCESS VIOLATION");}return cC.CRX_CLASS_ID;}function cf(cE){aV=true;ch(cE);if(!C[cE.CRX_CLASS_ID]){var cG=bv[cE.CRX_CLASS_ID];while(cG){br(ac[cG.CRX_CLASS_ID]);F(cG);cG=cG.EXTENDS;}var cC=[];var cF=[];ae(bv[cE.CRX_CLASS_ID],cC,cF);for(var cD=0;cD<cF.length;cD++){bU("WARNING: "+cF[cD],1);}for(var cD=0;cD<cC.length;cD++){bU("FATAL ERROR: "+cC[cD],0);}if(cC.length>0){x("DEFINITION ERROR");}}}function ch(cF){if(bZ[cF.CRX_CLASS_ID]){return cF;}var cC=[];var cG=[];var cD={};cD["extensionChain"]={};cD["virtuals"]={};cD["nonVirtuals"]={};cD["virtualFinalFunctions"]={};cD["remainingAbstractVirtuals"]={p:{},length:0};aQ(cF);l(ac[cF.CRX_CLASS_ID],cC,cG);aA(ac[cF.CRX_CLASS_ID],cC,cG,cD);for(var cE=0;cE<cG.length;cE++){bU("WARNING: "+cG[cE],1);}for(var cE=0;cE<cC.length;cE++){bU("FATAL ERROR: "+cC[cE],0);}bZ[cF.CRX_CLASS_ID]=true;if(cC.length>0){x("DEFINITION ERROR");}}function aQ(cD,cK){if((!cK&&(aC[cD.CRX_CLASS_ID]!==void (0)))||(cK&&(at[cD.CRX_STRUCTURE_ID]!==void (0)))){return;}for(var cJ in cD){if(cJ==="VERBOSE"){var cI={};var cE=true;for(var cC in cD){if(!cD.hasOwnProperty(cC)){continue;}var cF=cC.split(/\s+/);var cH=cI;if(cE){cE=false;continue;}if(cF.length===1){cF[0]=cF[0].toUpperCase();}else{for(var cG=0;cG<cF.length-1;cG++){cF[cG]=cF[cG].toUpperCase();if(cF[cG]==="FUNCTION"){cF[cG]="FUNCTIONS";}else{if(cF[cG]==="VAR"){cF[cG]="VARS";}else{if(cF[cG]==="CONST"){cF[cG]="CONSTS";}}}if(!cH[cF[cG]]){cH[cF[cG]]={};}cH=cH[cF[cG]];}}cH[cF[cF.length-1]]=cD[cC];}cc(cI);if(!cK){aC[cD.CRX_CLASS_ID]=cD;ac[cD.CRX_CLASS_ID]=cI;}else{at[cD.CRX_STRUCTURE_ID]=cD;ca[cD.CRX_STRUCTURE_ID]=cI;}}else{if(!cK){ac[cD.CRX_CLASS_ID]=cD;aC[cD.CRX_CLASS_ID]=null;}else{ca[cD.CRX_STRUCTURE_ID]=cD;at[cD.CRX_STRUCTURE_ID]=null;}}break;}}function aA(cD,cG,cE,cC){if(r.hasOwnProperty(cD.CRX_CLASS_ID)){ci(cC.virtuals,r[cD.CRX_CLASS_ID].virtuals);ci(cC.nonVirtuals,r[cD.CRX_CLASS_ID].nonVirtuals);ci(cC.virtualFinalFunctions,r[cD.CRX_CLASS_ID].virtualFinalFunctions);ci(cC.remainingAbstractVirtuals.p,r[cD.CRX_CLASS_ID].remainingAbstractVirtuals.p);cC.remainingAbstractVirtuals.length=r[cD.CRX_CLASS_ID].remainingAbstractVirtuals.length;return;}if(cD.hasOwnProperty("EXTENDS")){var cH=bg(cD.EXTENDS);if(cH===null){x('MISSING DEFINITION FOR THE CLASS THAT IS EXTENED BY CLASS "'+aZ(cD)+'"');}if(cC["extensionChain"].hasOwnProperty(cH.CRX_CLASS_ID)||(cH.CRX_CLASS_ID===cD.CRX_CLASS_ID)){x('CIRCULAR EXTENSION DETECTED ON CLASS "'+aZ(cD)+'"');}cC["extensionChain"][cH.CRX_CLASS_ID]=true;aQ(cH);l(ac[cH.CRX_CLASS_ID],cG,cE);aA(ac[cH.CRX_CLASS_ID],cG,cE,cC);}bn[cD.CRX_CLASS_ID]={};bn[cD.CRX_CLASS_ID][cD.CRX_CLASS_ID]=true;if(cD.hasOwnProperty("FRIENDS")){if(ak(cD["FRIENDS"])!=="array"){cG.push("'FRIENDS' DEFINITION FOR CLASS '"+aZ(cD)+"' IS NOT AN ARRAY");}else{for(var cF=0;cF<cD["FRIENDS"].length;cF++){var cH=bg(cD["FRIENDS"][cF]);if(cH===null){cG.push('MISSING DEFINITION FOR THE CLASS "??'+cD["FRIENDS"][cF]+'??" THAT IS FRIENDED BY CLASS "'+aZ(cD)+'"');}else{bn[cD.CRX_CLASS_ID][cH.CRX_CLASS_ID]=true;}}}}cu(ac[cD.CRX_CLASS_ID],cG,cE,cC.virtuals,cC.nonVirtuals,cC.virtualFinalFunctions,cC.remainingAbstractVirtuals);r[cD.CRX_CLASS_ID]={};r[cD.CRX_CLASS_ID]["virtuals"]={};r[cD.CRX_CLASS_ID]["nonVirtuals"]={};r[cD.CRX_CLASS_ID]["virtualFinalFunctions"]={};r[cD.CRX_CLASS_ID]["remainingAbstractVirtuals"]={p:{},length:0};ci(r[cD.CRX_CLASS_ID].virtuals,cC.virtuals);ci(r[cD.CRX_CLASS_ID].nonVirtuals,cC.nonVirtuals);ci(r[cD.CRX_CLASS_ID].virtualFinalFunctions,cC.virtualFinalFunctions);ci(r[cD.CRX_CLASS_ID].remainingAbstractVirtuals.p,cC.remainingAbstractVirtuals.p);r[cD.CRX_CLASS_ID].remainingAbstractVirtuals.length=cC.remainingAbstractVirtuals.length;}function l(cD,cH,cF){if(cD.hasOwnProperty("IMPLEMENTS")){if(ak(cD["IMPLEMENTS"])!=="array"){cH.push("'IMPLEMENTS' DEFINITION FOR CLASS '"+aZ(cD)+"' IS NOT AN ARRAY");}else{var cC={};var cE={"INHERITS":[],"CRX_INTERFACE_ID":-1};var cI=cD;for(var cG=0;cG<cD["IMPLEMENTS"].length;cG++){cE["INHERITS"].push(cD["IMPLEMENTS"][cG]);}ap(cE,cH,cF);a0[cD.CRX_CLASS_ID]=bS[-1].fullTrace;bp[cD.CRX_CLASS_ID]=bS[-1].trace;delete bS[-1];}}}function ae(cC,cG,cD){if(bc[cC.CRX_CLASS_ID]){return;}var cH=cC.EXTENDS;if(cH){ae(cH,cG,cD);}for(var cE in bp[cC.CRX_CLASS_ID]){if(!bp[cC.CRX_CLASS_ID].hasOwnProperty(cE)){continue;}for(var cF in bS[cE].functions){if(!bS[cE].functions.hasOwnProperty(cF)){continue;}if(!aM[cC.CRX_CLASS_ID][cF]){cG.push("MISSING FUNCTION IMPLEMENTATION IN CLASS '"+aZ(ac[cC.CRX_CLASS_ID])+"' FOR '"+aJ(co[bS[cE].functions[cF]])+"::"+cF+"()'");}else{if(aM[cC.CRX_CLASS_ID][cF]===cC.CRX_CLASS_ID){if(O[cC.CRX_CLASS_ID][cF]!==b5){cG.push("FUNCTION '"+aZ(ac[cC.CRX_CLASS_ID])+"::"+cF+"()', WHICH IS REQUIRED BY INTERFACE '"+aJ(co[bS[cE].functions[cF]])+"', MUST BE PUBLIC");}}else{if(O[aM[cC.CRX_CLASS_ID][cF]][cF]!==b5){cG.push("MISSING FUNCTION IMPLEMENTATION IN CLASS '"+aZ(ac[cC.CRX_CLASS_ID])+"' FOR '"+aJ(co[bS[cE].functions[cF]])+"::"+cF+"()'. FUNCTION WAS FOUND IN THE EXTENSION CHAIN, IN THE CLASS '"+aZ(ac[aM[cC.CRX_CLASS_ID][cF]])+"', BUT IS NOT PUBLIC.");}else{cD.push("FUNCTION IMPLEMENTATION FOR '"+aJ(co[bS[cE].functions[cF]])+"::"+cF+"()' IN CLASS '"+aZ(ac[cC.CRX_CLASS_ID])+"' WAS FOUND IN EXTENSION CHAIN INSTEAD");}}}}}while(cH){for(var cE in bp[cH.CRX_CLASS_ID]){if(!bp[cH.CRX_CLASS_ID].hasOwnProperty(cE)){continue;}for(var cF in bS[cE].functions){if(!bS[cE].functions.hasOwnProperty(cF)){continue;}if(!aM[cC.CRX_CLASS_ID][cF]){x("UNKOWN ERROR: SNH01");}else{if(aM[cC.CRX_CLASS_ID][cF]===cC.CRX_CLASS_ID){if(O[cC.CRX_CLASS_ID][cF]!==b5){cG.push("FUNCTION '"+aZ(ac[cC.CRX_CLASS_ID])+"::"+cF+"()' IS REQUIRED BY INTERFACES, HENCE MUST REMAIN PUBLIC.");}}else{if(O[aM[cC.CRX_CLASS_ID][cF]][cF]!==b5){x("UNKOWN ERROR: SNH02");}}}}}cH=cH.EXTENDS;}bc[cC.CRX_CLASS_ID]=true;}function cu(cF,cJ,cE,cK,cD,cC,cG){var cL=aZ(cF);var cI={};for(var cH in cF){if(!cF.hasOwnProperty(cH)){continue;}if((cH==="IMPLEMENTS")||(cH==="EXTENDS")||(cH==="CRX_DEFINITION")||(cH==="CRX_CLASS_ID")||(cH==="CRX_CLASS_NAME")||(cH==="FRIENDS")){}else{if(cH==="CRXOOP_DIRECTIVES"){if(ak(cF["CRXOOP_DIRECTIVES"])!=="array"){cJ.push("'CRXOOP_DIRECTIVES' DEFINITION FOR CLASS '"+cL+"' IS NOT AN ARRAY");}}else{if((cH==="PUBLIC")||(cH==="PRIVATE")||(cH==="PROTECTED")){b1(cL,cJ,cH,cF[cH],cK,cD,cC,cG,cI);}else{cJ.push('UNRECOGINZED TOKEN "'+cH+'" IN CLASS "'+cL+'"');}}}}if(cJ.length===0){b4(cF);}}function b1(cK,cJ,cD,cH,cL,cF,cE,cG,cN){if(cD==="PRIVATE"){for(var cI in cH){if(!cH.hasOwnProperty(cI)){continue;}if(cI==="CONSTS"){bm(cK,cJ,"PRIVATE CONSTS",cH["CONSTS"],cL,cN);}else{if(cI==="VARS"){aU(cK,cJ,"PRIVATE VARS",cH["VARS"],cL,cN);}else{if(cI==="FUNCTIONS"){b6(cK,cJ,"PRIVATE FUNCTIONS",cH["FUNCTIONS"],cL,cF,cN);}else{if(cI==="STATIC"){A(cK,cJ,"PRIVATE STATIC",cH["STATIC"],cL,cF,cN);}else{if(cI==="VIRTUAL"){for(var cC in cH["VIRTUAL"]){if(!cH["VIRTUAL"].hasOwnProperty(cC)){continue;}if(cC==="FUNCTIONS"){aN(cK,cJ,"PRIVATE VIRTUAL FUNCTIONS",cH["VIRTUAL"]["FUNCTIONS"],cL,cF,cE,cG,cN);}else{if(cC==="FINAL"){for(var cM in cH["VIRTUAL"]["FINAL"]){if(!cH["VIRTUAL"]["FINAL"].hasOwnProperty(cM)){continue;}if(cM==="FUNCTIONS"){aN(cK,cJ,"PRIVATE VIRTUAL FINAL FUNCTIONS",cH["VIRTUAL"]["FINAL"]["FUNCTIONS"],cL,cF,cE,cG,cN);}}}else{cJ.push('"PRIVATE VIRTUAL '+cC+'" IS NOT ALLOWED. FOUND IN CLASS "'+cK+'"');}}}}else{cJ.push('"PRIVATE '+cI+'" IS NOT ALLOWED. FOUND IN CLASS "'+cK+'"');}}}}}}}else{if(cD==="PUBLIC"){for(var cI in cH){if(!cH.hasOwnProperty(cI)){continue;}if(cI==="CONSTS"){bm(cK,cJ,"PUBLIC CONSTS",cH["CONSTS"],cL,cN);}else{if(cI==="VARS"){aU(cK,cJ,"PUBLIC VARS",cH["VARS"],cL,cN);}else{if(cI==="FUNCTIONS"){b6(cK,cJ,"PUBLIC FUNCTIONS",cH["FUNCTIONS"],cL,cF,cN);}else{if(cI==="STATIC"){A(cK,cJ,"PUBLIC STATIC",cH["STATIC"],cL,cF,cN);}else{if(cI==="CONSTRUCT"){((cH[cI]===1)||a4(cJ,cK,"PUBLIC",cI,cH[cI],false));}else{if(cI==="VIRTUAL"){for(var cC in cH["VIRTUAL"]){if(!cH["VIRTUAL"].hasOwnProperty(cC)){continue;}if(cC==="FUNCTIONS"){aN(cK,cJ,"PUBLIC VIRTUAL FUNCTIONS",cH["VIRTUAL"]["FUNCTIONS"],cL,cF,cE,cG,cN);}else{if(cC==="FINAL"){for(var cM in cH["VIRTUAL"]["FINAL"]){if(!cH["VIRTUAL"]["FINAL"].hasOwnProperty(cM)){continue;}if(cM==="FUNCTIONS"){aN(cK,cJ,"PUBLIC VIRTUAL FINAL FUNCTIONS",cH["VIRTUAL"]["FINAL"]["FUNCTIONS"],cL,cF,cE,cG,cN);}}}else{cJ.push('"PUBLIC VIRTUAL '+cC+'" IS NOT ALLOWED. FOUND IN CLASS "'+cK+'"');}}}}else{cJ.push('"PUBLIC '+cI+'" IS NOT ALLOWED. FOUND IN CLASS "'+cK+'"');}}}}}}}}else{if(cD==="PROTECTED"){for(var cI in cH){if(!cH.hasOwnProperty(cI)){continue;}if(cI==="FUNCTIONS"){b6(cK,cJ,"PROTECTED FUNCTIONS",cH["FUNCTIONS"],cL,cF,cN);}else{if(cI==="VIRTUAL"){for(var cC in cH["VIRTUAL"]){if(!cH["VIRTUAL"].hasOwnProperty(cC)){continue;}if(cC==="FUNCTIONS"){aN(cK,cJ,"PROTECTED VIRTUAL FUNCTIONS",cH["VIRTUAL"]["FUNCTIONS"],cL,cF,cE,cG,cN);}else{if(cC==="FINAL"){for(var cM in cH["VIRTUAL"]["FINAL"]){if(!cH["VIRTUAL"]["FINAL"].hasOwnProperty(cM)){continue;}if(cM==="FUNCTIONS"){aN(cK,cJ,"PROTECTED VIRTUAL FINAL FUNCTIONS",cH["VIRTUAL"]["FINAL"]["FUNCTIONS"],cL,cF,cE,cG,cN);}}}else{cJ.push('"PROTECTED VIRTUAL '+cC+'" IS NOT ALLOWED. FOUND IN CLASS "'+cK+'"');}}}}else{cJ.push('"PROTECTED '+cI+'" IS NOT ALLOWED. FOUND IN CLASS "'+cK+'"');}}}}}}}function bm(cD,cI,cC,cG,cE,cF){if(!av&&(cC.indexOf("PRIVATE")>-1)){cI.push(cD+"::"+"CONSTS =>"+'"'+cC+" CAN NOT BE SUPPORTED ON THIS BROWSER");}else{for(var cH in cG){if(!cG.hasOwnProperty(cH)||bh(cI,cD,cC,cH)){continue;}cm(cI,cD,cH,cF);if(cE.hasOwnProperty(cH)){cI.push(cD+"::"+cH+"=>"+"MEMBER ALREADY DECLARED AS VIRTUAL IN BASE CLASSES");}}}}function aU(cD,cI,cC,cG,cE,cF){if(!av&&(((cC.indexOf("PUBLIC")>-1)&&(cC.indexOf("STATIC")<0))||((cC.indexOf("PRIVATE")>-1)&&(cC.indexOf("STATIC")>-1)))){cI.push(cD+"::"+"VARS =>"+'"'+cC+" CAN NOT BE SUPPORTED ON THIS BROWSER");}else{for(var cH in cG){if(!cG.hasOwnProperty(cH)||bh(cI,cD,cC,cH)){continue;}cm(cI,cD,cH,cF);if(cE.hasOwnProperty(cH)){cI.push(cD+"::"+cH+"=>"+"MEMBER ALREADY DECLARED AS VIRTUAL IN BASE CLASSES");}}}}function b6(cJ,cI,cC,cE,cK,cD,cL){var cG=(cC.indexOf("STATIC")>-1);var cH=(cC.indexOf("PROTECTED")>-1);for(var cF in cE){if(!cE.hasOwnProperty(cF)||bh(cI,cJ,cC,cF)||a4(cI,cJ,cC,cF,cE[cF],false)){continue;}if(!cG){if(cK.hasOwnProperty(cF)){cI.push(cJ+"::"+cF+"=>"+"MEMBER MUST BE DECLARED VIRTUAL. SEE BASE CLASSES.");}cD[cF]=true;}cm(cI,cJ,cF,cL);}}function aN(cJ,cI,cC,cG,cK,cE,cD,cF,cM){var cL=(cC.indexOf("FINAL")>-1);for(var cH in cG){if(!cG.hasOwnProperty(cH)||bh(cI,cJ,cC,cH)||a4(cI,cJ,cC,cH,cG[cH],true)){continue;}if(cE.hasOwnProperty(cH)){cI.push(cJ+"::"+cH+"=>"+"MEMBER MUST BE DECLARED AS NON VIRTUAL. SEE BASE CLASSES");}cK[cH]=true;cm(cI,cJ,cH,cM);if(cD.hasOwnProperty(cH)){cI.push(cJ+"::"+cH+"=>"+'CAN NOT OVERRIDE VIRTUAL MEMBER. MEMBER ALREADY DECLARED FINAL IN BASE CLASS "'+cD[cH]+'"');}if(cL){if(cG[cH]===0){cI.push(cJ+"::"+cH+"=>"+"AN ABSTRACT VIRTUAL FUNCTION, CAN NOT BE DECLARED FINAL");}else{if(cF.p[cH]){delete cF.p[cH];cF.length--;}cD[cH]=cJ;}}else{if(cG[cH]===0){if(!cF.p[cH]){cF.p[cH]=true;cF.length++;}}else{if(cF.p[cH]){delete cF.p[cH];cF.length--;}}}}}function A(cE,cJ,cD,cH,cF,cC,cG){for(var cI in cH){if(!cH.hasOwnProperty(cI)){continue;}if((cI!=="VARS")&&(cI!=="FUNCTIONS")){cJ.push(cE+"::"+cI+"=>"+'"'+cD+" "+cI+'" IS NOT ALLOWED');}else{if(cI==="VARS"){aU(cE,cJ,cD+" VARS",cH["VARS"],cF,cG);}else{if(cI==="FUNCTIONS"){if(J&&!aX){cJ.push(cE+"::"+cI+"=>"+'"'+cD+" "+'FUNCTIONS" IS NOT ALLOWED; RUNNING IN STRICT JS MODE OR STATIC FUNCTIONS CAN NOT '+"BE SUPPORTED IN THIS BROWSER");}else{b6(cE,cJ,cD+" FUNCTIONS",cH["FUNCTIONS"],cF,cC,cG);}}}}}}function ap(cH,cG,cC){if(bS.hasOwnProperty(cH.CRX_INTERFACE_ID)){return;}var cI={};bS[cH.CRX_INTERFACE_ID]={"functions":{},"trace":{},"fullTrace":{}};if(cH.hasOwnProperty("INHERITS")){if(ak(cH["INHERITS"])!=="array"){cG.push("'INHERITS' DEFINITION FOR INTERFACE '"+aJ(cH)+"' IS NOT AN ARRAY");}else{for(var cE=0;cE<cH["INHERITS"].length;cE++){var cJ=bL(cH["INHERITS"][cE]);if(cJ===null){x('MISSING DEFINITION FOR THE INTERFACE THAT IS INHERITED BY INTERFACE "'+aJ(cH)+'"');}ap(cJ,cG,cC);if(bS[cJ.CRX_INTERFACE_ID]["fullTrace"]&&bS[cJ.CRX_INTERFACE_ID]["fullTrace"].hasOwnProperty(cH.CRX_INTERFACE_ID)){x("CIRCULAR INHERITANCE IN INTERFACE '"+aJ(cH)+"' WITH INTERFACE '"+aJ(cJ));}bS[cH.CRX_INTERFACE_ID]["trace"][cJ.CRX_INTERFACE_ID]=cJ;bS[cH.CRX_INTERFACE_ID]["fullTrace"][cJ.CRX_INTERFACE_ID]=cJ;for(var cD in bS[cJ.CRX_INTERFACE_ID].fullTrace){if(!bS[cJ.CRX_INTERFACE_ID].fullTrace.hasOwnProperty(cD)){continue;}bS[cH.CRX_INTERFACE_ID].fullTrace[cD]=bS[cJ.CRX_INTERFACE_ID].fullTrace[cD];}}}}for(var cD in bS[cH.CRX_INTERFACE_ID].trace){if(!bS[cH.CRX_INTERFACE_ID].trace.hasOwnProperty(cD)){continue;}for(var cF in bS[cD].functions){if(!bS[cD].functions.hasOwnProperty(cF)){continue;}if(bS[cH.CRX_INTERFACE_ID].functions.hasOwnProperty(cF)){cG.push("INTERFACE FUNCTION '"+aJ(co[bS[cD].functions[cF]])+"::"+cF+"' ALSO DEFINED IN INTERFACE '"+aJ(co[bS[cH.CRX_INTERFACE_ID].functions[cF]])+"'");}else{bS[cH.CRX_INTERFACE_ID].functions[cF]=bS[cD].functions[cF];}}}for(var cD in cH){if(!cH.hasOwnProperty(cD)||(cD==="CRX_INTERFACE_ID")||(cD==="CRX_INTERFACE_NAME")||(cD==="INHERITS")||(cD==="CRX_DEFINITION")){continue;}if(bh(cD)){cG.push("ILEGAL USE OF KEYWORD '"+cD+"' IN INTERFACE '"+aJ(cH)+"'");continue;}else{if(bS[cH.CRX_INTERFACE_ID].functions.hasOwnProperty(cD)){cG.push("INTERFACE FUNCTION '"+aJ(co[cH.CRX_INTERFACE_ID])+"::"+cD+"' ALSO DEFINED IN INTERFACE '"+aJ(co[bS[cH.CRX_INTERFACE_ID].functions[cD]])+"'");}bS[cH.CRX_INTERFACE_ID].functions[cD]=cH.CRX_INTERFACE_ID;}}}function bh(cE,cC,cD,cG,cF){if(bh.illegalNames.hasOwnProperty(cG)){cE.push("ILEGAL USE OF KEYWORD '"+cG+"' IN "+(!cF?"CLASS":"STRUCTURE")+" '"+cC+"' IN SECTION "+"["+cD+"]");return true;}return false;}bh.illegalNames={"PUBLIC":true,"PRIVATE":true,"PROTECTED":true,"CONSTRUCT":true,"VIRTUAL":true,"IMPLEMENTS":true,"SHARED":true,"PARENT":true,"STATIC":true,"CRX_CLASS_INFO":true,"CAST":true,"SELF":true,"VARS":true,"FUNCTIONS":true,"VAR":true,"FUNCTION":true,"SR":true,"CRX_CLASS_ID":true,"O":true,"CRX_DEFINITION":true,"FINAL":true,"CONST":true,"CONSTS":true,"CRX_INTERFACE_ID":true,"CRX_STRUCTURE_ID":true,"CRX_STRUCTURE_ID_PV":true,"CRX_CLASS_NAME":true,"CRX_STRUCTURE_NAME":true,"CRX_STRUCTURE_INFO":true,"HASOWN":true,"FRIENDS":true,"CRX_FUNCTION_ID":true,"CRX_STATIC_INFO":true};function a4(cG,cC,cE,cH,cF,cD){if((typeof(cF)!=="function")&&(!cD||(cF!==0))){cG.push(cC+"::"+cH+"=>"+'"'+cE+'" MUST BE A FUNCTION');return true;}return false;}function cm(cF,cC,cE,cD){if(cD.hasOwnProperty(cE)){cF.push('DUPLICATE MEMBER "'+cE+'" FOUND IN CLASS "'+cC+'"');}else{cD[cE]=true;}}function b4(cC){if(bv[cC.CRX_CLASS_ID]){return;}var cH={EXTENDS:null,IMPLEMENTES:null,PUBLIC:null,PRIVATE:null,PROTECTED:null,DIRECTIVE_NO_PUBLIC_VARS_DELEGATION:false,DEPTH:1};var cE=null;var cF={};var cG={VARS:{},FUNCTIONS:{}};cH.CRX_CLASS_ID=cC.CRX_CLASS_ID;if(cC.hasOwnProperty("CRXOOP_DIRECTIVES")){for(var cD=0;cD<cC["CRXOOP_DIRECTIVES"].length;cD++){if(cC["CRXOOP_DIRECTIVES"][cD]===ah){cH.DIRECTIVE_NO_PUBLIC_VARS_DELEGATION=true;}}}if(cC.hasOwnProperty("EXTENDS")){cH.EXTENDS=bv[al(cC["EXTENDS"])];cH.DEPTH=cH.EXTENDS.DEPTH+1;}if(cC.hasOwnProperty("IMPLEMENTS")){cH.IMPLEMENTS=cC["IMPLEMENTS"];}if(cC.hasOwnProperty("PUBLIC")){cH.PUBLIC_CONSTS=[];cH.PUBLIC_VARS=[];cH.PUBLIC_FUNCTIONS=[];cH.PUBLIC_VIRTUAL=null;cH.PUBLIC_VIRTUAL_FUNCTIONS=[];cH.PUBLIC_CONSTRUCT=null;if(bI&&cC["PUBLIC"].hasOwnProperty("CONSTS")){for(cE in cC["PUBLIC"]["CONSTS"]){if(cC["PUBLIC"]["CONSTS"].hasOwnProperty(cE)){cH.PUBLIC_CONSTS.push([cE,cC["PUBLIC"]["CONSTS"][cE]]);}}}if(cC["PUBLIC"].hasOwnProperty("VARS")){for(cE in cC["PUBLIC"]["VARS"]){if(cC["PUBLIC"]["VARS"].hasOwnProperty(cE)){if(cH.DIRECTIVE_NO_PUBLIC_VARS_DELEGATION){cH.PUBLIC_VARS.push([cE,bs(cC["PUBLIC"]["VARS"][cE])]);}else{cH.PUBLIC_VARS.push([cE,bs(cC["PUBLIC"]["VARS"][cE]),(function(cK,cJ){return function(){return bC(this).CRX_PRIVATE_OBJECT_SEGMENTS[cK][cJ];};})(cC.CRX_CLASS_ID,cE),(function(cK,cJ){return function(cL){bC(this).CRX_PRIVATE_OBJECT_SEGMENTS[cK][cJ]=cL;};})(cC.CRX_CLASS_ID,cE)]);}cF[cE]=b5;cG.VARS[cE]=1;}}}if(cC["PUBLIC"].hasOwnProperty("FUNCTIONS")){for(cE in cC["PUBLIC"]["FUNCTIONS"]){if(cC["PUBLIC"]["FUNCTIONS"].hasOwnProperty(cE)){cH.PUBLIC_FUNCTIONS.push([cE,cC["PUBLIC"]["FUNCTIONS"][cE]]);cF[cE]=b5;cG.FUNCTIONS[cE]=1;b9(cC["PUBLIC"]["FUNCTIONS"][cE],cC.CRX_CLASS_ID);}}}if(cC["PUBLIC"].hasOwnProperty("VIRTUAL")){if(cC["PUBLIC"]["VIRTUAL"].hasOwnProperty("FUNCTIONS")){for(cE in cC["PUBLIC"]["VIRTUAL"]["FUNCTIONS"]){if(cC["PUBLIC"]["VIRTUAL"]["FUNCTIONS"].hasOwnProperty(cE)){cH.PUBLIC_VIRTUAL_FUNCTIONS.push([cE,cC["PUBLIC"]["VIRTUAL"]["FUNCTIONS"][cE]]);if((cC["PUBLIC"]["VIRTUAL"]["FUNCTIONS"][cE]!==0)){cG.FUNCTIONS[cE]=2;b9(cC["PUBLIC"]["VIRTUAL"]["FUNCTIONS"][cE],cC.CRX_CLASS_ID);}else{cG.FUNCTIONS[cE]=3;}cF[cE]=b5;}}}if(cC["PUBLIC"]["VIRTUAL"].hasOwnProperty("FINAL")&&cC["PUBLIC"]["VIRTUAL"]["FINAL"].hasOwnProperty("FUNCTIONS")){for(cE in cC["PUBLIC"]["VIRTUAL"]["FINAL"]["FUNCTIONS"]){if(cC["PUBLIC"]["VIRTUAL"]["FINAL"]["FUNCTIONS"].hasOwnProperty(cE)){cH.PUBLIC_VIRTUAL_FUNCTIONS.push([cE,cC["PUBLIC"]["VIRTUAL"]["FINAL"]["FUNCTIONS"][cE]]);cF[cE]=b5;cG.FUNCTIONS[cE]=2;b9(cC["PUBLIC"]["VIRTUAL"]["FINAL"]["FUNCTIONS"][cE],cC.CRX_CLASS_ID);}}}if(cH.PUBLIC_VIRTUAL_FUNCTIONS.length>0){cH.PUBLIC_VIRTUAL=true;}}if(cC["PUBLIC"].hasOwnProperty("CONSTRUCT")){if(cC["PUBLIC"]["CONSTRUCT"]===1){if(cH.EXTENDS){cH.PUBLIC_CONSTRUCT=function(){if(this.PARENT.CONSTRUCT){this.PARENT.CONSTRUCT.apply(this.PARENT,arguments);}};}}else{cH.PUBLIC_CONSTRUCT=cC["PUBLIC"]["CONSTRUCT"];}}if((cH.PUBLIC_VARS.length>0)||(cH.PUBLIC_FUNCTIONS.length>0)||(cH.PUBLIC_VIRTUAL)||(cH.PUBLIC_CONSTRUCT)){cH.PUBLIC=true;}}if(cC.hasOwnProperty("PRIVATE")){cH.PRIVATE_CONSTS=[];cH.PRIVATE_VARS=[];cH.PRIVATE_FUNCTIONS=[];cH.PRIVATE_VIRTUAL=null;cH.PRIVATE_VIRTUAL_FUNCTIONS=[];if(bI&&cC["PRIVATE"].hasOwnProperty("CONSTS")){for(cE in cC["PRIVATE"]["CONSTS"]){if(cC["PRIVATE"]["CONSTS"].hasOwnProperty(cE)){cH.PRIVATE_CONSTS.push([cE,cC["PRIVATE"]["CONSTS"][cE]]);}}}if(cC["PRIVATE"].hasOwnProperty("VARS")){for(cE in cC["PRIVATE"]["VARS"]){if(cC["PRIVATE"]["VARS"].hasOwnProperty(cE)){if(J||aX){cH.PRIVATE_VARS.push([cE,bs(cC["PRIVATE"]["VARS"][cE])]);}else{var cI=ai(cC.CRX_CLASS_ID,cE);cH.PRIVATE_VARS.push([cE,bs(cC["PRIVATE"]["VARS"][cE]),cI[0],cI[1]]);}cF[cE]=Z;cG.VARS[cE]=1;}}}if(cC["PRIVATE"].hasOwnProperty("FUNCTIONS")){for(cE in cC["PRIVATE"]["FUNCTIONS"]){if(cC["PRIVATE"]["FUNCTIONS"].hasOwnProperty(cE)){if(J||aX){cH.PRIVATE_FUNCTIONS.push([cE,cC["PRIVATE"]["FUNCTIONS"][cE]]);}else{var cI=cx(cC.CRX_CLASS_ID,cE);cH.PRIVATE_FUNCTIONS.push([cE,cC["PRIVATE"]["FUNCTIONS"][cE],cI[0],cI[1]]);}cF[cE]=Z;cG.FUNCTIONS[cE]=1;b9(cC["PRIVATE"]["FUNCTIONS"][cE],cC.CRX_CLASS_ID);}}}if(cC["PRIVATE"].hasOwnProperty("VIRTUAL")){if(cC["PRIVATE"]["VIRTUAL"].hasOwnProperty("FUNCTIONS")){for(cE in cC["PRIVATE"]["VIRTUAL"]["FUNCTIONS"]){if(cC["PRIVATE"]["VIRTUAL"]["FUNCTIONS"].hasOwnProperty(cE)){cH.PRIVATE_VIRTUAL_FUNCTIONS.push([cE,cC["PRIVATE"]["VIRTUAL"]["FUNCTIONS"][cE]]);if((cC["PRIVATE"]["VIRTUAL"]["FUNCTIONS"][cE]!==0)){cG.FUNCTIONS[cE]=2;b9(cC["PRIVATE"]["VIRTUAL"]["FUNCTIONS"][cE],cC.CRX_CLASS_ID);}else{cG.FUNCTIONS[cE]=3;}cF[cE]=Z;}}}if(cC["PRIVATE"]["VIRTUAL"].hasOwnProperty("FINAL")&&cC["PRIVATE"]["VIRTUAL"]["FINAL"].hasOwnProperty("FUNCTIONS")){for(cE in cC["PRIVATE"]["VIRTUAL"]["FINAL"]["FUNCTIONS"]){if(cC["PRIVATE"]["VIRTUAL"]["FINAL"]["FUNCTIONS"].hasOwnProperty(cE)){cH.PRIVATE_VIRTUAL_FUNCTIONS.push([cE,cC["PRIVATE"]["VIRTUAL"]["FINAL"]["FUNCTIONS"][cE]]);cF[cE]=Z;cG.FUNCTIONS[cE]=2;b9(cC["PRIVATE"]["VIRTUAL"]["FINAL"]["FUNCTIONS"][cE],cC.CRX_CLASS_ID);}}}if(cH.PRIVATE_VIRTUAL_FUNCTIONS.length>0){cH.PRIVATE_VIRTUAL=true;}}if((cH.PRIVATE_VARS.length>0)||(cH.PRIVATE_FUNCTIONS.length>0)||cH.PRIVATE_VIRTUAL){cH.PRIVATE=true;}}if(cC.hasOwnProperty("PROTECTED")){cH.PROTECTED_FUNCTIONS=[];cH.PROTECTED_VIRTUAL=null;cH.PROTECTED_VIRTUAL_FUNCTIONS=[];if(cC["PROTECTED"].hasOwnProperty("FUNCTIONS")){for(cE in cC["PROTECTED"]["FUNCTIONS"]){if(cC["PROTECTED"]["FUNCTIONS"].hasOwnProperty(cE)){cH.PROTECTED_FUNCTIONS.push([cE,cC["PROTECTED"]["FUNCTIONS"][cE]]);cF[cE]=aH;cG.FUNCTIONS[cE]=1;b9(cC["PROTECTED"]["FUNCTIONS"][cE],cC.CRX_CLASS_ID);}}}if(cC["PROTECTED"].hasOwnProperty("VIRTUAL")){if(cC["PROTECTED"]["VIRTUAL"].hasOwnProperty("FUNCTIONS")){for(cE in cC["PROTECTED"]["VIRTUAL"]["FUNCTIONS"]){if(cC["PROTECTED"]["VIRTUAL"]["FUNCTIONS"].hasOwnProperty(cE)){cH.PROTECTED_VIRTUAL_FUNCTIONS.push([cE,cC["PROTECTED"]["VIRTUAL"]["FUNCTIONS"][cE]]);if((cC["PROTECTED"]["VIRTUAL"]["FUNCTIONS"][cE]!==0)){cG.FUNCTIONS[cE]=2;b9(cC["PROTECTED"]["VIRTUAL"]["FUNCTIONS"][cE],cC.CRX_CLASS_ID);}else{cG.FUNCTIONS[cE]=3;}cF[cE]=aH;}}}if(cC["PROTECTED"]["VIRTUAL"].hasOwnProperty("FINAL")&&cC["PROTECTED"]["VIRTUAL"]["FINAL"].hasOwnProperty("FUNCTIONS")){for(cE in cC["PROTECTED"]["VIRTUAL"]["FINAL"]["FUNCTIONS"]){if(cC["PROTECTED"]["VIRTUAL"]["FINAL"]["FUNCTIONS"].hasOwnProperty(cE)){cH.PROTECTED_VIRTUAL_FUNCTIONS.push([cE,cC["PROTECTED"]["VIRTUAL"]["FINAL"]["FUNCTIONS"][cE]]);cF[cE]=aH;cG.FUNCTIONS[cE]=2;b9(cC["PROTECTED"]["VIRTUAL"]["FINAL"]["FUNCTIONS"][cE],cC.CRX_CLASS_ID);}}}if(cH.PROTECTED_VIRTUAL_FUNCTIONS.length>0){cH.PROTECTED_VIRTUAL=true;}}if((cH.PROTECTED_FUNCTIONS.length>0)||(cH.PROTECTED_VIRTUAL)){cH.PROTECTED=true;}}bv[cC.CRX_CLASS_ID]=cH;O[cC.CRX_CLASS_ID]=cF;aL[cC.CRX_CLASS_ID]=cG;}function F(cC){m(cC.CRX_CLASS_ID,cC);}function m(cF,cC){if(cC.EXTENDS){m(cF,cC.EXTENDS);}for(var cD=0;cD<m.KEYS.length;cD++){if(cC[m.KEYS[cD][0]]&&cC[m.KEYS[cD][1]]){if(!C[cF]){C[cF]={};bX[cF]={};aM[cF]={};}for(var cE=cC[m.KEYS[cD][2]].length-1;cE>-1;cE--){if(cC[m.KEYS[cD][2]][cE][1]!==0){C[cF][cC[m.KEYS[cD][2]][cE][0]]=cC[m.KEYS[cD][2]][cE][1];}aM[cF][cC[m.KEYS[cD][2]][cE][0]]=cC.CRX_CLASS_ID;if(!bX[cF][cC[m.KEYS[cD][2]][cE][0]]){bX[cF][cC[m.KEYS[cD][2]][cE][0]]=cC.CRX_CLASS_ID;}}}}}m.KEYS=[["PUBLIC","PUBLIC_VIRTUAL","PUBLIC_VIRTUAL_FUNCTIONS"],["PRIVATE","PRIVATE_VIRTUAL","PRIVATE_VIRTUAL_FUNCTIONS"],["PROTECTED","PROTECTED_VIRTUAL","PROTECTED_VIRTUAL_FUNCTIONS"]];function br(cD){if(P[cD.CRX_CLASS_ID]===void (0)){var cC=false;if(aX){ad[cD.CRX_CLASS_ID]={};}if(cD.hasOwnProperty("PUBLIC")){if(cD["PUBLIC"].hasOwnProperty("CONSTS")||cD["PUBLIC"].hasOwnProperty("STATIC")){P[cD.CRX_CLASS_ID]={};}else{P[cD.CRX_CLASS_ID]=null;}if(cD["PUBLIC"].hasOwnProperty("CONSTS")){for(var cE in cD["PUBLIC"]["CONSTS"]){if(!cD["PUBLIC"]["CONSTS"].hasOwnProperty(cE)){continue;}an(P[cD.CRX_CLASS_ID],cE,cD["PUBLIC"]["CONSTS"][cE]);}}if(cD["PUBLIC"].hasOwnProperty("STATIC")){if(cD["PUBLIC"]["STATIC"].hasOwnProperty("VARS")){for(var cE in cD["PUBLIC"]["STATIC"]["VARS"]){if(!cD["PUBLIC"]["STATIC"]["VARS"].hasOwnProperty(cE)){continue;}if(bv[cD.CRX_CLASS_ID].DIRECTIVE_NO_PUBLIC_VARS_DELEGATION){P[cD.CRX_CLASS_ID][cE]=cD["PUBLIC"]["STATIC"]["VARS"][cE];}else{cC=true;Object.defineProperty(P[cD.CRX_CLASS_ID],cE,{"get":(function(cG,cF){return function(){return L[cD.CRX_CLASS_ID][cF];};})(cD.CRX_CLASS_ID,cE),"set":(function(cG,cF){return function(cH){L[cD.CRX_CLASS_ID][cF]=cH;};})(cD.CRX_CLASS_ID,cE),"enumerable":true});}}}if((!J||aX)&&cD["PUBLIC"]["STATIC"].hasOwnProperty("FUNCTIONS")){for(var cE in cD["PUBLIC"]["STATIC"]["FUNCTIONS"]){if(!cD["PUBLIC"]["STATIC"]["FUNCTIONS"].hasOwnProperty(cE)){continue;}an(P[cD.CRX_CLASS_ID],cE,ag(cD.CRX_CLASS_ID,cD["PUBLIC"]["STATIC"]["FUNCTIONS"][cE]));b9(cD["PUBLIC"]["STATIC"]["FUNCTIONS"][cE],cD.CRX_CLASS_ID,true);}}}}else{P[cD.CRX_CLASS_ID]=null;}if(aX&&P[cD.CRX_CLASS_ID]){L[cD.CRX_CLASS_ID]=a2(P[cD.CRX_CLASS_ID]);}if(cD.hasOwnProperty("PRIVATE")){if(L[cD.CRX_CLASS_ID]===void (0)){if(cC||cD["PRIVATE"].hasOwnProperty("CONSTS")||cD["PRIVATE"].hasOwnProperty("STATIC")){if(P[cD.CRX_CLASS_ID]===null){L[cD.CRX_CLASS_ID]={};}else{L[cD.CRX_CLASS_ID]=a2(P[cD.CRX_CLASS_ID]);}}else{L[cD.CRX_CLASS_ID]=null;}}if(cD["PRIVATE"].hasOwnProperty("CONSTS")){for(var cE in cD["PRIVATE"]["CONSTS"]){if(!cD["PRIVATE"]["CONSTS"].hasOwnProperty(cE)){continue;}an(L[cD.CRX_CLASS_ID],cE,cD["PRIVATE"]["CONSTS"][cE]);}}if(cD["PRIVATE"].hasOwnProperty("STATIC")){if(cD["PRIVATE"]["STATIC"].hasOwnProperty("VARS")){for(var cE in cD["PRIVATE"]["STATIC"]["VARS"]){if(!cD["PRIVATE"]["STATIC"]["VARS"].hasOwnProperty(cE)){continue;}L[cD.CRX_CLASS_ID][cE]=cD["PRIVATE"]["STATIC"]["VARS"][cE];}}if((!J||aX)&&cD["PRIVATE"]["STATIC"].hasOwnProperty("FUNCTIONS")){for(var cE in cD["PRIVATE"]["STATIC"]["FUNCTIONS"]){if(!cD["PRIVATE"]["STATIC"]["FUNCTIONS"].hasOwnProperty(cE)){continue;}an(L[cD.CRX_CLASS_ID],cE,ag(cD.CRX_CLASS_ID,cD["PRIVATE"]["STATIC"]["FUNCTIONS"][cE]));b9(cD["PRIVATE"]["STATIC"]["FUNCTIONS"][cE],cD.CRX_CLASS_ID,true);}}}if(cC){for(var cE in cD["PUBLIC"]["STATIC"]["VARS"]){if(!cD["PUBLIC"]["STATIC"]["VARS"].hasOwnProperty(cE)){continue;}Object.defineProperty(L[cD.CRX_CLASS_ID],cE,{"value":cD["PUBLIC"]["STATIC"]["VARS"][cE],"writable":true,"enumerable":true});}}}if(aX&&L[cD.CRX_CLASS_ID]){an(ad[cD.CRX_CLASS_ID],"O",R(cD.CRX_CLASS_ID));an(ad[cD.CRX_CLASS_ID],"CRX_STATIC_INFO",bd({"CRX_CLASS_ID":cD.CRX_CLASS_ID}));an(ad[cD.CRX_CLASS_ID],"STATIC",L[cD.CRX_CLASS_ID]);}}}function bq(cD){if(d){return;}var cC=al(cD);if(cC===null){return null;}return(bC(this).CRX_OBJECT_SEGMENTS[cC]||null);}function e(cC){if(d){return;}var cD=bg(cC);if(cD===null){return null;}cf(cD);if(P[cD.CRX_CLASS_ID]){if(bI&&(bv[cD.CRX_CLASS_ID].PUBLIC_CONSTS.length>0)){cr(cD.CRX_CLASS_ID);}return(P[cD.CRX_CLASS_ID]||null);}else{return null;}}function cr(cD){for(var cC=0;cC<bv[cD].PUBLIC_CONSTS.length;cC++){P[cD][bv[cD].PUBLIC_CONSTS[cC][0]]=bv[cD].PUBLIC_CONSTS[cC][1];}}function f(cH,cD){if(d){return;}var cF=null;var cG=null;if((cH!==void (0))&&(cH!==null)){cF=al(cH);cG=this.CAST(cH);}else{cF=aW(this.PARENT);cG=this.PARENT;}if(!cF){x('UNDECLARED CLASS "??'+cH+'??"',-1);}if(!cG){x('CAN NOT RESOLVE MEMBER "'+cD+'" ON CLASS "'+aZ(ac[cF])+'". INSTANCE CAN NOT BE CASTED TO "'+aZ(ac[cF])+'"',-1);}if(bA(this)===cF){if(aL[cF].VARS[cD]){return this[cD];}else{if(aL[cF].FUNCTIONS[cD]){if(aL[cF].FUNCTIONS[cD]===1){return this[cD].apply(this,Array.prototype.slice.call(arguments,2));}else{if(aL[cF].FUNCTIONS[cD]===2){var cI=a6(cF,"puv",cD);return cI.apply(cG,Array.prototype.slice.call(arguments,2));}}}}}else{if(aL[cF].VARS[cD]){if(O[cF][cD]===b5){if(arguments.length===2){return cG[cD];}else{if(arguments.length===3){cG[cD]=arguments[2];return;}}}}else{if(aL[cF].FUNCTIONS[cD]){if(aL[cF].FUNCTIONS[cD]===1){if(O[cF][cD]===b5){return cG[cD].apply(cG,Array.prototype.slice.call(arguments,2));}else{if(O[cF][cD]===aH){var cE=bC(this);var cL=bO(this.THIS,cE);var cJ=this.PARENT;if((this===cE.CRX_PRIVATE_OBJECT_SEGMENTS[cL])||(!J&&!aX&&bk(f.caller,cL,true))){return cG[cD].apply(cE.CRX_PRIVATE_OBJECT_SEGMENTS[cF],Array.prototype.slice.call(arguments,2));}}}}else{if(aL[cF].FUNCTIONS[cD]===2){if(O[cF][cD]!==Z){var cE=bC(this);var cL=bO(this.THIS,cE);var cJ=this.PARENT;var cC=false;var cK=false;if((this===cE.CRX_PRIVATE_OBJECT_SEGMENTS[cL])||(!J&&!aX&&bk(f.caller,cL,true))){cK=true;}while(cJ!==null){cL=aM[bA(cJ)][cD]||null;if(aL[cL].FUNCTIONS[cD]){if((O[cL][cD]===aH)||(O[cL][cD]===b5)){if(O[cL][cD]===aH){cC=true;}if(aL[cL].FUNCTIONS[cD]===2){if(cL==cF){if(!cC||(cK)){return a6(cF,"puv",cD).apply(cE.CRX_PRIVATE_OBJECT_SEGMENTS[cF],Array.prototype.slice.call(arguments,2));}else{break;}}}}else{break;}}cJ=cJ.PARENT;}}}}}}}x('ILLEGAL ACCESS TO, OR UNKNOWN, MEMBER "'+cD+'" IN CLASS "'+aZ(ac[cF])+'"',-1);}function be(cC){return function(cE,cD){if(d){return;}return aq(this,cC,cE,cD);};}function aq(cJ,cG,cI,cF){if(cJ===cG){var cD=aW(cJ.THIS);if(cD!==null){if(cF===void (0)){return bC(cI).CRX_PRIVATE_OBJECT_SEGMENTS[cD]||null;}else{var cC=cI.CAST(cF);if(cC!==null){var cH=bC(cC);var cE=bO(cC,cH);if(bn[cE].hasOwnProperty(cD)){return cH.CRX_PRIVATE_OBJECT_SEGMENTS[cE];}else{x("ERROR USING 'O'. CLASS \""+aZ(ac[cD])+'" IS NOT BE FRIENDED '+'BY CLASS "'+aZ(ac[cE])+'"',-1);}}else{return null;}}}}x("SECURITY ERROR WHILE USING 'O'");}function cq(cD){if(d){return;}var cF=bg(cD);var cE=bC(this);var cC=bO(this.THIS,cE);if(cF===null){return null;}cf(cF);if((cE.CRX_PRIVATE_OBJECT_SEGMENTS[cC]===this)&&bn[cF.CRX_CLASS_ID].hasOwnProperty(cC)){return(L[cF.CRX_CLASS_ID]||P[cF.CRX_CLASS_ID]||null);}else{return(P[cF.CRX_CLASS_ID]||null);}}function b0(cC){if(d){return;}var cD=bg(cC);if(cD===null){return null;}cf(cD);if(P[cD.CRX_CLASS_ID]||L[cD.CRX_CLASS_ID]){if(bk(b0.caller,cD.CRX_CLASS_ID,true)){return(L[cD.CRX_CLASS_ID]||P[cD.CRX_CLASS_ID]||null);}else{return(P[cD.CRX_CLASS_ID]||null);}}else{return null;}}function R(cC){return function(cE,cD){if(d){return;}return aK(this,cC,cE,cD);};}function aK(cI,cF,cH,cE){if(cI===ad[cF]){if(cE===void (0)){return bC(cH).CRX_PRIVATE_OBJECT_SEGMENTS[cF]||null;}else{var cC=cH.CAST(cE);if(cC!==null){var cG=bC(cC);var cD=bO(cC,cG);if(bn[cD].hasOwnProperty(cF)){return cG.CRX_PRIVATE_OBJECT_SEGMENTS[cD];}else{x("ERROR USING 'O'. CLASS \""+aZ(ac[cF])+'" IS NOT BE FRIENDED '+'BY CLASS "'+aZ(ac[cD])+'"',-1);}}else{return null;}}}x("SECURITY ERROR WHILE USING 'O'");}function bj(cD){if(d){return;}var cE=bg(cD);var cC=j(this);if(cE===null){return null;}cf(cE);if((ad[pClass.CRX_CLASS_ID][cC]===this)&&bn[cE.CRX_CLASS_ID].hasOwnProperty(cC)){return(L[cE.CRX_CLASS_ID]||P[cE.CRX_CLASS_ID]||null);}else{return(P[cE.CRX_CLASS_ID]||null);}}function N(){var cD=bC(this);var cC=bO(this.THIS,cD);if(cD.CRX_PRIVATE_OBJECT_SEGMENTS[cC]===this){cD.CRX_IS_ANNULED=true;}else{x("SECURITY ERROR WHILE USING 'ANNUL'");}return cD.CRX_IS_ANNULED;}function a7(cC){if(cC.CRX_CLASS_INFO){return bC(cC,true).CRX_IS_ANNULED;}return false;}function aE(cJ,cE){if(typeof(cJ)==="string"){return false;}var cI=b3(cJ);var cF=null;var cH=null;if(typeof(cE)==="string"){cF=bg(cE);if(cF===null){cF=bL(cE);}if(cF===null){cF=aR(cE);}if(cF===null){return false;}}else{cF=cE;}cH=b3(cF);if(cI==="$CRX__native"){if(cH==="$CRX__native"){return(cJ instanceof cE);}return false;}else{if((cI==="$CRX_DEFINITION__INTERFACE")||(cI==="$CRX_DEFINITION__CLASS")||(cI==="$CRX_DEFINITION__STRUCTURE")){return false;}else{if(cI==="$CRX_OBJECT"){if(cH==="$CRX_DEFINITION__CLASS"){var cG=ac[aW(cJ.THIS)];while(cG){if(cF.CRX_CLASS_ID===cG.CRX_CLASS_ID){return true;}if(cG.hasOwnProperty("EXTENDS")){cG=bg(cG["EXTENDS"]);}else{cG=null;}}return false;}else{if(cH==="$CRX_DEFINITION__STRUCTURE"){var cC=bT[cJ.CRX_STRUCTURE_ID];if(cF.CRX_STRUCTURE_ID===cJ.CRX_STRUCTURE_ID){return true;}if(cC.SHARED_LIST){for(var cD=0;cD<cC.SHARED_LIST.length;cD++){if(cF.CRX_STRUCTURE_ID===cC.SHARED_LIST[cD]){return true;}}}return false;}else{if(cH==="$CRX_DEFINITION__INTERFACE"){var cG=ac[aW(cJ.THIS)];while(cG){if(a0[cG.CRX_CLASS_ID]&&a0[cG.CRX_CLASS_ID].hasOwnProperty(cF.CRX_INTERFACE_ID)){return true;}if(cG.hasOwnProperty("EXTENDS")){cG=bg(cG["EXTENDS"]);}else{cG=null;}}return false;}}}}}}return false;}function b3(cC){if((cC===null)||(cC===void (0))){return"$CRX__native";}if(cC.CRX_DEFINITION){if(cC.CRX_INTERFACE_ID&&(co[cC.CRX_INTERFACE_ID]===cC)){return"$CRX_DEFINITION__INTERFACE";}if(cC.CRX_CLASS_ID&&((ac[cC.CRX_CLASS_ID]===cC)||(aC[cC.CRX_CLASS_ID]===cC))){return"$CRX_DEFINITION__CLASS";}if(cC.CRX_STRUCTURE_ID&&((ca[cC.CRX_STRUCTURE_ID]===cC)||(at[cC.CRX_STRUCTURE_ID]===cC))){return"$CRX_DEFINITION__STRUCTURE";}}if((cC.CRX_CLASS_INFO&&(bC(cC)!==null))||(cC.CRX_STRUCTURE_INFO&&(a8(cC)!==null))){return"$CRX_OBJECT";}return"$CRX__native";}function B(cE,cC,cH){if(d){return;}var cF=bg(cE);var cD=bg(cC);var cG=null;if(cF===null){x('UNDECLARED CLASS "??'+cE+'??"',-1);}else{if(cD===null){x('UNDECLARED CLASS "??'+cC+'??"',-1);}}cf(cF);cf(cD);cG=bv[cF.CRX_CLASS_ID];if(!cH&&(cG===bv[cD.CRX_CLASS_ID])){return false;}else{while(cG){if(cG===bv[cD.CRX_CLASS_ID]){return true;}cG=cG.EXTENDS;}}return false;}function az(cE,cD){if(d){return;}var cF=bg(cE);var cC=bL(cD);if(cC===null){x('UNDECLARED INTERFACE "??'+cD+'??"',-1);}cf(cF);while(cF){if(a0[cF.CRX_CLASS_ID]&&a0[cF.CRX_CLASS_ID].hasOwnProperty(cC.CRX_INTERFACE_ID)){return true;}if(cF.hasOwnProperty("EXTENDS")){cF=bg(cF["EXTENDS"]);}else{cF=null;}}return false;}function bH(cC){return(bg(cC,true)?true:false);}function aB(cC){return(bL(cC)?true:false);}function U(cK,cN,cC){var cE=[];var cL=[];var cM=v(cK);var cJ=false;var cG=null;var cF=0;var cI=0;var cH=0;var cO=-1;var cD=null;for(cF=0;cF<cC;cF++){cE[cF]=a2(cM);cN[cF].CRX_SHARED_SEGMENT=cE[cF];cN[cF].CRX_SHARED_PRIVATE_SEGMENT=null;cN[cF].CRX_PRIVATE_SEGMENTS={};cN[cF].CRX_SHARED_SEGMENTS_DATA={};cN[cF].currentStructureID=-1;an(cE[cF],"CRX_STRUCTURE_INFO",bd(cN[cF]));an(cE[cF],"THIS",cE[cF]);cE[cF]["CONSTRUCT"]=T;}if(cK.SHARED){if(cK.SHARED_PUBLIC){for(cF=0;cF<cK.SHARED_ALL_PUBLIC_VARS.length;cF++){if(cK.SHARED_PRIVATE||(cK.PRIVATES.length>0)){U.o1.get=cK.SHARED_ALL_PUBLIC_VARS[cF][2];U.o1.set=cK.SHARED_ALL_PUBLIC_VARS[cF][3];for(cI=0;cI<cC;cI++){cN[cI].CRX_SHARED_SEGMENTS_DATA[cK.SHARED_ALL_PUBLIC_VARS[cF][0]]=cK.SHARED_ALL_PUBLIC_VARS[cF][1];Object.defineProperty(cE[cI],cK.SHARED_ALL_PUBLIC_VARS[cF][0],U.o1);}}else{for(cI=0;cI<cC;cI++){cE[cI][cK.SHARED_ALL_PUBLIC_VARS[cF][0]]=cK.SHARED_ALL_PUBLIC_VARS[cF][1];}}}}if(cK.SHARED_PRIVATE){for(cF=0;cF<cC;cF++){cL[cF]=a2(cE[cF]);cN[cF].CRX_SHARED_PRIVATE_SEGMENT=cL[cF];}for(cF=0;cF<cK.SHARED_ALL_PRIVATE_VARS.length;cF++){if(cK.PRIVATES.length>0){U.o1.get=cK.SHARED_ALL_PRIVATE_VARS[cF][2];U.o1.set=cK.SHARED_ALL_PRIVATE_VARS[cF][3];for(cI=0;cI<cC;cI++){cN[cI].CRX_SHARED_SEGMENTS_DATA[cK.SHARED_ALL_PRIVATE_VARS[cF][0]]=cK.SHARED_ALL_PRIVATE_VARS[cF][1];Object.defineProperty(cE[cI],cK.SHARED_ALL_PRIVATE_VARS[cF][0],U.o1);}}else{for(cI=0;cI<cC;cI++){cL[cI][cK.SHARED_ALL_PRIVATE_VARS[cF][0]]=cK.SHARED_ALL_PRIVATE_VARS[cF][1];}}}for(cF=0;cF<cK.SHARED_ALL_PRIVATE_FUNCTIONS.length;cF++){ax(cL,cK.SHARED_ALL_PRIVATE_FUNCTIONS[cF][0],cK.SHARED_ALL_PRIVATE_FUNCTIONS[cF][1],true);}ax(cL,"O",ay);}else{for(cF=0;cF<cC;cF++){cN[cF].CRX_SHARED_PRIVATE_SEGMENT=cE[cF];}}}else{for(cF=0;cF<cC;cF++){cN[cF].CRX_SHARED_PRIVATE_SEGMENT=cE[cF];}}for(cF=0;cF<cC;cF++){for(cI=0;cI<cK.SHARED_LIST.length;cI++){cN[cF].CRX_PRIVATE_SEGMENTS[cK.SHARED_LIST[cI]]=cN[cF].CRX_SHARED_PRIVATE_SEGMENT;}}for(cF=0;cF<cK.PRIVATES.length;cF++){cO=cK.PRIVATES[cF];for(cI=0;cI<cC;cI++){cG=a2(cN[cI].CRX_SHARED_PRIVATE_SEGMENT);cN[cI].CRX_PRIVATE_SEGMENTS[cO]=cG;for(cH=0;cH<bT[cO].PRIVATE_VARS.length;cH++){cG[bT[cO].PRIVATE_VARS[cH][0]]=bT[cO].PRIVATE_VARS[cH][1];}for(cH=0;cH<bT[cO].PRIVATE_FUNCTIONS.length;cH++){an(cG,bT[cO].PRIVATE_FUNCTIONS[cH][0],bT[cO].PRIVATE_FUNCTIONS[cH][1]);}an(cG,"O",bf(cG,cO));an(cG,"CRX_STRUCTURE_ID_PV",cO);}}return cE;}U.o1={"get":null,"set":null,enumerable:true};function cl(cD,cC){if(cv[cD]&&cv[cD]["pub"]&&cv[cD]["pub"]["CONSTRUCT"]){return cv[cD]["pub"]["CONSTRUCT"];}else{if(!cv[cD]){cv[cD]={};}if(!cv[cD]["pub"]){cv[cD]["pub"]={};}if(cC){cv[cD]["pub"]["CONSTRUCT"]=(function(cF,cE){return function(){if(d){return;}var cH=a8(this);var cI=cH.currentStructureID;cH.currentStructureID=cF;if(aj[cF]){x("SECOND CALL TO CONSTRUCTOR");}aj[cF]=true;if(bT[cF].INHERITS&&bT[cF].INHERITS.length>0){for(var cG=0;cG<bT[cF].INHERITS.length;cG++){if(aj[bT[cF].INHERITS[cG]]){x("UNKNOWN CONSTRUCTION ERROR");}}cE.apply(cH.CRX_PRIVATE_SEGMENTS[cF],arguments);for(var cG=0;cG<bT[cF].INHERITS.length;cG++){if(!bT[bT[cF].INHERITS[cG]].PUBLIC_CONSTRUCT){continue;}if(!aj[bT[cF].INHERITS[cG]]){bT[bT[cF].INHERITS[cG]].PUBLIC_CONSTRUCT.apply(cH.CRX_PRIVATE_SEGMENTS[bT[cF].INHERITS[cG]]);}if(!aj[bT[cF].INHERITS[cG]]){x("UNKNOWN CONSTRUCTION ERROR");}aj[bT[cF].INHERITS[cG]]=false;}}else{cE.apply(cH.CRX_PRIVATE_SEGMENTS[cF],arguments);}cH.currentStructureID=cI;};})(cD,cC);}else{cv[cD]["pub"]["CONSTRUCT"]=(function(cE){return function(){if(d){return;}var cG=a8(this);var cH=cG.currentStructureID;cG.currentStructureID=cE;if(aj[cE]){x("SECOND CALL TO CONSTRUCTOR");}aj[cE]=true;for(var cF=0;cF<bT[cE].INHERITS.length;cF++){if(!bT[bT[cE].INHERITS[cF]].PUBLIC_CONSTRUCT){continue;}if(aj[bT[cE].INHERITS[cF]]){x("UNKNOWN CONSTRUCTION ERROR");}bT[bT[cE].INHERITS[cF]].PUBLIC_CONSTRUCT.apply(cG.CRX_PRIVATE_SEGMENTS[bT[cE].INHERITS[cF]],arguments);if(!aj[bT[cE].INHERITS[cF]]){x("UNKNOWN CONSTRUCTION ERROR");}aj[bT[cE].INHERITS[cF]]=false;}cG.currentStructureID=cH;};})(cD);}return cv[cD]["pub"]["CONSTRUCT"];}}function af(cG,cE,cD,cC,cF){if(cv[cG]&&cv[cG][cE]&&cv[cG][cE][cD]){return cv[cG][cE][cD];}else{if(!cv[cG]){cv[cG]={};}if(!cv[cG][cE]){cv[cG][cE]={};}if(cF){cv[cG][cE][cD]=(function(cI,cH){return function(){if(d){return;}var cK=a8(this);var cL=cK.currentStructureID;var cJ=void (0);cK.CRX_STRUCTURE_ID=cI;cJ=cH.apply(a8(this).CRX_PRIVATE_SEGMENTS[cI],arguments);cK.CRX_STRUCTURE_ID=cL;return cJ;};})(cG,cC);}else{cv[cG][cE][cD]=(function(cI,cH){return function(){if(d){return;}return cH.apply(a8(this).CRX_PRIVATE_SEGMENTS[cI],arguments);};})(cG,cC);}}return cv[cG][cE][cD];}function bV(cC){aV=true;Q(cC);}function a8(cD){var cC=null;cD.CRX_STRUCTURE_INFO();cC=cs;cs=null;if(cC===null){x("SECURITY ERROR, ACCESS VIOLATION");}return cC;}function c(cD,cC){if(cD.CRX_STRUCTURE_ID_PV){if(cC.CRX_PRIVATE_SEGMENTS[cD.CRX_STRUCTURE_ID_PV]!==cD){x("SECURITY VIOLATION");}return cD.CRX_STRUCTURE_ID_PV;}else{if(cC.CRX_PRIVATE_SEGMENTS[cC.currentStructureID]!==cD){return(cD.CRX_STRUCTURE_ID||null);}return cC.currentStructureID;}}function Q(cD){if(X[cD.CRX_STRUCTURE_ID]){return cD;}var cC=[];var cG=[];var cE={};cE["originalStructureID"]=cD.CRX_STRUCTURE_ID;cE["extensionChain"]={};cE["shared"]={};cE["SHARED_PUBLIC_VARS"]={};cE["SHARED_PUBLIC_FUNCTIONS"]={};cE["SHARED_PRIVATE_VARS"]={};cE["SHARED_PRIVATE_FUNCTIONS"]={};aQ(cD,true);b7(ca[cD.CRX_STRUCTURE_ID],cC,cG,cE);for(var cF=0;cF<cG.length;cF++){bU("WARNING: "+cG[cF],1);}for(var cF=0;cF<cC.length;cF++){bU("FATAL ERROR: "+cC[cF],0);}X[cD.CRX_STRUCTURE_ID]=true;if(cC.length>0){x("DEFINITION ERROR");}}function b7(cE,cH,cD,cC){if(q.hasOwnProperty(cE.CRX_STRUCTURE_ID)){for(var cG in q[cE.CRX_STRUCTURE_ID].extensionChain){if(!q[cE.CRX_STRUCTURE_ID].extensionChain.hasOwnProperty(cG)){continue;}if(cC["extensionChain"][cG]||(cG===cE.CRX_STRUCTURE_ID)){x('CIRCULAR INHERITANCE DETECTED ON STRUCTURE "'+bR(ca[cC.originalStructureID])+'" THAT IS DUE TO INHERITING STRUCTURE "'+bR(ca[cG])+'"');}cC["extensionChain"][cG]=true;}ci(cC.shared,q[cE.CRX_STRUCTURE_ID].shared);ci(cC.SHARED_PUBLIC_VARS,q[cE.CRX_STRUCTURE_ID].SHARED_PUBLIC_VARS);ci(cC.SHARED_PUBLIC_FUNCTIONS,q[cE.CRX_STRUCTURE_ID].SHARED_PUBLIC_FUNCTIONS);ci(cC.SHARED_PRIVATE_VARS,q[cE.CRX_STRUCTURE_ID].SHARED_PRIVATE_VARS);ci(cC.SHARED_PRIVATE_FUNCTIONS,q[cE.CRX_STRUCTURE_ID].SHARED_PRIVATE_FUNCTIONS);return;}if(cE.hasOwnProperty("INHERITS")){if(ak(cE["INHERITS"])!=="array"){cH.push("'INHERITS' DEFINITION FOR STRUCTURE '"+bR(cE)+"' IS NOT AN ARRAY");}else{for(var cF=0;cF<cE["INHERITS"].length;cF++){var cI=aR(cE["INHERITS"][cF]);if(cI===null){x('MISSING DEFINITION FOR THE STRUCTURE "'+cE["INHERITS"][cF]+'" THAT IS EXTENED BY STRUCTURE "'+bR(cE)+'"');}if(cC["extensionChain"].hasOwnProperty(cI.CRX_STRUCTURE_ID)||(cI.CRX_STRUCTURE_ID===cE.CRX_STRUCTURE_ID)){x('CIRCULAR INHERITANCE DETECTED ON STRUCTURE "'+bR(ca[cC.originalStructureID])+'" THAT IS DUE TO INHERITING STRUCTURE "'+bR(cE)+'"');}cC["extensionChain"][cI.CRX_STRUCTURE_ID]=true;aQ(cI,true);b7(ca[cI.CRX_STRUCTURE_ID],cH,cD,cC);}}}a5(ca[cE.CRX_STRUCTURE_ID],cH,cD,cC);q[cE.CRX_STRUCTURE_ID]={};q[cE.CRX_STRUCTURE_ID]["extensionChain"]={};q[cE.CRX_STRUCTURE_ID]["shared"]={};q[cE.CRX_STRUCTURE_ID]["SHARED_PUBLIC_VARS"]={};q[cE.CRX_STRUCTURE_ID]["SHARED_PUBLIC_FUNCTIONS"]={};q[cE.CRX_STRUCTURE_ID]["SHARED_PRIVATE_VARS"]={};q[cE.CRX_STRUCTURE_ID]["SHARED_PRIVATE_FUNCTIONS"]={};ci(q[cE.CRX_STRUCTURE_ID].extensionChain,cC.extensionChain);ci(q[cE.CRX_STRUCTURE_ID].shared,cC.shared);ci(q[cE.CRX_STRUCTURE_ID].SHARED_PUBLIC_VARS,cC.SHARED_PUBLIC_VARS);ci(q[cE.CRX_STRUCTURE_ID].SHARED_PUBLIC_FUNCTIONS,cC.SHARED_PUBLIC_FUNCTIONS);ci(q[cE.CRX_STRUCTURE_ID].SHARED_PRIVATE_VARS,cC.SHARED_PRIVATE_VARS);ci(q[cE.CRX_STRUCTURE_ID].SHARED_PRIVATE_FUNCTIONS,cC.SHARED_PRIVATE_FUNCTIONS);}function a5(cE,cH,cD,cC){var cI=bR(cE);var cJ={};for(var cF in cE){if(!cE.hasOwnProperty(cF)){continue;}if((cF==="INHERITS")||(cF==="")||(cF==="CRX_DEFINITION")||(cF==="CRX_STRUCTURE_ID")||(cF==="CRX_STRUCTURE_NAME")){}else{if(cF==="SHARED"){for(var cG in cE["SHARED"]){if(!cE["SHARED"].hasOwnProperty(cG)){continue;}if((cG==="PUBLIC")||(cG==="PRIVATE")){aY(cI,cH,"SHARED "+cG,"SHARED_"+cG,cE["SHARED"][cG],cJ,cC);}else{cH.push('UNRECOGINZED TOKEN "SHARED '+cG+'" IN STRUCTURE "'+cI+'"');}}}else{if((cF==="PRIVATE")||(cF==="PUBLIC")){aY(cI,cH,cF,cF,cE[cF],cJ,cC);}else{cH.push('UNRECOGINZED TOKEN "'+cF+'" IN STRUCTURE "'+cI+'"');}}}}if(cH.length===0){ab(cE);}}function aY(cF,cJ,cC,cD,cG,cK,cE){var cI=(cC==="PUBLIC");for(var cH in cG){if(!cG.hasOwnProperty(cH)){continue;}if((cH==="CONSTRUCT")&&cI){a4(cJ,cF,"PUBLIC",cH,cG[cH],false);}else{if((cH==="VARS")&&!cI){bY(cF,cJ,cC+" VARS",cD+"_VARS",cG["VARS"],cK,cE);}else{if((cH==="FUNCTIONS")&&!cI){aD(cF,cJ,cC+" FUNCTIONS",cD+"_FUNCTIONS",cG["FUNCTIONS"],cK,cE);}else{cJ.push('"'+cC+" "+cH+'" IS NOT ALLOWED. FOUND IN CLASS "'+cF+'"');}}}}}function bY(cF,cI,cC,cG,cJ,cE,cD){if(!av&&(cC.indexOf("SHARED")>-1)){cI.push(cF+"::"+"VARS =>"+'"'+cC+" CAN NOT BE SUPPORTED ON THIS BROWSER");}else{for(var cH in cJ){if(!cJ.hasOwnProperty(cH)||bh(cI,cF,cC,cG,cH,true)){continue;}cb(cI,cF,cC,cG,cH,cE,cD);}}}function aD(cF,cI,cC,cG,cJ,cE,cD){for(var cH in cJ){if(!cJ.hasOwnProperty(cH)||bh(cI,cF,cC,cH,true)||a4(cI,cF,cC,cH,cJ[cH],false)){continue;}cb(cI,cF,cC,cG,cH,cE,cD);}}function cb(cI,cF,cC,cD,cG,cK,cE){var cH=(cC.indexOf("SHARED")>-1);if(cK.hasOwnProperty(cG)){cI.push('DUPLICATE MEMBER "'+cG+'" FOUND IN STRUCTURE "'+cF+'"');}else{if(cE["shared"].hasOwnProperty(cG)){if(!cE[cD]||!cE[cD].hasOwnProperty(cG)){var cJ='MEMBER "'+cG+'" FOUND IN STRUCTURE "'+cF+" IS ALREADY SHARED AND MUST BE "+'DECLARED WITH THE SAME DECLARATION, "';if(cE["SHARED_PUBLIC_VARS"].hasOwnProperty(cG)){cJ+="SHARED PUBLIC (VAR)";}else{if(cE["SHARED_PUBLIC_FUNCTIONS"]){cJ+="SHARED PUBLIC (FUNCTION)";}else{if(cE["SHARED_PRIVATE_VARS"]){cJ+="SHARED PRIVATE (VAR)";}else{if(cE["SHARED_PRIVATE_FUNCTIONS"]){cJ+="SHARED PRIVATE (FUNCTION)";}}}}cJ+='"';cI.push(cJ);}}}cK[cG]=true;if(cH){cE["shared"][cG]=true;cE[cD][cG]=true;}}function ab(cE){if(bT[cE.CRX_STRUCTURE_ID]){return;}var cD={INHERITS:null,SHARED_LIST:[],SHARED:null,PUBLIC:null,PRIVATE:null,PRIVATES:[]};var cI={};var cC={};var cN=0;var cO=(cE.hasOwnProperty("PRIVATE")&&((cE["PRIVATE"].hasOwnProperty("VARS")&&(cE["PRIVATE"]["VARS"].length>0))||(cE["PRIVATE"].hasOwnProperty("FUNCTIONS")&&(cE["PRIVATE"]["FUNCTIONS"].length>0))));var cH={};var cF={};var cM={};var cP={};var cL=null;bQ[cE.CRX_STRUCTURE_ID]={};cD["CRX_STRUCTURE_ID"]=cE.CRX_STRUCTURE_ID;if(cE.hasOwnProperty("INHERITS")){var cQ=null;var cK=cD.INHERITS=[];for(var cG=0;cG<cE["INHERITS"].length;cG++){cQ=M(cE["INHERITS"][cG]);cD.INHERITS.push(cQ);cD.SHARED_LIST.push(cQ);for(var cJ=0;cJ<bT[cQ].SHARED_LIST.length;cJ++){cD.SHARED_LIST.push(bT[cQ].SHARED_LIST[cJ]);if(bT[bT[cQ].SHARED_LIST[cJ]].SHARED){cD.SHARED=true;if(bT[bT[cQ].SHARED_LIST[cJ]].SHARED_PUBLIC){cD.SHARED_PUBLIC=true;}if(bT[bT[cQ].SHARED_LIST[cJ]].SHARED_PRIVATE){cD.SHARED_PRIVATE=true;}}}for(var cJ=0;cJ<bT[cQ].PRIVATES.length;cJ++){cD.PRIVATES[cN]=bT[cQ].PRIVATES[cJ];cN++;}if(bT[cQ].SHARED){for(var cJ=0;cJ<bT[cQ].SHARED_ALL_PUBLIC_VARS.length;cJ++){cH[bT[cQ].SHARED_ALL_PUBLIC_VARS[cJ][0]]=bT[cQ].SHARED_ALL_PUBLIC_VARS[cJ];}for(var cJ=0;cJ<bT[cQ].SHARED_ALL_PUBLIC_FUNCTIONS.length;cJ++){cF[bT[cQ].SHARED_ALL_PUBLIC_FUNCTIONS[cJ][0]]=bT[cQ].SHARED_ALL_PUBLIC_FUNCTIONS[cJ];}for(var cJ=0;cJ<bT[cQ].SHARED_ALL_PRIVATE_VARS.length;cJ++){cM[bT[cQ].SHARED_ALL_PRIVATE_VARS[cJ][0]]=bT[cQ].SHARED_ALL_PRIVATE_VARS[cJ];}for(var cJ=0;cJ<bT[cQ].SHARED_ALL_PRIVATE_FUNCTIONS.length;cJ++){cP[bT[cQ].SHARED_ALL_PRIVATE_FUNCTIONS[cJ][0]]=bT[cQ].SHARED_ALL_PRIVATE_FUNCTIONS[cJ];}}}}if(cD.SHARED||cE.hasOwnProperty("SHARED")){cD.SHARED_PUBLIC_VARS=[];cD.SHARED_PUBLIC_FUNCTIONS=[];cD.SHARED_ALL_PUBLIC_VARS=[];cD.SHARED_ALL_PUBLIC_FUNCTIONS=[];cD.SHARED_PRIVATE_VARS=[];cD.SHARED_PRIVATE_FUNCTIONS=[];cD.SHARED_ALL_PRIVATE_VARS=[];cD.SHARED_ALL_PRIVATE_FUNCTIONS=[];}if(cE.hasOwnProperty("SHARED")){if(cE["SHARED"].hasOwnProperty("PUBLIC")){cD.SHARED_PUBLIC=true;if(cE["SHARED"]["PUBLIC"].hasOwnProperty("VARS")){for(cL in cE["SHARED"]["PUBLIC"]["VARS"]){if(cE["SHARED"]["PUBLIC"]["VARS"].hasOwnProperty(cL)){cD.SHARED_PUBLIC_VARS.push([cL,bs(cE["SHARED"]["PUBLIC"]["VARS"][cL]),(function(cS,cR){return function(){var cT=a8(this);if(cT.CRX_PRIVATE_SEGMENTS[cS]){return cT.CRX_SHARED_SEGMENTS_DATA[cR];}};})(cE.CRX_STRUCTURE_ID,cL),(function(cS,cR){return function(cT){var cU=a8(this);if(cU.CRX_PRIVATE_SEGMENTS[cS]){cU.CRX_SHARED_SEGMENTS_DATA[cR]=cT;}};})(cE.CRX_STRUCTURE_ID,cL)]);cH[cL]=cD.SHARED_PUBLIC_VARS[cD.SHARED_PUBLIC_VARS.length-1];cI[cL]=bu;cC[cL]=aw;}}}if(cE["SHARED"]["PUBLIC"].hasOwnProperty("FUNCTIONS")){for(cL in cE["SHARED"]["PUBLIC"]["FUNCTIONS"]){if(cE["SHARED"]["PUBLIC"]["FUNCTIONS"].hasOwnProperty(cL)){cD.SHARED_PUBLIC_FUNCTIONS.push([cL,af(cE.CRX_STRUCTURE_ID,"shpu",cL,cE["SHARED"]["PUBLIC"]["FUNCTIONS"][cL],!cO)]);cF[cL]=cD.SHARED_PUBLIC_FUNCTIONS[cD.SHARED_PUBLIC_FUNCTIONS.length-1];cI[cL]=bu;cC[cL]=a1;}}}if((cD.SHARED_PUBLIC_VARS.length>0)||(cD.SHARED_PUBLIC_FUNCTIONS.length>0)){cD.SHARED_PUBLIC=true;}}if(cE["SHARED"].hasOwnProperty("PRIVATE")){cD.SHARED_PRIVATE=true;if(cE["SHARED"]["PRIVATE"].hasOwnProperty("VARS")){for(cL in cE["SHARED"]["PRIVATE"]["VARS"]){if(cE["SHARED"]["PRIVATE"]["VARS"].hasOwnProperty(cL)){cD.SHARED_PRIVATE_VARS.push([cL,bs(cE["SHARED"]["PRIVATE"]["VARS"][cL]),(function(cS,cR){return function(){var cT=a8(this);if(cT.CRX_PRIVATE_SEGMENTS[cS]&&(cT.CRX_PRIVATE_SEGMENTS[c(this,cT)]===this)){return cT.CRX_SHARED_SEGMENTS_DATA[cR];}};})(cE.CRX_STRUCTURE_ID,cL),(function(cS,cR){return function(cT){var cU=a8(this);if(cU.CRX_PRIVATE_SEGMENTS[cS]&&(cU.CRX_PRIVATE_SEGMENTS[c(this,cU)]===this)){cU.CRX_SHARED_SEGMENTS_DATA[cR]=cT;}};})(cE.CRX_STRUCTURE_ID,cL)]);cM[cL]=cD.SHARED_PRIVATE_VARS[cD.SHARED_PRIVATE_VARS.length-1];cI[cL]=K;cC[cL]=aw;}}}if(cE["SHARED"]["PRIVATE"].hasOwnProperty("FUNCTIONS")){for(cL in cE["SHARED"]["PRIVATE"]["FUNCTIONS"]){if(cE["SHARED"]["PRIVATE"]["FUNCTIONS"].hasOwnProperty(cL)){cD.SHARED_PRIVATE_FUNCTIONS.push([cL,af(cE.CRX_STRUCTURE_ID,"shpr",cL,cE["SHARED"]["PRIVATE"]["FUNCTIONS"][cL],!cO)]);cP[cL]=cD.SHARED_PRIVATE_FUNCTIONS[cD.SHARED_PRIVATE_FUNCTIONS.length-1];cI[cL]=K;cC[cL]=a1;}}}if((cD.SHARED_PRIVATE_VARS.length>0)||(cD.SHARED_PRIVATE_FUNCTIONS.length>0)){cD.SHARED_PRIVATE=true;}}if(cD.SHARED_PUBLIC||cD.SHARED_PRIVATE){cD.SHARED=true;}}if(cE.hasOwnProperty("PRIVATE")){cD.PRIVATE_VARS=[];cD.PRIVATE_FUNCTIONS=[];if(cE["PRIVATE"].hasOwnProperty("VARS")){for(cL in cE["PRIVATE"]["VARS"]){if(cE["PRIVATE"]["VARS"].hasOwnProperty(cL)){cD.PRIVATE_VARS.push([cL,bs(cE["PRIVATE"]["VARS"][cL])]);cI[cL]=Z;cC[cL]=aw;bQ[cE.CRX_STRUCTURE_ID][cL]=cz|b2;}}}if(cE["PRIVATE"].hasOwnProperty("FUNCTIONS")){for(cL in cE["PRIVATE"]["FUNCTIONS"]){if(cE["PRIVATE"]["FUNCTIONS"].hasOwnProperty(cL)){cD.PRIVATE_FUNCTIONS.push([cL,af(cE.CRX_STRUCTURE_ID,"pr",cL,cE["PRIVATE"]["FUNCTIONS"][cL],false)]);cI[cL]=Z;cC[cL]=a1;bQ[cE.CRX_STRUCTURE_ID][cL]=W|b2;}}}if((cD.PRIVATE_VARS.length>0)||(cD.PRIVATE_FUNCTIONS.length>0)){cD.PRIVATE=true;cD.PRIVATES[cN]=cE.CRX_STRUCTURE_ID;cN++;}}if(cE.hasOwnProperty("PUBLIC")&&cE["PUBLIC"].hasOwnProperty("CONSTRUCT")){cD.PUBLIC_CONSTRUCT=cl(cE.CRX_STRUCTURE_ID,cE["PUBLIC"]["CONSTRUCT"]);cD.PUBLIC=true;}else{if(cD.INHERITS&&(cD.INHERITS.length>0)){for(var cG=0;cG<cD.INHERITS.length;cG++){if(bT[cD.INHERITS[cG]].PUBLIC&&bT[cD.INHERITS[cG]].PUBLIC_CONSTRUCT){cD.PUBLIC_CONSTRUCT=cl(cE.CRX_STRUCTURE_ID);cD.PUBLIC=true;}}}}if(cD.SHARED){for(cL in cH){if(cH.hasOwnProperty(cL)){cD.SHARED_ALL_PUBLIC_VARS.push(cH[cL]);bQ[cE.CRX_STRUCTURE_ID][cL]=cz|cB;}}for(cL in cF){if(cF.hasOwnProperty(cL)){cD.SHARED_ALL_PUBLIC_FUNCTIONS.push(cF[cL]);bQ[cE.CRX_STRUCTURE_ID][cL]=W|cB;}}for(cL in cM){if(cM.hasOwnProperty(cL)){cD.SHARED_ALL_PRIVATE_VARS.push(cM[cL]);bQ[cE.CRX_STRUCTURE_ID][cL]=cz|bM;}}for(cL in cP){if(cP.hasOwnProperty(cL)){cD.SHARED_ALL_PRIVATE_FUNCTIONS.push(cP[cL]);bQ[cE.CRX_STRUCTURE_ID][cL]=W|bM;}}}cD.SHARED_LIST.push(cE.CRX_STRUCTURE_ID);bT[cE.CRX_STRUCTURE_ID]=cD;bE[cE.CRX_STRUCTURE_ID]=cI;cA[cE.CRX_STRUCTURE_ID]=cC;}function v(cE){if(n.hasOwnProperty(cE.CRX_STRUCTURE_ID)){return n[cE.CRX_STRUCTURE_ID];}var cD={};if(cE.INHERITS){for(var cC=0;cC<cE.INHERITS.length;cC++){ci(cD,v(bT[cE.INHERITS[cC]]));}}if(cE.SHARED){if(cE.SHARED_PUBLIC){for(var cC=0;cC<cE.SHARED_PUBLIC_FUNCTIONS.length;cC++){cD[cE.SHARED_PUBLIC_FUNCTIONS[cC][0]]=cE.SHARED_PUBLIC_FUNCTIONS[cC][1];}}}cD.CRX_STRUCTURE_ID=cE.CRX_STRUCTURE_ID;cD.SR=cj;cD.HASOWN=w;cc(cD);n[cE.CRX_STRUCTURE_ID]=cD;return n[cE.CRX_STRUCTURE_ID];}function bf(cC,cD){return bf.func;}bf.func=function(cD){if(d){return;}if(this.CRX_STRUCTURE_ID_PV){var cC=a8(this);if(cC.CRX_PRIVATE_SEGMENTS[this.CRX_STRUCTURE_ID_PV]===this){return(a8(cD).CRX_PRIVATE_SEGMENTS[this.CRX_STRUCTURE_ID_PV]||null);}}x("SECURITY ERROR WHILE USING 'O'");};function ay(cD){if(d){return;}var cC=a8(cD);if(this===cC.CRX_PRIVATE_SEGMENTS[cC.currentStructureID]){return(a8(cD).CRX_PRIVATE_SEGMENTS[cC.currentStructureID]||null);}x("SECURITY ERROR WHILE USING 'O'");}function cj(cC,cH){if(d){return;}var cG=null;var cD=null;var cE=null;var cF=null;if((cC!==void (0))&&(cC!==null)){cE=a8(this);cG=M(cC);cD=cE.CRX_PRIVATE_SEGMENTS[cG]||null;}if(!cG){x('UNDECLARED STRUCTURE "??'+cC+'??"',-1);}if(!cD){x('CAN NOT RESOLVE MEMBER "'+cH+'" ON STRUCTURE "'+bR(ca[cG])+'". INSTANCE NOT A SUPER SET OF STRUCTURE "'+bR(ca[cG])+'"',-1);}cF=c(this,cE);if(bE[cG][cH]!==Z){if(bE[cG][cH]===K){if(this===cE.CRX_PRIVATE_SEGMENTS[cF]){if(cA[cG][cH]===aw){return void (0);}else{return cv[cG]["shpr"][cH].apply(cD,Array.prototype.slice.call(arguments,2));}}}else{if(bE[cG][cH]===bu){if(cA[cG][cH]===aw){return void (0);}else{return cv[cG]["shpu"][cH].apply(this,Array.prototype.slice.call(arguments,2));}}}}x('ILLEGAL ACCESS TO, OR UNKNOWN, MEMBER "'+cH+'" IN STRUCTURE "'+bR(ca[cG])+'"',-1);}function T(cD){var cG=a8(this);var cH=cG.currentStructureID;if(cH){var cC=M(cD);var cF=false;if(cC){for(var cE=0;cE<bT[cH].INHERITS.length;cE++){if(bT[cH].INHERITS[cE]===cC){cF=true;break;}}if(cF){return(function(cI){return function(){cv[cC]["pub"]["CONSTRUCT"].apply(cI,arguments);};})(cG.CRX_PRIVATE_SEGMENTS[cC]);}else{x('CALL TO "'+bR(ca[cC])+'::CONSTRUCT" IN "'+bR(ca[cH])+'::CONSTRUCT" CAN NOT BE RESOLVED',-1);}}else{x('UNREGISTERED STRUCTURE "'+cD+'"',-1);}}else{x("UNKNOWN ERROR IN CONSTRUCTOR CALL");}}function p(cI,cH,cG){if(d){return;}var cF=aR(cI);var cE=aR(cH);var cC=null;if(cF===null){x('UNDECLARED STRUCTURE "??'+cI+'??"',-1);}else{if(cE===null){x('UNDECLARED STRUCTURE "??'+cH+'??"',-1);}}bV(cF);bV(cE);cC=bT[cF.CRX_STRUCTURE_ID];if(!cG&&(cC===bT[cE.CRX_STRUCTURE_ID])){return false;}else{for(var cD=0;cD<cC.SHARED_LIST.length;cD++){if(cC.SHARED_LIST[cD]===cE.CRX_STRUCTURE_ID){return true;}}}return false;}function bt(cC){return(aR(cC,true)?true:false);}function w(cG,cC,cD,cE){cC=(!cC?cB:cC);cD=(!cD?cz:cD);var cF=a8(this);var cH=c(this,cF);var cI=(cE?cH:this.CRX_STRUCTURE_ID);if(!bh.illegalNames.hasOwnProperty(cG)){if(bQ[cI].hasOwnProperty(cG)){if(bQ[cI][cG]&cC){if((bQ[cI][cG]&cB)||(((bQ[cI][cG]&bM)||(bQ[cI][cG]&b2))&&(this===cF.CRX_PRIVATE_SEGMENTS[cH]))){if(bQ[cI][cG]&cD){return true;}}}}else{if(!cE&&(cD&bG)){if(this===cF.CRX_SHARED_SEGMENT){return(true&&(cC&cB)&&this.hasOwnProperty(cG));}else{if(this===cF.CRX_SHARED_PRIVATE_SEGMENT){return(true&&(((cC&bM)&&this.hasOwnProperty(cG))||((cC&cB)&&cF.CRX_SHARED_SEGMENT.hasOwnProperty(cG))));}else{if(this===cF.CRX_PRIVATE_SEGMENTS[cH]){return(true&&(((cC&b2)&&this.hasOwnProperty(cG))||((cC&bM)&&cF.CRX_SHARED_PRIVATE_SEGMENT.hasOwnProperty(cG))||((cC&cB)&&cF.CRX_SHARED_SEGMENT.hasOwnProperty(cG))));}}}}}}return false;}function bd(cC){return function(){cs=cC;};}function b9(cC,cE,cD){if(cC.hasOwnProperty("CRX_FUNCTION_ID")){x('UNKNOWN ERROR WHEN SIGNING CLASS FUNCTION IN CLASS "'+aZ(ac[cE])+'". IS FUNCTION ALREADY BOUND?');}u(cC,{"cf":{"classID":cE,"isStatic":(cD?true:false)}});}function bk(cG,cD,cF,cC){if(cG&&cG.CRX_FUNCTION_ID){var cE=a(cG);if((cE===null)||(!cE.cf)){return false;}else{cE=cE.cf;}if(cF){return(cE.isStatic&&((cE.classID===cD)||bn[cD].hasOwnProperty(cE.classID)));}else{if(cC){if(!cE.isStatic){return(cE.classID!==cD)&&bn[cD].hasOwnProperty(cE.classID);}else{return(cE.classID===cD)||bn[cD].hasOwnProperty(cE.classID);}}else{return(cE.classID===cD)||bn[cD].hasOwnProperty(cE.classID);}}}return false;}function u(cC,cD){if(cC.hasOwnProperty("CRX_FUNCTION_ID")){return false;}var cE=bd({"func":cC,"data":cD});if(cd){an.o.value=cE;Object.defineProperty(cC,"CRX_FUNCTION_ID",an.o);}else{cC["CRX_FUNCTION_ID"]=cE;}}function a(cC){if(!cC.CRX_FUNCTION_ID){return null;}var cD=null;cC.CRX_FUNCTION_ID();cD=cs;cs=null;if((cD===null)||(cD.func!==cC)){if((cD===null)||cC.hasOwnProperty("CRX_FUNCTION_ID")){x("SECURITY ERROR, ACCESS VIOLATION");}return false;}return cD.data;}function cw(cD){if(!E){return true;}var cC="Security Error, exposed method overriden";if(window.crx_new!==t){x(cC);return false;}else{if(window.crx_registerClass!==y){x(cC);return false;}else{if(window.crx_registerInterface!==bi){x(cC);return false;}else{if(window.crx_static!==e){x(cC);return false;}else{if(crxOop.setLogger!==cg){x(cC);return false;}else{if(crxOop.assertFunctionIdentity!==aG){x(cC);return false;}else{if(crxOop.assertIdentity!==cw){x(cC);return false;}else{if(crxOop.instanceOf!==aE){x(cC);return false;}else{if(crxOop.typeOf!==b3){x(cC);return false;}else{return true;}}}}}}}}}}function aG(cE,cD,cC){if(aT[aW(cE.THIS)][cD][cC]!==cE[cC]){x("Security Error, object's public method was overriden");return false;}}function x(cG,cF){var cD=null;if(!d){if(!h){V(S);V(aT);V(C);V(bX);V(aM);V(P);V(L);V(ad);for(var cC in ac){if(ac.hasOwnProperty(cC)){ac[cC]=null;}}V(ac);}d=true;cp=cG;}cD="CrxOop FATAL ERROR:: "+cp;if(!h){bU(cD,0);}if(!h){if(cF){if(cF===-1){try{throw new Error(cD);}catch(cE){ct(cE,cD);}}else{if(g){ct(cF,cD);}else{cD=ct(cF,cD);}}}}throw cD;}function V(cD){var cC=null;for(cC in cD){if(cD.hasOwnProperty(cC)){delete cD[cC];}}}function ci(cE,cD){for(var cC in cD){if(!cD.hasOwnProperty(cC)||cE.hasOwnProperty(cC)){continue;}cE[cC]=cD[cC];}}function an(cE,cD,cC){if(a9&&cd){an.o.value=cC;Object.defineProperty(cE,cD,an.o);}else{cE[cD]=cC;}}an.o={value:null,writable:false,enumerable:false};function ax(cG,cF,cC,cE){if(a9&&cd){an.o.value=cC;an.o.enumerable=(cE?true:false);for(var cD=cG.length-1;cD>-1;cD--){Object.defineProperty(cG[cD],cF,an.o);}}else{for(var cD=cG.length-1;cD>-1;cD--){cG[cD][cF]=cC;}}}function ba(cE,cD,cC){if(bB){ba.o.value=cC;Object.defineProperty(cE,cD,ba.o);}else{cE[cD]=cC;}}ba.o={value:null,writable:true};function aP(cF,cE,cC){if(bB){ba.o.value=cC;for(var cD=cF.length-1;cD>-1;cD--){Object.defineProperty(cF[cD],cE,ba.o);}}else{for(var cD=cF.length-1;cD>-1;cD--){cF[cD][cE]=cC;}}}function cg(cC){if(d||aV){return false;}au=cC;return true;}function bs(cC,cD){if(typeof(cC)==="function"){var cE=a(cC);if((cE===null)||(cE.bf&&cE.bf[0]!==null)){return cy(cC,null,false,true,-1,null);}else{return cC;}}else{return cC;}}function cy(cM,cH,cD,cP,cE,cL){if((typeof cM!=="function")||(Object.prototype.toString.call(cM)!=="[object Function]")){return null;}var cN=(cL?cL:[]);var cJ=cM;var cF=null;var cO=a(cM);var cK=null;var cG=true;if(cO&&cO.bf){cK=cO.bf;}if(cD&&(cK!==null)){if((cH===cK[0])&&(cP===cK[1])&&((cE?cE:0)===cK[2])&&((cL?cN:null)===cK[3])){cG=false;}}if(cG){if(cP){cF=function(){if(this instanceof cJ){var cQ=cM.apply(this,cN.concat(Array.prototype.slice.call(arguments)));if(Object(cQ)===cQ){return cQ;}else{return this;}}else{return cM.apply(((cH===-1)?this:cH),cN.concat(Array.prototype.slice.call(arguments)));}};}else{cF=function(){return cM.apply(((cH===-1)?this:cH),cN.concat(Array.prototype.slice.call(arguments)));};}if(cE){var cC=(((cE>0)&&(cE<11))?cE:Math.max(0,cM.length-cN.length));switch(cC){case 0:cJ=function(){return cF.apply(this,arguments);};case 1:cJ=function(cQ){return cF.apply(this,arguments);};case 2:cJ=function(cR,cQ){return cF.apply(this,arguments);};case 3:cJ=function(cR,cQ,cS){return cF.apply(this,arguments);};case 4:cJ=function(cR,cQ,cT,cS){return cF.apply(this,arguments);};case 5:cJ=function(cR,cQ,cU,cT,cS){return cF.apply(this,arguments);};case 6:cJ=function(cR,cQ,cV,cU,cT,cS){return cF.apply(this,arguments);};case 7:cJ=function(cR,cQ,cW,cV,cU,cT,cS){return cF.apply(this,arguments);};case 8:cJ=function(cR,cQ,cX,cW,cV,cU,cT,cS){return cF.apply(this,arguments);};case 9:cJ=function(cY,cX,cW,cV,cU,cT,cS,cR,cQ){return cF.apply(this,arguments);};case 10:cJ=function(cZ,cY,cX,cW,cV,cU,cT,cS,cR,cQ){return cF.apply(this,arguments);};default:cJ=function(){return cF.apply(this,arguments);};}}else{cJ=function(){return cF.apply(this,arguments);};}if(cP&&cM.prototype){var cI=function cI(){};cI.prototype=cM.prototype;cJ.prototype=new cI();cI.prototype=null;}if(cO){cO["bf"]=[cH,cP,(cE?cE:0),(cL?cN:null)];}else{u(cJ,{"bf":[cH,cP,(cE?cE:0),(cL?cN:null)]});}}return cJ;}function b8(){var cC=arguments[0];arguments[0]=function(){if(d){return;}cC();};if(arguments.length===1){return window.setTimeout(arguments[0]);}else{if(arguments.length===2){return window.setTimeout(arguments[0],arguments[1]);}else{return window.setTimeout.apply(window,arguments);}}}function aa(){var cD=arguments[0];var cC=-1;arguments[0]=function(){if(d){window.clearInterval(cC);return;}cD();};if(arguments.length===2){cC=window.setInterval(arguments[0],arguments[1]);}else{cC=window.setInterval.apply(window,arguments);}return cC;}an(ao,"HASOWN_TYPE_VAR",cz);an(ao,"HASOWN_TYPE_FUNCTION",W);an(ao,"HASOWN_TYPE_FOREIGN",bG);an(ao,"HASOWN_SCOPE_SHARED_PUBLIC",cB);an(ao,"HASOWN_SCOPE_SHARED_PRIVATE",bM);an(ao,"HASOWN_SCOPE_PRIVATE",b2);an(ao,"crx_new",t);an(ao,"crx_registerClass",y);an(ao,"crx_registerInterface",bi);an(ao,"crx_registerStructure",bz);an(ao,"crx_static",((J||aX)?e:b0));an(ao,"setLogger",cg);an(ao,"isAnnul",a7);an(ao,"instanceOf",aE);an(ao,"typeOf",b3);an(ao,"isClassExtending",function(cD,cC){return B(cD,cC,false);});an(ao,"isClassChaining",function(cD,cC){return B(cD,cC,true);});an(ao,"isClassImplementing",az);an(ao,"isClassRegistered",bH);an(ao,"getObjectClassName",function(cD){if(!cD.CRX_CLASS_INFO||!cD.THIS){return null;}var cC=aW(cD.THIS);if(cC&&ac.hasOwnProperty(cC)&&ac[cC].CRX_CLASS_NAME&&S.hasOwnProperty(ac[cC].CRX_CLASS_NAME)){return ac[cC].CRX_CLASS_NAME;}return null;});an(ao,"isInterfaceRegistered",aB);an(ao,"isStructureInheriting",function(cD,cC){return p(cD,cC,false);});an(ao,"isStructureContaining",function(cD,cC){return p(cD,cC,true);});an(ao,"isStructureRegistered",bt);an(ao,"getObjectStructureName",function(cD){if(!cD.CRX_STRUCTURE_INFO){return null;}var cC=c(cD,a8(cD));if(cC&&ca.hasOwnProperty(cC)&&ca[cC].CRX_STRUCTURE_NAME&&by.hasOwnProperty(ca[cC].CRX_STRUCTURE_NAME)){return ca[cC].CRX_STRUCTURE_NAME;}return null;});an(ao,"getObjectStructureNames",function(cG){if(!cG.CRX_STRUCTURE_INFO){return null;}var cE=null;var cF=(cG.CRX_STRUCTURE_ID||null);a8(cG);if(cF){var cC=(bT[cG.CRX_STRUCTURE_ID]||null);if(cC){cE={};for(var cD=0;cD<cC.SHARED_LIST.length;cD++){if(ca[cC.SHARED_LIST[cD]].CRX_STRUCTURE_NAME&&by.hasOwnProperty(ca[cC.SHARED_LIST[cD]].CRX_STRUCTURE_NAME)){cE[ca[cC.SHARED_LIST[cD]].CRX_STRUCTURE_NAME]=true;}else{cE=null;break;}}}}return cE;});an(ao,"areStaticFunctionsSupported",function(){return(!J||aX);});an(ao,"isUsingNewStaticFunctionsSyntax",function(){return aX;});an(ao,"createObject",a2);an(ao,"setStrictMode",function(cC){if(aV){return;}a9=cC;});an(ao,"areStructuresLocked",function(){return cd&&Object.seal&&cc&&a9;});an(ao,"areConstantsLocked",function(){return ao.areStructuresLocked()||bI;});an(ao,"var",bs);an(ao,"bindFunction",cy);an(ao,"setTimeout",b8);an(ao,"setInterval",aa);an(ao,"nativeTypeOf",ak);an(ao,"setRunningTestCasesMode",function(cC){if(aV){return;}if(cC){h=true;}});an(ao,"unHalt",function(cC){if(h){if(!d){x("UNHALTING WHEN NOT HALTED: "+cC);}d=false;}});if(E){an(E,"crxOop",ao);an(E,"crx_new",t);an(E,"crx_registerClass",y);an(E,"crx_registerInterface",bi);an(E,"crx_registerStructure",bz);an(E,"crx_static",((J||aX)?e:b0));}try{throw new Error("CrxOop::end");}catch(aO){ct(aO);}})(); | 3,030.714286 | 83,334 | 0.699882 |
9962b5c13125c7cb631ee09afc3f2116a3be0d7b | 2,527 | js | JavaScript | components/menu/IconMenu.js | justinrainbow/react-toolbox | 0d21c02068aa1396ee2262f6427bf40166a0c164 | [
"MIT"
] | 2 | 2016-06-21T23:45:11.000Z | 2016-11-18T15:09:39.000Z | components/menu/IconMenu.js | justinrainbow/react-toolbox | 0d21c02068aa1396ee2262f6427bf40166a0c164 | [
"MIT"
] | 2 | 2020-04-17T16:03:00.000Z | 2020-04-17T17:49:27.000Z | components/menu/IconMenu.js | justinrainbow/react-toolbox | 0d21c02068aa1396ee2262f6427bf40166a0c164 | [
"MIT"
] | 1 | 2016-07-05T08:14:25.000Z | 2016-07-05T08:14:25.000Z | import React, { Component, PropTypes } from 'react';
import classnames from 'classnames';
import { themr } from 'react-css-themr';
import { MENU } from '../identifiers';
import InjectIconButton from '../button/IconButton';
import InjectMenu from './Menu';
const factory = (IconButton, Menu) => {
class IconMenu extends Component {
static propTypes = {
children: PropTypes.node,
className: PropTypes.string,
icon: PropTypes.oneOfType([
PropTypes.string,
PropTypes.element,
]),
iconRipple: PropTypes.bool,
menuRipple: PropTypes.bool,
onClick: PropTypes.func,
onHide: PropTypes.func,
onSelect: PropTypes.func,
onShow: PropTypes.func,
position: PropTypes.string,
selectable: PropTypes.bool,
selected: PropTypes.node,
theme: PropTypes.shape({
icon: PropTypes.string,
iconMenu: PropTypes.string,
}),
};
static defaultProps = {
className: '',
icon: 'more_vert',
iconRipple: true,
menuRipple: true,
position: 'auto',
selectable: false,
};
state = {
active: false,
}
handleButtonClick = (event) => {
this.setState({ active: !this.state.active });
if (this.props.onClick) this.props.onClick(event);
};
handleMenuHide = () => {
this.setState({ active: false });
if (this.props.onHide) this.props.onHide();
}
render() {
const {
children, className, icon, iconRipple, inverse, menuRipple, onHide, // eslint-disable-line
onSelect, onShow, position, selectable, selected, theme, ...other
} = this.props;
return (
<div {...other} className={classnames(theme.iconMenu, className)}>
<IconButton
className={theme.icon}
icon={icon}
inverse={inverse}
onClick={this.handleButtonClick}
ripple={iconRipple}
/>
<Menu
active={this.state.active}
onHide={this.handleMenuHide}
onSelect={onSelect}
onShow={onShow}
position={position}
ripple={menuRipple}
selectable={selectable}
selected={selected}
theme={theme}
>
{children}
</Menu>
</div>
);
}
}
return IconMenu;
};
const IconMenu = factory(InjectIconButton, InjectMenu);
export default themr(MENU)(IconMenu);
export { factory as iconMenuFactory };
export { IconMenu };
| 26.882979 | 98 | 0.584092 |
9962cb520026ef725d4bdb5c872a3b2de1591c1d | 1,177 | js | JavaScript | razorchess-react/src/components/Piece/SmartPiece.js | tlewis11/razorchess | f362667ff4b2e867b05ef1f52d5f9921b0f7ad86 | [
"Apache-2.0"
] | 1 | 2016-06-02T17:54:55.000Z | 2016-06-02T17:54:55.000Z | razorchess-react/src/components/Piece/SmartPiece.js | blank-blank/razorchess | f362667ff4b2e867b05ef1f52d5f9921b0f7ad86 | [
"Apache-2.0"
] | 13 | 2016-05-24T01:52:28.000Z | 2016-07-15T20:10:06.000Z | razorchess-react/src/components/Piece/SmartPiece.js | tlewis11/razorchess | f362667ff4b2e867b05ef1f52d5f9921b0f7ad86 | [
"Apache-2.0"
] | 1 | 2017-04-28T02:04:12.000Z | 2017-04-28T02:04:12.000Z | import React, { Component, PropTypes } from 'react';
import { DragSource } from 'react-dnd';
import { SQUARES, PIECES, DND_TYPES } from '../../utils/constants/constants';
import DumbPiece from './DumbPiece';
const pieceSource = {
canDrag(props) {
return props.dnd && props.canMove;
},
beginDrag(props) {
return {
from: props.square,
piece: props.name
};
}
};
function collect(connect, monitor) {
return {
isDragging: monitor.isDragging(),
connectDragSource: connect.dragSource()
};
}
@DragSource(DND_TYPES.PIECE, pieceSource, collect)
export default class SmartPiece extends Component {
static propTypes = {
dnd: PropTypes.bool.isRequired,
canMove: PropTypes.bool.isRequired,
square: PropTypes.oneOf(SQUARES).isRequired,
connectDragSource: PropTypes.func.isRequired,
name: PropTypes.oneOf(PIECES).isRequired,
isDragging: PropTypes.bool.isRequired
};
constructor(props) {
super(props);
}
render() {
const { connectDragSource, name, canMove, isDragging } = this.props;
return connectDragSource(
<DumbPiece name={name} canMove={canMove} isDragging={isDragging} />
);
}
}
| 24.020408 | 77 | 0.685641 |
99638ccee2e70c58e79c320966c76bfe3eaf2134 | 6,499 | js | JavaScript | src/commands/Admin/settings.js | AstolfoDev/Astolfo-Eris | 2a6ce783a90d6b765cce98d82ab05e66c64c7ce1 | [
"MIT"
] | 2 | 2020-06-24T16:02:51.000Z | 2020-09-12T09:32:52.000Z | src/commands/Admin/settings.js | AstolfoDev/Astolfo-Eris | 2a6ce783a90d6b765cce98d82ab05e66c64c7ce1 | [
"MIT"
] | 1 | 2021-09-02T13:06:25.000Z | 2021-09-02T13:06:25.000Z | src/commands/Admin/settings.js | AstolfoDev/Astolfo-Eris | 2a6ce783a90d6b765cce98d82ab05e66c64c7ce1 | [
"MIT"
] | null | null | null | module.exports.run = async (client, message, args) => {
const db = require("betterqdb");
const guildData = new db.table("guild");
let fail = async () => {
message.channel.createMessage({
embed: {
title: "**hey heY hEEeEeYyY**",
thumbnail: { url: client.user.avatarURL },
author: { name: message.author.tag, icon_url: message.author.avatarURL },
footer: { text: "Astolfo.js", icon_url: client.user.avatarURL },
color: 0xde1073,
description: `${errorMsg}\n\nSyntax: /config [view/set/remove/reset] <setting> (new value) (additional flags)`
}
});
};
let success = async () => {
message.channel.createMessage({
embed: {
title: "**oooOooOoOoh!**",
thumbnail: { url: client.user.avatarURL },
author: { name: message.author.tag, icon_url: message.author.avatarURL },
footer: { text: "Astolfo.js", icon_url: client.user.avatarURL },
color: 0xde1073,
description: `${result}`
}
});
}
var errorMsg;
if (!message.member.hasPermission("manageGuild")) {
errorMsg = `u dont haz da permissions for this command!!!1!!`;
return fail();
};
var command = args[0];
var setting = args[1];
var settings = ["levelling"];
if (!command && setting) {
errorMsg = `u need to specify the action u want to make! (view, set, remove or reset)`;
return fail();
};
if (!command && !setting) {
errorMsg = `available settings:\n
**levelling**: <level> <roleID>\n*Give a user a role when they reach a level on your server.*`;
return fail();
}
if (command != "view" && command != "set" && command != "remove" && command != "reset") {
errorMsg = `"${command}" is not a valid action! u must pick either "view", "set", "remove" or "reset"!!!`;
return fail();
};
if (!setting) {
errorMsg = `u need to specify the setting you want to ${command}!!`
};
if (!settings.includes(setting)) {
errorMsg = `"${setting}" is not a valid setting! do \`/settings\` to view all settings and their flags!`;
return fail();
};
var settingInfo = guildData.get(`u${message.channel.guild.id}.${setting}`);
var result;
if (command == "view") {
if (!settingInfo || !settingInfo.levels) {
result = `**Setting:** ${setting}\n**Flags:** None set`;
return success();
}
else {
if (setting == "levelling") {
var levels = settingInfo.levels;
var levelInfo = [];
var levelName;
result = "";
levels.sort(function(a, b){return b-a});
for (let i=0;i<levels.length;i++) {
levelName = guildData.get(`u${message.channel.guild.id}.levelling.level.${levels[i]}`);
levelInfo[i] = { number: levels[i], id: levelName };
result = `${result}Level ${levelInfo[i].number}:\n<@&${levelInfo[i].id}>\n\n`
}
return success();
}
}
}
if (command == "set") {
if (setting == "levelling") {
var levelSet = args[2];
var roleSet = args[3];
if (!levelSet) {
errorMsg = `u must specify the level u want to set the role for!`;
return fail();
}
else if (isNaN(parseInt(levelSet))) {
errorMsg = `"${levelSet}" is not a valid number!`;
return fail();
}
else if (parseInt(levelSet) > 100 || parseInt(levelSet) < 1) {
errorMsg = `u may only apply roles to levels between 1 and 100, to exceed this join the \`/support\` server and contact "agent".`;
return fail();
};
levelSet = Math.floor(parseInt(levelSet));
if (!roleSet) {
errorMsg = `u must give a role ID for me to use!`;
return fail();
}
else if (isNaN(parseInt(roleSet))) {
errorMsg = `role IDs must be numbers!`;
return fail();
};
var roleGet = await message.guild.roles.get(roleSet);
if (!roleGet) {
errorMsg = `invalid role ID! no role with that ID exists on this server!`;
return fail();
}
var guildInfo = guildData.get(`u${message.channel.guild.id}.levelling`);
var levels = guildData.get(`u${message.channel.guild.id}.levelling.levels`);
if (levels == null) {
levels = ["bruh","bruh2"];
}
if (!guildInfo.levels) {
guildInfo = { levels: ["bruh","bruh2"] };
}
if (!guildInfo.levels.includes(parseInt(levelSet))) {
guildData.push(`u${message.channel.guild.id}.levelling.levels`, levelSet);
}
guildData.set(`u${message.channel.guild.id}.levelling.level.${levelSet}`, roleSet);
result = `role for level ${levelSet} set to ${roleSet}`;
return success();
}
}
if (command == "remove") {
if (setting == "levelling") {
var levelSet = args[2];
if (!levelSet) {
errorMsg = `u must specify the level u want to remove the role for!`;
return fail();
}
else if (isNaN(parseInt(levelSet))) {
errorMsg = `"${levelSet}" is not a valid number!`;
return fail();
}
else if (parseInt(Math.floor(levelSet)) > 100 || parseInt(levelSet) < 1) {
errorMsg = `u may only delete roles that have levels between 1 and 100, to exceed this join the \`/support\` server and contact "agent".`;
return fail();
}
levelSet = Math.floor(parseInt(levelSet))
var bruh1 = guildData.get(`u${message.channel.guild.id}.levelling.level.${levelSet}`);
if (!bruh1) {
errorMsg = `there is no role set for level ${levelSet}!`;
return fail();
}
var data = guildData.get(`u${message.channel.guild.id}.levelling`);
var removeIndex = data.levels.indexOf(levelSet);
var removeArray = data.levels;
console.log(removeArray)
console.log(removeIndex)
removeArray = removeArray.filter(item => item !== levelSet)
console.log(removeArray)
guildData.delete(`u${message.channel.guild.id}.levelling.levels`);
guildData.delete(`u${message.channel.guild.id}.levelling.level.${levelSet}`);
for (element of removeArray) {
guildData.push(`u${message.channel.guild.id}.levelling.levels`, element);
};
result = `removed the setting for level ${levelSet}`
return success();
}
}
};
module.exports.config = {
name: "settings",
aliases: ["setting","config"],
descriprion: "Server configuartion"
}; | 33.328205 | 146 | 0.577627 |